From 006827f10462505382c0cd6a4169f6d7ef757dab Mon Sep 17 00:00:00 2001 From: Squall <2573040560@qq.com> Date: Mon, 27 Nov 2023 22:04:03 +0800 Subject: [PATCH] percent --- packages/client/assets/main/index.js | 14 ++++++++++---- .../assets/{ccip-3995c446.js => ccip-abf0a7d9.js} | 4 ++-- .../{ccip-3995c446.js.map => ccip-abf0a7d9.js.map} | 2 +- .../{index-7b9cb951.js => index-58a95187.js} | 6 +++--- ...index-7b9cb951.js.map => index-58a95187.js.map} | 2 +- .../{index-a13e0f4b.js => index-c7ee7ff5.js} | 4 ++-- ...index-a13e0f4b.js.map => index-c7ee7ff5.js.map} | 2 +- packages/client/dist/index.html | 2 +- packages/client/src/index.ts | 2 +- 9 files changed, 22 insertions(+), 16 deletions(-) rename packages/client/dist/assets/{ccip-3995c446.js => ccip-abf0a7d9.js} (96%) rename packages/client/dist/assets/{ccip-3995c446.js.map => ccip-abf0a7d9.js.map} (99%) rename packages/client/dist/assets/{index-7b9cb951.js => index-58a95187.js} (99%) rename packages/client/dist/assets/{index-7b9cb951.js.map => index-58a95187.js.map} (73%) rename packages/client/dist/assets/{index-a13e0f4b.js => index-c7ee7ff5.js} (99%) rename packages/client/dist/assets/{index-a13e0f4b.js.map => index-c7ee7ff5.js.map} (99%) diff --git a/packages/client/assets/main/index.js b/packages/client/assets/main/index.js index f1c6423..59d7aa0 100644 --- a/packages/client/assets/main/index.js +++ b/packages/client/assets/main/index.js @@ -2720,7 +2720,11 @@ System.register("chunks:///_virtual/loading.ts", ['./rollupPluginModLoBabelHelpe this.progressBar.progress = 0; } - ponzi_controller.instance.on(ccc_msg.update_loading_percentage, this.setProgress.bind(this)); + var self = this; + ponzi_controller.instance.on(ccc_msg.update_loading_percentage, function (_ref) { + var percent = _ref.percent; + self.setProgress(percent); + }); } // 外界传入百分比,并更新进度条 ; @@ -6289,9 +6293,11 @@ System.register("chunks:///_virtual/ponzi-controller.ts", ['./rollupPluginModLoB }; _proto.onSyncProgressUpdate = function onSyncProgressUpdate(values) { - console.error("onSyncProgressUpdate:", values); - var percentage = values.percentage; - ponzi_controller.instance.sendCCCMsg(ccc_msg.update_loading_percentage, percentage); // if(percentage >= 1){ + console.log("onSyncProgressUpdate:", values); + var percent = values.percentage; + ponzi_controller.instance.sendCCCMsg(ccc_msg.update_loading_percentage, { + percent: percent + }); // if(percentage >= 1){ // } }; diff --git a/packages/client/dist/assets/ccip-3995c446.js b/packages/client/dist/assets/ccip-abf0a7d9.js similarity index 96% rename from packages/client/dist/assets/ccip-3995c446.js rename to packages/client/dist/assets/ccip-abf0a7d9.js index 4c756e6..acce681 100644 --- a/packages/client/dist/assets/ccip-3995c446.js +++ b/packages/client/dist/assets/ccip-abf0a7d9.js @@ -1,2 +1,2 @@ -import{B as l,g as w,s as y,i as p,I as h,d as g,a as k,b as O,e as L,H as m,f as E}from"./index-7b9cb951.js";class x extends l{constructor({callbackSelector:e,cause:a,data:o,extraData:c,sender:s,urls:n}){super(a.shortMessage||"An error occurred while fetching for an offchain result.",{cause:a,metaMessages:[...a.metaMessages||[],a.metaMessages?.length?"":[],"Offchain Gateway Call:",n&&[" Gateway URL(s):",...n.map(d=>` ${w(d)}`)],` Sender: ${s}`,` Data: ${o}`,` Callback selector: ${e}`,` Extra data: ${c}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class M extends l{constructor({result:e,url:a}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${w(a)}`,`Response: ${y(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class R extends l{constructor({sender:e,to:a}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${a}`,`OffchainLookup sender address: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}function $(t,e){if(!p(t))throw new h({address:t});if(!p(e))throw new h({address:e});return t.toLowerCase()===e.toLowerCase()}const C="0x556f1830",S={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function P(t,{blockNumber:e,blockTag:a,data:o,to:c}){const{args:s}=g({data:o,abi:[S]}),[n,d,r,i,f]=s;try{if(!$(c,n))throw new R({sender:n,to:c});const u=await A({data:r,sender:n,urls:d}),{data:b}=await k(t,{blockNumber:e,blockTag:a,data:O([i,L([{type:"bytes"},{type:"bytes"}],[u,f])]),to:c});return b}catch(u){throw new x({callbackSelector:i,cause:u,data:o,extraData:f,sender:n,urls:d})}}async function A({data:t,sender:e,urls:a}){let o=new Error("An unknown error occurred.");for(let c=0;c` ${w(d)}`)],` Sender: ${s}`,` Data: ${o}`,` Callback selector: ${e}`,` Extra data: ${c}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class M extends l{constructor({result:e,url:a}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${w(a)}`,`Response: ${y(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class R extends l{constructor({sender:e,to:a}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${a}`,`OffchainLookup sender address: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}function $(t,e){if(!p(t))throw new h({address:t});if(!p(e))throw new h({address:e});return t.toLowerCase()===e.toLowerCase()}const C="0x556f1830",S={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function P(t,{blockNumber:e,blockTag:a,data:o,to:c}){const{args:s}=g({data:o,abi:[S]}),[n,d,r,i,f]=s;try{if(!$(c,n))throw new R({sender:n,to:c});const u=await A({data:r,sender:n,urls:d}),{data:b}=await k(t,{blockNumber:e,blockTag:a,data:O([i,L([{type:"bytes"},{type:"bytes"}],[u,f])]),to:c});return b}catch(u){throw new x({callbackSelector:i,cause:u,data:o,extraData:f,sender:n,urls:d})}}async function A({data:t,sender:e,urls:a}){let o=new Error("An unknown error occurred.");for(let c=0;c ` ${getUrl(url)}`),\n ],\n ` Sender: ${sender}`,\n ` Data: ${data}`,\n ` Callback selector: ${callbackSelector}`,\n ` Extra data: ${extraData}`,\n ].flat(),\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'OffchainLookupError'\n });\n }\n}\nexport class OffchainLookupResponseMalformedError extends BaseError {\n constructor({ result, url }) {\n super('Offchain gateway response is malformed. Response data must be a hex value.', {\n metaMessages: [\n `Gateway URL: ${getUrl(url)}`,\n `Response: ${stringify(result)}`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'OffchainLookupResponseMalformedError'\n });\n }\n}\nexport class OffchainLookupSenderMismatchError extends BaseError {\n constructor({ sender, to }) {\n super('Reverted sender address does not match target contract address (`to`).', {\n metaMessages: [\n `Contract address: ${to}`,\n `OffchainLookup sender address: ${sender}`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'OffchainLookupSenderMismatchError'\n });\n }\n}\n//# sourceMappingURL=ccip.js.map","import { InvalidAddressError } from '../../errors/address.js';\nimport { isAddress } from './isAddress.js';\nexport function isAddressEqual(a, b) {\n if (!isAddress(a))\n throw new InvalidAddressError({ address: a });\n if (!isAddress(b))\n throw new InvalidAddressError({ address: b });\n return a.toLowerCase() === b.toLowerCase();\n}\n//# sourceMappingURL=isAddressEqual.js.map","import { call } from '../actions/public/call.js';\nimport {} from '../errors/base.js';\nimport { OffchainLookupError, OffchainLookupResponseMalformedError, OffchainLookupSenderMismatchError, } from '../errors/ccip.js';\nimport { HttpRequestError } from '../errors/request.js';\nimport { decodeErrorResult } from './abi/decodeErrorResult.js';\nimport { encodeAbiParameters } from './abi/encodeAbiParameters.js';\nimport { isAddressEqual } from './address/isAddressEqual.js';\nimport { concat } from './data/concat.js';\nimport { isHex } from './data/isHex.js';\nimport { stringify } from './stringify.js';\nexport const offchainLookupSignature = '0x556f1830';\nexport const offchainLookupAbiItem = {\n name: 'OffchainLookup',\n type: 'error',\n inputs: [\n {\n name: 'sender',\n type: 'address',\n },\n {\n name: 'urls',\n type: 'string[]',\n },\n {\n name: 'callData',\n type: 'bytes',\n },\n {\n name: 'callbackFunction',\n type: 'bytes4',\n },\n {\n name: 'extraData',\n type: 'bytes',\n },\n ],\n};\nexport async function offchainLookup(client, { blockNumber, blockTag, data, to, }) {\n const { args } = decodeErrorResult({\n data,\n abi: [offchainLookupAbiItem],\n });\n const [sender, urls, callData, callbackSelector, extraData] = args;\n try {\n if (!isAddressEqual(to, sender))\n throw new OffchainLookupSenderMismatchError({ sender, to });\n const result = await ccipFetch({ data: callData, sender, urls });\n const { data: data_ } = await call(client, {\n blockNumber,\n blockTag,\n data: concat([\n callbackSelector,\n encodeAbiParameters([{ type: 'bytes' }, { type: 'bytes' }], [result, extraData]),\n ]),\n to,\n });\n return data_;\n }\n catch (err) {\n throw new OffchainLookupError({\n callbackSelector,\n cause: err,\n data,\n extraData,\n sender,\n urls,\n });\n }\n}\nexport async function ccipFetch({ data, sender, urls, }) {\n let error = new Error('An unknown error occurred.');\n for (let i = 0; i < urls.length; i++) {\n const url = urls[i];\n const method = url.includes('{sender}') || url.includes('{data}') ? 'GET' : 'POST';\n const body = method === 'POST' ? { data, sender } : undefined;\n try {\n const response = await fetch(url.replace('{sender}', sender).replace('{data}', data), {\n body: JSON.stringify(body),\n method,\n });\n let result;\n if (response.headers.get('Content-Type')?.startsWith('application/json')) {\n result = (await response.json()).data;\n }\n else {\n result = (await response.text());\n }\n if (!response.ok) {\n error = new HttpRequestError({\n body,\n details: stringify(result.error) || response.statusText,\n headers: response.headers,\n status: response.status,\n url,\n });\n continue;\n }\n if (!isHex(result)) {\n error = new OffchainLookupResponseMalformedError({\n result,\n url,\n });\n continue;\n }\n return result;\n }\n catch (err) {\n error = new HttpRequestError({\n body,\n details: err.message,\n url,\n });\n }\n }\n throw error;\n}\n//# sourceMappingURL=ccip.js.map"],"names":["OffchainLookupError","BaseError","callbackSelector","cause","data","extraData","sender","urls","url","getUrl","OffchainLookupResponseMalformedError","result","stringify","OffchainLookupSenderMismatchError","to","isAddressEqual","a","b","isAddress","InvalidAddressError","offchainLookupSignature","offchainLookupAbiItem","offchainLookup","client","blockNumber","blockTag","args","decodeErrorResult","callData","ccipFetch","data_","call","concat","encodeAbiParameters","err","error","i","method","body","response","HttpRequestError","isHex"],"mappings":"8GAGO,MAAMA,UAA4BC,CAAU,CAC/C,YAAY,CAAE,iBAAAC,EAAkB,MAAAC,EAAO,KAAAC,EAAM,UAAAC,EAAW,OAAAC,EAAQ,KAAAC,GAAS,CACrE,MAAMJ,EAAM,cACR,2DAA4D,CAC5D,MAAAA,EACA,aAAc,CACV,GAAIA,EAAM,cAAgB,GAC1BA,EAAM,cAAc,OAAS,GAAK,CAAE,EACpC,yBACAI,GAAQ,CACJ,oBACA,GAAGA,EAAK,IAAKC,GAAQ,OAAOC,EAAOD,CAAG,GAAG,CAC5C,EACD,aAAaF,IACb,WAAWF,IACX,wBAAwBF,IACxB,iBAAiBG,GACpB,EAAC,KAAM,CACpB,CAAS,EACD,OAAO,eAAe,KAAM,OAAQ,CAChC,WAAY,GACZ,aAAc,GACd,SAAU,GACV,MAAO,qBACnB,CAAS,CACJ,CACL,CACO,MAAMK,UAA6CT,CAAU,CAChE,YAAY,CAAE,OAAAU,EAAQ,IAAAH,GAAO,CACzB,MAAM,6EAA8E,CAChF,aAAc,CACV,gBAAgBC,EAAOD,CAAG,IAC1B,aAAaI,EAAUD,CAAM,G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4B,EAAS,WAC7C,QAASA,EAAS,QAClB,OAAQA,EAAS,OACjB,IAAA/B,CACpB,CAAiB,EACD,SAEJ,GAAI,CAACiC,EAAM9B,CAAM,EAAG,CAChBwB,EAAQ,IAAIzB,EAAqC,CAC7C,OAAAC,EACA,IAAAH,CACpB,CAAiB,EACD,SAEJ,OAAOG,CACV,OACMuB,EAAP,CACIC,EAAQ,IAAIK,EAAiB,CACzB,KAAAF,EACA,QAASJ,EAAI,QACb,IAAA1B,CAChB,CAAa,CACJ,EAEL,MAAM2B,CACV","x_google_ignoreList":[0,1,2]} \ No newline at end of file +{"version":3,"file":"ccip-abf0a7d9.js","sources":["../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/errors/ccip.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/address/isAddressEqual.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/ccip.js"],"sourcesContent":["import { stringify } from '../utils/stringify.js';\nimport { BaseError } from './base.js';\nimport { getUrl } from './utils.js';\nexport class OffchainLookupError extends BaseError {\n constructor({ callbackSelector, cause, data, extraData, sender, urls, }) {\n super(cause.shortMessage ||\n 'An error occurred while fetching for an offchain result.', {\n cause,\n metaMessages: [\n ...(cause.metaMessages || []),\n cause.metaMessages?.length ? '' : [],\n 'Offchain Gateway Call:',\n urls && [\n ' Gateway URL(s):',\n ...urls.map((url) => ` ${getUrl(url)}`),\n ],\n ` Sender: ${sender}`,\n ` Data: ${data}`,\n ` Callback selector: ${callbackSelector}`,\n ` Extra data: ${extraData}`,\n ].flat(),\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'OffchainLookupError'\n });\n }\n}\nexport class OffchainLookupResponseMalformedError extends BaseError {\n constructor({ result, url }) {\n super('Offchain gateway response is malformed. Response data must be a hex value.', {\n metaMessages: [\n `Gateway URL: ${getUrl(url)}`,\n `Response: ${stringify(result)}`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'OffchainLookupResponseMalformedError'\n });\n }\n}\nexport class OffchainLookupSenderMismatchError extends BaseError {\n constructor({ sender, to }) {\n super('Reverted sender address does not match target contract address (`to`).', {\n metaMessages: [\n `Contract address: ${to}`,\n `OffchainLookup sender address: ${sender}`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'OffchainLookupSenderMismatchError'\n });\n }\n}\n//# sourceMappingURL=ccip.js.map","import { InvalidAddressError } from '../../errors/address.js';\nimport { isAddress } from './isAddress.js';\nexport function isAddressEqual(a, b) {\n if (!isAddress(a))\n throw new InvalidAddressError({ address: a });\n if (!isAddress(b))\n throw new InvalidAddressError({ address: b });\n return a.toLowerCase() === b.toLowerCase();\n}\n//# sourceMappingURL=isAddressEqual.js.map","import { call } from '../actions/public/call.js';\nimport {} from '../errors/base.js';\nimport { OffchainLookupError, OffchainLookupResponseMalformedError, OffchainLookupSenderMismatchError, } from '../errors/ccip.js';\nimport { HttpRequestError } from '../errors/request.js';\nimport { decodeErrorResult } from './abi/decodeErrorResult.js';\nimport { encodeAbiParameters } from './abi/encodeAbiParameters.js';\nimport { isAddressEqual } from './address/isAddressEqual.js';\nimport { concat } from './data/concat.js';\nimport { isHex } from './data/isHex.js';\nimport { stringify } from './stringify.js';\nexport const offchainLookupSignature = '0x556f1830';\nexport const offchainLookupAbiItem = {\n name: 'OffchainLookup',\n type: 'error',\n inputs: [\n {\n name: 'sender',\n type: 'address',\n },\n {\n name: 'urls',\n type: 'string[]',\n },\n {\n name: 'callData',\n type: 'bytes',\n },\n {\n name: 'callbackFunction',\n type: 'bytes4',\n },\n {\n name: 'extraData',\n type: 'bytes',\n },\n ],\n};\nexport async function offchainLookup(client, { blockNumber, blockTag, data, to, }) {\n const { args } = decodeErrorResult({\n data,\n abi: [offchainLookupAbiItem],\n });\n const [sender, urls, callData, callbackSelector, extraData] = args;\n try {\n if (!isAddressEqual(to, sender))\n throw new OffchainLookupSenderMismatchError({ sender, to });\n const result = await ccipFetch({ data: callData, sender, urls });\n const { data: data_ } = await call(client, {\n blockNumber,\n blockTag,\n data: concat([\n callbackSelector,\n encodeAbiParameters([{ type: 'bytes' }, { type: 'bytes' }], [result, extraData]),\n ]),\n to,\n });\n return data_;\n }\n catch (err) {\n throw new OffchainLookupError({\n callbackSelector,\n cause: err,\n data,\n extraData,\n sender,\n urls,\n });\n }\n}\nexport async function ccipFetch({ data, sender, urls, }) {\n let error = new Error('An unknown error occurred.');\n for (let i = 0; i < urls.length; i++) {\n const url = urls[i];\n const method = url.includes('{sender}') || url.includes('{data}') ? 'GET' : 'POST';\n const body = method === 'POST' ? { data, sender } : undefined;\n try {\n const response = await fetch(url.replace('{sender}', sender).replace('{data}', data), {\n body: JSON.stringify(body),\n method,\n });\n let result;\n if (response.headers.get('Content-Type')?.startsWith('application/json')) {\n result = (await response.json()).data;\n }\n else {\n result = (await response.text());\n }\n if (!response.ok) {\n error = new HttpRequestError({\n body,\n details: stringify(result.error) || response.statusText,\n headers: response.headers,\n status: response.status,\n url,\n });\n continue;\n }\n if (!isHex(result)) {\n error = new OffchainLookupResponseMalformedError({\n result,\n url,\n });\n continue;\n }\n return result;\n }\n catch (err) {\n error = new HttpRequestError({\n body,\n details: err.message,\n url,\n });\n }\n }\n throw error;\n}\n//# sourceMappingURL=ccip.js.map"],"names":["OffchainLookupError","BaseError","callbackSelector","cause","data","extraData","sender","urls","url","getUrl","OffchainLookupResponseMalformedError","result","stringify","OffchainLookupSenderMismatchError","to","isAddressEqual","a","b","isAddress","InvalidAddressError","offchainLookupSignature","offchainLookupAbiItem","offchainLookup","client","blockNumber","blockTag","args","decodeErrorResult","callData","ccipFetch","data_","call","concat","encodeAbiParameters","err","error","i","method","body","response","HttpRequestError","isHex"],"mappings":"8GAGO,MAAMA,UAA4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Q,IAAI,MAAM,4BAA4B,EAClD,QAASC,EAAI,EAAGA,EAAI7B,EAAK,OAAQ6B,IAAK,CAClC,MAAM5B,EAAMD,EAAK6B,CAAC,EACZC,EAAS7B,EAAI,SAAS,UAAU,GAAKA,EAAI,SAAS,QAAQ,EAAI,MAAQ,OACtE8B,EAAOD,IAAW,OAAS,CAAE,KAAAjC,EAAM,OAAAE,CAAQ,EAAG,OACpD,GAAI,CACA,MAAMiC,EAAW,MAAM,MAAM/B,EAAI,QAAQ,WAAYF,CAAM,EAAE,QAAQ,SAAUF,CAAI,EAAG,CAClF,KAAM,KAAK,UAAUkC,CAAI,EACzB,OAAAD,CAChB,CAAa,EACD,IAAI1B,EAOJ,GANI4B,EAAS,QAAQ,IAAI,cAAc,GAAG,WAAW,kBAAkB,EACnE5B,GAAU,MAAM4B,EAAS,KAAI,GAAI,KAGjC5B,EAAU,MAAM4B,EAAS,KAAI,EAE7B,CAACA,EAAS,GAAI,CACdJ,EAAQ,IAAIK,EAAiB,CACzB,KAAAF,EACA,QAAS1B,EAAUD,EAAO,KAAK,GAAK4B,EAAS,WAC7C,QAASA,EAAS,QAClB,OAAQA,EAAS,OACjB,IAAA/B,CACpB,CAAiB,EACD,SAEJ,GAAI,CAACiC,EAAM9B,CAAM,EAAG,CAChBwB,EAAQ,IAAIzB,EAAqC,CAC7C,OAAAC,EACA,IAAAH,CACpB,CAAiB,EACD,SAEJ,OAAOG,CACV,OACMuB,EAAP,CACIC,EAAQ,IAAIK,EAAiB,CACzB,KAAAF,EACA,QAASJ,EAAI,QACb,IAAA1B,CAChB,CAAa,CACJ,EAEL,MAAM2B,CACV","x_google_ignoreList":[0,1,2]} \ No newline at end of file diff --git a/packages/client/dist/assets/index-7b9cb951.js b/packages/client/dist/assets/index-58a95187.js similarity index 99% rename from packages/client/dist/assets/index-7b9cb951.js rename to packages/client/dist/assets/index-58a95187.js index 0610278..14cb019 100644 --- a/packages/client/dist/assets/index-7b9cb951.js +++ b/packages/client/dist/assets/index-58a95187.js @@ -44,7 +44,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `),{cause:Z}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}}Object.defineProperty(TipAboveFeeCapError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class UnknownNodeError extends BaseError{constructor({cause:Z}){super(`An error occurred while executing: ${Z?.message}`,{cause:Z}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownNodeError"})}}class HttpRequestError extends BaseError{constructor({body:Z,details:X,headers:te,status:ie,url:oe}){super("HTTP request failed.",{details:X,metaMessages:[ie&&`Status: ${ie}`,`URL: ${getUrl$1(oe)}`,Z&&`Request body: ${stringify(Z)}`].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=Z,this.headers=te,this.status=ie,this.url=oe}}class WebSocketRequestError extends BaseError{constructor({body:Z,details:X,url:te}){super("WebSocket request failed.",{details:X,metaMessages:[`URL: ${getUrl$1(te)}`,`Request body: ${stringify(Z)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WebSocketRequestError"})}}class RpcRequestError extends BaseError{constructor({body:Z,error:X,url:te}){super("RPC Request failed.",{cause:X,details:X.message,metaMessages:[`URL: ${getUrl$1(te)}`,`Request body: ${stringify(Z)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=X.code}}class TimeoutError extends BaseError{constructor({body:Z,url:X}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${getUrl$1(X)}`,`Request body: ${stringify(Z)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}}const unknownErrorCode=-1;class RpcError extends BaseError{constructor(Z,{code:X,docsPath:te,metaMessages:ie,shortMessage:oe}){super(oe,{cause:Z,docsPath:te,metaMessages:ie||Z?.metaMessages}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=Z.name,this.code=Z instanceof RpcRequestError?Z.code:X??unknownErrorCode}}class ProviderRpcError extends RpcError{constructor(Z,X){super(Z,X),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=X.data}}class ParseRpcError extends RpcError{constructor(Z){super(Z,{code:ParseRpcError.code,shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ParseRpcError"})}}Object.defineProperty(ParseRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class InvalidRequestRpcError extends RpcError{constructor(Z){super(Z,{code:InvalidRequestRpcError.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}}Object.defineProperty(InvalidRequestRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class MethodNotFoundRpcError extends RpcError{constructor(Z){super(Z,{code:MethodNotFoundRpcError.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}}Object.defineProperty(MethodNotFoundRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class InvalidParamsRpcError extends RpcError{constructor(Z){super(Z,{code:InvalidParamsRpcError.code,shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` `)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParamsRpcError"})}}Object.defineProperty(InvalidParamsRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class InternalRpcError extends RpcError{constructor(Z){super(Z,{code:InternalRpcError.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}}Object.defineProperty(InternalRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class InvalidInputRpcError extends RpcError{constructor(Z){super(Z,{code:InvalidInputRpcError.code,shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` `)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidInputRpcError"})}}Object.defineProperty(InvalidInputRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class ResourceNotFoundRpcError extends RpcError{constructor(Z){super(Z,{code:ResourceNotFoundRpcError.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(ResourceNotFoundRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class ResourceUnavailableRpcError extends RpcError{constructor(Z){super(Z,{code:ResourceUnavailableRpcError.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}}Object.defineProperty(ResourceUnavailableRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class TransactionRejectedRpcError extends RpcError{constructor(Z){super(Z,{code:TransactionRejectedRpcError.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}}Object.defineProperty(TransactionRejectedRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class MethodNotSupportedRpcError extends RpcError{constructor(Z){super(Z,{code:MethodNotSupportedRpcError.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}}Object.defineProperty(MethodNotSupportedRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class LimitExceededRpcError extends RpcError{constructor(Z){super(Z,{code:LimitExceededRpcError.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}}Object.defineProperty(LimitExceededRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class JsonRpcVersionUnsupportedError extends RpcError{constructor(Z){super(Z,{code:JsonRpcVersionUnsupportedError.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}}Object.defineProperty(JsonRpcVersionUnsupportedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class UserRejectedRequestError extends ProviderRpcError{constructor(Z){super(Z,{code:UserRejectedRequestError.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}}Object.defineProperty(UserRejectedRequestError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class UnauthorizedProviderError extends ProviderRpcError{constructor(Z){super(Z,{code:UnauthorizedProviderError.code,shortMessage:"The requested method and/or account has not been authorized by the user."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnauthorizedProviderError"})}}Object.defineProperty(UnauthorizedProviderError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class UnsupportedProviderMethodError extends ProviderRpcError{constructor(Z){super(Z,{code:UnsupportedProviderMethodError.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}}Object.defineProperty(UnsupportedProviderMethodError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class ProviderDisconnectedError extends ProviderRpcError{constructor(Z){super(Z,{code:ProviderDisconnectedError.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}}Object.defineProperty(ProviderDisconnectedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class ChainDisconnectedError extends ProviderRpcError{constructor(Z){super(Z,{code:ChainDisconnectedError.code,shortMessage:"The Provider is not connected to the requested chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDisconnectedError"})}}Object.defineProperty(ChainDisconnectedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class SwitchChainError extends ProviderRpcError{constructor(Z){super(Z,{code:SwitchChainError.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}}Object.defineProperty(SwitchChainError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class UnknownRpcError extends RpcError{constructor(Z){super(Z,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}function containsNodeError(L){return L instanceof TransactionRejectedRpcError||L instanceof InvalidInputRpcError||L instanceof RpcRequestError&&L.code===ExecutionRevertedError.code}function getNodeError(L,Z){const X=L.details.toLowerCase();return FeeCapTooHighError.nodeMessage.test(X)?new FeeCapTooHighError({cause:L,maxFeePerGas:Z?.maxFeePerGas}):FeeCapTooLowError.nodeMessage.test(X)?new FeeCapTooLowError({cause:L,maxFeePerGas:Z?.maxFeePerGas}):NonceTooHighError.nodeMessage.test(X)?new NonceTooHighError({cause:L,nonce:Z?.nonce}):NonceTooLowError.nodeMessage.test(X)?new NonceTooLowError({cause:L,nonce:Z?.nonce}):NonceMaxValueError.nodeMessage.test(X)?new NonceMaxValueError({cause:L,nonce:Z?.nonce}):InsufficientFundsError.nodeMessage.test(X)?new InsufficientFundsError({cause:L}):IntrinsicGasTooHighError.nodeMessage.test(X)?new IntrinsicGasTooHighError({cause:L,gas:Z?.gas}):IntrinsicGasTooLowError.nodeMessage.test(X)?new IntrinsicGasTooLowError({cause:L,gas:Z?.gas}):TransactionTypeNotSupportedError.nodeMessage.test(X)?new TransactionTypeNotSupportedError({cause:L}):TipAboveFeeCapError.nodeMessage.test(X)?new TipAboveFeeCapError({cause:L,maxFeePerGas:Z?.maxFeePerGas,maxPriorityFeePerGas:Z?.maxPriorityFeePerGas}):X.match(ExecutionRevertedError.nodeMessage)||"code"in L.cause&&L.cause?.code===ExecutionRevertedError.code?new ExecutionRevertedError({cause:L,message:L.cause.details||L.details}):new UnknownNodeError({cause:L.cause.cause})}function getEstimateGasError(L,{docsPath:Z,...X}){let te=L;return containsNodeError(L)&&(te=getNodeError(L,X)),new EstimateGasExecutionError(te,{docsPath:Z,...X})}function extract(L,{format:Z}){return Z?Object.keys(Z({})).reduce((te,ie)=>(L?.hasOwnProperty(ie)&&(te[ie]=L[ie]),te),{}):{}}function formatTransactionRequest(L){return{...L,gas:typeof L.gas<"u"?numberToHex(L.gas):void 0,gasPrice:typeof L.gasPrice<"u"?numberToHex(L.gasPrice):void 0,maxFeePerGas:typeof L.maxFeePerGas<"u"?numberToHex(L.maxFeePerGas):void 0,maxPriorityFeePerGas:typeof L.maxPriorityFeePerGas<"u"?numberToHex(L.maxPriorityFeePerGas):void 0,nonce:typeof L.nonce<"u"?numberToHex(L.nonce):void 0,value:typeof L.value<"u"?numberToHex(L.value):void 0}}function assertRequest(L){const{account:Z,gasPrice:X,maxFeePerGas:te,maxPriorityFeePerGas:ie,to:oe}=L,se=Z?parseAccount(Z):void 0;if(se&&!isAddress(se.address))throw new InvalidAddressError({address:se.address});if(oe&&!isAddress(oe))throw new InvalidAddressError({address:oe});if(typeof X<"u"&&(typeof te<"u"||typeof ie<"u"))throw new FeeConflictError;if(te&&te>2n**256n-1n)throw new FeeCapTooHighError({maxFeePerGas:te});if(ie&&te&&ie>te)throw new TipAboveFeeCapError({maxFeePerGas:te,maxPriorityFeePerGas:ie})}class BlockNotFoundError extends BaseError{constructor({blockHash:Z,blockNumber:X}){let te="Block";Z&&(te=`Block at hash "${Z}"`),X&&(te=`Block at number "${X}"`),super(`${te} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}}const transactionType={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559"};function formatTransaction(L){const Z={...L,blockHash:L.blockHash?L.blockHash:null,blockNumber:L.blockNumber?BigInt(L.blockNumber):null,chainId:L.chainId?hexToNumber$1(L.chainId):void 0,gas:L.gas?BigInt(L.gas):void 0,gasPrice:L.gasPrice?BigInt(L.gasPrice):void 0,maxFeePerGas:L.maxFeePerGas?BigInt(L.maxFeePerGas):void 0,maxPriorityFeePerGas:L.maxPriorityFeePerGas?BigInt(L.maxPriorityFeePerGas):void 0,nonce:L.nonce?hexToNumber$1(L.nonce):void 0,to:L.to?L.to:null,transactionIndex:L.transactionIndex?Number(L.transactionIndex):null,type:L.type?transactionType[L.type]:void 0,typeHex:L.type?L.type:void 0,value:L.value?BigInt(L.value):void 0,v:L.v?BigInt(L.v):void 0};return Z.type==="legacy"&&(delete Z.accessList,delete Z.maxFeePerGas,delete Z.maxPriorityFeePerGas),Z.type==="eip2930"&&(delete Z.maxFeePerGas,delete Z.maxPriorityFeePerGas),Z}function formatBlock(L){const Z=L.transactions?.map(X=>typeof X=="string"?X:formatTransaction(X));return{...L,baseFeePerGas:L.baseFeePerGas?BigInt(L.baseFeePerGas):null,difficulty:L.difficulty?BigInt(L.difficulty):void 0,gasLimit:L.gasLimit?BigInt(L.gasLimit):void 0,gasUsed:L.gasUsed?BigInt(L.gasUsed):void 0,hash:L.hash?L.hash:null,logsBloom:L.logsBloom?L.logsBloom:null,nonce:L.nonce?L.nonce:null,number:L.number?BigInt(L.number):null,size:L.size?BigInt(L.size):void 0,timestamp:L.timestamp?BigInt(L.timestamp):void 0,transactions:Z,totalDifficulty:L.totalDifficulty?BigInt(L.totalDifficulty):null}}async function getBlock(L,{blockHash:Z,blockNumber:X,blockTag:te,includeTransactions:ie}={}){const oe=te??"latest",se=ie??!1,ue=X!==void 0?numberToHex(X):void 0;let ce=null;if(Z?ce=await L.request({method:"eth_getBlockByHash",params:[Z,se]}):ce=await L.request({method:"eth_getBlockByNumber",params:[ue||oe,se]}),!ce)throw new BlockNotFoundError({blockHash:Z,blockNumber:X});return(L.chain?.formatters?.block?.format||formatBlock)(ce)}async function getGasPrice(L){const Z=await L.request({method:"eth_gasPrice"});return BigInt(Z)}async function getTransactionCount(L,{address:Z,blockTag:X="latest",blockNumber:te}){const ie=await L.request({method:"eth_getTransactionCount",params:[Z,te?numberToHex(te):X]});return hexToNumber$1(ie)}async function prepareRequest(L,Z){const{account:X,chain:te=L.chain,gas:ie,gasPrice:oe,maxFeePerGas:se,maxPriorityFeePerGas:ue,nonce:ce}=Z;if(!X)throw new AccountNotFoundError;const le=parseAccount(X),de=await getBlock(L,{blockTag:"latest"}),he={...Z,from:le.address};if(typeof ce>"u"&&(he.nonce=await getTransactionCount(L,{address:le.address,blockTag:"pending"})),typeof de.baseFeePerGas=="bigint"&&typeof oe>"u"){let ge=1500000000n;if(typeof te?.fees?.defaultPriorityFee<"u"&&(ge=typeof te.fees.defaultPriorityFee=="bigint"?te.fees.defaultPriorityFee:await te.fees.defaultPriorityFee({block:de,request:he})),typeof se>"u")he.maxPriorityFeePerGas=ue??ge,he.maxFeePerGas=de.baseFeePerGas*120n/100n+he.maxPriorityFeePerGas;else{if(typeof ue>"u"&&se"u"){if(typeof se<"u"||typeof ue<"u")throw new BaseError("Chain does not support EIP-1559 fees.");he.gasPrice=await getGasPrice(L)*120n/100n}return typeof ie>"u"&&(he.gas=await estimateGas(L,{...he,account:{address:le.address,type:"json-rpc"}})),assertRequest(he),he}async function estimateGas(L,Z){const X=Z.account??L.account;if(!X)throw new AccountNotFoundError({docsPath:"/docs/actions/public/estimateGas"});const te=parseAccount(X);try{const{accessList:ie,blockNumber:oe,blockTag:se,data:ue,gas:ce,gasPrice:le,maxFeePerGas:de,maxPriorityFeePerGas:he,nonce:ge,to:_e,value:Ae,...xe}=te.type==="local"?await prepareRequest(L,Z):Z,Pe=(oe?numberToHex(oe):void 0)||se;assertRequest(Z);const Ce=L.chain?.formatters?.transactionRequest?.format||formatTransactionRequest,Be=Ce({...extract(xe,{format:Ce}),from:te.address,accessList:ie,data:ue,gas:ce,gasPrice:le,maxFeePerGas:de,maxPriorityFeePerGas:he,nonce:ge,to:_e,value:Ae}),Ve=await L.request({method:"eth_estimateGas",params:Pe?[Be,Pe]:[Be]});return BigInt(Ve)}catch(ie){throw getEstimateGasError(ie,{...Z,account:te,chain:L.chain})}}async function estimateContractGas(L,{abi:Z,address:X,args:te,functionName:ie,...oe}){const se=encodeFunctionData({abi:Z,args:te,functionName:ie});try{return await estimateGas(L,{data:se,to:X,...oe})}catch(ue){const ce=oe.account?parseAccount(oe.account):void 0;throw getContractError(ue,{abi:Z,address:X,args:te,docsPath:"/docs/contract/estimateContractGas",functionName:ie,sender:ce?.address})}}const docsPath$2="/docs/contract/decodeFunctionResult";function decodeFunctionResult({abi:L,args:Z,functionName:X,data:te}){let ie=L[0];if(X&&(ie=getAbiItem({abi:L,args:Z,name:X}),!ie))throw new AbiFunctionNotFoundError(X,{docsPath:docsPath$2});if(ie.type!=="function")throw new AbiFunctionNotFoundError(void 0,{docsPath:docsPath$2});if(!ie.outputs)throw new AbiFunctionOutputsNotFoundError(ie.name,{docsPath:docsPath$2});const oe=decodeAbiParameters(ie.outputs,te);if(oe&&oe.length>1)return oe;if(oe&&oe.length===1)return oe[0]}const multicall3Abi=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],universalResolverErrors=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"}],universalResolverResolveAbi=[...universalResolverErrors,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],universalResolverReverseAbi=[...universalResolverErrors,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],textResolverAbi=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],addressResolverAbi=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],universalSignatureValidatorAbi=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}],aggregate3Signature="0x82ad56cb";class ChainDoesNotSupportContract extends BaseError{constructor({blockNumber:Z,chain:X,contract:te}){super(`Chain "${X.name}" does not support contract "${te.name}".`,{metaMessages:["This could be due to any of the following:",...Z&&te.blockCreated&&te.blockCreated>Z?[`- The contract "${te.name}" was not deployed until block ${te.blockCreated} (current block ${Z}).`]:[`- The chain does not have the contract "${te.name}" configured.`]]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDoesNotSupportContract"})}}class ChainMismatchError extends BaseError{constructor({chain:Z,currentChainId:X}){super(`The current chain of the wallet (id: ${X}) does not match the target chain for the transaction (id: ${Z.id} – ${Z.name}).`,{metaMessages:[`Current Chain ID: ${X}`,`Expected Chain ID: ${Z.id} – ${Z.name}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainMismatchError"})}}class ChainNotFoundError extends BaseError{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(` -`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotFoundError"})}}class ClientChainNotConfiguredError extends BaseError{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}}class InvalidChainIdError extends BaseError{constructor({chainId:Z}){super(`Chain ID "${Z}" is invalid.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidChainIdError"})}}function assertCurrentChain({chain:L,currentChainId:Z}){if(!L)throw new ChainNotFoundError;if(Z!==L.id)throw new ChainMismatchError({chain:L,currentChainId:Z})}function defineChain(L,Z={}){const{fees:X=L.fees,formatters:te=L.formatters,serializers:ie=L.serializers}=Z;return{...L,fees:X,formatters:te,serializers:ie}}function getChainContractAddress({blockNumber:L,chain:Z,contract:X}){const te=Z?.contracts?.[X];if(!te)throw new ChainDoesNotSupportContract({chain:Z,contract:{name:X}});if(L&&te.blockCreated&&te.blockCreated>L)throw new ChainDoesNotSupportContract({blockNumber:L,chain:Z,contract:{name:X,blockCreated:te.blockCreated}});return te.address}function getCallError(L,{docsPath:Z,...X}){let te=L;return containsNodeError(L)&&(te=getNodeError(L,X)),new CallExecutionError(te,{docsPath:Z,...X})}const schedulerCache=new Map;function createBatchScheduler({fn:L,id:Z,shouldSplitBatch:X,wait:te=0}){const ie=async()=>{const le=ue();oe();const de=le.map(({args:he})=>he);de.length!==0&&L(de).then(he=>{le.forEach(({pendingPromise:ge},_e)=>ge.resolve?.([he[_e],he]))}).catch(he=>{le.forEach(({pendingPromise:ge})=>ge.reject?.(he))})},oe=()=>schedulerCache.delete(Z),se=()=>ue().map(({args:le})=>le),ue=()=>schedulerCache.get(Z)||[],ce=le=>schedulerCache.set(Z,[...ue(),le]);return{flush:oe,async schedule(le){const de={},he=new Promise((Ae,xe)=>{de.resolve=Ae,de.reject=xe});return X?.([...se(),le])&&ie(),ue().length>0?(ce({args:le,pendingPromise:de}),he):(ce({args:le,pendingPromise:de}),setTimeout(ie,te),he)}}}async function call(L,Z){const{account:X,batch:te=!!L.batch?.multicall,blockNumber:ie,blockTag:oe="latest",accessList:se,data:ue,gas:ce,gasPrice:le,maxFeePerGas:de,maxPriorityFeePerGas:he,nonce:ge,to:_e,value:Ae,...xe}=Z,Ie=X?parseAccount(X):void 0;try{assertRequest(Z);const Ce=(ie?numberToHex(ie):void 0)||oe,Be=L.chain?.formatters?.transactionRequest?.format||formatTransactionRequest,Ve=Be({...extract(xe,{format:Be}),from:Ie?.address,accessList:se,data:ue,gas:ce,gasPrice:le,maxFeePerGas:de,maxPriorityFeePerGas:he,nonce:ge,to:_e,value:Ae});if(te&&shouldPerformMulticall({request:Ve}))try{return await scheduleMulticall(L,{...Ve,blockNumber:ie,blockTag:oe})}catch(Ke){if(!(Ke instanceof ClientChainNotConfiguredError)&&!(Ke instanceof ChainDoesNotSupportContract))throw Ke}const Ge=await L.request({method:"eth_call",params:Ce?[Ve,Ce]:[Ve]});return Ge==="0x"?{data:void 0}:{data:Ge}}catch(Pe){const Ce=getRevertErrorData(Pe),{offchainLookup:Be,offchainLookupSignature:Ve}=await __vitePreload(()=>import("./ccip-3995c446.js"),[]);if(Ce?.slice(0,10)===Ve&&_e)return{data:await Be(L,{data:Ce,to:_e})};throw getCallError(Pe,{...Z,account:Ie,chain:L.chain})}}function shouldPerformMulticall({request:L}){const{data:Z,to:X,...te}=L;return!(!Z||Z.startsWith(aggregate3Signature)||!X||Object.values(te).filter(ie=>typeof ie<"u").length>0)}async function scheduleMulticall(L,Z){const{batchSize:X=1024,wait:te=0}=typeof L.batch?.multicall=="object"?L.batch.multicall:{},{blockNumber:ie,blockTag:oe="latest",data:se,multicallAddress:ue,to:ce}=Z;let le=ue;if(!le){if(!L.chain)throw new ClientChainNotConfiguredError;le=getChainContractAddress({blockNumber:ie,chain:L.chain,contract:"multicall3"})}const he=(ie?numberToHex(ie):void 0)||oe,{schedule:ge}=createBatchScheduler({id:`${L.uid}.${he}`,wait:te,shouldSplitBatch(xe){return xe.reduce((Pe,{data:Ce})=>Pe+(Ce.length-2),0)>X*2},fn:async xe=>{const Ie=xe.map(Be=>({allowFailure:!0,callData:Be.data,target:Be.to})),Pe=encodeFunctionData({abi:multicall3Abi,args:[Ie],functionName:"aggregate3"}),Ce=await L.request({method:"eth_call",params:[{data:Pe,to:le},he]});return decodeFunctionResult({abi:multicall3Abi,args:[Ie],functionName:"aggregate3",data:Ce||"0x"})}}),[{returnData:_e,success:Ae}]=await ge({data:se,to:ce});if(!Ae)throw new RawContractError({data:_e});return _e==="0x"?{data:void 0}:{data:_e}}function getRevertErrorData(L){if(!(L instanceof BaseError))return;const Z=L.walk();return typeof Z.data=="object"?Z.data.data:Z.data}async function readContract(L,{abi:Z,address:X,args:te,functionName:ie,...oe}){const se=encodeFunctionData({abi:Z,args:te,functionName:ie});try{const{data:ue}=await call(L,{data:se,to:X,...oe});return decodeFunctionResult({abi:Z,args:te,functionName:ie,data:ue||"0x"})}catch(ue){throw getContractError(ue,{abi:Z,address:X,args:te,docsPath:"/docs/contract/readContract",functionName:ie})}}async function simulateContract(L,{abi:Z,address:X,args:te,dataSuffix:ie,functionName:oe,...se}){const ue=se.account?parseAccount(se.account):void 0,ce=encodeFunctionData({abi:Z,args:te,functionName:oe});try{const{data:le}=await call(L,{batch:!1,data:`${ce}${ie?ie.replace("0x",""):""}`,to:X,...se});return{result:decodeFunctionResult({abi:Z,args:te,functionName:oe,data:le||"0x"}),request:{abi:Z,address:X,args:te,dataSuffix:ie,functionName:oe,...se}}}catch(le){throw getContractError(le,{abi:Z,address:X,args:te,docsPath:"/docs/contract/simulateContract",functionName:oe,sender:ue?.address})}}const listenersCache=new Map,cleanupCache=new Map;let callbackCount=0;function observe(L,Z,X){const te=++callbackCount,ie=()=>listenersCache.get(L)||[],oe=()=>{const de=ie();listenersCache.set(L,de.filter(he=>he.id!==te))},se=()=>{const de=cleanupCache.get(L);ie().length===1&&de&&de(),oe()},ue=ie();if(listenersCache.set(L,[...ue,{id:te,fns:Z}]),ue&&ue.length>0)return se;const ce={};for(const de in Z)ce[de]=(...he)=>{const ge=ie();ge.length!==0&&ge.forEach(_e=>_e.fns[de]?.(...he))};const le=X(ce);return typeof le=="function"&&cleanupCache.set(L,le),se}async function wait(L){return new Promise(Z=>setTimeout(Z,L))}function poll(L,{emitOnBegin:Z,initialWaitTime:X,interval:te}){let ie=!0;const oe=()=>ie=!1;return(async()=>{let ue;Z&&(ue=await L({unpoll:oe}));const ce=await X?.(ue)??te;await wait(ce);const le=async()=>{ie&&(await L({unpoll:oe}),await wait(te),le())};le()})(),oe}const promiseCache=new Map,responseCache=new Map;function getCache(L){const Z=(ie,oe)=>({clear:()=>oe.delete(ie),get:()=>oe.get(ie),set:se=>oe.set(ie,se)}),X=Z(L,promiseCache),te=Z(L,responseCache);return{clear:()=>{X.clear(),te.clear()},promise:X,response:te}}async function withCache(L,{cacheKey:Z,cacheTime:X=1/0}){const te=getCache(Z),ie=te.response.get();if(ie&&X>0&&new Date().getTime()-ie.created.getTime()`blockNumber.${L}`;async function getBlockNumber(L,{cacheTime:Z=L.cacheTime,maxAge:X}={}){const te=await withCache(()=>L.request({method:"eth_blockNumber"}),{cacheKey:cacheKey(L.uid),cacheTime:X??Z});return BigInt(te)}const docsPath$1="/docs/contract/decodeEventLog";function decodeEventLog({abi:L,data:Z,strict:X,topics:te}){const ie=X??!0,[oe,...se]=te;if(!oe)throw new AbiEventSignatureEmptyTopicsError({docsPath:docsPath$1});const ue=L.find(Ae=>Ae.type==="event"&&oe===getEventSelector(formatAbiItem(Ae)));if(!(ue&&"name"in ue)||ue.type!=="event")throw new AbiEventSignatureNotFoundError(oe,{docsPath:docsPath$1});const{name:ce,inputs:le}=ue,de=le?.some(Ae=>!("name"in Ae&&Ae.name));let he=de?[]:{};const ge=le.filter(Ae=>"indexed"in Ae&&Ae.indexed);if(se.length>0)for(let Ae=0;Ae!("indexed"in Ae&&Ae.indexed));if(_e.length>0){if(Z&&Z!=="0x")try{const Ae=decodeAbiParameters(_e,Z);if(Ae)if(de)he=[...he,...Ae];else for(let xe=0;xe<_e.length;xe++)he[_e[xe].name]=Ae[xe]}catch(Ae){if(ie)throw Ae instanceof AbiDecodingDataSizeTooSmallError?new DecodeLogDataMismatch({abiItem:ue,data:Ae.data,params:Ae.params,size:Ae.size}):Ae}else if(ie)throw new DecodeLogDataMismatch({abiItem:ue,data:"0x",params:_e,size:0})}return{eventName:ce,args:Object.values(he).length>0?he:void 0}}function decodeTopic({param:L,value:Z}){return L.type==="string"||L.type==="bytes"||L.type==="tuple"||L.type.match(/^(.*)\[(\d+)?\]$/)?Z:(decodeAbiParameters([L],Z)||[])[0]}function formatLog(L,{args:Z,eventName:X}={}){return{...L,blockHash:L.blockHash?L.blockHash:null,blockNumber:L.blockNumber?BigInt(L.blockNumber):null,logIndex:L.logIndex?Number(L.logIndex):null,transactionHash:L.transactionHash?L.transactionHash:null,transactionIndex:L.transactionIndex?Number(L.transactionIndex):null,...X?{args:Z,eventName:X}:{}}}async function getFilterChanges(L,{filter:Z}){const X="strict"in Z&&Z.strict;return(await Z.request({method:"eth_getFilterChanges",params:[Z.id]})).map(ie=>{if(typeof ie=="string")return ie;try{const{eventName:oe,args:se}="abi"in Z&&Z.abi?decodeEventLog({abi:Z.abi,data:ie.data,topics:ie.topics,strict:X}):{eventName:void 0,args:void 0};return formatLog(ie,{args:se,eventName:oe})}catch(oe){let se,ue;if(oe instanceof DecodeLogDataMismatch||oe instanceof DecodeLogTopicsMismatch){if("strict"in Z&&Z.strict)return;se=oe.abiItem.name,ue=oe.abiItem.inputs?.some(ce=>!("name"in ce&&ce.name))}return formatLog(ie,{args:ue?[]:{},eventName:se})}}).filter(Boolean)}async function getLogs(L,{address:Z,blockHash:X,fromBlock:te,toBlock:ie,event:oe,events:se,args:ue,strict:ce}={}){const le=ce??!1,de=se??(oe?[oe]:void 0);let he=[];de&&(he=[de.flatMap(_e=>encodeEventTopics({abi:[_e],eventName:_e.name,args:ue}))],oe&&(he=he[0]));let ge;return X?ge=await L.request({method:"eth_getLogs",params:[{address:Z,topics:he,blockHash:X}]}):ge=await L.request({method:"eth_getLogs",params:[{address:Z,topics:he,fromBlock:typeof te=="bigint"?numberToHex(te):te,toBlock:typeof ie=="bigint"?numberToHex(ie):ie}]}),ge.map(_e=>{try{const{eventName:Ae,args:xe}=de?decodeEventLog({abi:de,data:_e.data,topics:_e.topics,strict:le}):{eventName:void 0,args:void 0};return formatLog(_e,{args:xe,eventName:Ae})}catch(Ae){let xe,Ie;if(Ae instanceof DecodeLogDataMismatch||Ae instanceof DecodeLogTopicsMismatch){if(le)return;xe=Ae.abiItem.name,Ie=Ae.abiItem.inputs?.some(Pe=>!("name"in Pe&&Pe.name))}return formatLog(_e,{args:Ie?[]:{},eventName:xe})}}).filter(Boolean)}async function uninstallFilter(L,{filter:Z}){return Z.request({method:"eth_uninstallFilter",params:[Z.id]})}function watchContractEvent(L,{abi:Z,address:X,args:te,batch:ie=!0,eventName:oe,onError:se,onLogs:ue,poll:ce,pollingInterval:le=L.pollingInterval,strict:de}){return(typeof ce<"u"?ce:L.transport.type!=="webSocket")?(()=>{const Ae=stringify(["watchContractEvent",X,te,ie,L.uid,oe,le]),xe=de??!1;return observe(Ae,{onLogs:ue,onError:se},Ie=>{let Pe,Ce,Be=!1;const Ve=poll(async()=>{if(!Be){try{Ce=await createContractEventFilter(L,{abi:Z,address:X,args:te,eventName:oe,strict:xe})}catch{}Be=!0;return}try{let Ge;if(Ce)Ge=await getFilterChanges(L,{filter:Ce});else{const Ke=await getBlockNumber(L);Pe&&Pe!==Ke?Ge=await getLogs(L,{address:X,args:te,fromBlock:Pe+1n,toBlock:Ke,event:getAbiItem({abi:Z,name:oe})}):Ge=[],Pe=Ke}if(Ge.length===0)return;ie?Ie.onLogs(Ge):Ge.forEach(Ke=>Ie.onLogs([Ke]))}catch(Ge){Ce&&Ge instanceof InvalidInputRpcError&&(Be=!1),Ie.onError?.(Ge)}},{emitOnBegin:!0,interval:le});return async()=>{Ce&&await uninstallFilter(L,{filter:Ce}),Ve()}})})():(()=>{let Ae=!0,xe=()=>Ae=!1;return(async()=>{try{const Ie=oe?encodeEventTopics({abi:Z,eventName:oe,args:te}):[],{unsubscribe:Pe}=await L.transport.subscribe({params:["logs",{address:X,topics:Ie}],onData(Ce){if(!Ae)return;const Be=Ce.result;try{const{eventName:Ve,args:Ge}=decodeEventLog({abi:Z,data:Be.data,topics:Be.topics,strict:de}),Ke=formatLog(Be,{args:Ge,eventName:Ve});ue([Ke])}catch(Ve){let Ge,Ke;if(Ve instanceof DecodeLogDataMismatch||Ve instanceof DecodeLogTopicsMismatch){if(de)return;Ge=Ve.abiItem.name,Ke=Ve.abiItem.inputs?.some(et=>!("name"in et&&et.name))}const Je=formatLog(Be,{args:Ke?[]:{},eventName:Ge});ue([Je])}},onError(Ce){se?.(Ce)}});xe=Pe,Ae||xe()}catch(Ie){se?.(Ie)}})(),xe})()}function getTransactionError(L,{docsPath:Z,...X}){let te=L;return containsNodeError(L)&&(te=getNodeError(L,X)),new TransactionExecutionError(te,{docsPath:Z,...X})}async function getChainId(L){const Z=await L.request({method:"eth_chainId"});return hexToNumber$1(Z)}async function sendTransaction(L,Z){const{account:X=L.account,chain:te=L.chain,accessList:ie,data:oe,gas:se,gasPrice:ue,maxFeePerGas:ce,maxPriorityFeePerGas:le,nonce:de,to:he,value:ge,..._e}=Z;if(!X)throw new AccountNotFoundError({docsPath:"/docs/actions/wallet/sendTransaction"});const Ae=parseAccount(X);try{assertRequest(Z);let xe;if(te!==null&&(xe=await getChainId(L),assertCurrentChain({currentChainId:xe,chain:te})),Ae.type==="local"){const Ce=await prepareRequest(L,{account:Ae,accessList:ie,chain:te,data:oe,gas:se,gasPrice:ue,maxFeePerGas:ce,maxPriorityFeePerGas:le,nonce:de,to:he,value:ge,..._e});xe||(xe=await getChainId(L));const Be=te?.serializers?.transaction,Ve=await Ae.signTransaction({...Ce,chainId:xe},{serializer:Be});return await L.request({method:"eth_sendRawTransaction",params:[Ve]})}const Ie=te?.formatters?.transactionRequest?.format||formatTransactionRequest,Pe=Ie({...extract(_e,{format:Ie}),accessList:ie,data:oe,from:Ae.address,gas:se,gasPrice:ue,maxFeePerGas:ce,maxPriorityFeePerGas:le,nonce:de,to:he,value:ge});return await L.request({method:"eth_sendTransaction",params:[Pe]})}catch(xe){throw getTransactionError(xe,{...Z,account:Ae,chain:Z.chain||void 0})}}async function writeContract(L,{abi:Z,address:X,args:te,dataSuffix:ie,functionName:oe,...se}){const ue=encodeFunctionData({abi:Z,args:te,functionName:oe});return await sendTransaction(L,{data:`${ue}${ie?ie.replace("0x",""):""}`,to:X,...se})}function getContract({abi:L,address:Z,publicClient:X,walletClient:te}){const ie=X!=null,oe=te!=null,se={};let ue=!1,ce=!1,le=!1;for(const de of L)if(de.type==="function"?de.stateMutability==="view"||de.stateMutability==="pure"?ue=!0:ce=!0:de.type==="event"&&(le=!0),ue&&ce&&le)break;return ie&&(ue&&(se.read=new Proxy({},{get(de,he){return(...ge)=>{const{args:_e,options:Ae}=getFunctionParameters(ge);return readContract(X,{abi:L,address:Z,functionName:he,args:_e,...Ae})}}})),ce&&(se.simulate=new Proxy({},{get(de,he){return(...ge)=>{const{args:_e,options:Ae}=getFunctionParameters(ge);return simulateContract(X,{abi:L,address:Z,functionName:he,args:_e,...Ae})}}})),le&&(se.createEventFilter=new Proxy({},{get(de,he){return(...ge)=>{const _e=L.find(Ie=>Ie.type==="event"&&Ie.name===he),{args:Ae,options:xe}=getEventParameters(ge,_e);return createContractEventFilter(X,{abi:L,address:Z,eventName:he,args:Ae,...xe})}}}),se.watchEvent=new Proxy({},{get(de,he){return(...ge)=>{const _e=L.find(Ie=>Ie.type==="event"&&Ie.name===he),{args:Ae,options:xe}=getEventParameters(ge,_e);return watchContractEvent(X,{abi:L,address:Z,eventName:he,args:Ae,...xe})}}}))),oe&&ce&&(se.write=new Proxy({},{get(de,he){return(...ge)=>{const{args:_e,options:Ae}=getFunctionParameters(ge);return writeContract(te,{abi:L,address:Z,functionName:he,args:_e,...Ae})}}})),(ie||oe)&&ce&&(se.estimateGas=new Proxy({},{get(de,he){return(...ge)=>{const{args:_e,options:Ae}=getFunctionParameters(ge);return estimateContractGas(X??te,{abi:L,address:Z,functionName:he,args:_e,...Ae,account:Ae.account??te.account})}}})),se.address=Z,se.abi=L,se}function getFunctionParameters(L){const Z=L.length&&Array.isArray(L[0]),X=Z?L[0]:[],te=(Z?L[1]:L[0])??{};return{args:X,options:te}}function getEventParameters(L,Z){let X=!1;Array.isArray(L[0])?X=!0:L.length===1?X=Z.inputs.some(oe=>oe.indexed):L.length===2&&(X=!0);const te=X?L[0]:void 0,ie=(X?L[1]:L[0])??{};return{args:te,options:ie}}async function addChain(L,{chain:Z}){const{id:X,name:te,nativeCurrency:ie,rpcUrls:oe,blockExplorers:se}=Z;await L.request({method:"wallet_addEthereumChain",params:[{chainId:numberToHex(X),chainName:te,nativeCurrency:ie,rpcUrls:oe.default.http,blockExplorerUrls:se?Object.values(se).map(({url:ue})=>ue):void 0}]})}function publicKeyToAddress(L){const Z=keccak256(`0x${L.substring(4)}`).substring(26);return checksumAddress(`0x${Z}`)}const size=256;let index=size,buffer;function uid(L=11){if(!buffer||index+L>size*2){buffer="",index=0;for(let Z=0;Z{const Pe=Ie(xe);for(const Be in _e)delete Pe[Be];const Ce={...xe,...Pe};return Object.assign(Ce,{extend:Ae(Ce)})}}return Object.assign(_e,{extend:Ae(_e)})}function withRetry(L,{delay:Z=100,retryCount:X=2,shouldRetry:te=()=>!0}={}){return new Promise((ie,oe)=>{const se=async({count:ue=0}={})=>{const ce=async({error:le})=>{const de=typeof Z=="function"?Z({count:ue,error:le}):Z;de&&await wait(de),se({count:ue+1})};try{const le=await L();ie(le)}catch(le){if(ue"code"in L?L.code!==-1&&L.code!==-32004&&L.code!==-32005&&L.code!==-32042&&L.code!==-32603:L instanceof HttpRequestError&&L.status?L.status!==403&&L.status!==408&&L.status!==413&&L.status!==429&&L.status!==500&&L.status!==502&&L.status!==503&&L.status!==504:!1;function buildRequest(L,{retryDelay:Z=150,retryCount:X=3}={}){return async te=>withRetry(async()=>{try{return await L(te)}catch(ie){const oe=ie;switch(oe.code){case ParseRpcError.code:throw new ParseRpcError(oe);case InvalidRequestRpcError.code:throw new InvalidRequestRpcError(oe);case MethodNotFoundRpcError.code:throw new MethodNotFoundRpcError(oe);case InvalidParamsRpcError.code:throw new InvalidParamsRpcError(oe);case InternalRpcError.code:throw new InternalRpcError(oe);case InvalidInputRpcError.code:throw new InvalidInputRpcError(oe);case ResourceNotFoundRpcError.code:throw new ResourceNotFoundRpcError(oe);case ResourceUnavailableRpcError.code:throw new ResourceUnavailableRpcError(oe);case TransactionRejectedRpcError.code:throw new TransactionRejectedRpcError(oe);case MethodNotSupportedRpcError.code:throw new MethodNotSupportedRpcError(oe);case LimitExceededRpcError.code:throw new LimitExceededRpcError(oe);case JsonRpcVersionUnsupportedError.code:throw new JsonRpcVersionUnsupportedError(oe);case UserRejectedRequestError.code:throw new UserRejectedRequestError(oe);case UnauthorizedProviderError.code:throw new UnauthorizedProviderError(oe);case UnsupportedProviderMethodError.code:throw new UnsupportedProviderMethodError(oe);case ProviderDisconnectedError.code:throw new ProviderDisconnectedError(oe);case ChainDisconnectedError.code:throw new ChainDisconnectedError(oe);case SwitchChainError.code:throw new SwitchChainError(oe);default:throw ie instanceof BaseError?ie:new UnknownRpcError(oe)}}},{delay:({count:ie,error:oe})=>{if(oe&&oe instanceof HttpRequestError){const se=oe?.headers?.get("Retry-After");if(se?.match(/\d/))return parseInt(se)*1e3}return~~(1<!isDeterministicError(ie)})}function createTransport({key:L,name:Z,request:X,retryCount:te=3,retryDelay:ie=150,timeout:oe,type:se},ue){return{config:{key:L,name:Z,request:X,retryCount:te,retryDelay:ie,timeout:oe,type:se},request:buildRequest(X,{retryCount:te,retryDelay:ie}),value:ue}}function fallback(L,Z={}){const{key:X="fallback",name:te="Fallback",rank:ie=!1,retryCount:oe,retryDelay:se}=Z;return({chain:ue,pollingInterval:ce=4e3,timeout:le})=>{let de=L,he=()=>{};const ge=createTransport({key:X,name:te,async request({method:_e,params:Ae}){const xe=async(Ie=0)=>{const Pe=de[Ie]({chain:ue,retryCount:0,timeout:le});try{const Ce=await Pe.request({method:_e,params:Ae});return he({method:_e,params:Ae,response:Ce,transport:Pe,status:"success"}),Ce}catch(Ce){if(he({error:Ce,method:_e,params:Ae,transport:Pe,status:"error"}),isDeterministicError(Ce)||Ie===de.length-1)throw Ce;return xe(Ie+1)}};return xe()},retryCount:oe,retryDelay:se,type:"fallback"},{onResponse:_e=>he=_e,transports:de.map(_e=>_e({chain:ue,retryCount:0}))});if(ie){const _e=typeof ie=="object"?ie:{};rankTransports({chain:ue,interval:_e.interval??ce,onTransports:Ae=>de=Ae,sampleCount:_e.sampleCount,timeout:_e.timeout,transports:de,weights:_e.weights})}return ge}}function rankTransports({chain:L,interval:Z=4e3,onTransports:X,sampleCount:te=10,timeout:ie=1e3,transports:oe,weights:se={}}){const{stability:ue=.7,latency:ce=.3}=se,le=[],de=async()=>{const he=await Promise.all(oe.map(async Ae=>{const xe=Ae({chain:L,retryCount:0,timeout:ie}),Ie=Date.now();let Pe,Ce;try{await xe.request({method:"net_listening"}),Ce=1}catch{Ce=0}finally{Pe=Date.now()}return{latency:Pe-Ie,success:Ce}}));le.push(he),le.length>te&&le.shift();const ge=Math.max(...le.map(Ae=>Math.max(...Ae.map(({latency:xe})=>xe)))),_e=oe.map((Ae,xe)=>{const Ie=le.map(Ge=>Ge[xe].latency),Ce=1-Ie.reduce((Ge,Ke)=>Ge+Ke,0)/Ie.length/ge,Be=le.map(Ge=>Ge[xe].success),Ve=Be.reduce((Ge,Ke)=>Ge+Ke,0)/Be.length;return Ve===0?[0,xe]:[ce*Ce+ue*Ve,xe]}).sort((Ae,xe)=>xe[0]-Ae[0]);X(_e.map(([,Ae])=>oe[Ae])),await wait(Z),de()};de()}class UrlRequiredError extends BaseError{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}}function withTimeout(L,{errorInstance:Z,timeout:X,signal:te}){return new Promise((ie,oe)=>{(async()=>{let se;try{const ue=new AbortController;X>0&&(se=setTimeout(()=>{te?ue.abort():oe(Z)},X)),ie(await L({signal:ue?.signal}))}catch(ue){ue.name==="AbortError"&&oe(Z),oe(ue)}finally{clearTimeout(se)}})()})}let id=0;async function http$1(L,{body:Z,fetchOptions:X={},timeout:te=1e4}){const{headers:ie,method:oe,signal:se}=X;try{const ue=await withTimeout(async({signal:le})=>await fetch(L,{...X,body:Array.isArray(Z)?stringify(Z.map(he=>({jsonrpc:"2.0",id:id++,...he}))):stringify({jsonrpc:"2.0",id:id++,...Z}),headers:{...ie,"Content-Type":"application/json"},method:oe||"POST",signal:se||(te>0?le:void 0)}),{errorInstance:new TimeoutError({body:Z,url:L}),timeout:te,signal:!0});let ce;if(ue.headers.get("Content-Type")?.startsWith("application/json")?ce=await ue.json():ce=await ue.text(),!ue.ok)throw new HttpRequestError({body:Z,details:stringify(ce.error)||ue.statusText,headers:ue.headers,status:ue.status,url:L});return ce}catch(ue){throw ue instanceof HttpRequestError||ue instanceof TimeoutError?ue:new HttpRequestError({body:Z,details:ue.message,url:L})}}const sockets=new Map;async function getSocket(L){const Z=new URL(L),X=Z.toString();let te=sockets.get(X);if(te)return te;const{schedule:ie}=createBatchScheduler({id:X,fn:async()=>{let ue=await __vitePreload(()=>import("./browser-3852a342.js"),[]);ue.default?.constructor?ue=ue.default:ue=ue.WebSocket;const ce=new ue(Z),le=new Map,de=new Map,he=({data:_e})=>{const Ae=JSON.parse(_e),xe=Ae.method==="eth_subscription",Ie=xe?Ae.params.subscription:Ae.id,Pe=xe?de:le,Ce=Pe.get(Ie);Ce&&Ce({data:_e}),xe||Pe.delete(Ie)},ge=()=>{sockets.delete(X),ce.removeEventListener("close",ge),ce.removeEventListener("message",he)};return ce.addEventListener("close",ge),ce.addEventListener("message",he),ce.readyState===ue.CONNECTING&&await new Promise((_e,Ae)=>{ce&&(ce.onopen=_e,ce.onerror=Ae)}),te=Object.assign(ce,{requests:le,subscriptions:de}),sockets.set(X,te),[te]}}),[oe,[se]]=await ie();return se}function webSocket$1(L,{body:Z,onResponse:X}){if(L.readyState===L.CLOSED||L.readyState===L.CLOSING)throw new WebSocketRequestError({body:Z,url:L.url,details:"Socket is closed."});const te=id++,ie=({data:oe})=>{const se=JSON.parse(oe);typeof se.id=="number"&&te!==se.id||(X?.(se),Z.method==="eth_subscribe"&&typeof se.result=="string"&&L.subscriptions.set(se.result,ie),Z.method==="eth_unsubscribe"&&L.subscriptions.delete(Z.params?.[0]))};return L.requests.set(te,ie),L.send(JSON.stringify({jsonrpc:"2.0",...Z,id:te})),L}async function webSocketAsync(L,{body:Z,timeout:X=1e4}){return withTimeout(()=>new Promise(te=>rpc$1.webSocket(L,{body:Z,onResponse:te})),{errorInstance:new TimeoutError({body:Z,url:L.url}),timeout:X})}const rpc$1={http:http$1,webSocket:webSocket$1,webSocketAsync};function http(L,Z={}){const{batch:X,fetchOptions:te,key:ie="http",name:oe="HTTP JSON-RPC",retryDelay:se}=Z;return({chain:ue,retryCount:ce,timeout:le})=>{const{batchSize:de=1e3,wait:he=0}=typeof X=="object"?X:{},ge=Z.retryCount??ce,_e=le??Z.timeout??1e4,Ae=L||ue?.rpcUrls.default.http[0];if(!Ae)throw new UrlRequiredError;return createTransport({key:ie,name:oe,async request({method:xe,params:Ie}){const Pe={method:xe,params:Ie},{schedule:Ce}=createBatchScheduler({id:`${L}`,wait:he,shouldSplitBatch(Ke){return Ke.length>de},fn:Ke=>rpc$1.http(Ae,{body:Ke,fetchOptions:te,timeout:_e})}),Be=async Ke=>X?Ce(Ke):[await rpc$1.http(Ae,{body:Ke,fetchOptions:te,timeout:_e})],[{error:Ve,result:Ge}]=await Be(Pe);if(Ve)throw new RpcRequestError({body:Pe,error:Ve,url:Ae});return Ge},retryCount:ge,retryDelay:se,timeout:_e,type:"http"},{url:L})}}function isNullUniversalResolverError(L,Z){if(!(L instanceof BaseError))return!1;const X=L.walk(te=>te instanceof ContractFunctionRevertedError);return X instanceof ContractFunctionRevertedError?!!(X.data?.errorName==="ResolverNotFound"||X.data?.errorName==="ResolverWildcardNotSupported"||X.reason?.includes("Wildcard on non-extended resolvers is not supported")||Z==="reverse"&&X.reason===panicReasons[50]):!1}const bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,integerRegex=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function validateTypedData({domain:L,message:Z,primaryType:X,types:te}){const ie=te,oe=(se,ue)=>{for(const ce of se){const{name:le,type:de}=ce,he=de,ge=ue[le],_e=he.match(integerRegex);if(_e&&(typeof ge=="number"||typeof ge=="bigint")){const[Ie,Pe,Ce]=_e;numberToHex(ge,{signed:Pe==="int",size:parseInt(Ce)/8})}if(he==="address"&&typeof ge=="string"&&!isAddress(ge))throw new InvalidAddressError({address:ge});const Ae=he.match(bytesRegex);if(Ae){const[Ie,Pe]=Ae;if(Pe&&size$1(ge)!==parseInt(Pe))throw new BytesSizeMismatchError({expectedSize:parseInt(Pe),givenSize:size$1(ge)})}const xe=ie[he];xe&&oe(xe,ge)}};if(ie.EIP712Domain&&L&&oe(ie.EIP712Domain,L),X!=="EIP712Domain"){const se=ie[X];oe(se,Z)}}const docsPath="/docs/contract/encodeDeployData";function encodeDeployData({abi:L,args:Z,bytecode:X}){if(!Z||Z.length===0)return X;const te=L.find(oe=>"type"in oe&&oe.type==="constructor");if(!te)throw new AbiConstructorNotFoundError({docsPath});if(!("inputs"in te))throw new AbiConstructorParamsNotFoundError({docsPath});if(!te.inputs||te.inputs.length===0)throw new AbiConstructorParamsNotFoundError({docsPath});const ie=encodeAbiParameters(te.inputs,Z);return concatHex([X,ie])}function toRlp(L,Z){const X=Z||"hex";return format(bytesToRlp(parse(L)),X)}function parse(L){return Array.isArray(L)?L.map(parse):typeof L=="string"?toBytes$2(L):L}function format(L,Z="bytes"){return Z==="hex"?bytesToHex$1(L):L}function bytesToRlp(L){if(Array.isArray(L)){const Z=concat(L.map(bytesToRlp));return new Uint8Array([...encodeLength(Z.length,192),...Z])}return L.length===1&&L[0]<128?L:new Uint8Array([...encodeLength(L.length,128),...L])}function encodeLength(L,Z){return L<56?[Z+L]:[toBytes$2(L).length+Z+55,...toBytes$2(L)]}const statuses={"0x0":"reverted","0x1":"success"};function formatTransactionReceipt(L){return{...L,blockNumber:L.blockNumber?BigInt(L.blockNumber):null,contractAddress:L.contractAddress?L.contractAddress:null,cumulativeGasUsed:L.cumulativeGasUsed?BigInt(L.cumulativeGasUsed):null,effectiveGasPrice:L.effectiveGasPrice?BigInt(L.effectiveGasPrice):null,gasUsed:L.gasUsed?BigInt(L.gasUsed):null,logs:L.logs?L.logs.map(Z=>formatLog(Z)):null,to:L.to?L.to:null,transactionIndex:L.transactionIndex?hexToNumber$1(L.transactionIndex):null,status:L.status?statuses[L.status]:null,type:L.type?transactionType[L.type]||L.type:null}}function hashTypedData({domain:L,message:Z,primaryType:X,types:te}){const ie=typeof L>"u"?{}:L,oe={EIP712Domain:[typeof ie?.name=="string"&&{name:"name",type:"string"},ie?.version&&{name:"version",type:"string"},typeof ie?.chainId=="number"&&{name:"chainId",type:"uint256"},ie?.verifyingContract&&{name:"verifyingContract",type:"address"},ie?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean),...te};validateTypedData({domain:ie,message:Z,primaryType:X,types:oe});const se=["0x1901"];return ie&&se.push(hashDomain({domain:ie,types:oe})),X!=="EIP712Domain"&&se.push(hashStruct({data:Z,primaryType:X,types:oe})),keccak256(concat(se))}function hashDomain({domain:L,types:Z}){return hashStruct({data:L,primaryType:"EIP712Domain",types:Z})}function hashStruct({data:L,primaryType:Z,types:X}){const te=encodeData({data:L,primaryType:Z,types:X});return keccak256(te)}function encodeData({data:L,primaryType:Z,types:X}){const te=[{type:"bytes32"}],ie=[hashType({primaryType:Z,types:X})];for(const oe of X[Z]){const[se,ue]=encodeField({types:X,name:oe.name,type:oe.type,value:L[oe.name]});te.push(se),ie.push(ue)}return encodeAbiParameters(te,ie)}function hashType({primaryType:L,types:Z}){const X=toHex(encodeType({primaryType:L,types:Z}));return keccak256(X)}function encodeType({primaryType:L,types:Z}){let X="";const te=findTypeDependencies({primaryType:L,types:Z});te.delete(L);const ie=[L,...Array.from(te).sort()];for(const oe of ie)X+=`${oe}(${Z[oe].map(({name:se,type:ue})=>`${ue} ${se}`).join(",")})`;return X}function findTypeDependencies({primaryType:L,types:Z},X=new Set){const ie=L.match(/^\w*/u)?.[0];if(X.has(ie)||Z[ie]===void 0)return X;X.add(ie);for(const oe of Z[ie])findTypeDependencies({primaryType:oe.type,types:Z},X);return X}function encodeField({types:L,name:Z,type:X,value:te}){if(L[X]!==void 0)return[{type:"bytes32"},keccak256(encodeData({data:te,primaryType:X,types:L}))];if(X==="bytes")return te=`0x${(te.length%2?"0":"")+te.slice(2)}`,[{type:"bytes32"},keccak256(te)];if(X==="string")return[{type:"bytes32"},keccak256(toHex(te))];if(X.lastIndexOf("]")===X.length-1){const ie=X.slice(0,X.lastIndexOf("[")),oe=te.map(se=>encodeField({name:Z,type:ie,types:L,value:se}));return[{type:"bytes32"},keccak256(encodeAbiParameters(oe.map(([se])=>se),oe.map(([,se])=>se)))]}return[{type:X},te]}function hashMessage(L,Z){const X=(()=>typeof L=="string"?stringToBytes(L):L.raw instanceof Uint8Array?L.raw:toBytes$2(L.raw))(),te=stringToBytes(`Ethereum Signed Message: +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotFoundError"})}}class ClientChainNotConfiguredError extends BaseError{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}}class InvalidChainIdError extends BaseError{constructor({chainId:Z}){super(`Chain ID "${Z}" is invalid.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidChainIdError"})}}function assertCurrentChain({chain:L,currentChainId:Z}){if(!L)throw new ChainNotFoundError;if(Z!==L.id)throw new ChainMismatchError({chain:L,currentChainId:Z})}function defineChain(L,Z={}){const{fees:X=L.fees,formatters:te=L.formatters,serializers:ie=L.serializers}=Z;return{...L,fees:X,formatters:te,serializers:ie}}function getChainContractAddress({blockNumber:L,chain:Z,contract:X}){const te=Z?.contracts?.[X];if(!te)throw new ChainDoesNotSupportContract({chain:Z,contract:{name:X}});if(L&&te.blockCreated&&te.blockCreated>L)throw new ChainDoesNotSupportContract({blockNumber:L,chain:Z,contract:{name:X,blockCreated:te.blockCreated}});return te.address}function getCallError(L,{docsPath:Z,...X}){let te=L;return containsNodeError(L)&&(te=getNodeError(L,X)),new CallExecutionError(te,{docsPath:Z,...X})}const schedulerCache=new Map;function createBatchScheduler({fn:L,id:Z,shouldSplitBatch:X,wait:te=0}){const ie=async()=>{const le=ue();oe();const de=le.map(({args:he})=>he);de.length!==0&&L(de).then(he=>{le.forEach(({pendingPromise:ge},_e)=>ge.resolve?.([he[_e],he]))}).catch(he=>{le.forEach(({pendingPromise:ge})=>ge.reject?.(he))})},oe=()=>schedulerCache.delete(Z),se=()=>ue().map(({args:le})=>le),ue=()=>schedulerCache.get(Z)||[],ce=le=>schedulerCache.set(Z,[...ue(),le]);return{flush:oe,async schedule(le){const de={},he=new Promise((Ae,xe)=>{de.resolve=Ae,de.reject=xe});return X?.([...se(),le])&&ie(),ue().length>0?(ce({args:le,pendingPromise:de}),he):(ce({args:le,pendingPromise:de}),setTimeout(ie,te),he)}}}async function call(L,Z){const{account:X,batch:te=!!L.batch?.multicall,blockNumber:ie,blockTag:oe="latest",accessList:se,data:ue,gas:ce,gasPrice:le,maxFeePerGas:de,maxPriorityFeePerGas:he,nonce:ge,to:_e,value:Ae,...xe}=Z,Ie=X?parseAccount(X):void 0;try{assertRequest(Z);const Ce=(ie?numberToHex(ie):void 0)||oe,Be=L.chain?.formatters?.transactionRequest?.format||formatTransactionRequest,Ve=Be({...extract(xe,{format:Be}),from:Ie?.address,accessList:se,data:ue,gas:ce,gasPrice:le,maxFeePerGas:de,maxPriorityFeePerGas:he,nonce:ge,to:_e,value:Ae});if(te&&shouldPerformMulticall({request:Ve}))try{return await scheduleMulticall(L,{...Ve,blockNumber:ie,blockTag:oe})}catch(Ke){if(!(Ke instanceof ClientChainNotConfiguredError)&&!(Ke instanceof ChainDoesNotSupportContract))throw Ke}const Ge=await L.request({method:"eth_call",params:Ce?[Ve,Ce]:[Ve]});return Ge==="0x"?{data:void 0}:{data:Ge}}catch(Pe){const Ce=getRevertErrorData(Pe),{offchainLookup:Be,offchainLookupSignature:Ve}=await __vitePreload(()=>import("./ccip-abf0a7d9.js"),[]);if(Ce?.slice(0,10)===Ve&&_e)return{data:await Be(L,{data:Ce,to:_e})};throw getCallError(Pe,{...Z,account:Ie,chain:L.chain})}}function shouldPerformMulticall({request:L}){const{data:Z,to:X,...te}=L;return!(!Z||Z.startsWith(aggregate3Signature)||!X||Object.values(te).filter(ie=>typeof ie<"u").length>0)}async function scheduleMulticall(L,Z){const{batchSize:X=1024,wait:te=0}=typeof L.batch?.multicall=="object"?L.batch.multicall:{},{blockNumber:ie,blockTag:oe="latest",data:se,multicallAddress:ue,to:ce}=Z;let le=ue;if(!le){if(!L.chain)throw new ClientChainNotConfiguredError;le=getChainContractAddress({blockNumber:ie,chain:L.chain,contract:"multicall3"})}const he=(ie?numberToHex(ie):void 0)||oe,{schedule:ge}=createBatchScheduler({id:`${L.uid}.${he}`,wait:te,shouldSplitBatch(xe){return xe.reduce((Pe,{data:Ce})=>Pe+(Ce.length-2),0)>X*2},fn:async xe=>{const Ie=xe.map(Be=>({allowFailure:!0,callData:Be.data,target:Be.to})),Pe=encodeFunctionData({abi:multicall3Abi,args:[Ie],functionName:"aggregate3"}),Ce=await L.request({method:"eth_call",params:[{data:Pe,to:le},he]});return decodeFunctionResult({abi:multicall3Abi,args:[Ie],functionName:"aggregate3",data:Ce||"0x"})}}),[{returnData:_e,success:Ae}]=await ge({data:se,to:ce});if(!Ae)throw new RawContractError({data:_e});return _e==="0x"?{data:void 0}:{data:_e}}function getRevertErrorData(L){if(!(L instanceof BaseError))return;const Z=L.walk();return typeof Z.data=="object"?Z.data.data:Z.data}async function readContract(L,{abi:Z,address:X,args:te,functionName:ie,...oe}){const se=encodeFunctionData({abi:Z,args:te,functionName:ie});try{const{data:ue}=await call(L,{data:se,to:X,...oe});return decodeFunctionResult({abi:Z,args:te,functionName:ie,data:ue||"0x"})}catch(ue){throw getContractError(ue,{abi:Z,address:X,args:te,docsPath:"/docs/contract/readContract",functionName:ie})}}async function simulateContract(L,{abi:Z,address:X,args:te,dataSuffix:ie,functionName:oe,...se}){const ue=se.account?parseAccount(se.account):void 0,ce=encodeFunctionData({abi:Z,args:te,functionName:oe});try{const{data:le}=await call(L,{batch:!1,data:`${ce}${ie?ie.replace("0x",""):""}`,to:X,...se});return{result:decodeFunctionResult({abi:Z,args:te,functionName:oe,data:le||"0x"}),request:{abi:Z,address:X,args:te,dataSuffix:ie,functionName:oe,...se}}}catch(le){throw getContractError(le,{abi:Z,address:X,args:te,docsPath:"/docs/contract/simulateContract",functionName:oe,sender:ue?.address})}}const listenersCache=new Map,cleanupCache=new Map;let callbackCount=0;function observe(L,Z,X){const te=++callbackCount,ie=()=>listenersCache.get(L)||[],oe=()=>{const de=ie();listenersCache.set(L,de.filter(he=>he.id!==te))},se=()=>{const de=cleanupCache.get(L);ie().length===1&&de&&de(),oe()},ue=ie();if(listenersCache.set(L,[...ue,{id:te,fns:Z}]),ue&&ue.length>0)return se;const ce={};for(const de in Z)ce[de]=(...he)=>{const ge=ie();ge.length!==0&&ge.forEach(_e=>_e.fns[de]?.(...he))};const le=X(ce);return typeof le=="function"&&cleanupCache.set(L,le),se}async function wait(L){return new Promise(Z=>setTimeout(Z,L))}function poll(L,{emitOnBegin:Z,initialWaitTime:X,interval:te}){let ie=!0;const oe=()=>ie=!1;return(async()=>{let ue;Z&&(ue=await L({unpoll:oe}));const ce=await X?.(ue)??te;await wait(ce);const le=async()=>{ie&&(await L({unpoll:oe}),await wait(te),le())};le()})(),oe}const promiseCache=new Map,responseCache=new Map;function getCache(L){const Z=(ie,oe)=>({clear:()=>oe.delete(ie),get:()=>oe.get(ie),set:se=>oe.set(ie,se)}),X=Z(L,promiseCache),te=Z(L,responseCache);return{clear:()=>{X.clear(),te.clear()},promise:X,response:te}}async function withCache(L,{cacheKey:Z,cacheTime:X=1/0}){const te=getCache(Z),ie=te.response.get();if(ie&&X>0&&new Date().getTime()-ie.created.getTime()`blockNumber.${L}`;async function getBlockNumber(L,{cacheTime:Z=L.cacheTime,maxAge:X}={}){const te=await withCache(()=>L.request({method:"eth_blockNumber"}),{cacheKey:cacheKey(L.uid),cacheTime:X??Z});return BigInt(te)}const docsPath$1="/docs/contract/decodeEventLog";function decodeEventLog({abi:L,data:Z,strict:X,topics:te}){const ie=X??!0,[oe,...se]=te;if(!oe)throw new AbiEventSignatureEmptyTopicsError({docsPath:docsPath$1});const ue=L.find(Ae=>Ae.type==="event"&&oe===getEventSelector(formatAbiItem(Ae)));if(!(ue&&"name"in ue)||ue.type!=="event")throw new AbiEventSignatureNotFoundError(oe,{docsPath:docsPath$1});const{name:ce,inputs:le}=ue,de=le?.some(Ae=>!("name"in Ae&&Ae.name));let he=de?[]:{};const ge=le.filter(Ae=>"indexed"in Ae&&Ae.indexed);if(se.length>0)for(let Ae=0;Ae!("indexed"in Ae&&Ae.indexed));if(_e.length>0){if(Z&&Z!=="0x")try{const Ae=decodeAbiParameters(_e,Z);if(Ae)if(de)he=[...he,...Ae];else for(let xe=0;xe<_e.length;xe++)he[_e[xe].name]=Ae[xe]}catch(Ae){if(ie)throw Ae instanceof AbiDecodingDataSizeTooSmallError?new DecodeLogDataMismatch({abiItem:ue,data:Ae.data,params:Ae.params,size:Ae.size}):Ae}else if(ie)throw new DecodeLogDataMismatch({abiItem:ue,data:"0x",params:_e,size:0})}return{eventName:ce,args:Object.values(he).length>0?he:void 0}}function decodeTopic({param:L,value:Z}){return L.type==="string"||L.type==="bytes"||L.type==="tuple"||L.type.match(/^(.*)\[(\d+)?\]$/)?Z:(decodeAbiParameters([L],Z)||[])[0]}function formatLog(L,{args:Z,eventName:X}={}){return{...L,blockHash:L.blockHash?L.blockHash:null,blockNumber:L.blockNumber?BigInt(L.blockNumber):null,logIndex:L.logIndex?Number(L.logIndex):null,transactionHash:L.transactionHash?L.transactionHash:null,transactionIndex:L.transactionIndex?Number(L.transactionIndex):null,...X?{args:Z,eventName:X}:{}}}async function getFilterChanges(L,{filter:Z}){const X="strict"in Z&&Z.strict;return(await Z.request({method:"eth_getFilterChanges",params:[Z.id]})).map(ie=>{if(typeof ie=="string")return ie;try{const{eventName:oe,args:se}="abi"in Z&&Z.abi?decodeEventLog({abi:Z.abi,data:ie.data,topics:ie.topics,strict:X}):{eventName:void 0,args:void 0};return formatLog(ie,{args:se,eventName:oe})}catch(oe){let se,ue;if(oe instanceof DecodeLogDataMismatch||oe instanceof DecodeLogTopicsMismatch){if("strict"in Z&&Z.strict)return;se=oe.abiItem.name,ue=oe.abiItem.inputs?.some(ce=>!("name"in ce&&ce.name))}return formatLog(ie,{args:ue?[]:{},eventName:se})}}).filter(Boolean)}async function getLogs(L,{address:Z,blockHash:X,fromBlock:te,toBlock:ie,event:oe,events:se,args:ue,strict:ce}={}){const le=ce??!1,de=se??(oe?[oe]:void 0);let he=[];de&&(he=[de.flatMap(_e=>encodeEventTopics({abi:[_e],eventName:_e.name,args:ue}))],oe&&(he=he[0]));let ge;return X?ge=await L.request({method:"eth_getLogs",params:[{address:Z,topics:he,blockHash:X}]}):ge=await L.request({method:"eth_getLogs",params:[{address:Z,topics:he,fromBlock:typeof te=="bigint"?numberToHex(te):te,toBlock:typeof ie=="bigint"?numberToHex(ie):ie}]}),ge.map(_e=>{try{const{eventName:Ae,args:xe}=de?decodeEventLog({abi:de,data:_e.data,topics:_e.topics,strict:le}):{eventName:void 0,args:void 0};return formatLog(_e,{args:xe,eventName:Ae})}catch(Ae){let xe,Ie;if(Ae instanceof DecodeLogDataMismatch||Ae instanceof DecodeLogTopicsMismatch){if(le)return;xe=Ae.abiItem.name,Ie=Ae.abiItem.inputs?.some(Pe=>!("name"in Pe&&Pe.name))}return formatLog(_e,{args:Ie?[]:{},eventName:xe})}}).filter(Boolean)}async function uninstallFilter(L,{filter:Z}){return Z.request({method:"eth_uninstallFilter",params:[Z.id]})}function watchContractEvent(L,{abi:Z,address:X,args:te,batch:ie=!0,eventName:oe,onError:se,onLogs:ue,poll:ce,pollingInterval:le=L.pollingInterval,strict:de}){return(typeof ce<"u"?ce:L.transport.type!=="webSocket")?(()=>{const Ae=stringify(["watchContractEvent",X,te,ie,L.uid,oe,le]),xe=de??!1;return observe(Ae,{onLogs:ue,onError:se},Ie=>{let Pe,Ce,Be=!1;const Ve=poll(async()=>{if(!Be){try{Ce=await createContractEventFilter(L,{abi:Z,address:X,args:te,eventName:oe,strict:xe})}catch{}Be=!0;return}try{let Ge;if(Ce)Ge=await getFilterChanges(L,{filter:Ce});else{const Ke=await getBlockNumber(L);Pe&&Pe!==Ke?Ge=await getLogs(L,{address:X,args:te,fromBlock:Pe+1n,toBlock:Ke,event:getAbiItem({abi:Z,name:oe})}):Ge=[],Pe=Ke}if(Ge.length===0)return;ie?Ie.onLogs(Ge):Ge.forEach(Ke=>Ie.onLogs([Ke]))}catch(Ge){Ce&&Ge instanceof InvalidInputRpcError&&(Be=!1),Ie.onError?.(Ge)}},{emitOnBegin:!0,interval:le});return async()=>{Ce&&await uninstallFilter(L,{filter:Ce}),Ve()}})})():(()=>{let Ae=!0,xe=()=>Ae=!1;return(async()=>{try{const Ie=oe?encodeEventTopics({abi:Z,eventName:oe,args:te}):[],{unsubscribe:Pe}=await L.transport.subscribe({params:["logs",{address:X,topics:Ie}],onData(Ce){if(!Ae)return;const Be=Ce.result;try{const{eventName:Ve,args:Ge}=decodeEventLog({abi:Z,data:Be.data,topics:Be.topics,strict:de}),Ke=formatLog(Be,{args:Ge,eventName:Ve});ue([Ke])}catch(Ve){let Ge,Ke;if(Ve instanceof DecodeLogDataMismatch||Ve instanceof DecodeLogTopicsMismatch){if(de)return;Ge=Ve.abiItem.name,Ke=Ve.abiItem.inputs?.some(et=>!("name"in et&&et.name))}const Je=formatLog(Be,{args:Ke?[]:{},eventName:Ge});ue([Je])}},onError(Ce){se?.(Ce)}});xe=Pe,Ae||xe()}catch(Ie){se?.(Ie)}})(),xe})()}function getTransactionError(L,{docsPath:Z,...X}){let te=L;return containsNodeError(L)&&(te=getNodeError(L,X)),new TransactionExecutionError(te,{docsPath:Z,...X})}async function getChainId(L){const Z=await L.request({method:"eth_chainId"});return hexToNumber$1(Z)}async function sendTransaction(L,Z){const{account:X=L.account,chain:te=L.chain,accessList:ie,data:oe,gas:se,gasPrice:ue,maxFeePerGas:ce,maxPriorityFeePerGas:le,nonce:de,to:he,value:ge,..._e}=Z;if(!X)throw new AccountNotFoundError({docsPath:"/docs/actions/wallet/sendTransaction"});const Ae=parseAccount(X);try{assertRequest(Z);let xe;if(te!==null&&(xe=await getChainId(L),assertCurrentChain({currentChainId:xe,chain:te})),Ae.type==="local"){const Ce=await prepareRequest(L,{account:Ae,accessList:ie,chain:te,data:oe,gas:se,gasPrice:ue,maxFeePerGas:ce,maxPriorityFeePerGas:le,nonce:de,to:he,value:ge,..._e});xe||(xe=await getChainId(L));const Be=te?.serializers?.transaction,Ve=await Ae.signTransaction({...Ce,chainId:xe},{serializer:Be});return await L.request({method:"eth_sendRawTransaction",params:[Ve]})}const Ie=te?.formatters?.transactionRequest?.format||formatTransactionRequest,Pe=Ie({...extract(_e,{format:Ie}),accessList:ie,data:oe,from:Ae.address,gas:se,gasPrice:ue,maxFeePerGas:ce,maxPriorityFeePerGas:le,nonce:de,to:he,value:ge});return await L.request({method:"eth_sendTransaction",params:[Pe]})}catch(xe){throw getTransactionError(xe,{...Z,account:Ae,chain:Z.chain||void 0})}}async function writeContract(L,{abi:Z,address:X,args:te,dataSuffix:ie,functionName:oe,...se}){const ue=encodeFunctionData({abi:Z,args:te,functionName:oe});return await sendTransaction(L,{data:`${ue}${ie?ie.replace("0x",""):""}`,to:X,...se})}function getContract({abi:L,address:Z,publicClient:X,walletClient:te}){const ie=X!=null,oe=te!=null,se={};let ue=!1,ce=!1,le=!1;for(const de of L)if(de.type==="function"?de.stateMutability==="view"||de.stateMutability==="pure"?ue=!0:ce=!0:de.type==="event"&&(le=!0),ue&&ce&&le)break;return ie&&(ue&&(se.read=new Proxy({},{get(de,he){return(...ge)=>{const{args:_e,options:Ae}=getFunctionParameters(ge);return readContract(X,{abi:L,address:Z,functionName:he,args:_e,...Ae})}}})),ce&&(se.simulate=new Proxy({},{get(de,he){return(...ge)=>{const{args:_e,options:Ae}=getFunctionParameters(ge);return simulateContract(X,{abi:L,address:Z,functionName:he,args:_e,...Ae})}}})),le&&(se.createEventFilter=new Proxy({},{get(de,he){return(...ge)=>{const _e=L.find(Ie=>Ie.type==="event"&&Ie.name===he),{args:Ae,options:xe}=getEventParameters(ge,_e);return createContractEventFilter(X,{abi:L,address:Z,eventName:he,args:Ae,...xe})}}}),se.watchEvent=new Proxy({},{get(de,he){return(...ge)=>{const _e=L.find(Ie=>Ie.type==="event"&&Ie.name===he),{args:Ae,options:xe}=getEventParameters(ge,_e);return watchContractEvent(X,{abi:L,address:Z,eventName:he,args:Ae,...xe})}}}))),oe&&ce&&(se.write=new Proxy({},{get(de,he){return(...ge)=>{const{args:_e,options:Ae}=getFunctionParameters(ge);return writeContract(te,{abi:L,address:Z,functionName:he,args:_e,...Ae})}}})),(ie||oe)&&ce&&(se.estimateGas=new Proxy({},{get(de,he){return(...ge)=>{const{args:_e,options:Ae}=getFunctionParameters(ge);return estimateContractGas(X??te,{abi:L,address:Z,functionName:he,args:_e,...Ae,account:Ae.account??te.account})}}})),se.address=Z,se.abi=L,se}function getFunctionParameters(L){const Z=L.length&&Array.isArray(L[0]),X=Z?L[0]:[],te=(Z?L[1]:L[0])??{};return{args:X,options:te}}function getEventParameters(L,Z){let X=!1;Array.isArray(L[0])?X=!0:L.length===1?X=Z.inputs.some(oe=>oe.indexed):L.length===2&&(X=!0);const te=X?L[0]:void 0,ie=(X?L[1]:L[0])??{};return{args:te,options:ie}}async function addChain(L,{chain:Z}){const{id:X,name:te,nativeCurrency:ie,rpcUrls:oe,blockExplorers:se}=Z;await L.request({method:"wallet_addEthereumChain",params:[{chainId:numberToHex(X),chainName:te,nativeCurrency:ie,rpcUrls:oe.default.http,blockExplorerUrls:se?Object.values(se).map(({url:ue})=>ue):void 0}]})}function publicKeyToAddress(L){const Z=keccak256(`0x${L.substring(4)}`).substring(26);return checksumAddress(`0x${Z}`)}const size=256;let index=size,buffer;function uid(L=11){if(!buffer||index+L>size*2){buffer="",index=0;for(let Z=0;Z{const Pe=Ie(xe);for(const Be in _e)delete Pe[Be];const Ce={...xe,...Pe};return Object.assign(Ce,{extend:Ae(Ce)})}}return Object.assign(_e,{extend:Ae(_e)})}function withRetry(L,{delay:Z=100,retryCount:X=2,shouldRetry:te=()=>!0}={}){return new Promise((ie,oe)=>{const se=async({count:ue=0}={})=>{const ce=async({error:le})=>{const de=typeof Z=="function"?Z({count:ue,error:le}):Z;de&&await wait(de),se({count:ue+1})};try{const le=await L();ie(le)}catch(le){if(ue"code"in L?L.code!==-1&&L.code!==-32004&&L.code!==-32005&&L.code!==-32042&&L.code!==-32603:L instanceof HttpRequestError&&L.status?L.status!==403&&L.status!==408&&L.status!==413&&L.status!==429&&L.status!==500&&L.status!==502&&L.status!==503&&L.status!==504:!1;function buildRequest(L,{retryDelay:Z=150,retryCount:X=3}={}){return async te=>withRetry(async()=>{try{return await L(te)}catch(ie){const oe=ie;switch(oe.code){case ParseRpcError.code:throw new ParseRpcError(oe);case InvalidRequestRpcError.code:throw new InvalidRequestRpcError(oe);case MethodNotFoundRpcError.code:throw new MethodNotFoundRpcError(oe);case InvalidParamsRpcError.code:throw new InvalidParamsRpcError(oe);case InternalRpcError.code:throw new InternalRpcError(oe);case InvalidInputRpcError.code:throw new InvalidInputRpcError(oe);case ResourceNotFoundRpcError.code:throw new ResourceNotFoundRpcError(oe);case ResourceUnavailableRpcError.code:throw new ResourceUnavailableRpcError(oe);case TransactionRejectedRpcError.code:throw new TransactionRejectedRpcError(oe);case MethodNotSupportedRpcError.code:throw new MethodNotSupportedRpcError(oe);case LimitExceededRpcError.code:throw new LimitExceededRpcError(oe);case JsonRpcVersionUnsupportedError.code:throw new JsonRpcVersionUnsupportedError(oe);case UserRejectedRequestError.code:throw new UserRejectedRequestError(oe);case UnauthorizedProviderError.code:throw new UnauthorizedProviderError(oe);case UnsupportedProviderMethodError.code:throw new UnsupportedProviderMethodError(oe);case ProviderDisconnectedError.code:throw new ProviderDisconnectedError(oe);case ChainDisconnectedError.code:throw new ChainDisconnectedError(oe);case SwitchChainError.code:throw new SwitchChainError(oe);default:throw ie instanceof BaseError?ie:new UnknownRpcError(oe)}}},{delay:({count:ie,error:oe})=>{if(oe&&oe instanceof HttpRequestError){const se=oe?.headers?.get("Retry-After");if(se?.match(/\d/))return parseInt(se)*1e3}return~~(1<!isDeterministicError(ie)})}function createTransport({key:L,name:Z,request:X,retryCount:te=3,retryDelay:ie=150,timeout:oe,type:se},ue){return{config:{key:L,name:Z,request:X,retryCount:te,retryDelay:ie,timeout:oe,type:se},request:buildRequest(X,{retryCount:te,retryDelay:ie}),value:ue}}function fallback(L,Z={}){const{key:X="fallback",name:te="Fallback",rank:ie=!1,retryCount:oe,retryDelay:se}=Z;return({chain:ue,pollingInterval:ce=4e3,timeout:le})=>{let de=L,he=()=>{};const ge=createTransport({key:X,name:te,async request({method:_e,params:Ae}){const xe=async(Ie=0)=>{const Pe=de[Ie]({chain:ue,retryCount:0,timeout:le});try{const Ce=await Pe.request({method:_e,params:Ae});return he({method:_e,params:Ae,response:Ce,transport:Pe,status:"success"}),Ce}catch(Ce){if(he({error:Ce,method:_e,params:Ae,transport:Pe,status:"error"}),isDeterministicError(Ce)||Ie===de.length-1)throw Ce;return xe(Ie+1)}};return xe()},retryCount:oe,retryDelay:se,type:"fallback"},{onResponse:_e=>he=_e,transports:de.map(_e=>_e({chain:ue,retryCount:0}))});if(ie){const _e=typeof ie=="object"?ie:{};rankTransports({chain:ue,interval:_e.interval??ce,onTransports:Ae=>de=Ae,sampleCount:_e.sampleCount,timeout:_e.timeout,transports:de,weights:_e.weights})}return ge}}function rankTransports({chain:L,interval:Z=4e3,onTransports:X,sampleCount:te=10,timeout:ie=1e3,transports:oe,weights:se={}}){const{stability:ue=.7,latency:ce=.3}=se,le=[],de=async()=>{const he=await Promise.all(oe.map(async Ae=>{const xe=Ae({chain:L,retryCount:0,timeout:ie}),Ie=Date.now();let Pe,Ce;try{await xe.request({method:"net_listening"}),Ce=1}catch{Ce=0}finally{Pe=Date.now()}return{latency:Pe-Ie,success:Ce}}));le.push(he),le.length>te&&le.shift();const ge=Math.max(...le.map(Ae=>Math.max(...Ae.map(({latency:xe})=>xe)))),_e=oe.map((Ae,xe)=>{const Ie=le.map(Ge=>Ge[xe].latency),Ce=1-Ie.reduce((Ge,Ke)=>Ge+Ke,0)/Ie.length/ge,Be=le.map(Ge=>Ge[xe].success),Ve=Be.reduce((Ge,Ke)=>Ge+Ke,0)/Be.length;return Ve===0?[0,xe]:[ce*Ce+ue*Ve,xe]}).sort((Ae,xe)=>xe[0]-Ae[0]);X(_e.map(([,Ae])=>oe[Ae])),await wait(Z),de()};de()}class UrlRequiredError extends BaseError{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}}function withTimeout(L,{errorInstance:Z,timeout:X,signal:te}){return new Promise((ie,oe)=>{(async()=>{let se;try{const ue=new AbortController;X>0&&(se=setTimeout(()=>{te?ue.abort():oe(Z)},X)),ie(await L({signal:ue?.signal}))}catch(ue){ue.name==="AbortError"&&oe(Z),oe(ue)}finally{clearTimeout(se)}})()})}let id=0;async function http$1(L,{body:Z,fetchOptions:X={},timeout:te=1e4}){const{headers:ie,method:oe,signal:se}=X;try{const ue=await withTimeout(async({signal:le})=>await fetch(L,{...X,body:Array.isArray(Z)?stringify(Z.map(he=>({jsonrpc:"2.0",id:id++,...he}))):stringify({jsonrpc:"2.0",id:id++,...Z}),headers:{...ie,"Content-Type":"application/json"},method:oe||"POST",signal:se||(te>0?le:void 0)}),{errorInstance:new TimeoutError({body:Z,url:L}),timeout:te,signal:!0});let ce;if(ue.headers.get("Content-Type")?.startsWith("application/json")?ce=await ue.json():ce=await ue.text(),!ue.ok)throw new HttpRequestError({body:Z,details:stringify(ce.error)||ue.statusText,headers:ue.headers,status:ue.status,url:L});return ce}catch(ue){throw ue instanceof HttpRequestError||ue instanceof TimeoutError?ue:new HttpRequestError({body:Z,details:ue.message,url:L})}}const sockets=new Map;async function getSocket(L){const Z=new URL(L),X=Z.toString();let te=sockets.get(X);if(te)return te;const{schedule:ie}=createBatchScheduler({id:X,fn:async()=>{let ue=await __vitePreload(()=>import("./browser-3852a342.js"),[]);ue.default?.constructor?ue=ue.default:ue=ue.WebSocket;const ce=new ue(Z),le=new Map,de=new Map,he=({data:_e})=>{const Ae=JSON.parse(_e),xe=Ae.method==="eth_subscription",Ie=xe?Ae.params.subscription:Ae.id,Pe=xe?de:le,Ce=Pe.get(Ie);Ce&&Ce({data:_e}),xe||Pe.delete(Ie)},ge=()=>{sockets.delete(X),ce.removeEventListener("close",ge),ce.removeEventListener("message",he)};return ce.addEventListener("close",ge),ce.addEventListener("message",he),ce.readyState===ue.CONNECTING&&await new Promise((_e,Ae)=>{ce&&(ce.onopen=_e,ce.onerror=Ae)}),te=Object.assign(ce,{requests:le,subscriptions:de}),sockets.set(X,te),[te]}}),[oe,[se]]=await ie();return se}function webSocket$1(L,{body:Z,onResponse:X}){if(L.readyState===L.CLOSED||L.readyState===L.CLOSING)throw new WebSocketRequestError({body:Z,url:L.url,details:"Socket is closed."});const te=id++,ie=({data:oe})=>{const se=JSON.parse(oe);typeof se.id=="number"&&te!==se.id||(X?.(se),Z.method==="eth_subscribe"&&typeof se.result=="string"&&L.subscriptions.set(se.result,ie),Z.method==="eth_unsubscribe"&&L.subscriptions.delete(Z.params?.[0]))};return L.requests.set(te,ie),L.send(JSON.stringify({jsonrpc:"2.0",...Z,id:te})),L}async function webSocketAsync(L,{body:Z,timeout:X=1e4}){return withTimeout(()=>new Promise(te=>rpc$1.webSocket(L,{body:Z,onResponse:te})),{errorInstance:new TimeoutError({body:Z,url:L.url}),timeout:X})}const rpc$1={http:http$1,webSocket:webSocket$1,webSocketAsync};function http(L,Z={}){const{batch:X,fetchOptions:te,key:ie="http",name:oe="HTTP JSON-RPC",retryDelay:se}=Z;return({chain:ue,retryCount:ce,timeout:le})=>{const{batchSize:de=1e3,wait:he=0}=typeof X=="object"?X:{},ge=Z.retryCount??ce,_e=le??Z.timeout??1e4,Ae=L||ue?.rpcUrls.default.http[0];if(!Ae)throw new UrlRequiredError;return createTransport({key:ie,name:oe,async request({method:xe,params:Ie}){const Pe={method:xe,params:Ie},{schedule:Ce}=createBatchScheduler({id:`${L}`,wait:he,shouldSplitBatch(Ke){return Ke.length>de},fn:Ke=>rpc$1.http(Ae,{body:Ke,fetchOptions:te,timeout:_e})}),Be=async Ke=>X?Ce(Ke):[await rpc$1.http(Ae,{body:Ke,fetchOptions:te,timeout:_e})],[{error:Ve,result:Ge}]=await Be(Pe);if(Ve)throw new RpcRequestError({body:Pe,error:Ve,url:Ae});return Ge},retryCount:ge,retryDelay:se,timeout:_e,type:"http"},{url:L})}}function isNullUniversalResolverError(L,Z){if(!(L instanceof BaseError))return!1;const X=L.walk(te=>te instanceof ContractFunctionRevertedError);return X instanceof ContractFunctionRevertedError?!!(X.data?.errorName==="ResolverNotFound"||X.data?.errorName==="ResolverWildcardNotSupported"||X.reason?.includes("Wildcard on non-extended resolvers is not supported")||Z==="reverse"&&X.reason===panicReasons[50]):!1}const bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,integerRegex=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function validateTypedData({domain:L,message:Z,primaryType:X,types:te}){const ie=te,oe=(se,ue)=>{for(const ce of se){const{name:le,type:de}=ce,he=de,ge=ue[le],_e=he.match(integerRegex);if(_e&&(typeof ge=="number"||typeof ge=="bigint")){const[Ie,Pe,Ce]=_e;numberToHex(ge,{signed:Pe==="int",size:parseInt(Ce)/8})}if(he==="address"&&typeof ge=="string"&&!isAddress(ge))throw new InvalidAddressError({address:ge});const Ae=he.match(bytesRegex);if(Ae){const[Ie,Pe]=Ae;if(Pe&&size$1(ge)!==parseInt(Pe))throw new BytesSizeMismatchError({expectedSize:parseInt(Pe),givenSize:size$1(ge)})}const xe=ie[he];xe&&oe(xe,ge)}};if(ie.EIP712Domain&&L&&oe(ie.EIP712Domain,L),X!=="EIP712Domain"){const se=ie[X];oe(se,Z)}}const docsPath="/docs/contract/encodeDeployData";function encodeDeployData({abi:L,args:Z,bytecode:X}){if(!Z||Z.length===0)return X;const te=L.find(oe=>"type"in oe&&oe.type==="constructor");if(!te)throw new AbiConstructorNotFoundError({docsPath});if(!("inputs"in te))throw new AbiConstructorParamsNotFoundError({docsPath});if(!te.inputs||te.inputs.length===0)throw new AbiConstructorParamsNotFoundError({docsPath});const ie=encodeAbiParameters(te.inputs,Z);return concatHex([X,ie])}function toRlp(L,Z){const X=Z||"hex";return format(bytesToRlp(parse(L)),X)}function parse(L){return Array.isArray(L)?L.map(parse):typeof L=="string"?toBytes$2(L):L}function format(L,Z="bytes"){return Z==="hex"?bytesToHex$1(L):L}function bytesToRlp(L){if(Array.isArray(L)){const Z=concat(L.map(bytesToRlp));return new Uint8Array([...encodeLength(Z.length,192),...Z])}return L.length===1&&L[0]<128?L:new Uint8Array([...encodeLength(L.length,128),...L])}function encodeLength(L,Z){return L<56?[Z+L]:[toBytes$2(L).length+Z+55,...toBytes$2(L)]}const statuses={"0x0":"reverted","0x1":"success"};function formatTransactionReceipt(L){return{...L,blockNumber:L.blockNumber?BigInt(L.blockNumber):null,contractAddress:L.contractAddress?L.contractAddress:null,cumulativeGasUsed:L.cumulativeGasUsed?BigInt(L.cumulativeGasUsed):null,effectiveGasPrice:L.effectiveGasPrice?BigInt(L.effectiveGasPrice):null,gasUsed:L.gasUsed?BigInt(L.gasUsed):null,logs:L.logs?L.logs.map(Z=>formatLog(Z)):null,to:L.to?L.to:null,transactionIndex:L.transactionIndex?hexToNumber$1(L.transactionIndex):null,status:L.status?statuses[L.status]:null,type:L.type?transactionType[L.type]||L.type:null}}function hashTypedData({domain:L,message:Z,primaryType:X,types:te}){const ie=typeof L>"u"?{}:L,oe={EIP712Domain:[typeof ie?.name=="string"&&{name:"name",type:"string"},ie?.version&&{name:"version",type:"string"},typeof ie?.chainId=="number"&&{name:"chainId",type:"uint256"},ie?.verifyingContract&&{name:"verifyingContract",type:"address"},ie?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean),...te};validateTypedData({domain:ie,message:Z,primaryType:X,types:oe});const se=["0x1901"];return ie&&se.push(hashDomain({domain:ie,types:oe})),X!=="EIP712Domain"&&se.push(hashStruct({data:Z,primaryType:X,types:oe})),keccak256(concat(se))}function hashDomain({domain:L,types:Z}){return hashStruct({data:L,primaryType:"EIP712Domain",types:Z})}function hashStruct({data:L,primaryType:Z,types:X}){const te=encodeData({data:L,primaryType:Z,types:X});return keccak256(te)}function encodeData({data:L,primaryType:Z,types:X}){const te=[{type:"bytes32"}],ie=[hashType({primaryType:Z,types:X})];for(const oe of X[Z]){const[se,ue]=encodeField({types:X,name:oe.name,type:oe.type,value:L[oe.name]});te.push(se),ie.push(ue)}return encodeAbiParameters(te,ie)}function hashType({primaryType:L,types:Z}){const X=toHex(encodeType({primaryType:L,types:Z}));return keccak256(X)}function encodeType({primaryType:L,types:Z}){let X="";const te=findTypeDependencies({primaryType:L,types:Z});te.delete(L);const ie=[L,...Array.from(te).sort()];for(const oe of ie)X+=`${oe}(${Z[oe].map(({name:se,type:ue})=>`${ue} ${se}`).join(",")})`;return X}function findTypeDependencies({primaryType:L,types:Z},X=new Set){const ie=L.match(/^\w*/u)?.[0];if(X.has(ie)||Z[ie]===void 0)return X;X.add(ie);for(const oe of Z[ie])findTypeDependencies({primaryType:oe.type,types:Z},X);return X}function encodeField({types:L,name:Z,type:X,value:te}){if(L[X]!==void 0)return[{type:"bytes32"},keccak256(encodeData({data:te,primaryType:X,types:L}))];if(X==="bytes")return te=`0x${(te.length%2?"0":"")+te.slice(2)}`,[{type:"bytes32"},keccak256(te)];if(X==="string")return[{type:"bytes32"},keccak256(toHex(te))];if(X.lastIndexOf("]")===X.length-1){const ie=X.slice(0,X.lastIndexOf("[")),oe=te.map(se=>encodeField({name:Z,type:ie,types:L,value:se}));return[{type:"bytes32"},keccak256(encodeAbiParameters(oe.map(([se])=>se),oe.map(([,se])=>se)))]}return[{type:X},te]}function hashMessage(L,Z){const X=(()=>typeof L=="string"?stringToBytes(L):L.raw instanceof Uint8Array?L.raw:toBytes$2(L.raw))(),te=stringToBytes(`Ethereum Signed Message: ${X.length}`);return keccak256(concat([te,X]),Z)}function getTransactionType(L){if(L.type)return L.type;if(typeof L.maxFeePerGas<"u"||typeof L.maxPriorityFeePerGas<"u")return"eip1559";if(typeof L.gasPrice<"u")return typeof L.accessList<"u"?"eip2930":"legacy";throw new InvalidSerializableTransactionError({transaction:L})}function assertTransactionEIP1559(L){const{chainId:Z,maxPriorityFeePerGas:X,gasPrice:te,maxFeePerGas:ie,to:oe}=L;if(Z<=0)throw new InvalidChainIdError({chainId:Z});if(oe&&!isAddress(oe))throw new InvalidAddressError({address:oe});if(te)throw new BaseError("`gasPrice` is not a valid EIP-1559 Transaction attribute.");if(ie&&ie>2n**256n-1n)throw new FeeCapTooHighError({maxFeePerGas:ie});if(X&&ie&&X>ie)throw new TipAboveFeeCapError({maxFeePerGas:ie,maxPriorityFeePerGas:X})}function assertTransactionEIP2930(L){const{chainId:Z,maxPriorityFeePerGas:X,gasPrice:te,maxFeePerGas:ie,to:oe}=L;if(Z<=0)throw new InvalidChainIdError({chainId:Z});if(oe&&!isAddress(oe))throw new InvalidAddressError({address:oe});if(X||ie)throw new BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(te&&te>2n**256n-1n)throw new FeeCapTooHighError({maxFeePerGas:te})}function assertTransactionLegacy(L){const{chainId:Z,maxPriorityFeePerGas:X,gasPrice:te,maxFeePerGas:ie,to:oe,accessList:se}=L;if(oe&&!isAddress(oe))throw new InvalidAddressError({address:oe});if(typeof Z<"u"&&Z<=0)throw new InvalidChainIdError({chainId:Z});if(X||ie)throw new BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(te&&te>2n**256n-1n)throw new FeeCapTooHighError({maxFeePerGas:te});if(se)throw new BaseError("`accessList` is not a valid Legacy Transaction attribute.")}function serializeAccessList(L){if(!L||L.length===0)return[];const Z=[];for(let X=0;X0)de=BigInt(X*2)+BigInt(35n+Z.v-27n);else if(Z.v!==de)throw new InvalidLegacyVError({v:Z.v});le=[...le,toHex(de),Z.r,Z.s]}else X>0&&(le=[...le,toHex(X),"0x","0x"]);return toRlp(le)}function parseUnits(L,Z){let[X,te="0"]=L.split(".");const ie=X.startsWith("-");if(ie&&(X=X.slice(1)),te=te.replace(/(0+)$/,""),Z===0)Math.round(+`.${te}`)===1&&(X=`${BigInt(X)+1n}`),te="";else if(te.length>Z){const[oe,se,ue]=[te.slice(0,Z-1),te.slice(Z-1,Z),te.slice(Z)],ce=Math.round(+`${se}.${ue}`);ce>9?te=`${BigInt(oe)+BigInt(1)}0`.padStart(oe.length+1,"0"):te=`${oe}${ce}`,te.length>Z&&(te=te.slice(1),X=`${BigInt(X)+1n}`),te=te.slice(0,Z)}else te=te.padEnd(Z,"0");return BigInt(`${ie?"-":""}${X}${te}`)}function parseEther(L,Z="wei"){return parseUnits(L,etherUnits[Z])}function encodedLabelToLabelhash(L){if(L.length!==66||L.indexOf("[")!==0||L.indexOf("]")!==65)return null;const Z=`0x${L.slice(1,65)}`;return isHex(Z)?Z:null}function namehash(L){let Z=new Uint8Array(32).fill(0);if(!L)return bytesToHex$1(Z);const X=L.split(".");for(let te=X.length-1;te>=0;te-=1){const ie=encodedLabelToLabelhash(X[te]),oe=ie?toBytes$2(ie):keccak256(stringToBytes(X[te]),"bytes");Z=keccak256(concat([Z,oe]),"bytes")}return bytesToHex$1(Z)}function encodeLabelhash(L){return`[${L.slice(2)}]`}function labelhash(L){const Z=new Uint8Array(32).fill(0);return L?encodedLabelToLabelhash(L)||keccak256(stringToBytes(L)):bytesToHex$1(Z)}function packetToBytes(L){const Z=L.replace(/^\.|\.$/gm,"");if(Z.length===0)return new Uint8Array(1);const X=new Uint8Array(stringToBytes(Z).byteLength+2);let te=0;const ie=Z.split(".");for(let oe=0;oe255&&(se=stringToBytes(encodeLabelhash(labelhash(ie[oe])))),X[te]=se.length,X.set(se,te+1),te+=se.length+1}return X.byteLength!==te+1?X.slice(0,te+1):X}async function getEnsAddress(L,{blockNumber:Z,blockTag:X,coinType:te,name:ie,universalResolverAddress:oe}){let se=oe;if(!se){if(!L.chain)throw new Error("client chain not configured. universalResolverAddress is required.");se=getChainContractAddress({blockNumber:Z,chain:L.chain,contract:"ensUniversalResolver"})}try{const ue=encodeFunctionData({abi:addressResolverAbi,functionName:"addr",...te!=null?{args:[namehash(ie),BigInt(te)]}:{args:[namehash(ie)]}}),ce=await readContract(L,{address:se,abi:universalResolverResolveAbi,functionName:"resolve",args:[toHex(packetToBytes(ie)),ue],blockNumber:Z,blockTag:X});if(ce[0]==="0x")return null;const le=trim(decodeFunctionResult({abi:addressResolverAbi,args:te!=null?[namehash(ie),BigInt(te)]:void 0,functionName:"addr",data:ce[0]}));return le==="0x"||trim(le)==="0x00"?null:le}catch(ue){if(isNullUniversalResolverError(ue,"resolve"))return null;throw ue}}class EnsAvatarInvalidMetadataError extends BaseError{constructor({data:Z}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(Z)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidMetadataError"})}}class EnsAvatarInvalidNftUriError extends BaseError{constructor({reason:Z}){super(`ENS NFT avatar URI is invalid. ${Z}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}}class EnsAvatarUriResolutionError extends BaseError{constructor({uri:Z}){super(`Unable to resolve ENS avatar URI "${Z}". The URI may be malformed, invalid, or does not respond with a valid image.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUriResolutionError"})}}class EnsAvatarUnsupportedNamespaceError extends BaseError{constructor({namespace:Z}){super(`ENS NFT avatar namespace "${Z}" is not supported. Must be "erc721" or "erc1155".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUnsupportedNamespaceError"})}}const networkRegex=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,ipfsHashRegex=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?[\w\-.]+))?(?\/.*)?$/,base64Regex=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,dataURIRegex=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function isImageUri(L){try{const Z=await fetch(L,{method:"HEAD"});return Z.status===200?Z.headers.get("content-type")?.startsWith("image/"):!1}catch(Z){return typeof Z=="object"&&typeof Z.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(X=>{const te=new Image;te.onload=()=>{X(!0)},te.onerror=()=>{X(!1)},te.src=L})}}function getGateway(L,Z){return L?L.endsWith("/")?L.slice(0,-1):L:Z}function resolveAvatarUri({uri:L,gatewayUrls:Z}){const X=base64Regex.test(L);if(X)return{uri:L,isOnChain:!0,isEncoded:X};const te=getGateway(Z?.ipfs,"https://ipfs.io"),ie=getGateway(Z?.arweave,"https://arweave.net"),oe=L.match(networkRegex),{protocol:se,subpath:ue,target:ce,subtarget:le=""}=oe?.groups||{},de=se==="ipns:/"||ue==="ipns/",he=se==="ipfs:/"||ue==="ipfs/"||ipfsHashRegex.test(L);if(L.startsWith("http")&&!de&&!he){let _e=L;return Z?.arweave&&(_e=L.replace(/https:\/\/arweave.net/g,Z?.arweave)),{uri:_e,isOnChain:!1,isEncoded:!1}}if((de||he)&&ce)return{uri:`${te}/${de?"ipns":"ipfs"}/${ce}${le}`,isOnChain:!1,isEncoded:!1};if(se==="ar:/"&&ce)return{uri:`${ie}/${ce}${le||""}`,isOnChain:!1,isEncoded:!1};let ge=L.replace(dataURIRegex,"");if(ge.startsWith("ie.json());return await parseAvatarUri({gatewayUrls:L,uri:getJsonImage(X)})}catch{throw new EnsAvatarUriResolutionError({uri:Z})}}async function parseAvatarUri({gatewayUrls:L,uri:Z}){const{uri:X,isOnChain:te}=resolveAvatarUri({uri:Z,gatewayUrls:L});if(te||await isImageUri(X))return X;throw new EnsAvatarUriResolutionError({uri:Z})}function parseNftUri(L){let Z=L;Z.startsWith("did:nft:")&&(Z=Z.replace("did:nft:","").replace(/_/g,"/"));const[X,te,ie]=Z.split("/"),[oe,se]=X.split(":"),[ue,ce]=te.split(":");if(!oe||oe.toLowerCase()!=="eip155")throw new EnsAvatarInvalidNftUriError({reason:"Only EIP-155 supported"});if(!se)throw new EnsAvatarInvalidNftUriError({reason:"Chain ID not found"});if(!ce)throw new EnsAvatarInvalidNftUriError({reason:"Contract address not found"});if(!ie)throw new EnsAvatarInvalidNftUriError({reason:"Token ID not found"});if(!ue)throw new EnsAvatarInvalidNftUriError({reason:"ERC namespace not found"});return{chainID:parseInt(se),namespace:ue.toLowerCase(),contractAddress:ce,tokenID:ie}}async function getNftTokenUri(L,{nft:Z}){if(Z.namespace==="erc721")return readContract(L,{address:Z.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(Z.tokenID)]});if(Z.namespace==="erc1155")return readContract(L,{address:Z.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(Z.tokenID)]});throw new EnsAvatarUnsupportedNamespaceError({namespace:Z.namespace})}async function parseAvatarRecord(L,{gatewayUrls:Z,record:X}){return/eip155:/i.test(X)?parseNftAvatarUri(L,{gatewayUrls:Z,record:X}):parseAvatarUri({uri:X,gatewayUrls:Z})}async function parseNftAvatarUri(L,{gatewayUrls:Z,record:X}){const te=parseNftUri(X),ie=await getNftTokenUri(L,{nft:te}),{uri:oe,isOnChain:se,isEncoded:ue}=resolveAvatarUri({uri:ie,gatewayUrls:Z});if(se&&(oe.includes("data:application/json;base64,")||oe.startsWith("{"))){const le=ue?atob(oe.replace("data:application/json;base64,","")):oe,de=JSON.parse(le);return parseAvatarUri({uri:getJsonImage(de),gatewayUrls:Z})}let ce=te.tokenID;return te.namespace==="erc1155"&&(ce=ce.replace("0x","").padStart(64,"0")),getMetadataAvatarUri({gatewayUrls:Z,uri:oe.replace(/(?:0x)?{id}/,ce)})}async function getEnsText(L,{blockNumber:Z,blockTag:X,name:te,key:ie,universalResolverAddress:oe}){let se=oe;if(!se){if(!L.chain)throw new Error("client chain not configured. universalResolverAddress is required.");se=getChainContractAddress({blockNumber:Z,chain:L.chain,contract:"ensUniversalResolver"})}try{const ue=await readContract(L,{address:se,abi:universalResolverResolveAbi,functionName:"resolve",args:[toHex(packetToBytes(te)),encodeFunctionData({abi:textResolverAbi,functionName:"text",args:[namehash(te),ie]})],blockNumber:Z,blockTag:X});if(ue[0]==="0x")return null;const ce=decodeFunctionResult({abi:textResolverAbi,functionName:"text",data:ue[0]});return ce===""?null:ce}catch(ue){if(isNullUniversalResolverError(ue,"resolve"))return null;throw ue}}async function getEnsAvatar(L,{blockNumber:Z,blockTag:X,gatewayUrls:te,name:ie,universalResolverAddress:oe}){const se=await getEnsText(L,{blockNumber:Z,blockTag:X,key:"avatar",name:ie,universalResolverAddress:oe});if(!se)return null;try{return await parseAvatarRecord(L,{record:se,gatewayUrls:te})}catch{return null}}async function getEnsName(L,{address:Z,blockNumber:X,blockTag:te,universalResolverAddress:ie}){let oe=ie;if(!oe){if(!L.chain)throw new Error("client chain not configured. universalResolverAddress is required.");oe=getChainContractAddress({blockNumber:X,chain:L.chain,contract:"ensUniversalResolver"})}const se=`${Z.toLowerCase().substring(2)}.addr.reverse`;try{return(await readContract(L,{address:oe,abi:universalResolverReverseAbi,functionName:"reverse",args:[toHex(packetToBytes(se))],blockNumber:X,blockTag:te}))[0]}catch(ue){if(isNullUniversalResolverError(ue,"reverse"))return null;throw ue}}async function getEnsResolver(L,{blockNumber:Z,blockTag:X,name:te,universalResolverAddress:ie}){let oe=ie;if(!oe){if(!L.chain)throw new Error("client chain not configured. universalResolverAddress is required.");oe=getChainContractAddress({blockNumber:Z,chain:L.chain,contract:"ensUniversalResolver"})}const[se]=await readContract(L,{address:oe,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[toHex(packetToBytes(te))],blockNumber:Z,blockTag:X});return se}async function createBlockFilter(L){const Z=createFilterRequestScope(L,{method:"eth_newBlockFilter"}),X=await L.request({method:"eth_newBlockFilter"});return{id:X,request:Z(X),type:"block"}}async function createEventFilter(L,{address:Z,args:X,event:te,events:ie,fromBlock:oe,strict:se,toBlock:ue}={}){const ce=ie??(te?[te]:void 0),le=createFilterRequestScope(L,{method:"eth_newFilter"});let de=[];ce&&(de=[ce.flatMap(ge=>encodeEventTopics({abi:[ge],eventName:ge.name,args:X}))],te&&(de=de[0]));const he=await L.request({method:"eth_newFilter",params:[{address:Z,fromBlock:typeof oe=="bigint"?numberToHex(oe):oe,toBlock:typeof ue=="bigint"?numberToHex(ue):ue,...de.length?{topics:de}:{}}]});return{abi:ce,args:X,eventName:te?te.name:void 0,fromBlock:oe,id:he,request:le(he),strict:se,toBlock:ue,type:"event"}}async function createPendingTransactionFilter(L){const Z=createFilterRequestScope(L,{method:"eth_newPendingTransactionFilter"}),X=await L.request({method:"eth_newPendingTransactionFilter"});return{id:X,request:Z(X),type:"transaction"}}async function getBalance(L,{address:Z,blockNumber:X,blockTag:te="latest"}){const ie=X?numberToHex(X):void 0,oe=await L.request({method:"eth_getBalance",params:[Z,ie||te]});return BigInt(oe)}async function getBlockTransactionCount(L,{blockHash:Z,blockNumber:X,blockTag:te="latest"}={}){const ie=X!==void 0?numberToHex(X):void 0;let oe;return Z?oe=await L.request({method:"eth_getBlockTransactionCountByHash",params:[Z]}):oe=await L.request({method:"eth_getBlockTransactionCountByNumber",params:[ie||te]}),hexToNumber$1(oe)}async function getBytecode(L,{address:Z,blockNumber:X,blockTag:te="latest"}){const ie=X!==void 0?numberToHex(X):void 0,oe=await L.request({method:"eth_getCode",params:[Z,ie||te]});if(oe!=="0x")return oe}function formatFeeHistory(L){return{baseFeePerGas:L.baseFeePerGas.map(Z=>BigInt(Z)),gasUsedRatio:L.gasUsedRatio,oldestBlock:BigInt(L.oldestBlock),reward:L.reward?.map(Z=>Z.map(X=>BigInt(X)))}}async function getFeeHistory(L,{blockCount:Z,blockNumber:X,blockTag:te="latest",rewardPercentiles:ie}){const oe=X?numberToHex(X):void 0,se=await L.request({method:"eth_feeHistory",params:[numberToHex(Z),oe||te,ie]});return formatFeeHistory(se)}async function getFilterLogs(L,{filter:Z}){const X=Z.strict??!1;return(await Z.request({method:"eth_getFilterLogs",params:[Z.id]})).map(ie=>{try{const{eventName:oe,args:se}="abi"in Z&&Z.abi?decodeEventLog({abi:Z.abi,data:ie.data,topics:ie.topics,strict:X}):{eventName:void 0,args:void 0};return formatLog(ie,{args:se,eventName:oe})}catch(oe){let se,ue;if(oe instanceof DecodeLogDataMismatch||oe instanceof DecodeLogTopicsMismatch){if("strict"in Z&&Z.strict)return;se=oe.abiItem.name,ue=oe.abiItem.inputs?.some(ce=>!("name"in ce&&ce.name))}return formatLog(ie,{args:ue?[]:{},eventName:se})}}).filter(Boolean)}async function getStorageAt(L,{address:Z,blockNumber:X,blockTag:te="latest",slot:ie}){const oe=X!==void 0?numberToHex(X):void 0;return await L.request({method:"eth_getStorageAt",params:[Z,ie,oe||te]})}async function getTransaction(L,{blockHash:Z,blockNumber:X,blockTag:te,hash:ie,index:oe}){const se=te||"latest",ue=X!==void 0?numberToHex(X):void 0;let ce=null;if(ie?ce=await L.request({method:"eth_getTransactionByHash",params:[ie]}):Z?ce=await L.request({method:"eth_getTransactionByBlockHashAndIndex",params:[Z,numberToHex(oe)]}):(ue||se)&&(ce=await L.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[ue||se,numberToHex(oe)]})),!ce)throw new TransactionNotFoundError({blockHash:Z,blockNumber:X,blockTag:se,hash:ie,index:oe});return(L.chain?.formatters?.transaction?.format||formatTransaction)(ce)}async function getTransactionConfirmations(L,{hash:Z,transactionReceipt:X}){const[te,ie]=await Promise.all([getBlockNumber(L),Z?getTransaction(L,{hash:Z}):void 0]),oe=X?.blockNumber||ie?.blockNumber;return oe?te-oe+1n:0n}async function getTransactionReceipt(L,{hash:Z}){const X=await L.request({method:"eth_getTransactionReceipt",params:[Z]});if(!X)throw new TransactionReceiptNotFoundError({hash:Z});return(L.chain?.formatters?.transactionReceipt?.format||formatTransactionReceipt)(X)}async function multicall(L,Z){const{allowFailure:X=!0,batchSize:te,blockNumber:ie,blockTag:oe,contracts:se,multicallAddress:ue}=Z,ce=te??(typeof L.batch?.multicall=="object"&&L.batch.multicall.batchSize||1024),le=se;let de=ue;if(!de){if(!L.chain)throw new Error("client chain not configured. multicallAddress is required.");de=getChainContractAddress({blockNumber:ie,chain:L.chain,contract:"multicall3"})}const he=[[]];let ge=0,_e=0;for(let xe=0;xe0&&_e>ce&&(ge++,_e=(Ve.length-2)/2,he[ge]=[]),he[ge]=[...he[ge],{allowFailure:!0,callData:Ve,target:Pe}]}catch(Ve){const Ge=getContractError(Ve,{abi:Ie,address:Pe,args:Ce,docsPath:"/docs/contract/multicall",functionName:Be});if(!X)throw Ge;he[ge]=[...he[ge],{allowFailure:!0,callData:"0x",target:Pe}]}}return(await Promise.all(he.map(xe=>readContract(L,{abi:multicall3Abi,address:de,args:[xe],blockNumber:ie,blockTag:oe,functionName:"aggregate3"})))).flat().map(({returnData:xe,success:Ie},Pe)=>{const Ce=he.flat(),{callData:Be}=Ce[Pe],{abi:Ve,address:Ge,functionName:Ke,args:Je}=le[Pe];try{if(Be==="0x")throw new AbiDecodingZeroDataError;if(!Ie)throw new RawContractError({data:xe});const et=decodeFunctionResult({abi:Ve,args:Je,data:xe,functionName:Ke});return X?{result:et,status:"success"}:et}catch(et){const at=getContractError(et,{abi:Ve,address:Ge,args:Je,docsPath:"/docs/contract/multicall",functionName:Ke});if(!X)throw at;return{error:at,result:void 0,status:"failure"}}})}const universalSignatureValidatorByteCode="0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$3=BigInt(0),_1n$4=BigInt(1),_2n$2=BigInt(2),u8a$1=L=>L instanceof Uint8Array,hexes=Array.from({length:256},(L,Z)=>Z.toString(16).padStart(2,"0"));function bytesToHex(L){if(!u8a$1(L))throw new Error("Uint8Array expected");let Z="";for(let X=0;Xte+ie.length,0));let X=0;return L.forEach(te=>{if(!u8a$1(te))throw new Error("Uint8Array expected");Z.set(te,X),X+=te.length}),Z}function equalBytes(L,Z){if(L.length!==Z.length)return!1;for(let X=0;X_0n$3;L>>=_1n$4,Z+=1);return Z}function bitGet(L,Z){return L>>BigInt(Z)&_1n$4}const bitSet=(L,Z,X)=>L|(X?_1n$4:_0n$3)<(_2n$2<new Uint8Array(L),u8fr=L=>Uint8Array.from(L);function createHmacDrbg(L,Z,X){if(typeof L!="number"||L<2)throw new Error("hashLen must be a number");if(typeof Z!="number"||Z<2)throw new Error("qByteLen must be a number");if(typeof X!="function")throw new Error("hmacFn must be a function");let te=u8n(L),ie=u8n(L),oe=0;const se=()=>{te.fill(1),ie.fill(0),oe=0},ue=(...he)=>X(ie,te,...he),ce=(he=u8n())=>{ie=ue(u8fr([0]),he),te=ue(),he.length!==0&&(ie=ue(u8fr([1]),he),te=ue())},le=()=>{if(oe++>=1e3)throw new Error("drbg: tried 1000 values");let he=0;const ge=[];for(;he{se(),ce(he);let _e;for(;!(_e=ge(le()));)ce();return se(),_e}}const validatorFns={bigint:L=>typeof L=="bigint",function:L=>typeof L=="function",boolean:L=>typeof L=="boolean",string:L=>typeof L=="string",isSafeInteger:L=>Number.isSafeInteger(L),array:L=>Array.isArray(L),field:(L,Z)=>Z.Fp.isValid(L),hash:L=>typeof L=="function"&&Number.isSafeInteger(L.outputLen)};function validateObject(L,Z,X={}){const te=(ie,oe,se)=>{const ue=validatorFns[oe];if(typeof ue!="function")throw new Error(`Invalid validator "${oe}", expected function`);const ce=L[ie];if(!(se&&ce===void 0)&&!ue(ce,L))throw new Error(`Invalid param ${String(ie)}=${ce} (${typeof ce}), expected ${oe}`)};for(const[ie,oe]of Object.entries(Z))te(ie,oe,!1);for(const[ie,oe]of Object.entries(X))te(ie,oe,!0);return L}const ut$1=Object.freeze(Object.defineProperty({__proto__:null,bitGet,bitLen,bitMask,bitSet,bytesToHex,bytesToNumberBE,bytesToNumberLE,concatBytes:concatBytes$1,createHmacDrbg,ensureBytes,equalBytes,hexToBytes,hexToNumber,numberToBytesBE,numberToBytesLE,numberToHexUnpadded,numberToVarBytesBE,utf8ToBytes:utf8ToBytes$1,validateObject},Symbol.toStringTag,{value:"Module"}));function isBytesEqual(L,Z){const X=isHex(L)?toBytes$2(L):L,te=isHex(Z)?toBytes$2(Z):Z;return equalBytes(X,te)}async function verifyHash(L,{address:Z,hash:X,signature:te,...ie}){const oe=isHex(te)?te:toHex(te);try{const{data:se}=await call(L,{data:encodeDeployData({abi:universalSignatureValidatorAbi,args:[Z,X,oe],bytecode:universalSignatureValidatorByteCode}),...ie});return isBytesEqual(se??"0x0","0x1")}catch(se){if(se instanceof CallExecutionError)return!1;throw se}}async function verifyMessage(L,{address:Z,message:X,signature:te,...ie}){const oe=hashMessage(X);return verifyHash(L,{address:Z,hash:oe,signature:te,...ie})}async function verifyTypedData(L,{address:Z,signature:X,message:te,primaryType:ie,types:oe,domain:se,...ue}){const ce=hashTypedData({message:te,primaryType:ie,types:oe,domain:se});return verifyHash(L,{address:Z,hash:ce,signature:X,...ue})}function watchBlockNumber(L,{emitOnBegin:Z=!1,emitMissed:X=!1,onBlockNumber:te,onError:ie,poll:oe,pollingInterval:se=L.pollingInterval}){const ue=typeof oe<"u"?oe:L.transport.type!=="webSocket";let ce;return ue?(()=>{const he=stringify(["watchBlockNumber",L.uid,Z,X,se]);return observe(he,{onBlockNumber:te,onError:ie},ge=>poll(async()=>{try{const _e=await getBlockNumber(L,{cacheTime:0});if(ce){if(_e===ce)return;if(_e-ce>1&&X)for(let Ae=ce+1n;Ae<_e;Ae++)ge.onBlockNumber(Ae,ce),ce=Ae}(!ce||_e>ce)&&(ge.onBlockNumber(_e,ce),ce=_e)}catch(_e){ge.onError?.(_e)}},{emitOnBegin:Z,interval:se}))})():(()=>{let he=!0,ge=()=>he=!1;return(async()=>{try{const{unsubscribe:_e}=await L.transport.subscribe({params:["newHeads"],onData(Ae){if(!he)return;const xe=hexToBigInt(Ae.result?.number);te(xe,ce),ce=xe},onError(Ae){ie?.(Ae)}});ge=_e,he||ge()}catch(_e){ie?.(_e)}})(),ge})()}async function waitForTransactionReceipt(L,{confirmations:Z=1,hash:X,onReplaced:te,pollingInterval:ie=L.pollingInterval,timeout:oe}){const se=stringify(["waitForTransactionReceipt",L.uid,X]);let ue,ce,le,de=!1;return new Promise((he,ge)=>{oe&&setTimeout(()=>ge(new WaitForTransactionReceiptTimeoutError({hash:X})),oe);const _e=observe(se,{onReplaced:te,resolve:he,reject:ge},Ae=>{const xe=watchBlockNumber(L,{emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:ie,async onBlockNumber(Ie){if(de)return;let Pe=Ie;const Ce=Be=>{xe(),Be(),_e()};try{if(le){if(Pe-le.blockNumber+1nAe.resolve(le));return}if(ue||(de=!0,await withRetry(async()=>{ue=await getTransaction(L,{hash:X}),ue.blockNumber&&(Pe=ue.blockNumber)},{delay:({count:Be})=>~~(1<0&&Pe-le.blockNumber+1nAe.resolve(le))}catch(Be){if(ue&&(Be instanceof TransactionNotFoundError||Be instanceof TransactionReceiptNotFoundError)){ce=ue;const Ge=(await getBlock(L,{blockNumber:Pe,includeTransactions:!0})).transactions.find(({from:Je,nonce:et})=>Je===ce.from&&et===ce.nonce);if(!Ge||(le=await getTransactionReceipt(L,{hash:Ge.hash}),Pe-le.blockNumber+1n{Ae.onReplaced?.({reason:Ke,replacedTransaction:ce,transaction:Ge,transactionReceipt:le}),Ae.resolve(le)})}else Ce(()=>Ae.reject(Be))}}})})})}function watchBlocks(L,{blockTag:Z="latest",emitMissed:X=!1,emitOnBegin:te=!1,onBlock:ie,onError:oe,includeTransactions:se,poll:ue,pollingInterval:ce=L.pollingInterval}){const le=typeof ue<"u"?ue:L.transport.type!=="webSocket",de=se??!1;let he;return le?(()=>{const Ae=stringify(["watchBlocks",L.uid,X,te,de,ce]);return observe(Ae,{onBlock:ie,onError:oe},xe=>poll(async()=>{try{const Ie=await getBlock(L,{blockTag:Z,includeTransactions:de});if(Ie.number&&he?.number){if(Ie.number===he.number)return;if(Ie.number-he.number>1&&X)for(let Pe=he?.number+1n;Pehe.number)&&(xe.onBlock(Ie,he),he=Ie)}catch(Ie){xe.onError?.(Ie)}},{emitOnBegin:te,interval:ce}))})():(()=>{let Ae=!0,xe=()=>Ae=!1;return(async()=>{try{const{unsubscribe:Ie}=await L.transport.subscribe({params:["newHeads"],onData(Pe){if(!Ae)return;const Be=(L.chain?.formatters?.block?.format||formatBlock)(Pe.result);ie(Be,he),he=Be},onError(Pe){oe?.(Pe)}});xe=Ie,Ae||xe()}catch(Ie){oe?.(Ie)}})(),xe})()}function watchEvent(L,{address:Z,args:X,batch:te=!0,event:ie,events:oe,onError:se,onLogs:ue,poll:ce,pollingInterval:le=L.pollingInterval,strict:de}){const he=typeof ce<"u"?ce:L.transport.type!=="webSocket",ge=de??!1;return he?(()=>{const xe=stringify(["watchEvent",Z,X,te,L.uid,ie,le]);return observe(xe,{onLogs:ue,onError:se},Ie=>{let Pe,Ce,Be=!1;const Ve=poll(async()=>{if(!Be){try{Ce=await createEventFilter(L,{address:Z,args:X,event:ie,events:oe,strict:ge})}catch{}Be=!0;return}try{let Ge;if(Ce)Ge=await getFilterChanges(L,{filter:Ce});else{const Ke=await getBlockNumber(L);Pe&&Pe!==Ke?Ge=await getLogs(L,{address:Z,args:X,event:ie,events:oe,fromBlock:Pe+1n,toBlock:Ke}):Ge=[],Pe=Ke}if(Ge.length===0)return;te?Ie.onLogs(Ge):Ge.forEach(Ke=>Ie.onLogs([Ke]))}catch(Ge){Ce&&Ge instanceof InvalidInputRpcError&&(Be=!1),Ie.onError?.(Ge)}},{emitOnBegin:!0,interval:le});return async()=>{Ce&&await uninstallFilter(L,{filter:Ce}),Ve()}})})():(()=>{let xe=!0,Ie=()=>xe=!1;return(async()=>{try{const Pe=oe??(ie?[ie]:void 0);let Ce=[];Pe&&(Ce=[Pe.flatMap(Ve=>encodeEventTopics({abi:[Ve],eventName:Ve.name,args:X}))],ie&&(Ce=Ce[0]));const{unsubscribe:Be}=await L.transport.subscribe({params:["logs",{address:Z,topics:Ce}],onData(Ve){if(!xe)return;const Ge=Ve.result;try{const{eventName:Ke,args:Je}=decodeEventLog({abi:Pe,data:Ge.data,topics:Ge.topics,strict:ge}),et=formatLog(Ge,{args:Je,eventName:Ke});ue([et])}catch(Ke){let Je,et;if(Ke instanceof DecodeLogDataMismatch||Ke instanceof DecodeLogTopicsMismatch){if(de)return;Je=Ke.abiItem.name,et=Ke.abiItem.inputs?.some(dt=>!("name"in dt&&dt.name))}const at=formatLog(Ge,{args:et?[]:{},eventName:Je});ue([at])}},onError(Ve){se?.(Ve)}});Ie=Be,xe||Ie()}catch(Pe){se?.(Pe)}})(),Ie})()}function watchPendingTransactions(L,{batch:Z=!0,onError:X,onTransactions:te,poll:ie,pollingInterval:oe=L.pollingInterval}){return(typeof ie<"u"?ie:L.transport.type!=="webSocket")?(()=>{const le=stringify(["watchPendingTransactions",L.uid,Z,oe]);return observe(le,{onTransactions:te,onError:X},de=>{let he;const ge=poll(async()=>{try{if(!he)try{he=await createPendingTransactionFilter(L);return}catch(Ae){throw ge(),Ae}const _e=await getFilterChanges(L,{filter:he});if(_e.length===0)return;Z?de.onTransactions(_e):_e.forEach(Ae=>de.onTransactions([Ae]))}catch(_e){de.onError?.(_e)}},{emitOnBegin:!0,interval:oe});return async()=>{he&&await uninstallFilter(L,{filter:he}),ge()}})})():(()=>{let le=!0,de=()=>le=!1;return(async()=>{try{const{unsubscribe:he}=await L.transport.subscribe({params:["newPendingTransactions"],onData(ge){if(!le)return;const _e=ge.result;te([_e])},onError(ge){X?.(ge)}});de=he,le||de()}catch(he){X?.(he)}})(),de})()}function publicActions(L){return{call:Z=>call(L,Z),createBlockFilter:()=>createBlockFilter(L),createContractEventFilter:Z=>createContractEventFilter(L,Z),createEventFilter:Z=>createEventFilter(L,Z),createPendingTransactionFilter:()=>createPendingTransactionFilter(L),estimateContractGas:Z=>estimateContractGas(L,Z),estimateGas:Z=>estimateGas(L,Z),getBalance:Z=>getBalance(L,Z),getBlock:Z=>getBlock(L,Z),getBlockNumber:Z=>getBlockNumber(L,Z),getBlockTransactionCount:Z=>getBlockTransactionCount(L,Z),getBytecode:Z=>getBytecode(L,Z),getChainId:()=>getChainId(L),getEnsAddress:Z=>getEnsAddress(L,Z),getEnsAvatar:Z=>getEnsAvatar(L,Z),getEnsName:Z=>getEnsName(L,Z),getEnsResolver:Z=>getEnsResolver(L,Z),getEnsText:Z=>getEnsText(L,Z),getFeeHistory:Z=>getFeeHistory(L,Z),getFilterChanges:Z=>getFilterChanges(L,Z),getFilterLogs:Z=>getFilterLogs(L,Z),getGasPrice:()=>getGasPrice(L),getLogs:Z=>getLogs(L,Z),getStorageAt:Z=>getStorageAt(L,Z),getTransaction:Z=>getTransaction(L,Z),getTransactionConfirmations:Z=>getTransactionConfirmations(L,Z),getTransactionCount:Z=>getTransactionCount(L,Z),getTransactionReceipt:Z=>getTransactionReceipt(L,Z),multicall:Z=>multicall(L,Z),readContract:Z=>readContract(L,Z),simulateContract:Z=>simulateContract(L,Z),verifyMessage:Z=>verifyMessage(L,Z),verifyTypedData:Z=>verifyTypedData(L,Z),uninstallFilter:Z=>uninstallFilter(L,Z),waitForTransactionReceipt:Z=>waitForTransactionReceipt(L,Z),watchBlocks:Z=>watchBlocks(L,Z),watchBlockNumber:Z=>watchBlockNumber(L,Z),watchContractEvent:Z=>watchContractEvent(L,Z),watchEvent:Z=>watchEvent(L,Z),watchPendingTransactions:Z=>watchPendingTransactions(L,Z)}}function createPublicClient(L){const{key:Z="public",name:X="Public Client"}=L;return createClient$1({...L,key:Z,name:X,type:"publicClient"}).extend(publicActions)}function deployContract(L,{abi:Z,args:X,bytecode:te,...ie}){const oe=encodeDeployData({abi:Z,args:X,bytecode:te});return sendTransaction(L,{...ie,data:oe})}async function getAddresses(L){return(await L.request({method:"eth_accounts"})).map(X=>checksumAddress(X))}async function getPermissions(L){return await L.request({method:"wallet_getPermissions"})}async function requestAddresses(L){return(await L.request({method:"eth_requestAccounts"})).map(X=>getAddress(X))}async function requestPermissions(L,Z){return L.request({method:"wallet_requestPermissions",params:[Z]})}async function signMessage$1(L,{account:Z=L.account,message:X}){if(!Z)throw new AccountNotFoundError({docsPath:"/docs/actions/wallet/signMessage"});const te=parseAccount(Z);if(te.type==="local")return te.signMessage({message:X});const ie=(()=>typeof X=="string"?stringToHex(X):X.raw instanceof Uint8Array?toHex(X.raw):X.raw)();return L.request({method:"personal_sign",params:[ie,te.address]})}async function signTypedData$1(L,{account:Z=L.account,domain:X,message:te,primaryType:ie,types:oe}){if(!Z)throw new AccountNotFoundError({docsPath:"/docs/actions/wallet/signTypedData"});const se=parseAccount(Z),ue={EIP712Domain:[typeof X?.name=="string"&&{name:"name",type:"string"},X?.version&&{name:"version",type:"string"},typeof X?.chainId=="number"&&{name:"chainId",type:"uint256"},X?.verifyingContract&&{name:"verifyingContract",type:"address"},X?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean),...oe};if(validateTypedData({domain:X,message:te,primaryType:ie,types:ue}),se.type==="local")return se.signTypedData({domain:X,primaryType:ie,types:ue,message:te});const ce=stringify({domain:X??{},primaryType:ie,types:ue,message:te},(le,de)=>isHex(de)?de.toLowerCase():de);return L.request({method:"eth_signTypedData_v4",params:[se.address,ce]})}async function switchChain(L,{id:Z}){await L.request({method:"wallet_switchEthereumChain",params:[{chainId:numberToHex(Z)}]})}async function watchAsset(L,Z){return await L.request({method:"wallet_watchAsset",params:Z})}function walletActions(L){return{addChain:Z=>addChain(L,Z),deployContract:Z=>deployContract(L,Z),getAddresses:()=>getAddresses(L),getChainId:()=>getChainId(L),getPermissions:()=>getPermissions(L),requestAddresses:()=>requestAddresses(L),requestPermissions:Z=>requestPermissions(L,Z),sendTransaction:Z=>sendTransaction(L,Z),signMessage:Z=>signMessage$1(L,Z),signTypedData:Z=>signTypedData$1(L,Z),switchChain:Z=>switchChain(L,Z),watchAsset:Z=>watchAsset(L,Z),writeContract:Z=>writeContract(L,Z)}}function createWalletClient(L){const{key:Z="wallet",name:X="Wallet Client",transport:te}=L;return createClient$1({...L,key:Z,name:X,transport:oe=>te({...oe,retryCount:0}),type:"walletClient"}).extend(walletActions)}function webSocket(L,Z={}){const{key:X="webSocket",name:te="WebSocket JSON-RPC",retryDelay:ie}=Z;return({chain:oe,retryCount:se,timeout:ue})=>{const ce=Z.retryCount??se,le=ue??Z.timeout??1e4,de=L||oe?.rpcUrls.default.webSocket?.[0];if(!de)throw new UrlRequiredError;return createTransport({key:X,name:te,async request({method:he,params:ge}){const _e={method:he,params:ge},Ae=await getSocket(de),{error:xe,result:Ie}=await rpc$1.webSocketAsync(Ae,{body:_e,timeout:le});if(xe)throw new RpcRequestError({body:_e,error:xe,url:de});return Ie},retryCount:ce,retryDelay:ie,timeout:le,type:"webSocket"},{getSocket(){return getSocket(de)},async subscribe({params:he,onData:ge,onError:_e}){const Ae=await getSocket(de),{result:xe}=await new Promise((Ie,Pe)=>rpc$1.webSocket(Ae,{body:{method:"eth_subscribe",params:he},onResponse(Ce){if(Ce.error){Pe(Ce.error),_e?.(Ce.error);return}if(typeof Ce.id=="number"){Ie(Ce);return}Ce.method==="eth_subscription"&&ge(Ce.params)}}));return{subscriptionId:xe,async unsubscribe(){return new Promise(Ie=>rpc$1.webSocket(Ae,{body:{method:"eth_unsubscribe",params:[xe]},onResponse:Ie}))}}}})}}function number(L){if(!Number.isSafeInteger(L)||L<0)throw new Error(`Wrong positive integer: ${L}`)}function bool(L){if(typeof L!="boolean")throw new Error(`Expected boolean, not ${L}`)}function bytes(L,...Z){if(!(L instanceof Uint8Array))throw new Error("Expected Uint8Array");if(Z.length>0&&!Z.includes(L.length))throw new Error(`Expected Uint8Array of length ${Z}, not of length=${L.length}`)}function hash(L){if(typeof L!="function"||typeof L.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number(L.outputLen),number(L.blockLen)}function exists(L,Z=!0){if(L.destroyed)throw new Error("Hash instance has been destroyed");if(Z&&L.finished)throw new Error("Hash#digest() has already been called")}function output(L,Z){bytes(L);const X=Z.outputLen;if(L.lengthL instanceof Uint8Array,createView=L=>new DataView(L.buffer,L.byteOffset,L.byteLength),rotr=(L,Z)=>L<<32-Z|L>>>Z,isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!isLE)throw new Error("Non little-endian hardware is not supported");Array.from({length:256},(L,Z)=>Z.toString(16).padStart(2,"0"));function utf8ToBytes(L){if(typeof L!="string")throw new Error(`utf8ToBytes expected string, got ${typeof L}`);return new Uint8Array(new TextEncoder().encode(L))}function toBytes(L){if(typeof L=="string"&&(L=utf8ToBytes(L)),!u8a(L))throw new Error(`expected Uint8Array, got ${typeof L}`);return L}function concatBytes(...L){const Z=new Uint8Array(L.reduce((te,ie)=>te+ie.length,0));let X=0;return L.forEach(te=>{if(!u8a(te))throw new Error("Uint8Array expected");Z.set(te,X),X+=te.length}),Z}class Hash{clone(){return this._cloneInto()}}function wrapConstructor(L){const Z=te=>L().update(toBytes(te)).digest(),X=L();return Z.outputLen=X.outputLen,Z.blockLen=X.blockLen,Z.create=()=>L(),Z}function randomBytes(L=32){if(crypto&&typeof crypto.getRandomValues=="function")return crypto.getRandomValues(new Uint8Array(L));throw new Error("crypto.getRandomValues must be defined")}function setBigUint64(L,Z,X,te){if(typeof L.setBigUint64=="function")return L.setBigUint64(Z,X,te);const ie=BigInt(32),oe=BigInt(4294967295),se=Number(X>>ie&oe),ue=Number(X&oe),ce=te?4:0,le=te?0:4;L.setUint32(Z+ce,se,te),L.setUint32(Z+le,ue,te)}class SHA2 extends Hash{constructor(Z,X,te,ie){super(),this.blockLen=Z,this.outputLen=X,this.padOffset=te,this.isLE=ie,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(Z),this.view=createView(this.buffer)}update(Z){assert.exists(this);const{view:X,buffer:te,blockLen:ie}=this;Z=toBytes(Z);const oe=Z.length;for(let se=0;seie-se&&(this.process(te,0),se=0);for(let he=se;hede.length)throw new Error("_sha2: outputLen bigger than state");for(let he=0;heL&Z^~L&X,Maj=(L,Z,X)=>L&Z^L&X^Z&X,SHA256_K=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]),IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),SHA256_W=new Uint32Array(64);class SHA256 extends SHA2{constructor(){super(64,32,8,!1),this.A=IV[0]|0,this.B=IV[1]|0,this.C=IV[2]|0,this.D=IV[3]|0,this.E=IV[4]|0,this.F=IV[5]|0,this.G=IV[6]|0,this.H=IV[7]|0}get(){const{A:Z,B:X,C:te,D:ie,E:oe,F:se,G:ue,H:ce}=this;return[Z,X,te,ie,oe,se,ue,ce]}set(Z,X,te,ie,oe,se,ue,ce){this.A=Z|0,this.B=X|0,this.C=te|0,this.D=ie|0,this.E=oe|0,this.F=se|0,this.G=ue|0,this.H=ce|0}process(Z,X){for(let he=0;he<16;he++,X+=4)SHA256_W[he]=Z.getUint32(X,!1);for(let he=16;he<64;he++){const ge=SHA256_W[he-15],_e=SHA256_W[he-2],Ae=rotr(ge,7)^rotr(ge,18)^ge>>>3,xe=rotr(_e,17)^rotr(_e,19)^_e>>>10;SHA256_W[he]=xe+SHA256_W[he-7]+Ae+SHA256_W[he-16]|0}let{A:te,B:ie,C:oe,D:se,E:ue,F:ce,G:le,H:de}=this;for(let he=0;he<64;he++){const ge=rotr(ue,6)^rotr(ue,11)^rotr(ue,25),_e=de+ge+Chi(ue,ce,le)+SHA256_K[he]+SHA256_W[he]|0,xe=(rotr(te,2)^rotr(te,13)^rotr(te,22))+Maj(te,ie,oe)|0;de=le,le=ce,ce=ue,ue=se+_e|0,se=oe,oe=ie,ie=te,te=_e+xe|0}te=te+this.A|0,ie=ie+this.B|0,oe=oe+this.C|0,se=se+this.D|0,ue=ue+this.E|0,ce=ce+this.F|0,le=le+this.G|0,de=de+this.H|0,this.set(te,ie,oe,se,ue,ce,le,de)}roundClean(){SHA256_W.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class SHA224 extends SHA256{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}}const sha256=wrapConstructor(()=>new SHA256);wrapConstructor(()=>new SHA224);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$2=BigInt(0),_1n$3=BigInt(1),_2n$1=BigInt(2),_3n$1=BigInt(3),_4n=BigInt(4),_5n=BigInt(5),_8n=BigInt(8);BigInt(9);BigInt(16);function mod(L,Z){const X=L%Z;return X>=_0n$2?X:Z+X}function pow(L,Z,X){if(X<=_0n$2||Z<_0n$2)throw new Error("Expected power/modulo > 0");if(X===_1n$3)return _0n$2;let te=_1n$3;for(;Z>_0n$2;)Z&_1n$3&&(te=te*L%X),L=L*L%X,Z>>=_1n$3;return te}function pow2(L,Z,X){let te=L;for(;Z-- >_0n$2;)te*=te,te%=X;return te}function invert$1(L,Z){if(L===_0n$2||Z<=_0n$2)throw new Error(`invert: expected positive integers, got n=${L} mod=${Z}`);let X=mod(L,Z),te=Z,ie=_0n$2,oe=_1n$3;for(;X!==_0n$2;){const ue=te/X,ce=te%X,le=ie-oe*ue;te=X,X=ce,ie=oe,oe=le}if(te!==_1n$3)throw new Error("invert: does not exist");return mod(ie,Z)}function tonelliShanks(L){const Z=(L-_1n$3)/_2n$1;let X,te,ie;for(X=L-_1n$3,te=0;X%_2n$1===_0n$2;X/=_2n$1,te++);for(ie=_2n$1;ie(te[ie]="function",te),Z);return validateObject(L,X)}function FpPow(L,Z,X){if(X<_0n$2)throw new Error("Expected power > 0");if(X===_0n$2)return L.ONE;if(X===_1n$3)return Z;let te=L.ONE,ie=Z;for(;X>_0n$2;)X&_1n$3&&(te=L.mul(te,ie)),ie=L.sqr(ie),X>>=_1n$3;return te}function FpInvertBatch(L,Z){const X=new Array(Z.length),te=Z.reduce((oe,se,ue)=>L.is0(se)?oe:(X[ue]=oe,L.mul(oe,se)),L.ONE),ie=L.inv(te);return Z.reduceRight((oe,se,ue)=>L.is0(se)?oe:(X[ue]=L.mul(oe,X[ue]),L.mul(oe,se)),ie),X}function nLength(L,Z){const X=Z!==void 0?Z:L.toString(2).length,te=Math.ceil(X/8);return{nBitLength:X,nByteLength:te}}function Field(L,Z,X=!1,te={}){if(L<=_0n$2)throw new Error(`Expected Fp ORDER > 0, got ${L}`);const{nBitLength:ie,nByteLength:oe}=nLength(L,Z);if(oe>2048)throw new Error("Field lengths over 2048 bytes are not supported");const se=FpSqrt(L),ue=Object.freeze({ORDER:L,BITS:ie,BYTES:oe,MASK:bitMask(ie),ZERO:_0n$2,ONE:_1n$3,create:ce=>mod(ce,L),isValid:ce=>{if(typeof ce!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof ce}`);return _0n$2<=ce&&cece===_0n$2,isOdd:ce=>(ce&_1n$3)===_1n$3,neg:ce=>mod(-ce,L),eql:(ce,le)=>ce===le,sqr:ce=>mod(ce*ce,L),add:(ce,le)=>mod(ce+le,L),sub:(ce,le)=>mod(ce-le,L),mul:(ce,le)=>mod(ce*le,L),pow:(ce,le)=>FpPow(ue,ce,le),div:(ce,le)=>mod(ce*invert$1(le,L),L),sqrN:ce=>ce*ce,addN:(ce,le)=>ce+le,subN:(ce,le)=>ce-le,mulN:(ce,le)=>ce*le,inv:ce=>invert$1(ce,L),sqrt:te.sqrt||(ce=>se(ue,ce)),invertBatch:ce=>FpInvertBatch(ue,ce),cmov:(ce,le,de)=>de?le:ce,toBytes:ce=>X?numberToBytesLE(ce,oe):numberToBytesBE(ce,oe),fromBytes:ce=>{if(ce.length!==oe)throw new Error(`Fp.fromBytes: expected ${oe}, got ${ce.length}`);return X?bytesToNumberLE(ce):bytesToNumberBE(ce)}});return Object.freeze(ue)}function hashToPrivateScalar(L,Z,X=!1){L=ensureBytes("privateHash",L);const te=L.length,ie=nLength(Z).nByteLength+8;if(ie<24||te1024)throw new Error(`hashToPrivateScalar: expected ${ie}-1024 bytes of input, got ${te}`);const oe=X?bytesToNumberLE(L):bytesToNumberBE(L);return mod(oe,Z-_1n$3)+_1n$3}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$1=BigInt(0),_1n$2=BigInt(1);function wNAF(L,Z){const X=(ie,oe)=>{const se=oe.negate();return ie?se:oe},te=ie=>{const oe=Math.ceil(Z/ie)+1,se=2**(ie-1);return{windows:oe,windowSize:se}};return{constTimeNegate:X,unsafeLadder(ie,oe){let se=L.ZERO,ue=ie;for(;oe>_0n$1;)oe&_1n$2&&(se=se.add(ue)),ue=ue.double(),oe>>=_1n$2;return se},precomputeWindow(ie,oe){const{windows:se,windowSize:ue}=te(oe),ce=[];let le=ie,de=le;for(let he=0;he>=_e,Ie>ce&&(Ie-=ge,se+=_1n$2);const Pe=xe,Ce=xe+Math.abs(Ie)-1,Be=Ae%2!==0,Ve=Ie<0;Ie===0?de=de.add(X(Be,oe[Pe])):le=le.add(X(Ve,oe[Ce]))}return{p:le,f:de}},wNAFCached(ie,oe,se,ue){const ce=ie._WINDOW_SIZE||1;let le=oe.get(ie);return le||(le=this.precomputeWindow(ie,ce),ce!==1&&oe.set(ie,ue(le))),this.wNAF(ce,le,se)}}}function validateBasic(L){return validateField(L.Fp),validateObject(L,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...nLength(L.n,L.nBitLength),...L,p:L.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function validatePointOpts(L){const Z=validateBasic(L);validateObject(Z,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:X,Fp:te,a:ie}=Z;if(X){if(!te.eql(ie,te.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof X!="object"||typeof X.beta!="bigint"||typeof X.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...Z})}const{bytesToNumberBE:b2n,hexToBytes:h2b}=ut$1,DER={Err:class extends Error{constructor(Z=""){super(Z)}},_parseInt(L){const{Err:Z}=DER;if(L.length<2||L[0]!==2)throw new Z("Invalid signature integer tag");const X=L[1],te=L.subarray(2,X+2);if(!X||te.length!==X)throw new Z("Invalid signature integer: wrong length");if(te[0]&128)throw new Z("Invalid signature integer: negative");if(te[0]===0&&!(te[1]&128))throw new Z("Invalid signature integer: unnecessary leading zero");return{d:b2n(te),l:L.subarray(X+2)}},toSig(L){const{Err:Z}=DER,X=typeof L=="string"?h2b(L):L;if(!(X instanceof Uint8Array))throw new Error("ui8a expected");let te=X.length;if(te<2||X[0]!=48)throw new Z("Invalid signature tag");if(X[1]!==te-2)throw new Z("Invalid signature: incorrect length");const{d:ie,l:oe}=DER._parseInt(X.subarray(2)),{d:se,l:ue}=DER._parseInt(oe);if(ue.length)throw new Z("Invalid signature: left bytes after parsing");return{r:ie,s:se}},hexFromSig(L){const Z=le=>Number.parseInt(le[0],16)&8?"00"+le:le,X=le=>{const de=le.toString(16);return de.length&1?`0${de}`:de},te=Z(X(L.s)),ie=Z(X(L.r)),oe=te.length/2,se=ie.length/2,ue=X(oe),ce=X(se);return`30${X(se+oe+4)}02${ce}${ie}02${ue}${te}`}},_0n=BigInt(0),_1n$1=BigInt(1);BigInt(2);const _3n=BigInt(3);BigInt(4);function weierstrassPoints(L){const Z=validatePointOpts(L),{Fp:X}=Z,te=Z.toBytes||((Ae,xe,Ie)=>{const Pe=xe.toAffine();return concatBytes$1(Uint8Array.from([4]),X.toBytes(Pe.x),X.toBytes(Pe.y))}),ie=Z.fromBytes||(Ae=>{const xe=Ae.subarray(1),Ie=X.fromBytes(xe.subarray(0,X.BYTES)),Pe=X.fromBytes(xe.subarray(X.BYTES,2*X.BYTES));return{x:Ie,y:Pe}});function oe(Ae){const{a:xe,b:Ie}=Z,Pe=X.sqr(Ae),Ce=X.mul(Pe,Ae);return X.add(X.add(Ce,X.mul(Ae,xe)),Ie)}if(!X.eql(X.sqr(Z.Gy),oe(Z.Gx)))throw new Error("bad generator point: equation left != right");function se(Ae){return typeof Ae=="bigint"&&_0nX.eql(Be,X.ZERO);return Ce(Ie)&&Ce(Pe)?he.ZERO:new he(Ie,Pe,X.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(xe){const Ie=X.invertBatch(xe.map(Pe=>Pe.pz));return xe.map((Pe,Ce)=>Pe.toAffine(Ie[Ce])).map(he.fromAffine)}static fromHex(xe){const Ie=he.fromAffine(ie(ensureBytes("pointHex",xe)));return Ie.assertValidity(),Ie}static fromPrivateKey(xe){return he.BASE.multiply(ce(xe))}_setWindowSize(xe){this._WINDOW_SIZE=xe,le.delete(this)}assertValidity(){if(this.is0()){if(Z.allowInfinityPoint)return;throw new Error("bad point: ZERO")}const{x:xe,y:Ie}=this.toAffine();if(!X.isValid(xe)||!X.isValid(Ie))throw new Error("bad point: x or y not FE");const Pe=X.sqr(Ie),Ce=oe(xe);if(!X.eql(Pe,Ce))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:xe}=this.toAffine();if(X.isOdd)return!X.isOdd(xe);throw new Error("Field doesn't support isOdd")}equals(xe){de(xe);const{px:Ie,py:Pe,pz:Ce}=this,{px:Be,py:Ve,pz:Ge}=xe,Ke=X.eql(X.mul(Ie,Ge),X.mul(Be,Ce)),Je=X.eql(X.mul(Pe,Ge),X.mul(Ve,Ce));return Ke&&Je}negate(){return new he(this.px,X.neg(this.py),this.pz)}double(){const{a:xe,b:Ie}=Z,Pe=X.mul(Ie,_3n),{px:Ce,py:Be,pz:Ve}=this;let Ge=X.ZERO,Ke=X.ZERO,Je=X.ZERO,et=X.mul(Ce,Ce),at=X.mul(Be,Be),dt=X.mul(Ve,Ve),st=X.mul(Ce,Be);return st=X.add(st,st),Je=X.mul(Ce,Ve),Je=X.add(Je,Je),Ge=X.mul(xe,Je),Ke=X.mul(Pe,dt),Ke=X.add(Ge,Ke),Ge=X.sub(at,Ke),Ke=X.add(at,Ke),Ke=X.mul(Ge,Ke),Ge=X.mul(st,Ge),Je=X.mul(Pe,Je),dt=X.mul(xe,dt),st=X.sub(et,dt),st=X.mul(xe,st),st=X.add(st,Je),Je=X.add(et,et),et=X.add(Je,et),et=X.add(et,dt),et=X.mul(et,st),Ke=X.add(Ke,et),dt=X.mul(Be,Ve),dt=X.add(dt,dt),et=X.mul(dt,st),Ge=X.sub(Ge,et),Je=X.mul(dt,at),Je=X.add(Je,Je),Je=X.add(Je,Je),new he(Ge,Ke,Je)}add(xe){de(xe);const{px:Ie,py:Pe,pz:Ce}=this,{px:Be,py:Ve,pz:Ge}=xe;let Ke=X.ZERO,Je=X.ZERO,et=X.ZERO;const at=Z.a,dt=X.mul(Z.b,_3n);let st=X.mul(Ie,Be),ht=X.mul(Pe,Ve),Fe=X.mul(Ce,Ge),pe=X.add(Ie,Pe),we=X.add(Be,Ve);pe=X.mul(pe,we),we=X.add(st,ht),pe=X.sub(pe,we),we=X.add(Ie,Ce);let $e=X.add(Be,Ge);return we=X.mul(we,$e),$e=X.add(st,Fe),we=X.sub(we,$e),$e=X.add(Pe,Ce),Ke=X.add(Ve,Ge),$e=X.mul($e,Ke),Ke=X.add(ht,Fe),$e=X.sub($e,Ke),et=X.mul(at,we),Ke=X.mul(dt,Fe),et=X.add(Ke,et),Ke=X.sub(ht,et),et=X.add(ht,et),Je=X.mul(Ke,et),ht=X.add(st,st),ht=X.add(ht,st),Fe=X.mul(at,Fe),we=X.mul(dt,we),ht=X.add(ht,Fe),Fe=X.sub(st,Fe),Fe=X.mul(at,Fe),we=X.add(we,Fe),st=X.mul(ht,we),Je=X.add(Je,st),st=X.mul($e,we),Ke=X.mul(pe,Ke),Ke=X.sub(Ke,st),st=X.mul(pe,ht),et=X.mul($e,et),et=X.add(et,st),new he(Ke,Je,et)}subtract(xe){return this.add(xe.negate())}is0(){return this.equals(he.ZERO)}wNAF(xe){return _e.wNAFCached(this,le,xe,Ie=>{const Pe=X.invertBatch(Ie.map(Ce=>Ce.pz));return Ie.map((Ce,Be)=>Ce.toAffine(Pe[Be])).map(he.fromAffine)})}multiplyUnsafe(xe){const Ie=he.ZERO;if(xe===_0n)return Ie;if(ue(xe),xe===_1n$1)return this;const{endo:Pe}=Z;if(!Pe)return _e.unsafeLadder(this,xe);let{k1neg:Ce,k1:Be,k2neg:Ve,k2:Ge}=Pe.splitScalar(xe),Ke=Ie,Je=Ie,et=this;for(;Be>_0n||Ge>_0n;)Be&_1n$1&&(Ke=Ke.add(et)),Ge&_1n$1&&(Je=Je.add(et)),et=et.double(),Be>>=_1n$1,Ge>>=_1n$1;return Ce&&(Ke=Ke.negate()),Ve&&(Je=Je.negate()),Je=new he(X.mul(Je.px,Pe.beta),Je.py,Je.pz),Ke.add(Je)}multiply(xe){ue(xe);let Ie=xe,Pe,Ce;const{endo:Be}=Z;if(Be){const{k1neg:Ve,k1:Ge,k2neg:Ke,k2:Je}=Be.splitScalar(Ie);let{p:et,f:at}=this.wNAF(Ge),{p:dt,f:st}=this.wNAF(Je);et=_e.constTimeNegate(Ve,et),dt=_e.constTimeNegate(Ke,dt),dt=new he(X.mul(dt.px,Be.beta),dt.py,dt.pz),Pe=et.add(dt),Ce=at.add(st)}else{const{p:Ve,f:Ge}=this.wNAF(Ie);Pe=Ve,Ce=Ge}return he.normalizeZ([Pe,Ce])[0]}multiplyAndAddUnsafe(xe,Ie,Pe){const Ce=he.BASE,Be=(Ge,Ke)=>Ke===_0n||Ke===_1n$1||!Ge.equals(Ce)?Ge.multiplyUnsafe(Ke):Ge.multiply(Ke),Ve=Be(this,Ie).add(Be(xe,Pe));return Ve.is0()?void 0:Ve}toAffine(xe){const{px:Ie,py:Pe,pz:Ce}=this,Be=this.is0();xe==null&&(xe=Be?X.ONE:X.inv(Ce));const Ve=X.mul(Ie,xe),Ge=X.mul(Pe,xe),Ke=X.mul(Ce,xe);if(Be)return{x:X.ZERO,y:X.ZERO};if(!X.eql(Ke,X.ONE))throw new Error("invZ was invalid");return{x:Ve,y:Ge}}isTorsionFree(){const{h:xe,isTorsionFree:Ie}=Z;if(xe===_1n$1)return!0;if(Ie)return Ie(he,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:xe,clearCofactor:Ie}=Z;return xe===_1n$1?this:Ie?Ie(he,this):this.multiplyUnsafe(Z.h)}toRawBytes(xe=!0){return this.assertValidity(),te(he,this,xe)}toHex(xe=!0){return bytesToHex(this.toRawBytes(xe))}}he.BASE=new he(Z.Gx,Z.Gy,X.ONE),he.ZERO=new he(X.ZERO,X.ONE,X.ZERO);const ge=Z.nBitLength,_e=wNAF(he,Z.endo?Math.ceil(ge/2):ge);return{CURVE:Z,ProjectivePoint:he,normPrivateKeyToScalar:ce,weierstrassEquation:oe,isWithinCurveOrder:se}}function validateOpts(L){const Z=validateBasic(L);return validateObject(Z,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...Z})}function weierstrass(L){const Z=validateOpts(L),{Fp:X,n:te}=Z,ie=X.BYTES+1,oe=2*X.BYTES+1;function se(we){return _0nbytesToHex(numberToBytesBE(we,Z.nByteLength));function Ae(we){const $e=te>>_1n$1;return we>$e}function xe(we){return Ae(we)?ue(-we):we}const Ie=(we,$e,Oe)=>bytesToNumberBE(we.slice($e,Oe));class Pe{constructor($e,Oe,Me){this.r=$e,this.s=Oe,this.recovery=Me,this.assertValidity()}static fromCompact($e){const Oe=Z.nByteLength;return $e=ensureBytes("compactSignature",$e,Oe*2),new Pe(Ie($e,0,Oe),Ie($e,Oe,2*Oe))}static fromDER($e){const{r:Oe,s:Me}=DER.toSig(ensureBytes("DER",$e));return new Pe(Oe,Me)}assertValidity(){if(!ge(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!ge(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit($e){return new Pe(this.r,this.s,$e)}recoverPublicKey($e){const{r:Oe,s:Me,recovery:Ze}=this,We=Je(ensureBytes("msgHash",$e));if(Ze==null||![0,1,2,3].includes(Ze))throw new Error("recovery id invalid");const Ne=Ze===2||Ze===3?Oe+Z.n:Oe;if(Ne>=X.ORDER)throw new Error("recovery id 2 or 3 invalid");const ve=Ze&1?"03":"02",Le=le.fromHex(ve+_e(Ne)),it=ce(Ne),Te=ue(-We*it),Ye=ue(Me*it),Ue=le.BASE.multiplyAndAddUnsafe(Le,Te,Ye);if(!Ue)throw new Error("point at infinify");return Ue.assertValidity(),Ue}hasHighS(){return Ae(this.s)}normalizeS(){return this.hasHighS()?new Pe(this.r,ue(-this.s),this.recovery):this}toDERRawBytes(){return hexToBytes(this.toDERHex())}toDERHex(){return DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return hexToBytes(this.toCompactHex())}toCompactHex(){return _e(this.r)+_e(this.s)}}const Ce={isValidPrivateKey(we){try{return de(we),!0}catch{return!1}},normPrivateKeyToScalar:de,randomPrivateKey:()=>{const we=Z.randomBytes(X.BYTES+8),$e=hashToPrivateScalar(we,te);return numberToBytesBE($e,Z.nByteLength)},precompute(we=8,$e=le.BASE){return $e._setWindowSize(we),$e.multiply(BigInt(3)),$e}};function Be(we,$e=!0){return le.fromPrivateKey(we).toRawBytes($e)}function Ve(we){const $e=we instanceof Uint8Array,Oe=typeof we=="string",Me=($e||Oe)&&we.length;return $e?Me===ie||Me===oe:Oe?Me===2*ie||Me===2*oe:we instanceof le}function Ge(we,$e,Oe=!0){if(Ve(we))throw new Error("first arg must be private key");if(!Ve($e))throw new Error("second arg must be public key");return le.fromHex($e).multiply(de(we)).toRawBytes(Oe)}const Ke=Z.bits2int||function(we){const $e=bytesToNumberBE(we),Oe=we.length*8-Z.nBitLength;return Oe>0?$e>>BigInt(Oe):$e},Je=Z.bits2int_modN||function(we){return ue(Ke(we))},et=bitMask(Z.nBitLength);function at(we){if(typeof we!="bigint")throw new Error("bigint expected");if(!(_0n<=we&&weXe in Oe))throw new Error("sign() legacy options not supported");const{hash:Me,randomBytes:Ze}=Z;let{lowS:We,prehash:Ne,extraEntropy:ve}=Oe;We==null&&(We=!0),we=ensureBytes("msgHash",we),Ne&&(we=ensureBytes("prehashed msgHash",Me(we)));const Le=Je(we),it=de($e),Te=[at(it),at(Le)];if(ve!=null){const Xe=ve===!0?Ze(X.BYTES):ve;Te.push(ensureBytes("extraEntropy",Xe,X.BYTES))}const Ye=concatBytes$1(...Te),Ue=Le;function qe(Xe){const nt=Ke(Xe);if(!ge(nt))return;const tt=ce(nt),Qe=le.BASE.multiply(nt).toAffine(),ft=ue(Qe.x);if(ft===_0n)return;const rt=ue(tt*ue(Ue+ft*it));if(rt===_0n)return;let lt=(Qe.x===ft?0:2)|Number(Qe.y&_1n$1),qt=rt;return We&&Ae(rt)&&(qt=xe(rt),lt^=1),new Pe(ft,qt,lt)}return{seed:Ye,k2sig:qe}}const st={lowS:Z.lowS,prehash:!1},ht={lowS:Z.lowS,prehash:!1};function Fe(we,$e,Oe=st){const{seed:Me,k2sig:Ze}=dt(we,$e,Oe),We=Z;return createHmacDrbg(We.hash.outputLen,We.nByteLength,We.hmac)(Me,Ze)}le.BASE._setWindowSize(8);function pe(we,$e,Oe,Me=ht){const Ze=we;if($e=ensureBytes("msgHash",$e),Oe=ensureBytes("publicKey",Oe),"strict"in Me)throw new Error("options.strict was renamed to lowS");const{lowS:We,prehash:Ne}=Me;let ve,Le;try{if(typeof Ze=="string"||Ze instanceof Uint8Array)try{ve=Pe.fromDER(Ze)}catch(Qe){if(!(Qe instanceof DER.Err))throw Qe;ve=Pe.fromCompact(Ze)}else if(typeof Ze=="object"&&typeof Ze.r=="bigint"&&typeof Ze.s=="bigint"){const{r:Qe,s:ft}=Ze;ve=new Pe(Qe,ft)}else throw new Error("PARSE");Le=le.fromHex(Oe)}catch(Qe){if(Qe.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(We&&ve.hasHighS())return!1;Ne&&($e=Z.hash($e));const{r:it,s:Te}=ve,Ye=Je($e),Ue=ce(Te),qe=ue(Ye*Ue),Xe=ue(it*Ue),nt=le.BASE.multiplyAndAddUnsafe(Le,qe,Xe)?.toAffine();return nt?ue(nt.x)===it:!1}return{CURVE:Z,getPublicKey:Be,getSharedSecret:Ge,sign:Fe,verify:pe,ProjectivePoint:le,Signature:Pe,utils:Ce}}class HMAC extends Hash{constructor(Z,X){super(),this.finished=!1,this.destroyed=!1,assert.hash(Z);const te=toBytes(X);if(this.iHash=Z.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const ie=this.blockLen,oe=new Uint8Array(ie);oe.set(te.length>ie?Z.create().update(te).digest():te);for(let se=0;senew HMAC(L,Z).update(X).digest();hmac.create=(L,Z)=>new HMAC(L,Z);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function getHash(L){return{hash:L,hmac:(Z,...X)=>hmac(L,Z,concatBytes(...X)),randomBytes}}function createCurve(L,Z){const X=te=>weierstrass({...L,...getHash(te)});return Object.freeze({...X(Z),create:X})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const secp256k1P=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),secp256k1N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),_1n=BigInt(1),_2n=BigInt(2),divNearest=(L,Z)=>(L+Z/_2n)/Z;function sqrtMod(L){const Z=secp256k1P,X=BigInt(3),te=BigInt(6),ie=BigInt(11),oe=BigInt(22),se=BigInt(23),ue=BigInt(44),ce=BigInt(88),le=L*L*L%Z,de=le*le*L%Z,he=pow2(de,X,Z)*de%Z,ge=pow2(he,X,Z)*de%Z,_e=pow2(ge,_2n,Z)*le%Z,Ae=pow2(_e,ie,Z)*_e%Z,xe=pow2(Ae,oe,Z)*Ae%Z,Ie=pow2(xe,ue,Z)*xe%Z,Pe=pow2(Ie,ce,Z)*Ie%Z,Ce=pow2(Pe,ue,Z)*xe%Z,Be=pow2(Ce,X,Z)*de%Z,Ve=pow2(Be,se,Z)*Ae%Z,Ge=pow2(Ve,te,Z)*le%Z,Ke=pow2(Ge,_2n,Z);if(!Fp.eql(Fp.sqr(Ke),L))throw new Error("Cannot find square root");return Ke}const Fp=Field(secp256k1P,void 0,void 0,{sqrt:sqrtMod}),secp256k1=createCurve({a:BigInt(0),b:BigInt(7),Fp,n:secp256k1N,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:L=>{const Z=secp256k1N,X=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),te=-_1n*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),ie=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),oe=X,se=BigInt("0x100000000000000000000000000000000"),ue=divNearest(oe*L,Z),ce=divNearest(-te*L,Z);let le=mod(L-ue*X-ce*ie,Z),de=mod(-ue*te-ce*oe,Z);const he=le>se,ge=de>se;if(he&&(le=Z-le),ge&&(de=Z-de),le>se||de>se)throw new Error("splitScalar: Endomorphism failed, k="+L);return{k1neg:he,k1:le,k2neg:ge,k2:de}}}},sha256);BigInt(0);secp256k1.ProjectivePoint;function signatureToHex({r:L,s:Z,v:X}){return`0x${new secp256k1.Signature(hexToBigInt(L),hexToBigInt(Z)).toCompactHex()}${toHex(X).slice(2)}`}function t$3(L,Z){throw new Error(Z??`Unexpected value: ${L}`)}function u$2(...L){return L.reduce((Z,X)=>XZ?1:0}function*f$3(L,Z){for(let X=0;XsetTimeout(()=>Z(),L))}var r$2=class extends Error{name="MUDError"};function ne(L){let Z=[],X=[];for(let te of L)T$2(te)?X.push(te):Z.push(te);return{staticFields:Z,dynamicFields:X}}var d$4=class extends r$2{name="InvalidHexValueError";constructor(Z){super(`Hex value "${Z}" is an odd length (${Z.length-2}). It must be an even length.`)}},f$2=class extends r$2{name="InvalidHexLengthForSchemaError";constructor(Z){super(`Hex value "${Z}" has length of ${Z.length-2}, but expected length of 64 for a schema.`)}},x$5=class extends r$2{name="InvalidHexLengthForPackedCounterError";constructor(Z){super(`Hex value "${Z}" has length of ${Z.length-2}, but expected length of 64 for a packed counter.`)}},g$5=class extends r$2{name="InvalidHexLengthForStaticFieldError";constructor(Z,X){super(`Hex value "${X}" has length of ${X.length-2}, but expected length of ${A$2[Z]*2} for ${Z} type.`)}},S$1=class extends r$2{name="InvalidHexLengthForArrayFieldError";constructor(Z,X){super(`Hex value "${X}" has length of ${X.length-2}, but expected a multiple of ${A$2[Z]*2} for ${Z}[] type.`)}},A$1=class extends r$2{name="SchemaStaticLengthMismatchError";constructor(Z,X,te){super(`Schema "${Z}" static data length (${X}) did not match the summed length of all static fields (${te}). Is \`staticAbiTypeToByteLength\` up to date with Solidity schema types?`)}},v$3=class extends r$2{name="PackedCounterLengthMismatchError";constructor(Z,X,te){super(`PackedCounter "${Z}" total bytes length (${X}) did not match the summed length of all field byte lengths (${te}).`)}};function p$1(L,Z){if(Z.length>3&&Z.length%2!==0)throw new d$4(Z);if((Z.length-2)/2!==A$2[L])throw new g$5(L,Z);switch(L){case"uint8":case"uint16":case"uint24":case"uint32":case"uint40":case"uint48":case"uint56":case"uint64":case"uint72":case"uint80":case"uint88":case"uint96":case"uint104":case"uint112":case"uint120":case"uint128":case"uint136":case"uint144":case"uint152":case"uint160":case"uint168":case"uint176":case"uint184":case"uint192":case"uint200":case"uint208":case"uint216":case"uint224":case"uint232":case"uint240":case"uint248":case"uint256":case"int8":case"int16":case"int24":case"int32":case"int40":case"int48":case"int56":case"int64":case"int72":case"int80":case"int88":case"int96":case"int104":case"int112":case"int120":case"int128":case"int136":case"int144":case"int152":case"int160":case"int168":case"int176":case"int184":case"int192":case"int200":case"int208":case"int216":case"int224":case"int232":case"int240":case"int248":case"int256":{let X=hexToBigInt(Z,{signed:L.startsWith("int")}),te=typeof a$3[L];if(te==="number")return Number(X);if(te==="bigint")return X;throw new Error(`Unexpected default value type (${te}) for ABI type (${L})`)}case"bytes1":case"bytes2":case"bytes3":case"bytes4":case"bytes5":case"bytes6":case"bytes7":case"bytes8":case"bytes9":case"bytes10":case"bytes11":case"bytes12":case"bytes13":case"bytes14":case"bytes15":case"bytes16":case"bytes17":case"bytes18":case"bytes19":case"bytes20":case"bytes21":case"bytes22":case"bytes23":case"bytes24":case"bytes25":case"bytes26":case"bytes27":case"bytes28":case"bytes29":case"bytes30":case"bytes31":case"bytes32":return Z;case"bool":return hexToBool(Z);case"address":return getAddress(Z)}return t$3(L,`Unsupported static ABI type: ${L}`)}function h$3(L,Z){if(L==="bytes")return Z;if(L==="string")return hexToString(Z);if(Z.length>3&&Z.length%2!==0)throw new d$4(Z);let X=(Z.length-2)/2;switch(L){case"uint8[]":case"uint16[]":case"uint24[]":case"uint32[]":case"uint40[]":case"uint48[]":case"uint56[]":case"uint64[]":case"uint72[]":case"uint80[]":case"uint88[]":case"uint96[]":case"uint104[]":case"uint112[]":case"uint120[]":case"uint128[]":case"uint136[]":case"uint144[]":case"uint152[]":case"uint160[]":case"uint168[]":case"uint176[]":case"uint184[]":case"uint192[]":case"uint200[]":case"uint208[]":case"uint216[]":case"uint224[]":case"uint232[]":case"uint240[]":case"uint248[]":case"uint256[]":case"int8[]":case"int16[]":case"int24[]":case"int32[]":case"int40[]":case"int48[]":case"int56[]":case"int64[]":case"int72[]":case"int80[]":case"int88[]":case"int96[]":case"int104[]":case"int112[]":case"int120[]":case"int128[]":case"int136[]":case"int144[]":case"int152[]":case"int160[]":case"int168[]":case"int176[]":case"int184[]":case"int192[]":case"int200[]":case"int208[]":case"int216[]":case"int224[]":case"int232[]":case"int240[]":case"int248[]":case"int256[]":case"bytes1[]":case"bytes2[]":case"bytes3[]":case"bytes4[]":case"bytes5[]":case"bytes6[]":case"bytes7[]":case"bytes8[]":case"bytes9[]":case"bytes10[]":case"bytes11[]":case"bytes12[]":case"bytes13[]":case"bytes14[]":case"bytes15[]":case"bytes16[]":case"bytes17[]":case"bytes18[]":case"bytes19[]":case"bytes20[]":case"bytes21[]":case"bytes22[]":case"bytes23[]":case"bytes24[]":case"bytes25[]":case"bytes26[]":case"bytes27[]":case"bytes28[]":case"bytes29[]":case"bytes30[]":case"bytes31[]":case"bytes32[]":case"bool[]":case"address[]":{let te=r$3(L),ie=A$2[te];if(X%ie!==0)throw new S$1(te,Z);return new Array(X/ie).fill(void 0).map((oe,se)=>{let ue=sliceHex(Z,se*ie,(se+1)*ie);return p$1(te,ue)})}}return t$3(L,`Unsupported dynamic ABI type: ${L}`)}function ke(L,Z){return T$2(L)?h$3(L,Z):p$1(L,Z)}function ze(L,Z){if(L.staticFields.length!==Z.length)throw new Error(`key tuple length ${Z.length} does not match key schema length ${L.staticFields.length}`);return Z.map((X,te)=>decodeAbiParameters([{type:L.staticFields[te]}],X)[0])}function B$2(L){if(L.length!==66)throw new x$5(L);let Z=p$1("uint56",sliceHex(L,32-7,32)),X=h$3("uint40[]",sliceHex(L,0,32-7)),te=Object.freeze([...X].reverse()),ie=BigInt(te.reduce((oe,se)=>oe+se,0));if(ie!==Z)throw new v$3(L,Z,ie);return{totalByteLength:Z,fieldByteLengths:te}}function P$4(L){return L.reduce((Z,X)=>Z+A$2[X],0)}function ct(L,Z){let X=[],te=0;L.staticFields.forEach(se=>{let ue=A$2[se],ce=p$1(se,sliceHex(Z,te,te+ue));te+=ue,X.push(ce)});let ie=P$4(L.staticFields),oe=te;if(oe!==ie&&console.warn("Decoded static data length does not match schema's expected static data length. Data may get corrupted. Is `getStaticByteLength` outdated?",{expectedLength:ie,actualLength:oe,bytesOffset:te}),L.dynamicFields.length>0){let se=B$2(sliceHex(Z,te,te+32));te+=32,L.dynamicFields.forEach((ce,le)=>{let de=se.fieldByteLengths[le];if(de>0){let he=h$3(ce,sliceHex(Z,te,te+de));te+=de,X.push(he)}else X.push(s$3[ce])});let ue=te-32-oe;BigInt(ue)!==se.totalByteLength&&console.warn("Decoded dynamic data length does not match data layout's expected data length. Data may get corrupted. Did the data layout change?",{expectedLength:se.totalByteLength,actualLength:ue,bytesOffset:te})}return X}function D$1(L){if(L.length!==66)throw new f$2(L);let Z=hexToNumber$1(sliceHex(L,0,2)),X=hexToNumber$1(sliceHex(L,2,3)),te=hexToNumber$1(sliceHex(L,3,4)),ie=[],oe=[];for(let ue=4;ue<4+X;ue++){let ce=hexToNumber$1(sliceHex(L,ue,ue+1));ie.push(n$1[ce])}for(let ue=4+X;ue<4+X+te;ue++){let ce=hexToNumber$1(sliceHex(L,ue,ue+1));oe.push(n$1[ce])}let se=ie.reduce((ue,ce)=>ue+A$2[ce],0);if(se!==Z)throw console.warn(`Schema "${L}" static data length (${Z}) did not match the summed length of all static fields (${se}). Is \`staticAbiTypeToByteLength\` up to date with Solidity schema types?`),new A$1(L,Z,se);return{staticFields:ie,dynamicFields:oe}}var browserExports={},browser={get exports(){return browserExports},set exports(L){browserExports=L}},ms,hasRequiredMs;function requireMs(){if(hasRequiredMs)return ms;hasRequiredMs=1;var L=1e3,Z=L*60,X=Z*60,te=X*24,ie=te*7,oe=te*365.25;ms=function(de,he){he=he||{};var ge=typeof de;if(ge==="string"&&de.length>0)return se(de);if(ge==="number"&&isFinite(de))return he.long?ce(de):ue(de);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(de))};function se(de){if(de=String(de),!(de.length>100)){var he=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(de);if(he){var ge=parseFloat(he[1]),_e=(he[2]||"ms").toLowerCase();switch(_e){case"years":case"year":case"yrs":case"yr":case"y":return ge*oe;case"weeks":case"week":case"w":return ge*ie;case"days":case"day":case"d":return ge*te;case"hours":case"hour":case"hrs":case"hr":case"h":return ge*X;case"minutes":case"minute":case"mins":case"min":case"m":return ge*Z;case"seconds":case"second":case"secs":case"sec":case"s":return ge*L;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return ge;default:return}}}}function ue(de){var he=Math.abs(de);return he>=te?Math.round(de/te)+"d":he>=X?Math.round(de/X)+"h":he>=Z?Math.round(de/Z)+"m":he>=L?Math.round(de/L)+"s":de+"ms"}function ce(de){var he=Math.abs(de);return he>=te?le(de,he,te,"day"):he>=X?le(de,he,X,"hour"):he>=Z?le(de,he,Z,"minute"):he>=L?le(de,he,L,"second"):de+" ms"}function le(de,he,ge,_e){var Ae=he>=ge*1.5;return Math.round(de/ge)+" "+_e+(Ae?"s":"")}return ms}function setup$1(L){X.debug=X,X.default=X,X.coerce=ce,X.disable=oe,X.enable=ie,X.enabled=se,X.humanize=requireMs(),X.destroy=le,Object.keys(L).forEach(de=>{X[de]=L[de]}),X.names=[],X.skips=[],X.formatters={};function Z(de){let he=0;for(let ge=0;ge{if(Ke==="%%")return"%";Ve++;const et=X.formatters[Je];if(typeof et=="function"){const at=Ie[Ve];Ke=et.call(Pe,at),Ie.splice(Ve,1),Ve--}return Ke}),X.formatArgs.call(Pe,Ie),(Pe.log||X.log).apply(Pe,Ie)}return xe.namespace=de,xe.useColors=X.useColors(),xe.color=X.selectColor(de),xe.extend=te,xe.destroy=X.destroy,Object.defineProperty(xe,"enabled",{enumerable:!0,configurable:!1,get:()=>ge!==null?ge:(_e!==X.namespaces&&(_e=X.namespaces,Ae=X.enabled(de)),Ae),set:Ie=>{ge=Ie}}),typeof X.init=="function"&&X.init(xe),xe}function te(de,he){const ge=X(this.namespace+(typeof he>"u"?":":he)+de);return ge.log=this.log,ge}function ie(de){X.save(de),X.namespaces=de,X.names=[],X.skips=[];let he;const ge=(typeof de=="string"?de:"").split(/[\s,]+/),_e=ge.length;for(he=0;he<_e;he++)ge[he]&&(de=ge[he].replace(/\*/g,".*?"),de[0]==="-"?X.skips.push(new RegExp("^"+de.slice(1)+"$")):X.names.push(new RegExp("^"+de+"$")))}function oe(){const de=[...X.names.map(ue),...X.skips.map(ue).map(he=>"-"+he)].join(",");return X.enable(""),de}function se(de){if(de[de.length-1]==="*")return!0;let he,ge;for(he=0,ge=X.skips.length;he{let ce=!1;return()=>{ce||(ce=!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`."))}})(),Z.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function X(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function te(ce){if(ce[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+ce[0]+(this.useColors?"%c ":" ")+"+"+L.exports.humanize(this.diff),!this.useColors)return;const le="color: "+this.color;ce.splice(1,0,le,"color: inherit");let de=0,he=0;ce[0].replace(/%[a-zA-Z%]/g,ge=>{ge!=="%%"&&(de++,ge==="%c"&&(he=de))}),ce.splice(he,0,le)}Z.log=console.debug||console.log||(()=>{});function ie(ce){try{ce?Z.storage.setItem("debug",ce):Z.storage.removeItem("debug")}catch{}}function oe(){let ce;try{ce=Z.storage.getItem("debug")}catch{}return!ce&&typeof process<"u"&&"env"in process&&(ce={}.DEBUG),ce}function se(){try{return localStorage}catch{}}L.exports=common(Z);const{formatters:ue}=L.exports;ue.j=function(ce){try{return JSON.stringify(ce)}catch(le){return"[UnexpectedJSONParseError]: "+le.message}}})(browser,browserExports);const g$4=browserExports;function generatePrivateKey(){return toHex(secp256k1.utils.randomPrivateKey())}function toAccount(L){if(typeof L=="string"){if(!isAddress(L))throw new InvalidAddressError({address:L});return{address:L,type:"json-rpc"}}if(!isAddress(L.address))throw new InvalidAddressError({address:L.address});return{address:L.address,signMessage:L.signMessage,signTransaction:L.signTransaction,signTypedData:L.signTypedData,source:"custom",type:"local"}}async function sign({hash:L,privateKey:Z}){const{r:X,s:te,recovery:ie}=secp256k1.sign(L.slice(2),Z.slice(2));return{r:toHex(X),s:toHex(te),v:ie?28n:27n}}async function signMessage({message:L,privateKey:Z}){const X=await sign({hash:hashMessage(L),privateKey:Z});return signatureToHex(X)}async function signTransaction({privateKey:L,transaction:Z,serializer:X=serializeTransaction}){const te=await sign({hash:keccak256(X(Z)),privateKey:L});return X(Z,te)}async function signTypedData({privateKey:L,...Z}){const X=await sign({hash:hashTypedData(Z),privateKey:L});return signatureToHex(X)}function privateKeyToAccount(L){const Z=toHex(secp256k1.getPublicKey(L.slice(2),!1)),X=publicKeyToAddress(Z);return{...toAccount({address:X,async signMessage({message:ie}){return signMessage({message:ie,privateKey:L})},async signTransaction(ie,{serializer:oe}={}){return signTransaction({privateKey:L,transaction:ie,serializer:oe})},async signTypedData(ie){return signTypedData({...ie,privateKey:L})}}),publicKey:Z,source:"privateKey"}}var retryExports={},retry$3={get exports(){return retryExports},set exports(L){retryExports=L}},retry$2={};function RetryOperation(L,Z){typeof Z=="boolean"&&(Z={forever:Z}),this._originalTimeouts=JSON.parse(JSON.stringify(L)),this._timeouts=L,this._options=Z||{},this._maxRetryTime=Z&&Z.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var retry_operation=RetryOperation;RetryOperation.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};RetryOperation.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};RetryOperation.prototype.retry=function(L){if(this._timeout&&clearTimeout(this._timeout),!L)return!1;var Z=new Date().getTime();if(L&&Z-this._operationStart>=this._maxRetryTime)return this._errors.push(L),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(L);var X=this._timeouts.shift();if(X===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),X=this._cachedTimeouts.slice(-1);else return!1;var te=this;return this._timer=setTimeout(function(){te._attempts++,te._operationTimeoutCb&&(te._timeout=setTimeout(function(){te._operationTimeoutCb(te._attempts)},te._operationTimeout),te._options.unref&&te._timeout.unref()),te._fn(te._attempts)},X),this._options.unref&&this._timer.unref(),!0};RetryOperation.prototype.attempt=function(L,Z){this._fn=L,Z&&(Z.timeout&&(this._operationTimeout=Z.timeout),Z.cb&&(this._operationTimeoutCb=Z.cb));var X=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){X._operationTimeoutCb()},X._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};RetryOperation.prototype.try=function(L){console.log("Using RetryOperation.try() is deprecated"),this.attempt(L)};RetryOperation.prototype.start=function(L){console.log("Using RetryOperation.start() is deprecated"),this.attempt(L)};RetryOperation.prototype.start=RetryOperation.prototype.try;RetryOperation.prototype.errors=function(){return this._errors};RetryOperation.prototype.attempts=function(){return this._attempts};RetryOperation.prototype.mainError=function(){if(this._errors.length===0)return null;for(var L={},Z=null,X=0,te=0;te=X&&(Z=ie,X=se)}return Z};(function(L){var Z=retry_operation;L.operation=function(X){var te=L.timeouts(X);return new Z(te,{forever:X&&(X.forever||X.retries===1/0),unref:X&&X.unref,maxRetryTime:X&&X.maxRetryTime})},L.timeouts=function(X){if(X instanceof Array)return[].concat(X);var te={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var ie in X)te[ie]=X[ie];if(te.minTimeout>te.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var oe=[],se=0;se{const te=X.retries-(Z-1);return L.attemptNumber=Z,L.retriesLeft=te,L},isNetworkError=L=>networkErrorMsgs.has(L),getDOMException=L=>globalThis.DOMException===void 0?new Error(L):new DOMException(L);async function pRetry(L,Z){return new Promise((X,te)=>{Z={onFailedAttempt(){},retries:10,...Z};const ie=retry$1.operation(Z);ie.attempt(async oe=>{try{X(await L(oe))}catch(se){if(!(se instanceof Error)){te(new TypeError(`Non-error was thrown: "${se}". You should only throw errors.`));return}if(se instanceof AbortError$1)ie.stop(),te(se.originalError);else if(se instanceof TypeError&&!isNetworkError(se.message))ie.stop(),te(se);else{decorateErrorWithCounts(se,oe,Z);try{await Z.onFailedAttempt(se)}catch(ue){te(ue);return}ie.retry(se)||te(ie.mainError())}}}),Z.signal&&!Z.signal.aborted&&Z.signal.addEventListener("abort",()=>{ie.stop();const oe=Z.signal.reason===void 0?getDOMException("The operation was aborted."):Z.signal.reason;te(oe instanceof Error?oe:getDOMException(oe))},{once:!0})})}function J(L){return{...privateKeyToAccount(L)}}var p=g$4("mud:common"),x$4=p.extend("createNonceManager");function b$2({publicClient:L,address:Z,blockTag:X}){let te={current:-1},ie=typeof BroadcastChannel<"u"?new BroadcastChannel(`mud:createNonceManager:${L.chain?.id}:${Z}`):null;ie&&ie.addEventListener("message",le=>{let de=JSON.parse(le.data);x$4("got nonce from broadcast channel",de),te.current=de});function oe(){return te.current>=0}function se(){if(!oe())throw new Error("call resetNonce before using nextNonce");let le=te.current++;return ie?.postMessage(JSON.stringify(te.current)),le}async function ue(){let le=await L.getTransactionCount({address:Z,blockTag:X});te.current=le,ie?.postMessage(JSON.stringify(te.current)),x$4("reset nonce to",te.current)}function ce(le){return le instanceof BaseError&&le.walk(de=>de instanceof NonceTooLowError||de instanceof NonceTooHighError)!=null}return{hasNonce:oe,nextNonce:se,resetNonce:ue,shouldResetNonce:ce}}var m$2=p.extend("createContract");function E$1(L){let Z=L.length&&Array.isArray(L[0]),X=Z?L[0]:[],te=(Z?L[1]:L[0])??{};return{args:X,options:te}}function me({abi:L,address:Z,publicClient:X,walletClient:te,onWrite:ie}){let oe=getContract({abi:L,address:Z,publicClient:X,walletClient:te});if(oe.write){let se=0,ue=b$2({publicClient:X,address:te.account.address});oe.write=new Proxy({},{get(ce,le){async function de(ge){if(ge.gas)return m$2("gas provided, skipping simulate",le,ge),ge;m$2("simulating write",le,ge);let{request:_e}=await X.simulateContract({...ge,account:ge.account??te.account});return _e}async function he(ge){let _e=await de(ge);return await pRetry(async()=>{ue.hasNonce()||await ue.resetNonce();let Ae=ue.nextNonce();return m$2("calling write function with nonce",Ae,_e),await te.writeContract({nonce:Ae,..._e})},{retries:3,onFailedAttempt:async Ae=>{if(ue.shouldResetNonce(Ae)){m$2("got nonce error, retrying",Ae),await ue.resetNonce();return}throw Ae}})}return(...ge)=>{let _e=`${te.chain.id}:${te.account.address}:${se++}`,{args:Ae,options:xe}=E$1(ge),Ie={address:Z,abi:L,functionName:le,args:Ae,...xe},Pe=he(Ie);return ie?.({id:_e,request:Ie,result:Pe}),Pe}}})}return oe}function B$1(L,Z){if(!isHex(L))throw console.error("Private key found in cache is not valid hex",{privateKey:L,cacheKey:Z}),new Error(`Private key found in cache (${Z}) is not valid hex`);privateKeyToAccount(L)}function be$1(L="mud:burnerWallet"){let Z=localStorage.getItem(L);if(Z!=null)return B$1(Z,L),Z;let X=generatePrivateKey();return console.log("New burner wallet created:",privateKeyToAccount(X)),localStorage.setItem(L,X),X}function ye(L){let Z=hexToString(sliceHex(L,0,16)).replace(/\0+$/,""),X=hexToString(sliceHex(L,16,32)).replace(/\0+$/,"");return{namespace:Z,name:X}}function He(L,Z){return concatHex([stringToHex(L.substring(0,16),{size:16}),stringToHex(Z.substring(0,16),{size:16})])}var I$2=p.extend("transportObserver");function Ee(L){return Z=>{let X=L(Z);return{...X,request:async te=>{if(te.method==="eth_sendRawTransaction"&&te.params instanceof Array){let ie=te.params.map(oe=>keccak256(oe));I$2("saw txs",ie)}return X.request(te)}}}}var I$1=(L=>(L[L.UINT8=0]="UINT8",L[L.UINT16=1]="UINT16",L[L.UINT24=2]="UINT24",L[L.UINT32=3]="UINT32",L[L.UINT40=4]="UINT40",L[L.UINT48=5]="UINT48",L[L.UINT56=6]="UINT56",L[L.UINT64=7]="UINT64",L[L.UINT72=8]="UINT72",L[L.UINT80=9]="UINT80",L[L.UINT88=10]="UINT88",L[L.UINT96=11]="UINT96",L[L.UINT104=12]="UINT104",L[L.UINT112=13]="UINT112",L[L.UINT120=14]="UINT120",L[L.UINT128=15]="UINT128",L[L.UINT136=16]="UINT136",L[L.UINT144=17]="UINT144",L[L.UINT152=18]="UINT152",L[L.UINT160=19]="UINT160",L[L.UINT168=20]="UINT168",L[L.UINT176=21]="UINT176",L[L.UINT184=22]="UINT184",L[L.UINT192=23]="UINT192",L[L.UINT200=24]="UINT200",L[L.UINT208=25]="UINT208",L[L.UINT216=26]="UINT216",L[L.UINT224=27]="UINT224",L[L.UINT232=28]="UINT232",L[L.UINT240=29]="UINT240",L[L.UINT248=30]="UINT248",L[L.UINT256=31]="UINT256",L[L.INT8=32]="INT8",L[L.INT16=33]="INT16",L[L.INT24=34]="INT24",L[L.INT32=35]="INT32",L[L.INT40=36]="INT40",L[L.INT48=37]="INT48",L[L.INT56=38]="INT56",L[L.INT64=39]="INT64",L[L.INT72=40]="INT72",L[L.INT80=41]="INT80",L[L.INT88=42]="INT88",L[L.INT96=43]="INT96",L[L.INT104=44]="INT104",L[L.INT112=45]="INT112",L[L.INT120=46]="INT120",L[L.INT128=47]="INT128",L[L.INT136=48]="INT136",L[L.INT144=49]="INT144",L[L.INT152=50]="INT152",L[L.INT160=51]="INT160",L[L.INT168=52]="INT168",L[L.INT176=53]="INT176",L[L.INT184=54]="INT184",L[L.INT192=55]="INT192",L[L.INT200=56]="INT200",L[L.INT208=57]="INT208",L[L.INT216=58]="INT216",L[L.INT224=59]="INT224",L[L.INT232=60]="INT232",L[L.INT240=61]="INT240",L[L.INT248=62]="INT248",L[L.INT256=63]="INT256",L[L.BYTES1=64]="BYTES1",L[L.BYTES2=65]="BYTES2",L[L.BYTES3=66]="BYTES3",L[L.BYTES4=67]="BYTES4",L[L.BYTES5=68]="BYTES5",L[L.BYTES6=69]="BYTES6",L[L.BYTES7=70]="BYTES7",L[L.BYTES8=71]="BYTES8",L[L.BYTES9=72]="BYTES9",L[L.BYTES10=73]="BYTES10",L[L.BYTES11=74]="BYTES11",L[L.BYTES12=75]="BYTES12",L[L.BYTES13=76]="BYTES13",L[L.BYTES14=77]="BYTES14",L[L.BYTES15=78]="BYTES15",L[L.BYTES16=79]="BYTES16",L[L.BYTES17=80]="BYTES17",L[L.BYTES18=81]="BYTES18",L[L.BYTES19=82]="BYTES19",L[L.BYTES20=83]="BYTES20",L[L.BYTES21=84]="BYTES21",L[L.BYTES22=85]="BYTES22",L[L.BYTES23=86]="BYTES23",L[L.BYTES24=87]="BYTES24",L[L.BYTES25=88]="BYTES25",L[L.BYTES26=89]="BYTES26",L[L.BYTES27=90]="BYTES27",L[L.BYTES28=91]="BYTES28",L[L.BYTES29=92]="BYTES29",L[L.BYTES30=93]="BYTES30",L[L.BYTES31=94]="BYTES31",L[L.BYTES32=95]="BYTES32",L[L.BOOL=96]="BOOL",L[L.ADDRESS=97]="ADDRESS",L[L.UINT8_ARRAY=98]="UINT8_ARRAY",L[L.UINT16_ARRAY=99]="UINT16_ARRAY",L[L.UINT24_ARRAY=100]="UINT24_ARRAY",L[L.UINT32_ARRAY=101]="UINT32_ARRAY",L[L.UINT40_ARRAY=102]="UINT40_ARRAY",L[L.UINT48_ARRAY=103]="UINT48_ARRAY",L[L.UINT56_ARRAY=104]="UINT56_ARRAY",L[L.UINT64_ARRAY=105]="UINT64_ARRAY",L[L.UINT72_ARRAY=106]="UINT72_ARRAY",L[L.UINT80_ARRAY=107]="UINT80_ARRAY",L[L.UINT88_ARRAY=108]="UINT88_ARRAY",L[L.UINT96_ARRAY=109]="UINT96_ARRAY",L[L.UINT104_ARRAY=110]="UINT104_ARRAY",L[L.UINT112_ARRAY=111]="UINT112_ARRAY",L[L.UINT120_ARRAY=112]="UINT120_ARRAY",L[L.UINT128_ARRAY=113]="UINT128_ARRAY",L[L.UINT136_ARRAY=114]="UINT136_ARRAY",L[L.UINT144_ARRAY=115]="UINT144_ARRAY",L[L.UINT152_ARRAY=116]="UINT152_ARRAY",L[L.UINT160_ARRAY=117]="UINT160_ARRAY",L[L.UINT168_ARRAY=118]="UINT168_ARRAY",L[L.UINT176_ARRAY=119]="UINT176_ARRAY",L[L.UINT184_ARRAY=120]="UINT184_ARRAY",L[L.UINT192_ARRAY=121]="UINT192_ARRAY",L[L.UINT200_ARRAY=122]="UINT200_ARRAY",L[L.UINT208_ARRAY=123]="UINT208_ARRAY",L[L.UINT216_ARRAY=124]="UINT216_ARRAY",L[L.UINT224_ARRAY=125]="UINT224_ARRAY",L[L.UINT232_ARRAY=126]="UINT232_ARRAY",L[L.UINT240_ARRAY=127]="UINT240_ARRAY",L[L.UINT248_ARRAY=128]="UINT248_ARRAY",L[L.UINT256_ARRAY=129]="UINT256_ARRAY",L[L.INT8_ARRAY=130]="INT8_ARRAY",L[L.INT16_ARRAY=131]="INT16_ARRAY",L[L.INT24_ARRAY=132]="INT24_ARRAY",L[L.INT32_ARRAY=133]="INT32_ARRAY",L[L.INT40_ARRAY=134]="INT40_ARRAY",L[L.INT48_ARRAY=135]="INT48_ARRAY",L[L.INT56_ARRAY=136]="INT56_ARRAY",L[L.INT64_ARRAY=137]="INT64_ARRAY",L[L.INT72_ARRAY=138]="INT72_ARRAY",L[L.INT80_ARRAY=139]="INT80_ARRAY",L[L.INT88_ARRAY=140]="INT88_ARRAY",L[L.INT96_ARRAY=141]="INT96_ARRAY",L[L.INT104_ARRAY=142]="INT104_ARRAY",L[L.INT112_ARRAY=143]="INT112_ARRAY",L[L.INT120_ARRAY=144]="INT120_ARRAY",L[L.INT128_ARRAY=145]="INT128_ARRAY",L[L.INT136_ARRAY=146]="INT136_ARRAY",L[L.INT144_ARRAY=147]="INT144_ARRAY",L[L.INT152_ARRAY=148]="INT152_ARRAY",L[L.INT160_ARRAY=149]="INT160_ARRAY",L[L.INT168_ARRAY=150]="INT168_ARRAY",L[L.INT176_ARRAY=151]="INT176_ARRAY",L[L.INT184_ARRAY=152]="INT184_ARRAY",L[L.INT192_ARRAY=153]="INT192_ARRAY",L[L.INT200_ARRAY=154]="INT200_ARRAY",L[L.INT208_ARRAY=155]="INT208_ARRAY",L[L.INT216_ARRAY=156]="INT216_ARRAY",L[L.INT224_ARRAY=157]="INT224_ARRAY",L[L.INT232_ARRAY=158]="INT232_ARRAY",L[L.INT240_ARRAY=159]="INT240_ARRAY",L[L.INT248_ARRAY=160]="INT248_ARRAY",L[L.INT256_ARRAY=161]="INT256_ARRAY",L[L.BYTES1_ARRAY=162]="BYTES1_ARRAY",L[L.BYTES2_ARRAY=163]="BYTES2_ARRAY",L[L.BYTES3_ARRAY=164]="BYTES3_ARRAY",L[L.BYTES4_ARRAY=165]="BYTES4_ARRAY",L[L.BYTES5_ARRAY=166]="BYTES5_ARRAY",L[L.BYTES6_ARRAY=167]="BYTES6_ARRAY",L[L.BYTES7_ARRAY=168]="BYTES7_ARRAY",L[L.BYTES8_ARRAY=169]="BYTES8_ARRAY",L[L.BYTES9_ARRAY=170]="BYTES9_ARRAY",L[L.BYTES10_ARRAY=171]="BYTES10_ARRAY",L[L.BYTES11_ARRAY=172]="BYTES11_ARRAY",L[L.BYTES12_ARRAY=173]="BYTES12_ARRAY",L[L.BYTES13_ARRAY=174]="BYTES13_ARRAY",L[L.BYTES14_ARRAY=175]="BYTES14_ARRAY",L[L.BYTES15_ARRAY=176]="BYTES15_ARRAY",L[L.BYTES16_ARRAY=177]="BYTES16_ARRAY",L[L.BYTES17_ARRAY=178]="BYTES17_ARRAY",L[L.BYTES18_ARRAY=179]="BYTES18_ARRAY",L[L.BYTES19_ARRAY=180]="BYTES19_ARRAY",L[L.BYTES20_ARRAY=181]="BYTES20_ARRAY",L[L.BYTES21_ARRAY=182]="BYTES21_ARRAY",L[L.BYTES22_ARRAY=183]="BYTES22_ARRAY",L[L.BYTES23_ARRAY=184]="BYTES23_ARRAY",L[L.BYTES24_ARRAY=185]="BYTES24_ARRAY",L[L.BYTES25_ARRAY=186]="BYTES25_ARRAY",L[L.BYTES26_ARRAY=187]="BYTES26_ARRAY",L[L.BYTES27_ARRAY=188]="BYTES27_ARRAY",L[L.BYTES28_ARRAY=189]="BYTES28_ARRAY",L[L.BYTES29_ARRAY=190]="BYTES29_ARRAY",L[L.BYTES30_ARRAY=191]="BYTES30_ARRAY",L[L.BYTES31_ARRAY=192]="BYTES31_ARRAY",L[L.BYTES32_ARRAY=193]="BYTES32_ARRAY",L[L.BOOL_ARRAY=194]="BOOL_ARRAY",L[L.ADDRESS_ARRAY=195]="ADDRESS_ARRAY",L[L.BYTES=196]="BYTES",L[L.STRING=197]="STRING",L))(I$1||{}),Y$1={[0]:"uint8",[1]:"uint16",[2]:"uint24",[3]:"uint32",[4]:"uint40",[5]:"uint48",[6]:"uint56",[7]:"uint64",[8]:"uint72",[9]:"uint80",[10]:"uint88",[11]:"uint96",[12]:"uint104",[13]:"uint112",[14]:"uint120",[15]:"uint128",[16]:"uint136",[17]:"uint144",[18]:"uint152",[19]:"uint160",[20]:"uint168",[21]:"uint176",[22]:"uint184",[23]:"uint192",[24]:"uint200",[25]:"uint208",[26]:"uint216",[27]:"uint224",[28]:"uint232",[29]:"uint240",[30]:"uint248",[31]:"uint256",[32]:"int8",[33]:"int16",[34]:"int24",[35]:"int32",[36]:"int40",[37]:"int48",[38]:"int56",[39]:"int64",[40]:"int72",[41]:"int80",[42]:"int88",[43]:"int96",[44]:"int104",[45]:"int112",[46]:"int120",[47]:"int128",[48]:"int136",[49]:"int144",[50]:"int152",[51]:"int160",[52]:"int168",[53]:"int176",[54]:"int184",[55]:"int192",[56]:"int200",[57]:"int208",[58]:"int216",[59]:"int224",[60]:"int232",[61]:"int240",[62]:"int248",[63]:"int256",[64]:"bytes1",[65]:"bytes2",[66]:"bytes3",[67]:"bytes4",[68]:"bytes5",[69]:"bytes6",[70]:"bytes7",[71]:"bytes8",[72]:"bytes9",[73]:"bytes10",[74]:"bytes11",[75]:"bytes12",[76]:"bytes13",[77]:"bytes14",[78]:"bytes15",[79]:"bytes16",[80]:"bytes17",[81]:"bytes18",[82]:"bytes19",[83]:"bytes20",[84]:"bytes21",[85]:"bytes22",[86]:"bytes23",[87]:"bytes24",[88]:"bytes25",[89]:"bytes26",[90]:"bytes27",[91]:"bytes28",[92]:"bytes29",[93]:"bytes30",[94]:"bytes31",[95]:"bytes32",[96]:"bool",[97]:"address",[98]:"uint8[]",[99]:"uint16[]",[100]:"uint24[]",[101]:"uint32[]",[102]:"uint40[]",[103]:"uint48[]",[104]:"uint56[]",[105]:"uint64[]",[106]:"uint72[]",[107]:"uint80[]",[108]:"uint88[]",[109]:"uint96[]",[110]:"uint104[]",[111]:"uint112[]",[112]:"uint120[]",[113]:"uint128[]",[114]:"uint136[]",[115]:"uint144[]",[116]:"uint152[]",[117]:"uint160[]",[118]:"uint168[]",[119]:"uint176[]",[120]:"uint184[]",[121]:"uint192[]",[122]:"uint200[]",[123]:"uint208[]",[124]:"uint216[]",[125]:"uint224[]",[126]:"uint232[]",[127]:"uint240[]",[128]:"uint248[]",[129]:"uint256[]",[130]:"int8[]",[131]:"int16[]",[132]:"int24[]",[133]:"int32[]",[134]:"int40[]",[135]:"int48[]",[136]:"int56[]",[137]:"int64[]",[138]:"int72[]",[139]:"int80[]",[140]:"int88[]",[141]:"int96[]",[142]:"int104[]",[143]:"int112[]",[144]:"int120[]",[145]:"int128[]",[146]:"int136[]",[147]:"int144[]",[148]:"int152[]",[149]:"int160[]",[150]:"int168[]",[151]:"int176[]",[152]:"int184[]",[153]:"int192[]",[154]:"int200[]",[155]:"int208[]",[156]:"int216[]",[157]:"int224[]",[158]:"int232[]",[159]:"int240[]",[160]:"int248[]",[161]:"int256[]",[162]:"bytes1[]",[163]:"bytes2[]",[164]:"bytes3[]",[165]:"bytes4[]",[166]:"bytes5[]",[167]:"bytes6[]",[168]:"bytes7[]",[169]:"bytes8[]",[170]:"bytes9[]",[171]:"bytes10[]",[172]:"bytes11[]",[173]:"bytes12[]",[174]:"bytes13[]",[175]:"bytes14[]",[176]:"bytes15[]",[177]:"bytes16[]",[178]:"bytes17[]",[179]:"bytes18[]",[180]:"bytes19[]",[181]:"bytes20[]",[182]:"bytes21[]",[183]:"bytes22[]",[184]:"bytes23[]",[185]:"bytes24[]",[186]:"bytes25[]",[187]:"bytes26[]",[188]:"bytes27[]",[189]:"bytes28[]",[190]:"bytes29[]",[191]:"bytes30[]",[192]:"bytes31[]",[193]:"bytes32[]",[194]:"bool[]",[195]:"address[]",[196]:"bytes",[197]:"string"},s$2=Object.values(Y$1),_$1=Object.fromEntries(Object.entries(Y$1).map(([L,Z])=>[Z,parseInt(L)]));function n(L){let Z=L.valueOf();return Z<32?Z+1:Z<64?Z+1-32:Z<96?Z+1-64:L==96?1:L==97?20:0}var U$3=s$2.filter(L=>n(_$1[L])>0),util$5;(function(L){L.assertEqual=ie=>ie;function Z(ie){}L.assertIs=Z;function X(ie){throw new Error}L.assertNever=X,L.arrayToEnum=ie=>{const oe={};for(const se of ie)oe[se]=se;return oe},L.getValidEnumValues=ie=>{const oe=L.objectKeys(ie).filter(ue=>typeof ie[ie[ue]]!="number"),se={};for(const ue of oe)se[ue]=ie[ue];return L.objectValues(se)},L.objectValues=ie=>L.objectKeys(ie).map(function(oe){return ie[oe]}),L.objectKeys=typeof Object.keys=="function"?ie=>Object.keys(ie):ie=>{const oe=[];for(const se in ie)Object.prototype.hasOwnProperty.call(ie,se)&&oe.push(se);return oe},L.find=(ie,oe)=>{for(const se of ie)if(oe(se))return se},L.isInteger=typeof Number.isInteger=="function"?ie=>Number.isInteger(ie):ie=>typeof ie=="number"&&isFinite(ie)&&Math.floor(ie)===ie;function te(ie,oe=" | "){return ie.map(se=>typeof se=="string"?`'${se}'`:se).join(oe)}L.joinValues=te,L.jsonStringifyReplacer=(ie,oe)=>typeof oe=="bigint"?oe.toString():oe})(util$5||(util$5={}));var objectUtil;(function(L){L.mergeShapes=(Z,X)=>({...Z,...X})})(objectUtil||(objectUtil={}));const ZodParsedType=util$5.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=L=>{switch(typeof L){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return isNaN(L)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(L)?ZodParsedType.array:L===null?ZodParsedType.null:L.then&&typeof L.then=="function"&&L.catch&&typeof L.catch=="function"?ZodParsedType.promise:typeof Map<"u"&&L instanceof Map?ZodParsedType.map:typeof Set<"u"&&L instanceof Set?ZodParsedType.set:typeof Date<"u"&&L instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util$5.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),quotelessJson=L=>JSON.stringify(L,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{constructor(Z){super(),this.issues=[],this.addIssue=te=>{this.issues=[...this.issues,te]},this.addIssues=(te=[])=>{this.issues=[...this.issues,...te]};const X=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,X):this.__proto__=X,this.name="ZodError",this.issues=Z}get errors(){return this.issues}format(Z){const X=Z||function(oe){return oe.message},te={_errors:[]},ie=oe=>{for(const se of oe.issues)if(se.code==="invalid_union")se.unionErrors.map(ie);else if(se.code==="invalid_return_type")ie(se.returnTypeError);else if(se.code==="invalid_arguments")ie(se.argumentsError);else if(se.path.length===0)te._errors.push(X(se));else{let ue=te,ce=0;for(;ceX.message){const X={},te=[];for(const ie of this.issues)ie.path.length>0?(X[ie.path[0]]=X[ie.path[0]]||[],X[ie.path[0]].push(Z(ie))):te.push(Z(ie));return{formErrors:te,fieldErrors:X}}get formErrors(){return this.flatten()}}ZodError.create=L=>new ZodError(L);const errorMap=(L,Z)=>{let X;switch(L.code){case ZodIssueCode.invalid_type:L.received===ZodParsedType.undefined?X="Required":X=`Expected ${L.expected}, received ${L.received}`;break;case ZodIssueCode.invalid_literal:X=`Invalid literal value, expected ${JSON.stringify(L.expected,util$5.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:X=`Unrecognized key(s) in object: ${util$5.joinValues(L.keys,", ")}`;break;case ZodIssueCode.invalid_union:X="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:X=`Invalid discriminator value. Expected ${util$5.joinValues(L.options)}`;break;case ZodIssueCode.invalid_enum_value:X=`Invalid enum value. Expected ${util$5.joinValues(L.options)}, received '${L.received}'`;break;case ZodIssueCode.invalid_arguments:X="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:X="Invalid function return type";break;case ZodIssueCode.invalid_date:X="Invalid date";break;case ZodIssueCode.invalid_string:typeof L.validation=="object"?"includes"in L.validation?(X=`Invalid input: must include "${L.validation.includes}"`,typeof L.validation.position=="number"&&(X=`${X} at one or more positions greater than or equal to ${L.validation.position}`)):"startsWith"in L.validation?X=`Invalid input: must start with "${L.validation.startsWith}"`:"endsWith"in L.validation?X=`Invalid input: must end with "${L.validation.endsWith}"`:util$5.assertNever(L.validation):L.validation!=="regex"?X=`Invalid ${L.validation}`:X="Invalid";break;case ZodIssueCode.too_small:L.type==="array"?X=`Array must contain ${L.exact?"exactly":L.inclusive?"at least":"more than"} ${L.minimum} element(s)`:L.type==="string"?X=`String must contain ${L.exact?"exactly":L.inclusive?"at least":"over"} ${L.minimum} character(s)`:L.type==="number"?X=`Number must be ${L.exact?"exactly equal to ":L.inclusive?"greater than or equal to ":"greater than "}${L.minimum}`:L.type==="date"?X=`Date must be ${L.exact?"exactly equal to ":L.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(L.minimum))}`:X="Invalid input";break;case ZodIssueCode.too_big:L.type==="array"?X=`Array must contain ${L.exact?"exactly":L.inclusive?"at most":"less than"} ${L.maximum} element(s)`:L.type==="string"?X=`String must contain ${L.exact?"exactly":L.inclusive?"at most":"under"} ${L.maximum} character(s)`:L.type==="number"?X=`Number must be ${L.exact?"exactly":L.inclusive?"less than or equal to":"less than"} ${L.maximum}`:L.type==="bigint"?X=`BigInt must be ${L.exact?"exactly":L.inclusive?"less than or equal to":"less than"} ${L.maximum}`:L.type==="date"?X=`Date must be ${L.exact?"exactly":L.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(L.maximum))}`:X="Invalid input";break;case ZodIssueCode.custom:X="Invalid input";break;case ZodIssueCode.invalid_intersection_types:X="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:X=`Number must be a multiple of ${L.multipleOf}`;break;case ZodIssueCode.not_finite:X="Number must be finite";break;default:X=Z.defaultError,util$5.assertNever(L)}return{message:X}};let overrideErrorMap=errorMap;function setErrorMap(L){overrideErrorMap=L}function getErrorMap(){return overrideErrorMap}const makeIssue=L=>{const{data:Z,path:X,errorMaps:te,issueData:ie}=L,oe=[...X,...ie.path||[]],se={...ie,path:oe};let ue="";const ce=te.filter(le=>!!le).slice().reverse();for(const le of ce)ue=le(se,{data:Z,defaultError:ue}).message;return{...ie,path:oe,message:ie.message||ue}},EMPTY_PATH=[];function addIssueToContext(L,Z){const X=makeIssue({issueData:Z,data:L.data,path:L.path,errorMaps:[L.common.contextualErrorMap,L.schemaErrorMap,getErrorMap(),errorMap].filter(te=>!!te)});L.common.issues.push(X)}class ParseStatus{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(Z,X){const te=[];for(const ie of X){if(ie.status==="aborted")return INVALID;ie.status==="dirty"&&Z.dirty(),te.push(ie.value)}return{status:Z.value,value:te}}static async mergeObjectAsync(Z,X){const te=[];for(const ie of X)te.push({key:await ie.key,value:await ie.value});return ParseStatus.mergeObjectSync(Z,te)}static mergeObjectSync(Z,X){const te={};for(const ie of X){const{key:oe,value:se}=ie;if(oe.status==="aborted"||se.status==="aborted")return INVALID;oe.status==="dirty"&&Z.dirty(),se.status==="dirty"&&Z.dirty(),oe.value!=="__proto__"&&(typeof se.value<"u"||ie.alwaysSet)&&(te[oe.value]=se.value)}return{status:Z.value,value:te}}}const INVALID=Object.freeze({status:"aborted"}),DIRTY=L=>({status:"dirty",value:L}),OK=L=>({status:"valid",value:L}),isAborted=L=>L.status==="aborted",isDirty=L=>L.status==="dirty",isValid=L=>L.status==="valid",isAsync=L=>typeof Promise<"u"&&L instanceof Promise;var errorUtil;(function(L){L.errToObj=Z=>typeof Z=="string"?{message:Z}:Z||{},L.toString=Z=>typeof Z=="string"?Z:Z?.message})(errorUtil||(errorUtil={}));class ParseInputLazyPath{constructor(Z,X,te,ie){this._cachedPath=[],this.parent=Z,this.data=X,this._path=te,this._key=ie}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(L,Z)=>{if(isValid(Z))return{success:!0,data:Z.value};if(!L.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const X=new ZodError(L.common.issues);return this._error=X,this._error}}};function processCreateParams(L){if(!L)return{};const{errorMap:Z,invalid_type_error:X,required_error:te,description:ie}=L;if(Z&&(X||te))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return Z?{errorMap:Z,description:ie}:{errorMap:(se,ue)=>se.code!=="invalid_type"?{message:ue.defaultError}:typeof ue.data>"u"?{message:te??ue.defaultError}:{message:X??ue.defaultError},description:ie}}class ZodType{constructor(Z){this.spa=this.safeParseAsync,this._def=Z,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(Z){return getParsedType(Z.data)}_getOrReturnCtx(Z,X){return X||{common:Z.parent.common,data:Z.data,parsedType:getParsedType(Z.data),schemaErrorMap:this._def.errorMap,path:Z.path,parent:Z.parent}}_processInputParams(Z){return{status:new ParseStatus,ctx:{common:Z.parent.common,data:Z.data,parsedType:getParsedType(Z.data),schemaErrorMap:this._def.errorMap,path:Z.path,parent:Z.parent}}}_parseSync(Z){const X=this._parse(Z);if(isAsync(X))throw new Error("Synchronous parse encountered promise.");return X}_parseAsync(Z){const X=this._parse(Z);return Promise.resolve(X)}parse(Z,X){const te=this.safeParse(Z,X);if(te.success)return te.data;throw te.error}safeParse(Z,X){var te;const ie={common:{issues:[],async:(te=X?.async)!==null&&te!==void 0?te:!1,contextualErrorMap:X?.errorMap},path:X?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:Z,parsedType:getParsedType(Z)},oe=this._parseSync({data:Z,path:ie.path,parent:ie});return handleResult(ie,oe)}async parseAsync(Z,X){const te=await this.safeParseAsync(Z,X);if(te.success)return te.data;throw te.error}async safeParseAsync(Z,X){const te={common:{issues:[],contextualErrorMap:X?.errorMap,async:!0},path:X?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:Z,parsedType:getParsedType(Z)},ie=this._parse({data:Z,path:te.path,parent:te}),oe=await(isAsync(ie)?ie:Promise.resolve(ie));return handleResult(te,oe)}refine(Z,X){const te=ie=>typeof X=="string"||typeof X>"u"?{message:X}:typeof X=="function"?X(ie):X;return this._refinement((ie,oe)=>{const se=Z(ie),ue=()=>oe.addIssue({code:ZodIssueCode.custom,...te(ie)});return typeof Promise<"u"&&se instanceof Promise?se.then(ce=>ce?!0:(ue(),!1)):se?!0:(ue(),!1)})}refinement(Z,X){return this._refinement((te,ie)=>Z(te)?!0:(ie.addIssue(typeof X=="function"?X(te,ie):X),!1))}_refinement(Z){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:Z}})}superRefine(Z){return this._refinement(Z)}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this,this._def)}promise(){return ZodPromise.create(this,this._def)}or(Z){return ZodUnion.create([this,Z],this._def)}and(Z){return ZodIntersection.create(this,Z,this._def)}transform(Z){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:Z}})}default(Z){const X=typeof Z=="function"?Z:()=>Z;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:X,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(Z){const X=typeof Z=="function"?Z:()=>Z;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:X,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(Z){const X=this.constructor;return new X({...this._def,description:Z})}pipe(Z){return ZodPipeline.create(this,Z)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[a-z][a-z0-9]*$/,ulidRegex=/[0-9A-HJKMNP-TV-Z]{26}/,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,emailRegex=/^([A-Z0-9_+-]+\.?)*[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,emojiRegex=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,ipv4Regex=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,ipv6Regex=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,datetimeRegex=L=>L.precision?L.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${L.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${L.precision}}Z$`):L.precision===0?L.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):L.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function isValidIP(L,Z){return!!((Z==="v4"||!Z)&&ipv4Regex.test(L)||(Z==="v6"||!Z)&&ipv6Regex.test(L))}class ZodString extends ZodType{constructor(){super(...arguments),this._regex=(Z,X,te)=>this.refinement(ie=>Z.test(ie),{validation:X,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(te)}),this.nonempty=Z=>this.min(1,errorUtil.errToObj(Z)),this.trim=()=>new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(Z){if(this._def.coerce&&(Z.data=String(Z.data)),this._getType(Z)!==ZodParsedType.string){const oe=this._getOrReturnCtx(Z);return addIssueToContext(oe,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:oe.parsedType}),INVALID}const te=new ParseStatus;let ie;for(const oe of this._def.checks)if(oe.kind==="min")Z.data.lengthoe.value&&(ie=this._getOrReturnCtx(Z,ie),addIssueToContext(ie,{code:ZodIssueCode.too_big,maximum:oe.value,type:"string",inclusive:!0,exact:!1,message:oe.message}),te.dirty());else if(oe.kind==="length"){const se=Z.data.length>oe.value,ue=Z.data.length"u"?null:Z?.precision,offset:(X=Z?.offset)!==null&&X!==void 0?X:!1,...errorUtil.errToObj(Z?.message)})}regex(Z,X){return this._addCheck({kind:"regex",regex:Z,...errorUtil.errToObj(X)})}includes(Z,X){return this._addCheck({kind:"includes",value:Z,position:X?.position,...errorUtil.errToObj(X?.message)})}startsWith(Z,X){return this._addCheck({kind:"startsWith",value:Z,...errorUtil.errToObj(X)})}endsWith(Z,X){return this._addCheck({kind:"endsWith",value:Z,...errorUtil.errToObj(X)})}min(Z,X){return this._addCheck({kind:"min",value:Z,...errorUtil.errToObj(X)})}max(Z,X){return this._addCheck({kind:"max",value:Z,...errorUtil.errToObj(X)})}length(Z,X){return this._addCheck({kind:"length",value:Z,...errorUtil.errToObj(X)})}get isDatetime(){return!!this._def.checks.find(Z=>Z.kind==="datetime")}get isEmail(){return!!this._def.checks.find(Z=>Z.kind==="email")}get isURL(){return!!this._def.checks.find(Z=>Z.kind==="url")}get isEmoji(){return!!this._def.checks.find(Z=>Z.kind==="emoji")}get isUUID(){return!!this._def.checks.find(Z=>Z.kind==="uuid")}get isCUID(){return!!this._def.checks.find(Z=>Z.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(Z=>Z.kind==="cuid2")}get isULID(){return!!this._def.checks.find(Z=>Z.kind==="ulid")}get isIP(){return!!this._def.checks.find(Z=>Z.kind==="ip")}get minLength(){let Z=null;for(const X of this._def.checks)X.kind==="min"&&(Z===null||X.value>Z)&&(Z=X.value);return Z}get maxLength(){let Z=null;for(const X of this._def.checks)X.kind==="max"&&(Z===null||X.value{var Z;return new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:(Z=L?.coerce)!==null&&Z!==void 0?Z:!1,...processCreateParams(L)})};function floatSafeRemainder(L,Z){const X=(L.toString().split(".")[1]||"").length,te=(Z.toString().split(".")[1]||"").length,ie=X>te?X:te,oe=parseInt(L.toFixed(ie).replace(".","")),se=parseInt(Z.toFixed(ie).replace(".",""));return oe%se/Math.pow(10,ie)}class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(Z){if(this._def.coerce&&(Z.data=Number(Z.data)),this._getType(Z)!==ZodParsedType.number){const oe=this._getOrReturnCtx(Z);return addIssueToContext(oe,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:oe.parsedType}),INVALID}let te;const ie=new ParseStatus;for(const oe of this._def.checks)oe.kind==="int"?util$5.isInteger(Z.data)||(te=this._getOrReturnCtx(Z,te),addIssueToContext(te,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:oe.message}),ie.dirty()):oe.kind==="min"?(oe.inclusive?Z.dataoe.value:Z.data>=oe.value)&&(te=this._getOrReturnCtx(Z,te),addIssueToContext(te,{code:ZodIssueCode.too_big,maximum:oe.value,type:"number",inclusive:oe.inclusive,exact:!1,message:oe.message}),ie.dirty()):oe.kind==="multipleOf"?floatSafeRemainder(Z.data,oe.value)!==0&&(te=this._getOrReturnCtx(Z,te),addIssueToContext(te,{code:ZodIssueCode.not_multiple_of,multipleOf:oe.value,message:oe.message}),ie.dirty()):oe.kind==="finite"?Number.isFinite(Z.data)||(te=this._getOrReturnCtx(Z,te),addIssueToContext(te,{code:ZodIssueCode.not_finite,message:oe.message}),ie.dirty()):util$5.assertNever(oe);return{status:ie.value,value:Z.data}}gte(Z,X){return this.setLimit("min",Z,!0,errorUtil.toString(X))}gt(Z,X){return this.setLimit("min",Z,!1,errorUtil.toString(X))}lte(Z,X){return this.setLimit("max",Z,!0,errorUtil.toString(X))}lt(Z,X){return this.setLimit("max",Z,!1,errorUtil.toString(X))}setLimit(Z,X,te,ie){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:Z,value:X,inclusive:te,message:errorUtil.toString(ie)}]})}_addCheck(Z){return new ZodNumber({...this._def,checks:[...this._def.checks,Z]})}int(Z){return this._addCheck({kind:"int",message:errorUtil.toString(Z)})}positive(Z){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(Z)})}negative(Z){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(Z)})}nonpositive(Z){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(Z)})}nonnegative(Z){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(Z)})}multipleOf(Z,X){return this._addCheck({kind:"multipleOf",value:Z,message:errorUtil.toString(X)})}finite(Z){return this._addCheck({kind:"finite",message:errorUtil.toString(Z)})}safe(Z){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(Z)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(Z)})}get minValue(){let Z=null;for(const X of this._def.checks)X.kind==="min"&&(Z===null||X.value>Z)&&(Z=X.value);return Z}get maxValue(){let Z=null;for(const X of this._def.checks)X.kind==="max"&&(Z===null||X.valueZ.kind==="int"||Z.kind==="multipleOf"&&util$5.isInteger(Z.value))}get isFinite(){let Z=null,X=null;for(const te of this._def.checks){if(te.kind==="finite"||te.kind==="int"||te.kind==="multipleOf")return!0;te.kind==="min"?(X===null||te.value>X)&&(X=te.value):te.kind==="max"&&(Z===null||te.valuenew ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:L?.coerce||!1,...processCreateParams(L)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(Z){if(this._def.coerce&&(Z.data=BigInt(Z.data)),this._getType(Z)!==ZodParsedType.bigint){const oe=this._getOrReturnCtx(Z);return addIssueToContext(oe,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:oe.parsedType}),INVALID}let te;const ie=new ParseStatus;for(const oe of this._def.checks)oe.kind==="min"?(oe.inclusive?Z.dataoe.value:Z.data>=oe.value)&&(te=this._getOrReturnCtx(Z,te),addIssueToContext(te,{code:ZodIssueCode.too_big,type:"bigint",maximum:oe.value,inclusive:oe.inclusive,message:oe.message}),ie.dirty()):oe.kind==="multipleOf"?Z.data%oe.value!==BigInt(0)&&(te=this._getOrReturnCtx(Z,te),addIssueToContext(te,{code:ZodIssueCode.not_multiple_of,multipleOf:oe.value,message:oe.message}),ie.dirty()):util$5.assertNever(oe);return{status:ie.value,value:Z.data}}gte(Z,X){return this.setLimit("min",Z,!0,errorUtil.toString(X))}gt(Z,X){return this.setLimit("min",Z,!1,errorUtil.toString(X))}lte(Z,X){return this.setLimit("max",Z,!0,errorUtil.toString(X))}lt(Z,X){return this.setLimit("max",Z,!1,errorUtil.toString(X))}setLimit(Z,X,te,ie){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:Z,value:X,inclusive:te,message:errorUtil.toString(ie)}]})}_addCheck(Z){return new ZodBigInt({...this._def,checks:[...this._def.checks,Z]})}positive(Z){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(Z)})}negative(Z){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(Z)})}nonpositive(Z){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(Z)})}nonnegative(Z){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(Z)})}multipleOf(Z,X){return this._addCheck({kind:"multipleOf",value:Z,message:errorUtil.toString(X)})}get minValue(){let Z=null;for(const X of this._def.checks)X.kind==="min"&&(Z===null||X.value>Z)&&(Z=X.value);return Z}get maxValue(){let Z=null;for(const X of this._def.checks)X.kind==="max"&&(Z===null||X.value{var Z;return new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:(Z=L?.coerce)!==null&&Z!==void 0?Z:!1,...processCreateParams(L)})};class ZodBoolean extends ZodType{_parse(Z){if(this._def.coerce&&(Z.data=!!Z.data),this._getType(Z)!==ZodParsedType.boolean){const te=this._getOrReturnCtx(Z);return addIssueToContext(te,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:te.parsedType}),INVALID}return OK(Z.data)}}ZodBoolean.create=L=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:L?.coerce||!1,...processCreateParams(L)});class ZodDate extends ZodType{_parse(Z){if(this._def.coerce&&(Z.data=new Date(Z.data)),this._getType(Z)!==ZodParsedType.date){const oe=this._getOrReturnCtx(Z);return addIssueToContext(oe,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:oe.parsedType}),INVALID}if(isNaN(Z.data.getTime())){const oe=this._getOrReturnCtx(Z);return addIssueToContext(oe,{code:ZodIssueCode.invalid_date}),INVALID}const te=new ParseStatus;let ie;for(const oe of this._def.checks)oe.kind==="min"?Z.data.getTime()oe.value&&(ie=this._getOrReturnCtx(Z,ie),addIssueToContext(ie,{code:ZodIssueCode.too_big,message:oe.message,inclusive:!0,exact:!1,maximum:oe.value,type:"date"}),te.dirty()):util$5.assertNever(oe);return{status:te.value,value:new Date(Z.data.getTime())}}_addCheck(Z){return new ZodDate({...this._def,checks:[...this._def.checks,Z]})}min(Z,X){return this._addCheck({kind:"min",value:Z.getTime(),message:errorUtil.toString(X)})}max(Z,X){return this._addCheck({kind:"max",value:Z.getTime(),message:errorUtil.toString(X)})}get minDate(){let Z=null;for(const X of this._def.checks)X.kind==="min"&&(Z===null||X.value>Z)&&(Z=X.value);return Z!=null?new Date(Z):null}get maxDate(){let Z=null;for(const X of this._def.checks)X.kind==="max"&&(Z===null||X.valuenew ZodDate({checks:[],coerce:L?.coerce||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(L)});class ZodSymbol extends ZodType{_parse(Z){if(this._getType(Z)!==ZodParsedType.symbol){const te=this._getOrReturnCtx(Z);return addIssueToContext(te,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:te.parsedType}),INVALID}return OK(Z.data)}}ZodSymbol.create=L=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(L)});class ZodUndefined extends ZodType{_parse(Z){if(this._getType(Z)!==ZodParsedType.undefined){const te=this._getOrReturnCtx(Z);return addIssueToContext(te,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:te.parsedType}),INVALID}return OK(Z.data)}}ZodUndefined.create=L=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(L)});class ZodNull extends ZodType{_parse(Z){if(this._getType(Z)!==ZodParsedType.null){const te=this._getOrReturnCtx(Z);return addIssueToContext(te,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:te.parsedType}),INVALID}return OK(Z.data)}}ZodNull.create=L=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(L)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(Z){return OK(Z.data)}}ZodAny.create=L=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(L)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(Z){return OK(Z.data)}}ZodUnknown.create=L=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(L)});class ZodNever extends ZodType{_parse(Z){const X=this._getOrReturnCtx(Z);return addIssueToContext(X,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:X.parsedType}),INVALID}}ZodNever.create=L=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(L)});class ZodVoid extends ZodType{_parse(Z){if(this._getType(Z)!==ZodParsedType.undefined){const te=this._getOrReturnCtx(Z);return addIssueToContext(te,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:te.parsedType}),INVALID}return OK(Z.data)}}ZodVoid.create=L=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(L)});class ZodArray extends ZodType{_parse(Z){const{ctx:X,status:te}=this._processInputParams(Z),ie=this._def;if(X.parsedType!==ZodParsedType.array)return addIssueToContext(X,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:X.parsedType}),INVALID;if(ie.exactLength!==null){const se=X.data.length>ie.exactLength.value,ue=X.data.lengthie.maxLength.value&&(addIssueToContext(X,{code:ZodIssueCode.too_big,maximum:ie.maxLength.value,type:"array",inclusive:!0,exact:!1,message:ie.maxLength.message}),te.dirty()),X.common.async)return Promise.all([...X.data].map((se,ue)=>ie.type._parseAsync(new ParseInputLazyPath(X,se,X.path,ue)))).then(se=>ParseStatus.mergeArray(te,se));const oe=[...X.data].map((se,ue)=>ie.type._parseSync(new ParseInputLazyPath(X,se,X.path,ue)));return ParseStatus.mergeArray(te,oe)}get element(){return this._def.type}min(Z,X){return new ZodArray({...this._def,minLength:{value:Z,message:errorUtil.toString(X)}})}max(Z,X){return new ZodArray({...this._def,maxLength:{value:Z,message:errorUtil.toString(X)}})}length(Z,X){return new ZodArray({...this._def,exactLength:{value:Z,message:errorUtil.toString(X)}})}nonempty(Z){return this.min(1,Z)}}ZodArray.create=(L,Z)=>new ZodArray({type:L,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(Z)});function deepPartialify(L){if(L instanceof ZodObject){const Z={};for(const X in L.shape){const te=L.shape[X];Z[X]=ZodOptional.create(deepPartialify(te))}return new ZodObject({...L._def,shape:()=>Z})}else return L instanceof ZodArray?new ZodArray({...L._def,type:deepPartialify(L.element)}):L instanceof ZodOptional?ZodOptional.create(deepPartialify(L.unwrap())):L instanceof ZodNullable?ZodNullable.create(deepPartialify(L.unwrap())):L instanceof ZodTuple?ZodTuple.create(L.items.map(Z=>deepPartialify(Z))):L}class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const Z=this._def.shape(),X=util$5.objectKeys(Z);return this._cached={shape:Z,keys:X}}_parse(Z){if(this._getType(Z)!==ZodParsedType.object){const le=this._getOrReturnCtx(Z);return addIssueToContext(le,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:le.parsedType}),INVALID}const{status:te,ctx:ie}=this._processInputParams(Z),{shape:oe,keys:se}=this._getCached(),ue=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip"))for(const le in ie.data)se.includes(le)||ue.push(le);const ce=[];for(const le of se){const de=oe[le],he=ie.data[le];ce.push({key:{status:"valid",value:le},value:de._parse(new ParseInputLazyPath(ie,he,ie.path,le)),alwaysSet:le in ie.data})}if(this._def.catchall instanceof ZodNever){const le=this._def.unknownKeys;if(le==="passthrough")for(const de of ue)ce.push({key:{status:"valid",value:de},value:{status:"valid",value:ie.data[de]}});else if(le==="strict")ue.length>0&&(addIssueToContext(ie,{code:ZodIssueCode.unrecognized_keys,keys:ue}),te.dirty());else if(le!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const le=this._def.catchall;for(const de of ue){const he=ie.data[de];ce.push({key:{status:"valid",value:de},value:le._parse(new ParseInputLazyPath(ie,he,ie.path,de)),alwaysSet:de in ie.data})}}return ie.common.async?Promise.resolve().then(async()=>{const le=[];for(const de of ce){const he=await de.key;le.push({key:he,value:await de.value,alwaysSet:de.alwaysSet})}return le}).then(le=>ParseStatus.mergeObjectSync(te,le)):ParseStatus.mergeObjectSync(te,ce)}get shape(){return this._def.shape()}strict(Z){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...Z!==void 0?{errorMap:(X,te)=>{var ie,oe,se,ue;const ce=(se=(oe=(ie=this._def).errorMap)===null||oe===void 0?void 0:oe.call(ie,X,te).message)!==null&&se!==void 0?se:te.defaultError;return X.code==="unrecognized_keys"?{message:(ue=errorUtil.errToObj(Z).message)!==null&&ue!==void 0?ue:ce}:{message:ce}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(Z){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...Z})})}merge(Z){return new ZodObject({unknownKeys:Z._def.unknownKeys,catchall:Z._def.catchall,shape:()=>({...this._def.shape(),...Z._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(Z,X){return this.augment({[Z]:X})}catchall(Z){return new ZodObject({...this._def,catchall:Z})}pick(Z){const X={};return util$5.objectKeys(Z).forEach(te=>{Z[te]&&this.shape[te]&&(X[te]=this.shape[te])}),new ZodObject({...this._def,shape:()=>X})}omit(Z){const X={};return util$5.objectKeys(this.shape).forEach(te=>{Z[te]||(X[te]=this.shape[te])}),new ZodObject({...this._def,shape:()=>X})}deepPartial(){return deepPartialify(this)}partial(Z){const X={};return util$5.objectKeys(this.shape).forEach(te=>{const ie=this.shape[te];Z&&!Z[te]?X[te]=ie:X[te]=ie.optional()}),new ZodObject({...this._def,shape:()=>X})}required(Z){const X={};return util$5.objectKeys(this.shape).forEach(te=>{if(Z&&!Z[te])X[te]=this.shape[te];else{let oe=this.shape[te];for(;oe instanceof ZodOptional;)oe=oe._def.innerType;X[te]=oe}}),new ZodObject({...this._def,shape:()=>X})}keyof(){return createZodEnum(util$5.objectKeys(this.shape))}}ZodObject.create=(L,Z)=>new ZodObject({shape:()=>L,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(Z)});ZodObject.strictCreate=(L,Z)=>new ZodObject({shape:()=>L,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(Z)});ZodObject.lazycreate=(L,Z)=>new ZodObject({shape:L,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(Z)});class ZodUnion extends ZodType{_parse(Z){const{ctx:X}=this._processInputParams(Z),te=this._def.options;function ie(oe){for(const ue of oe)if(ue.result.status==="valid")return ue.result;for(const ue of oe)if(ue.result.status==="dirty")return X.common.issues.push(...ue.ctx.common.issues),ue.result;const se=oe.map(ue=>new ZodError(ue.ctx.common.issues));return addIssueToContext(X,{code:ZodIssueCode.invalid_union,unionErrors:se}),INVALID}if(X.common.async)return Promise.all(te.map(async oe=>{const se={...X,common:{...X.common,issues:[]},parent:null};return{result:await oe._parseAsync({data:X.data,path:X.path,parent:se}),ctx:se}})).then(ie);{let oe;const se=[];for(const ce of te){const le={...X,common:{...X.common,issues:[]},parent:null},de=ce._parseSync({data:X.data,path:X.path,parent:le});if(de.status==="valid")return de;de.status==="dirty"&&!oe&&(oe={result:de,ctx:le}),le.common.issues.length&&se.push(le.common.issues)}if(oe)return X.common.issues.push(...oe.ctx.common.issues),oe.result;const ue=se.map(ce=>new ZodError(ce));return addIssueToContext(X,{code:ZodIssueCode.invalid_union,unionErrors:ue}),INVALID}}get options(){return this._def.options}}ZodUnion.create=(L,Z)=>new ZodUnion({options:L,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(Z)});const getDiscriminator=L=>L instanceof ZodLazy?getDiscriminator(L.schema):L instanceof ZodEffects?getDiscriminator(L.innerType()):L instanceof ZodLiteral?[L.value]:L instanceof ZodEnum?L.options:L instanceof ZodNativeEnum?Object.keys(L.enum):L instanceof ZodDefault?getDiscriminator(L._def.innerType):L instanceof ZodUndefined?[void 0]:L instanceof ZodNull?[null]:null;class ZodDiscriminatedUnion extends ZodType{_parse(Z){const{ctx:X}=this._processInputParams(Z);if(X.parsedType!==ZodParsedType.object)return addIssueToContext(X,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:X.parsedType}),INVALID;const te=this.discriminator,ie=X.data[te],oe=this.optionsMap.get(ie);return oe?X.common.async?oe._parseAsync({data:X.data,path:X.path,parent:X}):oe._parseSync({data:X.data,path:X.path,parent:X}):(addIssueToContext(X,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[te]}),INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(Z,X,te){const ie=new Map;for(const oe of X){const se=getDiscriminator(oe.shape[Z]);if(!se)throw new Error(`A discriminator value for key \`${Z}\` could not be extracted from all schema options`);for(const ue of se){if(ie.has(ue))throw new Error(`Discriminator property ${String(Z)} has duplicate value ${String(ue)}`);ie.set(ue,oe)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:Z,options:X,optionsMap:ie,...processCreateParams(te)})}}function mergeValues(L,Z){const X=getParsedType(L),te=getParsedType(Z);if(L===Z)return{valid:!0,data:L};if(X===ZodParsedType.object&&te===ZodParsedType.object){const ie=util$5.objectKeys(Z),oe=util$5.objectKeys(L).filter(ue=>ie.indexOf(ue)!==-1),se={...L,...Z};for(const ue of oe){const ce=mergeValues(L[ue],Z[ue]);if(!ce.valid)return{valid:!1};se[ue]=ce.data}return{valid:!0,data:se}}else if(X===ZodParsedType.array&&te===ZodParsedType.array){if(L.length!==Z.length)return{valid:!1};const ie=[];for(let oe=0;oe{if(isAborted(oe)||isAborted(se))return INVALID;const ue=mergeValues(oe.value,se.value);return ue.valid?((isDirty(oe)||isDirty(se))&&X.dirty(),{status:X.value,value:ue.data}):(addIssueToContext(te,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return te.common.async?Promise.all([this._def.left._parseAsync({data:te.data,path:te.path,parent:te}),this._def.right._parseAsync({data:te.data,path:te.path,parent:te})]).then(([oe,se])=>ie(oe,se)):ie(this._def.left._parseSync({data:te.data,path:te.path,parent:te}),this._def.right._parseSync({data:te.data,path:te.path,parent:te}))}}ZodIntersection.create=(L,Z,X)=>new ZodIntersection({left:L,right:Z,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams(X)});class ZodTuple extends ZodType{_parse(Z){const{status:X,ctx:te}=this._processInputParams(Z);if(te.parsedType!==ZodParsedType.array)return addIssueToContext(te,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:te.parsedType}),INVALID;if(te.data.lengththis._def.items.length&&(addIssueToContext(te,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),X.dirty());const oe=[...te.data].map((se,ue)=>{const ce=this._def.items[ue]||this._def.rest;return ce?ce._parse(new ParseInputLazyPath(te,se,te.path,ue)):null}).filter(se=>!!se);return te.common.async?Promise.all(oe).then(se=>ParseStatus.mergeArray(X,se)):ParseStatus.mergeArray(X,oe)}get items(){return this._def.items}rest(Z){return new ZodTuple({...this._def,rest:Z})}}ZodTuple.create=(L,Z)=>{if(!Array.isArray(L))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:L,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(Z)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(Z){const{status:X,ctx:te}=this._processInputParams(Z);if(te.parsedType!==ZodParsedType.object)return addIssueToContext(te,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:te.parsedType}),INVALID;const ie=[],oe=this._def.keyType,se=this._def.valueType;for(const ue in te.data)ie.push({key:oe._parse(new ParseInputLazyPath(te,ue,te.path,ue)),value:se._parse(new ParseInputLazyPath(te,te.data[ue],te.path,ue))});return te.common.async?ParseStatus.mergeObjectAsync(X,ie):ParseStatus.mergeObjectSync(X,ie)}get element(){return this._def.valueType}static create(Z,X,te){return X instanceof ZodType?new ZodRecord({keyType:Z,valueType:X,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(te)}):new ZodRecord({keyType:ZodString.create(),valueType:Z,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(X)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(Z){const{status:X,ctx:te}=this._processInputParams(Z);if(te.parsedType!==ZodParsedType.map)return addIssueToContext(te,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:te.parsedType}),INVALID;const ie=this._def.keyType,oe=this._def.valueType,se=[...te.data.entries()].map(([ue,ce],le)=>({key:ie._parse(new ParseInputLazyPath(te,ue,te.path,[le,"key"])),value:oe._parse(new ParseInputLazyPath(te,ce,te.path,[le,"value"]))}));if(te.common.async){const ue=new Map;return Promise.resolve().then(async()=>{for(const ce of se){const le=await ce.key,de=await ce.value;if(le.status==="aborted"||de.status==="aborted")return INVALID;(le.status==="dirty"||de.status==="dirty")&&X.dirty(),ue.set(le.value,de.value)}return{status:X.value,value:ue}})}else{const ue=new Map;for(const ce of se){const le=ce.key,de=ce.value;if(le.status==="aborted"||de.status==="aborted")return INVALID;(le.status==="dirty"||de.status==="dirty")&&X.dirty(),ue.set(le.value,de.value)}return{status:X.value,value:ue}}}}ZodMap.create=(L,Z,X)=>new ZodMap({valueType:Z,keyType:L,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams(X)});class ZodSet extends ZodType{_parse(Z){const{status:X,ctx:te}=this._processInputParams(Z);if(te.parsedType!==ZodParsedType.set)return addIssueToContext(te,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:te.parsedType}),INVALID;const ie=this._def;ie.minSize!==null&&te.data.sizeie.maxSize.value&&(addIssueToContext(te,{code:ZodIssueCode.too_big,maximum:ie.maxSize.value,type:"set",inclusive:!0,exact:!1,message:ie.maxSize.message}),X.dirty());const oe=this._def.valueType;function se(ce){const le=new Set;for(const de of ce){if(de.status==="aborted")return INVALID;de.status==="dirty"&&X.dirty(),le.add(de.value)}return{status:X.value,value:le}}const ue=[...te.data.values()].map((ce,le)=>oe._parse(new ParseInputLazyPath(te,ce,te.path,le)));return te.common.async?Promise.all(ue).then(ce=>se(ce)):se(ue)}min(Z,X){return new ZodSet({...this._def,minSize:{value:Z,message:errorUtil.toString(X)}})}max(Z,X){return new ZodSet({...this._def,maxSize:{value:Z,message:errorUtil.toString(X)}})}size(Z,X){return this.min(Z,X).max(Z,X)}nonempty(Z){return this.min(1,Z)}}ZodSet.create=(L,Z)=>new ZodSet({valueType:L,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(Z)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(Z){const{ctx:X}=this._processInputParams(Z);if(X.parsedType!==ZodParsedType.function)return addIssueToContext(X,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:X.parsedType}),INVALID;function te(ue,ce){return makeIssue({data:ue,path:X.path,errorMaps:[X.common.contextualErrorMap,X.schemaErrorMap,getErrorMap(),errorMap].filter(le=>!!le),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:ce}})}function ie(ue,ce){return makeIssue({data:ue,path:X.path,errorMaps:[X.common.contextualErrorMap,X.schemaErrorMap,getErrorMap(),errorMap].filter(le=>!!le),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:ce}})}const oe={errorMap:X.common.contextualErrorMap},se=X.data;if(this._def.returns instanceof ZodPromise){const ue=this;return OK(async function(...ce){const le=new ZodError([]),de=await ue._def.args.parseAsync(ce,oe).catch(_e=>{throw le.addIssue(te(ce,_e)),le}),he=await Reflect.apply(se,this,de);return await ue._def.returns._def.type.parseAsync(he,oe).catch(_e=>{throw le.addIssue(ie(he,_e)),le})})}else{const ue=this;return OK(function(...ce){const le=ue._def.args.safeParse(ce,oe);if(!le.success)throw new ZodError([te(ce,le.error)]);const de=Reflect.apply(se,this,le.data),he=ue._def.returns.safeParse(de,oe);if(!he.success)throw new ZodError([ie(de,he.error)]);return he.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...Z){return new ZodFunction({...this._def,args:ZodTuple.create(Z).rest(ZodUnknown.create())})}returns(Z){return new ZodFunction({...this._def,returns:Z})}implement(Z){return this.parse(Z)}strictImplement(Z){return this.parse(Z)}static create(Z,X,te){return new ZodFunction({args:Z||ZodTuple.create([]).rest(ZodUnknown.create()),returns:X||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(te)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(Z){const{ctx:X}=this._processInputParams(Z);return this._def.getter()._parse({data:X.data,path:X.path,parent:X})}}ZodLazy.create=(L,Z)=>new ZodLazy({getter:L,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(Z)});class ZodLiteral extends ZodType{_parse(Z){if(Z.data!==this._def.value){const X=this._getOrReturnCtx(Z);return addIssueToContext(X,{received:X.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:"valid",value:Z.data}}get value(){return this._def.value}}ZodLiteral.create=(L,Z)=>new ZodLiteral({value:L,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(Z)});function createZodEnum(L,Z){return new ZodEnum({values:L,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(Z)})}class ZodEnum extends ZodType{_parse(Z){if(typeof Z.data!="string"){const X=this._getOrReturnCtx(Z),te=this._def.values;return addIssueToContext(X,{expected:util$5.joinValues(te),received:X.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(this._def.values.indexOf(Z.data)===-1){const X=this._getOrReturnCtx(Z),te=this._def.values;return addIssueToContext(X,{received:X.data,code:ZodIssueCode.invalid_enum_value,options:te}),INVALID}return OK(Z.data)}get options(){return this._def.values}get enum(){const Z={};for(const X of this._def.values)Z[X]=X;return Z}get Values(){const Z={};for(const X of this._def.values)Z[X]=X;return Z}get Enum(){const Z={};for(const X of this._def.values)Z[X]=X;return Z}extract(Z){return ZodEnum.create(Z)}exclude(Z){return ZodEnum.create(this.options.filter(X=>!Z.includes(X)))}}ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{_parse(Z){const X=util$5.getValidEnumValues(this._def.values),te=this._getOrReturnCtx(Z);if(te.parsedType!==ZodParsedType.string&&te.parsedType!==ZodParsedType.number){const ie=util$5.objectValues(X);return addIssueToContext(te,{expected:util$5.joinValues(ie),received:te.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(X.indexOf(Z.data)===-1){const ie=util$5.objectValues(X);return addIssueToContext(te,{received:te.data,code:ZodIssueCode.invalid_enum_value,options:ie}),INVALID}return OK(Z.data)}get enum(){return this._def.values}}ZodNativeEnum.create=(L,Z)=>new ZodNativeEnum({values:L,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(Z)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(Z){const{ctx:X}=this._processInputParams(Z);if(X.parsedType!==ZodParsedType.promise&&X.common.async===!1)return addIssueToContext(X,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:X.parsedType}),INVALID;const te=X.parsedType===ZodParsedType.promise?X.data:Promise.resolve(X.data);return OK(te.then(ie=>this._def.type.parseAsync(ie,{path:X.path,errorMap:X.common.contextualErrorMap})))}}ZodPromise.create=(L,Z)=>new ZodPromise({type:L,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(Z)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(Z){const{status:X,ctx:te}=this._processInputParams(Z),ie=this._def.effect||null,oe={addIssue:se=>{addIssueToContext(te,se),se.fatal?X.abort():X.dirty()},get path(){return te.path}};if(oe.addIssue=oe.addIssue.bind(oe),ie.type==="preprocess"){const se=ie.transform(te.data,oe);return te.common.issues.length?{status:"dirty",value:te.data}:te.common.async?Promise.resolve(se).then(ue=>this._def.schema._parseAsync({data:ue,path:te.path,parent:te})):this._def.schema._parseSync({data:se,path:te.path,parent:te})}if(ie.type==="refinement"){const se=ue=>{const ce=ie.refinement(ue,oe);if(te.common.async)return Promise.resolve(ce);if(ce instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return ue};if(te.common.async===!1){const ue=this._def.schema._parseSync({data:te.data,path:te.path,parent:te});return ue.status==="aborted"?INVALID:(ue.status==="dirty"&&X.dirty(),se(ue.value),{status:X.value,value:ue.value})}else return this._def.schema._parseAsync({data:te.data,path:te.path,parent:te}).then(ue=>ue.status==="aborted"?INVALID:(ue.status==="dirty"&&X.dirty(),se(ue.value).then(()=>({status:X.value,value:ue.value}))))}if(ie.type==="transform")if(te.common.async===!1){const se=this._def.schema._parseSync({data:te.data,path:te.path,parent:te});if(!isValid(se))return se;const ue=ie.transform(se.value,oe);if(ue instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:X.value,value:ue}}else return this._def.schema._parseAsync({data:te.data,path:te.path,parent:te}).then(se=>isValid(se)?Promise.resolve(ie.transform(se.value,oe)).then(ue=>({status:X.value,value:ue})):se);util$5.assertNever(ie)}}ZodEffects.create=(L,Z,X)=>new ZodEffects({schema:L,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:Z,...processCreateParams(X)});ZodEffects.createWithPreprocess=(L,Z,X)=>new ZodEffects({schema:Z,effect:{type:"preprocess",transform:L},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams(X)});class ZodOptional extends ZodType{_parse(Z){return this._getType(Z)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(Z)}unwrap(){return this._def.innerType}}ZodOptional.create=(L,Z)=>new ZodOptional({innerType:L,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(Z)});class ZodNullable extends ZodType{_parse(Z){return this._getType(Z)===ZodParsedType.null?OK(null):this._def.innerType._parse(Z)}unwrap(){return this._def.innerType}}ZodNullable.create=(L,Z)=>new ZodNullable({innerType:L,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(Z)});class ZodDefault extends ZodType{_parse(Z){const{ctx:X}=this._processInputParams(Z);let te=X.data;return X.parsedType===ZodParsedType.undefined&&(te=this._def.defaultValue()),this._def.innerType._parse({data:te,path:X.path,parent:X})}removeDefault(){return this._def.innerType}}ZodDefault.create=(L,Z)=>new ZodDefault({innerType:L,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof Z.default=="function"?Z.default:()=>Z.default,...processCreateParams(Z)});class ZodCatch extends ZodType{_parse(Z){const{ctx:X}=this._processInputParams(Z),te={...X,common:{...X.common,issues:[]}},ie=this._def.innerType._parse({data:te.data,path:te.path,parent:{...te}});return isAsync(ie)?ie.then(oe=>({status:"valid",value:oe.status==="valid"?oe.value:this._def.catchValue({get error(){return new ZodError(te.common.issues)},input:te.data})})):{status:"valid",value:ie.status==="valid"?ie.value:this._def.catchValue({get error(){return new ZodError(te.common.issues)},input:te.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(L,Z)=>new ZodCatch({innerType:L,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof Z.catch=="function"?Z.catch:()=>Z.catch,...processCreateParams(Z)});class ZodNaN extends ZodType{_parse(Z){if(this._getType(Z)!==ZodParsedType.nan){const te=this._getOrReturnCtx(Z);return addIssueToContext(te,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:te.parsedType}),INVALID}return{status:"valid",value:Z.data}}}ZodNaN.create=L=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(L)});const BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(Z){const{ctx:X}=this._processInputParams(Z),te=X.data;return this._def.type._parse({data:te,path:X.path,parent:X})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(Z){const{status:X,ctx:te}=this._processInputParams(Z);if(te.common.async)return(async()=>{const oe=await this._def.in._parseAsync({data:te.data,path:te.path,parent:te});return oe.status==="aborted"?INVALID:oe.status==="dirty"?(X.dirty(),DIRTY(oe.value)):this._def.out._parseAsync({data:oe.value,path:te.path,parent:te})})();{const ie=this._def.in._parseSync({data:te.data,path:te.path,parent:te});return ie.status==="aborted"?INVALID:ie.status==="dirty"?(X.dirty(),{status:"dirty",value:ie.value}):this._def.out._parseSync({data:ie.value,path:te.path,parent:te})}}static create(Z,X){return new ZodPipeline({in:Z,out:X,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(Z){const X=this._def.innerType._parse(Z);return isValid(X)&&(X.value=Object.freeze(X.value)),X}}ZodReadonly.create=(L,Z)=>new ZodReadonly({innerType:L,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(Z)});const custom=(L,Z={},X)=>L?ZodAny.create().superRefine((te,ie)=>{var oe,se;if(!L(te)){const ue=typeof Z=="function"?Z(te):typeof Z=="string"?{message:Z}:Z,ce=(se=(oe=ue.fatal)!==null&&oe!==void 0?oe:X)!==null&&se!==void 0?se:!0,le=typeof ue=="string"?{message:ue}:ue;ie.addIssue({code:"custom",...le,fatal:ce})}}):ZodAny.create(),late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;(function(L){L.ZodString="ZodString",L.ZodNumber="ZodNumber",L.ZodNaN="ZodNaN",L.ZodBigInt="ZodBigInt",L.ZodBoolean="ZodBoolean",L.ZodDate="ZodDate",L.ZodSymbol="ZodSymbol",L.ZodUndefined="ZodUndefined",L.ZodNull="ZodNull",L.ZodAny="ZodAny",L.ZodUnknown="ZodUnknown",L.ZodNever="ZodNever",L.ZodVoid="ZodVoid",L.ZodArray="ZodArray",L.ZodObject="ZodObject",L.ZodUnion="ZodUnion",L.ZodDiscriminatedUnion="ZodDiscriminatedUnion",L.ZodIntersection="ZodIntersection",L.ZodTuple="ZodTuple",L.ZodRecord="ZodRecord",L.ZodMap="ZodMap",L.ZodSet="ZodSet",L.ZodFunction="ZodFunction",L.ZodLazy="ZodLazy",L.ZodLiteral="ZodLiteral",L.ZodEnum="ZodEnum",L.ZodEffects="ZodEffects",L.ZodNativeEnum="ZodNativeEnum",L.ZodOptional="ZodOptional",L.ZodNullable="ZodNullable",L.ZodDefault="ZodDefault",L.ZodCatch="ZodCatch",L.ZodPromise="ZodPromise",L.ZodBranded="ZodBranded",L.ZodPipeline="ZodPipeline",L.ZodReadonly="ZodReadonly"})(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const instanceOfType=(L,Z={message:`Input not instance of ${L.name}`})=>custom(X=>X instanceof L,Z),stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,ostring=()=>stringType().optional(),onumber=()=>numberType().optional(),oboolean=()=>booleanType().optional(),coerce={string:L=>ZodString.create({...L,coerce:!0}),number:L=>ZodNumber.create({...L,coerce:!0}),boolean:L=>ZodBoolean.create({...L,coerce:!0}),bigint:L=>ZodBigInt.create({...L,coerce:!0}),date:L=>ZodDate.create({...L,coerce:!0})},NEVER=INVALID;var z$2=Object.freeze({__proto__:null,defaultErrorMap:errorMap,setErrorMap,getErrorMap,makeIssue,EMPTY_PATH,addIssueToContext,ParseStatus,INVALID,DIRTY,OK,isAborted,isDirty,isValid,isAsync,get util(){return util$5},get objectUtil(){return objectUtil},ZodParsedType,getParsedType,ZodType,ZodString,ZodNumber,ZodBigInt,ZodBoolean,ZodDate,ZodSymbol,ZodUndefined,ZodNull,ZodAny,ZodUnknown,ZodNever,ZodVoid,ZodArray,ZodObject,ZodUnion,ZodDiscriminatedUnion,ZodIntersection,ZodTuple,ZodRecord,ZodMap,ZodSet,ZodFunction,ZodLazy,ZodLiteral,ZodEnum,ZodNativeEnum,ZodPromise,ZodEffects,ZodTransformer:ZodEffects,ZodOptional,ZodNullable,ZodDefault,ZodCatch,ZodNaN,BRAND,ZodBranded,ZodPipeline,ZodReadonly,custom,Schema:ZodType,ZodSchema:ZodType,late,get ZodFirstPartyTypeKind(){return ZodFirstPartyTypeKind},coerce,any:anyType,array:arrayType,bigint:bigIntType,boolean:booleanType,date:dateType,discriminatedUnion:discriminatedUnionType,effect:effectsType,enum:enumType,function:functionType,instanceof:instanceOfType,intersection:intersectionType,lazy:lazyType,literal:literalType,map:mapType,nan:nanType,nativeEnum:nativeEnumType,never:neverType,null:nullType,nullable:nullableType,number:numberType,object:objectType,oboolean,onumber,optional:optionalType,ostring,pipeline:pipelineType,preprocess:preprocessType,promise:promiseType,record:recordType,set:setType,strictObject:strictObjectType,string:stringType,symbol:symbolType,transformer:effectsType,tuple:tupleType,undefined:undefinedType,union:unionType,unknown:unknownType,void:voidType,NEVER,ZodIssueCode,quotelessJson,ZodError});const ANSI_BACKGROUND_OFFSET=10,wrapAnsi16=(L=0)=>Z=>`\x1B[${Z+L}m`,wrapAnsi256=(L=0)=>Z=>`\x1B[${38+L};5;${Z}m`,wrapAnsi16m=(L=0)=>(Z,X,te)=>`\x1B[${38+L};2;${Z};${X};${te}m`,styles$1={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(styles$1.modifier);const foregroundColorNames=Object.keys(styles$1.color),backgroundColorNames=Object.keys(styles$1.bgColor);[...foregroundColorNames,...backgroundColorNames];function assembleStyles(){const L=new Map;for(const[Z,X]of Object.entries(styles$1)){for(const[te,ie]of Object.entries(X))styles$1[te]={open:`\x1B[${ie[0]}m`,close:`\x1B[${ie[1]}m`},X[te]=styles$1[te],L.set(ie[0],ie[1]);Object.defineProperty(styles$1,Z,{value:X,enumerable:!1})}return Object.defineProperty(styles$1,"codes",{value:L,enumerable:!1}),styles$1.color.close="\x1B[39m",styles$1.bgColor.close="\x1B[49m",styles$1.color.ansi=wrapAnsi16(),styles$1.color.ansi256=wrapAnsi256(),styles$1.color.ansi16m=wrapAnsi16m(),styles$1.bgColor.ansi=wrapAnsi16(ANSI_BACKGROUND_OFFSET),styles$1.bgColor.ansi256=wrapAnsi256(ANSI_BACKGROUND_OFFSET),styles$1.bgColor.ansi16m=wrapAnsi16m(ANSI_BACKGROUND_OFFSET),Object.defineProperties(styles$1,{rgbToAnsi256:{value(Z,X,te){return Z===X&&X===te?Z<8?16:Z>248?231:Math.round((Z-8)/247*24)+232:16+36*Math.round(Z/255*5)+6*Math.round(X/255*5)+Math.round(te/255*5)},enumerable:!1},hexToRgb:{value(Z){const X=/[a-f\d]{6}|[a-f\d]{3}/i.exec(Z.toString(16));if(!X)return[0,0,0];let[te]=X;te.length===3&&(te=[...te].map(oe=>oe+oe).join(""));const ie=Number.parseInt(te,16);return[ie>>16&255,ie>>8&255,ie&255]},enumerable:!1},hexToAnsi256:{value:Z=>styles$1.rgbToAnsi256(...styles$1.hexToRgb(Z)),enumerable:!1},ansi256ToAnsi:{value(Z){if(Z<8)return 30+Z;if(Z<16)return 90+(Z-8);let X,te,ie;if(Z>=232)X=((Z-232)*10+8)/255,te=X,ie=X;else{Z-=16;const ue=Z%36;X=Math.floor(Z/36)/5,te=Math.floor(ue/6)/5,ie=ue%6/5}const oe=Math.max(X,te,ie)*2;if(oe===0)return 30;let se=30+(Math.round(ie)<<2|Math.round(te)<<1|Math.round(X));return oe===2&&(se+=60),se},enumerable:!1},rgbToAnsi:{value:(Z,X,te)=>styles$1.ansi256ToAnsi(styles$1.rgbToAnsi256(Z,X,te)),enumerable:!1},hexToAnsi:{value:Z=>styles$1.ansi256ToAnsi(styles$1.hexToAnsi256(Z)),enumerable:!1}}),styles$1}const ansiStyles=assembleStyles(),ansiStyles$1=ansiStyles,level=(()=>{if(navigator.userAgentData){const L=navigator.userAgentData.brands.find(({brand:Z})=>Z==="Chromium");if(L&&L.version>93)return 3}return/\b(Chrome|Chromium)\//.test(navigator.userAgent)?1:0})(),colorSupport=level!==0&&{level,hasBasic:!0,has256:level>=2,has16m:level>=3},supportsColor={stdout:colorSupport,stderr:colorSupport},supportsColor$1=supportsColor;function stringReplaceAll(L,Z,X){let te=L.indexOf(Z);if(te===-1)return L;const ie=Z.length;let oe=0,se="";do se+=L.slice(oe,te)+Z+X,oe=te+ie,te=L.indexOf(Z,oe);while(te!==-1);return se+=L.slice(oe),se}function stringEncaseCRLFWithFirstIndex(L,Z,X,te){let ie=0,oe="";do{const se=L[te-1]==="\r";oe+=L.slice(ie,se?te-1:te)+Z+(se?`\r `:` `)+X,ie=te+1,te=L.indexOf(` @@ -71,5 +71,5 @@ ${X.length}`);return keccak256(concat([te,X]),Z)}function getTransactionType(L){ * SPDX-License-Identifier: Apache-2.0 */var wasm=null;try{wasm=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function Long(L,Z,X){this.low=L|0,this.high=Z|0,this.unsigned=!!X}Long.prototype.__isLong__;Object.defineProperty(Long.prototype,"__isLong__",{value:!0});function isLong(L){return(L&&L.__isLong__)===!0}function ctz32(L){var Z=Math.clz32(L&-L);return L?31-Z:Z}Long.isLong=isLong;var INT_CACHE={},UINT_CACHE={};function fromInt(L,Z){var X,te,ie;return Z?(L>>>=0,(ie=0<=L&&L<256)&&(te=UINT_CACHE[L],te)?te:(X=fromBits(L,0,!0),ie&&(UINT_CACHE[L]=X),X)):(L|=0,(ie=-128<=L&&L<128)&&(te=INT_CACHE[L],te)?te:(X=fromBits(L,L<0?-1:0,!1),ie&&(INT_CACHE[L]=X),X))}Long.fromInt=fromInt;function fromNumber(L,Z){if(isNaN(L))return Z?UZERO:ZERO;if(Z){if(L<0)return UZERO;if(L>=TWO_PWR_64_DBL)return MAX_UNSIGNED_VALUE}else{if(L<=-TWO_PWR_63_DBL)return MIN_VALUE;if(L+1>=TWO_PWR_63_DBL)return MAX_VALUE}return L<0?fromNumber(-L,Z).neg():fromBits(L%TWO_PWR_32_DBL|0,L/TWO_PWR_32_DBL|0,Z)}Long.fromNumber=fromNumber;function fromBits(L,Z,X){return new Long(L,Z,X)}Long.fromBits=fromBits;var pow_dbl=Math.pow;function fromString(L,Z,X){if(L.length===0)throw Error("empty string");if(typeof Z=="number"?(X=Z,Z=!1):Z=!!Z,L==="NaN"||L==="Infinity"||L==="+Infinity"||L==="-Infinity")return Z?UZERO:ZERO;if(X=X||10,X<2||360)throw Error("interior hyphen");if(te===0)return fromString(L.substring(1),Z,X).neg();for(var ie=fromNumber(pow_dbl(X,8)),oe=ZERO,se=0;se>>0:this.low};LongPrototype.toNumber=function(){return this.unsigned?(this.high>>>0)*TWO_PWR_32_DBL+(this.low>>>0):this.high*TWO_PWR_32_DBL+(this.low>>>0)};LongPrototype.toString=function(Z){if(Z=Z||10,Z<2||36>>0,de=le.toString(Z);if(se=ce,se.isZero())return de+ue;for(;de.length<6;)de="0"+de;ue=""+de+ue}};LongPrototype.getHighBits=function(){return this.high};LongPrototype.getHighBitsUnsigned=function(){return this.high>>>0};LongPrototype.getLowBits=function(){return this.low};LongPrototype.getLowBitsUnsigned=function(){return this.low>>>0};LongPrototype.getNumBitsAbs=function(){if(this.isNegative())return this.eq(MIN_VALUE)?64:this.neg().getNumBitsAbs();for(var Z=this.high!=0?this.high:this.low,X=31;X>0&&!(Z&1<=0};LongPrototype.isOdd=function(){return(this.low&1)===1};LongPrototype.isEven=function(){return(this.low&1)===0};LongPrototype.equals=function(Z){return isLong(Z)||(Z=fromValue(Z)),this.unsigned!==Z.unsigned&&this.high>>>31===1&&Z.high>>>31===1?!1:this.high===Z.high&&this.low===Z.low};LongPrototype.eq=LongPrototype.equals;LongPrototype.notEquals=function(Z){return!this.eq(Z)};LongPrototype.neq=LongPrototype.notEquals;LongPrototype.ne=LongPrototype.notEquals;LongPrototype.lessThan=function(Z){return this.comp(Z)<0};LongPrototype.lt=LongPrototype.lessThan;LongPrototype.lessThanOrEqual=function(Z){return this.comp(Z)<=0};LongPrototype.lte=LongPrototype.lessThanOrEqual;LongPrototype.le=LongPrototype.lessThanOrEqual;LongPrototype.greaterThan=function(Z){return this.comp(Z)>0};LongPrototype.gt=LongPrototype.greaterThan;LongPrototype.greaterThanOrEqual=function(Z){return this.comp(Z)>=0};LongPrototype.gte=LongPrototype.greaterThanOrEqual;LongPrototype.ge=LongPrototype.greaterThanOrEqual;LongPrototype.compare=function(Z){if(isLong(Z)||(Z=fromValue(Z)),this.eq(Z))return 0;var X=this.isNegative(),te=Z.isNegative();return X&&!te?-1:!X&&te?1:this.unsigned?Z.high>>>0>this.high>>>0||Z.high===this.high&&Z.low>>>0>this.low>>>0?-1:1:this.sub(Z).isNegative()?-1:1};LongPrototype.comp=LongPrototype.compare;LongPrototype.negate=function(){return!this.unsigned&&this.eq(MIN_VALUE)?MIN_VALUE:this.not().add(ONE)};LongPrototype.neg=LongPrototype.negate;LongPrototype.add=function(Z){isLong(Z)||(Z=fromValue(Z));var X=this.high>>>16,te=this.high&65535,ie=this.low>>>16,oe=this.low&65535,se=Z.high>>>16,ue=Z.high&65535,ce=Z.low>>>16,le=Z.low&65535,de=0,he=0,ge=0,_e=0;return _e+=oe+le,ge+=_e>>>16,_e&=65535,ge+=ie+ce,he+=ge>>>16,ge&=65535,he+=te+ue,de+=he>>>16,he&=65535,de+=X+se,de&=65535,fromBits(ge<<16|_e,de<<16|he,this.unsigned)};LongPrototype.subtract=function(Z){return isLong(Z)||(Z=fromValue(Z)),this.add(Z.neg())};LongPrototype.sub=LongPrototype.subtract;LongPrototype.multiply=function(Z){if(this.isZero())return this;if(isLong(Z)||(Z=fromValue(Z)),wasm){var X=wasm.mul(this.low,this.high,Z.low,Z.high);return fromBits(X,wasm.get_high(),this.unsigned)}if(Z.isZero())return this.unsigned?UZERO:ZERO;if(this.eq(MIN_VALUE))return Z.isOdd()?MIN_VALUE:ZERO;if(Z.eq(MIN_VALUE))return this.isOdd()?MIN_VALUE:ZERO;if(this.isNegative())return Z.isNegative()?this.neg().mul(Z.neg()):this.neg().mul(Z).neg();if(Z.isNegative())return this.mul(Z.neg()).neg();if(this.lt(TWO_PWR_24)&&Z.lt(TWO_PWR_24))return fromNumber(this.toNumber()*Z.toNumber(),this.unsigned);var te=this.high>>>16,ie=this.high&65535,oe=this.low>>>16,se=this.low&65535,ue=Z.high>>>16,ce=Z.high&65535,le=Z.low>>>16,de=Z.low&65535,he=0,ge=0,_e=0,Ae=0;return Ae+=se*de,_e+=Ae>>>16,Ae&=65535,_e+=oe*de,ge+=_e>>>16,_e&=65535,_e+=se*le,ge+=_e>>>16,_e&=65535,ge+=ie*de,he+=ge>>>16,ge&=65535,ge+=oe*le,he+=ge>>>16,ge&=65535,ge+=se*ce,he+=ge>>>16,ge&=65535,he+=te*de+ie*le+oe*ce+se*ue,he&=65535,fromBits(_e<<16|Ae,he<<16|ge,this.unsigned)};LongPrototype.mul=LongPrototype.multiply;LongPrototype.divide=function(Z){if(isLong(Z)||(Z=fromValue(Z)),Z.isZero())throw Error("division by zero");if(wasm){if(!this.unsigned&&this.high===-2147483648&&Z.low===-1&&Z.high===-1)return this;var X=(this.unsigned?wasm.div_u:wasm.div_s)(this.low,this.high,Z.low,Z.high);return fromBits(X,wasm.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?UZERO:ZERO;var te,ie,oe;if(this.unsigned){if(Z.unsigned||(Z=Z.toUnsigned()),Z.gt(this))return UZERO;if(Z.gt(this.shru(1)))return UONE;oe=UZERO}else{if(this.eq(MIN_VALUE)){if(Z.eq(ONE)||Z.eq(NEG_ONE))return MIN_VALUE;if(Z.eq(MIN_VALUE))return ONE;var se=this.shr(1);return te=se.div(Z).shl(1),te.eq(ZERO)?Z.isNegative()?ONE:NEG_ONE:(ie=this.sub(Z.mul(te)),oe=te.add(ie.div(Z)),oe)}else if(Z.eq(MIN_VALUE))return this.unsigned?UZERO:ZERO;if(this.isNegative())return Z.isNegative()?this.neg().div(Z.neg()):this.neg().div(Z).neg();if(Z.isNegative())return this.div(Z.neg()).neg();oe=ZERO}for(ie=this;ie.gte(Z);){te=Math.max(1,Math.floor(ie.toNumber()/Z.toNumber()));for(var ue=Math.ceil(Math.log(te)/Math.LN2),ce=ue<=48?1:pow_dbl(2,ue-48),le=fromNumber(te),de=le.mul(Z);de.isNegative()||de.gt(ie);)te-=ce,le=fromNumber(te,this.unsigned),de=le.mul(Z);le.isZero()&&(le=ONE),oe=oe.add(le),ie=ie.sub(de)}return oe};LongPrototype.div=LongPrototype.divide;LongPrototype.modulo=function(Z){if(isLong(Z)||(Z=fromValue(Z)),wasm){var X=(this.unsigned?wasm.rem_u:wasm.rem_s)(this.low,this.high,Z.low,Z.high);return fromBits(X,wasm.get_high(),this.unsigned)}return this.sub(this.div(Z).mul(Z))};LongPrototype.mod=LongPrototype.modulo;LongPrototype.rem=LongPrototype.modulo;LongPrototype.not=function(){return fromBits(~this.low,~this.high,this.unsigned)};LongPrototype.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};LongPrototype.clz=LongPrototype.countLeadingZeros;LongPrototype.countTrailingZeros=function(){return this.low?ctz32(this.low):ctz32(this.high)+32};LongPrototype.ctz=LongPrototype.countTrailingZeros;LongPrototype.and=function(Z){return isLong(Z)||(Z=fromValue(Z)),fromBits(this.low&Z.low,this.high&Z.high,this.unsigned)};LongPrototype.or=function(Z){return isLong(Z)||(Z=fromValue(Z)),fromBits(this.low|Z.low,this.high|Z.high,this.unsigned)};LongPrototype.xor=function(Z){return isLong(Z)||(Z=fromValue(Z)),fromBits(this.low^Z.low,this.high^Z.high,this.unsigned)};LongPrototype.shiftLeft=function(Z){return isLong(Z)&&(Z=Z.toInt()),(Z&=63)===0?this:Z<32?fromBits(this.low<>>32-Z,this.unsigned):fromBits(0,this.low<>>Z|this.high<<32-Z,this.high>>Z,this.unsigned):fromBits(this.high>>Z-32,this.high>=0?0:-1,this.unsigned)};LongPrototype.shr=LongPrototype.shiftRight;LongPrototype.shiftRightUnsigned=function(Z){return isLong(Z)&&(Z=Z.toInt()),(Z&=63)===0?this:Z<32?fromBits(this.low>>>Z|this.high<<32-Z,this.high>>>Z,this.unsigned):Z===32?fromBits(this.high,0,this.unsigned):fromBits(this.high>>>Z-32,0,this.unsigned)};LongPrototype.shru=LongPrototype.shiftRightUnsigned;LongPrototype.shr_u=LongPrototype.shiftRightUnsigned;LongPrototype.rotateLeft=function(Z){var X;return isLong(Z)&&(Z=Z.toInt()),(Z&=63)===0?this:Z===32?fromBits(this.high,this.low,this.unsigned):Z<32?(X=32-Z,fromBits(this.low<>>X,this.high<>>X,this.unsigned)):(Z-=32,X=32-Z,fromBits(this.high<>>X,this.low<>>X,this.unsigned))};LongPrototype.rotl=LongPrototype.rotateLeft;LongPrototype.rotateRight=function(Z){var X;return isLong(Z)&&(Z=Z.toInt()),(Z&=63)===0?this:Z===32?fromBits(this.high,this.low,this.unsigned):Z<32?(X=32-Z,fromBits(this.high<>>Z,this.low<>>Z,this.unsigned)):(Z-=32,X=32-Z,fromBits(this.low<>>Z,this.high<>>Z,this.unsigned))};LongPrototype.rotr=LongPrototype.rotateRight;LongPrototype.toSigned=function(){return this.unsigned?fromBits(this.low,this.high,!1):this};LongPrototype.toUnsigned=function(){return this.unsigned?this:fromBits(this.low,this.high,!0)};LongPrototype.toBytes=function(Z){return Z?this.toBytesLE():this.toBytesBE()};LongPrototype.toBytesLE=function(){var Z=this.high,X=this.low;return[X&255,X>>>8&255,X>>>16&255,X>>>24,Z&255,Z>>>8&255,Z>>>16&255,Z>>>24]};LongPrototype.toBytesBE=function(){var Z=this.high,X=this.low;return[Z>>>24,Z>>>16&255,Z>>>8&255,Z&255,X>>>24,X>>>16&255,X>>>8&255,X&255]};Long.fromBytes=function(Z,X,te){return te?Long.fromBytesLE(Z,X):Long.fromBytesBE(Z,X)};Long.fromBytesLE=function(Z,X){return new Long(Z[0]|Z[1]<<8|Z[2]<<16|Z[3]<<24,Z[4]|Z[5]<<8|Z[6]<<16|Z[7]<<24,X)};Long.fromBytesBE=function(Z,X){return new Long(Z[4]<<24|Z[5]<<16|Z[6]<<8|Z[7],Z[0]<<24|Z[1]<<16|Z[2]<<8|Z[3],X)};var minimalExports={},minimal$1={get exports(){return minimalExports},set exports(L){minimalExports=L}},indexMinimal={},minimal={},aspromise=asPromise;function asPromise(L,Z){for(var X=new Array(arguments.length-1),te=0,ie=2,oe=!0;ie1&&ue.charAt(ce)==="=";)++le;return Math.ceil(ue.length*3)/4-le};for(var X=new Array(64),te=new Array(123),ie=0;ie<64;)te[X[ie]=ie<26?ie+65:ie<52?ie+71:ie<62?ie-4:ie-59|43]=ie++;Z.encode=function(ue,ce,le){for(var de=null,he=[],ge=0,_e=0,Ae;ce>2],Ae=(xe&3)<<4,_e=1;break;case 1:he[ge++]=X[Ae|xe>>4],Ae=(xe&15)<<2,_e=2;break;case 2:he[ge++]=X[Ae|xe>>6],he[ge++]=X[xe&63],_e=0;break}ge>8191&&((de||(de=[])).push(String.fromCharCode.apply(String,he)),ge=0)}return _e&&(he[ge++]=X[Ae],he[ge++]=61,_e===1&&(he[ge++]=61)),de?(ge&&de.push(String.fromCharCode.apply(String,he.slice(0,ge))),de.join("")):String.fromCharCode.apply(String,he.slice(0,ge))};var oe="invalid encoding";Z.decode=function(ue,ce,le){for(var de=le,he=0,ge,_e=0;_e1)break;if((Ae=te[Ae])===void 0)throw Error(oe);switch(he){case 0:ge=Ae,he=1;break;case 1:ce[le++]=ge<<2|(Ae&48)>>4,ge=Ae,he=2;break;case 2:ce[le++]=(ge&15)<<4|(Ae&60)>>2,ge=Ae,he=3;break;case 3:ce[le++]=(ge&3)<<6|Ae,he=0;break}}if(he===1)throw Error(oe);return le-de},Z.test=function(ue){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(ue)}})(base64$2);var eventemitter=EventEmitter;function EventEmitter(){this._listeners={}}EventEmitter.prototype.on=function(Z,X,te){return(this._listeners[Z]||(this._listeners[Z]=[])).push({fn:X,ctx:te||this}),this};EventEmitter.prototype.off=function(Z,X){if(Z===void 0)this._listeners={};else if(X===void 0)this._listeners[Z]=[];else for(var te=this._listeners[Z],ie=0;ie0?0:2147483648,oe,se);else if(isNaN(ie))te(2143289344,oe,se);else if(ie>34028234663852886e22)te((ue<<31|2139095040)>>>0,oe,se);else if(ie<11754943508222875e-54)te((ue<<31|Math.round(ie/1401298464324817e-60))>>>0,oe,se);else{var ce=Math.floor(Math.log(ie)/Math.LN2),le=Math.round(ie*Math.pow(2,-ce)*8388608)&8388607;te((ue<<31|ce+127<<23|le)>>>0,oe,se)}}L.writeFloatLE=Z.bind(null,writeUintLE),L.writeFloatBE=Z.bind(null,writeUintBE);function X(te,ie,oe){var se=te(ie,oe),ue=(se>>31)*2+1,ce=se>>>23&255,le=se&8388607;return ce===255?le?NaN:ue*(1/0):ce===0?ue*1401298464324817e-60*le:ue*Math.pow(2,ce-150)*(le+8388608)}L.readFloatLE=X.bind(null,readUintLE),L.readFloatBE=X.bind(null,readUintBE)}(),typeof Float64Array<"u"?function(){var Z=new Float64Array([-0]),X=new Uint8Array(Z.buffer),te=X[7]===128;function ie(ce,le,de){Z[0]=ce,le[de]=X[0],le[de+1]=X[1],le[de+2]=X[2],le[de+3]=X[3],le[de+4]=X[4],le[de+5]=X[5],le[de+6]=X[6],le[de+7]=X[7]}function oe(ce,le,de){Z[0]=ce,le[de]=X[7],le[de+1]=X[6],le[de+2]=X[5],le[de+3]=X[4],le[de+4]=X[3],le[de+5]=X[2],le[de+6]=X[1],le[de+7]=X[0]}L.writeDoubleLE=te?ie:oe,L.writeDoubleBE=te?oe:ie;function se(ce,le){return X[0]=ce[le],X[1]=ce[le+1],X[2]=ce[le+2],X[3]=ce[le+3],X[4]=ce[le+4],X[5]=ce[le+5],X[6]=ce[le+6],X[7]=ce[le+7],Z[0]}function ue(ce,le){return X[7]=ce[le],X[6]=ce[le+1],X[5]=ce[le+2],X[4]=ce[le+3],X[3]=ce[le+4],X[2]=ce[le+5],X[1]=ce[le+6],X[0]=ce[le+7],Z[0]}L.readDoubleLE=te?se:ue,L.readDoubleBE=te?ue:se}():function(){function Z(te,ie,oe,se,ue,ce){var le=se<0?1:0;if(le&&(se=-se),se===0)te(0,ue,ce+ie),te(1/se>0?0:2147483648,ue,ce+oe);else if(isNaN(se))te(0,ue,ce+ie),te(2146959360,ue,ce+oe);else if(se>17976931348623157e292)te(0,ue,ce+ie),te((le<<31|2146435072)>>>0,ue,ce+oe);else{var de;if(se<22250738585072014e-324)de=se/5e-324,te(de>>>0,ue,ce+ie),te((le<<31|de/4294967296)>>>0,ue,ce+oe);else{var he=Math.floor(Math.log(se)/Math.LN2);he===1024&&(he=1023),de=se*Math.pow(2,-he),te(de*4503599627370496>>>0,ue,ce+ie),te((le<<31|he+1023<<20|de*1048576&1048575)>>>0,ue,ce+oe)}}}L.writeDoubleLE=Z.bind(null,writeUintLE,0,4),L.writeDoubleBE=Z.bind(null,writeUintBE,4,0);function X(te,ie,oe,se,ue){var ce=te(se,ue+ie),le=te(se,ue+oe),de=(le>>31)*2+1,he=le>>>20&2047,ge=4294967296*(le&1048575)+ce;return he===2047?ge?NaN:de*(1/0):he===0?de*5e-324*ge:de*Math.pow(2,he-1075)*(ge+4503599627370496)}L.readDoubleLE=X.bind(null,readUintLE,0,4),L.readDoubleBE=X.bind(null,readUintBE,4,0)}(),L}function writeUintLE(L,Z,X){Z[X]=L&255,Z[X+1]=L>>>8&255,Z[X+2]=L>>>16&255,Z[X+3]=L>>>24}function writeUintBE(L,Z,X){Z[X]=L>>>24,Z[X+1]=L>>>16&255,Z[X+2]=L>>>8&255,Z[X+3]=L&255}function readUintLE(L,Z){return(L[Z]|L[Z+1]<<8|L[Z+2]<<16|L[Z+3]<<24)>>>0}function readUintBE(L,Z){return(L[Z]<<24|L[Z+1]<<16|L[Z+2]<<8|L[Z+3])>>>0}var inquire_1=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(L){}return null}var utf8$2={};(function(L){var Z=L;Z.length=function(te){for(var ie=0,oe=0,se=0;se191&&de<224?ce[le++]=(de&31)<<6|te[ie++]&63:de>239&&de<365?(de=((de&7)<<18|(te[ie++]&63)<<12|(te[ie++]&63)<<6|te[ie++]&63)-65536,ce[le++]=55296+(de>>10),ce[le++]=56320+(de&1023)):ce[le++]=(de&15)<<12|(te[ie++]&63)<<6|te[ie++]&63,le>8191&&((ue||(ue=[])).push(String.fromCharCode.apply(String,ce)),le=0);return ue?(le&&ue.push(String.fromCharCode.apply(String,ce.slice(0,le))),ue.join("")):String.fromCharCode.apply(String,ce.slice(0,le))},Z.write=function(te,ie,oe){for(var se=oe,ue,ce,le=0;le>6|192,ie[oe++]=ue&63|128):(ue&64512)===55296&&((ce=te.charCodeAt(le+1))&64512)===56320?(ue=65536+((ue&1023)<<10)+(ce&1023),++le,ie[oe++]=ue>>18|240,ie[oe++]=ue>>12&63|128,ie[oe++]=ue>>6&63|128,ie[oe++]=ue&63|128):(ie[oe++]=ue>>12|224,ie[oe++]=ue>>6&63|128,ie[oe++]=ue&63|128);return oe-se}})(utf8$2);var pool_1=pool;function pool(L,Z,X){var te=X||8192,ie=te>>>1,oe=null,se=te;return function(ce){if(ce<1||ce>ie)return L(ce);se+ce>te&&(oe=L(te),se=0);var le=Z.call(oe,se,se+=ce);return se&7&&(se=(se|7)+1),le}}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=Z;var L=requireMinimal();function Z(oe,se){this.lo=oe>>>0,this.hi=se>>>0}var X=Z.zero=new Z(0,0);X.toNumber=function(){return 0},X.zzEncode=X.zzDecode=function(){return this},X.length=function(){return 1};var te=Z.zeroHash="\0\0\0\0\0\0\0\0";Z.fromNumber=function(se){if(se===0)return X;var ue=se<0;ue&&(se=-se);var ce=se>>>0,le=(se-ce)/4294967296>>>0;return ue&&(le=~le>>>0,ce=~ce>>>0,++ce>4294967295&&(ce=0,++le>4294967295&&(le=0))),new Z(ce,le)},Z.from=function(se){if(typeof se=="number")return Z.fromNumber(se);if(L.isString(se))if(L.Long)se=L.Long.fromString(se);else return Z.fromNumber(parseInt(se,10));return se.low||se.high?new Z(se.low>>>0,se.high>>>0):X},Z.prototype.toNumber=function(se){if(!se&&this.hi>>>31){var ue=~this.lo+1>>>0,ce=~this.hi>>>0;return ue||(ce=ce+1>>>0),-(ue+ce*4294967296)}return this.lo+this.hi*4294967296},Z.prototype.toLong=function(se){return L.Long?new L.Long(this.lo|0,this.hi|0,!!se):{low:this.lo|0,high:this.hi|0,unsigned:!!se}};var ie=String.prototype.charCodeAt;return Z.fromHash=function(se){return se===te?X:new Z((ie.call(se,0)|ie.call(se,1)<<8|ie.call(se,2)<<16|ie.call(se,3)<<24)>>>0,(ie.call(se,4)|ie.call(se,5)<<8|ie.call(se,6)<<16|ie.call(se,7)<<24)>>>0)},Z.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},Z.prototype.zzEncode=function(){var se=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^se)>>>0,this.lo=(this.lo<<1^se)>>>0,this},Z.prototype.zzDecode=function(){var se=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^se)>>>0,this.hi=(this.hi>>>1^se)>>>0,this},Z.prototype.length=function(){var se=this.lo,ue=(this.lo>>>28|this.hi<<4)>>>0,ce=this.hi>>>24;return ce===0?ue===0?se<16384?se<128?1:2:se<2097152?3:4:ue<16384?ue<128?5:6:ue<2097152?7:8:ce<128?9:10},longbits}var hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,function(L){var Z=L;Z.asPromise=aspromise,Z.base64=base64$2,Z.EventEmitter=eventemitter,Z.float=float,Z.inquire=inquire_1,Z.utf8=utf8$2,Z.pool=pool_1,Z.LongBits=requireLongbits(),Z.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),Z.global=Z.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||commonjsGlobal,Z.emptyArray=Object.freeze?Object.freeze([]):[],Z.emptyObject=Object.freeze?Object.freeze({}):{},Z.isInteger=Number.isInteger||function(oe){return typeof oe=="number"&&isFinite(oe)&&Math.floor(oe)===oe},Z.isString=function(oe){return typeof oe=="string"||oe instanceof String},Z.isObject=function(oe){return oe&&typeof oe=="object"},Z.isset=Z.isSet=function(oe,se){var ue=oe[se];return ue!=null&&oe.hasOwnProperty(se)?typeof ue!="object"||(Array.isArray(ue)?ue.length:Object.keys(ue).length)>0:!1},Z.Buffer=function(){try{var ie=Z.inquire("buffer").Buffer;return ie.prototype.utf8Write?ie:null}catch{return null}}(),Z._Buffer_from=null,Z._Buffer_allocUnsafe=null,Z.newBuffer=function(oe){return typeof oe=="number"?Z.Buffer?Z._Buffer_allocUnsafe(oe):new Z.Array(oe):Z.Buffer?Z._Buffer_from(oe):typeof Uint8Array>"u"?oe:new Uint8Array(oe)},Z.Array=typeof Uint8Array<"u"?Uint8Array:Array,Z.Long=Z.global.dcodeIO&&Z.global.dcodeIO.Long||Z.global.Long||Z.inquire("long"),Z.key2Re=/^true|false|0|1$/,Z.key32Re=/^-?(?:0|[1-9][0-9]*)$/,Z.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,Z.longToHash=function(oe){return oe?Z.LongBits.from(oe).toHash():Z.LongBits.zeroHash},Z.longFromHash=function(oe,se){var ue=Z.LongBits.fromHash(oe);return Z.Long?Z.Long.fromBits(ue.lo,ue.hi,se):ue.toNumber(!!se)};function X(ie,oe,se){for(var ue=Object.keys(oe),ce=0;ce-1;--le)if(se[ce[le]]===1&&this[ce[le]]!==void 0&&this[ce[le]]!==null)return ce[le]}},Z.oneOfSetter=function(oe){return function(se){for(var ue=0;ue127;)Z[X++]=L&127|128,L>>>=7;Z[X]=L}function VarintOp(L,Z){this.len=L,this.next=void 0,this.val=Z}VarintOp.prototype=Object.create(Op.prototype);VarintOp.prototype.fn=writeVarint32;Writer$1.prototype.uint32=function L(Z){return this.len+=(this.tail=this.tail.next=new VarintOp((Z=Z>>>0)<128?1:Z<16384?2:Z<2097152?3:Z<268435456?4:5,Z)).len,this};Writer$1.prototype.int32=function L(Z){return Z<0?this._push(writeVarint64,10,LongBits$1.fromNumber(Z)):this.uint32(Z)};Writer$1.prototype.sint32=function L(Z){return this.uint32((Z<<1^Z>>31)>>>0)};function writeVarint64(L,Z,X){for(;L.hi;)Z[X++]=L.lo&127|128,L.lo=(L.lo>>>7|L.hi<<25)>>>0,L.hi>>>=7;for(;L.lo>127;)Z[X++]=L.lo&127|128,L.lo=L.lo>>>7;Z[X++]=L.lo}Writer$1.prototype.uint64=function L(Z){var X=LongBits$1.from(Z);return this._push(writeVarint64,X.length(),X)};Writer$1.prototype.int64=Writer$1.prototype.uint64;Writer$1.prototype.sint64=function L(Z){var X=LongBits$1.from(Z).zzEncode();return this._push(writeVarint64,X.length(),X)};Writer$1.prototype.bool=function L(Z){return this._push(writeByte,1,Z?1:0)};function writeFixed32(L,Z,X){Z[X]=L&255,Z[X+1]=L>>>8&255,Z[X+2]=L>>>16&255,Z[X+3]=L>>>24}Writer$1.prototype.fixed32=function L(Z){return this._push(writeFixed32,4,Z>>>0)};Writer$1.prototype.sfixed32=Writer$1.prototype.fixed32;Writer$1.prototype.fixed64=function L(Z){var X=LongBits$1.from(Z);return this._push(writeFixed32,4,X.lo)._push(writeFixed32,4,X.hi)};Writer$1.prototype.sfixed64=Writer$1.prototype.fixed64;Writer$1.prototype.float=function L(Z){return this._push(util$4.float.writeFloatLE,4,Z)};Writer$1.prototype.double=function L(Z){return this._push(util$4.float.writeDoubleLE,8,Z)};var writeBytes=util$4.Array.prototype.set?function L(Z,X,te){X.set(Z,te)}:function L(Z,X,te){for(var ie=0;ie>>0;if(!X)return this._push(writeByte,1,0);if(util$4.isString(Z)){var te=Writer$1.alloc(X=base64$1.length(Z));base64$1.decode(Z,te,0),Z=te}return this.uint32(X)._push(writeBytes,X,Z)};Writer$1.prototype.string=function L(Z){var X=utf8$1.length(Z);return X?this.uint32(X)._push(utf8$1.write,X,Z):this._push(writeByte,1,0)};Writer$1.prototype.fork=function L(){return this.states=new State(this),this.head=this.tail=new Op(noop,0,0),this.len=0,this};Writer$1.prototype.reset=function L(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Op(noop,0,0),this.len=0),this};Writer$1.prototype.ldelim=function L(){var Z=this.head,X=this.tail,te=this.len;return this.reset().uint32(te),te&&(this.tail.next=Z.next,this.tail=X,this.len+=te),this};Writer$1.prototype.finish=function L(){for(var Z=this.head.next,X=this.constructor.alloc(this.len),te=0;Z;)Z.fn(Z.val,X,te),te+=Z.len,Z=Z.next;return X};Writer$1._configure=function(L){BufferWriter$1=L,Writer$1.create=create$1(),BufferWriter$1._configure()};var writer_buffer=BufferWriter,Writer=writer;(BufferWriter.prototype=Object.create(Writer.prototype)).constructor=BufferWriter;var util$3=requireMinimal();function BufferWriter(){Writer.call(this)}BufferWriter._configure=function(){BufferWriter.alloc=util$3._Buffer_allocUnsafe,BufferWriter.writeBytesBuffer=util$3.Buffer&&util$3.Buffer.prototype instanceof Uint8Array&&util$3.Buffer.prototype.set.name==="set"?function(Z,X,te){X.set(Z,te)}:function(Z,X,te){if(Z.copy)Z.copy(X,te,0,Z.length);else for(var ie=0;ie>>0;return this.uint32(X),X&&this._push(BufferWriter.writeBytesBuffer,X,Z),this};function writeStringBuffer(L,Z,X){L.length<40?util$3.utf8.write(L,Z,X):Z.utf8Write?Z.utf8Write(L,X):Z.write(L,X)}BufferWriter.prototype.string=function L(Z){var X=util$3.Buffer.byteLength(Z);return this.uint32(X),X&&this._push(writeStringBuffer,X,Z),this};BufferWriter._configure();var reader=Reader$1,util$2=requireMinimal(),BufferReader$1,LongBits=util$2.LongBits,utf8=util$2.utf8;function indexOutOfRange(L,Z){return RangeError("index out of range: "+L.pos+" + "+(Z||1)+" > "+L.len)}function Reader$1(L){this.buf=L,this.pos=0,this.len=L.length}var create_array=typeof Uint8Array<"u"?function L(Z){if(Z instanceof Uint8Array||Array.isArray(Z))return new Reader$1(Z);throw Error("illegal buffer")}:function L(Z){if(Array.isArray(Z))return new Reader$1(Z);throw Error("illegal buffer")},create=function L(){return util$2.Buffer?function(X){return(Reader$1.create=function(ie){return util$2.Buffer.isBuffer(ie)?new BufferReader$1(ie):create_array(ie)})(X)}:create_array};Reader$1.create=create();Reader$1.prototype._slice=util$2.Array.prototype.subarray||util$2.Array.prototype.slice;Reader$1.prototype.uint32=function L(){var Z=4294967295;return function(){if(Z=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(Z=(Z|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(Z=(Z|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(Z=(Z|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(Z=(Z|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return Z;if((this.pos+=5)>this.len)throw this.pos=this.len,indexOutOfRange(this,10);return Z}}();Reader$1.prototype.int32=function L(){return this.uint32()|0};Reader$1.prototype.sint32=function L(){var Z=this.uint32();return Z>>>1^-(Z&1)|0};function readLongVarint(){var L=new LongBits(0,0),Z=0;if(this.len-this.pos>4){for(;Z<4;++Z)if(L.lo=(L.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return L;if(L.lo=(L.lo|(this.buf[this.pos]&127)<<28)>>>0,L.hi=(L.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return L;Z=0}else{for(;Z<3;++Z){if(this.pos>=this.len)throw indexOutOfRange(this);if(L.lo=(L.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return L}return L.lo=(L.lo|(this.buf[this.pos++]&127)<>>0,L}if(this.len-this.pos>4){for(;Z<5;++Z)if(L.hi=(L.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return L}else for(;Z<5;++Z){if(this.pos>=this.len)throw indexOutOfRange(this);if(L.hi=(L.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return L}throw Error("invalid varint encoding")}Reader$1.prototype.bool=function L(){return this.uint32()!==0};function readFixed32_end(L,Z){return(L[Z-4]|L[Z-3]<<8|L[Z-2]<<16|L[Z-1]<<24)>>>0}Reader$1.prototype.fixed32=function L(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)};Reader$1.prototype.sfixed32=function L(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)|0};function readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange(this,8);return new LongBits(readFixed32_end(this.buf,this.pos+=4),readFixed32_end(this.buf,this.pos+=4))}Reader$1.prototype.float=function L(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);var Z=util$2.float.readFloatLE(this.buf,this.pos);return this.pos+=4,Z};Reader$1.prototype.double=function L(){if(this.pos+8>this.len)throw indexOutOfRange(this,4);var Z=util$2.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,Z};Reader$1.prototype.bytes=function L(){var Z=this.uint32(),X=this.pos,te=this.pos+Z;if(te>this.len)throw indexOutOfRange(this,Z);if(this.pos+=Z,Array.isArray(this.buf))return this.buf.slice(X,te);if(X===te){var ie=util$2.Buffer;return ie?ie.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,X,te)};Reader$1.prototype.string=function L(){var Z=this.bytes();return utf8.read(Z,0,Z.length)};Reader$1.prototype.skip=function L(Z){if(typeof Z=="number"){if(this.pos+Z>this.len)throw indexOutOfRange(this,Z);this.pos+=Z}else do if(this.pos>=this.len)throw indexOutOfRange(this);while(this.buf[this.pos++]&128);return this};Reader$1.prototype.skipType=function(L){switch(L){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(L=this.uint32()&7)!==4;)this.skipType(L);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+L+" at offset "+this.pos)}return this};Reader$1._configure=function(L){BufferReader$1=L,Reader$1.create=create(),BufferReader$1._configure();var Z=util$2.Long?"toLong":"toNumber";util$2.merge(Reader$1.prototype,{int64:function(){return readLongVarint.call(this)[Z](!1)},uint64:function(){return readLongVarint.call(this)[Z](!0)},sint64:function(){return readLongVarint.call(this).zzDecode()[Z](!1)},fixed64:function(){return readFixed64.call(this)[Z](!0)},sfixed64:function(){return readFixed64.call(this)[Z](!1)}})};var reader_buffer=BufferReader,Reader=reader;(BufferReader.prototype=Object.create(Reader.prototype)).constructor=BufferReader;var util$1=requireMinimal();function BufferReader(L){Reader.call(this,L)}BufferReader._configure=function(){util$1.Buffer&&(BufferReader.prototype._slice=util$1.Buffer.prototype.slice)};BufferReader.prototype.string=function L(){var Z=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+Z,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+Z,this.len))};BufferReader._configure();var rpc={},service=Service,util=requireMinimal();(Service.prototype=Object.create(util.EventEmitter.prototype)).constructor=Service;function Service(L,Z,X){if(typeof L!="function")throw TypeError("rpcImpl must be a function");util.EventEmitter.call(this),this.rpcImpl=L,this.requestDelimited=!!Z,this.responseDelimited=!!X}Service.prototype.rpcCall=function L(Z,X,te,ie,oe){if(!ie)throw TypeError("request must be specified");var se=this;if(!oe)return util.asPromise(L,se,Z,X,te,ie);if(!se.rpcImpl){setTimeout(function(){oe(Error("already ended"))},0);return}try{return se.rpcImpl(Z,X[se.requestDelimited?"encodeDelimited":"encode"](ie).finish(),function(ce,le){if(ce)return se.emit("error",ce,Z),oe(ce);if(le===null){se.end(!0);return}if(!(le instanceof te))try{le=te[se.responseDelimited?"decodeDelimited":"decode"](le)}catch(de){return se.emit("error",de,Z),oe(de)}return se.emit("data",le,Z),oe(null,le)})}catch(ue){se.emit("error",ue,Z),setTimeout(function(){oe(ue)},0);return}};Service.prototype.end=function L(Z){return this.rpcImpl&&(Z||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this};(function(L){var Z=L;Z.Service=service})(rpc);var roots={};(function(L){var Z=L;Z.build="minimal",Z.Writer=writer,Z.BufferWriter=writer_buffer,Z.Reader=reader,Z.BufferReader=reader_buffer,Z.util=requireMinimal(),Z.rpc=rpc,Z.roots=roots,Z.configure=X;function X(){Z.util._configure(),Z.Writer._configure(Z.BufferWriter),Z.Reader._configure(Z.BufferReader)}X()})(indexMinimal);(function(L){L.exports=indexMinimal})(minimal$1);const _m0=getDefaultExportFromCjs(minimalExports);var lib$1={},lib={},Metadata={};Object.defineProperty(Metadata,"__esModule",{value:!0});Metadata.Metadata=void 0;Metadata.Metadata=function L(Z){const X=new Map,te={set(ie,oe){if(ie=normalizeKey(ie),Array.isArray(oe))if(oe.length===0)X.delete(ie);else{for(const se of oe)validate(ie,se);X.set(ie,ie.endsWith("-bin")?oe:[oe.join(", ")])}else validate(ie,oe),X.set(ie,[oe]);return te},append(ie,oe){ie=normalizeKey(ie),validate(ie,oe);let se=X.get(ie);return se==null&&(se=[],X.set(ie,se)),se.push(oe),ie.endsWith("-bin")||X.set(ie,[se.join(", ")]),te},delete(ie){ie=normalizeKey(ie),X.delete(ie)},get(ie){var oe;return ie=normalizeKey(ie),(oe=X.get(ie))===null||oe===void 0?void 0:oe[0]},getAll(ie){var oe;return ie=normalizeKey(ie),(oe=X.get(ie))!==null&&oe!==void 0?oe:[]},has(ie){return ie=normalizeKey(ie),X.has(ie)},[Symbol.iterator](){return X[Symbol.iterator]()}};if(Z!=null){const ie=isIterable(Z)?Z:Object.entries(Z);for(const[oe,se]of ie)te.set(oe,se)}return te};function normalizeKey(L){return L.toLowerCase()}function validate(L,Z){if(!/^[0-9a-z_.-]+$/.test(L))throw new Error(`Metadata key '${L}' contains illegal characters`);if(L.endsWith("-bin")){if(!(Z instanceof Uint8Array))throw new Error(`Metadata key '${L}' ends with '-bin', thus it must have binary value`)}else{if(typeof Z!="string")throw new Error(`Metadata key '${L}' doesn't end with '-bin', thus it must have string value`);if(!/^[ -~]*$/.test(Z))throw new Error(`Metadata value '${Z}' of key '${L}' contains illegal characters`)}}function isIterable(L){return Symbol.iterator in L}var Status={};(function(L){Object.defineProperty(L,"__esModule",{value:!0}),L.Status=void 0,function(Z){Z[Z.OK=0]="OK",Z[Z.CANCELLED=1]="CANCELLED",Z[Z.UNKNOWN=2]="UNKNOWN",Z[Z.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Z[Z.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Z[Z.NOT_FOUND=5]="NOT_FOUND",Z[Z.ALREADY_EXISTS=6]="ALREADY_EXISTS",Z[Z.PERMISSION_DENIED=7]="PERMISSION_DENIED",Z[Z.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Z[Z.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Z[Z.ABORTED=10]="ABORTED",Z[Z.OUT_OF_RANGE=11]="OUT_OF_RANGE",Z[Z.UNIMPLEMENTED=12]="UNIMPLEMENTED",Z[Z.INTERNAL=13]="INTERNAL",Z[Z.UNAVAILABLE=14]="UNAVAILABLE",Z[Z.DATA_LOSS=15]="DATA_LOSS",Z[Z.UNAUTHENTICATED=16]="UNAUTHENTICATED"}(L.Status||(L.Status={}))})(Status);var MethodDescriptor={};Object.defineProperty(MethodDescriptor,"__esModule",{value:!0});var CallOptions={};Object.defineProperty(CallOptions,"__esModule",{value:!0});var ClientMiddleware={};Object.defineProperty(ClientMiddleware,"__esModule",{value:!0});var composeClientMiddleware$1={};Object.defineProperty(composeClientMiddleware$1,"__esModule",{value:!0});composeClientMiddleware$1.composeClientMiddleware=void 0;function composeClientMiddleware(L,Z){return(X,te)=>Z(Object.assign(Object.assign({},X),{next:(ie,oe)=>L(Object.assign(Object.assign({},X),{request:ie}),oe)}),te)}composeClientMiddleware$1.composeClientMiddleware=composeClientMiddleware;var ClientError$1={},cjs={},helpers={};helpers.__esModule=void 0;helpers.__esModule=!0;var objectSetPrototypeOfIsDefined=typeof Object.setPrototypeOf=="function",objectGetPrototypeOfIsDefined=typeof Object.getPrototypeOf=="function",objectDefinePropertyIsDefined=typeof Object.defineProperty=="function",objectCreateIsDefined=typeof Object.create=="function",objectHasOwnPropertyIsDefined=typeof Object.prototype.hasOwnProperty=="function",setPrototypeOf=function L(Z,X){objectSetPrototypeOfIsDefined?Object.setPrototypeOf(Z,X):Z.__proto__=X};helpers.setPrototypeOf=setPrototypeOf;var getPrototypeOf=function L(Z){return objectGetPrototypeOfIsDefined?Object.getPrototypeOf(Z):Z.__proto__||Z.prototype};helpers.getPrototypeOf=getPrototypeOf;var ie8ObjectDefinePropertyBug=!1,defineProperty=function L(Z,X,te){if(objectDefinePropertyIsDefined&&!ie8ObjectDefinePropertyBug)try{Object.defineProperty(Z,X,te)}catch{ie8ObjectDefinePropertyBug=!0,L(Z,X,te)}else Z[X]=te.value};helpers.defineProperty=defineProperty;var hasOwnProperty=function L(Z,X){return objectHasOwnPropertyIsDefined?Z.hasOwnProperty(Z,X):Z[X]===void 0};helpers.hasOwnProperty=hasOwnProperty;var objectCreate=function L(Z,X){if(objectCreateIsDefined)return Object.create(Z,X);var te=function(){};te.prototype=Z;var ie=new te;if(typeof X>"u")return ie;if(typeof X=="null")throw new Error("PropertyDescriptors must not be null.");if(typeof X=="object")for(var oe in X)hasOwnProperty(X,oe)&&(ie[oe]=X[oe].value);return ie};helpers.objectCreate=objectCreate;(function(L){L.__esModule=void 0,L.__esModule=!0;var Z=helpers,X=Z.setPrototypeOf,te=Z.getPrototypeOf,ie=Z.defineProperty,oe=Z.objectCreate,se=new Error().toString()==="[object Error]",ue="";function ce(le){var de=this.constructor,he=de.name||function(){var Ie=de.toString().match(/^function\s*([^\s(]+)/);return Ie===null?ue||"Error":Ie[1]}(),ge=he==="Error",_e=ge?ue:he,Ae=Error.apply(this,arguments);if(X(Ae,te(this)),!(Ae instanceof de)||!(Ae instanceof ce)){var Ae=this;Error.apply(this,arguments),ie(Ae,"message",{configurable:!0,enumerable:!1,value:le,writable:!0})}if(ie(Ae,"name",{configurable:!0,enumerable:!1,value:_e,writable:!0}),Error.captureStackTrace&&Error.captureStackTrace(Ae,ge?ce:de),Ae.stack===void 0){var xe=new Error(le);xe.name=Ae.name,Ae.stack=xe.stack}return se&&ie(Ae,"toString",{configurable:!0,enumerable:!1,value:function(){return(this.name||"Error")+(typeof this.message>"u"?"":": "+this.message)},writable:!0}),Ae}ue=ce.name||"ExtendableError",ce.prototype=oe(Error.prototype,{constructor:{value:Error,enumerable:!1,writable:!0,configurable:!0}}),L.ExtendableError=ce,L.default=L.ExtendableError})(cjs);Object.defineProperty(ClientError$1,"__esModule",{value:!0});ClientError$1.ClientError=void 0;const ts_error_1$1=cjs,Status_1$1=Status;class ClientError extends ts_error_1$1.ExtendableError{constructor(Z,X,te){super(`${Z} ${Status_1$1.Status[X]}: ${te}`),this.path=Z,this.code=X,this.details=te,this.name="ClientError",Object.defineProperty(this,"@@nice-grpc",{value:!0}),Object.defineProperty(this,"@@nice-grpc:ClientError",{value:!0})}static[Symbol.hasInstance](Z){return this!==ClientError?this.prototype.isPrototypeOf(Z):typeof Z=="object"&&Z!==null&&(Z.constructor===ClientError||Z["@@nice-grpc:ClientError"]===!0||Z.name==="ClientError"&&Z["@@nice-grpc"]===!0)}}ClientError$1.ClientError=ClientError;var CallContext={};Object.defineProperty(CallContext,"__esModule",{value:!0});var ServerMiddleware={};Object.defineProperty(ServerMiddleware,"__esModule",{value:!0});var composeServerMiddleware$1={};Object.defineProperty(composeServerMiddleware$1,"__esModule",{value:!0});composeServerMiddleware$1.composeServerMiddleware=void 0;function composeServerMiddleware(L,Z){return(X,te)=>L(Object.assign(Object.assign({},X),{next:(ie,oe)=>Z(Object.assign(Object.assign({},X),{request:ie}),oe)}),te)}composeServerMiddleware$1.composeServerMiddleware=composeServerMiddleware;var ServerError$1={};Object.defineProperty(ServerError$1,"__esModule",{value:!0});ServerError$1.ServerError=void 0;const ts_error_1=cjs,Status_1=Status;class ServerError extends ts_error_1.ExtendableError{constructor(Z,X){super(`${Status_1.Status[Z]}: ${X}`),this.code=Z,this.details=X,this.name="ServerError",Object.defineProperty(this,"@@nice-grpc",{value:!0}),Object.defineProperty(this,"@@nice-grpc:ServerError",{value:!0})}static[Symbol.hasInstance](Z){return this!==ServerError?this.prototype.isPrototypeOf(Z):typeof Z=="object"&&Z!==null&&(Z.constructor===ServerError||Z["@@nice-grpc:ServerError"]===!0||Z.name==="ServerError"&&Z["@@nice-grpc"]===!0)}}ServerError$1.ServerError=ServerError;(function(L){var Z=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(te,ie,oe,se){se===void 0&&(se=oe);var ue=Object.getOwnPropertyDescriptor(ie,oe);(!ue||("get"in ue?!ie.__esModule:ue.writable||ue.configurable))&&(ue={enumerable:!0,get:function(){return ie[oe]}}),Object.defineProperty(te,se,ue)}:function(te,ie,oe,se){se===void 0&&(se=oe),te[se]=ie[oe]}),X=commonjsGlobal&&commonjsGlobal.__exportStar||function(te,ie){for(var oe in te)oe!=="default"&&!Object.prototype.hasOwnProperty.call(ie,oe)&&Z(ie,te,oe)};Object.defineProperty(L,"__esModule",{value:!0}),X(Metadata,L),X(Status,L),X(MethodDescriptor,L),X(CallOptions,L),X(ClientMiddleware,L),X(composeClientMiddleware$1,L),X(ClientError$1,L),X(CallContext,L),X(ServerMiddleware,L),X(composeServerMiddleware$1,L),X(ServerError$1,L)})(lib);var serviceDefinitions={},grpcWeb={};Object.defineProperty(grpcWeb,"__esModule",{value:!0});grpcWeb.isGrpcWebServiceDefinition=grpcWeb.fromGrpcWebServiceDefinition=void 0;function fromGrpcWebServiceDefinition(L){const Z={};for(const[X,te]of Object.entries(L)){if(X==="serviceName")continue;const ie=te;Z[uncapitalize(X)]={path:`/${L.serviceName}/${X}`,requestStream:ie.requestStream,responseStream:ie.responseStream,requestDeserialize:ie.requestType.deserializeBinary,requestSerialize:oe=>oe.serializeBinary(),responseDeserialize:ie.responseType.deserializeBinary,responseSerialize:oe=>oe.serializeBinary(),options:{}}}return Z}grpcWeb.fromGrpcWebServiceDefinition=fromGrpcWebServiceDefinition;function isGrpcWebServiceDefinition(L){return"prototype"in L}grpcWeb.isGrpcWebServiceDefinition=isGrpcWebServiceDefinition;function uncapitalize(L){return L.length===0?L:L[0].toLowerCase()+L.slice(1)}var tsProto={};Object.defineProperty(tsProto,"__esModule",{value:!0});tsProto.isTsProtoServiceDefinition=tsProto.fromTsProtoServiceDefinition=void 0;function fromTsProtoServiceDefinition(L){const Z={};for(const[X,te]of Object.entries(L.methods)){const ie=te.requestType.encode,oe=te.requestType.fromPartial,se=te.responseType.encode,ue=te.responseType.fromPartial;Z[X]={path:`/${L.fullName}/${te.name}`,requestStream:te.requestStream,responseStream:te.responseStream,requestDeserialize:te.requestType.decode,requestSerialize:oe!=null?ce=>ie(oe(ce)).finish():ce=>ie(ce).finish(),responseDeserialize:te.responseType.decode,responseSerialize:ue!=null?ce=>se(ue(ce)).finish():ce=>se(ce).finish(),options:te.options}}return Z}tsProto.fromTsProtoServiceDefinition=fromTsProtoServiceDefinition;function isTsProtoServiceDefinition(L){return"name"in L&&"fullName"in L&&"methods"in L}tsProto.isTsProtoServiceDefinition=isTsProtoServiceDefinition;Object.defineProperty(serviceDefinitions,"__esModule",{value:!0});serviceDefinitions.toGrpcWebMethodDefinition=serviceDefinitions.normalizeServiceDefinition=void 0;const grpc_web_1$5=grpcWeb,ts_proto_1=tsProto;function normalizeServiceDefinition(L){return(0,grpc_web_1$5.isGrpcWebServiceDefinition)(L)?(0,grpc_web_1$5.fromGrpcWebServiceDefinition)(L):(0,ts_proto_1.isTsProtoServiceDefinition)(L)?(0,ts_proto_1.fromTsProtoServiceDefinition)(L):L}serviceDefinitions.normalizeServiceDefinition=normalizeServiceDefinition;function toGrpcWebMethodDefinition(L){const[,Z,X]=L.path.split("/");return{service:{serviceName:Z},methodName:X,requestStream:L.requestStream,responseStream:L.responseStream,requestType:class{constructor(){throw new Error("Unexpected instantiation")}static deserializeBinary(te){return L.requestDeserialize(te)}},responseType:class{constructor(){throw new Error("Unexpected instantiation")}static deserializeBinary(te){return L.responseDeserialize(te)}}}}serviceDefinitions.toGrpcWebMethodDefinition=toGrpcWebMethodDefinition;var channel={};Object.defineProperty(channel,"__esModule",{value:!0});channel.createChannel=void 0;function createChannel(L,Z){return{address:L,transport:Z}}channel.createChannel=createChannel;var ClientFactory={},createBidiStreamingMethod$1={},grpcWebClient_umdExports={},grpcWebClient_umd={get exports(){return grpcWebClient_umdExports},set exports(L){grpcWebClient_umdExports=L}};(function(L,Z){(function(X,te){L.exports=te()})(commonjsGlobal,function(){return X={418:function(ie,oe){(function(se,ue){for(var ce in ue)se[ce]=ue[ce]})(oe,function(se){var ue={};function ce(le){if(ue[le])return ue[le].exports;var de=ue[le]={i:le,l:!1,exports:{}};return se[le].call(de.exports,de,de.exports,ce),de.l=!0,de.exports}return ce.m=se,ce.c=ue,ce.i=function(le){return le},ce.d=function(le,de,he){ce.o(le,de)||Object.defineProperty(le,de,{configurable:!1,enumerable:!0,get:he})},ce.n=function(le){var de=le&&le.__esModule?function(){return le.default}:function(){return le};return ce.d(de,"a",de),de},ce.o=function(le,de){return Object.prototype.hasOwnProperty.call(le,de)},ce.p="",ce(ce.s=1)}([function(se,ue,ce){Object.defineProperty(ue,"__esModule",{value:!0});var le=ce(3),de=function(){function he(ge,_e){ge===void 0&&(ge={}),_e===void 0&&(_e={splitValues:!1});var Ae,xe=this;this.headersMap={},ge&&(typeof Headers<"u"&&ge instanceof Headers?le.getHeaderKeys(ge).forEach(function(Ie){le.getHeaderValues(ge,Ie).forEach(function(Pe){_e.splitValues?xe.append(Ie,le.splitHeaderValue(Pe)):xe.append(Ie,Pe)})}):typeof(Ae=ge)=="object"&&typeof Ae.headersMap=="object"&&typeof Ae.forEach=="function"?ge.forEach(function(Ie,Pe){xe.append(Ie,Pe)}):typeof Map<"u"&&ge instanceof Map?ge.forEach(function(Ie,Pe){xe.append(Pe,Ie)}):typeof ge=="string"?this.appendFromString(ge):typeof ge=="object"&&Object.getOwnPropertyNames(ge).forEach(function(Ie){var Pe=ge[Ie];Array.isArray(Pe)?Pe.forEach(function(Ce){xe.append(Ie,Ce)}):xe.append(Ie,Pe)}))}return he.prototype.appendFromString=function(ge){for(var _e=ge.split(`\r `),Ae=0;Ae<_e.length;Ae++){var xe=_e[Ae],Ie=xe.indexOf(":");if(Ie>0){var Pe=xe.substring(0,Ie).trim(),Ce=xe.substring(Ie+1).trim();this.append(Pe,Ce)}}},he.prototype.delete=function(ge,_e){var Ae=le.normalizeName(ge);if(_e===void 0)delete this.headersMap[Ae];else{var xe=this.headersMap[Ae];if(xe){var Ie=xe.indexOf(_e);Ie>=0&&xe.splice(Ie,1),xe.length===0&&delete this.headersMap[Ae]}}},he.prototype.append=function(ge,_e){var Ae=this,xe=le.normalizeName(ge);Array.isArray(this.headersMap[xe])||(this.headersMap[xe]=[]),Array.isArray(_e)?_e.forEach(function(Ie){Ae.headersMap[xe].push(le.normalizeValue(Ie))}):this.headersMap[xe].push(le.normalizeValue(_e))},he.prototype.set=function(ge,_e){var Ae=le.normalizeName(ge);if(Array.isArray(_e)){var xe=[];_e.forEach(function(Ie){xe.push(le.normalizeValue(Ie))}),this.headersMap[Ae]=xe}else this.headersMap[Ae]=[le.normalizeValue(_e)]},he.prototype.has=function(ge,_e){var Ae=this.headersMap[le.normalizeName(ge)];if(!Array.isArray(Ae))return!1;if(_e!==void 0){var xe=le.normalizeValue(_e);return Ae.indexOf(xe)>=0}return!0},he.prototype.get=function(ge){var _e=this.headersMap[le.normalizeName(ge)];return _e!==void 0?_e.concat():[]},he.prototype.forEach=function(ge){var _e=this;Object.getOwnPropertyNames(this.headersMap).forEach(function(Ae){ge(Ae,_e.headersMap[Ae])},this)},he.prototype.toHeaders=function(){if(typeof Headers<"u"){var ge=new Headers;return this.forEach(function(_e,Ae){Ae.forEach(function(xe){ge.append(_e,xe)})}),ge}throw new Error("Headers class is not defined")},he}();ue.BrowserHeaders=de},function(se,ue,ce){Object.defineProperty(ue,"__esModule",{value:!0});var le=ce(0);ue.BrowserHeaders=le.BrowserHeaders},function(se,ue,ce){Object.defineProperty(ue,"__esModule",{value:!0}),ue.iterateHeaders=function(le,de){for(var he=le[Symbol.iterator](),ge=he.next();!ge.done;)de(ge.value[0]),ge=he.next()},ue.iterateHeadersKeys=function(le,de){for(var he=le.keys(),ge=he.next();!ge.done;)de(ge.value),ge=he.next()}},function(se,ue,ce){Object.defineProperty(ue,"__esModule",{value:!0});var le=ce(2);ue.normalizeName=function(de){if(typeof de!="string"&&(de=String(de)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(de))throw new TypeError("Invalid character in header field name");return de.toLowerCase()},ue.normalizeValue=function(de){return typeof de!="string"&&(de=String(de)),de},ue.getHeaderValues=function(de,he){var ge=de;if(ge instanceof Headers&&ge.getAll)return ge.getAll(he);var _e=ge.get(he);return _e&&typeof _e=="string"?[_e]:_e},ue.getHeaderKeys=function(de){var he=de,ge={},_e=[];return he.keys?le.iterateHeadersKeys(he,function(Ae){ge[Ae]||(ge[Ae]=!0,_e.push(Ae))}):he.forEach?he.forEach(function(Ae,xe){ge[xe]||(ge[xe]=!0,_e.push(xe))}):le.iterateHeaders(he,function(Ae){var xe=Ae[0];ge[xe]||(ge[xe]=!0,_e.push(xe))}),_e},ue.splitHeaderValue=function(de){var he=[];return de.split(", ").forEach(function(ge){ge.split(",").forEach(function(_e){he.push(_e)})}),he}}]))},617:function(ie,oe,se){Object.defineProperty(oe,"__esModule",{value:!0}),oe.ChunkParser=oe.ChunkType=oe.encodeASCII=oe.decodeASCII=void 0;var ue,ce=se(65);function le(Ie){return(Pe=Ie)===9||Pe===10||Pe===13||Ie>=32&&Ie<=126;var Pe}function de(Ie){for(var Pe=0;Pe!==Ie.length;++Pe)if(!le(Ie[Pe]))throw new Error("Metadata is not valid (printable) ASCII");return String.fromCharCode.apply(String,Array.prototype.slice.call(Ie))}function he(Ie){return(128&Ie.getUint8(0))==128}function ge(Ie){return Ie.getUint32(1,!1)}function _e(Ie,Pe,Ce){return Ie.byteLength-Pe>=Ce}function Ae(Ie,Pe,Ce){if(Ie.slice)return Ie.slice(Pe,Ce);var Be=Ie.length;Ce!==void 0&&(Be=Ce);for(var Ve=new Uint8Array(Be-Pe),Ge=0,Ke=Pe;Ke=0?Ce:le.httpStatusToCode(Pe);this.props.debug&&de.debug("onHeaders.code",Be);var Ve=Ie.get("grpc-message")||[];if(this.props.debug&&de.debug("onHeaders.gRPCMessage",Ve),this.rawOnHeaders(Ie),Be!==le.Code.OK){var Ge=this.decodeGRPCStatus(Ve[0]);this.rawOnError(Be,Ge,Ie)}}},xe.prototype.onTransportChunk=function(Ie){var Pe=this;if(this.closed)this.props.debug&&de.debug("grpc.onChunk received after request was closed - ignoring");else{var Ce=[];try{Ce=this.parser.parse(Ie)}catch(Be){return this.props.debug&&de.debug("onChunk.parsing error",Be,Be.message),void this.rawOnError(le.Code.Internal,"parsing error: "+Be.message)}Ce.forEach(function(Be){if(Be.chunkType===ce.ChunkType.MESSAGE){var Ve=Pe.methodDefinition.responseType.deserializeBinary(Be.data);Pe.rawOnMessage(Ve)}else Be.chunkType===ce.ChunkType.TRAILERS&&(Pe.responseHeaders?(Pe.responseTrailers=new ue.Metadata(Be.trailers),Pe.props.debug&&de.debug("onChunk.trailers",Pe.responseTrailers)):(Pe.responseHeaders=new ue.Metadata(Be.trailers),Pe.rawOnHeaders(Pe.responseHeaders)))})}},xe.prototype.onTransportEnd=function(){if(this.props.debug&&de.debug("grpc.onEnd"),this.closed)this.props.debug&&de.debug("grpc.onEnd received after request was closed - ignoring");else if(this.responseTrailers!==void 0){var Ie=Ae(this.responseTrailers);if(Ie!==null){var Pe=this.responseTrailers.get("grpc-message"),Ce=this.decodeGRPCStatus(Pe[0]);this.rawOnEnd(Ie,Ce,this.responseTrailers)}else this.rawOnError(le.Code.Internal,"Response closed without grpc-status (Trailers provided)")}else{if(this.responseHeaders===void 0)return void this.rawOnError(le.Code.Unknown,"Response closed without headers");var Be=Ae(this.responseHeaders),Ve=this.responseHeaders.get("grpc-message");if(this.props.debug&&de.debug("grpc.headers only response ",Be,Ve),Be===null)return void this.rawOnEnd(le.Code.Unknown,"Response closed without grpc-status (Headers only)",this.responseHeaders);var Ge=this.decodeGRPCStatus(Ve[0]);this.rawOnEnd(Be,Ge,this.responseHeaders)}},xe.prototype.decodeGRPCStatus=function(Ie){if(!Ie)return"";try{return decodeURIComponent(Ie)}catch{return Ie}},xe.prototype.rawOnEnd=function(Ie,Pe,Ce){var Be=this;this.props.debug&&de.debug("rawOnEnd",Ie,Pe,Ce),this.completed||(this.completed=!0,this.onEndCallbacks.forEach(function(Ve){if(!Be.closed)try{Ve(Ie,Pe,Ce)}catch(Ge){setTimeout(function(){throw Ge},0)}}))},xe.prototype.rawOnHeaders=function(Ie){this.props.debug&&de.debug("rawOnHeaders",Ie),this.completed||this.onHeadersCallbacks.forEach(function(Pe){try{Pe(Ie)}catch(Ce){setTimeout(function(){throw Ce},0)}})},xe.prototype.rawOnError=function(Ie,Pe,Ce){var Be=this;Ce===void 0&&(Ce=new ue.Metadata),this.props.debug&&de.debug("rawOnError",Ie,Pe),this.completed||(this.completed=!0,this.onEndCallbacks.forEach(function(Ve){if(!Be.closed)try{Ve(Ie,Pe,Ce)}catch(Ge){setTimeout(function(){throw Ge},0)}}))},xe.prototype.rawOnMessage=function(Ie){var Pe=this;this.props.debug&&de.debug("rawOnMessage",Ie.toObject()),this.completed||this.closed||this.onMessageCallbacks.forEach(function(Ce){if(!Pe.closed)try{Ce(Ie)}catch(Be){setTimeout(function(){throw Be},0)}})},xe.prototype.onHeaders=function(Ie){this.onHeadersCallbacks.push(Ie)},xe.prototype.onMessage=function(Ie){this.onMessageCallbacks.push(Ie)},xe.prototype.onEnd=function(Ie){this.onEndCallbacks.push(Ie)},xe.prototype.start=function(Ie){if(this.started)throw new Error("Client already started - cannot .start()");this.started=!0;var Pe=new ue.Metadata(Ie||{});Pe.set("content-type","application/grpc-web+proto"),Pe.set("x-grpc-web","1"),this.transport.start(Pe)},xe.prototype.send=function(Ie){if(!this.started)throw new Error("Client not started - .start() must be called before .send()");if(this.closed)throw new Error("Client already closed - cannot .send()");if(this.finishedSending)throw new Error("Client already finished sending - cannot .send()");if(!this.methodDefinition.requestStream&&this.sentFirstMessage)throw new Error("Message already sent for non-client-streaming method - cannot .send()");this.sentFirstMessage=!0;var Pe=ge.frameRequest(Ie);this.transport.sendMessage(Pe)},xe.prototype.finishSend=function(){if(!this.started)throw new Error("Client not started - .finishSend() must be called before .close()");if(this.closed)throw new Error("Client already closed - cannot .send()");if(this.finishedSending)throw new Error("Client already finished sending - cannot .finishSend()");this.finishedSending=!0,this.transport.finishSend()},xe.prototype.close=function(){if(!this.started)throw new Error("Client not started - .start() must be called before .close()");if(this.closed)throw new Error("Client already closed - cannot .close()");this.closed=!0,this.props.debug&&de.debug("request.abort aborting request"),this.transport.cancel()},xe}();function Ae(xe){var Ie=xe.get("grpc-status")||[];if(Ie.length>0)try{var Pe=Ie[0];return parseInt(Pe,10)}catch{return null}return null}},346:function(ie,oe){Object.defineProperty(oe,"__esModule",{value:!0}),oe.debug=void 0,oe.debug=function(){for(var se=[],ue=0;ue=55296&&Ce<=56319){var Be=Ie.charCodeAt(Pe+1);Be>=56320&&Be<=57343&&(Ce=65536+(Ce-55296<<10)+(Be-56320))}return Ce}function xe(Ie){for(var Pe=new Uint8Array(Ie.length),Ce=0,Be=0;Be{if(L.aborted){te(new AbortError);return}let ie,oe=!1;function se(){oe||(oe=!0,ie?.())}const ue=Z(ce=>{X(ce),se()},ce=>{te(ce),se()});if(!oe){const ce=()=>{const le=ue();le==null?te(new AbortError):le.then(()=>{te(new AbortError)},de=>{te(de)}),se()};L.addEventListener("abort",ce),ie=()=>{L.removeEventListener("abort",ce)}}})}function abortable(L,Z){if(L.aborted){const X=()=>{};Z.then(X,X)}return execute(L,(X,te)=>(Z.then(X,te),()=>{}))}function delay(L,Z){return execute(L,X=>{const te=typeof Z=="number"?Z:Z.getTime()-Date.now(),ie=setTimeout(X,te);return()=>{clearTimeout(ie)}})}function forever(L){return execute(L,()=>()=>{})}function waitForEvent(L,Z,X,te){return execute(L,ie=>{let oe,se=!1;return oe=listen(Z,X,(...ce)=>{ie(ce.length>1?ce:ce[0]),se=!0,oe?.()},te),se&&oe(),()=>{se=!0,oe?.()}})}function listen(L,Z,X,te){if(isEventTarget(L))return L.addEventListener(Z,X,te),()=>L.removeEventListener(Z,X,te);if(isJQueryStyleEventEmitter(L))return L.on(Z,X),()=>L.off(Z,X);if(isNodeStyleEventEmitter(L))return L.addListener(Z,X),()=>L.removeListener(Z,X);throw new Error("Invalid event target")}function isNodeStyleEventEmitter(L){return isFunction(L.addListener)&&isFunction(L.removeListener)}function isJQueryStyleEventEmitter(L){return isFunction(L.on)&&isFunction(L.off)}function isEventTarget(L){return isFunction(L.addEventListener)&&isFunction(L.removeEventListener)}const isFunction=L=>typeof L=="function";function all(L,Z){return new Promise((X,te)=>{if(L.aborted){te(new AbortError);return}const ie=new AbortController,oe=Z(ie.signal);if(oe.length===0){X([]);return}const se=()=>{ie.abort()};L.addEventListener("abort",se);let ue;const ce=new Array(oe.length);let le=0;function de(){le+=1,le===oe.length&&(L.removeEventListener("abort",se),ue!=null?te(ue.reason):X(ce))}for(const[he,ge]of oe.entries())ge.then(_e=>{ce[he]=_e,de()},_e=>{ie.abort(),(ue==null||!isAbortError(_e)&&isAbortError(ue.reason))&&(ue={reason:_e}),de()})})}function race(L,Z){return new Promise((X,te)=>{if(L.aborted){te(new AbortError);return}const ie=new AbortController,oe=Z(ie.signal),se=()=>{ie.abort()};L.addEventListener("abort",se);let ue=0;function ce(de){ie.abort(),ue+=1,ue===oe.length&&(L.removeEventListener("abort",se),de.status==="fulfilled"?X(de.value):te(de.reason))}let le;for(const de of oe)de.then(he=>{le==null&&(le={status:"fulfilled",value:he}),ce(le)},he=>{(le==null||!isAbortError(he)&&(le.status==="fulfilled"||isAbortError(le.reason)))&&(le={status:"rejected",reason:he}),ce(le)})})}async function retry(L,Z,X={}){const{baseMs:te=1e3,maxDelayMs:ie=3e4,onError:oe,maxAttempts:se=1/0}=X;let ue=0;const ce=()=>{ue=-1};for(;;)try{return await Z(L,ue,ce)}catch(le){if(rethrowAbortError(le),ue>=se)throw le;let de;if(ue===-1)de=0;else{const he=Math.min(ie,Math.pow(2,ue)*te);de=Math.round(he*(1+Math.random())/2)}oe&&oe(le,ue,de),de!==0&&await delay(L,de),ue+=1}}function spawn(L,Z){if(L.aborted)return Promise.reject(new AbortError);const X=[],te=new AbortController,ie=te.signal,oe=()=>{te.abort()};L.addEventListener("abort",oe);const se=()=>{L.removeEventListener("abort",oe)},ue=new Set,ce=()=>{for(const he of ue)he.abort()};ie.addEventListener("abort",ce);const le=()=>{ie.removeEventListener("abort",ce)};let de=new Promise((he,ge)=>{let _e,Ae;xe(Ie=>Z(Ie,{defer(Pe){X.push(Pe)},fork:xe})).join().then(Ie=>{te.abort(),_e={value:Ie}},Ie=>{te.abort(),(!isAbortError(Ie)||Ae==null)&&(Ae={error:Ie})});function xe(Ie){if(ie.aborted)return{abort(){},async join(){throw new AbortError}};const Pe=new AbortController,Ce=Pe.signal,Be=Ie(Ce),Ve={abort(){Pe.abort()},join:()=>Be};return ue.add(Ve),Be.catch(catchAbortError).catch(Ge=>{Ae={error:Ge},te.abort()}).finally(()=>{ue.delete(Ve),ue.size===0&&(Ae!=null?ge(Ae.error):he(_e.value))}),Ve}});return de=de.finally(()=>{se(),le();let he=Promise.resolve();for(let ge=X.length-1;ge>=0;ge--)he=he.finally(X[ge]);return he}),de}function run(L){const Z=new AbortController,X=L(Z.signal).catch(catchAbortError);return()=>(Z.abort(),X)}function proactiveRetry(L,Z,X={}){const{baseMs:te=1e3,onError:ie,maxAttempts:oe=1/0}=X;return execute(L,(se,ue)=>{const ce=new AbortController;let le=!1;const de=new Map;function he(Ae){ce.abort(),de.clear(),se(Ae)}function ge(Ae,xe){if(de.delete(xe),le&&de.size===0){ue(Ae);return}if(!isAbortError(Ae)&&ie)try{ie(Ae,xe)}catch(Ie){ce.abort(),de.clear(),ue(Ie)}}async function _e(Ae){for(let xe=0;;xe++){const Ie=Z(Ae,xe);if(de.set(xe,Ie),Ie.then(he,Be=>ge(Be,xe)),xe+1>=oe)break;const Pe=Math.pow(2,xe)*te,Ce=Math.round(Pe*(1+Math.random())/2);await delay(Ae,Ce)}le=!0}return _e(ce.signal).catch(catchAbortError),()=>{ce.abort()}})}const es=Object.freeze(Object.defineProperty({__proto__:null,AbortError,abortable,all,catchAbortError,delay,execute,forever,isAbortError,proactiveRetry,race,rethrowAbortError,retry,run,spawn,throwIfAborted,waitForEvent},Symbol.toStringTag,{value:"Module"})),require$$2=getAugmentedNamespace(es);var AsyncSink$1={};Object.defineProperty(AsyncSink$1,"__esModule",{value:!0});AsyncSink$1.AsyncSink=void 0;const ARRAY_VALUE="value",ARRAY_ERROR="error";class AsyncSink{constructor(){this._ended=!1,this._values=[],this._resolvers=[]}[Symbol.asyncIterator](){return this}write(Z){this._push({type:ARRAY_VALUE,value:Z})}error(Z){this._push({type:ARRAY_ERROR,error:Z})}_push(Z){if(this._ended)throw new Error("AsyncSink already ended");if(this._resolvers.length>0){const{resolve:X,reject:te}=this._resolvers.shift();Z.type===ARRAY_ERROR?te(Z.error):X({done:!1,value:Z.value})}else this._values.push(Z)}next(){if(this._values.length>0){const{type:Z,value:X,error:te}=this._values.shift();return Z===ARRAY_ERROR?Promise.reject(te):Promise.resolve({done:!1,value:X})}return this._ended?Promise.resolve({done:!0}):new Promise((Z,X)=>{this._resolvers.push({resolve:Z,reject:X})})}end(){for(;this._resolvers.length>0;)this._resolvers.shift().resolve({done:!0});this._ended=!0}}AsyncSink$1.AsyncSink=AsyncSink;var isAsyncIterable$1={};Object.defineProperty(isAsyncIterable$1,"__esModule",{value:!0});isAsyncIterable$1.isAsyncIterable=void 0;function isAsyncIterable(L){return L!=null&&Symbol.asyncIterator in L}isAsyncIterable$1.isAsyncIterable=isAsyncIterable;var convertMetadata={},base64Exports={},base64={get exports(){return base64Exports},set exports(L){base64Exports=L}};(function(L,Z){(function(X,te){L.exports=te()})(typeof self<"u"?self:typeof window<"u"?window:commonjsGlobal,function(){var X="3.7.5",te=X,ie=typeof atob=="function",oe=typeof btoa=="function",se=typeof Buffer=="function",ue=typeof TextDecoder=="function"?new TextDecoder:void 0,ce=typeof TextEncoder=="function"?new TextEncoder:void 0,le="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",de=Array.prototype.slice.call(le),he=function(Ue){var qe={};return Ue.forEach(function(Xe,nt){return qe[Xe]=nt}),qe}(de),ge=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,_e=String.fromCharCode.bind(String),Ae=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):function(Ue){return new Uint8Array(Array.prototype.slice.call(Ue,0))},xe=function(Ue){return Ue.replace(/=/g,"").replace(/[+\/]/g,function(qe){return qe=="+"?"-":"_"})},Ie=function(Ue){return Ue.replace(/[^A-Za-z0-9\+\/]/g,"")},Pe=function(Ue){for(var qe,Xe,nt,tt,Qe="",ft=Ue.length%3,rt=0;rt255||(nt=Ue.charCodeAt(rt++))>255||(tt=Ue.charCodeAt(rt++))>255)throw new TypeError("invalid character found");qe=Xe<<16|nt<<8|tt,Qe+=de[qe>>18&63]+de[qe>>12&63]+de[qe>>6&63]+de[qe&63]}return ft?Qe.slice(0,ft-3)+"===".substring(ft):Qe},Ce=oe?function(Ue){return btoa(Ue)}:se?function(Ue){return Buffer.from(Ue,"binary").toString("base64")}:Pe,Be=se?function(Ue){return Buffer.from(Ue).toString("base64")}:function(Ue){for(var qe=4096,Xe=[],nt=0,tt=Ue.length;nt>>6)+_e(128|qe&63):_e(224|qe>>>12&15)+_e(128|qe>>>6&63)+_e(128|qe&63)}else{var qe=65536+(Ue.charCodeAt(0)-55296)*1024+(Ue.charCodeAt(1)-56320);return _e(240|qe>>>18&7)+_e(128|qe>>>12&63)+_e(128|qe>>>6&63)+_e(128|qe&63)}},Ke=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Je=function(Ue){return Ue.replace(Ke,Ge)},et=se?function(Ue){return Buffer.from(Ue,"utf8").toString("base64")}:ce?function(Ue){return Be(ce.encode(Ue))}:function(Ue){return Ce(Je(Ue))},at=function(Ue,qe){return qe===void 0&&(qe=!1),qe?xe(et(Ue)):et(Ue)},dt=function(Ue){return at(Ue,!0)},st=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,ht=function(Ue){switch(Ue.length){case 4:var qe=(7&Ue.charCodeAt(0))<<18|(63&Ue.charCodeAt(1))<<12|(63&Ue.charCodeAt(2))<<6|63&Ue.charCodeAt(3),Xe=qe-65536;return _e((Xe>>>10)+55296)+_e((Xe&1023)+56320);case 3:return _e((15&Ue.charCodeAt(0))<<12|(63&Ue.charCodeAt(1))<<6|63&Ue.charCodeAt(2));default:return _e((31&Ue.charCodeAt(0))<<6|63&Ue.charCodeAt(1))}},Fe=function(Ue){return Ue.replace(st,ht)},pe=function(Ue){if(Ue=Ue.replace(/\s+/g,""),!ge.test(Ue))throw new TypeError("malformed base64.");Ue+="==".slice(2-(Ue.length&3));for(var qe,Xe="",nt,tt,Qe=0;Qe>16&255):tt===64?_e(qe>>16&255,qe>>8&255):_e(qe>>16&255,qe>>8&255,qe&255);return Xe},we=ie?function(Ue){return atob(Ie(Ue))}:se?function(Ue){return Buffer.from(Ue,"base64").toString("binary")}:pe,$e=se?function(Ue){return Ae(Buffer.from(Ue,"base64"))}:function(Ue){return Ae(we(Ue).split("").map(function(qe){return qe.charCodeAt(0)}))},Oe=function(Ue){return $e(Ze(Ue))},Me=se?function(Ue){return Buffer.from(Ue,"base64").toString("utf8")}:ue?function(Ue){return ue.decode($e(Ue))}:function(Ue){return Fe(we(Ue))},Ze=function(Ue){return Ie(Ue.replace(/[-_]/g,function(qe){return qe=="-"?"+":"/"}))},We=function(Ue){return Me(Ze(Ue))},Ne=function(Ue){if(typeof Ue!="string")return!1;var qe=Ue.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(qe)||!/[^\s0-9a-zA-Z\-_]/.test(qe)},ve=function(Ue){return{value:Ue,enumerable:!1,writable:!0,configurable:!0}},Le=function(){var Ue=function(qe,Xe){return Object.defineProperty(String.prototype,qe,ve(Xe))};Ue("fromBase64",function(){return We(this)}),Ue("toBase64",function(qe){return at(this,qe)}),Ue("toBase64URI",function(){return at(this,!0)}),Ue("toBase64URL",function(){return at(this,!0)}),Ue("toUint8Array",function(){return Oe(this)})},it=function(){var Ue=function(qe,Xe){return Object.defineProperty(Uint8Array.prototype,qe,ve(Xe))};Ue("toBase64",function(qe){return Ve(this,qe)}),Ue("toBase64URI",function(){return Ve(this,!0)}),Ue("toBase64URL",function(){return Ve(this,!0)})},Te=function(){Le(),it()},Ye={version:X,VERSION:te,atob:we,atobPolyfill:pe,btoa:Ce,btoaPolyfill:Pe,fromBase64:We,toBase64:at,encode:at,encodeURI:dt,encodeURL:dt,utob:Je,btou:Fe,decode:We,isValid:Ne,fromUint8Array:Ve,toUint8Array:Oe,extendString:Le,extendUint8Array:it,extendBuiltins:Te};return Ye.Base64={},Object.keys(Ye).forEach(function(Ue){return Ye.Base64[Ue]=Ye[Ue]}),Ye})})(base64);Object.defineProperty(convertMetadata,"__esModule",{value:!0});convertMetadata.convertMetadataFromGrpcWeb=convertMetadata.convertMetadataToGrpcWeb=void 0;const grpc_web_1$4=grpcWebClient_umdExports,nice_grpc_common_1$5=lib,js_base64_1=base64Exports;function convertMetadataToGrpcWeb(L){const Z=new grpc_web_1$4.grpc.Metadata;for(const[X,te]of L)for(const ie of te)Z.append(X,typeof ie=="string"?ie:js_base64_1.Base64.fromUint8Array(ie));return Z}convertMetadata.convertMetadataToGrpcWeb=convertMetadataToGrpcWeb;function convertMetadataFromGrpcWeb(L){const Z=(0,nice_grpc_common_1$5.Metadata)();for(const[X,te]of Object.entries(L.headersMap))if(X.endsWith("-bin"))for(const ie of te)for(const oe of ie.split(/,\s?/))Z.append(X,js_base64_1.Base64.toUint8Array(oe));else Z.set(X,te);return Z}convertMetadata.convertMetadataFromGrpcWeb=convertMetadataFromGrpcWeb;Object.defineProperty(createBidiStreamingMethod$1,"__esModule",{value:!0});createBidiStreamingMethod$1.createBidiStreamingMethod=void 0;const nice_grpc_common_1$4=lib,grpc_web_1$3=grpcWebClient_umdExports,abort_controller_x_1$3=require$$2,AsyncSink_1$1=AsyncSink$1,service_definitions_1$4=serviceDefinitions,isAsyncIterable_1$3=isAsyncIterable$1,convertMetadata_1$3=convertMetadata;function createBidiStreamingMethod(L,Z,X,te){const ie=(0,service_definitions_1$4.toGrpcWebMethodDefinition)(L),oe={path:L.path,requestStream:L.requestStream,responseStream:L.responseStream,options:L.options};async function*se(ce,le){if(!(0,isAsyncIterable_1$3.isAsyncIterable)(ce))throw new Error("A middleware passed invalid request to next(): expected a single message for bidirectional streaming method");const{metadata:de=(0,nice_grpc_common_1$4.Metadata)(),signal:he=new AbortController().signal,onHeader:ge,onTrailer:_e}=le,Ae=new AbortController,xe=new AsyncSink_1$1.AsyncSink,Ie=grpc_web_1$3.grpc.client(ie,{host:Z.address,transport:Z.transport});Ie.onHeaders(Be=>{ge?.((0,convertMetadata_1$3.convertMetadataFromGrpcWeb)(Be))}),Ie.onMessage(Be=>{xe.write(Be)}),Ie.onEnd((Be,Ve,Ge)=>{_e?.((0,convertMetadata_1$3.convertMetadataFromGrpcWeb)(Ge)),Be===grpc_web_1$3.grpc.Code.OK?xe.end():xe.error(new nice_grpc_common_1$4.ClientError(L.path,+Be,Ve))}),Ie.start((0,convertMetadata_1$3.convertMetadataToGrpcWeb)(de));let Pe;pipeRequest$1(Ae.signal,ce,Ie,L).then(()=>{Ie.finishSend()},Be=>{(0,abort_controller_x_1$3.isAbortError)(Be)||(Pe=Be,Ie.close(),xe.end())});const Ce=()=>{xe.error(new abort_controller_x_1$3.AbortError),Ae.abort(),Ie.close()};he.addEventListener("abort",Ce);try{yield*xe}finally{if(Ae.abort(),he.removeEventListener("abort",Ce),(0,abort_controller_x_1$3.throwIfAborted)(he),Pe)throw Pe}}const ue=X==null?se:(ce,le)=>X({method:oe,requestStream:!0,request:ce,responseStream:!0,next:se},le);return(ce,le)=>{const he=ue(ce,{...te,...le})[Symbol.asyncIterator]();return{[Symbol.asyncIterator](){return{async next(){const ge=await he.next();return ge.done&&ge.value!=null?await he.throw(new Error("A middleware returned a message, but expected to return void for bidirectional streaming method")):ge},return(){return he.return()},throw(ge){return he.throw(ge)}}}}}}createBidiStreamingMethod$1.createBidiStreamingMethod=createBidiStreamingMethod;async function pipeRequest$1(L,Z,X,te){for await(const ie of Z)(0,abort_controller_x_1$3.throwIfAborted)(L),X.send({serializeBinary:()=>te.requestSerialize(ie)})}var createClientStreamingMethod$1={};Object.defineProperty(createClientStreamingMethod$1,"__esModule",{value:!0});createClientStreamingMethod$1.createClientStreamingMethod=void 0;const nice_grpc_common_1$3=lib,grpc_web_1$2=grpcWebClient_umdExports,abort_controller_x_1$2=require$$2,service_definitions_1$3=serviceDefinitions,isAsyncIterable_1$2=isAsyncIterable$1,convertMetadata_1$2=convertMetadata;function createClientStreamingMethod(L,Z,X,te){const ie=(0,service_definitions_1$3.toGrpcWebMethodDefinition)(L),oe={path:L.path,requestStream:L.requestStream,responseStream:L.responseStream,options:L.options};async function*se(ce,le){if(!(0,isAsyncIterable_1$2.isAsyncIterable)(ce))throw new Error("A middleware passed invalid request to next(): expected a single message for client streaming method");const{metadata:de=(0,nice_grpc_common_1$3.Metadata)(),signal:he=new AbortController().signal,onHeader:ge,onTrailer:_e}=le;return await(0,abort_controller_x_1$2.execute)(he,(Ae,xe)=>{const Ie=new AbortController;let Pe;const Ce=grpc_web_1$2.grpc.client(ie,{host:Z.address,transport:Z.transport});return Ce.onHeaders(Be=>{ge?.((0,convertMetadata_1$2.convertMetadataFromGrpcWeb)(Be))}),Ce.onMessage(Be=>{Pe=Be}),Ce.onEnd((Be,Ve,Ge)=>{_e?.((0,convertMetadata_1$2.convertMetadataFromGrpcWeb)(Ge)),Ie.abort(),Be===grpc_web_1$2.grpc.Code.OK?Ae(Pe):xe(new nice_grpc_common_1$3.ClientError(L.path,+Be,Ve))}),Ce.start((0,convertMetadata_1$2.convertMetadataToGrpcWeb)(de)),pipeRequest(Ie.signal,ce,Ce,L).then(()=>{Ce.finishSend()},Be=>{(0,abort_controller_x_1$2.isAbortError)(Be)||(xe(Be),Ce.close())}),()=>{Ie.abort(),Ce.close()}})}const ue=X==null?se:(ce,le)=>X({method:oe,requestStream:!0,request:ce,responseStream:!1,next:se},le);return async(ce,le)=>{const he=ue(ce,{...te,...le})[Symbol.asyncIterator]();let ge=await he.next();for(;;){if(!ge.done){ge=await he.throw(new Error("A middleware yielded a message, but expected to only return a message for client streaming method"));continue}if(ge.value==null){ge=await he.throw(new Error("A middleware returned void, but expected to return a message for client streaming method"));continue}return ge.value}}}createClientStreamingMethod$1.createClientStreamingMethod=createClientStreamingMethod;async function pipeRequest(L,Z,X,te){for await(const ie of Z)(0,abort_controller_x_1$2.throwIfAborted)(L),X.send({serializeBinary:()=>te.requestSerialize(ie)})}var createServerStreamingMethod$1={};Object.defineProperty(createServerStreamingMethod$1,"__esModule",{value:!0});createServerStreamingMethod$1.createServerStreamingMethod=void 0;const grpc_web_1$1=grpcWebClient_umdExports,abort_controller_x_1$1=require$$2,AsyncSink_1=AsyncSink$1,nice_grpc_common_1$2=lib,service_definitions_1$2=serviceDefinitions,convertMetadata_1$1=convertMetadata,isAsyncIterable_1$1=isAsyncIterable$1;function createServerStreamingMethod(L,Z,X,te){const ie=(0,service_definitions_1$2.toGrpcWebMethodDefinition)(L),oe={path:L.path,requestStream:L.requestStream,responseStream:L.responseStream,options:L.options};async function*se(ce,le){if((0,isAsyncIterable_1$1.isAsyncIterable)(ce))throw new Error("A middleware passed invalid request to next(): expected a single message for server streaming method");const{metadata:de=(0,nice_grpc_common_1$2.Metadata)(),signal:he=new AbortController().signal,onHeader:ge,onTrailer:_e}=le,Ae=new AsyncSink_1.AsyncSink,xe=grpc_web_1$1.grpc.client(ie,{host:Z.address,transport:Z.transport});xe.onHeaders(Pe=>{ge?.((0,convertMetadata_1$1.convertMetadataFromGrpcWeb)(Pe))}),xe.onMessage(Pe=>{Ae.write(Pe)}),xe.onEnd((Pe,Ce,Be)=>{_e?.((0,convertMetadata_1$1.convertMetadataFromGrpcWeb)(Be)),Pe===grpc_web_1$1.grpc.Code.OK?Ae.end():Ae.error(new nice_grpc_common_1$2.ClientError(L.path,+Pe,Ce))}),xe.start((0,convertMetadata_1$1.convertMetadataToGrpcWeb)(de)),xe.send({serializeBinary:()=>L.requestSerialize(ce)}),xe.finishSend();const Ie=()=>{Ae.error(new abort_controller_x_1$1.AbortError),xe.close()};he.addEventListener("abort",Ie);try{yield*Ae}finally{he.removeEventListener("abort",Ie),(0,abort_controller_x_1$1.throwIfAborted)(he)}}const ue=X==null?se:(ce,le)=>X({method:oe,requestStream:!1,request:ce,responseStream:!0,next:se},le);return(ce,le)=>{const he=ue(ce,{...te,...le})[Symbol.asyncIterator]();return{[Symbol.asyncIterator](){return{async next(){const ge=await he.next();return ge.done&&ge.value!=null?await he.throw(new Error("A middleware returned a message, but expected to return void for server streaming method")):ge},return(){return he.return()},throw(ge){return he.throw(ge)}}}}}}createServerStreamingMethod$1.createServerStreamingMethod=createServerStreamingMethod;var createUnaryMethod$1={};Object.defineProperty(createUnaryMethod$1,"__esModule",{value:!0});createUnaryMethod$1.createUnaryMethod=void 0;const nice_grpc_common_1$1=lib,grpc_web_1=grpcWebClient_umdExports,abort_controller_x_1=require$$2,service_definitions_1$1=serviceDefinitions,isAsyncIterable_1=isAsyncIterable$1,convertMetadata_1=convertMetadata;function createUnaryMethod(L,Z,X,te){const ie=(0,service_definitions_1$1.toGrpcWebMethodDefinition)(L),oe={path:L.path,requestStream:L.requestStream,responseStream:L.responseStream,options:L.options};async function*se(ce,le){if((0,isAsyncIterable_1.isAsyncIterable)(ce))throw new Error("A middleware passed invalid request to next(): expected a single message for unary method");const{metadata:de=(0,nice_grpc_common_1$1.Metadata)(),signal:he=new AbortController().signal,onHeader:ge,onTrailer:_e}=le;return await(0,abort_controller_x_1.execute)(he,(Ae,xe)=>{let Ie;const Pe=grpc_web_1.grpc.client(ie,{host:Z.address,transport:Z.transport});return Pe.onHeaders(Ce=>{ge?.((0,convertMetadata_1.convertMetadataFromGrpcWeb)(Ce))}),Pe.onMessage(Ce=>{Ie=Ce}),Pe.onEnd((Ce,Be,Ve)=>{_e?.((0,convertMetadata_1.convertMetadataFromGrpcWeb)(Ve)),Ce===grpc_web_1.grpc.Code.OK?Ae(Ie):xe(new nice_grpc_common_1$1.ClientError(L.path,+Ce,Be))}),Pe.start((0,convertMetadata_1.convertMetadataToGrpcWeb)(de)),Pe.send({serializeBinary:()=>L.requestSerialize(ce)}),Pe.finishSend(),()=>{Pe.close()}})}const ue=X==null?se:(ce,le)=>X({method:oe,requestStream:!1,request:ce,responseStream:!1,next:se},le);return async(ce,le)=>{const he=ue(ce,{...te,...le})[Symbol.asyncIterator]();let ge=await he.next();for(;;){if(!ge.done){ge=await he.throw(new Error("A middleware yielded a message, but expected to only return a message for unary method"));continue}if(ge.value==null){ge=await he.throw(new Error("A middleware returned void, but expected to return a message for unary method"));continue}return ge.value}}}createUnaryMethod$1.createUnaryMethod=createUnaryMethod;Object.defineProperty(ClientFactory,"__esModule",{value:!0});ClientFactory.createClient=ClientFactory.createClientFactory=void 0;const nice_grpc_common_1=lib,service_definitions_1=serviceDefinitions,createBidiStreamingMethod_1=createBidiStreamingMethod$1,createClientStreamingMethod_1=createClientStreamingMethod$1,createServerStreamingMethod_1=createServerStreamingMethod$1,createUnaryMethod_1=createUnaryMethod$1;function createClientFactory(){return createClientFactoryWithMiddleware()}ClientFactory.createClientFactory=createClientFactory;function createClient(L,Z,X){return createClientFactory().create(L,Z,X)}ClientFactory.createClient=createClient;function createClientFactoryWithMiddleware(L){return{use(Z){return createClientFactoryWithMiddleware(L==null?Z:(0,nice_grpc_common_1.composeClientMiddleware)(L,Z))},create(Z,X,te={}){const ie={},oe=Object.entries((0,service_definitions_1.normalizeServiceDefinition)(Z));for(const[se,ue]of oe){const ce={...te["*"],...te[se]};ue.requestStream?ue.responseStream?ie[se]=(0,createBidiStreamingMethod_1.createBidiStreamingMethod)(ue,X,L,ce):ie[se]=(0,createClientStreamingMethod_1.createClientStreamingMethod)(ue,X,L,ce):ue.responseStream?ie[se]=(0,createServerStreamingMethod_1.createServerStreamingMethod)(ue,X,L,ce):ie[se]=(0,createUnaryMethod_1.createUnaryMethod)(ue,X,L,ce)}return ie}}}var Client={};Object.defineProperty(Client,"__esModule",{value:!0});(function(L){var Z=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(ie,oe,se,ue){ue===void 0&&(ue=se);var ce=Object.getOwnPropertyDescriptor(oe,se);(!ce||("get"in ce?!oe.__esModule:ce.writable||ce.configurable))&&(ce={enumerable:!0,get:function(){return oe[se]}}),Object.defineProperty(ie,ue,ce)}:function(ie,oe,se,ue){ue===void 0&&(ue=se),ie[ue]=oe[se]}),X=commonjsGlobal&&commonjsGlobal.__exportStar||function(ie,oe){for(var se in ie)se!=="default"&&!Object.prototype.hasOwnProperty.call(oe,se)&&Z(oe,ie,se)};Object.defineProperty(L,"__esModule",{value:!0}),L.Status=L.Metadata=L.composeClientMiddleware=L.ClientError=void 0;var te=lib;Object.defineProperty(L,"ClientError",{enumerable:!0,get:function(){return te.ClientError}}),Object.defineProperty(L,"composeClientMiddleware",{enumerable:!0,get:function(){return te.composeClientMiddleware}}),Object.defineProperty(L,"Metadata",{enumerable:!0,get:function(){return te.Metadata}}),Object.defineProperty(L,"Status",{enumerable:!0,get:function(){return te.Status}}),X(serviceDefinitions,L),X(channel,L),X(ClientFactory,L),X(Client,L)})(lib$1);function createBaseLinkedTwitterPair(){return{username:"",address:""}}var LinkedTwitterPair={encode(L,Z=_m0.Writer.create()){return L.username!==""&&Z.uint32(10).string(L.username),L.address!==""&&Z.uint32(18).string(L.address),Z},decode(L,Z){const X=L instanceof _m0.Reader?L:_m0.Reader.create(L);let te=Z===void 0?X.len:X.pos+Z;const ie=createBaseLinkedTwitterPair();for(;X.pos>>3){case 1:if(oe!=10)break;ie.username=X.string();continue;case 2:if(oe!=18)break;ie.address=X.string();continue}if((oe&7)==4||oe==0)break;X.skipType(oe&7)}return ie},create(L){return LinkedTwitterPair.fromPartial(L??{})},fromPartial(L){const Z=createBaseLinkedTwitterPair();return Z.username=L.username??"",Z.address=L.address??"",Z}};function createBaseDripRequest(){return{username:"",address:""}}var DripRequest={encode(L,Z=_m0.Writer.create()){return L.username!==""&&Z.uint32(10).string(L.username),L.address!==""&&Z.uint32(18).string(L.address),Z},decode(L,Z){const X=L instanceof _m0.Reader?L:_m0.Reader.create(L);let te=Z===void 0?X.len:X.pos+Z;const ie=createBaseDripRequest();for(;X.pos>>3){case 1:if(oe!=10)break;ie.username=X.string();continue;case 2:if(oe!=18)break;ie.address=X.string();continue}if((oe&7)==4||oe==0)break;X.skipType(oe&7)}return ie},create(L){return DripRequest.fromPartial(L??{})},fromPartial(L){const Z=createBaseDripRequest();return Z.username=L.username??"",Z.address=L.address??"",Z}};function createBaseDripDevRequest(){return{address:""}}var DripDevRequest={encode(L,Z=_m0.Writer.create()){return L.address!==""&&Z.uint32(10).string(L.address),Z},decode(L,Z){const X=L instanceof _m0.Reader?L:_m0.Reader.create(L);let te=Z===void 0?X.len:X.pos+Z;const ie=createBaseDripDevRequest();for(;X.pos>>3){case 1:if(oe!=10)break;ie.address=X.string();continue}if((oe&7)==4||oe==0)break;X.skipType(oe&7)}return ie},create(L){return DripDevRequest.fromPartial(L??{})},fromPartial(L){const Z=createBaseDripDevRequest();return Z.address=L.address??"",Z}};function createBaseDripResponse(){return{dripTxHash:"",ecsTxHash:""}}var DripResponse={encode(L,Z=_m0.Writer.create()){return L.dripTxHash!==""&&Z.uint32(10).string(L.dripTxHash),L.ecsTxHash!==""&&Z.uint32(18).string(L.ecsTxHash),Z},decode(L,Z){const X=L instanceof _m0.Reader?L:_m0.Reader.create(L);let te=Z===void 0?X.len:X.pos+Z;const ie=createBaseDripResponse();for(;X.pos>>3){case 1:if(oe!=10)break;ie.dripTxHash=X.string();continue;case 2:if(oe!=18)break;ie.ecsTxHash=X.string();continue}if((oe&7)==4||oe==0)break;X.skipType(oe&7)}return ie},create(L){return DripResponse.fromPartial(L??{})},fromPartial(L){const Z=createBaseDripResponse();return Z.dripTxHash=L.dripTxHash??"",Z.ecsTxHash=L.ecsTxHash??"",Z}};function createBaseTimeUntilDripResponse(){return{timeUntilDripMinutes:0,timeUntilDripSeconds:0}}var TimeUntilDripResponse={encode(L,Z=_m0.Writer.create()){return L.timeUntilDripMinutes!==0&&Z.uint32(9).double(L.timeUntilDripMinutes),L.timeUntilDripSeconds!==0&&Z.uint32(17).double(L.timeUntilDripSeconds),Z},decode(L,Z){const X=L instanceof _m0.Reader?L:_m0.Reader.create(L);let te=Z===void 0?X.len:X.pos+Z;const ie=createBaseTimeUntilDripResponse();for(;X.pos>>3){case 1:if(oe!=9)break;ie.timeUntilDripMinutes=X.double();continue;case 2:if(oe!=17)break;ie.timeUntilDripSeconds=X.double();continue}if((oe&7)==4||oe==0)break;X.skipType(oe&7)}return ie},create(L){return TimeUntilDripResponse.fromPartial(L??{})},fromPartial(L){const Z=createBaseTimeUntilDripResponse();return Z.timeUntilDripMinutes=L.timeUntilDripMinutes??0,Z.timeUntilDripSeconds=L.timeUntilDripSeconds??0,Z}};function createBaseGetLinkedTwittersRequest(){return{}}var GetLinkedTwittersRequest={encode(L,Z=_m0.Writer.create()){return Z},decode(L,Z){const X=L instanceof _m0.Reader?L:_m0.Reader.create(L);let te=Z===void 0?X.len:X.pos+Z;const ie=createBaseGetLinkedTwittersRequest();for(;X.pos>>3){case 1:if(oe!=10)break;ie.linkedTwitters.push(LinkedTwitterPair.decode(X,X.uint32()));continue}if((oe&7)==4||oe==0)break;X.skipType(oe&7)}return ie},create(L){return GetLinkedTwittersResponse.fromPartial(L??{})},fromPartial(L){const Z=createBaseGetLinkedTwittersResponse();return Z.linkedTwitters=L.linkedTwitters?.map(X=>LinkedTwitterPair.fromPartial(X))||[],Z}};function createBaseLinkedTwitterForAddressRequest(){return{address:""}}var LinkedTwitterForAddressRequest={encode(L,Z=_m0.Writer.create()){return L.address!==""&&Z.uint32(10).string(L.address),Z},decode(L,Z){const X=L instanceof _m0.Reader?L:_m0.Reader.create(L);let te=Z===void 0?X.len:X.pos+Z;const ie=createBaseLinkedTwitterForAddressRequest();for(;X.pos>>3){case 1:if(oe!=10)break;ie.address=X.string();continue}if((oe&7)==4||oe==0)break;X.skipType(oe&7)}return ie},create(L){return LinkedTwitterForAddressRequest.fromPartial(L??{})},fromPartial(L){const Z=createBaseLinkedTwitterForAddressRequest();return Z.address=L.address??"",Z}};function createBaseLinkedTwitterForAddressResponse(){return{username:""}}var LinkedTwitterForAddressResponse={encode(L,Z=_m0.Writer.create()){return L.username!==""&&Z.uint32(10).string(L.username),Z},decode(L,Z){const X=L instanceof _m0.Reader?L:_m0.Reader.create(L);let te=Z===void 0?X.len:X.pos+Z;const ie=createBaseLinkedTwitterForAddressResponse();for(;X.pos>>3){case 1:if(oe!=10)break;ie.username=X.string();continue}if((oe&7)==4||oe==0)break;X.skipType(oe&7)}return ie},create(L){return LinkedTwitterForAddressResponse.fromPartial(L??{})},fromPartial(L){const Z=createBaseLinkedTwitterForAddressResponse();return Z.username=L.username??"",Z}};function createBaseLinkedAddressForTwitterRequest(){return{username:""}}var LinkedAddressForTwitterRequest={encode(L,Z=_m0.Writer.create()){return L.username!==""&&Z.uint32(10).string(L.username),Z},decode(L,Z){const X=L instanceof _m0.Reader?L:_m0.Reader.create(L);let te=Z===void 0?X.len:X.pos+Z;const ie=createBaseLinkedAddressForTwitterRequest();for(;X.pos>>3){case 1:if(oe!=10)break;ie.username=X.string();continue}if((oe&7)==4||oe==0)break;X.skipType(oe&7)}return ie},create(L){return LinkedAddressForTwitterRequest.fromPartial(L??{})},fromPartial(L){const Z=createBaseLinkedAddressForTwitterRequest();return Z.username=L.username??"",Z}};function createBaseLinkedAddressForTwitterResponse(){return{address:""}}var LinkedAddressForTwitterResponse={encode(L,Z=_m0.Writer.create()){return L.address!==""&&Z.uint32(10).string(L.address),Z},decode(L,Z){const X=L instanceof _m0.Reader?L:_m0.Reader.create(L);let te=Z===void 0?X.len:X.pos+Z;const ie=createBaseLinkedAddressForTwitterResponse();for(;X.pos>>3){case 1:if(oe!=10)break;ie.address=X.string();continue}if((oe&7)==4||oe==0)break;X.skipType(oe&7)}return ie},create(L){return LinkedAddressForTwitterResponse.fromPartial(L??{})},fromPartial(L){const Z=createBaseLinkedAddressForTwitterResponse();return Z.address=L.address??"",Z}};function createBaseSetLinkedTwitterRequest(){return{address:"",username:"",signature:""}}var SetLinkedTwitterRequest={encode(L,Z=_m0.Writer.create()){return L.address!==""&&Z.uint32(10).string(L.address),L.username!==""&&Z.uint32(18).string(L.username),L.signature!==""&&Z.uint32(26).string(L.signature),Z},decode(L,Z){const X=L instanceof _m0.Reader?L:_m0.Reader.create(L);let te=Z===void 0?X.len:X.pos+Z;const ie=createBaseSetLinkedTwitterRequest();for(;X.pos>>3){case 1:if(oe!=10)break;ie.address=X.string();continue;case 2:if(oe!=18)break;ie.username=X.string();continue;case 3:if(oe!=26)break;ie.signature=X.string();continue}if((oe&7)==4||oe==0)break;X.skipType(oe&7)}return ie},create(L){return SetLinkedTwitterRequest.fromPartial(L??{})},fromPartial(L){const Z=createBaseSetLinkedTwitterRequest();return Z.address=L.address??"",Z.username=L.username??"",Z.signature=L.signature??"",Z}};function createBaseSetLinkedTwitterResponse(){return{}}var SetLinkedTwitterResponse={encode(L,Z=_m0.Writer.create()){return Z},decode(L,Z){const X=L instanceof _m0.Reader?L:_m0.Reader.create(L);let te=Z===void 0?X.len:X.pos+Z;const ie=createBaseSetLinkedTwitterResponse();for(;X.pos{if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function createFaucetService(L){return lib$1.createClient(FaucetServiceDefinition,lib$1.createChannel(L))}const worldsJson={4242:{address:"0x99323650ADEaE6E6c93A7Cae249982F58a5b6D3B",blockNumber:31046336},17001:{address:"0x2D6E6A6430F0121d6949D743DF54730b40C5c74F",blockNumber:665316},31337:{address:"0xe70f935c32dA4dB13e7876795f1e175465e6458e"}};var foundry$1={id:31337,name:"Foundry",network:"foundry",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["http://127.0.0.1:8545"],webSocket:["ws://127.0.0.1:8545"]},public:{http:["http://127.0.0.1:8545"],webSocket:["ws://127.0.0.1:8545"]}}};const foundry=defineChain(foundry$1);var t={name:"Lattice Testnet",id:4242,network:"lattice-testnet",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://follower.testnet-chain.linfra.xyz"],webSocket:["wss://follower.testnet-chain.linfra.xyz"]},public:{http:["https://follower.testnet-chain.linfra.xyz"],webSocket:["wss://follower.testnet-chain.linfra.xyz"]}},blockExplorers:{otterscan:{name:"Otterscan",url:"https://explorer.testnet-chain.linfra.xyz"},default:{name:"Otterscan",url:"https://explorer.testnet-chain.linfra.xyz"}},faucetUrl:"https://faucet.testnet-mud-services.linfra.xyz"},r={...foundry,fees:{defaultPriorityFee:0n}};const redStone={name:"Red Stone",id:17001,network:"red-stone",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.holesky.redstone.xyz"],webSocket:["wss://rpc.holesky.redstone.xyz/ws"]},public:{http:["https://rpc.holesky.redstone.xyz"],webSocket:["wss://rpc.holesky.redstone.xyz/ws"]}},blockExplorers:{otterscan:{name:"Otterscan",url:"https://explorer.holesky.redstone.xyz"},default:{name:"Otterscan",url:"https://explorer.holesky.redstone.xyz"}},faucetUrl:"https://faucet.testnet-mud-services.linfra.xyz"},supportedChains=[r,t,redStone],worlds=worldsJson;async function getNetworkConfig(){const L=new URLSearchParams(window.location.search),Z=Number(L.get("chainId")||L.get("chainid")||"31337"),X=supportedChains.findIndex(ue=>ue.id===Z),te=supportedChains[X];if(!te)throw new Error(`Chain ${Z} not found`);const ie=worlds[te.id.toString()],oe=L.get("worldAddress")||ie?.address;if(!oe)throw new Error(`No world address found for chain ${Z}. Did you run \`mud deploy\`?`);const se=L.has("initialBlockNumber")?Number(L.get("initialBlockNumber")):ie?.blockNumber??0n;return{privateKey:be$1(),chainId:Z,chain:te,faucetServiceUrl:L.get("faucet")??te.faucetUrl,worldAddress:oe,initialBlockNumber:se}}const world=Yt(),_abi=[{inputs:[{internalType:"string",name:"resource",type:"string"},{internalType:"address",name:"caller",type:"address"}],name:"AccessDenied",type:"error"},{inputs:[{internalType:"bytes4",name:"functionSelector",type:"bytes4"}],name:"FunctionSelectorExists",type:"error"},{inputs:[{internalType:"bytes4",name:"functionSelector",type:"bytes4"}],name:"FunctionSelectorNotFound",type:"error"},{inputs:[{internalType:"string",name:"resource",type:"string"}],name:"InvalidSelector",type:"error"},{inputs:[{internalType:"string",name:"module",type:"string"}],name:"ModuleAlreadyInstalled",type:"error"},{inputs:[{internalType:"string",name:"resource",type:"string"}],name:"ResourceExists",type:"error"},{inputs:[{internalType:"string",name:"resource",type:"string"}],name:"ResourceNotFound",type:"error"},{inputs:[{internalType:"uint256",name:"length",type:"uint256"},{internalType:"uint256",name:"received",type:"uint256"}],name:"StoreCore_DataIndexOverflow",type:"error"},{inputs:[{internalType:"uint256",name:"expected",type:"uint256"},{internalType:"uint256",name:"received",type:"uint256"}],name:"StoreCore_InvalidDataLength",type:"error"},{inputs:[{internalType:"uint256",name:"expected",type:"uint256"},{internalType:"uint256",name:"received",type:"uint256"}],name:"StoreCore_InvalidFieldNamesLength",type:"error"},{inputs:[{internalType:"uint256",name:"expected",type:"uint256"},{internalType:"uint256",name:"received",type:"uint256"}],name:"StoreCore_InvalidKeyNamesLength",type:"error"},{inputs:[],name:"StoreCore_NotDynamicField",type:"error"},{inputs:[],name:"StoreCore_NotImplemented",type:"error"},{inputs:[{internalType:"bytes32",name:"tableId",type:"bytes32"},{internalType:"string",name:"tableIdString",type:"string"}],name:"StoreCore_TableAlreadyExists",type:"error"},{inputs:[{internalType:"bytes32",name:"tableId",type:"bytes32"},{internalType:"string",name:"tableIdString",type:"string"}],name:"StoreCore_TableNotFound",type:"error"},{inputs:[{internalType:"address",name:"system",type:"address"}],name:"SystemExists",type:"error"},{anonymous:!1,inputs:[],name:"HelloWorld",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"table",type:"bytes32"},{indexed:!1,internalType:"bytes32[]",name:"key",type:"bytes32[]"}],name:"StoreDeleteRecord",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"table",type:"bytes32"},{indexed:!1,internalType:"bytes32[]",name:"key",type:"bytes32[]"},{indexed:!1,internalType:"bytes",name:"data",type:"bytes"}],name:"StoreEphemeralRecord",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"table",type:"bytes32"},{indexed:!1,internalType:"bytes32[]",name:"key",type:"bytes32[]"},{indexed:!1,internalType:"uint8",name:"schemaIndex",type:"uint8"},{indexed:!1,internalType:"bytes",name:"data",type:"bytes"}],name:"StoreSetField",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"table",type:"bytes32"},{indexed:!1,internalType:"bytes32[]",name:"key",type:"bytes32[]"},{indexed:!1,internalType:"bytes",name:"data",type:"bytes"}],name:"StoreSetRecord",type:"event"},{inputs:[],name:"acceptTrade",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"askStart",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"resourceSelector",type:"bytes32"},{internalType:"bytes",name:"funcSelectorAndArgs",type:"bytes"}],name:"call",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"payable",type:"function"},{inputs:[],name:"checkDebt",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"str",type:"string"},{internalType:"uint256",name:"num",type:"uint256"}],name:"concatenate",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"},{internalType:"bytes32[]",name:"key",type:"bytes32[]"},{internalType:"Schema",name:"valueSchema",type:"bytes32"}],name:"deleteRecord",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"},{internalType:"bytes32[]",name:"key",type:"bytes32[]"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"Schema",name:"valueSchema",type:"bytes32"}],name:"emitEphemeralRecord",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"findPartner",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"finishGame",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"},{internalType:"bytes32[]",name:"key",type:"bytes32[]"},{internalType:"uint8",name:"schemaIndex",type:"uint8"},{internalType:"Schema",name:"valueSchema",type:"bytes32"}],name:"getField",outputs:[{internalType:"bytes",name:"data",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"},{internalType:"bytes32[]",name:"key",type:"bytes32[]"},{internalType:"uint8",name:"schemaIndex",type:"uint8"},{internalType:"Schema",name:"valueSchema",type:"bytes32"}],name:"getFieldLength",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"},{internalType:"bytes32[]",name:"key",type:"bytes32[]"},{internalType:"uint8",name:"schemaIndex",type:"uint8"},{internalType:"Schema",name:"valueSchema",type:"bytes32"},{internalType:"uint256",name:"start",type:"uint256"},{internalType:"uint256",name:"end",type:"uint256"}],name:"getFieldSlice",outputs:[{internalType:"bytes",name:"data",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"}],name:"getKeySchema",outputs:[{internalType:"Schema",name:"schema",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"},{internalType:"bytes32[]",name:"key",type:"bytes32[]"},{internalType:"Schema",name:"valueSchema",type:"bytes32"}],name:"getRecord",outputs:[{internalType:"bytes",name:"data",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"}],name:"getValueSchema",outputs:[{internalType:"Schema",name:"schema",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"resourceSelector",type:"bytes32"},{internalType:"address",name:"grantee",type:"address"}],name:"grantAccess",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"increment",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IModule",name:"module",type:"address"},{internalType:"bytes",name:"args",type:"bytes"}],name:"installModule",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IModule",name:"module",type:"address"},{internalType:"bytes",name:"args",type:"bytes"}],name:"installRootModule",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"joinGame",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"targetX",type:"uint256"},{internalType:"uint256",name:"targetY",type:"uint256"}],name:"move",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"pay",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint8",name:"assetKind",type:"uint8"}],name:"pickAsset",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"pickCoin",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint8",name:"cardId",type:"uint8"}],name:"pickFund",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"},{internalType:"bytes32[]",name:"key",type:"bytes32[]"},{internalType:"uint8",name:"schemaIndex",type:"uint8"},{internalType:"uint256",name:"byteLengthToPop",type:"uint256"},{internalType:"Schema",name:"valueSchema",type:"bytes32"}],name:"popFromField",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"},{internalType:"bytes32[]",name:"key",type:"bytes32[]"},{internalType:"uint8",name:"schemaIndex",type:"uint8"},{internalType:"bytes",name:"dataToPush",type:"bytes"},{internalType:"Schema",name:"valueSchema",type:"bytes32"}],name:"pushToField",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"resourceSelector",type:"bytes32"},{internalType:"string",name:"systemFunctionName",type:"string"},{internalType:"string",name:"systemFunctionArguments",type:"string"}],name:"registerFunctionSelector",outputs:[{internalType:"bytes4",name:"worldFunctionSelector",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes16",name:"namespace",type:"bytes16"}],name:"registerNamespace",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"resourceSelector",type:"bytes32"},{internalType:"bytes4",name:"worldFunctionSelector",type:"bytes4"},{internalType:"bytes4",name:"systemFunctionSelector",type:"bytes4"}],name:"registerRootFunctionSelector",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"},{internalType:"contract IStoreHook",name:"hook",type:"address"}],name:"registerStoreHook",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"resourceSelector",type:"bytes32"},{internalType:"contract System",name:"system",type:"address"},{internalType:"bool",name:"publicAccess",type:"bool"}],name:"registerSystem",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"resourceSelector",type:"bytes32"},{internalType:"contract ISystemHook",name:"hook",type:"address"}],name:"registerSystemHook",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"},{internalType:"Schema",name:"keySchema",type:"bytes32"},{internalType:"Schema",name:"valueSchema",type:"bytes32"},{internalType:"string[]",name:"keyNames",type:"string[]"},{internalType:"string[]",name:"fieldNames",type:"string[]"}],name:"registerTable",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"rejectTrade",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"restartGame",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"resourceSelector",type:"bytes32"},{internalType:"address",name:"grantee",type:"address"}],name:"revokeAccess",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"},{internalType:"bytes32[]",name:"key",type:"bytes32[]"},{internalType:"uint8",name:"schemaIndex",type:"uint8"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"Schema",name:"valueSchema",type:"bytes32"}],name:"setField",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"},{internalType:"bytes32[]",name:"key",type:"bytes32[]"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"Schema",name:"valueSchema",type:"bytes32"}],name:"setRecord",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"targetPlayer",type:"bytes32"},{internalType:"uint8",name:"assetKind",type:"uint8"},{internalType:"uint32",name:"money",type:"uint32"}],name:"trade",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"},{internalType:"bytes32[]",name:"key",type:"bytes32[]"},{internalType:"uint8",name:"schemaIndex",type:"uint8"},{internalType:"uint256",name:"startByteIndex",type:"uint256"},{internalType:"bytes",name:"dataToSet",type:"bytes"},{internalType:"Schema",name:"valueSchema",type:"bytes32"}],name:"updateInField",outputs:[],stateMutability:"nonpayable",type:"function"}];class IWorld__factory{static createInterface(){return new Interface(_abi)}static connect(Z,X){return new Contract(Z,_abi,X)}}IWorld__factory.abi=_abi;const mudConfig=s({enums:{},modules:[{name:"UniqueEntityModule",root:!0,args:[]},{name:"KeysInTableModule",root:!0,args:[ee("Player")]},{name:"KeysWithValueModule",root:!0,args:[ee("Player")]},{name:"KeysInTableModule",root:!0,args:[ee("MapItem")]},{name:"KeysWithValueModule",root:!0,args:[ee("MapItem")]}],tables:{Counter:{keySchema:{},schema:"uint32"},Game:{keySchema:{},schema:{gameId:"uint256",startTime:"uint256",endTime:"uint256",finishTime:"uint256"}},GameState:{keySchema:{},schema:"uint32"},GameMap:{keySchema:{},schema:{width:"uint256",height:"uint256",mapArray:"bytes"}},FundCards:{keySchema:{},schema:{allCard:"uint16[72]"}},FundPool:{keySchema:{},schema:{placeHolder:"uint256",array:"uint16[9]"}},MapItem:{schema:{x:"uint256",y:"uint256"}},MapItemValue:{schema:"uint32"},IsPlayer:{dataStruct:!1,schema:"bool"},Player:{dataStruct:!0,schema:{gameId:"uint256",state:"uint32",money:"uint32",x:"uint256",y:"uint256"}},RaiseColddown:{dataStruct:!0,schema:{start:"uint256",end:"uint256"}},AssetsList:{dataStruct:!0,schema:{gpu:"int8",bitcoin:"int8",battery:"int8",leiter:"int8",gold:"int8",oil:"int8"}},OwnedCards:{schema:{array:"uint256[]"}},HasDebt:{schema:"bool"},Debt:{schema:"uint32"},Log:{dataStruct:!0,schema:"uint256"},TransactionList:{dataStruct:!0,schema:{list:"bytes32[]"}},TradeList:{dataStruct:!0,schema:{list:"bytes"}},IsTrading:{dataStruct:!1,schema:"bool"},PlayerGameResult:{dataStruct:!0,schema:{rank:"int32",points:"int32",gpu:"int8",bitcoin:"int8",battery:"int8",leiter:"int8",gold:"int8",oil:"int8"}},IsEliminated:{schema:"bool"},UnsolicitedTransaction:{dataStruct:!0,schema:{asset:"uint8",money:"uint32",to:"bytes32"}},PassiveTransaction:{dataStruct:!0,schema:{asset:"uint8",money:"uint32",from:"bytes32"}}}});async function setupNetwork(){const L=await getNetworkConfig(),Z={chain:L.chain,transport:Ee(fallback([webSocket(),http()])),pollingInterval:1e3},X=createPublicClient(Z),te=J(L.privateKey),ie=createWalletClient({...Z,account:te}),oe=new Subject,se=me({address:L.worldAddress,abi:IWorld__factory.abi,publicClient:X,walletClient:ie,onWrite:he=>oe.next(he)}),{components:ue,latestBlock$:ce,blockStorageOperations$:le,waitForTransaction:de}=await ae({world,config:mudConfig,address:L.worldAddress,publicClient:X,startBlock:BigInt(L.initialBlockNumber)});if(L.faucetServiceUrl){const he=te.address;console.info("[Dev Faucet]: Player address -> ",he);const ge=createFaucetService(L.faucetServiceUrl),_e=async()=>{const Ae=await X.getBalance({address:he});console.info(`[Dev Faucet]: Player balance -> ${Ae}`),Ae{const[Z,X]=L.value;console.log("GameState updated",L,{nextValue:Z,prevValue:X}),globalThis.ponzi.gameState=Z?Z.value:null,globalThis.ponzi.gamestate_update?.(X?.value,Z?.value)});components.SyncProgress.update$.subscribe(L=>{console.log("onSyncProgressUpdate:",L),globalThis.ponzi.percentage=L.value[0].percentage/100,globalThis.ponzi.syncprogress_update?.(globalThis.ponzi.percentage)});components.Game.update$.subscribe(L=>{const[Z,X]=L.value;console.log("Game updated",L,{nextValue:Z,prevValue:X}),globalThis.ponzi.game=Z,globalThis.ponzi.game_update?.(X,Z)});components.Player.update$.subscribe(L=>{const[Z,X]=L.value;console.log("Player updated",L,{nextValue:Z,prevValue:X}),globalThis.ponzi.player_update?.(L)});components.GameMap.update$.subscribe(L=>{const[Z,X]=L.value;console.log("GameMap updated",{nextValue:Z,prevValue:X}),globalThis.ponzi.gameMap=Z,globalThis.ponzi.gamemap_update?.(X,Z)});components.FundPool.update$.subscribe(L=>{L.value,console.log("FundPool updated",L),globalThis.ponzi.fundpool_update?.(L)});components.MapItem.update$.subscribe(L=>{const[Z,X]=L.value;globalThis.ponzi.mapitems_update?.(X,Z)});components.IsPlayer.update$.subscribe(L=>{L.value,console.log("IsPlayer updated",L),globalThis.ponzi.isplayer_update?.(L)});components.IsEliminated.update$.subscribe(L=>{L.value,console.log("IsEliminated updated",L),globalThis.ponzi.iseliminated_update?.(L)});components.OwnedCards.update$.subscribe(L=>{L.value,console.log("OwnedCards updated",L)});components.TransactionList.update$.subscribe(L=>{const[Z,X]=L.value;console.log("TransactionList updated",L),globalThis.ponzi.transactionList=Z,globalThis.ponzi.transactionlist_update?.(L)});components.Log.update$.subscribe(L=>{L.value,console.log("Log updated",L)});components.AssetsList.update$.subscribe(L=>{L.value,console.log("AssetsList updated",L),globalThis.ponzi.assetslist_update?.(L)});components.RaiseColddown.update$.subscribe(L=>{L.value,console.log("RaiseColddown updated",L),globalThis.ponzi.raiseColddown_update?.(L)});components.PassiveTransaction.update$.subscribe(L=>{L.value,console.log("PassiveTransaction updated",L),globalThis.ponzi.passivetransaction_update?.(L)});components.TradeList.update$.subscribe(L=>{L.value,console.log("TradeList updated",L),globalThis.ponzi.tradelist_update?.(L)});components.PlayerGameResult.update$.subscribe(L=>{L.value,console.log("PlayerGameResult updated",L),globalThis.ponzi.playergameresult_update?.(L)});components.HasDebt.update$.subscribe(L=>{L.value,console.log("HasDebt updated",L),globalThis.ponzi.hasdebt_update?.(L)});components.TransactionList.update$.subscribe(L=>{L.value,console.log("TransactionList updated",L),globalThis.ponzi.transactionlist_update?.(L)});window.getPlayers=()=>components.Player.values;window.getIsPlayers=()=>components.IsPlayer.values;window.getMapItems=()=>components.MapItem.values;window.getAssetsList=()=>components.AssetsList.values;window.getTransactionList=()=>components.TransactionList.values;window.getFundPool=()=>components.FundPool.values;window.queryValue=async(L,Z)=>{const X=De(L,Z);return console.log("getValueByComAndEntity:",X),X};window.queryPlayingAssetsList=async()=>z$3([Ft(components.AssetsList),Ft(components.Player)]);window.queryResultAssetsList=async()=>z$3([Ft(components.AssetsList),Qt(components.IsEliminated)]);window.increment=async()=>{let L=await increment();return console.log("new counter value:",L),L};window.joinGame=async()=>{let L=await joinGame();return console.log("joinGame:",L),L};window.askStart=async()=>{let L=await askStart();return console.log("askStart:",L),L};window.move=async(L,Z)=>{let X=await move(L,Z);return console.log("move:",X),X};window.pickAsset=async L=>{console.log("send pickAsset:",L),await pickAsset(L)};window.pickFund=async L=>{console.log("send pickFund:",L),await pickFund(L)};window.trade=async(L,Z,X)=>{console.log("send trade:",L,X,Z),await trade(L,Z,X)};window.acceptTrade=async()=>{let L=await acceptTrade();console.log("send acceptTrade:"+L)};window.rejectTrade=async()=>{let L=await rejectTrade();console.log("send rejectTrade:"+L)};window.finishGame=async()=>{console.log("send finishGame"),await finishGame()};window.pickCoin=async()=>{console.log("send pickCoin...");let L=await pickCoin();console.log("send pickCoin data:"+L)};window.searchPartner=async()=>{console.log("send searchPartner..."),await findPartner()};window.payDebt=async()=>{console.log("send pay..."),await pay()};window.restartGame=async()=>{console.log("send restartGame..."),await restartGame()};window.checkDebt=async()=>{console.log("send checkDebt..."),await checkDebt()};{const{mount:L}=await __vitePreload(()=>import("./index-a13e0f4b.js"),[]);console.log("============================"),L({config:mudConfig,publicClient:network.publicClient,walletClient:network.walletClient,latestBlock$:network.latestBlock$,blockStorageOperations$:network.blockStorageOperations$,worldAddress:network.worldContract.address,worldAbi:network.worldContract.abi,write$:network.write$,recsWorld:network.world})}window.mudutils={};window.mudutils.hexToArray=function(L,Z,X){const te=Array.from(K$2(X)).map((oe,se)=>oe),ie=[];for(let oe=0;oe{if(L.aborted){te(new AbortError);return}let ie,oe=!1;function se(){oe||(oe=!0,ie?.())}const ue=Z(ce=>{X(ce),se()},ce=>{te(ce),se()});if(!oe){const ce=()=>{const le=ue();le==null?te(new AbortError):le.then(()=>{te(new AbortError)},de=>{te(de)}),se()};L.addEventListener("abort",ce),ie=()=>{L.removeEventListener("abort",ce)}}})}function abortable(L,Z){if(L.aborted){const X=()=>{};Z.then(X,X)}return execute(L,(X,te)=>(Z.then(X,te),()=>{}))}function delay(L,Z){return execute(L,X=>{const te=typeof Z=="number"?Z:Z.getTime()-Date.now(),ie=setTimeout(X,te);return()=>{clearTimeout(ie)}})}function forever(L){return execute(L,()=>()=>{})}function waitForEvent(L,Z,X,te){return execute(L,ie=>{let oe,se=!1;return oe=listen(Z,X,(...ce)=>{ie(ce.length>1?ce:ce[0]),se=!0,oe?.()},te),se&&oe(),()=>{se=!0,oe?.()}})}function listen(L,Z,X,te){if(isEventTarget(L))return L.addEventListener(Z,X,te),()=>L.removeEventListener(Z,X,te);if(isJQueryStyleEventEmitter(L))return L.on(Z,X),()=>L.off(Z,X);if(isNodeStyleEventEmitter(L))return L.addListener(Z,X),()=>L.removeListener(Z,X);throw new Error("Invalid event target")}function isNodeStyleEventEmitter(L){return isFunction(L.addListener)&&isFunction(L.removeListener)}function isJQueryStyleEventEmitter(L){return isFunction(L.on)&&isFunction(L.off)}function isEventTarget(L){return isFunction(L.addEventListener)&&isFunction(L.removeEventListener)}const isFunction=L=>typeof L=="function";function all(L,Z){return new Promise((X,te)=>{if(L.aborted){te(new AbortError);return}const ie=new AbortController,oe=Z(ie.signal);if(oe.length===0){X([]);return}const se=()=>{ie.abort()};L.addEventListener("abort",se);let ue;const ce=new Array(oe.length);let le=0;function de(){le+=1,le===oe.length&&(L.removeEventListener("abort",se),ue!=null?te(ue.reason):X(ce))}for(const[he,ge]of oe.entries())ge.then(_e=>{ce[he]=_e,de()},_e=>{ie.abort(),(ue==null||!isAbortError(_e)&&isAbortError(ue.reason))&&(ue={reason:_e}),de()})})}function race(L,Z){return new Promise((X,te)=>{if(L.aborted){te(new AbortError);return}const ie=new AbortController,oe=Z(ie.signal),se=()=>{ie.abort()};L.addEventListener("abort",se);let ue=0;function ce(de){ie.abort(),ue+=1,ue===oe.length&&(L.removeEventListener("abort",se),de.status==="fulfilled"?X(de.value):te(de.reason))}let le;for(const de of oe)de.then(he=>{le==null&&(le={status:"fulfilled",value:he}),ce(le)},he=>{(le==null||!isAbortError(he)&&(le.status==="fulfilled"||isAbortError(le.reason)))&&(le={status:"rejected",reason:he}),ce(le)})})}async function retry(L,Z,X={}){const{baseMs:te=1e3,maxDelayMs:ie=3e4,onError:oe,maxAttempts:se=1/0}=X;let ue=0;const ce=()=>{ue=-1};for(;;)try{return await Z(L,ue,ce)}catch(le){if(rethrowAbortError(le),ue>=se)throw le;let de;if(ue===-1)de=0;else{const he=Math.min(ie,Math.pow(2,ue)*te);de=Math.round(he*(1+Math.random())/2)}oe&&oe(le,ue,de),de!==0&&await delay(L,de),ue+=1}}function spawn(L,Z){if(L.aborted)return Promise.reject(new AbortError);const X=[],te=new AbortController,ie=te.signal,oe=()=>{te.abort()};L.addEventListener("abort",oe);const se=()=>{L.removeEventListener("abort",oe)},ue=new Set,ce=()=>{for(const he of ue)he.abort()};ie.addEventListener("abort",ce);const le=()=>{ie.removeEventListener("abort",ce)};let de=new Promise((he,ge)=>{let _e,Ae;xe(Ie=>Z(Ie,{defer(Pe){X.push(Pe)},fork:xe})).join().then(Ie=>{te.abort(),_e={value:Ie}},Ie=>{te.abort(),(!isAbortError(Ie)||Ae==null)&&(Ae={error:Ie})});function xe(Ie){if(ie.aborted)return{abort(){},async join(){throw new AbortError}};const Pe=new AbortController,Ce=Pe.signal,Be=Ie(Ce),Ve={abort(){Pe.abort()},join:()=>Be};return ue.add(Ve),Be.catch(catchAbortError).catch(Ge=>{Ae={error:Ge},te.abort()}).finally(()=>{ue.delete(Ve),ue.size===0&&(Ae!=null?ge(Ae.error):he(_e.value))}),Ve}});return de=de.finally(()=>{se(),le();let he=Promise.resolve();for(let ge=X.length-1;ge>=0;ge--)he=he.finally(X[ge]);return he}),de}function run(L){const Z=new AbortController,X=L(Z.signal).catch(catchAbortError);return()=>(Z.abort(),X)}function proactiveRetry(L,Z,X={}){const{baseMs:te=1e3,onError:ie,maxAttempts:oe=1/0}=X;return execute(L,(se,ue)=>{const ce=new AbortController;let le=!1;const de=new Map;function he(Ae){ce.abort(),de.clear(),se(Ae)}function ge(Ae,xe){if(de.delete(xe),le&&de.size===0){ue(Ae);return}if(!isAbortError(Ae)&&ie)try{ie(Ae,xe)}catch(Ie){ce.abort(),de.clear(),ue(Ie)}}async function _e(Ae){for(let xe=0;;xe++){const Ie=Z(Ae,xe);if(de.set(xe,Ie),Ie.then(he,Be=>ge(Be,xe)),xe+1>=oe)break;const Pe=Math.pow(2,xe)*te,Ce=Math.round(Pe*(1+Math.random())/2);await delay(Ae,Ce)}le=!0}return _e(ce.signal).catch(catchAbortError),()=>{ce.abort()}})}const es=Object.freeze(Object.defineProperty({__proto__:null,AbortError,abortable,all,catchAbortError,delay,execute,forever,isAbortError,proactiveRetry,race,rethrowAbortError,retry,run,spawn,throwIfAborted,waitForEvent},Symbol.toStringTag,{value:"Module"})),require$$2=getAugmentedNamespace(es);var AsyncSink$1={};Object.defineProperty(AsyncSink$1,"__esModule",{value:!0});AsyncSink$1.AsyncSink=void 0;const ARRAY_VALUE="value",ARRAY_ERROR="error";class AsyncSink{constructor(){this._ended=!1,this._values=[],this._resolvers=[]}[Symbol.asyncIterator](){return this}write(Z){this._push({type:ARRAY_VALUE,value:Z})}error(Z){this._push({type:ARRAY_ERROR,error:Z})}_push(Z){if(this._ended)throw new Error("AsyncSink already ended");if(this._resolvers.length>0){const{resolve:X,reject:te}=this._resolvers.shift();Z.type===ARRAY_ERROR?te(Z.error):X({done:!1,value:Z.value})}else this._values.push(Z)}next(){if(this._values.length>0){const{type:Z,value:X,error:te}=this._values.shift();return Z===ARRAY_ERROR?Promise.reject(te):Promise.resolve({done:!1,value:X})}return this._ended?Promise.resolve({done:!0}):new Promise((Z,X)=>{this._resolvers.push({resolve:Z,reject:X})})}end(){for(;this._resolvers.length>0;)this._resolvers.shift().resolve({done:!0});this._ended=!0}}AsyncSink$1.AsyncSink=AsyncSink;var isAsyncIterable$1={};Object.defineProperty(isAsyncIterable$1,"__esModule",{value:!0});isAsyncIterable$1.isAsyncIterable=void 0;function isAsyncIterable(L){return L!=null&&Symbol.asyncIterator in L}isAsyncIterable$1.isAsyncIterable=isAsyncIterable;var convertMetadata={},base64Exports={},base64={get exports(){return base64Exports},set exports(L){base64Exports=L}};(function(L,Z){(function(X,te){L.exports=te()})(typeof self<"u"?self:typeof window<"u"?window:commonjsGlobal,function(){var X="3.7.5",te=X,ie=typeof atob=="function",oe=typeof btoa=="function",se=typeof Buffer=="function",ue=typeof TextDecoder=="function"?new TextDecoder:void 0,ce=typeof TextEncoder=="function"?new TextEncoder:void 0,le="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",de=Array.prototype.slice.call(le),he=function(Ue){var qe={};return Ue.forEach(function(Xe,nt){return qe[Xe]=nt}),qe}(de),ge=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,_e=String.fromCharCode.bind(String),Ae=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):function(Ue){return new Uint8Array(Array.prototype.slice.call(Ue,0))},xe=function(Ue){return Ue.replace(/=/g,"").replace(/[+\/]/g,function(qe){return qe=="+"?"-":"_"})},Ie=function(Ue){return Ue.replace(/[^A-Za-z0-9\+\/]/g,"")},Pe=function(Ue){for(var qe,Xe,nt,tt,Qe="",ft=Ue.length%3,rt=0;rt255||(nt=Ue.charCodeAt(rt++))>255||(tt=Ue.charCodeAt(rt++))>255)throw new TypeError("invalid character found");qe=Xe<<16|nt<<8|tt,Qe+=de[qe>>18&63]+de[qe>>12&63]+de[qe>>6&63]+de[qe&63]}return ft?Qe.slice(0,ft-3)+"===".substring(ft):Qe},Ce=oe?function(Ue){return btoa(Ue)}:se?function(Ue){return Buffer.from(Ue,"binary").toString("base64")}:Pe,Be=se?function(Ue){return Buffer.from(Ue).toString("base64")}:function(Ue){for(var qe=4096,Xe=[],nt=0,tt=Ue.length;nt>>6)+_e(128|qe&63):_e(224|qe>>>12&15)+_e(128|qe>>>6&63)+_e(128|qe&63)}else{var qe=65536+(Ue.charCodeAt(0)-55296)*1024+(Ue.charCodeAt(1)-56320);return _e(240|qe>>>18&7)+_e(128|qe>>>12&63)+_e(128|qe>>>6&63)+_e(128|qe&63)}},Ke=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Je=function(Ue){return Ue.replace(Ke,Ge)},et=se?function(Ue){return Buffer.from(Ue,"utf8").toString("base64")}:ce?function(Ue){return Be(ce.encode(Ue))}:function(Ue){return Ce(Je(Ue))},at=function(Ue,qe){return qe===void 0&&(qe=!1),qe?xe(et(Ue)):et(Ue)},dt=function(Ue){return at(Ue,!0)},st=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,ht=function(Ue){switch(Ue.length){case 4:var qe=(7&Ue.charCodeAt(0))<<18|(63&Ue.charCodeAt(1))<<12|(63&Ue.charCodeAt(2))<<6|63&Ue.charCodeAt(3),Xe=qe-65536;return _e((Xe>>>10)+55296)+_e((Xe&1023)+56320);case 3:return _e((15&Ue.charCodeAt(0))<<12|(63&Ue.charCodeAt(1))<<6|63&Ue.charCodeAt(2));default:return _e((31&Ue.charCodeAt(0))<<6|63&Ue.charCodeAt(1))}},Fe=function(Ue){return Ue.replace(st,ht)},pe=function(Ue){if(Ue=Ue.replace(/\s+/g,""),!ge.test(Ue))throw new TypeError("malformed base64.");Ue+="==".slice(2-(Ue.length&3));for(var qe,Xe="",nt,tt,Qe=0;Qe>16&255):tt===64?_e(qe>>16&255,qe>>8&255):_e(qe>>16&255,qe>>8&255,qe&255);return Xe},we=ie?function(Ue){return atob(Ie(Ue))}:se?function(Ue){return Buffer.from(Ue,"base64").toString("binary")}:pe,$e=se?function(Ue){return Ae(Buffer.from(Ue,"base64"))}:function(Ue){return Ae(we(Ue).split("").map(function(qe){return qe.charCodeAt(0)}))},Oe=function(Ue){return $e(Ze(Ue))},Me=se?function(Ue){return Buffer.from(Ue,"base64").toString("utf8")}:ue?function(Ue){return ue.decode($e(Ue))}:function(Ue){return Fe(we(Ue))},Ze=function(Ue){return Ie(Ue.replace(/[-_]/g,function(qe){return qe=="-"?"+":"/"}))},We=function(Ue){return Me(Ze(Ue))},Ne=function(Ue){if(typeof Ue!="string")return!1;var qe=Ue.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(qe)||!/[^\s0-9a-zA-Z\-_]/.test(qe)},ve=function(Ue){return{value:Ue,enumerable:!1,writable:!0,configurable:!0}},Le=function(){var Ue=function(qe,Xe){return Object.defineProperty(String.prototype,qe,ve(Xe))};Ue("fromBase64",function(){return We(this)}),Ue("toBase64",function(qe){return at(this,qe)}),Ue("toBase64URI",function(){return at(this,!0)}),Ue("toBase64URL",function(){return at(this,!0)}),Ue("toUint8Array",function(){return Oe(this)})},it=function(){var Ue=function(qe,Xe){return Object.defineProperty(Uint8Array.prototype,qe,ve(Xe))};Ue("toBase64",function(qe){return Ve(this,qe)}),Ue("toBase64URI",function(){return Ve(this,!0)}),Ue("toBase64URL",function(){return Ve(this,!0)})},Te=function(){Le(),it()},Ye={version:X,VERSION:te,atob:we,atobPolyfill:pe,btoa:Ce,btoaPolyfill:Pe,fromBase64:We,toBase64:at,encode:at,encodeURI:dt,encodeURL:dt,utob:Je,btou:Fe,decode:We,isValid:Ne,fromUint8Array:Ve,toUint8Array:Oe,extendString:Le,extendUint8Array:it,extendBuiltins:Te};return Ye.Base64={},Object.keys(Ye).forEach(function(Ue){return Ye.Base64[Ue]=Ye[Ue]}),Ye})})(base64);Object.defineProperty(convertMetadata,"__esModule",{value:!0});convertMetadata.convertMetadataFromGrpcWeb=convertMetadata.convertMetadataToGrpcWeb=void 0;const grpc_web_1$4=grpcWebClient_umdExports,nice_grpc_common_1$5=lib,js_base64_1=base64Exports;function convertMetadataToGrpcWeb(L){const Z=new grpc_web_1$4.grpc.Metadata;for(const[X,te]of L)for(const ie of te)Z.append(X,typeof ie=="string"?ie:js_base64_1.Base64.fromUint8Array(ie));return Z}convertMetadata.convertMetadataToGrpcWeb=convertMetadataToGrpcWeb;function convertMetadataFromGrpcWeb(L){const Z=(0,nice_grpc_common_1$5.Metadata)();for(const[X,te]of Object.entries(L.headersMap))if(X.endsWith("-bin"))for(const ie of te)for(const oe of ie.split(/,\s?/))Z.append(X,js_base64_1.Base64.toUint8Array(oe));else Z.set(X,te);return Z}convertMetadata.convertMetadataFromGrpcWeb=convertMetadataFromGrpcWeb;Object.defineProperty(createBidiStreamingMethod$1,"__esModule",{value:!0});createBidiStreamingMethod$1.createBidiStreamingMethod=void 0;const nice_grpc_common_1$4=lib,grpc_web_1$3=grpcWebClient_umdExports,abort_controller_x_1$3=require$$2,AsyncSink_1$1=AsyncSink$1,service_definitions_1$4=serviceDefinitions,isAsyncIterable_1$3=isAsyncIterable$1,convertMetadata_1$3=convertMetadata;function createBidiStreamingMethod(L,Z,X,te){const ie=(0,service_definitions_1$4.toGrpcWebMethodDefinition)(L),oe={path:L.path,requestStream:L.requestStream,responseStream:L.responseStream,options:L.options};async function*se(ce,le){if(!(0,isAsyncIterable_1$3.isAsyncIterable)(ce))throw new Error("A middleware passed invalid request to next(): expected a single message for bidirectional streaming method");const{metadata:de=(0,nice_grpc_common_1$4.Metadata)(),signal:he=new AbortController().signal,onHeader:ge,onTrailer:_e}=le,Ae=new AbortController,xe=new AsyncSink_1$1.AsyncSink,Ie=grpc_web_1$3.grpc.client(ie,{host:Z.address,transport:Z.transport});Ie.onHeaders(Be=>{ge?.((0,convertMetadata_1$3.convertMetadataFromGrpcWeb)(Be))}),Ie.onMessage(Be=>{xe.write(Be)}),Ie.onEnd((Be,Ve,Ge)=>{_e?.((0,convertMetadata_1$3.convertMetadataFromGrpcWeb)(Ge)),Be===grpc_web_1$3.grpc.Code.OK?xe.end():xe.error(new nice_grpc_common_1$4.ClientError(L.path,+Be,Ve))}),Ie.start((0,convertMetadata_1$3.convertMetadataToGrpcWeb)(de));let Pe;pipeRequest$1(Ae.signal,ce,Ie,L).then(()=>{Ie.finishSend()},Be=>{(0,abort_controller_x_1$3.isAbortError)(Be)||(Pe=Be,Ie.close(),xe.end())});const Ce=()=>{xe.error(new abort_controller_x_1$3.AbortError),Ae.abort(),Ie.close()};he.addEventListener("abort",Ce);try{yield*xe}finally{if(Ae.abort(),he.removeEventListener("abort",Ce),(0,abort_controller_x_1$3.throwIfAborted)(he),Pe)throw Pe}}const ue=X==null?se:(ce,le)=>X({method:oe,requestStream:!0,request:ce,responseStream:!0,next:se},le);return(ce,le)=>{const he=ue(ce,{...te,...le})[Symbol.asyncIterator]();return{[Symbol.asyncIterator](){return{async next(){const ge=await he.next();return ge.done&&ge.value!=null?await he.throw(new Error("A middleware returned a message, but expected to return void for bidirectional streaming method")):ge},return(){return he.return()},throw(ge){return he.throw(ge)}}}}}}createBidiStreamingMethod$1.createBidiStreamingMethod=createBidiStreamingMethod;async function pipeRequest$1(L,Z,X,te){for await(const ie of Z)(0,abort_controller_x_1$3.throwIfAborted)(L),X.send({serializeBinary:()=>te.requestSerialize(ie)})}var createClientStreamingMethod$1={};Object.defineProperty(createClientStreamingMethod$1,"__esModule",{value:!0});createClientStreamingMethod$1.createClientStreamingMethod=void 0;const nice_grpc_common_1$3=lib,grpc_web_1$2=grpcWebClient_umdExports,abort_controller_x_1$2=require$$2,service_definitions_1$3=serviceDefinitions,isAsyncIterable_1$2=isAsyncIterable$1,convertMetadata_1$2=convertMetadata;function createClientStreamingMethod(L,Z,X,te){const ie=(0,service_definitions_1$3.toGrpcWebMethodDefinition)(L),oe={path:L.path,requestStream:L.requestStream,responseStream:L.responseStream,options:L.options};async function*se(ce,le){if(!(0,isAsyncIterable_1$2.isAsyncIterable)(ce))throw new Error("A middleware passed invalid request to next(): expected a single message for client streaming method");const{metadata:de=(0,nice_grpc_common_1$3.Metadata)(),signal:he=new AbortController().signal,onHeader:ge,onTrailer:_e}=le;return await(0,abort_controller_x_1$2.execute)(he,(Ae,xe)=>{const Ie=new AbortController;let Pe;const Ce=grpc_web_1$2.grpc.client(ie,{host:Z.address,transport:Z.transport});return Ce.onHeaders(Be=>{ge?.((0,convertMetadata_1$2.convertMetadataFromGrpcWeb)(Be))}),Ce.onMessage(Be=>{Pe=Be}),Ce.onEnd((Be,Ve,Ge)=>{_e?.((0,convertMetadata_1$2.convertMetadataFromGrpcWeb)(Ge)),Ie.abort(),Be===grpc_web_1$2.grpc.Code.OK?Ae(Pe):xe(new nice_grpc_common_1$3.ClientError(L.path,+Be,Ve))}),Ce.start((0,convertMetadata_1$2.convertMetadataToGrpcWeb)(de)),pipeRequest(Ie.signal,ce,Ce,L).then(()=>{Ce.finishSend()},Be=>{(0,abort_controller_x_1$2.isAbortError)(Be)||(xe(Be),Ce.close())}),()=>{Ie.abort(),Ce.close()}})}const ue=X==null?se:(ce,le)=>X({method:oe,requestStream:!0,request:ce,responseStream:!1,next:se},le);return async(ce,le)=>{const he=ue(ce,{...te,...le})[Symbol.asyncIterator]();let ge=await he.next();for(;;){if(!ge.done){ge=await he.throw(new Error("A middleware yielded a message, but expected to only return a message for client streaming method"));continue}if(ge.value==null){ge=await he.throw(new Error("A middleware returned void, but expected to return a message for client streaming method"));continue}return ge.value}}}createClientStreamingMethod$1.createClientStreamingMethod=createClientStreamingMethod;async function pipeRequest(L,Z,X,te){for await(const ie of Z)(0,abort_controller_x_1$2.throwIfAborted)(L),X.send({serializeBinary:()=>te.requestSerialize(ie)})}var createServerStreamingMethod$1={};Object.defineProperty(createServerStreamingMethod$1,"__esModule",{value:!0});createServerStreamingMethod$1.createServerStreamingMethod=void 0;const grpc_web_1$1=grpcWebClient_umdExports,abort_controller_x_1$1=require$$2,AsyncSink_1=AsyncSink$1,nice_grpc_common_1$2=lib,service_definitions_1$2=serviceDefinitions,convertMetadata_1$1=convertMetadata,isAsyncIterable_1$1=isAsyncIterable$1;function createServerStreamingMethod(L,Z,X,te){const ie=(0,service_definitions_1$2.toGrpcWebMethodDefinition)(L),oe={path:L.path,requestStream:L.requestStream,responseStream:L.responseStream,options:L.options};async function*se(ce,le){if((0,isAsyncIterable_1$1.isAsyncIterable)(ce))throw new Error("A middleware passed invalid request to next(): expected a single message for server streaming method");const{metadata:de=(0,nice_grpc_common_1$2.Metadata)(),signal:he=new AbortController().signal,onHeader:ge,onTrailer:_e}=le,Ae=new AsyncSink_1.AsyncSink,xe=grpc_web_1$1.grpc.client(ie,{host:Z.address,transport:Z.transport});xe.onHeaders(Pe=>{ge?.((0,convertMetadata_1$1.convertMetadataFromGrpcWeb)(Pe))}),xe.onMessage(Pe=>{Ae.write(Pe)}),xe.onEnd((Pe,Ce,Be)=>{_e?.((0,convertMetadata_1$1.convertMetadataFromGrpcWeb)(Be)),Pe===grpc_web_1$1.grpc.Code.OK?Ae.end():Ae.error(new nice_grpc_common_1$2.ClientError(L.path,+Pe,Ce))}),xe.start((0,convertMetadata_1$1.convertMetadataToGrpcWeb)(de)),xe.send({serializeBinary:()=>L.requestSerialize(ce)}),xe.finishSend();const Ie=()=>{Ae.error(new abort_controller_x_1$1.AbortError),xe.close()};he.addEventListener("abort",Ie);try{yield*Ae}finally{he.removeEventListener("abort",Ie),(0,abort_controller_x_1$1.throwIfAborted)(he)}}const ue=X==null?se:(ce,le)=>X({method:oe,requestStream:!1,request:ce,responseStream:!0,next:se},le);return(ce,le)=>{const he=ue(ce,{...te,...le})[Symbol.asyncIterator]();return{[Symbol.asyncIterator](){return{async next(){const ge=await he.next();return ge.done&&ge.value!=null?await he.throw(new Error("A middleware returned a message, but expected to return void for server streaming method")):ge},return(){return he.return()},throw(ge){return he.throw(ge)}}}}}}createServerStreamingMethod$1.createServerStreamingMethod=createServerStreamingMethod;var createUnaryMethod$1={};Object.defineProperty(createUnaryMethod$1,"__esModule",{value:!0});createUnaryMethod$1.createUnaryMethod=void 0;const nice_grpc_common_1$1=lib,grpc_web_1=grpcWebClient_umdExports,abort_controller_x_1=require$$2,service_definitions_1$1=serviceDefinitions,isAsyncIterable_1=isAsyncIterable$1,convertMetadata_1=convertMetadata;function createUnaryMethod(L,Z,X,te){const ie=(0,service_definitions_1$1.toGrpcWebMethodDefinition)(L),oe={path:L.path,requestStream:L.requestStream,responseStream:L.responseStream,options:L.options};async function*se(ce,le){if((0,isAsyncIterable_1.isAsyncIterable)(ce))throw new Error("A middleware passed invalid request to next(): expected a single message for unary method");const{metadata:de=(0,nice_grpc_common_1$1.Metadata)(),signal:he=new AbortController().signal,onHeader:ge,onTrailer:_e}=le;return await(0,abort_controller_x_1.execute)(he,(Ae,xe)=>{let Ie;const Pe=grpc_web_1.grpc.client(ie,{host:Z.address,transport:Z.transport});return Pe.onHeaders(Ce=>{ge?.((0,convertMetadata_1.convertMetadataFromGrpcWeb)(Ce))}),Pe.onMessage(Ce=>{Ie=Ce}),Pe.onEnd((Ce,Be,Ve)=>{_e?.((0,convertMetadata_1.convertMetadataFromGrpcWeb)(Ve)),Ce===grpc_web_1.grpc.Code.OK?Ae(Ie):xe(new nice_grpc_common_1$1.ClientError(L.path,+Ce,Be))}),Pe.start((0,convertMetadata_1.convertMetadataToGrpcWeb)(de)),Pe.send({serializeBinary:()=>L.requestSerialize(ce)}),Pe.finishSend(),()=>{Pe.close()}})}const ue=X==null?se:(ce,le)=>X({method:oe,requestStream:!1,request:ce,responseStream:!1,next:se},le);return async(ce,le)=>{const he=ue(ce,{...te,...le})[Symbol.asyncIterator]();let ge=await he.next();for(;;){if(!ge.done){ge=await he.throw(new Error("A middleware yielded a message, but expected to only return a message for unary method"));continue}if(ge.value==null){ge=await he.throw(new Error("A middleware returned void, but expected to return a message for unary method"));continue}return ge.value}}}createUnaryMethod$1.createUnaryMethod=createUnaryMethod;Object.defineProperty(ClientFactory,"__esModule",{value:!0});ClientFactory.createClient=ClientFactory.createClientFactory=void 0;const nice_grpc_common_1=lib,service_definitions_1=serviceDefinitions,createBidiStreamingMethod_1=createBidiStreamingMethod$1,createClientStreamingMethod_1=createClientStreamingMethod$1,createServerStreamingMethod_1=createServerStreamingMethod$1,createUnaryMethod_1=createUnaryMethod$1;function createClientFactory(){return createClientFactoryWithMiddleware()}ClientFactory.createClientFactory=createClientFactory;function createClient(L,Z,X){return createClientFactory().create(L,Z,X)}ClientFactory.createClient=createClient;function createClientFactoryWithMiddleware(L){return{use(Z){return createClientFactoryWithMiddleware(L==null?Z:(0,nice_grpc_common_1.composeClientMiddleware)(L,Z))},create(Z,X,te={}){const ie={},oe=Object.entries((0,service_definitions_1.normalizeServiceDefinition)(Z));for(const[se,ue]of oe){const ce={...te["*"],...te[se]};ue.requestStream?ue.responseStream?ie[se]=(0,createBidiStreamingMethod_1.createBidiStreamingMethod)(ue,X,L,ce):ie[se]=(0,createClientStreamingMethod_1.createClientStreamingMethod)(ue,X,L,ce):ue.responseStream?ie[se]=(0,createServerStreamingMethod_1.createServerStreamingMethod)(ue,X,L,ce):ie[se]=(0,createUnaryMethod_1.createUnaryMethod)(ue,X,L,ce)}return ie}}}var Client={};Object.defineProperty(Client,"__esModule",{value:!0});(function(L){var Z=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(ie,oe,se,ue){ue===void 0&&(ue=se);var ce=Object.getOwnPropertyDescriptor(oe,se);(!ce||("get"in ce?!oe.__esModule:ce.writable||ce.configurable))&&(ce={enumerable:!0,get:function(){return oe[se]}}),Object.defineProperty(ie,ue,ce)}:function(ie,oe,se,ue){ue===void 0&&(ue=se),ie[ue]=oe[se]}),X=commonjsGlobal&&commonjsGlobal.__exportStar||function(ie,oe){for(var se in ie)se!=="default"&&!Object.prototype.hasOwnProperty.call(oe,se)&&Z(oe,ie,se)};Object.defineProperty(L,"__esModule",{value:!0}),L.Status=L.Metadata=L.composeClientMiddleware=L.ClientError=void 0;var te=lib;Object.defineProperty(L,"ClientError",{enumerable:!0,get:function(){return te.ClientError}}),Object.defineProperty(L,"composeClientMiddleware",{enumerable:!0,get:function(){return te.composeClientMiddleware}}),Object.defineProperty(L,"Metadata",{enumerable:!0,get:function(){return te.Metadata}}),Object.defineProperty(L,"Status",{enumerable:!0,get:function(){return te.Status}}),X(serviceDefinitions,L),X(channel,L),X(ClientFactory,L),X(Client,L)})(lib$1);function createBaseLinkedTwitterPair(){return{username:"",address:""}}var LinkedTwitterPair={encode(L,Z=_m0.Writer.create()){return L.username!==""&&Z.uint32(10).string(L.username),L.address!==""&&Z.uint32(18).string(L.address),Z},decode(L,Z){const X=L instanceof _m0.Reader?L:_m0.Reader.create(L);let te=Z===void 0?X.len:X.pos+Z;const ie=createBaseLinkedTwitterPair();for(;X.pos>>3){case 1:if(oe!=10)break;ie.username=X.string();continue;case 2:if(oe!=18)break;ie.address=X.string();continue}if((oe&7)==4||oe==0)break;X.skipType(oe&7)}return ie},create(L){return LinkedTwitterPair.fromPartial(L??{})},fromPartial(L){const Z=createBaseLinkedTwitterPair();return Z.username=L.username??"",Z.address=L.address??"",Z}};function createBaseDripRequest(){return{username:"",address:""}}var DripRequest={encode(L,Z=_m0.Writer.create()){return L.username!==""&&Z.uint32(10).string(L.username),L.address!==""&&Z.uint32(18).string(L.address),Z},decode(L,Z){const X=L instanceof _m0.Reader?L:_m0.Reader.create(L);let te=Z===void 0?X.len:X.pos+Z;const ie=createBaseDripRequest();for(;X.pos>>3){case 1:if(oe!=10)break;ie.username=X.string();continue;case 2:if(oe!=18)break;ie.address=X.string();continue}if((oe&7)==4||oe==0)break;X.skipType(oe&7)}return ie},create(L){return DripRequest.fromPartial(L??{})},fromPartial(L){const Z=createBaseDripRequest();return Z.username=L.username??"",Z.address=L.address??"",Z}};function createBaseDripDevRequest(){return{address:""}}var DripDevRequest={encode(L,Z=_m0.Writer.create()){return L.address!==""&&Z.uint32(10).string(L.address),Z},decode(L,Z){const X=L instanceof _m0.Reader?L:_m0.Reader.create(L);let te=Z===void 0?X.len:X.pos+Z;const ie=createBaseDripDevRequest();for(;X.pos>>3){case 1:if(oe!=10)break;ie.address=X.string();continue}if((oe&7)==4||oe==0)break;X.skipType(oe&7)}return ie},create(L){return DripDevRequest.fromPartial(L??{})},fromPartial(L){const Z=createBaseDripDevRequest();return Z.address=L.address??"",Z}};function createBaseDripResponse(){return{dripTxHash:"",ecsTxHash:""}}var DripResponse={encode(L,Z=_m0.Writer.create()){return L.dripTxHash!==""&&Z.uint32(10).string(L.dripTxHash),L.ecsTxHash!==""&&Z.uint32(18).string(L.ecsTxHash),Z},decode(L,Z){const X=L instanceof _m0.Reader?L:_m0.Reader.create(L);let te=Z===void 0?X.len:X.pos+Z;const ie=createBaseDripResponse();for(;X.pos>>3){case 1:if(oe!=10)break;ie.dripTxHash=X.string();continue;case 2:if(oe!=18)break;ie.ecsTxHash=X.string();continue}if((oe&7)==4||oe==0)break;X.skipType(oe&7)}return ie},create(L){return DripResponse.fromPartial(L??{})},fromPartial(L){const Z=createBaseDripResponse();return Z.dripTxHash=L.dripTxHash??"",Z.ecsTxHash=L.ecsTxHash??"",Z}};function createBaseTimeUntilDripResponse(){return{timeUntilDripMinutes:0,timeUntilDripSeconds:0}}var TimeUntilDripResponse={encode(L,Z=_m0.Writer.create()){return L.timeUntilDripMinutes!==0&&Z.uint32(9).double(L.timeUntilDripMinutes),L.timeUntilDripSeconds!==0&&Z.uint32(17).double(L.timeUntilDripSeconds),Z},decode(L,Z){const X=L instanceof _m0.Reader?L:_m0.Reader.create(L);let te=Z===void 0?X.len:X.pos+Z;const ie=createBaseTimeUntilDripResponse();for(;X.pos>>3){case 1:if(oe!=9)break;ie.timeUntilDripMinutes=X.double();continue;case 2:if(oe!=17)break;ie.timeUntilDripSeconds=X.double();continue}if((oe&7)==4||oe==0)break;X.skipType(oe&7)}return ie},create(L){return TimeUntilDripResponse.fromPartial(L??{})},fromPartial(L){const Z=createBaseTimeUntilDripResponse();return Z.timeUntilDripMinutes=L.timeUntilDripMinutes??0,Z.timeUntilDripSeconds=L.timeUntilDripSeconds??0,Z}};function createBaseGetLinkedTwittersRequest(){return{}}var GetLinkedTwittersRequest={encode(L,Z=_m0.Writer.create()){return Z},decode(L,Z){const X=L instanceof _m0.Reader?L:_m0.Reader.create(L);let te=Z===void 0?X.len:X.pos+Z;const ie=createBaseGetLinkedTwittersRequest();for(;X.pos>>3){case 1:if(oe!=10)break;ie.linkedTwitters.push(LinkedTwitterPair.decode(X,X.uint32()));continue}if((oe&7)==4||oe==0)break;X.skipType(oe&7)}return ie},create(L){return GetLinkedTwittersResponse.fromPartial(L??{})},fromPartial(L){const Z=createBaseGetLinkedTwittersResponse();return Z.linkedTwitters=L.linkedTwitters?.map(X=>LinkedTwitterPair.fromPartial(X))||[],Z}};function createBaseLinkedTwitterForAddressRequest(){return{address:""}}var LinkedTwitterForAddressRequest={encode(L,Z=_m0.Writer.create()){return L.address!==""&&Z.uint32(10).string(L.address),Z},decode(L,Z){const X=L instanceof _m0.Reader?L:_m0.Reader.create(L);let te=Z===void 0?X.len:X.pos+Z;const ie=createBaseLinkedTwitterForAddressRequest();for(;X.pos>>3){case 1:if(oe!=10)break;ie.address=X.string();continue}if((oe&7)==4||oe==0)break;X.skipType(oe&7)}return ie},create(L){return LinkedTwitterForAddressRequest.fromPartial(L??{})},fromPartial(L){const Z=createBaseLinkedTwitterForAddressRequest();return Z.address=L.address??"",Z}};function createBaseLinkedTwitterForAddressResponse(){return{username:""}}var LinkedTwitterForAddressResponse={encode(L,Z=_m0.Writer.create()){return L.username!==""&&Z.uint32(10).string(L.username),Z},decode(L,Z){const X=L instanceof _m0.Reader?L:_m0.Reader.create(L);let te=Z===void 0?X.len:X.pos+Z;const ie=createBaseLinkedTwitterForAddressResponse();for(;X.pos>>3){case 1:if(oe!=10)break;ie.username=X.string();continue}if((oe&7)==4||oe==0)break;X.skipType(oe&7)}return ie},create(L){return LinkedTwitterForAddressResponse.fromPartial(L??{})},fromPartial(L){const Z=createBaseLinkedTwitterForAddressResponse();return Z.username=L.username??"",Z}};function createBaseLinkedAddressForTwitterRequest(){return{username:""}}var LinkedAddressForTwitterRequest={encode(L,Z=_m0.Writer.create()){return L.username!==""&&Z.uint32(10).string(L.username),Z},decode(L,Z){const X=L instanceof _m0.Reader?L:_m0.Reader.create(L);let te=Z===void 0?X.len:X.pos+Z;const ie=createBaseLinkedAddressForTwitterRequest();for(;X.pos>>3){case 1:if(oe!=10)break;ie.username=X.string();continue}if((oe&7)==4||oe==0)break;X.skipType(oe&7)}return ie},create(L){return LinkedAddressForTwitterRequest.fromPartial(L??{})},fromPartial(L){const Z=createBaseLinkedAddressForTwitterRequest();return Z.username=L.username??"",Z}};function createBaseLinkedAddressForTwitterResponse(){return{address:""}}var LinkedAddressForTwitterResponse={encode(L,Z=_m0.Writer.create()){return L.address!==""&&Z.uint32(10).string(L.address),Z},decode(L,Z){const X=L instanceof _m0.Reader?L:_m0.Reader.create(L);let te=Z===void 0?X.len:X.pos+Z;const ie=createBaseLinkedAddressForTwitterResponse();for(;X.pos>>3){case 1:if(oe!=10)break;ie.address=X.string();continue}if((oe&7)==4||oe==0)break;X.skipType(oe&7)}return ie},create(L){return LinkedAddressForTwitterResponse.fromPartial(L??{})},fromPartial(L){const Z=createBaseLinkedAddressForTwitterResponse();return Z.address=L.address??"",Z}};function createBaseSetLinkedTwitterRequest(){return{address:"",username:"",signature:""}}var SetLinkedTwitterRequest={encode(L,Z=_m0.Writer.create()){return L.address!==""&&Z.uint32(10).string(L.address),L.username!==""&&Z.uint32(18).string(L.username),L.signature!==""&&Z.uint32(26).string(L.signature),Z},decode(L,Z){const X=L instanceof _m0.Reader?L:_m0.Reader.create(L);let te=Z===void 0?X.len:X.pos+Z;const ie=createBaseSetLinkedTwitterRequest();for(;X.pos>>3){case 1:if(oe!=10)break;ie.address=X.string();continue;case 2:if(oe!=18)break;ie.username=X.string();continue;case 3:if(oe!=26)break;ie.signature=X.string();continue}if((oe&7)==4||oe==0)break;X.skipType(oe&7)}return ie},create(L){return SetLinkedTwitterRequest.fromPartial(L??{})},fromPartial(L){const Z=createBaseSetLinkedTwitterRequest();return Z.address=L.address??"",Z.username=L.username??"",Z.signature=L.signature??"",Z}};function createBaseSetLinkedTwitterResponse(){return{}}var SetLinkedTwitterResponse={encode(L,Z=_m0.Writer.create()){return Z},decode(L,Z){const X=L instanceof _m0.Reader?L:_m0.Reader.create(L);let te=Z===void 0?X.len:X.pos+Z;const ie=createBaseSetLinkedTwitterResponse();for(;X.pos{if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw"Unable to locate global object"})();_m0.util.Long!==Long&&(_m0.util.Long=Long,_m0.configure());function createFaucetService(L){return lib$1.createClient(FaucetServiceDefinition,lib$1.createChannel(L))}const worldsJson={4242:{address:"0x99323650ADEaE6E6c93A7Cae249982F58a5b6D3B",blockNumber:31046336},17001:{address:"0x2D6E6A6430F0121d6949D743DF54730b40C5c74F",blockNumber:665316},31337:{address:"0xe70f935c32dA4dB13e7876795f1e175465e6458e"}};var foundry$1={id:31337,name:"Foundry",network:"foundry",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["http://127.0.0.1:8545"],webSocket:["ws://127.0.0.1:8545"]},public:{http:["http://127.0.0.1:8545"],webSocket:["ws://127.0.0.1:8545"]}}};const foundry=defineChain(foundry$1);var t={name:"Lattice Testnet",id:4242,network:"lattice-testnet",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://follower.testnet-chain.linfra.xyz"],webSocket:["wss://follower.testnet-chain.linfra.xyz"]},public:{http:["https://follower.testnet-chain.linfra.xyz"],webSocket:["wss://follower.testnet-chain.linfra.xyz"]}},blockExplorers:{otterscan:{name:"Otterscan",url:"https://explorer.testnet-chain.linfra.xyz"},default:{name:"Otterscan",url:"https://explorer.testnet-chain.linfra.xyz"}},faucetUrl:"https://faucet.testnet-mud-services.linfra.xyz"},r={...foundry,fees:{defaultPriorityFee:0n}};const redStone={name:"Red Stone",id:17001,network:"red-stone",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.holesky.redstone.xyz"],webSocket:["wss://rpc.holesky.redstone.xyz/ws"]},public:{http:["https://rpc.holesky.redstone.xyz"],webSocket:["wss://rpc.holesky.redstone.xyz/ws"]}},blockExplorers:{otterscan:{name:"Otterscan",url:"https://explorer.holesky.redstone.xyz"},default:{name:"Otterscan",url:"https://explorer.holesky.redstone.xyz"}},faucetUrl:"https://faucet.testnet-mud-services.linfra.xyz"},supportedChains=[r,t,redStone],worlds=worldsJson;async function getNetworkConfig(){const L=new URLSearchParams(window.location.search),Z=Number(L.get("chainId")||L.get("chainid")||"31337"),X=supportedChains.findIndex(ue=>ue.id===Z),te=supportedChains[X];if(!te)throw new Error(`Chain ${Z} not found`);const ie=worlds[te.id.toString()],oe=L.get("worldAddress")||ie?.address;if(!oe)throw new Error(`No world address found for chain ${Z}. Did you run \`mud deploy\`?`);const se=L.has("initialBlockNumber")?Number(L.get("initialBlockNumber")):ie?.blockNumber??0n;return{privateKey:be$1(),chainId:Z,chain:te,faucetServiceUrl:L.get("faucet")??te.faucetUrl,worldAddress:oe,initialBlockNumber:se}}const world=Yt(),_abi=[{inputs:[{internalType:"string",name:"resource",type:"string"},{internalType:"address",name:"caller",type:"address"}],name:"AccessDenied",type:"error"},{inputs:[{internalType:"bytes4",name:"functionSelector",type:"bytes4"}],name:"FunctionSelectorExists",type:"error"},{inputs:[{internalType:"bytes4",name:"functionSelector",type:"bytes4"}],name:"FunctionSelectorNotFound",type:"error"},{inputs:[{internalType:"string",name:"resource",type:"string"}],name:"InvalidSelector",type:"error"},{inputs:[{internalType:"string",name:"module",type:"string"}],name:"ModuleAlreadyInstalled",type:"error"},{inputs:[{internalType:"string",name:"resource",type:"string"}],name:"ResourceExists",type:"error"},{inputs:[{internalType:"string",name:"resource",type:"string"}],name:"ResourceNotFound",type:"error"},{inputs:[{internalType:"uint256",name:"length",type:"uint256"},{internalType:"uint256",name:"received",type:"uint256"}],name:"StoreCore_DataIndexOverflow",type:"error"},{inputs:[{internalType:"uint256",name:"expected",type:"uint256"},{internalType:"uint256",name:"received",type:"uint256"}],name:"StoreCore_InvalidDataLength",type:"error"},{inputs:[{internalType:"uint256",name:"expected",type:"uint256"},{internalType:"uint256",name:"received",type:"uint256"}],name:"StoreCore_InvalidFieldNamesLength",type:"error"},{inputs:[{internalType:"uint256",name:"expected",type:"uint256"},{internalType:"uint256",name:"received",type:"uint256"}],name:"StoreCore_InvalidKeyNamesLength",type:"error"},{inputs:[],name:"StoreCore_NotDynamicField",type:"error"},{inputs:[],name:"StoreCore_NotImplemented",type:"error"},{inputs:[{internalType:"bytes32",name:"tableId",type:"bytes32"},{internalType:"string",name:"tableIdString",type:"string"}],name:"StoreCore_TableAlreadyExists",type:"error"},{inputs:[{internalType:"bytes32",name:"tableId",type:"bytes32"},{internalType:"string",name:"tableIdString",type:"string"}],name:"StoreCore_TableNotFound",type:"error"},{inputs:[{internalType:"address",name:"system",type:"address"}],name:"SystemExists",type:"error"},{anonymous:!1,inputs:[],name:"HelloWorld",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"table",type:"bytes32"},{indexed:!1,internalType:"bytes32[]",name:"key",type:"bytes32[]"}],name:"StoreDeleteRecord",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"table",type:"bytes32"},{indexed:!1,internalType:"bytes32[]",name:"key",type:"bytes32[]"},{indexed:!1,internalType:"bytes",name:"data",type:"bytes"}],name:"StoreEphemeralRecord",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"table",type:"bytes32"},{indexed:!1,internalType:"bytes32[]",name:"key",type:"bytes32[]"},{indexed:!1,internalType:"uint8",name:"schemaIndex",type:"uint8"},{indexed:!1,internalType:"bytes",name:"data",type:"bytes"}],name:"StoreSetField",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"table",type:"bytes32"},{indexed:!1,internalType:"bytes32[]",name:"key",type:"bytes32[]"},{indexed:!1,internalType:"bytes",name:"data",type:"bytes"}],name:"StoreSetRecord",type:"event"},{inputs:[],name:"acceptTrade",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"askStart",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"resourceSelector",type:"bytes32"},{internalType:"bytes",name:"funcSelectorAndArgs",type:"bytes"}],name:"call",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"payable",type:"function"},{inputs:[],name:"checkDebt",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"str",type:"string"},{internalType:"uint256",name:"num",type:"uint256"}],name:"concatenate",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"},{internalType:"bytes32[]",name:"key",type:"bytes32[]"},{internalType:"Schema",name:"valueSchema",type:"bytes32"}],name:"deleteRecord",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"},{internalType:"bytes32[]",name:"key",type:"bytes32[]"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"Schema",name:"valueSchema",type:"bytes32"}],name:"emitEphemeralRecord",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"findPartner",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"finishGame",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"},{internalType:"bytes32[]",name:"key",type:"bytes32[]"},{internalType:"uint8",name:"schemaIndex",type:"uint8"},{internalType:"Schema",name:"valueSchema",type:"bytes32"}],name:"getField",outputs:[{internalType:"bytes",name:"data",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"},{internalType:"bytes32[]",name:"key",type:"bytes32[]"},{internalType:"uint8",name:"schemaIndex",type:"uint8"},{internalType:"Schema",name:"valueSchema",type:"bytes32"}],name:"getFieldLength",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"},{internalType:"bytes32[]",name:"key",type:"bytes32[]"},{internalType:"uint8",name:"schemaIndex",type:"uint8"},{internalType:"Schema",name:"valueSchema",type:"bytes32"},{internalType:"uint256",name:"start",type:"uint256"},{internalType:"uint256",name:"end",type:"uint256"}],name:"getFieldSlice",outputs:[{internalType:"bytes",name:"data",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"}],name:"getKeySchema",outputs:[{internalType:"Schema",name:"schema",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"},{internalType:"bytes32[]",name:"key",type:"bytes32[]"},{internalType:"Schema",name:"valueSchema",type:"bytes32"}],name:"getRecord",outputs:[{internalType:"bytes",name:"data",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"}],name:"getValueSchema",outputs:[{internalType:"Schema",name:"schema",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"resourceSelector",type:"bytes32"},{internalType:"address",name:"grantee",type:"address"}],name:"grantAccess",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"increment",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IModule",name:"module",type:"address"},{internalType:"bytes",name:"args",type:"bytes"}],name:"installModule",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IModule",name:"module",type:"address"},{internalType:"bytes",name:"args",type:"bytes"}],name:"installRootModule",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"joinGame",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"targetX",type:"uint256"},{internalType:"uint256",name:"targetY",type:"uint256"}],name:"move",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"pay",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint8",name:"assetKind",type:"uint8"}],name:"pickAsset",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"pickCoin",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint8",name:"cardId",type:"uint8"}],name:"pickFund",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"},{internalType:"bytes32[]",name:"key",type:"bytes32[]"},{internalType:"uint8",name:"schemaIndex",type:"uint8"},{internalType:"uint256",name:"byteLengthToPop",type:"uint256"},{internalType:"Schema",name:"valueSchema",type:"bytes32"}],name:"popFromField",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"},{internalType:"bytes32[]",name:"key",type:"bytes32[]"},{internalType:"uint8",name:"schemaIndex",type:"uint8"},{internalType:"bytes",name:"dataToPush",type:"bytes"},{internalType:"Schema",name:"valueSchema",type:"bytes32"}],name:"pushToField",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"resourceSelector",type:"bytes32"},{internalType:"string",name:"systemFunctionName",type:"string"},{internalType:"string",name:"systemFunctionArguments",type:"string"}],name:"registerFunctionSelector",outputs:[{internalType:"bytes4",name:"worldFunctionSelector",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes16",name:"namespace",type:"bytes16"}],name:"registerNamespace",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"resourceSelector",type:"bytes32"},{internalType:"bytes4",name:"worldFunctionSelector",type:"bytes4"},{internalType:"bytes4",name:"systemFunctionSelector",type:"bytes4"}],name:"registerRootFunctionSelector",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"},{internalType:"contract IStoreHook",name:"hook",type:"address"}],name:"registerStoreHook",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"resourceSelector",type:"bytes32"},{internalType:"contract System",name:"system",type:"address"},{internalType:"bool",name:"publicAccess",type:"bool"}],name:"registerSystem",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"resourceSelector",type:"bytes32"},{internalType:"contract ISystemHook",name:"hook",type:"address"}],name:"registerSystemHook",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"},{internalType:"Schema",name:"keySchema",type:"bytes32"},{internalType:"Schema",name:"valueSchema",type:"bytes32"},{internalType:"string[]",name:"keyNames",type:"string[]"},{internalType:"string[]",name:"fieldNames",type:"string[]"}],name:"registerTable",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"rejectTrade",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"restartGame",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"resourceSelector",type:"bytes32"},{internalType:"address",name:"grantee",type:"address"}],name:"revokeAccess",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"},{internalType:"bytes32[]",name:"key",type:"bytes32[]"},{internalType:"uint8",name:"schemaIndex",type:"uint8"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"Schema",name:"valueSchema",type:"bytes32"}],name:"setField",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"},{internalType:"bytes32[]",name:"key",type:"bytes32[]"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"Schema",name:"valueSchema",type:"bytes32"}],name:"setRecord",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"targetPlayer",type:"bytes32"},{internalType:"uint8",name:"assetKind",type:"uint8"},{internalType:"uint32",name:"money",type:"uint32"}],name:"trade",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"table",type:"bytes32"},{internalType:"bytes32[]",name:"key",type:"bytes32[]"},{internalType:"uint8",name:"schemaIndex",type:"uint8"},{internalType:"uint256",name:"startByteIndex",type:"uint256"},{internalType:"bytes",name:"dataToSet",type:"bytes"},{internalType:"Schema",name:"valueSchema",type:"bytes32"}],name:"updateInField",outputs:[],stateMutability:"nonpayable",type:"function"}];class IWorld__factory{static createInterface(){return new Interface(_abi)}static connect(Z,X){return new Contract(Z,_abi,X)}}IWorld__factory.abi=_abi;const mudConfig=s({enums:{},modules:[{name:"UniqueEntityModule",root:!0,args:[]},{name:"KeysInTableModule",root:!0,args:[ee("Player")]},{name:"KeysWithValueModule",root:!0,args:[ee("Player")]},{name:"KeysInTableModule",root:!0,args:[ee("MapItem")]},{name:"KeysWithValueModule",root:!0,args:[ee("MapItem")]}],tables:{Counter:{keySchema:{},schema:"uint32"},Game:{keySchema:{},schema:{gameId:"uint256",startTime:"uint256",endTime:"uint256",finishTime:"uint256"}},GameState:{keySchema:{},schema:"uint32"},GameMap:{keySchema:{},schema:{width:"uint256",height:"uint256",mapArray:"bytes"}},FundCards:{keySchema:{},schema:{allCard:"uint16[72]"}},FundPool:{keySchema:{},schema:{placeHolder:"uint256",array:"uint16[9]"}},MapItem:{schema:{x:"uint256",y:"uint256"}},MapItemValue:{schema:"uint32"},IsPlayer:{dataStruct:!1,schema:"bool"},Player:{dataStruct:!0,schema:{gameId:"uint256",state:"uint32",money:"uint32",x:"uint256",y:"uint256"}},RaiseColddown:{dataStruct:!0,schema:{start:"uint256",end:"uint256"}},AssetsList:{dataStruct:!0,schema:{gpu:"int8",bitcoin:"int8",battery:"int8",leiter:"int8",gold:"int8",oil:"int8"}},OwnedCards:{schema:{array:"uint256[]"}},HasDebt:{schema:"bool"},Debt:{schema:"uint32"},Log:{dataStruct:!0,schema:"uint256"},TransactionList:{dataStruct:!0,schema:{list:"bytes32[]"}},TradeList:{dataStruct:!0,schema:{list:"bytes"}},IsTrading:{dataStruct:!1,schema:"bool"},PlayerGameResult:{dataStruct:!0,schema:{rank:"int32",points:"int32",gpu:"int8",bitcoin:"int8",battery:"int8",leiter:"int8",gold:"int8",oil:"int8"}},IsEliminated:{schema:"bool"},UnsolicitedTransaction:{dataStruct:!0,schema:{asset:"uint8",money:"uint32",to:"bytes32"}},PassiveTransaction:{dataStruct:!0,schema:{asset:"uint8",money:"uint32",from:"bytes32"}}}});async function setupNetwork(){const L=await getNetworkConfig(),Z={chain:L.chain,transport:Ee(fallback([webSocket(),http()])),pollingInterval:1e3},X=createPublicClient(Z),te=J(L.privateKey),ie=createWalletClient({...Z,account:te}),oe=new Subject,se=me({address:L.worldAddress,abi:IWorld__factory.abi,publicClient:X,walletClient:ie,onWrite:he=>oe.next(he)}),{components:ue,latestBlock$:ce,blockStorageOperations$:le,waitForTransaction:de}=await ae({world,config:mudConfig,address:L.worldAddress,publicClient:X,startBlock:BigInt(L.initialBlockNumber)});if(L.faucetServiceUrl){const he=te.address;console.info("[Dev Faucet]: Player address -> ",he);const ge=createFaucetService(L.faucetServiceUrl),_e=async()=>{const Ae=await X.getBalance({address:he});console.info(`[Dev Faucet]: Player balance -> ${Ae}`),Ae{const[Z,X]=L.value;console.log("GameState updated",L,{nextValue:Z,prevValue:X}),globalThis.ponzi.gameState=Z?Z.value:null,globalThis.ponzi.gamestate_update?.(X?.value,Z?.value)});components.SyncProgress.update$.subscribe(L=>{console.log("onSyncProgressUpdate:",L),globalThis.ponzi.percentage=L.value[0].percentage,globalThis.ponzi.syncprogress_update?.(globalThis.ponzi.percentage)});components.Game.update$.subscribe(L=>{const[Z,X]=L.value;console.log("Game updated",L,{nextValue:Z,prevValue:X}),globalThis.ponzi.game=Z,globalThis.ponzi.game_update?.(X,Z)});components.Player.update$.subscribe(L=>{const[Z,X]=L.value;console.log("Player updated",L,{nextValue:Z,prevValue:X}),globalThis.ponzi.player_update?.(L)});components.GameMap.update$.subscribe(L=>{const[Z,X]=L.value;console.log("GameMap updated",{nextValue:Z,prevValue:X}),globalThis.ponzi.gameMap=Z,globalThis.ponzi.gamemap_update?.(X,Z)});components.FundPool.update$.subscribe(L=>{L.value,console.log("FundPool updated",L),globalThis.ponzi.fundpool_update?.(L)});components.MapItem.update$.subscribe(L=>{const[Z,X]=L.value;globalThis.ponzi.mapitems_update?.(X,Z)});components.IsPlayer.update$.subscribe(L=>{L.value,console.log("IsPlayer updated",L),globalThis.ponzi.isplayer_update?.(L)});components.IsEliminated.update$.subscribe(L=>{L.value,console.log("IsEliminated updated",L),globalThis.ponzi.iseliminated_update?.(L)});components.OwnedCards.update$.subscribe(L=>{L.value,console.log("OwnedCards updated",L)});components.TransactionList.update$.subscribe(L=>{const[Z,X]=L.value;console.log("TransactionList updated",L),globalThis.ponzi.transactionList=Z,globalThis.ponzi.transactionlist_update?.(L)});components.Log.update$.subscribe(L=>{L.value,console.log("Log updated",L)});components.AssetsList.update$.subscribe(L=>{L.value,console.log("AssetsList updated",L),globalThis.ponzi.assetslist_update?.(L)});components.RaiseColddown.update$.subscribe(L=>{L.value,console.log("RaiseColddown updated",L),globalThis.ponzi.raiseColddown_update?.(L)});components.PassiveTransaction.update$.subscribe(L=>{L.value,console.log("PassiveTransaction updated",L),globalThis.ponzi.passivetransaction_update?.(L)});components.TradeList.update$.subscribe(L=>{L.value,console.log("TradeList updated",L),globalThis.ponzi.tradelist_update?.(L)});components.PlayerGameResult.update$.subscribe(L=>{L.value,console.log("PlayerGameResult updated",L),globalThis.ponzi.playergameresult_update?.(L)});components.HasDebt.update$.subscribe(L=>{L.value,console.log("HasDebt updated",L),globalThis.ponzi.hasdebt_update?.(L)});components.TransactionList.update$.subscribe(L=>{L.value,console.log("TransactionList updated",L),globalThis.ponzi.transactionlist_update?.(L)});window.getPlayers=()=>components.Player.values;window.getIsPlayers=()=>components.IsPlayer.values;window.getMapItems=()=>components.MapItem.values;window.getAssetsList=()=>components.AssetsList.values;window.getTransactionList=()=>components.TransactionList.values;window.getFundPool=()=>components.FundPool.values;window.queryValue=async(L,Z)=>{const X=De(L,Z);return console.log("getValueByComAndEntity:",X),X};window.queryPlayingAssetsList=async()=>z$3([Ft(components.AssetsList),Ft(components.Player)]);window.queryResultAssetsList=async()=>z$3([Ft(components.AssetsList),Qt(components.IsEliminated)]);window.increment=async()=>{let L=await increment();return console.log("new counter value:",L),L};window.joinGame=async()=>{let L=await joinGame();return console.log("joinGame:",L),L};window.askStart=async()=>{let L=await askStart();return console.log("askStart:",L),L};window.move=async(L,Z)=>{let X=await move(L,Z);return console.log("move:",X),X};window.pickAsset=async L=>{console.log("send pickAsset:",L),await pickAsset(L)};window.pickFund=async L=>{console.log("send pickFund:",L),await pickFund(L)};window.trade=async(L,Z,X)=>{console.log("send trade:",L,X,Z),await trade(L,Z,X)};window.acceptTrade=async()=>{let L=await acceptTrade();console.log("send acceptTrade:"+L)};window.rejectTrade=async()=>{let L=await rejectTrade();console.log("send rejectTrade:"+L)};window.finishGame=async()=>{console.log("send finishGame"),await finishGame()};window.pickCoin=async()=>{console.log("send pickCoin...");let L=await pickCoin();console.log("send pickCoin data:"+L)};window.searchPartner=async()=>{console.log("send searchPartner..."),await findPartner()};window.payDebt=async()=>{console.log("send pay..."),await pay()};window.restartGame=async()=>{console.log("send restartGame..."),await restartGame()};window.checkDebt=async()=>{console.log("send checkDebt..."),await checkDebt()};{const{mount:L}=await __vitePreload(()=>import("./index-c7ee7ff5.js"),[]);console.log("============================"),L({config:mudConfig,publicClient:network.publicClient,walletClient:network.walletClient,latestBlock$:network.latestBlock$,blockStorageOperations$:network.blockStorageOperations$,worldAddress:network.worldContract.address,worldAbi:network.worldContract.abi,write$:network.write$,recsWorld:network.world})}window.mudutils={};window.mudutils.hexToArray=function(L,Z,X){const te=Array.from(K$2(X)).map((oe,se)=>oe),ie=[];for(let oe=0;oe;\n\nexport function createClientComponents({ components }: SetupNetworkResult) {\n return {\n ...components,\n // add your client components or overrides here\n };\n}\n","var niceErrors = {\n 0: \"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'\",\n 1: function _(annotationType, key) {\n return \"Cannot apply '\" + annotationType + \"' to '\" + key.toString() + \"': Field not found.\";\n },\n /*\r\n 2(prop) {\r\n return `invalid decorator for '${prop.toString()}'`\r\n },\r\n 3(prop) {\r\n return `Cannot decorate '${prop.toString()}': action can only be used on properties with a function value.`\r\n },\r\n 4(prop) {\r\n return `Cannot decorate '${prop.toString()}': computed can only be used on getter properties.`\r\n },\r\n */\n 5: \"'keys()' can only be used on observable objects, arrays, sets and maps\",\n 6: \"'values()' can only be used on observable objects, arrays, sets and maps\",\n 7: \"'entries()' can only be used on observable objects, arrays and maps\",\n 8: \"'set()' can only be used on observable objects, arrays and maps\",\n 9: \"'remove()' can only be used on observable objects, arrays and maps\",\n 10: \"'has()' can only be used on observable objects, arrays and maps\",\n 11: \"'get()' can only be used on observable objects, arrays and maps\",\n 12: \"Invalid annotation\",\n 13: \"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 14: \"Intercept handlers should return nothing or a change object\",\n 15: \"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 16: \"Modification exception: the internal structure of an observable array was changed.\",\n 17: function _(index, length) {\n return \"[mobx.array] Index out of bounds, \" + index + \" is larger than \" + length;\n },\n 18: \"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js\",\n 19: function _(other) {\n return \"Cannot initialize from classes that inherit from Map: \" + other.constructor.name;\n },\n 20: function _(other) {\n return \"Cannot initialize map from \" + other;\n },\n 21: function _(dataStructure) {\n return \"Cannot convert to map from '\" + dataStructure + \"'\";\n },\n 22: \"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js\",\n 23: \"It is not possible to get index atoms from arrays\",\n 24: function _(thing) {\n return \"Cannot obtain administration from \" + thing;\n },\n 25: function _(property, name) {\n return \"the entry '\" + property + \"' does not exist in the observable map '\" + name + \"'\";\n },\n 26: \"please specify a property\",\n 27: function _(property, name) {\n return \"no observable property '\" + property.toString() + \"' found on the observable object '\" + name + \"'\";\n },\n 28: function _(thing) {\n return \"Cannot obtain atom from \" + thing;\n },\n 29: \"Expecting some object\",\n 30: \"invalid action stack. did you forget to finish an action?\",\n 31: \"missing option for computed: get\",\n 32: function _(name, derivation) {\n return \"Cycle detected in computation \" + name + \": \" + derivation;\n },\n 33: function _(name) {\n return \"The setter of computed value '\" + name + \"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?\";\n },\n 34: function _(name) {\n return \"[ComputedValue '\" + name + \"'] It is not possible to assign a new value to a computed value.\";\n },\n 35: \"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`\",\n 36: \"isolateGlobalState should be called before MobX is running any reactions\",\n 37: function _(method) {\n return \"[mobx] `observableArray.\" + method + \"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice().\" + method + \"()` instead\";\n },\n 38: \"'ownKeys()' can only be used on observable objects\",\n 39: \"'defineProperty()' can only be used on observable objects\"\n};\nvar errors = process.env.NODE_ENV !== \"production\" ? niceErrors : {};\nfunction die(error) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n if (process.env.NODE_ENV !== \"production\") {\n var e = typeof error === \"string\" ? error : errors[error];\n if (typeof e === \"function\") e = e.apply(null, args);\n throw new Error(\"[MobX] \" + e);\n }\n throw new Error(typeof error === \"number\" ? \"[MobX] minified error nr: \" + error + (args.length ? \" \" + args.map(String).join(\",\") : \"\") + \". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts\" : \"[MobX] \" + error);\n}\n\nvar mockGlobal = {};\nfunction getGlobal() {\n if (typeof globalThis !== \"undefined\") {\n return globalThis;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n if (typeof self !== \"undefined\") {\n return self;\n }\n return mockGlobal;\n}\n\n// We shorten anything used > 5 times\nvar assign = Object.assign;\nvar getDescriptor = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar objectPrototype = Object.prototype;\nvar EMPTY_ARRAY = [];\nObject.freeze(EMPTY_ARRAY);\nvar EMPTY_OBJECT = {};\nObject.freeze(EMPTY_OBJECT);\nvar hasProxy = typeof Proxy !== \"undefined\";\nvar plainObjectString = /*#__PURE__*/Object.toString();\nfunction assertProxies() {\n if (!hasProxy) {\n die(process.env.NODE_ENV !== \"production\" ? \"`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`\" : \"Proxy not available\");\n }\n}\nfunction warnAboutProxyRequirement(msg) {\n if (process.env.NODE_ENV !== \"production\" && globalState.verifyProxies) {\n die(\"MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to \" + msg);\n }\n}\nfunction getNextId() {\n return ++globalState.mobxGuid;\n}\n/**\r\n * Makes sure that the provided function is invoked at most once.\r\n */\nfunction once(func) {\n var invoked = false;\n return function () {\n if (invoked) {\n return;\n }\n invoked = true;\n return func.apply(this, arguments);\n };\n}\nvar noop = function noop() {};\nfunction isFunction(fn) {\n return typeof fn === \"function\";\n}\nfunction isStringish(value) {\n var t = typeof value;\n switch (t) {\n case \"string\":\n case \"symbol\":\n case \"number\":\n return true;\n }\n return false;\n}\nfunction isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nfunction isPlainObject(value) {\n if (!isObject(value)) {\n return false;\n }\n var proto = Object.getPrototypeOf(value);\n if (proto == null) {\n return true;\n }\n var protoConstructor = Object.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n return typeof protoConstructor === \"function\" && protoConstructor.toString() === plainObjectString;\n}\n// https://stackoverflow.com/a/37865170\nfunction isGenerator(obj) {\n var constructor = obj == null ? void 0 : obj.constructor;\n if (!constructor) {\n return false;\n }\n if (\"GeneratorFunction\" === constructor.name || \"GeneratorFunction\" === constructor.displayName) {\n return true;\n }\n return false;\n}\nfunction addHiddenProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: true,\n configurable: true,\n value: value\n });\n}\nfunction addHiddenFinalProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: false,\n configurable: true,\n value: value\n });\n}\nfunction createInstanceofPredicate(name, theClass) {\n var propName = \"isMobX\" + name;\n theClass.prototype[propName] = true;\n return function (x) {\n return isObject(x) && x[propName] === true;\n };\n}\nfunction isES6Map(thing) {\n return thing instanceof Map;\n}\nfunction isES6Set(thing) {\n return thing instanceof Set;\n}\nvar hasGetOwnPropertySymbols = typeof Object.getOwnPropertySymbols !== \"undefined\";\n/**\r\n * Returns the following: own enumerable keys and symbols.\r\n */\nfunction getPlainObjectKeys(object) {\n var keys = Object.keys(object);\n // Not supported in IE, so there are not going to be symbol props anyway...\n if (!hasGetOwnPropertySymbols) {\n return keys;\n }\n var symbols = Object.getOwnPropertySymbols(object);\n if (!symbols.length) {\n return keys;\n }\n return [].concat(keys, symbols.filter(function (s) {\n return objectPrototype.propertyIsEnumerable.call(object, s);\n }));\n}\n// From Immer utils\n// Returns all own keys, including non-enumerable and symbolic\nvar ownKeys = typeof Reflect !== \"undefined\" && Reflect.ownKeys ? Reflect.ownKeys : hasGetOwnPropertySymbols ? function (obj) {\n return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));\n} : /* istanbul ignore next */Object.getOwnPropertyNames;\nfunction stringifyKey(key) {\n if (typeof key === \"string\") {\n return key;\n }\n if (typeof key === \"symbol\") {\n return key.toString();\n }\n return new String(key).toString();\n}\nfunction toPrimitive(value) {\n return value === null ? null : typeof value === \"object\" ? \"\" + value : value;\n}\nfunction hasProp(target, prop) {\n return objectPrototype.hasOwnProperty.call(target, prop);\n}\n// From Immer utils\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(target) {\n // Polyfill needed for Hermes and IE, see https://github.com/facebook/hermes/issues/274\n var res = {};\n // Note: without polyfill for ownKeys, symbols won't be picked up\n ownKeys(target).forEach(function (key) {\n res[key] = getDescriptor(target, key);\n });\n return res;\n};\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n _setPrototypeOf(subClass, superClass);\n}\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n if (it) return (it = it.call(o)).next.bind(it);\n if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n return function () {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n };\n }\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction _toPrimitive(input, hint) {\n if (typeof input !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (typeof res !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nfunction _toPropertyKey(arg) {\n var key = _toPrimitive(arg, \"string\");\n return typeof key === \"symbol\" ? key : String(key);\n}\n\nvar storedAnnotationsSymbol = /*#__PURE__*/Symbol(\"mobx-stored-annotations\");\n/**\r\n * Creates a function that acts as\r\n * - decorator\r\n * - annotation object\r\n */\nfunction createDecoratorAnnotation(annotation) {\n function decorator(target, property) {\n storeAnnotation(target, property, annotation);\n }\n return Object.assign(decorator, annotation);\n}\n/**\r\n * Stores annotation to prototype,\r\n * so it can be inspected later by `makeObservable` called from constructor\r\n */\nfunction storeAnnotation(prototype, key, annotation) {\n if (!hasProp(prototype, storedAnnotationsSymbol)) {\n addHiddenProp(prototype, storedAnnotationsSymbol, _extends({}, prototype[storedAnnotationsSymbol]));\n }\n // @override must override something\n if (process.env.NODE_ENV !== \"production\" && isOverride(annotation) && !hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n die(\"'\" + fieldName + \"' is decorated with 'override', \" + \"but no such decorated member was found on prototype.\");\n }\n // Cannot re-decorate\n assertNotDecorated(prototype, annotation, key);\n // Ignore override\n if (!isOverride(annotation)) {\n prototype[storedAnnotationsSymbol][key] = annotation;\n }\n}\nfunction assertNotDecorated(prototype, annotation, key) {\n if (process.env.NODE_ENV !== \"production\" && !isOverride(annotation) && hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n var currentAnnotationType = prototype[storedAnnotationsSymbol][key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '@\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already decorated with '@\" + currentAnnotationType + \"'.\") + \"\\nRe-decorating fields is not allowed.\" + \"\\nUse '@override' decorator for methods overridden by subclass.\");\n }\n}\n/**\r\n * Collects annotations from prototypes and stores them on target (instance)\r\n */\nfunction collectStoredAnnotations(target) {\n if (!hasProp(target, storedAnnotationsSymbol)) {\n if (process.env.NODE_ENV !== \"production\" && !target[storedAnnotationsSymbol]) {\n die(\"No annotations were passed to makeObservable, but no decorated members have been found either\");\n }\n // We need a copy as we will remove annotation from the list once it's applied.\n addHiddenProp(target, storedAnnotationsSymbol, _extends({}, target[storedAnnotationsSymbol]));\n }\n return target[storedAnnotationsSymbol];\n}\n\nvar $mobx = /*#__PURE__*/Symbol(\"mobx administration\");\nvar Atom = /*#__PURE__*/function () {\n // for effective unobserving. BaseAtom has true, for extra optimization, so its onBecomeUnobserved never gets called, because it's not needed\n\n /**\r\n * Create a new atom. For debugging purposes it is recommended to give it a name.\r\n * The onBecomeObserved and onBecomeUnobserved callbacks can be used for resource management.\r\n */\n function Atom(name_) {\n if (name_ === void 0) {\n name_ = process.env.NODE_ENV !== \"production\" ? \"Atom@\" + getNextId() : \"Atom\";\n }\n this.name_ = void 0;\n this.isPendingUnobservation_ = false;\n this.isBeingObserved_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.NOT_TRACKING_;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n this.name_ = name_;\n }\n // onBecomeObservedListeners\n var _proto = Atom.prototype;\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\r\n * Invoke this method to notify mobx that your atom has been used somehow.\r\n * Returns true if there is currently a reactive context.\r\n */;\n _proto.reportObserved = function reportObserved$1() {\n return reportObserved(this);\n }\n /**\r\n * Invoke this method _after_ this method has changed to signal mobx that all its observers should invalidate.\r\n */;\n _proto.reportChanged = function reportChanged() {\n startBatch();\n propagateChanged(this);\n // We could update state version only at the end of batch,\n // but we would still have to switch some global flag here to signal a change.\n globalState.stateVersion = globalState.stateVersion < Number.MAX_SAFE_INTEGER ? globalState.stateVersion + 1 : Number.MIN_SAFE_INTEGER;\n endBatch();\n };\n _proto.toString = function toString() {\n return this.name_;\n };\n return Atom;\n}();\nvar isAtom = /*#__PURE__*/createInstanceofPredicate(\"Atom\", Atom);\nfunction createAtom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) {\n if (onBecomeObservedHandler === void 0) {\n onBecomeObservedHandler = noop;\n }\n if (onBecomeUnobservedHandler === void 0) {\n onBecomeUnobservedHandler = noop;\n }\n var atom = new Atom(name);\n // default `noop` listener will not initialize the hook Set\n if (onBecomeObservedHandler !== noop) {\n onBecomeObserved(atom, onBecomeObservedHandler);\n }\n if (onBecomeUnobservedHandler !== noop) {\n onBecomeUnobserved(atom, onBecomeUnobservedHandler);\n }\n return atom;\n}\n\nfunction identityComparer(a, b) {\n return a === b;\n}\nfunction structuralComparer(a, b) {\n return deepEqual(a, b);\n}\nfunction shallowComparer(a, b) {\n return deepEqual(a, b, 1);\n}\nfunction defaultComparer(a, b) {\n if (Object.is) {\n return Object.is(a, b);\n }\n return a === b ? a !== 0 || 1 / a === 1 / b : a !== a && b !== b;\n}\nvar comparer = {\n identity: identityComparer,\n structural: structuralComparer,\n \"default\": defaultComparer,\n shallow: shallowComparer\n};\n\nfunction deepEnhancer(v, _, name) {\n // it is an observable already, done\n if (isObservable(v)) {\n return v;\n }\n // something that can be converted and mutated?\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name\n });\n }\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name\n });\n }\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name\n });\n }\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name\n });\n }\n if (typeof v === \"function\" && !isAction(v) && !isFlow(v)) {\n if (isGenerator(v)) {\n return flow(v);\n } else {\n return autoAction(name, v);\n }\n }\n return v;\n}\nfunction shallowEnhancer(v, _, name) {\n if (v === undefined || v === null) {\n return v;\n }\n if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v) || isObservableSet(v)) {\n return v;\n }\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name,\n deep: false\n });\n }\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name,\n deep: false\n });\n }\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name,\n deep: false\n });\n }\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name,\n deep: false\n });\n }\n if (process.env.NODE_ENV !== \"production\") {\n die(\"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets\");\n }\n}\nfunction referenceEnhancer(newValue) {\n // never turn into an observable\n return newValue;\n}\nfunction refStructEnhancer(v, oldValue) {\n if (process.env.NODE_ENV !== \"production\" && isObservable(v)) {\n die(\"observable.struct should not be used with observable values\");\n }\n if (deepEqual(v, oldValue)) {\n return oldValue;\n }\n return v;\n}\n\nvar OVERRIDE = \"override\";\nvar override = /*#__PURE__*/createDecoratorAnnotation({\n annotationType_: OVERRIDE,\n make_: make_,\n extend_: extend_\n});\nfunction isOverride(annotation) {\n return annotation.annotationType_ === OVERRIDE;\n}\nfunction make_(adm, key) {\n // Must not be plain object\n if (process.env.NODE_ENV !== \"production\" && adm.isPlainObject_) {\n die(\"Cannot apply '\" + this.annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + this.annotationType_ + \"' cannot be used on plain objects.\"));\n }\n // Must override something\n if (process.env.NODE_ENV !== \"production\" && !hasProp(adm.appliedAnnotations_, key)) {\n die(\"'\" + adm.name_ + \".\" + key.toString() + \"' is annotated with '\" + this.annotationType_ + \"', \" + \"but no such annotated member was found on prototype.\");\n }\n return 0 /* Cancel */;\n}\n\nfunction extend_(adm, key, descriptor, proxyTrap) {\n die(\"'\" + this.annotationType_ + \"' can only be used with 'makeObservable'\");\n}\n\nfunction createActionAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$1,\n extend_: extend_$1\n };\n}\nfunction make_$1(adm, key, descriptor, source) {\n var _this$options_;\n // bound\n if ((_this$options_ = this.options_) != null && _this$options_.bound) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* Cancel */ : 1 /* Break */;\n }\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* Cancel */ : 2 /* Continue */;\n }\n // prototype\n if (isAction(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1 /* Break */;\n }\n\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor, false);\n defineProperty(source, key, actionDescriptor);\n return 2 /* Continue */;\n}\n\nfunction extend_$1(adm, key, descriptor, proxyTrap) {\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor);\n return adm.defineProperty_(key, actionDescriptor, proxyTrap);\n}\nfunction assertActionDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n if (process.env.NODE_ENV !== \"production\" && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a function value.\"));\n }\n}\nfunction createActionDescriptor(adm, annotation, key, descriptor,\n// provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n var _annotation$options_, _annotation$options_$, _annotation$options_2, _annotation$options_$2, _annotation$options_3, _annotation$options_4, _adm$proxy_2;\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n assertActionDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n if ((_annotation$options_ = annotation.options_) != null && _annotation$options_.bound) {\n var _adm$proxy_;\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n return {\n value: createAction((_annotation$options_$ = (_annotation$options_2 = annotation.options_) == null ? void 0 : _annotation$options_2.name) != null ? _annotation$options_$ : key.toString(), value, (_annotation$options_$2 = (_annotation$options_3 = annotation.options_) == null ? void 0 : _annotation$options_3.autoAction) != null ? _annotation$options_$2 : false,\n // https://github.com/mobxjs/mobx/discussions/3140\n (_annotation$options_4 = annotation.options_) != null && _annotation$options_4.bound ? (_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_ : undefined),\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createFlowAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$2,\n extend_: extend_$2\n };\n}\nfunction make_$2(adm, key, descriptor, source) {\n var _this$options_;\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* Cancel */ : 2 /* Continue */;\n }\n // prototype\n // bound - must annotate protos to support super.flow()\n if ((_this$options_ = this.options_) != null && _this$options_.bound && (!hasProp(adm.target_, key) || !isFlow(adm.target_[key]))) {\n if (this.extend_(adm, key, descriptor, false) === null) {\n return 0 /* Cancel */;\n }\n }\n\n if (isFlow(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1 /* Break */;\n }\n\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, false, false);\n defineProperty(source, key, flowDescriptor);\n return 2 /* Continue */;\n}\n\nfunction extend_$2(adm, key, descriptor, proxyTrap) {\n var _this$options_2;\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, (_this$options_2 = this.options_) == null ? void 0 : _this$options_2.bound);\n return adm.defineProperty_(key, flowDescriptor, proxyTrap);\n}\nfunction assertFlowDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n if (process.env.NODE_ENV !== \"production\" && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a generator function value.\"));\n }\n}\nfunction createFlowDescriptor(adm, annotation, key, descriptor, bound,\n// provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n assertFlowDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n // In case of flow.bound, the descriptor can be from already annotated prototype\n if (!isFlow(value)) {\n value = flow(value);\n }\n if (bound) {\n var _adm$proxy_;\n // We do not keep original function around, so we bind the existing flow\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n // This is normally set by `flow`, but `bind` returns new function...\n value.isMobXFlow = true;\n }\n return {\n value: value,\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createComputedAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$3,\n extend_: extend_$3\n };\n}\nfunction make_$3(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* Cancel */ : 1 /* Break */;\n}\n\nfunction extend_$3(adm, key, descriptor, proxyTrap) {\n assertComputedDescriptor(adm, this, key, descriptor);\n return adm.defineComputedProperty_(key, _extends({}, this.options_, {\n get: descriptor.get,\n set: descriptor.set\n }), proxyTrap);\n}\nfunction assertComputedDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var get = _ref2.get;\n if (process.env.NODE_ENV !== \"production\" && !get) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on getter(+setter) properties.\"));\n }\n}\n\nfunction createObservableAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$4,\n extend_: extend_$4\n };\n}\nfunction make_$4(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* Cancel */ : 1 /* Break */;\n}\n\nfunction extend_$4(adm, key, descriptor, proxyTrap) {\n var _this$options_$enhanc, _this$options_;\n assertObservableDescriptor(adm, this, key, descriptor);\n return adm.defineObservableProperty_(key, descriptor.value, (_this$options_$enhanc = (_this$options_ = this.options_) == null ? void 0 : _this$options_.enhancer) != null ? _this$options_$enhanc : deepEnhancer, proxyTrap);\n}\nfunction assertObservableDescriptor(adm, _ref, key, descriptor) {\n var annotationType_ = _ref.annotationType_;\n if (process.env.NODE_ENV !== \"production\" && !(\"value\" in descriptor)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' cannot be used on getter/setter properties\"));\n }\n}\n\nvar AUTO = \"true\";\nvar autoAnnotation = /*#__PURE__*/createAutoAnnotation();\nfunction createAutoAnnotation(options) {\n return {\n annotationType_: AUTO,\n options_: options,\n make_: make_$5,\n extend_: extend_$5\n };\n}\nfunction make_$5(adm, key, descriptor, source) {\n var _this$options_3, _this$options_4;\n // getter -> computed\n if (descriptor.get) {\n return computed.make_(adm, key, descriptor, source);\n }\n // lone setter -> action setter\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.make_\n var set = createAction(key.toString(), descriptor.set);\n // own\n if (source === adm.target_) {\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: set\n }) === null ? 0 /* Cancel */ : 2 /* Continue */;\n }\n // proto\n defineProperty(source, key, {\n configurable: true,\n set: set\n });\n return 2 /* Continue */;\n }\n // function on proto -> autoAction/flow\n if (source !== adm.target_ && typeof descriptor.value === \"function\") {\n var _this$options_2;\n if (isGenerator(descriptor.value)) {\n var _this$options_;\n var flowAnnotation = (_this$options_ = this.options_) != null && _this$options_.autoBind ? flow.bound : flow;\n return flowAnnotation.make_(adm, key, descriptor, source);\n }\n var actionAnnotation = (_this$options_2 = this.options_) != null && _this$options_2.autoBind ? autoAction.bound : autoAction;\n return actionAnnotation.make_(adm, key, descriptor, source);\n }\n // other -> observable\n // Copy props from proto as well, see test:\n // \"decorate should work with Object.create\"\n var observableAnnotation = ((_this$options_3 = this.options_) == null ? void 0 : _this$options_3.deep) === false ? observable.ref : observable;\n // if function respect autoBind option\n if (typeof descriptor.value === \"function\" && (_this$options_4 = this.options_) != null && _this$options_4.autoBind) {\n var _adm$proxy_;\n descriptor.value = descriptor.value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n return observableAnnotation.make_(adm, key, descriptor, source);\n}\nfunction extend_$5(adm, key, descriptor, proxyTrap) {\n var _this$options_5, _this$options_6;\n // getter -> computed\n if (descriptor.get) {\n return computed.extend_(adm, key, descriptor, proxyTrap);\n }\n // lone setter -> action setter\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.extend_\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: createAction(key.toString(), descriptor.set)\n }, proxyTrap);\n }\n // other -> observable\n // if function respect autoBind option\n if (typeof descriptor.value === \"function\" && (_this$options_5 = this.options_) != null && _this$options_5.autoBind) {\n var _adm$proxy_2;\n descriptor.value = descriptor.value.bind((_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_);\n }\n var observableAnnotation = ((_this$options_6 = this.options_) == null ? void 0 : _this$options_6.deep) === false ? observable.ref : observable;\n return observableAnnotation.extend_(adm, key, descriptor, proxyTrap);\n}\n\nvar OBSERVABLE = \"observable\";\nvar OBSERVABLE_REF = \"observable.ref\";\nvar OBSERVABLE_SHALLOW = \"observable.shallow\";\nvar OBSERVABLE_STRUCT = \"observable.struct\";\n// Predefined bags of create observable options, to avoid allocating temporarily option objects\n// in the majority of cases\nvar defaultCreateObservableOptions = {\n deep: true,\n name: undefined,\n defaultDecorator: undefined,\n proxy: true\n};\nObject.freeze(defaultCreateObservableOptions);\nfunction asCreateObservableOptions(thing) {\n return thing || defaultCreateObservableOptions;\n}\nvar observableAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE);\nvar observableRefAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_REF, {\n enhancer: referenceEnhancer\n});\nvar observableShallowAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_SHALLOW, {\n enhancer: shallowEnhancer\n});\nvar observableStructAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_STRUCT, {\n enhancer: refStructEnhancer\n});\nvar observableDecoratorAnnotation = /*#__PURE__*/createDecoratorAnnotation(observableAnnotation);\nfunction getEnhancerFromOptions(options) {\n return options.deep === true ? deepEnhancer : options.deep === false ? referenceEnhancer : getEnhancerFromAnnotation(options.defaultDecorator);\n}\nfunction getAnnotationFromOptions(options) {\n var _options$defaultDecor;\n return options ? (_options$defaultDecor = options.defaultDecorator) != null ? _options$defaultDecor : createAutoAnnotation(options) : undefined;\n}\nfunction getEnhancerFromAnnotation(annotation) {\n var _annotation$options_$, _annotation$options_;\n return !annotation ? deepEnhancer : (_annotation$options_$ = (_annotation$options_ = annotation.options_) == null ? void 0 : _annotation$options_.enhancer) != null ? _annotation$options_$ : deepEnhancer;\n}\n/**\r\n * Turns an object, array or function into a reactive structure.\r\n * @param v the value which should become observable.\r\n */\nfunction createObservable(v, arg2, arg3) {\n // @observable someProp;\n if (isStringish(arg2)) {\n storeAnnotation(v, arg2, observableAnnotation);\n return;\n }\n // already observable - ignore\n if (isObservable(v)) {\n return v;\n }\n // plain object\n if (isPlainObject(v)) {\n return observable.object(v, arg2, arg3);\n }\n // Array\n if (Array.isArray(v)) {\n return observable.array(v, arg2);\n }\n // Map\n if (isES6Map(v)) {\n return observable.map(v, arg2);\n }\n // Set\n if (isES6Set(v)) {\n return observable.set(v, arg2);\n }\n // other object - ignore\n if (typeof v === \"object\" && v !== null) {\n return v;\n }\n // anything else\n return observable.box(v, arg2);\n}\nassign(createObservable, observableDecoratorAnnotation);\nvar observableFactories = {\n box: function box(value, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableValue(value, getEnhancerFromOptions(o), o.name, true, o.equals);\n },\n array: function array(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return (globalState.useProxies === false || o.proxy === false ? createLegacyArray : createObservableArray)(initialValues, getEnhancerFromOptions(o), o.name);\n },\n map: function map(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableMap(initialValues, getEnhancerFromOptions(o), o.name);\n },\n set: function set(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableSet(initialValues, getEnhancerFromOptions(o), o.name);\n },\n object: function object(props, decorators, options) {\n return extendObservable(globalState.useProxies === false || (options == null ? void 0 : options.proxy) === false ? asObservableObject({}, options) : asDynamicObservableObject({}, options), props, decorators);\n },\n ref: /*#__PURE__*/createDecoratorAnnotation(observableRefAnnotation),\n shallow: /*#__PURE__*/createDecoratorAnnotation(observableShallowAnnotation),\n deep: observableDecoratorAnnotation,\n struct: /*#__PURE__*/createDecoratorAnnotation(observableStructAnnotation)\n};\n// eslint-disable-next-line\nvar observable = /*#__PURE__*/assign(createObservable, observableFactories);\n\nvar COMPUTED = \"computed\";\nvar COMPUTED_STRUCT = \"computed.struct\";\nvar computedAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED);\nvar computedStructAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED_STRUCT, {\n equals: comparer.structural\n});\n/**\r\n * Decorator for class properties: @computed get value() { return expr; }.\r\n * For legacy purposes also invokable as ES5 observable created: `computed(() => expr)`;\r\n */\nvar computed = function computed(arg1, arg2) {\n if (isStringish(arg2)) {\n // @computed\n return storeAnnotation(arg1, arg2, computedAnnotation);\n }\n if (isPlainObject(arg1)) {\n // @computed({ options })\n return createDecoratorAnnotation(createComputedAnnotation(COMPUTED, arg1));\n }\n // computed(expr, options?)\n if (process.env.NODE_ENV !== \"production\") {\n if (!isFunction(arg1)) {\n die(\"First argument to `computed` should be an expression.\");\n }\n if (isFunction(arg2)) {\n die(\"A setter as second argument is no longer supported, use `{ set: fn }` option instead\");\n }\n }\n var opts = isPlainObject(arg2) ? arg2 : {};\n opts.get = arg1;\n opts.name || (opts.name = arg1.name || \"\"); /* for generated name */\n return new ComputedValue(opts);\n};\nObject.assign(computed, computedAnnotation);\ncomputed.struct = /*#__PURE__*/createDecoratorAnnotation(computedStructAnnotation);\n\nvar _getDescriptor$config, _getDescriptor;\n// we don't use globalState for these in order to avoid possible issues with multiple\n// mobx versions\nvar currentActionId = 0;\nvar nextActionId = 1;\nvar isFunctionNameConfigurable = (_getDescriptor$config = (_getDescriptor = /*#__PURE__*/getDescriptor(function () {}, \"name\")) == null ? void 0 : _getDescriptor.configurable) != null ? _getDescriptor$config : false;\n// we can safely recycle this object\nvar tmpNameDescriptor = {\n value: \"action\",\n configurable: true,\n writable: false,\n enumerable: false\n};\nfunction createAction(actionName, fn, autoAction, ref) {\n if (autoAction === void 0) {\n autoAction = false;\n }\n if (process.env.NODE_ENV !== \"production\") {\n if (!isFunction(fn)) {\n die(\"`action` can only be invoked on functions\");\n }\n if (typeof actionName !== \"string\" || !actionName) {\n die(\"actions should have valid names, got: '\" + actionName + \"'\");\n }\n }\n function res() {\n return executeAction(actionName, autoAction, fn, ref || this, arguments);\n }\n res.isMobxAction = true;\n if (isFunctionNameConfigurable) {\n tmpNameDescriptor.value = actionName;\n defineProperty(res, \"name\", tmpNameDescriptor);\n }\n return res;\n}\nfunction executeAction(actionName, canRunAsDerivation, fn, scope, args) {\n var runInfo = _startAction(actionName, canRunAsDerivation, scope, args);\n try {\n return fn.apply(scope, args);\n } catch (err) {\n runInfo.error_ = err;\n throw err;\n } finally {\n _endAction(runInfo);\n }\n}\nfunction _startAction(actionName, canRunAsDerivation,\n// true for autoAction\nscope, args) {\n var notifySpy_ = process.env.NODE_ENV !== \"production\" && isSpyEnabled() && !!actionName;\n var startTime_ = 0;\n if (process.env.NODE_ENV !== \"production\" && notifySpy_) {\n startTime_ = Date.now();\n var flattenedArgs = args ? Array.from(args) : EMPTY_ARRAY;\n spyReportStart({\n type: ACTION,\n name: actionName,\n object: scope,\n arguments: flattenedArgs\n });\n }\n var prevDerivation_ = globalState.trackingDerivation;\n var runAsAction = !canRunAsDerivation || !prevDerivation_;\n startBatch();\n var prevAllowStateChanges_ = globalState.allowStateChanges; // by default preserve previous allow\n if (runAsAction) {\n untrackedStart();\n prevAllowStateChanges_ = allowStateChangesStart(true);\n }\n var prevAllowStateReads_ = allowStateReadsStart(true);\n var runInfo = {\n runAsAction_: runAsAction,\n prevDerivation_: prevDerivation_,\n prevAllowStateChanges_: prevAllowStateChanges_,\n prevAllowStateReads_: prevAllowStateReads_,\n notifySpy_: notifySpy_,\n startTime_: startTime_,\n actionId_: nextActionId++,\n parentActionId_: currentActionId\n };\n currentActionId = runInfo.actionId_;\n return runInfo;\n}\nfunction _endAction(runInfo) {\n if (currentActionId !== runInfo.actionId_) {\n die(30);\n }\n currentActionId = runInfo.parentActionId_;\n if (runInfo.error_ !== undefined) {\n globalState.suppressReactionErrors = true;\n }\n allowStateChangesEnd(runInfo.prevAllowStateChanges_);\n allowStateReadsEnd(runInfo.prevAllowStateReads_);\n endBatch();\n if (runInfo.runAsAction_) {\n untrackedEnd(runInfo.prevDerivation_);\n }\n if (process.env.NODE_ENV !== \"production\" && runInfo.notifySpy_) {\n spyReportEnd({\n time: Date.now() - runInfo.startTime_\n });\n }\n globalState.suppressReactionErrors = false;\n}\nfunction allowStateChanges(allowStateChanges, func) {\n var prev = allowStateChangesStart(allowStateChanges);\n try {\n return func();\n } finally {\n allowStateChangesEnd(prev);\n }\n}\nfunction allowStateChangesStart(allowStateChanges) {\n var prev = globalState.allowStateChanges;\n globalState.allowStateChanges = allowStateChanges;\n return prev;\n}\nfunction allowStateChangesEnd(prev) {\n globalState.allowStateChanges = prev;\n}\n\nvar _Symbol$toPrimitive;\nvar CREATE = \"create\";\n_Symbol$toPrimitive = Symbol.toPrimitive;\nvar ObservableValue = /*#__PURE__*/function (_Atom) {\n _inheritsLoose(ObservableValue, _Atom);\n function ObservableValue(value, enhancer, name_, notifySpy, equals) {\n var _this;\n if (name_ === void 0) {\n name_ = process.env.NODE_ENV !== \"production\" ? \"ObservableValue@\" + getNextId() : \"ObservableValue\";\n }\n if (notifySpy === void 0) {\n notifySpy = true;\n }\n if (equals === void 0) {\n equals = comparer[\"default\"];\n }\n _this = _Atom.call(this, name_) || this;\n _this.enhancer = void 0;\n _this.name_ = void 0;\n _this.equals = void 0;\n _this.hasUnreportedChange_ = false;\n _this.interceptors_ = void 0;\n _this.changeListeners_ = void 0;\n _this.value_ = void 0;\n _this.dehancer = void 0;\n _this.enhancer = enhancer;\n _this.name_ = name_;\n _this.equals = equals;\n _this.value_ = enhancer(value, undefined, name_);\n if (process.env.NODE_ENV !== \"production\" && notifySpy && isSpyEnabled()) {\n // only notify spy if this is a stand-alone observable\n spyReport({\n type: CREATE,\n object: _assertThisInitialized(_this),\n observableKind: \"value\",\n debugObjectName: _this.name_,\n newValue: \"\" + _this.value_\n });\n }\n return _this;\n }\n var _proto = ObservableValue.prototype;\n _proto.dehanceValue = function dehanceValue(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.set = function set(newValue) {\n var oldValue = this.value_;\n newValue = this.prepareNewValue_(newValue);\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportStart({\n type: UPDATE,\n object: this,\n observableKind: \"value\",\n debugObjectName: this.name_,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n this.setNewValue_(newValue);\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportEnd();\n }\n }\n };\n _proto.prepareNewValue_ = function prepareNewValue_(newValue) {\n checkIfStateModificationsAreAllowed(this);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this,\n type: UPDATE,\n newValue: newValue\n });\n if (!change) {\n return globalState.UNCHANGED;\n }\n newValue = change.newValue;\n }\n // apply modifier\n newValue = this.enhancer(newValue, this.value_, this.name_);\n return this.equals(this.value_, newValue) ? globalState.UNCHANGED : newValue;\n };\n _proto.setNewValue_ = function setNewValue_(newValue) {\n var oldValue = this.value_;\n this.value_ = newValue;\n this.reportChanged();\n if (hasListeners(this)) {\n notifyListeners(this, {\n type: UPDATE,\n object: this,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n };\n _proto.get = function get() {\n this.reportObserved();\n return this.dehanceValue(this.value_);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately) {\n listener({\n observableKind: \"value\",\n debugObjectName: this.name_,\n object: this,\n type: UPDATE,\n newValue: this.value_,\n oldValue: undefined\n });\n }\n return registerListener(this, listener);\n };\n _proto.raw = function raw() {\n // used by MST ot get undehanced value\n return this.value_;\n };\n _proto.toJSON = function toJSON() {\n return this.get();\n };\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.value_ + \"]\";\n };\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n _proto[_Symbol$toPrimitive] = function () {\n return this.valueOf();\n };\n return ObservableValue;\n}(Atom);\nvar isObservableValue = /*#__PURE__*/createInstanceofPredicate(\"ObservableValue\", ObservableValue);\n\nvar _Symbol$toPrimitive$1;\n/**\r\n * A node in the state dependency root that observes other nodes, and can be observed itself.\r\n *\r\n * ComputedValue will remember the result of the computation for the duration of the batch, or\r\n * while being observed.\r\n *\r\n * During this time it will recompute only when one of its direct dependencies changed,\r\n * but only when it is being accessed with `ComputedValue.get()`.\r\n *\r\n * Implementation description:\r\n * 1. First time it's being accessed it will compute and remember result\r\n * give back remembered result until 2. happens\r\n * 2. First time any deep dependency change, propagate POSSIBLY_STALE to all observers, wait for 3.\r\n * 3. When it's being accessed, recompute if any shallow dependency changed.\r\n * if result changed: propagate STALE to all observers, that were POSSIBLY_STALE from the last step.\r\n * go to step 2. either way\r\n *\r\n * If at any point it's outside batch and it isn't observed: reset everything and go to 1.\r\n */\n_Symbol$toPrimitive$1 = Symbol.toPrimitive;\nvar ComputedValue = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n // during tracking it's an array with new observed observers\n\n // to check for cycles\n\n // N.B: unminified as it is used by MST\n\n /**\r\n * Create a new computed value based on a function expression.\r\n *\r\n * The `name` property is for debug purposes only.\r\n *\r\n * The `equals` property specifies the comparer function to use to determine if a newly produced\r\n * value differs from the previous value. Two comparers are provided in the library; `defaultComparer`\r\n * compares based on identity comparison (===), and `structuralComparer` deeply compares the structure.\r\n * Structural comparison can be convenient if you always produce a new aggregated object and\r\n * don't want to notify observers if it is structurally the same.\r\n * This is useful for working with vectors, mouse coordinates etc.\r\n */\n function ComputedValue(options) {\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.observing_ = [];\n this.newObserving_ = null;\n this.isBeingObserved_ = false;\n this.isPendingUnobservation_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n this.unboundDepsCount_ = 0;\n this.value_ = new CaughtException(null);\n this.name_ = void 0;\n this.triggeredBy_ = void 0;\n this.isComputing_ = false;\n this.isRunningSetter_ = false;\n this.derivation = void 0;\n this.setter_ = void 0;\n this.isTracing_ = TraceMode.NONE;\n this.scope_ = void 0;\n this.equals_ = void 0;\n this.requiresReaction_ = void 0;\n this.keepAlive_ = void 0;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n if (!options.get) {\n die(31);\n }\n this.derivation = options.get;\n this.name_ = options.name || (process.env.NODE_ENV !== \"production\" ? \"ComputedValue@\" + getNextId() : \"ComputedValue\");\n if (options.set) {\n this.setter_ = createAction(process.env.NODE_ENV !== \"production\" ? this.name_ + \"-setter\" : \"ComputedValue-setter\", options.set);\n }\n this.equals_ = options.equals || (options.compareStructural || options.struct ? comparer.structural : comparer[\"default\"]);\n this.scope_ = options.context;\n this.requiresReaction_ = options.requiresReaction;\n this.keepAlive_ = !!options.keepAlive;\n }\n var _proto = ComputedValue.prototype;\n _proto.onBecomeStale_ = function onBecomeStale_() {\n propagateMaybeChanged(this);\n };\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\r\n * Returns the current value of this computed value.\r\n * Will evaluate its computation first if needed.\r\n */;\n _proto.get = function get() {\n if (this.isComputing_) {\n die(32, this.name_, this.derivation);\n }\n if (globalState.inBatch === 0 &&\n // !globalState.trackingDerivatpion &&\n this.observers_.size === 0 && !this.keepAlive_) {\n if (shouldCompute(this)) {\n this.warnAboutUntrackedRead_();\n startBatch(); // See perf test 'computed memoization'\n this.value_ = this.computeValue_(false);\n endBatch();\n }\n } else {\n reportObserved(this);\n if (shouldCompute(this)) {\n var prevTrackingContext = globalState.trackingContext;\n if (this.keepAlive_ && !prevTrackingContext) {\n globalState.trackingContext = this;\n }\n if (this.trackAndCompute()) {\n propagateChangeConfirmed(this);\n }\n globalState.trackingContext = prevTrackingContext;\n }\n }\n var result = this.value_;\n if (isCaughtException(result)) {\n throw result.cause;\n }\n return result;\n };\n _proto.set = function set(value) {\n if (this.setter_) {\n if (this.isRunningSetter_) {\n die(33, this.name_);\n }\n this.isRunningSetter_ = true;\n try {\n this.setter_.call(this.scope_, value);\n } finally {\n this.isRunningSetter_ = false;\n }\n } else {\n die(34, this.name_);\n }\n };\n _proto.trackAndCompute = function trackAndCompute() {\n // N.B: unminified as it is used by MST\n var oldValue = this.value_;\n var wasSuspended = /* see #1208 */this.dependenciesState_ === IDerivationState_.NOT_TRACKING_;\n var newValue = this.computeValue_(true);\n var changed = wasSuspended || isCaughtException(oldValue) || isCaughtException(newValue) || !this.equals_(oldValue, newValue);\n if (changed) {\n this.value_ = newValue;\n if (process.env.NODE_ENV !== \"production\" && isSpyEnabled()) {\n spyReport({\n observableKind: \"computed\",\n debugObjectName: this.name_,\n object: this.scope_,\n type: \"update\",\n oldValue: oldValue,\n newValue: newValue\n });\n }\n }\n return changed;\n };\n _proto.computeValue_ = function computeValue_(track) {\n this.isComputing_ = true;\n // don't allow state changes during computation\n var prev = allowStateChangesStart(false);\n var res;\n if (track) {\n res = trackDerivedFunction(this, this.derivation, this.scope_);\n } else {\n if (globalState.disableErrorBoundaries === true) {\n res = this.derivation.call(this.scope_);\n } else {\n try {\n res = this.derivation.call(this.scope_);\n } catch (e) {\n res = new CaughtException(e);\n }\n }\n }\n allowStateChangesEnd(prev);\n this.isComputing_ = false;\n return res;\n };\n _proto.suspend_ = function suspend_() {\n if (!this.keepAlive_) {\n clearObserving(this);\n this.value_ = undefined; // don't hold on to computed value!\n if (process.env.NODE_ENV !== \"production\" && this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' was suspended and it will recompute on the next access.\");\n }\n }\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n var _this = this;\n var firstTime = true;\n var prevValue = undefined;\n return autorun(function () {\n // TODO: why is this in a different place than the spyReport() function? in all other observables it's called in the same place\n var newValue = _this.get();\n if (!firstTime || fireImmediately) {\n var prevU = untrackedStart();\n listener({\n observableKind: \"computed\",\n debugObjectName: _this.name_,\n type: UPDATE,\n object: _this,\n newValue: newValue,\n oldValue: prevValue\n });\n untrackedEnd(prevU);\n }\n firstTime = false;\n prevValue = newValue;\n });\n };\n _proto.warnAboutUntrackedRead_ = function warnAboutUntrackedRead_() {\n if (!(process.env.NODE_ENV !== \"production\")) {\n return;\n }\n if (this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n if (typeof this.requiresReaction_ === \"boolean\" ? this.requiresReaction_ : globalState.computedRequiresReaction) {\n console.warn(\"[mobx] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n };\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.derivation.toString() + \"]\";\n };\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n _proto[_Symbol$toPrimitive$1] = function () {\n return this.valueOf();\n };\n return ComputedValue;\n}();\nvar isComputedValue = /*#__PURE__*/createInstanceofPredicate(\"ComputedValue\", ComputedValue);\n\nvar IDerivationState_;\n(function (IDerivationState_) {\n // before being run or (outside batch and not being observed)\n // at this point derivation is not holding any data about dependency tree\n IDerivationState_[IDerivationState_[\"NOT_TRACKING_\"] = -1] = \"NOT_TRACKING_\";\n // no shallow dependency changed since last computation\n // won't recalculate derivation\n // this is what makes mobx fast\n IDerivationState_[IDerivationState_[\"UP_TO_DATE_\"] = 0] = \"UP_TO_DATE_\";\n // some deep dependency changed, but don't know if shallow dependency changed\n // will require to check first if UP_TO_DATE or POSSIBLY_STALE\n // currently only ComputedValue will propagate POSSIBLY_STALE\n //\n // having this state is second big optimization:\n // don't have to recompute on every dependency change, but only when it's needed\n IDerivationState_[IDerivationState_[\"POSSIBLY_STALE_\"] = 1] = \"POSSIBLY_STALE_\";\n // A shallow dependency has changed since last computation and the derivation\n // will need to recompute when it's needed next.\n IDerivationState_[IDerivationState_[\"STALE_\"] = 2] = \"STALE_\";\n})(IDerivationState_ || (IDerivationState_ = {}));\nvar TraceMode;\n(function (TraceMode) {\n TraceMode[TraceMode[\"NONE\"] = 0] = \"NONE\";\n TraceMode[TraceMode[\"LOG\"] = 1] = \"LOG\";\n TraceMode[TraceMode[\"BREAK\"] = 2] = \"BREAK\";\n})(TraceMode || (TraceMode = {}));\nvar CaughtException = function CaughtException(cause) {\n this.cause = void 0;\n this.cause = cause;\n // Empty\n};\n\nfunction isCaughtException(e) {\n return e instanceof CaughtException;\n}\n/**\r\n * Finds out whether any dependency of the derivation has actually changed.\r\n * If dependenciesState is 1 then it will recalculate dependencies,\r\n * if any dependency changed it will propagate it by changing dependenciesState to 2.\r\n *\r\n * By iterating over the dependencies in the same order that they were reported and\r\n * stopping on the first change, all the recalculations are only called for ComputedValues\r\n * that will be tracked by derivation. That is because we assume that if the first x\r\n * dependencies of the derivation doesn't change then the derivation should run the same way\r\n * up until accessing x-th dependency.\r\n */\nfunction shouldCompute(derivation) {\n switch (derivation.dependenciesState_) {\n case IDerivationState_.UP_TO_DATE_:\n return false;\n case IDerivationState_.NOT_TRACKING_:\n case IDerivationState_.STALE_:\n return true;\n case IDerivationState_.POSSIBLY_STALE_:\n {\n // state propagation can occur outside of action/reactive context #2195\n var prevAllowStateReads = allowStateReadsStart(true);\n var prevUntracked = untrackedStart(); // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\n var obs = derivation.observing_,\n l = obs.length;\n for (var i = 0; i < l; i++) {\n var obj = obs[i];\n if (isComputedValue(obj)) {\n if (globalState.disableErrorBoundaries) {\n obj.get();\n } else {\n try {\n obj.get();\n } catch (e) {\n // we are not interested in the value *or* exception at this moment, but if there is one, notify all\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\n // and `derivation` is an observer of `obj`\n // invariantShouldCompute(derivation)\n if (derivation.dependenciesState_ === IDerivationState_.STALE_) {\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n }\n changeDependenciesStateTo0(derivation);\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return false;\n }\n }\n}\nfunction isComputingDerivation() {\n return globalState.trackingDerivation !== null; // filter out actions inside computations\n}\n\nfunction checkIfStateModificationsAreAllowed(atom) {\n if (!(process.env.NODE_ENV !== \"production\")) {\n return;\n }\n var hasObservers = atom.observers_.size > 0;\n // Should not be possible to change observed state outside strict mode, except during initialization, see #563\n if (!globalState.allowStateChanges && (hasObservers || globalState.enforceActions === \"always\")) {\n console.warn(\"[MobX] \" + (globalState.enforceActions ? \"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: \" : \"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: \") + atom.name_);\n }\n}\nfunction checkIfStateReadsAreAllowed(observable) {\n if (process.env.NODE_ENV !== \"production\" && !globalState.allowStateReads && globalState.observableRequiresReaction) {\n console.warn(\"[mobx] Observable '\" + observable.name_ + \"' being read outside a reactive context.\");\n }\n}\n/**\r\n * Executes the provided function `f` and tracks which observables are being accessed.\r\n * The tracking information is stored on the `derivation` object and the derivation is registered\r\n * as observer of any of the accessed observables.\r\n */\nfunction trackDerivedFunction(derivation, f, context) {\n var prevAllowStateReads = allowStateReadsStart(true);\n // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n changeDependenciesStateTo0(derivation);\n derivation.newObserving_ = new Array(derivation.observing_.length + 100);\n derivation.unboundDepsCount_ = 0;\n derivation.runId_ = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n globalState.inBatch++;\n var result;\n if (globalState.disableErrorBoundaries === true) {\n result = f.call(context);\n } else {\n try {\n result = f.call(context);\n } catch (e) {\n result = new CaughtException(e);\n }\n }\n globalState.inBatch--;\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n warnAboutDerivationWithoutDependencies(derivation);\n allowStateReadsEnd(prevAllowStateReads);\n return result;\n}\nfunction warnAboutDerivationWithoutDependencies(derivation) {\n if (!(process.env.NODE_ENV !== \"production\")) {\n return;\n }\n if (derivation.observing_.length !== 0) {\n return;\n }\n if (typeof derivation.requiresObservable_ === \"boolean\" ? derivation.requiresObservable_ : globalState.reactionRequiresObservable) {\n console.warn(\"[mobx] Derivation '\" + derivation.name_ + \"' is created/updated without reading any observable value.\");\n }\n}\n/**\r\n * diffs newObserving with observing.\r\n * update observing to be newObserving with unique observables\r\n * notify observers that become observed/unobserved\r\n */\nfunction bindDependencies(derivation) {\n // invariant(derivation.dependenciesState !== IDerivationState.NOT_TRACKING, \"INTERNAL ERROR bindDependencies expects derivation.dependenciesState !== -1\");\n var prevObserving = derivation.observing_;\n var observing = derivation.observing_ = derivation.newObserving_;\n var lowestNewObservingDerivationState = IDerivationState_.UP_TO_DATE_;\n // Go through all new observables and check diffValue: (this list can contain duplicates):\n // 0: first occurrence, change to 1 and keep it\n // 1: extra occurrence, drop it\n var i0 = 0,\n l = derivation.unboundDepsCount_;\n for (var i = 0; i < l; i++) {\n var dep = observing[i];\n if (dep.diffValue_ === 0) {\n dep.diffValue_ = 1;\n if (i0 !== i) {\n observing[i0] = dep;\n }\n i0++;\n }\n // Upcast is 'safe' here, because if dep is IObservable, `dependenciesState` will be undefined,\n // not hitting the condition\n if (dep.dependenciesState_ > lowestNewObservingDerivationState) {\n lowestNewObservingDerivationState = dep.dependenciesState_;\n }\n }\n observing.length = i0;\n derivation.newObserving_ = null; // newObserving shouldn't be needed outside tracking (statement moved down to work around FF bug, see #614)\n // Go through all old observables and check diffValue: (it is unique after last bindDependencies)\n // 0: it's not in new observables, unobserve it\n // 1: it keeps being observed, don't want to notify it. change to 0\n l = prevObserving.length;\n while (l--) {\n var _dep = prevObserving[l];\n if (_dep.diffValue_ === 0) {\n removeObserver(_dep, derivation);\n }\n _dep.diffValue_ = 0;\n }\n // Go through all new observables and check diffValue: (now it should be unique)\n // 0: it was set to 0 in last loop. don't need to do anything.\n // 1: it wasn't observed, let's observe it. set back to 0\n while (i0--) {\n var _dep2 = observing[i0];\n if (_dep2.diffValue_ === 1) {\n _dep2.diffValue_ = 0;\n addObserver(_dep2, derivation);\n }\n }\n // Some new observed derivations may become stale during this derivation computation\n // so they have had no chance to propagate staleness (#916)\n if (lowestNewObservingDerivationState !== IDerivationState_.UP_TO_DATE_) {\n derivation.dependenciesState_ = lowestNewObservingDerivationState;\n derivation.onBecomeStale_();\n }\n}\nfunction clearObserving(derivation) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR clearObserving should be called only inside batch\");\n var obs = derivation.observing_;\n derivation.observing_ = [];\n var i = obs.length;\n while (i--) {\n removeObserver(obs[i], derivation);\n }\n derivation.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n}\nfunction untracked(action) {\n var prev = untrackedStart();\n try {\n return action();\n } finally {\n untrackedEnd(prev);\n }\n}\nfunction untrackedStart() {\n var prev = globalState.trackingDerivation;\n globalState.trackingDerivation = null;\n return prev;\n}\nfunction untrackedEnd(prev) {\n globalState.trackingDerivation = prev;\n}\nfunction allowStateReadsStart(allowStateReads) {\n var prev = globalState.allowStateReads;\n globalState.allowStateReads = allowStateReads;\n return prev;\n}\nfunction allowStateReadsEnd(prev) {\n globalState.allowStateReads = prev;\n}\n/**\r\n * needed to keep `lowestObserverState` correct. when changing from (2 or 1) to 0\r\n *\r\n */\nfunction changeDependenciesStateTo0(derivation) {\n if (derivation.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n return;\n }\n derivation.dependenciesState_ = IDerivationState_.UP_TO_DATE_;\n var obs = derivation.observing_;\n var i = obs.length;\n while (i--) {\n obs[i].lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n}\n\n/**\r\n * These values will persist if global state is reset\r\n */\nvar persistentKeys = [\"mobxGuid\", \"spyListeners\", \"enforceActions\", \"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"allowStateReads\", \"disableErrorBoundaries\", \"runId\", \"UNCHANGED\", \"useProxies\"];\nvar MobXGlobals = function MobXGlobals() {\n this.version = 6;\n this.UNCHANGED = {};\n this.trackingDerivation = null;\n this.trackingContext = null;\n this.runId = 0;\n this.mobxGuid = 0;\n this.inBatch = 0;\n this.pendingUnobservations = [];\n this.pendingReactions = [];\n this.isRunningReactions = false;\n this.allowStateChanges = false;\n this.allowStateReads = true;\n this.enforceActions = true;\n this.spyListeners = [];\n this.globalReactionErrorHandlers = [];\n this.computedRequiresReaction = false;\n this.reactionRequiresObservable = false;\n this.observableRequiresReaction = false;\n this.disableErrorBoundaries = false;\n this.suppressReactionErrors = false;\n this.useProxies = true;\n this.verifyProxies = false;\n this.safeDescriptors = true;\n this.stateVersion = Number.MIN_SAFE_INTEGER;\n};\nvar canMergeGlobalState = true;\nvar isolateCalled = false;\nvar globalState = /*#__PURE__*/function () {\n var global = /*#__PURE__*/getGlobal();\n if (global.__mobxInstanceCount > 0 && !global.__mobxGlobals) {\n canMergeGlobalState = false;\n }\n if (global.__mobxGlobals && global.__mobxGlobals.version !== new MobXGlobals().version) {\n canMergeGlobalState = false;\n }\n if (!canMergeGlobalState) {\n // Because this is a IIFE we need to let isolateCalled a chance to change\n // so we run it after the event loop completed at least 1 iteration\n setTimeout(function () {\n if (!isolateCalled) {\n die(35);\n }\n }, 1);\n return new MobXGlobals();\n } else if (global.__mobxGlobals) {\n global.__mobxInstanceCount += 1;\n if (!global.__mobxGlobals.UNCHANGED) {\n global.__mobxGlobals.UNCHANGED = {};\n } // make merge backward compatible\n return global.__mobxGlobals;\n } else {\n global.__mobxInstanceCount = 1;\n return global.__mobxGlobals = /*#__PURE__*/new MobXGlobals();\n }\n}();\nfunction isolateGlobalState() {\n if (globalState.pendingReactions.length || globalState.inBatch || globalState.isRunningReactions) {\n die(36);\n }\n isolateCalled = true;\n if (canMergeGlobalState) {\n var global = getGlobal();\n if (--global.__mobxInstanceCount === 0) {\n global.__mobxGlobals = undefined;\n }\n globalState = new MobXGlobals();\n }\n}\nfunction getGlobalState() {\n return globalState;\n}\n/**\r\n * For testing purposes only; this will break the internal state of existing observables,\r\n * but can be used to get back at a stable state after throwing errors\r\n */\nfunction resetGlobalState() {\n var defaultGlobals = new MobXGlobals();\n for (var key in defaultGlobals) {\n if (persistentKeys.indexOf(key) === -1) {\n globalState[key] = defaultGlobals[key];\n }\n }\n globalState.allowStateChanges = !globalState.enforceActions;\n}\n\nfunction hasObservers(observable) {\n return observable.observers_ && observable.observers_.size > 0;\n}\nfunction getObservers(observable) {\n return observable.observers_;\n}\n// function invariantObservers(observable: IObservable) {\n// const list = observable.observers\n// const map = observable.observersIndexes\n// const l = list.length\n// for (let i = 0; i < l; i++) {\n// const id = list[i].__mapid\n// if (i) {\n// invariant(map[id] === i, \"INTERNAL ERROR maps derivation.__mapid to index in list\") // for performance\n// } else {\n// invariant(!(id in map), \"INTERNAL ERROR observer on index 0 shouldn't be held in map.\") // for performance\n// }\n// }\n// invariant(\n// list.length === 0 || Object.keys(map).length === list.length - 1,\n// \"INTERNAL ERROR there is no junk in map\"\n// )\n// }\nfunction addObserver(observable, node) {\n // invariant(node.dependenciesState !== -1, \"INTERNAL ERROR, can add only dependenciesState !== -1\");\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR add already added node\");\n // invariantObservers(observable);\n observable.observers_.add(node);\n if (observable.lowestObserverState_ > node.dependenciesState_) {\n observable.lowestObserverState_ = node.dependenciesState_;\n }\n // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR didn't add node\");\n}\n\nfunction removeObserver(observable, node) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR, remove should be called only inside batch\");\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR remove already removed node\");\n // invariantObservers(observable);\n observable.observers_[\"delete\"](node);\n if (observable.observers_.size === 0) {\n // deleting last observer\n queueForUnobservation(observable);\n }\n // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR remove already removed node2\");\n}\n\nfunction queueForUnobservation(observable) {\n if (observable.isPendingUnobservation_ === false) {\n // invariant(observable._observers.length === 0, \"INTERNAL ERROR, should only queue for unobservation unobserved observables\");\n observable.isPendingUnobservation_ = true;\n globalState.pendingUnobservations.push(observable);\n }\n}\n/**\r\n * Batch starts a transaction, at least for purposes of memoizing ComputedValues when nothing else does.\r\n * During a batch `onBecomeUnobserved` will be called at most once per observable.\r\n * Avoids unnecessary recalculations.\r\n */\nfunction startBatch() {\n globalState.inBatch++;\n}\nfunction endBatch() {\n if (--globalState.inBatch === 0) {\n runReactions();\n // the batch is actually about to finish, all unobserving should happen here.\n var list = globalState.pendingUnobservations;\n for (var i = 0; i < list.length; i++) {\n var observable = list[i];\n observable.isPendingUnobservation_ = false;\n if (observable.observers_.size === 0) {\n if (observable.isBeingObserved_) {\n // if this observable had reactive observers, trigger the hooks\n observable.isBeingObserved_ = false;\n observable.onBUO();\n }\n if (observable instanceof ComputedValue) {\n // computed values are automatically teared down when the last observer leaves\n // this process happens recursively, this computed might be the last observabe of another, etc..\n observable.suspend_();\n }\n }\n }\n globalState.pendingUnobservations = [];\n }\n}\nfunction reportObserved(observable) {\n checkIfStateReadsAreAllowed(observable);\n var derivation = globalState.trackingDerivation;\n if (derivation !== null) {\n /**\r\n * Simple optimization, give each derivation run an unique id (runId)\r\n * Check if last time this observable was accessed the same runId is used\r\n * if this is the case, the relation is already known\r\n */\n if (derivation.runId_ !== observable.lastAccessedBy_) {\n observable.lastAccessedBy_ = derivation.runId_;\n // Tried storing newObserving, or observing, or both as Set, but performance didn't come close...\n derivation.newObserving_[derivation.unboundDepsCount_++] = observable;\n if (!observable.isBeingObserved_ && globalState.trackingContext) {\n observable.isBeingObserved_ = true;\n observable.onBO();\n }\n }\n return observable.isBeingObserved_;\n } else if (observable.observers_.size === 0 && globalState.inBatch > 0) {\n queueForUnobservation(observable);\n }\n return false;\n}\n// function invariantLOS(observable: IObservable, msg: string) {\n// // it's expensive so better not run it in produciton. but temporarily helpful for testing\n// const min = getObservers(observable).reduce((a, b) => Math.min(a, b.dependenciesState), 2)\n// if (min >= observable.lowestObserverState) return // <- the only assumption about `lowestObserverState`\n// throw new Error(\n// \"lowestObserverState is wrong for \" +\n// msg +\n// \" because \" +\n// min +\n// \" < \" +\n// observable.lowestObserverState\n// )\n// }\n/**\r\n * NOTE: current propagation mechanism will in case of self reruning autoruns behave unexpectedly\r\n * It will propagate changes to observers from previous run\r\n * It's hard or maybe impossible (with reasonable perf) to get it right with current approach\r\n * Hopefully self reruning autoruns aren't a feature people should depend on\r\n * Also most basic use cases should be ok\r\n */\n// Called by Atom when its value changes\nfunction propagateChanged(observable) {\n // invariantLOS(observable, \"changed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n observable.lowestObserverState_ = IDerivationState_.STALE_;\n // Ideally we use for..of here, but the downcompiled version is really slow...\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n if (process.env.NODE_ENV !== \"production\" && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n d.onBecomeStale_();\n }\n d.dependenciesState_ = IDerivationState_.STALE_;\n });\n // invariantLOS(observable, \"changed end\");\n}\n// Called by ComputedValue when it recalculate and its value changed\nfunction propagateChangeConfirmed(observable) {\n // invariantLOS(observable, \"confirmed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n observable.lowestObserverState_ = IDerivationState_.STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.POSSIBLY_STALE_) {\n d.dependenciesState_ = IDerivationState_.STALE_;\n if (process.env.NODE_ENV !== \"production\" && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n } else if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_ // this happens during computing of `d`, just keep lowestObserverState up to date.\n ) {\n observable.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n });\n // invariantLOS(observable, \"confirmed end\");\n}\n// Used by computed when its dependency changed, but we don't wan't to immediately recompute.\nfunction propagateMaybeChanged(observable) {\n // invariantLOS(observable, \"maybe start\");\n if (observable.lowestObserverState_ !== IDerivationState_.UP_TO_DATE_) {\n return;\n }\n observable.lowestObserverState_ = IDerivationState_.POSSIBLY_STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n d.dependenciesState_ = IDerivationState_.POSSIBLY_STALE_;\n d.onBecomeStale_();\n }\n });\n // invariantLOS(observable, \"maybe end\");\n}\n\nfunction logTraceInfo(derivation, observable) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' is invalidated due to a change in: '\" + observable.name_ + \"'\");\n if (derivation.isTracing_ === TraceMode.BREAK) {\n var lines = [];\n printDepTree(getDependencyTree(derivation), lines, 1);\n // prettier-ignore\n new Function(\"debugger;\\n/*\\nTracing '\" + derivation.name_ + \"'\\n\\nYou are entering this break point because derivation '\" + derivation.name_ + \"' is being traced and '\" + observable.name_ + \"' is now forcing it to update.\\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\\n\\n\" + (derivation instanceof ComputedValue ? derivation.derivation.toString().replace(/[*]\\//g, \"/\") : \"\") + \"\\n\\nThe dependencies for this derivation are:\\n\\n\" + lines.join(\"\\n\") + \"\\n*/\\n \")();\n }\n}\nfunction printDepTree(tree, lines, depth) {\n if (lines.length >= 1000) {\n lines.push(\"(and many more)\");\n return;\n }\n lines.push(\"\" + \"\\t\".repeat(depth - 1) + tree.name);\n if (tree.dependencies) {\n tree.dependencies.forEach(function (child) {\n return printDepTree(child, lines, depth + 1);\n });\n }\n}\n\nvar Reaction = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n\n function Reaction(name_, onInvalidate_, errorHandler_, requiresObservable_) {\n if (name_ === void 0) {\n name_ = process.env.NODE_ENV !== \"production\" ? \"Reaction@\" + getNextId() : \"Reaction\";\n }\n this.name_ = void 0;\n this.onInvalidate_ = void 0;\n this.errorHandler_ = void 0;\n this.requiresObservable_ = void 0;\n this.observing_ = [];\n this.newObserving_ = [];\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.unboundDepsCount_ = 0;\n this.isDisposed_ = false;\n this.isScheduled_ = false;\n this.isTrackPending_ = false;\n this.isRunning_ = false;\n this.isTracing_ = TraceMode.NONE;\n this.name_ = name_;\n this.onInvalidate_ = onInvalidate_;\n this.errorHandler_ = errorHandler_;\n this.requiresObservable_ = requiresObservable_;\n }\n var _proto = Reaction.prototype;\n _proto.onBecomeStale_ = function onBecomeStale_() {\n this.schedule_();\n };\n _proto.schedule_ = function schedule_() {\n if (!this.isScheduled_) {\n this.isScheduled_ = true;\n globalState.pendingReactions.push(this);\n runReactions();\n }\n };\n _proto.isScheduled = function isScheduled() {\n return this.isScheduled_;\n }\n /**\r\n * internal, use schedule() if you intend to kick off a reaction\r\n */;\n _proto.runReaction_ = function runReaction_() {\n if (!this.isDisposed_) {\n startBatch();\n this.isScheduled_ = false;\n var prev = globalState.trackingContext;\n globalState.trackingContext = this;\n if (shouldCompute(this)) {\n this.isTrackPending_ = true;\n try {\n this.onInvalidate_();\n if (process.env.NODE_ENV !== \"production\" && this.isTrackPending_ && isSpyEnabled()) {\n // onInvalidate didn't trigger track right away..\n spyReport({\n name: this.name_,\n type: \"scheduled-reaction\"\n });\n }\n } catch (e) {\n this.reportExceptionInDerivation_(e);\n }\n }\n globalState.trackingContext = prev;\n endBatch();\n }\n };\n _proto.track = function track(fn) {\n if (this.isDisposed_) {\n return;\n // console.warn(\"Reaction already disposed\") // Note: Not a warning / error in mobx 4 either\n }\n\n startBatch();\n var notify = isSpyEnabled();\n var startTime;\n if (process.env.NODE_ENV !== \"production\" && notify) {\n startTime = Date.now();\n spyReportStart({\n name: this.name_,\n type: \"reaction\"\n });\n }\n this.isRunning_ = true;\n var prevReaction = globalState.trackingContext; // reactions could create reactions...\n globalState.trackingContext = this;\n var result = trackDerivedFunction(this, fn, undefined);\n globalState.trackingContext = prevReaction;\n this.isRunning_ = false;\n this.isTrackPending_ = false;\n if (this.isDisposed_) {\n // disposed during last run. Clean up everything that was bound after the dispose call.\n clearObserving(this);\n }\n if (isCaughtException(result)) {\n this.reportExceptionInDerivation_(result.cause);\n }\n if (process.env.NODE_ENV !== \"production\" && notify) {\n spyReportEnd({\n time: Date.now() - startTime\n });\n }\n endBatch();\n };\n _proto.reportExceptionInDerivation_ = function reportExceptionInDerivation_(error) {\n var _this = this;\n if (this.errorHandler_) {\n this.errorHandler_(error, this);\n return;\n }\n if (globalState.disableErrorBoundaries) {\n throw error;\n }\n var message = process.env.NODE_ENV !== \"production\" ? \"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '\" + this + \"'\" : \"[mobx] uncaught error in '\" + this + \"'\";\n if (!globalState.suppressReactionErrors) {\n console.error(message, error);\n /** If debugging brought you here, please, read the above message :-). Tnx! */\n } else if (process.env.NODE_ENV !== \"production\") {\n console.warn(\"[mobx] (error in reaction '\" + this.name_ + \"' suppressed, fix error of causing action below)\");\n } // prettier-ignore\n if (process.env.NODE_ENV !== \"production\" && isSpyEnabled()) {\n spyReport({\n type: \"error\",\n name: this.name_,\n message: message,\n error: \"\" + error\n });\n }\n globalState.globalReactionErrorHandlers.forEach(function (f) {\n return f(error, _this);\n });\n };\n _proto.dispose = function dispose() {\n if (!this.isDisposed_) {\n this.isDisposed_ = true;\n if (!this.isRunning_) {\n // if disposed while running, clean up later. Maybe not optimal, but rare case\n startBatch();\n clearObserving(this);\n endBatch();\n }\n }\n };\n _proto.getDisposer_ = function getDisposer_(abortSignal) {\n var _this2 = this;\n var dispose = function dispose() {\n _this2.dispose();\n abortSignal == null ? void 0 : abortSignal.removeEventListener == null ? void 0 : abortSignal.removeEventListener(\"abort\", dispose);\n };\n abortSignal == null ? void 0 : abortSignal.addEventListener == null ? void 0 : abortSignal.addEventListener(\"abort\", dispose);\n dispose[$mobx] = this;\n return dispose;\n };\n _proto.toString = function toString() {\n return \"Reaction[\" + this.name_ + \"]\";\n };\n _proto.trace = function trace$1(enterBreakPoint) {\n if (enterBreakPoint === void 0) {\n enterBreakPoint = false;\n }\n trace(this, enterBreakPoint);\n };\n return Reaction;\n}();\nfunction onReactionError(handler) {\n globalState.globalReactionErrorHandlers.push(handler);\n return function () {\n var idx = globalState.globalReactionErrorHandlers.indexOf(handler);\n if (idx >= 0) {\n globalState.globalReactionErrorHandlers.splice(idx, 1);\n }\n };\n}\n/**\r\n * Magic number alert!\r\n * Defines within how many times a reaction is allowed to re-trigger itself\r\n * until it is assumed that this is gonna be a never ending loop...\r\n */\nvar MAX_REACTION_ITERATIONS = 100;\nvar reactionScheduler = function reactionScheduler(f) {\n return f();\n};\nfunction runReactions() {\n // Trampolining, if runReactions are already running, new reactions will be picked up\n if (globalState.inBatch > 0 || globalState.isRunningReactions) {\n return;\n }\n reactionScheduler(runReactionsHelper);\n}\nfunction runReactionsHelper() {\n globalState.isRunningReactions = true;\n var allReactions = globalState.pendingReactions;\n var iterations = 0;\n // While running reactions, new reactions might be triggered.\n // Hence we work with two variables and check whether\n // we converge to no remaining reactions after a while.\n while (allReactions.length > 0) {\n if (++iterations === MAX_REACTION_ITERATIONS) {\n console.error(process.env.NODE_ENV !== \"production\" ? \"Reaction doesn't converge to a stable state after \" + MAX_REACTION_ITERATIONS + \" iterations.\" + (\" Probably there is a cycle in the reactive function: \" + allReactions[0]) : \"[mobx] cycle in reaction: \" + allReactions[0]);\n allReactions.splice(0); // clear reactions\n }\n\n var remainingReactions = allReactions.splice(0);\n for (var i = 0, l = remainingReactions.length; i < l; i++) {\n remainingReactions[i].runReaction_();\n }\n }\n globalState.isRunningReactions = false;\n}\nvar isReaction = /*#__PURE__*/createInstanceofPredicate(\"Reaction\", Reaction);\nfunction setReactionScheduler(fn) {\n var baseScheduler = reactionScheduler;\n reactionScheduler = function reactionScheduler(f) {\n return fn(function () {\n return baseScheduler(f);\n });\n };\n}\n\nfunction isSpyEnabled() {\n return process.env.NODE_ENV !== \"production\" && !!globalState.spyListeners.length;\n}\nfunction spyReport(event) {\n if (!(process.env.NODE_ENV !== \"production\")) {\n return;\n } // dead code elimination can do the rest\n if (!globalState.spyListeners.length) {\n return;\n }\n var listeners = globalState.spyListeners;\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](event);\n }\n}\nfunction spyReportStart(event) {\n if (!(process.env.NODE_ENV !== \"production\")) {\n return;\n }\n var change = _extends({}, event, {\n spyReportStart: true\n });\n spyReport(change);\n}\nvar END_EVENT = {\n type: \"report-end\",\n spyReportEnd: true\n};\nfunction spyReportEnd(change) {\n if (!(process.env.NODE_ENV !== \"production\")) {\n return;\n }\n if (change) {\n spyReport(_extends({}, change, {\n type: \"report-end\",\n spyReportEnd: true\n }));\n } else {\n spyReport(END_EVENT);\n }\n}\nfunction spy(listener) {\n if (!(process.env.NODE_ENV !== \"production\")) {\n console.warn(\"[mobx.spy] Is a no-op in production builds\");\n return function () {};\n } else {\n globalState.spyListeners.push(listener);\n return once(function () {\n globalState.spyListeners = globalState.spyListeners.filter(function (l) {\n return l !== listener;\n });\n });\n }\n}\n\nvar ACTION = \"action\";\nvar ACTION_BOUND = \"action.bound\";\nvar AUTOACTION = \"autoAction\";\nvar AUTOACTION_BOUND = \"autoAction.bound\";\nvar DEFAULT_ACTION_NAME = \"\";\nvar actionAnnotation = /*#__PURE__*/createActionAnnotation(ACTION);\nvar actionBoundAnnotation = /*#__PURE__*/createActionAnnotation(ACTION_BOUND, {\n bound: true\n});\nvar autoActionAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION, {\n autoAction: true\n});\nvar autoActionBoundAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION_BOUND, {\n autoAction: true,\n bound: true\n});\nfunction createActionFactory(autoAction) {\n var res = function action(arg1, arg2) {\n // action(fn() {})\n if (isFunction(arg1)) {\n return createAction(arg1.name || DEFAULT_ACTION_NAME, arg1, autoAction);\n }\n // action(\"name\", fn() {})\n if (isFunction(arg2)) {\n return createAction(arg1, arg2, autoAction);\n }\n // @action\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, autoAction ? autoActionAnnotation : actionAnnotation);\n }\n // action(\"name\") & @action(\"name\")\n if (isStringish(arg1)) {\n return createDecoratorAnnotation(createActionAnnotation(autoAction ? AUTOACTION : ACTION, {\n name: arg1,\n autoAction: autoAction\n }));\n }\n if (process.env.NODE_ENV !== \"production\") {\n die(\"Invalid arguments for `action`\");\n }\n };\n return res;\n}\nvar action = /*#__PURE__*/createActionFactory(false);\nObject.assign(action, actionAnnotation);\nvar autoAction = /*#__PURE__*/createActionFactory(true);\nObject.assign(autoAction, autoActionAnnotation);\naction.bound = /*#__PURE__*/createDecoratorAnnotation(actionBoundAnnotation);\nautoAction.bound = /*#__PURE__*/createDecoratorAnnotation(autoActionBoundAnnotation);\nfunction runInAction(fn) {\n return executeAction(fn.name || DEFAULT_ACTION_NAME, false, fn, this, undefined);\n}\nfunction isAction(thing) {\n return isFunction(thing) && thing.isMobxAction === true;\n}\n\n/**\r\n * Creates a named reactive view and keeps it alive, so that the view is always\r\n * updated if one of the dependencies changes, even when the view is not further used by something else.\r\n * @param view The reactive view\r\n * @returns disposer function, which can be used to stop the view from being updated in the future.\r\n */\nfunction autorun(view, opts) {\n var _opts$name, _opts, _opts2, _opts2$signal, _opts3;\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n if (process.env.NODE_ENV !== \"production\") {\n if (!isFunction(view)) {\n die(\"Autorun expects a function as first argument\");\n }\n if (isAction(view)) {\n die(\"Autorun does not accept actions since actions are untrackable\");\n }\n }\n var name = (_opts$name = (_opts = opts) == null ? void 0 : _opts.name) != null ? _opts$name : process.env.NODE_ENV !== \"production\" ? view.name || \"Autorun@\" + getNextId() : \"Autorun\";\n var runSync = !opts.scheduler && !opts.delay;\n var reaction;\n if (runSync) {\n // normal autorun\n reaction = new Reaction(name, function () {\n this.track(reactionRunner);\n }, opts.onError, opts.requiresObservable);\n } else {\n var scheduler = createSchedulerFromOptions(opts);\n // debounced autorun\n var isScheduled = false;\n reaction = new Reaction(name, function () {\n if (!isScheduled) {\n isScheduled = true;\n scheduler(function () {\n isScheduled = false;\n if (!reaction.isDisposed_) {\n reaction.track(reactionRunner);\n }\n });\n }\n }, opts.onError, opts.requiresObservable);\n }\n function reactionRunner() {\n view(reaction);\n }\n if (!((_opts2 = opts) != null && (_opts2$signal = _opts2.signal) != null && _opts2$signal.aborted)) {\n reaction.schedule_();\n }\n return reaction.getDisposer_((_opts3 = opts) == null ? void 0 : _opts3.signal);\n}\nvar run = function run(f) {\n return f();\n};\nfunction createSchedulerFromOptions(opts) {\n return opts.scheduler ? opts.scheduler : opts.delay ? function (f) {\n return setTimeout(f, opts.delay);\n } : run;\n}\nfunction reaction(expression, effect, opts) {\n var _opts$name2, _opts4, _opts4$signal, _opts5;\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n if (process.env.NODE_ENV !== \"production\") {\n if (!isFunction(expression) || !isFunction(effect)) {\n die(\"First and second argument to reaction should be functions\");\n }\n if (!isPlainObject(opts)) {\n die(\"Third argument of reactions should be an object\");\n }\n }\n var name = (_opts$name2 = opts.name) != null ? _opts$name2 : process.env.NODE_ENV !== \"production\" ? \"Reaction@\" + getNextId() : \"Reaction\";\n var effectAction = action(name, opts.onError ? wrapErrorHandler(opts.onError, effect) : effect);\n var runSync = !opts.scheduler && !opts.delay;\n var scheduler = createSchedulerFromOptions(opts);\n var firstTime = true;\n var isScheduled = false;\n var value;\n var oldValue;\n var equals = opts.compareStructural ? comparer.structural : opts.equals || comparer[\"default\"];\n var r = new Reaction(name, function () {\n if (firstTime || runSync) {\n reactionRunner();\n } else if (!isScheduled) {\n isScheduled = true;\n scheduler(reactionRunner);\n }\n }, opts.onError, opts.requiresObservable);\n function reactionRunner() {\n isScheduled = false;\n if (r.isDisposed_) {\n return;\n }\n var changed = false;\n r.track(function () {\n var nextValue = allowStateChanges(false, function () {\n return expression(r);\n });\n changed = firstTime || !equals(value, nextValue);\n oldValue = value;\n value = nextValue;\n });\n if (firstTime && opts.fireImmediately) {\n effectAction(value, oldValue, r);\n } else if (!firstTime && changed) {\n effectAction(value, oldValue, r);\n }\n firstTime = false;\n }\n if (!((_opts4 = opts) != null && (_opts4$signal = _opts4.signal) != null && _opts4$signal.aborted)) {\n r.schedule_();\n }\n return r.getDisposer_((_opts5 = opts) == null ? void 0 : _opts5.signal);\n}\nfunction wrapErrorHandler(errorHandler, baseFn) {\n return function () {\n try {\n return baseFn.apply(this, arguments);\n } catch (e) {\n errorHandler.call(this, e);\n }\n };\n}\n\nvar ON_BECOME_OBSERVED = \"onBO\";\nvar ON_BECOME_UNOBSERVED = \"onBUO\";\nfunction onBecomeObserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_OBSERVED, thing, arg2, arg3);\n}\nfunction onBecomeUnobserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_UNOBSERVED, thing, arg2, arg3);\n}\nfunction interceptHook(hook, thing, arg2, arg3) {\n var atom = typeof arg3 === \"function\" ? getAtom(thing, arg2) : getAtom(thing);\n var cb = isFunction(arg3) ? arg3 : arg2;\n var listenersKey = hook + \"L\";\n if (atom[listenersKey]) {\n atom[listenersKey].add(cb);\n } else {\n atom[listenersKey] = new Set([cb]);\n }\n return function () {\n var hookListeners = atom[listenersKey];\n if (hookListeners) {\n hookListeners[\"delete\"](cb);\n if (hookListeners.size === 0) {\n delete atom[listenersKey];\n }\n }\n };\n}\n\nvar NEVER = \"never\";\nvar ALWAYS = \"always\";\nvar OBSERVED = \"observed\";\n// const IF_AVAILABLE = \"ifavailable\"\nfunction configure(options) {\n if (options.isolateGlobalState === true) {\n isolateGlobalState();\n }\n var useProxies = options.useProxies,\n enforceActions = options.enforceActions;\n if (useProxies !== undefined) {\n globalState.useProxies = useProxies === ALWAYS ? true : useProxies === NEVER ? false : typeof Proxy !== \"undefined\";\n }\n if (useProxies === \"ifavailable\") {\n globalState.verifyProxies = true;\n }\n if (enforceActions !== undefined) {\n var ea = enforceActions === ALWAYS ? ALWAYS : enforceActions === OBSERVED;\n globalState.enforceActions = ea;\n globalState.allowStateChanges = ea === true || ea === ALWAYS ? false : true;\n }\n [\"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"disableErrorBoundaries\", \"safeDescriptors\"].forEach(function (key) {\n if (key in options) {\n globalState[key] = !!options[key];\n }\n });\n globalState.allowStateReads = !globalState.observableRequiresReaction;\n if (process.env.NODE_ENV !== \"production\" && globalState.disableErrorBoundaries === true) {\n console.warn(\"WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled.\");\n }\n if (options.reactionScheduler) {\n setReactionScheduler(options.reactionScheduler);\n }\n}\n\nfunction extendObservable(target, properties, annotations, options) {\n if (process.env.NODE_ENV !== \"production\") {\n if (arguments.length > 4) {\n die(\"'extendObservable' expected 2-4 arguments\");\n }\n if (typeof target !== \"object\") {\n die(\"'extendObservable' expects an object as first argument\");\n }\n if (isObservableMap(target)) {\n die(\"'extendObservable' should not be used on maps, use map.merge instead\");\n }\n if (!isPlainObject(properties)) {\n die(\"'extendObservable' only accepts plain objects as second argument\");\n }\n if (isObservable(properties) || isObservable(annotations)) {\n die(\"Extending an object with another observable (object) is not supported\");\n }\n }\n // Pull descriptors first, so we don't have to deal with props added by administration ($mobx)\n var descriptors = getOwnPropertyDescriptors(properties);\n var adm = asObservableObject(target, options)[$mobx];\n startBatch();\n try {\n ownKeys(descriptors).forEach(function (key) {\n adm.extend_(key, descriptors[key],\n // must pass \"undefined\" for { key: undefined }\n !annotations ? true : key in annotations ? annotations[key] : true);\n });\n } finally {\n endBatch();\n }\n return target;\n}\n\nfunction getDependencyTree(thing, property) {\n return nodeToDependencyTree(getAtom(thing, property));\n}\nfunction nodeToDependencyTree(node) {\n var result = {\n name: node.name_\n };\n if (node.observing_ && node.observing_.length > 0) {\n result.dependencies = unique(node.observing_).map(nodeToDependencyTree);\n }\n return result;\n}\nfunction getObserverTree(thing, property) {\n return nodeToObserverTree(getAtom(thing, property));\n}\nfunction nodeToObserverTree(node) {\n var result = {\n name: node.name_\n };\n if (hasObservers(node)) {\n result.observers = Array.from(getObservers(node)).map(nodeToObserverTree);\n }\n return result;\n}\nfunction unique(list) {\n return Array.from(new Set(list));\n}\n\nvar generatorId = 0;\nfunction FlowCancellationError() {\n this.message = \"FLOW_CANCELLED\";\n}\nFlowCancellationError.prototype = /*#__PURE__*/Object.create(Error.prototype);\nfunction isFlowCancellationError(error) {\n return error instanceof FlowCancellationError;\n}\nvar flowAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow\");\nvar flowBoundAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow.bound\", {\n bound: true\n});\nvar flow = /*#__PURE__*/Object.assign(function flow(arg1, arg2) {\n // @flow\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, flowAnnotation);\n }\n // flow(fn)\n if (process.env.NODE_ENV !== \"production\" && arguments.length !== 1) {\n die(\"Flow expects single argument with generator function\");\n }\n var generator = arg1;\n var name = generator.name || \"\";\n // Implementation based on https://github.com/tj/co/blob/master/index.js\n var res = function res() {\n var ctx = this;\n var args = arguments;\n var runId = ++generatorId;\n var gen = action(name + \" - runid: \" + runId + \" - init\", generator).apply(ctx, args);\n var rejector;\n var pendingPromise = undefined;\n var promise = new Promise(function (resolve, reject) {\n var stepId = 0;\n rejector = reject;\n function onFulfilled(res) {\n pendingPromise = undefined;\n var ret;\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen.next).call(gen, res);\n } catch (e) {\n return reject(e);\n }\n next(ret);\n }\n function onRejected(err) {\n pendingPromise = undefined;\n var ret;\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen[\"throw\"]).call(gen, err);\n } catch (e) {\n return reject(e);\n }\n next(ret);\n }\n function next(ret) {\n if (isFunction(ret == null ? void 0 : ret.then)) {\n // an async iterator\n ret.then(next, reject);\n return;\n }\n if (ret.done) {\n return resolve(ret.value);\n }\n pendingPromise = Promise.resolve(ret.value);\n return pendingPromise.then(onFulfilled, onRejected);\n }\n onFulfilled(undefined); // kick off the process\n });\n\n promise.cancel = action(name + \" - runid: \" + runId + \" - cancel\", function () {\n try {\n if (pendingPromise) {\n cancelPromise(pendingPromise);\n }\n // Finally block can return (or yield) stuff..\n var _res = gen[\"return\"](undefined);\n // eat anything that promise would do, it's cancelled!\n var yieldedPromise = Promise.resolve(_res.value);\n yieldedPromise.then(noop, noop);\n cancelPromise(yieldedPromise); // maybe it can be cancelled :)\n // reject our original promise\n rejector(new FlowCancellationError());\n } catch (e) {\n rejector(e); // there could be a throwing finally block\n }\n });\n\n return promise;\n };\n res.isMobXFlow = true;\n return res;\n}, flowAnnotation);\nflow.bound = /*#__PURE__*/createDecoratorAnnotation(flowBoundAnnotation);\nfunction cancelPromise(promise) {\n if (isFunction(promise.cancel)) {\n promise.cancel();\n }\n}\nfunction flowResult(result) {\n return result; // just tricking TypeScript :)\n}\n\nfunction isFlow(fn) {\n return (fn == null ? void 0 : fn.isMobXFlow) === true;\n}\n\nfunction interceptReads(thing, propOrHandler, handler) {\n var target;\n if (isObservableMap(thing) || isObservableArray(thing) || isObservableValue(thing)) {\n target = getAdministration(thing);\n } else if (isObservableObject(thing)) {\n if (process.env.NODE_ENV !== \"production\" && !isStringish(propOrHandler)) {\n return die(\"InterceptReads can only be used with a specific property, not with an object in general\");\n }\n target = getAdministration(thing, propOrHandler);\n } else if (process.env.NODE_ENV !== \"production\") {\n return die(\"Expected observable map, object or array as first array\");\n }\n if (process.env.NODE_ENV !== \"production\" && target.dehancer !== undefined) {\n return die(\"An intercept reader was already established\");\n }\n target.dehancer = typeof propOrHandler === \"function\" ? propOrHandler : handler;\n return function () {\n target.dehancer = undefined;\n };\n}\n\nfunction intercept(thing, propOrHandler, handler) {\n if (isFunction(handler)) {\n return interceptProperty(thing, propOrHandler, handler);\n } else {\n return interceptInterceptable(thing, propOrHandler);\n }\n}\nfunction interceptInterceptable(thing, handler) {\n return getAdministration(thing).intercept_(handler);\n}\nfunction interceptProperty(thing, property, handler) {\n return getAdministration(thing, property).intercept_(handler);\n}\n\nfunction _isComputed(value, property) {\n if (property === undefined) {\n return isComputedValue(value);\n }\n if (isObservableObject(value) === false) {\n return false;\n }\n if (!value[$mobx].values_.has(property)) {\n return false;\n }\n var atom = getAtom(value, property);\n return isComputedValue(atom);\n}\nfunction isComputed(value) {\n if (process.env.NODE_ENV !== \"production\" && arguments.length > 1) {\n return die(\"isComputed expects only 1 argument. Use isComputedProp to inspect the observability of a property\");\n }\n return _isComputed(value);\n}\nfunction isComputedProp(value, propName) {\n if (process.env.NODE_ENV !== \"production\" && !isStringish(propName)) {\n return die(\"isComputed expected a property name as second argument\");\n }\n return _isComputed(value, propName);\n}\n\nfunction _isObservable(value, property) {\n if (!value) {\n return false;\n }\n if (property !== undefined) {\n if (process.env.NODE_ENV !== \"production\" && (isObservableMap(value) || isObservableArray(value))) {\n return die(\"isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.\");\n }\n if (isObservableObject(value)) {\n return value[$mobx].values_.has(property);\n }\n return false;\n }\n // For first check, see #701\n return isObservableObject(value) || !!value[$mobx] || isAtom(value) || isReaction(value) || isComputedValue(value);\n}\nfunction isObservable(value) {\n if (process.env.NODE_ENV !== \"production\" && arguments.length !== 1) {\n die(\"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property\");\n }\n return _isObservable(value);\n}\nfunction isObservableProp(value, propName) {\n if (process.env.NODE_ENV !== \"production\" && !isStringish(propName)) {\n return die(\"expected a property name as second argument\");\n }\n return _isObservable(value, propName);\n}\n\nfunction keys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].keys_();\n }\n if (isObservableMap(obj) || isObservableSet(obj)) {\n return Array.from(obj.keys());\n }\n if (isObservableArray(obj)) {\n return obj.map(function (_, index) {\n return index;\n });\n }\n die(5);\n}\nfunction values(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return obj[key];\n });\n }\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return obj.get(key);\n });\n }\n if (isObservableSet(obj)) {\n return Array.from(obj.values());\n }\n if (isObservableArray(obj)) {\n return obj.slice();\n }\n die(6);\n}\nfunction entries(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj[key]];\n });\n }\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj.get(key)];\n });\n }\n if (isObservableSet(obj)) {\n return Array.from(obj.entries());\n }\n if (isObservableArray(obj)) {\n return obj.map(function (key, index) {\n return [index, key];\n });\n }\n die(7);\n}\nfunction set(obj, key, value) {\n if (arguments.length === 2 && !isObservableSet(obj)) {\n startBatch();\n var _values = key;\n try {\n for (var _key in _values) {\n set(obj, _key, _values[_key]);\n }\n } finally {\n endBatch();\n }\n return;\n }\n if (isObservableObject(obj)) {\n obj[$mobx].set_(key, value);\n } else if (isObservableMap(obj)) {\n obj.set(key, value);\n } else if (isObservableSet(obj)) {\n obj.add(key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n if (key < 0) {\n die(\"Invalid index: '\" + key + \"'\");\n }\n startBatch();\n if (key >= obj.length) {\n obj.length = key + 1;\n }\n obj[key] = value;\n endBatch();\n } else {\n die(8);\n }\n}\nfunction remove(obj, key) {\n if (isObservableObject(obj)) {\n obj[$mobx].delete_(key);\n } else if (isObservableMap(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableSet(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n obj.splice(key, 1);\n } else {\n die(9);\n }\n}\nfunction has(obj, key) {\n if (isObservableObject(obj)) {\n return obj[$mobx].has_(key);\n } else if (isObservableMap(obj)) {\n return obj.has(key);\n } else if (isObservableSet(obj)) {\n return obj.has(key);\n } else if (isObservableArray(obj)) {\n return key >= 0 && key < obj.length;\n }\n die(10);\n}\nfunction get(obj, key) {\n if (!has(obj, key)) {\n return undefined;\n }\n if (isObservableObject(obj)) {\n return obj[$mobx].get_(key);\n } else if (isObservableMap(obj)) {\n return obj.get(key);\n } else if (isObservableArray(obj)) {\n return obj[key];\n }\n die(11);\n}\nfunction apiDefineProperty(obj, key, descriptor) {\n if (isObservableObject(obj)) {\n return obj[$mobx].defineProperty_(key, descriptor);\n }\n die(39);\n}\nfunction apiOwnKeys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].ownKeys_();\n }\n die(38);\n}\n\nfunction observe(thing, propOrCb, cbOrFire, fireImmediately) {\n if (isFunction(cbOrFire)) {\n return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately);\n } else {\n return observeObservable(thing, propOrCb, cbOrFire);\n }\n}\nfunction observeObservable(thing, listener, fireImmediately) {\n return getAdministration(thing).observe_(listener, fireImmediately);\n}\nfunction observeObservableProperty(thing, property, listener, fireImmediately) {\n return getAdministration(thing, property).observe_(listener, fireImmediately);\n}\n\nfunction cache(map, key, value) {\n map.set(key, value);\n return value;\n}\nfunction toJSHelper(source, __alreadySeen) {\n if (source == null || typeof source !== \"object\" || source instanceof Date || !isObservable(source)) {\n return source;\n }\n if (isObservableValue(source) || isComputedValue(source)) {\n return toJSHelper(source.get(), __alreadySeen);\n }\n if (__alreadySeen.has(source)) {\n return __alreadySeen.get(source);\n }\n if (isObservableArray(source)) {\n var res = cache(__alreadySeen, source, new Array(source.length));\n source.forEach(function (value, idx) {\n res[idx] = toJSHelper(value, __alreadySeen);\n });\n return res;\n }\n if (isObservableSet(source)) {\n var _res = cache(__alreadySeen, source, new Set());\n source.forEach(function (value) {\n _res.add(toJSHelper(value, __alreadySeen));\n });\n return _res;\n }\n if (isObservableMap(source)) {\n var _res2 = cache(__alreadySeen, source, new Map());\n source.forEach(function (value, key) {\n _res2.set(key, toJSHelper(value, __alreadySeen));\n });\n return _res2;\n } else {\n // must be observable object\n var _res3 = cache(__alreadySeen, source, {});\n apiOwnKeys(source).forEach(function (key) {\n if (objectPrototype.propertyIsEnumerable.call(source, key)) {\n _res3[key] = toJSHelper(source[key], __alreadySeen);\n }\n });\n return _res3;\n }\n}\n/**\r\n * Recursively converts an observable to it's non-observable native counterpart.\r\n * It does NOT recurse into non-observables, these are left as they are, even if they contain observables.\r\n * Computed and other non-enumerable properties are completely ignored.\r\n * Complex scenarios require custom solution, eg implementing `toJSON` or using `serializr` lib.\r\n */\nfunction toJS(source, options) {\n if (process.env.NODE_ENV !== \"production\" && options) {\n die(\"toJS no longer supports options\");\n }\n return toJSHelper(source, new Map());\n}\n\nfunction trace() {\n if (!(process.env.NODE_ENV !== \"production\")) {\n return;\n }\n var enterBreakPoint = false;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n if (typeof args[args.length - 1] === \"boolean\") {\n enterBreakPoint = args.pop();\n }\n var derivation = getAtomFromArgs(args);\n if (!derivation) {\n return die(\"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly\");\n }\n if (derivation.isTracing_ === TraceMode.NONE) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' tracing enabled\");\n }\n derivation.isTracing_ = enterBreakPoint ? TraceMode.BREAK : TraceMode.LOG;\n}\nfunction getAtomFromArgs(args) {\n switch (args.length) {\n case 0:\n return globalState.trackingDerivation;\n case 1:\n return getAtom(args[0]);\n case 2:\n return getAtom(args[0], args[1]);\n }\n}\n\n/**\r\n * During a transaction no views are updated until the end of the transaction.\r\n * The transaction will be run synchronously nonetheless.\r\n *\r\n * @param action a function that updates some reactive state\r\n * @returns any value that was returned by the 'action' parameter.\r\n */\nfunction transaction(action, thisArg) {\n if (thisArg === void 0) {\n thisArg = undefined;\n }\n startBatch();\n try {\n return action.apply(thisArg);\n } finally {\n endBatch();\n }\n}\n\nfunction when(predicate, arg1, arg2) {\n if (arguments.length === 1 || arg1 && typeof arg1 === \"object\") {\n return whenPromise(predicate, arg1);\n }\n return _when(predicate, arg1, arg2 || {});\n}\nfunction _when(predicate, effect, opts) {\n var timeoutHandle;\n if (typeof opts.timeout === \"number\") {\n var error = new Error(\"WHEN_TIMEOUT\");\n timeoutHandle = setTimeout(function () {\n if (!disposer[$mobx].isDisposed_) {\n disposer();\n if (opts.onError) {\n opts.onError(error);\n } else {\n throw error;\n }\n }\n }, opts.timeout);\n }\n opts.name = process.env.NODE_ENV !== \"production\" ? opts.name || \"When@\" + getNextId() : \"When\";\n var effectAction = createAction(process.env.NODE_ENV !== \"production\" ? opts.name + \"-effect\" : \"When-effect\", effect);\n // eslint-disable-next-line\n var disposer = autorun(function (r) {\n // predicate should not change state\n var cond = allowStateChanges(false, predicate);\n if (cond) {\n r.dispose();\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n effectAction();\n }\n }, opts);\n return disposer;\n}\nfunction whenPromise(predicate, opts) {\n var _opts$signal;\n if (process.env.NODE_ENV !== \"production\" && opts && opts.onError) {\n return die(\"the options 'onError' and 'promise' cannot be combined\");\n }\n if (opts != null && (_opts$signal = opts.signal) != null && _opts$signal.aborted) {\n return Object.assign(Promise.reject(new Error(\"WHEN_ABORTED\")), {\n cancel: function cancel() {\n return null;\n }\n });\n }\n var cancel;\n var abort;\n var res = new Promise(function (resolve, reject) {\n var _opts$signal2;\n var disposer = _when(predicate, resolve, _extends({}, opts, {\n onError: reject\n }));\n cancel = function cancel() {\n disposer();\n reject(new Error(\"WHEN_CANCELLED\"));\n };\n abort = function abort() {\n disposer();\n reject(new Error(\"WHEN_ABORTED\"));\n };\n opts == null ? void 0 : (_opts$signal2 = opts.signal) == null ? void 0 : _opts$signal2.addEventListener == null ? void 0 : _opts$signal2.addEventListener(\"abort\", abort);\n })[\"finally\"](function () {\n var _opts$signal3;\n return opts == null ? void 0 : (_opts$signal3 = opts.signal) == null ? void 0 : _opts$signal3.removeEventListener == null ? void 0 : _opts$signal3.removeEventListener(\"abort\", abort);\n });\n res.cancel = cancel;\n return res;\n}\n\nfunction getAdm(target) {\n return target[$mobx];\n}\n// Optimization: we don't need the intermediate objects and could have a completely custom administration for DynamicObjects,\n// and skip either the internal values map, or the base object with its property descriptors!\nvar objectProxyTraps = {\n has: function has(target, name) {\n if (process.env.NODE_ENV !== \"production\" && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"detect new properties using the 'in' operator. Use 'has' from 'mobx' instead.\");\n }\n return getAdm(target).has_(name);\n },\n get: function get(target, name) {\n return getAdm(target).get_(name);\n },\n set: function set(target, name, value) {\n var _getAdm$set_;\n if (!isStringish(name)) {\n return false;\n }\n if (process.env.NODE_ENV !== \"production\" && !getAdm(target).values_.has(name)) {\n warnAboutProxyRequirement(\"add a new observable property through direct assignment. Use 'set' from 'mobx' instead.\");\n }\n // null (intercepted) -> true (success)\n return (_getAdm$set_ = getAdm(target).set_(name, value, true)) != null ? _getAdm$set_ : true;\n },\n deleteProperty: function deleteProperty(target, name) {\n var _getAdm$delete_;\n if (process.env.NODE_ENV !== \"production\") {\n warnAboutProxyRequirement(\"delete properties from an observable object. Use 'remove' from 'mobx' instead.\");\n }\n if (!isStringish(name)) {\n return false;\n }\n // null (intercepted) -> true (success)\n return (_getAdm$delete_ = getAdm(target).delete_(name, true)) != null ? _getAdm$delete_ : true;\n },\n defineProperty: function defineProperty(target, name, descriptor) {\n var _getAdm$definePropert;\n if (process.env.NODE_ENV !== \"production\") {\n warnAboutProxyRequirement(\"define property on an observable object. Use 'defineProperty' from 'mobx' instead.\");\n }\n // null (intercepted) -> true (success)\n return (_getAdm$definePropert = getAdm(target).defineProperty_(name, descriptor)) != null ? _getAdm$definePropert : true;\n },\n ownKeys: function ownKeys(target) {\n if (process.env.NODE_ENV !== \"production\" && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead.\");\n }\n return getAdm(target).ownKeys_();\n },\n preventExtensions: function preventExtensions(target) {\n die(13);\n }\n};\nfunction asDynamicObservableObject(target, options) {\n var _target$$mobx, _target$$mobx$proxy_;\n assertProxies();\n target = asObservableObject(target, options);\n return (_target$$mobx$proxy_ = (_target$$mobx = target[$mobx]).proxy_) != null ? _target$$mobx$proxy_ : _target$$mobx.proxy_ = new Proxy(target, objectProxyTraps);\n}\n\nfunction hasInterceptors(interceptable) {\n return interceptable.interceptors_ !== undefined && interceptable.interceptors_.length > 0;\n}\nfunction registerInterceptor(interceptable, handler) {\n var interceptors = interceptable.interceptors_ || (interceptable.interceptors_ = []);\n interceptors.push(handler);\n return once(function () {\n var idx = interceptors.indexOf(handler);\n if (idx !== -1) {\n interceptors.splice(idx, 1);\n }\n });\n}\nfunction interceptChange(interceptable, change) {\n var prevU = untrackedStart();\n try {\n // Interceptor can modify the array, copy it to avoid concurrent modification, see #1950\n var interceptors = [].concat(interceptable.interceptors_ || []);\n for (var i = 0, l = interceptors.length; i < l; i++) {\n change = interceptors[i](change);\n if (change && !change.type) {\n die(14);\n }\n if (!change) {\n break;\n }\n }\n return change;\n } finally {\n untrackedEnd(prevU);\n }\n}\n\nfunction hasListeners(listenable) {\n return listenable.changeListeners_ !== undefined && listenable.changeListeners_.length > 0;\n}\nfunction registerListener(listenable, handler) {\n var listeners = listenable.changeListeners_ || (listenable.changeListeners_ = []);\n listeners.push(handler);\n return once(function () {\n var idx = listeners.indexOf(handler);\n if (idx !== -1) {\n listeners.splice(idx, 1);\n }\n });\n}\nfunction notifyListeners(listenable, change) {\n var prevU = untrackedStart();\n var listeners = listenable.changeListeners_;\n if (!listeners) {\n return;\n }\n listeners = listeners.slice();\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](change);\n }\n untrackedEnd(prevU);\n}\n\nfunction makeObservable(target, annotations, options) {\n var adm = asObservableObject(target, options)[$mobx];\n startBatch();\n try {\n var _annotations;\n if (process.env.NODE_ENV !== \"production\" && annotations && target[storedAnnotationsSymbol]) {\n die(\"makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported.\");\n }\n // Default to decorators\n (_annotations = annotations) != null ? _annotations : annotations = collectStoredAnnotations(target);\n // Annotate\n ownKeys(annotations).forEach(function (key) {\n return adm.make_(key, annotations[key]);\n });\n } finally {\n endBatch();\n }\n return target;\n}\n// proto[keysSymbol] = new Set()\nvar keysSymbol = /*#__PURE__*/Symbol(\"mobx-keys\");\nfunction makeAutoObservable(target, overrides, options) {\n if (process.env.NODE_ENV !== \"production\") {\n if (!isPlainObject(target) && !isPlainObject(Object.getPrototypeOf(target))) {\n die(\"'makeAutoObservable' can only be used for classes that don't have a superclass\");\n }\n if (isObservableObject(target)) {\n die(\"makeAutoObservable can only be used on objects not already made observable\");\n }\n }\n // Optimization: avoid visiting protos\n // Assumes that annotation.make_/.extend_ works the same for plain objects\n if (isPlainObject(target)) {\n return extendObservable(target, target, overrides, options);\n }\n var adm = asObservableObject(target, options)[$mobx];\n // Optimization: cache keys on proto\n // Assumes makeAutoObservable can be called only once per object and can't be used in subclass\n if (!target[keysSymbol]) {\n var proto = Object.getPrototypeOf(target);\n var keys = new Set([].concat(ownKeys(target), ownKeys(proto)));\n keys[\"delete\"](\"constructor\");\n keys[\"delete\"]($mobx);\n addHiddenProp(proto, keysSymbol, keys);\n }\n startBatch();\n try {\n target[keysSymbol].forEach(function (key) {\n return adm.make_(key,\n // must pass \"undefined\" for { key: undefined }\n !overrides ? true : key in overrides ? overrides[key] : true);\n });\n } finally {\n endBatch();\n }\n return target;\n}\n\nvar SPLICE = \"splice\";\nvar UPDATE = \"update\";\nvar MAX_SPLICE_SIZE = 10000; // See e.g. https://github.com/mobxjs/mobx/issues/859\nvar arrayTraps = {\n get: function get(target, name) {\n var adm = target[$mobx];\n if (name === $mobx) {\n return adm;\n }\n if (name === \"length\") {\n return adm.getArrayLength_();\n }\n if (typeof name === \"string\" && !isNaN(name)) {\n return adm.get_(parseInt(name));\n }\n if (hasProp(arrayExtensions, name)) {\n return arrayExtensions[name];\n }\n return target[name];\n },\n set: function set(target, name, value) {\n var adm = target[$mobx];\n if (name === \"length\") {\n adm.setArrayLength_(value);\n }\n if (typeof name === \"symbol\" || isNaN(name)) {\n target[name] = value;\n } else {\n // numeric string\n adm.set_(parseInt(name), value);\n }\n return true;\n },\n preventExtensions: function preventExtensions() {\n die(15);\n }\n};\nvar ObservableArrayAdministration = /*#__PURE__*/function () {\n // this is the prop that gets proxied, so can't replace it!\n\n function ObservableArrayAdministration(name, enhancer, owned_, legacyMode_) {\n if (name === void 0) {\n name = process.env.NODE_ENV !== \"production\" ? \"ObservableArray@\" + getNextId() : \"ObservableArray\";\n }\n this.owned_ = void 0;\n this.legacyMode_ = void 0;\n this.atom_ = void 0;\n this.values_ = [];\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.enhancer_ = void 0;\n this.dehancer = void 0;\n this.proxy_ = void 0;\n this.lastKnownLength_ = 0;\n this.owned_ = owned_;\n this.legacyMode_ = legacyMode_;\n this.atom_ = new Atom(name);\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, process.env.NODE_ENV !== \"production\" ? name + \"[..]\" : \"ObservableArray[..]\");\n };\n }\n var _proto = ObservableArrayAdministration.prototype;\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.dehanceValues_ = function dehanceValues_(values) {\n if (this.dehancer !== undefined && values.length > 0) {\n return values.map(this.dehancer);\n }\n return values;\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately === void 0) {\n fireImmediately = false;\n }\n if (fireImmediately) {\n listener({\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: \"splice\",\n index: 0,\n added: this.values_.slice(),\n addedCount: this.values_.length,\n removed: [],\n removedCount: 0\n });\n }\n return registerListener(this, listener);\n };\n _proto.getArrayLength_ = function getArrayLength_() {\n this.atom_.reportObserved();\n return this.values_.length;\n };\n _proto.setArrayLength_ = function setArrayLength_(newLength) {\n if (typeof newLength !== \"number\" || isNaN(newLength) || newLength < 0) {\n die(\"Out of range: \" + newLength);\n }\n var currentLength = this.values_.length;\n if (newLength === currentLength) {\n return;\n } else if (newLength > currentLength) {\n var newItems = new Array(newLength - currentLength);\n for (var i = 0; i < newLength - currentLength; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n this.spliceWithArray_(currentLength, 0, newItems);\n } else {\n this.spliceWithArray_(newLength, currentLength - newLength);\n }\n };\n _proto.updateArrayLength_ = function updateArrayLength_(oldLength, delta) {\n if (oldLength !== this.lastKnownLength_) {\n die(16);\n }\n this.lastKnownLength_ += delta;\n if (this.legacyMode_ && delta > 0) {\n reserveArrayBuffer(oldLength + delta + 1);\n }\n };\n _proto.spliceWithArray_ = function spliceWithArray_(index, deleteCount, newItems) {\n var _this = this;\n checkIfStateModificationsAreAllowed(this.atom_);\n var length = this.values_.length;\n if (index === undefined) {\n index = 0;\n } else if (index > length) {\n index = length;\n } else if (index < 0) {\n index = Math.max(0, length + index);\n }\n if (arguments.length === 1) {\n deleteCount = length - index;\n } else if (deleteCount === undefined || deleteCount === null) {\n deleteCount = 0;\n } else {\n deleteCount = Math.max(0, Math.min(deleteCount, length - index));\n }\n if (newItems === undefined) {\n newItems = EMPTY_ARRAY;\n }\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_,\n type: SPLICE,\n index: index,\n removedCount: deleteCount,\n added: newItems\n });\n if (!change) {\n return EMPTY_ARRAY;\n }\n deleteCount = change.removedCount;\n newItems = change.added;\n }\n newItems = newItems.length === 0 ? newItems : newItems.map(function (v) {\n return _this.enhancer_(v, undefined);\n });\n if (this.legacyMode_ || process.env.NODE_ENV !== \"production\") {\n var lengthDelta = newItems.length - deleteCount;\n this.updateArrayLength_(length, lengthDelta); // checks if internal array wasn't modified\n }\n\n var res = this.spliceItemsIntoValues_(index, deleteCount, newItems);\n if (deleteCount !== 0 || newItems.length !== 0) {\n this.notifyArraySplice_(index, newItems, res);\n }\n return this.dehanceValues_(res);\n };\n _proto.spliceItemsIntoValues_ = function spliceItemsIntoValues_(index, deleteCount, newItems) {\n if (newItems.length < MAX_SPLICE_SIZE) {\n var _this$values_;\n return (_this$values_ = this.values_).splice.apply(_this$values_, [index, deleteCount].concat(newItems));\n } else {\n // The items removed by the splice\n var res = this.values_.slice(index, index + deleteCount);\n // The items that that should remain at the end of the array\n var oldItems = this.values_.slice(index + deleteCount);\n // New length is the previous length + addition count - deletion count\n this.values_.length += newItems.length - deleteCount;\n for (var i = 0; i < newItems.length; i++) {\n this.values_[index + i] = newItems[i];\n }\n for (var _i = 0; _i < oldItems.length; _i++) {\n this.values_[index + newItems.length + _i] = oldItems[_i];\n }\n return res;\n }\n };\n _proto.notifyArrayChildUpdate_ = function notifyArrayChildUpdate_(index, newValue, oldValue) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n type: UPDATE,\n debugObjectName: this.atom_.name_,\n index: index,\n newValue: newValue,\n oldValue: oldValue\n } : null;\n // The reason why this is on right hand side here (and not above), is this way the uglifier will drop it, but it won't\n // cause any runtime overhead in development mode without NODE_ENV set, unless spying is enabled\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportStart(change);\n }\n this.atom_.reportChanged();\n if (notify) {\n notifyListeners(this, change);\n }\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportEnd();\n }\n };\n _proto.notifyArraySplice_ = function notifyArraySplice_(index, added, removed) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: SPLICE,\n index: index,\n removed: removed,\n added: added,\n removedCount: removed.length,\n addedCount: added.length\n } : null;\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportStart(change);\n }\n this.atom_.reportChanged();\n // conform: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/observe\n if (notify) {\n notifyListeners(this, change);\n }\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportEnd();\n }\n };\n _proto.get_ = function get_(index) {\n if (this.legacyMode_ && index >= this.values_.length) {\n console.warn(process.env.NODE_ENV !== \"production\" ? \"[mobx.array] Attempt to read an array index (\" + index + \") that is out of bounds (\" + this.values_.length + \"). Please check length first. Out of bound indices will not be tracked by MobX\" : \"[mobx] Out of bounds read: \" + index);\n return undefined;\n }\n this.atom_.reportObserved();\n return this.dehanceValue_(this.values_[index]);\n };\n _proto.set_ = function set_(index, newValue) {\n var values = this.values_;\n if (this.legacyMode_ && index > values.length) {\n // out of bounds\n die(17, index, values.length);\n }\n if (index < values.length) {\n // update at index in range\n checkIfStateModificationsAreAllowed(this.atom_);\n var oldValue = values[index];\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_,\n index: index,\n newValue: newValue\n });\n if (!change) {\n return;\n }\n newValue = change.newValue;\n }\n newValue = this.enhancer_(newValue, oldValue);\n var changed = newValue !== oldValue;\n if (changed) {\n values[index] = newValue;\n this.notifyArrayChildUpdate_(index, newValue, oldValue);\n }\n } else {\n // For out of bound index, we don't create an actual sparse array,\n // but rather fill the holes with undefined (same as setArrayLength_).\n // This could be considered a bug.\n var newItems = new Array(index + 1 - values.length);\n for (var i = 0; i < newItems.length - 1; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n newItems[newItems.length - 1] = newValue;\n this.spliceWithArray_(values.length, 0, newItems);\n }\n };\n return ObservableArrayAdministration;\n}();\nfunction createObservableArray(initialValues, enhancer, name, owned) {\n if (name === void 0) {\n name = process.env.NODE_ENV !== \"production\" ? \"ObservableArray@\" + getNextId() : \"ObservableArray\";\n }\n if (owned === void 0) {\n owned = false;\n }\n assertProxies();\n var adm = new ObservableArrayAdministration(name, enhancer, owned, false);\n addHiddenFinalProp(adm.values_, $mobx, adm);\n var proxy = new Proxy(adm.values_, arrayTraps);\n adm.proxy_ = proxy;\n if (initialValues && initialValues.length) {\n var prev = allowStateChangesStart(true);\n adm.spliceWithArray_(0, 0, initialValues);\n allowStateChangesEnd(prev);\n }\n return proxy;\n}\n// eslint-disable-next-line\nvar arrayExtensions = {\n clear: function clear() {\n return this.splice(0);\n },\n replace: function replace(newItems) {\n var adm = this[$mobx];\n return adm.spliceWithArray_(0, adm.values_.length, newItems);\n },\n // Used by JSON.stringify\n toJSON: function toJSON() {\n return this.slice();\n },\n /*\r\n * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)\r\n * since these functions alter the inner structure of the array, the have side effects.\r\n * Because the have side effects, they should not be used in computed function,\r\n * and for that reason the do not call dependencyState.notifyObserved\r\n */\n splice: function splice(index, deleteCount) {\n for (var _len = arguments.length, newItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n newItems[_key - 2] = arguments[_key];\n }\n var adm = this[$mobx];\n switch (arguments.length) {\n case 0:\n return [];\n case 1:\n return adm.spliceWithArray_(index);\n case 2:\n return adm.spliceWithArray_(index, deleteCount);\n }\n return adm.spliceWithArray_(index, deleteCount, newItems);\n },\n spliceWithArray: function spliceWithArray(index, deleteCount, newItems) {\n return this[$mobx].spliceWithArray_(index, deleteCount, newItems);\n },\n push: function push() {\n var adm = this[$mobx];\n for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n items[_key2] = arguments[_key2];\n }\n adm.spliceWithArray_(adm.values_.length, 0, items);\n return adm.values_.length;\n },\n pop: function pop() {\n return this.splice(Math.max(this[$mobx].values_.length - 1, 0), 1)[0];\n },\n shift: function shift() {\n return this.splice(0, 1)[0];\n },\n unshift: function unshift() {\n var adm = this[$mobx];\n for (var _len3 = arguments.length, items = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n items[_key3] = arguments[_key3];\n }\n adm.spliceWithArray_(0, 0, items);\n return adm.values_.length;\n },\n reverse: function reverse() {\n // reverse by default mutates in place before returning the result\n // which makes it both a 'derivation' and a 'mutation'.\n if (globalState.trackingDerivation) {\n die(37, \"reverse\");\n }\n this.replace(this.slice().reverse());\n return this;\n },\n sort: function sort() {\n // sort by default mutates in place before returning the result\n // which goes against all good practices. Let's not change the array in place!\n if (globalState.trackingDerivation) {\n die(37, \"sort\");\n }\n var copy = this.slice();\n copy.sort.apply(copy, arguments);\n this.replace(copy);\n return this;\n },\n remove: function remove(value) {\n var adm = this[$mobx];\n var idx = adm.dehanceValues_(adm.values_).indexOf(value);\n if (idx > -1) {\n this.splice(idx, 1);\n return true;\n }\n return false;\n }\n};\n/**\r\n * Wrap function from prototype\r\n * Without this, everything works as well, but this works\r\n * faster as everything works on unproxied values\r\n */\naddArrayExtension(\"concat\", simpleFunc);\naddArrayExtension(\"flat\", simpleFunc);\naddArrayExtension(\"includes\", simpleFunc);\naddArrayExtension(\"indexOf\", simpleFunc);\naddArrayExtension(\"join\", simpleFunc);\naddArrayExtension(\"lastIndexOf\", simpleFunc);\naddArrayExtension(\"slice\", simpleFunc);\naddArrayExtension(\"toString\", simpleFunc);\naddArrayExtension(\"toLocaleString\", simpleFunc);\n// map\naddArrayExtension(\"every\", mapLikeFunc);\naddArrayExtension(\"filter\", mapLikeFunc);\naddArrayExtension(\"find\", mapLikeFunc);\naddArrayExtension(\"findIndex\", mapLikeFunc);\naddArrayExtension(\"flatMap\", mapLikeFunc);\naddArrayExtension(\"forEach\", mapLikeFunc);\naddArrayExtension(\"map\", mapLikeFunc);\naddArrayExtension(\"some\", mapLikeFunc);\n// reduce\naddArrayExtension(\"reduce\", reduceLikeFunc);\naddArrayExtension(\"reduceRight\", reduceLikeFunc);\nfunction addArrayExtension(funcName, funcFactory) {\n if (typeof Array.prototype[funcName] === \"function\") {\n arrayExtensions[funcName] = funcFactory(funcName);\n }\n}\n// Report and delegate to dehanced array\nfunction simpleFunc(funcName) {\n return function () {\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n}\n// Make sure callbacks recieve correct array arg #2326\nfunction mapLikeFunc(funcName) {\n return function (callback, thisArg) {\n var _this2 = this;\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName](function (element, index) {\n return callback.call(thisArg, element, index, _this2);\n });\n };\n}\n// Make sure callbacks recieve correct array arg #2326\nfunction reduceLikeFunc(funcName) {\n return function () {\n var _this3 = this;\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n // #2432 - reduce behavior depends on arguments.length\n var callback = arguments[0];\n arguments[0] = function (accumulator, currentValue, index) {\n return callback(accumulator, currentValue, index, _this3);\n };\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n}\nvar isObservableArrayAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableArrayAdministration\", ObservableArrayAdministration);\nfunction isObservableArray(thing) {\n return isObject(thing) && isObservableArrayAdministration(thing[$mobx]);\n}\n\nvar _Symbol$iterator, _Symbol$toStringTag;\nvar ObservableMapMarker = {};\nvar ADD = \"add\";\nvar DELETE = \"delete\";\n// just extend Map? See also https://gist.github.com/nestharus/13b4d74f2ef4a2f4357dbd3fc23c1e54\n// But: https://github.com/mobxjs/mobx/issues/1556\n_Symbol$iterator = Symbol.iterator;\n_Symbol$toStringTag = Symbol.toStringTag;\nvar ObservableMap = /*#__PURE__*/function () {\n // hasMap, not hashMap >-).\n\n function ObservableMap(initialData, enhancer_, name_) {\n var _this = this;\n if (enhancer_ === void 0) {\n enhancer_ = deepEnhancer;\n }\n if (name_ === void 0) {\n name_ = process.env.NODE_ENV !== \"production\" ? \"ObservableMap@\" + getNextId() : \"ObservableMap\";\n }\n this.enhancer_ = void 0;\n this.name_ = void 0;\n this[$mobx] = ObservableMapMarker;\n this.data_ = void 0;\n this.hasMap_ = void 0;\n this.keysAtom_ = void 0;\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = enhancer_;\n this.name_ = name_;\n if (!isFunction(Map)) {\n die(18);\n }\n this.keysAtom_ = createAtom(process.env.NODE_ENV !== \"production\" ? this.name_ + \".keys()\" : \"ObservableMap.keys()\");\n this.data_ = new Map();\n this.hasMap_ = new Map();\n allowStateChanges(true, function () {\n _this.merge(initialData);\n });\n }\n var _proto = ObservableMap.prototype;\n _proto.has_ = function has_(key) {\n return this.data_.has(key);\n };\n _proto.has = function has(key) {\n var _this2 = this;\n if (!globalState.trackingDerivation) {\n return this.has_(key);\n }\n var entry = this.hasMap_.get(key);\n if (!entry) {\n var newEntry = entry = new ObservableValue(this.has_(key), referenceEnhancer, process.env.NODE_ENV !== \"production\" ? this.name_ + \".\" + stringifyKey(key) + \"?\" : \"ObservableMap.key?\", false);\n this.hasMap_.set(key, newEntry);\n onBecomeUnobserved(newEntry, function () {\n return _this2.hasMap_[\"delete\"](key);\n });\n }\n return entry.get();\n };\n _proto.set = function set(key, value) {\n var hasKey = this.has_(key);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: hasKey ? UPDATE : ADD,\n object: this,\n newValue: value,\n name: key\n });\n if (!change) {\n return this;\n }\n value = change.newValue;\n }\n if (hasKey) {\n this.updateValue_(key, value);\n } else {\n this.addValue_(key, value);\n }\n return this;\n };\n _proto[\"delete\"] = function _delete(key) {\n var _this3 = this;\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n name: key\n });\n if (!change) {\n return false;\n }\n }\n if (this.has_(key)) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var _change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: this.data_.get(key).value_,\n name: key\n } : null;\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportStart(_change);\n } // TODO fix type\n transaction(function () {\n var _this3$hasMap_$get;\n _this3.keysAtom_.reportChanged();\n (_this3$hasMap_$get = _this3.hasMap_.get(key)) == null ? void 0 : _this3$hasMap_$get.setNewValue_(false);\n var observable = _this3.data_.get(key);\n observable.setNewValue_(undefined);\n _this3.data_[\"delete\"](key);\n });\n if (notify) {\n notifyListeners(this, _change);\n }\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportEnd();\n }\n return true;\n }\n return false;\n };\n _proto.updateValue_ = function updateValue_(key, newValue) {\n var observable = this.data_.get(key);\n newValue = observable.prepareNewValue_(newValue);\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: UPDATE,\n object: this,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n observable.setNewValue_(newValue);\n if (notify) {\n notifyListeners(this, change);\n }\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportEnd();\n }\n }\n };\n _proto.addValue_ = function addValue_(key, newValue) {\n var _this4 = this;\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n transaction(function () {\n var _this4$hasMap_$get;\n var observable = new ObservableValue(newValue, _this4.enhancer_, process.env.NODE_ENV !== \"production\" ? _this4.name_ + \".\" + stringifyKey(key) : \"ObservableMap.key\", false);\n _this4.data_.set(key, observable);\n newValue = observable.value_; // value might have been changed\n (_this4$hasMap_$get = _this4.hasMap_.get(key)) == null ? void 0 : _this4$hasMap_$get.setNewValue_(true);\n _this4.keysAtom_.reportChanged();\n });\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n name: key,\n newValue: newValue\n } : null;\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n if (notify) {\n notifyListeners(this, change);\n }\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportEnd();\n }\n };\n _proto.get = function get(key) {\n if (this.has(key)) {\n return this.dehanceValue_(this.data_.get(key).get());\n }\n return this.dehanceValue_(undefined);\n };\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.keys = function keys() {\n this.keysAtom_.reportObserved();\n return this.data_.keys();\n };\n _proto.values = function values() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next = keys.next(),\n done = _keys$next.done,\n value = _keys$next.value;\n return {\n done: done,\n value: done ? undefined : self.get(value)\n };\n }\n });\n };\n _proto.entries = function entries() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next2 = keys.next(),\n done = _keys$next2.done,\n value = _keys$next2.value;\n return {\n done: done,\n value: done ? undefined : [value, self.get(value)]\n };\n }\n });\n };\n _proto[_Symbol$iterator] = function () {\n return this.entries();\n };\n _proto.forEach = function forEach(callback, thisArg) {\n for (var _iterator = _createForOfIteratorHelperLoose(this), _step; !(_step = _iterator()).done;) {\n var _step$value = _step.value,\n key = _step$value[0],\n value = _step$value[1];\n callback.call(thisArg, value, key, this);\n }\n }\n /** Merge another object into this object, returns this. */;\n _proto.merge = function merge(other) {\n var _this5 = this;\n if (isObservableMap(other)) {\n other = new Map(other);\n }\n transaction(function () {\n if (isPlainObject(other)) {\n getPlainObjectKeys(other).forEach(function (key) {\n return _this5.set(key, other[key]);\n });\n } else if (Array.isArray(other)) {\n other.forEach(function (_ref) {\n var key = _ref[0],\n value = _ref[1];\n return _this5.set(key, value);\n });\n } else if (isES6Map(other)) {\n if (other.constructor !== Map) {\n die(19, other);\n }\n other.forEach(function (value, key) {\n return _this5.set(key, value);\n });\n } else if (other !== null && other !== undefined) {\n die(20, other);\n }\n });\n return this;\n };\n _proto.clear = function clear() {\n var _this6 = this;\n transaction(function () {\n untracked(function () {\n for (var _iterator2 = _createForOfIteratorHelperLoose(_this6.keys()), _step2; !(_step2 = _iterator2()).done;) {\n var key = _step2.value;\n _this6[\"delete\"](key);\n }\n });\n });\n };\n _proto.replace = function replace(values) {\n var _this7 = this;\n // Implementation requirements:\n // - respect ordering of replacement map\n // - allow interceptors to run and potentially prevent individual operations\n // - don't recreate observables that already exist in original map (so we don't destroy existing subscriptions)\n // - don't _keysAtom.reportChanged if the keys of resulting map are indentical (order matters!)\n // - note that result map may differ from replacement map due to the interceptors\n transaction(function () {\n // Convert to map so we can do quick key lookups\n var replacementMap = convertToMap(values);\n var orderedData = new Map();\n // Used for optimization\n var keysReportChangedCalled = false;\n // Delete keys that don't exist in replacement map\n // if the key deletion is prevented by interceptor\n // add entry at the beginning of the result map\n for (var _iterator3 = _createForOfIteratorHelperLoose(_this7.data_.keys()), _step3; !(_step3 = _iterator3()).done;) {\n var key = _step3.value;\n // Concurrently iterating/deleting keys\n // iterator should handle this correctly\n if (!replacementMap.has(key)) {\n var deleted = _this7[\"delete\"](key);\n // Was the key removed?\n if (deleted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n } else {\n // Delete prevented by interceptor\n var value = _this7.data_.get(key);\n orderedData.set(key, value);\n }\n }\n }\n // Merge entries\n for (var _iterator4 = _createForOfIteratorHelperLoose(replacementMap.entries()), _step4; !(_step4 = _iterator4()).done;) {\n var _step4$value = _step4.value,\n _key = _step4$value[0],\n _value = _step4$value[1];\n // We will want to know whether a new key is added\n var keyExisted = _this7.data_.has(_key);\n // Add or update value\n _this7.set(_key, _value);\n // The addition could have been prevent by interceptor\n if (_this7.data_.has(_key)) {\n // The update could have been prevented by interceptor\n // and also we want to preserve existing values\n // so use value from _data map (instead of replacement map)\n var _value2 = _this7.data_.get(_key);\n orderedData.set(_key, _value2);\n // Was a new key added?\n if (!keyExisted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n }\n }\n }\n // Check for possible key order change\n if (!keysReportChangedCalled) {\n if (_this7.data_.size !== orderedData.size) {\n // If size differs, keys are definitely modified\n _this7.keysAtom_.reportChanged();\n } else {\n var iter1 = _this7.data_.keys();\n var iter2 = orderedData.keys();\n var next1 = iter1.next();\n var next2 = iter2.next();\n while (!next1.done) {\n if (next1.value !== next2.value) {\n _this7.keysAtom_.reportChanged();\n break;\n }\n next1 = iter1.next();\n next2 = iter2.next();\n }\n }\n }\n // Use correctly ordered map\n _this7.data_ = orderedData;\n });\n return this;\n };\n _proto.toString = function toString() {\n return \"[object ObservableMap]\";\n };\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n /**\r\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n * for callback details\r\n */\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (process.env.NODE_ENV !== \"production\" && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with maps.\");\n }\n return registerListener(this, listener);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _createClass(ObservableMap, [{\n key: \"size\",\n get: function get() {\n this.keysAtom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Map\";\n }\n }]);\n return ObservableMap;\n}();\n// eslint-disable-next-line\nvar isObservableMap = /*#__PURE__*/createInstanceofPredicate(\"ObservableMap\", ObservableMap);\nfunction convertToMap(dataStructure) {\n if (isES6Map(dataStructure) || isObservableMap(dataStructure)) {\n return dataStructure;\n } else if (Array.isArray(dataStructure)) {\n return new Map(dataStructure);\n } else if (isPlainObject(dataStructure)) {\n var map = new Map();\n for (var key in dataStructure) {\n map.set(key, dataStructure[key]);\n }\n return map;\n } else {\n return die(21, dataStructure);\n }\n}\n\nvar _Symbol$iterator$1, _Symbol$toStringTag$1;\nvar ObservableSetMarker = {};\n_Symbol$iterator$1 = Symbol.iterator;\n_Symbol$toStringTag$1 = Symbol.toStringTag;\nvar ObservableSet = /*#__PURE__*/function () {\n function ObservableSet(initialData, enhancer, name_) {\n if (enhancer === void 0) {\n enhancer = deepEnhancer;\n }\n if (name_ === void 0) {\n name_ = process.env.NODE_ENV !== \"production\" ? \"ObservableSet@\" + getNextId() : \"ObservableSet\";\n }\n this.name_ = void 0;\n this[$mobx] = ObservableSetMarker;\n this.data_ = new Set();\n this.atom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = void 0;\n this.name_ = name_;\n if (!isFunction(Set)) {\n die(22);\n }\n this.atom_ = createAtom(this.name_);\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, name_);\n };\n if (initialData) {\n this.replace(initialData);\n }\n }\n var _proto = ObservableSet.prototype;\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.clear = function clear() {\n var _this = this;\n transaction(function () {\n untracked(function () {\n for (var _iterator = _createForOfIteratorHelperLoose(_this.data_.values()), _step; !(_step = _iterator()).done;) {\n var value = _step.value;\n _this[\"delete\"](value);\n }\n });\n });\n };\n _proto.forEach = function forEach(callbackFn, thisArg) {\n for (var _iterator2 = _createForOfIteratorHelperLoose(this), _step2; !(_step2 = _iterator2()).done;) {\n var value = _step2.value;\n callbackFn.call(thisArg, value, value, this);\n }\n };\n _proto.add = function add(value) {\n var _this2 = this;\n checkIfStateModificationsAreAllowed(this.atom_);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: ADD,\n object: this,\n newValue: value\n });\n if (!change) {\n return this;\n }\n // ideally, value = change.value would be done here, so that values can be\n // changed by interceptor. Same applies for other Set and Map api's.\n }\n\n if (!this.has(value)) {\n transaction(function () {\n _this2.data_.add(_this2.enhancer_(value, undefined));\n _this2.atom_.reportChanged();\n });\n var notifySpy = process.env.NODE_ENV !== \"production\" && isSpyEnabled();\n var notify = hasListeners(this);\n var _change = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n newValue: value\n } : null;\n if (notifySpy && process.env.NODE_ENV !== \"production\") {\n spyReportStart(_change);\n }\n if (notify) {\n notifyListeners(this, _change);\n }\n if (notifySpy && process.env.NODE_ENV !== \"production\") {\n spyReportEnd();\n }\n }\n return this;\n };\n _proto[\"delete\"] = function _delete(value) {\n var _this3 = this;\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n oldValue: value\n });\n if (!change) {\n return false;\n }\n }\n if (this.has(value)) {\n var notifySpy = process.env.NODE_ENV !== \"production\" && isSpyEnabled();\n var notify = hasListeners(this);\n var _change2 = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: value\n } : null;\n if (notifySpy && process.env.NODE_ENV !== \"production\") {\n spyReportStart(_change2);\n }\n transaction(function () {\n _this3.atom_.reportChanged();\n _this3.data_[\"delete\"](value);\n });\n if (notify) {\n notifyListeners(this, _change2);\n }\n if (notifySpy && process.env.NODE_ENV !== \"production\") {\n spyReportEnd();\n }\n return true;\n }\n return false;\n };\n _proto.has = function has(value) {\n this.atom_.reportObserved();\n return this.data_.has(this.dehanceValue_(value));\n };\n _proto.entries = function entries() {\n var nextIndex = 0;\n var keys = Array.from(this.keys());\n var values = Array.from(this.values());\n return makeIterable({\n next: function next() {\n var index = nextIndex;\n nextIndex += 1;\n return index < values.length ? {\n value: [keys[index], values[index]],\n done: false\n } : {\n done: true\n };\n }\n });\n };\n _proto.keys = function keys() {\n return this.values();\n };\n _proto.values = function values() {\n this.atom_.reportObserved();\n var self = this;\n var nextIndex = 0;\n var observableValues = Array.from(this.data_.values());\n return makeIterable({\n next: function next() {\n return nextIndex < observableValues.length ? {\n value: self.dehanceValue_(observableValues[nextIndex++]),\n done: false\n } : {\n done: true\n };\n }\n });\n };\n _proto.replace = function replace(other) {\n var _this4 = this;\n if (isObservableSet(other)) {\n other = new Set(other);\n }\n transaction(function () {\n if (Array.isArray(other)) {\n _this4.clear();\n other.forEach(function (value) {\n return _this4.add(value);\n });\n } else if (isES6Set(other)) {\n _this4.clear();\n other.forEach(function (value) {\n return _this4.add(value);\n });\n } else if (other !== null && other !== undefined) {\n die(\"Cannot initialize set from \" + other);\n }\n });\n return this;\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n // ... 'fireImmediately' could also be true?\n if (process.env.NODE_ENV !== \"production\" && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with sets.\");\n }\n return registerListener(this, listener);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n _proto.toString = function toString() {\n return \"[object ObservableSet]\";\n };\n _proto[_Symbol$iterator$1] = function () {\n return this.values();\n };\n _createClass(ObservableSet, [{\n key: \"size\",\n get: function get() {\n this.atom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag$1,\n get: function get() {\n return \"Set\";\n }\n }]);\n return ObservableSet;\n}();\n// eslint-disable-next-line\nvar isObservableSet = /*#__PURE__*/createInstanceofPredicate(\"ObservableSet\", ObservableSet);\n\nvar descriptorCache = /*#__PURE__*/Object.create(null);\nvar REMOVE = \"remove\";\nvar ObservableObjectAdministration = /*#__PURE__*/function () {\n function ObservableObjectAdministration(target_, values_, name_,\n // Used anytime annotation is not explicitely provided\n defaultAnnotation_) {\n if (values_ === void 0) {\n values_ = new Map();\n }\n if (defaultAnnotation_ === void 0) {\n defaultAnnotation_ = autoAnnotation;\n }\n this.target_ = void 0;\n this.values_ = void 0;\n this.name_ = void 0;\n this.defaultAnnotation_ = void 0;\n this.keysAtom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.proxy_ = void 0;\n this.isPlainObject_ = void 0;\n this.appliedAnnotations_ = void 0;\n this.pendingKeys_ = void 0;\n this.target_ = target_;\n this.values_ = values_;\n this.name_ = name_;\n this.defaultAnnotation_ = defaultAnnotation_;\n this.keysAtom_ = new Atom(process.env.NODE_ENV !== \"production\" ? this.name_ + \".keys\" : \"ObservableObject.keys\");\n // Optimization: we use this frequently\n this.isPlainObject_ = isPlainObject(this.target_);\n if (process.env.NODE_ENV !== \"production\" && !isAnnotation(this.defaultAnnotation_)) {\n die(\"defaultAnnotation must be valid annotation\");\n }\n if (process.env.NODE_ENV !== \"production\") {\n // Prepare structure for tracking which fields were already annotated\n this.appliedAnnotations_ = {};\n }\n }\n var _proto = ObservableObjectAdministration.prototype;\n _proto.getObservablePropValue_ = function getObservablePropValue_(key) {\n return this.values_.get(key).get();\n };\n _proto.setObservablePropValue_ = function setObservablePropValue_(key, newValue) {\n var observable = this.values_.get(key);\n if (observable instanceof ComputedValue) {\n observable.set(newValue);\n return true;\n }\n // intercept\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: newValue\n });\n if (!change) {\n return null;\n }\n newValue = change.newValue;\n }\n newValue = observable.prepareNewValue_(newValue);\n // notify spy & observers\n if (newValue !== globalState.UNCHANGED) {\n var notify = hasListeners(this);\n var notifySpy = process.env.NODE_ENV !== \"production\" && isSpyEnabled();\n var _change = notify || notifySpy ? {\n type: UPDATE,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportStart(_change);\n }\n observable.setNewValue_(newValue);\n if (notify) {\n notifyListeners(this, _change);\n }\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportEnd();\n }\n }\n return true;\n };\n _proto.get_ = function get_(key) {\n if (globalState.trackingDerivation && !hasProp(this.target_, key)) {\n // Key doesn't exist yet, subscribe for it in case it's added later\n this.has_(key);\n }\n return this.target_[key];\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {any} value\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */;\n _proto.set_ = function set_(key, value, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n // Don't use .has(key) - we care about own\n if (hasProp(this.target_, key)) {\n // Existing prop\n if (this.values_.has(key)) {\n // Observable (can be intercepted)\n return this.setObservablePropValue_(key, value);\n } else if (proxyTrap) {\n // Non-observable - proxy\n return Reflect.set(this.target_, key, value);\n } else {\n // Non-observable\n this.target_[key] = value;\n return true;\n }\n } else {\n // New prop\n return this.extend_(key, {\n value: value,\n enumerable: true,\n writable: true,\n configurable: true\n }, this.defaultAnnotation_, proxyTrap);\n }\n }\n // Trap for \"in\"\n ;\n _proto.has_ = function has_(key) {\n if (!globalState.trackingDerivation) {\n // Skip key subscription outside derivation\n return key in this.target_;\n }\n this.pendingKeys_ || (this.pendingKeys_ = new Map());\n var entry = this.pendingKeys_.get(key);\n if (!entry) {\n entry = new ObservableValue(key in this.target_, referenceEnhancer, process.env.NODE_ENV !== \"production\" ? this.name_ + \".\" + stringifyKey(key) + \"?\" : \"ObservableObject.key?\", false);\n this.pendingKeys_.set(key, entry);\n }\n return entry.get();\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - ignore prop\r\n */;\n _proto.make_ = function make_(key, annotation) {\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n if (annotation === false) {\n return;\n }\n assertAnnotable(this, annotation, key);\n if (!(key in this.target_)) {\n var _this$target_$storedA;\n // Throw on missing key, except for decorators:\n // Decorator annotations are collected from whole prototype chain.\n // When called from super() some props may not exist yet.\n // However we don't have to worry about missing prop,\n // because the decorator must have been applied to something.\n if ((_this$target_$storedA = this.target_[storedAnnotationsSymbol]) != null && _this$target_$storedA[key]) {\n return; // will be annotated by subclass constructor\n } else {\n die(1, annotation.annotationType_, this.name_ + \".\" + key.toString());\n }\n }\n var source = this.target_;\n while (source && source !== objectPrototype) {\n var descriptor = getDescriptor(source, key);\n if (descriptor) {\n var outcome = annotation.make_(this, key, descriptor, source);\n if (outcome === 0 /* Cancel */) {\n return;\n }\n if (outcome === 1 /* Break */) {\n break;\n }\n }\n source = Object.getPrototypeOf(source);\n }\n recordAnnotationApplied(this, annotation, key);\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */;\n _proto.extend_ = function extend_(key, descriptor, annotation, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n if (annotation === false) {\n return this.defineProperty_(key, descriptor, proxyTrap);\n }\n assertAnnotable(this, annotation, key);\n var outcome = annotation.extend_(this, key, descriptor, proxyTrap);\n if (outcome) {\n recordAnnotationApplied(this, annotation, key);\n }\n return outcome;\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */;\n _proto.defineProperty_ = function defineProperty_(key, descriptor, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n try {\n startBatch();\n // Delete\n var deleteOutcome = this.delete_(key);\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n }\n // ADD interceptor\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: descriptor.value\n });\n if (!change) {\n return null;\n }\n var newValue = change.newValue;\n if (descriptor.value !== newValue) {\n descriptor = _extends({}, descriptor, {\n value: newValue\n });\n }\n }\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n // Notify\n this.notifyPropertyAddition_(key, descriptor.value);\n } finally {\n endBatch();\n }\n return true;\n }\n // If original descriptor becomes relevant, move this to annotation directly\n ;\n _proto.defineObservableProperty_ = function defineObservableProperty_(key, value, enhancer, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n try {\n startBatch();\n // Delete\n var deleteOutcome = this.delete_(key);\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n }\n // ADD interceptor\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: value\n });\n if (!change) {\n return null;\n }\n value = change.newValue;\n }\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: true,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n };\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n var observable = new ObservableValue(value, enhancer, process.env.NODE_ENV !== \"production\" ? this.name_ + \".\" + key.toString() : \"ObservableObject.key\", false);\n this.values_.set(key, observable);\n // Notify (value possibly changed by ObservableValue)\n this.notifyPropertyAddition_(key, observable.value_);\n } finally {\n endBatch();\n }\n return true;\n }\n // If original descriptor becomes relevant, move this to annotation directly\n ;\n _proto.defineComputedProperty_ = function defineComputedProperty_(key, options, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n try {\n startBatch();\n // Delete\n var deleteOutcome = this.delete_(key);\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n }\n // ADD interceptor\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: undefined\n });\n if (!change) {\n return null;\n }\n }\n options.name || (options.name = process.env.NODE_ENV !== \"production\" ? this.name_ + \".\" + key.toString() : \"ObservableObject.key\");\n options.context = this.proxy_ || this.target_;\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: false,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n };\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n this.values_.set(key, new ComputedValue(options));\n // Notify\n this.notifyPropertyAddition_(key, undefined);\n } finally {\n endBatch();\n }\n return true;\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */;\n _proto.delete_ = function delete_(key, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n // No such prop\n if (!hasProp(this.target_, key)) {\n return true;\n }\n // Intercept\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: REMOVE\n });\n // Cancelled\n if (!change) {\n return null;\n }\n }\n // Delete\n try {\n var _this$pendingKeys_, _this$pendingKeys_$ge;\n startBatch();\n var notify = hasListeners(this);\n var notifySpy = process.env.NODE_ENV !== \"production\" && isSpyEnabled();\n var observable = this.values_.get(key);\n // Value needed for spies/listeners\n var value = undefined;\n // Optimization: don't pull the value unless we will need it\n if (!observable && (notify || notifySpy)) {\n var _getDescriptor;\n value = (_getDescriptor = getDescriptor(this.target_, key)) == null ? void 0 : _getDescriptor.value;\n }\n // delete prop (do first, may fail)\n if (proxyTrap) {\n if (!Reflect.deleteProperty(this.target_, key)) {\n return false;\n }\n } else {\n delete this.target_[key];\n }\n // Allow re-annotating this field\n if (process.env.NODE_ENV !== \"production\") {\n delete this.appliedAnnotations_[key];\n }\n // Clear observable\n if (observable) {\n this.values_[\"delete\"](key);\n // for computed, value is undefined\n if (observable instanceof ObservableValue) {\n value = observable.value_;\n }\n // Notify: autorun(() => obj[key]), see #1796\n propagateChanged(observable);\n }\n // Notify \"keys/entries/values\" observers\n this.keysAtom_.reportChanged();\n // Notify \"has\" observers\n // \"in\" as it may still exist in proto\n (_this$pendingKeys_ = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_$ge = _this$pendingKeys_.get(key)) == null ? void 0 : _this$pendingKeys_$ge.set(key in this.target_);\n // Notify spies/listeners\n if (notify || notifySpy) {\n var _change2 = {\n type: REMOVE,\n observableKind: \"object\",\n object: this.proxy_ || this.target_,\n debugObjectName: this.name_,\n oldValue: value,\n name: key\n };\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportStart(_change2);\n }\n if (notify) {\n notifyListeners(this, _change2);\n }\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportEnd();\n }\n }\n } finally {\n endBatch();\n }\n return true;\n }\n /**\r\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n * for callback details\r\n */;\n _proto.observe_ = function observe_(callback, fireImmediately) {\n if (process.env.NODE_ENV !== \"production\" && fireImmediately === true) {\n die(\"`observe` doesn't support the fire immediately property for observable objects.\");\n }\n return registerListener(this, callback);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.notifyPropertyAddition_ = function notifyPropertyAddition_(key, value) {\n var _this$pendingKeys_2, _this$pendingKeys_2$g;\n var notify = hasListeners(this);\n var notifySpy = process.env.NODE_ENV !== \"production\" && isSpyEnabled();\n if (notify || notifySpy) {\n var change = notify || notifySpy ? {\n type: ADD,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: value\n } : null;\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportStart(change);\n }\n if (notify) {\n notifyListeners(this, change);\n }\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportEnd();\n }\n }\n (_this$pendingKeys_2 = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_2$g = _this$pendingKeys_2.get(key)) == null ? void 0 : _this$pendingKeys_2$g.set(true);\n // Notify \"keys/entries/values\" observers\n this.keysAtom_.reportChanged();\n };\n _proto.ownKeys_ = function ownKeys_() {\n this.keysAtom_.reportObserved();\n return ownKeys(this.target_);\n };\n _proto.keys_ = function keys_() {\n // Returns enumerable && own, but unfortunately keysAtom will report on ANY key change.\n // There is no way to distinguish between Object.keys(object) and Reflect.ownKeys(object) - both are handled by ownKeys trap.\n // We can either over-report in Object.keys(object) or under-report in Reflect.ownKeys(object)\n // We choose to over-report in Object.keys(object), because:\n // - typically it's used with simple data objects\n // - when symbolic/non-enumerable keys are relevant Reflect.ownKeys works as expected\n this.keysAtom_.reportObserved();\n return Object.keys(this.target_);\n };\n return ObservableObjectAdministration;\n}();\nfunction asObservableObject(target, options) {\n var _options$name;\n if (process.env.NODE_ENV !== \"production\" && options && isObservableObject(target)) {\n die(\"Options can't be provided for already observable objects.\");\n }\n if (hasProp(target, $mobx)) {\n if (process.env.NODE_ENV !== \"production\" && !(getAdministration(target) instanceof ObservableObjectAdministration)) {\n die(\"Cannot convert '\" + getDebugName(target) + \"' into observable object:\" + \"\\nThe target is already observable of different type.\" + \"\\nExtending builtins is not supported.\");\n }\n return target;\n }\n if (process.env.NODE_ENV !== \"production\" && !Object.isExtensible(target)) {\n die(\"Cannot make the designated object observable; it is not extensible\");\n }\n var name = (_options$name = options == null ? void 0 : options.name) != null ? _options$name : process.env.NODE_ENV !== \"production\" ? (isPlainObject(target) ? \"ObservableObject\" : target.constructor.name) + \"@\" + getNextId() : \"ObservableObject\";\n var adm = new ObservableObjectAdministration(target, new Map(), String(name), getAnnotationFromOptions(options));\n addHiddenProp(target, $mobx, adm);\n return target;\n}\nvar isObservableObjectAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableObjectAdministration\", ObservableObjectAdministration);\nfunction getCachedObservablePropDescriptor(key) {\n return descriptorCache[key] || (descriptorCache[key] = {\n get: function get() {\n return this[$mobx].getObservablePropValue_(key);\n },\n set: function set(value) {\n return this[$mobx].setObservablePropValue_(key, value);\n }\n });\n}\nfunction isObservableObject(thing) {\n if (isObject(thing)) {\n return isObservableObjectAdministration(thing[$mobx]);\n }\n return false;\n}\nfunction recordAnnotationApplied(adm, annotation, key) {\n var _adm$target_$storedAn;\n if (process.env.NODE_ENV !== \"production\") {\n adm.appliedAnnotations_[key] = annotation;\n }\n // Remove applied decorator annotation so we don't try to apply it again in subclass constructor\n (_adm$target_$storedAn = adm.target_[storedAnnotationsSymbol]) == null ? true : delete _adm$target_$storedAn[key];\n}\nfunction assertAnnotable(adm, annotation, key) {\n // Valid annotation\n if (process.env.NODE_ENV !== \"production\" && !isAnnotation(annotation)) {\n die(\"Cannot annotate '\" + adm.name_ + \".\" + key.toString() + \"': Invalid annotation.\");\n }\n /*\r\n // Configurable, not sealed, not frozen\r\n // Possibly not needed, just a little better error then the one thrown by engine.\r\n // Cases where this would be useful the most (subclass field initializer) are not interceptable by this.\r\n if (__DEV__) {\r\n const configurable = getDescriptor(adm.target_, key)?.configurable\r\n const frozen = Object.isFrozen(adm.target_)\r\n const sealed = Object.isSealed(adm.target_)\r\n if (!configurable || frozen || sealed) {\r\n const fieldName = `${adm.name_}.${key.toString()}`\r\n const requestedAnnotationType = annotation.annotationType_\r\n let error = `Cannot apply '${requestedAnnotationType}' to '${fieldName}':`\r\n if (frozen) {\r\n error += `\\nObject is frozen.`\r\n }\r\n if (sealed) {\r\n error += `\\nObject is sealed.`\r\n }\r\n if (!configurable) {\r\n error += `\\nproperty is not configurable.`\r\n // Mention only if caused by us to avoid confusion\r\n if (hasProp(adm.appliedAnnotations!, key)) {\r\n error += `\\nTo prevent accidental re-definition of a field by a subclass, `\r\n error += `all annotated fields of non-plain objects (classes) are not configurable.`\r\n }\r\n }\r\n die(error)\r\n }\r\n }\r\n */\n // Not annotated\n if (process.env.NODE_ENV !== \"production\" && !isOverride(annotation) && hasProp(adm.appliedAnnotations_, key)) {\n var fieldName = adm.name_ + \".\" + key.toString();\n var currentAnnotationType = adm.appliedAnnotations_[key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already annotated with '\" + currentAnnotationType + \"'.\") + \"\\nRe-annotating fields is not allowed.\" + \"\\nUse 'override' annotation for methods overridden by subclass.\");\n }\n}\n\n// Bug in safari 9.* (or iOS 9 safari mobile). See #364\nvar ENTRY_0 = /*#__PURE__*/createArrayEntryDescriptor(0);\n/**\r\n * This array buffer contains two lists of properties, so that all arrays\r\n * can recycle their property definitions, which significantly improves performance of creating\r\n * properties on the fly.\r\n */\nvar OBSERVABLE_ARRAY_BUFFER_SIZE = 0;\n// Typescript workaround to make sure ObservableArray extends Array\nvar StubArray = function StubArray() {};\nfunction inherit(ctor, proto) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(ctor.prototype, proto);\n } else if (ctor.prototype.__proto__ !== undefined) {\n ctor.prototype.__proto__ = proto;\n } else {\n ctor.prototype = proto;\n }\n}\ninherit(StubArray, Array.prototype);\n// Weex proto freeze protection was here,\n// but it is unclear why the hack is need as MobX never changed the prototype\n// anyway, so removed it in V6\nvar LegacyObservableArray = /*#__PURE__*/function (_StubArray, _Symbol$toStringTag, _Symbol$iterator) {\n _inheritsLoose(LegacyObservableArray, _StubArray);\n function LegacyObservableArray(initialValues, enhancer, name, owned) {\n var _this;\n if (name === void 0) {\n name = process.env.NODE_ENV !== \"production\" ? \"ObservableArray@\" + getNextId() : \"ObservableArray\";\n }\n if (owned === void 0) {\n owned = false;\n }\n _this = _StubArray.call(this) || this;\n var adm = new ObservableArrayAdministration(name, enhancer, owned, true);\n adm.proxy_ = _assertThisInitialized(_this);\n addHiddenFinalProp(_assertThisInitialized(_this), $mobx, adm);\n if (initialValues && initialValues.length) {\n var prev = allowStateChangesStart(true);\n // @ts-ignore\n _this.spliceWithArray(0, 0, initialValues);\n allowStateChangesEnd(prev);\n }\n {\n // Seems that Safari won't use numeric prototype setter untill any * numeric property is\n // defined on the instance. After that it works fine, even if this property is deleted.\n Object.defineProperty(_assertThisInitialized(_this), \"0\", ENTRY_0);\n }\n return _this;\n }\n var _proto = LegacyObservableArray.prototype;\n _proto.concat = function concat() {\n this[$mobx].atom_.reportObserved();\n for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) {\n arrays[_key] = arguments[_key];\n }\n return Array.prototype.concat.apply(this.slice(),\n //@ts-ignore\n arrays.map(function (a) {\n return isObservableArray(a) ? a.slice() : a;\n }));\n };\n _proto[_Symbol$iterator] = function () {\n var self = this;\n var nextIndex = 0;\n return makeIterable({\n next: function next() {\n return nextIndex < self.length ? {\n value: self[nextIndex++],\n done: false\n } : {\n done: true,\n value: undefined\n };\n }\n });\n };\n _createClass(LegacyObservableArray, [{\n key: \"length\",\n get: function get() {\n return this[$mobx].getArrayLength_();\n },\n set: function set(newLength) {\n this[$mobx].setArrayLength_(newLength);\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Array\";\n }\n }]);\n return LegacyObservableArray;\n}(StubArray, Symbol.toStringTag, Symbol.iterator);\nObject.entries(arrayExtensions).forEach(function (_ref) {\n var prop = _ref[0],\n fn = _ref[1];\n if (prop !== \"concat\") {\n addHiddenProp(LegacyObservableArray.prototype, prop, fn);\n }\n});\nfunction createArrayEntryDescriptor(index) {\n return {\n enumerable: false,\n configurable: true,\n get: function get() {\n return this[$mobx].get_(index);\n },\n set: function set(value) {\n this[$mobx].set_(index, value);\n }\n };\n}\nfunction createArrayBufferItem(index) {\n defineProperty(LegacyObservableArray.prototype, \"\" + index, createArrayEntryDescriptor(index));\n}\nfunction reserveArrayBuffer(max) {\n if (max > OBSERVABLE_ARRAY_BUFFER_SIZE) {\n for (var index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max + 100; index++) {\n createArrayBufferItem(index);\n }\n OBSERVABLE_ARRAY_BUFFER_SIZE = max;\n }\n}\nreserveArrayBuffer(1000);\nfunction createLegacyArray(initialValues, enhancer, name) {\n return new LegacyObservableArray(initialValues, enhancer, name);\n}\n\nfunction getAtom(thing, property) {\n if (typeof thing === \"object\" && thing !== null) {\n if (isObservableArray(thing)) {\n if (property !== undefined) {\n die(23);\n }\n return thing[$mobx].atom_;\n }\n if (isObservableSet(thing)) {\n return thing.atom_;\n }\n if (isObservableMap(thing)) {\n if (property === undefined) {\n return thing.keysAtom_;\n }\n var observable = thing.data_.get(property) || thing.hasMap_.get(property);\n if (!observable) {\n die(25, property, getDebugName(thing));\n }\n return observable;\n }\n if (isObservableObject(thing)) {\n if (!property) {\n return die(26);\n }\n var _observable = thing[$mobx].values_.get(property);\n if (!_observable) {\n die(27, property, getDebugName(thing));\n }\n return _observable;\n }\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n } else if (isFunction(thing)) {\n if (isReaction(thing[$mobx])) {\n // disposer function\n return thing[$mobx];\n }\n }\n die(28);\n}\nfunction getAdministration(thing, property) {\n if (!thing) {\n die(29);\n }\n if (property !== undefined) {\n return getAdministration(getAtom(thing, property));\n }\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n if (isObservableMap(thing) || isObservableSet(thing)) {\n return thing;\n }\n if (thing[$mobx]) {\n return thing[$mobx];\n }\n die(24, thing);\n}\nfunction getDebugName(thing, property) {\n var named;\n if (property !== undefined) {\n named = getAtom(thing, property);\n } else if (isAction(thing)) {\n return thing.name;\n } else if (isObservableObject(thing) || isObservableMap(thing) || isObservableSet(thing)) {\n named = getAdministration(thing);\n } else {\n // valid for arrays as well\n named = getAtom(thing);\n }\n return named.name_;\n}\n\nvar toString = objectPrototype.toString;\nfunction deepEqual(a, b, depth) {\n if (depth === void 0) {\n depth = -1;\n }\n return eq(a, b, depth);\n}\n// Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289\n// Internal recursive comparison function for `isEqual`.\nfunction eq(a, b, depth, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) {\n return a !== 0 || 1 / a === 1 / b;\n }\n // `null` or `undefined` only equal to itself (strict comparison).\n if (a == null || b == null) {\n return false;\n }\n // `NaN`s are equivalent, but non-reflexive.\n if (a !== a) {\n return b !== b;\n }\n // Exhaust primitive checks\n var type = typeof a;\n if (type !== \"function\" && type !== \"object\" && typeof b != \"object\") {\n return false;\n }\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className !== toString.call(b)) {\n return false;\n }\n switch (className) {\n // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n case \"[object RegExp]\":\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n case \"[object String]\":\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return \"\" + a === \"\" + b;\n case \"[object Number]\":\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) {\n return +b !== +b;\n }\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n case \"[object Date]\":\n case \"[object Boolean]\":\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n case \"[object Symbol]\":\n return typeof Symbol !== \"undefined\" && Symbol.valueOf.call(a) === Symbol.valueOf.call(b);\n case \"[object Map]\":\n case \"[object Set]\":\n // Maps and Sets are unwrapped to arrays of entry-pairs, adding an incidental level.\n // Hide this extra level by increasing the depth.\n if (depth >= 0) {\n depth++;\n }\n break;\n }\n // Unwrap any wrapped objects.\n a = unwrap(a);\n b = unwrap(b);\n var areArrays = className === \"[object Array]\";\n if (!areArrays) {\n if (typeof a != \"object\" || typeof b != \"object\") {\n return false;\n }\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n var aCtor = a.constructor,\n bCtor = b.constructor;\n if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && isFunction(bCtor) && bCtor instanceof bCtor) && \"constructor\" in a && \"constructor\" in b) {\n return false;\n }\n }\n if (depth === 0) {\n return false;\n } else if (depth < 0) {\n depth = -1;\n }\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) {\n return bStack[length] === b;\n }\n }\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) {\n return false;\n }\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], depth - 1, aStack, bStack)) {\n return false;\n }\n }\n } else {\n // Deep compare objects.\n var keys = Object.keys(a);\n var key;\n length = keys.length;\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (Object.keys(b).length !== length) {\n return false;\n }\n while (length--) {\n // Deep compare each member\n key = keys[length];\n if (!(hasProp(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack))) {\n return false;\n }\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return true;\n}\nfunction unwrap(a) {\n if (isObservableArray(a)) {\n return a.slice();\n }\n if (isES6Map(a) || isObservableMap(a)) {\n return Array.from(a.entries());\n }\n if (isES6Set(a) || isObservableSet(a)) {\n return Array.from(a.entries());\n }\n return a;\n}\n\nfunction makeIterable(iterator) {\n iterator[Symbol.iterator] = getSelf;\n return iterator;\n}\nfunction getSelf() {\n return this;\n}\n\nfunction isAnnotation(thing) {\n return (\n // Can be function\n thing instanceof Object && typeof thing.annotationType_ === \"string\" && isFunction(thing.make_) && isFunction(thing.extend_)\n );\n}\n\n/**\r\n * (c) Michel Weststrate 2015 - 2020\r\n * MIT Licensed\r\n *\r\n * Welcome to the mobx sources! To get a global overview of how MobX internally works,\r\n * this is a good place to start:\r\n * https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74\r\n *\r\n * Source folders:\r\n * ===============\r\n *\r\n * - api/ Most of the public static methods exposed by the module can be found here.\r\n * - core/ Implementation of the MobX algorithm; atoms, derivations, reactions, dependency trees, optimizations. Cool stuff can be found here.\r\n * - types/ All the magic that is need to have observable objects, arrays and values is in this folder. Including the modifiers like `asFlat`.\r\n * - utils/ Utility stuff.\r\n *\r\n */\n[\"Symbol\", \"Map\", \"Set\"].forEach(function (m) {\n var g = getGlobal();\n if (typeof g[m] === \"undefined\") {\n die(\"MobX requires global '\" + m + \"' to be available or polyfilled\");\n }\n});\nif (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === \"object\") {\n // See: https://github.com/andykog/mobx-devtools/\n __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({\n spy: spy,\n extras: {\n getDebugName: getDebugName\n },\n $mobx: $mobx\n });\n}\n\nexport { $mobx, FlowCancellationError, ObservableMap, ObservableSet, Reaction, allowStateChanges as _allowStateChanges, runInAction as _allowStateChangesInsideComputed, allowStateReadsEnd as _allowStateReadsEnd, allowStateReadsStart as _allowStateReadsStart, autoAction as _autoAction, _endAction, getAdministration as _getAdministration, getGlobalState as _getGlobalState, interceptReads as _interceptReads, isComputingDerivation as _isComputingDerivation, resetGlobalState as _resetGlobalState, _startAction, action, autorun, comparer, computed, configure, createAtom, apiDefineProperty as defineProperty, entries, extendObservable, flow, flowResult, get, getAtom, getDebugName, getDependencyTree, getObserverTree, has, intercept, isAction, isObservableValue as isBoxedObservable, isComputed, isComputedProp, isFlow, isFlowCancellationError, isObservable, isObservableArray, isObservableMap, isObservableObject, isObservableProp, isObservableSet, keys, makeAutoObservable, makeObservable, observable, observe, onBecomeObserved, onBecomeUnobserved, onReactionError, override, apiOwnKeys as ownKeys, reaction, remove, runInAction, set, spy, toJS, trace, transaction, untracked, values, when };\n//# sourceMappingURL=mobx.esm.js.map\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n function next() {\n while (env.stack.length) {\n var rec = env.stack.pop();\n try {\n var result = rec.dispose && rec.dispose.call(rec.value);\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n catch (e) {\n fail(e);\n }\n }\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","export function isFunction(value) {\n return typeof value === 'function';\n}\n//# sourceMappingURL=isFunction.js.map","export function createErrorClass(createImpl) {\n var _super = function (instance) {\n Error.call(instance);\n instance.stack = new Error().stack;\n };\n var ctorFunc = createImpl(_super);\n ctorFunc.prototype = Object.create(Error.prototype);\n ctorFunc.prototype.constructor = ctorFunc;\n return ctorFunc;\n}\n//# sourceMappingURL=createErrorClass.js.map","import { createErrorClass } from './createErrorClass';\nexport var UnsubscriptionError = createErrorClass(function (_super) {\n return function UnsubscriptionErrorImpl(errors) {\n _super(this);\n this.message = errors\n ? errors.length + \" errors occurred during unsubscription:\\n\" + errors.map(function (err, i) { return i + 1 + \") \" + err.toString(); }).join('\\n ')\n : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n };\n});\n//# sourceMappingURL=UnsubscriptionError.js.map","export function arrRemove(arr, item) {\n if (arr) {\n var index = arr.indexOf(item);\n 0 <= index && arr.splice(index, 1);\n }\n}\n//# sourceMappingURL=arrRemove.js.map","import { __read, __spreadArray, __values } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { arrRemove } from './util/arrRemove';\nvar Subscription = (function () {\n function Subscription(initialTeardown) {\n this.initialTeardown = initialTeardown;\n this.closed = false;\n this._parentage = null;\n this._finalizers = null;\n }\n Subscription.prototype.unsubscribe = function () {\n var e_1, _a, e_2, _b;\n var errors;\n if (!this.closed) {\n this.closed = true;\n var _parentage = this._parentage;\n if (_parentage) {\n this._parentage = null;\n if (Array.isArray(_parentage)) {\n try {\n for (var _parentage_1 = __values(_parentage), _parentage_1_1 = _parentage_1.next(); !_parentage_1_1.done; _parentage_1_1 = _parentage_1.next()) {\n var parent_1 = _parentage_1_1.value;\n parent_1.remove(this);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_parentage_1_1 && !_parentage_1_1.done && (_a = _parentage_1.return)) _a.call(_parentage_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n else {\n _parentage.remove(this);\n }\n }\n var initialFinalizer = this.initialTeardown;\n if (isFunction(initialFinalizer)) {\n try {\n initialFinalizer();\n }\n catch (e) {\n errors = e instanceof UnsubscriptionError ? e.errors : [e];\n }\n }\n var _finalizers = this._finalizers;\n if (_finalizers) {\n this._finalizers = null;\n try {\n for (var _finalizers_1 = __values(_finalizers), _finalizers_1_1 = _finalizers_1.next(); !_finalizers_1_1.done; _finalizers_1_1 = _finalizers_1.next()) {\n var finalizer = _finalizers_1_1.value;\n try {\n execFinalizer(finalizer);\n }\n catch (err) {\n errors = errors !== null && errors !== void 0 ? errors : [];\n if (err instanceof UnsubscriptionError) {\n errors = __spreadArray(__spreadArray([], __read(errors)), __read(err.errors));\n }\n else {\n errors.push(err);\n }\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_finalizers_1_1 && !_finalizers_1_1.done && (_b = _finalizers_1.return)) _b.call(_finalizers_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n };\n Subscription.prototype.add = function (teardown) {\n var _a;\n if (teardown && teardown !== this) {\n if (this.closed) {\n execFinalizer(teardown);\n }\n else {\n if (teardown instanceof Subscription) {\n if (teardown.closed || teardown._hasParent(this)) {\n return;\n }\n teardown._addParent(this);\n }\n (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);\n }\n }\n };\n Subscription.prototype._hasParent = function (parent) {\n var _parentage = this._parentage;\n return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));\n };\n Subscription.prototype._addParent = function (parent) {\n var _parentage = this._parentage;\n this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;\n };\n Subscription.prototype._removeParent = function (parent) {\n var _parentage = this._parentage;\n if (_parentage === parent) {\n this._parentage = null;\n }\n else if (Array.isArray(_parentage)) {\n arrRemove(_parentage, parent);\n }\n };\n Subscription.prototype.remove = function (teardown) {\n var _finalizers = this._finalizers;\n _finalizers && arrRemove(_finalizers, teardown);\n if (teardown instanceof Subscription) {\n teardown._removeParent(this);\n }\n };\n Subscription.EMPTY = (function () {\n var empty = new Subscription();\n empty.closed = true;\n return empty;\n })();\n return Subscription;\n}());\nexport { Subscription };\nexport var EMPTY_SUBSCRIPTION = Subscription.EMPTY;\nexport function isSubscription(value) {\n return (value instanceof Subscription ||\n (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));\n}\nfunction execFinalizer(finalizer) {\n if (isFunction(finalizer)) {\n finalizer();\n }\n else {\n finalizer.unsubscribe();\n }\n}\n//# sourceMappingURL=Subscription.js.map","export var config = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: undefined,\n useDeprecatedSynchronousErrorHandling: false,\n useDeprecatedNextContext: false,\n};\n//# sourceMappingURL=config.js.map","import { __read, __spreadArray } from \"tslib\";\nexport var timeoutProvider = {\n setTimeout: function (handler, timeout) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var delegate = timeoutProvider.delegate;\n if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {\n return delegate.setTimeout.apply(delegate, __spreadArray([handler, timeout], __read(args)));\n }\n return setTimeout.apply(void 0, __spreadArray([handler, timeout], __read(args)));\n },\n clearTimeout: function (handle) {\n var delegate = timeoutProvider.delegate;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);\n },\n delegate: undefined,\n};\n//# sourceMappingURL=timeoutProvider.js.map","import { config } from '../config';\nimport { timeoutProvider } from '../scheduler/timeoutProvider';\nexport function reportUnhandledError(err) {\n timeoutProvider.setTimeout(function () {\n var onUnhandledError = config.onUnhandledError;\n if (onUnhandledError) {\n onUnhandledError(err);\n }\n else {\n throw err;\n }\n });\n}\n//# sourceMappingURL=reportUnhandledError.js.map","export function noop() { }\n//# sourceMappingURL=noop.js.map","import { config } from '../config';\nvar context = null;\nexport function errorContext(cb) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n var isRoot = !context;\n if (isRoot) {\n context = { errorThrown: false, error: null };\n }\n cb();\n if (isRoot) {\n var _a = context, errorThrown = _a.errorThrown, error = _a.error;\n context = null;\n if (errorThrown) {\n throw error;\n }\n }\n }\n else {\n cb();\n }\n}\nexport function captureError(err) {\n if (config.useDeprecatedSynchronousErrorHandling && context) {\n context.errorThrown = true;\n context.error = err;\n }\n}\n//# sourceMappingURL=errorContext.js.map","import { __extends } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { isSubscription, Subscription } from './Subscription';\nimport { config } from './config';\nimport { reportUnhandledError } from './util/reportUnhandledError';\nimport { noop } from './util/noop';\nimport { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';\nimport { timeoutProvider } from './scheduler/timeoutProvider';\nimport { captureError } from './util/errorContext';\nvar Subscriber = (function (_super) {\n __extends(Subscriber, _super);\n function Subscriber(destination) {\n var _this = _super.call(this) || this;\n _this.isStopped = false;\n if (destination) {\n _this.destination = destination;\n if (isSubscription(destination)) {\n destination.add(_this);\n }\n }\n else {\n _this.destination = EMPTY_OBSERVER;\n }\n return _this;\n }\n Subscriber.create = function (next, error, complete) {\n return new SafeSubscriber(next, error, complete);\n };\n Subscriber.prototype.next = function (value) {\n if (this.isStopped) {\n handleStoppedNotification(nextNotification(value), this);\n }\n else {\n this._next(value);\n }\n };\n Subscriber.prototype.error = function (err) {\n if (this.isStopped) {\n handleStoppedNotification(errorNotification(err), this);\n }\n else {\n this.isStopped = true;\n this._error(err);\n }\n };\n Subscriber.prototype.complete = function () {\n if (this.isStopped) {\n handleStoppedNotification(COMPLETE_NOTIFICATION, this);\n }\n else {\n this.isStopped = true;\n this._complete();\n }\n };\n Subscriber.prototype.unsubscribe = function () {\n if (!this.closed) {\n this.isStopped = true;\n _super.prototype.unsubscribe.call(this);\n this.destination = null;\n }\n };\n Subscriber.prototype._next = function (value) {\n this.destination.next(value);\n };\n Subscriber.prototype._error = function (err) {\n try {\n this.destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n };\n Subscriber.prototype._complete = function () {\n try {\n this.destination.complete();\n }\n finally {\n this.unsubscribe();\n }\n };\n return Subscriber;\n}(Subscription));\nexport { Subscriber };\nvar _bind = Function.prototype.bind;\nfunction bind(fn, thisArg) {\n return _bind.call(fn, thisArg);\n}\nvar ConsumerObserver = (function () {\n function ConsumerObserver(partialObserver) {\n this.partialObserver = partialObserver;\n }\n ConsumerObserver.prototype.next = function (value) {\n var partialObserver = this.partialObserver;\n if (partialObserver.next) {\n try {\n partialObserver.next(value);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n ConsumerObserver.prototype.error = function (err) {\n var partialObserver = this.partialObserver;\n if (partialObserver.error) {\n try {\n partialObserver.error(err);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n else {\n handleUnhandledError(err);\n }\n };\n ConsumerObserver.prototype.complete = function () {\n var partialObserver = this.partialObserver;\n if (partialObserver.complete) {\n try {\n partialObserver.complete();\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n return ConsumerObserver;\n}());\nvar SafeSubscriber = (function (_super) {\n __extends(SafeSubscriber, _super);\n function SafeSubscriber(observerOrNext, error, complete) {\n var _this = _super.call(this) || this;\n var partialObserver;\n if (isFunction(observerOrNext) || !observerOrNext) {\n partialObserver = {\n next: observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined,\n error: error !== null && error !== void 0 ? error : undefined,\n complete: complete !== null && complete !== void 0 ? complete : undefined,\n };\n }\n else {\n var context_1;\n if (_this && config.useDeprecatedNextContext) {\n context_1 = Object.create(observerOrNext);\n context_1.unsubscribe = function () { return _this.unsubscribe(); };\n partialObserver = {\n next: observerOrNext.next && bind(observerOrNext.next, context_1),\n error: observerOrNext.error && bind(observerOrNext.error, context_1),\n complete: observerOrNext.complete && bind(observerOrNext.complete, context_1),\n };\n }\n else {\n partialObserver = observerOrNext;\n }\n }\n _this.destination = new ConsumerObserver(partialObserver);\n return _this;\n }\n return SafeSubscriber;\n}(Subscriber));\nexport { SafeSubscriber };\nfunction handleUnhandledError(error) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n captureError(error);\n }\n else {\n reportUnhandledError(error);\n }\n}\nfunction defaultErrorHandler(err) {\n throw err;\n}\nfunction handleStoppedNotification(notification, subscriber) {\n var onStoppedNotification = config.onStoppedNotification;\n onStoppedNotification && timeoutProvider.setTimeout(function () { return onStoppedNotification(notification, subscriber); });\n}\nexport var EMPTY_OBSERVER = {\n closed: true,\n next: noop,\n error: defaultErrorHandler,\n complete: noop,\n};\n//# sourceMappingURL=Subscriber.js.map","export var observable = (function () { return (typeof Symbol === 'function' && Symbol.observable) || '@@observable'; })();\n//# sourceMappingURL=observable.js.map","export function identity(x) {\n return x;\n}\n//# sourceMappingURL=identity.js.map","import { identity } from './identity';\nexport function pipe() {\n var fns = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n fns[_i] = arguments[_i];\n }\n return pipeFromArray(fns);\n}\nexport function pipeFromArray(fns) {\n if (fns.length === 0) {\n return identity;\n }\n if (fns.length === 1) {\n return fns[0];\n }\n return function piped(input) {\n return fns.reduce(function (prev, fn) { return fn(prev); }, input);\n };\n}\n//# sourceMappingURL=pipe.js.map","import { SafeSubscriber, Subscriber } from './Subscriber';\nimport { isSubscription } from './Subscription';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nimport { isFunction } from './util/isFunction';\nimport { errorContext } from './util/errorContext';\nvar Observable = (function () {\n function Observable(subscribe) {\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n Observable.prototype.lift = function (operator) {\n var observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n };\n Observable.prototype.subscribe = function (observerOrNext, error, complete) {\n var _this = this;\n var subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);\n errorContext(function () {\n var _a = _this, operator = _a.operator, source = _a.source;\n subscriber.add(operator\n ?\n operator.call(subscriber, source)\n : source\n ?\n _this._subscribe(subscriber)\n :\n _this._trySubscribe(subscriber));\n });\n return subscriber;\n };\n Observable.prototype._trySubscribe = function (sink) {\n try {\n return this._subscribe(sink);\n }\n catch (err) {\n sink.error(err);\n }\n };\n Observable.prototype.forEach = function (next, promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var subscriber = new SafeSubscriber({\n next: function (value) {\n try {\n next(value);\n }\n catch (err) {\n reject(err);\n subscriber.unsubscribe();\n }\n },\n error: reject,\n complete: resolve,\n });\n _this.subscribe(subscriber);\n });\n };\n Observable.prototype._subscribe = function (subscriber) {\n var _a;\n return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);\n };\n Observable.prototype[Symbol_observable] = function () {\n return this;\n };\n Observable.prototype.pipe = function () {\n var operations = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operations[_i] = arguments[_i];\n }\n return pipeFromArray(operations)(this);\n };\n Observable.prototype.toPromise = function (promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var value;\n _this.subscribe(function (x) { return (value = x); }, function (err) { return reject(err); }, function () { return resolve(value); });\n });\n };\n Observable.create = function (subscribe) {\n return new Observable(subscribe);\n };\n return Observable;\n}());\nexport { Observable };\nfunction getPromiseCtor(promiseCtor) {\n var _a;\n return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;\n}\nfunction isObserver(value) {\n return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);\n}\nfunction isSubscriber(value) {\n return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));\n}\n//# sourceMappingURL=Observable.js.map","import { isFunction } from './isFunction';\nexport function hasLift(source) {\n return isFunction(source === null || source === void 0 ? void 0 : source.lift);\n}\nexport function operate(init) {\n return function (source) {\n if (hasLift(source)) {\n return source.lift(function (liftedSource) {\n try {\n return init(liftedSource, this);\n }\n catch (err) {\n this.error(err);\n }\n });\n }\n throw new TypeError('Unable to lift unknown Observable type');\n };\n}\n//# sourceMappingURL=lift.js.map","import { __extends } from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nexport function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {\n return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);\n}\nvar OperatorSubscriber = (function (_super) {\n __extends(OperatorSubscriber, _super);\n function OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {\n var _this = _super.call(this, destination) || this;\n _this.onFinalize = onFinalize;\n _this.shouldUnsubscribe = shouldUnsubscribe;\n _this._next = onNext\n ? function (value) {\n try {\n onNext(value);\n }\n catch (err) {\n destination.error(err);\n }\n }\n : _super.prototype._next;\n _this._error = onError\n ? function (err) {\n try {\n onError(err);\n }\n catch (err) {\n destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n }\n : _super.prototype._error;\n _this._complete = onComplete\n ? function () {\n try {\n onComplete();\n }\n catch (err) {\n destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n }\n : _super.prototype._complete;\n return _this;\n }\n OperatorSubscriber.prototype.unsubscribe = function () {\n var _a;\n if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {\n var closed_1 = this.closed;\n _super.prototype.unsubscribe.call(this);\n !closed_1 && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));\n }\n };\n return OperatorSubscriber;\n}(Subscriber));\nexport { OperatorSubscriber };\n//# sourceMappingURL=OperatorSubscriber.js.map","import { createErrorClass } from './createErrorClass';\nexport var ObjectUnsubscribedError = createErrorClass(function (_super) {\n return function ObjectUnsubscribedErrorImpl() {\n _super(this);\n this.name = 'ObjectUnsubscribedError';\n this.message = 'object unsubscribed';\n };\n});\n//# sourceMappingURL=ObjectUnsubscribedError.js.map","import { __extends, __values } from \"tslib\";\nimport { Observable } from './Observable';\nimport { Subscription, EMPTY_SUBSCRIPTION } from './Subscription';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { arrRemove } from './util/arrRemove';\nimport { errorContext } from './util/errorContext';\nvar Subject = (function (_super) {\n __extends(Subject, _super);\n function Subject() {\n var _this = _super.call(this) || this;\n _this.closed = false;\n _this.currentObservers = null;\n _this.observers = [];\n _this.isStopped = false;\n _this.hasError = false;\n _this.thrownError = null;\n return _this;\n }\n Subject.prototype.lift = function (operator) {\n var subject = new AnonymousSubject(this, this);\n subject.operator = operator;\n return subject;\n };\n Subject.prototype._throwIfClosed = function () {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n };\n Subject.prototype.next = function (value) {\n var _this = this;\n errorContext(function () {\n var e_1, _a;\n _this._throwIfClosed();\n if (!_this.isStopped) {\n if (!_this.currentObservers) {\n _this.currentObservers = Array.from(_this.observers);\n }\n try {\n for (var _b = __values(_this.currentObservers), _c = _b.next(); !_c.done; _c = _b.next()) {\n var observer = _c.value;\n observer.next(value);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n });\n };\n Subject.prototype.error = function (err) {\n var _this = this;\n errorContext(function () {\n _this._throwIfClosed();\n if (!_this.isStopped) {\n _this.hasError = _this.isStopped = true;\n _this.thrownError = err;\n var observers = _this.observers;\n while (observers.length) {\n observers.shift().error(err);\n }\n }\n });\n };\n Subject.prototype.complete = function () {\n var _this = this;\n errorContext(function () {\n _this._throwIfClosed();\n if (!_this.isStopped) {\n _this.isStopped = true;\n var observers = _this.observers;\n while (observers.length) {\n observers.shift().complete();\n }\n }\n });\n };\n Subject.prototype.unsubscribe = function () {\n this.isStopped = this.closed = true;\n this.observers = this.currentObservers = null;\n };\n Object.defineProperty(Subject.prototype, \"observed\", {\n get: function () {\n var _a;\n return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;\n },\n enumerable: false,\n configurable: true\n });\n Subject.prototype._trySubscribe = function (subscriber) {\n this._throwIfClosed();\n return _super.prototype._trySubscribe.call(this, subscriber);\n };\n Subject.prototype._subscribe = function (subscriber) {\n this._throwIfClosed();\n this._checkFinalizedStatuses(subscriber);\n return this._innerSubscribe(subscriber);\n };\n Subject.prototype._innerSubscribe = function (subscriber) {\n var _this = this;\n var _a = this, hasError = _a.hasError, isStopped = _a.isStopped, observers = _a.observers;\n if (hasError || isStopped) {\n return EMPTY_SUBSCRIPTION;\n }\n this.currentObservers = null;\n observers.push(subscriber);\n return new Subscription(function () {\n _this.currentObservers = null;\n arrRemove(observers, subscriber);\n });\n };\n Subject.prototype._checkFinalizedStatuses = function (subscriber) {\n var _a = this, hasError = _a.hasError, thrownError = _a.thrownError, isStopped = _a.isStopped;\n if (hasError) {\n subscriber.error(thrownError);\n }\n else if (isStopped) {\n subscriber.complete();\n }\n };\n Subject.prototype.asObservable = function () {\n var observable = new Observable();\n observable.source = this;\n return observable;\n };\n Subject.create = function (destination, source) {\n return new AnonymousSubject(destination, source);\n };\n return Subject;\n}(Observable));\nexport { Subject };\nvar AnonymousSubject = (function (_super) {\n __extends(AnonymousSubject, _super);\n function AnonymousSubject(destination, source) {\n var _this = _super.call(this) || this;\n _this.destination = destination;\n _this.source = source;\n return _this;\n }\n AnonymousSubject.prototype.next = function (value) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value);\n };\n AnonymousSubject.prototype.error = function (err) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err);\n };\n AnonymousSubject.prototype.complete = function () {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a);\n };\n AnonymousSubject.prototype._subscribe = function (subscriber) {\n var _a, _b;\n return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : EMPTY_SUBSCRIPTION;\n };\n return AnonymousSubject;\n}(Subject));\nexport { AnonymousSubject };\n//# sourceMappingURL=Subject.js.map","export var dateTimestampProvider = {\n now: function () {\n return (dateTimestampProvider.delegate || Date).now();\n },\n delegate: undefined,\n};\n//# sourceMappingURL=dateTimestampProvider.js.map","import { __extends } from \"tslib\";\nimport { Subject } from './Subject';\nimport { dateTimestampProvider } from './scheduler/dateTimestampProvider';\nvar ReplaySubject = (function (_super) {\n __extends(ReplaySubject, _super);\n function ReplaySubject(_bufferSize, _windowTime, _timestampProvider) {\n if (_bufferSize === void 0) { _bufferSize = Infinity; }\n if (_windowTime === void 0) { _windowTime = Infinity; }\n if (_timestampProvider === void 0) { _timestampProvider = dateTimestampProvider; }\n var _this = _super.call(this) || this;\n _this._bufferSize = _bufferSize;\n _this._windowTime = _windowTime;\n _this._timestampProvider = _timestampProvider;\n _this._buffer = [];\n _this._infiniteTimeWindow = true;\n _this._infiniteTimeWindow = _windowTime === Infinity;\n _this._bufferSize = Math.max(1, _bufferSize);\n _this._windowTime = Math.max(1, _windowTime);\n return _this;\n }\n ReplaySubject.prototype.next = function (value) {\n var _a = this, isStopped = _a.isStopped, _buffer = _a._buffer, _infiniteTimeWindow = _a._infiniteTimeWindow, _timestampProvider = _a._timestampProvider, _windowTime = _a._windowTime;\n if (!isStopped) {\n _buffer.push(value);\n !_infiniteTimeWindow && _buffer.push(_timestampProvider.now() + _windowTime);\n }\n this._trimBuffer();\n _super.prototype.next.call(this, value);\n };\n ReplaySubject.prototype._subscribe = function (subscriber) {\n this._throwIfClosed();\n this._trimBuffer();\n var subscription = this._innerSubscribe(subscriber);\n var _a = this, _infiniteTimeWindow = _a._infiniteTimeWindow, _buffer = _a._buffer;\n var copy = _buffer.slice();\n for (var i = 0; i < copy.length && !subscriber.closed; i += _infiniteTimeWindow ? 1 : 2) {\n subscriber.next(copy[i]);\n }\n this._checkFinalizedStatuses(subscriber);\n return subscription;\n };\n ReplaySubject.prototype._trimBuffer = function () {\n var _a = this, _bufferSize = _a._bufferSize, _timestampProvider = _a._timestampProvider, _buffer = _a._buffer, _infiniteTimeWindow = _a._infiniteTimeWindow;\n var adjustedBufferSize = (_infiniteTimeWindow ? 1 : 2) * _bufferSize;\n _bufferSize < Infinity && adjustedBufferSize < _buffer.length && _buffer.splice(0, _buffer.length - adjustedBufferSize);\n if (!_infiniteTimeWindow) {\n var now = _timestampProvider.now();\n var last = 0;\n for (var i = 1; i < _buffer.length && _buffer[i] <= now; i += 2) {\n last = i;\n }\n last && _buffer.splice(0, last + 1);\n }\n };\n return ReplaySubject;\n}(Subject));\nexport { ReplaySubject };\n//# sourceMappingURL=ReplaySubject.js.map","import { Observable } from '../Observable';\nexport var EMPTY = new Observable(function (subscriber) { return subscriber.complete(); });\nexport function empty(scheduler) {\n return scheduler ? emptyScheduled(scheduler) : EMPTY;\n}\nfunction emptyScheduled(scheduler) {\n return new Observable(function (subscriber) { return scheduler.schedule(function () { return subscriber.complete(); }); });\n}\n//# sourceMappingURL=empty.js.map","import { isFunction } from './isFunction';\nexport function isScheduler(value) {\n return value && isFunction(value.schedule);\n}\n//# sourceMappingURL=isScheduler.js.map","import { isFunction } from './isFunction';\nimport { isScheduler } from './isScheduler';\nfunction last(arr) {\n return arr[arr.length - 1];\n}\nexport function popResultSelector(args) {\n return isFunction(last(args)) ? args.pop() : undefined;\n}\nexport function popScheduler(args) {\n return isScheduler(last(args)) ? args.pop() : undefined;\n}\nexport function popNumber(args, defaultValue) {\n return typeof last(args) === 'number' ? args.pop() : defaultValue;\n}\n//# sourceMappingURL=args.js.map","export var isArrayLike = (function (x) { return x && typeof x.length === 'number' && typeof x !== 'function'; });\n//# sourceMappingURL=isArrayLike.js.map","import { isFunction } from \"./isFunction\";\nexport function isPromise(value) {\n return isFunction(value === null || value === void 0 ? void 0 : value.then);\n}\n//# sourceMappingURL=isPromise.js.map","import { observable as Symbol_observable } from '../symbol/observable';\nimport { isFunction } from './isFunction';\nexport function isInteropObservable(input) {\n return isFunction(input[Symbol_observable]);\n}\n//# sourceMappingURL=isInteropObservable.js.map","import { isFunction } from './isFunction';\nexport function isAsyncIterable(obj) {\n return Symbol.asyncIterator && isFunction(obj === null || obj === void 0 ? void 0 : obj[Symbol.asyncIterator]);\n}\n//# sourceMappingURL=isAsyncIterable.js.map","export function createInvalidObservableTypeError(input) {\n return new TypeError(\"You provided \" + (input !== null && typeof input === 'object' ? 'an invalid object' : \"'\" + input + \"'\") + \" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.\");\n}\n//# sourceMappingURL=throwUnobservableError.js.map","export function getSymbolIterator() {\n if (typeof Symbol !== 'function' || !Symbol.iterator) {\n return '@@iterator';\n }\n return Symbol.iterator;\n}\nexport var iterator = getSymbolIterator();\n//# sourceMappingURL=iterator.js.map","import { iterator as Symbol_iterator } from '../symbol/iterator';\nimport { isFunction } from './isFunction';\nexport function isIterable(input) {\n return isFunction(input === null || input === void 0 ? void 0 : input[Symbol_iterator]);\n}\n//# sourceMappingURL=isIterable.js.map","import { __asyncGenerator, __await, __generator } from \"tslib\";\nimport { isFunction } from './isFunction';\nexport function readableStreamLikeToAsyncGenerator(readableStream) {\n return __asyncGenerator(this, arguments, function readableStreamLikeToAsyncGenerator_1() {\n var reader, _a, value, done;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n reader = readableStream.getReader();\n _b.label = 1;\n case 1:\n _b.trys.push([1, , 9, 10]);\n _b.label = 2;\n case 2:\n if (!true) return [3, 8];\n return [4, __await(reader.read())];\n case 3:\n _a = _b.sent(), value = _a.value, done = _a.done;\n if (!done) return [3, 5];\n return [4, __await(void 0)];\n case 4: return [2, _b.sent()];\n case 5: return [4, __await(value)];\n case 6: return [4, _b.sent()];\n case 7:\n _b.sent();\n return [3, 2];\n case 8: return [3, 10];\n case 9:\n reader.releaseLock();\n return [7];\n case 10: return [2];\n }\n });\n });\n}\nexport function isReadableStreamLike(obj) {\n return isFunction(obj === null || obj === void 0 ? void 0 : obj.getReader);\n}\n//# sourceMappingURL=isReadableStreamLike.js.map","import { __asyncValues, __awaiter, __generator, __values } from \"tslib\";\nimport { isArrayLike } from '../util/isArrayLike';\nimport { isPromise } from '../util/isPromise';\nimport { Observable } from '../Observable';\nimport { isInteropObservable } from '../util/isInteropObservable';\nimport { isAsyncIterable } from '../util/isAsyncIterable';\nimport { createInvalidObservableTypeError } from '../util/throwUnobservableError';\nimport { isIterable } from '../util/isIterable';\nimport { isReadableStreamLike, readableStreamLikeToAsyncGenerator } from '../util/isReadableStreamLike';\nimport { isFunction } from '../util/isFunction';\nimport { reportUnhandledError } from '../util/reportUnhandledError';\nimport { observable as Symbol_observable } from '../symbol/observable';\nexport function innerFrom(input) {\n if (input instanceof Observable) {\n return input;\n }\n if (input != null) {\n if (isInteropObservable(input)) {\n return fromInteropObservable(input);\n }\n if (isArrayLike(input)) {\n return fromArrayLike(input);\n }\n if (isPromise(input)) {\n return fromPromise(input);\n }\n if (isAsyncIterable(input)) {\n return fromAsyncIterable(input);\n }\n if (isIterable(input)) {\n return fromIterable(input);\n }\n if (isReadableStreamLike(input)) {\n return fromReadableStreamLike(input);\n }\n }\n throw createInvalidObservableTypeError(input);\n}\nexport function fromInteropObservable(obj) {\n return new Observable(function (subscriber) {\n var obs = obj[Symbol_observable]();\n if (isFunction(obs.subscribe)) {\n return obs.subscribe(subscriber);\n }\n throw new TypeError('Provided object does not correctly implement Symbol.observable');\n });\n}\nexport function fromArrayLike(array) {\n return new Observable(function (subscriber) {\n for (var i = 0; i < array.length && !subscriber.closed; i++) {\n subscriber.next(array[i]);\n }\n subscriber.complete();\n });\n}\nexport function fromPromise(promise) {\n return new Observable(function (subscriber) {\n promise\n .then(function (value) {\n if (!subscriber.closed) {\n subscriber.next(value);\n subscriber.complete();\n }\n }, function (err) { return subscriber.error(err); })\n .then(null, reportUnhandledError);\n });\n}\nexport function fromIterable(iterable) {\n return new Observable(function (subscriber) {\n var e_1, _a;\n try {\n for (var iterable_1 = __values(iterable), iterable_1_1 = iterable_1.next(); !iterable_1_1.done; iterable_1_1 = iterable_1.next()) {\n var value = iterable_1_1.value;\n subscriber.next(value);\n if (subscriber.closed) {\n return;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (iterable_1_1 && !iterable_1_1.done && (_a = iterable_1.return)) _a.call(iterable_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n subscriber.complete();\n });\n}\nexport function fromAsyncIterable(asyncIterable) {\n return new Observable(function (subscriber) {\n process(asyncIterable, subscriber).catch(function (err) { return subscriber.error(err); });\n });\n}\nexport function fromReadableStreamLike(readableStream) {\n return fromAsyncIterable(readableStreamLikeToAsyncGenerator(readableStream));\n}\nfunction process(asyncIterable, subscriber) {\n var asyncIterable_1, asyncIterable_1_1;\n var e_2, _a;\n return __awaiter(this, void 0, void 0, function () {\n var value, e_2_1;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _b.trys.push([0, 5, 6, 11]);\n asyncIterable_1 = __asyncValues(asyncIterable);\n _b.label = 1;\n case 1: return [4, asyncIterable_1.next()];\n case 2:\n if (!(asyncIterable_1_1 = _b.sent(), !asyncIterable_1_1.done)) return [3, 4];\n value = asyncIterable_1_1.value;\n subscriber.next(value);\n if (subscriber.closed) {\n return [2];\n }\n _b.label = 3;\n case 3: return [3, 1];\n case 4: return [3, 11];\n case 5:\n e_2_1 = _b.sent();\n e_2 = { error: e_2_1 };\n return [3, 11];\n case 6:\n _b.trys.push([6, , 9, 10]);\n if (!(asyncIterable_1_1 && !asyncIterable_1_1.done && (_a = asyncIterable_1.return))) return [3, 8];\n return [4, _a.call(asyncIterable_1)];\n case 7:\n _b.sent();\n _b.label = 8;\n case 8: return [3, 10];\n case 9:\n if (e_2) throw e_2.error;\n return [7];\n case 10: return [7];\n case 11:\n subscriber.complete();\n return [2];\n }\n });\n });\n}\n//# sourceMappingURL=innerFrom.js.map","export function executeSchedule(parentSubscription, scheduler, work, delay, repeat) {\n if (delay === void 0) { delay = 0; }\n if (repeat === void 0) { repeat = false; }\n var scheduleSubscription = scheduler.schedule(function () {\n work();\n if (repeat) {\n parentSubscription.add(this.schedule(null, delay));\n }\n else {\n this.unsubscribe();\n }\n }, delay);\n parentSubscription.add(scheduleSubscription);\n if (!repeat) {\n return scheduleSubscription;\n }\n}\n//# sourceMappingURL=executeSchedule.js.map","import { executeSchedule } from '../util/executeSchedule';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function observeOn(scheduler, delay) {\n if (delay === void 0) { delay = 0; }\n return operate(function (source, subscriber) {\n source.subscribe(createOperatorSubscriber(subscriber, function (value) { return executeSchedule(subscriber, scheduler, function () { return subscriber.next(value); }, delay); }, function () { return executeSchedule(subscriber, scheduler, function () { return subscriber.complete(); }, delay); }, function (err) { return executeSchedule(subscriber, scheduler, function () { return subscriber.error(err); }, delay); }));\n });\n}\n//# sourceMappingURL=observeOn.js.map","import { operate } from '../util/lift';\nexport function subscribeOn(scheduler, delay) {\n if (delay === void 0) { delay = 0; }\n return operate(function (source, subscriber) {\n subscriber.add(scheduler.schedule(function () { return source.subscribe(subscriber); }, delay));\n });\n}\n//# sourceMappingURL=subscribeOn.js.map","import { innerFrom } from '../observable/innerFrom';\nimport { observeOn } from '../operators/observeOn';\nimport { subscribeOn } from '../operators/subscribeOn';\nexport function scheduleObservable(input, scheduler) {\n return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));\n}\n//# sourceMappingURL=scheduleObservable.js.map","import { innerFrom } from '../observable/innerFrom';\nimport { observeOn } from '../operators/observeOn';\nimport { subscribeOn } from '../operators/subscribeOn';\nexport function schedulePromise(input, scheduler) {\n return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));\n}\n//# sourceMappingURL=schedulePromise.js.map","import { Observable } from '../Observable';\nexport function scheduleArray(input, scheduler) {\n return new Observable(function (subscriber) {\n var i = 0;\n return scheduler.schedule(function () {\n if (i === input.length) {\n subscriber.complete();\n }\n else {\n subscriber.next(input[i++]);\n if (!subscriber.closed) {\n this.schedule();\n }\n }\n });\n });\n}\n//# sourceMappingURL=scheduleArray.js.map","import { Observable } from '../Observable';\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\nimport { isFunction } from '../util/isFunction';\nimport { executeSchedule } from '../util/executeSchedule';\nexport function scheduleIterable(input, scheduler) {\n return new Observable(function (subscriber) {\n var iterator;\n executeSchedule(subscriber, scheduler, function () {\n iterator = input[Symbol_iterator]();\n executeSchedule(subscriber, scheduler, function () {\n var _a;\n var value;\n var done;\n try {\n (_a = iterator.next(), value = _a.value, done = _a.done);\n }\n catch (err) {\n subscriber.error(err);\n return;\n }\n if (done) {\n subscriber.complete();\n }\n else {\n subscriber.next(value);\n }\n }, 0, true);\n });\n return function () { return isFunction(iterator === null || iterator === void 0 ? void 0 : iterator.return) && iterator.return(); };\n });\n}\n//# sourceMappingURL=scheduleIterable.js.map","import { Observable } from '../Observable';\nimport { executeSchedule } from '../util/executeSchedule';\nexport function scheduleAsyncIterable(input, scheduler) {\n if (!input) {\n throw new Error('Iterable cannot be null');\n }\n return new Observable(function (subscriber) {\n executeSchedule(subscriber, scheduler, function () {\n var iterator = input[Symbol.asyncIterator]();\n executeSchedule(subscriber, scheduler, function () {\n iterator.next().then(function (result) {\n if (result.done) {\n subscriber.complete();\n }\n else {\n subscriber.next(result.value);\n }\n });\n }, 0, true);\n });\n });\n}\n//# sourceMappingURL=scheduleAsyncIterable.js.map","import { scheduleAsyncIterable } from './scheduleAsyncIterable';\nimport { readableStreamLikeToAsyncGenerator } from '../util/isReadableStreamLike';\nexport function scheduleReadableStreamLike(input, scheduler) {\n return scheduleAsyncIterable(readableStreamLikeToAsyncGenerator(input), scheduler);\n}\n//# sourceMappingURL=scheduleReadableStreamLike.js.map","import { scheduleObservable } from './scheduleObservable';\nimport { schedulePromise } from './schedulePromise';\nimport { scheduleArray } from './scheduleArray';\nimport { scheduleIterable } from './scheduleIterable';\nimport { scheduleAsyncIterable } from './scheduleAsyncIterable';\nimport { isInteropObservable } from '../util/isInteropObservable';\nimport { isPromise } from '../util/isPromise';\nimport { isArrayLike } from '../util/isArrayLike';\nimport { isIterable } from '../util/isIterable';\nimport { isAsyncIterable } from '../util/isAsyncIterable';\nimport { createInvalidObservableTypeError } from '../util/throwUnobservableError';\nimport { isReadableStreamLike } from '../util/isReadableStreamLike';\nimport { scheduleReadableStreamLike } from './scheduleReadableStreamLike';\nexport function scheduled(input, scheduler) {\n if (input != null) {\n if (isInteropObservable(input)) {\n return scheduleObservable(input, scheduler);\n }\n if (isArrayLike(input)) {\n return scheduleArray(input, scheduler);\n }\n if (isPromise(input)) {\n return schedulePromise(input, scheduler);\n }\n if (isAsyncIterable(input)) {\n return scheduleAsyncIterable(input, scheduler);\n }\n if (isIterable(input)) {\n return scheduleIterable(input, scheduler);\n }\n if (isReadableStreamLike(input)) {\n return scheduleReadableStreamLike(input, scheduler);\n }\n }\n throw createInvalidObservableTypeError(input);\n}\n//# sourceMappingURL=scheduled.js.map","import { scheduled } from '../scheduled/scheduled';\nimport { innerFrom } from './innerFrom';\nexport function from(input, scheduler) {\n return scheduler ? scheduled(input, scheduler) : innerFrom(input);\n}\n//# sourceMappingURL=from.js.map","import { popScheduler } from '../util/args';\nimport { from } from './from';\nexport function of() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var scheduler = popScheduler(args);\n return from(args, scheduler);\n}\n//# sourceMappingURL=of.js.map","import { createErrorClass } from './createErrorClass';\nexport var EmptyError = createErrorClass(function (_super) { return function EmptyErrorImpl() {\n _super(this);\n this.name = 'EmptyError';\n this.message = 'no elements in sequence';\n}; });\n//# sourceMappingURL=EmptyError.js.map","import { EmptyError } from './util/EmptyError';\nimport { SafeSubscriber } from './Subscriber';\nexport function firstValueFrom(source, config) {\n var hasConfig = typeof config === 'object';\n return new Promise(function (resolve, reject) {\n var subscriber = new SafeSubscriber({\n next: function (value) {\n resolve(value);\n subscriber.unsubscribe();\n },\n error: reject,\n complete: function () {\n if (hasConfig) {\n resolve(config.defaultValue);\n }\n else {\n reject(new EmptyError());\n }\n },\n });\n source.subscribe(subscriber);\n });\n}\n//# sourceMappingURL=firstValueFrom.js.map","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function map(project, thisArg) {\n return operate(function (source, subscriber) {\n var index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n subscriber.next(project.call(thisArg, value, index++));\n }));\n });\n}\n//# sourceMappingURL=map.js.map","import { __read, __spreadArray } from \"tslib\";\nimport { map } from \"../operators/map\";\nvar isArray = Array.isArray;\nfunction callOrApply(fn, args) {\n return isArray(args) ? fn.apply(void 0, __spreadArray([], __read(args))) : fn(args);\n}\nexport function mapOneOrManyArgs(fn) {\n return map(function (args) { return callOrApply(fn, args); });\n}\n//# sourceMappingURL=mapOneOrManyArgs.js.map","var isArray = Array.isArray;\nvar getPrototypeOf = Object.getPrototypeOf, objectProto = Object.prototype, getKeys = Object.keys;\nexport function argsArgArrayOrObject(args) {\n if (args.length === 1) {\n var first_1 = args[0];\n if (isArray(first_1)) {\n return { args: first_1, keys: null };\n }\n if (isPOJO(first_1)) {\n var keys = getKeys(first_1);\n return {\n args: keys.map(function (key) { return first_1[key]; }),\n keys: keys,\n };\n }\n }\n return { args: args, keys: null };\n}\nfunction isPOJO(obj) {\n return obj && typeof obj === 'object' && getPrototypeOf(obj) === objectProto;\n}\n//# sourceMappingURL=argsArgArrayOrObject.js.map","export function createObject(keys, values) {\n return keys.reduce(function (result, key, i) { return ((result[key] = values[i]), result); }, {});\n}\n//# sourceMappingURL=createObject.js.map","import { Observable } from '../Observable';\nimport { argsArgArrayOrObject } from '../util/argsArgArrayOrObject';\nimport { from } from './from';\nimport { identity } from '../util/identity';\nimport { mapOneOrManyArgs } from '../util/mapOneOrManyArgs';\nimport { popResultSelector, popScheduler } from '../util/args';\nimport { createObject } from '../util/createObject';\nimport { createOperatorSubscriber } from '../operators/OperatorSubscriber';\nimport { executeSchedule } from '../util/executeSchedule';\nexport function combineLatest() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var scheduler = popScheduler(args);\n var resultSelector = popResultSelector(args);\n var _a = argsArgArrayOrObject(args), observables = _a.args, keys = _a.keys;\n if (observables.length === 0) {\n return from([], scheduler);\n }\n var result = new Observable(combineLatestInit(observables, scheduler, keys\n ?\n function (values) { return createObject(keys, values); }\n :\n identity));\n return resultSelector ? result.pipe(mapOneOrManyArgs(resultSelector)) : result;\n}\nexport function combineLatestInit(observables, scheduler, valueTransform) {\n if (valueTransform === void 0) { valueTransform = identity; }\n return function (subscriber) {\n maybeSchedule(scheduler, function () {\n var length = observables.length;\n var values = new Array(length);\n var active = length;\n var remainingFirstValues = length;\n var _loop_1 = function (i) {\n maybeSchedule(scheduler, function () {\n var source = from(observables[i], scheduler);\n var hasFirstValue = false;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n values[i] = value;\n if (!hasFirstValue) {\n hasFirstValue = true;\n remainingFirstValues--;\n }\n if (!remainingFirstValues) {\n subscriber.next(valueTransform(values.slice()));\n }\n }, function () {\n if (!--active) {\n subscriber.complete();\n }\n }));\n }, subscriber);\n };\n for (var i = 0; i < length; i++) {\n _loop_1(i);\n }\n }, subscriber);\n };\n}\nfunction maybeSchedule(scheduler, execute, subscription) {\n if (scheduler) {\n executeSchedule(subscription, scheduler, execute);\n }\n else {\n execute();\n }\n}\n//# sourceMappingURL=combineLatest.js.map","import { innerFrom } from '../observable/innerFrom';\nimport { executeSchedule } from '../util/executeSchedule';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function mergeInternals(source, subscriber, project, concurrent, onBeforeNext, expand, innerSubScheduler, additionalFinalizer) {\n var buffer = [];\n var active = 0;\n var index = 0;\n var isComplete = false;\n var checkComplete = function () {\n if (isComplete && !buffer.length && !active) {\n subscriber.complete();\n }\n };\n var outerNext = function (value) { return (active < concurrent ? doInnerSub(value) : buffer.push(value)); };\n var doInnerSub = function (value) {\n expand && subscriber.next(value);\n active++;\n var innerComplete = false;\n innerFrom(project(value, index++)).subscribe(createOperatorSubscriber(subscriber, function (innerValue) {\n onBeforeNext === null || onBeforeNext === void 0 ? void 0 : onBeforeNext(innerValue);\n if (expand) {\n outerNext(innerValue);\n }\n else {\n subscriber.next(innerValue);\n }\n }, function () {\n innerComplete = true;\n }, undefined, function () {\n if (innerComplete) {\n try {\n active--;\n var _loop_1 = function () {\n var bufferedValue = buffer.shift();\n if (innerSubScheduler) {\n executeSchedule(subscriber, innerSubScheduler, function () { return doInnerSub(bufferedValue); });\n }\n else {\n doInnerSub(bufferedValue);\n }\n };\n while (buffer.length && active < concurrent) {\n _loop_1();\n }\n checkComplete();\n }\n catch (err) {\n subscriber.error(err);\n }\n }\n }));\n };\n source.subscribe(createOperatorSubscriber(subscriber, outerNext, function () {\n isComplete = true;\n checkComplete();\n }));\n return function () {\n additionalFinalizer === null || additionalFinalizer === void 0 ? void 0 : additionalFinalizer();\n };\n}\n//# sourceMappingURL=mergeInternals.js.map","import { map } from './map';\nimport { innerFrom } from '../observable/innerFrom';\nimport { operate } from '../util/lift';\nimport { mergeInternals } from './mergeInternals';\nimport { isFunction } from '../util/isFunction';\nexport function mergeMap(project, resultSelector, concurrent) {\n if (concurrent === void 0) { concurrent = Infinity; }\n if (isFunction(resultSelector)) {\n return mergeMap(function (a, i) { return map(function (b, ii) { return resultSelector(a, b, i, ii); })(innerFrom(project(a, i))); }, concurrent);\n }\n else if (typeof resultSelector === 'number') {\n concurrent = resultSelector;\n }\n return operate(function (source, subscriber) { return mergeInternals(source, subscriber, project, concurrent); });\n}\n//# sourceMappingURL=mergeMap.js.map","import { mergeMap } from './mergeMap';\nimport { identity } from '../util/identity';\nexport function mergeAll(concurrent) {\n if (concurrent === void 0) { concurrent = Infinity; }\n return mergeMap(identity, concurrent);\n}\n//# sourceMappingURL=mergeAll.js.map","import { mergeAll } from './mergeAll';\nexport function concatAll() {\n return mergeAll(1);\n}\n//# sourceMappingURL=concatAll.js.map","import { concatAll } from '../operators/concatAll';\nimport { popScheduler } from '../util/args';\nimport { from } from './from';\nexport function concat() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return concatAll()(from(args, popScheduler(args)));\n}\n//# sourceMappingURL=concat.js.map","import { Observable } from '../Observable';\nimport { innerFrom } from './innerFrom';\nexport function defer(observableFactory) {\n return new Observable(function (subscriber) {\n innerFrom(observableFactory()).subscribe(subscriber);\n });\n}\n//# sourceMappingURL=defer.js.map","import { mergeAll } from '../operators/mergeAll';\nimport { innerFrom } from './innerFrom';\nimport { EMPTY } from './empty';\nimport { popNumber, popScheduler } from '../util/args';\nimport { from } from './from';\nexport function merge() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var scheduler = popScheduler(args);\n var concurrent = popNumber(args, Infinity);\n var sources = args;\n return !sources.length\n ?\n EMPTY\n : sources.length === 1\n ?\n innerFrom(sources[0])\n :\n mergeAll(concurrent)(from(sources, scheduler));\n}\n//# sourceMappingURL=merge.js.map","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function filter(predicate, thisArg) {\n return operate(function (source, subscriber) {\n var index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) { return predicate.call(thisArg, value, index++) && subscriber.next(value); }));\n });\n}\n//# sourceMappingURL=filter.js.map","import { innerFrom } from '../observable/innerFrom';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { operate } from '../util/lift';\nexport function catchError(selector) {\n return operate(function (source, subscriber) {\n var innerSub = null;\n var syncUnsub = false;\n var handledResult;\n innerSub = source.subscribe(createOperatorSubscriber(subscriber, undefined, undefined, function (err) {\n handledResult = innerFrom(selector(err, catchError(selector)(source)));\n if (innerSub) {\n innerSub.unsubscribe();\n innerSub = null;\n handledResult.subscribe(subscriber);\n }\n else {\n syncUnsub = true;\n }\n }));\n if (syncUnsub) {\n innerSub.unsubscribe();\n innerSub = null;\n handledResult.subscribe(subscriber);\n }\n });\n}\n//# sourceMappingURL=catchError.js.map","import { mergeMap } from './mergeMap';\nimport { isFunction } from '../util/isFunction';\nexport function concatMap(project, resultSelector) {\n return isFunction(resultSelector) ? mergeMap(project, resultSelector, 1) : mergeMap(project, 1);\n}\n//# sourceMappingURL=concatMap.js.map","import { EMPTY } from '../observable/empty';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function take(count) {\n return count <= 0\n ?\n function () { return EMPTY; }\n : operate(function (source, subscriber) {\n var seen = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n if (++seen <= count) {\n subscriber.next(value);\n if (count <= seen) {\n subscriber.complete();\n }\n }\n }));\n });\n}\n//# sourceMappingURL=take.js.map","import { __read, __spreadArray } from \"tslib\";\nimport { from } from '../observable/from';\nimport { take } from '../operators/take';\nimport { Subject } from '../Subject';\nimport { SafeSubscriber } from '../Subscriber';\nimport { operate } from '../util/lift';\nexport function share(options) {\n if (options === void 0) { options = {}; }\n var _a = options.connector, connector = _a === void 0 ? function () { return new Subject(); } : _a, _b = options.resetOnError, resetOnError = _b === void 0 ? true : _b, _c = options.resetOnComplete, resetOnComplete = _c === void 0 ? true : _c, _d = options.resetOnRefCountZero, resetOnRefCountZero = _d === void 0 ? true : _d;\n return function (wrapperSource) {\n var connection = null;\n var resetConnection = null;\n var subject = null;\n var refCount = 0;\n var hasCompleted = false;\n var hasErrored = false;\n var cancelReset = function () {\n resetConnection === null || resetConnection === void 0 ? void 0 : resetConnection.unsubscribe();\n resetConnection = null;\n };\n var reset = function () {\n cancelReset();\n connection = subject = null;\n hasCompleted = hasErrored = false;\n };\n var resetAndUnsubscribe = function () {\n var conn = connection;\n reset();\n conn === null || conn === void 0 ? void 0 : conn.unsubscribe();\n };\n return operate(function (source, subscriber) {\n refCount++;\n if (!hasErrored && !hasCompleted) {\n cancelReset();\n }\n var dest = (subject = subject !== null && subject !== void 0 ? subject : connector());\n subscriber.add(function () {\n refCount--;\n if (refCount === 0 && !hasErrored && !hasCompleted) {\n resetConnection = handleReset(resetAndUnsubscribe, resetOnRefCountZero);\n }\n });\n dest.subscribe(subscriber);\n if (!connection) {\n connection = new SafeSubscriber({\n next: function (value) { return dest.next(value); },\n error: function (err) {\n hasErrored = true;\n cancelReset();\n resetConnection = handleReset(reset, resetOnError, err);\n dest.error(err);\n },\n complete: function () {\n hasCompleted = true;\n cancelReset();\n resetConnection = handleReset(reset, resetOnComplete);\n dest.complete();\n },\n });\n from(source).subscribe(connection);\n }\n })(wrapperSource);\n };\n}\nfunction handleReset(reset, on) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n if (on === true) {\n reset();\n return null;\n }\n if (on === false) {\n return null;\n }\n return on.apply(void 0, __spreadArray([], __read(args))).pipe(take(1))\n .subscribe(function () { return reset(); });\n}\n//# sourceMappingURL=share.js.map","import { ReplaySubject } from '../ReplaySubject';\nimport { share } from './share';\nexport function shareReplay(configOrBufferSize, windowTime, scheduler) {\n var _a, _b, _c;\n var bufferSize;\n var refCount = false;\n if (configOrBufferSize && typeof configOrBufferSize === 'object') {\n (_a = configOrBufferSize.bufferSize, bufferSize = _a === void 0 ? Infinity : _a, _b = configOrBufferSize.windowTime, windowTime = _b === void 0 ? Infinity : _b, _c = configOrBufferSize.refCount, refCount = _c === void 0 ? false : _c, scheduler = configOrBufferSize.scheduler);\n }\n else {\n bufferSize = configOrBufferSize !== null && configOrBufferSize !== void 0 ? configOrBufferSize : Infinity;\n }\n return share({\n connector: function () { return new ReplaySubject(bufferSize, windowTime, scheduler); },\n resetOnError: true,\n resetOnComplete: false,\n resetOnRefCountZero: refCount,\n });\n}\n//# sourceMappingURL=shareReplay.js.map","import { isFunction } from '../util/isFunction';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { identity } from '../util/identity';\nexport function tap(observerOrNext, error, complete) {\n var tapObserver = isFunction(observerOrNext) || error || complete\n ?\n { next: observerOrNext, error: error, complete: complete }\n : observerOrNext;\n return tapObserver\n ? operate(function (source, subscriber) {\n var _a;\n (_a = tapObserver.subscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);\n var isUnsub = true;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n var _a;\n (_a = tapObserver.next) === null || _a === void 0 ? void 0 : _a.call(tapObserver, value);\n subscriber.next(value);\n }, function () {\n var _a;\n isUnsub = false;\n (_a = tapObserver.complete) === null || _a === void 0 ? void 0 : _a.call(tapObserver);\n subscriber.complete();\n }, function (err) {\n var _a;\n isUnsub = false;\n (_a = tapObserver.error) === null || _a === void 0 ? void 0 : _a.call(tapObserver, err);\n subscriber.error(err);\n }, function () {\n var _a, _b;\n if (isUnsub) {\n (_a = tapObserver.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);\n }\n (_b = tapObserver.finalize) === null || _b === void 0 ? void 0 : _b.call(tapObserver);\n }));\n })\n :\n identity;\n}\n//# sourceMappingURL=tap.js.map","export default {}","(function (module, exports) {\n 'use strict';\n\n // Utils\n function assert (val, msg) {\n if (!val) throw new Error(msg || 'Assertion failed');\n }\n\n // Could use `inherits` module, but don't want to move from single file\n // architecture yet.\n function inherits (ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function () {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n\n // BN\n\n function BN (number, base, endian) {\n if (BN.isBN(number)) {\n return number;\n }\n\n this.negative = 0;\n this.words = null;\n this.length = 0;\n\n // Reduction context\n this.red = null;\n\n if (number !== null) {\n if (base === 'le' || base === 'be') {\n endian = base;\n base = 10;\n }\n\n this._init(number || 0, base || 10, endian || 'be');\n }\n }\n if (typeof module === 'object') {\n module.exports = BN;\n } else {\n exports.BN = BN;\n }\n\n BN.BN = BN;\n BN.wordSize = 26;\n\n var Buffer;\n try {\n if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') {\n Buffer = window.Buffer;\n } else {\n Buffer = require('buffer').Buffer;\n }\n } catch (e) {\n }\n\n BN.isBN = function isBN (num) {\n if (num instanceof BN) {\n return true;\n }\n\n return num !== null && typeof num === 'object' &&\n num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n };\n\n BN.max = function max (left, right) {\n if (left.cmp(right) > 0) return left;\n return right;\n };\n\n BN.min = function min (left, right) {\n if (left.cmp(right) < 0) return left;\n return right;\n };\n\n BN.prototype._init = function init (number, base, endian) {\n if (typeof number === 'number') {\n return this._initNumber(number, base, endian);\n }\n\n if (typeof number === 'object') {\n return this._initArray(number, base, endian);\n }\n\n if (base === 'hex') {\n base = 16;\n }\n assert(base === (base | 0) && base >= 2 && base <= 36);\n\n number = number.toString().replace(/\\s+/g, '');\n var start = 0;\n if (number[0] === '-') {\n start++;\n this.negative = 1;\n }\n\n if (start < number.length) {\n if (base === 16) {\n this._parseHex(number, start, endian);\n } else {\n this._parseBase(number, base, start);\n if (endian === 'le') {\n this._initArray(this.toArray(), base, endian);\n }\n }\n }\n };\n\n BN.prototype._initNumber = function _initNumber (number, base, endian) {\n if (number < 0) {\n this.negative = 1;\n number = -number;\n }\n if (number < 0x4000000) {\n this.words = [number & 0x3ffffff];\n this.length = 1;\n } else if (number < 0x10000000000000) {\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff\n ];\n this.length = 2;\n } else {\n assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff,\n 1\n ];\n this.length = 3;\n }\n\n if (endian !== 'le') return;\n\n // Reverse the bytes\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initArray = function _initArray (number, base, endian) {\n // Perhaps a Uint8Array\n assert(typeof number.length === 'number');\n if (number.length <= 0) {\n this.words = [0];\n this.length = 1;\n return this;\n }\n\n this.length = Math.ceil(number.length / 3);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n var off = 0;\n if (endian === 'be') {\n for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n } else if (endian === 'le') {\n for (i = 0, j = 0; i < number.length; i += 3) {\n w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n }\n return this._strip();\n };\n\n function parseHex4Bits (string, index) {\n var c = string.charCodeAt(index);\n // '0' - '9'\n if (c >= 48 && c <= 57) {\n return c - 48;\n // 'A' - 'F'\n } else if (c >= 65 && c <= 70) {\n return c - 55;\n // 'a' - 'f'\n } else if (c >= 97 && c <= 102) {\n return c - 87;\n } else {\n assert(false, 'Invalid character in ' + string);\n }\n }\n\n function parseHexByte (string, lowerBound, index) {\n var r = parseHex4Bits(string, index);\n if (index - 1 >= lowerBound) {\n r |= parseHex4Bits(string, index - 1) << 4;\n }\n return r;\n }\n\n BN.prototype._parseHex = function _parseHex (number, start, endian) {\n // Create possibly bigger array to ensure that it fits the number\n this.length = Math.ceil((number.length - start) / 6);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n // 24-bits chunks\n var off = 0;\n var j = 0;\n\n var w;\n if (endian === 'be') {\n for (i = number.length - 1; i >= start; i -= 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n } else {\n var parseLength = number.length - start;\n for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n }\n\n this._strip();\n };\n\n function parseBase (str, start, end, mul) {\n var r = 0;\n var b = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r *= mul;\n\n // 'a'\n if (c >= 49) {\n b = c - 49 + 0xa;\n\n // 'A'\n } else if (c >= 17) {\n b = c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n b = c;\n }\n assert(c >= 0 && b < mul, 'Invalid character');\n r += b;\n }\n return r;\n }\n\n BN.prototype._parseBase = function _parseBase (number, base, start) {\n // Initialize as zero\n this.words = [0];\n this.length = 1;\n\n // Find length of limb in base\n for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n limbLen++;\n }\n limbLen--;\n limbPow = (limbPow / base) | 0;\n\n var total = number.length - start;\n var mod = total % limbLen;\n var end = Math.min(total, total - mod) + start;\n\n var word = 0;\n for (var i = start; i < end; i += limbLen) {\n word = parseBase(number, i, i + limbLen, base);\n\n this.imuln(limbPow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n if (mod !== 0) {\n var pow = 1;\n word = parseBase(number, i, number.length, base);\n\n for (i = 0; i < mod; i++) {\n pow *= base;\n }\n\n this.imuln(pow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n this._strip();\n };\n\n BN.prototype.copy = function copy (dest) {\n dest.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n dest.words[i] = this.words[i];\n }\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n };\n\n function move (dest, src) {\n dest.words = src.words;\n dest.length = src.length;\n dest.negative = src.negative;\n dest.red = src.red;\n }\n\n BN.prototype._move = function _move (dest) {\n move(dest, this);\n };\n\n BN.prototype.clone = function clone () {\n var r = new BN(null);\n this.copy(r);\n return r;\n };\n\n BN.prototype._expand = function _expand (size) {\n while (this.length < size) {\n this.words[this.length++] = 0;\n }\n return this;\n };\n\n // Remove leading `0` from `this`\n BN.prototype._strip = function strip () {\n while (this.length > 1 && this.words[this.length - 1] === 0) {\n this.length--;\n }\n return this._normSign();\n };\n\n BN.prototype._normSign = function _normSign () {\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0) {\n this.negative = 0;\n }\n return this;\n };\n\n // Check Symbol.for because not everywhere where Symbol defined\n // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#Browser_compatibility\n if (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function') {\n try {\n BN.prototype[Symbol.for('nodejs.util.inspect.custom')] = inspect;\n } catch (e) {\n BN.prototype.inspect = inspect;\n }\n } else {\n BN.prototype.inspect = inspect;\n }\n\n function inspect () {\n return (this.red ? '';\n }\n\n /*\n\n var zeros = [];\n var groupSizes = [];\n var groupBases = [];\n\n var s = '';\n var i = -1;\n while (++i < BN.wordSize) {\n zeros[i] = s;\n s += '0';\n }\n groupSizes[0] = 0;\n groupSizes[1] = 0;\n groupBases[0] = 0;\n groupBases[1] = 0;\n var base = 2 - 1;\n while (++base < 36 + 1) {\n var groupSize = 0;\n var groupBase = 1;\n while (groupBase < (1 << BN.wordSize) / base) {\n groupBase *= base;\n groupSize += 1;\n }\n groupSizes[base] = groupSize;\n groupBases[base] = groupBase;\n }\n\n */\n\n var zeros = [\n '',\n '0',\n '00',\n '000',\n '0000',\n '00000',\n '000000',\n '0000000',\n '00000000',\n '000000000',\n '0000000000',\n '00000000000',\n '000000000000',\n '0000000000000',\n '00000000000000',\n '000000000000000',\n '0000000000000000',\n '00000000000000000',\n '000000000000000000',\n '0000000000000000000',\n '00000000000000000000',\n '000000000000000000000',\n '0000000000000000000000',\n '00000000000000000000000',\n '000000000000000000000000',\n '0000000000000000000000000'\n ];\n\n var groupSizes = [\n 0, 0,\n 25, 16, 12, 11, 10, 9, 8,\n 8, 7, 7, 7, 7, 6, 6,\n 6, 6, 6, 6, 6, 5, 5,\n 5, 5, 5, 5, 5, 5, 5,\n 5, 5, 5, 5, 5, 5, 5\n ];\n\n var groupBases = [\n 0, 0,\n 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n ];\n\n BN.prototype.toString = function toString (base, padding) {\n base = base || 10;\n padding = padding | 0 || 1;\n\n var out;\n if (base === 16 || base === 'hex') {\n out = '';\n var off = 0;\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = this.words[i];\n var word = (((w << off) | carry) & 0xffffff).toString(16);\n carry = (w >>> (24 - off)) & 0xffffff;\n off += 2;\n if (off >= 26) {\n off -= 26;\n i--;\n }\n if (carry !== 0 || i !== this.length - 1) {\n out = zeros[6 - word.length] + word + out;\n } else {\n out = word + out;\n }\n }\n if (carry !== 0) {\n out = carry.toString(16) + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n if (base === (base | 0) && base >= 2 && base <= 36) {\n // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n var groupSize = groupSizes[base];\n // var groupBase = Math.pow(base, groupSize);\n var groupBase = groupBases[base];\n out = '';\n var c = this.clone();\n c.negative = 0;\n while (!c.isZero()) {\n var r = c.modrn(groupBase).toString(base);\n c = c.idivn(groupBase);\n\n if (!c.isZero()) {\n out = zeros[groupSize - r.length] + r + out;\n } else {\n out = r + out;\n }\n }\n if (this.isZero()) {\n out = '0' + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n assert(false, 'Base should be between 2 and 36');\n };\n\n BN.prototype.toNumber = function toNumber () {\n var ret = this.words[0];\n if (this.length === 2) {\n ret += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // NOTE: at this stage it is known that the top bit is set\n ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n } else if (this.length > 2) {\n assert(false, 'Number can only safely store up to 53 bits');\n }\n return (this.negative !== 0) ? -ret : ret;\n };\n\n BN.prototype.toJSON = function toJSON () {\n return this.toString(16, 2);\n };\n\n if (Buffer) {\n BN.prototype.toBuffer = function toBuffer (endian, length) {\n return this.toArrayLike(Buffer, endian, length);\n };\n }\n\n BN.prototype.toArray = function toArray (endian, length) {\n return this.toArrayLike(Array, endian, length);\n };\n\n var allocate = function allocate (ArrayType, size) {\n if (ArrayType.allocUnsafe) {\n return ArrayType.allocUnsafe(size);\n }\n return new ArrayType(size);\n };\n\n BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n this._strip();\n\n var byteLength = this.byteLength();\n var reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, 'byte array longer than desired length');\n assert(reqLength > 0, 'Requested array length <= 0');\n\n var res = allocate(ArrayType, reqLength);\n var postfix = endian === 'le' ? 'LE' : 'BE';\n this['_toArrayLike' + postfix](res, byteLength);\n return res;\n };\n\n BN.prototype._toArrayLikeLE = function _toArrayLikeLE (res, byteLength) {\n var position = 0;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position++] = word & 0xff;\n if (position < res.length) {\n res[position++] = (word >> 8) & 0xff;\n }\n if (position < res.length) {\n res[position++] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position < res.length) {\n res[position++] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position < res.length) {\n res[position++] = carry;\n\n while (position < res.length) {\n res[position++] = 0;\n }\n }\n };\n\n BN.prototype._toArrayLikeBE = function _toArrayLikeBE (res, byteLength) {\n var position = res.length - 1;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position--] = word & 0xff;\n if (position >= 0) {\n res[position--] = (word >> 8) & 0xff;\n }\n if (position >= 0) {\n res[position--] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position >= 0) {\n res[position--] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position >= 0) {\n res[position--] = carry;\n\n while (position >= 0) {\n res[position--] = 0;\n }\n }\n };\n\n if (Math.clz32) {\n BN.prototype._countBits = function _countBits (w) {\n return 32 - Math.clz32(w);\n };\n } else {\n BN.prototype._countBits = function _countBits (w) {\n var t = w;\n var r = 0;\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n return r + t;\n };\n }\n\n BN.prototype._zeroBits = function _zeroBits (w) {\n // Short-cut\n if (w === 0) return 26;\n\n var t = w;\n var r = 0;\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n if ((t & 0x1) === 0) {\n r++;\n }\n return r;\n };\n\n // Return number of used bits in a BN\n BN.prototype.bitLength = function bitLength () {\n var w = this.words[this.length - 1];\n var hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n\n function toBitArray (num) {\n var w = new Array(num.bitLength());\n\n for (var bit = 0; bit < w.length; bit++) {\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n w[bit] = (num.words[off] >>> wbit) & 0x01;\n }\n\n return w;\n }\n\n // Number of trailing zero bits\n BN.prototype.zeroBits = function zeroBits () {\n if (this.isZero()) return 0;\n\n var r = 0;\n for (var i = 0; i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n r += b;\n if (b !== 26) break;\n }\n return r;\n };\n\n BN.prototype.byteLength = function byteLength () {\n return Math.ceil(this.bitLength() / 8);\n };\n\n BN.prototype.toTwos = function toTwos (width) {\n if (this.negative !== 0) {\n return this.abs().inotn(width).iaddn(1);\n }\n return this.clone();\n };\n\n BN.prototype.fromTwos = function fromTwos (width) {\n if (this.testn(width - 1)) {\n return this.notn(width).iaddn(1).ineg();\n }\n return this.clone();\n };\n\n BN.prototype.isNeg = function isNeg () {\n return this.negative !== 0;\n };\n\n // Return negative clone of `this`\n BN.prototype.neg = function neg () {\n return this.clone().ineg();\n };\n\n BN.prototype.ineg = function ineg () {\n if (!this.isZero()) {\n this.negative ^= 1;\n }\n\n return this;\n };\n\n // Or `num` with `this` in-place\n BN.prototype.iuor = function iuor (num) {\n while (this.length < num.length) {\n this.words[this.length++] = 0;\n }\n\n for (var i = 0; i < num.length; i++) {\n this.words[i] = this.words[i] | num.words[i];\n }\n\n return this._strip();\n };\n\n BN.prototype.ior = function ior (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuor(num);\n };\n\n // Or `num` with `this`\n BN.prototype.or = function or (num) {\n if (this.length > num.length) return this.clone().ior(num);\n return num.clone().ior(this);\n };\n\n BN.prototype.uor = function uor (num) {\n if (this.length > num.length) return this.clone().iuor(num);\n return num.clone().iuor(this);\n };\n\n // And `num` with `this` in-place\n BN.prototype.iuand = function iuand (num) {\n // b = min-length(num, this)\n var b;\n if (this.length > num.length) {\n b = num;\n } else {\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = this.words[i] & num.words[i];\n }\n\n this.length = b.length;\n\n return this._strip();\n };\n\n BN.prototype.iand = function iand (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuand(num);\n };\n\n // And `num` with `this`\n BN.prototype.and = function and (num) {\n if (this.length > num.length) return this.clone().iand(num);\n return num.clone().iand(this);\n };\n\n BN.prototype.uand = function uand (num) {\n if (this.length > num.length) return this.clone().iuand(num);\n return num.clone().iuand(this);\n };\n\n // Xor `num` with `this` in-place\n BN.prototype.iuxor = function iuxor (num) {\n // a.length > b.length\n var a;\n var b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = a.words[i] ^ b.words[i];\n }\n\n if (this !== a) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = a.length;\n\n return this._strip();\n };\n\n BN.prototype.ixor = function ixor (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuxor(num);\n };\n\n // Xor `num` with `this`\n BN.prototype.xor = function xor (num) {\n if (this.length > num.length) return this.clone().ixor(num);\n return num.clone().ixor(this);\n };\n\n BN.prototype.uxor = function uxor (num) {\n if (this.length > num.length) return this.clone().iuxor(num);\n return num.clone().iuxor(this);\n };\n\n // Not ``this`` with ``width`` bitwidth\n BN.prototype.inotn = function inotn (width) {\n assert(typeof width === 'number' && width >= 0);\n\n var bytesNeeded = Math.ceil(width / 26) | 0;\n var bitsLeft = width % 26;\n\n // Extend the buffer with leading zeroes\n this._expand(bytesNeeded);\n\n if (bitsLeft > 0) {\n bytesNeeded--;\n }\n\n // Handle complete words\n for (var i = 0; i < bytesNeeded; i++) {\n this.words[i] = ~this.words[i] & 0x3ffffff;\n }\n\n // Handle the residue\n if (bitsLeft > 0) {\n this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n }\n\n // And remove leading zeroes\n return this._strip();\n };\n\n BN.prototype.notn = function notn (width) {\n return this.clone().inotn(width);\n };\n\n // Set `bit` of `this`\n BN.prototype.setn = function setn (bit, val) {\n assert(typeof bit === 'number' && bit >= 0);\n\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n this._expand(off + 1);\n\n if (val) {\n this.words[off] = this.words[off] | (1 << wbit);\n } else {\n this.words[off] = this.words[off] & ~(1 << wbit);\n }\n\n return this._strip();\n };\n\n // Add `num` to `this` in-place\n BN.prototype.iadd = function iadd (num) {\n var r;\n\n // negative + positive\n if (this.negative !== 0 && num.negative === 0) {\n this.negative = 0;\n r = this.isub(num);\n this.negative ^= 1;\n return this._normSign();\n\n // positive + negative\n } else if (this.negative === 0 && num.negative !== 0) {\n num.negative = 0;\n r = this.isub(num);\n num.negative = 1;\n return r._normSign();\n }\n\n // a.length > b.length\n var a, b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n\n this.length = a.length;\n if (carry !== 0) {\n this.words[this.length] = carry;\n this.length++;\n // Copy the rest of the words\n } else if (a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n return this;\n };\n\n // Add `num` to `this`\n BN.prototype.add = function add (num) {\n var res;\n if (num.negative !== 0 && this.negative === 0) {\n num.negative = 0;\n res = this.sub(num);\n num.negative ^= 1;\n return res;\n } else if (num.negative === 0 && this.negative !== 0) {\n this.negative = 0;\n res = num.sub(this);\n this.negative = 1;\n return res;\n }\n\n if (this.length > num.length) return this.clone().iadd(num);\n\n return num.clone().iadd(this);\n };\n\n // Subtract `num` from `this` in-place\n BN.prototype.isub = function isub (num) {\n // this - (-num) = this + num\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n num.negative = 1;\n return r._normSign();\n\n // -this - num = -(this + num)\n } else if (this.negative !== 0) {\n this.negative = 0;\n this.iadd(num);\n this.negative = 1;\n return this._normSign();\n }\n\n // At this point both numbers are positive\n var cmp = this.cmp(num);\n\n // Optimization - zeroify\n if (cmp === 0) {\n this.negative = 0;\n this.length = 1;\n this.words[0] = 0;\n return this;\n }\n\n // a > b\n var a, b;\n if (cmp > 0) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n\n // Copy rest of the words\n if (carry === 0 && i < a.length && a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = Math.max(this.length, i);\n\n if (a !== this) {\n this.negative = 1;\n }\n\n return this._strip();\n };\n\n // Subtract `num` from `this`\n BN.prototype.sub = function sub (num) {\n return this.clone().isub(num);\n };\n\n function smallMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n var len = (self.length + num.length) | 0;\n out.length = len;\n len = (len - 1) | 0;\n\n // Peel one iteration (compiler can't do it, because of code complexity)\n var a = self.words[0] | 0;\n var b = num.words[0] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n var carry = (r / 0x4000000) | 0;\n out.words[0] = lo;\n\n for (var k = 1; k < len; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = carry >>> 26;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = (k - j) | 0;\n a = self.words[i] | 0;\n b = num.words[j] | 0;\n r = a * b + rword;\n ncarry += (r / 0x4000000) | 0;\n rword = r & 0x3ffffff;\n }\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n if (carry !== 0) {\n out.words[k] = carry | 0;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n // TODO(indutny): it may be reasonable to omit it for users who don't need\n // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n // multiplication (like elliptic secp256k1).\n var comb10MulTo = function comb10MulTo (self, num, out) {\n var a = self.words;\n var b = num.words;\n var o = out.words;\n var c = 0;\n var lo;\n var mid;\n var hi;\n var a0 = a[0] | 0;\n var al0 = a0 & 0x1fff;\n var ah0 = a0 >>> 13;\n var a1 = a[1] | 0;\n var al1 = a1 & 0x1fff;\n var ah1 = a1 >>> 13;\n var a2 = a[2] | 0;\n var al2 = a2 & 0x1fff;\n var ah2 = a2 >>> 13;\n var a3 = a[3] | 0;\n var al3 = a3 & 0x1fff;\n var ah3 = a3 >>> 13;\n var a4 = a[4] | 0;\n var al4 = a4 & 0x1fff;\n var ah4 = a4 >>> 13;\n var a5 = a[5] | 0;\n var al5 = a5 & 0x1fff;\n var ah5 = a5 >>> 13;\n var a6 = a[6] | 0;\n var al6 = a6 & 0x1fff;\n var ah6 = a6 >>> 13;\n var a7 = a[7] | 0;\n var al7 = a7 & 0x1fff;\n var ah7 = a7 >>> 13;\n var a8 = a[8] | 0;\n var al8 = a8 & 0x1fff;\n var ah8 = a8 >>> 13;\n var a9 = a[9] | 0;\n var al9 = a9 & 0x1fff;\n var ah9 = a9 >>> 13;\n var b0 = b[0] | 0;\n var bl0 = b0 & 0x1fff;\n var bh0 = b0 >>> 13;\n var b1 = b[1] | 0;\n var bl1 = b1 & 0x1fff;\n var bh1 = b1 >>> 13;\n var b2 = b[2] | 0;\n var bl2 = b2 & 0x1fff;\n var bh2 = b2 >>> 13;\n var b3 = b[3] | 0;\n var bl3 = b3 & 0x1fff;\n var bh3 = b3 >>> 13;\n var b4 = b[4] | 0;\n var bl4 = b4 & 0x1fff;\n var bh4 = b4 >>> 13;\n var b5 = b[5] | 0;\n var bl5 = b5 & 0x1fff;\n var bh5 = b5 >>> 13;\n var b6 = b[6] | 0;\n var bl6 = b6 & 0x1fff;\n var bh6 = b6 >>> 13;\n var b7 = b[7] | 0;\n var bl7 = b7 & 0x1fff;\n var bh7 = b7 >>> 13;\n var b8 = b[8] | 0;\n var bl8 = b8 & 0x1fff;\n var bh8 = b8 >>> 13;\n var b9 = b[9] | 0;\n var bl9 = b9 & 0x1fff;\n var bh9 = b9 >>> 13;\n\n out.negative = self.negative ^ num.negative;\n out.length = 19;\n /* k = 0 */\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = (mid + Math.imul(ah0, bl0)) | 0;\n hi = Math.imul(ah0, bh0);\n var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n w0 &= 0x3ffffff;\n /* k = 1 */\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = (mid + Math.imul(ah1, bl0)) | 0;\n hi = Math.imul(ah1, bh0);\n lo = (lo + Math.imul(al0, bl1)) | 0;\n mid = (mid + Math.imul(al0, bh1)) | 0;\n mid = (mid + Math.imul(ah0, bl1)) | 0;\n hi = (hi + Math.imul(ah0, bh1)) | 0;\n var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n w1 &= 0x3ffffff;\n /* k = 2 */\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = (mid + Math.imul(ah2, bl0)) | 0;\n hi = Math.imul(ah2, bh0);\n lo = (lo + Math.imul(al1, bl1)) | 0;\n mid = (mid + Math.imul(al1, bh1)) | 0;\n mid = (mid + Math.imul(ah1, bl1)) | 0;\n hi = (hi + Math.imul(ah1, bh1)) | 0;\n lo = (lo + Math.imul(al0, bl2)) | 0;\n mid = (mid + Math.imul(al0, bh2)) | 0;\n mid = (mid + Math.imul(ah0, bl2)) | 0;\n hi = (hi + Math.imul(ah0, bh2)) | 0;\n var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n w2 &= 0x3ffffff;\n /* k = 3 */\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = (mid + Math.imul(ah3, bl0)) | 0;\n hi = Math.imul(ah3, bh0);\n lo = (lo + Math.imul(al2, bl1)) | 0;\n mid = (mid + Math.imul(al2, bh1)) | 0;\n mid = (mid + Math.imul(ah2, bl1)) | 0;\n hi = (hi + Math.imul(ah2, bh1)) | 0;\n lo = (lo + Math.imul(al1, bl2)) | 0;\n mid = (mid + Math.imul(al1, bh2)) | 0;\n mid = (mid + Math.imul(ah1, bl2)) | 0;\n hi = (hi + Math.imul(ah1, bh2)) | 0;\n lo = (lo + Math.imul(al0, bl3)) | 0;\n mid = (mid + Math.imul(al0, bh3)) | 0;\n mid = (mid + Math.imul(ah0, bl3)) | 0;\n hi = (hi + Math.imul(ah0, bh3)) | 0;\n var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n w3 &= 0x3ffffff;\n /* k = 4 */\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = (mid + Math.imul(ah4, bl0)) | 0;\n hi = Math.imul(ah4, bh0);\n lo = (lo + Math.imul(al3, bl1)) | 0;\n mid = (mid + Math.imul(al3, bh1)) | 0;\n mid = (mid + Math.imul(ah3, bl1)) | 0;\n hi = (hi + Math.imul(ah3, bh1)) | 0;\n lo = (lo + Math.imul(al2, bl2)) | 0;\n mid = (mid + Math.imul(al2, bh2)) | 0;\n mid = (mid + Math.imul(ah2, bl2)) | 0;\n hi = (hi + Math.imul(ah2, bh2)) | 0;\n lo = (lo + Math.imul(al1, bl3)) | 0;\n mid = (mid + Math.imul(al1, bh3)) | 0;\n mid = (mid + Math.imul(ah1, bl3)) | 0;\n hi = (hi + Math.imul(ah1, bh3)) | 0;\n lo = (lo + Math.imul(al0, bl4)) | 0;\n mid = (mid + Math.imul(al0, bh4)) | 0;\n mid = (mid + Math.imul(ah0, bl4)) | 0;\n hi = (hi + Math.imul(ah0, bh4)) | 0;\n var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n w4 &= 0x3ffffff;\n /* k = 5 */\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = (mid + Math.imul(ah5, bl0)) | 0;\n hi = Math.imul(ah5, bh0);\n lo = (lo + Math.imul(al4, bl1)) | 0;\n mid = (mid + Math.imul(al4, bh1)) | 0;\n mid = (mid + Math.imul(ah4, bl1)) | 0;\n hi = (hi + Math.imul(ah4, bh1)) | 0;\n lo = (lo + Math.imul(al3, bl2)) | 0;\n mid = (mid + Math.imul(al3, bh2)) | 0;\n mid = (mid + Math.imul(ah3, bl2)) | 0;\n hi = (hi + Math.imul(ah3, bh2)) | 0;\n lo = (lo + Math.imul(al2, bl3)) | 0;\n mid = (mid + Math.imul(al2, bh3)) | 0;\n mid = (mid + Math.imul(ah2, bl3)) | 0;\n hi = (hi + Math.imul(ah2, bh3)) | 0;\n lo = (lo + Math.imul(al1, bl4)) | 0;\n mid = (mid + Math.imul(al1, bh4)) | 0;\n mid = (mid + Math.imul(ah1, bl4)) | 0;\n hi = (hi + Math.imul(ah1, bh4)) | 0;\n lo = (lo + Math.imul(al0, bl5)) | 0;\n mid = (mid + Math.imul(al0, bh5)) | 0;\n mid = (mid + Math.imul(ah0, bl5)) | 0;\n hi = (hi + Math.imul(ah0, bh5)) | 0;\n var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n w5 &= 0x3ffffff;\n /* k = 6 */\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = (mid + Math.imul(ah6, bl0)) | 0;\n hi = Math.imul(ah6, bh0);\n lo = (lo + Math.imul(al5, bl1)) | 0;\n mid = (mid + Math.imul(al5, bh1)) | 0;\n mid = (mid + Math.imul(ah5, bl1)) | 0;\n hi = (hi + Math.imul(ah5, bh1)) | 0;\n lo = (lo + Math.imul(al4, bl2)) | 0;\n mid = (mid + Math.imul(al4, bh2)) | 0;\n mid = (mid + Math.imul(ah4, bl2)) | 0;\n hi = (hi + Math.imul(ah4, bh2)) | 0;\n lo = (lo + Math.imul(al3, bl3)) | 0;\n mid = (mid + Math.imul(al3, bh3)) | 0;\n mid = (mid + Math.imul(ah3, bl3)) | 0;\n hi = (hi + Math.imul(ah3, bh3)) | 0;\n lo = (lo + Math.imul(al2, bl4)) | 0;\n mid = (mid + Math.imul(al2, bh4)) | 0;\n mid = (mid + Math.imul(ah2, bl4)) | 0;\n hi = (hi + Math.imul(ah2, bh4)) | 0;\n lo = (lo + Math.imul(al1, bl5)) | 0;\n mid = (mid + Math.imul(al1, bh5)) | 0;\n mid = (mid + Math.imul(ah1, bl5)) | 0;\n hi = (hi + Math.imul(ah1, bh5)) | 0;\n lo = (lo + Math.imul(al0, bl6)) | 0;\n mid = (mid + Math.imul(al0, bh6)) | 0;\n mid = (mid + Math.imul(ah0, bl6)) | 0;\n hi = (hi + Math.imul(ah0, bh6)) | 0;\n var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n w6 &= 0x3ffffff;\n /* k = 7 */\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = (mid + Math.imul(ah7, bl0)) | 0;\n hi = Math.imul(ah7, bh0);\n lo = (lo + Math.imul(al6, bl1)) | 0;\n mid = (mid + Math.imul(al6, bh1)) | 0;\n mid = (mid + Math.imul(ah6, bl1)) | 0;\n hi = (hi + Math.imul(ah6, bh1)) | 0;\n lo = (lo + Math.imul(al5, bl2)) | 0;\n mid = (mid + Math.imul(al5, bh2)) | 0;\n mid = (mid + Math.imul(ah5, bl2)) | 0;\n hi = (hi + Math.imul(ah5, bh2)) | 0;\n lo = (lo + Math.imul(al4, bl3)) | 0;\n mid = (mid + Math.imul(al4, bh3)) | 0;\n mid = (mid + Math.imul(ah4, bl3)) | 0;\n hi = (hi + Math.imul(ah4, bh3)) | 0;\n lo = (lo + Math.imul(al3, bl4)) | 0;\n mid = (mid + Math.imul(al3, bh4)) | 0;\n mid = (mid + Math.imul(ah3, bl4)) | 0;\n hi = (hi + Math.imul(ah3, bh4)) | 0;\n lo = (lo + Math.imul(al2, bl5)) | 0;\n mid = (mid + Math.imul(al2, bh5)) | 0;\n mid = (mid + Math.imul(ah2, bl5)) | 0;\n hi = (hi + Math.imul(ah2, bh5)) | 0;\n lo = (lo + Math.imul(al1, bl6)) | 0;\n mid = (mid + Math.imul(al1, bh6)) | 0;\n mid = (mid + Math.imul(ah1, bl6)) | 0;\n hi = (hi + Math.imul(ah1, bh6)) | 0;\n lo = (lo + Math.imul(al0, bl7)) | 0;\n mid = (mid + Math.imul(al0, bh7)) | 0;\n mid = (mid + Math.imul(ah0, bl7)) | 0;\n hi = (hi + Math.imul(ah0, bh7)) | 0;\n var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n w7 &= 0x3ffffff;\n /* k = 8 */\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = (mid + Math.imul(ah8, bl0)) | 0;\n hi = Math.imul(ah8, bh0);\n lo = (lo + Math.imul(al7, bl1)) | 0;\n mid = (mid + Math.imul(al7, bh1)) | 0;\n mid = (mid + Math.imul(ah7, bl1)) | 0;\n hi = (hi + Math.imul(ah7, bh1)) | 0;\n lo = (lo + Math.imul(al6, bl2)) | 0;\n mid = (mid + Math.imul(al6, bh2)) | 0;\n mid = (mid + Math.imul(ah6, bl2)) | 0;\n hi = (hi + Math.imul(ah6, bh2)) | 0;\n lo = (lo + Math.imul(al5, bl3)) | 0;\n mid = (mid + Math.imul(al5, bh3)) | 0;\n mid = (mid + Math.imul(ah5, bl3)) | 0;\n hi = (hi + Math.imul(ah5, bh3)) | 0;\n lo = (lo + Math.imul(al4, bl4)) | 0;\n mid = (mid + Math.imul(al4, bh4)) | 0;\n mid = (mid + Math.imul(ah4, bl4)) | 0;\n hi = (hi + Math.imul(ah4, bh4)) | 0;\n lo = (lo + Math.imul(al3, bl5)) | 0;\n mid = (mid + Math.imul(al3, bh5)) | 0;\n mid = (mid + Math.imul(ah3, bl5)) | 0;\n hi = (hi + Math.imul(ah3, bh5)) | 0;\n lo = (lo + Math.imul(al2, bl6)) | 0;\n mid = (mid + Math.imul(al2, bh6)) | 0;\n mid = (mid + Math.imul(ah2, bl6)) | 0;\n hi = (hi + Math.imul(ah2, bh6)) | 0;\n lo = (lo + Math.imul(al1, bl7)) | 0;\n mid = (mid + Math.imul(al1, bh7)) | 0;\n mid = (mid + Math.imul(ah1, bl7)) | 0;\n hi = (hi + Math.imul(ah1, bh7)) | 0;\n lo = (lo + Math.imul(al0, bl8)) | 0;\n mid = (mid + Math.imul(al0, bh8)) | 0;\n mid = (mid + Math.imul(ah0, bl8)) | 0;\n hi = (hi + Math.imul(ah0, bh8)) | 0;\n var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n w8 &= 0x3ffffff;\n /* k = 9 */\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = (mid + Math.imul(ah9, bl0)) | 0;\n hi = Math.imul(ah9, bh0);\n lo = (lo + Math.imul(al8, bl1)) | 0;\n mid = (mid + Math.imul(al8, bh1)) | 0;\n mid = (mid + Math.imul(ah8, bl1)) | 0;\n hi = (hi + Math.imul(ah8, bh1)) | 0;\n lo = (lo + Math.imul(al7, bl2)) | 0;\n mid = (mid + Math.imul(al7, bh2)) | 0;\n mid = (mid + Math.imul(ah7, bl2)) | 0;\n hi = (hi + Math.imul(ah7, bh2)) | 0;\n lo = (lo + Math.imul(al6, bl3)) | 0;\n mid = (mid + Math.imul(al6, bh3)) | 0;\n mid = (mid + Math.imul(ah6, bl3)) | 0;\n hi = (hi + Math.imul(ah6, bh3)) | 0;\n lo = (lo + Math.imul(al5, bl4)) | 0;\n mid = (mid + Math.imul(al5, bh4)) | 0;\n mid = (mid + Math.imul(ah5, bl4)) | 0;\n hi = (hi + Math.imul(ah5, bh4)) | 0;\n lo = (lo + Math.imul(al4, bl5)) | 0;\n mid = (mid + Math.imul(al4, bh5)) | 0;\n mid = (mid + Math.imul(ah4, bl5)) | 0;\n hi = (hi + Math.imul(ah4, bh5)) | 0;\n lo = (lo + Math.imul(al3, bl6)) | 0;\n mid = (mid + Math.imul(al3, bh6)) | 0;\n mid = (mid + Math.imul(ah3, bl6)) | 0;\n hi = (hi + Math.imul(ah3, bh6)) | 0;\n lo = (lo + Math.imul(al2, bl7)) | 0;\n mid = (mid + Math.imul(al2, bh7)) | 0;\n mid = (mid + Math.imul(ah2, bl7)) | 0;\n hi = (hi + Math.imul(ah2, bh7)) | 0;\n lo = (lo + Math.imul(al1, bl8)) | 0;\n mid = (mid + Math.imul(al1, bh8)) | 0;\n mid = (mid + Math.imul(ah1, bl8)) | 0;\n hi = (hi + Math.imul(ah1, bh8)) | 0;\n lo = (lo + Math.imul(al0, bl9)) | 0;\n mid = (mid + Math.imul(al0, bh9)) | 0;\n mid = (mid + Math.imul(ah0, bl9)) | 0;\n hi = (hi + Math.imul(ah0, bh9)) | 0;\n var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n w9 &= 0x3ffffff;\n /* k = 10 */\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = (mid + Math.imul(ah9, bl1)) | 0;\n hi = Math.imul(ah9, bh1);\n lo = (lo + Math.imul(al8, bl2)) | 0;\n mid = (mid + Math.imul(al8, bh2)) | 0;\n mid = (mid + Math.imul(ah8, bl2)) | 0;\n hi = (hi + Math.imul(ah8, bh2)) | 0;\n lo = (lo + Math.imul(al7, bl3)) | 0;\n mid = (mid + Math.imul(al7, bh3)) | 0;\n mid = (mid + Math.imul(ah7, bl3)) | 0;\n hi = (hi + Math.imul(ah7, bh3)) | 0;\n lo = (lo + Math.imul(al6, bl4)) | 0;\n mid = (mid + Math.imul(al6, bh4)) | 0;\n mid = (mid + Math.imul(ah6, bl4)) | 0;\n hi = (hi + Math.imul(ah6, bh4)) | 0;\n lo = (lo + Math.imul(al5, bl5)) | 0;\n mid = (mid + Math.imul(al5, bh5)) | 0;\n mid = (mid + Math.imul(ah5, bl5)) | 0;\n hi = (hi + Math.imul(ah5, bh5)) | 0;\n lo = (lo + Math.imul(al4, bl6)) | 0;\n mid = (mid + Math.imul(al4, bh6)) | 0;\n mid = (mid + Math.imul(ah4, bl6)) | 0;\n hi = (hi + Math.imul(ah4, bh6)) | 0;\n lo = (lo + Math.imul(al3, bl7)) | 0;\n mid = (mid + Math.imul(al3, bh7)) | 0;\n mid = (mid + Math.imul(ah3, bl7)) | 0;\n hi = (hi + Math.imul(ah3, bh7)) | 0;\n lo = (lo + Math.imul(al2, bl8)) | 0;\n mid = (mid + Math.imul(al2, bh8)) | 0;\n mid = (mid + Math.imul(ah2, bl8)) | 0;\n hi = (hi + Math.imul(ah2, bh8)) | 0;\n lo = (lo + Math.imul(al1, bl9)) | 0;\n mid = (mid + Math.imul(al1, bh9)) | 0;\n mid = (mid + Math.imul(ah1, bl9)) | 0;\n hi = (hi + Math.imul(ah1, bh9)) | 0;\n var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n w10 &= 0x3ffffff;\n /* k = 11 */\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = (mid + Math.imul(ah9, bl2)) | 0;\n hi = Math.imul(ah9, bh2);\n lo = (lo + Math.imul(al8, bl3)) | 0;\n mid = (mid + Math.imul(al8, bh3)) | 0;\n mid = (mid + Math.imul(ah8, bl3)) | 0;\n hi = (hi + Math.imul(ah8, bh3)) | 0;\n lo = (lo + Math.imul(al7, bl4)) | 0;\n mid = (mid + Math.imul(al7, bh4)) | 0;\n mid = (mid + Math.imul(ah7, bl4)) | 0;\n hi = (hi + Math.imul(ah7, bh4)) | 0;\n lo = (lo + Math.imul(al6, bl5)) | 0;\n mid = (mid + Math.imul(al6, bh5)) | 0;\n mid = (mid + Math.imul(ah6, bl5)) | 0;\n hi = (hi + Math.imul(ah6, bh5)) | 0;\n lo = (lo + Math.imul(al5, bl6)) | 0;\n mid = (mid + Math.imul(al5, bh6)) | 0;\n mid = (mid + Math.imul(ah5, bl6)) | 0;\n hi = (hi + Math.imul(ah5, bh6)) | 0;\n lo = (lo + Math.imul(al4, bl7)) | 0;\n mid = (mid + Math.imul(al4, bh7)) | 0;\n mid = (mid + Math.imul(ah4, bl7)) | 0;\n hi = (hi + Math.imul(ah4, bh7)) | 0;\n lo = (lo + Math.imul(al3, bl8)) | 0;\n mid = (mid + Math.imul(al3, bh8)) | 0;\n mid = (mid + Math.imul(ah3, bl8)) | 0;\n hi = (hi + Math.imul(ah3, bh8)) | 0;\n lo = (lo + Math.imul(al2, bl9)) | 0;\n mid = (mid + Math.imul(al2, bh9)) | 0;\n mid = (mid + Math.imul(ah2, bl9)) | 0;\n hi = (hi + Math.imul(ah2, bh9)) | 0;\n var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n w11 &= 0x3ffffff;\n /* k = 12 */\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = (mid + Math.imul(ah9, bl3)) | 0;\n hi = Math.imul(ah9, bh3);\n lo = (lo + Math.imul(al8, bl4)) | 0;\n mid = (mid + Math.imul(al8, bh4)) | 0;\n mid = (mid + Math.imul(ah8, bl4)) | 0;\n hi = (hi + Math.imul(ah8, bh4)) | 0;\n lo = (lo + Math.imul(al7, bl5)) | 0;\n mid = (mid + Math.imul(al7, bh5)) | 0;\n mid = (mid + Math.imul(ah7, bl5)) | 0;\n hi = (hi + Math.imul(ah7, bh5)) | 0;\n lo = (lo + Math.imul(al6, bl6)) | 0;\n mid = (mid + Math.imul(al6, bh6)) | 0;\n mid = (mid + Math.imul(ah6, bl6)) | 0;\n hi = (hi + Math.imul(ah6, bh6)) | 0;\n lo = (lo + Math.imul(al5, bl7)) | 0;\n mid = (mid + Math.imul(al5, bh7)) | 0;\n mid = (mid + Math.imul(ah5, bl7)) | 0;\n hi = (hi + Math.imul(ah5, bh7)) | 0;\n lo = (lo + Math.imul(al4, bl8)) | 0;\n mid = (mid + Math.imul(al4, bh8)) | 0;\n mid = (mid + Math.imul(ah4, bl8)) | 0;\n hi = (hi + Math.imul(ah4, bh8)) | 0;\n lo = (lo + Math.imul(al3, bl9)) | 0;\n mid = (mid + Math.imul(al3, bh9)) | 0;\n mid = (mid + Math.imul(ah3, bl9)) | 0;\n hi = (hi + Math.imul(ah3, bh9)) | 0;\n var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n w12 &= 0x3ffffff;\n /* k = 13 */\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = (mid + Math.imul(ah9, bl4)) | 0;\n hi = Math.imul(ah9, bh4);\n lo = (lo + Math.imul(al8, bl5)) | 0;\n mid = (mid + Math.imul(al8, bh5)) | 0;\n mid = (mid + Math.imul(ah8, bl5)) | 0;\n hi = (hi + Math.imul(ah8, bh5)) | 0;\n lo = (lo + Math.imul(al7, bl6)) | 0;\n mid = (mid + Math.imul(al7, bh6)) | 0;\n mid = (mid + Math.imul(ah7, bl6)) | 0;\n hi = (hi + Math.imul(ah7, bh6)) | 0;\n lo = (lo + Math.imul(al6, bl7)) | 0;\n mid = (mid + Math.imul(al6, bh7)) | 0;\n mid = (mid + Math.imul(ah6, bl7)) | 0;\n hi = (hi + Math.imul(ah6, bh7)) | 0;\n lo = (lo + Math.imul(al5, bl8)) | 0;\n mid = (mid + Math.imul(al5, bh8)) | 0;\n mid = (mid + Math.imul(ah5, bl8)) | 0;\n hi = (hi + Math.imul(ah5, bh8)) | 0;\n lo = (lo + Math.imul(al4, bl9)) | 0;\n mid = (mid + Math.imul(al4, bh9)) | 0;\n mid = (mid + Math.imul(ah4, bl9)) | 0;\n hi = (hi + Math.imul(ah4, bh9)) | 0;\n var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n w13 &= 0x3ffffff;\n /* k = 14 */\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = (mid + Math.imul(ah9, bl5)) | 0;\n hi = Math.imul(ah9, bh5);\n lo = (lo + Math.imul(al8, bl6)) | 0;\n mid = (mid + Math.imul(al8, bh6)) | 0;\n mid = (mid + Math.imul(ah8, bl6)) | 0;\n hi = (hi + Math.imul(ah8, bh6)) | 0;\n lo = (lo + Math.imul(al7, bl7)) | 0;\n mid = (mid + Math.imul(al7, bh7)) | 0;\n mid = (mid + Math.imul(ah7, bl7)) | 0;\n hi = (hi + Math.imul(ah7, bh7)) | 0;\n lo = (lo + Math.imul(al6, bl8)) | 0;\n mid = (mid + Math.imul(al6, bh8)) | 0;\n mid = (mid + Math.imul(ah6, bl8)) | 0;\n hi = (hi + Math.imul(ah6, bh8)) | 0;\n lo = (lo + Math.imul(al5, bl9)) | 0;\n mid = (mid + Math.imul(al5, bh9)) | 0;\n mid = (mid + Math.imul(ah5, bl9)) | 0;\n hi = (hi + Math.imul(ah5, bh9)) | 0;\n var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n w14 &= 0x3ffffff;\n /* k = 15 */\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = (mid + Math.imul(ah9, bl6)) | 0;\n hi = Math.imul(ah9, bh6);\n lo = (lo + Math.imul(al8, bl7)) | 0;\n mid = (mid + Math.imul(al8, bh7)) | 0;\n mid = (mid + Math.imul(ah8, bl7)) | 0;\n hi = (hi + Math.imul(ah8, bh7)) | 0;\n lo = (lo + Math.imul(al7, bl8)) | 0;\n mid = (mid + Math.imul(al7, bh8)) | 0;\n mid = (mid + Math.imul(ah7, bl8)) | 0;\n hi = (hi + Math.imul(ah7, bh8)) | 0;\n lo = (lo + Math.imul(al6, bl9)) | 0;\n mid = (mid + Math.imul(al6, bh9)) | 0;\n mid = (mid + Math.imul(ah6, bl9)) | 0;\n hi = (hi + Math.imul(ah6, bh9)) | 0;\n var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n w15 &= 0x3ffffff;\n /* k = 16 */\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = (mid + Math.imul(ah9, bl7)) | 0;\n hi = Math.imul(ah9, bh7);\n lo = (lo + Math.imul(al8, bl8)) | 0;\n mid = (mid + Math.imul(al8, bh8)) | 0;\n mid = (mid + Math.imul(ah8, bl8)) | 0;\n hi = (hi + Math.imul(ah8, bh8)) | 0;\n lo = (lo + Math.imul(al7, bl9)) | 0;\n mid = (mid + Math.imul(al7, bh9)) | 0;\n mid = (mid + Math.imul(ah7, bl9)) | 0;\n hi = (hi + Math.imul(ah7, bh9)) | 0;\n var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n w16 &= 0x3ffffff;\n /* k = 17 */\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = (mid + Math.imul(ah9, bl8)) | 0;\n hi = Math.imul(ah9, bh8);\n lo = (lo + Math.imul(al8, bl9)) | 0;\n mid = (mid + Math.imul(al8, bh9)) | 0;\n mid = (mid + Math.imul(ah8, bl9)) | 0;\n hi = (hi + Math.imul(ah8, bh9)) | 0;\n var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n w17 &= 0x3ffffff;\n /* k = 18 */\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = (mid + Math.imul(ah9, bl9)) | 0;\n hi = Math.imul(ah9, bh9);\n var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n w18 &= 0x3ffffff;\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n if (c !== 0) {\n o[19] = c;\n out.length++;\n }\n return out;\n };\n\n // Polyfill comb\n if (!Math.imul) {\n comb10MulTo = smallMulTo;\n }\n\n function bigMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n out.length = self.length + num.length;\n\n var carry = 0;\n var hncarry = 0;\n for (var k = 0; k < out.length - 1; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = hncarry;\n hncarry = 0;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = k - j;\n var a = self.words[i] | 0;\n var b = num.words[j] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n lo = (lo + rword) | 0;\n rword = lo & 0x3ffffff;\n ncarry = (ncarry + (lo >>> 26)) | 0;\n\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n if (carry !== 0) {\n out.words[k] = carry;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n function jumboMulTo (self, num, out) {\n // Temporary disable, see https://github.com/indutny/bn.js/issues/211\n // var fftm = new FFTM();\n // return fftm.mulp(self, num, out);\n return bigMulTo(self, num, out);\n }\n\n BN.prototype.mulTo = function mulTo (num, out) {\n var res;\n var len = this.length + num.length;\n if (this.length === 10 && num.length === 10) {\n res = comb10MulTo(this, num, out);\n } else if (len < 63) {\n res = smallMulTo(this, num, out);\n } else if (len < 1024) {\n res = bigMulTo(this, num, out);\n } else {\n res = jumboMulTo(this, num, out);\n }\n\n return res;\n };\n\n // Cooley-Tukey algorithm for FFT\n // slightly revisited to rely on looping instead of recursion\n\n function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }\n\n FFTM.prototype.makeRBT = function makeRBT (N) {\n var t = new Array(N);\n var l = BN.prototype._countBits(N) - 1;\n for (var i = 0; i < N; i++) {\n t[i] = this.revBin(i, l, N);\n }\n\n return t;\n };\n\n // Returns binary-reversed representation of `x`\n FFTM.prototype.revBin = function revBin (x, l, N) {\n if (x === 0 || x === N - 1) return x;\n\n var rb = 0;\n for (var i = 0; i < l; i++) {\n rb |= (x & 1) << (l - i - 1);\n x >>= 1;\n }\n\n return rb;\n };\n\n // Performs \"tweedling\" phase, therefore 'emulating'\n // behaviour of the recursive algorithm\n FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n for (var i = 0; i < N; i++) {\n rtws[i] = rws[rbt[i]];\n itws[i] = iws[rbt[i]];\n }\n };\n\n FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n\n for (var s = 1; s < N; s <<= 1) {\n var l = s << 1;\n\n var rtwdf = Math.cos(2 * Math.PI / l);\n var itwdf = Math.sin(2 * Math.PI / l);\n\n for (var p = 0; p < N; p += l) {\n var rtwdf_ = rtwdf;\n var itwdf_ = itwdf;\n\n for (var j = 0; j < s; j++) {\n var re = rtws[p + j];\n var ie = itws[p + j];\n\n var ro = rtws[p + j + s];\n var io = itws[p + j + s];\n\n var rx = rtwdf_ * ro - itwdf_ * io;\n\n io = rtwdf_ * io + itwdf_ * ro;\n ro = rx;\n\n rtws[p + j] = re + ro;\n itws[p + j] = ie + io;\n\n rtws[p + j + s] = re - ro;\n itws[p + j + s] = ie - io;\n\n /* jshint maxdepth : false */\n if (j !== l) {\n rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n rtwdf_ = rx;\n }\n }\n }\n }\n };\n\n FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n var N = Math.max(m, n) | 1;\n var odd = N & 1;\n var i = 0;\n for (N = N / 2 | 0; N; N = N >>> 1) {\n i++;\n }\n\n return 1 << i + 1 + odd;\n };\n\n FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n if (N <= 1) return;\n\n for (var i = 0; i < N / 2; i++) {\n var t = rws[i];\n\n rws[i] = rws[N - i - 1];\n rws[N - i - 1] = t;\n\n t = iws[i];\n\n iws[i] = -iws[N - i - 1];\n iws[N - i - 1] = -t;\n }\n };\n\n FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n var carry = 0;\n for (var i = 0; i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n Math.round(ws[2 * i] / N) +\n carry;\n\n ws[i] = w & 0x3ffffff;\n\n if (w < 0x4000000) {\n carry = 0;\n } else {\n carry = w / 0x4000000 | 0;\n }\n }\n\n return ws;\n };\n\n FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n var carry = 0;\n for (var i = 0; i < len; i++) {\n carry = carry + (ws[i] | 0);\n\n rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n }\n\n // Pad with zeroes\n for (i = 2 * len; i < N; ++i) {\n rws[i] = 0;\n }\n\n assert(carry === 0);\n assert((carry & ~0x1fff) === 0);\n };\n\n FFTM.prototype.stub = function stub (N) {\n var ph = new Array(N);\n for (var i = 0; i < N; i++) {\n ph[i] = 0;\n }\n\n return ph;\n };\n\n FFTM.prototype.mulp = function mulp (x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length);\n\n var rbt = this.makeRBT(N);\n\n var _ = this.stub(N);\n\n var rws = new Array(N);\n var rwst = new Array(N);\n var iwst = new Array(N);\n\n var nrws = new Array(N);\n var nrwst = new Array(N);\n var niwst = new Array(N);\n\n var rmws = out.words;\n rmws.length = N;\n\n this.convert13b(x.words, x.length, rws, N);\n this.convert13b(y.words, y.length, nrws, N);\n\n this.transform(rws, _, rwst, iwst, N, rbt);\n this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n for (var i = 0; i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n rwst[i] = rx;\n }\n\n this.conjugate(rwst, iwst, N);\n this.transform(rwst, iwst, rmws, _, N, rbt);\n this.conjugate(rmws, _, N);\n this.normalize13b(rmws, N);\n\n out.negative = x.negative ^ y.negative;\n out.length = x.length + y.length;\n return out._strip();\n };\n\n // Multiply `this` by `num`\n BN.prototype.mul = function mul (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return this.mulTo(num, out);\n };\n\n // Multiply employing FFT\n BN.prototype.mulf = function mulf (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return jumboMulTo(this, num, out);\n };\n\n // In-place Multiplication\n BN.prototype.imul = function imul (num) {\n return this.clone().mulTo(num, this);\n };\n\n BN.prototype.imuln = function imuln (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n\n // Carry\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = (this.words[i] | 0) * num;\n var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n carry >>= 26;\n carry += (w / 0x4000000) | 0;\n // NOTE: lo is 27bit maximum\n carry += lo >>> 26;\n this.words[i] = lo & 0x3ffffff;\n }\n\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.muln = function muln (num) {\n return this.clone().imuln(num);\n };\n\n // `this` * `this`\n BN.prototype.sqr = function sqr () {\n return this.mul(this);\n };\n\n // `this` * `this` in-place\n BN.prototype.isqr = function isqr () {\n return this.imul(this.clone());\n };\n\n // Math.pow(`this`, `num`)\n BN.prototype.pow = function pow (num) {\n var w = toBitArray(num);\n if (w.length === 0) return new BN(1);\n\n // Skip leading zeroes\n var res = this;\n for (var i = 0; i < w.length; i++, res = res.sqr()) {\n if (w[i] !== 0) break;\n }\n\n if (++i < w.length) {\n for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n if (w[i] === 0) continue;\n\n res = res.mul(q);\n }\n }\n\n return res;\n };\n\n // Shift-left in-place\n BN.prototype.iushln = function iushln (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n var i;\n\n if (r !== 0) {\n var carry = 0;\n\n for (i = 0; i < this.length; i++) {\n var newCarry = this.words[i] & carryMask;\n var c = ((this.words[i] | 0) - newCarry) << r;\n this.words[i] = c | carry;\n carry = newCarry >>> (26 - r);\n }\n\n if (carry) {\n this.words[i] = carry;\n this.length++;\n }\n }\n\n if (s !== 0) {\n for (i = this.length - 1; i >= 0; i--) {\n this.words[i + s] = this.words[i];\n }\n\n for (i = 0; i < s; i++) {\n this.words[i] = 0;\n }\n\n this.length += s;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishln = function ishln (bits) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushln(bits);\n };\n\n // Shift-right in-place\n // NOTE: `hint` is a lowest bit before trailing zeroes\n // NOTE: if `extended` is present - it will be filled with destroyed bits\n BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n assert(typeof bits === 'number' && bits >= 0);\n var h;\n if (hint) {\n h = (hint - (hint % 26)) / 26;\n } else {\n h = 0;\n }\n\n var r = bits % 26;\n var s = Math.min((bits - r) / 26, this.length);\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n var maskedWords = extended;\n\n h -= s;\n h = Math.max(0, h);\n\n // Extended mode, copy masked part\n if (maskedWords) {\n for (var i = 0; i < s; i++) {\n maskedWords.words[i] = this.words[i];\n }\n maskedWords.length = s;\n }\n\n if (s === 0) {\n // No-op, we should not move anything at all\n } else if (this.length > s) {\n this.length -= s;\n for (i = 0; i < this.length; i++) {\n this.words[i] = this.words[i + s];\n }\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n var carry = 0;\n for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = (carry << (26 - r)) | (word >>> r);\n carry = word & mask;\n }\n\n // Push carried bits as a mask\n if (maskedWords && carry !== 0) {\n maskedWords.words[maskedWords.length++] = carry;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushrn(bits, hint, extended);\n };\n\n // Shift-left\n BN.prototype.shln = function shln (bits) {\n return this.clone().ishln(bits);\n };\n\n BN.prototype.ushln = function ushln (bits) {\n return this.clone().iushln(bits);\n };\n\n // Shift-right\n BN.prototype.shrn = function shrn (bits) {\n return this.clone().ishrn(bits);\n };\n\n BN.prototype.ushrn = function ushrn (bits) {\n return this.clone().iushrn(bits);\n };\n\n // Test if n bit is set\n BN.prototype.testn = function testn (bit) {\n assert(typeof bit === 'number' && bit >= 0);\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) return false;\n\n // Check bit and return\n var w = this.words[s];\n\n return !!(w & q);\n };\n\n // Return only lowers bits of number (in-place)\n BN.prototype.imaskn = function imaskn (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n\n assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n if (this.length <= s) {\n return this;\n }\n\n if (r !== 0) {\n s++;\n }\n this.length = Math.min(s, this.length);\n\n if (r !== 0) {\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n this.words[this.length - 1] &= mask;\n }\n\n return this._strip();\n };\n\n // Return only lowers bits of number\n BN.prototype.maskn = function maskn (bits) {\n return this.clone().imaskn(bits);\n };\n\n // Add plain number `num` to `this`\n BN.prototype.iaddn = function iaddn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.isubn(-num);\n\n // Possible sign change\n if (this.negative !== 0) {\n if (this.length === 1 && (this.words[0] | 0) <= num) {\n this.words[0] = num - (this.words[0] | 0);\n this.negative = 0;\n return this;\n }\n\n this.negative = 0;\n this.isubn(num);\n this.negative = 1;\n return this;\n }\n\n // Add without checks\n return this._iaddn(num);\n };\n\n BN.prototype._iaddn = function _iaddn (num) {\n this.words[0] += num;\n\n // Carry\n for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n if (i === this.length - 1) {\n this.words[i + 1] = 1;\n } else {\n this.words[i + 1]++;\n }\n }\n this.length = Math.max(this.length, i + 1);\n\n return this;\n };\n\n // Subtract plain number `num` from `this`\n BN.prototype.isubn = function isubn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.iaddn(-num);\n\n if (this.negative !== 0) {\n this.negative = 0;\n this.iaddn(num);\n this.negative = 1;\n return this;\n }\n\n this.words[0] -= num;\n\n if (this.length === 1 && this.words[0] < 0) {\n this.words[0] = -this.words[0];\n this.negative = 1;\n } else {\n // Carry\n for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n }\n\n return this._strip();\n };\n\n BN.prototype.addn = function addn (num) {\n return this.clone().iaddn(num);\n };\n\n BN.prototype.subn = function subn (num) {\n return this.clone().isubn(num);\n };\n\n BN.prototype.iabs = function iabs () {\n this.negative = 0;\n\n return this;\n };\n\n BN.prototype.abs = function abs () {\n return this.clone().iabs();\n };\n\n BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n var len = num.length + shift;\n var i;\n\n this._expand(len);\n\n var w;\n var carry = 0;\n for (i = 0; i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 0x3ffffff;\n carry = (w >> 26) - ((right / 0x4000000) | 0);\n this.words[i + shift] = w & 0x3ffffff;\n }\n for (; i < this.length - shift; i++) {\n w = (this.words[i + shift] | 0) + carry;\n carry = w >> 26;\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0) return this._strip();\n\n // Subtraction overflow\n assert(carry === -1);\n carry = 0;\n for (i = 0; i < this.length; i++) {\n w = -(this.words[i] | 0) + carry;\n carry = w >> 26;\n this.words[i] = w & 0x3ffffff;\n }\n this.negative = 1;\n\n return this._strip();\n };\n\n BN.prototype._wordDiv = function _wordDiv (num, mode) {\n var shift = this.length - num.length;\n\n var a = this.clone();\n var b = num;\n\n // Normalize\n var bhi = b.words[b.length - 1] | 0;\n var bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits;\n if (shift !== 0) {\n b = b.ushln(shift);\n a.iushln(shift);\n bhi = b.words[b.length - 1] | 0;\n }\n\n // Initialize quotient\n var m = a.length - b.length;\n var q;\n\n if (mode !== 'mod') {\n q = new BN(null);\n q.length = m + 1;\n q.words = new Array(q.length);\n for (var i = 0; i < q.length; i++) {\n q.words[i] = 0;\n }\n }\n\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n if (diff.negative === 0) {\n a = diff;\n if (q) {\n q.words[m] = 1;\n }\n }\n\n for (var j = m - 1; j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n (a.words[b.length + j - 1] | 0);\n\n // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n // (0x7ffffff)\n qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n while (a.negative !== 0) {\n qj--;\n a.negative = 0;\n a._ishlnsubmul(b, 1, j);\n if (!a.isZero()) {\n a.negative ^= 1;\n }\n }\n if (q) {\n q.words[j] = qj;\n }\n }\n if (q) {\n q._strip();\n }\n a._strip();\n\n // Denormalize\n if (mode !== 'div' && shift !== 0) {\n a.iushrn(shift);\n }\n\n return {\n div: q || null,\n mod: a\n };\n };\n\n // NOTE: 1) `mode` can be set to `mod` to request mod only,\n // to `div` to request div only, or be absent to\n // request both div & mod\n // 2) `positive` is true if unsigned mod is requested\n BN.prototype.divmod = function divmod (num, mode, positive) {\n assert(!num.isZero());\n\n if (this.isZero()) {\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n }\n\n var div, mod, res;\n if (this.negative !== 0 && num.negative === 0) {\n res = this.neg().divmod(num, mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.iadd(num);\n }\n }\n\n return {\n div: div,\n mod: mod\n };\n }\n\n if (this.negative === 0 && num.negative !== 0) {\n res = this.divmod(num.neg(), mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n return {\n div: div,\n mod: res.mod\n };\n }\n\n if ((this.negative & num.negative) !== 0) {\n res = this.neg().divmod(num.neg(), mode);\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.isub(num);\n }\n }\n\n return {\n div: res.div,\n mod: mod\n };\n }\n\n // Both numbers are positive at this point\n\n // Strip both numbers to approximate shift value\n if (num.length > this.length || this.cmp(num) < 0) {\n return {\n div: new BN(0),\n mod: this\n };\n }\n\n // Very short reduction\n if (num.length === 1) {\n if (mode === 'div') {\n return {\n div: this.divn(num.words[0]),\n mod: null\n };\n }\n\n if (mode === 'mod') {\n return {\n div: null,\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return {\n div: this.divn(num.words[0]),\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return this._wordDiv(num, mode);\n };\n\n // Find `this` / `num`\n BN.prototype.div = function div (num) {\n return this.divmod(num, 'div', false).div;\n };\n\n // Find `this` % `num`\n BN.prototype.mod = function mod (num) {\n return this.divmod(num, 'mod', false).mod;\n };\n\n BN.prototype.umod = function umod (num) {\n return this.divmod(num, 'mod', true).mod;\n };\n\n // Find Round(`this` / `num`)\n BN.prototype.divRound = function divRound (num) {\n var dm = this.divmod(num);\n\n // Fast case - exact division\n if (dm.mod.isZero()) return dm.div;\n\n var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n\n var half = num.ushrn(1);\n var r2 = num.andln(1);\n var cmp = mod.cmp(half);\n\n // Round down\n if (cmp < 0 || (r2 === 1 && cmp === 0)) return dm.div;\n\n // Round up\n return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n };\n\n BN.prototype.modrn = function modrn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n var p = (1 << 26) % num;\n\n var acc = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n acc = (p * acc + (this.words[i] | 0)) % num;\n }\n\n return isNegNum ? -acc : acc;\n };\n\n // WARNING: DEPRECATED\n BN.prototype.modn = function modn (num) {\n return this.modrn(num);\n };\n\n // In-place division by number\n BN.prototype.idivn = function idivn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n\n var carry = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 0x4000000;\n this.words[i] = (w / num) | 0;\n carry = w % num;\n }\n\n this._strip();\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.divn = function divn (num) {\n return this.clone().idivn(num);\n };\n\n BN.prototype.egcd = function egcd (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var x = this;\n var y = p.clone();\n\n if (x.negative !== 0) {\n x = x.umod(p);\n } else {\n x = x.clone();\n }\n\n // A * x + B * y = x\n var A = new BN(1);\n var B = new BN(0);\n\n // C * x + D * y = y\n var C = new BN(0);\n var D = new BN(1);\n\n var g = 0;\n\n while (x.isEven() && y.isEven()) {\n x.iushrn(1);\n y.iushrn(1);\n ++g;\n }\n\n var yp = y.clone();\n var xp = x.clone();\n\n while (!x.isZero()) {\n for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n x.iushrn(i);\n while (i-- > 0) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n y.iushrn(j);\n while (j-- > 0) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n };\n\n // This is reduced incarnation of the binary EEA\n // above, designated to invert members of the\n // _prime_ fields F(p) at a maximal speed\n BN.prototype._invmp = function _invmp (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var a = this;\n var b = p.clone();\n\n if (a.negative !== 0) {\n a = a.umod(p);\n } else {\n a = a.clone();\n }\n\n var x1 = new BN(1);\n var x2 = new BN(0);\n\n var delta = b.clone();\n\n while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n a.iushrn(i);\n while (i-- > 0) {\n if (x1.isOdd()) {\n x1.iadd(delta);\n }\n\n x1.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n b.iushrn(j);\n while (j-- > 0) {\n if (x2.isOdd()) {\n x2.iadd(delta);\n }\n\n x2.iushrn(1);\n }\n }\n\n if (a.cmp(b) >= 0) {\n a.isub(b);\n x1.isub(x2);\n } else {\n b.isub(a);\n x2.isub(x1);\n }\n }\n\n var res;\n if (a.cmpn(1) === 0) {\n res = x1;\n } else {\n res = x2;\n }\n\n if (res.cmpn(0) < 0) {\n res.iadd(p);\n }\n\n return res;\n };\n\n BN.prototype.gcd = function gcd (num) {\n if (this.isZero()) return num.abs();\n if (num.isZero()) return this.abs();\n\n var a = this.clone();\n var b = num.clone();\n a.negative = 0;\n b.negative = 0;\n\n // Remove common factor of two\n for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n a.iushrn(1);\n b.iushrn(1);\n }\n\n do {\n while (a.isEven()) {\n a.iushrn(1);\n }\n while (b.isEven()) {\n b.iushrn(1);\n }\n\n var r = a.cmp(b);\n if (r < 0) {\n // Swap `a` and `b` to make `a` always bigger than `b`\n var t = a;\n a = b;\n b = t;\n } else if (r === 0 || b.cmpn(1) === 0) {\n break;\n }\n\n a.isub(b);\n } while (true);\n\n return b.iushln(shift);\n };\n\n // Invert number in the field F(num)\n BN.prototype.invm = function invm (num) {\n return this.egcd(num).a.umod(num);\n };\n\n BN.prototype.isEven = function isEven () {\n return (this.words[0] & 1) === 0;\n };\n\n BN.prototype.isOdd = function isOdd () {\n return (this.words[0] & 1) === 1;\n };\n\n // And first word and num\n BN.prototype.andln = function andln (num) {\n return this.words[0] & num;\n };\n\n // Increment at the bit position in-line\n BN.prototype.bincn = function bincn (bit) {\n assert(typeof bit === 'number');\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) {\n this._expand(s + 1);\n this.words[s] |= q;\n return this;\n }\n\n // Add bit and propagate, if needed\n var carry = q;\n for (var i = s; carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry;\n carry = w >>> 26;\n w &= 0x3ffffff;\n this.words[i] = w;\n }\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n return this;\n };\n\n BN.prototype.isZero = function isZero () {\n return this.length === 1 && this.words[0] === 0;\n };\n\n BN.prototype.cmpn = function cmpn (num) {\n var negative = num < 0;\n\n if (this.negative !== 0 && !negative) return -1;\n if (this.negative === 0 && negative) return 1;\n\n this._strip();\n\n var res;\n if (this.length > 1) {\n res = 1;\n } else {\n if (negative) {\n num = -num;\n }\n\n assert(num <= 0x3ffffff, 'Number is too big');\n\n var w = this.words[0] | 0;\n res = w === num ? 0 : w < num ? -1 : 1;\n }\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Compare two numbers and return:\n // 1 - if `this` > `num`\n // 0 - if `this` == `num`\n // -1 - if `this` < `num`\n BN.prototype.cmp = function cmp (num) {\n if (this.negative !== 0 && num.negative === 0) return -1;\n if (this.negative === 0 && num.negative !== 0) return 1;\n\n var res = this.ucmp(num);\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Unsigned comparison\n BN.prototype.ucmp = function ucmp (num) {\n // At this point both numbers have the same sign\n if (this.length > num.length) return 1;\n if (this.length < num.length) return -1;\n\n var res = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var a = this.words[i] | 0;\n var b = num.words[i] | 0;\n\n if (a === b) continue;\n if (a < b) {\n res = -1;\n } else if (a > b) {\n res = 1;\n }\n break;\n }\n return res;\n };\n\n BN.prototype.gtn = function gtn (num) {\n return this.cmpn(num) === 1;\n };\n\n BN.prototype.gt = function gt (num) {\n return this.cmp(num) === 1;\n };\n\n BN.prototype.gten = function gten (num) {\n return this.cmpn(num) >= 0;\n };\n\n BN.prototype.gte = function gte (num) {\n return this.cmp(num) >= 0;\n };\n\n BN.prototype.ltn = function ltn (num) {\n return this.cmpn(num) === -1;\n };\n\n BN.prototype.lt = function lt (num) {\n return this.cmp(num) === -1;\n };\n\n BN.prototype.lten = function lten (num) {\n return this.cmpn(num) <= 0;\n };\n\n BN.prototype.lte = function lte (num) {\n return this.cmp(num) <= 0;\n };\n\n BN.prototype.eqn = function eqn (num) {\n return this.cmpn(num) === 0;\n };\n\n BN.prototype.eq = function eq (num) {\n return this.cmp(num) === 0;\n };\n\n //\n // A reduce context, could be using montgomery or something better, depending\n // on the `m` itself.\n //\n BN.red = function red (num) {\n return new Red(num);\n };\n\n BN.prototype.toRed = function toRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n assert(this.negative === 0, 'red works only with positives');\n return ctx.convertTo(this)._forceRed(ctx);\n };\n\n BN.prototype.fromRed = function fromRed () {\n assert(this.red, 'fromRed works only with numbers in reduction context');\n return this.red.convertFrom(this);\n };\n\n BN.prototype._forceRed = function _forceRed (ctx) {\n this.red = ctx;\n return this;\n };\n\n BN.prototype.forceRed = function forceRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n return this._forceRed(ctx);\n };\n\n BN.prototype.redAdd = function redAdd (num) {\n assert(this.red, 'redAdd works only with red numbers');\n return this.red.add(this, num);\n };\n\n BN.prototype.redIAdd = function redIAdd (num) {\n assert(this.red, 'redIAdd works only with red numbers');\n return this.red.iadd(this, num);\n };\n\n BN.prototype.redSub = function redSub (num) {\n assert(this.red, 'redSub works only with red numbers');\n return this.red.sub(this, num);\n };\n\n BN.prototype.redISub = function redISub (num) {\n assert(this.red, 'redISub works only with red numbers');\n return this.red.isub(this, num);\n };\n\n BN.prototype.redShl = function redShl (num) {\n assert(this.red, 'redShl works only with red numbers');\n return this.red.shl(this, num);\n };\n\n BN.prototype.redMul = function redMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.mul(this, num);\n };\n\n BN.prototype.redIMul = function redIMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.imul(this, num);\n };\n\n BN.prototype.redSqr = function redSqr () {\n assert(this.red, 'redSqr works only with red numbers');\n this.red._verify1(this);\n return this.red.sqr(this);\n };\n\n BN.prototype.redISqr = function redISqr () {\n assert(this.red, 'redISqr works only with red numbers');\n this.red._verify1(this);\n return this.red.isqr(this);\n };\n\n // Square root over p\n BN.prototype.redSqrt = function redSqrt () {\n assert(this.red, 'redSqrt works only with red numbers');\n this.red._verify1(this);\n return this.red.sqrt(this);\n };\n\n BN.prototype.redInvm = function redInvm () {\n assert(this.red, 'redInvm works only with red numbers');\n this.red._verify1(this);\n return this.red.invm(this);\n };\n\n // Return negative clone of `this` % `red modulo`\n BN.prototype.redNeg = function redNeg () {\n assert(this.red, 'redNeg works only with red numbers');\n this.red._verify1(this);\n return this.red.neg(this);\n };\n\n BN.prototype.redPow = function redPow (num) {\n assert(this.red && !num.red, 'redPow(normalNum)');\n this.red._verify1(this);\n return this.red.pow(this, num);\n };\n\n // Prime numbers with efficient reduction\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n\n // Pseudo-Mersenne prime\n function MPrime (name, p) {\n // P = 2 ^ N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = new BN(1).iushln(this.n).isub(this.p);\n\n this.tmp = this._tmp();\n }\n\n MPrime.prototype._tmp = function _tmp () {\n var tmp = new BN(null);\n tmp.words = new Array(Math.ceil(this.n / 13));\n return tmp;\n };\n\n MPrime.prototype.ireduce = function ireduce (num) {\n // Assumes that `num` is less than `P^2`\n // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n var r = num;\n var rlen;\n\n do {\n this.split(r, this.tmp);\n r = this.imulK(r);\n r = r.iadd(this.tmp);\n rlen = r.bitLength();\n } while (rlen > this.n);\n\n var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n if (cmp === 0) {\n r.words[0] = 0;\n r.length = 1;\n } else if (cmp > 0) {\n r.isub(this.p);\n } else {\n if (r.strip !== undefined) {\n // r is a BN v4 instance\n r.strip();\n } else {\n // r is a BN v5 instance\n r._strip();\n }\n }\n\n return r;\n };\n\n MPrime.prototype.split = function split (input, out) {\n input.iushrn(this.n, 0, out);\n };\n\n MPrime.prototype.imulK = function imulK (num) {\n return num.imul(this.k);\n };\n\n function K256 () {\n MPrime.call(\n this,\n 'k256',\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n }\n inherits(K256, MPrime);\n\n K256.prototype.split = function split (input, output) {\n // 256 = 9 * 26 + 22\n var mask = 0x3fffff;\n\n var outLen = Math.min(input.length, 9);\n for (var i = 0; i < outLen; i++) {\n output.words[i] = input.words[i];\n }\n output.length = outLen;\n\n if (input.length <= 9) {\n input.words[0] = 0;\n input.length = 1;\n return;\n }\n\n // Shift by 9 limbs\n var prev = input.words[9];\n output.words[output.length++] = prev & mask;\n\n for (i = 10; i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n prev = next;\n }\n prev >>>= 22;\n input.words[i - 10] = prev;\n if (prev === 0 && input.length > 10) {\n input.length -= 10;\n } else {\n input.length -= 9;\n }\n };\n\n K256.prototype.imulK = function imulK (num) {\n // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n num.words[num.length] = 0;\n num.words[num.length + 1] = 0;\n num.length += 2;\n\n // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n var lo = 0;\n for (var i = 0; i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 0x3d1;\n num.words[i] = lo & 0x3ffffff;\n lo = w * 0x40 + ((lo / 0x4000000) | 0);\n }\n\n // Fast length reduction\n if (num.words[num.length - 1] === 0) {\n num.length--;\n if (num.words[num.length - 1] === 0) {\n num.length--;\n }\n }\n return num;\n };\n\n function P224 () {\n MPrime.call(\n this,\n 'p224',\n 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n }\n inherits(P224, MPrime);\n\n function P192 () {\n MPrime.call(\n this,\n 'p192',\n 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n }\n inherits(P192, MPrime);\n\n function P25519 () {\n // 2 ^ 255 - 19\n MPrime.call(\n this,\n '25519',\n '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n }\n inherits(P25519, MPrime);\n\n P25519.prototype.imulK = function imulK (num) {\n // K = 0x13\n var carry = 0;\n for (var i = 0; i < num.length; i++) {\n var hi = (num.words[i] | 0) * 0x13 + carry;\n var lo = hi & 0x3ffffff;\n hi >>>= 26;\n\n num.words[i] = lo;\n carry = hi;\n }\n if (carry !== 0) {\n num.words[num.length++] = carry;\n }\n return num;\n };\n\n // Exported mostly for testing purposes, use plain name instead\n BN._prime = function prime (name) {\n // Cached version of prime\n if (primes[name]) return primes[name];\n\n var prime;\n if (name === 'k256') {\n prime = new K256();\n } else if (name === 'p224') {\n prime = new P224();\n } else if (name === 'p192') {\n prime = new P192();\n } else if (name === 'p25519') {\n prime = new P25519();\n } else {\n throw new Error('Unknown prime ' + name);\n }\n primes[name] = prime;\n\n return prime;\n };\n\n //\n // Base reduction engine\n //\n function Red (m) {\n if (typeof m === 'string') {\n var prime = BN._prime(m);\n this.m = prime.p;\n this.prime = prime;\n } else {\n assert(m.gtn(1), 'modulus must be greater than 1');\n this.m = m;\n this.prime = null;\n }\n }\n\n Red.prototype._verify1 = function _verify1 (a) {\n assert(a.negative === 0, 'red works only with positives');\n assert(a.red, 'red works only with red numbers');\n };\n\n Red.prototype._verify2 = function _verify2 (a, b) {\n assert((a.negative | b.negative) === 0, 'red works only with positives');\n assert(a.red && a.red === b.red,\n 'red works only with red numbers');\n };\n\n Red.prototype.imod = function imod (a) {\n if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n\n move(a, a.umod(this.m)._forceRed(this));\n return a;\n };\n\n Red.prototype.neg = function neg (a) {\n if (a.isZero()) {\n return a.clone();\n }\n\n return this.m.sub(a)._forceRed(this);\n };\n\n Red.prototype.add = function add (a, b) {\n this._verify2(a, b);\n\n var res = a.add(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.iadd = function iadd (a, b) {\n this._verify2(a, b);\n\n var res = a.iadd(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res;\n };\n\n Red.prototype.sub = function sub (a, b) {\n this._verify2(a, b);\n\n var res = a.sub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.isub = function isub (a, b) {\n this._verify2(a, b);\n\n var res = a.isub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res;\n };\n\n Red.prototype.shl = function shl (a, num) {\n this._verify1(a);\n return this.imod(a.ushln(num));\n };\n\n Red.prototype.imul = function imul (a, b) {\n this._verify2(a, b);\n return this.imod(a.imul(b));\n };\n\n Red.prototype.mul = function mul (a, b) {\n this._verify2(a, b);\n return this.imod(a.mul(b));\n };\n\n Red.prototype.isqr = function isqr (a) {\n return this.imul(a, a.clone());\n };\n\n Red.prototype.sqr = function sqr (a) {\n return this.mul(a, a);\n };\n\n Red.prototype.sqrt = function sqrt (a) {\n if (a.isZero()) return a.clone();\n\n var mod3 = this.m.andln(3);\n assert(mod3 % 2 === 1);\n\n // Fast case\n if (mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n\n // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n //\n // Find Q and S, that Q * 2 ^ S = (P - 1)\n var q = this.m.subn(1);\n var s = 0;\n while (!q.isZero() && q.andln(1) === 0) {\n s++;\n q.iushrn(1);\n }\n assert(!q.isZero());\n\n var one = new BN(1).toRed(this);\n var nOne = one.redNeg();\n\n // Find quadratic non-residue\n // NOTE: Max is such because of generalized Riemann hypothesis.\n var lpow = this.m.subn(1).iushrn(1);\n var z = this.m.bitLength();\n z = new BN(2 * z * z).toRed(this);\n\n while (this.pow(z, lpow).cmp(nOne) !== 0) {\n z.redIAdd(nOne);\n }\n\n var c = this.pow(z, q);\n var r = this.pow(a, q.addn(1).iushrn(1));\n var t = this.pow(a, q);\n var m = s;\n while (t.cmp(one) !== 0) {\n var tmp = t;\n for (var i = 0; tmp.cmp(one) !== 0; i++) {\n tmp = tmp.redSqr();\n }\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n r = r.redMul(b);\n c = b.redSqr();\n t = t.redMul(c);\n m = i;\n }\n\n return r;\n };\n\n Red.prototype.invm = function invm (a) {\n var inv = a._invmp(this.m);\n if (inv.negative !== 0) {\n inv.negative = 0;\n return this.imod(inv).redNeg();\n } else {\n return this.imod(inv);\n }\n };\n\n Red.prototype.pow = function pow (a, num) {\n if (num.isZero()) return new BN(1).toRed(this);\n if (num.cmpn(1) === 0) return a.clone();\n\n var windowSize = 4;\n var wnd = new Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this);\n wnd[1] = a;\n for (var i = 2; i < wnd.length; i++) {\n wnd[i] = this.mul(wnd[i - 1], a);\n }\n\n var res = wnd[0];\n var current = 0;\n var currentLen = 0;\n var start = num.bitLength() % 26;\n if (start === 0) {\n start = 26;\n }\n\n for (i = num.length - 1; i >= 0; i--) {\n var word = num.words[i];\n for (var j = start - 1; j >= 0; j--) {\n var bit = (word >> j) & 1;\n if (res !== wnd[0]) {\n res = this.sqr(res);\n }\n\n if (bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n\n current <<= 1;\n current |= bit;\n currentLen++;\n if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n res = this.mul(res, wnd[current]);\n currentLen = 0;\n current = 0;\n }\n start = 26;\n }\n\n return res;\n };\n\n Red.prototype.convertTo = function convertTo (num) {\n var r = num.umod(this.m);\n\n return r === num ? r.clone() : r;\n };\n\n Red.prototype.convertFrom = function convertFrom (num) {\n var res = num.clone();\n res.red = null;\n return res;\n };\n\n //\n // Montgomery method engine\n //\n\n BN.mont = function mont (num) {\n return new Mont(num);\n };\n\n function Mont (m) {\n Red.call(this, m);\n\n this.shift = this.m.bitLength();\n if (this.shift % 26 !== 0) {\n this.shift += 26 - (this.shift % 26);\n }\n\n this.r = new BN(1).iushln(this.shift);\n this.r2 = this.imod(this.r.sqr());\n this.rinv = this.r._invmp(this.m);\n\n this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n this.minv = this.minv.umod(this.r);\n this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red);\n\n Mont.prototype.convertTo = function convertTo (num) {\n return this.imod(num.ushln(this.shift));\n };\n\n Mont.prototype.convertFrom = function convertFrom (num) {\n var r = this.imod(num.mul(this.rinv));\n r.red = null;\n return r;\n };\n\n Mont.prototype.imul = function imul (a, b) {\n if (a.isZero() || b.isZero()) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n var t = a.imul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.mul = function mul (a, b) {\n if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n var t = a.mul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.invm = function invm (a) {\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n})(typeof module === 'undefined' || module, this);\n","export const version = \"logger/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nlet _permanentCensorErrors = false;\nlet _censorErrors = false;\nconst LogLevels = { debug: 1, \"default\": 2, info: 2, warning: 3, error: 4, off: 5 };\nlet _logLevel = LogLevels[\"default\"];\nimport { version } from \"./_version\";\nlet _globalLogger = null;\nfunction _checkNormalize() {\n try {\n const missing = [];\n // Make sure all forms of normalization are supported\n [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].forEach((form) => {\n try {\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad normalize\");\n }\n ;\n }\n catch (error) {\n missing.push(form);\n }\n });\n if (missing.length) {\n throw new Error(\"missing \" + missing.join(\", \"));\n }\n if (String.fromCharCode(0xe9).normalize(\"NFD\") !== String.fromCharCode(0x65, 0x0301)) {\n throw new Error(\"broken implementation\");\n }\n }\n catch (error) {\n return error.message;\n }\n return null;\n}\nconst _normalizeError = _checkNormalize();\nexport var LogLevel;\n(function (LogLevel) {\n LogLevel[\"DEBUG\"] = \"DEBUG\";\n LogLevel[\"INFO\"] = \"INFO\";\n LogLevel[\"WARNING\"] = \"WARNING\";\n LogLevel[\"ERROR\"] = \"ERROR\";\n LogLevel[\"OFF\"] = \"OFF\";\n})(LogLevel || (LogLevel = {}));\nexport var ErrorCode;\n(function (ErrorCode) {\n ///////////////////\n // Generic Errors\n // Unknown Error\n ErrorCode[\"UNKNOWN_ERROR\"] = \"UNKNOWN_ERROR\";\n // Not Implemented\n ErrorCode[\"NOT_IMPLEMENTED\"] = \"NOT_IMPLEMENTED\";\n // Unsupported Operation\n // - operation\n ErrorCode[\"UNSUPPORTED_OPERATION\"] = \"UNSUPPORTED_OPERATION\";\n // Network Error (i.e. Ethereum Network, such as an invalid chain ID)\n // - event (\"noNetwork\" is not re-thrown in provider.ready; otherwise thrown)\n ErrorCode[\"NETWORK_ERROR\"] = \"NETWORK_ERROR\";\n // Some sort of bad response from the server\n ErrorCode[\"SERVER_ERROR\"] = \"SERVER_ERROR\";\n // Timeout\n ErrorCode[\"TIMEOUT\"] = \"TIMEOUT\";\n ///////////////////\n // Operational Errors\n // Buffer Overrun\n ErrorCode[\"BUFFER_OVERRUN\"] = \"BUFFER_OVERRUN\";\n // Numeric Fault\n // - operation: the operation being executed\n // - fault: the reason this faulted\n ErrorCode[\"NUMERIC_FAULT\"] = \"NUMERIC_FAULT\";\n ///////////////////\n // Argument Errors\n // Missing new operator to an object\n // - name: The name of the class\n ErrorCode[\"MISSING_NEW\"] = \"MISSING_NEW\";\n // Invalid argument (e.g. value is incompatible with type) to a function:\n // - argument: The argument name that was invalid\n // - value: The value of the argument\n ErrorCode[\"INVALID_ARGUMENT\"] = \"INVALID_ARGUMENT\";\n // Missing argument to a function:\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"MISSING_ARGUMENT\"] = \"MISSING_ARGUMENT\";\n // Too many arguments\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"UNEXPECTED_ARGUMENT\"] = \"UNEXPECTED_ARGUMENT\";\n ///////////////////\n // Blockchain Errors\n // Call exception\n // - transaction: the transaction\n // - address?: the contract address\n // - args?: The arguments passed into the function\n // - method?: The Solidity method signature\n // - errorSignature?: The EIP848 error signature\n // - errorArgs?: The EIP848 error parameters\n // - reason: The reason (only for EIP848 \"Error(string)\")\n ErrorCode[\"CALL_EXCEPTION\"] = \"CALL_EXCEPTION\";\n // Insufficient funds (< value + gasLimit * gasPrice)\n // - transaction: the transaction attempted\n ErrorCode[\"INSUFFICIENT_FUNDS\"] = \"INSUFFICIENT_FUNDS\";\n // Nonce has already been used\n // - transaction: the transaction attempted\n ErrorCode[\"NONCE_EXPIRED\"] = \"NONCE_EXPIRED\";\n // The replacement fee for the transaction is too low\n // - transaction: the transaction attempted\n ErrorCode[\"REPLACEMENT_UNDERPRICED\"] = \"REPLACEMENT_UNDERPRICED\";\n // The gas limit could not be estimated\n // - transaction: the transaction passed to estimateGas\n ErrorCode[\"UNPREDICTABLE_GAS_LIMIT\"] = \"UNPREDICTABLE_GAS_LIMIT\";\n // The transaction was replaced by one with a higher gas price\n // - reason: \"cancelled\", \"replaced\" or \"repriced\"\n // - cancelled: true if reason == \"cancelled\" or reason == \"replaced\")\n // - hash: original transaction hash\n // - replacement: the full TransactionsResponse for the replacement\n // - receipt: the receipt of the replacement\n ErrorCode[\"TRANSACTION_REPLACED\"] = \"TRANSACTION_REPLACED\";\n ///////////////////\n // Interaction Errors\n // The user rejected the action, such as signing a message or sending\n // a transaction\n ErrorCode[\"ACTION_REJECTED\"] = \"ACTION_REJECTED\";\n})(ErrorCode || (ErrorCode = {}));\n;\nconst HEX = \"0123456789abcdef\";\nexport class Logger {\n constructor(version) {\n Object.defineProperty(this, \"version\", {\n enumerable: true,\n value: version,\n writable: false\n });\n }\n _log(logLevel, args) {\n const level = logLevel.toLowerCase();\n if (LogLevels[level] == null) {\n this.throwArgumentError(\"invalid log level name\", \"logLevel\", logLevel);\n }\n if (_logLevel > LogLevels[level]) {\n return;\n }\n console.log.apply(console, args);\n }\n debug(...args) {\n this._log(Logger.levels.DEBUG, args);\n }\n info(...args) {\n this._log(Logger.levels.INFO, args);\n }\n warn(...args) {\n this._log(Logger.levels.WARNING, args);\n }\n makeError(message, code, params) {\n // Errors are being censored\n if (_censorErrors) {\n return this.makeError(\"censored error\", code, {});\n }\n if (!code) {\n code = Logger.errors.UNKNOWN_ERROR;\n }\n if (!params) {\n params = {};\n }\n const messageDetails = [];\n Object.keys(params).forEach((key) => {\n const value = params[key];\n try {\n if (value instanceof Uint8Array) {\n let hex = \"\";\n for (let i = 0; i < value.length; i++) {\n hex += HEX[value[i] >> 4];\n hex += HEX[value[i] & 0x0f];\n }\n messageDetails.push(key + \"=Uint8Array(0x\" + hex + \")\");\n }\n else {\n messageDetails.push(key + \"=\" + JSON.stringify(value));\n }\n }\n catch (error) {\n messageDetails.push(key + \"=\" + JSON.stringify(params[key].toString()));\n }\n });\n messageDetails.push(`code=${code}`);\n messageDetails.push(`version=${this.version}`);\n const reason = message;\n let url = \"\";\n switch (code) {\n case ErrorCode.NUMERIC_FAULT: {\n url = \"NUMERIC_FAULT\";\n const fault = message;\n switch (fault) {\n case \"overflow\":\n case \"underflow\":\n case \"division-by-zero\":\n url += \"-\" + fault;\n break;\n case \"negative-power\":\n case \"negative-width\":\n url += \"-unsupported\";\n break;\n case \"unbound-bitwise-result\":\n url += \"-unbound-result\";\n break;\n }\n break;\n }\n case ErrorCode.CALL_EXCEPTION:\n case ErrorCode.INSUFFICIENT_FUNDS:\n case ErrorCode.MISSING_NEW:\n case ErrorCode.NONCE_EXPIRED:\n case ErrorCode.REPLACEMENT_UNDERPRICED:\n case ErrorCode.TRANSACTION_REPLACED:\n case ErrorCode.UNPREDICTABLE_GAS_LIMIT:\n url = code;\n break;\n }\n if (url) {\n message += \" [ See: https:/\\/links.ethers.org/v5-errors-\" + url + \" ]\";\n }\n if (messageDetails.length) {\n message += \" (\" + messageDetails.join(\", \") + \")\";\n }\n // @TODO: Any??\n const error = new Error(message);\n error.reason = reason;\n error.code = code;\n Object.keys(params).forEach(function (key) {\n error[key] = params[key];\n });\n return error;\n }\n throwError(message, code, params) {\n throw this.makeError(message, code, params);\n }\n throwArgumentError(message, name, value) {\n return this.throwError(message, Logger.errors.INVALID_ARGUMENT, {\n argument: name,\n value: value\n });\n }\n assert(condition, message, code, params) {\n if (!!condition) {\n return;\n }\n this.throwError(message, code, params);\n }\n assertArgument(condition, message, name, value) {\n if (!!condition) {\n return;\n }\n this.throwArgumentError(message, name, value);\n }\n checkNormalize(message) {\n if (message == null) {\n message = \"platform missing String.prototype.normalize\";\n }\n if (_normalizeError) {\n this.throwError(\"platform missing String.prototype.normalize\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"String.prototype.normalize\", form: _normalizeError\n });\n }\n }\n checkSafeUint53(value, message) {\n if (typeof (value) !== \"number\") {\n return;\n }\n if (message == null) {\n message = \"value not safe\";\n }\n if (value < 0 || value >= 0x1fffffffffffff) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"out-of-safe-range\",\n value: value\n });\n }\n if (value % 1) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"non-integer\",\n value: value\n });\n }\n }\n checkArgumentCount(count, expectedCount, message) {\n if (message) {\n message = \": \" + message;\n }\n else {\n message = \"\";\n }\n if (count < expectedCount) {\n this.throwError(\"missing argument\" + message, Logger.errors.MISSING_ARGUMENT, {\n count: count,\n expectedCount: expectedCount\n });\n }\n if (count > expectedCount) {\n this.throwError(\"too many arguments\" + message, Logger.errors.UNEXPECTED_ARGUMENT, {\n count: count,\n expectedCount: expectedCount\n });\n }\n }\n checkNew(target, kind) {\n if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, { name: kind.name });\n }\n }\n checkAbstract(target, kind) {\n if (target === kind) {\n this.throwError(\"cannot instantiate abstract class \" + JSON.stringify(kind.name) + \" directly; use a sub-class\", Logger.errors.UNSUPPORTED_OPERATION, { name: target.name, operation: \"new\" });\n }\n else if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, { name: kind.name });\n }\n }\n static globalLogger() {\n if (!_globalLogger) {\n _globalLogger = new Logger(version);\n }\n return _globalLogger;\n }\n static setCensorship(censorship, permanent) {\n if (!censorship && permanent) {\n this.globalLogger().throwError(\"cannot permanently disable censorship\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\"\n });\n }\n if (_permanentCensorErrors) {\n if (!censorship) {\n return;\n }\n this.globalLogger().throwError(\"error censorship permanent\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\"\n });\n }\n _censorErrors = !!censorship;\n _permanentCensorErrors = !!permanent;\n }\n static setLogLevel(logLevel) {\n const level = LogLevels[logLevel.toLowerCase()];\n if (level == null) {\n Logger.globalLogger().warn(\"invalid log level - \" + logLevel);\n return;\n }\n _logLevel = level;\n }\n static from(version) {\n return new Logger(version);\n }\n}\nLogger.errors = ErrorCode;\nLogger.levels = LogLevel;\n//# sourceMappingURL=index.js.map","export const version = \"bytes/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n///////////////////////////////\nfunction isHexable(value) {\n return !!(value.toHexString);\n}\nfunction addSlice(array) {\n if (array.slice) {\n return array;\n }\n array.slice = function () {\n const args = Array.prototype.slice.call(arguments);\n return addSlice(new Uint8Array(Array.prototype.slice.apply(array, args)));\n };\n return array;\n}\nexport function isBytesLike(value) {\n return ((isHexString(value) && !(value.length % 2)) || isBytes(value));\n}\nfunction isInteger(value) {\n return (typeof (value) === \"number\" && value == value && (value % 1) === 0);\n}\nexport function isBytes(value) {\n if (value == null) {\n return false;\n }\n if (value.constructor === Uint8Array) {\n return true;\n }\n if (typeof (value) === \"string\") {\n return false;\n }\n if (!isInteger(value.length) || value.length < 0) {\n return false;\n }\n for (let i = 0; i < value.length; i++) {\n const v = value[i];\n if (!isInteger(v) || v < 0 || v >= 256) {\n return false;\n }\n }\n return true;\n}\nexport function arrayify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof (value) === \"number\") {\n logger.checkSafeUint53(value, \"invalid arrayify value\");\n const result = [];\n while (value) {\n result.unshift(value & 0xff);\n value = parseInt(String(value / 256));\n }\n if (result.length === 0) {\n result.push(0);\n }\n return addSlice(new Uint8Array(result));\n }\n if (options.allowMissingPrefix && typeof (value) === \"string\" && value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n value = value.toHexString();\n }\n if (isHexString(value)) {\n let hex = value.substring(2);\n if (hex.length % 2) {\n if (options.hexPad === \"left\") {\n hex = \"0\" + hex;\n }\n else if (options.hexPad === \"right\") {\n hex += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n const result = [];\n for (let i = 0; i < hex.length; i += 2) {\n result.push(parseInt(hex.substring(i, i + 2), 16));\n }\n return addSlice(new Uint8Array(result));\n }\n if (isBytes(value)) {\n return addSlice(new Uint8Array(value));\n }\n return logger.throwArgumentError(\"invalid arrayify value\", \"value\", value);\n}\nexport function concat(items) {\n const objects = items.map(item => arrayify(item));\n const length = objects.reduce((accum, item) => (accum + item.length), 0);\n const result = new Uint8Array(length);\n objects.reduce((offset, object) => {\n result.set(object, offset);\n return offset + object.length;\n }, 0);\n return addSlice(result);\n}\nexport function stripZeros(value) {\n let result = arrayify(value);\n if (result.length === 0) {\n return result;\n }\n // Find the first non-zero entry\n let start = 0;\n while (start < result.length && result[start] === 0) {\n start++;\n }\n // If we started with zeros, strip them\n if (start) {\n result = result.slice(start);\n }\n return result;\n}\nexport function zeroPad(value, length) {\n value = arrayify(value);\n if (value.length > length) {\n logger.throwArgumentError(\"value out of range\", \"value\", arguments[0]);\n }\n const result = new Uint8Array(length);\n result.set(value, length - value.length);\n return addSlice(result);\n}\nexport function isHexString(value, length) {\n if (typeof (value) !== \"string\" || !value.match(/^0x[0-9A-Fa-f]*$/)) {\n return false;\n }\n if (length && value.length !== 2 + 2 * length) {\n return false;\n }\n return true;\n}\nconst HexCharacters = \"0123456789abcdef\";\nexport function hexlify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof (value) === \"number\") {\n logger.checkSafeUint53(value, \"invalid hexlify value\");\n let hex = \"\";\n while (value) {\n hex = HexCharacters[value & 0xf] + hex;\n value = Math.floor(value / 16);\n }\n if (hex.length) {\n if (hex.length % 2) {\n hex = \"0\" + hex;\n }\n return \"0x\" + hex;\n }\n return \"0x00\";\n }\n if (typeof (value) === \"bigint\") {\n value = value.toString(16);\n if (value.length % 2) {\n return (\"0x0\" + value);\n }\n return \"0x\" + value;\n }\n if (options.allowMissingPrefix && typeof (value) === \"string\" && value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n return value.toHexString();\n }\n if (isHexString(value)) {\n if (value.length % 2) {\n if (options.hexPad === \"left\") {\n value = \"0x0\" + value.substring(2);\n }\n else if (options.hexPad === \"right\") {\n value += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n return value.toLowerCase();\n }\n if (isBytes(value)) {\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n let v = value[i];\n result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f];\n }\n return result;\n }\n return logger.throwArgumentError(\"invalid hexlify value\", \"value\", value);\n}\n/*\nfunction unoddify(value: BytesLike | Hexable | number): BytesLike | Hexable | number {\n if (typeof(value) === \"string\" && value.length % 2 && value.substring(0, 2) === \"0x\") {\n return \"0x0\" + value.substring(2);\n }\n return value;\n}\n*/\nexport function hexDataLength(data) {\n if (typeof (data) !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || (data.length % 2)) {\n return null;\n }\n return (data.length - 2) / 2;\n}\nexport function hexDataSlice(data, offset, endOffset) {\n if (typeof (data) !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || (data.length % 2)) {\n logger.throwArgumentError(\"invalid hexData\", \"value\", data);\n }\n offset = 2 + 2 * offset;\n if (endOffset != null) {\n return \"0x\" + data.substring(offset, 2 + 2 * endOffset);\n }\n return \"0x\" + data.substring(offset);\n}\nexport function hexConcat(items) {\n let result = \"0x\";\n items.forEach((item) => {\n result += hexlify(item).substring(2);\n });\n return result;\n}\nexport function hexValue(value) {\n const trimmed = hexStripZeros(hexlify(value, { hexPad: \"left\" }));\n if (trimmed === \"0x\") {\n return \"0x0\";\n }\n return trimmed;\n}\nexport function hexStripZeros(value) {\n if (typeof (value) !== \"string\") {\n value = hexlify(value);\n }\n if (!isHexString(value)) {\n logger.throwArgumentError(\"invalid hex string\", \"value\", value);\n }\n value = value.substring(2);\n let offset = 0;\n while (offset < value.length && value[offset] === \"0\") {\n offset++;\n }\n return \"0x\" + value.substring(offset);\n}\nexport function hexZeroPad(value, length) {\n if (typeof (value) !== \"string\") {\n value = hexlify(value);\n }\n else if (!isHexString(value)) {\n logger.throwArgumentError(\"invalid hex string\", \"value\", value);\n }\n if (value.length > 2 * length + 2) {\n logger.throwArgumentError(\"value out of range\", \"value\", arguments[1]);\n }\n while (value.length < 2 * length + 2) {\n value = \"0x0\" + value.substring(2);\n }\n return value;\n}\nexport function splitSignature(signature) {\n const result = {\n r: \"0x\",\n s: \"0x\",\n _vs: \"0x\",\n recoveryParam: 0,\n v: 0,\n yParityAndS: \"0x\",\n compact: \"0x\"\n };\n if (isBytesLike(signature)) {\n let bytes = arrayify(signature);\n // Get the r, s and v\n if (bytes.length === 64) {\n // EIP-2098; pull the v from the top bit of s and clear it\n result.v = 27 + (bytes[32] >> 7);\n bytes[32] &= 0x7f;\n result.r = hexlify(bytes.slice(0, 32));\n result.s = hexlify(bytes.slice(32, 64));\n }\n else if (bytes.length === 65) {\n result.r = hexlify(bytes.slice(0, 32));\n result.s = hexlify(bytes.slice(32, 64));\n result.v = bytes[64];\n }\n else {\n logger.throwArgumentError(\"invalid signature string\", \"signature\", signature);\n }\n // Allow a recid to be used as the v\n if (result.v < 27) {\n if (result.v === 0 || result.v === 1) {\n result.v += 27;\n }\n else {\n logger.throwArgumentError(\"signature invalid v byte\", \"signature\", signature);\n }\n }\n // Compute recoveryParam from v\n result.recoveryParam = 1 - (result.v % 2);\n // Compute _vs from recoveryParam and s\n if (result.recoveryParam) {\n bytes[32] |= 0x80;\n }\n result._vs = hexlify(bytes.slice(32, 64));\n }\n else {\n result.r = signature.r;\n result.s = signature.s;\n result.v = signature.v;\n result.recoveryParam = signature.recoveryParam;\n result._vs = signature._vs;\n // If the _vs is available, use it to populate missing s, v and recoveryParam\n // and verify non-missing s, v and recoveryParam\n if (result._vs != null) {\n const vs = zeroPad(arrayify(result._vs), 32);\n result._vs = hexlify(vs);\n // Set or check the recid\n const recoveryParam = ((vs[0] >= 128) ? 1 : 0);\n if (result.recoveryParam == null) {\n result.recoveryParam = recoveryParam;\n }\n else if (result.recoveryParam !== recoveryParam) {\n logger.throwArgumentError(\"signature recoveryParam mismatch _vs\", \"signature\", signature);\n }\n // Set or check the s\n vs[0] &= 0x7f;\n const s = hexlify(vs);\n if (result.s == null) {\n result.s = s;\n }\n else if (result.s !== s) {\n logger.throwArgumentError(\"signature v mismatch _vs\", \"signature\", signature);\n }\n }\n // Use recid and v to populate each other\n if (result.recoveryParam == null) {\n if (result.v == null) {\n logger.throwArgumentError(\"signature missing v and recoveryParam\", \"signature\", signature);\n }\n else if (result.v === 0 || result.v === 1) {\n result.recoveryParam = result.v;\n }\n else {\n result.recoveryParam = 1 - (result.v % 2);\n }\n }\n else {\n if (result.v == null) {\n result.v = 27 + result.recoveryParam;\n }\n else {\n const recId = (result.v === 0 || result.v === 1) ? result.v : (1 - (result.v % 2));\n if (result.recoveryParam !== recId) {\n logger.throwArgumentError(\"signature recoveryParam mismatch v\", \"signature\", signature);\n }\n }\n }\n if (result.r == null || !isHexString(result.r)) {\n logger.throwArgumentError(\"signature missing or invalid r\", \"signature\", signature);\n }\n else {\n result.r = hexZeroPad(result.r, 32);\n }\n if (result.s == null || !isHexString(result.s)) {\n logger.throwArgumentError(\"signature missing or invalid s\", \"signature\", signature);\n }\n else {\n result.s = hexZeroPad(result.s, 32);\n }\n const vs = arrayify(result.s);\n if (vs[0] >= 128) {\n logger.throwArgumentError(\"signature s out of range\", \"signature\", signature);\n }\n if (result.recoveryParam) {\n vs[0] |= 0x80;\n }\n const _vs = hexlify(vs);\n if (result._vs) {\n if (!isHexString(result._vs)) {\n logger.throwArgumentError(\"signature invalid _vs\", \"signature\", signature);\n }\n result._vs = hexZeroPad(result._vs, 32);\n }\n // Set or check the _vs\n if (result._vs == null) {\n result._vs = _vs;\n }\n else if (result._vs !== _vs) {\n logger.throwArgumentError(\"signature _vs mismatch v and s\", \"signature\", signature);\n }\n }\n result.yParityAndS = result._vs;\n result.compact = result.r + result.yParityAndS.substring(2);\n return result;\n}\nexport function joinSignature(signature) {\n signature = splitSignature(signature);\n return hexlify(concat([\n signature.r,\n signature.s,\n (signature.recoveryParam ? \"0x1c\" : \"0x1b\")\n ]));\n}\n//# sourceMappingURL=index.js.map","export const version = \"bignumber/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\n/**\n * BigNumber\n *\n * A wrapper around the BN.js object. We use the BN.js library\n * because it is used by elliptic, so it is required regardless.\n *\n */\nimport _BN from \"bn.js\";\nvar BN = _BN.BN;\nimport { hexlify, isBytes, isHexString } from \"@ethersproject/bytes\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nconst _constructorGuard = {};\nconst MAX_SAFE = 0x1fffffffffffff;\nexport function isBigNumberish(value) {\n return (value != null) && (BigNumber.isBigNumber(value) ||\n (typeof (value) === \"number\" && (value % 1) === 0) ||\n (typeof (value) === \"string\" && !!value.match(/^-?[0-9]+$/)) ||\n isHexString(value) ||\n (typeof (value) === \"bigint\") ||\n isBytes(value));\n}\n// Only warn about passing 10 into radix once\nlet _warnedToStringRadix = false;\nexport class BigNumber {\n constructor(constructorGuard, hex) {\n if (constructorGuard !== _constructorGuard) {\n logger.throwError(\"cannot call constructor directly; use BigNumber.from\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"new (BigNumber)\"\n });\n }\n this._hex = hex;\n this._isBigNumber = true;\n Object.freeze(this);\n }\n fromTwos(value) {\n return toBigNumber(toBN(this).fromTwos(value));\n }\n toTwos(value) {\n return toBigNumber(toBN(this).toTwos(value));\n }\n abs() {\n if (this._hex[0] === \"-\") {\n return BigNumber.from(this._hex.substring(1));\n }\n return this;\n }\n add(other) {\n return toBigNumber(toBN(this).add(toBN(other)));\n }\n sub(other) {\n return toBigNumber(toBN(this).sub(toBN(other)));\n }\n div(other) {\n const o = BigNumber.from(other);\n if (o.isZero()) {\n throwFault(\"division-by-zero\", \"div\");\n }\n return toBigNumber(toBN(this).div(toBN(other)));\n }\n mul(other) {\n return toBigNumber(toBN(this).mul(toBN(other)));\n }\n mod(other) {\n const value = toBN(other);\n if (value.isNeg()) {\n throwFault(\"division-by-zero\", \"mod\");\n }\n return toBigNumber(toBN(this).umod(value));\n }\n pow(other) {\n const value = toBN(other);\n if (value.isNeg()) {\n throwFault(\"negative-power\", \"pow\");\n }\n return toBigNumber(toBN(this).pow(value));\n }\n and(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"unbound-bitwise-result\", \"and\");\n }\n return toBigNumber(toBN(this).and(value));\n }\n or(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"unbound-bitwise-result\", \"or\");\n }\n return toBigNumber(toBN(this).or(value));\n }\n xor(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"unbound-bitwise-result\", \"xor\");\n }\n return toBigNumber(toBN(this).xor(value));\n }\n mask(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"negative-width\", \"mask\");\n }\n return toBigNumber(toBN(this).maskn(value));\n }\n shl(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"negative-width\", \"shl\");\n }\n return toBigNumber(toBN(this).shln(value));\n }\n shr(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"negative-width\", \"shr\");\n }\n return toBigNumber(toBN(this).shrn(value));\n }\n eq(other) {\n return toBN(this).eq(toBN(other));\n }\n lt(other) {\n return toBN(this).lt(toBN(other));\n }\n lte(other) {\n return toBN(this).lte(toBN(other));\n }\n gt(other) {\n return toBN(this).gt(toBN(other));\n }\n gte(other) {\n return toBN(this).gte(toBN(other));\n }\n isNegative() {\n return (this._hex[0] === \"-\");\n }\n isZero() {\n return toBN(this).isZero();\n }\n toNumber() {\n try {\n return toBN(this).toNumber();\n }\n catch (error) {\n throwFault(\"overflow\", \"toNumber\", this.toString());\n }\n return null;\n }\n toBigInt() {\n try {\n return BigInt(this.toString());\n }\n catch (e) { }\n return logger.throwError(\"this platform does not support BigInt\", Logger.errors.UNSUPPORTED_OPERATION, {\n value: this.toString()\n });\n }\n toString() {\n // Lots of people expect this, which we do not support, so check (See: #889)\n if (arguments.length > 0) {\n if (arguments[0] === 10) {\n if (!_warnedToStringRadix) {\n _warnedToStringRadix = true;\n logger.warn(\"BigNumber.toString does not accept any parameters; base-10 is assumed\");\n }\n }\n else if (arguments[0] === 16) {\n logger.throwError(\"BigNumber.toString does not accept any parameters; use bigNumber.toHexString()\", Logger.errors.UNEXPECTED_ARGUMENT, {});\n }\n else {\n logger.throwError(\"BigNumber.toString does not accept parameters\", Logger.errors.UNEXPECTED_ARGUMENT, {});\n }\n }\n return toBN(this).toString(10);\n }\n toHexString() {\n return this._hex;\n }\n toJSON(key) {\n return { type: \"BigNumber\", hex: this.toHexString() };\n }\n static from(value) {\n if (value instanceof BigNumber) {\n return value;\n }\n if (typeof (value) === \"string\") {\n if (value.match(/^-?0x[0-9a-f]+$/i)) {\n return new BigNumber(_constructorGuard, toHex(value));\n }\n if (value.match(/^-?[0-9]+$/)) {\n return new BigNumber(_constructorGuard, toHex(new BN(value)));\n }\n return logger.throwArgumentError(\"invalid BigNumber string\", \"value\", value);\n }\n if (typeof (value) === \"number\") {\n if (value % 1) {\n throwFault(\"underflow\", \"BigNumber.from\", value);\n }\n if (value >= MAX_SAFE || value <= -MAX_SAFE) {\n throwFault(\"overflow\", \"BigNumber.from\", value);\n }\n return BigNumber.from(String(value));\n }\n const anyValue = value;\n if (typeof (anyValue) === \"bigint\") {\n return BigNumber.from(anyValue.toString());\n }\n if (isBytes(anyValue)) {\n return BigNumber.from(hexlify(anyValue));\n }\n if (anyValue) {\n // Hexable interface (takes priority)\n if (anyValue.toHexString) {\n const hex = anyValue.toHexString();\n if (typeof (hex) === \"string\") {\n return BigNumber.from(hex);\n }\n }\n else {\n // For now, handle legacy JSON-ified values (goes away in v6)\n let hex = anyValue._hex;\n // New-form JSON\n if (hex == null && anyValue.type === \"BigNumber\") {\n hex = anyValue.hex;\n }\n if (typeof (hex) === \"string\") {\n if (isHexString(hex) || (hex[0] === \"-\" && isHexString(hex.substring(1)))) {\n return BigNumber.from(hex);\n }\n }\n }\n }\n return logger.throwArgumentError(\"invalid BigNumber value\", \"value\", value);\n }\n static isBigNumber(value) {\n return !!(value && value._isBigNumber);\n }\n}\n// Normalize the hex string\nfunction toHex(value) {\n // For BN, call on the hex string\n if (typeof (value) !== \"string\") {\n return toHex(value.toString(16));\n }\n // If negative, prepend the negative sign to the normalized positive value\n if (value[0] === \"-\") {\n // Strip off the negative sign\n value = value.substring(1);\n // Cannot have multiple negative signs (e.g. \"--0x04\")\n if (value[0] === \"-\") {\n logger.throwArgumentError(\"invalid hex\", \"value\", value);\n }\n // Call toHex on the positive component\n value = toHex(value);\n // Do not allow \"-0x00\"\n if (value === \"0x00\") {\n return value;\n }\n // Negate the value\n return \"-\" + value;\n }\n // Add a \"0x\" prefix if missing\n if (value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n // Normalize zero\n if (value === \"0x\") {\n return \"0x00\";\n }\n // Make the string even length\n if (value.length % 2) {\n value = \"0x0\" + value.substring(2);\n }\n // Trim to smallest even-length string\n while (value.length > 4 && value.substring(0, 4) === \"0x00\") {\n value = \"0x\" + value.substring(4);\n }\n return value;\n}\nfunction toBigNumber(value) {\n return BigNumber.from(toHex(value));\n}\nfunction toBN(value) {\n const hex = BigNumber.from(value).toHexString();\n if (hex[0] === \"-\") {\n return (new BN(\"-\" + hex.substring(3), 16));\n }\n return new BN(hex.substring(2), 16);\n}\nfunction throwFault(fault, operation, value) {\n const params = { fault: fault, operation: operation };\n if (value != null) {\n params.value = value;\n }\n return logger.throwError(fault, Logger.errors.NUMERIC_FAULT, params);\n}\n// value should have no prefix\nexport function _base36To16(value) {\n return (new BN(value, 36)).toString(16);\n}\n// value should have no prefix\nexport function _base16To36(value) {\n return (new BN(value, 16)).toString(36);\n}\n//# sourceMappingURL=bignumber.js.map","export const version = \"properties/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nexport function defineReadOnly(object, name, value) {\n Object.defineProperty(object, name, {\n enumerable: true,\n value: value,\n writable: false,\n });\n}\n// Crawl up the constructor chain to find a static method\nexport function getStatic(ctor, key) {\n for (let i = 0; i < 32; i++) {\n if (ctor[key]) {\n return ctor[key];\n }\n if (!ctor.prototype || typeof (ctor.prototype) !== \"object\") {\n break;\n }\n ctor = Object.getPrototypeOf(ctor.prototype).constructor;\n }\n return null;\n}\nexport function resolveProperties(object) {\n return __awaiter(this, void 0, void 0, function* () {\n const promises = Object.keys(object).map((key) => {\n const value = object[key];\n return Promise.resolve(value).then((v) => ({ key: key, value: v }));\n });\n const results = yield Promise.all(promises);\n return results.reduce((accum, result) => {\n accum[(result.key)] = result.value;\n return accum;\n }, {});\n });\n}\nexport function checkProperties(object, properties) {\n if (!object || typeof (object) !== \"object\") {\n logger.throwArgumentError(\"invalid object\", \"object\", object);\n }\n Object.keys(object).forEach((key) => {\n if (!properties[key]) {\n logger.throwArgumentError(\"invalid object key - \" + key, \"transaction:\" + key, object);\n }\n });\n}\nexport function shallowCopy(object) {\n const result = {};\n for (const key in object) {\n result[key] = object[key];\n }\n return result;\n}\nconst opaque = { bigint: true, boolean: true, \"function\": true, number: true, string: true };\nfunction _isFrozen(object) {\n // Opaque objects are not mutable, so safe to copy by assignment\n if (object === undefined || object === null || opaque[typeof (object)]) {\n return true;\n }\n if (Array.isArray(object) || typeof (object) === \"object\") {\n if (!Object.isFrozen(object)) {\n return false;\n }\n const keys = Object.keys(object);\n for (let i = 0; i < keys.length; i++) {\n let value = null;\n try {\n value = object[keys[i]];\n }\n catch (error) {\n // If accessing a value triggers an error, it is a getter\n // designed to do so (e.g. Result) and is therefore \"frozen\"\n continue;\n }\n if (!_isFrozen(value)) {\n return false;\n }\n }\n return true;\n }\n return logger.throwArgumentError(`Cannot deepCopy ${typeof (object)}`, \"object\", object);\n}\n// Returns a new copy of object, such that no properties may be replaced.\n// New properties may be added only to objects.\nfunction _deepCopy(object) {\n if (_isFrozen(object)) {\n return object;\n }\n // Arrays are mutable, so we need to create a copy\n if (Array.isArray(object)) {\n return Object.freeze(object.map((item) => deepCopy(item)));\n }\n if (typeof (object) === \"object\") {\n const result = {};\n for (const key in object) {\n const value = object[key];\n if (value === undefined) {\n continue;\n }\n defineReadOnly(result, key, deepCopy(value));\n }\n return result;\n }\n return logger.throwArgumentError(`Cannot deepCopy ${typeof (object)}`, \"object\", object);\n}\nexport function deepCopy(object) {\n return _deepCopy(object);\n}\nexport class Description {\n constructor(info) {\n for (const key in info) {\n this[key] = deepCopy(info[key]);\n }\n }\n}\n//# sourceMappingURL=index.js.map","export const version = \"abi/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n;\nconst _constructorGuard = {};\nlet ModifiersBytes = { calldata: true, memory: true, storage: true };\nlet ModifiersNest = { calldata: true, memory: true };\nfunction checkModifier(type, name) {\n if (type === \"bytes\" || type === \"string\") {\n if (ModifiersBytes[name]) {\n return true;\n }\n }\n else if (type === \"address\") {\n if (name === \"payable\") {\n return true;\n }\n }\n else if (type.indexOf(\"[\") >= 0 || type === \"tuple\") {\n if (ModifiersNest[name]) {\n return true;\n }\n }\n if (ModifiersBytes[name] || name === \"payable\") {\n logger.throwArgumentError(\"invalid modifier\", \"name\", name);\n }\n return false;\n}\n// @TODO: Make sure that children of an indexed tuple are marked with a null indexed\nfunction parseParamType(param, allowIndexed) {\n let originalParam = param;\n function throwError(i) {\n logger.throwArgumentError(`unexpected character at position ${i}`, \"param\", param);\n }\n param = param.replace(/\\s/g, \" \");\n function newNode(parent) {\n let node = { type: \"\", name: \"\", parent: parent, state: { allowType: true } };\n if (allowIndexed) {\n node.indexed = false;\n }\n return node;\n }\n let parent = { type: \"\", name: \"\", state: { allowType: true } };\n let node = parent;\n for (let i = 0; i < param.length; i++) {\n let c = param[i];\n switch (c) {\n case \"(\":\n if (node.state.allowType && node.type === \"\") {\n node.type = \"tuple\";\n }\n else if (!node.state.allowParams) {\n throwError(i);\n }\n node.state.allowType = false;\n node.type = verifyType(node.type);\n node.components = [newNode(node)];\n node = node.components[0];\n break;\n case \")\":\n delete node.state;\n if (node.name === \"indexed\") {\n if (!allowIndexed) {\n throwError(i);\n }\n node.indexed = true;\n node.name = \"\";\n }\n if (checkModifier(node.type, node.name)) {\n node.name = \"\";\n }\n node.type = verifyType(node.type);\n let child = node;\n node = node.parent;\n if (!node) {\n throwError(i);\n }\n delete child.parent;\n node.state.allowParams = false;\n node.state.allowName = true;\n node.state.allowArray = true;\n break;\n case \",\":\n delete node.state;\n if (node.name === \"indexed\") {\n if (!allowIndexed) {\n throwError(i);\n }\n node.indexed = true;\n node.name = \"\";\n }\n if (checkModifier(node.type, node.name)) {\n node.name = \"\";\n }\n node.type = verifyType(node.type);\n let sibling = newNode(node.parent);\n //{ type: \"\", name: \"\", parent: node.parent, state: { allowType: true } };\n node.parent.components.push(sibling);\n delete node.parent;\n node = sibling;\n break;\n // Hit a space...\n case \" \":\n // If reading type, the type is done and may read a param or name\n if (node.state.allowType) {\n if (node.type !== \"\") {\n node.type = verifyType(node.type);\n delete node.state.allowType;\n node.state.allowName = true;\n node.state.allowParams = true;\n }\n }\n // If reading name, the name is done\n if (node.state.allowName) {\n if (node.name !== \"\") {\n if (node.name === \"indexed\") {\n if (!allowIndexed) {\n throwError(i);\n }\n if (node.indexed) {\n throwError(i);\n }\n node.indexed = true;\n node.name = \"\";\n }\n else if (checkModifier(node.type, node.name)) {\n node.name = \"\";\n }\n else {\n node.state.allowName = false;\n }\n }\n }\n break;\n case \"[\":\n if (!node.state.allowArray) {\n throwError(i);\n }\n node.type += c;\n node.state.allowArray = false;\n node.state.allowName = false;\n node.state.readArray = true;\n break;\n case \"]\":\n if (!node.state.readArray) {\n throwError(i);\n }\n node.type += c;\n node.state.readArray = false;\n node.state.allowArray = true;\n node.state.allowName = true;\n break;\n default:\n if (node.state.allowType) {\n node.type += c;\n node.state.allowParams = true;\n node.state.allowArray = true;\n }\n else if (node.state.allowName) {\n node.name += c;\n delete node.state.allowArray;\n }\n else if (node.state.readArray) {\n node.type += c;\n }\n else {\n throwError(i);\n }\n }\n }\n if (node.parent) {\n logger.throwArgumentError(\"unexpected eof\", \"param\", param);\n }\n delete parent.state;\n if (node.name === \"indexed\") {\n if (!allowIndexed) {\n throwError(originalParam.length - 7);\n }\n if (node.indexed) {\n throwError(originalParam.length - 7);\n }\n node.indexed = true;\n node.name = \"\";\n }\n else if (checkModifier(node.type, node.name)) {\n node.name = \"\";\n }\n parent.type = verifyType(parent.type);\n return parent;\n}\nfunction populate(object, params) {\n for (let key in params) {\n defineReadOnly(object, key, params[key]);\n }\n}\nexport const FormatTypes = Object.freeze({\n // Bare formatting, as is needed for computing a sighash of an event or function\n sighash: \"sighash\",\n // Human-Readable with Minimal spacing and without names (compact human-readable)\n minimal: \"minimal\",\n // Human-Readable with nice spacing, including all names\n full: \"full\",\n // JSON-format a la Solidity\n json: \"json\"\n});\nconst paramTypeArray = new RegExp(/^(.*)\\[([0-9]*)\\]$/);\nexport class ParamType {\n constructor(constructorGuard, params) {\n if (constructorGuard !== _constructorGuard) {\n logger.throwError(\"use fromString\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"new ParamType()\"\n });\n }\n populate(this, params);\n let match = this.type.match(paramTypeArray);\n if (match) {\n populate(this, {\n arrayLength: parseInt(match[2] || \"-1\"),\n arrayChildren: ParamType.fromObject({\n type: match[1],\n components: this.components\n }),\n baseType: \"array\"\n });\n }\n else {\n populate(this, {\n arrayLength: null,\n arrayChildren: null,\n baseType: ((this.components != null) ? \"tuple\" : this.type)\n });\n }\n this._isParamType = true;\n Object.freeze(this);\n }\n // Format the parameter fragment\n // - sighash: \"(uint256,address)\"\n // - minimal: \"tuple(uint256,address) indexed\"\n // - full: \"tuple(uint256 foo, address bar) indexed baz\"\n format(format) {\n if (!format) {\n format = FormatTypes.sighash;\n }\n if (!FormatTypes[format]) {\n logger.throwArgumentError(\"invalid format type\", \"format\", format);\n }\n if (format === FormatTypes.json) {\n let result = {\n type: ((this.baseType === \"tuple\") ? \"tuple\" : this.type),\n name: (this.name || undefined)\n };\n if (typeof (this.indexed) === \"boolean\") {\n result.indexed = this.indexed;\n }\n if (this.components) {\n result.components = this.components.map((comp) => JSON.parse(comp.format(format)));\n }\n return JSON.stringify(result);\n }\n let result = \"\";\n // Array\n if (this.baseType === \"array\") {\n result += this.arrayChildren.format(format);\n result += \"[\" + (this.arrayLength < 0 ? \"\" : String(this.arrayLength)) + \"]\";\n }\n else {\n if (this.baseType === \"tuple\") {\n if (format !== FormatTypes.sighash) {\n result += this.type;\n }\n result += \"(\" + this.components.map((comp) => comp.format(format)).join((format === FormatTypes.full) ? \", \" : \",\") + \")\";\n }\n else {\n result += this.type;\n }\n }\n if (format !== FormatTypes.sighash) {\n if (this.indexed === true) {\n result += \" indexed\";\n }\n if (format === FormatTypes.full && this.name) {\n result += \" \" + this.name;\n }\n }\n return result;\n }\n static from(value, allowIndexed) {\n if (typeof (value) === \"string\") {\n return ParamType.fromString(value, allowIndexed);\n }\n return ParamType.fromObject(value);\n }\n static fromObject(value) {\n if (ParamType.isParamType(value)) {\n return value;\n }\n return new ParamType(_constructorGuard, {\n name: (value.name || null),\n type: verifyType(value.type),\n indexed: ((value.indexed == null) ? null : !!value.indexed),\n components: (value.components ? value.components.map(ParamType.fromObject) : null)\n });\n }\n static fromString(value, allowIndexed) {\n function ParamTypify(node) {\n return ParamType.fromObject({\n name: node.name,\n type: node.type,\n indexed: node.indexed,\n components: node.components\n });\n }\n return ParamTypify(parseParamType(value, !!allowIndexed));\n }\n static isParamType(value) {\n return !!(value != null && value._isParamType);\n }\n}\n;\nfunction parseParams(value, allowIndex) {\n return splitNesting(value).map((param) => ParamType.fromString(param, allowIndex));\n}\nexport class Fragment {\n constructor(constructorGuard, params) {\n if (constructorGuard !== _constructorGuard) {\n logger.throwError(\"use a static from method\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"new Fragment()\"\n });\n }\n populate(this, params);\n this._isFragment = true;\n Object.freeze(this);\n }\n static from(value) {\n if (Fragment.isFragment(value)) {\n return value;\n }\n if (typeof (value) === \"string\") {\n return Fragment.fromString(value);\n }\n return Fragment.fromObject(value);\n }\n static fromObject(value) {\n if (Fragment.isFragment(value)) {\n return value;\n }\n switch (value.type) {\n case \"function\":\n return FunctionFragment.fromObject(value);\n case \"event\":\n return EventFragment.fromObject(value);\n case \"constructor\":\n return ConstructorFragment.fromObject(value);\n case \"error\":\n return ErrorFragment.fromObject(value);\n case \"fallback\":\n case \"receive\":\n // @TODO: Something? Maybe return a FunctionFragment? A custom DefaultFunctionFragment?\n return null;\n }\n return logger.throwArgumentError(\"invalid fragment object\", \"value\", value);\n }\n static fromString(value) {\n // Make sure the \"returns\" is surrounded by a space and all whitespace is exactly one space\n value = value.replace(/\\s/g, \" \");\n value = value.replace(/\\(/g, \" (\").replace(/\\)/g, \") \").replace(/\\s+/g, \" \");\n value = value.trim();\n if (value.split(\" \")[0] === \"event\") {\n return EventFragment.fromString(value.substring(5).trim());\n }\n else if (value.split(\" \")[0] === \"function\") {\n return FunctionFragment.fromString(value.substring(8).trim());\n }\n else if (value.split(\"(\")[0].trim() === \"constructor\") {\n return ConstructorFragment.fromString(value.trim());\n }\n else if (value.split(\" \")[0] === \"error\") {\n return ErrorFragment.fromString(value.substring(5).trim());\n }\n return logger.throwArgumentError(\"unsupported fragment\", \"value\", value);\n }\n static isFragment(value) {\n return !!(value && value._isFragment);\n }\n}\nexport class EventFragment extends Fragment {\n format(format) {\n if (!format) {\n format = FormatTypes.sighash;\n }\n if (!FormatTypes[format]) {\n logger.throwArgumentError(\"invalid format type\", \"format\", format);\n }\n if (format === FormatTypes.json) {\n return JSON.stringify({\n type: \"event\",\n anonymous: this.anonymous,\n name: this.name,\n inputs: this.inputs.map((input) => JSON.parse(input.format(format)))\n });\n }\n let result = \"\";\n if (format !== FormatTypes.sighash) {\n result += \"event \";\n }\n result += this.name + \"(\" + this.inputs.map((input) => input.format(format)).join((format === FormatTypes.full) ? \", \" : \",\") + \") \";\n if (format !== FormatTypes.sighash) {\n if (this.anonymous) {\n result += \"anonymous \";\n }\n }\n return result.trim();\n }\n static from(value) {\n if (typeof (value) === \"string\") {\n return EventFragment.fromString(value);\n }\n return EventFragment.fromObject(value);\n }\n static fromObject(value) {\n if (EventFragment.isEventFragment(value)) {\n return value;\n }\n if (value.type !== \"event\") {\n logger.throwArgumentError(\"invalid event object\", \"value\", value);\n }\n const params = {\n name: verifyIdentifier(value.name),\n anonymous: value.anonymous,\n inputs: (value.inputs ? value.inputs.map(ParamType.fromObject) : []),\n type: \"event\"\n };\n return new EventFragment(_constructorGuard, params);\n }\n static fromString(value) {\n let match = value.match(regexParen);\n if (!match) {\n logger.throwArgumentError(\"invalid event string\", \"value\", value);\n }\n let anonymous = false;\n match[3].split(\" \").forEach((modifier) => {\n switch (modifier.trim()) {\n case \"anonymous\":\n anonymous = true;\n break;\n case \"\":\n break;\n default:\n logger.warn(\"unknown modifier: \" + modifier);\n }\n });\n return EventFragment.fromObject({\n name: match[1].trim(),\n anonymous: anonymous,\n inputs: parseParams(match[2], true),\n type: \"event\"\n });\n }\n static isEventFragment(value) {\n return (value && value._isFragment && value.type === \"event\");\n }\n}\nfunction parseGas(value, params) {\n params.gas = null;\n let comps = value.split(\"@\");\n if (comps.length !== 1) {\n if (comps.length > 2) {\n logger.throwArgumentError(\"invalid human-readable ABI signature\", \"value\", value);\n }\n if (!comps[1].match(/^[0-9]+$/)) {\n logger.throwArgumentError(\"invalid human-readable ABI signature gas\", \"value\", value);\n }\n params.gas = BigNumber.from(comps[1]);\n return comps[0];\n }\n return value;\n}\nfunction parseModifiers(value, params) {\n params.constant = false;\n params.payable = false;\n params.stateMutability = \"nonpayable\";\n value.split(\" \").forEach((modifier) => {\n switch (modifier.trim()) {\n case \"constant\":\n params.constant = true;\n break;\n case \"payable\":\n params.payable = true;\n params.stateMutability = \"payable\";\n break;\n case \"nonpayable\":\n params.payable = false;\n params.stateMutability = \"nonpayable\";\n break;\n case \"pure\":\n params.constant = true;\n params.stateMutability = \"pure\";\n break;\n case \"view\":\n params.constant = true;\n params.stateMutability = \"view\";\n break;\n case \"external\":\n case \"public\":\n case \"\":\n break;\n default:\n console.log(\"unknown modifier: \" + modifier);\n }\n });\n}\nfunction verifyState(value) {\n let result = {\n constant: false,\n payable: true,\n stateMutability: \"payable\"\n };\n if (value.stateMutability != null) {\n result.stateMutability = value.stateMutability;\n // Set (and check things are consistent) the constant property\n result.constant = (result.stateMutability === \"view\" || result.stateMutability === \"pure\");\n if (value.constant != null) {\n if ((!!value.constant) !== result.constant) {\n logger.throwArgumentError(\"cannot have constant function with mutability \" + result.stateMutability, \"value\", value);\n }\n }\n // Set (and check things are consistent) the payable property\n result.payable = (result.stateMutability === \"payable\");\n if (value.payable != null) {\n if ((!!value.payable) !== result.payable) {\n logger.throwArgumentError(\"cannot have payable function with mutability \" + result.stateMutability, \"value\", value);\n }\n }\n }\n else if (value.payable != null) {\n result.payable = !!value.payable;\n // If payable we can assume non-constant; otherwise we can't assume\n if (value.constant == null && !result.payable && value.type !== \"constructor\") {\n logger.throwArgumentError(\"unable to determine stateMutability\", \"value\", value);\n }\n result.constant = !!value.constant;\n if (result.constant) {\n result.stateMutability = \"view\";\n }\n else {\n result.stateMutability = (result.payable ? \"payable\" : \"nonpayable\");\n }\n if (result.payable && result.constant) {\n logger.throwArgumentError(\"cannot have constant payable function\", \"value\", value);\n }\n }\n else if (value.constant != null) {\n result.constant = !!value.constant;\n result.payable = !result.constant;\n result.stateMutability = (result.constant ? \"view\" : \"payable\");\n }\n else if (value.type !== \"constructor\") {\n logger.throwArgumentError(\"unable to determine stateMutability\", \"value\", value);\n }\n return result;\n}\nexport class ConstructorFragment extends Fragment {\n format(format) {\n if (!format) {\n format = FormatTypes.sighash;\n }\n if (!FormatTypes[format]) {\n logger.throwArgumentError(\"invalid format type\", \"format\", format);\n }\n if (format === FormatTypes.json) {\n return JSON.stringify({\n type: \"constructor\",\n stateMutability: ((this.stateMutability !== \"nonpayable\") ? this.stateMutability : undefined),\n payable: this.payable,\n gas: (this.gas ? this.gas.toNumber() : undefined),\n inputs: this.inputs.map((input) => JSON.parse(input.format(format)))\n });\n }\n if (format === FormatTypes.sighash) {\n logger.throwError(\"cannot format a constructor for sighash\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"format(sighash)\"\n });\n }\n let result = \"constructor(\" + this.inputs.map((input) => input.format(format)).join((format === FormatTypes.full) ? \", \" : \",\") + \") \";\n if (this.stateMutability && this.stateMutability !== \"nonpayable\") {\n result += this.stateMutability + \" \";\n }\n return result.trim();\n }\n static from(value) {\n if (typeof (value) === \"string\") {\n return ConstructorFragment.fromString(value);\n }\n return ConstructorFragment.fromObject(value);\n }\n static fromObject(value) {\n if (ConstructorFragment.isConstructorFragment(value)) {\n return value;\n }\n if (value.type !== \"constructor\") {\n logger.throwArgumentError(\"invalid constructor object\", \"value\", value);\n }\n let state = verifyState(value);\n if (state.constant) {\n logger.throwArgumentError(\"constructor cannot be constant\", \"value\", value);\n }\n const params = {\n name: null,\n type: value.type,\n inputs: (value.inputs ? value.inputs.map(ParamType.fromObject) : []),\n payable: state.payable,\n stateMutability: state.stateMutability,\n gas: (value.gas ? BigNumber.from(value.gas) : null)\n };\n return new ConstructorFragment(_constructorGuard, params);\n }\n static fromString(value) {\n let params = { type: \"constructor\" };\n value = parseGas(value, params);\n let parens = value.match(regexParen);\n if (!parens || parens[1].trim() !== \"constructor\") {\n logger.throwArgumentError(\"invalid constructor string\", \"value\", value);\n }\n params.inputs = parseParams(parens[2].trim(), false);\n parseModifiers(parens[3].trim(), params);\n return ConstructorFragment.fromObject(params);\n }\n static isConstructorFragment(value) {\n return (value && value._isFragment && value.type === \"constructor\");\n }\n}\nexport class FunctionFragment extends ConstructorFragment {\n format(format) {\n if (!format) {\n format = FormatTypes.sighash;\n }\n if (!FormatTypes[format]) {\n logger.throwArgumentError(\"invalid format type\", \"format\", format);\n }\n if (format === FormatTypes.json) {\n return JSON.stringify({\n type: \"function\",\n name: this.name,\n constant: this.constant,\n stateMutability: ((this.stateMutability !== \"nonpayable\") ? this.stateMutability : undefined),\n payable: this.payable,\n gas: (this.gas ? this.gas.toNumber() : undefined),\n inputs: this.inputs.map((input) => JSON.parse(input.format(format))),\n outputs: this.outputs.map((output) => JSON.parse(output.format(format))),\n });\n }\n let result = \"\";\n if (format !== FormatTypes.sighash) {\n result += \"function \";\n }\n result += this.name + \"(\" + this.inputs.map((input) => input.format(format)).join((format === FormatTypes.full) ? \", \" : \",\") + \") \";\n if (format !== FormatTypes.sighash) {\n if (this.stateMutability) {\n if (this.stateMutability !== \"nonpayable\") {\n result += (this.stateMutability + \" \");\n }\n }\n else if (this.constant) {\n result += \"view \";\n }\n if (this.outputs && this.outputs.length) {\n result += \"returns (\" + this.outputs.map((output) => output.format(format)).join(\", \") + \") \";\n }\n if (this.gas != null) {\n result += \"@\" + this.gas.toString() + \" \";\n }\n }\n return result.trim();\n }\n static from(value) {\n if (typeof (value) === \"string\") {\n return FunctionFragment.fromString(value);\n }\n return FunctionFragment.fromObject(value);\n }\n static fromObject(value) {\n if (FunctionFragment.isFunctionFragment(value)) {\n return value;\n }\n if (value.type !== \"function\") {\n logger.throwArgumentError(\"invalid function object\", \"value\", value);\n }\n let state = verifyState(value);\n const params = {\n type: value.type,\n name: verifyIdentifier(value.name),\n constant: state.constant,\n inputs: (value.inputs ? value.inputs.map(ParamType.fromObject) : []),\n outputs: (value.outputs ? value.outputs.map(ParamType.fromObject) : []),\n payable: state.payable,\n stateMutability: state.stateMutability,\n gas: (value.gas ? BigNumber.from(value.gas) : null)\n };\n return new FunctionFragment(_constructorGuard, params);\n }\n static fromString(value) {\n let params = { type: \"function\" };\n value = parseGas(value, params);\n let comps = value.split(\" returns \");\n if (comps.length > 2) {\n logger.throwArgumentError(\"invalid function string\", \"value\", value);\n }\n let parens = comps[0].match(regexParen);\n if (!parens) {\n logger.throwArgumentError(\"invalid function signature\", \"value\", value);\n }\n params.name = parens[1].trim();\n if (params.name) {\n verifyIdentifier(params.name);\n }\n params.inputs = parseParams(parens[2], false);\n parseModifiers(parens[3].trim(), params);\n // We have outputs\n if (comps.length > 1) {\n let returns = comps[1].match(regexParen);\n if (returns[1].trim() != \"\" || returns[3].trim() != \"\") {\n logger.throwArgumentError(\"unexpected tokens\", \"value\", value);\n }\n params.outputs = parseParams(returns[2], false);\n }\n else {\n params.outputs = [];\n }\n return FunctionFragment.fromObject(params);\n }\n static isFunctionFragment(value) {\n return (value && value._isFragment && value.type === \"function\");\n }\n}\n//export class StructFragment extends Fragment {\n//}\nfunction checkForbidden(fragment) {\n const sig = fragment.format();\n if (sig === \"Error(string)\" || sig === \"Panic(uint256)\") {\n logger.throwArgumentError(`cannot specify user defined ${sig} error`, \"fragment\", fragment);\n }\n return fragment;\n}\nexport class ErrorFragment extends Fragment {\n format(format) {\n if (!format) {\n format = FormatTypes.sighash;\n }\n if (!FormatTypes[format]) {\n logger.throwArgumentError(\"invalid format type\", \"format\", format);\n }\n if (format === FormatTypes.json) {\n return JSON.stringify({\n type: \"error\",\n name: this.name,\n inputs: this.inputs.map((input) => JSON.parse(input.format(format))),\n });\n }\n let result = \"\";\n if (format !== FormatTypes.sighash) {\n result += \"error \";\n }\n result += this.name + \"(\" + this.inputs.map((input) => input.format(format)).join((format === FormatTypes.full) ? \", \" : \",\") + \") \";\n return result.trim();\n }\n static from(value) {\n if (typeof (value) === \"string\") {\n return ErrorFragment.fromString(value);\n }\n return ErrorFragment.fromObject(value);\n }\n static fromObject(value) {\n if (ErrorFragment.isErrorFragment(value)) {\n return value;\n }\n if (value.type !== \"error\") {\n logger.throwArgumentError(\"invalid error object\", \"value\", value);\n }\n const params = {\n type: value.type,\n name: verifyIdentifier(value.name),\n inputs: (value.inputs ? value.inputs.map(ParamType.fromObject) : [])\n };\n return checkForbidden(new ErrorFragment(_constructorGuard, params));\n }\n static fromString(value) {\n let params = { type: \"error\" };\n let parens = value.match(regexParen);\n if (!parens) {\n logger.throwArgumentError(\"invalid error signature\", \"value\", value);\n }\n params.name = parens[1].trim();\n if (params.name) {\n verifyIdentifier(params.name);\n }\n params.inputs = parseParams(parens[2], false);\n return checkForbidden(ErrorFragment.fromObject(params));\n }\n static isErrorFragment(value) {\n return (value && value._isFragment && value.type === \"error\");\n }\n}\nfunction verifyType(type) {\n // These need to be transformed to their full description\n if (type.match(/^uint($|[^1-9])/)) {\n type = \"uint256\" + type.substring(4);\n }\n else if (type.match(/^int($|[^1-9])/)) {\n type = \"int256\" + type.substring(3);\n }\n // @TODO: more verification\n return type;\n}\n// See: https://github.com/ethereum/solidity/blob/1f8f1a3db93a548d0555e3e14cfc55a10e25b60e/docs/grammar/SolidityLexer.g4#L234\nconst regexIdentifier = new RegExp(\"^[a-zA-Z$_][a-zA-Z0-9$_]*$\");\nfunction verifyIdentifier(value) {\n if (!value || !value.match(regexIdentifier)) {\n logger.throwArgumentError(`invalid identifier \"${value}\"`, \"value\", value);\n }\n return value;\n}\nconst regexParen = new RegExp(\"^([^)(]*)\\\\((.*)\\\\)([^)(]*)$\");\nfunction splitNesting(value) {\n value = value.trim();\n let result = [];\n let accum = \"\";\n let depth = 0;\n for (let offset = 0; offset < value.length; offset++) {\n let c = value[offset];\n if (c === \",\" && depth === 0) {\n result.push(accum);\n accum = \"\";\n }\n else {\n accum += c;\n if (c === \"(\") {\n depth++;\n }\n else if (c === \")\") {\n depth--;\n if (depth === -1) {\n logger.throwArgumentError(\"unbalanced parenthesis\", \"value\", value);\n }\n }\n }\n }\n if (accum) {\n result.push(accum);\n }\n return result;\n}\n//# sourceMappingURL=fragments.js.map","\"use strict\";\nimport { arrayify, concat, hexConcat, hexlify } from \"@ethersproject/bytes\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"../_version\";\nconst logger = new Logger(version);\nexport function checkResultErrors(result) {\n // Find the first error (if any)\n const errors = [];\n const checkErrors = function (path, object) {\n if (!Array.isArray(object)) {\n return;\n }\n for (let key in object) {\n const childPath = path.slice();\n childPath.push(key);\n try {\n checkErrors(childPath, object[key]);\n }\n catch (error) {\n errors.push({ path: childPath, error: error });\n }\n }\n };\n checkErrors([], result);\n return errors;\n}\nexport class Coder {\n constructor(name, type, localName, dynamic) {\n // @TODO: defineReadOnly these\n this.name = name;\n this.type = type;\n this.localName = localName;\n this.dynamic = dynamic;\n }\n _throwError(message, value) {\n logger.throwArgumentError(message, this.localName, value);\n }\n}\nexport class Writer {\n constructor(wordSize) {\n defineReadOnly(this, \"wordSize\", wordSize || 32);\n this._data = [];\n this._dataLength = 0;\n this._padding = new Uint8Array(wordSize);\n }\n get data() {\n return hexConcat(this._data);\n }\n get length() { return this._dataLength; }\n _writeData(data) {\n this._data.push(data);\n this._dataLength += data.length;\n return data.length;\n }\n appendWriter(writer) {\n return this._writeData(concat(writer._data));\n }\n // Arrayish items; padded on the right to wordSize\n writeBytes(value) {\n let bytes = arrayify(value);\n const paddingOffset = bytes.length % this.wordSize;\n if (paddingOffset) {\n bytes = concat([bytes, this._padding.slice(paddingOffset)]);\n }\n return this._writeData(bytes);\n }\n _getValue(value) {\n let bytes = arrayify(BigNumber.from(value));\n if (bytes.length > this.wordSize) {\n logger.throwError(\"value out-of-bounds\", Logger.errors.BUFFER_OVERRUN, {\n length: this.wordSize,\n offset: bytes.length\n });\n }\n if (bytes.length % this.wordSize) {\n bytes = concat([this._padding.slice(bytes.length % this.wordSize), bytes]);\n }\n return bytes;\n }\n // BigNumberish items; padded on the left to wordSize\n writeValue(value) {\n return this._writeData(this._getValue(value));\n }\n writeUpdatableValue() {\n const offset = this._data.length;\n this._data.push(this._padding);\n this._dataLength += this.wordSize;\n return (value) => {\n this._data[offset] = this._getValue(value);\n };\n }\n}\nexport class Reader {\n constructor(data, wordSize, coerceFunc, allowLoose) {\n defineReadOnly(this, \"_data\", arrayify(data));\n defineReadOnly(this, \"wordSize\", wordSize || 32);\n defineReadOnly(this, \"_coerceFunc\", coerceFunc);\n defineReadOnly(this, \"allowLoose\", allowLoose);\n this._offset = 0;\n }\n get data() { return hexlify(this._data); }\n get consumed() { return this._offset; }\n // The default Coerce function\n static coerce(name, value) {\n let match = name.match(\"^u?int([0-9]+)$\");\n if (match && parseInt(match[1]) <= 48) {\n value = value.toNumber();\n }\n return value;\n }\n coerce(name, value) {\n if (this._coerceFunc) {\n return this._coerceFunc(name, value);\n }\n return Reader.coerce(name, value);\n }\n _peekBytes(offset, length, loose) {\n let alignedLength = Math.ceil(length / this.wordSize) * this.wordSize;\n if (this._offset + alignedLength > this._data.length) {\n if (this.allowLoose && loose && this._offset + length <= this._data.length) {\n alignedLength = length;\n }\n else {\n logger.throwError(\"data out-of-bounds\", Logger.errors.BUFFER_OVERRUN, {\n length: this._data.length,\n offset: this._offset + alignedLength\n });\n }\n }\n return this._data.slice(this._offset, this._offset + alignedLength);\n }\n subReader(offset) {\n return new Reader(this._data.slice(this._offset + offset), this.wordSize, this._coerceFunc, this.allowLoose);\n }\n readBytes(length, loose) {\n let bytes = this._peekBytes(0, length, !!loose);\n this._offset += bytes.length;\n // @TODO: Make sure the length..end bytes are all 0?\n return bytes.slice(0, length);\n }\n readValue() {\n return BigNumber.from(this.readBytes(this.wordSize));\n }\n}\n//# sourceMappingURL=abstract-coder.js.map","/**\n * [js-sha3]{@link https://github.com/emn178/js-sha3}\n *\n * @version 0.8.0\n * @author Chen, Yi-Cyuan [emn178@gmail.com]\n * @copyright Chen, Yi-Cyuan 2015-2018\n * @license MIT\n */\n/*jslint bitwise: true */\n(function () {\n 'use strict';\n\n var INPUT_ERROR = 'input is invalid type';\n var FINALIZE_ERROR = 'finalize already called';\n var WINDOW = typeof window === 'object';\n var root = WINDOW ? window : {};\n if (root.JS_SHA3_NO_WINDOW) {\n WINDOW = false;\n }\n var WEB_WORKER = !WINDOW && typeof self === 'object';\n var NODE_JS = !root.JS_SHA3_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;\n if (NODE_JS) {\n root = global;\n } else if (WEB_WORKER) {\n root = self;\n }\n var COMMON_JS = !root.JS_SHA3_NO_COMMON_JS && typeof module === 'object' && module.exports;\n var AMD = typeof define === 'function' && define.amd;\n var ARRAY_BUFFER = !root.JS_SHA3_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined';\n var HEX_CHARS = '0123456789abcdef'.split('');\n var SHAKE_PADDING = [31, 7936, 2031616, 520093696];\n var CSHAKE_PADDING = [4, 1024, 262144, 67108864];\n var KECCAK_PADDING = [1, 256, 65536, 16777216];\n var PADDING = [6, 1536, 393216, 100663296];\n var SHIFT = [0, 8, 16, 24];\n var RC = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649,\n 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0,\n 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771,\n 2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648,\n 2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648];\n var BITS = [224, 256, 384, 512];\n var SHAKE_BITS = [128, 256];\n var OUTPUT_TYPES = ['hex', 'buffer', 'arrayBuffer', 'array', 'digest'];\n var CSHAKE_BYTEPAD = {\n '128': 168,\n '256': 136\n };\n\n if (root.JS_SHA3_NO_NODE_JS || !Array.isArray) {\n Array.isArray = function (obj) {\n return Object.prototype.toString.call(obj) === '[object Array]';\n };\n }\n\n if (ARRAY_BUFFER && (root.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) {\n ArrayBuffer.isView = function (obj) {\n return typeof obj === 'object' && obj.buffer && obj.buffer.constructor === ArrayBuffer;\n };\n }\n\n var createOutputMethod = function (bits, padding, outputType) {\n return function (message) {\n return new Keccak(bits, padding, bits).update(message)[outputType]();\n };\n };\n\n var createShakeOutputMethod = function (bits, padding, outputType) {\n return function (message, outputBits) {\n return new Keccak(bits, padding, outputBits).update(message)[outputType]();\n };\n };\n\n var createCshakeOutputMethod = function (bits, padding, outputType) {\n return function (message, outputBits, n, s) {\n return methods['cshake' + bits].update(message, outputBits, n, s)[outputType]();\n };\n };\n\n var createKmacOutputMethod = function (bits, padding, outputType) {\n return function (key, message, outputBits, s) {\n return methods['kmac' + bits].update(key, message, outputBits, s)[outputType]();\n };\n };\n\n var createOutputMethods = function (method, createMethod, bits, padding) {\n for (var i = 0; i < OUTPUT_TYPES.length; ++i) {\n var type = OUTPUT_TYPES[i];\n method[type] = createMethod(bits, padding, type);\n }\n return method;\n };\n\n var createMethod = function (bits, padding) {\n var method = createOutputMethod(bits, padding, 'hex');\n method.create = function () {\n return new Keccak(bits, padding, bits);\n };\n method.update = function (message) {\n return method.create().update(message);\n };\n return createOutputMethods(method, createOutputMethod, bits, padding);\n };\n\n var createShakeMethod = function (bits, padding) {\n var method = createShakeOutputMethod(bits, padding, 'hex');\n method.create = function (outputBits) {\n return new Keccak(bits, padding, outputBits);\n };\n method.update = function (message, outputBits) {\n return method.create(outputBits).update(message);\n };\n return createOutputMethods(method, createShakeOutputMethod, bits, padding);\n };\n\n var createCshakeMethod = function (bits, padding) {\n var w = CSHAKE_BYTEPAD[bits];\n var method = createCshakeOutputMethod(bits, padding, 'hex');\n method.create = function (outputBits, n, s) {\n if (!n && !s) {\n return methods['shake' + bits].create(outputBits);\n } else {\n return new Keccak(bits, padding, outputBits).bytepad([n, s], w);\n }\n };\n method.update = function (message, outputBits, n, s) {\n return method.create(outputBits, n, s).update(message);\n };\n return createOutputMethods(method, createCshakeOutputMethod, bits, padding);\n };\n\n var createKmacMethod = function (bits, padding) {\n var w = CSHAKE_BYTEPAD[bits];\n var method = createKmacOutputMethod(bits, padding, 'hex');\n method.create = function (key, outputBits, s) {\n return new Kmac(bits, padding, outputBits).bytepad(['KMAC', s], w).bytepad([key], w);\n };\n method.update = function (key, message, outputBits, s) {\n return method.create(key, outputBits, s).update(message);\n };\n return createOutputMethods(method, createKmacOutputMethod, bits, padding);\n };\n\n var algorithms = [\n { name: 'keccak', padding: KECCAK_PADDING, bits: BITS, createMethod: createMethod },\n { name: 'sha3', padding: PADDING, bits: BITS, createMethod: createMethod },\n { name: 'shake', padding: SHAKE_PADDING, bits: SHAKE_BITS, createMethod: createShakeMethod },\n { name: 'cshake', padding: CSHAKE_PADDING, bits: SHAKE_BITS, createMethod: createCshakeMethod },\n { name: 'kmac', padding: CSHAKE_PADDING, bits: SHAKE_BITS, createMethod: createKmacMethod }\n ];\n\n var methods = {}, methodNames = [];\n\n for (var i = 0; i < algorithms.length; ++i) {\n var algorithm = algorithms[i];\n var bits = algorithm.bits;\n for (var j = 0; j < bits.length; ++j) {\n var methodName = algorithm.name + '_' + bits[j];\n methodNames.push(methodName);\n methods[methodName] = algorithm.createMethod(bits[j], algorithm.padding);\n if (algorithm.name !== 'sha3') {\n var newMethodName = algorithm.name + bits[j];\n methodNames.push(newMethodName);\n methods[newMethodName] = methods[methodName];\n }\n }\n }\n\n function Keccak(bits, padding, outputBits) {\n this.blocks = [];\n this.s = [];\n this.padding = padding;\n this.outputBits = outputBits;\n this.reset = true;\n this.finalized = false;\n this.block = 0;\n this.start = 0;\n this.blockCount = (1600 - (bits << 1)) >> 5;\n this.byteCount = this.blockCount << 2;\n this.outputBlocks = outputBits >> 5;\n this.extraBytes = (outputBits & 31) >> 3;\n\n for (var i = 0; i < 50; ++i) {\n this.s[i] = 0;\n }\n }\n\n Keccak.prototype.update = function (message) {\n if (this.finalized) {\n throw new Error(FINALIZE_ERROR);\n }\n var notString, type = typeof message;\n if (type !== 'string') {\n if (type === 'object') {\n if (message === null) {\n throw new Error(INPUT_ERROR);\n } else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {\n message = new Uint8Array(message);\n } else if (!Array.isArray(message)) {\n if (!ARRAY_BUFFER || !ArrayBuffer.isView(message)) {\n throw new Error(INPUT_ERROR);\n }\n }\n } else {\n throw new Error(INPUT_ERROR);\n }\n notString = true;\n }\n var blocks = this.blocks, byteCount = this.byteCount, length = message.length,\n blockCount = this.blockCount, index = 0, s = this.s, i, code;\n\n while (index < length) {\n if (this.reset) {\n this.reset = false;\n blocks[0] = this.block;\n for (i = 1; i < blockCount + 1; ++i) {\n blocks[i] = 0;\n }\n }\n if (notString) {\n for (i = this.start; index < length && i < byteCount; ++index) {\n blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];\n }\n } else {\n for (i = this.start; index < length && i < byteCount; ++index) {\n code = message.charCodeAt(index);\n if (code < 0x80) {\n blocks[i >> 2] |= code << SHIFT[i++ & 3];\n } else if (code < 0x800) {\n blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else if (code < 0xd800 || code >= 0xe000) {\n blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else {\n code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));\n blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n }\n }\n }\n this.lastByteIndex = i;\n if (i >= byteCount) {\n this.start = i - byteCount;\n this.block = blocks[blockCount];\n for (i = 0; i < blockCount; ++i) {\n s[i] ^= blocks[i];\n }\n f(s);\n this.reset = true;\n } else {\n this.start = i;\n }\n }\n return this;\n };\n\n Keccak.prototype.encode = function (x, right) {\n var o = x & 255, n = 1;\n var bytes = [o];\n x = x >> 8;\n o = x & 255;\n while (o > 0) {\n bytes.unshift(o);\n x = x >> 8;\n o = x & 255;\n ++n;\n }\n if (right) {\n bytes.push(n);\n } else {\n bytes.unshift(n);\n }\n this.update(bytes);\n return bytes.length;\n };\n\n Keccak.prototype.encodeString = function (str) {\n var notString, type = typeof str;\n if (type !== 'string') {\n if (type === 'object') {\n if (str === null) {\n throw new Error(INPUT_ERROR);\n } else if (ARRAY_BUFFER && str.constructor === ArrayBuffer) {\n str = new Uint8Array(str);\n } else if (!Array.isArray(str)) {\n if (!ARRAY_BUFFER || !ArrayBuffer.isView(str)) {\n throw new Error(INPUT_ERROR);\n }\n }\n } else {\n throw new Error(INPUT_ERROR);\n }\n notString = true;\n }\n var bytes = 0, length = str.length;\n if (notString) {\n bytes = length;\n } else {\n for (var i = 0; i < str.length; ++i) {\n var code = str.charCodeAt(i);\n if (code < 0x80) {\n bytes += 1;\n } else if (code < 0x800) {\n bytes += 2;\n } else if (code < 0xd800 || code >= 0xe000) {\n bytes += 3;\n } else {\n code = 0x10000 + (((code & 0x3ff) << 10) | (str.charCodeAt(++i) & 0x3ff));\n bytes += 4;\n }\n }\n }\n bytes += this.encode(bytes * 8);\n this.update(str);\n return bytes;\n };\n\n Keccak.prototype.bytepad = function (strs, w) {\n var bytes = this.encode(w);\n for (var i = 0; i < strs.length; ++i) {\n bytes += this.encodeString(strs[i]);\n }\n var paddingBytes = w - bytes % w;\n var zeros = [];\n zeros.length = paddingBytes;\n this.update(zeros);\n return this;\n };\n\n Keccak.prototype.finalize = function () {\n if (this.finalized) {\n return;\n }\n this.finalized = true;\n var blocks = this.blocks, i = this.lastByteIndex, blockCount = this.blockCount, s = this.s;\n blocks[i >> 2] |= this.padding[i & 3];\n if (this.lastByteIndex === this.byteCount) {\n blocks[0] = blocks[blockCount];\n for (i = 1; i < blockCount + 1; ++i) {\n blocks[i] = 0;\n }\n }\n blocks[blockCount - 1] |= 0x80000000;\n for (i = 0; i < blockCount; ++i) {\n s[i] ^= blocks[i];\n }\n f(s);\n };\n\n Keccak.prototype.toString = Keccak.prototype.hex = function () {\n this.finalize();\n\n var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,\n extraBytes = this.extraBytes, i = 0, j = 0;\n var hex = '', block;\n while (j < outputBlocks) {\n for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\n block = s[i];\n hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F] +\n HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F] +\n HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F] +\n HEX_CHARS[(block >> 28) & 0x0F] + HEX_CHARS[(block >> 24) & 0x0F];\n }\n if (j % blockCount === 0) {\n f(s);\n i = 0;\n }\n }\n if (extraBytes) {\n block = s[i];\n hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F];\n if (extraBytes > 1) {\n hex += HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F];\n }\n if (extraBytes > 2) {\n hex += HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F];\n }\n }\n return hex;\n };\n\n Keccak.prototype.arrayBuffer = function () {\n this.finalize();\n\n var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,\n extraBytes = this.extraBytes, i = 0, j = 0;\n var bytes = this.outputBits >> 3;\n var buffer;\n if (extraBytes) {\n buffer = new ArrayBuffer((outputBlocks + 1) << 2);\n } else {\n buffer = new ArrayBuffer(bytes);\n }\n var array = new Uint32Array(buffer);\n while (j < outputBlocks) {\n for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\n array[j] = s[i];\n }\n if (j % blockCount === 0) {\n f(s);\n }\n }\n if (extraBytes) {\n array[i] = s[i];\n buffer = buffer.slice(0, bytes);\n }\n return buffer;\n };\n\n Keccak.prototype.buffer = Keccak.prototype.arrayBuffer;\n\n Keccak.prototype.digest = Keccak.prototype.array = function () {\n this.finalize();\n\n var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,\n extraBytes = this.extraBytes, i = 0, j = 0;\n var array = [], offset, block;\n while (j < outputBlocks) {\n for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\n offset = j << 2;\n block = s[i];\n array[offset] = block & 0xFF;\n array[offset + 1] = (block >> 8) & 0xFF;\n array[offset + 2] = (block >> 16) & 0xFF;\n array[offset + 3] = (block >> 24) & 0xFF;\n }\n if (j % blockCount === 0) {\n f(s);\n }\n }\n if (extraBytes) {\n offset = j << 2;\n block = s[i];\n array[offset] = block & 0xFF;\n if (extraBytes > 1) {\n array[offset + 1] = (block >> 8) & 0xFF;\n }\n if (extraBytes > 2) {\n array[offset + 2] = (block >> 16) & 0xFF;\n }\n }\n return array;\n };\n\n function Kmac(bits, padding, outputBits) {\n Keccak.call(this, bits, padding, outputBits);\n }\n\n Kmac.prototype = new Keccak();\n\n Kmac.prototype.finalize = function () {\n this.encode(this.outputBits, true);\n return Keccak.prototype.finalize.call(this);\n };\n\n var f = function (s) {\n var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9,\n b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17,\n b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33,\n b34, b35, b36, b37, b38, b39, b40, b41, b42, b43, b44, b45, b46, b47, b48, b49;\n for (n = 0; n < 48; n += 2) {\n c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40];\n c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41];\n c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42];\n c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43];\n c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44];\n c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45];\n c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46];\n c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47];\n c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48];\n c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49];\n\n h = c8 ^ ((c2 << 1) | (c3 >>> 31));\n l = c9 ^ ((c3 << 1) | (c2 >>> 31));\n s[0] ^= h;\n s[1] ^= l;\n s[10] ^= h;\n s[11] ^= l;\n s[20] ^= h;\n s[21] ^= l;\n s[30] ^= h;\n s[31] ^= l;\n s[40] ^= h;\n s[41] ^= l;\n h = c0 ^ ((c4 << 1) | (c5 >>> 31));\n l = c1 ^ ((c5 << 1) | (c4 >>> 31));\n s[2] ^= h;\n s[3] ^= l;\n s[12] ^= h;\n s[13] ^= l;\n s[22] ^= h;\n s[23] ^= l;\n s[32] ^= h;\n s[33] ^= l;\n s[42] ^= h;\n s[43] ^= l;\n h = c2 ^ ((c6 << 1) | (c7 >>> 31));\n l = c3 ^ ((c7 << 1) | (c6 >>> 31));\n s[4] ^= h;\n s[5] ^= l;\n s[14] ^= h;\n s[15] ^= l;\n s[24] ^= h;\n s[25] ^= l;\n s[34] ^= h;\n s[35] ^= l;\n s[44] ^= h;\n s[45] ^= l;\n h = c4 ^ ((c8 << 1) | (c9 >>> 31));\n l = c5 ^ ((c9 << 1) | (c8 >>> 31));\n s[6] ^= h;\n s[7] ^= l;\n s[16] ^= h;\n s[17] ^= l;\n s[26] ^= h;\n s[27] ^= l;\n s[36] ^= h;\n s[37] ^= l;\n s[46] ^= h;\n s[47] ^= l;\n h = c6 ^ ((c0 << 1) | (c1 >>> 31));\n l = c7 ^ ((c1 << 1) | (c0 >>> 31));\n s[8] ^= h;\n s[9] ^= l;\n s[18] ^= h;\n s[19] ^= l;\n s[28] ^= h;\n s[29] ^= l;\n s[38] ^= h;\n s[39] ^= l;\n s[48] ^= h;\n s[49] ^= l;\n\n b0 = s[0];\n b1 = s[1];\n b32 = (s[11] << 4) | (s[10] >>> 28);\n b33 = (s[10] << 4) | (s[11] >>> 28);\n b14 = (s[20] << 3) | (s[21] >>> 29);\n b15 = (s[21] << 3) | (s[20] >>> 29);\n b46 = (s[31] << 9) | (s[30] >>> 23);\n b47 = (s[30] << 9) | (s[31] >>> 23);\n b28 = (s[40] << 18) | (s[41] >>> 14);\n b29 = (s[41] << 18) | (s[40] >>> 14);\n b20 = (s[2] << 1) | (s[3] >>> 31);\n b21 = (s[3] << 1) | (s[2] >>> 31);\n b2 = (s[13] << 12) | (s[12] >>> 20);\n b3 = (s[12] << 12) | (s[13] >>> 20);\n b34 = (s[22] << 10) | (s[23] >>> 22);\n b35 = (s[23] << 10) | (s[22] >>> 22);\n b16 = (s[33] << 13) | (s[32] >>> 19);\n b17 = (s[32] << 13) | (s[33] >>> 19);\n b48 = (s[42] << 2) | (s[43] >>> 30);\n b49 = (s[43] << 2) | (s[42] >>> 30);\n b40 = (s[5] << 30) | (s[4] >>> 2);\n b41 = (s[4] << 30) | (s[5] >>> 2);\n b22 = (s[14] << 6) | (s[15] >>> 26);\n b23 = (s[15] << 6) | (s[14] >>> 26);\n b4 = (s[25] << 11) | (s[24] >>> 21);\n b5 = (s[24] << 11) | (s[25] >>> 21);\n b36 = (s[34] << 15) | (s[35] >>> 17);\n b37 = (s[35] << 15) | (s[34] >>> 17);\n b18 = (s[45] << 29) | (s[44] >>> 3);\n b19 = (s[44] << 29) | (s[45] >>> 3);\n b10 = (s[6] << 28) | (s[7] >>> 4);\n b11 = (s[7] << 28) | (s[6] >>> 4);\n b42 = (s[17] << 23) | (s[16] >>> 9);\n b43 = (s[16] << 23) | (s[17] >>> 9);\n b24 = (s[26] << 25) | (s[27] >>> 7);\n b25 = (s[27] << 25) | (s[26] >>> 7);\n b6 = (s[36] << 21) | (s[37] >>> 11);\n b7 = (s[37] << 21) | (s[36] >>> 11);\n b38 = (s[47] << 24) | (s[46] >>> 8);\n b39 = (s[46] << 24) | (s[47] >>> 8);\n b30 = (s[8] << 27) | (s[9] >>> 5);\n b31 = (s[9] << 27) | (s[8] >>> 5);\n b12 = (s[18] << 20) | (s[19] >>> 12);\n b13 = (s[19] << 20) | (s[18] >>> 12);\n b44 = (s[29] << 7) | (s[28] >>> 25);\n b45 = (s[28] << 7) | (s[29] >>> 25);\n b26 = (s[38] << 8) | (s[39] >>> 24);\n b27 = (s[39] << 8) | (s[38] >>> 24);\n b8 = (s[48] << 14) | (s[49] >>> 18);\n b9 = (s[49] << 14) | (s[48] >>> 18);\n\n s[0] = b0 ^ (~b2 & b4);\n s[1] = b1 ^ (~b3 & b5);\n s[10] = b10 ^ (~b12 & b14);\n s[11] = b11 ^ (~b13 & b15);\n s[20] = b20 ^ (~b22 & b24);\n s[21] = b21 ^ (~b23 & b25);\n s[30] = b30 ^ (~b32 & b34);\n s[31] = b31 ^ (~b33 & b35);\n s[40] = b40 ^ (~b42 & b44);\n s[41] = b41 ^ (~b43 & b45);\n s[2] = b2 ^ (~b4 & b6);\n s[3] = b3 ^ (~b5 & b7);\n s[12] = b12 ^ (~b14 & b16);\n s[13] = b13 ^ (~b15 & b17);\n s[22] = b22 ^ (~b24 & b26);\n s[23] = b23 ^ (~b25 & b27);\n s[32] = b32 ^ (~b34 & b36);\n s[33] = b33 ^ (~b35 & b37);\n s[42] = b42 ^ (~b44 & b46);\n s[43] = b43 ^ (~b45 & b47);\n s[4] = b4 ^ (~b6 & b8);\n s[5] = b5 ^ (~b7 & b9);\n s[14] = b14 ^ (~b16 & b18);\n s[15] = b15 ^ (~b17 & b19);\n s[24] = b24 ^ (~b26 & b28);\n s[25] = b25 ^ (~b27 & b29);\n s[34] = b34 ^ (~b36 & b38);\n s[35] = b35 ^ (~b37 & b39);\n s[44] = b44 ^ (~b46 & b48);\n s[45] = b45 ^ (~b47 & b49);\n s[6] = b6 ^ (~b8 & b0);\n s[7] = b7 ^ (~b9 & b1);\n s[16] = b16 ^ (~b18 & b10);\n s[17] = b17 ^ (~b19 & b11);\n s[26] = b26 ^ (~b28 & b20);\n s[27] = b27 ^ (~b29 & b21);\n s[36] = b36 ^ (~b38 & b30);\n s[37] = b37 ^ (~b39 & b31);\n s[46] = b46 ^ (~b48 & b40);\n s[47] = b47 ^ (~b49 & b41);\n s[8] = b8 ^ (~b0 & b2);\n s[9] = b9 ^ (~b1 & b3);\n s[18] = b18 ^ (~b10 & b12);\n s[19] = b19 ^ (~b11 & b13);\n s[28] = b28 ^ (~b20 & b22);\n s[29] = b29 ^ (~b21 & b23);\n s[38] = b38 ^ (~b30 & b32);\n s[39] = b39 ^ (~b31 & b33);\n s[48] = b48 ^ (~b40 & b42);\n s[49] = b49 ^ (~b41 & b43);\n\n s[0] ^= RC[n];\n s[1] ^= RC[n + 1];\n }\n };\n\n if (COMMON_JS) {\n module.exports = methods;\n } else {\n for (i = 0; i < methodNames.length; ++i) {\n root[methodNames[i]] = methods[methodNames[i]];\n }\n if (AMD) {\n define(function () {\n return methods;\n });\n }\n }\n})();\n","\"use strict\";\nimport sha3 from \"js-sha3\";\nimport { arrayify } from \"@ethersproject/bytes\";\nexport function keccak256(data) {\n return '0x' + sha3.keccak_256(arrayify(data));\n}\n//# sourceMappingURL=index.js.map","export const version = \"rlp/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\n//See: https://github.com/ethereum/wiki/wiki/RLP\nimport { arrayify, hexlify, isBytesLike } from \"@ethersproject/bytes\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nfunction arrayifyInteger(value) {\n const result = [];\n while (value) {\n result.unshift(value & 0xff);\n value >>= 8;\n }\n return result;\n}\nfunction unarrayifyInteger(data, offset, length) {\n let result = 0;\n for (let i = 0; i < length; i++) {\n result = (result * 256) + data[offset + i];\n }\n return result;\n}\nfunction _encode(object) {\n if (Array.isArray(object)) {\n let payload = [];\n object.forEach(function (child) {\n payload = payload.concat(_encode(child));\n });\n if (payload.length <= 55) {\n payload.unshift(0xc0 + payload.length);\n return payload;\n }\n const length = arrayifyInteger(payload.length);\n length.unshift(0xf7 + length.length);\n return length.concat(payload);\n }\n if (!isBytesLike(object)) {\n logger.throwArgumentError(\"RLP object must be BytesLike\", \"object\", object);\n }\n const data = Array.prototype.slice.call(arrayify(object));\n if (data.length === 1 && data[0] <= 0x7f) {\n return data;\n }\n else if (data.length <= 55) {\n data.unshift(0x80 + data.length);\n return data;\n }\n const length = arrayifyInteger(data.length);\n length.unshift(0xb7 + length.length);\n return length.concat(data);\n}\nexport function encode(object) {\n return hexlify(_encode(object));\n}\nfunction _decodeChildren(data, offset, childOffset, length) {\n const result = [];\n while (childOffset < offset + 1 + length) {\n const decoded = _decode(data, childOffset);\n result.push(decoded.result);\n childOffset += decoded.consumed;\n if (childOffset > offset + 1 + length) {\n logger.throwError(\"child data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n }\n return { consumed: (1 + length), result: result };\n}\n// returns { consumed: number, result: Object }\nfunction _decode(data, offset) {\n if (data.length === 0) {\n logger.throwError(\"data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n // Array with extra length prefix\n if (data[offset] >= 0xf8) {\n const lengthLength = data[offset] - 0xf7;\n if (offset + 1 + lengthLength > data.length) {\n logger.throwError(\"data short segment too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n if (offset + 1 + lengthLength + length > data.length) {\n logger.throwError(\"data long segment too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length);\n }\n else if (data[offset] >= 0xc0) {\n const length = data[offset] - 0xc0;\n if (offset + 1 + length > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n return _decodeChildren(data, offset, offset + 1, length);\n }\n else if (data[offset] >= 0xb8) {\n const lengthLength = data[offset] - 0xb7;\n if (offset + 1 + lengthLength > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n if (offset + 1 + lengthLength + length > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const result = hexlify(data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length));\n return { consumed: (1 + lengthLength + length), result: result };\n }\n else if (data[offset] >= 0x80) {\n const length = data[offset] - 0x80;\n if (offset + 1 + length > data.length) {\n logger.throwError(\"data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const result = hexlify(data.slice(offset + 1, offset + 1 + length));\n return { consumed: (1 + length), result: result };\n }\n return { consumed: 1, result: hexlify(data[offset]) };\n}\nexport function decode(data) {\n const bytes = arrayify(data);\n const decoded = _decode(bytes, 0);\n if (decoded.consumed !== bytes.length) {\n logger.throwArgumentError(\"invalid rlp data\", \"data\", data);\n }\n return decoded.result;\n}\n//# sourceMappingURL=index.js.map","export const version = \"address/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nimport { arrayify, concat, hexDataLength, hexDataSlice, isHexString, stripZeros } from \"@ethersproject/bytes\";\nimport { BigNumber, _base16To36, _base36To16 } from \"@ethersproject/bignumber\";\nimport { keccak256 } from \"@ethersproject/keccak256\";\nimport { encode } from \"@ethersproject/rlp\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nfunction getChecksumAddress(address) {\n if (!isHexString(address, 20)) {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n address = address.toLowerCase();\n const chars = address.substring(2).split(\"\");\n const expanded = new Uint8Array(40);\n for (let i = 0; i < 40; i++) {\n expanded[i] = chars[i].charCodeAt(0);\n }\n const hashed = arrayify(keccak256(expanded));\n for (let i = 0; i < 40; i += 2) {\n if ((hashed[i >> 1] >> 4) >= 8) {\n chars[i] = chars[i].toUpperCase();\n }\n if ((hashed[i >> 1] & 0x0f) >= 8) {\n chars[i + 1] = chars[i + 1].toUpperCase();\n }\n }\n return \"0x\" + chars.join(\"\");\n}\n// Shims for environments that are missing some required constants and functions\nconst MAX_SAFE_INTEGER = 0x1fffffffffffff;\nfunction log10(x) {\n if (Math.log10) {\n return Math.log10(x);\n }\n return Math.log(x) / Math.LN10;\n}\n// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number\n// Create lookup table\nconst ibanLookup = {};\nfor (let i = 0; i < 10; i++) {\n ibanLookup[String(i)] = String(i);\n}\nfor (let i = 0; i < 26; i++) {\n ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);\n}\n// How many decimal digits can we process? (for 64-bit float, this is 15)\nconst safeDigits = Math.floor(log10(MAX_SAFE_INTEGER));\nfunction ibanChecksum(address) {\n address = address.toUpperCase();\n address = address.substring(4) + address.substring(0, 2) + \"00\";\n let expanded = address.split(\"\").map((c) => { return ibanLookup[c]; }).join(\"\");\n // Javascript can handle integers safely up to 15 (decimal) digits\n while (expanded.length >= safeDigits) {\n let block = expanded.substring(0, safeDigits);\n expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);\n }\n let checksum = String(98 - (parseInt(expanded, 10) % 97));\n while (checksum.length < 2) {\n checksum = \"0\" + checksum;\n }\n return checksum;\n}\n;\nexport function getAddress(address) {\n let result = null;\n if (typeof (address) !== \"string\") {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) {\n // Missing the 0x prefix\n if (address.substring(0, 2) !== \"0x\") {\n address = \"0x\" + address;\n }\n result = getChecksumAddress(address);\n // It is a checksummed address with a bad checksum\n if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {\n logger.throwArgumentError(\"bad address checksum\", \"address\", address);\n }\n // Maybe ICAP? (we only support direct mode)\n }\n else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {\n // It is an ICAP address with a bad checksum\n if (address.substring(2, 4) !== ibanChecksum(address)) {\n logger.throwArgumentError(\"bad icap checksum\", \"address\", address);\n }\n result = _base36To16(address.substring(4));\n while (result.length < 40) {\n result = \"0\" + result;\n }\n result = getChecksumAddress(\"0x\" + result);\n }\n else {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n return result;\n}\nexport function isAddress(address) {\n try {\n getAddress(address);\n return true;\n }\n catch (error) { }\n return false;\n}\nexport function getIcapAddress(address) {\n let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase();\n while (base36.length < 30) {\n base36 = \"0\" + base36;\n }\n return \"XE\" + ibanChecksum(\"XE00\" + base36) + base36;\n}\n// http://ethereum.stackexchange.com/questions/760/how-is-the-address-of-an-ethereum-contract-computed\nexport function getContractAddress(transaction) {\n let from = null;\n try {\n from = getAddress(transaction.from);\n }\n catch (error) {\n logger.throwArgumentError(\"missing from address\", \"transaction\", transaction);\n }\n const nonce = stripZeros(arrayify(BigNumber.from(transaction.nonce).toHexString()));\n return getAddress(hexDataSlice(keccak256(encode([from, nonce])), 12));\n}\nexport function getCreate2Address(from, salt, initCodeHash) {\n if (hexDataLength(salt) !== 32) {\n logger.throwArgumentError(\"salt must be 32 bytes\", \"salt\", salt);\n }\n if (hexDataLength(initCodeHash) !== 32) {\n logger.throwArgumentError(\"initCodeHash must be 32 bytes\", \"initCodeHash\", initCodeHash);\n }\n return getAddress(hexDataSlice(keccak256(concat([\"0xff\", getAddress(from), salt, initCodeHash])), 12));\n}\n//# sourceMappingURL=index.js.map","\"use strict\";\nimport { getAddress } from \"@ethersproject/address\";\nimport { hexZeroPad } from \"@ethersproject/bytes\";\nimport { Coder } from \"./abstract-coder\";\nexport class AddressCoder extends Coder {\n constructor(localName) {\n super(\"address\", \"address\", localName, false);\n }\n defaultValue() {\n return \"0x0000000000000000000000000000000000000000\";\n }\n encode(writer, value) {\n try {\n value = getAddress(value);\n }\n catch (error) {\n this._throwError(error.message, value);\n }\n return writer.writeValue(value);\n }\n decode(reader) {\n return getAddress(hexZeroPad(reader.readValue().toHexString(), 20));\n }\n}\n//# sourceMappingURL=address.js.map","\"use strict\";\nimport { Coder } from \"./abstract-coder\";\n// Clones the functionality of an existing Coder, but without a localName\nexport class AnonymousCoder extends Coder {\n constructor(coder) {\n super(coder.name, coder.type, undefined, coder.dynamic);\n this.coder = coder;\n }\n defaultValue() {\n return this.coder.defaultValue();\n }\n encode(writer, value) {\n return this.coder.encode(writer, value);\n }\n decode(reader) {\n return this.coder.decode(reader);\n }\n}\n//# sourceMappingURL=anonymous.js.map","\"use strict\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"../_version\";\nconst logger = new Logger(version);\nimport { Coder, Writer } from \"./abstract-coder\";\nimport { AnonymousCoder } from \"./anonymous\";\nexport function pack(writer, coders, values) {\n let arrayValues = null;\n if (Array.isArray(values)) {\n arrayValues = values;\n }\n else if (values && typeof (values) === \"object\") {\n let unique = {};\n arrayValues = coders.map((coder) => {\n const name = coder.localName;\n if (!name) {\n logger.throwError(\"cannot encode object for signature with missing names\", Logger.errors.INVALID_ARGUMENT, {\n argument: \"values\",\n coder: coder,\n value: values\n });\n }\n if (unique[name]) {\n logger.throwError(\"cannot encode object for signature with duplicate names\", Logger.errors.INVALID_ARGUMENT, {\n argument: \"values\",\n coder: coder,\n value: values\n });\n }\n unique[name] = true;\n return values[name];\n });\n }\n else {\n logger.throwArgumentError(\"invalid tuple value\", \"tuple\", values);\n }\n if (coders.length !== arrayValues.length) {\n logger.throwArgumentError(\"types/value length mismatch\", \"tuple\", values);\n }\n let staticWriter = new Writer(writer.wordSize);\n let dynamicWriter = new Writer(writer.wordSize);\n let updateFuncs = [];\n coders.forEach((coder, index) => {\n let value = arrayValues[index];\n if (coder.dynamic) {\n // Get current dynamic offset (for the future pointer)\n let dynamicOffset = dynamicWriter.length;\n // Encode the dynamic value into the dynamicWriter\n coder.encode(dynamicWriter, value);\n // Prepare to populate the correct offset once we are done\n let updateFunc = staticWriter.writeUpdatableValue();\n updateFuncs.push((baseOffset) => {\n updateFunc(baseOffset + dynamicOffset);\n });\n }\n else {\n coder.encode(staticWriter, value);\n }\n });\n // Backfill all the dynamic offsets, now that we know the static length\n updateFuncs.forEach((func) => { func(staticWriter.length); });\n let length = writer.appendWriter(staticWriter);\n length += writer.appendWriter(dynamicWriter);\n return length;\n}\nexport function unpack(reader, coders) {\n let values = [];\n // A reader anchored to this base\n let baseReader = reader.subReader(0);\n coders.forEach((coder) => {\n let value = null;\n if (coder.dynamic) {\n let offset = reader.readValue();\n let offsetReader = baseReader.subReader(offset.toNumber());\n try {\n value = coder.decode(offsetReader);\n }\n catch (error) {\n // Cannot recover from this\n if (error.code === Logger.errors.BUFFER_OVERRUN) {\n throw error;\n }\n value = error;\n value.baseType = coder.name;\n value.name = coder.localName;\n value.type = coder.type;\n }\n }\n else {\n try {\n value = coder.decode(reader);\n }\n catch (error) {\n // Cannot recover from this\n if (error.code === Logger.errors.BUFFER_OVERRUN) {\n throw error;\n }\n value = error;\n value.baseType = coder.name;\n value.name = coder.localName;\n value.type = coder.type;\n }\n }\n if (value != undefined) {\n values.push(value);\n }\n });\n // We only output named properties for uniquely named coders\n const uniqueNames = coders.reduce((accum, coder) => {\n const name = coder.localName;\n if (name) {\n if (!accum[name]) {\n accum[name] = 0;\n }\n accum[name]++;\n }\n return accum;\n }, {});\n // Add any named parameters (i.e. tuples)\n coders.forEach((coder, index) => {\n let name = coder.localName;\n if (!name || uniqueNames[name] !== 1) {\n return;\n }\n if (name === \"length\") {\n name = \"_length\";\n }\n if (values[name] != null) {\n return;\n }\n const value = values[index];\n if (value instanceof Error) {\n Object.defineProperty(values, name, {\n enumerable: true,\n get: () => { throw value; }\n });\n }\n else {\n values[name] = value;\n }\n });\n for (let i = 0; i < values.length; i++) {\n const value = values[i];\n if (value instanceof Error) {\n Object.defineProperty(values, i, {\n enumerable: true,\n get: () => { throw value; }\n });\n }\n }\n return Object.freeze(values);\n}\nexport class ArrayCoder extends Coder {\n constructor(coder, length, localName) {\n const type = (coder.type + \"[\" + (length >= 0 ? length : \"\") + \"]\");\n const dynamic = (length === -1 || coder.dynamic);\n super(\"array\", type, localName, dynamic);\n this.coder = coder;\n this.length = length;\n }\n defaultValue() {\n // Verifies the child coder is valid (even if the array is dynamic or 0-length)\n const defaultChild = this.coder.defaultValue();\n const result = [];\n for (let i = 0; i < this.length; i++) {\n result.push(defaultChild);\n }\n return result;\n }\n encode(writer, value) {\n if (!Array.isArray(value)) {\n this._throwError(\"expected array value\", value);\n }\n let count = this.length;\n if (count === -1) {\n count = value.length;\n writer.writeValue(value.length);\n }\n logger.checkArgumentCount(value.length, count, \"coder array\" + (this.localName ? (\" \" + this.localName) : \"\"));\n let coders = [];\n for (let i = 0; i < value.length; i++) {\n coders.push(this.coder);\n }\n return pack(writer, coders, value);\n }\n decode(reader) {\n let count = this.length;\n if (count === -1) {\n count = reader.readValue().toNumber();\n // Check that there is *roughly* enough data to ensure\n // stray random data is not being read as a length. Each\n // slot requires at least 32 bytes for their value (or 32\n // bytes as a link to the data). This could use a much\n // tighter bound, but we are erroring on the side of safety.\n if (count * 32 > reader._data.length) {\n logger.throwError(\"insufficient data length\", Logger.errors.BUFFER_OVERRUN, {\n length: reader._data.length,\n count: count\n });\n }\n }\n let coders = [];\n for (let i = 0; i < count; i++) {\n coders.push(new AnonymousCoder(this.coder));\n }\n return reader.coerce(this.name, unpack(reader, coders));\n }\n}\n//# sourceMappingURL=array.js.map","\"use strict\";\nimport { Coder } from \"./abstract-coder\";\nexport class BooleanCoder extends Coder {\n constructor(localName) {\n super(\"bool\", \"bool\", localName, false);\n }\n defaultValue() {\n return false;\n }\n encode(writer, value) {\n return writer.writeValue(value ? 1 : 0);\n }\n decode(reader) {\n return reader.coerce(this.type, !reader.readValue().isZero());\n }\n}\n//# sourceMappingURL=boolean.js.map","\"use strict\";\nimport { arrayify, hexlify } from \"@ethersproject/bytes\";\nimport { Coder } from \"./abstract-coder\";\nexport class DynamicBytesCoder extends Coder {\n constructor(type, localName) {\n super(type, type, localName, true);\n }\n defaultValue() {\n return \"0x\";\n }\n encode(writer, value) {\n value = arrayify(value);\n let length = writer.writeValue(value.length);\n length += writer.writeBytes(value);\n return length;\n }\n decode(reader) {\n return reader.readBytes(reader.readValue().toNumber(), true);\n }\n}\nexport class BytesCoder extends DynamicBytesCoder {\n constructor(localName) {\n super(\"bytes\", localName);\n }\n decode(reader) {\n return reader.coerce(this.name, hexlify(super.decode(reader)));\n }\n}\n//# sourceMappingURL=bytes.js.map","\"use strict\";\nimport { arrayify, hexlify } from \"@ethersproject/bytes\";\nimport { Coder } from \"./abstract-coder\";\n// @TODO: Merge this with bytes\nexport class FixedBytesCoder extends Coder {\n constructor(size, localName) {\n let name = \"bytes\" + String(size);\n super(name, name, localName, false);\n this.size = size;\n }\n defaultValue() {\n return (\"0x0000000000000000000000000000000000000000000000000000000000000000\").substring(0, 2 + this.size * 2);\n }\n encode(writer, value) {\n let data = arrayify(value);\n if (data.length !== this.size) {\n this._throwError(\"incorrect data length\", value);\n }\n return writer.writeBytes(data);\n }\n decode(reader) {\n return reader.coerce(this.name, hexlify(reader.readBytes(this.size)));\n }\n}\n//# sourceMappingURL=fixed-bytes.js.map","\"use strict\";\nimport { Coder } from \"./abstract-coder\";\nexport class NullCoder extends Coder {\n constructor(localName) {\n super(\"null\", \"\", localName, false);\n }\n defaultValue() {\n return null;\n }\n encode(writer, value) {\n if (value != null) {\n this._throwError(\"not null\", value);\n }\n return writer.writeBytes([]);\n }\n decode(reader) {\n reader.readBytes(0);\n return reader.coerce(this.name, null);\n }\n}\n//# sourceMappingURL=null.js.map","import { BigNumber } from \"@ethersproject/bignumber\";\nconst NegativeOne = ( /*#__PURE__*/BigNumber.from(-1));\nconst Zero = ( /*#__PURE__*/BigNumber.from(0));\nconst One = ( /*#__PURE__*/BigNumber.from(1));\nconst Two = ( /*#__PURE__*/BigNumber.from(2));\nconst WeiPerEther = ( /*#__PURE__*/BigNumber.from(\"1000000000000000000\"));\nconst MaxUint256 = ( /*#__PURE__*/BigNumber.from(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\"));\nconst MinInt256 = ( /*#__PURE__*/BigNumber.from(\"-0x8000000000000000000000000000000000000000000000000000000000000000\"));\nconst MaxInt256 = ( /*#__PURE__*/BigNumber.from(\"0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\"));\nexport { NegativeOne, Zero, One, Two, WeiPerEther, MaxUint256, MinInt256, MaxInt256, };\n//# sourceMappingURL=bignumbers.js.map","\"use strict\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { MaxUint256, NegativeOne, One, Zero } from \"@ethersproject/constants\";\nimport { Coder } from \"./abstract-coder\";\nexport class NumberCoder extends Coder {\n constructor(size, signed, localName) {\n const name = ((signed ? \"int\" : \"uint\") + (size * 8));\n super(name, name, localName, false);\n this.size = size;\n this.signed = signed;\n }\n defaultValue() {\n return 0;\n }\n encode(writer, value) {\n let v = BigNumber.from(value);\n // Check bounds are safe for encoding\n let maxUintValue = MaxUint256.mask(writer.wordSize * 8);\n if (this.signed) {\n let bounds = maxUintValue.mask(this.size * 8 - 1);\n if (v.gt(bounds) || v.lt(bounds.add(One).mul(NegativeOne))) {\n this._throwError(\"value out-of-bounds\", value);\n }\n }\n else if (v.lt(Zero) || v.gt(maxUintValue.mask(this.size * 8))) {\n this._throwError(\"value out-of-bounds\", value);\n }\n v = v.toTwos(this.size * 8).mask(this.size * 8);\n if (this.signed) {\n v = v.fromTwos(this.size * 8).toTwos(8 * writer.wordSize);\n }\n return writer.writeValue(v);\n }\n decode(reader) {\n let value = reader.readValue().mask(this.size * 8);\n if (this.signed) {\n value = value.fromTwos(this.size * 8);\n }\n return reader.coerce(this.name, value);\n }\n}\n//# sourceMappingURL=number.js.map","export const version = \"strings/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nimport { arrayify } from \"@ethersproject/bytes\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n///////////////////////////////\nexport var UnicodeNormalizationForm;\n(function (UnicodeNormalizationForm) {\n UnicodeNormalizationForm[\"current\"] = \"\";\n UnicodeNormalizationForm[\"NFC\"] = \"NFC\";\n UnicodeNormalizationForm[\"NFD\"] = \"NFD\";\n UnicodeNormalizationForm[\"NFKC\"] = \"NFKC\";\n UnicodeNormalizationForm[\"NFKD\"] = \"NFKD\";\n})(UnicodeNormalizationForm || (UnicodeNormalizationForm = {}));\n;\nexport var Utf8ErrorReason;\n(function (Utf8ErrorReason) {\n // A continuation byte was present where there was nothing to continue\n // - offset = the index the codepoint began in\n Utf8ErrorReason[\"UNEXPECTED_CONTINUE\"] = \"unexpected continuation byte\";\n // An invalid (non-continuation) byte to start a UTF-8 codepoint was found\n // - offset = the index the codepoint began in\n Utf8ErrorReason[\"BAD_PREFIX\"] = \"bad codepoint prefix\";\n // The string is too short to process the expected codepoint\n // - offset = the index the codepoint began in\n Utf8ErrorReason[\"OVERRUN\"] = \"string overrun\";\n // A missing continuation byte was expected but not found\n // - offset = the index the continuation byte was expected at\n Utf8ErrorReason[\"MISSING_CONTINUE\"] = \"missing continuation byte\";\n // The computed code point is outside the range for UTF-8\n // - offset = start of this codepoint\n // - badCodepoint = the computed codepoint; outside the UTF-8 range\n Utf8ErrorReason[\"OUT_OF_RANGE\"] = \"out of UTF-8 range\";\n // UTF-8 strings may not contain UTF-16 surrogate pairs\n // - offset = start of this codepoint\n // - badCodepoint = the computed codepoint; inside the UTF-16 surrogate range\n Utf8ErrorReason[\"UTF16_SURROGATE\"] = \"UTF-16 surrogate\";\n // The string is an overlong representation\n // - offset = start of this codepoint\n // - badCodepoint = the computed codepoint; already bounds checked\n Utf8ErrorReason[\"OVERLONG\"] = \"overlong representation\";\n})(Utf8ErrorReason || (Utf8ErrorReason = {}));\n;\nfunction errorFunc(reason, offset, bytes, output, badCodepoint) {\n return logger.throwArgumentError(`invalid codepoint at offset ${offset}; ${reason}`, \"bytes\", bytes);\n}\nfunction ignoreFunc(reason, offset, bytes, output, badCodepoint) {\n // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes\n if (reason === Utf8ErrorReason.BAD_PREFIX || reason === Utf8ErrorReason.UNEXPECTED_CONTINUE) {\n let i = 0;\n for (let o = offset + 1; o < bytes.length; o++) {\n if (bytes[o] >> 6 !== 0x02) {\n break;\n }\n i++;\n }\n return i;\n }\n // This byte runs us past the end of the string, so just jump to the end\n // (but the first byte was read already read and therefore skipped)\n if (reason === Utf8ErrorReason.OVERRUN) {\n return bytes.length - offset - 1;\n }\n // Nothing to skip\n return 0;\n}\nfunction replaceFunc(reason, offset, bytes, output, badCodepoint) {\n // Overlong representations are otherwise \"valid\" code points; just non-deistingtished\n if (reason === Utf8ErrorReason.OVERLONG) {\n output.push(badCodepoint);\n return 0;\n }\n // Put the replacement character into the output\n output.push(0xfffd);\n // Otherwise, process as if ignoring errors\n return ignoreFunc(reason, offset, bytes, output, badCodepoint);\n}\n// Common error handing strategies\nexport const Utf8ErrorFuncs = Object.freeze({\n error: errorFunc,\n ignore: ignoreFunc,\n replace: replaceFunc\n});\n// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499\nfunction getUtf8CodePoints(bytes, onError) {\n if (onError == null) {\n onError = Utf8ErrorFuncs.error;\n }\n bytes = arrayify(bytes);\n const result = [];\n let i = 0;\n // Invalid bytes are ignored\n while (i < bytes.length) {\n const c = bytes[i++];\n // 0xxx xxxx\n if (c >> 7 === 0) {\n result.push(c);\n continue;\n }\n // Multibyte; how many bytes left for this character?\n let extraLength = null;\n let overlongMask = null;\n // 110x xxxx 10xx xxxx\n if ((c & 0xe0) === 0xc0) {\n extraLength = 1;\n overlongMask = 0x7f;\n // 1110 xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf0) === 0xe0) {\n extraLength = 2;\n overlongMask = 0x7ff;\n // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf8) === 0xf0) {\n extraLength = 3;\n overlongMask = 0xffff;\n }\n else {\n if ((c & 0xc0) === 0x80) {\n i += onError(Utf8ErrorReason.UNEXPECTED_CONTINUE, i - 1, bytes, result);\n }\n else {\n i += onError(Utf8ErrorReason.BAD_PREFIX, i - 1, bytes, result);\n }\n continue;\n }\n // Do we have enough bytes in our data?\n if (i - 1 + extraLength >= bytes.length) {\n i += onError(Utf8ErrorReason.OVERRUN, i - 1, bytes, result);\n continue;\n }\n // Remove the length prefix from the char\n let res = c & ((1 << (8 - extraLength - 1)) - 1);\n for (let j = 0; j < extraLength; j++) {\n let nextChar = bytes[i];\n // Invalid continuation byte\n if ((nextChar & 0xc0) != 0x80) {\n i += onError(Utf8ErrorReason.MISSING_CONTINUE, i, bytes, result);\n res = null;\n break;\n }\n ;\n res = (res << 6) | (nextChar & 0x3f);\n i++;\n }\n // See above loop for invalid continuation byte\n if (res === null) {\n continue;\n }\n // Maximum code point\n if (res > 0x10ffff) {\n i += onError(Utf8ErrorReason.OUT_OF_RANGE, i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Reserved for UTF-16 surrogate halves\n if (res >= 0xd800 && res <= 0xdfff) {\n i += onError(Utf8ErrorReason.UTF16_SURROGATE, i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Check for overlong sequences (more bytes than needed)\n if (res <= overlongMask) {\n i += onError(Utf8ErrorReason.OVERLONG, i - 1 - extraLength, bytes, result, res);\n continue;\n }\n result.push(res);\n }\n return result;\n}\n// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array\nexport function toUtf8Bytes(str, form = UnicodeNormalizationForm.current) {\n if (form != UnicodeNormalizationForm.current) {\n logger.checkNormalize();\n str = str.normalize(form);\n }\n let result = [];\n for (let i = 0; i < str.length; i++) {\n const c = str.charCodeAt(i);\n if (c < 0x80) {\n result.push(c);\n }\n else if (c < 0x800) {\n result.push((c >> 6) | 0xc0);\n result.push((c & 0x3f) | 0x80);\n }\n else if ((c & 0xfc00) == 0xd800) {\n i++;\n const c2 = str.charCodeAt(i);\n if (i >= str.length || (c2 & 0xfc00) !== 0xdc00) {\n throw new Error(\"invalid utf-8 string\");\n }\n // Surrogate Pair\n const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);\n result.push((pair >> 18) | 0xf0);\n result.push(((pair >> 12) & 0x3f) | 0x80);\n result.push(((pair >> 6) & 0x3f) | 0x80);\n result.push((pair & 0x3f) | 0x80);\n }\n else {\n result.push((c >> 12) | 0xe0);\n result.push(((c >> 6) & 0x3f) | 0x80);\n result.push((c & 0x3f) | 0x80);\n }\n }\n return arrayify(result);\n}\n;\nfunction escapeChar(value) {\n const hex = (\"0000\" + value.toString(16));\n return \"\\\\u\" + hex.substring(hex.length - 4);\n}\nexport function _toEscapedUtf8String(bytes, onError) {\n return '\"' + getUtf8CodePoints(bytes, onError).map((codePoint) => {\n if (codePoint < 256) {\n switch (codePoint) {\n case 8: return \"\\\\b\";\n case 9: return \"\\\\t\";\n case 10: return \"\\\\n\";\n case 13: return \"\\\\r\";\n case 34: return \"\\\\\\\"\";\n case 92: return \"\\\\\\\\\";\n }\n if (codePoint >= 32 && codePoint < 127) {\n return String.fromCharCode(codePoint);\n }\n }\n if (codePoint <= 0xffff) {\n return escapeChar(codePoint);\n }\n codePoint -= 0x10000;\n return escapeChar(((codePoint >> 10) & 0x3ff) + 0xd800) + escapeChar((codePoint & 0x3ff) + 0xdc00);\n }).join(\"\") + '\"';\n}\nexport function _toUtf8String(codePoints) {\n return codePoints.map((codePoint) => {\n if (codePoint <= 0xffff) {\n return String.fromCharCode(codePoint);\n }\n codePoint -= 0x10000;\n return String.fromCharCode((((codePoint >> 10) & 0x3ff) + 0xd800), ((codePoint & 0x3ff) + 0xdc00));\n }).join(\"\");\n}\nexport function toUtf8String(bytes, onError) {\n return _toUtf8String(getUtf8CodePoints(bytes, onError));\n}\nexport function toUtf8CodePoints(str, form = UnicodeNormalizationForm.current) {\n return getUtf8CodePoints(toUtf8Bytes(str, form));\n}\n//# sourceMappingURL=utf8.js.map","\"use strict\";\nimport { toUtf8Bytes, toUtf8String } from \"@ethersproject/strings\";\nimport { DynamicBytesCoder } from \"./bytes\";\nexport class StringCoder extends DynamicBytesCoder {\n constructor(localName) {\n super(\"string\", localName);\n }\n defaultValue() {\n return \"\";\n }\n encode(writer, value) {\n return super.encode(writer, toUtf8Bytes(value));\n }\n decode(reader) {\n return toUtf8String(super.decode(reader));\n }\n}\n//# sourceMappingURL=string.js.map","\"use strict\";\nimport { Coder } from \"./abstract-coder\";\nimport { pack, unpack } from \"./array\";\nexport class TupleCoder extends Coder {\n constructor(coders, localName) {\n let dynamic = false;\n const types = [];\n coders.forEach((coder) => {\n if (coder.dynamic) {\n dynamic = true;\n }\n types.push(coder.type);\n });\n const type = (\"tuple(\" + types.join(\",\") + \")\");\n super(\"tuple\", type, localName, dynamic);\n this.coders = coders;\n }\n defaultValue() {\n const values = [];\n this.coders.forEach((coder) => {\n values.push(coder.defaultValue());\n });\n // We only output named properties for uniquely named coders\n const uniqueNames = this.coders.reduce((accum, coder) => {\n const name = coder.localName;\n if (name) {\n if (!accum[name]) {\n accum[name] = 0;\n }\n accum[name]++;\n }\n return accum;\n }, {});\n // Add named values\n this.coders.forEach((coder, index) => {\n let name = coder.localName;\n if (!name || uniqueNames[name] !== 1) {\n return;\n }\n if (name === \"length\") {\n name = \"_length\";\n }\n if (values[name] != null) {\n return;\n }\n values[name] = values[index];\n });\n return Object.freeze(values);\n }\n encode(writer, value) {\n return pack(writer, this.coders, value);\n }\n decode(reader) {\n return reader.coerce(this.name, unpack(reader, this.coders));\n }\n}\n//# sourceMappingURL=tuple.js.map","\"use strict\";\n// See: https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI\nimport { arrayify } from \"@ethersproject/bytes\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nimport { Reader, Writer } from \"./coders/abstract-coder\";\nimport { AddressCoder } from \"./coders/address\";\nimport { ArrayCoder } from \"./coders/array\";\nimport { BooleanCoder } from \"./coders/boolean\";\nimport { BytesCoder } from \"./coders/bytes\";\nimport { FixedBytesCoder } from \"./coders/fixed-bytes\";\nimport { NullCoder } from \"./coders/null\";\nimport { NumberCoder } from \"./coders/number\";\nimport { StringCoder } from \"./coders/string\";\nimport { TupleCoder } from \"./coders/tuple\";\nimport { ParamType } from \"./fragments\";\nconst paramTypeBytes = new RegExp(/^bytes([0-9]*)$/);\nconst paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/);\nexport class AbiCoder {\n constructor(coerceFunc) {\n defineReadOnly(this, \"coerceFunc\", coerceFunc || null);\n }\n _getCoder(param) {\n switch (param.baseType) {\n case \"address\":\n return new AddressCoder(param.name);\n case \"bool\":\n return new BooleanCoder(param.name);\n case \"string\":\n return new StringCoder(param.name);\n case \"bytes\":\n return new BytesCoder(param.name);\n case \"array\":\n return new ArrayCoder(this._getCoder(param.arrayChildren), param.arrayLength, param.name);\n case \"tuple\":\n return new TupleCoder((param.components || []).map((component) => {\n return this._getCoder(component);\n }), param.name);\n case \"\":\n return new NullCoder(param.name);\n }\n // u?int[0-9]*\n let match = param.type.match(paramTypeNumber);\n if (match) {\n let size = parseInt(match[2] || \"256\");\n if (size === 0 || size > 256 || (size % 8) !== 0) {\n logger.throwArgumentError(\"invalid \" + match[1] + \" bit length\", \"param\", param);\n }\n return new NumberCoder(size / 8, (match[1] === \"int\"), param.name);\n }\n // bytes[0-9]+\n match = param.type.match(paramTypeBytes);\n if (match) {\n let size = parseInt(match[1]);\n if (size === 0 || size > 32) {\n logger.throwArgumentError(\"invalid bytes length\", \"param\", param);\n }\n return new FixedBytesCoder(size, param.name);\n }\n return logger.throwArgumentError(\"invalid type\", \"type\", param.type);\n }\n _getWordSize() { return 32; }\n _getReader(data, allowLoose) {\n return new Reader(data, this._getWordSize(), this.coerceFunc, allowLoose);\n }\n _getWriter() {\n return new Writer(this._getWordSize());\n }\n getDefaultValue(types) {\n const coders = types.map((type) => this._getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.defaultValue();\n }\n encode(types, values) {\n if (types.length !== values.length) {\n logger.throwError(\"types/values length mismatch\", Logger.errors.INVALID_ARGUMENT, {\n count: { types: types.length, values: values.length },\n value: { types: types, values: values }\n });\n }\n const coders = types.map((type) => this._getCoder(ParamType.from(type)));\n const coder = (new TupleCoder(coders, \"_\"));\n const writer = this._getWriter();\n coder.encode(writer, values);\n return writer.data;\n }\n decode(types, data, loose) {\n const coders = types.map((type) => this._getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.decode(this._getReader(arrayify(data), loose));\n }\n}\nexport const defaultAbiCoder = new AbiCoder();\n//# sourceMappingURL=abi-coder.js.map","import { keccak256 } from \"@ethersproject/keccak256\";\nimport { toUtf8Bytes } from \"@ethersproject/strings\";\nexport function id(text) {\n return keccak256(toUtf8Bytes(text));\n}\n//# sourceMappingURL=id.js.map","\"use strict\";\nimport { getAddress } from \"@ethersproject/address\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { arrayify, concat, hexDataSlice, hexlify, hexZeroPad, isHexString } from \"@ethersproject/bytes\";\nimport { id } from \"@ethersproject/hash\";\nimport { keccak256 } from \"@ethersproject/keccak256\";\nimport { defineReadOnly, Description, getStatic } from \"@ethersproject/properties\";\nimport { defaultAbiCoder } from \"./abi-coder\";\nimport { checkResultErrors } from \"./coders/abstract-coder\";\nimport { ConstructorFragment, EventFragment, FormatTypes, Fragment, FunctionFragment, ParamType } from \"./fragments\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nexport { checkResultErrors };\nexport class LogDescription extends Description {\n}\nexport class TransactionDescription extends Description {\n}\nexport class ErrorDescription extends Description {\n}\nexport class Indexed extends Description {\n static isIndexed(value) {\n return !!(value && value._isIndexed);\n }\n}\nconst BuiltinErrors = {\n \"0x08c379a0\": { signature: \"Error(string)\", name: \"Error\", inputs: [\"string\"], reason: true },\n \"0x4e487b71\": { signature: \"Panic(uint256)\", name: \"Panic\", inputs: [\"uint256\"] }\n};\nfunction wrapAccessError(property, error) {\n const wrap = new Error(`deferred error during ABI decoding triggered accessing ${property}`);\n wrap.error = error;\n return wrap;\n}\n/*\nfunction checkNames(fragment: Fragment, type: \"input\" | \"output\", params: Array): void {\n params.reduce((accum, param) => {\n if (param.name) {\n if (accum[param.name]) {\n logger.throwArgumentError(`duplicate ${ type } parameter ${ JSON.stringify(param.name) } in ${ fragment.format(\"full\") }`, \"fragment\", fragment);\n }\n accum[param.name] = true;\n }\n return accum;\n }, <{ [ name: string ]: boolean }>{ });\n}\n*/\nexport class Interface {\n constructor(fragments) {\n let abi = [];\n if (typeof (fragments) === \"string\") {\n abi = JSON.parse(fragments);\n }\n else {\n abi = fragments;\n }\n defineReadOnly(this, \"fragments\", abi.map((fragment) => {\n return Fragment.from(fragment);\n }).filter((fragment) => (fragment != null)));\n defineReadOnly(this, \"_abiCoder\", getStatic(new.target, \"getAbiCoder\")());\n defineReadOnly(this, \"functions\", {});\n defineReadOnly(this, \"errors\", {});\n defineReadOnly(this, \"events\", {});\n defineReadOnly(this, \"structs\", {});\n // Add all fragments by their signature\n this.fragments.forEach((fragment) => {\n let bucket = null;\n switch (fragment.type) {\n case \"constructor\":\n if (this.deploy) {\n logger.warn(\"duplicate definition - constructor\");\n return;\n }\n //checkNames(fragment, \"input\", fragment.inputs);\n defineReadOnly(this, \"deploy\", fragment);\n return;\n case \"function\":\n //checkNames(fragment, \"input\", fragment.inputs);\n //checkNames(fragment, \"output\", (fragment).outputs);\n bucket = this.functions;\n break;\n case \"event\":\n //checkNames(fragment, \"input\", fragment.inputs);\n bucket = this.events;\n break;\n case \"error\":\n bucket = this.errors;\n break;\n default:\n return;\n }\n let signature = fragment.format();\n if (bucket[signature]) {\n logger.warn(\"duplicate definition - \" + signature);\n return;\n }\n bucket[signature] = fragment;\n });\n // If we do not have a constructor add a default\n if (!this.deploy) {\n defineReadOnly(this, \"deploy\", ConstructorFragment.from({\n payable: false,\n type: \"constructor\"\n }));\n }\n defineReadOnly(this, \"_isInterface\", true);\n }\n format(format) {\n if (!format) {\n format = FormatTypes.full;\n }\n if (format === FormatTypes.sighash) {\n logger.throwArgumentError(\"interface does not support formatting sighash\", \"format\", format);\n }\n const abi = this.fragments.map((fragment) => fragment.format(format));\n // We need to re-bundle the JSON fragments a bit\n if (format === FormatTypes.json) {\n return JSON.stringify(abi.map((j) => JSON.parse(j)));\n }\n return abi;\n }\n // Sub-classes can override these to handle other blockchains\n static getAbiCoder() {\n return defaultAbiCoder;\n }\n static getAddress(address) {\n return getAddress(address);\n }\n static getSighash(fragment) {\n return hexDataSlice(id(fragment.format()), 0, 4);\n }\n static getEventTopic(eventFragment) {\n return id(eventFragment.format());\n }\n // Find a function definition by any means necessary (unless it is ambiguous)\n getFunction(nameOrSignatureOrSighash) {\n if (isHexString(nameOrSignatureOrSighash)) {\n for (const name in this.functions) {\n if (nameOrSignatureOrSighash === this.getSighash(name)) {\n return this.functions[name];\n }\n }\n logger.throwArgumentError(\"no matching function\", \"sighash\", nameOrSignatureOrSighash);\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (nameOrSignatureOrSighash.indexOf(\"(\") === -1) {\n const name = nameOrSignatureOrSighash.trim();\n const matching = Object.keys(this.functions).filter((f) => (f.split(\"(\" /* fix:) */)[0] === name));\n if (matching.length === 0) {\n logger.throwArgumentError(\"no matching function\", \"name\", name);\n }\n else if (matching.length > 1) {\n logger.throwArgumentError(\"multiple matching functions\", \"name\", name);\n }\n return this.functions[matching[0]];\n }\n // Normalize the signature and lookup the function\n const result = this.functions[FunctionFragment.fromString(nameOrSignatureOrSighash).format()];\n if (!result) {\n logger.throwArgumentError(\"no matching function\", \"signature\", nameOrSignatureOrSighash);\n }\n return result;\n }\n // Find an event definition by any means necessary (unless it is ambiguous)\n getEvent(nameOrSignatureOrTopic) {\n if (isHexString(nameOrSignatureOrTopic)) {\n const topichash = nameOrSignatureOrTopic.toLowerCase();\n for (const name in this.events) {\n if (topichash === this.getEventTopic(name)) {\n return this.events[name];\n }\n }\n logger.throwArgumentError(\"no matching event\", \"topichash\", topichash);\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (nameOrSignatureOrTopic.indexOf(\"(\") === -1) {\n const name = nameOrSignatureOrTopic.trim();\n const matching = Object.keys(this.events).filter((f) => (f.split(\"(\" /* fix:) */)[0] === name));\n if (matching.length === 0) {\n logger.throwArgumentError(\"no matching event\", \"name\", name);\n }\n else if (matching.length > 1) {\n logger.throwArgumentError(\"multiple matching events\", \"name\", name);\n }\n return this.events[matching[0]];\n }\n // Normalize the signature and lookup the function\n const result = this.events[EventFragment.fromString(nameOrSignatureOrTopic).format()];\n if (!result) {\n logger.throwArgumentError(\"no matching event\", \"signature\", nameOrSignatureOrTopic);\n }\n return result;\n }\n // Find a function definition by any means necessary (unless it is ambiguous)\n getError(nameOrSignatureOrSighash) {\n if (isHexString(nameOrSignatureOrSighash)) {\n const getSighash = getStatic(this.constructor, \"getSighash\");\n for (const name in this.errors) {\n const error = this.errors[name];\n if (nameOrSignatureOrSighash === getSighash(error)) {\n return this.errors[name];\n }\n }\n logger.throwArgumentError(\"no matching error\", \"sighash\", nameOrSignatureOrSighash);\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (nameOrSignatureOrSighash.indexOf(\"(\") === -1) {\n const name = nameOrSignatureOrSighash.trim();\n const matching = Object.keys(this.errors).filter((f) => (f.split(\"(\" /* fix:) */)[0] === name));\n if (matching.length === 0) {\n logger.throwArgumentError(\"no matching error\", \"name\", name);\n }\n else if (matching.length > 1) {\n logger.throwArgumentError(\"multiple matching errors\", \"name\", name);\n }\n return this.errors[matching[0]];\n }\n // Normalize the signature and lookup the function\n const result = this.errors[FunctionFragment.fromString(nameOrSignatureOrSighash).format()];\n if (!result) {\n logger.throwArgumentError(\"no matching error\", \"signature\", nameOrSignatureOrSighash);\n }\n return result;\n }\n // Get the sighash (the bytes4 selector) used by Solidity to identify a function\n getSighash(fragment) {\n if (typeof (fragment) === \"string\") {\n try {\n fragment = this.getFunction(fragment);\n }\n catch (error) {\n try {\n fragment = this.getError(fragment);\n }\n catch (_) {\n throw error;\n }\n }\n }\n return getStatic(this.constructor, \"getSighash\")(fragment);\n }\n // Get the topic (the bytes32 hash) used by Solidity to identify an event\n getEventTopic(eventFragment) {\n if (typeof (eventFragment) === \"string\") {\n eventFragment = this.getEvent(eventFragment);\n }\n return getStatic(this.constructor, \"getEventTopic\")(eventFragment);\n }\n _decodeParams(params, data) {\n return this._abiCoder.decode(params, data);\n }\n _encodeParams(params, values) {\n return this._abiCoder.encode(params, values);\n }\n encodeDeploy(values) {\n return this._encodeParams(this.deploy.inputs, values || []);\n }\n decodeErrorResult(fragment, data) {\n if (typeof (fragment) === \"string\") {\n fragment = this.getError(fragment);\n }\n const bytes = arrayify(data);\n if (hexlify(bytes.slice(0, 4)) !== this.getSighash(fragment)) {\n logger.throwArgumentError(`data signature does not match error ${fragment.name}.`, \"data\", hexlify(bytes));\n }\n return this._decodeParams(fragment.inputs, bytes.slice(4));\n }\n encodeErrorResult(fragment, values) {\n if (typeof (fragment) === \"string\") {\n fragment = this.getError(fragment);\n }\n return hexlify(concat([\n this.getSighash(fragment),\n this._encodeParams(fragment.inputs, values || [])\n ]));\n }\n // Decode the data for a function call (e.g. tx.data)\n decodeFunctionData(functionFragment, data) {\n if (typeof (functionFragment) === \"string\") {\n functionFragment = this.getFunction(functionFragment);\n }\n const bytes = arrayify(data);\n if (hexlify(bytes.slice(0, 4)) !== this.getSighash(functionFragment)) {\n logger.throwArgumentError(`data signature does not match function ${functionFragment.name}.`, \"data\", hexlify(bytes));\n }\n return this._decodeParams(functionFragment.inputs, bytes.slice(4));\n }\n // Encode the data for a function call (e.g. tx.data)\n encodeFunctionData(functionFragment, values) {\n if (typeof (functionFragment) === \"string\") {\n functionFragment = this.getFunction(functionFragment);\n }\n return hexlify(concat([\n this.getSighash(functionFragment),\n this._encodeParams(functionFragment.inputs, values || [])\n ]));\n }\n // Decode the result from a function call (e.g. from eth_call)\n decodeFunctionResult(functionFragment, data) {\n if (typeof (functionFragment) === \"string\") {\n functionFragment = this.getFunction(functionFragment);\n }\n let bytes = arrayify(data);\n let reason = null;\n let message = \"\";\n let errorArgs = null;\n let errorName = null;\n let errorSignature = null;\n switch (bytes.length % this._abiCoder._getWordSize()) {\n case 0:\n try {\n return this._abiCoder.decode(functionFragment.outputs, bytes);\n }\n catch (error) { }\n break;\n case 4: {\n const selector = hexlify(bytes.slice(0, 4));\n const builtin = BuiltinErrors[selector];\n if (builtin) {\n errorArgs = this._abiCoder.decode(builtin.inputs, bytes.slice(4));\n errorName = builtin.name;\n errorSignature = builtin.signature;\n if (builtin.reason) {\n reason = errorArgs[0];\n }\n if (errorName === \"Error\") {\n message = `; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(errorArgs[0])}`;\n }\n else if (errorName === \"Panic\") {\n message = `; VM Exception while processing transaction: reverted with panic code ${errorArgs[0]}`;\n }\n }\n else {\n try {\n const error = this.getError(selector);\n errorArgs = this._abiCoder.decode(error.inputs, bytes.slice(4));\n errorName = error.name;\n errorSignature = error.format();\n }\n catch (error) { }\n }\n break;\n }\n }\n return logger.throwError(\"call revert exception\" + message, Logger.errors.CALL_EXCEPTION, {\n method: functionFragment.format(),\n data: hexlify(data), errorArgs, errorName, errorSignature, reason\n });\n }\n // Encode the result for a function call (e.g. for eth_call)\n encodeFunctionResult(functionFragment, values) {\n if (typeof (functionFragment) === \"string\") {\n functionFragment = this.getFunction(functionFragment);\n }\n return hexlify(this._abiCoder.encode(functionFragment.outputs, values || []));\n }\n // Create the filter for the event with search criteria (e.g. for eth_filterLog)\n encodeFilterTopics(eventFragment, values) {\n if (typeof (eventFragment) === \"string\") {\n eventFragment = this.getEvent(eventFragment);\n }\n if (values.length > eventFragment.inputs.length) {\n logger.throwError(\"too many arguments for \" + eventFragment.format(), Logger.errors.UNEXPECTED_ARGUMENT, {\n argument: \"values\",\n value: values\n });\n }\n let topics = [];\n if (!eventFragment.anonymous) {\n topics.push(this.getEventTopic(eventFragment));\n }\n const encodeTopic = (param, value) => {\n if (param.type === \"string\") {\n return id(value);\n }\n else if (param.type === \"bytes\") {\n return keccak256(hexlify(value));\n }\n if (param.type === \"bool\" && typeof (value) === \"boolean\") {\n value = (value ? \"0x01\" : \"0x00\");\n }\n if (param.type.match(/^u?int/)) {\n value = BigNumber.from(value).toHexString();\n }\n // Check addresses are valid\n if (param.type === \"address\") {\n this._abiCoder.encode([\"address\"], [value]);\n }\n return hexZeroPad(hexlify(value), 32);\n };\n values.forEach((value, index) => {\n let param = eventFragment.inputs[index];\n if (!param.indexed) {\n if (value != null) {\n logger.throwArgumentError(\"cannot filter non-indexed parameters; must be null\", (\"contract.\" + param.name), value);\n }\n return;\n }\n if (value == null) {\n topics.push(null);\n }\n else if (param.baseType === \"array\" || param.baseType === \"tuple\") {\n logger.throwArgumentError(\"filtering with tuples or arrays not supported\", (\"contract.\" + param.name), value);\n }\n else if (Array.isArray(value)) {\n topics.push(value.map((value) => encodeTopic(param, value)));\n }\n else {\n topics.push(encodeTopic(param, value));\n }\n });\n // Trim off trailing nulls\n while (topics.length && topics[topics.length - 1] === null) {\n topics.pop();\n }\n return topics;\n }\n encodeEventLog(eventFragment, values) {\n if (typeof (eventFragment) === \"string\") {\n eventFragment = this.getEvent(eventFragment);\n }\n const topics = [];\n const dataTypes = [];\n const dataValues = [];\n if (!eventFragment.anonymous) {\n topics.push(this.getEventTopic(eventFragment));\n }\n if (values.length !== eventFragment.inputs.length) {\n logger.throwArgumentError(\"event arguments/values mismatch\", \"values\", values);\n }\n eventFragment.inputs.forEach((param, index) => {\n const value = values[index];\n if (param.indexed) {\n if (param.type === \"string\") {\n topics.push(id(value));\n }\n else if (param.type === \"bytes\") {\n topics.push(keccak256(value));\n }\n else if (param.baseType === \"tuple\" || param.baseType === \"array\") {\n // @TODO\n throw new Error(\"not implemented\");\n }\n else {\n topics.push(this._abiCoder.encode([param.type], [value]));\n }\n }\n else {\n dataTypes.push(param);\n dataValues.push(value);\n }\n });\n return {\n data: this._abiCoder.encode(dataTypes, dataValues),\n topics: topics\n };\n }\n // Decode a filter for the event and the search criteria\n decodeEventLog(eventFragment, data, topics) {\n if (typeof (eventFragment) === \"string\") {\n eventFragment = this.getEvent(eventFragment);\n }\n if (topics != null && !eventFragment.anonymous) {\n let topicHash = this.getEventTopic(eventFragment);\n if (!isHexString(topics[0], 32) || topics[0].toLowerCase() !== topicHash) {\n logger.throwError(\"fragment/topic mismatch\", Logger.errors.INVALID_ARGUMENT, { argument: \"topics[0]\", expected: topicHash, value: topics[0] });\n }\n topics = topics.slice(1);\n }\n let indexed = [];\n let nonIndexed = [];\n let dynamic = [];\n eventFragment.inputs.forEach((param, index) => {\n if (param.indexed) {\n if (param.type === \"string\" || param.type === \"bytes\" || param.baseType === \"tuple\" || param.baseType === \"array\") {\n indexed.push(ParamType.fromObject({ type: \"bytes32\", name: param.name }));\n dynamic.push(true);\n }\n else {\n indexed.push(param);\n dynamic.push(false);\n }\n }\n else {\n nonIndexed.push(param);\n dynamic.push(false);\n }\n });\n let resultIndexed = (topics != null) ? this._abiCoder.decode(indexed, concat(topics)) : null;\n let resultNonIndexed = this._abiCoder.decode(nonIndexed, data, true);\n let result = [];\n let nonIndexedIndex = 0, indexedIndex = 0;\n eventFragment.inputs.forEach((param, index) => {\n if (param.indexed) {\n if (resultIndexed == null) {\n result[index] = new Indexed({ _isIndexed: true, hash: null });\n }\n else if (dynamic[index]) {\n result[index] = new Indexed({ _isIndexed: true, hash: resultIndexed[indexedIndex++] });\n }\n else {\n try {\n result[index] = resultIndexed[indexedIndex++];\n }\n catch (error) {\n result[index] = error;\n }\n }\n }\n else {\n try {\n result[index] = resultNonIndexed[nonIndexedIndex++];\n }\n catch (error) {\n result[index] = error;\n }\n }\n // Add the keyword argument if named and safe\n if (param.name && result[param.name] == null) {\n const value = result[index];\n // Make error named values throw on access\n if (value instanceof Error) {\n Object.defineProperty(result, param.name, {\n enumerable: true,\n get: () => { throw wrapAccessError(`property ${JSON.stringify(param.name)}`, value); }\n });\n }\n else {\n result[param.name] = value;\n }\n }\n });\n // Make all error indexed values throw on access\n for (let i = 0; i < result.length; i++) {\n const value = result[i];\n if (value instanceof Error) {\n Object.defineProperty(result, i, {\n enumerable: true,\n get: () => { throw wrapAccessError(`index ${i}`, value); }\n });\n }\n }\n return Object.freeze(result);\n }\n // Given a transaction, find the matching function fragment (if any) and\n // determine all its properties and call parameters\n parseTransaction(tx) {\n let fragment = this.getFunction(tx.data.substring(0, 10).toLowerCase());\n if (!fragment) {\n return null;\n }\n return new TransactionDescription({\n args: this._abiCoder.decode(fragment.inputs, \"0x\" + tx.data.substring(10)),\n functionFragment: fragment,\n name: fragment.name,\n signature: fragment.format(),\n sighash: this.getSighash(fragment),\n value: BigNumber.from(tx.value || \"0\"),\n });\n }\n // @TODO\n //parseCallResult(data: BytesLike): ??\n // Given an event log, find the matching event fragment (if any) and\n // determine all its properties and values\n parseLog(log) {\n let fragment = this.getEvent(log.topics[0]);\n if (!fragment || fragment.anonymous) {\n return null;\n }\n // @TODO: If anonymous, and the only method, and the input count matches, should we parse?\n // Probably not, because just because it is the only event in the ABI does\n // not mean we have the full ABI; maybe just a fragment?\n return new LogDescription({\n eventFragment: fragment,\n name: fragment.name,\n signature: fragment.format(),\n topic: this.getEventTopic(fragment),\n args: this.decodeEventLog(fragment, log.data, log.topics)\n });\n }\n parseError(data) {\n const hexData = hexlify(data);\n let fragment = this.getError(hexData.substring(0, 10).toLowerCase());\n if (!fragment) {\n return null;\n }\n return new ErrorDescription({\n args: this._abiCoder.decode(fragment.inputs, \"0x\" + hexData.substring(10)),\n errorFragment: fragment,\n name: fragment.name,\n signature: fragment.format(),\n sighash: this.getSighash(fragment),\n });\n }\n /*\n static from(value: Array | string | Interface) {\n if (Interface.isInterface(value)) {\n return value;\n }\n if (typeof(value) === \"string\") {\n return new Interface(JSON.parse(value));\n }\n return new Interface(value);\n }\n */\n static isInterface(value) {\n return !!(value && value._isInterface);\n }\n}\n//# sourceMappingURL=interface.js.map","export const version = \"abstract-provider/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { isHexString } from \"@ethersproject/bytes\";\nimport { Description, defineReadOnly, resolveProperties } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n;\n;\n//export type CallTransactionable = {\n// call(transaction: TransactionRequest): Promise;\n//};\nexport class ForkEvent extends Description {\n static isForkEvent(value) {\n return !!(value && value._isForkEvent);\n }\n}\nexport class BlockForkEvent extends ForkEvent {\n constructor(blockHash, expiry) {\n if (!isHexString(blockHash, 32)) {\n logger.throwArgumentError(\"invalid blockHash\", \"blockHash\", blockHash);\n }\n super({\n _isForkEvent: true,\n _isBlockForkEvent: true,\n expiry: (expiry || 0),\n blockHash: blockHash\n });\n }\n}\nexport class TransactionForkEvent extends ForkEvent {\n constructor(hash, expiry) {\n if (!isHexString(hash, 32)) {\n logger.throwArgumentError(\"invalid transaction hash\", \"hash\", hash);\n }\n super({\n _isForkEvent: true,\n _isTransactionForkEvent: true,\n expiry: (expiry || 0),\n hash: hash\n });\n }\n}\nexport class TransactionOrderForkEvent extends ForkEvent {\n constructor(beforeHash, afterHash, expiry) {\n if (!isHexString(beforeHash, 32)) {\n logger.throwArgumentError(\"invalid transaction hash\", \"beforeHash\", beforeHash);\n }\n if (!isHexString(afterHash, 32)) {\n logger.throwArgumentError(\"invalid transaction hash\", \"afterHash\", afterHash);\n }\n super({\n _isForkEvent: true,\n _isTransactionOrderForkEvent: true,\n expiry: (expiry || 0),\n beforeHash: beforeHash,\n afterHash: afterHash\n });\n }\n}\n///////////////////////////////\n// Exported Abstracts\nexport class Provider {\n constructor() {\n logger.checkAbstract(new.target, Provider);\n defineReadOnly(this, \"_isProvider\", true);\n }\n getFeeData() {\n return __awaiter(this, void 0, void 0, function* () {\n const { block, gasPrice } = yield resolveProperties({\n block: this.getBlock(\"latest\"),\n gasPrice: this.getGasPrice().catch((error) => {\n // @TODO: Why is this now failing on Calaveras?\n //console.log(error);\n return null;\n })\n });\n let lastBaseFeePerGas = null, maxFeePerGas = null, maxPriorityFeePerGas = null;\n if (block && block.baseFeePerGas) {\n // We may want to compute this more accurately in the future,\n // using the formula \"check if the base fee is correct\".\n // See: https://eips.ethereum.org/EIPS/eip-1559\n lastBaseFeePerGas = block.baseFeePerGas;\n maxPriorityFeePerGas = BigNumber.from(\"1500000000\");\n maxFeePerGas = block.baseFeePerGas.mul(2).add(maxPriorityFeePerGas);\n }\n return { lastBaseFeePerGas, maxFeePerGas, maxPriorityFeePerGas, gasPrice };\n });\n }\n // Alias for \"on\"\n addListener(eventName, listener) {\n return this.on(eventName, listener);\n }\n // Alias for \"off\"\n removeListener(eventName, listener) {\n return this.off(eventName, listener);\n }\n static isProvider(value) {\n return !!(value && value._isProvider);\n }\n}\n//# sourceMappingURL=index.js.map","export const version = \"abstract-signer/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { defineReadOnly, resolveProperties, shallowCopy } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nconst allowedTransactionKeys = [\n \"accessList\", \"ccipReadEnabled\", \"chainId\", \"customData\", \"data\", \"from\", \"gasLimit\", \"gasPrice\", \"maxFeePerGas\", \"maxPriorityFeePerGas\", \"nonce\", \"to\", \"type\", \"value\"\n];\nconst forwardErrors = [\n Logger.errors.INSUFFICIENT_FUNDS,\n Logger.errors.NONCE_EXPIRED,\n Logger.errors.REPLACEMENT_UNDERPRICED,\n];\n;\n;\nexport class Signer {\n ///////////////////\n // Sub-classes MUST call super\n constructor() {\n logger.checkAbstract(new.target, Signer);\n defineReadOnly(this, \"_isSigner\", true);\n }\n ///////////////////\n // Sub-classes MAY override these\n getBalance(blockTag) {\n return __awaiter(this, void 0, void 0, function* () {\n this._checkProvider(\"getBalance\");\n return yield this.provider.getBalance(this.getAddress(), blockTag);\n });\n }\n getTransactionCount(blockTag) {\n return __awaiter(this, void 0, void 0, function* () {\n this._checkProvider(\"getTransactionCount\");\n return yield this.provider.getTransactionCount(this.getAddress(), blockTag);\n });\n }\n // Populates \"from\" if unspecified, and estimates the gas for the transaction\n estimateGas(transaction) {\n return __awaiter(this, void 0, void 0, function* () {\n this._checkProvider(\"estimateGas\");\n const tx = yield resolveProperties(this.checkTransaction(transaction));\n return yield this.provider.estimateGas(tx);\n });\n }\n // Populates \"from\" if unspecified, and calls with the transaction\n call(transaction, blockTag) {\n return __awaiter(this, void 0, void 0, function* () {\n this._checkProvider(\"call\");\n const tx = yield resolveProperties(this.checkTransaction(transaction));\n return yield this.provider.call(tx, blockTag);\n });\n }\n // Populates all fields in a transaction, signs it and sends it to the network\n sendTransaction(transaction) {\n return __awaiter(this, void 0, void 0, function* () {\n this._checkProvider(\"sendTransaction\");\n const tx = yield this.populateTransaction(transaction);\n const signedTx = yield this.signTransaction(tx);\n return yield this.provider.sendTransaction(signedTx);\n });\n }\n getChainId() {\n return __awaiter(this, void 0, void 0, function* () {\n this._checkProvider(\"getChainId\");\n const network = yield this.provider.getNetwork();\n return network.chainId;\n });\n }\n getGasPrice() {\n return __awaiter(this, void 0, void 0, function* () {\n this._checkProvider(\"getGasPrice\");\n return yield this.provider.getGasPrice();\n });\n }\n getFeeData() {\n return __awaiter(this, void 0, void 0, function* () {\n this._checkProvider(\"getFeeData\");\n return yield this.provider.getFeeData();\n });\n }\n resolveName(name) {\n return __awaiter(this, void 0, void 0, function* () {\n this._checkProvider(\"resolveName\");\n return yield this.provider.resolveName(name);\n });\n }\n // Checks a transaction does not contain invalid keys and if\n // no \"from\" is provided, populates it.\n // - does NOT require a provider\n // - adds \"from\" is not present\n // - returns a COPY (safe to mutate the result)\n // By default called from: (overriding these prevents it)\n // - call\n // - estimateGas\n // - populateTransaction (and therefor sendTransaction)\n checkTransaction(transaction) {\n for (const key in transaction) {\n if (allowedTransactionKeys.indexOf(key) === -1) {\n logger.throwArgumentError(\"invalid transaction key: \" + key, \"transaction\", transaction);\n }\n }\n const tx = shallowCopy(transaction);\n if (tx.from == null) {\n tx.from = this.getAddress();\n }\n else {\n // Make sure any provided address matches this signer\n tx.from = Promise.all([\n Promise.resolve(tx.from),\n this.getAddress()\n ]).then((result) => {\n if (result[0].toLowerCase() !== result[1].toLowerCase()) {\n logger.throwArgumentError(\"from address mismatch\", \"transaction\", transaction);\n }\n return result[0];\n });\n }\n return tx;\n }\n // Populates ALL keys for a transaction and checks that \"from\" matches\n // this Signer. Should be used by sendTransaction but NOT by signTransaction.\n // By default called from: (overriding these prevents it)\n // - sendTransaction\n //\n // Notes:\n // - We allow gasPrice for EIP-1559 as long as it matches maxFeePerGas\n populateTransaction(transaction) {\n return __awaiter(this, void 0, void 0, function* () {\n const tx = yield resolveProperties(this.checkTransaction(transaction));\n if (tx.to != null) {\n tx.to = Promise.resolve(tx.to).then((to) => __awaiter(this, void 0, void 0, function* () {\n if (to == null) {\n return null;\n }\n const address = yield this.resolveName(to);\n if (address == null) {\n logger.throwArgumentError(\"provided ENS name resolves to null\", \"tx.to\", to);\n }\n return address;\n }));\n // Prevent this error from causing an UnhandledPromiseException\n tx.to.catch((error) => { });\n }\n // Do not allow mixing pre-eip-1559 and eip-1559 properties\n const hasEip1559 = (tx.maxFeePerGas != null || tx.maxPriorityFeePerGas != null);\n if (tx.gasPrice != null && (tx.type === 2 || hasEip1559)) {\n logger.throwArgumentError(\"eip-1559 transaction do not support gasPrice\", \"transaction\", transaction);\n }\n else if ((tx.type === 0 || tx.type === 1) && hasEip1559) {\n logger.throwArgumentError(\"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas\", \"transaction\", transaction);\n }\n if ((tx.type === 2 || tx.type == null) && (tx.maxFeePerGas != null && tx.maxPriorityFeePerGas != null)) {\n // Fully-formed EIP-1559 transaction (skip getFeeData)\n tx.type = 2;\n }\n else if (tx.type === 0 || tx.type === 1) {\n // Explicit Legacy or EIP-2930 transaction\n // Populate missing gasPrice\n if (tx.gasPrice == null) {\n tx.gasPrice = this.getGasPrice();\n }\n }\n else {\n // We need to get fee data to determine things\n const feeData = yield this.getFeeData();\n if (tx.type == null) {\n // We need to auto-detect the intended type of this transaction...\n if (feeData.maxFeePerGas != null && feeData.maxPriorityFeePerGas != null) {\n // The network supports EIP-1559!\n // Upgrade transaction from null to eip-1559\n tx.type = 2;\n if (tx.gasPrice != null) {\n // Using legacy gasPrice property on an eip-1559 network,\n // so use gasPrice as both fee properties\n const gasPrice = tx.gasPrice;\n delete tx.gasPrice;\n tx.maxFeePerGas = gasPrice;\n tx.maxPriorityFeePerGas = gasPrice;\n }\n else {\n // Populate missing fee data\n if (tx.maxFeePerGas == null) {\n tx.maxFeePerGas = feeData.maxFeePerGas;\n }\n if (tx.maxPriorityFeePerGas == null) {\n tx.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas;\n }\n }\n }\n else if (feeData.gasPrice != null) {\n // Network doesn't support EIP-1559...\n // ...but they are trying to use EIP-1559 properties\n if (hasEip1559) {\n logger.throwError(\"network does not support EIP-1559\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"populateTransaction\"\n });\n }\n // Populate missing fee data\n if (tx.gasPrice == null) {\n tx.gasPrice = feeData.gasPrice;\n }\n // Explicitly set untyped transaction to legacy\n tx.type = 0;\n }\n else {\n // getFeeData has failed us.\n logger.throwError(\"failed to get consistent fee data\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"signer.getFeeData\"\n });\n }\n }\n else if (tx.type === 2) {\n // Explicitly using EIP-1559\n // Populate missing fee data\n if (tx.maxFeePerGas == null) {\n tx.maxFeePerGas = feeData.maxFeePerGas;\n }\n if (tx.maxPriorityFeePerGas == null) {\n tx.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas;\n }\n }\n }\n if (tx.nonce == null) {\n tx.nonce = this.getTransactionCount(\"pending\");\n }\n if (tx.gasLimit == null) {\n tx.gasLimit = this.estimateGas(tx).catch((error) => {\n if (forwardErrors.indexOf(error.code) >= 0) {\n throw error;\n }\n return logger.throwError(\"cannot estimate gas; transaction may fail or may require manual gas limit\", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {\n error: error,\n tx: tx\n });\n });\n }\n if (tx.chainId == null) {\n tx.chainId = this.getChainId();\n }\n else {\n tx.chainId = Promise.all([\n Promise.resolve(tx.chainId),\n this.getChainId()\n ]).then((results) => {\n if (results[1] !== 0 && results[0] !== results[1]) {\n logger.throwArgumentError(\"chainId address mismatch\", \"transaction\", transaction);\n }\n return results[0];\n });\n }\n return yield resolveProperties(tx);\n });\n }\n ///////////////////\n // Sub-classes SHOULD leave these alone\n _checkProvider(operation) {\n if (!this.provider) {\n logger.throwError(\"missing provider\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: (operation || \"_checkProvider\")\n });\n }\n }\n static isSigner(value) {\n return !!(value && value._isSigner);\n }\n}\nexport class VoidSigner extends Signer {\n constructor(address, provider) {\n super();\n defineReadOnly(this, \"address\", address);\n defineReadOnly(this, \"provider\", provider || null);\n }\n getAddress() {\n return Promise.resolve(this.address);\n }\n _fail(message, operation) {\n return Promise.resolve().then(() => {\n logger.throwError(message, Logger.errors.UNSUPPORTED_OPERATION, { operation: operation });\n });\n }\n signMessage(message) {\n return this._fail(\"VoidSigner cannot sign messages\", \"signMessage\");\n }\n signTransaction(transaction) {\n return this._fail(\"VoidSigner cannot sign transactions\", \"signTransaction\");\n }\n _signTypedData(domain, types, value) {\n return this._fail(\"VoidSigner cannot sign typed data\", \"signTypedData\");\n }\n connect(provider) {\n return new VoidSigner(this.address, provider);\n }\n}\n//# sourceMappingURL=index.js.map","export const version = \"transactions/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nimport { getAddress } from \"@ethersproject/address\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { arrayify, hexConcat, hexDataLength, hexDataSlice, hexlify, hexZeroPad, isBytesLike, splitSignature, stripZeros, } from \"@ethersproject/bytes\";\nimport { Zero } from \"@ethersproject/constants\";\nimport { keccak256 } from \"@ethersproject/keccak256\";\nimport { checkProperties } from \"@ethersproject/properties\";\nimport * as RLP from \"@ethersproject/rlp\";\nimport { computePublicKey, recoverPublicKey } from \"@ethersproject/signing-key\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nexport var TransactionTypes;\n(function (TransactionTypes) {\n TransactionTypes[TransactionTypes[\"legacy\"] = 0] = \"legacy\";\n TransactionTypes[TransactionTypes[\"eip2930\"] = 1] = \"eip2930\";\n TransactionTypes[TransactionTypes[\"eip1559\"] = 2] = \"eip1559\";\n})(TransactionTypes || (TransactionTypes = {}));\n;\n///////////////////////////////\nfunction handleAddress(value) {\n if (value === \"0x\") {\n return null;\n }\n return getAddress(value);\n}\nfunction handleNumber(value) {\n if (value === \"0x\") {\n return Zero;\n }\n return BigNumber.from(value);\n}\n// Legacy Transaction Fields\nconst transactionFields = [\n { name: \"nonce\", maxLength: 32, numeric: true },\n { name: \"gasPrice\", maxLength: 32, numeric: true },\n { name: \"gasLimit\", maxLength: 32, numeric: true },\n { name: \"to\", length: 20 },\n { name: \"value\", maxLength: 32, numeric: true },\n { name: \"data\" },\n];\nconst allowedTransactionKeys = {\n chainId: true, data: true, gasLimit: true, gasPrice: true, nonce: true, to: true, type: true, value: true\n};\nexport function computeAddress(key) {\n const publicKey = computePublicKey(key);\n return getAddress(hexDataSlice(keccak256(hexDataSlice(publicKey, 1)), 12));\n}\nexport function recoverAddress(digest, signature) {\n return computeAddress(recoverPublicKey(arrayify(digest), signature));\n}\nfunction formatNumber(value, name) {\n const result = stripZeros(BigNumber.from(value).toHexString());\n if (result.length > 32) {\n logger.throwArgumentError(\"invalid length for \" + name, (\"transaction:\" + name), value);\n }\n return result;\n}\nfunction accessSetify(addr, storageKeys) {\n return {\n address: getAddress(addr),\n storageKeys: (storageKeys || []).map((storageKey, index) => {\n if (hexDataLength(storageKey) !== 32) {\n logger.throwArgumentError(\"invalid access list storageKey\", `accessList[${addr}:${index}]`, storageKey);\n }\n return storageKey.toLowerCase();\n })\n };\n}\nexport function accessListify(value) {\n if (Array.isArray(value)) {\n return value.map((set, index) => {\n if (Array.isArray(set)) {\n if (set.length > 2) {\n logger.throwArgumentError(\"access list expected to be [ address, storageKeys[] ]\", `value[${index}]`, set);\n }\n return accessSetify(set[0], set[1]);\n }\n return accessSetify(set.address, set.storageKeys);\n });\n }\n const result = Object.keys(value).map((addr) => {\n const storageKeys = value[addr].reduce((accum, storageKey) => {\n accum[storageKey] = true;\n return accum;\n }, {});\n return accessSetify(addr, Object.keys(storageKeys).sort());\n });\n result.sort((a, b) => (a.address.localeCompare(b.address)));\n return result;\n}\nfunction formatAccessList(value) {\n return accessListify(value).map((set) => [set.address, set.storageKeys]);\n}\nfunction _serializeEip1559(transaction, signature) {\n // If there is an explicit gasPrice, make sure it matches the\n // EIP-1559 fees; otherwise they may not understand what they\n // think they are setting in terms of fee.\n if (transaction.gasPrice != null) {\n const gasPrice = BigNumber.from(transaction.gasPrice);\n const maxFeePerGas = BigNumber.from(transaction.maxFeePerGas || 0);\n if (!gasPrice.eq(maxFeePerGas)) {\n logger.throwArgumentError(\"mismatch EIP-1559 gasPrice != maxFeePerGas\", \"tx\", {\n gasPrice, maxFeePerGas\n });\n }\n }\n const fields = [\n formatNumber(transaction.chainId || 0, \"chainId\"),\n formatNumber(transaction.nonce || 0, \"nonce\"),\n formatNumber(transaction.maxPriorityFeePerGas || 0, \"maxPriorityFeePerGas\"),\n formatNumber(transaction.maxFeePerGas || 0, \"maxFeePerGas\"),\n formatNumber(transaction.gasLimit || 0, \"gasLimit\"),\n ((transaction.to != null) ? getAddress(transaction.to) : \"0x\"),\n formatNumber(transaction.value || 0, \"value\"),\n (transaction.data || \"0x\"),\n (formatAccessList(transaction.accessList || []))\n ];\n if (signature) {\n const sig = splitSignature(signature);\n fields.push(formatNumber(sig.recoveryParam, \"recoveryParam\"));\n fields.push(stripZeros(sig.r));\n fields.push(stripZeros(sig.s));\n }\n return hexConcat([\"0x02\", RLP.encode(fields)]);\n}\nfunction _serializeEip2930(transaction, signature) {\n const fields = [\n formatNumber(transaction.chainId || 0, \"chainId\"),\n formatNumber(transaction.nonce || 0, \"nonce\"),\n formatNumber(transaction.gasPrice || 0, \"gasPrice\"),\n formatNumber(transaction.gasLimit || 0, \"gasLimit\"),\n ((transaction.to != null) ? getAddress(transaction.to) : \"0x\"),\n formatNumber(transaction.value || 0, \"value\"),\n (transaction.data || \"0x\"),\n (formatAccessList(transaction.accessList || []))\n ];\n if (signature) {\n const sig = splitSignature(signature);\n fields.push(formatNumber(sig.recoveryParam, \"recoveryParam\"));\n fields.push(stripZeros(sig.r));\n fields.push(stripZeros(sig.s));\n }\n return hexConcat([\"0x01\", RLP.encode(fields)]);\n}\n// Legacy Transactions and EIP-155\nfunction _serialize(transaction, signature) {\n checkProperties(transaction, allowedTransactionKeys);\n const raw = [];\n transactionFields.forEach(function (fieldInfo) {\n let value = transaction[fieldInfo.name] || ([]);\n const options = {};\n if (fieldInfo.numeric) {\n options.hexPad = \"left\";\n }\n value = arrayify(hexlify(value, options));\n // Fixed-width field\n if (fieldInfo.length && value.length !== fieldInfo.length && value.length > 0) {\n logger.throwArgumentError(\"invalid length for \" + fieldInfo.name, (\"transaction:\" + fieldInfo.name), value);\n }\n // Variable-width (with a maximum)\n if (fieldInfo.maxLength) {\n value = stripZeros(value);\n if (value.length > fieldInfo.maxLength) {\n logger.throwArgumentError(\"invalid length for \" + fieldInfo.name, (\"transaction:\" + fieldInfo.name), value);\n }\n }\n raw.push(hexlify(value));\n });\n let chainId = 0;\n if (transaction.chainId != null) {\n // A chainId was provided; if non-zero we'll use EIP-155\n chainId = transaction.chainId;\n if (typeof (chainId) !== \"number\") {\n logger.throwArgumentError(\"invalid transaction.chainId\", \"transaction\", transaction);\n }\n }\n else if (signature && !isBytesLike(signature) && signature.v > 28) {\n // No chainId provided, but the signature is signing with EIP-155; derive chainId\n chainId = Math.floor((signature.v - 35) / 2);\n }\n // We have an EIP-155 transaction (chainId was specified and non-zero)\n if (chainId !== 0) {\n raw.push(hexlify(chainId)); // @TODO: hexValue?\n raw.push(\"0x\");\n raw.push(\"0x\");\n }\n // Requesting an unsigned transaction\n if (!signature) {\n return RLP.encode(raw);\n }\n // The splitSignature will ensure the transaction has a recoveryParam in the\n // case that the signTransaction function only adds a v.\n const sig = splitSignature(signature);\n // We pushed a chainId and null r, s on for hashing only; remove those\n let v = 27 + sig.recoveryParam;\n if (chainId !== 0) {\n raw.pop();\n raw.pop();\n raw.pop();\n v += chainId * 2 + 8;\n // If an EIP-155 v (directly or indirectly; maybe _vs) was provided, check it!\n if (sig.v > 28 && sig.v !== v) {\n logger.throwArgumentError(\"transaction.chainId/signature.v mismatch\", \"signature\", signature);\n }\n }\n else if (sig.v !== v) {\n logger.throwArgumentError(\"transaction.chainId/signature.v mismatch\", \"signature\", signature);\n }\n raw.push(hexlify(v));\n raw.push(stripZeros(arrayify(sig.r)));\n raw.push(stripZeros(arrayify(sig.s)));\n return RLP.encode(raw);\n}\nexport function serialize(transaction, signature) {\n // Legacy and EIP-155 Transactions\n if (transaction.type == null || transaction.type === 0) {\n if (transaction.accessList != null) {\n logger.throwArgumentError(\"untyped transactions do not support accessList; include type: 1\", \"transaction\", transaction);\n }\n return _serialize(transaction, signature);\n }\n // Typed Transactions (EIP-2718)\n switch (transaction.type) {\n case 1:\n return _serializeEip2930(transaction, signature);\n case 2:\n return _serializeEip1559(transaction, signature);\n default:\n break;\n }\n return logger.throwError(`unsupported transaction type: ${transaction.type}`, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"serializeTransaction\",\n transactionType: transaction.type\n });\n}\nfunction _parseEipSignature(tx, fields, serialize) {\n try {\n const recid = handleNumber(fields[0]).toNumber();\n if (recid !== 0 && recid !== 1) {\n throw new Error(\"bad recid\");\n }\n tx.v = recid;\n }\n catch (error) {\n logger.throwArgumentError(\"invalid v for transaction type: 1\", \"v\", fields[0]);\n }\n tx.r = hexZeroPad(fields[1], 32);\n tx.s = hexZeroPad(fields[2], 32);\n try {\n const digest = keccak256(serialize(tx));\n tx.from = recoverAddress(digest, { r: tx.r, s: tx.s, recoveryParam: tx.v });\n }\n catch (error) { }\n}\nfunction _parseEip1559(payload) {\n const transaction = RLP.decode(payload.slice(1));\n if (transaction.length !== 9 && transaction.length !== 12) {\n logger.throwArgumentError(\"invalid component count for transaction type: 2\", \"payload\", hexlify(payload));\n }\n const maxPriorityFeePerGas = handleNumber(transaction[2]);\n const maxFeePerGas = handleNumber(transaction[3]);\n const tx = {\n type: 2,\n chainId: handleNumber(transaction[0]).toNumber(),\n nonce: handleNumber(transaction[1]).toNumber(),\n maxPriorityFeePerGas: maxPriorityFeePerGas,\n maxFeePerGas: maxFeePerGas,\n gasPrice: null,\n gasLimit: handleNumber(transaction[4]),\n to: handleAddress(transaction[5]),\n value: handleNumber(transaction[6]),\n data: transaction[7],\n accessList: accessListify(transaction[8]),\n };\n // Unsigned EIP-1559 Transaction\n if (transaction.length === 9) {\n return tx;\n }\n tx.hash = keccak256(payload);\n _parseEipSignature(tx, transaction.slice(9), _serializeEip1559);\n return tx;\n}\nfunction _parseEip2930(payload) {\n const transaction = RLP.decode(payload.slice(1));\n if (transaction.length !== 8 && transaction.length !== 11) {\n logger.throwArgumentError(\"invalid component count for transaction type: 1\", \"payload\", hexlify(payload));\n }\n const tx = {\n type: 1,\n chainId: handleNumber(transaction[0]).toNumber(),\n nonce: handleNumber(transaction[1]).toNumber(),\n gasPrice: handleNumber(transaction[2]),\n gasLimit: handleNumber(transaction[3]),\n to: handleAddress(transaction[4]),\n value: handleNumber(transaction[5]),\n data: transaction[6],\n accessList: accessListify(transaction[7])\n };\n // Unsigned EIP-2930 Transaction\n if (transaction.length === 8) {\n return tx;\n }\n tx.hash = keccak256(payload);\n _parseEipSignature(tx, transaction.slice(8), _serializeEip2930);\n return tx;\n}\n// Legacy Transactions and EIP-155\nfunction _parse(rawTransaction) {\n const transaction = RLP.decode(rawTransaction);\n if (transaction.length !== 9 && transaction.length !== 6) {\n logger.throwArgumentError(\"invalid raw transaction\", \"rawTransaction\", rawTransaction);\n }\n const tx = {\n nonce: handleNumber(transaction[0]).toNumber(),\n gasPrice: handleNumber(transaction[1]),\n gasLimit: handleNumber(transaction[2]),\n to: handleAddress(transaction[3]),\n value: handleNumber(transaction[4]),\n data: transaction[5],\n chainId: 0\n };\n // Legacy unsigned transaction\n if (transaction.length === 6) {\n return tx;\n }\n try {\n tx.v = BigNumber.from(transaction[6]).toNumber();\n }\n catch (error) {\n // @TODO: What makes snese to do? The v is too big\n return tx;\n }\n tx.r = hexZeroPad(transaction[7], 32);\n tx.s = hexZeroPad(transaction[8], 32);\n if (BigNumber.from(tx.r).isZero() && BigNumber.from(tx.s).isZero()) {\n // EIP-155 unsigned transaction\n tx.chainId = tx.v;\n tx.v = 0;\n }\n else {\n // Signed Transaction\n tx.chainId = Math.floor((tx.v - 35) / 2);\n if (tx.chainId < 0) {\n tx.chainId = 0;\n }\n let recoveryParam = tx.v - 27;\n const raw = transaction.slice(0, 6);\n if (tx.chainId !== 0) {\n raw.push(hexlify(tx.chainId));\n raw.push(\"0x\");\n raw.push(\"0x\");\n recoveryParam -= tx.chainId * 2 + 8;\n }\n const digest = keccak256(RLP.encode(raw));\n try {\n tx.from = recoverAddress(digest, { r: hexlify(tx.r), s: hexlify(tx.s), recoveryParam: recoveryParam });\n }\n catch (error) { }\n tx.hash = keccak256(rawTransaction);\n }\n tx.type = null;\n return tx;\n}\nexport function parse(rawTransaction) {\n const payload = arrayify(rawTransaction);\n // Legacy and EIP-155 Transactions\n if (payload[0] > 0x7f) {\n return _parse(payload);\n }\n // Typed Transaction (EIP-2718)\n switch (payload[0]) {\n case 1:\n return _parseEip2930(payload);\n case 2:\n return _parseEip1559(payload);\n default:\n break;\n }\n return logger.throwError(`unsupported transaction type: ${payload[0]}`, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"parseTransaction\",\n transactionType: payload[0]\n });\n}\n//# sourceMappingURL=index.js.map","export const version = \"contracts/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { checkResultErrors, Indexed, Interface } from \"@ethersproject/abi\";\nimport { Provider } from \"@ethersproject/abstract-provider\";\nimport { Signer, VoidSigner } from \"@ethersproject/abstract-signer\";\nimport { getAddress, getContractAddress } from \"@ethersproject/address\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { arrayify, concat, hexlify, isBytes, isHexString } from \"@ethersproject/bytes\";\nimport { defineReadOnly, deepCopy, getStatic, resolveProperties, shallowCopy } from \"@ethersproject/properties\";\nimport { accessListify } from \"@ethersproject/transactions\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n;\n;\n///////////////////////////////\nconst allowedTransactionKeys = {\n chainId: true, data: true, from: true, gasLimit: true, gasPrice: true, nonce: true, to: true, value: true,\n type: true, accessList: true,\n maxFeePerGas: true, maxPriorityFeePerGas: true,\n customData: true,\n ccipReadEnabled: true\n};\nfunction resolveName(resolver, nameOrPromise) {\n return __awaiter(this, void 0, void 0, function* () {\n const name = yield nameOrPromise;\n if (typeof (name) !== \"string\") {\n logger.throwArgumentError(\"invalid address or ENS name\", \"name\", name);\n }\n // If it is already an address, just use it (after adding checksum)\n try {\n return getAddress(name);\n }\n catch (error) { }\n if (!resolver) {\n logger.throwError(\"a provider or signer is needed to resolve ENS names\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"resolveName\"\n });\n }\n const address = yield resolver.resolveName(name);\n if (address == null) {\n logger.throwArgumentError(\"resolver or addr is not configured for ENS name\", \"name\", name);\n }\n return address;\n });\n}\n// Recursively replaces ENS names with promises to resolve the name and resolves all properties\nfunction resolveAddresses(resolver, value, paramType) {\n return __awaiter(this, void 0, void 0, function* () {\n if (Array.isArray(paramType)) {\n return yield Promise.all(paramType.map((paramType, index) => {\n return resolveAddresses(resolver, ((Array.isArray(value)) ? value[index] : value[paramType.name]), paramType);\n }));\n }\n if (paramType.type === \"address\") {\n return yield resolveName(resolver, value);\n }\n if (paramType.type === \"tuple\") {\n return yield resolveAddresses(resolver, value, paramType.components);\n }\n if (paramType.baseType === \"array\") {\n if (!Array.isArray(value)) {\n return Promise.reject(logger.makeError(\"invalid value for array\", Logger.errors.INVALID_ARGUMENT, {\n argument: \"value\",\n value\n }));\n }\n return yield Promise.all(value.map((v) => resolveAddresses(resolver, v, paramType.arrayChildren)));\n }\n return value;\n });\n}\nfunction populateTransaction(contract, fragment, args) {\n return __awaiter(this, void 0, void 0, function* () {\n // If an extra argument is given, it is overrides\n let overrides = {};\n if (args.length === fragment.inputs.length + 1 && typeof (args[args.length - 1]) === \"object\") {\n overrides = shallowCopy(args.pop());\n }\n // Make sure the parameter count matches\n logger.checkArgumentCount(args.length, fragment.inputs.length, \"passed to contract\");\n // Populate \"from\" override (allow promises)\n if (contract.signer) {\n if (overrides.from) {\n // Contracts with a Signer are from the Signer's frame-of-reference;\n // but we allow overriding \"from\" if it matches the signer\n overrides.from = resolveProperties({\n override: resolveName(contract.signer, overrides.from),\n signer: contract.signer.getAddress()\n }).then((check) => __awaiter(this, void 0, void 0, function* () {\n if (getAddress(check.signer) !== check.override) {\n logger.throwError(\"Contract with a Signer cannot override from\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"overrides.from\"\n });\n }\n return check.override;\n }));\n }\n else {\n overrides.from = contract.signer.getAddress();\n }\n }\n else if (overrides.from) {\n overrides.from = resolveName(contract.provider, overrides.from);\n //} else {\n // Contracts without a signer can override \"from\", and if\n // unspecified the zero address is used\n //overrides.from = AddressZero;\n }\n // Wait for all dependencies to be resolved (prefer the signer over the provider)\n const resolved = yield resolveProperties({\n args: resolveAddresses(contract.signer || contract.provider, args, fragment.inputs),\n address: contract.resolvedAddress,\n overrides: (resolveProperties(overrides) || {})\n });\n // The ABI coded transaction\n const data = contract.interface.encodeFunctionData(fragment, resolved.args);\n const tx = {\n data: data,\n to: resolved.address\n };\n // Resolved Overrides\n const ro = resolved.overrides;\n // Populate simple overrides\n if (ro.nonce != null) {\n tx.nonce = BigNumber.from(ro.nonce).toNumber();\n }\n if (ro.gasLimit != null) {\n tx.gasLimit = BigNumber.from(ro.gasLimit);\n }\n if (ro.gasPrice != null) {\n tx.gasPrice = BigNumber.from(ro.gasPrice);\n }\n if (ro.maxFeePerGas != null) {\n tx.maxFeePerGas = BigNumber.from(ro.maxFeePerGas);\n }\n if (ro.maxPriorityFeePerGas != null) {\n tx.maxPriorityFeePerGas = BigNumber.from(ro.maxPriorityFeePerGas);\n }\n if (ro.from != null) {\n tx.from = ro.from;\n }\n if (ro.type != null) {\n tx.type = ro.type;\n }\n if (ro.accessList != null) {\n tx.accessList = accessListify(ro.accessList);\n }\n // If there was no \"gasLimit\" override, but the ABI specifies a default, use it\n if (tx.gasLimit == null && fragment.gas != null) {\n // Compute the intrinsic gas cost for this transaction\n // @TODO: This is based on the yellow paper as of Petersburg; this is something\n // we may wish to parameterize in v6 as part of the Network object. Since this\n // is always a non-nil to address, we can ignore G_create, but may wish to add\n // similar logic to the ContractFactory.\n let intrinsic = 21000;\n const bytes = arrayify(data);\n for (let i = 0; i < bytes.length; i++) {\n intrinsic += 4;\n if (bytes[i]) {\n intrinsic += 64;\n }\n }\n tx.gasLimit = BigNumber.from(fragment.gas).add(intrinsic);\n }\n // Populate \"value\" override\n if (ro.value) {\n const roValue = BigNumber.from(ro.value);\n if (!roValue.isZero() && !fragment.payable) {\n logger.throwError(\"non-payable method cannot override value\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"overrides.value\",\n value: overrides.value\n });\n }\n tx.value = roValue;\n }\n if (ro.customData) {\n tx.customData = shallowCopy(ro.customData);\n }\n if (ro.ccipReadEnabled) {\n tx.ccipReadEnabled = !!ro.ccipReadEnabled;\n }\n // Remove the overrides\n delete overrides.nonce;\n delete overrides.gasLimit;\n delete overrides.gasPrice;\n delete overrides.from;\n delete overrides.value;\n delete overrides.type;\n delete overrides.accessList;\n delete overrides.maxFeePerGas;\n delete overrides.maxPriorityFeePerGas;\n delete overrides.customData;\n delete overrides.ccipReadEnabled;\n // Make sure there are no stray overrides, which may indicate a\n // typo or using an unsupported key.\n const leftovers = Object.keys(overrides).filter((key) => (overrides[key] != null));\n if (leftovers.length) {\n logger.throwError(`cannot override ${leftovers.map((l) => JSON.stringify(l)).join(\",\")}`, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"overrides\",\n overrides: leftovers\n });\n }\n return tx;\n });\n}\nfunction buildPopulate(contract, fragment) {\n return function (...args) {\n return populateTransaction(contract, fragment, args);\n };\n}\nfunction buildEstimate(contract, fragment) {\n const signerOrProvider = (contract.signer || contract.provider);\n return function (...args) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!signerOrProvider) {\n logger.throwError(\"estimate require a provider or signer\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"estimateGas\"\n });\n }\n const tx = yield populateTransaction(contract, fragment, args);\n return yield signerOrProvider.estimateGas(tx);\n });\n };\n}\nfunction addContractWait(contract, tx) {\n const wait = tx.wait.bind(tx);\n tx.wait = (confirmations) => {\n return wait(confirmations).then((receipt) => {\n receipt.events = receipt.logs.map((log) => {\n let event = deepCopy(log);\n let parsed = null;\n try {\n parsed = contract.interface.parseLog(log);\n }\n catch (e) { }\n // Successfully parsed the event log; include it\n if (parsed) {\n event.args = parsed.args;\n event.decode = (data, topics) => {\n return contract.interface.decodeEventLog(parsed.eventFragment, data, topics);\n };\n event.event = parsed.name;\n event.eventSignature = parsed.signature;\n }\n // Useful operations\n event.removeListener = () => { return contract.provider; };\n event.getBlock = () => {\n return contract.provider.getBlock(receipt.blockHash);\n };\n event.getTransaction = () => {\n return contract.provider.getTransaction(receipt.transactionHash);\n };\n event.getTransactionReceipt = () => {\n return Promise.resolve(receipt);\n };\n return event;\n });\n return receipt;\n });\n };\n}\nfunction buildCall(contract, fragment, collapseSimple) {\n const signerOrProvider = (contract.signer || contract.provider);\n return function (...args) {\n return __awaiter(this, void 0, void 0, function* () {\n // Extract the \"blockTag\" override if present\n let blockTag = undefined;\n if (args.length === fragment.inputs.length + 1 && typeof (args[args.length - 1]) === \"object\") {\n const overrides = shallowCopy(args.pop());\n if (overrides.blockTag != null) {\n blockTag = yield overrides.blockTag;\n }\n delete overrides.blockTag;\n args.push(overrides);\n }\n // If the contract was just deployed, wait until it is mined\n if (contract.deployTransaction != null) {\n yield contract._deployed(blockTag);\n }\n // Call a node and get the result\n const tx = yield populateTransaction(contract, fragment, args);\n const result = yield signerOrProvider.call(tx, blockTag);\n try {\n let value = contract.interface.decodeFunctionResult(fragment, result);\n if (collapseSimple && fragment.outputs.length === 1) {\n value = value[0];\n }\n return value;\n }\n catch (error) {\n if (error.code === Logger.errors.CALL_EXCEPTION) {\n error.address = contract.address;\n error.args = args;\n error.transaction = tx;\n }\n throw error;\n }\n });\n };\n}\nfunction buildSend(contract, fragment) {\n return function (...args) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!contract.signer) {\n logger.throwError(\"sending a transaction requires a signer\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"sendTransaction\"\n });\n }\n // If the contract was just deployed, wait until it is mined\n if (contract.deployTransaction != null) {\n yield contract._deployed();\n }\n const txRequest = yield populateTransaction(contract, fragment, args);\n const tx = yield contract.signer.sendTransaction(txRequest);\n // Tweak the tx.wait so the receipt has extra properties\n addContractWait(contract, tx);\n return tx;\n });\n };\n}\nfunction buildDefault(contract, fragment, collapseSimple) {\n if (fragment.constant) {\n return buildCall(contract, fragment, collapseSimple);\n }\n return buildSend(contract, fragment);\n}\nfunction getEventTag(filter) {\n if (filter.address && (filter.topics == null || filter.topics.length === 0)) {\n return \"*\";\n }\n return (filter.address || \"*\") + \"@\" + (filter.topics ? filter.topics.map((topic) => {\n if (Array.isArray(topic)) {\n return topic.join(\"|\");\n }\n return topic;\n }).join(\":\") : \"\");\n}\nclass RunningEvent {\n constructor(tag, filter) {\n defineReadOnly(this, \"tag\", tag);\n defineReadOnly(this, \"filter\", filter);\n this._listeners = [];\n }\n addListener(listener, once) {\n this._listeners.push({ listener: listener, once: once });\n }\n removeListener(listener) {\n let done = false;\n this._listeners = this._listeners.filter((item) => {\n if (done || item.listener !== listener) {\n return true;\n }\n done = true;\n return false;\n });\n }\n removeAllListeners() {\n this._listeners = [];\n }\n listeners() {\n return this._listeners.map((i) => i.listener);\n }\n listenerCount() {\n return this._listeners.length;\n }\n run(args) {\n const listenerCount = this.listenerCount();\n this._listeners = this._listeners.filter((item) => {\n const argsCopy = args.slice();\n // Call the callback in the next event loop\n setTimeout(() => {\n item.listener.apply(this, argsCopy);\n }, 0);\n // Reschedule it if it not \"once\"\n return !(item.once);\n });\n return listenerCount;\n }\n prepareEvent(event) {\n }\n // Returns the array that will be applied to an emit\n getEmit(event) {\n return [event];\n }\n}\nclass ErrorRunningEvent extends RunningEvent {\n constructor() {\n super(\"error\", null);\n }\n}\n// @TODO Fragment should inherit Wildcard? and just override getEmit?\n// or have a common abstract super class, with enough constructor\n// options to configure both.\n// A Fragment Event will populate all the properties that Wildcard\n// will, and additionally dereference the arguments when emitting\nclass FragmentRunningEvent extends RunningEvent {\n constructor(address, contractInterface, fragment, topics) {\n const filter = {\n address: address\n };\n let topic = contractInterface.getEventTopic(fragment);\n if (topics) {\n if (topic !== topics[0]) {\n logger.throwArgumentError(\"topic mismatch\", \"topics\", topics);\n }\n filter.topics = topics.slice();\n }\n else {\n filter.topics = [topic];\n }\n super(getEventTag(filter), filter);\n defineReadOnly(this, \"address\", address);\n defineReadOnly(this, \"interface\", contractInterface);\n defineReadOnly(this, \"fragment\", fragment);\n }\n prepareEvent(event) {\n super.prepareEvent(event);\n event.event = this.fragment.name;\n event.eventSignature = this.fragment.format();\n event.decode = (data, topics) => {\n return this.interface.decodeEventLog(this.fragment, data, topics);\n };\n try {\n event.args = this.interface.decodeEventLog(this.fragment, event.data, event.topics);\n }\n catch (error) {\n event.args = null;\n event.decodeError = error;\n }\n }\n getEmit(event) {\n const errors = checkResultErrors(event.args);\n if (errors.length) {\n throw errors[0].error;\n }\n const args = (event.args || []).slice();\n args.push(event);\n return args;\n }\n}\n// A Wildcard Event will attempt to populate:\n// - event The name of the event name\n// - eventSignature The full signature of the event\n// - decode A function to decode data and topics\n// - args The decoded data and topics\nclass WildcardRunningEvent extends RunningEvent {\n constructor(address, contractInterface) {\n super(\"*\", { address: address });\n defineReadOnly(this, \"address\", address);\n defineReadOnly(this, \"interface\", contractInterface);\n }\n prepareEvent(event) {\n super.prepareEvent(event);\n try {\n const parsed = this.interface.parseLog(event);\n event.event = parsed.name;\n event.eventSignature = parsed.signature;\n event.decode = (data, topics) => {\n return this.interface.decodeEventLog(parsed.eventFragment, data, topics);\n };\n event.args = parsed.args;\n }\n catch (error) {\n // No matching event\n }\n }\n}\nexport class BaseContract {\n constructor(addressOrName, contractInterface, signerOrProvider) {\n // @TODO: Maybe still check the addressOrName looks like a valid address or name?\n //address = getAddress(address);\n defineReadOnly(this, \"interface\", getStatic(new.target, \"getInterface\")(contractInterface));\n if (signerOrProvider == null) {\n defineReadOnly(this, \"provider\", null);\n defineReadOnly(this, \"signer\", null);\n }\n else if (Signer.isSigner(signerOrProvider)) {\n defineReadOnly(this, \"provider\", signerOrProvider.provider || null);\n defineReadOnly(this, \"signer\", signerOrProvider);\n }\n else if (Provider.isProvider(signerOrProvider)) {\n defineReadOnly(this, \"provider\", signerOrProvider);\n defineReadOnly(this, \"signer\", null);\n }\n else {\n logger.throwArgumentError(\"invalid signer or provider\", \"signerOrProvider\", signerOrProvider);\n }\n defineReadOnly(this, \"callStatic\", {});\n defineReadOnly(this, \"estimateGas\", {});\n defineReadOnly(this, \"functions\", {});\n defineReadOnly(this, \"populateTransaction\", {});\n defineReadOnly(this, \"filters\", {});\n {\n const uniqueFilters = {};\n Object.keys(this.interface.events).forEach((eventSignature) => {\n const event = this.interface.events[eventSignature];\n defineReadOnly(this.filters, eventSignature, (...args) => {\n return {\n address: this.address,\n topics: this.interface.encodeFilterTopics(event, args)\n };\n });\n if (!uniqueFilters[event.name]) {\n uniqueFilters[event.name] = [];\n }\n uniqueFilters[event.name].push(eventSignature);\n });\n Object.keys(uniqueFilters).forEach((name) => {\n const filters = uniqueFilters[name];\n if (filters.length === 1) {\n defineReadOnly(this.filters, name, this.filters[filters[0]]);\n }\n else {\n logger.warn(`Duplicate definition of ${name} (${filters.join(\", \")})`);\n }\n });\n }\n defineReadOnly(this, \"_runningEvents\", {});\n defineReadOnly(this, \"_wrappedEmits\", {});\n if (addressOrName == null) {\n logger.throwArgumentError(\"invalid contract address or ENS name\", \"addressOrName\", addressOrName);\n }\n defineReadOnly(this, \"address\", addressOrName);\n if (this.provider) {\n defineReadOnly(this, \"resolvedAddress\", resolveName(this.provider, addressOrName));\n }\n else {\n try {\n defineReadOnly(this, \"resolvedAddress\", Promise.resolve(getAddress(addressOrName)));\n }\n catch (error) {\n // Without a provider, we cannot use ENS names\n logger.throwError(\"provider is required to use ENS name as contract address\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"new Contract\"\n });\n }\n }\n // Swallow bad ENS names to prevent Unhandled Exceptions\n this.resolvedAddress.catch((e) => { });\n const uniqueNames = {};\n const uniqueSignatures = {};\n Object.keys(this.interface.functions).forEach((signature) => {\n const fragment = this.interface.functions[signature];\n // Check that the signature is unique; if not the ABI generation has\n // not been cleaned or may be incorrectly generated\n if (uniqueSignatures[signature]) {\n logger.warn(`Duplicate ABI entry for ${JSON.stringify(signature)}`);\n return;\n }\n uniqueSignatures[signature] = true;\n // Track unique names; we only expose bare named functions if they\n // are ambiguous\n {\n const name = fragment.name;\n if (!uniqueNames[`%${name}`]) {\n uniqueNames[`%${name}`] = [];\n }\n uniqueNames[`%${name}`].push(signature);\n }\n if (this[signature] == null) {\n defineReadOnly(this, signature, buildDefault(this, fragment, true));\n }\n // We do not collapse simple calls on this bucket, which allows\n // frameworks to safely use this without introspection as well as\n // allows decoding error recovery.\n if (this.functions[signature] == null) {\n defineReadOnly(this.functions, signature, buildDefault(this, fragment, false));\n }\n if (this.callStatic[signature] == null) {\n defineReadOnly(this.callStatic, signature, buildCall(this, fragment, true));\n }\n if (this.populateTransaction[signature] == null) {\n defineReadOnly(this.populateTransaction, signature, buildPopulate(this, fragment));\n }\n if (this.estimateGas[signature] == null) {\n defineReadOnly(this.estimateGas, signature, buildEstimate(this, fragment));\n }\n });\n Object.keys(uniqueNames).forEach((name) => {\n // Ambiguous names to not get attached as bare names\n const signatures = uniqueNames[name];\n if (signatures.length > 1) {\n return;\n }\n // Strip off the leading \"%\" used for prototype protection\n name = name.substring(1);\n const signature = signatures[0];\n // If overwriting a member property that is null, swallow the error\n try {\n if (this[name] == null) {\n defineReadOnly(this, name, this[signature]);\n }\n }\n catch (e) { }\n if (this.functions[name] == null) {\n defineReadOnly(this.functions, name, this.functions[signature]);\n }\n if (this.callStatic[name] == null) {\n defineReadOnly(this.callStatic, name, this.callStatic[signature]);\n }\n if (this.populateTransaction[name] == null) {\n defineReadOnly(this.populateTransaction, name, this.populateTransaction[signature]);\n }\n if (this.estimateGas[name] == null) {\n defineReadOnly(this.estimateGas, name, this.estimateGas[signature]);\n }\n });\n }\n static getContractAddress(transaction) {\n return getContractAddress(transaction);\n }\n static getInterface(contractInterface) {\n if (Interface.isInterface(contractInterface)) {\n return contractInterface;\n }\n return new Interface(contractInterface);\n }\n // @TODO: Allow timeout?\n deployed() {\n return this._deployed();\n }\n _deployed(blockTag) {\n if (!this._deployedPromise) {\n // If we were just deployed, we know the transaction we should occur in\n if (this.deployTransaction) {\n this._deployedPromise = this.deployTransaction.wait().then(() => {\n return this;\n });\n }\n else {\n // @TODO: Once we allow a timeout to be passed in, we will wait\n // up to that many blocks for getCode\n // Otherwise, poll for our code to be deployed\n this._deployedPromise = this.provider.getCode(this.address, blockTag).then((code) => {\n if (code === \"0x\") {\n logger.throwError(\"contract not deployed\", Logger.errors.UNSUPPORTED_OPERATION, {\n contractAddress: this.address,\n operation: \"getDeployed\"\n });\n }\n return this;\n });\n }\n }\n return this._deployedPromise;\n }\n // @TODO:\n // estimateFallback(overrides?: TransactionRequest): Promise\n // @TODO:\n // estimateDeploy(bytecode: string, ...args): Promise\n fallback(overrides) {\n if (!this.signer) {\n logger.throwError(\"sending a transactions require a signer\", Logger.errors.UNSUPPORTED_OPERATION, { operation: \"sendTransaction(fallback)\" });\n }\n const tx = shallowCopy(overrides || {});\n [\"from\", \"to\"].forEach(function (key) {\n if (tx[key] == null) {\n return;\n }\n logger.throwError(\"cannot override \" + key, Logger.errors.UNSUPPORTED_OPERATION, { operation: key });\n });\n tx.to = this.resolvedAddress;\n return this.deployed().then(() => {\n return this.signer.sendTransaction(tx);\n });\n }\n // Reconnect to a different signer or provider\n connect(signerOrProvider) {\n if (typeof (signerOrProvider) === \"string\") {\n signerOrProvider = new VoidSigner(signerOrProvider, this.provider);\n }\n const contract = new (this.constructor)(this.address, this.interface, signerOrProvider);\n if (this.deployTransaction) {\n defineReadOnly(contract, \"deployTransaction\", this.deployTransaction);\n }\n return contract;\n }\n // Re-attach to a different on-chain instance of this contract\n attach(addressOrName) {\n return new (this.constructor)(addressOrName, this.interface, this.signer || this.provider);\n }\n static isIndexed(value) {\n return Indexed.isIndexed(value);\n }\n _normalizeRunningEvent(runningEvent) {\n // Already have an instance of this event running; we can re-use it\n if (this._runningEvents[runningEvent.tag]) {\n return this._runningEvents[runningEvent.tag];\n }\n return runningEvent;\n }\n _getRunningEvent(eventName) {\n if (typeof (eventName) === \"string\") {\n // Listen for \"error\" events (if your contract has an error event, include\n // the full signature to bypass this special event keyword)\n if (eventName === \"error\") {\n return this._normalizeRunningEvent(new ErrorRunningEvent());\n }\n // Listen for any event that is registered\n if (eventName === \"event\") {\n return this._normalizeRunningEvent(new RunningEvent(\"event\", null));\n }\n // Listen for any event\n if (eventName === \"*\") {\n return this._normalizeRunningEvent(new WildcardRunningEvent(this.address, this.interface));\n }\n // Get the event Fragment (throws if ambiguous/unknown event)\n const fragment = this.interface.getEvent(eventName);\n return this._normalizeRunningEvent(new FragmentRunningEvent(this.address, this.interface, fragment));\n }\n // We have topics to filter by...\n if (eventName.topics && eventName.topics.length > 0) {\n // Is it a known topichash? (throws if no matching topichash)\n try {\n const topic = eventName.topics[0];\n if (typeof (topic) !== \"string\") {\n throw new Error(\"invalid topic\"); // @TODO: May happen for anonymous events\n }\n const fragment = this.interface.getEvent(topic);\n return this._normalizeRunningEvent(new FragmentRunningEvent(this.address, this.interface, fragment, eventName.topics));\n }\n catch (error) { }\n // Filter by the unknown topichash\n const filter = {\n address: this.address,\n topics: eventName.topics\n };\n return this._normalizeRunningEvent(new RunningEvent(getEventTag(filter), filter));\n }\n return this._normalizeRunningEvent(new WildcardRunningEvent(this.address, this.interface));\n }\n _checkRunningEvents(runningEvent) {\n if (runningEvent.listenerCount() === 0) {\n delete this._runningEvents[runningEvent.tag];\n // If we have a poller for this, remove it\n const emit = this._wrappedEmits[runningEvent.tag];\n if (emit && runningEvent.filter) {\n this.provider.off(runningEvent.filter, emit);\n delete this._wrappedEmits[runningEvent.tag];\n }\n }\n }\n // Subclasses can override this to gracefully recover\n // from parse errors if they wish\n _wrapEvent(runningEvent, log, listener) {\n const event = deepCopy(log);\n event.removeListener = () => {\n if (!listener) {\n return;\n }\n runningEvent.removeListener(listener);\n this._checkRunningEvents(runningEvent);\n };\n event.getBlock = () => { return this.provider.getBlock(log.blockHash); };\n event.getTransaction = () => { return this.provider.getTransaction(log.transactionHash); };\n event.getTransactionReceipt = () => { return this.provider.getTransactionReceipt(log.transactionHash); };\n // This may throw if the topics and data mismatch the signature\n runningEvent.prepareEvent(event);\n return event;\n }\n _addEventListener(runningEvent, listener, once) {\n if (!this.provider) {\n logger.throwError(\"events require a provider or a signer with a provider\", Logger.errors.UNSUPPORTED_OPERATION, { operation: \"once\" });\n }\n runningEvent.addListener(listener, once);\n // Track this running event and its listeners (may already be there; but no hard in updating)\n this._runningEvents[runningEvent.tag] = runningEvent;\n // If we are not polling the provider, start polling\n if (!this._wrappedEmits[runningEvent.tag]) {\n const wrappedEmit = (log) => {\n let event = this._wrapEvent(runningEvent, log, listener);\n // Try to emit the result for the parameterized event...\n if (event.decodeError == null) {\n try {\n const args = runningEvent.getEmit(event);\n this.emit(runningEvent.filter, ...args);\n }\n catch (error) {\n event.decodeError = error.error;\n }\n }\n // Always emit \"event\" for fragment-base events\n if (runningEvent.filter != null) {\n this.emit(\"event\", event);\n }\n // Emit \"error\" if there was an error\n if (event.decodeError != null) {\n this.emit(\"error\", event.decodeError, event);\n }\n };\n this._wrappedEmits[runningEvent.tag] = wrappedEmit;\n // Special events, like \"error\" do not have a filter\n if (runningEvent.filter != null) {\n this.provider.on(runningEvent.filter, wrappedEmit);\n }\n }\n }\n queryFilter(event, fromBlockOrBlockhash, toBlock) {\n const runningEvent = this._getRunningEvent(event);\n const filter = shallowCopy(runningEvent.filter);\n if (typeof (fromBlockOrBlockhash) === \"string\" && isHexString(fromBlockOrBlockhash, 32)) {\n if (toBlock != null) {\n logger.throwArgumentError(\"cannot specify toBlock with blockhash\", \"toBlock\", toBlock);\n }\n filter.blockHash = fromBlockOrBlockhash;\n }\n else {\n filter.fromBlock = ((fromBlockOrBlockhash != null) ? fromBlockOrBlockhash : 0);\n filter.toBlock = ((toBlock != null) ? toBlock : \"latest\");\n }\n return this.provider.getLogs(filter).then((logs) => {\n return logs.map((log) => this._wrapEvent(runningEvent, log, null));\n });\n }\n on(event, listener) {\n this._addEventListener(this._getRunningEvent(event), listener, false);\n return this;\n }\n once(event, listener) {\n this._addEventListener(this._getRunningEvent(event), listener, true);\n return this;\n }\n emit(eventName, ...args) {\n if (!this.provider) {\n return false;\n }\n const runningEvent = this._getRunningEvent(eventName);\n const result = (runningEvent.run(args) > 0);\n // May have drained all the \"once\" events; check for living events\n this._checkRunningEvents(runningEvent);\n return result;\n }\n listenerCount(eventName) {\n if (!this.provider) {\n return 0;\n }\n if (eventName == null) {\n return Object.keys(this._runningEvents).reduce((accum, key) => {\n return accum + this._runningEvents[key].listenerCount();\n }, 0);\n }\n return this._getRunningEvent(eventName).listenerCount();\n }\n listeners(eventName) {\n if (!this.provider) {\n return [];\n }\n if (eventName == null) {\n const result = [];\n for (let tag in this._runningEvents) {\n this._runningEvents[tag].listeners().forEach((listener) => {\n result.push(listener);\n });\n }\n return result;\n }\n return this._getRunningEvent(eventName).listeners();\n }\n removeAllListeners(eventName) {\n if (!this.provider) {\n return this;\n }\n if (eventName == null) {\n for (const tag in this._runningEvents) {\n const runningEvent = this._runningEvents[tag];\n runningEvent.removeAllListeners();\n this._checkRunningEvents(runningEvent);\n }\n return this;\n }\n // Delete any listeners\n const runningEvent = this._getRunningEvent(eventName);\n runningEvent.removeAllListeners();\n this._checkRunningEvents(runningEvent);\n return this;\n }\n off(eventName, listener) {\n if (!this.provider) {\n return this;\n }\n const runningEvent = this._getRunningEvent(eventName);\n runningEvent.removeListener(listener);\n this._checkRunningEvents(runningEvent);\n return this;\n }\n removeListener(eventName, listener) {\n return this.off(eventName, listener);\n }\n}\nexport class Contract extends BaseContract {\n}\nexport class ContractFactory {\n constructor(contractInterface, bytecode, signer) {\n let bytecodeHex = null;\n if (typeof (bytecode) === \"string\") {\n bytecodeHex = bytecode;\n }\n else if (isBytes(bytecode)) {\n bytecodeHex = hexlify(bytecode);\n }\n else if (bytecode && typeof (bytecode.object) === \"string\") {\n // Allow the bytecode object from the Solidity compiler\n bytecodeHex = bytecode.object;\n }\n else {\n // Crash in the next verification step\n bytecodeHex = \"!\";\n }\n // Make sure it is 0x prefixed\n if (bytecodeHex.substring(0, 2) !== \"0x\") {\n bytecodeHex = \"0x\" + bytecodeHex;\n }\n // Make sure the final result is valid bytecode\n if (!isHexString(bytecodeHex) || (bytecodeHex.length % 2)) {\n logger.throwArgumentError(\"invalid bytecode\", \"bytecode\", bytecode);\n }\n // If we have a signer, make sure it is valid\n if (signer && !Signer.isSigner(signer)) {\n logger.throwArgumentError(\"invalid signer\", \"signer\", signer);\n }\n defineReadOnly(this, \"bytecode\", bytecodeHex);\n defineReadOnly(this, \"interface\", getStatic(new.target, \"getInterface\")(contractInterface));\n defineReadOnly(this, \"signer\", signer || null);\n }\n // @TODO: Future; rename to populateTransaction?\n getDeployTransaction(...args) {\n let tx = {};\n // If we have 1 additional argument, we allow transaction overrides\n if (args.length === this.interface.deploy.inputs.length + 1 && typeof (args[args.length - 1]) === \"object\") {\n tx = shallowCopy(args.pop());\n for (const key in tx) {\n if (!allowedTransactionKeys[key]) {\n throw new Error(\"unknown transaction override \" + key);\n }\n }\n }\n // Do not allow these to be overridden in a deployment transaction\n [\"data\", \"from\", \"to\"].forEach((key) => {\n if (tx[key] == null) {\n return;\n }\n logger.throwError(\"cannot override \" + key, Logger.errors.UNSUPPORTED_OPERATION, { operation: key });\n });\n if (tx.value) {\n const value = BigNumber.from(tx.value);\n if (!value.isZero() && !this.interface.deploy.payable) {\n logger.throwError(\"non-payable constructor cannot override value\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"overrides.value\",\n value: tx.value\n });\n }\n }\n // Make sure the call matches the constructor signature\n logger.checkArgumentCount(args.length, this.interface.deploy.inputs.length, \" in Contract constructor\");\n // Set the data to the bytecode + the encoded constructor arguments\n tx.data = hexlify(concat([\n this.bytecode,\n this.interface.encodeDeploy(args)\n ]));\n return tx;\n }\n deploy(...args) {\n return __awaiter(this, void 0, void 0, function* () {\n let overrides = {};\n // If 1 extra parameter was passed in, it contains overrides\n if (args.length === this.interface.deploy.inputs.length + 1) {\n overrides = args.pop();\n }\n // Make sure the call matches the constructor signature\n logger.checkArgumentCount(args.length, this.interface.deploy.inputs.length, \" in Contract constructor\");\n // Resolve ENS names and promises in the arguments\n const params = yield resolveAddresses(this.signer, args, this.interface.deploy.inputs);\n params.push(overrides);\n // Get the deployment transaction (with optional overrides)\n const unsignedTx = this.getDeployTransaction(...params);\n // Send the deployment transaction\n const tx = yield this.signer.sendTransaction(unsignedTx);\n const address = getStatic(this.constructor, \"getContractAddress\")(tx);\n const contract = getStatic(this.constructor, \"getContract\")(address, this.interface, this.signer);\n // Add the modified wait that wraps events\n addContractWait(contract, tx);\n defineReadOnly(contract, \"deployTransaction\", tx);\n return contract;\n });\n }\n attach(address) {\n return (this.constructor).getContract(address, this.interface, this.signer);\n }\n connect(signer) {\n return new (this.constructor)(this.interface, this.bytecode, signer);\n }\n static fromSolidity(compilerOutput, signer) {\n if (compilerOutput == null) {\n logger.throwError(\"missing compiler output\", Logger.errors.MISSING_ARGUMENT, { argument: \"compilerOutput\" });\n }\n if (typeof (compilerOutput) === \"string\") {\n compilerOutput = JSON.parse(compilerOutput);\n }\n const abi = compilerOutput.abi;\n let bytecode = null;\n if (compilerOutput.bytecode) {\n bytecode = compilerOutput.bytecode;\n }\n else if (compilerOutput.evm && compilerOutput.evm.bytecode) {\n bytecode = compilerOutput.evm.bytecode;\n }\n return new this(abi, bytecode, signer);\n }\n static getInterface(contractInterface) {\n return Contract.getInterface(contractInterface);\n }\n static getContractAddress(tx) {\n return getContractAddress(tx);\n }\n static getContract(address, contractInterface, signer) {\n return new Contract(address, contractInterface, signer);\n }\n}\n//# sourceMappingURL=index.js.map","function Ir(r){return r.length!==0}function vr(r){return r.filter(e=>e!=null)}function p(){let r=null,e=null,t=new Promise((o,n)=>{r=i=>o(i),e=i=>n(i)});return[r,e,t]}import{reaction as G}from\"mobx\";async function R(r){let[e,,t]=p(),o=G(()=>r.get(),i=>{i&&e(i)},{fireImmediately:!0}),n=await t;return o(),n}function B(r){return typeof r==\"object\"&&!Array.isArray(r)&&r!==null}function O(r){return r instanceof Function}import{reaction as q}from\"mobx\";import Q from\"proxy-deep\";function S(r,e){if(e.length===0)return r;if(e.length===1)return r[e[0]];let[t,...o]=e,n=r[t];if(!B(n))throw new Error(\"Path does not exist on the target\");return S(n,o)}function $r(r){let e=[],t=new Q({},{get(o,n){let i=r.get();return i?n===\"proxied\"?!1:Reflect.get(i,n):n===\"proxied\"?!0:n===\"name\"?\"ProxiedTarget\":n===\"toJSON\"?()=>({proxied:!0}):this.nest(()=>{})},apply(o,n,i){let s=r.get();if(s){let a=S(s,this.path);if(!O(a))throw new Error(\"Target is not callable\");return Reflect.apply(a,n,i)}else{let[a,l,u]=p();return e.push({path:this.path,args:i,resolve:a,reject:l}),u}}});return q(()=>r.get(),o=>{if(!o)return;let n=e.splice(0);for(let{path:i,args:s,resolve:a,reject:l}of n){let u=S(o,i);s&&O(u)?(async()=>{try{a(await u(...s))}catch(f){l(f)}})():a(u)}}),t}function Yr(r){let e=[];for(let t of Object.values(r))isNaN(Number(t))||e.push(Number(t));return e}function Jr(r,e){let t={};for(let o in r)t[o]=e(r[o],o);return t}function Z(r,e=0){return Math.floor(Math.random()*(r-e+1))+e}function Xr(r){return r[Z(r.length-1)]}import{concatMap as rr,delay as er,filter as tr,first as or,mergeMap as nr,of as ir,pipe as E,ReplaySubject as F,scan as ar,timestamp as sr}from\"rxjs\";import{computed as U,observable as P,reaction as _,runInAction as j,toJS as ur}from\"mobx\";function lr(){return E(tr(r=>r!=null))}function oe(){return E(rr(r=>r))}function ne(r){return E(sr(),ar((e,t)=>{let o=0;if(e!==null){let n=t.timestamp-e.timestamp;o=n>r?0:r-n}return{timestamp:t.timestamp,delay:o,value:t.value}},null),lr(),nr(e=>ir(e.value).pipe(er(e.delay)),1))}function ie(r){return U(()=>r.get())}function ae(r){let e=new F(1);return _(()=>r.get(),t=>{t!=null&&e.next(t)},{fireImmediately:!0}),e}function se(r){let e=new F(1);return _(()=>ur(r),t=>{t!=null&&e.next(t)},{fireImmediately:!0}),e}function ue(r){let e=P.box();return r.subscribe(t=>j(()=>e.set(t))),U(()=>e.get())}async function le(r){let e=P.box();r.subscribe(o=>j(()=>e.set(o)));let t=U(()=>e.get());return await R(t),t}async function cr(r,e=t=>t!=null){let[t,,o]=p();return r.pipe(or(e)).subscribe(t),o}async function ce(r){let e={};return r.subscribe(t=>e.current=t),e.current=await cr(r),e}var fe=function(){let r=mr,e=fr;return e(r(32),8)+\"-\"+e(r(16),4)+\"-\"+e(16384|r(12),4)+\"-\"+e(32768|r(14),4)+\"-\"+e(r(48),12)},mr=function(r){if(r<0||r>53)return NaN;let e=0|Math.random()*1073741824;return r>30?e+(0|Math.random()*(1<>>30-r},fr=function(r,e){let t=r.toString(16),o=e-t.length,n=\"0\";for(;o>0;o>>>=1,n+=n)o&1&&(t=n+t);return t};function M(r,e){return new Promise(t=>setTimeout(()=>t(e),r))}var be=function*(r=0,e=1,t=0){for(let o=0;oPromise.race([r,pr(e,t)]),ye=(r,e=[],t=10,o=1e3)=>{let[n,i,s]=p();return(async()=>{let l;for(let u=0;u=r.length;return o?{done:o,value:null}:{value:r[e++]}}})}function ve(r,e){return e.x>=r.x&&e.y>=r.y&&e.xr.postMessage(t)),D(r,\"message\").pipe(Y(t=>t.data))}function Pe(r){let e=D(self,\"message\");r.work(e.pipe(Y(o=>o.data))).subscribe(o=>self.postMessage(o))}function br(r,e){return r&2**e-1}function gr(r,e){if(e.reduce((o,n)=>o+n,0)>32)throw new Error(\"JS pretends integers are 32 bit when bitshifts are involved\");if(r.length!==e.length)throw new Error(\"Arrays' lengths must match\");for(let o=0;o2**e[o]-1){let n=`Overflow: ${r[o]} does not fit in ${e[o]} bits`;throw new Error(n)}}let t=0;for(let o=0;o=0;n--)t.unshift(br(o,e[n])),o=o>>>e[n];return t}function je(r){return gr(r,[8,24])}function $e(r){return yr(r,[8,24])}var hr=2**16-1,h=2**15-1;function We(r,e){let t=new A;for(let o of r.coords())e.get(o)||t.set(o,!0);return t}function v(r){return r.x<<16|r.y&hr}function W(r){let e=r>>16,t=r<<16>>16;return{x:e,y:t}}var A=class{map;defaultValue;constructor(e){this.map=new Map,this.defaultValue=e?.defaultValue}static from(e){let t=new A;return t.map=e.map,t.defaultValue=e.defaultValue,t}set(e,t){if(e.x>h||e.x<-1*h||e.y>h||e.y<-1*h)throw new Error(`CoordMap only supports coords up to ${h}`);return this.map.set(v(e),t)}get(e){return this.map.get(v(e))??this.defaultValue}keys(){return this.map.keys()}coords(){return I(this.map.keys(),e=>W(e))}entries(){return this.map.entries()}toArray(){return Array.from(this.map.entries()).map(([t,o])=>[W(t),o])}values(){return this.map.values()}delete(e){return this.map.delete(v(e))}has(e){return this.map.has(v(e))}clear(){for(let e of this.map.keys())this.map.delete(e)}get size(){return this.map.size}};function k(r){return`${r.x}/${r.y}/${r.z}`}function J(r){let e=r.split(\"/\");return{x:Number(e[0]),y:Number(e[1]),z:Number(e[2])}}var V=class{map;defaultValue;constructor(e){this.map=new Map,this.defaultValue=e?.defaultValue}static from(e){let t=new V;return t.map=e.map,t.defaultValue=e.defaultValue,t}set(e,t){return this.map.set(k(e),t)}get(e){return this.map.get(k(e))??this.defaultValue}keys(){return this.map.keys()}coords(){return I(this.map.keys(),e=>J(e))}entries(){return this.map.entries()}toArray(){return Array.from(this.map.entries()).map(([t,o])=>[J(t),o])}values(){return this.map.values()}delete(e){return this.map.delete(k(e))}has(e){return this.map.has(k(e))}clear(){for(let e of this.map.keys())this.map.delete(e)}get size(){return this.map.size}};function H(r,e){r.substring(0,2)==\"0x\"&&(r=r.substring(2));let t=e/4;return r=r.padStart(t,\"0\"),r=r.substring(r.length-t),`0x${r}`}function X(r){return H(r,160)}function ze(r){return H(r,256)}function Ke(r){if(r[0]!==\"0\"&&r[1]!==\"x\")throw new Error(\"Invalid hex string\");return\"0x\"+r.substring(10)}function d(r,e,t){return(((e^t)*134775813^r+e)*(1103515245*e<<16^1103515245*t-134775813)>>>0)/4294967295}function m(r,e){if(r<0)for(;r<0;)r+=e;return r%e}function N(r,e,t,o,n,i,s){let a=o-t-(r-e);return(e*Math.pow(i,3)+n*(t*Math.pow(i,2)+r*i*(-i+n)+n*(-(e+a)*i+a*n)))*s}function Ge(r,e,t,o=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return{seed:Math.floor(r*Number.MAX_SAFE_INTEGER),periodX:o,periodY:n,octave:e,scale:t}}function qe(r,e){let t=Math.floor(e),o=e-t;return N(d(r.seed,m(t-1,r.periodX),0),d(r.seed,m(t,r.periodX),0),d(r.seed,m(t+1,r.periodX),0),d(r.seed,m(t+2,r.periodX),0),o,1,1)*.666666+.166666}function Qe({octave:r,periodX:e,periodY:t,seed:o,scale:n},i,s){let a=Math.floor(i/r),l=Math.floor(i*1e3/r)-a*1e3,u=Math.floor(s/r),f=Math.floor(s*1e3/r)-u*1e3,T=m(a-1,e),c=m(a,e),b=m(a+1,e),L=m(a+2,e),g=new Array(4);for(let w=0;w<4;++w){let C=m(u-1+w,t);g[w]=N(d(o,T,C),d(o,c,C),d(o,b,C),d(o,L,C),l,1e3,1)}return Math.floor(N(g[0],g[1],g[2],g[3],f,1e3,n)/Math.pow(1e3,6))}var x=\"mud-logger-topics\";function rt(){let r=window.console,e=!!localStorage.getItem(x),t=localStorage.getItem(x),o=t?JSON.parse(t):[];function n(...c){e||r.log(...c)}function i(c,...b){(!e||o.includes(c))&&(r.log(`--- BETTER CONSOLE / TOPIC ${c} ---`),r.log(...b))}function s(){localStorage.setItem(x,JSON.stringify([])),e=!0}function a(){localStorage.removeItem(x),e=!1}function l(c){o.push(c),localStorage.setItem(x,JSON.stringify(o))}function u(c){o=o.filter(b=>b!==c),localStorage.setItem(x,JSON.stringify(o))}function f(){o=[],localStorage.setItem(x,JSON.stringify(o))}let T={...r,log:n,logWithTopic:i,enableFilters:s,disableFilters:a,addTopic:l,removeTopic:u,resetTopics:f};return window.logger=T,window.console=T,T}function tt(r,e){if(r.length!==e.length)throw new Error(\"points must have same dimension\");return Math.sqrt(r.reduce((t,o,n)=>t+Math.pow(r[n]-e[n],2),0))}function nt(r){return(r<0?-1:1)*Math.floor(Math.abs(r))}var at=r=>`0x${[...new Uint8Array(r)].map(e=>e.toString(16).padStart(2,\"0\")).join(\"\")}`;var ut=r=>[...r].map(e=>String.fromCharCode(e)).join(\"\");function z(r){return/^(0x)?([\\da-f]{2})*$/i.test(r)}var K=r=>{if(!z(r))throw console.error(\"Invalid hex string\",r),new Error(\"Invalid hex string\");let e=r.match(/[\\da-f]{2}/gi);return e?new Uint8Array(e.map(t=>parseInt(t,16))):new Uint8Array([])};var pt=r=>{if(r.length>16)throw new Error(\"string too long\");return new Uint8Array(16).map((e,t)=>r.charCodeAt(t))},dt=r=>{if(r.length>32)throw new Error(\"string too long\");return new Uint8Array(32).map((e,t)=>r.charCodeAt(t))};function Ar(r){return r.substring(0,2)==\"0x\"&&(r=r.substring(2)),(r.length%2!==0?\"0x0\":\"0x\")+r}function wr(r){return K(r)}function It(r){return r.length===0?\"0x00\":Ar(r.reduce((e,t)=>e+t.toString(16).padStart(2,\"0\"),\"\"))}function vt(...r){return Uint8Array.from(r.reduce((e,t)=>[...e,...t],[]))}function kt(r,e){let t=[],o=0;for(let n of e){let i=new Uint8Array(n);t.push(i);for(let s=0;s64)throw new Error(\"Maximum size is 64\");let e=2**(r-1)-1,t=-e-1;return o=>{if(o=o<<0,o>e||oe,o(y[y.Boolean=0]=\"Boolean\",y[y.Number=1]=\"Number\",y[y.OptionalNumber=2]=\"OptionalNumber\",y[y.BigInt=3]=\"BigInt\",y[y.OptionalBigInt=4]=\"OptionalBigInt\",y[y.String=5]=\"String\",y[y.OptionalString=6]=\"OptionalString\",y[y.NumberArray=7]=\"NumberArray\",y[y.OptionalNumberArray=8]=\"OptionalNumberArray\",y[y.BigIntArray=9]=\"BigIntArray\",y[y.OptionalBigIntArray=10]=\"OptionalBigIntArray\",y[y.StringArray=11]=\"StringArray\",y[y.OptionalStringArray=12]=\"OptionalStringArray\",y[y.Entity=13]=\"Entity\",y[y.OptionalEntity=14]=\"OptionalEntity\",y[y.EntityArray=15]=\"EntityArray\",y[y.OptionalEntityArray=16]=\"OptionalEntityArray\",y[y.T=17]=\"T\",y[y.OptionalT=18]=\"OptionalT\",y))(W||{}),Q=(r=>(r[r.Enter=0]=\"Enter\",r[r.Exit=1]=\"Exit\",r[r.Update=2]=\"Update\",r[r.Noop=3]=\"Noop\",r))(Q||{}),H=[14,16,2,8,4,10,6,12,18];function he(e,t,n){let o=e.registerEntity(n??{});if(t)for(let[r,p]of t)T(r,o,p);return o}function S(e){return Symbol.for(e)}function C(e){return Symbol.keyFor(e)}function $(e){let t=new Map;function n(a){let m=t.get(o(a));return m?new Set([...m].map(C)):new Set}function o(a){return Object.values(a).join(\"/\")}function r(a,m){if(!m)return;let c=o(m),u=t.get(c);u||(u=new Set,t.set(c,u)),u.add(a)}function p(a,m){if(!m)return;let c=o(m),u=t.get(c);u&&u.delete(a)}for(let a of b(e)){let m=x(e,a);r(S(a),m)}let i=e.update$.subscribe(({entity:a,value:m})=>{p(S(a),m[1]),r(S(a),m[0])});return e.world.registerDisposer(()=>i?.unsubscribe()),{...e,getEntitiesWithValue:n}}import{map as ee,pipe as te}from\"rxjs\";function Ne(e,t){return e.component===t}function ne(e,t){let n=x(t,e);return{entity:e,component:t,value:[n,void 0],type:n==null?3:0}}function I(e){return te(ee(t=>ne(t,e)))}function B(e){return\"getEntitiesWithValue\"in e}function R(e,t){return Object.keys(e.schema).every(n=>n in t)}function h(e){return e.metadata?.componentName??e.metadata?.tableName??e.metadata?.tableId??e.metadata?.contractId??e.id}function Re(e,t,n){if(Object.keys(t).length===0)throw new Error(\"Component schema must have at least one key\");let o=n?.id??oe(),r=D(t,()=>new Map),p=new q,i=n?.metadata,m={values:r,schema:t,id:o,update$:p,metadata:i,entities:()=>j(Object.values(r)[0].keys(),C),world:e};return n?.indexed&&(m=$(m)),e.registerComponent(m),m}function T(e,t,n){let o=S(t),r=x(e,t);for(let[p,i]of Object.entries(n))e.values[p]?e.values[p].set(o,i):e.metadata?.tableId&&/^\\d+$/.test(p)||console.warn(\"Component definition for\",h(e),\"is missing key\",p,\", ignoring value\",i,\"for entity\",t,\". Existing keys: \",Object.keys(e.values));e.update$.next({entity:t,value:[n,r],component:e})}function je(e,t,n,o){let r=x(e,t);if(r===void 0){if(o===void 0)throw new Error(`Can't update component ${h(e)} without a current value or initial value`);T(e,t,{...o,...n})}else T(e,t,{...r,...n})}function w(e,t){let n=S(t),o=x(e,t);for(let r of Object.keys(e.values))e.values[r].delete(n);e.update$.next({entity:t,value:[void 0,o],component:e})}function v(e,t){let n=S(t);return Object.values(e.values)[0].has(n)}function x(e,t){let n={},o=S(t),r=Object.keys(e.schema);for(let p of r){let i=e.values[p].get(o);if(i===void 0&&!H.includes(e.schema[p]))return;n[p]=i}return n}function De(e,t){let n=x(e,t);if(!n)throw new Error(`No value for component ${h(e)} on entity ${t}`);return n}function k(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;let n=!0;for(let o of Object.keys(e))if(n=e[o]===t[o],!n)return!1;return n}function qe(e,t){return[e,t]}function A(e,t){if(B(e)&&R(e,t))return e.getEntitiesWithValue(t);let n=new Set;for(let o of b(e)){let r=x(e,o);k(t,r)&&n.add(o)}return n}function b(e){return e.entities()}function Le(e){let t=0,n=new Map,o=new Map,r=new q;function p(l,s){n.set(l,{update:s,nonce:t++}),g(s.entity,s.value)}function i(l){let s=n.get(l)?.update.entity;if(n.delete(l),s==null)return;let E=[...n.values()].filter(f=>f.update.entity===s).sort((f,N)=>f.nonce0){let f=E[E.length-1];g(s,f.update.value)}else g(s,void 0)}function a(l){let s=x(e,l),E=S(l),f=o.get(E);return(s||f)&&f!==null?{...s,...f}:void 0}let m=l=>({get(s,E){return E===\"get\"?f=>{let N=s.get(f),M=o.get(f);return M&&M[l]!=null?M[l]:N}:E===\"has\"?f=>s.has(f)||o.has(f):E===\"keys\"?()=>new Set([...s.keys(),...o.keys()]).values():Reflect.get(s,E,s)}}),c={};for(let l of Object.keys(e.values))c[l]=new Proxy(e.values[l],m(l));let u=c,d=new Proxy(e,{get(l,s){return s===\"addOverride\"?p:s===\"removeOverride\"?i:s===\"values\"?u:s===\"update$\"?r:s===\"entities\"?()=>new Set([...j(o.keys(),C),...l.entities()]).values():Reflect.get(l,s)},has(l,s){return s===\"addOverride\"||s===\"removeOverride\"?!0:s in l}});function g(l,s){let E=S(l),f=a(l);s!==void 0?o.set(E,s):o.delete(E),r.next({entity:l,value:[a(l),f],component:d})}return e.update$.pipe(re(l=>!o.get(S(l.entity))),ie(l=>({...l,component:d}))).subscribe(r),d}function L(e,t){return`localcache-${t}-${e.id}`}function Ke(e,t){localStorage.removeItem(L(e,t))}function Je(e,t){let{world:n,update$:o,values:r}=e,p=L(e,t),i=0,a=Date.now(),m=localStorage.getItem(p);if(m){let u=JSON.parse(m),d={};for(let[g,l]of u)for(let[s,E]of l)d[s]=d[s]||{},d[s][g]=E;for(let[g,l]of Object.entries(d)){let s=n.registerEntity({id:g});T(e,s,l)}console.info(\"Loading component\",h(e),\"from local cache.\")}let c=o.subscribe(()=>{i++;let u=JSON.stringify(Object.entries(D(r,d=>[...d.entries()].map(g=>[C(g[0]),g[1]]))));localStorage.setItem(p,u),i>200&&console.warn(\"Component\",h(e),\"was locally cached\",i,\"times since\",new Date(a).toLocaleTimeString(),\"- the local cache is in an alpha state and should not be used with components that update frequently yet\")});return e.world.registerDisposer(()=>c?.unsubscribe()),e}import{concat as xe,EMPTY as ge,from as Ee}from\"rxjs\";import{filterNullish as ae}from\"@latticexyz/utils\";import{observable as ue}from\"mobx\";import{concat as pe,concatMap as ye,filter as U,from as se,map as me,merge as le,of as de,share as ce}from\"rxjs\";var K=(i=>(i[i.Has=0]=\"Has\",i[i.HasValue=1]=\"HasValue\",i[i.Not=2]=\"Not\",i[i.NotValue=3]=\"NotValue\",i[i.ProxyRead=4]=\"ProxyRead\",i[i.ProxyExpand=5]=\"ProxyExpand\",i))(K||{});function Ge(e){return[2,4,6,14,16,8,10,12].includes(e)}function Xe(e){return[7,8,9,10,11,12,15,16].includes(e)}function Ze(e){return[1,2].includes(e)}function _e(e){return[13,14].includes(e)}function Ft(e){return{type:0,component:e}}function Qt(e){return{type:2,component:e}}function It(e,t){return{type:1,component:e,value:t}}function wt(e,t){return{type:3,component:e,value:t}}function kt(e,t){return{type:4,component:e,depth:t}}function Nt(e,t){return{type:5,component:e,depth:t}}function O(e,t){if(t.type===0)return v(t.component,e);if(t.type===1)return k(t.value,x(t.component,e));if(t.type===2)return!v(t.component,e);if(t.type===3)return!k(t.value,x(t.component,e));throw new Error(\"Unknown query fragment\")}function fe(e){return e.type===0||e.type==1}function Y(e){return e.type===2||e.type==3}function Se(e){return e.type===5||e.type==4}function G(e,t){return e&&fe(t)||!e&&Y(t)}function J(e,t,n){let o=e,r=!1;for(let p=0;p[...P(p,t,n-1)]).flat();return new Set([...o,...r])}function z(e,t){let n=t?new Set([...t]):void 0,o,r;for(let p=0;p0&&!G(m,i)&&(m=J(a,i,o)??m),m||n.delete(a),r&&r.depth>0){let c=P(a,r.component,r.depth);for(let u of c)(O(u,i)||o&&o.depth>0&&J(u,i,o))&&n.add(u)}}else{if(Y(i))throw new Error(\"First EntityQueryFragment must be Has or HasValue\");if(n=i.type===0?new Set([...b(i.component)]):A(i.component,i.value),r&&r.depth>0)for(let a of[...n])for(let m of P(a,r.component,r.depth))n.add(m)}}return n??new Set}function V(e,t){let n=t?.runOnInit||t?.initialSet?z(e,t.initialSet):new Set,o=ue(n),r=se(o).pipe(I(e[0].component)),p=e.findIndex(a=>[5,4].includes(a.type))!==-1,i=le(...e.map(a=>a.component.update$)).pipe(p?ye(a=>{let m=z(e,t?.initialSet),c=[];for(let u of o)m.has(u)||(o.delete(u),c.push({entity:u,type:1,component:a.component,value:[void 0,void 0]}));for(let u of m)o.has(u)?c.push({entity:u,type:2,component:a.component,value:[x(a.component,u),void 0]}):(o.add(u),c.push({entity:u,type:0,component:a.component,value:[x(a.component,u),void 0]}));return de(...c)}):me(a=>{if(o.has(a.entity))return e.filter(d=>d.component.id===a.component.id).every(d=>O(a.entity,d))?{...a,type:2}:(o.delete(a.entity),{...a,type:1});if(e.every(c=>O(a.entity,c)))return o.add(a.entity),{...a,type:0}}),ae());return{matching:o,update$:pe(r,i).pipe(ce())}}function X(e,t){return V(e,t).update$.pipe(U(n=>n.type===2))}function Z(e,t){return V(e,t).update$.pipe(U(n=>n.type===0))}function _(e,t){return V(e,t).update$.pipe(U(n=>n.type===1))}function F(e,t,n){let o=t.subscribe(n);e.registerDisposer(()=>o?.unsubscribe())}function Bt(e,t,n,o={runOnInit:!0}){F(e,X(t,o),n)}function Rt(e,t,n,o={runOnInit:!0}){F(e,Z(t,o),n)}function jt(e,t,n,o={runOnInit:!0}){F(e,_(t,o),n)}function Ce(e,t,n,o={runOnInit:!0}){F(e,V(t,o).update$,n)}function Dt(e,t,n,o={runOnInit:!0}){let r=o?.runOnInit?Ee(b(t)).pipe(I(t)):ge;F(e,xe(r,t.update$),n)}function qt(e,t,n,o,r={update:!1,runOnInit:!0}){Ce(e,t,({entity:p,type:i})=>{i===0&&T(n(p),p,o(p)),i===1&&w(n(p),p),r?.update&&i===2&&T(n(p),p,o(p))},r)}import{transformIterator as Te}from\"@latticexyz/utils\";function Yt(){let e=new Set,t=[],n=[];function o({id:u,idSuffix:d}={}){let g=u||e.size+(d?\"-\"+d:\"\"),l=S(g);return e.add(l),g}function r(){return Te(e.values(),C)}function p(u){t.push(u)}function i(u){for(let[,d]of n.filter(g=>!u||g[0]===u))d();n=n.filter(d=>u&&d[0]!==u)}function a(u,d=\"\"){n.push([d,u])}function m(u){let d=S(u);return e.has(d)}function c(u){for(let d of t)v(d,u)&&w(d,u);e.delete(S(u))}return{registerEntity:o,components:t,registerComponent:p,dispose:i,registerDisposer:a,hasEntity:m,getEntities:r,entitySymbols:e,deleteEntity:c}}function Gt(e,t){return{...e,registerDisposer:n=>e.registerDisposer(n,t),dispose:()=>e.dispose(t)}}function Xt(e,t){return e.components.filter(n=>v(n,t))}export{Ft as Has,It as HasValue,Qt as Not,wt as NotValue,H as OptionalTypes,Nt as ProxyExpand,kt as ProxyRead,K as QueryFragmentType,W as Type,Q as UpdateType,Ke as clearLocalCache,k as componentValueEquals,he as createEntity,$ as createIndexer,Je as createLocalCache,Yt as createWorld,Re as defineComponent,Dt as defineComponentSystem,Z as defineEnterQuery,Rt as defineEnterSystem,_ as defineExitQuery,jt as defineExitSystem,V as defineQuery,F as defineRxSystem,qt as defineSyncSystem,Ce as defineSystem,X as defineUpdateQuery,Bt as defineUpdateSystem,P as getChildEntities,b as getComponentEntities,x as getComponentValue,De as getComponentValueStrict,A as getEntitiesWithValue,Xt as getEntityComponents,C as getEntityString,S as getEntitySymbol,v as hasComponent,Xe as isArrayType,Ne as isComponentUpdate,_e as isEntityType,R as isFullComponentValue,B as isIndexer,Ze as isNumberType,Ge as isOptionalType,Gt as namespaceWorld,Le as overridableComponent,w as removeComponent,z as runQuery,T as setComponent,ne as toUpdate,I as toUpdateStream,je as updateComponent,qe as withValue};\n//# sourceMappingURL=index.js.map","var i=/\\[\\]$/;function b(t){return i.test(t)}function r(t){return t.replace(i,\"\")}var n=[\"uint8\",\"uint16\",\"uint24\",\"uint32\",\"uint40\",\"uint48\",\"uint56\",\"uint64\",\"uint72\",\"uint80\",\"uint88\",\"uint96\",\"uint104\",\"uint112\",\"uint120\",\"uint128\",\"uint136\",\"uint144\",\"uint152\",\"uint160\",\"uint168\",\"uint176\",\"uint184\",\"uint192\",\"uint200\",\"uint208\",\"uint216\",\"uint224\",\"uint232\",\"uint240\",\"uint248\",\"uint256\",\"int8\",\"int16\",\"int24\",\"int32\",\"int40\",\"int48\",\"int56\",\"int64\",\"int72\",\"int80\",\"int88\",\"int96\",\"int104\",\"int112\",\"int120\",\"int128\",\"int136\",\"int144\",\"int152\",\"int160\",\"int168\",\"int176\",\"int184\",\"int192\",\"int200\",\"int208\",\"int216\",\"int224\",\"int232\",\"int240\",\"int248\",\"int256\",\"bytes1\",\"bytes2\",\"bytes3\",\"bytes4\",\"bytes5\",\"bytes6\",\"bytes7\",\"bytes8\",\"bytes9\",\"bytes10\",\"bytes11\",\"bytes12\",\"bytes13\",\"bytes14\",\"bytes15\",\"bytes16\",\"bytes17\",\"bytes18\",\"bytes19\",\"bytes20\",\"bytes21\",\"bytes22\",\"bytes23\",\"bytes24\",\"bytes25\",\"bytes26\",\"bytes27\",\"bytes28\",\"bytes29\",\"bytes30\",\"bytes31\",\"bytes32\",\"bool\",\"address\",\"uint8[]\",\"uint16[]\",\"uint24[]\",\"uint32[]\",\"uint40[]\",\"uint48[]\",\"uint56[]\",\"uint64[]\",\"uint72[]\",\"uint80[]\",\"uint88[]\",\"uint96[]\",\"uint104[]\",\"uint112[]\",\"uint120[]\",\"uint128[]\",\"uint136[]\",\"uint144[]\",\"uint152[]\",\"uint160[]\",\"uint168[]\",\"uint176[]\",\"uint184[]\",\"uint192[]\",\"uint200[]\",\"uint208[]\",\"uint216[]\",\"uint224[]\",\"uint232[]\",\"uint240[]\",\"uint248[]\",\"uint256[]\",\"int8[]\",\"int16[]\",\"int24[]\",\"int32[]\",\"int40[]\",\"int48[]\",\"int56[]\",\"int64[]\",\"int72[]\",\"int80[]\",\"int88[]\",\"int96[]\",\"int104[]\",\"int112[]\",\"int120[]\",\"int128[]\",\"int136[]\",\"int144[]\",\"int152[]\",\"int160[]\",\"int168[]\",\"int176[]\",\"int184[]\",\"int192[]\",\"int200[]\",\"int208[]\",\"int216[]\",\"int224[]\",\"int232[]\",\"int240[]\",\"int248[]\",\"int256[]\",\"bytes1[]\",\"bytes2[]\",\"bytes3[]\",\"bytes4[]\",\"bytes5[]\",\"bytes6[]\",\"bytes7[]\",\"bytes8[]\",\"bytes9[]\",\"bytes10[]\",\"bytes11[]\",\"bytes12[]\",\"bytes13[]\",\"bytes14[]\",\"bytes15[]\",\"bytes16[]\",\"bytes17[]\",\"bytes18[]\",\"bytes19[]\",\"bytes20[]\",\"bytes21[]\",\"bytes22[]\",\"bytes23[]\",\"bytes24[]\",\"bytes25[]\",\"bytes26[]\",\"bytes27[]\",\"bytes28[]\",\"bytes29[]\",\"bytes30[]\",\"bytes31[]\",\"bytes32[]\",\"bool[]\",\"address[]\",\"bytes\",\"string\"],e=n.slice(0,98),y=n.slice(98);var s={\"uint8[]\":[],\"uint16[]\":[],\"uint24[]\":[],\"uint32[]\":[],\"uint40[]\":[],\"uint48[]\":[],\"uint56[]\":[],\"uint64[]\":[],\"uint72[]\":[],\"uint80[]\":[],\"uint88[]\":[],\"uint96[]\":[],\"uint104[]\":[],\"uint112[]\":[],\"uint120[]\":[],\"uint128[]\":[],\"uint136[]\":[],\"uint144[]\":[],\"uint152[]\":[],\"uint160[]\":[],\"uint168[]\":[],\"uint176[]\":[],\"uint184[]\":[],\"uint192[]\":[],\"uint200[]\":[],\"uint208[]\":[],\"uint216[]\":[],\"uint224[]\":[],\"uint232[]\":[],\"uint240[]\":[],\"uint248[]\":[],\"uint256[]\":[],\"int8[]\":[],\"int16[]\":[],\"int24[]\":[],\"int32[]\":[],\"int40[]\":[],\"int48[]\":[],\"int56[]\":[],\"int64[]\":[],\"int72[]\":[],\"int80[]\":[],\"int88[]\":[],\"int96[]\":[],\"int104[]\":[],\"int112[]\":[],\"int120[]\":[],\"int128[]\":[],\"int136[]\":[],\"int144[]\":[],\"int152[]\":[],\"int160[]\":[],\"int168[]\":[],\"int176[]\":[],\"int184[]\":[],\"int192[]\":[],\"int200[]\":[],\"int208[]\":[],\"int216[]\":[],\"int224[]\":[],\"int232[]\":[],\"int240[]\":[],\"int248[]\":[],\"int256[]\":[],\"bytes1[]\":[],\"bytes2[]\":[],\"bytes3[]\":[],\"bytes4[]\":[],\"bytes5[]\":[],\"bytes6[]\":[],\"bytes7[]\":[],\"bytes8[]\":[],\"bytes9[]\":[],\"bytes10[]\":[],\"bytes11[]\":[],\"bytes12[]\":[],\"bytes13[]\":[],\"bytes14[]\":[],\"bytes15[]\":[],\"bytes16[]\":[],\"bytes17[]\":[],\"bytes18[]\":[],\"bytes19[]\":[],\"bytes20[]\":[],\"bytes21[]\":[],\"bytes22[]\":[],\"bytes23[]\":[],\"bytes24[]\":[],\"bytes25[]\":[],\"bytes26[]\":[],\"bytes27[]\":[],\"bytes28[]\":[],\"bytes29[]\":[],\"bytes30[]\":[],\"bytes31[]\":[],\"bytes32[]\":[],\"bool[]\":[],\"address[]\":[],bytes:\"0x\",string:\"\"};function T(t){return y.includes(t)}var a={uint8:0,uint16:0,uint24:0,uint32:0,uint40:0,uint48:0,uint56:0n,uint64:0n,uint72:0n,uint80:0n,uint88:0n,uint96:0n,uint104:0n,uint112:0n,uint120:0n,uint128:0n,uint136:0n,uint144:0n,uint152:0n,uint160:0n,uint168:0n,uint176:0n,uint184:0n,uint192:0n,uint200:0n,uint208:0n,uint216:0n,uint224:0n,uint232:0n,uint240:0n,uint248:0n,uint256:0n,int8:0,int16:0,int24:0,int32:0,int40:0,int48:0,int56:0n,int64:0n,int72:0n,int80:0n,int88:0n,int96:0n,int104:0n,int112:0n,int120:0n,int128:0n,int136:0n,int144:0n,int152:0n,int160:0n,int168:0n,int176:0n,int184:0n,int192:0n,int200:0n,int208:0n,int216:0n,int224:0n,int232:0n,int240:0n,int248:0n,int256:0n,bytes1:\"0x00\",bytes2:\"0x0000\",bytes3:\"0x000000\",bytes4:\"0x00000000\",bytes5:\"0x0000000000\",bytes6:\"0x000000000000\",bytes7:\"0x00000000000000\",bytes8:\"0x0000000000000000\",bytes9:\"0x000000000000000000\",bytes10:\"0x00000000000000000000\",bytes11:\"0x0000000000000000000000\",bytes12:\"0x000000000000000000000000\",bytes13:\"0x00000000000000000000000000\",bytes14:\"0x0000000000000000000000000000\",bytes15:\"0x000000000000000000000000000000\",bytes16:\"0x00000000000000000000000000000000\",bytes17:\"0x0000000000000000000000000000000000\",bytes18:\"0x000000000000000000000000000000000000\",bytes19:\"0x00000000000000000000000000000000000000\",bytes20:\"0x0000000000000000000000000000000000000000\",bytes21:\"0x000000000000000000000000000000000000000000\",bytes22:\"0x00000000000000000000000000000000000000000000\",bytes23:\"0x0000000000000000000000000000000000000000000000\",bytes24:\"0x000000000000000000000000000000000000000000000000\",bytes25:\"0x00000000000000000000000000000000000000000000000000\",bytes26:\"0x0000000000000000000000000000000000000000000000000000\",bytes27:\"0x000000000000000000000000000000000000000000000000000000\",bytes28:\"0x00000000000000000000000000000000000000000000000000000000\",bytes29:\"0x0000000000000000000000000000000000000000000000000000000000\",bytes30:\"0x000000000000000000000000000000000000000000000000000000000000\",bytes31:\"0x00000000000000000000000000000000000000000000000000000000000000\",bytes32:\"0x0000000000000000000000000000000000000000000000000000000000000000\",bool:!1,address:\"0x0000000000000000000000000000000000000000\"},A={uint8:1,uint16:2,uint24:3,uint32:4,uint40:5,uint48:6,uint56:7,uint64:8,uint72:9,uint80:10,uint88:11,uint96:12,uint104:13,uint112:14,uint120:15,uint128:16,uint136:17,uint144:18,uint152:19,uint160:20,uint168:21,uint176:22,uint184:23,uint192:24,uint200:25,uint208:26,uint216:27,uint224:28,uint232:29,uint240:30,uint248:31,uint256:32,int8:1,int16:2,int24:3,int32:4,int40:5,int48:6,int56:7,int64:8,int72:9,int80:10,int88:11,int96:12,int104:13,int112:14,int120:15,int128:16,int136:17,int144:18,int152:19,int160:20,int168:21,int176:22,int184:23,int192:24,int200:25,int208:26,int216:27,int224:28,int232:29,int240:30,int248:31,int256:32,bytes1:1,bytes2:2,bytes3:3,bytes4:4,bytes5:5,bytes6:6,bytes7:7,bytes8:8,bytes9:9,bytes10:10,bytes11:11,bytes12:12,bytes13:13,bytes14:14,bytes15:15,bytes16:16,bytes17:17,bytes18:18,bytes19:19,bytes20:20,bytes21:21,bytes22:22,bytes23:23,bytes24:24,bytes25:25,bytes26:26,bytes27:27,bytes28:28,bytes29:29,bytes30:30,bytes31:31,bytes32:32,bool:1,address:20};function g(t){return e.includes(t)}var P={...a,...s};export{r as arrayAbiTypeToStaticAbiType,s as dynamicAbiTypeToDefaultValue,y as dynamicAbiTypes,b as isArrayAbiType,T as isDynamicAbiType,g as isStaticAbiType,P as schemaAbiTypeToDefaultValue,n as schemaAbiTypes,A as staticAbiTypeToByteLength,a as staticAbiTypeToDefaultValue,e as staticAbiTypes};\n//# sourceMappingURL=index.js.map","export const version = '0.9.3';\n//# sourceMappingURL=version.js.map","import { version } from './version.js';\nexport class BaseError extends Error {\n constructor(shortMessage, args = {}) {\n const details = args.cause instanceof BaseError\n ? args.cause.details\n : args.cause?.message\n ? args.cause.message\n : args.details;\n const docsPath = args.cause instanceof BaseError\n ? args.cause.docsPath || args.docsPath\n : args.docsPath;\n const message = [\n shortMessage || 'An error occurred.',\n '',\n ...(args.metaMessages ? [...args.metaMessages, ''] : []),\n ...(docsPath ? [`Docs: https://abitype.dev${docsPath}`] : []),\n ...(details ? [`Details: ${details}`] : []),\n `Version: abitype@${version}`,\n ].join('\\n');\n super(message);\n Object.defineProperty(this, \"details\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"docsPath\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"metaMessages\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"shortMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiTypeError'\n });\n if (args.cause)\n this.cause = args.cause;\n this.details = details;\n this.docsPath = docsPath;\n this.metaMessages = args.metaMessages;\n this.shortMessage = shortMessage;\n }\n}\n//# sourceMappingURL=errors.js.map","export function execTyped(regex, string) {\n const match = regex.exec(string);\n return match?.groups;\n}\nexport const bytesRegex = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/;\nexport const integerRegex = /^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;\nexport const isTupleRegex = /^\\(.+?\\).*?$/;\n//# sourceMappingURL=regex.js.map","import { execTyped } from '../../regex.js';\nconst errorSignatureRegex = /^error (?[a-zA-Z$_][a-zA-Z0-9$_]*)\\((?.*?)\\)$/;\nexport function isErrorSignature(signature) {\n return errorSignatureRegex.test(signature);\n}\nexport function execErrorSignature(signature) {\n return execTyped(errorSignatureRegex, signature);\n}\nconst eventSignatureRegex = /^event (?[a-zA-Z$_][a-zA-Z0-9$_]*)\\((?.*?)\\)$/;\nexport function isEventSignature(signature) {\n return eventSignatureRegex.test(signature);\n}\nexport function execEventSignature(signature) {\n return execTyped(eventSignatureRegex, signature);\n}\nconst functionSignatureRegex = /^function (?[a-zA-Z$_][a-zA-Z0-9$_]*)\\((?.*?)\\)(?: (?external|public{1}))?(?: (?pure|view|nonpayable|payable{1}))?(?: returns\\s?\\((?.*?)\\))?$/;\nexport function isFunctionSignature(signature) {\n return functionSignatureRegex.test(signature);\n}\nexport function execFunctionSignature(signature) {\n return execTyped(functionSignatureRegex, signature);\n}\nconst structSignatureRegex = /^struct (?[a-zA-Z$_][a-zA-Z0-9$_]*) \\{(?.*?)\\}$/;\nexport function isStructSignature(signature) {\n return structSignatureRegex.test(signature);\n}\nexport function execStructSignature(signature) {\n return execTyped(structSignatureRegex, signature);\n}\nconst constructorSignatureRegex = /^constructor\\((?.*?)\\)(?:\\s(?payable{1}))?$/;\nexport function isConstructorSignature(signature) {\n return constructorSignatureRegex.test(signature);\n}\nexport function execConstructorSignature(signature) {\n return execTyped(constructorSignatureRegex, signature);\n}\nconst fallbackSignatureRegex = /^fallback\\(\\)$/;\nexport function isFallbackSignature(signature) {\n return fallbackSignatureRegex.test(signature);\n}\nconst receiveSignatureRegex = /^receive\\(\\) external payable$/;\nexport function isReceiveSignature(signature) {\n return receiveSignatureRegex.test(signature);\n}\nexport const modifiers = new Set([\n 'memory',\n 'indexed',\n 'storage',\n 'calldata',\n]);\nexport const eventModifiers = new Set(['indexed']);\nexport const functionModifiers = new Set([\n 'calldata',\n 'memory',\n 'storage',\n]);\n//# sourceMappingURL=signatures.js.map","import { BaseError } from '../../errors.js';\nexport class InvalidAbiItemError extends BaseError {\n constructor({ signature }) {\n super('Failed to parse ABI item.', {\n details: `parseAbiItem(${JSON.stringify(signature, null, 2)})`,\n docsPath: '/api/human.html#parseabiitem-1',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidAbiItemError'\n });\n }\n}\nexport class UnknownTypeError extends BaseError {\n constructor({ type }) {\n super('Unknown type.', {\n metaMessages: [\n `Type \"${type}\" is not a valid ABI type. Perhaps you forgot to include a struct signature?`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'UnknownTypeError'\n });\n }\n}\nexport class UnknownSolidityTypeError extends BaseError {\n constructor({ type }) {\n super('Unknown type.', {\n metaMessages: [`Type \"${type}\" is not a valid ABI type.`],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'UnknownSolidityTypeError'\n });\n }\n}\n//# sourceMappingURL=abiItem.js.map","import { BaseError } from '../../errors.js';\nexport class InvalidAbiParameterError extends BaseError {\n constructor({ param }) {\n super('Failed to parse ABI parameter.', {\n details: `parseAbiParameter(${JSON.stringify(param, null, 2)})`,\n docsPath: '/api/human.html#parseabiparameter-1',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidAbiParameterError'\n });\n }\n}\nexport class InvalidAbiParametersError extends BaseError {\n constructor({ params }) {\n super('Failed to parse ABI parameters.', {\n details: `parseAbiParameters(${JSON.stringify(params, null, 2)})`,\n docsPath: '/api/human.html#parseabiparameters-1',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidAbiParametersError'\n });\n }\n}\nexport class InvalidParameterError extends BaseError {\n constructor({ param }) {\n super('Invalid ABI parameter.', {\n details: param,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidParameterError'\n });\n }\n}\nexport class SolidityProtectedKeywordError extends BaseError {\n constructor({ param, name }) {\n super('Invalid ABI parameter.', {\n details: param,\n metaMessages: [\n `\"${name}\" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'SolidityProtectedKeywordError'\n });\n }\n}\nexport class InvalidModifierError extends BaseError {\n constructor({ param, type, modifier, }) {\n super('Invalid ABI parameter.', {\n details: param,\n metaMessages: [\n `Modifier \"${modifier}\" not allowed${type ? ` in \"${type}\" type` : ''}.`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidModifierError'\n });\n }\n}\nexport class InvalidFunctionModifierError extends BaseError {\n constructor({ param, type, modifier, }) {\n super('Invalid ABI parameter.', {\n details: param,\n metaMessages: [\n `Modifier \"${modifier}\" not allowed${type ? ` in \"${type}\" type` : ''}.`,\n `Data location can only be specified for array, struct, or mapping types, but \"${modifier}\" was given.`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidFunctionModifierError'\n });\n }\n}\nexport class InvalidAbiTypeParameterError extends BaseError {\n constructor({ abiParameter, }) {\n super('Invalid ABI parameter.', {\n details: JSON.stringify(abiParameter, null, 2),\n metaMessages: ['ABI parameter type is invalid.'],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidAbiTypeParameterError'\n });\n }\n}\n//# sourceMappingURL=abiParameter.js.map","import { BaseError } from '../../errors.js';\nexport class InvalidSignatureError extends BaseError {\n constructor({ signature, type, }) {\n super(`Invalid ${type} signature.`, {\n details: signature,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidSignatureError'\n });\n }\n}\nexport class UnknownSignatureError extends BaseError {\n constructor({ signature }) {\n super('Unknown signature.', {\n details: signature,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'UnknownSignatureError'\n });\n }\n}\nexport class InvalidStructSignatureError extends BaseError {\n constructor({ signature }) {\n super('Invalid struct signature.', {\n details: signature,\n metaMessages: ['No properties exist.'],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidStructSignatureError'\n });\n }\n}\n//# sourceMappingURL=signature.js.map","import { BaseError } from '../../errors.js';\nexport class CircularReferenceError extends BaseError {\n constructor({ type }) {\n super('Circular reference detected.', {\n metaMessages: [`Struct \"${type}\" is a circular reference.`],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'CircularReferenceError'\n });\n }\n}\n//# sourceMappingURL=struct.js.map","import { BaseError } from '../../errors.js';\nexport class InvalidParenthesisError extends BaseError {\n constructor({ current, depth }) {\n super('Unbalanced parentheses.', {\n metaMessages: [\n `\"${current.trim()}\" has too many ${depth > 0 ? 'opening' : 'closing'} parentheses.`,\n ],\n details: `Depth \"${depth}\"`,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidParenthesisError'\n });\n }\n}\n//# sourceMappingURL=splitParameters.js.map","export function getParameterCacheKey(param, type) {\n if (type)\n return `${type}:${param}`;\n return param;\n}\nexport const parameterCache = new Map([\n ['address', { type: 'address' }],\n ['bool', { type: 'bool' }],\n ['bytes', { type: 'bytes' }],\n ['bytes32', { type: 'bytes32' }],\n ['int', { type: 'int256' }],\n ['int256', { type: 'int256' }],\n ['string', { type: 'string' }],\n ['uint', { type: 'uint256' }],\n ['uint8', { type: 'uint8' }],\n ['uint16', { type: 'uint16' }],\n ['uint24', { type: 'uint24' }],\n ['uint32', { type: 'uint32' }],\n ['uint64', { type: 'uint64' }],\n ['uint96', { type: 'uint96' }],\n ['uint112', { type: 'uint112' }],\n ['uint160', { type: 'uint160' }],\n ['uint192', { type: 'uint192' }],\n ['uint256', { type: 'uint256' }],\n ['address owner', { type: 'address', name: 'owner' }],\n ['address to', { type: 'address', name: 'to' }],\n ['bool approved', { type: 'bool', name: 'approved' }],\n ['bytes _data', { type: 'bytes', name: '_data' }],\n ['bytes data', { type: 'bytes', name: 'data' }],\n ['bytes signature', { type: 'bytes', name: 'signature' }],\n ['bytes32 hash', { type: 'bytes32', name: 'hash' }],\n ['bytes32 r', { type: 'bytes32', name: 'r' }],\n ['bytes32 root', { type: 'bytes32', name: 'root' }],\n ['bytes32 s', { type: 'bytes32', name: 's' }],\n ['string name', { type: 'string', name: 'name' }],\n ['string symbol', { type: 'string', name: 'symbol' }],\n ['string tokenURI', { type: 'string', name: 'tokenURI' }],\n ['uint tokenId', { type: 'uint256', name: 'tokenId' }],\n ['uint8 v', { type: 'uint8', name: 'v' }],\n ['uint256 balance', { type: 'uint256', name: 'balance' }],\n ['uint256 tokenId', { type: 'uint256', name: 'tokenId' }],\n ['uint256 value', { type: 'uint256', name: 'value' }],\n [\n 'event:address indexed from',\n { type: 'address', name: 'from', indexed: true },\n ],\n ['event:address indexed to', { type: 'address', name: 'to', indexed: true }],\n [\n 'event:uint indexed tokenId',\n { type: 'uint256', name: 'tokenId', indexed: true },\n ],\n [\n 'event:uint256 indexed tokenId',\n { type: 'uint256', name: 'tokenId', indexed: true },\n ],\n]);\n//# sourceMappingURL=cache.js.map","import { bytesRegex, execTyped, integerRegex, isTupleRegex, } from '../../regex.js';\nimport { UnknownSolidityTypeError } from '../errors/abiItem.js';\nimport { InvalidFunctionModifierError, InvalidModifierError, InvalidParameterError, SolidityProtectedKeywordError, } from '../errors/abiParameter.js';\nimport { InvalidSignatureError, UnknownSignatureError, } from '../errors/signature.js';\nimport { InvalidParenthesisError } from '../errors/splitParameters.js';\nimport { getParameterCacheKey, parameterCache } from './cache.js';\nimport { eventModifiers, execConstructorSignature, execErrorSignature, execEventSignature, execFunctionSignature, functionModifiers, isConstructorSignature, isErrorSignature, isEventSignature, isFallbackSignature, isFunctionSignature, isReceiveSignature, } from './signatures.js';\nexport function parseSignature(signature, structs = {}) {\n if (isFunctionSignature(signature)) {\n const match = execFunctionSignature(signature);\n if (!match)\n throw new InvalidSignatureError({ signature, type: 'function' });\n const inputParams = splitParameters(match.parameters);\n const inputs = [];\n const inputLength = inputParams.length;\n for (let i = 0; i < inputLength; i++) {\n inputs.push(parseAbiParameter(inputParams[i], {\n modifiers: functionModifiers,\n structs,\n type: 'function',\n }));\n }\n const outputs = [];\n if (match.returns) {\n const outputParams = splitParameters(match.returns);\n const outputLength = outputParams.length;\n for (let i = 0; i < outputLength; i++) {\n outputs.push(parseAbiParameter(outputParams[i], {\n modifiers: functionModifiers,\n structs,\n type: 'function',\n }));\n }\n }\n return {\n name: match.name,\n type: 'function',\n stateMutability: match.stateMutability ?? 'nonpayable',\n inputs,\n outputs,\n };\n }\n if (isEventSignature(signature)) {\n const match = execEventSignature(signature);\n if (!match)\n throw new InvalidSignatureError({ signature, type: 'event' });\n const params = splitParameters(match.parameters);\n const abiParameters = [];\n const length = params.length;\n for (let i = 0; i < length; i++) {\n abiParameters.push(parseAbiParameter(params[i], {\n modifiers: eventModifiers,\n structs,\n type: 'event',\n }));\n }\n return { name: match.name, type: 'event', inputs: abiParameters };\n }\n if (isErrorSignature(signature)) {\n const match = execErrorSignature(signature);\n if (!match)\n throw new InvalidSignatureError({ signature, type: 'error' });\n const params = splitParameters(match.parameters);\n const abiParameters = [];\n const length = params.length;\n for (let i = 0; i < length; i++) {\n abiParameters.push(parseAbiParameter(params[i], { structs, type: 'error' }));\n }\n return { name: match.name, type: 'error', inputs: abiParameters };\n }\n if (isConstructorSignature(signature)) {\n const match = execConstructorSignature(signature);\n if (!match)\n throw new InvalidSignatureError({ signature, type: 'constructor' });\n const params = splitParameters(match.parameters);\n const abiParameters = [];\n const length = params.length;\n for (let i = 0; i < length; i++) {\n abiParameters.push(parseAbiParameter(params[i], { structs, type: 'constructor' }));\n }\n return {\n type: 'constructor',\n stateMutability: match.stateMutability ?? 'nonpayable',\n inputs: abiParameters,\n };\n }\n if (isFallbackSignature(signature))\n return { type: 'fallback' };\n if (isReceiveSignature(signature))\n return {\n type: 'receive',\n stateMutability: 'payable',\n };\n throw new UnknownSignatureError({ signature });\n}\nconst abiParameterWithoutTupleRegex = /^(?[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\\[\\d*?\\])+?)?(?:\\s(?calldata|indexed|memory|storage{1}))?(?:\\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/;\nconst abiParameterWithTupleRegex = /^\\((?.+?)\\)(?(?:\\[\\d*?\\])+?)?(?:\\s(?calldata|indexed|memory|storage{1}))?(?:\\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/;\nconst dynamicIntegerRegex = /^u?int$/;\nexport function parseAbiParameter(param, options) {\n const parameterCacheKey = getParameterCacheKey(param, options?.type);\n if (parameterCache.has(parameterCacheKey))\n return parameterCache.get(parameterCacheKey);\n const isTuple = isTupleRegex.test(param);\n const match = execTyped(isTuple ? abiParameterWithTupleRegex : abiParameterWithoutTupleRegex, param);\n if (!match)\n throw new InvalidParameterError({ param });\n if (match.name && isSolidityKeyword(match.name))\n throw new SolidityProtectedKeywordError({ param, name: match.name });\n const name = match.name ? { name: match.name } : {};\n const indexed = match.modifier === 'indexed' ? { indexed: true } : {};\n const structs = options?.structs ?? {};\n let type;\n let components = {};\n if (isTuple) {\n type = 'tuple';\n const params = splitParameters(match.type);\n const components_ = [];\n const length = params.length;\n for (let i = 0; i < length; i++) {\n components_.push(parseAbiParameter(params[i], { structs }));\n }\n components = { components: components_ };\n }\n else if (match.type in structs) {\n type = 'tuple';\n components = { components: structs[match.type] };\n }\n else if (dynamicIntegerRegex.test(match.type)) {\n type = `${match.type}256`;\n }\n else {\n type = match.type;\n if (!(options?.type === 'struct') && !isSolidityType(type))\n throw new UnknownSolidityTypeError({ type });\n }\n if (match.modifier) {\n if (!options?.modifiers?.has?.(match.modifier))\n throw new InvalidModifierError({\n param,\n type: options?.type,\n modifier: match.modifier,\n });\n if (functionModifiers.has(match.modifier) &&\n !isValidDataLocation(type, !!match.array))\n throw new InvalidFunctionModifierError({\n param,\n type: options?.type,\n modifier: match.modifier,\n });\n }\n const abiParameter = {\n type: `${type}${match.array ?? ''}`,\n ...name,\n ...indexed,\n ...components,\n };\n parameterCache.set(parameterCacheKey, abiParameter);\n return abiParameter;\n}\nexport function splitParameters(params, result = [], current = '', depth = 0) {\n if (params === '') {\n if (current === '')\n return result;\n if (depth !== 0)\n throw new InvalidParenthesisError({ current, depth });\n result.push(current.trim());\n return result;\n }\n const length = params.length;\n for (let i = 0; i < length; i++) {\n const char = params[i];\n const tail = params.slice(i + 1);\n switch (char) {\n case ',':\n return depth === 0\n ? splitParameters(tail, [...result, current.trim()])\n : splitParameters(tail, result, `${current}${char}`, depth);\n case '(':\n return splitParameters(tail, result, `${current}${char}`, depth + 1);\n case ')':\n return splitParameters(tail, result, `${current}${char}`, depth - 1);\n default:\n return splitParameters(tail, result, `${current}${char}`, depth);\n }\n }\n return [];\n}\nexport function isSolidityType(type) {\n return (type === 'address' ||\n type === 'bool' ||\n type === 'function' ||\n type === 'string' ||\n bytesRegex.test(type) ||\n integerRegex.test(type));\n}\nconst protectedKeywordsRegex = /^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;\nexport function isSolidityKeyword(name) {\n return (name === 'address' ||\n name === 'bool' ||\n name === 'function' ||\n name === 'string' ||\n name === 'tuple' ||\n bytesRegex.test(name) ||\n integerRegex.test(name) ||\n protectedKeywordsRegex.test(name));\n}\nexport function isValidDataLocation(type, isArray) {\n return isArray || type === 'bytes' || type === 'string' || type === 'tuple';\n}\n//# sourceMappingURL=utils.js.map","import { execTyped, isTupleRegex } from '../../regex.js';\nimport { UnknownTypeError } from '../errors/abiItem.js';\nimport { InvalidAbiTypeParameterError } from '../errors/abiParameter.js';\nimport { InvalidSignatureError, InvalidStructSignatureError, } from '../errors/signature.js';\nimport { CircularReferenceError } from '../errors/struct.js';\nimport { execStructSignature, isStructSignature } from './signatures.js';\nimport { isSolidityType, parseAbiParameter } from './utils.js';\nexport function parseStructs(signatures) {\n const shallowStructs = {};\n const signaturesLength = signatures.length;\n for (let i = 0; i < signaturesLength; i++) {\n const signature = signatures[i];\n if (!isStructSignature(signature))\n continue;\n const match = execStructSignature(signature);\n if (!match)\n throw new InvalidSignatureError({ signature, type: 'struct' });\n const properties = match.properties.split(';');\n const components = [];\n const propertiesLength = properties.length;\n for (let k = 0; k < propertiesLength; k++) {\n const property = properties[k];\n const trimmed = property.trim();\n if (!trimmed)\n continue;\n const abiParameter = parseAbiParameter(trimmed, {\n type: 'struct',\n });\n components.push(abiParameter);\n }\n if (!components.length)\n throw new InvalidStructSignatureError({ signature });\n shallowStructs[match.name] = components;\n }\n const resolvedStructs = {};\n const entries = Object.entries(shallowStructs);\n const entriesLength = entries.length;\n for (let i = 0; i < entriesLength; i++) {\n const [name, parameters] = entries[i];\n resolvedStructs[name] = resolveStructs(parameters, shallowStructs);\n }\n return resolvedStructs;\n}\nconst typeWithoutTupleRegex = /^(?[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\\[\\d*?\\])+?)?$/;\nfunction resolveStructs(abiParameters, structs, ancestors = new Set()) {\n const components = [];\n const length = abiParameters.length;\n for (let i = 0; i < length; i++) {\n const abiParameter = abiParameters[i];\n const isTuple = isTupleRegex.test(abiParameter.type);\n if (isTuple)\n components.push(abiParameter);\n else {\n const match = execTyped(typeWithoutTupleRegex, abiParameter.type);\n if (!match?.type)\n throw new InvalidAbiTypeParameterError({ abiParameter });\n const { array, type } = match;\n if (type in structs) {\n if (ancestors.has(type))\n throw new CircularReferenceError({ type });\n components.push({\n ...abiParameter,\n type: `tuple${array ?? ''}`,\n components: resolveStructs(structs[type] ?? [], structs, new Set([...ancestors, type])),\n });\n }\n else {\n if (isSolidityType(type))\n components.push(abiParameter);\n else\n throw new UnknownTypeError({ type });\n }\n }\n }\n return components;\n}\n//# sourceMappingURL=structs.js.map","import { isStructSignature } from './runtime/signatures.js';\nimport { parseStructs } from './runtime/structs.js';\nimport { parseSignature } from './runtime/utils.js';\nexport function parseAbi(signatures) {\n const structs = parseStructs(signatures);\n const abi = [];\n const length = signatures.length;\n for (let i = 0; i < length; i++) {\n const signature = signatures[i];\n if (isStructSignature(signature))\n continue;\n abi.push(parseSignature(signature, structs));\n }\n return abi;\n}\n//# sourceMappingURL=parseAbi.js.map","import { InvalidAbiParametersError } from '../index.js';\nimport { isStructSignature, modifiers } from './runtime/signatures.js';\nimport { parseStructs } from './runtime/structs.js';\nimport { splitParameters } from './runtime/utils.js';\nimport { parseAbiParameter as parseAbiParameter_ } from './runtime/utils.js';\nexport function parseAbiParameters(params) {\n const abiParameters = [];\n if (typeof params === 'string') {\n const parameters = splitParameters(params);\n const length = parameters.length;\n for (let i = 0; i < length; i++) {\n abiParameters.push(parseAbiParameter_(parameters[i], { modifiers }));\n }\n }\n else {\n const structs = parseStructs(params);\n const length = params.length;\n for (let i = 0; i < length; i++) {\n const signature = params[i];\n if (isStructSignature(signature))\n continue;\n const parameters = splitParameters(signature);\n const length = parameters.length;\n for (let k = 0; k < length; k++) {\n abiParameters.push(parseAbiParameter_(parameters[k], { modifiers, structs }));\n }\n }\n }\n if (abiParameters.length === 0)\n throw new InvalidAbiParametersError({ params });\n return abiParameters;\n}\n//# sourceMappingURL=parseAbiParameters.js.map","import { InvalidDefinitionTypeError } from '../../errors/abi.js';\nexport function formatAbiItem(abiItem, { includeName = false } = {}) {\n if (abiItem.type !== 'function' &&\n abiItem.type !== 'event' &&\n abiItem.type !== 'error')\n throw new InvalidDefinitionTypeError(abiItem.type);\n return `${abiItem.name}(${formatAbiParams(abiItem.inputs, { includeName })})`;\n}\nexport function formatAbiParams(params, { includeName = false } = {}) {\n if (!params)\n return '';\n return params\n .map((param) => formatAbiParam(param, { includeName }))\n .join(includeName ? ', ' : ',');\n}\nfunction formatAbiParam(param, { includeName }) {\n if (param.type.startsWith('tuple')) {\n return `(${formatAbiParams(param.components, { includeName })})${param.type.slice('tuple'.length)}`;\n }\n return param.type + (includeName && param.name ? ` ${param.name}` : '');\n}\n//# sourceMappingURL=formatAbiItem.js.map","export function isHex(value, { strict = true } = {}) {\n if (!value)\n return false;\n if (typeof value !== 'string')\n return false;\n return strict ? /^0x[0-9a-fA-F]*$/.test(value) : value.startsWith('0x');\n}\n//# sourceMappingURL=isHex.js.map","import { isHex } from './isHex.js';\n/**\n * @description Retrieves the size of the value (in bytes).\n *\n * @param value The value (hex or byte array) to retrieve the size of.\n * @returns The size of the value (in bytes).\n */\nexport function size(value) {\n if (isHex(value, { strict: false }))\n return Math.ceil((value.length - 2) / 2);\n return value.length;\n}\n//# sourceMappingURL=size.js.map","export const version = '1.5.4';\n//# sourceMappingURL=version.js.map","import { version } from './version.js';\nexport const getContractAddress = (address) => address;\nexport const getUrl = (url) => url;\nexport const getVersion = () => `viem@${version}`;\n//# sourceMappingURL=utils.js.map","import { getVersion } from './utils.js';\nexport class BaseError extends Error {\n constructor(shortMessage, args = {}) {\n super();\n Object.defineProperty(this, \"details\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"docsPath\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"metaMessages\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"shortMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ViemError'\n });\n Object.defineProperty(this, \"version\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: getVersion()\n });\n const details = args.cause instanceof BaseError\n ? args.cause.details\n : args.cause?.message\n ? args.cause.message\n : args.details;\n const docsPath = args.cause instanceof BaseError\n ? args.cause.docsPath || args.docsPath\n : args.docsPath;\n this.message = [\n shortMessage || 'An error occurred.',\n '',\n ...(args.metaMessages ? [...args.metaMessages, ''] : []),\n ...(docsPath\n ? [\n `Docs: https://viem.sh${docsPath}.html${args.docsSlug ? `#${args.docsSlug}` : ''}`,\n ]\n : []),\n ...(details ? [`Details: ${details}`] : []),\n `Version: ${this.version}`,\n ].join('\\n');\n if (args.cause)\n this.cause = args.cause;\n this.details = details;\n this.docsPath = docsPath;\n this.metaMessages = args.metaMessages;\n this.shortMessage = shortMessage;\n }\n walk(fn) {\n return walk(this, fn);\n }\n}\nfunction walk(err, fn) {\n if (fn?.(err))\n return err;\n if (err && typeof err === 'object' && 'cause' in err)\n return walk(err.cause, fn);\n return fn ? null : err;\n}\n//# sourceMappingURL=base.js.map","import { formatAbiItem, formatAbiParams } from '../utils/abi/formatAbiItem.js';\nimport { size } from '../utils/data/size.js';\nimport { BaseError } from './base.js';\nexport class AbiConstructorNotFoundError extends BaseError {\n constructor({ docsPath }) {\n super([\n 'A constructor was not found on the ABI.',\n 'Make sure you are using the correct ABI and that the constructor exists on it.',\n ].join('\\n'), {\n docsPath,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiConstructorNotFoundError'\n });\n }\n}\nexport class AbiConstructorParamsNotFoundError extends BaseError {\n constructor({ docsPath }) {\n super([\n 'Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.',\n 'Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists.',\n ].join('\\n'), {\n docsPath,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiConstructorParamsNotFoundError'\n });\n }\n}\nexport class AbiDecodingDataSizeInvalidError extends BaseError {\n constructor({ data, size }) {\n super([\n `Data size of ${size} bytes is invalid.`,\n 'Size must be in increments of 32 bytes (size % 32 === 0).',\n ].join('\\n'), { metaMessages: [`Data: ${data} (${size} bytes)`] });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiDecodingDataSizeInvalidError'\n });\n }\n}\nexport class AbiDecodingDataSizeTooSmallError extends BaseError {\n constructor({ data, params, size, }) {\n super([`Data size of ${size} bytes is too small for given parameters.`].join('\\n'), {\n metaMessages: [\n `Params: (${formatAbiParams(params, { includeName: true })})`,\n `Data: ${data} (${size} bytes)`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiDecodingDataSizeTooSmallError'\n });\n Object.defineProperty(this, \"data\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"params\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"size\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.data = data;\n this.params = params;\n this.size = size;\n }\n}\nexport class AbiDecodingZeroDataError extends BaseError {\n constructor() {\n super('Cannot decode zero data (\"0x\") with ABI parameters.');\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiDecodingZeroDataError'\n });\n }\n}\nexport class AbiEncodingArrayLengthMismatchError extends BaseError {\n constructor({ expectedLength, givenLength, type, }) {\n super([\n `ABI encoding array length mismatch for type ${type}.`,\n `Expected length: ${expectedLength}`,\n `Given length: ${givenLength}`,\n ].join('\\n'));\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiEncodingArrayLengthMismatchError'\n });\n }\n}\nexport class AbiEncodingBytesSizeMismatchError extends BaseError {\n constructor({ expectedSize, value }) {\n super(`Size of bytes \"${value}\" (bytes${size(value)}) does not match expected size (bytes${expectedSize}).`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiEncodingBytesSizeMismatchError'\n });\n }\n}\nexport class AbiEncodingLengthMismatchError extends BaseError {\n constructor({ expectedLength, givenLength, }) {\n super([\n 'ABI encoding params/values length mismatch.',\n `Expected length (params): ${expectedLength}`,\n `Given length (values): ${givenLength}`,\n ].join('\\n'));\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiEncodingLengthMismatchError'\n });\n }\n}\nexport class AbiErrorInputsNotFoundError extends BaseError {\n constructor(errorName, { docsPath }) {\n super([\n `Arguments (\\`args\\`) were provided to \"${errorName}\", but \"${errorName}\" on the ABI does not contain any parameters (\\`inputs\\`).`,\n 'Cannot encode error result without knowing what the parameter types are.',\n 'Make sure you are using the correct ABI and that the inputs exist on it.',\n ].join('\\n'), {\n docsPath,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiErrorInputsNotFoundError'\n });\n }\n}\nexport class AbiErrorNotFoundError extends BaseError {\n constructor(errorName, { docsPath } = {}) {\n super([\n `Error ${errorName ? `\"${errorName}\" ` : ''}not found on ABI.`,\n 'Make sure you are using the correct ABI and that the error exists on it.',\n ].join('\\n'), {\n docsPath,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiErrorNotFoundError'\n });\n }\n}\nexport class AbiErrorSignatureNotFoundError extends BaseError {\n constructor(signature, { docsPath }) {\n super([\n `Encoded error signature \"${signature}\" not found on ABI.`,\n 'Make sure you are using the correct ABI and that the error exists on it.',\n `You can look up the decoded signature here: https://openchain.xyz/signatures?query=${signature}.`,\n ].join('\\n'), {\n docsPath,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiErrorSignatureNotFoundError'\n });\n Object.defineProperty(this, \"signature\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.signature = signature;\n }\n}\nexport class AbiEventSignatureEmptyTopicsError extends BaseError {\n constructor({ docsPath }) {\n super('Cannot extract event signature from empty topics.', {\n docsPath,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiEventSignatureEmptyTopicsError'\n });\n }\n}\nexport class AbiEventSignatureNotFoundError extends BaseError {\n constructor(signature, { docsPath }) {\n super([\n `Encoded event signature \"${signature}\" not found on ABI.`,\n 'Make sure you are using the correct ABI and that the event exists on it.',\n `You can look up the signature here: https://openchain.xyz/signatures?query=${signature}.`,\n ].join('\\n'), {\n docsPath,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiEventSignatureNotFoundError'\n });\n }\n}\nexport class AbiEventNotFoundError extends BaseError {\n constructor(eventName, { docsPath } = {}) {\n super([\n `Event ${eventName ? `\"${eventName}\" ` : ''}not found on ABI.`,\n 'Make sure you are using the correct ABI and that the event exists on it.',\n ].join('\\n'), {\n docsPath,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiEventNotFoundError'\n });\n }\n}\nexport class AbiFunctionNotFoundError extends BaseError {\n constructor(functionName, { docsPath } = {}) {\n super([\n `Function ${functionName ? `\"${functionName}\" ` : ''}not found on ABI.`,\n 'Make sure you are using the correct ABI and that the function exists on it.',\n ].join('\\n'), {\n docsPath,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiFunctionNotFoundError'\n });\n }\n}\nexport class AbiFunctionOutputsNotFoundError extends BaseError {\n constructor(functionName, { docsPath }) {\n super([\n `Function \"${functionName}\" does not contain any \\`outputs\\` on ABI.`,\n 'Cannot decode function result without knowing what the parameter types are.',\n 'Make sure you are using the correct ABI and that the function exists on it.',\n ].join('\\n'), {\n docsPath,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiFunctionOutputsNotFoundError'\n });\n }\n}\nexport class AbiFunctionSignatureNotFoundError extends BaseError {\n constructor(signature, { docsPath }) {\n super([\n `Encoded function signature \"${signature}\" not found on ABI.`,\n 'Make sure you are using the correct ABI and that the function exists on it.',\n `You can look up the signature here: https://openchain.xyz/signatures?query=${signature}.`,\n ].join('\\n'), {\n docsPath,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiFunctionSignatureNotFoundError'\n });\n }\n}\nexport class BytesSizeMismatchError extends BaseError {\n constructor({ expectedSize, givenSize, }) {\n super(`Expected bytes${expectedSize}, got bytes${givenSize}.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'BytesSizeMismatchError'\n });\n }\n}\nexport class DecodeLogDataMismatch extends BaseError {\n constructor({ abiItem, data, params, size, }) {\n super([\n `Data size of ${size} bytes is too small for non-indexed event parameters.`,\n ].join('\\n'), {\n metaMessages: [\n `Params: (${formatAbiParams(params, { includeName: true })})`,\n `Data: ${data} (${size} bytes)`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'DecodeLogDataMismatch'\n });\n Object.defineProperty(this, \"abiItem\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"data\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"params\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"size\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.abiItem = abiItem;\n this.data = data;\n this.params = params;\n this.size = size;\n }\n}\nexport class DecodeLogTopicsMismatch extends BaseError {\n constructor({ abiItem, param, }) {\n super([\n `Expected a topic for indexed event parameter${param.name ? ` \"${param.name}\"` : ''} on event \"${formatAbiItem(abiItem, { includeName: true })}\".`,\n ].join('\\n'));\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'DecodeLogTopicsMismatch'\n });\n Object.defineProperty(this, \"abiItem\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.abiItem = abiItem;\n }\n}\nexport class InvalidAbiEncodingTypeError extends BaseError {\n constructor(type, { docsPath }) {\n super([\n `Type \"${type}\" is not a valid encoding type.`,\n 'Please provide a valid ABI type.',\n ].join('\\n'), { docsPath });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidAbiEncodingType'\n });\n }\n}\nexport class InvalidAbiDecodingTypeError extends BaseError {\n constructor(type, { docsPath }) {\n super([\n `Type \"${type}\" is not a valid decoding type.`,\n 'Please provide a valid ABI type.',\n ].join('\\n'), { docsPath });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidAbiDecodingType'\n });\n }\n}\nexport class InvalidArrayError extends BaseError {\n constructor(value) {\n super([`Value \"${value}\" is not a valid array.`].join('\\n'));\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidArrayError'\n });\n }\n}\nexport class InvalidDefinitionTypeError extends BaseError {\n constructor(type) {\n super([\n `\"${type}\" is not a valid definition type.`,\n 'Valid types: \"function\", \"event\", \"error\"',\n ].join('\\n'));\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidDefinitionTypeError'\n });\n }\n}\nexport class UnsupportedPackedAbiType extends BaseError {\n constructor(type) {\n super(`Type \"${type}\" is not supported for packed encoding.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'UnsupportedPackedAbiType'\n });\n }\n}\n//# sourceMappingURL=abi.js.map","import { BaseError } from './base.js';\nexport class FilterTypeNotSupportedError extends BaseError {\n constructor(type) {\n super(`Filter type \"${type}\" is not supported.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'FilterTypeNotSupportedError'\n });\n }\n}\n//# sourceMappingURL=log.js.map","import { BaseError } from './base.js';\nexport class SliceOffsetOutOfBoundsError extends BaseError {\n constructor({ offset, position, size, }) {\n super(`Slice ${position === 'start' ? 'starting' : 'ending'} at offset \"${offset}\" is out-of-bounds (size: ${size}).`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'SliceOffsetOutOfBoundsError'\n });\n }\n}\nexport class SizeExceedsPaddingSizeError extends BaseError {\n constructor({ size, targetSize, type, }) {\n super(`${type.charAt(0).toUpperCase()}${type\n .slice(1)\n .toLowerCase()} size (${size}) exceeds padding size (${targetSize}).`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'SizeExceedsPaddingSizeError'\n });\n }\n}\n//# sourceMappingURL=data.js.map","import { SizeExceedsPaddingSizeError } from '../../errors/data.js';\nexport function pad(hexOrBytes, { dir, size = 32 } = {}) {\n if (typeof hexOrBytes === 'string')\n return padHex(hexOrBytes, { dir, size });\n return padBytes(hexOrBytes, { dir, size });\n}\nexport function padHex(hex_, { dir, size = 32 } = {}) {\n if (size === null)\n return hex_;\n const hex = hex_.replace('0x', '');\n if (hex.length > size * 2)\n throw new SizeExceedsPaddingSizeError({\n size: Math.ceil(hex.length / 2),\n targetSize: size,\n type: 'hex',\n });\n return `0x${hex[dir === 'right' ? 'padEnd' : 'padStart'](size * 2, '0')}`;\n}\nexport function padBytes(bytes, { dir, size = 32 } = {}) {\n if (size === null)\n return bytes;\n if (bytes.length > size)\n throw new SizeExceedsPaddingSizeError({\n size: bytes.length,\n targetSize: size,\n type: 'bytes',\n });\n const paddedBytes = new Uint8Array(size);\n for (let i = 0; i < size; i++) {\n const padEnd = dir === 'right';\n paddedBytes[padEnd ? i : size - i - 1] =\n bytes[padEnd ? i : bytes.length - i - 1];\n }\n return paddedBytes;\n}\n//# sourceMappingURL=pad.js.map","import { BaseError } from './base.js';\nexport class DataLengthTooLongError extends BaseError {\n constructor({ consumed, length }) {\n super(`Consumed bytes (${consumed}) is shorter than data length (${length - 1}).`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'DataLengthTooLongError'\n });\n }\n}\nexport class DataLengthTooShortError extends BaseError {\n constructor({ length, dataLength }) {\n super(`Data length (${dataLength - 1}) is shorter than prefix length (${length - 1}).`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'DataLengthTooShortError'\n });\n }\n}\nexport class IntegerOutOfRangeError extends BaseError {\n constructor({ max, min, signed, size, value, }) {\n super(`Number \"${value}\" is not in safe ${size ? `${size * 8}-bit ${signed ? 'signed' : 'unsigned'} ` : ''}integer range ${max ? `(${min} to ${max})` : `(above ${min})`}`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'IntegerOutOfRangeError'\n });\n }\n}\nexport class InvalidBytesBooleanError extends BaseError {\n constructor(bytes) {\n super(`Bytes value \"${bytes}\" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidBytesBooleanError'\n });\n }\n}\nexport class InvalidHexBooleanError extends BaseError {\n constructor(hex) {\n super(`Hex value \"${hex}\" is not a valid boolean. The hex value must be \"0x0\" (false) or \"0x1\" (true).`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidHexBooleanError'\n });\n }\n}\nexport class InvalidHexValueError extends BaseError {\n constructor(value) {\n super(`Hex value \"${value}\" is an odd length (${value.length}). It must be an even length.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidHexValueError'\n });\n }\n}\nexport class OffsetOutOfBoundsError extends BaseError {\n constructor({ nextOffset, offset }) {\n super(`Next offset (${nextOffset}) is greater than previous offset + consumed bytes (${offset})`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'OffsetOutOfBoundsError'\n });\n }\n}\nexport class SizeOverflowError extends BaseError {\n constructor({ givenSize, maxSize }) {\n super(`Size cannot exceed ${maxSize} bytes. Given size: ${givenSize} bytes.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'SizeOverflowError'\n });\n }\n}\n//# sourceMappingURL=encoding.js.map","export function trim(hexOrBytes, { dir = 'left' } = {}) {\n let data = typeof hexOrBytes === 'string' ? hexOrBytes.replace('0x', '') : hexOrBytes;\n let sliceLength = 0;\n for (let i = 0; i < data.length - 1; i++) {\n if (data[dir === 'left' ? i : data.length - i - 1].toString() === '0')\n sliceLength++;\n else\n break;\n }\n data =\n dir === 'left'\n ? data.slice(sliceLength)\n : data.slice(0, data.length - sliceLength);\n if (typeof hexOrBytes === 'string') {\n if (data.length === 1 && dir === 'right')\n data = `${data}0`;\n return `0x${data.length % 2 === 1 ? `0${data}` : data}`;\n }\n return data;\n}\n//# sourceMappingURL=trim.js.map","import { InvalidHexBooleanError, SizeOverflowError, } from '../../errors/encoding.js';\nimport { size as size_ } from '../data/size.js';\nimport { trim } from '../data/trim.js';\nimport { hexToBytes } from './toBytes.js';\nexport function assertSize(hexOrBytes, { size }) {\n if (size_(hexOrBytes) > size)\n throw new SizeOverflowError({\n givenSize: size_(hexOrBytes),\n maxSize: size,\n });\n}\n/**\n * Decodes a hex string into a string, number, bigint, boolean, or byte array.\n *\n * - Docs: https://viem.sh/docs/utilities/fromHex.html\n * - Example: https://viem.sh/docs/utilities/fromHex.html#usage\n *\n * @param hex Hex string to decode.\n * @param toOrOpts Type to convert to or options.\n * @returns Decoded value.\n *\n * @example\n * import { fromHex } from 'viem'\n * const data = fromHex('0x1a4', 'number')\n * // 420\n *\n * @example\n * import { fromHex } from 'viem'\n * const data = fromHex('0x48656c6c6f20576f726c6421', 'string')\n * // 'Hello world'\n *\n * @example\n * import { fromHex } from 'viem'\n * const data = fromHex('0x48656c6c6f20576f726c64210000000000000000000000000000000000000000', {\n * size: 32,\n * to: 'string'\n * })\n * // 'Hello world'\n */\nexport function fromHex(hex, toOrOpts) {\n const opts = typeof toOrOpts === 'string' ? { to: toOrOpts } : toOrOpts;\n const to = opts.to;\n if (to === 'number')\n return hexToNumber(hex, opts);\n if (to === 'bigint')\n return hexToBigInt(hex, opts);\n if (to === 'string')\n return hexToString(hex, opts);\n if (to === 'boolean')\n return hexToBool(hex, opts);\n return hexToBytes(hex, opts);\n}\n/**\n * Decodes a hex value into a bigint.\n *\n * - Docs: https://viem.sh/docs/utilities/fromHex.html#hextobigint\n *\n * @param hex Hex value to decode.\n * @param opts Options.\n * @returns BigInt value.\n *\n * @example\n * import { hexToBigInt } from 'viem'\n * const data = hexToBigInt('0x1a4', { signed: true })\n * // 420n\n *\n * @example\n * import { hexToBigInt } from 'viem'\n * const data = hexToBigInt('0x00000000000000000000000000000000000000000000000000000000000001a4', { size: 32 })\n * // 420n\n */\nexport function hexToBigInt(hex, opts = {}) {\n const { signed } = opts;\n if (opts.size)\n assertSize(hex, { size: opts.size });\n const value = BigInt(hex);\n if (!signed)\n return value;\n const size = (hex.length - 2) / 2;\n const max = (1n << (BigInt(size) * 8n - 1n)) - 1n;\n if (value <= max)\n return value;\n return value - BigInt(`0x${'f'.padStart(size * 2, 'f')}`) - 1n;\n}\n/**\n * Decodes a hex value into a boolean.\n *\n * - Docs: https://viem.sh/docs/utilities/fromHex.html#hextobool\n *\n * @param hex Hex value to decode.\n * @param opts Options.\n * @returns Boolean value.\n *\n * @example\n * import { hexToBool } from 'viem'\n * const data = hexToBool('0x01')\n * // true\n *\n * @example\n * import { hexToBool } from 'viem'\n * const data = hexToBool('0x0000000000000000000000000000000000000000000000000000000000000001', { size: 32 })\n * // true\n */\nexport function hexToBool(hex_, opts = {}) {\n let hex = hex_;\n if (opts.size) {\n assertSize(hex, { size: opts.size });\n hex = trim(hex);\n }\n if (trim(hex) === '0x00')\n return false;\n if (trim(hex) === '0x01')\n return true;\n throw new InvalidHexBooleanError(hex);\n}\n/**\n * Decodes a hex string into a number.\n *\n * - Docs: https://viem.sh/docs/utilities/fromHex.html#hextonumber\n *\n * @param hex Hex value to decode.\n * @param opts Options.\n * @returns Number value.\n *\n * @example\n * import { hexToNumber } from 'viem'\n * const data = hexToNumber('0x1a4')\n * // 420\n *\n * @example\n * import { hexToNumber } from 'viem'\n * const data = hexToBigInt('0x00000000000000000000000000000000000000000000000000000000000001a4', { size: 32 })\n * // 420\n */\nexport function hexToNumber(hex, opts = {}) {\n return Number(hexToBigInt(hex, opts));\n}\n/**\n * Decodes a hex value into a UTF-8 string.\n *\n * - Docs: https://viem.sh/docs/utilities/fromHex.html#hextostring\n *\n * @param hex Hex value to decode.\n * @param opts Options.\n * @returns String value.\n *\n * @example\n * import { hexToString } from 'viem'\n * const data = hexToString('0x48656c6c6f20576f726c6421')\n * // 'Hello world!'\n *\n * @example\n * import { hexToString } from 'viem'\n * const data = hexToString('0x48656c6c6f20576f726c64210000000000000000000000000000000000000000', {\n * size: 32,\n * })\n * // 'Hello world'\n */\nexport function hexToString(hex, opts = {}) {\n let bytes = hexToBytes(hex);\n if (opts.size) {\n assertSize(bytes, { size: opts.size });\n bytes = trim(bytes, { dir: 'right' });\n }\n return new TextDecoder().decode(bytes);\n}\n//# sourceMappingURL=fromHex.js.map","import { IntegerOutOfRangeError } from '../../errors/encoding.js';\nimport { pad } from '../data/pad.js';\nimport { assertSize } from './fromHex.js';\nconst hexes = /*#__PURE__*/ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, '0'));\n/**\n * Encodes a string, number, bigint, or ByteArray into a hex string\n *\n * - Docs: https://viem.sh/docs/utilities/toHex.html\n * - Example: https://viem.sh/docs/utilities/toHex.html#usage\n *\n * @param value Value to encode.\n * @param opts Options.\n * @returns Hex value.\n *\n * @example\n * import { toHex } from 'viem'\n * const data = toHex('Hello world')\n * // '0x48656c6c6f20776f726c6421'\n *\n * @example\n * import { toHex } from 'viem'\n * const data = toHex(420)\n * // '0x1a4'\n *\n * @example\n * import { toHex } from 'viem'\n * const data = toHex('Hello world', { size: 32 })\n * // '0x48656c6c6f20776f726c64210000000000000000000000000000000000000000'\n */\nexport function toHex(value, opts = {}) {\n if (typeof value === 'number' || typeof value === 'bigint')\n return numberToHex(value, opts);\n if (typeof value === 'string') {\n return stringToHex(value, opts);\n }\n if (typeof value === 'boolean')\n return boolToHex(value, opts);\n return bytesToHex(value, opts);\n}\n/**\n * Encodes a boolean into a hex string\n *\n * - Docs: https://viem.sh/docs/utilities/toHex.html#booltohex\n *\n * @param value Value to encode.\n * @param opts Options.\n * @returns Hex value.\n *\n * @example\n * import { boolToHex } from 'viem'\n * const data = boolToHex(true)\n * // '0x1'\n *\n * @example\n * import { boolToHex } from 'viem'\n * const data = boolToHex(false)\n * // '0x0'\n *\n * @example\n * import { boolToHex } from 'viem'\n * const data = boolToHex(true, { size: 32 })\n * // '0x0000000000000000000000000000000000000000000000000000000000000001'\n */\nexport function boolToHex(value, opts = {}) {\n const hex = `0x${Number(value)}`;\n if (typeof opts.size === 'number') {\n assertSize(hex, { size: opts.size });\n return pad(hex, { size: opts.size });\n }\n return hex;\n}\n/**\n * Encodes a bytes array into a hex string\n *\n * - Docs: https://viem.sh/docs/utilities/toHex.html#bytestohex\n *\n * @param value Value to encode.\n * @param opts Options.\n * @returns Hex value.\n *\n * @example\n * import { bytesToHex } from 'viem'\n * const data = bytesToHex(Uint8Array.from([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33])\n * // '0x48656c6c6f20576f726c6421'\n *\n * @example\n * import { bytesToHex } from 'viem'\n * const data = bytesToHex(Uint8Array.from([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33]), { size: 32 })\n * // '0x48656c6c6f20576f726c64210000000000000000000000000000000000000000'\n */\nexport function bytesToHex(value, opts = {}) {\n let hexString = '';\n for (let i = 0; i < value.length; i++) {\n hexString += hexes[value[i]];\n }\n const hex = `0x${hexString}`;\n if (typeof opts.size === 'number') {\n assertSize(hex, { size: opts.size });\n return pad(hex, { dir: 'right', size: opts.size });\n }\n return hex;\n}\n/**\n * Encodes a number or bigint into a hex string\n *\n * - Docs: https://viem.sh/docs/utilities/toHex.html#numbertohex\n *\n * @param value Value to encode.\n * @param opts Options.\n * @returns Hex value.\n *\n * @example\n * import { numberToHex } from 'viem'\n * const data = numberToHex(420)\n * // '0x1a4'\n *\n * @example\n * import { numberToHex } from 'viem'\n * const data = numberToHex(420, { size: 32 })\n * // '0x00000000000000000000000000000000000000000000000000000000000001a4'\n */\nexport function numberToHex(value_, opts = {}) {\n const { signed, size } = opts;\n const value = BigInt(value_);\n let maxValue;\n if (size) {\n if (signed)\n maxValue = (1n << (BigInt(size) * 8n - 1n)) - 1n;\n else\n maxValue = 2n ** (BigInt(size) * 8n) - 1n;\n }\n else if (typeof value_ === 'number') {\n maxValue = BigInt(Number.MAX_SAFE_INTEGER);\n }\n const minValue = typeof maxValue === 'bigint' && signed ? -maxValue - 1n : 0;\n if ((maxValue && value > maxValue) || value < minValue) {\n const suffix = typeof value_ === 'bigint' ? 'n' : '';\n throw new IntegerOutOfRangeError({\n max: maxValue ? `${maxValue}${suffix}` : undefined,\n min: `${minValue}${suffix}`,\n signed,\n size,\n value: `${value_}${suffix}`,\n });\n }\n const hex = `0x${(signed && value < 0\n ? (1n << BigInt(size * 8)) + BigInt(value)\n : value).toString(16)}`;\n if (size)\n return pad(hex, { size });\n return hex;\n}\nconst encoder = /*#__PURE__*/ new TextEncoder();\n/**\n * Encodes a UTF-8 string into a hex string\n *\n * - Docs: https://viem.sh/docs/utilities/toHex.html#stringtohex\n *\n * @param value Value to encode.\n * @param opts Options.\n * @returns Hex value.\n *\n * @example\n * import { stringToHex } from 'viem'\n * const data = stringToHex('Hello World!')\n * // '0x48656c6c6f20576f726c6421'\n *\n * @example\n * import { stringToHex } from 'viem'\n * const data = stringToHex('Hello World!', { size: 32 })\n * // '0x48656c6c6f20576f726c64210000000000000000000000000000000000000000'\n */\nexport function stringToHex(value_, opts = {}) {\n const value = encoder.encode(value_);\n return bytesToHex(value, opts);\n}\n//# sourceMappingURL=toHex.js.map","import { BaseError } from '../../errors/base.js';\nimport { isHex } from '../data/isHex.js';\nimport { pad } from '../data/pad.js';\nimport { assertSize } from './fromHex.js';\nimport { numberToHex } from './toHex.js';\nconst encoder = /*#__PURE__*/ new TextEncoder();\n/**\n * Encodes a UTF-8 string, hex value, bigint, number or boolean to a byte array.\n *\n * - Docs: https://viem.sh/docs/utilities/toBytes.html\n * - Example: https://viem.sh/docs/utilities/toBytes.html#usage\n *\n * @param value Value to encode.\n * @param opts Options.\n * @returns Byte array value.\n *\n * @example\n * import { toBytes } from 'viem'\n * const data = toBytes('Hello world')\n * // Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33])\n *\n * @example\n * import { toBytes } from 'viem'\n * const data = toBytes(420)\n * // Uint8Array([1, 164])\n *\n * @example\n * import { toBytes } from 'viem'\n * const data = toBytes(420, { size: 4 })\n * // Uint8Array([0, 0, 1, 164])\n */\nexport function toBytes(value, opts = {}) {\n if (typeof value === 'number' || typeof value === 'bigint')\n return numberToBytes(value, opts);\n if (typeof value === 'boolean')\n return boolToBytes(value, opts);\n if (isHex(value))\n return hexToBytes(value, opts);\n return stringToBytes(value, opts);\n}\n/**\n * Encodes a boolean into a byte array.\n *\n * - Docs: https://viem.sh/docs/utilities/toBytes.html#booltobytes\n *\n * @param value Boolean value to encode.\n * @param opts Options.\n * @returns Byte array value.\n *\n * @example\n * import { boolToBytes } from 'viem'\n * const data = boolToBytes(true)\n * // Uint8Array([1])\n *\n * @example\n * import { boolToBytes } from 'viem'\n * const data = boolToBytes(true, { size: 32 })\n * // 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, 1])\n */\nexport function boolToBytes(value, opts = {}) {\n const bytes = new Uint8Array(1);\n bytes[0] = Number(value);\n if (typeof opts.size === 'number') {\n assertSize(bytes, { size: opts.size });\n return pad(bytes, { size: opts.size });\n }\n return bytes;\n}\n/**\n * Encodes a hex string into a byte array.\n *\n * - Docs: https://viem.sh/docs/utilities/toBytes.html#hextobytes\n *\n * @param hex Hex string to encode.\n * @param opts Options.\n * @returns Byte array value.\n *\n * @example\n * import { hexToBytes } from 'viem'\n * const data = hexToBytes('0x48656c6c6f20776f726c6421')\n * // Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33])\n *\n * @example\n * import { hexToBytes } from 'viem'\n * const data = hexToBytes('0x48656c6c6f20776f726c6421', { size: 32 })\n * // Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])\n */\nexport function hexToBytes(hex_, opts = {}) {\n let hex = hex_;\n if (opts.size) {\n assertSize(hex, { size: opts.size });\n hex = pad(hex, { dir: 'right', size: opts.size });\n }\n let hexString = hex.slice(2);\n if (hexString.length % 2)\n hexString = `0${hexString}`;\n const bytes = new Uint8Array(hexString.length / 2);\n for (let index = 0; index < bytes.length; index++) {\n const start = index * 2;\n const hexByte = hexString.slice(start, start + 2);\n const byte = Number.parseInt(hexByte, 16);\n if (Number.isNaN(byte) || byte < 0)\n throw new BaseError(`Invalid byte sequence (\"${hexByte}\" in \"${hexString}\").`);\n bytes[index] = byte;\n }\n return bytes;\n}\n/**\n * Encodes a number into a byte array.\n *\n * - Docs: https://viem.sh/docs/utilities/toBytes.html#numbertobytes\n *\n * @param value Number to encode.\n * @param opts Options.\n * @returns Byte array value.\n *\n * @example\n * import { numberToBytes } from 'viem'\n * const data = numberToBytes(420)\n * // Uint8Array([1, 164])\n *\n * @example\n * import { numberToBytes } from 'viem'\n * const data = numberToBytes(420, { size: 4 })\n * // Uint8Array([0, 0, 1, 164])\n */\nexport function numberToBytes(value, opts) {\n const hex = numberToHex(value, opts);\n return hexToBytes(hex);\n}\n/**\n * Encodes a UTF-8 string into a byte array.\n *\n * - Docs: https://viem.sh/docs/utilities/toBytes.html#stringtobytes\n *\n * @param value String to encode.\n * @param opts Options.\n * @returns Byte array value.\n *\n * @example\n * import { stringToBytes } from 'viem'\n * const data = stringToBytes('Hello world!')\n * // Uint8Array([72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100, 33])\n *\n * @example\n * import { stringToBytes } from 'viem'\n * const data = stringToBytes('Hello world!', { size: 32 })\n * // Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])\n */\nexport function stringToBytes(value, opts = {}) {\n const bytes = encoder.encode(value);\n if (typeof opts.size === 'number') {\n assertSize(bytes, { size: opts.size });\n return pad(bytes, { dir: 'right', size: opts.size });\n }\n return bytes;\n}\n//# sourceMappingURL=toBytes.js.map","const paramsRegex = /((function|event)\\s)?(.*)(\\((.*)\\))/;\nexport function extractFunctionParts(def) {\n const parts = def.match(paramsRegex);\n const type = parts?.[2] || undefined;\n const name = parts?.[3];\n const params = parts?.[5] || undefined;\n return { type, name, params };\n}\nexport function extractFunctionName(def) {\n return extractFunctionParts(def).name;\n}\nexport function extractFunctionParams(def) {\n const params = extractFunctionParts(def).params;\n const splitParams = params?.split(',').map((x) => x.trim().split(' '));\n return splitParams?.map((param) => ({\n type: param[0],\n name: param[1] === 'indexed' ? param[2] : param[1],\n ...(param[1] === 'indexed' ? { indexed: true } : {}),\n }));\n}\nexport function extractFunctionType(def) {\n return extractFunctionParts(def).type;\n}\n//# sourceMappingURL=extractFunctionParts.js.map","export function number(n) {\n if (!Number.isSafeInteger(n) || n < 0)\n throw new Error(`Wrong positive integer: ${n}`);\n}\nexport function bool(b) {\n if (typeof b !== 'boolean')\n throw new Error(`Expected boolean, not ${b}`);\n}\nexport function bytes(b, ...lengths) {\n if (!(b instanceof Uint8Array))\n throw new TypeError('Expected Uint8Array');\n if (lengths.length > 0 && !lengths.includes(b.length))\n throw new TypeError(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`);\n}\nexport function hash(hash) {\n if (typeof hash !== 'function' || typeof hash.create !== 'function')\n throw new Error('Hash should be wrapped by utils.wrapConstructor');\n number(hash.outputLen);\n number(hash.blockLen);\n}\nexport function exists(instance, checkFinished = true) {\n if (instance.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished)\n throw new Error('Hash#digest() has already been called');\n}\nexport function output(out, instance) {\n bytes(out);\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error(`digestInto() expects output buffer of length at least ${min}`);\n }\n}\nconst assert = {\n number,\n bool,\n bytes,\n hash,\n exists,\n output,\n};\nexport default assert;\n//# sourceMappingURL=_assert.js.map","const U32_MASK64 = BigInt(2 ** 32 - 1);\nconst _32n = BigInt(32);\n// We are not using BigUint64Array, because they are extremely slow as per 2022\nexport function fromBig(n, le = false) {\n if (le)\n return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\n}\nexport function split(lst, le = false) {\n let Ah = new Uint32Array(lst.length);\n let Al = new Uint32Array(lst.length);\n for (let i = 0; i < lst.length; i++) {\n const { h, l } = fromBig(lst[i], le);\n [Ah[i], Al[i]] = [h, l];\n }\n return [Ah, Al];\n}\nexport const toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\n// for Shift in [0, 32)\nconst shrSH = (h, l, s) => h >>> s;\nconst shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in [1, 32)\nconst rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));\nconst rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));\nconst rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));\n// Right rotate for shift===32 (just swaps l&h)\nconst rotr32H = (h, l) => l;\nconst rotr32L = (h, l) => h;\n// Left rotate for Shift in [1, 32)\nconst rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));\nconst rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));\n// Left rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));\nconst rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));\n// JS uses 32-bit signed integers for bitwise operations which means we cannot\n// simple take carry out of low bit sum by shift, we need to use division.\n// Removing \"export\" has 5% perf penalty -_-\nexport function add(Ah, Al, Bh, Bl) {\n const l = (Al >>> 0) + (Bl >>> 0);\n return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\n}\n// Addition with more than 2 elements\nconst add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\nconst add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;\nconst add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\nconst add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;\nconst add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\nconst add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\n// prettier-ignore\nconst u64 = {\n fromBig, split, toBig,\n shrSH, shrSL,\n rotrSH, rotrSL, rotrBH, rotrBL,\n rotr32H, rotr32L,\n rotlSH, rotlSL, rotlBH, rotlBL,\n add, add3L, add3H, add4L, add4H, add5H, add5L,\n};\nexport default u64;\n//# sourceMappingURL=_u64.js.map","/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// We use `globalThis.crypto`, but node.js versions earlier than v19 don't\n// declare it in global scope. For node.js, package.json#exports field mapping\n// rewrites import from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated, we can just drop the import.\nimport { crypto } from '@noble/hashes/crypto';\n// Cast array to different type\nexport const u8 = (arr) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\nexport const u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n// Cast array to view\nexport const createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n// The rotate right (circular right shift) operation for uint32\nexport const rotr = (word, shift) => (word << (32 - shift)) | (word >>> shift);\n// big-endian hardware is rare. Just in case someone still decides to run hashes:\n// early-throw an error because we don't support BE yet.\nexport const isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44;\nif (!isLE)\n throw new Error('Non little-endian hardware is not supported');\nconst hexes = Array.from({ length: 256 }, (v, i) => i.toString(16).padStart(2, '0'));\n/**\n * @example bytesToHex(Uint8Array.from([0xde, 0xad, 0xbe, 0xef])) // 'deadbeef'\n */\nexport function bytesToHex(uint8a) {\n // pre-caching improves the speed 6x\n if (!(uint8a instanceof Uint8Array))\n throw new Error('Uint8Array expected');\n let hex = '';\n for (let i = 0; i < uint8a.length; i++) {\n hex += hexes[uint8a[i]];\n }\n return hex;\n}\n/**\n * @example hexToBytes('deadbeef') // Uint8Array.from([0xde, 0xad, 0xbe, 0xef])\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string') {\n throw new TypeError('hexToBytes: expected string, got ' + typeof hex);\n }\n if (hex.length % 2)\n throw new Error('hexToBytes: received invalid unpadded hex');\n const array = new Uint8Array(hex.length / 2);\n for (let i = 0; i < array.length; i++) {\n const j = i * 2;\n const hexByte = hex.slice(j, j + 2);\n const byte = Number.parseInt(hexByte, 16);\n if (Number.isNaN(byte) || byte < 0)\n throw new Error('Invalid byte sequence');\n array[i] = byte;\n }\n return array;\n}\n// There is no setImmediate in browser and setTimeout is slow.\n// call of async fn will return Promise, which will be fullfiled only on\n// next scheduler queue processing step and this is exactly what we need.\nexport const nextTick = async () => { };\n// Returns control to thread each 'tick' ms to avoid blocking\nexport async function asyncLoop(iters, tick, cb) {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await nextTick();\n ts += diff;\n }\n}\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string') {\n throw new TypeError(`utf8ToBytes expected string, got ${typeof str}`);\n }\n return new TextEncoder().encode(str);\n}\nexport function toBytes(data) {\n if (typeof data === 'string')\n data = utf8ToBytes(data);\n if (!(data instanceof Uint8Array))\n throw new TypeError(`Expected input type is Uint8Array (got ${typeof data})`);\n return data;\n}\n/**\n * Concats Uint8Array-s into one; like `Buffer.concat([buf1, buf2])`\n * @example concatBytes(buf1, buf2)\n */\nexport function concatBytes(...arrays) {\n if (!arrays.every((a) => a instanceof Uint8Array))\n throw new Error('Uint8Array list expected');\n if (arrays.length === 1)\n return arrays[0];\n const length = arrays.reduce((a, arr) => a + arr.length, 0);\n const result = new Uint8Array(length);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const arr = arrays[i];\n result.set(arr, pad);\n pad += arr.length;\n }\n return result;\n}\n// For runtime check if class implements interface\nexport class Hash {\n // Safe version that clones internal state\n clone() {\n return this._cloneInto();\n }\n}\n// Check if object doens't have custom constructor (like Uint8Array/Array)\nconst isPlainObject = (obj) => Object.prototype.toString.call(obj) === '[object Object]' && obj.constructor === Object;\nexport function checkOpts(defaults, opts) {\n if (opts !== undefined && (typeof opts !== 'object' || !isPlainObject(opts)))\n throw new TypeError('Options should be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged;\n}\nexport function wrapConstructor(hashConstructor) {\n const hashC = (message) => hashConstructor().update(toBytes(message)).digest();\n const tmp = hashConstructor();\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = () => hashConstructor();\n return hashC;\n}\nexport function wrapConstructorWithOpts(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\n/**\n * Secure PRNG. Uses `globalThis.crypto` or node.js crypto module.\n */\nexport function randomBytes(bytesLength = 32) {\n if (crypto && typeof crypto.getRandomValues === 'function') {\n return crypto.getRandomValues(new Uint8Array(bytesLength));\n }\n throw new Error('crypto.getRandomValues must be defined');\n}\n//# sourceMappingURL=utils.js.map","import assert from './_assert.js';\nimport u64 from './_u64.js';\nimport { Hash, u32, toBytes, wrapConstructor, wrapConstructorWithOpts, } from './utils.js';\n// Various per round constants calculations\nconst [SHA3_PI, SHA3_ROTL, _SHA3_IOTA] = [[], [], []];\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst _7n = BigInt(7);\nconst _256n = BigInt(256);\nconst _0x71n = BigInt(0x71);\nfor (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {\n // Pi\n [x, y] = [y, (2 * x + 3 * y) % 5];\n SHA3_PI.push(2 * (5 * y + x));\n // Rotational\n SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64);\n // Iota\n let t = _0n;\n for (let j = 0; j < 7; j++) {\n R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n;\n if (R & _2n)\n t ^= _1n << ((_1n << BigInt(j)) - _1n);\n }\n _SHA3_IOTA.push(t);\n}\nconst [SHA3_IOTA_H, SHA3_IOTA_L] = u64.split(_SHA3_IOTA, true);\n// Left rotation (without 0, 32, 64)\nconst rotlH = (h, l, s) => s > 32 ? u64.rotlBH(h, l, s) : u64.rotlSH(h, l, s);\nconst rotlL = (h, l, s) => s > 32 ? u64.rotlBL(h, l, s) : u64.rotlSL(h, l, s);\n// Same as keccakf1600, but allows to skip some rounds\nexport function keccakP(s, rounds = 24) {\n const B = new Uint32Array(5 * 2);\n // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js)\n for (let round = 24 - rounds; round < 24; round++) {\n // Theta θ\n for (let x = 0; x < 10; x++)\n B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];\n for (let x = 0; x < 10; x += 2) {\n const idx1 = (x + 8) % 10;\n const idx0 = (x + 2) % 10;\n const B0 = B[idx0];\n const B1 = B[idx0 + 1];\n const Th = rotlH(B0, B1, 1) ^ B[idx1];\n const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];\n for (let y = 0; y < 50; y += 10) {\n s[x + y] ^= Th;\n s[x + y + 1] ^= Tl;\n }\n }\n // Rho (ρ) and Pi (π)\n let curH = s[2];\n let curL = s[3];\n for (let t = 0; t < 24; t++) {\n const shift = SHA3_ROTL[t];\n const Th = rotlH(curH, curL, shift);\n const Tl = rotlL(curH, curL, shift);\n const PI = SHA3_PI[t];\n curH = s[PI];\n curL = s[PI + 1];\n s[PI] = Th;\n s[PI + 1] = Tl;\n }\n // Chi (χ)\n for (let y = 0; y < 50; y += 10) {\n for (let x = 0; x < 10; x++)\n B[x] = s[y + x];\n for (let x = 0; x < 10; x++)\n s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];\n }\n // Iota (ι)\n s[0] ^= SHA3_IOTA_H[round];\n s[1] ^= SHA3_IOTA_L[round];\n }\n B.fill(0);\n}\nexport class Keccak extends Hash {\n // NOTE: we accept arguments in bytes instead of bits here.\n constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {\n super();\n this.blockLen = blockLen;\n this.suffix = suffix;\n this.outputLen = outputLen;\n this.enableXOF = enableXOF;\n this.rounds = rounds;\n this.pos = 0;\n this.posOut = 0;\n this.finished = false;\n this.destroyed = false;\n // Can be passed from user as dkLen\n assert.number(outputLen);\n // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes\n if (0 >= this.blockLen || this.blockLen >= 200)\n throw new Error('Sha3 supports only keccak-f1600 function');\n this.state = new Uint8Array(200);\n this.state32 = u32(this.state);\n }\n keccak() {\n keccakP(this.state32, this.rounds);\n this.posOut = 0;\n this.pos = 0;\n }\n update(data) {\n assert.exists(this);\n const { blockLen, state } = this;\n data = toBytes(data);\n const len = data.length;\n for (let pos = 0; pos < len;) {\n const take = Math.min(blockLen - this.pos, len - pos);\n for (let i = 0; i < take; i++)\n state[this.pos++] ^= data[pos++];\n if (this.pos === blockLen)\n this.keccak();\n }\n return this;\n }\n finish() {\n if (this.finished)\n return;\n this.finished = true;\n const { state, suffix, pos, blockLen } = this;\n // Do the padding\n state[pos] ^= suffix;\n if ((suffix & 0x80) !== 0 && pos === blockLen - 1)\n this.keccak();\n state[blockLen - 1] ^= 0x80;\n this.keccak();\n }\n writeInto(out) {\n assert.exists(this, false);\n assert.bytes(out);\n this.finish();\n const bufferOut = this.state;\n const { blockLen } = this;\n for (let pos = 0, len = out.length; pos < len;) {\n if (this.posOut >= blockLen)\n this.keccak();\n const take = Math.min(blockLen - this.posOut, len - pos);\n out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);\n this.posOut += take;\n pos += take;\n }\n return out;\n }\n xofInto(out) {\n // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF\n if (!this.enableXOF)\n throw new Error('XOF is not possible for this instance');\n return this.writeInto(out);\n }\n xof(bytes) {\n assert.number(bytes);\n return this.xofInto(new Uint8Array(bytes));\n }\n digestInto(out) {\n assert.output(out, this);\n if (this.finished)\n throw new Error('digest() was already called');\n this.writeInto(out);\n this.destroy();\n return out;\n }\n digest() {\n return this.digestInto(new Uint8Array(this.outputLen));\n }\n destroy() {\n this.destroyed = true;\n this.state.fill(0);\n }\n _cloneInto(to) {\n const { blockLen, suffix, outputLen, rounds, enableXOF } = this;\n to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds));\n to.state32.set(this.state32);\n to.pos = this.pos;\n to.posOut = this.posOut;\n to.finished = this.finished;\n to.rounds = rounds;\n // Suffix can change in cSHAKE\n to.suffix = suffix;\n to.outputLen = outputLen;\n to.enableXOF = enableXOF;\n to.destroyed = this.destroyed;\n return to;\n }\n}\nconst gen = (suffix, blockLen, outputLen) => wrapConstructor(() => new Keccak(blockLen, suffix, outputLen));\nexport const sha3_224 = gen(0x06, 144, 224 / 8);\n/**\n * SHA3-256 hash function\n * @param message - that would be hashed\n */\nexport const sha3_256 = gen(0x06, 136, 256 / 8);\nexport const sha3_384 = gen(0x06, 104, 384 / 8);\nexport const sha3_512 = gen(0x06, 72, 512 / 8);\nexport const keccak_224 = gen(0x01, 144, 224 / 8);\n/**\n * keccak-256 hash function. Different from SHA3-256.\n * @param message - that would be hashed\n */\nexport const keccak_256 = gen(0x01, 136, 256 / 8);\nexport const keccak_384 = gen(0x01, 104, 384 / 8);\nexport const keccak_512 = gen(0x01, 72, 512 / 8);\nconst genShake = (suffix, blockLen, outputLen) => wrapConstructorWithOpts((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true));\nexport const shake128 = genShake(0x1f, 168, 128 / 8);\nexport const shake256 = genShake(0x1f, 136, 256 / 8);\n//# sourceMappingURL=sha3.js.map","import { keccak_256 } from '@noble/hashes/sha3';\nimport { isHex } from '../data/isHex.js';\nimport { toBytes } from '../encoding/toBytes.js';\nimport { toHex } from '../encoding/toHex.js';\nexport function keccak256(value, to_) {\n const to = to_ || 'hex';\n const bytes = keccak_256(isHex(value, { strict: false }) ? toBytes(value) : value);\n if (to === 'bytes')\n return bytes;\n return toHex(bytes);\n}\n//# sourceMappingURL=keccak256.js.map","import { formatAbiItem } from '../abi/formatAbiItem.js';\nimport { extractFunctionName, extractFunctionParams, } from '../contract/extractFunctionParts.js';\nimport { toBytes } from '../encoding/toBytes.js';\nimport { keccak256 } from './keccak256.js';\nconst hash = (value) => keccak256(toBytes(value));\nexport function hashFunction(def) {\n const name = extractFunctionName(def);\n const params = extractFunctionParams(def) || [];\n return hash(`${name}(${params.map(({ type }) => type).join(',')})`);\n}\nexport function hashAbiItem(abiItem) {\n return hash(formatAbiItem(abiItem));\n}\n//# sourceMappingURL=hashFunction.js.map","import { hashAbiItem, hashFunction } from './hashFunction.js';\nexport const getEventSelector = (event) => {\n if (typeof event === 'string')\n return hashFunction(event);\n return hashAbiItem(event);\n};\n//# sourceMappingURL=getEventSelector.js.map","import { BaseError } from './base.js';\nexport class InvalidAddressError extends BaseError {\n constructor({ address }) {\n super(`Address \"${address}\" is invalid.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidAddressError'\n });\n }\n}\n//# sourceMappingURL=address.js.map","const addressRegex = /^0x[a-fA-F0-9]{40}$/;\nexport function isAddress(address) {\n return addressRegex.test(address);\n}\n//# sourceMappingURL=isAddress.js.map","export function concat(values) {\n if (typeof values[0] === 'string')\n return concatHex(values);\n return concatBytes(values);\n}\nexport function concatBytes(values) {\n let length = 0;\n for (const arr of values) {\n length += arr.length;\n }\n const result = new Uint8Array(length);\n let offset = 0;\n for (const arr of values) {\n result.set(arr, offset);\n offset += arr.length;\n }\n return result;\n}\nexport function concatHex(values) {\n return `0x${values.reduce((acc, x) => acc + x.replace('0x', ''), '')}`;\n}\n//# sourceMappingURL=concat.js.map","import { SliceOffsetOutOfBoundsError } from '../../errors/data.js';\nimport { isHex } from './isHex.js';\nimport { size } from './size.js';\n/**\n * @description Returns a section of the hex or byte array given a start/end bytes offset.\n *\n * @param value The hex or byte array to slice.\n * @param start The start offset (in bytes).\n * @param end The end offset (in bytes).\n */\nexport function slice(value, start, end, { strict } = {}) {\n if (isHex(value, { strict: false }))\n return sliceHex(value, start, end, {\n strict,\n });\n return sliceBytes(value, start, end, {\n strict,\n });\n}\nfunction assertStartOffset(value, start) {\n if (typeof start === 'number' && start > 0 && start > size(value) - 1)\n throw new SliceOffsetOutOfBoundsError({\n offset: start,\n position: 'start',\n size: size(value),\n });\n}\nfunction assertEndOffset(value, start, end) {\n if (typeof start === 'number' &&\n typeof end === 'number' &&\n size(value) !== end - start) {\n throw new SliceOffsetOutOfBoundsError({\n offset: end,\n position: 'end',\n size: size(value),\n });\n }\n}\n/**\n * @description Returns a section of the byte array given a start/end bytes offset.\n *\n * @param value The byte array to slice.\n * @param start The start offset (in bytes).\n * @param end The end offset (in bytes).\n */\nexport function sliceBytes(value_, start, end, { strict } = {}) {\n assertStartOffset(value_, start);\n const value = value_.slice(start, end);\n if (strict)\n assertEndOffset(value, start, end);\n return value;\n}\n/**\n * @description Returns a section of the hex value given a start/end bytes offset.\n *\n * @param value The hex value to slice.\n * @param start The start offset (in bytes).\n * @param end The end offset (in bytes).\n */\nexport function sliceHex(value_, start, end, { strict } = {}) {\n assertStartOffset(value_, start);\n const value = `0x${value_\n .replace('0x', '')\n .slice((start ?? 0) * 2, (end ?? value_.length) * 2)}`;\n if (strict)\n assertEndOffset(value, start, end);\n return value;\n}\n//# sourceMappingURL=slice.js.map","import { AbiEncodingArrayLengthMismatchError, AbiEncodingBytesSizeMismatchError, AbiEncodingLengthMismatchError, InvalidAbiEncodingTypeError, InvalidArrayError, } from '../../errors/abi.js';\nimport { InvalidAddressError } from '../../errors/address.js';\nimport { isAddress } from '../address/isAddress.js';\nimport { concat } from '../data/concat.js';\nimport { padHex } from '../data/pad.js';\nimport { size } from '../data/size.js';\nimport { slice } from '../data/slice.js';\nimport { boolToHex, numberToHex, stringToHex } from '../encoding/toHex.js';\n/**\n * @description Encodes a list of primitive values into an ABI-encoded hex value.\n */\nexport function encodeAbiParameters(params, values) {\n if (params.length !== values.length)\n throw new AbiEncodingLengthMismatchError({\n expectedLength: params.length,\n givenLength: values.length,\n });\n // Prepare the parameters to determine dynamic types to encode.\n const preparedParams = prepareParams({\n params: params,\n values,\n });\n const data = encodeParams(preparedParams);\n if (data.length === 0)\n return '0x';\n return data;\n}\nfunction prepareParams({ params, values, }) {\n const preparedParams = [];\n for (let i = 0; i < params.length; i++) {\n preparedParams.push(prepareParam({ param: params[i], value: values[i] }));\n }\n return preparedParams;\n}\nfunction prepareParam({ param, value, }) {\n const arrayComponents = getArrayComponents(param.type);\n if (arrayComponents) {\n const [length, type] = arrayComponents;\n return encodeArray(value, { length, param: { ...param, type } });\n }\n if (param.type === 'tuple') {\n return encodeTuple(value, {\n param: param,\n });\n }\n if (param.type === 'address') {\n return encodeAddress(value);\n }\n if (param.type === 'bool') {\n return encodeBool(value);\n }\n if (param.type.startsWith('uint') || param.type.startsWith('int')) {\n const signed = param.type.startsWith('int');\n return encodeNumber(value, { signed });\n }\n if (param.type.startsWith('bytes')) {\n return encodeBytes(value, { param });\n }\n if (param.type === 'string') {\n return encodeString(value);\n }\n throw new InvalidAbiEncodingTypeError(param.type, {\n docsPath: '/docs/contract/encodeAbiParameters',\n });\n}\n/////////////////////////////////////////////////////////////////\nfunction encodeParams(preparedParams) {\n // 1. Compute the size of the static part of the parameters.\n let staticSize = 0;\n for (let i = 0; i < preparedParams.length; i++) {\n const { dynamic, encoded } = preparedParams[i];\n if (dynamic)\n staticSize += 32;\n else\n staticSize += size(encoded);\n }\n // 2. Split the parameters into static and dynamic parts.\n const staticParams = [];\n const dynamicParams = [];\n let dynamicSize = 0;\n for (let i = 0; i < preparedParams.length; i++) {\n const { dynamic, encoded } = preparedParams[i];\n if (dynamic) {\n staticParams.push(numberToHex(staticSize + dynamicSize, { size: 32 }));\n dynamicParams.push(encoded);\n dynamicSize += size(encoded);\n }\n else {\n staticParams.push(encoded);\n }\n }\n // 3. Concatenate static and dynamic parts.\n return concat([...staticParams, ...dynamicParams]);\n}\n/////////////////////////////////////////////////////////////////\nfunction encodeAddress(value) {\n if (!isAddress(value))\n throw new InvalidAddressError({ address: value });\n return { dynamic: false, encoded: padHex(value.toLowerCase()) };\n}\nfunction encodeArray(value, { length, param, }) {\n const dynamic = length === null;\n if (!Array.isArray(value))\n throw new InvalidArrayError(value);\n if (!dynamic && value.length !== length)\n throw new AbiEncodingArrayLengthMismatchError({\n expectedLength: length,\n givenLength: value.length,\n type: `${param.type}[${length}]`,\n });\n let dynamicChild = false;\n const preparedParams = [];\n for (let i = 0; i < value.length; i++) {\n const preparedParam = prepareParam({ param, value: value[i] });\n if (preparedParam.dynamic)\n dynamicChild = true;\n preparedParams.push(preparedParam);\n }\n if (dynamic || dynamicChild) {\n const data = encodeParams(preparedParams);\n if (dynamic) {\n const length = numberToHex(preparedParams.length, { size: 32 });\n return {\n dynamic: true,\n encoded: preparedParams.length > 0 ? concat([length, data]) : length,\n };\n }\n if (dynamicChild)\n return { dynamic: true, encoded: data };\n }\n return {\n dynamic: false,\n encoded: concat(preparedParams.map(({ encoded }) => encoded)),\n };\n}\nfunction encodeBytes(value, { param }) {\n const [, paramSize] = param.type.split('bytes');\n const bytesSize = size(value);\n if (!paramSize) {\n let value_ = value;\n // If the size is not divisible by 32 bytes, pad the end\n // with empty bytes to the ceiling 32 bytes.\n if (bytesSize % 32 !== 0)\n value_ = padHex(value_, {\n dir: 'right',\n size: Math.ceil((value.length - 2) / 2 / 32) * 32,\n });\n return {\n dynamic: true,\n encoded: concat([padHex(numberToHex(bytesSize, { size: 32 })), value_]),\n };\n }\n if (bytesSize !== parseInt(paramSize))\n throw new AbiEncodingBytesSizeMismatchError({\n expectedSize: parseInt(paramSize),\n value,\n });\n return { dynamic: false, encoded: padHex(value, { dir: 'right' }) };\n}\nfunction encodeBool(value) {\n return { dynamic: false, encoded: padHex(boolToHex(value)) };\n}\nfunction encodeNumber(value, { signed }) {\n return {\n dynamic: false,\n encoded: numberToHex(value, {\n size: 32,\n signed,\n }),\n };\n}\nfunction encodeString(value) {\n const hexValue = stringToHex(value);\n const partsLength = Math.ceil(size(hexValue) / 32);\n const parts = [];\n for (let i = 0; i < partsLength; i++) {\n parts.push(padHex(slice(hexValue, i * 32, (i + 1) * 32), {\n dir: 'right',\n }));\n }\n return {\n dynamic: true,\n encoded: concat([\n padHex(numberToHex(size(hexValue), { size: 32 })),\n ...parts,\n ]),\n };\n}\nfunction encodeTuple(value, { param }) {\n let dynamic = false;\n const preparedParams = [];\n for (let i = 0; i < param.components.length; i++) {\n const param_ = param.components[i];\n const index = Array.isArray(value) ? i : param_.name;\n const preparedParam = prepareParam({\n param: param_,\n value: value[index],\n });\n preparedParams.push(preparedParam);\n if (preparedParam.dynamic)\n dynamic = true;\n }\n return {\n dynamic,\n encoded: dynamic\n ? encodeParams(preparedParams)\n : concat(preparedParams.map(({ encoded }) => encoded)),\n };\n}\nexport function getArrayComponents(type) {\n const matches = type.match(/^(.*)\\[(\\d+)?\\]$/);\n return matches\n ? // Return `null` if the array is dynamic.\n [matches[2] ? Number(matches[2]) : null, matches[1]]\n : undefined;\n}\n//# sourceMappingURL=encodeAbiParameters.js.map","import { isAddress } from '../address/isAddress.js';\nexport function getAbiItem({ abi, args = [], name, }) {\n const abiItems = abi.filter((x) => 'name' in x && x.name === name);\n if (abiItems.length === 0)\n return undefined;\n if (abiItems.length === 1)\n return abiItems[0];\n for (const abiItem of abiItems) {\n if (!('inputs' in abiItem))\n continue;\n if (!args || args.length === 0) {\n if (!abiItem.inputs || abiItem.inputs.length === 0)\n return abiItem;\n continue;\n }\n if (!abiItem.inputs)\n continue;\n if (abiItem.inputs.length === 0)\n continue;\n if (abiItem.inputs.length !== args.length)\n continue;\n const matched = args.every((arg, index) => {\n const abiParameter = 'inputs' in abiItem && abiItem.inputs[index];\n if (!abiParameter)\n return false;\n return isArgOfType(arg, abiParameter);\n });\n if (matched)\n return abiItem;\n }\n return abiItems[0];\n}\nexport function isArgOfType(arg, abiParameter) {\n const argType = typeof arg;\n const abiParameterType = abiParameter.type;\n switch (abiParameterType) {\n case 'address':\n return isAddress(arg);\n case 'bool':\n return argType === 'boolean';\n case 'function':\n return argType === 'string';\n case 'string':\n return argType === 'string';\n default: {\n if (abiParameterType === 'tuple' && 'components' in abiParameter)\n return Object.values(abiParameter.components).every((component, index) => {\n return isArgOfType(Object.values(arg)[index], component);\n });\n // `(u)int`: (un)signed integer type of `M` bits, `0 < M <= 256`, `M % 8 == 0`\n // https://regexr.com/6v8hp\n if (/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(abiParameterType))\n return argType === 'number' || argType === 'bigint';\n // `bytes`: binary type of `M` bytes, `0 < M <= 32`\n // https://regexr.com/6va55\n if (/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(abiParameterType))\n return argType === 'string' || arg instanceof Uint8Array;\n // fixed-length (`[M]`) and dynamic (`[]`) arrays\n // https://regexr.com/6va6i\n if (/[a-z]+[1-9]{0,3}(\\[[0-9]{0,}\\])+$/.test(abiParameterType)) {\n return (Array.isArray(arg) &&\n arg.every((x) => isArgOfType(x, {\n ...abiParameter,\n // Pop off `[]` or `[M]` from end of type\n type: abiParameterType.replace(/(\\[[0-9]{0,}\\])$/, ''),\n })));\n }\n return false;\n }\n }\n}\n//# sourceMappingURL=getAbiItem.js.map","import { AbiEventNotFoundError } from '../../errors/abi.js';\nimport { FilterTypeNotSupportedError } from '../../errors/log.js';\nimport { toBytes } from '../encoding/toBytes.js';\nimport { getEventSelector } from '../hash/getEventSelector.js';\nimport { keccak256 } from '../hash/keccak256.js';\nimport { encodeAbiParameters } from './encodeAbiParameters.js';\nimport { formatAbiItem } from './formatAbiItem.js';\nimport { getAbiItem } from './getAbiItem.js';\nexport function encodeEventTopics({ abi, eventName, args }) {\n let abiItem = abi[0];\n if (eventName) {\n abiItem = getAbiItem({\n abi,\n args,\n name: eventName,\n });\n if (!abiItem)\n throw new AbiEventNotFoundError(eventName, {\n docsPath: '/docs/contract/encodeEventTopics',\n });\n }\n if (abiItem.type !== 'event')\n throw new AbiEventNotFoundError(undefined, {\n docsPath: '/docs/contract/encodeEventTopics',\n });\n const definition = formatAbiItem(abiItem);\n const signature = getEventSelector(definition);\n let topics = [];\n if (args && 'inputs' in abiItem) {\n const indexedInputs = abiItem.inputs?.filter((param) => 'indexed' in param && param.indexed);\n const args_ = Array.isArray(args)\n ? args\n : Object.values(args).length > 0\n ? indexedInputs?.map((x) => args[x.name]) ?? []\n : [];\n if (args_.length > 0) {\n topics =\n indexedInputs?.map((param, i) => Array.isArray(args_[i])\n ? args_[i].map((_, j) => encodeArg({ param, value: args_[i][j] }))\n : args_[i]\n ? encodeArg({ param, value: args_[i] })\n : null) ?? [];\n }\n }\n return [signature, ...topics];\n}\nfunction encodeArg({ param, value, }) {\n if (param.type === 'string' || param.type === 'bytes')\n return keccak256(toBytes(value));\n if (param.type === 'tuple' || param.type.match(/^(.*)\\[(\\d+)?\\]$/))\n throw new FilterTypeNotSupportedError(param.type);\n return encodeAbiParameters([param], [value]);\n}\n//# sourceMappingURL=encodeEventTopics.js.map","/**\n * Scopes `request` to the filter ID. If the client is a fallback, it will\n * listen for responses and scope the child transport `request` function\n * to the successful filter ID.\n */\nexport function createFilterRequestScope(client, { method }) {\n const requestMap = {};\n if (client.transport.type === 'fallback')\n client.transport.onResponse?.(({ method: method_, response: id, status, transport, }) => {\n if (status === 'success' && method === method_)\n requestMap[id] = transport.request;\n });\n return ((id) => requestMap[id] || client.request);\n}\n//# sourceMappingURL=createFilterRequestScope.js.map","import { encodeEventTopics, } from '../../utils/abi/encodeEventTopics.js';\nimport { numberToHex } from '../../utils/encoding/toHex.js';\nimport { createFilterRequestScope } from '../../utils/filters/createFilterRequestScope.js';\n/**\n * Creates a Filter to retrieve event logs that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html) or [`getFilterLogs`](https://viem.sh/docs/actions/public/getFilterLogs.html).\n *\n * - Docs: https://viem.sh/docs/contract/createContractEventFilter.html\n *\n * @param client - Client to use\n * @param parameters - {@link CreateContractEventFilterParameters}\n * @returns [`Filter`](https://viem.sh/docs/glossary/types.html#filter). {@link CreateContractEventFilterReturnType}\n *\n * @example\n * import { createPublicClient, http, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createContractEventFilter } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createContractEventFilter(client, {\n * abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']),\n * })\n */\nexport async function createContractEventFilter(client, { address, abi, args, eventName, fromBlock, strict, toBlock, }) {\n const getRequest = createFilterRequestScope(client, {\n method: 'eth_newFilter',\n });\n const topics = eventName\n ? encodeEventTopics({\n abi,\n args,\n eventName,\n })\n : undefined;\n const id = await client.request({\n method: 'eth_newFilter',\n params: [\n {\n address,\n fromBlock: typeof fromBlock === 'bigint' ? numberToHex(fromBlock) : fromBlock,\n toBlock: typeof toBlock === 'bigint' ? numberToHex(toBlock) : toBlock,\n topics,\n },\n ],\n });\n return {\n abi,\n args,\n eventName,\n id,\n request: getRequest(id),\n strict,\n type: 'event',\n };\n}\n//# sourceMappingURL=createContractEventFilter.js.map","export function parseAccount(account) {\n if (typeof account === 'string')\n return { address: account, type: 'json-rpc' };\n return account;\n}\n//# sourceMappingURL=parseAccount.js.map","import { slice } from '../data/slice.js';\nimport { hashAbiItem, hashFunction } from './hashFunction.js';\nexport const getFunctionSelector = (fn) => {\n if (typeof fn === 'string')\n return slice(hashFunction(fn), 0, 4);\n return slice(hashAbiItem(fn), 0, 4);\n};\n//# sourceMappingURL=getFunctionSelector.js.map","import { AbiFunctionNotFoundError } from '../../errors/abi.js';\nimport { concatHex } from '../data/concat.js';\nimport { getFunctionSelector } from '../hash/getFunctionSelector.js';\nimport { encodeAbiParameters } from './encodeAbiParameters.js';\nimport { formatAbiItem } from './formatAbiItem.js';\nimport { getAbiItem } from './getAbiItem.js';\nexport function encodeFunctionData({ abi, args, functionName, }) {\n let abiItem = abi[0];\n if (functionName) {\n abiItem = getAbiItem({\n abi,\n args,\n name: functionName,\n });\n if (!abiItem)\n throw new AbiFunctionNotFoundError(functionName, {\n docsPath: '/docs/contract/encodeFunctionData',\n });\n }\n if (abiItem.type !== 'function')\n throw new AbiFunctionNotFoundError(undefined, {\n docsPath: '/docs/contract/encodeFunctionData',\n });\n const definition = formatAbiItem(abiItem);\n const signature = getFunctionSelector(definition);\n const data = 'inputs' in abiItem && abiItem.inputs\n ? encodeAbiParameters(abiItem.inputs, (args ?? []))\n : undefined;\n return concatHex([signature, data ?? '0x']);\n}\n//# sourceMappingURL=encodeFunctionData.js.map","// https://docs.soliditylang.org/en/v0.8.16/control-structures.html#panic-via-assert-and-error-via-require\nexport const panicReasons = {\n 1: 'An `assert` condition failed.',\n 17: 'Arithmic operation resulted in underflow or overflow.',\n 18: 'Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).',\n 33: 'Attempted to convert to an invalid type.',\n 34: 'Attempted to access a storage byte array that is incorrectly encoded.',\n 49: 'Performed `.pop()` on an empty array',\n 50: 'Array index is out of bounds.',\n 65: 'Allocated too much memory or created an array which is too large.',\n 81: 'Attempted to call a zero-initialized variable of internal function type.',\n};\nexport const solidityError = {\n inputs: [\n {\n name: 'message',\n type: 'string',\n },\n ],\n name: 'Error',\n type: 'error',\n};\nexport const solidityPanic = {\n inputs: [\n {\n name: 'reason',\n type: 'uint256',\n },\n ],\n name: 'Panic',\n type: 'error',\n};\n//# sourceMappingURL=solidity.js.map","import { InvalidAddressError } from '../../errors/address.js';\nimport { stringToBytes } from '../encoding/toBytes.js';\nimport { keccak256 } from '../hash/keccak256.js';\nimport { isAddress } from './isAddress.js';\nexport function checksumAddress(address_, chainId) {\n const hexAddress = chainId\n ? `${chainId}${address_.toLowerCase()}`\n : address_.substring(2).toLowerCase();\n const hash = keccak256(stringToBytes(hexAddress), 'bytes');\n const address = (chainId ? hexAddress.substring(`${chainId}0x`.length) : hexAddress).split('');\n for (let i = 0; i < 40; i += 2) {\n if (hash[i >> 1] >> 4 >= 8 && address[i]) {\n address[i] = address[i].toUpperCase();\n }\n if ((hash[i >> 1] & 0x0f) >= 8 && address[i + 1]) {\n address[i + 1] = address[i + 1].toUpperCase();\n }\n }\n return `0x${address.join('')}`;\n}\nexport function getAddress(address, chainId) {\n if (!isAddress(address))\n throw new InvalidAddressError({ address });\n return checksumAddress(address, chainId);\n}\n//# sourceMappingURL=getAddress.js.map","import { AbiDecodingDataSizeTooSmallError, AbiDecodingZeroDataError, InvalidAbiDecodingTypeError, } from '../../errors/abi.js';\nimport { checksumAddress } from '../address/getAddress.js';\nimport { size } from '../data/size.js';\nimport { slice } from '../data/slice.js';\nimport { trim } from '../data/trim.js';\nimport { hexToBigInt, hexToBool, hexToNumber, hexToString, } from '../encoding/fromHex.js';\nimport { getArrayComponents } from './encodeAbiParameters.js';\nexport function decodeAbiParameters(params, data) {\n if (data === '0x' && params.length > 0)\n throw new AbiDecodingZeroDataError();\n if (size(data) && size(data) < 32)\n throw new AbiDecodingDataSizeTooSmallError({\n data,\n params: params,\n size: size(data),\n });\n return decodeParams({\n data,\n params: params,\n });\n}\nfunction decodeParams({ data, params, }) {\n const decodedValues = [];\n let position = 0;\n for (let i = 0; i < params.length; i++) {\n if (position >= size(data))\n throw new AbiDecodingDataSizeTooSmallError({\n data,\n params,\n size: size(data),\n });\n const param = params[i];\n const { consumed, value } = decodeParam({ data, param, position });\n decodedValues.push(value);\n // Step across the data by the amount of data consumed by this parameter.\n position += consumed;\n }\n return decodedValues;\n}\nfunction decodeParam({ data, param, position, }) {\n const arrayComponents = getArrayComponents(param.type);\n if (arrayComponents) {\n const [length, type] = arrayComponents;\n return decodeArray(data, {\n length,\n param: { ...param, type: type },\n position,\n });\n }\n if (param.type === 'tuple') {\n return decodeTuple(data, { param: param, position });\n }\n if (param.type === 'string') {\n return decodeString(data, { position });\n }\n if (param.type.startsWith('bytes')) {\n return decodeBytes(data, { param, position });\n }\n const value = slice(data, position, position + 32, { strict: true });\n if (param.type.startsWith('uint') || param.type.startsWith('int')) {\n return decodeNumber(value, { param });\n }\n if (param.type === 'address') {\n return decodeAddress(value);\n }\n if (param.type === 'bool') {\n return decodeBool(value);\n }\n throw new InvalidAbiDecodingTypeError(param.type, {\n docsPath: '/docs/contract/decodeAbiParameters',\n });\n}\n////////////////////////////////////////////////////////////////////\nfunction decodeAddress(value) {\n return { consumed: 32, value: checksumAddress(slice(value, -20)) };\n}\nfunction decodeArray(data, { param, length, position, }) {\n // If the length of the array is not known in advance (dynamic array),\n // we will need to decode the offset of the array data.\n if (!length) {\n // Get the offset of the array data.\n const offset = hexToNumber(slice(data, position, position + 32, { strict: true }));\n // Get the length of the array from the offset.\n const length = hexToNumber(slice(data, offset, offset + 32, { strict: true }));\n let consumed = 0;\n const value = [];\n for (let i = 0; i < length; ++i) {\n const decodedChild = decodeParam({\n data: slice(data, offset + 32),\n param,\n position: consumed,\n });\n consumed += decodedChild.consumed;\n value.push(decodedChild.value);\n }\n return { value, consumed: 32 };\n }\n // If the length of the array is known in advance,\n // and the length of an element deeply nested in the array is not known,\n // we need to decode the offset of the array data.\n if (hasDynamicChild(param)) {\n // Get the child type of the array.\n const arrayComponents = getArrayComponents(param.type);\n // If the child type is not known, the array is dynamic.\n const dynamicChild = !arrayComponents?.[0];\n let consumed = 0;\n const value = [];\n for (let i = 0; i < length; ++i) {\n const offset = hexToNumber(slice(data, position, position + 32, { strict: true }));\n const decodedChild = decodeParam({\n data: slice(data, offset),\n param,\n position: dynamicChild ? consumed : i * 32,\n });\n consumed += decodedChild.consumed;\n value.push(decodedChild.value);\n }\n return { value, consumed: 32 };\n }\n // If the length of the array is known in advance,\n // and the length of each element in the array is known,\n // the array data is encoded contiguously after the array.\n let consumed = 0;\n const value = [];\n for (let i = 0; i < length; ++i) {\n const decodedChild = decodeParam({\n data,\n param,\n position: position + consumed,\n });\n consumed += decodedChild.consumed;\n value.push(decodedChild.value);\n }\n return { value, consumed };\n}\nfunction decodeBool(value) {\n return { consumed: 32, value: hexToBool(value) };\n}\nfunction decodeBytes(data, { param, position }) {\n const [_, size] = param.type.split('bytes');\n if (!size) {\n // If we don't have a size, we're dealing with a dynamic-size array\n // so we need to read the offset of the data part first.\n const offset = hexToNumber(slice(data, position, position + 32, { strict: true }));\n const length = hexToNumber(slice(data, offset, offset + 32, { strict: true }));\n // If there is no length, we have zero data.\n if (length === 0)\n return { consumed: 32, value: '0x' };\n const value = slice(data, offset + 32, offset + 32 + length, {\n strict: true,\n });\n return { consumed: 32, value };\n }\n const value = slice(data, position, position + parseInt(size), {\n strict: true,\n });\n return { consumed: 32, value };\n}\nfunction decodeNumber(value, { param }) {\n const signed = param.type.startsWith('int');\n const size = parseInt(param.type.split('int')[1] || '256');\n return {\n consumed: 32,\n value: size > 48\n ? hexToBigInt(value, { signed })\n : hexToNumber(value, { signed }),\n };\n}\nfunction decodeString(data, { position }) {\n const offset = hexToNumber(slice(data, position, position + 32, { strict: true }));\n const length = hexToNumber(slice(data, offset, offset + 32, { strict: true }));\n // If there is no length, we have zero data (empty string).\n if (length === 0)\n return { consumed: 32, value: '' };\n const value = hexToString(trim(slice(data, offset + 32, offset + 32 + length, { strict: true })));\n return { consumed: 32, value };\n}\nfunction decodeTuple(data, { param, position }) {\n // Tuples can have unnamed components (i.e. they are arrays), so we must\n // determine whether the tuple is named or unnamed. In the case of a named\n // tuple, the value will be an object where each property is the name of the\n // component. In the case of an unnamed tuple, the value will be an array.\n const hasUnnamedChild = param.components.length === 0 || param.components.some(({ name }) => !name);\n // Initialize the value to an object or an array, depending on whether the\n // tuple is named or unnamed.\n const value = hasUnnamedChild ? [] : {};\n let consumed = 0;\n // If the tuple has a dynamic child, we must first decode the offset to the\n // tuple data.\n if (hasDynamicChild(param)) {\n const offset = hexToNumber(slice(data, position, position + 32, { strict: true }));\n // Decode each component of the tuple, starting at the offset.\n for (let i = 0; i < param.components.length; ++i) {\n const component = param.components[i];\n const decodedChild = decodeParam({\n data: slice(data, offset),\n param: component,\n position: consumed,\n });\n consumed += decodedChild.consumed;\n value[hasUnnamedChild ? i : component?.name] = decodedChild.value;\n }\n return { consumed: 32, value };\n }\n // If the tuple has static children, we can just decode each component\n // in sequence.\n for (let i = 0; i < param.components.length; ++i) {\n const component = param.components[i];\n const decodedChild = decodeParam({\n data,\n param: component,\n position: position + consumed,\n });\n consumed += decodedChild.consumed;\n value[hasUnnamedChild ? i : component?.name] = decodedChild.value;\n }\n return { consumed, value };\n}\nfunction hasDynamicChild(param) {\n const { type } = param;\n if (type === 'string')\n return true;\n if (type === 'bytes')\n return true;\n if (type.endsWith('[]'))\n return true;\n if (type === 'tuple')\n return param.components?.some(hasDynamicChild);\n const arrayComponents = getArrayComponents(param.type);\n if (arrayComponents &&\n hasDynamicChild({ ...param, type: arrayComponents[1] }))\n return true;\n return false;\n}\n//# sourceMappingURL=decodeAbiParameters.js.map","import { solidityError, solidityPanic } from '../../constants/solidity.js';\nimport { AbiDecodingZeroDataError, AbiErrorSignatureNotFoundError, } from '../../errors/abi.js';\nimport { slice } from '../data/slice.js';\nimport { getFunctionSelector } from '../hash/getFunctionSelector.js';\nimport { decodeAbiParameters } from './decodeAbiParameters.js';\nimport { formatAbiItem } from './formatAbiItem.js';\nexport function decodeErrorResult({ abi, data, }) {\n const signature = slice(data, 0, 4);\n if (signature === '0x')\n throw new AbiDecodingZeroDataError();\n const abi_ = [...(abi || []), solidityError, solidityPanic];\n const abiItem = abi_.find((x) => x.type === 'error' && signature === getFunctionSelector(formatAbiItem(x)));\n if (!abiItem)\n throw new AbiErrorSignatureNotFoundError(signature, {\n docsPath: '/docs/contract/decodeErrorResult',\n });\n return {\n abiItem,\n args: ('inputs' in abiItem && abiItem.inputs && abiItem.inputs.length > 0\n ? decodeAbiParameters(abiItem.inputs, slice(data, 4))\n : undefined),\n errorName: abiItem.name,\n };\n}\n//# sourceMappingURL=decodeErrorResult.js.map","export const stringify = (value, replacer, space) => JSON.stringify(value, (key, value_) => {\n const value = typeof value_ === 'bigint' ? value_.toString() : value_;\n return typeof replacer === 'function' ? replacer(key, value) : value;\n}, space);\n//# sourceMappingURL=stringify.js.map","import { stringify } from '../stringify.js';\nexport function formatAbiItemWithArgs({ abiItem, args, includeFunctionName = true, includeName = false, }) {\n if (!('name' in abiItem))\n return;\n if (!('inputs' in abiItem))\n return;\n if (!abiItem.inputs)\n return;\n return `${includeFunctionName ? abiItem.name : ''}(${abiItem.inputs\n .map((input, i) => `${includeName && input.name ? `${input.name}: ` : ''}${typeof args[i] === 'object' ? stringify(args[i]) : args[i]}`)\n .join(', ')})`;\n}\n//# sourceMappingURL=formatAbiItemWithArgs.js.map","export const etherUnits = {\n gwei: 9,\n wei: 18,\n};\nexport const gweiUnits = {\n ether: -9,\n wei: 9,\n};\nexport const weiUnits = {\n ether: -18,\n gwei: -9,\n};\n//# sourceMappingURL=unit.js.map","export function formatUnits(value, decimals) {\n let display = value.toString();\n const negative = display.startsWith('-');\n if (negative)\n display = display.slice(1);\n display = display.padStart(decimals, '0');\n let [integer, fraction] = [\n display.slice(0, display.length - decimals),\n display.slice(display.length - decimals),\n ];\n fraction = fraction.replace(/(0+)$/, '');\n return `${negative ? '-' : ''}${integer || '0'}${fraction ? `.${fraction}` : ''}`;\n}\n//# sourceMappingURL=formatUnits.js.map","import { etherUnits } from '../../constants/unit.js';\nimport { formatUnits } from './formatUnits.js';\nexport function formatEther(wei, unit = 'wei') {\n return formatUnits(wei, etherUnits[unit]);\n}\n//# sourceMappingURL=formatEther.js.map","import { gweiUnits } from '../../constants/unit.js';\nimport { formatUnits } from './formatUnits.js';\nexport function formatGwei(wei, unit = 'wei') {\n return formatUnits(wei, gweiUnits[unit]);\n}\n//# sourceMappingURL=formatGwei.js.map","import { formatEther } from '../utils/unit/formatEther.js';\nimport { formatGwei } from '../utils/unit/formatGwei.js';\nimport { BaseError } from './base.js';\nexport function prettyPrint(args) {\n const entries = Object.entries(args)\n .map(([key, value]) => {\n if (value === undefined || value === false)\n return null;\n return [key, value];\n })\n .filter(Boolean);\n const maxLength = entries.reduce((acc, [key]) => Math.max(acc, key.length), 0);\n return entries\n .map(([key, value]) => ` ${`${key}:`.padEnd(maxLength + 1)} ${value}`)\n .join('\\n');\n}\nexport class FeeConflictError extends BaseError {\n constructor() {\n super([\n 'Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.',\n 'Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others.',\n ].join('\\n'));\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'FeeConflictError'\n });\n }\n}\nexport class InvalidLegacyVError extends BaseError {\n constructor({ v }) {\n super(`Invalid \\`v\\` value \"${v}\". Expected 27 or 28.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidLegacyVError'\n });\n }\n}\nexport class InvalidSerializableTransactionError extends BaseError {\n constructor({ transaction }) {\n super('Cannot infer a transaction type from provided transaction.', {\n metaMessages: [\n 'Provided Transaction:',\n '{',\n prettyPrint(transaction),\n '}',\n '',\n 'To infer the type, either provide:',\n '- a `type` to the Transaction, or',\n '- an EIP-1559 Transaction with `maxFeePerGas`, or',\n '- an EIP-2930 Transaction with `gasPrice` & `accessList`, or',\n '- a Legacy Transaction with `gasPrice`',\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidSerializableTransactionError'\n });\n }\n}\nexport class InvalidSerializedTransactionTypeError extends BaseError {\n constructor({ serializedType }) {\n super(`Serialized transaction type \"${serializedType}\" is invalid.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidSerializedTransactionType'\n });\n Object.defineProperty(this, \"serializedType\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.serializedType = serializedType;\n }\n}\nexport class InvalidSerializedTransactionError extends BaseError {\n constructor({ attributes, serializedTransaction, type, }) {\n const missing = Object.entries(attributes)\n .map(([key, value]) => (typeof value === 'undefined' ? key : undefined))\n .filter(Boolean);\n super(`Invalid serialized transaction of type \"${type}\" was provided.`, {\n metaMessages: [\n `Serialized Transaction: \"${serializedTransaction}\"`,\n missing.length > 0 ? `Missing Attributes: ${missing.join(', ')}` : '',\n ].filter(Boolean),\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidSerializedTransactionError'\n });\n Object.defineProperty(this, \"serializedTransaction\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"type\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.serializedTransaction = serializedTransaction;\n this.type = type;\n }\n}\nexport class InvalidStorageKeySizeError extends BaseError {\n constructor({ storageKey }) {\n super(`Size for storage key \"${storageKey}\" is invalid. Expected 32 bytes. Got ${Math.floor((storageKey.length - 2) / 2)} bytes.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidStorageKeySizeError'\n });\n }\n}\nexport class TransactionExecutionError extends BaseError {\n constructor(cause, { account, docsPath, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, }) {\n const prettyArgs = prettyPrint({\n chain: chain && `${chain?.name} (id: ${chain?.id})`,\n from: account?.address,\n to,\n value: typeof value !== 'undefined' &&\n `${formatEther(value)} ${chain?.nativeCurrency.symbol || 'ETH'}`,\n data,\n gas,\n gasPrice: typeof gasPrice !== 'undefined' && `${formatGwei(gasPrice)} gwei`,\n maxFeePerGas: typeof maxFeePerGas !== 'undefined' &&\n `${formatGwei(maxFeePerGas)} gwei`,\n maxPriorityFeePerGas: typeof maxPriorityFeePerGas !== 'undefined' &&\n `${formatGwei(maxPriorityFeePerGas)} gwei`,\n nonce,\n });\n super(cause.shortMessage, {\n cause,\n docsPath,\n metaMessages: [\n ...(cause.metaMessages ? [...cause.metaMessages, ' '] : []),\n 'Request Arguments:',\n prettyArgs,\n ].filter(Boolean),\n });\n Object.defineProperty(this, \"cause\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'TransactionExecutionError'\n });\n this.cause = cause;\n }\n}\nexport class TransactionNotFoundError extends BaseError {\n constructor({ blockHash, blockNumber, blockTag, hash, index, }) {\n let identifier = 'Transaction';\n if (blockTag && index !== undefined)\n identifier = `Transaction at block time \"${blockTag}\" at index \"${index}\"`;\n if (blockHash && index !== undefined)\n identifier = `Transaction at block hash \"${blockHash}\" at index \"${index}\"`;\n if (blockNumber && index !== undefined)\n identifier = `Transaction at block number \"${blockNumber}\" at index \"${index}\"`;\n if (hash)\n identifier = `Transaction with hash \"${hash}\"`;\n super(`${identifier} could not be found.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'TransactionNotFoundError'\n });\n }\n}\nexport class TransactionReceiptNotFoundError extends BaseError {\n constructor({ hash }) {\n super(`Transaction receipt with hash \"${hash}\" could not be found. The Transaction may not be processed on a block yet.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'TransactionReceiptNotFoundError'\n });\n }\n}\nexport class WaitForTransactionReceiptTimeoutError extends BaseError {\n constructor({ hash }) {\n super(`Timed out while waiting for transaction with hash \"${hash}\" to be confirmed.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'WaitForTransactionReceiptTimeoutError'\n });\n }\n}\n//# sourceMappingURL=transaction.js.map","import { parseAccount } from '../accounts/utils/parseAccount.js';\nimport { panicReasons } from '../constants/solidity.js';\nimport { decodeErrorResult, } from '../utils/abi/decodeErrorResult.js';\nimport { formatAbiItem } from '../utils/abi/formatAbiItem.js';\nimport { formatAbiItemWithArgs } from '../utils/abi/formatAbiItemWithArgs.js';\nimport { getAbiItem } from '../utils/abi/getAbiItem.js';\nimport { formatEther } from '../utils/unit/formatEther.js';\nimport { formatGwei } from '../utils/unit/formatGwei.js';\nimport { AbiErrorSignatureNotFoundError } from './abi.js';\nimport { BaseError } from './base.js';\nimport { prettyPrint } from './transaction.js';\nimport { getContractAddress } from './utils.js';\nexport class CallExecutionError extends BaseError {\n constructor(cause, { account: account_, docsPath, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, }) {\n const account = account_ ? parseAccount(account_) : undefined;\n const prettyArgs = prettyPrint({\n from: account?.address,\n to,\n value: typeof value !== 'undefined' &&\n `${formatEther(value)} ${chain?.nativeCurrency.symbol || 'ETH'}`,\n data,\n gas,\n gasPrice: typeof gasPrice !== 'undefined' && `${formatGwei(gasPrice)} gwei`,\n maxFeePerGas: typeof maxFeePerGas !== 'undefined' &&\n `${formatGwei(maxFeePerGas)} gwei`,\n maxPriorityFeePerGas: typeof maxPriorityFeePerGas !== 'undefined' &&\n `${formatGwei(maxPriorityFeePerGas)} gwei`,\n nonce,\n });\n super(cause.shortMessage, {\n cause,\n docsPath,\n metaMessages: [\n ...(cause.metaMessages ? [...cause.metaMessages, ' '] : []),\n 'Raw Call Arguments:',\n prettyArgs,\n ].filter(Boolean),\n });\n Object.defineProperty(this, \"cause\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'CallExecutionError'\n });\n this.cause = cause;\n }\n}\nexport class ContractFunctionExecutionError extends BaseError {\n constructor(cause, { abi, args, contractAddress, docsPath, functionName, sender, }) {\n const abiItem = getAbiItem({ abi, args, name: functionName });\n const formattedArgs = abiItem\n ? formatAbiItemWithArgs({\n abiItem,\n args,\n includeFunctionName: false,\n includeName: false,\n })\n : undefined;\n const functionWithParams = abiItem\n ? formatAbiItem(abiItem, { includeName: true })\n : undefined;\n const prettyArgs = prettyPrint({\n address: contractAddress && getContractAddress(contractAddress),\n function: functionWithParams,\n args: formattedArgs &&\n formattedArgs !== '()' &&\n `${[...Array(functionName?.length ?? 0).keys()]\n .map(() => ' ')\n .join('')}${formattedArgs}`,\n sender,\n });\n super(cause.shortMessage ||\n `An unknown error occurred while executing the contract function \"${functionName}\".`, {\n cause,\n docsPath,\n metaMessages: [\n ...(cause.metaMessages ? [...cause.metaMessages, ' '] : []),\n 'Contract Call:',\n prettyArgs,\n ].filter(Boolean),\n });\n Object.defineProperty(this, \"abi\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"args\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"cause\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"contractAddress\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"formattedArgs\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"functionName\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"sender\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ContractFunctionExecutionError'\n });\n this.abi = abi;\n this.args = args;\n this.cause = cause;\n this.contractAddress = contractAddress;\n this.functionName = functionName;\n this.sender = sender;\n }\n}\nexport class ContractFunctionRevertedError extends BaseError {\n constructor({ abi, data, functionName, message, }) {\n let cause;\n let decodedData = undefined;\n let metaMessages;\n let reason;\n if (data && data !== '0x') {\n try {\n decodedData = decodeErrorResult({ abi, data });\n const { abiItem, errorName, args: errorArgs } = decodedData;\n if (errorName === 'Error') {\n reason = errorArgs[0];\n }\n else if (errorName === 'Panic') {\n const [firstArg] = errorArgs;\n reason = panicReasons[firstArg];\n }\n else {\n const errorWithParams = abiItem\n ? formatAbiItem(abiItem, { includeName: true })\n : undefined;\n const formattedArgs = abiItem && errorArgs\n ? formatAbiItemWithArgs({\n abiItem,\n args: errorArgs,\n includeFunctionName: false,\n includeName: false,\n })\n : undefined;\n metaMessages = [\n errorWithParams ? `Error: ${errorWithParams}` : '',\n formattedArgs && formattedArgs !== '()'\n ? ` ${[...Array(errorName?.length ?? 0).keys()]\n .map(() => ' ')\n .join('')}${formattedArgs}`\n : '',\n ];\n }\n }\n catch (err) {\n cause = err;\n }\n }\n else if (message)\n reason = message;\n let signature;\n if (cause instanceof AbiErrorSignatureNotFoundError) {\n signature = cause.signature;\n metaMessages = [\n `Unable to decode signature \"${signature}\" as it was not found on the provided ABI.`,\n 'Make sure you are using the correct ABI and that the error exists on it.',\n `You can look up the decoded signature here: https://openchain.xyz/signatures?query=${signature}.`,\n ];\n }\n super((reason && reason !== 'execution reverted') || signature\n ? [\n `The contract function \"${functionName}\" reverted with the following ${signature ? 'signature' : 'reason'}:`,\n reason || signature,\n ].join('\\n')\n : `The contract function \"${functionName}\" reverted.`, {\n cause,\n metaMessages,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ContractFunctionRevertedError'\n });\n Object.defineProperty(this, \"data\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"reason\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"signature\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.data = decodedData;\n this.reason = reason;\n this.signature = signature;\n }\n}\nexport class ContractFunctionZeroDataError extends BaseError {\n constructor({ functionName }) {\n super(`The contract function \"${functionName}\" returned no data (\"0x\").`, {\n metaMessages: [\n 'This could be due to any of the following:',\n ` - The contract does not have the function \"${functionName}\",`,\n ' - The parameters passed to the contract function may be invalid, or',\n ' - The address is not a contract.',\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ContractFunctionZeroDataError'\n });\n }\n}\nexport class RawContractError extends BaseError {\n constructor({ data, message, }) {\n super(message || '');\n Object.defineProperty(this, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 3\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'RawContractError'\n });\n Object.defineProperty(this, \"data\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.data = data;\n }\n}\n//# sourceMappingURL=contract.js.map","import { AbiDecodingZeroDataError } from '../../errors/abi.js';\nimport { BaseError } from '../../errors/base.js';\nimport { ContractFunctionExecutionError, ContractFunctionRevertedError, ContractFunctionZeroDataError, RawContractError, } from '../../errors/contract.js';\nconst EXECUTION_REVERTED_ERROR_CODE = 3;\nexport function getContractError(err, { abi, address, args, docsPath, functionName, sender, }) {\n const { code, data, message, shortMessage } = (err instanceof RawContractError\n ? err\n : err instanceof BaseError\n ? err.walk((err) => 'data' in err) || err.walk()\n : {});\n let cause = err;\n if (err instanceof AbiDecodingZeroDataError) {\n cause = new ContractFunctionZeroDataError({ functionName });\n }\n else if (code === EXECUTION_REVERTED_ERROR_CODE &&\n (data || message || shortMessage)) {\n cause = new ContractFunctionRevertedError({\n abi,\n data: typeof data === 'object' ? data.data : data,\n functionName,\n message: shortMessage ?? message,\n });\n }\n return new ContractFunctionExecutionError(cause, {\n abi,\n args,\n contractAddress: address,\n docsPath,\n functionName,\n sender,\n });\n}\n//# sourceMappingURL=getContractError.js.map","import { BaseError } from './base.js';\nexport class AccountNotFoundError extends BaseError {\n constructor({ docsPath } = {}) {\n super([\n 'Could not find an Account to execute with this Action.',\n 'Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the WalletClient.',\n ].join('\\n'), {\n docsPath,\n docsSlug: 'account',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AccountNotFoundError'\n });\n }\n}\n//# sourceMappingURL=account.js.map","import { formatEther } from '../utils/unit/formatEther.js';\nimport { formatGwei } from '../utils/unit/formatGwei.js';\nimport { BaseError } from './base.js';\nimport { prettyPrint } from './transaction.js';\nexport class EstimateGasExecutionError extends BaseError {\n constructor(cause, { account, docsPath, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, }) {\n const prettyArgs = prettyPrint({\n from: account?.address,\n to,\n value: typeof value !== 'undefined' &&\n `${formatEther(value)} ${chain?.nativeCurrency.symbol || 'ETH'}`,\n data,\n gas,\n gasPrice: typeof gasPrice !== 'undefined' && `${formatGwei(gasPrice)} gwei`,\n maxFeePerGas: typeof maxFeePerGas !== 'undefined' &&\n `${formatGwei(maxFeePerGas)} gwei`,\n maxPriorityFeePerGas: typeof maxPriorityFeePerGas !== 'undefined' &&\n `${formatGwei(maxPriorityFeePerGas)} gwei`,\n nonce,\n });\n super(cause.shortMessage, {\n cause,\n docsPath,\n metaMessages: [\n ...(cause.metaMessages ? [...cause.metaMessages, ' '] : []),\n 'Estimate Gas Arguments:',\n prettyArgs,\n ].filter(Boolean),\n });\n Object.defineProperty(this, \"cause\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'EstimateGasExecutionError'\n });\n this.cause = cause;\n }\n}\n//# sourceMappingURL=estimateGas.js.map","import { formatGwei } from '../utils/unit/formatGwei.js';\nimport { BaseError } from './base.js';\n/**\n * geth: https://github.com/ethereum/go-ethereum/blob/master/core/error.go\n * https://github.com/ethereum/go-ethereum/blob/master/core/types/transaction.go#L34-L41\n *\n * erigon: https://github.com/ledgerwatch/erigon/blob/master/core/error.go\n * https://github.com/ledgerwatch/erigon/blob/master/core/types/transaction.go#L41-L46\n *\n * anvil: https://github.com/foundry-rs/foundry/blob/master/anvil/src/eth/error.rs#L108\n */\nclass ExecutionRevertedError extends BaseError {\n constructor({ cause, message, } = {}) {\n const reason = message\n ?.replace('execution reverted: ', '')\n ?.replace('execution reverted', '');\n super(`Execution reverted ${reason ? `with reason: ${reason}` : 'for an unknown reason'}.`, {\n cause,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ExecutionRevertedError'\n });\n }\n}\nObject.defineProperty(ExecutionRevertedError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 3\n});\nObject.defineProperty(ExecutionRevertedError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /execution reverted/\n});\nexport { ExecutionRevertedError };\nclass FeeCapTooHighError extends BaseError {\n constructor({ cause, maxFeePerGas, } = {}) {\n super(`The fee cap (\\`maxFeePerGas\\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)} gwei` : ''}) cannot be higher than the maximum allowed value (2^256-1).`, {\n cause,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'FeeCapTooHigh'\n });\n }\n}\nObject.defineProperty(FeeCapTooHighError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /max fee per gas higher than 2\\^256-1|fee cap higher than 2\\^256-1/\n});\nexport { FeeCapTooHighError };\nclass FeeCapTooLowError extends BaseError {\n constructor({ cause, maxFeePerGas, } = {}) {\n super(`The fee cap (\\`maxFeePerGas\\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)}` : ''} gwei) cannot be lower than the block base fee.`, {\n cause,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'FeeCapTooLow'\n });\n }\n}\nObject.defineProperty(FeeCapTooLowError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/\n});\nexport { FeeCapTooLowError };\nclass NonceTooHighError extends BaseError {\n constructor({ cause, nonce } = {}) {\n super(`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ''}is higher than the next one expected.`, { cause });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'NonceTooHighError'\n });\n }\n}\nObject.defineProperty(NonceTooHighError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /nonce too high/\n});\nexport { NonceTooHighError };\nclass NonceTooLowError extends BaseError {\n constructor({ cause, nonce } = {}) {\n super([\n `Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ''}is lower than the current nonce of the account.`,\n 'Try increasing the nonce or find the latest nonce with `getTransactionCount`.',\n ].join('\\n'), { cause });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'NonceTooLowError'\n });\n }\n}\nObject.defineProperty(NonceTooLowError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /nonce too low|transaction already imported|already known/\n});\nexport { NonceTooLowError };\nclass NonceMaxValueError extends BaseError {\n constructor({ cause, nonce } = {}) {\n super(`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ''}exceeds the maximum allowed nonce.`, { cause });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'NonceMaxValueError'\n });\n }\n}\nObject.defineProperty(NonceMaxValueError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /nonce has max value/\n});\nexport { NonceMaxValueError };\nclass InsufficientFundsError extends BaseError {\n constructor({ cause } = {}) {\n super([\n 'The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account.',\n ].join('\\n'), {\n cause,\n metaMessages: [\n 'This error could arise when the account does not have enough funds to:',\n ' - pay for the total gas fee,',\n ' - pay for the value to send.',\n ' ',\n 'The cost of the transaction is calculated as `gas * gas fee + value`, where:',\n ' - `gas` is the amount of gas needed for transaction to execute,',\n ' - `gas fee` is the gas fee,',\n ' - `value` is the amount of ether to send to the recipient.',\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InsufficientFundsError'\n });\n }\n}\nObject.defineProperty(InsufficientFundsError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /insufficient funds/\n});\nexport { InsufficientFundsError };\nclass IntrinsicGasTooHighError extends BaseError {\n constructor({ cause, gas } = {}) {\n super(`The amount of gas ${gas ? `(${gas}) ` : ''}provided for the transaction exceeds the limit allowed for the block.`, {\n cause,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'IntrinsicGasTooHighError'\n });\n }\n}\nObject.defineProperty(IntrinsicGasTooHighError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /intrinsic gas too high|gas limit reached/\n});\nexport { IntrinsicGasTooHighError };\nclass IntrinsicGasTooLowError extends BaseError {\n constructor({ cause, gas } = {}) {\n super(`The amount of gas ${gas ? `(${gas}) ` : ''}provided for the transaction is too low.`, {\n cause,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'IntrinsicGasTooLowError'\n });\n }\n}\nObject.defineProperty(IntrinsicGasTooLowError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /intrinsic gas too low/\n});\nexport { IntrinsicGasTooLowError };\nclass TransactionTypeNotSupportedError extends BaseError {\n constructor({ cause }) {\n super('The transaction type is not supported for this chain.', {\n cause,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'TransactionTypeNotSupportedError'\n });\n }\n}\nObject.defineProperty(TransactionTypeNotSupportedError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /transaction type not valid/\n});\nexport { TransactionTypeNotSupportedError };\nclass TipAboveFeeCapError extends BaseError {\n constructor({ cause, maxPriorityFeePerGas, maxFeePerGas, } = {}) {\n super([\n `The provided tip (\\`maxPriorityFeePerGas\\`${maxPriorityFeePerGas\n ? ` = ${formatGwei(maxPriorityFeePerGas)} gwei`\n : ''}) cannot be higher than the fee cap (\\`maxFeePerGas\\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)} gwei` : ''}).`,\n ].join('\\n'), {\n cause,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'TipAboveFeeCapError'\n });\n }\n}\nObject.defineProperty(TipAboveFeeCapError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /max priority fee per gas higher than max fee per gas|tip higher than fee cap/\n});\nexport { TipAboveFeeCapError };\nexport class UnknownNodeError extends BaseError {\n constructor({ cause }) {\n super(`An error occurred while executing: ${cause?.message}`, {\n cause,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'UnknownNodeError'\n });\n }\n}\n//# sourceMappingURL=node.js.map","import { stringify } from '../utils/stringify.js';\nimport { BaseError } from './base.js';\nimport { getUrl } from './utils.js';\nexport class HttpRequestError extends BaseError {\n constructor({ body, details, headers, status, url, }) {\n super('HTTP request failed.', {\n details,\n metaMessages: [\n status && `Status: ${status}`,\n `URL: ${getUrl(url)}`,\n body && `Request body: ${stringify(body)}`,\n ].filter(Boolean),\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'HttpRequestError'\n });\n Object.defineProperty(this, \"body\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"headers\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"status\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"url\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.body = body;\n this.headers = headers;\n this.status = status;\n this.url = url;\n }\n}\nexport class WebSocketRequestError extends BaseError {\n constructor({ body, details, url, }) {\n super('WebSocket request failed.', {\n details,\n metaMessages: [`URL: ${getUrl(url)}`, `Request body: ${stringify(body)}`],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'WebSocketRequestError'\n });\n }\n}\nexport class RpcRequestError extends BaseError {\n constructor({ body, error, url, }) {\n super('RPC Request failed.', {\n cause: error,\n details: error.message,\n metaMessages: [`URL: ${getUrl(url)}`, `Request body: ${stringify(body)}`],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'RpcRequestError'\n });\n Object.defineProperty(this, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.code = error.code;\n }\n}\nexport class TimeoutError extends BaseError {\n constructor({ body, url, }) {\n super('The request took too long to respond.', {\n details: 'The request timed out.',\n metaMessages: [`URL: ${getUrl(url)}`, `Request body: ${stringify(body)}`],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'TimeoutError'\n });\n }\n}\n//# sourceMappingURL=request.js.map","import { BaseError } from './base.js';\nimport { RpcRequestError } from './request.js';\nconst unknownErrorCode = -1;\n/**\n * Error subclass implementing JSON RPC 2.0 errors and Ethereum RPC errors per EIP-1474.\n *\n * - EIP https://eips.ethereum.org/EIPS/eip-1474\n */\nexport class RpcError extends BaseError {\n constructor(cause, { code, docsPath, metaMessages, shortMessage }) {\n super(shortMessage, {\n cause,\n docsPath,\n metaMessages: metaMessages || cause?.metaMessages,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'RpcError'\n });\n Object.defineProperty(this, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.name = cause.name;\n this.code = (cause instanceof RpcRequestError ? cause.code : code ?? unknownErrorCode);\n }\n}\n/**\n * Error subclass implementing Ethereum Provider errors per EIP-1193.\n *\n * - EIP https://eips.ethereum.org/EIPS/eip-1193\n */\nexport class ProviderRpcError extends RpcError {\n constructor(cause, options) {\n super(cause, options);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ProviderRpcError'\n });\n Object.defineProperty(this, \"data\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.data = options.data;\n }\n}\n/**\n * Subclass for a \"Parse error\" EIP-1474 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nclass ParseRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: ParseRpcError.code,\n shortMessage: 'Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ParseRpcError'\n });\n }\n}\nObject.defineProperty(ParseRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32700\n});\nexport { ParseRpcError };\n/**\n * Subclass for a \"Invalid request\" EIP-1474 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nclass InvalidRequestRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: InvalidRequestRpcError.code,\n shortMessage: 'JSON is not a valid request object.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidRequestRpcError'\n });\n }\n}\nObject.defineProperty(InvalidRequestRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32600\n});\nexport { InvalidRequestRpcError };\n/**\n * Subclass for a \"Method not found\" EIP-1474 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nclass MethodNotFoundRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: MethodNotFoundRpcError.code,\n shortMessage: 'The method does not exist / is not available.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'MethodNotFoundRpcError'\n });\n }\n}\nObject.defineProperty(MethodNotFoundRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32601\n});\nexport { MethodNotFoundRpcError };\n/**\n * Subclass for an \"Invalid params\" EIP-1474 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nclass InvalidParamsRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: InvalidParamsRpcError.code,\n shortMessage: [\n 'Invalid parameters were provided to the RPC method.',\n 'Double check you have provided the correct parameters.',\n ].join('\\n'),\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidParamsRpcError'\n });\n }\n}\nObject.defineProperty(InvalidParamsRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32602\n});\nexport { InvalidParamsRpcError };\n/**\n * Subclass for an \"Internal error\" EIP-1474 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nclass InternalRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: InternalRpcError.code,\n shortMessage: 'An internal error was received.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InternalRpcError'\n });\n }\n}\nObject.defineProperty(InternalRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32603\n});\nexport { InternalRpcError };\n/**\n * Subclass for an \"Invalid input\" EIP-1474 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nclass InvalidInputRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: InvalidInputRpcError.code,\n shortMessage: [\n 'Missing or invalid parameters.',\n 'Double check you have provided the correct parameters.',\n ].join('\\n'),\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidInputRpcError'\n });\n }\n}\nObject.defineProperty(InvalidInputRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32000\n});\nexport { InvalidInputRpcError };\n/**\n * Subclass for a \"Resource not found\" EIP-1474 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nclass ResourceNotFoundRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: ResourceNotFoundRpcError.code,\n shortMessage: 'Requested resource not found.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ResourceNotFoundRpcError'\n });\n }\n}\nObject.defineProperty(ResourceNotFoundRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32001\n});\nexport { ResourceNotFoundRpcError };\n/**\n * Subclass for a \"Resource unavailable\" EIP-1474 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nclass ResourceUnavailableRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: ResourceUnavailableRpcError.code,\n shortMessage: 'Requested resource not available.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ResourceUnavailableRpcError'\n });\n }\n}\nObject.defineProperty(ResourceUnavailableRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32002\n});\nexport { ResourceUnavailableRpcError };\n/**\n * Subclass for a \"Transaction rejected\" EIP-1474 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nclass TransactionRejectedRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: TransactionRejectedRpcError.code,\n shortMessage: 'Transaction creation failed.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'TransactionRejectedRpcError'\n });\n }\n}\nObject.defineProperty(TransactionRejectedRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32003\n});\nexport { TransactionRejectedRpcError };\n/**\n * Subclass for a \"Method not supported\" EIP-1474 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nclass MethodNotSupportedRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: MethodNotSupportedRpcError.code,\n shortMessage: 'Method is not implemented.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'MethodNotSupportedRpcError'\n });\n }\n}\nObject.defineProperty(MethodNotSupportedRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32004\n});\nexport { MethodNotSupportedRpcError };\n/**\n * Subclass for a \"Limit exceeded\" EIP-1474 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nclass LimitExceededRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: LimitExceededRpcError.code,\n shortMessage: 'Request exceeds defined limit.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'LimitExceededRpcError'\n });\n }\n}\nObject.defineProperty(LimitExceededRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32005\n});\nexport { LimitExceededRpcError };\n/**\n * Subclass for a \"JSON-RPC version not supported\" EIP-1474 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nclass JsonRpcVersionUnsupportedError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: JsonRpcVersionUnsupportedError.code,\n shortMessage: 'Version of JSON-RPC protocol is not supported.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'JsonRpcVersionUnsupportedError'\n });\n }\n}\nObject.defineProperty(JsonRpcVersionUnsupportedError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32006\n});\nexport { JsonRpcVersionUnsupportedError };\n/**\n * Subclass for a \"User Rejected Request\" EIP-1193 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1193#provider-errors\n */\nclass UserRejectedRequestError extends ProviderRpcError {\n constructor(cause) {\n super(cause, {\n code: UserRejectedRequestError.code,\n shortMessage: 'User rejected the request.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'UserRejectedRequestError'\n });\n }\n}\nObject.defineProperty(UserRejectedRequestError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 4001\n});\nexport { UserRejectedRequestError };\n/**\n * Subclass for an \"Unauthorized\" EIP-1193 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1193#provider-errors\n */\nclass UnauthorizedProviderError extends ProviderRpcError {\n constructor(cause) {\n super(cause, {\n code: UnauthorizedProviderError.code,\n shortMessage: 'The requested method and/or account has not been authorized by the user.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'UnauthorizedProviderError'\n });\n }\n}\nObject.defineProperty(UnauthorizedProviderError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 4100\n});\nexport { UnauthorizedProviderError };\n/**\n * Subclass for an \"Unsupported Method\" EIP-1193 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1193#provider-errors\n */\nclass UnsupportedProviderMethodError extends ProviderRpcError {\n constructor(cause) {\n super(cause, {\n code: UnsupportedProviderMethodError.code,\n shortMessage: 'The Provider does not support the requested method.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'UnsupportedProviderMethodError'\n });\n }\n}\nObject.defineProperty(UnsupportedProviderMethodError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 4200\n});\nexport { UnsupportedProviderMethodError };\n/**\n * Subclass for an \"Disconnected\" EIP-1193 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1193#provider-errors\n */\nclass ProviderDisconnectedError extends ProviderRpcError {\n constructor(cause) {\n super(cause, {\n code: ProviderDisconnectedError.code,\n shortMessage: 'The Provider is disconnected from all chains.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ProviderDisconnectedError'\n });\n }\n}\nObject.defineProperty(ProviderDisconnectedError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 4900\n});\nexport { ProviderDisconnectedError };\n/**\n * Subclass for an \"Chain Disconnected\" EIP-1193 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1193#provider-errors\n */\nclass ChainDisconnectedError extends ProviderRpcError {\n constructor(cause) {\n super(cause, {\n code: ChainDisconnectedError.code,\n shortMessage: 'The Provider is not connected to the requested chain.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ChainDisconnectedError'\n });\n }\n}\nObject.defineProperty(ChainDisconnectedError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 4901\n});\nexport { ChainDisconnectedError };\n/**\n * Subclass for an \"Switch Chain\" EIP-1193 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1193#provider-errors\n */\nclass SwitchChainError extends ProviderRpcError {\n constructor(cause) {\n super(cause, {\n code: SwitchChainError.code,\n shortMessage: 'An error occurred when attempting to switch chain.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'SwitchChainError'\n });\n }\n}\nObject.defineProperty(SwitchChainError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 4902\n});\nexport { SwitchChainError };\n/**\n * Subclass for an unknown RPC error.\n */\nexport class UnknownRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n shortMessage: 'An unknown RPC error occurred.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'UnknownRpcError'\n });\n }\n}\n//# sourceMappingURL=rpc.js.map","import { ExecutionRevertedError, FeeCapTooHighError, FeeCapTooLowError, InsufficientFundsError, IntrinsicGasTooHighError, IntrinsicGasTooLowError, NonceMaxValueError, NonceTooHighError, NonceTooLowError, TipAboveFeeCapError, TransactionTypeNotSupportedError, UnknownNodeError, } from '../../errors/node.js';\nimport { RpcRequestError } from '../../errors/request.js';\nimport { InvalidInputRpcError, TransactionRejectedRpcError, } from '../../errors/rpc.js';\nexport function containsNodeError(err) {\n return (err instanceof TransactionRejectedRpcError ||\n err instanceof InvalidInputRpcError ||\n (err instanceof RpcRequestError && err.code === ExecutionRevertedError.code));\n}\nexport function getNodeError(err, args) {\n const message = err.details.toLowerCase();\n if (FeeCapTooHighError.nodeMessage.test(message))\n return new FeeCapTooHighError({\n cause: err,\n maxFeePerGas: args?.maxFeePerGas,\n });\n else if (FeeCapTooLowError.nodeMessage.test(message))\n return new FeeCapTooLowError({\n cause: err,\n maxFeePerGas: args?.maxFeePerGas,\n });\n else if (NonceTooHighError.nodeMessage.test(message))\n return new NonceTooHighError({ cause: err, nonce: args?.nonce });\n else if (NonceTooLowError.nodeMessage.test(message))\n return new NonceTooLowError({ cause: err, nonce: args?.nonce });\n else if (NonceMaxValueError.nodeMessage.test(message))\n return new NonceMaxValueError({ cause: err, nonce: args?.nonce });\n else if (InsufficientFundsError.nodeMessage.test(message))\n return new InsufficientFundsError({ cause: err });\n else if (IntrinsicGasTooHighError.nodeMessage.test(message))\n return new IntrinsicGasTooHighError({ cause: err, gas: args?.gas });\n else if (IntrinsicGasTooLowError.nodeMessage.test(message))\n return new IntrinsicGasTooLowError({ cause: err, gas: args?.gas });\n else if (TransactionTypeNotSupportedError.nodeMessage.test(message))\n return new TransactionTypeNotSupportedError({ cause: err });\n else if (TipAboveFeeCapError.nodeMessage.test(message))\n return new TipAboveFeeCapError({\n cause: err,\n maxFeePerGas: args?.maxFeePerGas,\n maxPriorityFeePerGas: args?.maxPriorityFeePerGas,\n });\n else if (message.match(ExecutionRevertedError.nodeMessage) ||\n ('code' in err.cause &&\n err.cause?.code === ExecutionRevertedError.code))\n return new ExecutionRevertedError({\n cause: err,\n message: err.cause.details || err.details,\n });\n return new UnknownNodeError({\n cause: err.cause.cause,\n });\n}\n//# sourceMappingURL=getNodeError.js.map","import { EstimateGasExecutionError } from '../../errors/estimateGas.js';\nimport { containsNodeError, getNodeError, } from './getNodeError.js';\nexport function getEstimateGasError(err, { docsPath, ...args }) {\n let cause = err;\n if (containsNodeError(err))\n cause = getNodeError(err, args);\n return new EstimateGasExecutionError(cause, {\n docsPath,\n ...args,\n });\n}\n//# sourceMappingURL=getEstimateGasError.js.map","/**\n * @description Picks out the keys from `value` that exist in the formatter.\n */\nexport function extract(value, { format }) {\n if (!format)\n return {};\n const keys = Object.keys(format({}));\n return keys.reduce((data, key) => {\n // rome-ignore lint/suspicious/noPrototypeBuiltins:\n if (value?.hasOwnProperty(key)) {\n data[key] = value[key];\n }\n return data;\n }, {});\n}\n//# sourceMappingURL=extract.js.map","import { numberToHex } from '../encoding/toHex.js';\nimport { defineFormatter } from './formatter.js';\nexport function formatTransactionRequest(transactionRequest) {\n return {\n ...transactionRequest,\n gas: typeof transactionRequest.gas !== 'undefined'\n ? numberToHex(transactionRequest.gas)\n : undefined,\n gasPrice: typeof transactionRequest.gasPrice !== 'undefined'\n ? numberToHex(transactionRequest.gasPrice)\n : undefined,\n maxFeePerGas: typeof transactionRequest.maxFeePerGas !== 'undefined'\n ? numberToHex(transactionRequest.maxFeePerGas)\n : undefined,\n maxPriorityFeePerGas: typeof transactionRequest.maxPriorityFeePerGas !== 'undefined'\n ? numberToHex(transactionRequest.maxPriorityFeePerGas)\n : undefined,\n nonce: typeof transactionRequest.nonce !== 'undefined'\n ? numberToHex(transactionRequest.nonce)\n : undefined,\n value: typeof transactionRequest.value !== 'undefined'\n ? numberToHex(transactionRequest.value)\n : undefined,\n };\n}\nexport const defineTransactionRequest = /*#__PURE__*/ defineFormatter('transactionRequest', formatTransactionRequest);\n//# sourceMappingURL=transactionRequest.js.map","import { parseAccount } from '../../accounts/utils/parseAccount.js';\nimport { InvalidAddressError } from '../../errors/address.js';\nimport { FeeCapTooHighError, TipAboveFeeCapError } from '../../errors/node.js';\nimport { FeeConflictError } from '../../errors/transaction.js';\nimport { isAddress } from '../address/isAddress.js';\nexport function assertRequest(args) {\n const { account: account_, gasPrice, maxFeePerGas, maxPriorityFeePerGas, to, } = args;\n const account = account_ ? parseAccount(account_) : undefined;\n if (account && !isAddress(account.address))\n throw new InvalidAddressError({ address: account.address });\n if (to && !isAddress(to))\n throw new InvalidAddressError({ address: to });\n if (typeof gasPrice !== 'undefined' &&\n (typeof maxFeePerGas !== 'undefined' ||\n typeof maxPriorityFeePerGas !== 'undefined'))\n throw new FeeConflictError();\n if (maxFeePerGas && maxFeePerGas > 2n ** 256n - 1n)\n throw new FeeCapTooHighError({ maxFeePerGas });\n if (maxPriorityFeePerGas &&\n maxFeePerGas &&\n maxPriorityFeePerGas > maxFeePerGas)\n throw new TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas });\n}\n//# sourceMappingURL=assertRequest.js.map","import { BaseError } from './base.js';\nexport class BlockNotFoundError extends BaseError {\n constructor({ blockHash, blockNumber, }) {\n let identifier = 'Block';\n if (blockHash)\n identifier = `Block at hash \"${blockHash}\"`;\n if (blockNumber)\n identifier = `Block at number \"${blockNumber}\"`;\n super(`${identifier} could not be found.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'BlockNotFoundError'\n });\n }\n}\n//# sourceMappingURL=block.js.map","import { hexToNumber } from '../encoding/fromHex.js';\nimport { defineFormatter } from './formatter.js';\nexport const transactionType = {\n '0x0': 'legacy',\n '0x1': 'eip2930',\n '0x2': 'eip1559',\n};\nexport function formatTransaction(transaction) {\n const transaction_ = {\n ...transaction,\n blockHash: transaction.blockHash ? transaction.blockHash : null,\n blockNumber: transaction.blockNumber\n ? BigInt(transaction.blockNumber)\n : null,\n chainId: transaction.chainId ? hexToNumber(transaction.chainId) : undefined,\n gas: transaction.gas ? BigInt(transaction.gas) : undefined,\n gasPrice: transaction.gasPrice ? BigInt(transaction.gasPrice) : undefined,\n maxFeePerGas: transaction.maxFeePerGas\n ? BigInt(transaction.maxFeePerGas)\n : undefined,\n maxPriorityFeePerGas: transaction.maxPriorityFeePerGas\n ? BigInt(transaction.maxPriorityFeePerGas)\n : undefined,\n nonce: transaction.nonce ? hexToNumber(transaction.nonce) : undefined,\n to: transaction.to ? transaction.to : null,\n transactionIndex: transaction.transactionIndex\n ? Number(transaction.transactionIndex)\n : null,\n type: transaction.type ? transactionType[transaction.type] : undefined,\n typeHex: transaction.type ? transaction.type : undefined,\n value: transaction.value ? BigInt(transaction.value) : undefined,\n v: transaction.v ? BigInt(transaction.v) : undefined,\n };\n if (transaction_.type === 'legacy') {\n delete transaction_['accessList'];\n delete transaction_['maxFeePerGas'];\n delete transaction_['maxPriorityFeePerGas'];\n }\n if (transaction_.type === 'eip2930') {\n delete transaction_['maxFeePerGas'];\n delete transaction_['maxPriorityFeePerGas'];\n }\n return transaction_;\n}\nexport const defineTransaction = /*#__PURE__*/ defineFormatter('transaction', formatTransaction);\n//# sourceMappingURL=transaction.js.map","import { defineFormatter } from './formatter.js';\nimport { formatTransaction } from './transaction.js';\nexport function formatBlock(block) {\n const transactions = block.transactions?.map((transaction) => {\n if (typeof transaction === 'string')\n return transaction;\n return formatTransaction(transaction);\n });\n return {\n ...block,\n baseFeePerGas: block.baseFeePerGas ? BigInt(block.baseFeePerGas) : null,\n difficulty: block.difficulty ? BigInt(block.difficulty) : undefined,\n gasLimit: block.gasLimit ? BigInt(block.gasLimit) : undefined,\n gasUsed: block.gasUsed ? BigInt(block.gasUsed) : undefined,\n hash: block.hash ? block.hash : null,\n logsBloom: block.logsBloom ? block.logsBloom : null,\n nonce: block.nonce ? block.nonce : null,\n number: block.number ? BigInt(block.number) : null,\n size: block.size ? BigInt(block.size) : undefined,\n timestamp: block.timestamp ? BigInt(block.timestamp) : undefined,\n transactions,\n totalDifficulty: block.totalDifficulty\n ? BigInt(block.totalDifficulty)\n : null,\n };\n}\nexport const defineBlock = /*#__PURE__*/ defineFormatter('block', formatBlock);\n//# sourceMappingURL=block.js.map","import { BlockNotFoundError } from '../../errors/block.js';\nimport { numberToHex } from '../../utils/encoding/toHex.js';\nimport { formatBlock, } from '../../utils/formatters/block.js';\n/**\n * Returns information about a block at a block number, hash, or tag.\n *\n * - Docs: https://viem.sh/docs/actions/public/getBlock.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/fetching-blocks\n * - JSON-RPC Methods:\n * - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) for `blockNumber` & `blockTag`.\n * - Calls [`eth_getBlockByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbyhash) for `blockHash`.\n *\n * @param client - Client to use\n * @param parameters - {@link GetBlockParameters}\n * @returns Information about the block. {@link GetBlockReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getBlock } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const block = await getBlock(client)\n */\nexport async function getBlock(client, { blockHash, blockNumber, blockTag: blockTag_, includeTransactions: includeTransactions_, } = {}) {\n const blockTag = blockTag_ ?? 'latest';\n const includeTransactions = includeTransactions_ ?? false;\n const blockNumberHex = blockNumber !== undefined ? numberToHex(blockNumber) : undefined;\n let block = null;\n if (blockHash) {\n block = await client.request({\n method: 'eth_getBlockByHash',\n params: [blockHash, includeTransactions],\n });\n }\n else {\n block = await client.request({\n method: 'eth_getBlockByNumber',\n params: [blockNumberHex || blockTag, includeTransactions],\n });\n }\n if (!block)\n throw new BlockNotFoundError({ blockHash, blockNumber });\n const format = client.chain?.formatters?.block?.format || formatBlock;\n return format(block);\n}\n//# sourceMappingURL=getBlock.js.map","/**\n * Returns the current price of gas (in wei).\n *\n * - Docs: https://viem.sh/docs/actions/public/getGasPrice.html\n * - JSON-RPC Methods: [`eth_gasPrice`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gasprice)\n *\n * @param client - Client to use\n * @returns The gas price (in wei). {@link GetGasPriceReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getGasPrice } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const gasPrice = await getGasPrice(client)\n */\nexport async function getGasPrice(client) {\n const gasPrice = await client.request({\n method: 'eth_gasPrice',\n });\n return BigInt(gasPrice);\n}\n//# sourceMappingURL=getGasPrice.js.map","import { hexToNumber } from '../../utils/encoding/fromHex.js';\nimport { numberToHex } from '../../utils/encoding/toHex.js';\n/**\n * Returns the number of [Transactions](https://viem.sh/docs/glossary/terms.html#transaction) an Account has broadcast / sent.\n *\n * - Docs: https://viem.sh/docs/actions/public/getTransactionCount.html\n * - JSON-RPC Methods: [`eth_getTransactionCount`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactioncount)\n *\n * @param client - Client to use\n * @param parameters - {@link GetTransactionCountParameters}\n * @returns The number of transactions an account has sent. {@link GetTransactionCountReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getTransactionCount } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const transactionCount = await getTransactionCount(client, {\n * address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * })\n */\nexport async function getTransactionCount(client, { address, blockTag = 'latest', blockNumber }) {\n const count = await client.request({\n method: 'eth_getTransactionCount',\n params: [address, blockNumber ? numberToHex(blockNumber) : blockTag],\n });\n return hexToNumber(count);\n}\n//# sourceMappingURL=getTransactionCount.js.map","import { parseAccount } from '../../accounts/utils/parseAccount.js';\nimport { estimateGas, } from '../../actions/public/estimateGas.js';\nimport { getBlock } from '../../actions/public/getBlock.js';\nimport { getGasPrice } from '../../actions/public/getGasPrice.js';\nimport { getTransactionCount } from '../../actions/public/getTransactionCount.js';\nimport { AccountNotFoundError } from '../../errors/account.js';\nimport { BaseError } from '../../errors/base.js';\nimport { assertRequest } from './assertRequest.js';\nexport async function prepareRequest(client, args) {\n const { account: account_, chain = client.chain, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, } = args;\n if (!account_)\n throw new AccountNotFoundError();\n const account = parseAccount(account_);\n const block = await getBlock(client, { blockTag: 'latest' });\n const request = { ...args, from: account.address };\n if (typeof nonce === 'undefined')\n request.nonce = await getTransactionCount(client, {\n address: account.address,\n blockTag: 'pending',\n });\n if (typeof block.baseFeePerGas === 'bigint' &&\n typeof gasPrice === 'undefined') {\n let defaultPriorityFee = 1500000000n; // 1.5 gwei\n if (typeof chain?.fees?.defaultPriorityFee !== 'undefined') {\n defaultPriorityFee =\n typeof chain.fees.defaultPriorityFee === 'bigint'\n ? chain.fees.defaultPriorityFee\n : await chain.fees.defaultPriorityFee({\n block,\n request: request,\n });\n }\n // EIP-1559 fees\n if (typeof maxFeePerGas === 'undefined') {\n // Set a buffer of 1.2x on top of the base fee to account for fluctuations.\n request.maxPriorityFeePerGas = maxPriorityFeePerGas ?? defaultPriorityFee;\n request.maxFeePerGas =\n (block.baseFeePerGas * 120n) / 100n + request.maxPriorityFeePerGas;\n }\n else {\n if (typeof maxPriorityFeePerGas === 'undefined' &&\n maxFeePerGas < defaultPriorityFee)\n throw new BaseError('`maxFeePerGas` cannot be less than the default `maxPriorityFeePerGas` (1.5 gwei).');\n request.maxFeePerGas = maxFeePerGas;\n request.maxPriorityFeePerGas = maxPriorityFeePerGas ?? defaultPriorityFee;\n }\n }\n else if (typeof gasPrice === 'undefined') {\n // Legacy fees\n if (typeof maxFeePerGas !== 'undefined' ||\n typeof maxPriorityFeePerGas !== 'undefined')\n throw new BaseError('Chain does not support EIP-1559 fees.');\n // Set a buffer of 1.2x on top of the base fee to account for fluctuations.\n request.gasPrice = ((await getGasPrice(client)) * 120n) / 100n;\n }\n if (typeof gas === 'undefined')\n request.gas = await estimateGas(client, {\n ...request,\n account: { address: account.address, type: 'json-rpc' },\n });\n assertRequest(request);\n return request;\n}\n//# sourceMappingURL=prepareRequest.js.map","import { parseAccount } from '../../accounts/utils/parseAccount.js';\nimport { AccountNotFoundError } from '../../errors/account.js';\nimport { numberToHex } from '../../utils/encoding/toHex.js';\nimport { getEstimateGasError } from '../../utils/errors/getEstimateGasError.js';\nimport { extract } from '../../utils/formatters/extract.js';\nimport { formatTransactionRequest, } from '../../utils/formatters/transactionRequest.js';\nimport { assertRequest, } from '../../utils/transaction/assertRequest.js';\nimport { prepareRequest, } from '../../utils/transaction/prepareRequest.js';\n/**\n * Estimates the gas necessary to complete a transaction without submitting it to the network.\n *\n * - Docs: https://viem.sh/docs/actions/public/estimateGas.html\n * - JSON-RPC Methods: [`eth_estimateGas`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_estimategas)\n *\n * @param client - Client to use\n * @param parameters - {@link EstimateGasParameters}\n * @returns The gas estimate (in wei). {@link EstimateGasReturnType}\n *\n * @example\n * import { createPublicClient, http, parseEther } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { estimateGas } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const gasEstimate = await estimateGas(client, {\n * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',\n * value: parseEther('1'),\n * })\n */\nexport async function estimateGas(client, args) {\n const account_ = args.account ?? client.account;\n if (!account_)\n throw new AccountNotFoundError({\n docsPath: '/docs/actions/public/estimateGas',\n });\n const account = parseAccount(account_);\n try {\n const { accessList, blockNumber, blockTag, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, ...rest } = account.type === 'local'\n ? (await prepareRequest(client, args))\n : args;\n const blockNumberHex = blockNumber ? numberToHex(blockNumber) : undefined;\n const block = blockNumberHex || blockTag;\n assertRequest(args);\n const format = client.chain?.formatters?.transactionRequest?.format ||\n formatTransactionRequest;\n const request = format({\n // Pick out extra data that might exist on the chain's transaction request type.\n ...extract(rest, { format }),\n from: account.address,\n accessList,\n data,\n gas,\n gasPrice,\n maxFeePerGas,\n maxPriorityFeePerGas,\n nonce,\n to,\n value,\n });\n const balance = await client.request({\n method: 'eth_estimateGas',\n params: block ? [request, block] : [request],\n });\n return BigInt(balance);\n }\n catch (err) {\n throw getEstimateGasError(err, {\n ...args,\n account,\n chain: client.chain,\n });\n }\n}\n//# sourceMappingURL=estimateGas.js.map","import { parseAccount } from '../../accounts/utils/parseAccount.js';\nimport { encodeFunctionData, } from '../../utils/abi/encodeFunctionData.js';\nimport { getContractError } from '../../utils/errors/getContractError.js';\nimport { estimateGas } from './estimateGas.js';\n/**\n * Estimates the gas required to successfully execute a contract write function call.\n *\n * - Docs: https://viem.sh/docs/contract/estimateContractGas.html\n *\n * Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`estimateGas` action](https://viem.sh/docs/actions/public/estimateGas.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html).\n *\n * @param client - Client to use\n * @param parameters - {@link EstimateContractGasParameters}\n * @returns The gas estimate (in wei). {@link EstimateContractGasReturnType}\n *\n * @example\n * import { createPublicClient, http, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { estimateContractGas } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const gas = await estimateContractGas(client, {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * abi: parseAbi(['function mint() public']),\n * functionName: 'mint',\n * account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',\n * })\n */\nexport async function estimateContractGas(client, { abi, address, args, functionName, ...request }) {\n const data = encodeFunctionData({\n abi,\n args,\n functionName,\n });\n try {\n const gas = await estimateGas(client, {\n data,\n to: address,\n ...request,\n });\n return gas;\n }\n catch (err) {\n const account = request.account ? parseAccount(request.account) : undefined;\n throw getContractError(err, {\n abi: abi,\n address,\n args,\n docsPath: '/docs/contract/estimateContractGas',\n functionName,\n sender: account?.address,\n });\n }\n}\n//# sourceMappingURL=estimateContractGas.js.map","import { AbiFunctionNotFoundError, AbiFunctionOutputsNotFoundError, } from '../../errors/abi.js';\nimport { decodeAbiParameters } from './decodeAbiParameters.js';\nimport { getAbiItem } from './getAbiItem.js';\nconst docsPath = '/docs/contract/decodeFunctionResult';\nexport function decodeFunctionResult({ abi, args, functionName, data, }) {\n let abiItem = abi[0];\n if (functionName) {\n abiItem = getAbiItem({\n abi,\n args,\n name: functionName,\n });\n if (!abiItem)\n throw new AbiFunctionNotFoundError(functionName, { docsPath });\n }\n if (abiItem.type !== 'function')\n throw new AbiFunctionNotFoundError(undefined, { docsPath });\n if (!abiItem.outputs)\n throw new AbiFunctionOutputsNotFoundError(abiItem.name, { docsPath });\n const values = decodeAbiParameters(abiItem.outputs, data);\n if (values && values.length > 1)\n return values;\n if (values && values.length === 1)\n return values[0];\n return undefined;\n}\n//# sourceMappingURL=decodeFunctionResult.js.map","/* [Multicall3](https://github.com/mds1/multicall) */\nexport const multicall3Abi = [\n {\n inputs: [\n {\n components: [\n {\n name: 'target',\n type: 'address',\n },\n {\n name: 'allowFailure',\n type: 'bool',\n },\n {\n name: 'callData',\n type: 'bytes',\n },\n ],\n name: 'calls',\n type: 'tuple[]',\n },\n ],\n name: 'aggregate3',\n outputs: [\n {\n components: [\n {\n name: 'success',\n type: 'bool',\n },\n {\n name: 'returnData',\n type: 'bytes',\n },\n ],\n name: 'returnData',\n type: 'tuple[]',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n];\nconst universalResolverErrors = [\n {\n inputs: [],\n name: 'ResolverNotFound',\n type: 'error',\n },\n {\n inputs: [],\n name: 'ResolverWildcardNotSupported',\n type: 'error',\n },\n];\nexport const universalResolverResolveAbi = [\n ...universalResolverErrors,\n {\n name: 'resolve',\n type: 'function',\n stateMutability: 'view',\n inputs: [\n { name: 'name', type: 'bytes' },\n { name: 'data', type: 'bytes' },\n ],\n outputs: [\n { name: '', type: 'bytes' },\n { name: 'address', type: 'address' },\n ],\n },\n];\nexport const universalResolverReverseAbi = [\n ...universalResolverErrors,\n {\n name: 'reverse',\n type: 'function',\n stateMutability: 'view',\n inputs: [{ type: 'bytes', name: 'reverseName' }],\n outputs: [\n { type: 'string', name: 'resolvedName' },\n { type: 'address', name: 'resolvedAddress' },\n { type: 'address', name: 'reverseResolver' },\n { type: 'address', name: 'resolver' },\n ],\n },\n];\nexport const textResolverAbi = [\n {\n name: 'text',\n type: 'function',\n stateMutability: 'view',\n inputs: [\n { name: 'name', type: 'bytes32' },\n { name: 'key', type: 'string' },\n ],\n outputs: [{ name: '', type: 'string' }],\n },\n];\nexport const addressResolverAbi = [\n {\n name: 'addr',\n type: 'function',\n stateMutability: 'view',\n inputs: [{ name: 'name', type: 'bytes32' }],\n outputs: [{ name: '', type: 'address' }],\n },\n {\n name: 'addr',\n type: 'function',\n stateMutability: 'view',\n inputs: [\n { name: 'name', type: 'bytes32' },\n { name: 'coinType', type: 'uint256' },\n ],\n outputs: [{ name: '', type: 'bytes' }],\n },\n];\n// ERC-1271\n// isValidSignature(bytes32 hash, bytes signature) → bytes4 magicValue\nexport const smartAccountAbi = [\n {\n name: 'isValidSignature',\n type: 'function',\n stateMutability: 'view',\n inputs: [\n { name: 'hash', type: 'bytes32' },\n { name: 'signature', type: 'bytes' },\n ],\n outputs: [{ name: '', type: 'bytes4' }],\n },\n];\n// ERC-6492 - universal deployless signature validator contract\n// constructor(address _signer, bytes32 _hash, bytes _signature) → bytes4 returnValue\n// returnValue is either 0x1 (valid) or 0x0 (invalid)\nexport const universalSignatureValidatorAbi = [\n {\n inputs: [\n {\n internalType: 'address',\n name: '_signer',\n type: 'address',\n },\n {\n internalType: 'bytes32',\n name: '_hash',\n type: 'bytes32',\n },\n {\n internalType: 'bytes',\n name: '_signature',\n type: 'bytes',\n },\n ],\n stateMutability: 'nonpayable',\n type: 'constructor',\n },\n];\n//# sourceMappingURL=abis.js.map","export const aggregate3Signature = '0x82ad56cb';\n//# sourceMappingURL=contract.js.map","import { BaseError } from './base.js';\nexport class ChainDoesNotSupportContract extends BaseError {\n constructor({ blockNumber, chain, contract, }) {\n super(`Chain \"${chain.name}\" does not support contract \"${contract.name}\".`, {\n metaMessages: [\n 'This could be due to any of the following:',\n ...(blockNumber &&\n contract.blockCreated &&\n contract.blockCreated > blockNumber\n ? [\n `- The contract \"${contract.name}\" was not deployed until block ${contract.blockCreated} (current block ${blockNumber}).`,\n ]\n : [\n `- The chain does not have the contract \"${contract.name}\" configured.`,\n ]),\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ChainDoesNotSupportContract'\n });\n }\n}\nexport class ChainMismatchError extends BaseError {\n constructor({ chain, currentChainId, }) {\n super(`The current chain of the wallet (id: ${currentChainId}) does not match the target chain for the transaction (id: ${chain.id} – ${chain.name}).`, {\n metaMessages: [\n `Current Chain ID: ${currentChainId}`,\n `Expected Chain ID: ${chain.id} – ${chain.name}`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ChainMismatchError'\n });\n }\n}\nexport class ChainNotFoundError extends BaseError {\n constructor() {\n super([\n 'No chain was provided to the request.',\n 'Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient.',\n ].join('\\n'));\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ChainNotFoundError'\n });\n }\n}\nexport class ClientChainNotConfiguredError extends BaseError {\n constructor() {\n super('No chain was provided to the Client.');\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ClientChainNotConfiguredError'\n });\n }\n}\nexport class InvalidChainIdError extends BaseError {\n constructor({ chainId }) {\n super(`Chain ID \"${chainId}\" is invalid.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidChainIdError'\n });\n }\n}\n//# sourceMappingURL=chain.js.map","import { ChainDoesNotSupportContract, ChainMismatchError, ChainNotFoundError, } from '../errors/chain.js';\nexport function assertCurrentChain({ chain, currentChainId, }) {\n if (!chain)\n throw new ChainNotFoundError();\n if (currentChainId !== chain.id)\n throw new ChainMismatchError({ chain, currentChainId });\n}\nexport function defineChain(chain, config = {}) {\n const { fees = chain.fees, formatters = chain.formatters, serializers = chain.serializers, } = config;\n return {\n ...chain,\n fees,\n formatters,\n serializers,\n };\n}\nexport function getChainContractAddress({ blockNumber, chain, contract: name, }) {\n const contract = chain?.contracts?.[name];\n if (!contract)\n throw new ChainDoesNotSupportContract({\n chain,\n contract: { name },\n });\n if (blockNumber &&\n contract.blockCreated &&\n contract.blockCreated > blockNumber)\n throw new ChainDoesNotSupportContract({\n blockNumber,\n chain,\n contract: {\n name,\n blockCreated: contract.blockCreated,\n },\n });\n return contract.address;\n}\n//# sourceMappingURL=chain.js.map","import { CallExecutionError } from '../../errors/contract.js';\nimport { containsNodeError, getNodeError, } from './getNodeError.js';\nexport function getCallError(err, { docsPath, ...args }) {\n let cause = err;\n if (containsNodeError(err))\n cause = getNodeError(err, args);\n return new CallExecutionError(cause, {\n docsPath,\n ...args,\n });\n}\n//# sourceMappingURL=getCallError.js.map","const schedulerCache = /*#__PURE__*/ new Map();\nexport function createBatchScheduler({ fn, id, shouldSplitBatch, wait = 0, }) {\n const exec = async () => {\n const scheduler = getScheduler();\n flush();\n const args = scheduler.map(({ args }) => args);\n if (args.length === 0)\n return;\n fn(args)\n .then((data) => {\n scheduler.forEach(({ pendingPromise }, i) => pendingPromise.resolve?.([data[i], data]));\n })\n .catch((err) => {\n scheduler.forEach(({ pendingPromise }) => pendingPromise.reject?.(err));\n });\n };\n const flush = () => schedulerCache.delete(id);\n const getBatchedArgs = () => getScheduler().map(({ args }) => args);\n const getScheduler = () => schedulerCache.get(id) || [];\n const setScheduler = (item) => schedulerCache.set(id, [...getScheduler(), item]);\n return {\n flush,\n async schedule(args) {\n const pendingPromise = {};\n const promise = new Promise((resolve, reject) => {\n pendingPromise.resolve = resolve;\n pendingPromise.reject = reject;\n });\n const split = shouldSplitBatch?.([...getBatchedArgs(), args]);\n if (split)\n exec();\n const hasActiveScheduler = getScheduler().length > 0;\n if (hasActiveScheduler) {\n setScheduler({ args, pendingPromise });\n return promise;\n }\n setScheduler({ args, pendingPromise });\n setTimeout(exec, wait);\n return promise;\n },\n };\n}\n//# sourceMappingURL=createBatchScheduler.js.map","import { parseAccount } from '../../accounts/utils/parseAccount.js';\nimport { multicall3Abi } from '../../constants/abis.js';\nimport { aggregate3Signature } from '../../constants/contract.js';\nimport { BaseError } from '../../errors/base.js';\nimport { ChainDoesNotSupportContract, ClientChainNotConfiguredError, } from '../../errors/chain.js';\nimport { RawContractError } from '../../errors/contract.js';\nimport { decodeFunctionResult } from '../../utils/abi/decodeFunctionResult.js';\nimport { encodeFunctionData } from '../../utils/abi/encodeFunctionData.js';\nimport { getChainContractAddress } from '../../utils/chain.js';\nimport { numberToHex } from '../../utils/encoding/toHex.js';\nimport { getCallError } from '../../utils/errors/getCallError.js';\nimport { extract } from '../../utils/formatters/extract.js';\nimport { formatTransactionRequest, } from '../../utils/formatters/transactionRequest.js';\nimport { createBatchScheduler } from '../../utils/promise/createBatchScheduler.js';\nimport { assertRequest } from '../../utils/transaction/assertRequest.js';\n/**\n * Executes a new message call immediately without submitting a transaction to the network.\n *\n * - Docs: https://viem.sh/docs/actions/public/call.html\n * - JSON-RPC Methods: [`eth_call`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_call)\n *\n * @param client - Client to use\n * @param parameters - {@link CallParameters}\n * @returns The call data. {@link CallReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { call } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const data = await call(client, {\n * account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',\n * data: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',\n * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',\n * })\n */\nexport async function call(client, args) {\n const { account: account_, batch = Boolean(client.batch?.multicall), blockNumber, blockTag = 'latest', accessList, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, ...rest } = args;\n const account = account_ ? parseAccount(account_) : undefined;\n try {\n assertRequest(args);\n const blockNumberHex = blockNumber ? numberToHex(blockNumber) : undefined;\n const block = blockNumberHex || blockTag;\n const format = client.chain?.formatters?.transactionRequest?.format ||\n formatTransactionRequest;\n const request = format({\n // Pick out extra data that might exist on the chain's transaction request type.\n ...extract(rest, { format }),\n from: account?.address,\n accessList,\n data,\n gas,\n gasPrice,\n maxFeePerGas,\n maxPriorityFeePerGas,\n nonce,\n to,\n value,\n });\n if (batch && shouldPerformMulticall({ request })) {\n try {\n return await scheduleMulticall(client, {\n ...request,\n blockNumber,\n blockTag,\n });\n }\n catch (err) {\n if (!(err instanceof ClientChainNotConfiguredError) &&\n !(err instanceof ChainDoesNotSupportContract))\n throw err;\n }\n }\n const response = await client.request({\n method: 'eth_call',\n params: block\n ? [request, block]\n : [request],\n });\n if (response === '0x')\n return { data: undefined };\n return { data: response };\n }\n catch (err) {\n const data = getRevertErrorData(err);\n const { offchainLookup, offchainLookupSignature } = await import('../../utils/ccip.js');\n if (data?.slice(0, 10) === offchainLookupSignature && to) {\n return { data: await offchainLookup(client, { data, to }) };\n }\n throw getCallError(err, {\n ...args,\n account,\n chain: client.chain,\n });\n }\n}\n// We only want to perform a scheduled multicall if:\n// - The request has calldata,\n// - The request has a target address,\n// - The target address is not already the aggregate3 signature,\n// - The request has no other properties (`nonce`, `gas`, etc cannot be sent with a multicall).\nfunction shouldPerformMulticall({ request }) {\n const { data, to, ...request_ } = request;\n if (!data)\n return false;\n if (data.startsWith(aggregate3Signature))\n return false;\n if (!to)\n return false;\n if (Object.values(request_).filter((x) => typeof x !== 'undefined').length > 0)\n return false;\n return true;\n}\nasync function scheduleMulticall(client, args) {\n const { batchSize = 1024, wait = 0 } = typeof client.batch?.multicall === 'object' ? client.batch.multicall : {};\n const { blockNumber, blockTag = 'latest', data, multicallAddress: multicallAddress_, to, } = args;\n let multicallAddress = multicallAddress_;\n if (!multicallAddress) {\n if (!client.chain)\n throw new ClientChainNotConfiguredError();\n multicallAddress = getChainContractAddress({\n blockNumber,\n chain: client.chain,\n contract: 'multicall3',\n });\n }\n const blockNumberHex = blockNumber ? numberToHex(blockNumber) : undefined;\n const block = blockNumberHex || blockTag;\n const { schedule } = createBatchScheduler({\n id: `${client.uid}.${block}`,\n wait,\n shouldSplitBatch(args) {\n const size = args.reduce((size, { data }) => size + (data.length - 2), 0);\n return size > batchSize * 2;\n },\n fn: async (requests) => {\n const calls = requests.map((request) => ({\n allowFailure: true,\n callData: request.data,\n target: request.to,\n }));\n const calldata = encodeFunctionData({\n abi: multicall3Abi,\n args: [calls],\n functionName: 'aggregate3',\n });\n const data = await client.request({\n method: 'eth_call',\n params: [\n {\n data: calldata,\n to: multicallAddress,\n },\n block,\n ],\n });\n return decodeFunctionResult({\n abi: multicall3Abi,\n args: [calls],\n functionName: 'aggregate3',\n data: data || '0x',\n });\n },\n });\n const [{ returnData, success }] = await schedule({ data, to });\n if (!success)\n throw new RawContractError({ data: returnData });\n if (returnData === '0x')\n return { data: undefined };\n return { data: returnData };\n}\nexport function getRevertErrorData(err) {\n if (!(err instanceof BaseError))\n return undefined;\n const error = err.walk();\n return typeof error.data === 'object' ? error.data.data : error.data;\n}\n//# sourceMappingURL=call.js.map","import { decodeFunctionResult, } from '../../utils/abi/decodeFunctionResult.js';\nimport { encodeFunctionData, } from '../../utils/abi/encodeFunctionData.js';\nimport { getContractError } from '../../utils/errors/getContractError.js';\nimport { call } from './call.js';\n/**\n * Calls a read-only function on a contract, and returns the response.\n *\n * - Docs: https://viem.sh/docs/contract/readContract.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/reading-contracts\n *\n * A \"read-only\" function (constant function) on a Solidity contract is denoted by a `view` or `pure` keyword. They can only read the state of the contract, and cannot make any changes to it. Since read-only methods do not change the state of the contract, they do not require any gas to be executed, and can be called by any user without the need to pay for gas.\n *\n * Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`call` action](https://viem.sh/docs/actions/public/call.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html).\n *\n * @param client - Client to use\n * @param parameters - {@link ReadContractParameters}\n * @returns The response from the contract. Type is inferred. {@link ReadContractReturnType}\n *\n * @example\n * import { createPublicClient, http, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { readContract } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const result = await readContract(client, {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * abi: parseAbi(['function balanceOf(address) view returns (uint256)']),\n * functionName: 'balanceOf',\n * args: ['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'],\n * })\n * // 424122n\n */\nexport async function readContract(client, { abi, address, args, functionName, ...callRequest }) {\n const calldata = encodeFunctionData({\n abi,\n args,\n functionName,\n });\n try {\n const { data } = await call(client, {\n data: calldata,\n to: address,\n ...callRequest,\n });\n return decodeFunctionResult({\n abi,\n args,\n functionName,\n data: data || '0x',\n });\n }\n catch (err) {\n throw getContractError(err, {\n abi: abi,\n address,\n args,\n docsPath: '/docs/contract/readContract',\n functionName,\n });\n }\n}\n//# sourceMappingURL=readContract.js.map","import { parseAccount } from '../../accounts/utils/parseAccount.js';\nimport { decodeFunctionResult, } from '../../utils/abi/decodeFunctionResult.js';\nimport { encodeFunctionData, } from '../../utils/abi/encodeFunctionData.js';\nimport { getContractError } from '../../utils/errors/getContractError.js';\nimport { call } from './call.js';\n/**\n * Simulates/validates a contract interaction. This is useful for retrieving **return data** and **revert reasons** of contract write functions.\n *\n * - Docs: https://viem.sh/docs/contract/simulateContract.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/writing-to-contracts\n *\n * This function does not require gas to execute and _**does not**_ change the state of the blockchain. It is almost identical to [`readContract`](https://viem.sh/docs/contract/readContract.html), but also supports contract write functions.\n *\n * Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`call` action](https://viem.sh/docs/actions/public/call.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html).\n *\n * @param client - Client to use\n * @param parameters - {@link SimulateContractParameters}\n * @returns The simulation result and write request. {@link SimulateContractReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { simulateContract } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const result = await simulateContract(client, {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * abi: parseAbi(['function mint(uint32) view returns (uint32)']),\n * functionName: 'mint',\n * args: ['69420'],\n * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * })\n */\nexport async function simulateContract(client, { abi, address, args, dataSuffix, functionName, ...callRequest }) {\n const account = callRequest.account\n ? parseAccount(callRequest.account)\n : undefined;\n const calldata = encodeFunctionData({\n abi,\n args,\n functionName,\n });\n try {\n const { data } = await call(client, {\n batch: false,\n data: `${calldata}${dataSuffix ? dataSuffix.replace('0x', '') : ''}`,\n to: address,\n ...callRequest,\n });\n const result = decodeFunctionResult({\n abi,\n args,\n functionName,\n data: data || '0x',\n });\n return {\n result,\n request: {\n abi,\n address,\n args,\n dataSuffix,\n functionName,\n ...callRequest,\n },\n };\n }\n catch (err) {\n throw getContractError(err, {\n abi: abi,\n address,\n args,\n docsPath: '/docs/contract/simulateContract',\n functionName,\n sender: account?.address,\n });\n }\n}\n//# sourceMappingURL=simulateContract.js.map","export const listenersCache = /*#__PURE__*/ new Map();\nexport const cleanupCache = /*#__PURE__*/ new Map();\nlet callbackCount = 0;\n/**\n * @description Sets up an observer for a given function. If another function\n * is set up under the same observer id, the function will only be called once\n * for both instances of the observer.\n */\nexport function observe(observerId, callbacks, fn) {\n const callbackId = ++callbackCount;\n const getListeners = () => listenersCache.get(observerId) || [];\n const unsubscribe = () => {\n const listeners = getListeners();\n listenersCache.set(observerId, listeners.filter((cb) => cb.id !== callbackId));\n };\n const unwatch = () => {\n const cleanup = cleanupCache.get(observerId);\n if (getListeners().length === 1 && cleanup)\n cleanup();\n unsubscribe();\n };\n const listeners = getListeners();\n listenersCache.set(observerId, [\n ...listeners,\n { id: callbackId, fns: callbacks },\n ]);\n if (listeners && listeners.length > 0)\n return unwatch;\n const emit = {};\n for (const key in callbacks) {\n emit[key] = ((...args) => {\n const listeners = getListeners();\n if (listeners.length === 0)\n return;\n listeners.forEach((listener) => listener.fns[key]?.(...args));\n });\n }\n const cleanup = fn(emit);\n if (typeof cleanup === 'function')\n cleanupCache.set(observerId, cleanup);\n return unwatch;\n}\n//# sourceMappingURL=observe.js.map","export async function wait(time) {\n return new Promise((res) => setTimeout(res, time));\n}\n//# sourceMappingURL=wait.js.map","import { wait } from './wait.js';\n/**\n * @description Polls a function at a specified interval.\n */\nexport function poll(fn, { emitOnBegin, initialWaitTime, interval }) {\n let active = true;\n const unwatch = () => (active = false);\n const watch = async () => {\n let data;\n if (emitOnBegin)\n data = await fn({ unpoll: unwatch });\n const initialWait = (await initialWaitTime?.(data)) ?? interval;\n await wait(initialWait);\n const poll = async () => {\n if (!active)\n return;\n await fn({ unpoll: unwatch });\n await wait(interval);\n poll();\n };\n poll();\n };\n watch();\n return unwatch;\n}\n//# sourceMappingURL=poll.js.map","export const promiseCache = /*#__PURE__*/ new Map();\nexport const responseCache = /*#__PURE__*/ new Map();\nexport function getCache(cacheKey) {\n const buildCache = (cacheKey, cache) => ({\n clear: () => cache.delete(cacheKey),\n get: () => cache.get(cacheKey),\n set: (data) => cache.set(cacheKey, data),\n });\n const promise = buildCache(cacheKey, promiseCache);\n const response = buildCache(cacheKey, responseCache);\n return {\n clear: () => {\n promise.clear();\n response.clear();\n },\n promise,\n response,\n };\n}\n/**\n * @description Returns the result of a given promise, and caches the result for\n * subsequent invocations against a provided cache key.\n */\nexport async function withCache(fn, { cacheKey, cacheTime = Infinity }) {\n const cache = getCache(cacheKey);\n // If a response exists in the cache, and it's not expired, return it\n // and do not invoke the promise.\n // If the max age is 0, the cache is disabled.\n const response = cache.response.get();\n if (response && cacheTime > 0) {\n const age = new Date().getTime() - response.created.getTime();\n if (age < cacheTime)\n return response.data;\n }\n let promise = cache.promise.get();\n if (!promise) {\n promise = fn();\n // Store the promise in the cache so that subsequent invocations\n // will wait for the same promise to resolve (deduping).\n cache.promise.set(promise);\n }\n try {\n const data = await promise;\n // Store the response in the cache so that subsequent invocations\n // will return the same response.\n cache.response.set({ created: new Date(), data });\n return data;\n }\n finally {\n // Clear the promise cache so that subsequent invocations will\n // invoke the promise again.\n cache.promise.clear();\n }\n}\n//# sourceMappingURL=withCache.js.map","import { getCache, withCache } from '../../utils/promise/withCache.js';\nconst cacheKey = (id) => `blockNumber.${id}`;\nexport function getBlockNumberCache(id) {\n return getCache(cacheKey(id));\n}\n/**\n * Returns the number of the most recent block seen.\n *\n * - Docs: https://viem.sh/docs/actions/public/getBlockNumber.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/fetching-blocks\n * - JSON-RPC Methods: [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber)\n *\n * @param client - Client to use\n * @param parameters - {@link GetBlockNumberParameters}\n * @returns The number of the block. {@link GetBlockNumberReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getBlockNumber } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const blockNumber = await getBlockNumber(client)\n * // 69420n\n */\nexport async function getBlockNumber(client, { cacheTime = client.cacheTime, maxAge } = {}) {\n const blockNumberHex = await withCache(() => client.request({\n method: 'eth_blockNumber',\n }), { cacheKey: cacheKey(client.uid), cacheTime: maxAge ?? cacheTime });\n return BigInt(blockNumberHex);\n}\n//# sourceMappingURL=getBlockNumber.js.map","import { AbiDecodingDataSizeTooSmallError, AbiEventSignatureEmptyTopicsError, AbiEventSignatureNotFoundError, DecodeLogDataMismatch, DecodeLogTopicsMismatch, } from '../../errors/abi.js';\nimport { getEventSelector } from '../hash/getEventSelector.js';\nimport { decodeAbiParameters } from './decodeAbiParameters.js';\nimport { formatAbiItem } from './formatAbiItem.js';\nconst docsPath = '/docs/contract/decodeEventLog';\nexport function decodeEventLog({ abi, data, strict: strict_, topics, }) {\n const strict = strict_ ?? true;\n const [signature, ...argTopics] = topics;\n if (!signature)\n throw new AbiEventSignatureEmptyTopicsError({\n docsPath,\n });\n const abiItem = abi.find((x) => x.type === 'event' &&\n signature === getEventSelector(formatAbiItem(x)));\n if (!(abiItem && 'name' in abiItem) || abiItem.type !== 'event')\n throw new AbiEventSignatureNotFoundError(signature, {\n docsPath,\n });\n const { name, inputs } = abiItem;\n const isUnnamed = inputs?.some((x) => !('name' in x && x.name));\n let args = isUnnamed ? [] : {};\n // Decode topics (indexed args).\n const indexedInputs = inputs.filter((x) => 'indexed' in x && x.indexed);\n if (argTopics.length > 0) {\n for (let i = 0; i < indexedInputs.length; i++) {\n const param = indexedInputs[i];\n const topic = argTopics[i];\n if (!topic)\n throw new DecodeLogTopicsMismatch({\n abiItem,\n param: param,\n });\n args[param.name || i] = decodeTopic({ param, value: topic });\n }\n }\n // Decode data (non-indexed args).\n const nonIndexedInputs = inputs.filter((x) => !('indexed' in x && x.indexed));\n if (nonIndexedInputs.length > 0) {\n if (data && data !== '0x') {\n try {\n const decodedData = decodeAbiParameters(nonIndexedInputs, data);\n if (decodedData) {\n if (isUnnamed)\n args = [...args, ...decodedData];\n else {\n for (let i = 0; i < nonIndexedInputs.length; i++) {\n args[nonIndexedInputs[i].name] = decodedData[i];\n }\n }\n }\n }\n catch (err) {\n if (strict) {\n if (err instanceof AbiDecodingDataSizeTooSmallError)\n throw new DecodeLogDataMismatch({\n abiItem,\n data: err.data,\n params: err.params,\n size: err.size,\n });\n throw err;\n }\n }\n }\n else if (strict) {\n throw new DecodeLogDataMismatch({\n abiItem,\n data: '0x',\n params: nonIndexedInputs,\n size: 0,\n });\n }\n }\n return {\n eventName: name,\n args: Object.values(args).length > 0 ? args : undefined,\n };\n}\nfunction decodeTopic({ param, value }) {\n if (param.type === 'string' ||\n param.type === 'bytes' ||\n param.type === 'tuple' ||\n param.type.match(/^(.*)\\[(\\d+)?\\]$/))\n return value;\n const decodedArg = decodeAbiParameters([param], value) || [];\n return decodedArg[0];\n}\n//# sourceMappingURL=decodeEventLog.js.map","export function formatLog(log, { args, eventName } = {}) {\n return {\n ...log,\n blockHash: log.blockHash ? log.blockHash : null,\n blockNumber: log.blockNumber ? BigInt(log.blockNumber) : null,\n logIndex: log.logIndex ? Number(log.logIndex) : null,\n transactionHash: log.transactionHash ? log.transactionHash : null,\n transactionIndex: log.transactionIndex\n ? Number(log.transactionIndex)\n : null,\n ...(eventName ? { args, eventName } : {}),\n };\n}\n//# sourceMappingURL=log.js.map","import { DecodeLogDataMismatch, DecodeLogTopicsMismatch, } from '../../errors/abi.js';\nimport { decodeEventLog } from '../../utils/abi/decodeEventLog.js';\nimport { formatLog } from '../../utils/formatters/log.js';\n/**\n * Returns a list of logs or hashes based on a [Filter](/docs/glossary/terms#filter) since the last time it was called.\n *\n * - Docs: https://viem.sh/docs/actions/public/getFilterChanges.html\n * - JSON-RPC Methods: [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges)\n *\n * A Filter can be created from the following actions:\n *\n * - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter.html)\n * - [`createContractEventFilter`](https://viem.sh/docs/contract/createContractEventFilter.html)\n * - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter.html)\n * - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter.html)\n *\n * Depending on the type of filter, the return value will be different:\n *\n * - If the filter was created with `createContractEventFilter` or `createEventFilter`, it returns a list of logs.\n * - If the filter was created with `createPendingTransactionFilter`, it returns a list of transaction hashes.\n * - If the filter was created with `createBlockFilter`, it returns a list of block hashes.\n *\n * @param client - Client to use\n * @param parameters - {@link GetFilterChangesParameters}\n * @returns Logs or hashes. {@link GetFilterChangesReturnType}\n *\n * @example\n * // Blocks\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createBlockFilter, getFilterChanges } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createBlockFilter(client)\n * const hashes = await getFilterChanges(client, { filter })\n *\n * @example\n * // Contract Events\n * import { createPublicClient, http, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createContractEventFilter, getFilterChanges } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createContractEventFilter(client, {\n * address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',\n * abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']),\n * eventName: 'Transfer',\n * })\n * const logs = await getFilterChanges(client, { filter })\n *\n * @example\n * // Raw Events\n * import { createPublicClient, http, parseAbiItem } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createEventFilter, getFilterChanges } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createEventFilter(client, {\n * address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',\n * event: parseAbiItem('event Transfer(address indexed, address indexed, uint256)'),\n * })\n * const logs = await getFilterChanges(client, { filter })\n *\n * @example\n * // Transactions\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createPendingTransactionFilter, getFilterChanges } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createPendingTransactionFilter(client)\n * const hashes = await getFilterChanges(client, { filter })\n */\nexport async function getFilterChanges(_client, { filter, }) {\n const strict = 'strict' in filter && filter.strict;\n const logs = await filter.request({\n method: 'eth_getFilterChanges',\n params: [filter.id],\n });\n return logs\n .map((log) => {\n if (typeof log === 'string')\n return log;\n try {\n const { eventName, args } = 'abi' in filter && filter.abi\n ? decodeEventLog({\n abi: filter.abi,\n data: log.data,\n topics: log.topics,\n strict,\n })\n : { eventName: undefined, args: undefined };\n return formatLog(log, { args, eventName });\n }\n catch (err) {\n let eventName;\n let isUnnamed;\n if (err instanceof DecodeLogDataMismatch ||\n err instanceof DecodeLogTopicsMismatch) {\n // If strict mode is on, and log data/topics do not match event definition, skip.\n if ('strict' in filter && filter.strict)\n return;\n eventName = err.abiItem.name;\n isUnnamed = err.abiItem.inputs?.some((x) => !('name' in x && x.name));\n }\n // Set args undefined if there is an error decoding (e.g. indexed/non-indexed params mismatch).\n return formatLog(log, { args: isUnnamed ? [] : {}, eventName });\n }\n })\n .filter(Boolean);\n}\n//# sourceMappingURL=getFilterChanges.js.map","import { DecodeLogDataMismatch, DecodeLogTopicsMismatch, } from '../../errors/abi.js';\nimport { decodeEventLog } from '../../utils/abi/decodeEventLog.js';\nimport { encodeEventTopics, } from '../../utils/abi/encodeEventTopics.js';\nimport { numberToHex } from '../../utils/encoding/toHex.js';\nimport { formatLog } from '../../utils/formatters/log.js';\n/**\n * Returns a list of event logs matching the provided parameters.\n *\n * - Docs: https://viem.sh/docs/actions/public/getLogs.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/filters-and-logs/event-logs\n * - JSON-RPC Methods: [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs)\n *\n * @param client - Client to use\n * @param parameters - {@link GetLogsParameters}\n * @returns A list of event logs. {@link GetLogsReturnType}\n *\n * @example\n * import { createPublicClient, http, parseAbiItem } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getLogs } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const logs = await getLogs(client)\n */\nexport async function getLogs(client, { address, blockHash, fromBlock, toBlock, event, events: events_, args, strict: strict_, } = {}) {\n const strict = strict_ ?? false;\n const events = events_ ?? (event ? [event] : undefined);\n let topics = [];\n if (events) {\n topics = [\n events.flatMap((event) => encodeEventTopics({\n abi: [event],\n eventName: event.name,\n args,\n })),\n ];\n if (event)\n topics = topics[0];\n }\n let logs;\n if (blockHash) {\n logs = await client.request({\n method: 'eth_getLogs',\n params: [{ address, topics, blockHash }],\n });\n }\n else {\n logs = await client.request({\n method: 'eth_getLogs',\n params: [\n {\n address,\n topics,\n fromBlock: typeof fromBlock === 'bigint' ? numberToHex(fromBlock) : fromBlock,\n toBlock: typeof toBlock === 'bigint' ? numberToHex(toBlock) : toBlock,\n },\n ],\n });\n }\n return logs\n .map((log) => {\n try {\n const { eventName, args } = events\n ? decodeEventLog({\n abi: events,\n data: log.data,\n topics: log.topics,\n strict,\n })\n : { eventName: undefined, args: undefined };\n return formatLog(log, { args, eventName: eventName });\n }\n catch (err) {\n let eventName;\n let isUnnamed;\n if (err instanceof DecodeLogDataMismatch ||\n err instanceof DecodeLogTopicsMismatch) {\n // If strict mode is on, and log data/topics do not match event definition, skip.\n if (strict)\n return;\n eventName = err.abiItem.name;\n isUnnamed = err.abiItem.inputs?.some((x) => !('name' in x && x.name));\n }\n // Set args to empty if there is an error decoding (e.g. indexed/non-indexed params mismatch).\n return formatLog(log, { args: isUnnamed ? [] : {}, eventName });\n }\n })\n .filter(Boolean);\n}\n//# sourceMappingURL=getLogs.js.map","/**\n * Destroys a [`Filter`](https://viem.sh/docs/glossary/types.html#filter).\n *\n * - Docs: https://viem.sh/docs/actions/public/uninstallFilter.html\n * - JSON-RPC Methods: [`eth_uninstallFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_uninstallFilter)\n *\n * Destroys a Filter that was created from one of the following Actions:\n * - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter.html)\n * - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter.html)\n * - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter.html)\n *\n * @param client - Client to use\n * @param parameters - {@link UninstallFilterParameters}\n * @returns A boolean indicating if the Filter was successfully uninstalled. {@link UninstallFilterReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createPendingTransactionFilter, uninstallFilter } from 'viem/public'\n *\n * const filter = await createPendingTransactionFilter(client)\n * const uninstalled = await uninstallFilter(client, { filter })\n * // true\n */\nexport async function uninstallFilter(_client, { filter }) {\n return filter.request({\n method: 'eth_uninstallFilter',\n params: [filter.id],\n });\n}\n//# sourceMappingURL=uninstallFilter.js.map","import { getAbiItem, } from '../../utils/abi/getAbiItem.js';\nimport { observe } from '../../utils/observe.js';\nimport { poll } from '../../utils/poll.js';\nimport { stringify } from '../../utils/stringify.js';\nimport { DecodeLogDataMismatch } from '../../errors/abi.js';\nimport { DecodeLogTopicsMismatch, InvalidInputRpcError, decodeEventLog, encodeEventTopics, formatLog, } from '../../index.js';\nimport { createContractEventFilter, } from './createContractEventFilter.js';\nimport { getBlockNumber } from './getBlockNumber.js';\nimport { getFilterChanges } from './getFilterChanges.js';\nimport { getLogs } from './getLogs.js';\nimport { uninstallFilter } from './uninstallFilter.js';\n/**\n * Watches and returns emitted contract event logs.\n *\n * - Docs: https://viem.sh/docs/contract/watchContractEvent.html\n *\n * This Action will batch up all the event logs found within the [`pollingInterval`](https://viem.sh/docs/contract/watchContractEvent.html#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/contract/watchContractEvent.html#onLogs).\n *\n * `watchContractEvent` will attempt to create an [Event Filter](https://viem.sh/docs/contract/createContractEventFilter.html) and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. `eth_newFilter`), then `watchContractEvent` will fall back to using [`getLogs`](https://viem.sh/docs/actions/public/getLogs) instead.\n *\n * @param client - Client to use\n * @param parameters - {@link WatchContractEventParameters}\n * @returns A function that can be invoked to stop watching for new event logs. {@link WatchContractEventReturnType}\n *\n * @example\n * import { createPublicClient, http, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { watchContractEvent } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const unwatch = watchContractEvent(client, {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * abi: parseAbi(['event Transfer(address indexed from, address indexed to, uint256 value)']),\n * eventName: 'Transfer',\n * args: { from: '0xc961145a54C96E3aE9bAA048c4F4D6b04C13916b' },\n * onLogs: (logs) => console.log(logs),\n * })\n */\nexport function watchContractEvent(client, { abi, address, args, batch = true, eventName, onError, onLogs, poll: poll_, pollingInterval = client.pollingInterval, strict: strict_, }) {\n const enablePolling = typeof poll_ !== 'undefined' ? poll_ : client.transport.type !== 'webSocket';\n const pollContractEvent = () => {\n const observerId = stringify([\n 'watchContractEvent',\n address,\n args,\n batch,\n client.uid,\n eventName,\n pollingInterval,\n ]);\n const strict = strict_ ?? false;\n return observe(observerId, { onLogs, onError }, (emit) => {\n let previousBlockNumber;\n let filter;\n let initialized = false;\n const unwatch = poll(async () => {\n if (!initialized) {\n try {\n filter = (await createContractEventFilter(client, {\n abi,\n address,\n args,\n eventName,\n strict,\n }));\n }\n catch { }\n initialized = true;\n return;\n }\n try {\n let logs;\n if (filter) {\n logs = await getFilterChanges(client, { filter });\n }\n else {\n // If the filter doesn't exist, we will fall back to use `getLogs`.\n // The fall back exists because some RPC Providers do not support filters.\n // Fetch the block number to use for `getLogs`.\n const blockNumber = await getBlockNumber(client);\n // If the block number has changed, we will need to fetch the logs.\n // If the block number doesn't exist, we are yet to reach the first poll interval,\n // so do not emit any logs.\n if (previousBlockNumber && previousBlockNumber !== blockNumber) {\n logs = await getLogs(client, {\n address,\n args,\n fromBlock: previousBlockNumber + 1n,\n toBlock: blockNumber,\n event: getAbiItem({\n abi,\n name: eventName,\n }),\n });\n }\n else {\n logs = [];\n }\n previousBlockNumber = blockNumber;\n }\n if (logs.length === 0)\n return;\n if (batch)\n emit.onLogs(logs);\n else\n logs.forEach((log) => emit.onLogs([log]));\n }\n catch (err) {\n // If a filter has been set and gets uninstalled, providers will throw an InvalidInput error.\n // Reinitalize the filter when this occurs\n if (filter && err instanceof InvalidInputRpcError)\n initialized = false;\n emit.onError?.(err);\n }\n }, {\n emitOnBegin: true,\n interval: pollingInterval,\n });\n return async () => {\n if (filter)\n await uninstallFilter(client, { filter });\n unwatch();\n };\n });\n };\n const subscribeContractEvent = () => {\n let active = true;\n let unsubscribe = () => (active = false);\n (async () => {\n try {\n const topics = eventName\n ? encodeEventTopics({\n abi: abi,\n eventName: eventName,\n args,\n })\n : [];\n const { unsubscribe: unsubscribe_ } = await client.transport.subscribe({\n params: ['logs', { address, topics }],\n onData(data) {\n if (!active)\n return;\n const log = data.result;\n try {\n const { eventName, args } = decodeEventLog({\n abi: abi,\n data: log.data,\n topics: log.topics,\n strict: strict_,\n });\n const formatted = formatLog(log, {\n args,\n eventName: eventName,\n });\n onLogs([formatted]);\n }\n catch (err) {\n let eventName;\n let isUnnamed;\n if (err instanceof DecodeLogDataMismatch ||\n err instanceof DecodeLogTopicsMismatch) {\n // If strict mode is on, and log data/topics do not match event definition, skip.\n if (strict_)\n return;\n eventName = err.abiItem.name;\n isUnnamed = err.abiItem.inputs?.some((x) => !('name' in x && x.name));\n }\n // Set args to empty if there is an error decoding (e.g. indexed/non-indexed params mismatch).\n const formatted = formatLog(log, {\n args: isUnnamed ? [] : {},\n eventName,\n });\n onLogs([formatted]);\n }\n },\n onError(error) {\n onError?.(error);\n },\n });\n unsubscribe = unsubscribe_;\n if (!active)\n unsubscribe();\n }\n catch (err) {\n onError?.(err);\n }\n })();\n return unsubscribe;\n };\n return enablePolling ? pollContractEvent() : subscribeContractEvent();\n}\n//# sourceMappingURL=watchContractEvent.js.map","import { TransactionExecutionError } from '../../errors/transaction.js';\nimport { containsNodeError, getNodeError, } from './getNodeError.js';\nexport function getTransactionError(err, { docsPath, ...args }) {\n let cause = err;\n if (containsNodeError(err))\n cause = getNodeError(err, args);\n return new TransactionExecutionError(cause, {\n docsPath,\n ...args,\n });\n}\n//# sourceMappingURL=getTransactionError.js.map","import { hexToNumber } from '../../utils/encoding/fromHex.js';\n/**\n * Returns the chain ID associated with the current network.\n *\n * - Docs: https://viem.sh/docs/actions/public/getChainId.html\n * - JSON-RPC Methods: [`eth_chainId`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_chainid)\n *\n * @param client - Client to use\n * @returns The current chain ID. {@link GetChainIdReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getChainId } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const chainId = await getChainId(client)\n * // 1\n */\nexport async function getChainId(client) {\n const chainIdHex = await client.request({\n method: 'eth_chainId',\n });\n return hexToNumber(chainIdHex);\n}\n//# sourceMappingURL=getChainId.js.map","import { parseAccount } from '../../accounts/utils/parseAccount.js';\nimport { AccountNotFoundError } from '../../errors/account.js';\nimport { assertCurrentChain } from '../../utils/chain.js';\nimport { getTransactionError } from '../../utils/errors/getTransactionError.js';\nimport { extract } from '../../utils/formatters/extract.js';\nimport { formatTransactionRequest, } from '../../utils/formatters/transactionRequest.js';\nimport { assertRequest, } from '../../utils/transaction/assertRequest.js';\nimport { prepareRequest } from '../../utils/transaction/prepareRequest.js';\nimport { getChainId } from '../public/getChainId.js';\n/**\n * Creates, signs, and sends a new transaction to the network.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/sendTransaction.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/sending-transactions\n * - JSON-RPC Methods:\n * - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction)\n * - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction)\n *\n * @param client - Client to use\n * @param parameters - {@link SendTransactionParameters}\n * @returns The [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) hash. {@link SendTransactionReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { sendTransaction } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n * const hash = await sendTransaction(client, {\n * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',\n * value: 1000000000000000000n,\n * })\n *\n * @example\n * // Account Hoisting\n * import { createWalletClient, http } from 'viem'\n * import { privateKeyToAccount } from 'viem/accounts'\n * import { mainnet } from 'viem/chains'\n * import { sendTransaction } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * account: privateKeyToAccount('0x…'),\n * chain: mainnet,\n * transport: http(),\n * })\n * const hash = await sendTransaction(client, {\n * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',\n * value: 1000000000000000000n,\n * })\n */\nexport async function sendTransaction(client, args) {\n const { account: account_ = client.account, chain = client.chain, accessList, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, ...rest } = args;\n if (!account_)\n throw new AccountNotFoundError({\n docsPath: '/docs/actions/wallet/sendTransaction',\n });\n const account = parseAccount(account_);\n try {\n assertRequest(args);\n let chainId;\n if (chain !== null) {\n chainId = await getChainId(client);\n assertCurrentChain({\n currentChainId: chainId,\n chain,\n });\n }\n if (account.type === 'local') {\n // Prepare the request for signing (assign appropriate fees, etc.)\n const request = await prepareRequest(client, {\n account,\n accessList,\n chain,\n data,\n gas,\n gasPrice,\n maxFeePerGas,\n maxPriorityFeePerGas,\n nonce,\n to,\n value,\n ...rest,\n });\n if (!chainId)\n chainId = await getChainId(client);\n const serializer = chain?.serializers?.transaction;\n const signedRequest = (await account.signTransaction({\n ...request,\n chainId,\n }, { serializer }));\n return await client.request({\n method: 'eth_sendRawTransaction',\n params: [signedRequest],\n });\n }\n const format = chain?.formatters?.transactionRequest?.format || formatTransactionRequest;\n const request = format({\n // Pick out extra data that might exist on the chain's transaction request type.\n ...extract(rest, { format }),\n accessList,\n data,\n from: account.address,\n gas,\n gasPrice,\n maxFeePerGas,\n maxPriorityFeePerGas,\n nonce,\n to,\n value,\n });\n return await client.request({\n method: 'eth_sendTransaction',\n params: [request],\n });\n }\n catch (err) {\n throw getTransactionError(err, {\n ...args,\n account,\n chain: args.chain || undefined,\n });\n }\n}\n//# sourceMappingURL=sendTransaction.js.map","import { encodeFunctionData, } from '../../utils/abi/encodeFunctionData.js';\nimport { sendTransaction, } from './sendTransaction.js';\n/**\n * Executes a write function on a contract.\n *\n * - Docs: https://viem.sh/docs/contract/writeContract.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/writing-to-contracts\n *\n * A \"write\" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms.html) is needed to be broadcast in order to change the state.\n *\n * Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet.html) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html).\n *\n * __Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract.html#usage) before you execute it.__\n *\n * @param client - Client to use\n * @param parameters - {@link WriteContractParameters}\n * @returns A [Transaction Hash](https://viem.sh/docs/glossary/terms.html#hash). {@link WriteContractReturnType}\n *\n * @example\n * import { createWalletClient, custom, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { writeContract } from 'viem/contract'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n * const hash = await writeContract(client, {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * abi: parseAbi(['function mint(uint32 tokenId) nonpayable']),\n * functionName: 'mint',\n * args: [69420],\n * })\n *\n * @example\n * // With Validation\n * import { createWalletClient, http, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { simulateContract, writeContract } from 'viem/contract'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const { request } = await simulateContract(client, {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * abi: parseAbi(['function mint(uint32 tokenId) nonpayable']),\n * functionName: 'mint',\n * args: [69420],\n * }\n * const hash = await writeContract(client, request)\n */\nexport async function writeContract(client, { abi, address, args, dataSuffix, functionName, ...request }) {\n const data = encodeFunctionData({\n abi,\n args,\n functionName,\n });\n const hash = await sendTransaction(client, {\n data: `${data}${dataSuffix ? dataSuffix.replace('0x', '') : ''}`,\n to: address,\n ...request,\n });\n return hash;\n}\n//# sourceMappingURL=writeContract.js.map","import { createContractEventFilter, } from './public/createContractEventFilter.js';\nimport { estimateContractGas, } from './public/estimateContractGas.js';\nimport { readContract, } from './public/readContract.js';\nimport { simulateContract, } from './public/simulateContract.js';\nimport { watchContractEvent, } from './public/watchContractEvent.js';\nimport { writeContract, } from './wallet/writeContract.js';\n/**\n * Gets type-safe interface for performing contract-related actions with a specific `abi` and `address`.\n *\n * - Docs https://viem.sh/docs/contract/getContract.html\n *\n * Using Contract Instances can make it easier to work with contracts if you don't want to pass the `abi` and `address` properites every time you perform contract actions, e.g. [`readContract`](https://viem.sh/docs/contract/readContract.html), [`writeContract`](https://viem.sh/docs/contract/writeContract.html), [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas.html), etc.\n *\n * @example\n * import { createPublicClient, getContract, http, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n *\n * const publicClient = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const contract = getContract({\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * abi: parseAbi([\n * 'function balanceOf(address owner) view returns (uint256)',\n * 'function ownerOf(uint256 tokenId) view returns (address)',\n * 'function totalSupply() view returns (uint256)',\n * ]),\n * publicClient,\n * })\n */\nexport function getContract({ abi, address, publicClient, walletClient, }) {\n const hasPublicClient = publicClient !== undefined && publicClient !== null;\n const hasWalletClient = walletClient !== undefined && walletClient !== null;\n const contract = {};\n let hasReadFunction = false;\n let hasWriteFunction = false;\n let hasEvent = false;\n for (const item of abi) {\n if (item.type === 'function')\n if (item.stateMutability === 'view' || item.stateMutability === 'pure')\n hasReadFunction = true;\n else\n hasWriteFunction = true;\n else if (item.type === 'event')\n hasEvent = true;\n // Exit early if all flags are `true`\n if (hasReadFunction && hasWriteFunction && hasEvent)\n break;\n }\n if (hasPublicClient) {\n if (hasReadFunction)\n contract.read = new Proxy({}, {\n get(_, functionName) {\n return (...parameters) => {\n const { args, options } = getFunctionParameters(parameters);\n return readContract(publicClient, {\n abi,\n address,\n functionName,\n args,\n ...options,\n });\n };\n },\n });\n if (hasWriteFunction)\n contract.simulate = new Proxy({}, {\n get(_, functionName) {\n return (...parameters) => {\n const { args, options } = getFunctionParameters(parameters);\n return simulateContract(publicClient, {\n abi,\n address,\n functionName,\n args,\n ...options,\n });\n };\n },\n });\n if (hasEvent) {\n contract.createEventFilter = new Proxy({}, {\n get(_, eventName) {\n return (...parameters) => {\n const abiEvent = abi.find((x) => x.type === 'event' && x.name === eventName);\n const { args, options } = getEventParameters(parameters, abiEvent);\n return createContractEventFilter(publicClient, {\n abi,\n address,\n eventName,\n args,\n ...options,\n });\n };\n },\n });\n contract.watchEvent = new Proxy({}, {\n get(_, eventName) {\n return (...parameters) => {\n const abiEvent = abi.find((x) => x.type === 'event' && x.name === eventName);\n const { args, options } = getEventParameters(parameters, abiEvent);\n return watchContractEvent(publicClient, {\n abi,\n address,\n eventName,\n args,\n ...options,\n });\n };\n },\n });\n }\n }\n if (hasWalletClient) {\n if (hasWriteFunction)\n contract.write = new Proxy({}, {\n get(_, functionName) {\n return (...parameters) => {\n const { args, options } = getFunctionParameters(parameters);\n return writeContract(walletClient, {\n abi,\n address,\n functionName,\n args,\n ...options,\n });\n };\n },\n });\n }\n if (hasPublicClient || hasWalletClient)\n if (hasWriteFunction)\n contract.estimateGas = new Proxy({}, {\n get(_, functionName) {\n return (...parameters) => {\n const { args, options } = getFunctionParameters(parameters);\n const client = (publicClient ?? walletClient);\n return estimateContractGas(client, {\n abi,\n address,\n functionName,\n args,\n ...options,\n account: options.account ??\n walletClient.account,\n });\n };\n },\n });\n contract.address = address;\n contract.abi = abi;\n return contract;\n}\n/**\n * @internal exporting for testing only\n */\nexport function getFunctionParameters(values) {\n const hasArgs = values.length && Array.isArray(values[0]);\n const args = hasArgs ? values[0] : [];\n const options = (hasArgs ? values[1] : values[0]) ?? {};\n return { args, options };\n}\n/**\n * @internal exporting for testing only\n */\nexport function getEventParameters(values, abiEvent) {\n let hasArgs = false;\n // If first item is array, must be `args`\n if (Array.isArray(values[0]))\n hasArgs = true;\n // Check if first item is `args` or `options`\n else if (values.length === 1) {\n // if event has indexed inputs, must have `args`\n hasArgs = abiEvent.inputs.some((x) => x.indexed);\n // If there are two items in array, must have `args`\n }\n else if (values.length === 2) {\n hasArgs = true;\n }\n const args = hasArgs ? values[0] : undefined;\n const options = (hasArgs ? values[1] : values[0]) ?? {};\n return { args, options };\n}\n//# sourceMappingURL=getContract.js.map","import { numberToHex } from '../../utils/encoding/toHex.js';\n/**\n * Adds an EVM chain to the wallet.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/addChain.html\n * - JSON-RPC Methods: [`eth_addEthereumChain`](https://eips.ethereum.org/EIPS/eip-3085)\n *\n * @param client - Client to use\n * @param parameters - {@link AddChainParameters}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { optimism } from 'viem/chains'\n * import { addChain } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * transport: custom(window.ethereum),\n * })\n * await addChain(client, { chain: optimism })\n */\nexport async function addChain(client, { chain }) {\n const { id, name, nativeCurrency, rpcUrls, blockExplorers } = chain;\n await client.request({\n method: 'wallet_addEthereumChain',\n params: [\n {\n chainId: numberToHex(id),\n chainName: name,\n nativeCurrency,\n rpcUrls: rpcUrls.default.http,\n blockExplorerUrls: blockExplorers\n ? Object.values(blockExplorers).map(({ url }) => url)\n : undefined,\n },\n ],\n });\n}\n//# sourceMappingURL=addChain.js.map","import { checksumAddress } from '../../utils/address/getAddress.js';\nimport { keccak256 } from '../../utils/hash/keccak256.js';\n/**\n * @description Converts an ECDSA public key to an address.\n *\n * @param publicKey The public key to convert.\n *\n * @returns The address.\n */\nexport function publicKeyToAddress(publicKey) {\n const address = keccak256(`0x${publicKey.substring(4)}`).substring(26);\n return checksumAddress(`0x${address}`);\n}\n//# sourceMappingURL=publicKeyToAddress.js.map","const size = 256;\nlet index = size;\nlet buffer;\nexport function uid(length = 11) {\n if (!buffer || index + length > size * 2) {\n buffer = '';\n index = 0;\n for (let i = 0; i < size; i++) {\n buffer += ((256 + Math.random() * 256) | 0).toString(16).substring(1);\n }\n }\n return buffer.substring(index, index++ + length);\n}\n//# sourceMappingURL=uid.js.map","import { parseAccount } from '../utils/accounts.js';\nimport { uid } from '../utils/uid.js';\nexport function createClient(parameters) {\n const { batch, cacheTime = parameters.pollingInterval ?? 4000, key = 'base', name = 'Base Client', pollingInterval = 4000, type = 'base', } = parameters;\n const chain = parameters.chain;\n const account = parameters.account\n ? parseAccount(parameters.account)\n : undefined;\n const { config, request, value } = parameters.transport({\n chain,\n pollingInterval,\n });\n const transport = { ...config, ...value };\n const client = {\n account,\n batch,\n cacheTime,\n chain,\n key,\n name,\n pollingInterval,\n request,\n transport,\n type,\n uid: uid(),\n };\n function extend(base) {\n return (extendFn) => {\n const extended = extendFn(base);\n for (const key in client)\n delete extended[key];\n const combined = { ...base, ...extended };\n return Object.assign(combined, { extend: extend(combined) });\n };\n }\n return Object.assign(client, { extend: extend(client) });\n}\n//# sourceMappingURL=createClient.js.map","import { wait } from '../wait.js';\nexport function withRetry(fn, { delay: delay_ = 100, retryCount = 2, shouldRetry = () => true, } = {}) {\n return new Promise((resolve, reject) => {\n const attemptRetry = async ({ count = 0 } = {}) => {\n const retry = async ({ error }) => {\n const delay = typeof delay_ === 'function' ? delay_({ count, error }) : delay_;\n if (delay)\n await wait(delay);\n attemptRetry({ count: count + 1 });\n };\n try {\n const data = await fn();\n resolve(data);\n }\n catch (err) {\n if (count < retryCount &&\n (await shouldRetry({ count, error: err })))\n return retry({ error: err });\n reject(err);\n }\n };\n attemptRetry();\n });\n}\n//# sourceMappingURL=withRetry.js.map","import { BaseError } from '../errors/base.js';\nimport { HttpRequestError } from '../errors/request.js';\nimport { ChainDisconnectedError, InternalRpcError, InvalidInputRpcError, InvalidParamsRpcError, InvalidRequestRpcError, JsonRpcVersionUnsupportedError, LimitExceededRpcError, MethodNotFoundRpcError, MethodNotSupportedRpcError, ParseRpcError, ProviderDisconnectedError, ResourceNotFoundRpcError, ResourceUnavailableRpcError, SwitchChainError, TransactionRejectedRpcError, UnauthorizedProviderError, UnknownRpcError, UnsupportedProviderMethodError, UserRejectedRequestError, } from '../errors/rpc.js';\nimport { withRetry } from './promise/withRetry.js';\nexport const isDeterministicError = (error) => {\n if ('code' in error)\n return (error.code !== -1 &&\n error.code !== -32004 &&\n error.code !== -32005 &&\n error.code !== -32042 &&\n error.code !== -32603);\n if (error instanceof HttpRequestError && error.status)\n return (error.status !== 403 &&\n error.status !== 408 &&\n error.status !== 413 &&\n error.status !== 429 &&\n error.status !== 500 &&\n error.status !== 502 &&\n error.status !== 503 &&\n error.status !== 504);\n return false;\n};\nexport function buildRequest(request, { retryDelay = 150, retryCount = 3, } = {}) {\n return (async (args) => withRetry(async () => {\n try {\n return await request(args);\n }\n catch (err_) {\n const err = err_;\n switch (err.code) {\n // -32700\n case ParseRpcError.code:\n throw new ParseRpcError(err);\n // -32600\n case InvalidRequestRpcError.code:\n throw new InvalidRequestRpcError(err);\n // -32601\n case MethodNotFoundRpcError.code:\n throw new MethodNotFoundRpcError(err);\n // -32602\n case InvalidParamsRpcError.code:\n throw new InvalidParamsRpcError(err);\n // -32603\n case InternalRpcError.code:\n throw new InternalRpcError(err);\n // -32000\n case InvalidInputRpcError.code:\n throw new InvalidInputRpcError(err);\n // -32001\n case ResourceNotFoundRpcError.code:\n throw new ResourceNotFoundRpcError(err);\n // -32002\n case ResourceUnavailableRpcError.code:\n throw new ResourceUnavailableRpcError(err);\n // -32003\n case TransactionRejectedRpcError.code:\n throw new TransactionRejectedRpcError(err);\n // -32004\n case MethodNotSupportedRpcError.code:\n throw new MethodNotSupportedRpcError(err);\n // -32005\n case LimitExceededRpcError.code:\n throw new LimitExceededRpcError(err);\n // -32006\n case JsonRpcVersionUnsupportedError.code:\n throw new JsonRpcVersionUnsupportedError(err);\n // 4001\n case UserRejectedRequestError.code:\n throw new UserRejectedRequestError(err);\n // 4100\n case UnauthorizedProviderError.code:\n throw new UnauthorizedProviderError(err);\n // 4200\n case UnsupportedProviderMethodError.code:\n throw new UnsupportedProviderMethodError(err);\n // 4900\n case ProviderDisconnectedError.code:\n throw new ProviderDisconnectedError(err);\n // 4901\n case ChainDisconnectedError.code:\n throw new ChainDisconnectedError(err);\n // 4902\n case SwitchChainError.code:\n throw new SwitchChainError(err);\n default:\n if (err_ instanceof BaseError)\n throw err_;\n throw new UnknownRpcError(err);\n }\n }\n }, {\n delay: ({ count, error }) => {\n // If we find a Retry-After header, let's retry after the given time.\n if (error && error instanceof HttpRequestError) {\n const retryAfter = error?.headers?.get('Retry-After');\n if (retryAfter?.match(/\\d/))\n return parseInt(retryAfter) * 1000;\n }\n // Otherwise, let's retry with an exponential backoff.\n return ~~(1 << count) * retryDelay;\n },\n retryCount,\n shouldRetry: ({ error }) => !isDeterministicError(error),\n }));\n}\n//# sourceMappingURL=buildRequest.js.map","import { buildRequest } from '../../utils/buildRequest.js';\n/**\n * @description Creates an transport intended to be used with a client.\n */\nexport function createTransport({ key, name, request, retryCount = 3, retryDelay = 150, timeout, type, }, value) {\n return {\n config: { key, name, request, retryCount, retryDelay, timeout, type },\n request: buildRequest(request, { retryCount, retryDelay }),\n value,\n };\n}\n//# sourceMappingURL=createTransport.js.map","import { isDeterministicError } from '../../utils/buildRequest.js';\nimport { wait } from '../../utils/wait.js';\nimport { createTransport, } from './createTransport.js';\nexport function fallback(transports_, config = {}) {\n const { key = 'fallback', name = 'Fallback', rank = false, retryCount, retryDelay, } = config;\n return ({ chain, pollingInterval = 4000, timeout }) => {\n let transports = transports_;\n let onResponse = () => { };\n const transport = createTransport({\n key,\n name,\n async request({ method, params }) {\n const fetch = async (i = 0) => {\n const transport = transports[i]({ chain, retryCount: 0, timeout });\n try {\n const response = await transport.request({\n method,\n params,\n });\n onResponse({\n method,\n params: params,\n response,\n transport,\n status: 'success',\n });\n return response;\n }\n catch (err) {\n onResponse({\n error: err,\n method,\n params: params,\n transport,\n status: 'error',\n });\n // If the error is deterministic, we don't need to fall back.\n // So throw the error.\n if (isDeterministicError(err))\n throw err;\n // If we've reached the end of the fallbacks, throw the error.\n if (i === transports.length - 1)\n throw err;\n // Otherwise, try the next fallback.\n return fetch(i + 1);\n }\n };\n return fetch();\n },\n retryCount,\n retryDelay,\n type: 'fallback',\n }, {\n onResponse: (fn) => (onResponse = fn),\n transports: transports.map((fn) => fn({ chain, retryCount: 0 })),\n });\n if (rank) {\n const rankOptions = (typeof rank === 'object' ? rank : {});\n rankTransports({\n chain,\n interval: rankOptions.interval ?? pollingInterval,\n onTransports: (transports_) => (transports = transports_),\n sampleCount: rankOptions.sampleCount,\n timeout: rankOptions.timeout,\n transports,\n weights: rankOptions.weights,\n });\n }\n return transport;\n };\n}\nexport function rankTransports({ chain, interval = 4000, onTransports, sampleCount = 10, timeout = 1000, transports, weights = {}, }) {\n const { stability: stabilityWeight = 0.7, latency: latencyWeight = 0.3 } = weights;\n const samples = [];\n const rankTransports_ = async () => {\n // 1. Take a sample from each Transport.\n const sample = await Promise.all(transports.map(async (transport) => {\n const transport_ = transport({ chain, retryCount: 0, timeout });\n const start = Date.now();\n let end;\n let success;\n try {\n await transport_.request({ method: 'net_listening' });\n success = 1;\n }\n catch {\n success = 0;\n }\n finally {\n end = Date.now();\n }\n const latency = end - start;\n return { latency, success };\n }));\n // 2. Store the sample. If we have more than `sampleCount` samples, remove\n // the oldest sample.\n samples.push(sample);\n if (samples.length > sampleCount)\n samples.shift();\n // 3. Calculate the max latency from samples.\n const maxLatency = Math.max(...samples.map((sample) => Math.max(...sample.map(({ latency }) => latency))));\n // 4. Calculate the score for each Transport.\n const scores = transports\n .map((_, i) => {\n const latencies = samples.map((sample) => sample[i].latency);\n const meanLatency = latencies.reduce((acc, latency) => acc + latency, 0) /\n latencies.length;\n const latencyScore = 1 - meanLatency / maxLatency;\n const successes = samples.map((sample) => sample[i].success);\n const stabilityScore = successes.reduce((acc, success) => acc + success, 0) /\n successes.length;\n if (stabilityScore === 0)\n return [0, i];\n return [\n latencyWeight * latencyScore + stabilityWeight * stabilityScore,\n i,\n ];\n })\n .sort((a, b) => b[0] - a[0]);\n // 5. Sort the Transports by score.\n onTransports(scores.map(([, i]) => transports[i]));\n // 6. Wait, and then rank again.\n await wait(interval);\n rankTransports_();\n };\n rankTransports_();\n}\n//# sourceMappingURL=fallback.js.map","import { BaseError } from './base.js';\nexport class UrlRequiredError extends BaseError {\n constructor() {\n super('No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.', {\n docsPath: '/docs/clients/intro',\n });\n }\n}\n//# sourceMappingURL=transport.js.map","export function withTimeout(fn, { errorInstance, timeout, signal, }) {\n return new Promise((resolve, reject) => {\n ;\n (async () => {\n let timeoutId;\n try {\n const controller = new AbortController();\n if (timeout > 0) {\n timeoutId = setTimeout(() => {\n if (signal) {\n controller.abort();\n }\n else {\n reject(errorInstance);\n }\n }, timeout);\n }\n resolve(await fn({ signal: controller?.signal }));\n }\n catch (err) {\n if (err.name === 'AbortError')\n reject(errorInstance);\n reject(err);\n }\n finally {\n clearTimeout(timeoutId);\n }\n })();\n });\n}\n//# sourceMappingURL=withTimeout.js.map","import { HttpRequestError, TimeoutError, WebSocketRequestError, } from '../errors/request.js';\nimport { createBatchScheduler } from './promise/createBatchScheduler.js';\nimport { withTimeout } from './promise/withTimeout.js';\nimport { stringify } from './stringify.js';\nlet id = 0;\nasync function http(url, { body, fetchOptions = {}, timeout = 10000 }) {\n const { headers, method, signal: signal_ } = fetchOptions;\n try {\n const response = await withTimeout(async ({ signal }) => {\n const response = await fetch(url, {\n ...fetchOptions,\n body: Array.isArray(body)\n ? stringify(body.map((body) => ({\n jsonrpc: '2.0',\n id: id++,\n ...body,\n })))\n : stringify({ jsonrpc: '2.0', id: id++, ...body }),\n headers: {\n ...headers,\n 'Content-Type': 'application/json',\n },\n method: method || 'POST',\n signal: signal_ || (timeout > 0 ? signal : undefined),\n });\n return response;\n }, {\n errorInstance: new TimeoutError({ body, url }),\n timeout,\n signal: true,\n });\n let data;\n if (response.headers.get('Content-Type')?.startsWith('application/json')) {\n data = await response.json();\n }\n else {\n data = await response.text();\n }\n if (!response.ok) {\n throw new HttpRequestError({\n body,\n details: stringify(data.error) || response.statusText,\n headers: response.headers,\n status: response.status,\n url,\n });\n }\n return data;\n }\n catch (err) {\n if (err instanceof HttpRequestError)\n throw err;\n if (err instanceof TimeoutError)\n throw err;\n throw new HttpRequestError({\n body,\n details: err.message,\n url,\n });\n }\n}\nconst sockets = /*#__PURE__*/ new Map();\nexport async function getSocket(url_) {\n const url = new URL(url_);\n const urlKey = url.toString();\n let socket = sockets.get(urlKey);\n // If the socket already exists, return it.\n if (socket)\n return socket;\n const { schedule } = createBatchScheduler({\n id: urlKey,\n fn: async () => {\n let WebSocket = await import('isomorphic-ws');\n // Workaround for Vite.\n // https://github.com/vitejs/vite/issues/9703\n // TODO: Remove when issue is resolved.\n if (WebSocket.default\n ?.constructor)\n WebSocket = WebSocket\n .default;\n else\n WebSocket = WebSocket.WebSocket;\n const webSocket = new WebSocket(url);\n // Set up a cache for incoming \"synchronous\" requests.\n const requests = new Map();\n // Set up a cache for subscriptions (eth_subscribe).\n const subscriptions = new Map();\n const onMessage = ({ data }) => {\n const message = JSON.parse(data);\n const isSubscription = message.method === 'eth_subscription';\n const id = isSubscription ? message.params.subscription : message.id;\n const cache = isSubscription ? subscriptions : requests;\n const callback = cache.get(id);\n if (callback)\n callback({ data });\n if (!isSubscription)\n cache.delete(id);\n };\n const onClose = () => {\n sockets.delete(urlKey);\n webSocket.removeEventListener('close', onClose);\n webSocket.removeEventListener('message', onMessage);\n };\n // Setup event listeners for RPC & subscription responses.\n webSocket.addEventListener('close', onClose);\n webSocket.addEventListener('message', onMessage);\n // Wait for the socket to open.\n if (webSocket.readyState === WebSocket.CONNECTING) {\n await new Promise((resolve, reject) => {\n if (!webSocket)\n return;\n webSocket.onopen = resolve;\n webSocket.onerror = reject;\n });\n }\n // Create a new socket instance.\n socket = Object.assign(webSocket, {\n requests,\n subscriptions,\n });\n sockets.set(urlKey, socket);\n return [socket];\n },\n });\n const [_, [socket_]] = await schedule();\n return socket_;\n}\nfunction webSocket(socket, { body, onResponse }) {\n if (socket.readyState === socket.CLOSED ||\n socket.readyState === socket.CLOSING)\n throw new WebSocketRequestError({\n body,\n url: socket.url,\n details: 'Socket is closed.',\n });\n const id_ = id++;\n const callback = ({ data }) => {\n const message = JSON.parse(data);\n if (typeof message.id === 'number' && id_ !== message.id)\n return;\n onResponse?.(message);\n // If we are subscribing to a topic, we want to set up a listener for incoming\n // messages.\n if (body.method === 'eth_subscribe' && typeof message.result === 'string') {\n socket.subscriptions.set(message.result, callback);\n }\n // If we are unsubscribing from a topic, we want to remove the listener.\n if (body.method === 'eth_unsubscribe') {\n socket.subscriptions.delete(body.params?.[0]);\n }\n };\n socket.requests.set(id_, callback);\n socket.send(JSON.stringify({ jsonrpc: '2.0', ...body, id: id_ }));\n return socket;\n}\nasync function webSocketAsync(socket, { body, timeout = 10000 }) {\n return withTimeout(() => new Promise((onResponse) => rpc.webSocket(socket, {\n body,\n onResponse,\n })), {\n errorInstance: new TimeoutError({ body, url: socket.url }),\n timeout,\n });\n}\n///////////////////////////////////////////////////\nexport const rpc = {\n http,\n webSocket,\n webSocketAsync,\n};\n//# sourceMappingURL=rpc.js.map","import { RpcRequestError } from '../../errors/request.js';\nimport { UrlRequiredError } from '../../errors/transport.js';\nimport { createBatchScheduler } from '../../utils/promise/createBatchScheduler.js';\nimport { rpc } from '../../utils/rpc.js';\nimport { createTransport, } from './createTransport.js';\n/**\n * @description Creates a HTTP transport that connects to a JSON-RPC API.\n */\nexport function http(\n/** URL of the JSON-RPC API. Defaults to the chain's public RPC URL. */\nurl, config = {}) {\n const { batch, fetchOptions, key = 'http', name = 'HTTP JSON-RPC', retryDelay, } = config;\n return ({ chain, retryCount: retryCount_, timeout: timeout_ }) => {\n const { batchSize = 1000, wait = 0 } = typeof batch === 'object' ? batch : {};\n const retryCount = config.retryCount ?? retryCount_;\n const timeout = timeout_ ?? config.timeout ?? 10000;\n const url_ = url || chain?.rpcUrls.default.http[0];\n if (!url_)\n throw new UrlRequiredError();\n return createTransport({\n key,\n name,\n async request({ method, params }) {\n const body = { method, params };\n const { schedule } = createBatchScheduler({\n id: `${url}`,\n wait,\n shouldSplitBatch(requests) {\n return requests.length > batchSize;\n },\n fn: (body) => rpc.http(url_, {\n body,\n fetchOptions,\n timeout,\n }),\n });\n const fn = async (body) => batch\n ? schedule(body)\n : [await rpc.http(url_, { body, fetchOptions, timeout })];\n const [{ error, result }] = await fn(body);\n if (error)\n throw new RpcRequestError({\n body,\n error,\n url: url_,\n });\n return result;\n },\n retryCount,\n retryDelay,\n timeout,\n type: 'http',\n }, {\n url,\n });\n };\n}\n//# sourceMappingURL=http.js.map","import { panicReasons } from '../../constants/solidity.js';\nimport { BaseError } from '../../errors/base.js';\nimport { ContractFunctionRevertedError } from '../../errors/contract.js';\n/*\n * @description Checks if error is a valid null result UniversalResolver error\n */\nexport function isNullUniversalResolverError(err, callType) {\n if (!(err instanceof BaseError))\n return false;\n const cause = err.walk((e) => e instanceof ContractFunctionRevertedError);\n if (!(cause instanceof ContractFunctionRevertedError))\n return false;\n if (cause.data?.errorName === 'ResolverNotFound')\n return true;\n if (cause.data?.errorName === 'ResolverWildcardNotSupported')\n return true;\n // Backwards compatibility for older UniversalResolver contracts\n if (cause.reason?.includes('Wildcard on non-extended resolvers is not supported'))\n return true;\n // No primary name set for address.\n if (callType === 'reverse' && cause.reason === panicReasons[50])\n return true;\n return false;\n}\n//# sourceMappingURL=errors.js.map","export const arrayRegex = /^(.*)\\[([0-9]*)\\]$/;\n// `bytes`: binary type of `M` bytes, `0 < M <= 32`\n// https://regexr.com/6va55\nexport const bytesRegex = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/;\n// `(u)int`: (un)signed integer type of `M` bits, `0 < M <= 256`, `M % 8 == 0`\n// https://regexr.com/6v8hp\nexport const integerRegex = /^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;\n//# sourceMappingURL=regex.js.map","import { BytesSizeMismatchError } from '../errors/abi.js';\nimport { InvalidAddressError } from '../errors/address.js';\nimport { isAddress } from './address/isAddress.js';\nimport { size } from './data/size.js';\nimport { numberToHex } from './encoding/toHex.js';\nimport { bytesRegex, integerRegex } from './regex.js';\nexport function validateTypedData({ domain, message, primaryType, types: types_, }) {\n const types = types_;\n const validateData = (struct, value_) => {\n for (const param of struct) {\n const { name, type: type_ } = param;\n const type = type_;\n const value = value_[name];\n const integerMatch = type.match(integerRegex);\n if (integerMatch &&\n (typeof value === 'number' || typeof value === 'bigint')) {\n const [_type, base, size_] = integerMatch;\n // If number cannot be cast to a sized hex value, it is out of range\n // and will throw.\n numberToHex(value, {\n signed: base === 'int',\n size: parseInt(size_) / 8,\n });\n }\n if (type === 'address' && typeof value === 'string' && !isAddress(value))\n throw new InvalidAddressError({ address: value });\n const bytesMatch = type.match(bytesRegex);\n if (bytesMatch) {\n const [_type, size_] = bytesMatch;\n if (size_ && size(value) !== parseInt(size_))\n throw new BytesSizeMismatchError({\n expectedSize: parseInt(size_),\n givenSize: size(value),\n });\n }\n const struct = types[type];\n if (struct)\n validateData(struct, value);\n }\n };\n // Validate domain types.\n if (types['EIP712Domain'] && domain)\n validateData(types['EIP712Domain'], domain);\n if (primaryType !== 'EIP712Domain') {\n // Validate message types.\n const type = types[primaryType];\n validateData(type, message);\n }\n}\n//# sourceMappingURL=typedData.js.map","import { AbiConstructorNotFoundError, AbiConstructorParamsNotFoundError, } from '../../errors/abi.js';\nimport { concatHex } from '../data/concat.js';\nimport { encodeAbiParameters } from './encodeAbiParameters.js';\nconst docsPath = '/docs/contract/encodeDeployData';\nexport function encodeDeployData({ abi, args, bytecode, }) {\n if (!args || args.length === 0)\n return bytecode;\n const description = abi.find((x) => 'type' in x && x.type === 'constructor');\n if (!description)\n throw new AbiConstructorNotFoundError({ docsPath });\n if (!('inputs' in description))\n throw new AbiConstructorParamsNotFoundError({ docsPath });\n if (!description.inputs || description.inputs.length === 0)\n throw new AbiConstructorParamsNotFoundError({ docsPath });\n const data = encodeAbiParameters(description.inputs, args);\n return concatHex([bytecode, data]);\n}\n//# sourceMappingURL=encodeDeployData.js.map","import { concat } from '../data/concat.js';\nimport { toBytes } from './toBytes.js';\nimport { bytesToHex } from './toHex.js';\nexport function toRlp(hexOrBytes, to_) {\n const to = to_ || 'hex';\n return format(bytesToRlp(parse(hexOrBytes)), to);\n}\nfunction parse(hexOrBytes) {\n if (Array.isArray(hexOrBytes))\n return hexOrBytes.map(parse);\n return typeof hexOrBytes === 'string' ? toBytes(hexOrBytes) : hexOrBytes;\n}\nfunction format(bytes, type = 'bytes') {\n return type === 'hex' ? bytesToHex(bytes) : bytes;\n}\nexport function bytesToRlp(bytes) {\n if (Array.isArray(bytes)) {\n const encoded = concat(bytes.map(bytesToRlp));\n return new Uint8Array([...encodeLength(encoded.length, 0xc0), ...encoded]);\n }\n if (bytes.length === 1 && bytes[0] < 0x80)\n return bytes;\n return new Uint8Array([...encodeLength(bytes.length, 0x80), ...bytes]);\n}\nfunction encodeLength(length, offset) {\n if (length < 56)\n return [offset + length];\n return [toBytes(length).length + offset + 55, ...toBytes(length)];\n}\n//# sourceMappingURL=toRlp.js.map","import { hexToNumber } from '../encoding/fromHex.js';\nimport { defineFormatter } from './formatter.js';\nimport { formatLog } from './log.js';\nimport { transactionType } from './transaction.js';\nconst statuses = {\n '0x0': 'reverted',\n '0x1': 'success',\n};\nexport function formatTransactionReceipt(transactionReceipt) {\n return {\n ...transactionReceipt,\n blockNumber: transactionReceipt.blockNumber\n ? BigInt(transactionReceipt.blockNumber)\n : null,\n contractAddress: transactionReceipt.contractAddress\n ? transactionReceipt.contractAddress\n : null,\n cumulativeGasUsed: transactionReceipt.cumulativeGasUsed\n ? BigInt(transactionReceipt.cumulativeGasUsed)\n : null,\n effectiveGasPrice: transactionReceipt.effectiveGasPrice\n ? BigInt(transactionReceipt.effectiveGasPrice)\n : null,\n gasUsed: transactionReceipt.gasUsed\n ? BigInt(transactionReceipt.gasUsed)\n : null,\n logs: transactionReceipt.logs\n ? transactionReceipt.logs.map((log) => formatLog(log))\n : null,\n to: transactionReceipt.to ? transactionReceipt.to : null,\n transactionIndex: transactionReceipt.transactionIndex\n ? hexToNumber(transactionReceipt.transactionIndex)\n : null,\n status: transactionReceipt.status\n ? statuses[transactionReceipt.status]\n : null,\n type: transactionReceipt.type\n ? transactionType[transactionReceipt.type] || transactionReceipt.type\n : null,\n };\n}\nexport const defineTransactionReceipt = /*#__PURE__*/ defineFormatter('transactionReceipt', formatTransactionReceipt);\n//# sourceMappingURL=transactionReceipt.js.map","// Implementation forked and adapted from https://github.com/MetaMask/eth-sig-util/blob/main/src/sign-typed-data.ts\nimport { encodeAbiParameters } from '../abi/encodeAbiParameters.js';\nimport { concat } from '../data/concat.js';\nimport { toHex } from '../encoding/toHex.js';\nimport { keccak256 } from '../hash/keccak256.js';\nimport { validateTypedData } from '../typedData.js';\nexport function hashTypedData({ domain: domain_, message, primaryType, types: types_, }) {\n const domain = typeof domain_ === 'undefined' ? {} : domain_;\n const types = {\n EIP712Domain: [\n typeof domain?.name === 'string' && { name: 'name', type: 'string' },\n domain?.version && { name: 'version', type: 'string' },\n typeof domain?.chainId === 'number' && {\n name: 'chainId',\n type: 'uint256',\n },\n domain?.verifyingContract && {\n name: 'verifyingContract',\n type: 'address',\n },\n domain?.salt && { name: 'salt', type: 'bytes32' },\n ].filter(Boolean),\n ...types_,\n };\n // Need to do a runtime validation check on addresses, byte ranges, integer ranges, etc\n // as we can't statically check this with TypeScript.\n validateTypedData({\n domain,\n message,\n primaryType,\n types,\n });\n const parts = ['0x1901'];\n if (domain)\n parts.push(hashDomain({\n domain,\n types: types,\n }));\n if (primaryType !== 'EIP712Domain') {\n parts.push(hashStruct({\n data: message,\n primaryType: primaryType,\n types: types,\n }));\n }\n return keccak256(concat(parts));\n}\nfunction hashDomain({ domain, types, }) {\n return hashStruct({\n data: domain,\n primaryType: 'EIP712Domain',\n types,\n });\n}\nfunction hashStruct({ data, primaryType, types, }) {\n const encoded = encodeData({\n data,\n primaryType,\n types,\n });\n return keccak256(encoded);\n}\nfunction encodeData({ data, primaryType, types, }) {\n const encodedTypes = [{ type: 'bytes32' }];\n const encodedValues = [hashType({ primaryType, types })];\n for (const field of types[primaryType]) {\n const [type, value] = encodeField({\n types,\n name: field.name,\n type: field.type,\n value: data[field.name],\n });\n encodedTypes.push(type);\n encodedValues.push(value);\n }\n return encodeAbiParameters(encodedTypes, encodedValues);\n}\nfunction hashType({ primaryType, types, }) {\n const encodedHashType = toHex(encodeType({ primaryType, types }));\n return keccak256(encodedHashType);\n}\nfunction encodeType({ primaryType, types, }) {\n let result = '';\n const unsortedDeps = findTypeDependencies({ primaryType, types });\n unsortedDeps.delete(primaryType);\n const deps = [primaryType, ...Array.from(unsortedDeps).sort()];\n for (const type of deps) {\n result += `${type}(${types[type]\n .map(({ name, type: t }) => `${t} ${name}`)\n .join(',')})`;\n }\n return result;\n}\nfunction findTypeDependencies({ primaryType: primaryType_, types, }, results = new Set()) {\n const match = primaryType_.match(/^\\w*/u);\n const primaryType = match?.[0];\n if (results.has(primaryType) || types[primaryType] === undefined) {\n return results;\n }\n results.add(primaryType);\n for (const field of types[primaryType]) {\n findTypeDependencies({ primaryType: field.type, types }, results);\n }\n return results;\n}\nfunction encodeField({ types, name, type, value, }) {\n if (types[type] !== undefined) {\n return [\n { type: 'bytes32' },\n keccak256(encodeData({ data: value, primaryType: type, types })),\n ];\n }\n if (type === 'bytes') {\n const prepend = value.length % 2 ? '0' : '';\n value = `0x${prepend + value.slice(2)}`;\n return [{ type: 'bytes32' }, keccak256(value)];\n }\n if (type === 'string')\n return [{ type: 'bytes32' }, keccak256(toHex(value))];\n if (type.lastIndexOf(']') === type.length - 1) {\n const parsedType = type.slice(0, type.lastIndexOf('['));\n const typeValuePairs = value.map((item) => encodeField({\n name,\n type: parsedType,\n types,\n value: item,\n }));\n return [\n { type: 'bytes32' },\n keccak256(encodeAbiParameters(typeValuePairs.map(([t]) => t), typeValuePairs.map(([, v]) => v))),\n ];\n }\n return [{ type }, value];\n}\n//# sourceMappingURL=hashTypedData.js.map","import { concat } from '../data/concat.js';\nimport { stringToBytes, toBytes } from '../encoding/toBytes.js';\nimport { keccak256 } from '../hash/keccak256.js';\nexport function hashMessage(message, to_) {\n const messageBytes = (() => {\n if (typeof message === 'string')\n return stringToBytes(message);\n if (message.raw instanceof Uint8Array)\n return message.raw;\n return toBytes(message.raw);\n })();\n const prefixBytes = stringToBytes(`\\x19Ethereum Signed Message:\\n${messageBytes.length}`);\n return keccak256(concat([prefixBytes, messageBytes]), to_);\n}\n//# sourceMappingURL=hashMessage.js.map","import { InvalidSerializableTransactionError } from '../../errors/transaction.js';\nexport function getTransactionType(transaction) {\n if (transaction.type)\n return transaction.type;\n if (typeof transaction.maxFeePerGas !== 'undefined' ||\n typeof transaction.maxPriorityFeePerGas !== 'undefined')\n return 'eip1559';\n if (typeof transaction.gasPrice !== 'undefined') {\n if (typeof transaction.accessList !== 'undefined')\n return 'eip2930';\n return 'legacy';\n }\n throw new InvalidSerializableTransactionError({ transaction });\n}\n//# sourceMappingURL=getTransactionType.js.map","import { InvalidAddressError } from '../../errors/address.js';\nimport { BaseError } from '../../errors/base.js';\nimport { InvalidChainIdError } from '../../errors/chain.js';\nimport { FeeCapTooHighError, TipAboveFeeCapError } from '../../errors/node.js';\nimport { isAddress } from '../address/isAddress.js';\nexport function assertTransactionEIP1559(transaction) {\n const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to } = transaction;\n if (chainId <= 0)\n throw new InvalidChainIdError({ chainId });\n if (to && !isAddress(to))\n throw new InvalidAddressError({ address: to });\n if (gasPrice)\n throw new BaseError('`gasPrice` is not a valid EIP-1559 Transaction attribute.');\n if (maxFeePerGas && maxFeePerGas > 2n ** 256n - 1n)\n throw new FeeCapTooHighError({ maxFeePerGas });\n if (maxPriorityFeePerGas &&\n maxFeePerGas &&\n maxPriorityFeePerGas > maxFeePerGas)\n throw new TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas });\n}\nexport function assertTransactionEIP2930(transaction) {\n const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to } = transaction;\n if (chainId <= 0)\n throw new InvalidChainIdError({ chainId });\n if (to && !isAddress(to))\n throw new InvalidAddressError({ address: to });\n if (maxPriorityFeePerGas || maxFeePerGas)\n throw new BaseError('`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.');\n if (gasPrice && gasPrice > 2n ** 256n - 1n)\n throw new FeeCapTooHighError({ maxFeePerGas: gasPrice });\n}\nexport function assertTransactionLegacy(transaction) {\n const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to, accessList, } = transaction;\n if (to && !isAddress(to))\n throw new InvalidAddressError({ address: to });\n if (typeof chainId !== 'undefined' && chainId <= 0)\n throw new InvalidChainIdError({ chainId });\n if (maxPriorityFeePerGas || maxFeePerGas)\n throw new BaseError('`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.');\n if (gasPrice && gasPrice > 2n ** 256n - 1n)\n throw new FeeCapTooHighError({ maxFeePerGas: gasPrice });\n if (accessList)\n throw new BaseError('`accessList` is not a valid Legacy Transaction attribute.');\n}\n//# sourceMappingURL=assertTransaction.js.map","import { InvalidAddressError } from '../../errors/address.js';\nimport { InvalidStorageKeySizeError } from '../../errors/transaction.js';\nimport { isAddress } from '../address/isAddress.js';\nimport {} from '../encoding/toRlp.js';\n/*\n * Serialize an EIP-2930 access list\n * @remarks\n * Use to create a transaction serializer with support for EIP-2930 access lists\n *\n * @param accessList - Array of objects of address and arrays of Storage Keys\n * @throws InvalidAddressError, InvalidStorageKeySizeError\n * @returns Array of hex strings\n */\nexport function serializeAccessList(accessList) {\n if (!accessList || accessList.length === 0)\n return [];\n const serializedAccessList = [];\n for (let i = 0; i < accessList.length; i++) {\n const { address, storageKeys } = accessList[i];\n for (let j = 0; j < storageKeys.length; j++) {\n if (storageKeys[j].length - 2 !== 64) {\n throw new InvalidStorageKeySizeError({ storageKey: storageKeys[j] });\n }\n }\n if (!isAddress(address)) {\n throw new InvalidAddressError({ address });\n }\n serializedAccessList.push([address, storageKeys]);\n }\n return serializedAccessList;\n}\n//# sourceMappingURL=serializeAccessList.js.map","import { InvalidLegacyVError } from '../../errors/transaction.js';\nimport { concatHex } from '../data/concat.js';\nimport { trim } from '../data/trim.js';\nimport { toHex } from '../encoding/toHex.js';\nimport { toRlp } from '../encoding/toRlp.js';\nimport { assertTransactionEIP1559, assertTransactionEIP2930, assertTransactionLegacy, } from './assertTransaction.js';\nimport { getTransactionType, } from './getTransactionType.js';\nimport { serializeAccessList } from './serializeAccessList.js';\nexport function serializeTransaction(transaction, signature) {\n const type = getTransactionType(transaction);\n if (type === 'eip1559')\n return serializeTransactionEIP1559(transaction, signature);\n if (type === 'eip2930')\n return serializeTransactionEIP2930(transaction, signature);\n return serializeTransactionLegacy(transaction, signature);\n}\nfunction serializeTransactionEIP1559(transaction, signature) {\n const { chainId, gas, nonce, to, value, maxFeePerGas, maxPriorityFeePerGas, accessList, data, } = transaction;\n assertTransactionEIP1559(transaction);\n const serializedAccessList = serializeAccessList(accessList);\n const serializedTransaction = [\n toHex(chainId),\n nonce ? toHex(nonce) : '0x',\n maxPriorityFeePerGas ? toHex(maxPriorityFeePerGas) : '0x',\n maxFeePerGas ? toHex(maxFeePerGas) : '0x',\n gas ? toHex(gas) : '0x',\n to ?? '0x',\n value ? toHex(value) : '0x',\n data ?? '0x',\n serializedAccessList,\n ];\n if (signature)\n serializedTransaction.push(signature.v === 27n ? '0x' : toHex(1), // yParity\n trim(signature.r), trim(signature.s));\n return concatHex([\n '0x02',\n toRlp(serializedTransaction),\n ]);\n}\nfunction serializeTransactionEIP2930(transaction, signature) {\n const { chainId, gas, data, nonce, to, value, accessList, gasPrice } = transaction;\n assertTransactionEIP2930(transaction);\n const serializedAccessList = serializeAccessList(accessList);\n const serializedTransaction = [\n toHex(chainId),\n nonce ? toHex(nonce) : '0x',\n gasPrice ? toHex(gasPrice) : '0x',\n gas ? toHex(gas) : '0x',\n to ?? '0x',\n value ? toHex(value) : '0x',\n data ?? '0x',\n serializedAccessList,\n ];\n if (signature)\n serializedTransaction.push(signature.v === 27n ? '0x' : toHex(1), // yParity\n signature.r, signature.s);\n return concatHex([\n '0x01',\n toRlp(serializedTransaction),\n ]);\n}\nfunction serializeTransactionLegacy(transaction, signature) {\n const { chainId = 0, gas, data, nonce, to, value, gasPrice } = transaction;\n assertTransactionLegacy(transaction);\n let serializedTransaction = [\n nonce ? toHex(nonce) : '0x',\n gasPrice ? toHex(gasPrice) : '0x',\n gas ? toHex(gas) : '0x',\n to ?? '0x',\n value ? toHex(value) : '0x',\n data ?? '0x',\n ];\n if (signature) {\n let v = 27n + (signature.v === 27n ? 0n : 1n);\n if (chainId > 0)\n v = BigInt(chainId * 2) + BigInt(35n + signature.v - 27n);\n else if (signature.v !== v)\n throw new InvalidLegacyVError({ v: signature.v });\n serializedTransaction = [\n ...serializedTransaction,\n toHex(v),\n signature.r,\n signature.s,\n ];\n }\n else if (chainId > 0) {\n serializedTransaction = [\n ...serializedTransaction,\n toHex(chainId),\n '0x',\n '0x',\n ];\n }\n return toRlp(serializedTransaction);\n}\n//# sourceMappingURL=serializeTransaction.js.map","export function parseUnits(value, decimals) {\n let [integer, fraction = '0'] = value.split('.');\n const negative = integer.startsWith('-');\n if (negative)\n integer = integer.slice(1);\n // trim leading zeros.\n fraction = fraction.replace(/(0+)$/, '');\n // round off if the fraction is larger than the number of decimals.\n if (decimals === 0) {\n if (Math.round(Number(`.${fraction}`)) === 1)\n integer = `${BigInt(integer) + 1n}`;\n fraction = '';\n }\n else if (fraction.length > decimals) {\n const [left, unit, right] = [\n fraction.slice(0, decimals - 1),\n fraction.slice(decimals - 1, decimals),\n fraction.slice(decimals),\n ];\n const rounded = Math.round(Number(`${unit}.${right}`));\n if (rounded > 9)\n fraction = `${BigInt(left) + BigInt(1)}0`.padStart(left.length + 1, '0');\n else\n fraction = `${left}${rounded}`;\n if (fraction.length > decimals) {\n fraction = fraction.slice(1);\n integer = `${BigInt(integer) + 1n}`;\n }\n fraction = fraction.slice(0, decimals);\n }\n else {\n fraction = fraction.padEnd(decimals, '0');\n }\n return BigInt(`${negative ? '-' : ''}${integer}${fraction}`);\n}\n//# sourceMappingURL=parseUnits.js.map","import { etherUnits } from '../../constants/unit.js';\nimport { parseUnits } from './parseUnits.js';\nexport function parseEther(ether, unit = 'wei') {\n return parseUnits(ether, etherUnits[unit]);\n}\n//# sourceMappingURL=parseEther.js.map","import { isHex } from '../index.js';\nexport function encodedLabelToLabelhash(label) {\n if (label.length !== 66)\n return null;\n if (label.indexOf('[') !== 0)\n return null;\n if (label.indexOf(']') !== 65)\n return null;\n const hash = `0x${label.slice(1, 65)}`;\n if (!isHex(hash))\n return null;\n return hash;\n}\n//# sourceMappingURL=encodedLabelToLabelhash.js.map","import { concat } from '../data/concat.js';\nimport { stringToBytes, toBytes } from '../encoding/toBytes.js';\nimport { bytesToHex } from '../encoding/toHex.js';\nimport { keccak256 } from '../hash/keccak256.js';\nimport { encodedLabelToLabelhash } from './encodedLabelToLabelhash.js';\n/**\n * @description Hashes ENS name\n *\n * - Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `namehash`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this.\n *\n * @example\n * namehash('wagmi-dev.eth')\n * '0xf246651c1b9a6b141d19c2604e9a58f567973833990f830d882534a747801359'\n *\n * @link https://eips.ethereum.org/EIPS/eip-137\n */\nexport function namehash(name) {\n let result = new Uint8Array(32).fill(0);\n if (!name)\n return bytesToHex(result);\n const labels = name.split('.');\n // Iterate in reverse order building up hash\n for (let i = labels.length - 1; i >= 0; i -= 1) {\n const hashFromEncodedLabel = encodedLabelToLabelhash(labels[i]);\n const hashed = hashFromEncodedLabel\n ? toBytes(hashFromEncodedLabel)\n : keccak256(stringToBytes(labels[i]), 'bytes');\n result = keccak256(concat([result, hashed]), 'bytes');\n }\n return bytesToHex(result);\n}\n//# sourceMappingURL=namehash.js.map","export function encodeLabelhash(hash) {\n return `[${hash.slice(2)}]`;\n}\n//# sourceMappingURL=encodeLabelhash.js.map","import { stringToBytes } from '../encoding/toBytes.js';\nimport { bytesToHex } from '../encoding/toHex.js';\nimport { keccak256 } from '../hash/keccak256.js';\nimport { encodedLabelToLabelhash } from './encodedLabelToLabelhash.js';\n/**\n * @description Hashes ENS label\n *\n * - Since ENS labels prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS labels](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `labelhash`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this.\n *\n * @example\n * labelhash('eth')\n * '0x4f5b812789fc606be1b3b16908db13fc7a9adf7ca72641f84d75b47069d3d7f0'\n */\nexport function labelhash(label) {\n const result = new Uint8Array(32).fill(0);\n if (!label)\n return bytesToHex(result);\n return encodedLabelToLabelhash(label) || keccak256(stringToBytes(label));\n}\n//# sourceMappingURL=labelhash.js.map","import { stringToBytes } from '../encoding/toBytes.js';\nimport { encodeLabelhash } from './encodeLabelhash.js';\nimport { labelhash } from './labelhash.js';\n/*\n * @description Encodes a DNS packet into a ByteArray containing a UDP payload.\n */\nexport function packetToBytes(packet) {\n // strip leading and trailing `.`\n const value = packet.replace(/^\\.|\\.$/gm, '');\n if (value.length === 0)\n return new Uint8Array(1);\n const bytes = new Uint8Array(stringToBytes(value).byteLength + 2);\n let offset = 0;\n const list = value.split('.');\n for (let i = 0; i < list.length; i++) {\n let encoded = stringToBytes(list[i]);\n // if the length is > 255, make the encoded label value a labelhash\n // this is compatible with the universal resolver\n if (encoded.byteLength > 255)\n encoded = stringToBytes(encodeLabelhash(labelhash(list[i])));\n bytes[offset] = encoded.length;\n bytes.set(encoded, offset + 1);\n offset += encoded.length + 1;\n }\n if (bytes.byteLength !== offset + 1)\n return bytes.slice(0, offset + 1);\n return bytes;\n}\n//# sourceMappingURL=packetToBytes.js.map","import { addressResolverAbi, universalResolverResolveAbi, } from '../../constants/abis.js';\nimport { decodeFunctionResult } from '../../utils/abi/decodeFunctionResult.js';\nimport { encodeFunctionData } from '../../utils/abi/encodeFunctionData.js';\nimport { getChainContractAddress } from '../../utils/chain.js';\nimport { trim } from '../../utils/data/trim.js';\nimport { toHex } from '../../utils/encoding/toHex.js';\nimport { isNullUniversalResolverError } from '../../utils/ens/errors.js';\nimport { namehash } from '../../utils/ens/namehash.js';\nimport { packetToBytes } from '../../utils/ens/packetToBytes.js';\nimport { readContract, } from '../public/readContract.js';\n/**\n * Gets address for ENS name.\n *\n * - Docs: https://viem.sh/docs/ens/actions/getEnsAddress.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens\n *\n * Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract.\n *\n * Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this.\n *\n * @param client - Client to use\n * @param parameters - {@link GetEnsAddressParameters}\n * @returns Address for ENS name or `null` if not found. {@link GetEnsAddressReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getEnsAddress, normalize } from 'viem/ens'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const ensAddress = await getEnsAddress(client, {\n * name: normalize('wagmi-dev.eth'),\n * })\n * // '0xd2135CfB216b74109775236E36d4b433F1DF507B'\n */\nexport async function getEnsAddress(client, { blockNumber, blockTag, coinType, name, universalResolverAddress: universalResolverAddress_, }) {\n let universalResolverAddress = universalResolverAddress_;\n if (!universalResolverAddress) {\n if (!client.chain)\n throw new Error('client chain not configured. universalResolverAddress is required.');\n universalResolverAddress = getChainContractAddress({\n blockNumber,\n chain: client.chain,\n contract: 'ensUniversalResolver',\n });\n }\n try {\n const functionData = encodeFunctionData({\n abi: addressResolverAbi,\n functionName: 'addr',\n ...(coinType != null\n ? { args: [namehash(name), BigInt(coinType)] }\n : { args: [namehash(name)] }),\n });\n const res = await readContract(client, {\n address: universalResolverAddress,\n abi: universalResolverResolveAbi,\n functionName: 'resolve',\n args: [toHex(packetToBytes(name)), functionData],\n blockNumber,\n blockTag,\n });\n if (res[0] === '0x')\n return null;\n const address = trim(decodeFunctionResult({\n abi: addressResolverAbi,\n args: coinType != null ? [namehash(name), BigInt(coinType)] : undefined,\n functionName: 'addr',\n data: res[0],\n }));\n if (address === '0x')\n return null;\n if (trim(address) === '0x00')\n return null;\n return address;\n }\n catch (err) {\n if (isNullUniversalResolverError(err, 'resolve'))\n return null;\n throw err;\n }\n}\n//# sourceMappingURL=getEnsAddress.js.map","import { BaseError } from './base.js';\nexport class EnsAvatarInvalidMetadataError extends BaseError {\n constructor({ data }) {\n super('Unable to extract image from metadata. The metadata may be malformed or invalid.', {\n metaMessages: [\n '- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.',\n '',\n `Provided data: ${JSON.stringify(data)}`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'EnsAvatarInvalidMetadataError'\n });\n }\n}\nexport class EnsAvatarInvalidNftUriError extends BaseError {\n constructor({ reason }) {\n super(`ENS NFT avatar URI is invalid. ${reason}`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'EnsAvatarInvalidNftUriError'\n });\n }\n}\nexport class EnsAvatarUriResolutionError extends BaseError {\n constructor({ uri }) {\n super(`Unable to resolve ENS avatar URI \"${uri}\". The URI may be malformed, invalid, or does not respond with a valid image.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'EnsAvatarUriResolutionError'\n });\n }\n}\nexport class EnsAvatarUnsupportedNamespaceError extends BaseError {\n constructor({ namespace }) {\n super(`ENS NFT avatar namespace \"${namespace}\" is not supported. Must be \"erc721\" or \"erc1155\".`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'EnsAvatarUnsupportedNamespaceError'\n });\n }\n}\n//# sourceMappingURL=ens.js.map","import { readContract } from '../../../actions/public/readContract.js';\nimport { EnsAvatarInvalidMetadataError, EnsAvatarInvalidNftUriError, EnsAvatarUnsupportedNamespaceError, EnsAvatarUriResolutionError, } from '../../../errors/ens.js';\nconst networkRegex = /(?https?:\\/\\/[^\\/]*|ipfs:\\/|ipns:\\/|ar:\\/)?(?\\/)?(?ipfs\\/|ipns\\/)?(?[\\w\\-.]+)(?\\/.*)?/;\nconst ipfsHashRegex = /^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\\/(?[\\w\\-.]+))?(?\\/.*)?$/;\nconst base64Regex = /^data:([a-zA-Z\\-/+]*);base64,([^\"].*)/;\nconst dataURIRegex = /^data:([a-zA-Z\\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;\nexport async function isImageUri(uri) {\n try {\n const res = await fetch(uri, { method: 'HEAD' });\n // retrieve content type header to check if content is image\n if (res.status === 200) {\n const contentType = res.headers.get('content-type');\n return contentType?.startsWith('image/');\n }\n return false;\n }\n catch (error) {\n // if error is not cors related then fail\n if (typeof error === 'object' && typeof error.response !== 'undefined') {\n return false;\n }\n // fail in NodeJS, since the error is not cors but any other network issue\n // rome-ignore lint/suspicious/noPrototypeBuiltins:\n if (!globalThis.hasOwnProperty('Image'))\n return false;\n // in case of cors, use image api to validate if given url is an actual image\n return new Promise((resolve) => {\n const img = new Image();\n img.onload = () => {\n resolve(true);\n };\n img.onerror = () => {\n resolve(false);\n };\n img.src = uri;\n });\n }\n}\nexport function getGateway(custom, defaultGateway) {\n if (!custom)\n return defaultGateway;\n if (custom.endsWith('/'))\n return custom.slice(0, -1);\n return custom;\n}\nexport function resolveAvatarUri({ uri, gatewayUrls, }) {\n const isEncoded = base64Regex.test(uri);\n if (isEncoded)\n return { uri, isOnChain: true, isEncoded };\n const ipfsGateway = getGateway(gatewayUrls?.ipfs, 'https://ipfs.io');\n const arweaveGateway = getGateway(gatewayUrls?.arweave, 'https://arweave.net');\n const networkRegexMatch = uri.match(networkRegex);\n const { protocol, subpath, target, subtarget = '', } = networkRegexMatch?.groups || {};\n const isIPNS = protocol === 'ipns:/' || subpath === 'ipns/';\n const isIPFS = protocol === 'ipfs:/' || subpath === 'ipfs/' || ipfsHashRegex.test(uri);\n if (uri.startsWith('http') && !isIPNS && !isIPFS) {\n let replacedUri = uri;\n if (gatewayUrls?.arweave)\n replacedUri = uri.replace(/https:\\/\\/arweave.net/g, gatewayUrls?.arweave);\n return { uri: replacedUri, isOnChain: false, isEncoded: false };\n }\n if ((isIPNS || isIPFS) && target) {\n return {\n uri: `${ipfsGateway}/${isIPNS ? 'ipns' : 'ipfs'}/${target}${subtarget}`,\n isOnChain: false,\n isEncoded: false,\n };\n }\n else if (protocol === 'ar:/' && target) {\n return {\n uri: `${arweaveGateway}/${target}${subtarget || ''}`,\n isOnChain: false,\n isEncoded: false,\n };\n }\n let parsedUri = uri.replace(dataURIRegex, '');\n if (parsedUri.startsWith(' res.json());\n const image = await parseAvatarUri({\n gatewayUrls,\n uri: getJsonImage(res),\n });\n return image;\n }\n catch {\n throw new EnsAvatarUriResolutionError({ uri });\n }\n}\nexport async function parseAvatarUri({ gatewayUrls, uri, }) {\n const { uri: resolvedURI, isOnChain } = resolveAvatarUri({ uri, gatewayUrls });\n if (isOnChain)\n return resolvedURI;\n // check if resolvedURI is an image, if it is return the url\n const isImage = await isImageUri(resolvedURI);\n if (isImage)\n return resolvedURI;\n throw new EnsAvatarUriResolutionError({ uri });\n}\nexport function parseNftUri(uri_) {\n let uri = uri_;\n // parse valid nft spec (CAIP-22/CAIP-29)\n // @see: https://github.com/ChainAgnostic/CAIPs/tree/master/CAIPs\n if (uri.startsWith('did:nft:')) {\n // convert DID to CAIP\n uri = uri.replace('did:nft:', '').replace(/_/g, '/');\n }\n const [reference, asset_namespace, tokenID] = uri.split('/');\n const [eip_namespace, chainID] = reference.split(':');\n const [erc_namespace, contractAddress] = asset_namespace.split(':');\n if (!eip_namespace || eip_namespace.toLowerCase() !== 'eip155')\n throw new EnsAvatarInvalidNftUriError({ reason: 'Only EIP-155 supported' });\n if (!chainID)\n throw new EnsAvatarInvalidNftUriError({ reason: 'Chain ID not found' });\n if (!contractAddress)\n throw new EnsAvatarInvalidNftUriError({\n reason: 'Contract address not found',\n });\n if (!tokenID)\n throw new EnsAvatarInvalidNftUriError({ reason: 'Token ID not found' });\n if (!erc_namespace)\n throw new EnsAvatarInvalidNftUriError({ reason: 'ERC namespace not found' });\n return {\n chainID: parseInt(chainID),\n namespace: erc_namespace.toLowerCase(),\n contractAddress: contractAddress,\n tokenID,\n };\n}\nexport async function getNftTokenUri(client, { nft }) {\n if (nft.namespace === 'erc721') {\n return readContract(client, {\n address: nft.contractAddress,\n abi: [\n {\n name: 'tokenURI',\n type: 'function',\n stateMutability: 'view',\n inputs: [{ name: 'tokenId', type: 'uint256' }],\n outputs: [{ name: '', type: 'string' }],\n },\n ],\n functionName: 'tokenURI',\n args: [BigInt(nft.tokenID)],\n });\n }\n if (nft.namespace === 'erc1155') {\n return readContract(client, {\n address: nft.contractAddress,\n abi: [\n {\n name: 'uri',\n type: 'function',\n stateMutability: 'view',\n inputs: [{ name: '_id', type: 'uint256' }],\n outputs: [{ name: '', type: 'string' }],\n },\n ],\n functionName: 'uri',\n args: [BigInt(nft.tokenID)],\n });\n }\n throw new EnsAvatarUnsupportedNamespaceError({ namespace: nft.namespace });\n}\n//# sourceMappingURL=utils.js.map","import { getJsonImage, getMetadataAvatarUri, getNftTokenUri, parseAvatarUri, parseNftUri, resolveAvatarUri, } from './utils.js';\nexport async function parseAvatarRecord(client, { gatewayUrls, record, }) {\n if (/eip155:/i.test(record))\n return parseNftAvatarUri(client, { gatewayUrls, record });\n return parseAvatarUri({ uri: record, gatewayUrls });\n}\nasync function parseNftAvatarUri(client, { gatewayUrls, record, }) {\n // parse NFT URI into properties\n const nft = parseNftUri(record);\n // fetch tokenURI from the NFT contract\n const nftUri = await getNftTokenUri(client, { nft });\n // resolve the URI from the fetched tokenURI\n const { uri: resolvedNftUri, isOnChain, isEncoded, } = resolveAvatarUri({ uri: nftUri, gatewayUrls });\n // if the resolved URI is on chain, return the data\n if (isOnChain &&\n (resolvedNftUri.includes('data:application/json;base64,') ||\n resolvedNftUri.startsWith('{'))) {\n const encodedJson = isEncoded\n ? // if it is encoded, decode it\n atob(resolvedNftUri.replace('data:application/json;base64,', ''))\n : // if it isn't encoded assume it is a JSON string, but it could be anything (it will error if it is)\n resolvedNftUri;\n const decoded = JSON.parse(encodedJson);\n return parseAvatarUri({ uri: getJsonImage(decoded), gatewayUrls });\n }\n let uriTokenId = nft.tokenID;\n if (nft.namespace === 'erc1155')\n uriTokenId = uriTokenId.replace('0x', '').padStart(64, '0');\n return getMetadataAvatarUri({\n gatewayUrls,\n uri: resolvedNftUri.replace(/(?:0x)?{id}/, uriTokenId),\n });\n}\n//# sourceMappingURL=parseAvatarRecord.js.map","import { textResolverAbi, universalResolverResolveAbi, } from '../../constants/abis.js';\nimport { decodeFunctionResult } from '../../utils/abi/decodeFunctionResult.js';\nimport { encodeFunctionData } from '../../utils/abi/encodeFunctionData.js';\nimport { getChainContractAddress } from '../../utils/chain.js';\nimport { toHex } from '../../utils/encoding/toHex.js';\nimport { isNullUniversalResolverError } from '../../utils/ens/errors.js';\nimport { namehash } from '../../utils/ens/namehash.js';\nimport { packetToBytes } from '../../utils/ens/packetToBytes.js';\nimport { readContract, } from '../public/readContract.js';\n/**\n * Gets a text record for specified ENS name.\n *\n * - Docs: https://viem.sh/docs/ens/actions/getEnsResolver.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens\n *\n * Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract.\n *\n * Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this.\n *\n * @param client - Client to use\n * @param parameters - {@link GetEnsTextParameters}\n * @returns Address for ENS resolver. {@link GetEnsTextReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getEnsText, normalize } from 'viem/ens'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const twitterRecord = await getEnsText(client, {\n * name: normalize('wagmi-dev.eth'),\n * key: 'com.twitter',\n * })\n * // 'wagmi_sh'\n */\nexport async function getEnsText(client, { blockNumber, blockTag, name, key, universalResolverAddress: universalResolverAddress_, }) {\n let universalResolverAddress = universalResolverAddress_;\n if (!universalResolverAddress) {\n if (!client.chain)\n throw new Error('client chain not configured. universalResolverAddress is required.');\n universalResolverAddress = getChainContractAddress({\n blockNumber,\n chain: client.chain,\n contract: 'ensUniversalResolver',\n });\n }\n try {\n const res = await readContract(client, {\n address: universalResolverAddress,\n abi: universalResolverResolveAbi,\n functionName: 'resolve',\n args: [\n toHex(packetToBytes(name)),\n encodeFunctionData({\n abi: textResolverAbi,\n functionName: 'text',\n args: [namehash(name), key],\n }),\n ],\n blockNumber,\n blockTag,\n });\n if (res[0] === '0x')\n return null;\n const record = decodeFunctionResult({\n abi: textResolverAbi,\n functionName: 'text',\n data: res[0],\n });\n return record === '' ? null : record;\n }\n catch (err) {\n if (isNullUniversalResolverError(err, 'resolve'))\n return null;\n throw err;\n }\n}\n//# sourceMappingURL=getEnsText.js.map","import { parseAvatarRecord } from '../../utils/ens/avatar/parseAvatarRecord.js';\nimport { getEnsText } from './getEnsText.js';\n/**\n * Gets the avatar of an ENS name.\n *\n * - Docs: https://viem.sh/docs/ens/actions/getEnsAvatar.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens\n *\n * Calls [`getEnsText`](https://viem.sh/docs/ens/actions/getEnsText.html) with `key` set to `'avatar'`.\n *\n * Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this.\n *\n * @param client - Client to use\n * @param parameters - {@link GetEnsAvatarParameters}\n * @returns Avatar URI or `null` if not found. {@link GetEnsAvatarReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getEnsAvatar, normalize } from 'viem/ens'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const ensAvatar = await getEnsAvatar(client, {\n * name: normalize('wagmi-dev.eth'),\n * })\n * // 'https://ipfs.io/ipfs/Qma8mnp6xV3J2cRNf3mTth5C8nV11CAnceVinc3y8jSbio'\n */\nexport async function getEnsAvatar(client, { blockNumber, blockTag, gatewayUrls, name, universalResolverAddress, }) {\n const record = await getEnsText(client, {\n blockNumber,\n blockTag,\n key: 'avatar',\n name,\n universalResolverAddress,\n });\n if (!record)\n return null;\n try {\n return await parseAvatarRecord(client, { record, gatewayUrls });\n }\n catch {\n return null;\n }\n}\n//# sourceMappingURL=getEnsAvatar.js.map","import { universalResolverReverseAbi } from '../../constants/abis.js';\nimport { getChainContractAddress } from '../../utils/chain.js';\nimport { toHex } from '../../utils/encoding/toHex.js';\nimport { isNullUniversalResolverError } from '../../utils/ens/errors.js';\nimport { packetToBytes } from '../../utils/ens/packetToBytes.js';\nimport { readContract, } from '../public/readContract.js';\n/**\n * Gets primary name for specified address.\n *\n * - Docs: https://viem.sh/docs/ens/actions/getEnsName.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens\n *\n * Calls `reverse(bytes)` on ENS Universal Resolver Contract to \"reverse resolve\" the address to the primary ENS name.\n *\n * @param client - Client to use\n * @param parameters - {@link GetEnsNameParameters}\n * @returns Name or `null` if not found. {@link GetEnsNameReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getEnsName } from 'viem/ens'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const ensName = await getEnsName(client, {\n * address: '0xd2135CfB216b74109775236E36d4b433F1DF507B',\n * })\n * // 'wagmi-dev.eth'\n */\nexport async function getEnsName(client, { address, blockNumber, blockTag, universalResolverAddress: universalResolverAddress_, }) {\n let universalResolverAddress = universalResolverAddress_;\n if (!universalResolverAddress) {\n if (!client.chain)\n throw new Error('client chain not configured. universalResolverAddress is required.');\n universalResolverAddress = getChainContractAddress({\n blockNumber,\n chain: client.chain,\n contract: 'ensUniversalResolver',\n });\n }\n const reverseNode = `${address.toLowerCase().substring(2)}.addr.reverse`;\n try {\n const res = await readContract(client, {\n address: universalResolverAddress,\n abi: universalResolverReverseAbi,\n functionName: 'reverse',\n args: [toHex(packetToBytes(reverseNode))],\n blockNumber,\n blockTag,\n });\n return res[0];\n }\n catch (err) {\n if (isNullUniversalResolverError(err, 'reverse'))\n return null;\n throw err;\n }\n}\n//# sourceMappingURL=getEnsName.js.map","import { getChainContractAddress } from '../../utils/chain.js';\nimport { toHex } from '../../utils/encoding/toHex.js';\nimport { packetToBytes } from '../../utils/ens/packetToBytes.js';\nimport { readContract, } from '../public/readContract.js';\n/**\n * Gets resolver for ENS name.\n *\n * - Docs: https://viem.sh/docs/ens/actions/getEnsResolver.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens\n *\n * Calls `findResolver(bytes)` on ENS Universal Resolver Contract to retrieve the resolver of an ENS name.\n *\n * Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this.\n *\n * @param client - Client to use\n * @param parameters - {@link GetEnsResolverParameters}\n * @returns Address for ENS resolver. {@link GetEnsResolverReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getEnsResolver, normalize } from 'viem/ens'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const resolverAddress = await getEnsResolver(client, {\n * name: normalize('wagmi-dev.eth'),\n * })\n * // '0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41'\n */\nexport async function getEnsResolver(client, { blockNumber, blockTag, name, universalResolverAddress: universalResolverAddress_, }) {\n let universalResolverAddress = universalResolverAddress_;\n if (!universalResolverAddress) {\n if (!client.chain)\n throw new Error('client chain not configured. universalResolverAddress is required.');\n universalResolverAddress = getChainContractAddress({\n blockNumber,\n chain: client.chain,\n contract: 'ensUniversalResolver',\n });\n }\n const [resolverAddress] = await readContract(client, {\n address: universalResolverAddress,\n abi: [\n {\n inputs: [{ type: 'bytes' }],\n name: 'findResolver',\n outputs: [{ type: 'address' }, { type: 'bytes32' }],\n stateMutability: 'view',\n type: 'function',\n },\n ],\n functionName: 'findResolver',\n args: [toHex(packetToBytes(name))],\n blockNumber,\n blockTag,\n });\n return resolverAddress;\n}\n//# sourceMappingURL=getEnsResolver.js.map","import { createFilterRequestScope } from '../../utils/filters/createFilterRequestScope.js';\n/**\n * Creates a [`Filter`](https://viem.sh/docs/glossary/types.html#filter) to listen for new block hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html).\n *\n * - Docs: https://viem.sh/docs/actions/public/createBlockFilter.html\n * - JSON-RPC Methods: [`eth_newBlockFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newBlockFilter)\n *\n * @param client - Client to use\n * @returns [`Filter`](https://viem.sh/docs/glossary/types.html#filter). {@link CreateBlockFilterReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createBlockFilter } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createBlockFilter(client)\n * // { id: \"0x345a6572337856574a76364e457a4366\", type: 'block' }\n */\nexport async function createBlockFilter(client) {\n const getRequest = createFilterRequestScope(client, {\n method: 'eth_newBlockFilter',\n });\n const id = await client.request({\n method: 'eth_newBlockFilter',\n });\n return { id, request: getRequest(id), type: 'block' };\n}\n//# sourceMappingURL=createBlockFilter.js.map","import { encodeEventTopics, } from '../../utils/abi/encodeEventTopics.js';\nimport { numberToHex } from '../../utils/encoding/toHex.js';\nimport { createFilterRequestScope } from '../../utils/filters/createFilterRequestScope.js';\n/**\n * Creates a [`Filter`](https://viem.sh/docs/glossary/types.html#filter) to listen for new events that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html).\n *\n * - Docs: https://viem.sh/docs/actions/public/createEventFilter.html\n * - JSON-RPC Methods: [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter)\n *\n * @param client - Client to use\n * @param parameters - {@link CreateEventFilterParameters}\n * @returns [`Filter`](https://viem.sh/docs/glossary/types.html#filter). {@link CreateEventFilterReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createEventFilter } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createEventFilter(client, {\n * address: '0xfba3912ca04dd458c843e2ee08967fc04f3579c2',\n * })\n */\nexport async function createEventFilter(client, { address, args, event, events: events_, fromBlock, strict, toBlock, } = {}) {\n const events = events_ ?? (event ? [event] : undefined);\n const getRequest = createFilterRequestScope(client, {\n method: 'eth_newFilter',\n });\n let topics = [];\n if (events) {\n topics = [\n events.flatMap((event) => encodeEventTopics({\n abi: [event],\n eventName: event.name,\n args,\n })),\n ];\n if (event)\n topics = topics[0];\n }\n const id = await client.request({\n method: 'eth_newFilter',\n params: [\n {\n address,\n fromBlock: typeof fromBlock === 'bigint' ? numberToHex(fromBlock) : fromBlock,\n toBlock: typeof toBlock === 'bigint' ? numberToHex(toBlock) : toBlock,\n ...(topics.length ? { topics } : {}),\n },\n ],\n });\n return {\n abi: events,\n args,\n eventName: event ? event.name : undefined,\n fromBlock,\n id,\n request: getRequest(id),\n strict,\n toBlock,\n type: 'event',\n };\n}\n//# sourceMappingURL=createEventFilter.js.map","import { createFilterRequestScope } from '../../utils/filters/createFilterRequestScope.js';\n/**\n * Creates a Filter to listen for new pending transaction hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html).\n *\n * - Docs: https://viem.sh/docs/actions/public/createPendingTransactionFilter.html\n * - JSON-RPC Methods: [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter)\n *\n * @param client - Client to use\n * @returns [`Filter`](https://viem.sh/docs/glossary/types.html#filter). {@link CreateBlockFilterReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createPendingTransactionFilter } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createPendingTransactionFilter(client)\n * // { id: \"0x345a6572337856574a76364e457a4366\", type: 'transaction' }\n */\nexport async function createPendingTransactionFilter(client) {\n const getRequest = createFilterRequestScope(client, {\n method: 'eth_newPendingTransactionFilter',\n });\n const id = await client.request({\n method: 'eth_newPendingTransactionFilter',\n });\n return { id, request: getRequest(id), type: 'transaction' };\n}\n//# sourceMappingURL=createPendingTransactionFilter.js.map","import { numberToHex } from '../../utils/encoding/toHex.js';\n/**\n * Returns the balance of an address in wei.\n *\n * - Docs: https://viem.sh/docs/actions/public/getBalance.html\n * - JSON-RPC Methods: [`eth_getBalance`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getbalance)\n *\n * You can convert the balance to ether units with [`formatEther`](https://viem.sh/docs/utilities/formatEther.html).\n *\n * ```ts\n * const balance = await getBalance(client, {\n * address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * blockTag: 'safe'\n * })\n * const balanceAsEther = formatEther(balance)\n * // \"6.942\"\n * ```\n *\n * @param client - Client to use\n * @param parameters - {@link GetBalanceParameters}\n * @returns The balance of the address in wei. {@link GetBalanceReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getBalance } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const balance = await getBalance(client, {\n * address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * })\n * // 10000000000000000000000n (wei)\n */\nexport async function getBalance(client, { address, blockNumber, blockTag = 'latest' }) {\n const blockNumberHex = blockNumber ? numberToHex(blockNumber) : undefined;\n const balance = await client.request({\n method: 'eth_getBalance',\n params: [address, blockNumberHex || blockTag],\n });\n return BigInt(balance);\n}\n//# sourceMappingURL=getBalance.js.map","import { hexToNumber } from '../../utils/encoding/fromHex.js';\nimport { numberToHex } from '../../utils/encoding/toHex.js';\n/**\n * Returns the number of Transactions at a block number, hash, or tag.\n *\n * - Docs: https://viem.sh/docs/actions/public/getBlockTransactionCount.html\n * - JSON-RPC Methods:\n * - Calls [`eth_getBlockTransactionCountByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbynumber) for `blockNumber` & `blockTag`.\n * - Calls [`eth_getBlockTransactionCountByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbyhash) for `blockHash`.\n *\n * @param client - Client to use\n * @param parameters - {@link GetBlockTransactionCountParameters}\n * @returns The block transaction count. {@link GetBlockTransactionCountReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getBlockTransactionCount } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const count = await getBlockTransactionCount(client)\n */\nexport async function getBlockTransactionCount(client, { blockHash, blockNumber, blockTag = 'latest', } = {}) {\n const blockNumberHex = blockNumber !== undefined ? numberToHex(blockNumber) : undefined;\n let count;\n if (blockHash) {\n count = await client.request({\n method: 'eth_getBlockTransactionCountByHash',\n params: [blockHash],\n });\n }\n else {\n count = await client.request({\n method: 'eth_getBlockTransactionCountByNumber',\n params: [blockNumberHex || blockTag],\n });\n }\n return hexToNumber(count);\n}\n//# sourceMappingURL=getBlockTransactionCount.js.map","import { numberToHex } from '../../utils/encoding/toHex.js';\n/**\n * Retrieves the bytecode at an address.\n *\n * - Docs: https://viem.sh/docs/contract/getBytecode.html\n * - JSON-RPC Methods: [`eth_getCode`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getcode)\n *\n * @param client - Client to use\n * @param parameters - {@link GetBytecodeParameters}\n * @returns The contract's bytecode. {@link GetBytecodeReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getBytecode } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const code = await getBytecode(client, {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * })\n */\nexport async function getBytecode(client, { address, blockNumber, blockTag = 'latest' }) {\n const blockNumberHex = blockNumber !== undefined ? numberToHex(blockNumber) : undefined;\n const hex = await client.request({\n method: 'eth_getCode',\n params: [address, blockNumberHex || blockTag],\n });\n if (hex === '0x')\n return undefined;\n return hex;\n}\n//# sourceMappingURL=getBytecode.js.map","export function formatFeeHistory(feeHistory) {\n return {\n baseFeePerGas: feeHistory.baseFeePerGas.map((value) => BigInt(value)),\n gasUsedRatio: feeHistory.gasUsedRatio,\n oldestBlock: BigInt(feeHistory.oldestBlock),\n reward: feeHistory.reward?.map((reward) => reward.map((value) => BigInt(value))),\n };\n}\n//# sourceMappingURL=feeHistory.js.map","import { numberToHex } from '../../utils/encoding/toHex.js';\nimport { formatFeeHistory } from '../../utils/formatters/feeHistory.js';\n/**\n * Returns a collection of historical gas information.\n *\n * - Docs: https://viem.sh/docs/actions/public/getFeeHistory.html\n * - JSON-RPC Methods: [`eth_feeHistory`](https://docs.alchemy.com/reference/eth-feehistory)\n *\n * @param client - Client to use\n * @param parameters - {@link GetFeeHistoryParameters}\n * @returns The gas estimate (in wei). {@link GetFeeHistoryReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getFeeHistory } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const feeHistory = await getFeeHistory(client, {\n * blockCount: 4,\n * rewardPercentiles: [25, 75],\n * })\n */\nexport async function getFeeHistory(client, { blockCount, blockNumber, blockTag = 'latest', rewardPercentiles, }) {\n const blockNumberHex = blockNumber ? numberToHex(blockNumber) : undefined;\n const feeHistory = await client.request({\n method: 'eth_feeHistory',\n params: [\n numberToHex(blockCount),\n blockNumberHex || blockTag,\n rewardPercentiles,\n ],\n });\n return formatFeeHistory(feeHistory);\n}\n//# sourceMappingURL=getFeeHistory.js.map","import { DecodeLogDataMismatch, DecodeLogTopicsMismatch, } from '../../errors/abi.js';\nimport { decodeEventLog } from '../../utils/abi/decodeEventLog.js';\nimport { formatLog } from '../../utils/formatters/log.js';\n/**\n * Returns a list of event logs since the filter was created.\n *\n * - Docs: https://viem.sh/docs/actions/public/getFilterLogs.html\n * - JSON-RPC Methods: [`eth_getFilterLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterlogs)\n *\n * `getFilterLogs` is only compatible with **event filters**.\n *\n * @param client - Client to use\n * @param parameters - {@link GetFilterLogsParameters}\n * @returns A list of event logs. {@link GetFilterLogsReturnType}\n *\n * @example\n * import { createPublicClient, http, parseAbiItem } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createEventFilter, getFilterLogs } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createEventFilter(client, {\n * address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',\n * event: parseAbiItem('event Transfer(address indexed, address indexed, uint256)'),\n * })\n * const logs = await getFilterLogs(client, { filter })\n */\nexport async function getFilterLogs(_client, { filter, }) {\n const strict = filter.strict ?? false;\n const logs = await filter.request({\n method: 'eth_getFilterLogs',\n params: [filter.id],\n });\n return logs\n .map((log) => {\n try {\n const { eventName, args } = 'abi' in filter && filter.abi\n ? decodeEventLog({\n abi: filter.abi,\n data: log.data,\n topics: log.topics,\n strict,\n })\n : { eventName: undefined, args: undefined };\n return formatLog(log, { args, eventName });\n }\n catch (err) {\n let eventName;\n let isUnnamed;\n if (err instanceof DecodeLogDataMismatch ||\n err instanceof DecodeLogTopicsMismatch) {\n // If strict mode is on, and log data/topics do not match event definition, skip.\n if ('strict' in filter && filter.strict)\n return;\n eventName = err.abiItem.name;\n isUnnamed = err.abiItem.inputs?.some((x) => !('name' in x && x.name));\n }\n // Set args to empty if there is an error decoding (e.g. indexed/non-indexed params mismatch).\n return formatLog(log, { args: isUnnamed ? [] : {}, eventName });\n }\n })\n .filter(Boolean);\n}\n//# sourceMappingURL=getFilterLogs.js.map","import { numberToHex } from '../../utils/encoding/toHex.js';\n/**\n * Returns the value from a storage slot at a given address.\n *\n * - Docs: https://viem.sh/docs/contract/getStorageAt.html\n * - JSON-RPC Methods: [`eth_getStorageAt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getstorageat)\n *\n * @param client - Client to use\n * @param parameters - {@link GetStorageAtParameters}\n * @returns The value of the storage slot. {@link GetStorageAtReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getStorageAt } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const code = await getStorageAt(client, {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * slot: toHex(0),\n * })\n */\nexport async function getStorageAt(client, { address, blockNumber, blockTag = 'latest', slot }) {\n const blockNumberHex = blockNumber !== undefined ? numberToHex(blockNumber) : undefined;\n const data = await client.request({\n method: 'eth_getStorageAt',\n params: [address, slot, blockNumberHex || blockTag],\n });\n return data;\n}\n//# sourceMappingURL=getStorageAt.js.map","import { TransactionNotFoundError } from '../../errors/transaction.js';\nimport { numberToHex } from '../../utils/encoding/toHex.js';\nimport { formatTransaction, } from '../../utils/formatters/transaction.js';\n/**\n * Returns information about a [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) given a hash or block identifier.\n *\n * - Docs: https://viem.sh/docs/actions/public/getTransaction.html\n * - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions\n * - JSON-RPC Methods: [`eth_getTransactionByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionByHash)\n *\n * @param client - Client to use\n * @param parameters - {@link GetTransactionParameters}\n * @returns The transaction information. {@link GetTransactionReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getTransaction } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const transaction = await getTransaction(client, {\n * hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',\n * })\n */\nexport async function getTransaction(client, { blockHash, blockNumber, blockTag: blockTag_, hash, index, }) {\n const blockTag = blockTag_ || 'latest';\n const blockNumberHex = blockNumber !== undefined ? numberToHex(blockNumber) : undefined;\n let transaction = null;\n if (hash) {\n transaction = await client.request({\n method: 'eth_getTransactionByHash',\n params: [hash],\n });\n }\n else if (blockHash) {\n transaction = await client.request({\n method: 'eth_getTransactionByBlockHashAndIndex',\n params: [blockHash, numberToHex(index)],\n });\n }\n else if (blockNumberHex || blockTag) {\n transaction = await client.request({\n method: 'eth_getTransactionByBlockNumberAndIndex',\n params: [blockNumberHex || blockTag, numberToHex(index)],\n });\n }\n if (!transaction)\n throw new TransactionNotFoundError({\n blockHash,\n blockNumber,\n blockTag,\n hash,\n index,\n });\n const format = client.chain?.formatters?.transaction?.format || formatTransaction;\n return format(transaction);\n}\n//# sourceMappingURL=getTransaction.js.map","import { getBlockNumber } from './getBlockNumber.js';\nimport { getTransaction } from './getTransaction.js';\n/**\n * Returns the number of blocks passed (confirmations) since the transaction was processed on a block.\n *\n * - Docs: https://viem.sh/docs/actions/public/getTransactionConfirmations.html\n * - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions\n * - JSON-RPC Methods: [`eth_getTransactionConfirmations`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionConfirmations)\n *\n * @param client - Client to use\n * @param parameters - {@link GetTransactionConfirmationsParameters}\n * @returns The number of blocks passed since the transaction was processed. If confirmations is 0, then the Transaction has not been confirmed & processed yet. {@link GetTransactionConfirmationsReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getTransactionConfirmations } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const confirmations = await getTransactionConfirmations(client, {\n * hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',\n * })\n */\nexport async function getTransactionConfirmations(client, { hash, transactionReceipt }) {\n const [blockNumber, transaction] = await Promise.all([\n getBlockNumber(client),\n hash ? getTransaction(client, { hash }) : undefined,\n ]);\n const transactionBlockNumber = transactionReceipt?.blockNumber || transaction?.blockNumber;\n if (!transactionBlockNumber)\n return 0n;\n return blockNumber - transactionBlockNumber + 1n;\n}\n//# sourceMappingURL=getTransactionConfirmations.js.map","import { TransactionReceiptNotFoundError } from '../../errors/transaction.js';\nimport { formatTransactionReceipt, } from '../../utils/formatters/transactionReceipt.js';\n/**\n * Returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms.html#transaction-receipt) given a [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) hash.\n *\n * - Docs: https://viem.sh/docs/actions/public/getTransactionReceipt.html\n * - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions\n * - JSON-RPC Methods: [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionreceipt)\n *\n * @param client - Client to use\n * @param parameters - {@link GetTransactionReceiptParameters}\n * @returns The transaction receipt. {@link GetTransactionReceiptReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getTransactionReceipt } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const transactionReceipt = await getTransactionReceipt(client, {\n * hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',\n * })\n */\nexport async function getTransactionReceipt(client, { hash }) {\n const receipt = await client.request({\n method: 'eth_getTransactionReceipt',\n params: [hash],\n });\n if (!receipt)\n throw new TransactionReceiptNotFoundError({ hash });\n const format = client.chain?.formatters?.transactionReceipt?.format ||\n formatTransactionReceipt;\n return format(receipt);\n}\n//# sourceMappingURL=getTransactionReceipt.js.map","import { multicall3Abi } from '../../constants/abis.js';\nimport { AbiDecodingZeroDataError } from '../../errors/abi.js';\nimport { RawContractError } from '../../errors/contract.js';\nimport { decodeFunctionResult } from '../../utils/abi/decodeFunctionResult.js';\nimport { encodeFunctionData, } from '../../utils/abi/encodeFunctionData.js';\nimport { getChainContractAddress } from '../../utils/chain.js';\nimport { getContractError } from '../../utils/errors/getContractError.js';\nimport { readContract } from './readContract.js';\n/**\n * Similar to [`readContract`](https://viem.sh/docs/contract/readContract.html), but batches up multiple functions on a contract in a single RPC call via the [`multicall3` contract](https://github.com/mds1/multicall).\n *\n * - Docs: https://viem.sh/docs/contract/multicall.html\n *\n * @param client - Client to use\n * @param parameters - {@link MulticallParameters}\n * @returns An array of results with accompanying status. {@link MulticallReturnType}\n *\n * @example\n * import { createPublicClient, http, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { multicall } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const abi = parseAbi([\n * 'function balanceOf(address) view returns (uint256)',\n * 'function totalSupply() view returns (uint256)',\n * ])\n * const results = await multicall(client, {\n * contracts: [\n * {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * abi,\n * functionName: 'balanceOf',\n * args: ['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'],\n * },\n * {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * abi,\n * functionName: 'totalSupply',\n * },\n * ],\n * })\n * // [{ result: 424122n, status: 'success' }, { result: 1000000n, status: 'success' }]\n */\nexport async function multicall(client, args) {\n const { allowFailure = true, batchSize: batchSize_, blockNumber, blockTag, contracts: contracts_, multicallAddress: multicallAddress_, } = args;\n const batchSize = batchSize_ ??\n ((typeof client.batch?.multicall === 'object' &&\n client.batch.multicall.batchSize) ||\n 1024);\n // Fix type cast from `Narrow` in type definition.\n const contracts = contracts_;\n let multicallAddress = multicallAddress_;\n if (!multicallAddress) {\n if (!client.chain)\n throw new Error('client chain not configured. multicallAddress is required.');\n multicallAddress = getChainContractAddress({\n blockNumber,\n chain: client.chain,\n contract: 'multicall3',\n });\n }\n const chunkedCalls = [[]];\n let currentChunk = 0;\n let currentChunkSize = 0;\n for (let i = 0; i < contracts.length; i++) {\n const { abi, address, args, functionName } = contracts[i];\n try {\n const callData = encodeFunctionData({\n abi,\n args,\n functionName,\n });\n currentChunkSize += callData.length;\n if (batchSize > 0 && currentChunkSize > batchSize) {\n currentChunk++;\n currentChunkSize = (callData.length - 2) / 2;\n chunkedCalls[currentChunk] = [];\n }\n chunkedCalls[currentChunk] = [\n ...chunkedCalls[currentChunk],\n {\n allowFailure: true,\n callData,\n target: address,\n },\n ];\n }\n catch (err) {\n const error = getContractError(err, {\n abi,\n address,\n args,\n docsPath: '/docs/contract/multicall',\n functionName,\n });\n if (!allowFailure)\n throw error;\n chunkedCalls[currentChunk] = [\n ...chunkedCalls[currentChunk],\n {\n allowFailure: true,\n callData: '0x',\n target: address,\n },\n ];\n }\n }\n const results = await Promise.all(chunkedCalls.map((calls) => readContract(client, {\n abi: multicall3Abi,\n address: multicallAddress,\n args: [calls],\n blockNumber,\n blockTag,\n functionName: 'aggregate3',\n })));\n return results.flat().map(({ returnData, success }, i) => {\n const calls = chunkedCalls.flat();\n const { callData } = calls[i];\n const { abi, address, functionName, args } = contracts[i];\n try {\n if (callData === '0x')\n throw new AbiDecodingZeroDataError();\n if (!success)\n throw new RawContractError({ data: returnData });\n const result = decodeFunctionResult({\n abi,\n args,\n data: returnData,\n functionName: functionName,\n });\n return allowFailure ? { result, status: 'success' } : result;\n }\n catch (err) {\n const error = getContractError(err, {\n abi,\n address,\n args,\n docsPath: '/docs/contract/multicall',\n functionName,\n });\n if (!allowFailure)\n throw error;\n return { error, result: undefined, status: 'failure' };\n }\n });\n}\n//# sourceMappingURL=multicall.js.map","export const universalSignatureValidatorByteCode = '0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572';\n//# sourceMappingURL=contracts.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// 100 lines of code in the file are duplicated from noble-hashes (utils).\n// This is OK: `abstract` directory does not use noble-hashes.\n// User may opt-in into using different hashing library. This way, noble-hashes\n// won't be included into their bundle.\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst u8a = (a) => a instanceof Uint8Array;\nconst hexes = Array.from({ length: 256 }, (v, i) => i.toString(16).padStart(2, '0'));\n/**\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nexport function bytesToHex(bytes) {\n if (!u8a(bytes))\n throw new Error('Uint8Array expected');\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\nexport function numberToHexUnpadded(num) {\n const hex = num.toString(16);\n return hex.length & 1 ? `0${hex}` : hex;\n}\nexport function hexToNumber(hex) {\n if (typeof hex !== 'string')\n throw new Error('hex string expected, got ' + typeof hex);\n // Big Endian\n return BigInt(hex === '' ? '0' : `0x${hex}`);\n}\n/**\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new Error('hex string expected, got ' + typeof hex);\n const len = hex.length;\n if (len % 2)\n throw new Error('padded hex string expected, got unpadded hex of length ' + len);\n const array = new Uint8Array(len / 2);\n for (let i = 0; i < array.length; i++) {\n const j = i * 2;\n const hexByte = hex.slice(j, j + 2);\n const byte = Number.parseInt(hexByte, 16);\n if (Number.isNaN(byte) || byte < 0)\n throw new Error('Invalid byte sequence');\n array[i] = byte;\n }\n return array;\n}\n// BE: Big Endian, LE: Little Endian\nexport function bytesToNumberBE(bytes) {\n return hexToNumber(bytesToHex(bytes));\n}\nexport function bytesToNumberLE(bytes) {\n if (!u8a(bytes))\n throw new Error('Uint8Array expected');\n return hexToNumber(bytesToHex(Uint8Array.from(bytes).reverse()));\n}\nexport function numberToBytesBE(n, len) {\n return hexToBytes(n.toString(16).padStart(len * 2, '0'));\n}\nexport function numberToBytesLE(n, len) {\n return numberToBytesBE(n, len).reverse();\n}\n// Unpadded, rarely used\nexport function numberToVarBytesBE(n) {\n return hexToBytes(numberToHexUnpadded(n));\n}\n/**\n * Takes hex string or Uint8Array, converts to Uint8Array.\n * Validates output length.\n * Will throw error for other types.\n * @param title descriptive title for an error e.g. 'private key'\n * @param hex hex string or Uint8Array\n * @param expectedLength optional, will compare to result array's length\n * @returns\n */\nexport function ensureBytes(title, hex, expectedLength) {\n let res;\n if (typeof hex === 'string') {\n try {\n res = hexToBytes(hex);\n }\n catch (e) {\n throw new Error(`${title} must be valid hex string, got \"${hex}\". Cause: ${e}`);\n }\n }\n else if (u8a(hex)) {\n // Uint8Array.from() instead of hash.slice() because node.js Buffer\n // is instance of Uint8Array, and its slice() creates **mutable** copy\n res = Uint8Array.from(hex);\n }\n else {\n throw new Error(`${title} must be hex string or Uint8Array`);\n }\n const len = res.length;\n if (typeof expectedLength === 'number' && len !== expectedLength)\n throw new Error(`${title} expected ${expectedLength} bytes, got ${len}`);\n return res;\n}\n/**\n * Copies several Uint8Arrays into one.\n */\nexport function concatBytes(...arrays) {\n const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0));\n let pad = 0; // walk through each item, ensure they have proper type\n arrays.forEach((a) => {\n if (!u8a(a))\n throw new Error('Uint8Array expected');\n r.set(a, pad);\n pad += a.length;\n });\n return r;\n}\nexport function equalBytes(b1, b2) {\n // We don't care about timing attacks here\n if (b1.length !== b2.length)\n return false;\n for (let i = 0; i < b1.length; i++)\n if (b1[i] !== b2[i])\n return false;\n return true;\n}\n/**\n * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new Error(`utf8ToBytes expected string, got ${typeof str}`);\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n// Bit operations\n/**\n * Calculates amount of bits in a bigint.\n * Same as `n.toString(2).length`\n */\nexport function bitLen(n) {\n let len;\n for (len = 0; n > _0n; n >>= _1n, len += 1)\n ;\n return len;\n}\n/**\n * Gets single bit at position.\n * NOTE: first bit position is 0 (same as arrays)\n * Same as `!!+Array.from(n.toString(2)).reverse()[pos]`\n */\nexport function bitGet(n, pos) {\n return (n >> BigInt(pos)) & _1n;\n}\n/**\n * Sets single bit at position.\n */\nexport const bitSet = (n, pos, value) => {\n return n | ((value ? _1n : _0n) << BigInt(pos));\n};\n/**\n * Calculate mask for N bits. Not using ** operator with bigints because of old engines.\n * Same as BigInt(`0b${Array(i).fill('1').join('')}`)\n */\nexport const bitMask = (n) => (_2n << BigInt(n - 1)) - _1n;\n// DRBG\nconst u8n = (data) => new Uint8Array(data); // creates Uint8Array\nconst u8fr = (arr) => Uint8Array.from(arr); // another shortcut\n/**\n * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs.\n * @returns function that will call DRBG until 2nd arg returns something meaningful\n * @example\n * const drbg = createHmacDRBG(32, 32, hmac);\n * drbg(seed, bytesToKey); // bytesToKey must return Key or undefined\n */\nexport function createHmacDrbg(hashLen, qByteLen, hmacFn) {\n if (typeof hashLen !== 'number' || hashLen < 2)\n throw new Error('hashLen must be a number');\n if (typeof qByteLen !== 'number' || qByteLen < 2)\n throw new Error('qByteLen must be a number');\n if (typeof hmacFn !== 'function')\n throw new Error('hmacFn must be a function');\n // Step B, Step C: set hashLen to 8*ceil(hlen/8)\n let v = u8n(hashLen); // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 sigs.\n let k = u8n(hashLen); // Steps B and C of RFC6979 3.2: set hashLen, in our case always same\n let i = 0; // Iterations counter, will throw when over 1000\n const reset = () => {\n v.fill(1);\n k.fill(0);\n i = 0;\n };\n const h = (...b) => hmacFn(k, v, ...b); // hmac(k)(v, ...values)\n const reseed = (seed = u8n()) => {\n // HMAC-DRBG reseed() function. Steps D-G\n k = h(u8fr([0x00]), seed); // k = hmac(k || v || 0x00 || seed)\n v = h(); // v = hmac(k || v)\n if (seed.length === 0)\n return;\n k = h(u8fr([0x01]), seed); // k = hmac(k || v || 0x01 || seed)\n v = h(); // v = hmac(k || v)\n };\n const gen = () => {\n // HMAC-DRBG generate() function\n if (i++ >= 1000)\n throw new Error('drbg: tried 1000 values');\n let len = 0;\n const out = [];\n while (len < qByteLen) {\n v = h();\n const sl = v.slice();\n out.push(sl);\n len += v.length;\n }\n return concatBytes(...out);\n };\n const genUntil = (seed, pred) => {\n reset();\n reseed(seed); // Steps D-G\n let res = undefined; // Step H: grind until k is in [1..n-1]\n while (!(res = pred(gen())))\n reseed();\n reset();\n return res;\n };\n return genUntil;\n}\n// Validating curves and fields\nconst validatorFns = {\n bigint: (val) => typeof val === 'bigint',\n function: (val) => typeof val === 'function',\n boolean: (val) => typeof val === 'boolean',\n string: (val) => typeof val === 'string',\n isSafeInteger: (val) => Number.isSafeInteger(val),\n array: (val) => Array.isArray(val),\n field: (val, object) => object.Fp.isValid(val),\n hash: (val) => typeof val === 'function' && Number.isSafeInteger(val.outputLen),\n};\n// type Record = { [P in K]: T; }\nexport function validateObject(object, validators, optValidators = {}) {\n const checkField = (fieldName, type, isOptional) => {\n const checkVal = validatorFns[type];\n if (typeof checkVal !== 'function')\n throw new Error(`Invalid validator \"${type}\", expected function`);\n const val = object[fieldName];\n if (isOptional && val === undefined)\n return;\n if (!checkVal(val, object)) {\n throw new Error(`Invalid param ${String(fieldName)}=${val} (${typeof val}), expected ${type}`);\n }\n };\n for (const [fieldName, type] of Object.entries(validators))\n checkField(fieldName, type, false);\n for (const [fieldName, type] of Object.entries(optValidators))\n checkField(fieldName, type, true);\n return object;\n}\n// validate type tests\n// const o: { a: number; b: number; c: number } = { a: 1, b: 5, c: 6 };\n// const z0 = validateObject(o, { a: 'isSafeInteger' }, { c: 'bigint' }); // Ok!\n// // Should fail type-check\n// const z1 = validateObject(o, { a: 'tmp' }, { c: 'zz' });\n// const z2 = validateObject(o, { a: 'isSafeInteger' }, { c: 'zz' });\n// const z3 = validateObject(o, { test: 'boolean', z: 'bug' });\n// const z4 = validateObject(o, { a: 'boolean', z: 'bug' });\n//# sourceMappingURL=utils.js.map","import { isHex, toBytes } from '../../index.js';\nimport { equalBytes } from '@noble/curves/abstract/utils';\nexport function isBytesEqual(a_, b_) {\n const a = isHex(a_) ? toBytes(a_) : a_;\n const b = isHex(b_) ? toBytes(b_) : b_;\n return equalBytes(a, b);\n}\n//# sourceMappingURL=isBytesEqual.js.map","import { universalSignatureValidatorAbi } from '../../constants/abis.js';\nimport { universalSignatureValidatorByteCode } from '../../constants/contracts.js';\nimport { CallExecutionError } from '../../errors/contract.js';\nimport { isBytesEqual } from '../../utils/data/isBytesEqual.js';\nimport { encodeDeployData, isHex, toHex } from '../../utils/index.js';\nimport { call } from './call.js';\n/**\n * Verifies a message hash on chain using ERC-6492.\n *\n * @param client - Client to use.\n * @param parameters - {@link VerifyHashParameters}\n * @returns Whether or not the signature is valid. {@link VerifyHashReturnType}\n */\nexport async function verifyHash(client, { address, hash, signature, ...callRequest }) {\n const signatureHex = isHex(signature) ? signature : toHex(signature);\n try {\n const { data } = await call(client, {\n data: encodeDeployData({\n abi: universalSignatureValidatorAbi,\n args: [address, hash, signatureHex],\n bytecode: universalSignatureValidatorByteCode,\n }),\n ...callRequest,\n });\n return isBytesEqual(data ?? '0x0', '0x1');\n }\n catch (error) {\n if (error instanceof CallExecutionError) {\n // if the execution fails, the signature was not valid and an internal method inside of the validator reverted\n // this can happen for many reasons, for example if signer can not be recovered from the signature\n // or if the signature has no valid format\n return false;\n }\n throw error;\n }\n}\n//# sourceMappingURL=verifyHash.js.map","import { hashMessage } from '../../utils/index.js';\nimport { verifyHash } from './verifyHash.js';\n/**\n * Verify that a message was signed by the provided address.\n *\n * Compatible with Smart Contract Accounts & Externally Owned Accounts via [ERC-6492](https://eips.ethereum.org/EIPS/eip-6492).\n *\n * - Docs {@link https://viem.sh/docs/actions/public/verifyMessage.html}\n *\n * @param client - Client to use.\n * @param parameters - {@link VerifyMessageParameters}\n * @returns Whether or not the signature is valid. {@link VerifyMessageReturnType}\n */\nexport async function verifyMessage(client, { address, message, signature, ...callRequest }) {\n const hash = hashMessage(message);\n return verifyHash(client, {\n address,\n hash,\n signature,\n ...callRequest,\n });\n}\n//# sourceMappingURL=verifyMessage.js.map","import { hashTypedData } from '../../utils/signature/hashTypedData.js';\nimport { verifyHash } from './verifyHash.js';\n/**\n * Verify that typed data was signed by the provided address.\n *\n * - Docs {@link https://viem.sh/docs/actions/public/verifyTypedData.html}\n *\n * @param client - Client to use.\n * @param parameters - {@link VerifyTypedDataParameters}\n * @returns Whether or not the signature is valid. {@link VerifyTypedDataReturnType}\n */\nexport async function verifyTypedData(client, { address, signature, message, primaryType, types, domain, ...callRequest }) {\n const hash = hashTypedData({ message, primaryType, types, domain });\n return verifyHash(client, {\n address,\n hash,\n signature,\n ...callRequest,\n });\n}\n//# sourceMappingURL=verifyTypedData.js.map","import { hexToBigInt } from '../../utils/encoding/fromHex.js';\nimport { observe } from '../../utils/observe.js';\nimport { poll } from '../../utils/poll.js';\nimport { stringify } from '../../utils/stringify.js';\nimport { getBlockNumber, } from './getBlockNumber.js';\n/**\n * Watches and returns incoming block numbers.\n *\n * - Docs: https://viem.sh/docs/actions/public/watchBlockNumber.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/watching-blocks\n * - JSON-RPC Methods:\n * - When `poll: true`, calls [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber) on a polling interval.\n * - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `\"newHeads\"` event.\n *\n * @param client - Client to use\n * @param parameters - {@link WatchBlockNumberParameters}\n * @returns A function that can be invoked to stop watching for new block numbers. {@link WatchBlockNumberReturnType}\n *\n * @example\n * import { createPublicClient, watchBlockNumber, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const unwatch = watchBlockNumber(client, {\n * onBlockNumber: (blockNumber) => console.log(blockNumber),\n * })\n */\nexport function watchBlockNumber(client, { emitOnBegin = false, emitMissed = false, onBlockNumber, onError, poll: poll_, pollingInterval = client.pollingInterval, }) {\n const enablePolling = typeof poll_ !== 'undefined' ? poll_ : client.transport.type !== 'webSocket';\n let prevBlockNumber;\n const pollBlockNumber = () => {\n const observerId = stringify([\n 'watchBlockNumber',\n client.uid,\n emitOnBegin,\n emitMissed,\n pollingInterval,\n ]);\n return observe(observerId, { onBlockNumber, onError }, (emit) => poll(async () => {\n try {\n const blockNumber = await getBlockNumber(client, { cacheTime: 0 });\n if (prevBlockNumber) {\n // If the current block number is the same as the previous,\n // we can skip.\n if (blockNumber === prevBlockNumber)\n return;\n // If we have missed out on some previous blocks, and the\n // `emitMissed` flag is truthy, let's emit those blocks.\n if (blockNumber - prevBlockNumber > 1 && emitMissed) {\n for (let i = prevBlockNumber + 1n; i < blockNumber; i++) {\n emit.onBlockNumber(i, prevBlockNumber);\n prevBlockNumber = i;\n }\n }\n }\n // If the next block number is greater than the previous,\n // it is not in the past, and we can emit the new block number.\n if (!prevBlockNumber || blockNumber > prevBlockNumber) {\n emit.onBlockNumber(blockNumber, prevBlockNumber);\n prevBlockNumber = blockNumber;\n }\n }\n catch (err) {\n emit.onError?.(err);\n }\n }, {\n emitOnBegin,\n interval: pollingInterval,\n }));\n };\n const subscribeBlockNumber = () => {\n let active = true;\n let unsubscribe = () => (active = false);\n (async () => {\n try {\n const { unsubscribe: unsubscribe_ } = await client.transport.subscribe({\n params: ['newHeads'],\n onData(data) {\n if (!active)\n return;\n const blockNumber = hexToBigInt(data.result?.number);\n onBlockNumber(blockNumber, prevBlockNumber);\n prevBlockNumber = blockNumber;\n },\n onError(error) {\n onError?.(error);\n },\n });\n unsubscribe = unsubscribe_;\n if (!active)\n unsubscribe();\n }\n catch (err) {\n onError?.(err);\n }\n })();\n return unsubscribe;\n };\n return enablePolling ? pollBlockNumber() : subscribeBlockNumber();\n}\n//# sourceMappingURL=watchBlockNumber.js.map","import { TransactionNotFoundError, TransactionReceiptNotFoundError, WaitForTransactionReceiptTimeoutError, } from '../../errors/transaction.js';\nimport { observe } from '../../utils/observe.js';\nimport { withRetry } from '../../utils/promise/withRetry.js';\nimport { stringify } from '../../utils/stringify.js';\nimport { getBlock } from './getBlock.js';\nimport { getTransaction, } from './getTransaction.js';\nimport { getTransactionReceipt, } from './getTransactionReceipt.js';\nimport { watchBlockNumber } from './watchBlockNumber.js';\n/**\n * Waits for the [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) to be included on a [Block](https://viem.sh/docs/glossary/terms.html#block) (one confirmation), and then returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms.html#transaction-receipt). If the Transaction reverts, then the action will throw an error.\n *\n * - Docs: https://viem.sh/docs/actions/public/waitForTransactionReceipt.html\n * - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/sending-transactions\n * - JSON-RPC Methods:\n * - Polls [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt) on each block until it has been processed.\n * - If a Transaction has been replaced:\n * - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) and extracts the transactions\n * - Checks if one of the Transactions is a replacement\n * - If so, calls [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt).\n *\n * The `waitForTransactionReceipt` action additionally supports Replacement detection (e.g. sped up Transactions).\n *\n * Transactions can be replaced when a user modifies their transaction in their wallet (to speed up or cancel). Transactions are replaced when they are sent from the same nonce.\n *\n * There are 3 types of Transaction Replacement reasons:\n *\n * - `repriced`: The gas price has been modified (e.g. different `maxFeePerGas`)\n * - `cancelled`: The Transaction has been cancelled (e.g. `value === 0n`)\n * - `replaced`: The Transaction has been replaced (e.g. different `value` or `data`)\n *\n * @param client - Client to use\n * @param parameters - {@link WaitForTransactionReceiptParameters}\n * @returns The transaction receipt. {@link WaitForTransactionReceiptReturnType}\n *\n * @example\n * import { createPublicClient, waitForTransactionReceipt, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const transactionReceipt = await waitForTransactionReceipt(client, {\n * hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',\n * })\n */\nexport async function waitForTransactionReceipt(client, { confirmations = 1, hash, onReplaced, pollingInterval = client.pollingInterval, timeout, }) {\n const observerId = stringify(['waitForTransactionReceipt', client.uid, hash]);\n let transaction;\n let replacedTransaction;\n let receipt;\n let retrying = false;\n return new Promise((resolve, reject) => {\n if (timeout)\n setTimeout(() => reject(new WaitForTransactionReceiptTimeoutError({ hash })), timeout);\n const _unobserve = observe(observerId, { onReplaced, resolve, reject }, (emit) => {\n const _unwatch = watchBlockNumber(client, {\n emitMissed: true,\n emitOnBegin: true,\n poll: true,\n pollingInterval,\n async onBlockNumber(blockNumber_) {\n if (retrying)\n return;\n let blockNumber = blockNumber_;\n const done = (fn) => {\n _unwatch();\n fn();\n _unobserve();\n };\n try {\n // If we already have a valid receipt, let's check if we have enough\n // confirmations. If we do, then we can resolve.\n if (receipt) {\n if (blockNumber - receipt.blockNumber + 1n < confirmations)\n return;\n done(() => emit.resolve(receipt));\n return;\n }\n // Get the transaction to check if it's been replaced.\n // We need to retry as some RPC Providers may be slow to sync\n // up mined transactions.\n if (!transaction) {\n retrying = true;\n await withRetry(async () => {\n transaction = await getTransaction(client, { hash });\n if (transaction.blockNumber)\n blockNumber = transaction.blockNumber;\n }, {\n // exponential backoff\n delay: ({ count }) => ~~(1 << count) * 200,\n retryCount: 6,\n });\n retrying = false;\n }\n // Get the receipt to check if it's been processed.\n receipt = await getTransactionReceipt(client, { hash });\n // Check if we have enough confirmations. If not, continue polling.\n if (confirmations > 0 &&\n blockNumber - receipt.blockNumber + 1n < confirmations)\n return;\n done(() => emit.resolve(receipt));\n }\n catch (err) {\n // If the receipt is not found, the transaction will be pending.\n // We need to check if it has potentially been replaced.\n if (transaction &&\n (err instanceof TransactionNotFoundError ||\n err instanceof TransactionReceiptNotFoundError)) {\n replacedTransaction = transaction;\n // Let's retrieve the transactions from the current block.\n const block = await getBlock(client, {\n blockNumber,\n includeTransactions: true,\n });\n const replacementTransaction = block.transactions.find(({ from, nonce }) => from === replacedTransaction.from &&\n nonce === replacedTransaction.nonce);\n // If we couldn't find a replacement transaction, continue polling.\n if (!replacementTransaction)\n return;\n // If we found a replacement transaction, return it's receipt.\n receipt = await getTransactionReceipt(client, {\n hash: replacementTransaction.hash,\n });\n // Check if we have enough confirmations. If not, continue polling.\n if (blockNumber - receipt.blockNumber + 1n < confirmations)\n return;\n let reason = 'replaced';\n if (replacementTransaction.to === replacedTransaction.to &&\n replacementTransaction.value === replacedTransaction.value) {\n reason = 'repriced';\n }\n else if (replacementTransaction.from === replacementTransaction.to &&\n replacementTransaction.value === 0n) {\n reason = 'cancelled';\n }\n done(() => {\n emit.onReplaced?.({\n reason,\n replacedTransaction: replacedTransaction,\n transaction: replacementTransaction,\n transactionReceipt: receipt,\n });\n emit.resolve(receipt);\n });\n }\n else {\n done(() => emit.reject(err));\n }\n }\n },\n });\n });\n });\n}\n//# sourceMappingURL=waitForTransactionReceipt.js.map","import { formatBlock } from '../../utils/formatters/block.js';\nimport { observe } from '../../utils/observe.js';\nimport { poll } from '../../utils/poll.js';\nimport { stringify } from '../../utils/stringify.js';\nimport { getBlock } from './getBlock.js';\n/**\n * Watches and returns information for incoming blocks.\n *\n * - Docs: https://viem.sh/docs/actions/public/watchBlocks.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/watching-blocks\n * - JSON-RPC Methods:\n * - When `poll: true`, calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getBlockByNumber) on a polling interval.\n * - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `\"newHeads\"` event.\n *\n * @param client - Client to use\n * @param parameters - {@link WatchBlocksParameters}\n * @returns A function that can be invoked to stop watching for new block numbers. {@link WatchBlocksReturnType}\n *\n * @example\n * import { createPublicClient, watchBlocks, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const unwatch = watchBlocks(client, {\n * onBlock: (block) => console.log(block),\n * })\n */\nexport function watchBlocks(client, { blockTag = 'latest', emitMissed = false, emitOnBegin = false, onBlock, onError, includeTransactions: includeTransactions_, poll: poll_, pollingInterval = client.pollingInterval, }) {\n const enablePolling = typeof poll_ !== 'undefined' ? poll_ : client.transport.type !== 'webSocket';\n const includeTransactions = includeTransactions_ ?? false;\n let prevBlock;\n const pollBlocks = () => {\n const observerId = stringify([\n 'watchBlocks',\n client.uid,\n emitMissed,\n emitOnBegin,\n includeTransactions,\n pollingInterval,\n ]);\n return observe(observerId, { onBlock, onError }, (emit) => poll(async () => {\n try {\n const block = await getBlock(client, {\n blockTag,\n includeTransactions,\n });\n if (block.number && prevBlock?.number) {\n // If the current block number is the same as the previous,\n // we can skip.\n if (block.number === prevBlock.number)\n return;\n // If we have missed out on some previous blocks, and the\n // `emitMissed` flag is truthy, let's emit those blocks.\n if (block.number - prevBlock.number > 1 && emitMissed) {\n for (let i = prevBlock?.number + 1n; i < block.number; i++) {\n const block = await getBlock(client, {\n blockNumber: i,\n includeTransactions,\n });\n emit.onBlock(block, prevBlock);\n prevBlock = block;\n }\n }\n }\n if (\n // If no previous block exists, emit.\n !prevBlock?.number ||\n // If the block tag is \"pending\" with no block number, emit.\n (blockTag === 'pending' && !block?.number) ||\n // If the next block number is greater than the previous block number, emit.\n // We don't want to emit blocks in the past.\n (block.number && block.number > prevBlock.number)) {\n emit.onBlock(block, prevBlock);\n prevBlock = block;\n }\n }\n catch (err) {\n emit.onError?.(err);\n }\n }, {\n emitOnBegin,\n interval: pollingInterval,\n }));\n };\n const subscribeBlocks = () => {\n let active = true;\n let unsubscribe = () => (active = false);\n (async () => {\n try {\n const { unsubscribe: unsubscribe_ } = await client.transport.subscribe({\n params: ['newHeads'],\n onData(data) {\n if (!active)\n return;\n const format = client.chain?.formatters?.block?.format || formatBlock;\n const block = format(data.result);\n onBlock(block, prevBlock);\n prevBlock = block;\n },\n onError(error) {\n onError?.(error);\n },\n });\n unsubscribe = unsubscribe_;\n if (!active)\n unsubscribe();\n }\n catch (err) {\n onError?.(err);\n }\n })();\n return unsubscribe;\n };\n return enablePolling ? pollBlocks() : subscribeBlocks();\n}\n//# sourceMappingURL=watchBlocks.js.map","import { observe } from '../../utils/observe.js';\nimport { poll } from '../../utils/poll.js';\nimport { stringify } from '../../utils/stringify.js';\nimport { DecodeLogDataMismatch, DecodeLogTopicsMismatch, } from '../../errors/abi.js';\nimport { InvalidInputRpcError } from '../../errors/rpc.js';\nimport { decodeEventLog, encodeEventTopics, formatLog, } from '../../utils/index.js';\nimport { createEventFilter, } from './createEventFilter.js';\nimport { getBlockNumber } from './getBlockNumber.js';\nimport { getFilterChanges } from './getFilterChanges.js';\nimport { getLogs } from './getLogs.js';\nimport { uninstallFilter } from './uninstallFilter.js';\n/**\n * Watches and returns emitted [Event Logs](https://viem.sh/docs/glossary/terms.html#event-log).\n *\n * - Docs: https://viem.sh/docs/actions/public/watchEvent.html\n * - JSON-RPC Methods:\n * - **RPC Provider supports `eth_newFilter`:**\n * - Calls [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter) to create a filter (called on initialize).\n * - On a polling interval, it will call [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges).\n * - **RPC Provider does not support `eth_newFilter`:**\n * - Calls [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs) for each block between the polling interval.\n *\n * This Action will batch up all the Event Logs found within the [`pollingInterval`](https://viem.sh/docs/actions/public/watchEvent.html#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/actions/public/watchEvent.html#onLogs).\n *\n * `watchEvent` will attempt to create an [Event Filter](https://viem.sh/docs/actions/public/createEventFilter.html) and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. `eth_newFilter`), then `watchEvent` will fall back to using [`getLogs`](https://viem.sh/docs/actions/public/getLogs.html) instead.\n *\n * @param client - Client to use\n * @param parameters - {@link WatchEventParameters}\n * @returns A function that can be invoked to stop watching for new Event Logs. {@link WatchEventReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { watchEvent } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const unwatch = watchEvent(client, {\n * onLogs: (logs) => console.log(logs),\n * })\n */\nexport function watchEvent(client, { address, args, batch = true, event, events, onError, onLogs, poll: poll_, pollingInterval = client.pollingInterval, strict: strict_, }) {\n const enablePolling = typeof poll_ !== 'undefined' ? poll_ : client.transport.type !== 'webSocket';\n const strict = strict_ ?? false;\n const pollEvent = () => {\n const observerId = stringify([\n 'watchEvent',\n address,\n args,\n batch,\n client.uid,\n event,\n pollingInterval,\n ]);\n return observe(observerId, { onLogs, onError }, (emit) => {\n let previousBlockNumber;\n let filter;\n let initialized = false;\n const unwatch = poll(async () => {\n if (!initialized) {\n try {\n filter = (await createEventFilter(client, {\n address,\n args,\n event: event,\n events,\n strict,\n }));\n }\n catch { }\n initialized = true;\n return;\n }\n try {\n let logs;\n if (filter) {\n logs = await getFilterChanges(client, { filter });\n }\n else {\n // If the filter doesn't exist, we will fall back to use `getLogs`.\n // The fall back exists because some RPC Providers do not support filters.\n // Fetch the block number to use for `getLogs`.\n const blockNumber = await getBlockNumber(client);\n // If the block number has changed, we will need to fetch the logs.\n // If the block number doesn't exist, we are yet to reach the first poll interval,\n // so do not emit any logs.\n if (previousBlockNumber && previousBlockNumber !== blockNumber) {\n logs = await getLogs(client, {\n address,\n args,\n event: event,\n events,\n fromBlock: previousBlockNumber + 1n,\n toBlock: blockNumber,\n });\n }\n else {\n logs = [];\n }\n previousBlockNumber = blockNumber;\n }\n if (logs.length === 0)\n return;\n if (batch)\n emit.onLogs(logs);\n else\n logs.forEach((log) => emit.onLogs([log]));\n }\n catch (err) {\n // If a filter has been set and gets uninstalled, providers will throw an InvalidInput error.\n // Reinitalize the filter when this occurs\n if (filter && err instanceof InvalidInputRpcError)\n initialized = false;\n emit.onError?.(err);\n }\n }, {\n emitOnBegin: true,\n interval: pollingInterval,\n });\n return async () => {\n if (filter)\n await uninstallFilter(client, { filter });\n unwatch();\n };\n });\n };\n const subscribeEvent = () => {\n let active = true;\n let unsubscribe = () => (active = false);\n (async () => {\n try {\n const events_ = events ?? (event ? [event] : undefined);\n let topics = [];\n if (events_) {\n topics = [\n events_.flatMap((event) => encodeEventTopics({\n abi: [event],\n eventName: event.name,\n args,\n })),\n ];\n if (event)\n topics = topics[0];\n }\n const { unsubscribe: unsubscribe_ } = await client.transport.subscribe({\n params: ['logs', { address, topics }],\n onData(data) {\n if (!active)\n return;\n const log = data.result;\n try {\n const { eventName, args } = decodeEventLog({\n abi: events_,\n data: log.data,\n topics: log.topics,\n strict,\n });\n const formatted = formatLog(log, {\n args,\n eventName: eventName,\n });\n onLogs([formatted]);\n }\n catch (err) {\n let eventName;\n let isUnnamed;\n if (err instanceof DecodeLogDataMismatch ||\n err instanceof DecodeLogTopicsMismatch) {\n // If strict mode is on, and log data/topics do not match event definition, skip.\n if (strict_)\n return;\n eventName = err.abiItem.name;\n isUnnamed = err.abiItem.inputs?.some((x) => !('name' in x && x.name));\n }\n // Set args to empty if there is an error decoding (e.g. indexed/non-indexed params mismatch).\n const formatted = formatLog(log, {\n args: isUnnamed ? [] : {},\n eventName,\n });\n onLogs([formatted]);\n }\n },\n onError(error) {\n onError?.(error);\n },\n });\n unsubscribe = unsubscribe_;\n if (!active)\n unsubscribe();\n }\n catch (err) {\n onError?.(err);\n }\n })();\n return unsubscribe;\n };\n return enablePolling ? pollEvent() : subscribeEvent();\n}\n//# sourceMappingURL=watchEvent.js.map","import { observe } from '../../utils/observe.js';\nimport { poll } from '../../utils/poll.js';\nimport { stringify } from '../../utils/stringify.js';\nimport { createPendingTransactionFilter } from './createPendingTransactionFilter.js';\nimport { getFilterChanges } from './getFilterChanges.js';\nimport { uninstallFilter } from './uninstallFilter.js';\n/**\n * Watches and returns pending transaction hashes.\n *\n * - Docs: https://viem.sh/docs/actions/public/watchPendingTransactions.html\n * - JSON-RPC Methods:\n * - When `poll: true`\n * - Calls [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter) to initialize the filter.\n * - Calls [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getFilterChanges) on a polling interval.\n * - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `\"newPendingTransactions\"` event.\n *\n * This Action will batch up all the pending transactions found within the [`pollingInterval`](https://viem.sh/docs/actions/public/watchPendingTransactions.html#pollinginterval-optional), and invoke them via [`onTransactions`](https://viem.sh/docs/actions/public/watchPendingTransactions.html#ontransactions).\n *\n * @param client - Client to use\n * @param parameters - {@link WatchPendingTransactionsParameters}\n * @returns A function that can be invoked to stop watching for new pending transaction hashes. {@link WatchPendingTransactionsReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { watchPendingTransactions } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const unwatch = await watchPendingTransactions(client, {\n * onTransactions: (hashes) => console.log(hashes),\n * })\n */\nexport function watchPendingTransactions(client, { batch = true, onError, onTransactions, poll: poll_, pollingInterval = client.pollingInterval, }) {\n const enablePolling = typeof poll_ !== 'undefined' ? poll_ : client.transport.type !== 'webSocket';\n const pollPendingTransactions = () => {\n const observerId = stringify([\n 'watchPendingTransactions',\n client.uid,\n batch,\n pollingInterval,\n ]);\n return observe(observerId, { onTransactions, onError }, (emit) => {\n let filter;\n const unwatch = poll(async () => {\n try {\n if (!filter) {\n try {\n filter = await createPendingTransactionFilter(client);\n return;\n }\n catch (err) {\n unwatch();\n throw err;\n }\n }\n const hashes = await getFilterChanges(client, { filter });\n if (hashes.length === 0)\n return;\n if (batch)\n emit.onTransactions(hashes);\n else\n hashes.forEach((hash) => emit.onTransactions([hash]));\n }\n catch (err) {\n emit.onError?.(err);\n }\n }, {\n emitOnBegin: true,\n interval: pollingInterval,\n });\n return async () => {\n if (filter)\n await uninstallFilter(client, { filter });\n unwatch();\n };\n });\n };\n const subscribePendingTransactions = () => {\n let active = true;\n let unsubscribe = () => (active = false);\n (async () => {\n try {\n const { unsubscribe: unsubscribe_ } = await client.transport.subscribe({\n params: ['newPendingTransactions'],\n onData(data) {\n if (!active)\n return;\n const transaction = data.result;\n onTransactions([transaction]);\n },\n onError(error) {\n onError?.(error);\n },\n });\n unsubscribe = unsubscribe_;\n if (!active)\n unsubscribe();\n }\n catch (err) {\n onError?.(err);\n }\n })();\n return unsubscribe;\n };\n return enablePolling\n ? pollPendingTransactions()\n : subscribePendingTransactions();\n}\n//# sourceMappingURL=watchPendingTransactions.js.map","import { getEnsAddress, } from '../../actions/ens/getEnsAddress.js';\nimport { getEnsAvatar, } from '../../actions/ens/getEnsAvatar.js';\nimport { getEnsName, } from '../../actions/ens/getEnsName.js';\nimport { getEnsResolver, } from '../../actions/ens/getEnsResolver.js';\nimport { getEnsText, } from '../../actions/ens/getEnsText.js';\nimport { call, } from '../../actions/public/call.js';\nimport { createBlockFilter, } from '../../actions/public/createBlockFilter.js';\nimport { createContractEventFilter, } from '../../actions/public/createContractEventFilter.js';\nimport { createEventFilter, } from '../../actions/public/createEventFilter.js';\nimport { createPendingTransactionFilter, } from '../../actions/public/createPendingTransactionFilter.js';\nimport { estimateContractGas, } from '../../actions/public/estimateContractGas.js';\nimport { estimateGas, } from '../../actions/public/estimateGas.js';\nimport { getBalance, } from '../../actions/public/getBalance.js';\nimport { getBlock, } from '../../actions/public/getBlock.js';\nimport { getBlockNumber, } from '../../actions/public/getBlockNumber.js';\nimport { getBlockTransactionCount, } from '../../actions/public/getBlockTransactionCount.js';\nimport { getBytecode, } from '../../actions/public/getBytecode.js';\nimport { getChainId, } from '../../actions/public/getChainId.js';\nimport { getFeeHistory, } from '../../actions/public/getFeeHistory.js';\nimport { getFilterChanges, } from '../../actions/public/getFilterChanges.js';\nimport { getFilterLogs, } from '../../actions/public/getFilterLogs.js';\nimport { getGasPrice, } from '../../actions/public/getGasPrice.js';\nimport { getLogs, } from '../../actions/public/getLogs.js';\nimport { getStorageAt, } from '../../actions/public/getStorageAt.js';\nimport { getTransaction, } from '../../actions/public/getTransaction.js';\nimport { getTransactionConfirmations, } from '../../actions/public/getTransactionConfirmations.js';\nimport { getTransactionCount, } from '../../actions/public/getTransactionCount.js';\nimport { getTransactionReceipt, } from '../../actions/public/getTransactionReceipt.js';\nimport { multicall, } from '../../actions/public/multicall.js';\nimport { readContract, } from '../../actions/public/readContract.js';\nimport { simulateContract, } from '../../actions/public/simulateContract.js';\nimport { uninstallFilter, } from '../../actions/public/uninstallFilter.js';\nimport { verifyMessage, } from '../../actions/public/verifyMessage.js';\nimport { verifyTypedData, } from '../../actions/public/verifyTypedData.js';\nimport { waitForTransactionReceipt, } from '../../actions/public/waitForTransactionReceipt.js';\nimport { watchBlockNumber, } from '../../actions/public/watchBlockNumber.js';\nimport { watchBlocks, } from '../../actions/public/watchBlocks.js';\nimport { watchContractEvent, } from '../../actions/public/watchContractEvent.js';\nimport { watchEvent, } from '../../actions/public/watchEvent.js';\nimport { watchPendingTransactions, } from '../../actions/public/watchPendingTransactions.js';\nexport function publicActions(client) {\n return {\n call: (args) => call(client, args),\n createBlockFilter: () => createBlockFilter(client),\n createContractEventFilter: (args) => createContractEventFilter(client, args),\n createEventFilter: (args) => createEventFilter(client, args),\n createPendingTransactionFilter: () => createPendingTransactionFilter(client),\n estimateContractGas: (args) => estimateContractGas(client, args),\n estimateGas: (args) => estimateGas(client, args),\n getBalance: (args) => getBalance(client, args),\n getBlock: (args) => getBlock(client, args),\n getBlockNumber: (args) => getBlockNumber(client, args),\n getBlockTransactionCount: (args) => getBlockTransactionCount(client, args),\n getBytecode: (args) => getBytecode(client, args),\n getChainId: () => getChainId(client),\n getEnsAddress: (args) => getEnsAddress(client, args),\n getEnsAvatar: (args) => getEnsAvatar(client, args),\n getEnsName: (args) => getEnsName(client, args),\n getEnsResolver: (args) => getEnsResolver(client, args),\n getEnsText: (args) => getEnsText(client, args),\n getFeeHistory: (args) => getFeeHistory(client, args),\n getFilterChanges: (args) => getFilterChanges(client, args),\n getFilterLogs: (args) => getFilterLogs(client, args),\n getGasPrice: () => getGasPrice(client),\n getLogs: (args) => getLogs(client, args),\n getStorageAt: (args) => getStorageAt(client, args),\n getTransaction: (args) => getTransaction(client, args),\n getTransactionConfirmations: (args) => getTransactionConfirmations(client, args),\n getTransactionCount: (args) => getTransactionCount(client, args),\n getTransactionReceipt: (args) => getTransactionReceipt(client, args),\n multicall: (args) => multicall(client, args),\n readContract: (args) => readContract(client, args),\n simulateContract: (args) => simulateContract(client, args),\n verifyMessage: (args) => verifyMessage(client, args),\n verifyTypedData: (args) => verifyTypedData(client, args),\n uninstallFilter: (args) => uninstallFilter(client, args),\n waitForTransactionReceipt: (args) => waitForTransactionReceipt(client, args),\n watchBlocks: (args) => watchBlocks(client, args),\n watchBlockNumber: (args) => watchBlockNumber(client, args),\n watchContractEvent: (args) => watchContractEvent(client, args),\n watchEvent: (args) => watchEvent(client, args),\n watchPendingTransactions: (args) => watchPendingTransactions(client, args),\n };\n}\n//# sourceMappingURL=public.js.map","import { createClient } from './createClient.js';\nimport { publicActions } from './decorators/public.js';\nexport function createPublicClient(parameters) {\n const { key = 'public', name = 'Public Client' } = parameters;\n const client = createClient({\n ...parameters,\n key,\n name,\n type: 'publicClient',\n });\n return client.extend(publicActions);\n}\n//# sourceMappingURL=createPublicClient.js.map","import { encodeDeployData } from '../../utils/abi/encodeDeployData.js';\nimport { sendTransaction, } from './sendTransaction.js';\n/**\n * Deploys a contract to the network, given bytecode and constructor arguments.\n *\n * - Docs: https://viem.sh/docs/contract/deployContract.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/deploying-contracts\n *\n * @param client - Client to use\n * @param parameters - {@link DeployContractParameters}\n * @returns The [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) hash. {@link DeployContractReturnType}\n *\n * @example\n * import { createWalletClient, http } from 'viem'\n * import { privateKeyToAccount } from 'viem/accounts'\n * import { mainnet } from 'viem/chains'\n * import { deployContract } from 'viem/contract'\n *\n * const client = createWalletClient({\n * account: privateKeyToAccount('0x…'),\n * chain: mainnet,\n * transport: http(),\n * })\n * const hash = await deployContract(client, {\n * abi: [],\n * account: '0x…,\n * bytecode: '0x608060405260405161083e38038061083e833981016040819052610...',\n * })\n */\nexport function deployContract(walletClient, { abi, args, bytecode, ...request }) {\n const calldata = encodeDeployData({\n abi,\n args,\n bytecode,\n });\n return sendTransaction(walletClient, {\n ...request,\n data: calldata,\n });\n}\n//# sourceMappingURL=deployContract.js.map","import { checksumAddress } from '../../utils/address/getAddress.js';\n/**\n * Returns a list of account addresses owned by the wallet or client.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/getAddresses.html\n * - JSON-RPC Methods: [`eth_accounts`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_accounts)\n *\n * @param client - Client to use\n * @returns List of account addresses owned by the wallet or client. {@link GetAddressesReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getAddresses } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n * const accounts = await getAddresses(client)\n */\nexport async function getAddresses(client) {\n const addresses = await client.request({ method: 'eth_accounts' });\n return addresses.map((address) => checksumAddress(address));\n}\n//# sourceMappingURL=getAddresses.js.map","/**\n * Gets the wallets current permissions.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/getPermissions.html\n * - JSON-RPC Methods: [`wallet_getPermissions`](https://eips.ethereum.org/EIPS/eip-2255)\n *\n * @param client - Client to use\n * @returns The wallet permissions. {@link GetPermissionsReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getPermissions } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n * const permissions = await getPermissions(client)\n */\nexport async function getPermissions(client) {\n const permissions = await client.request({ method: 'wallet_getPermissions' });\n return permissions;\n}\n//# sourceMappingURL=getPermissions.js.map","import { getAddress } from '../../utils/address/getAddress.js';\n/**\n * Requests a list of accounts managed by a wallet.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/requestAddresses.html\n * - JSON-RPC Methods: [`eth_requestAccounts`](https://eips.ethereum.org/EIPS/eip-1102)\n *\n * Sends a request to the wallet, asking for permission to access the user's accounts. After the user accepts the request, it will return a list of accounts (addresses).\n *\n * This API can be useful for dapps that need to access the user's accounts in order to execute transactions or interact with smart contracts.\n *\n * @param client - Client to use\n * @returns List of accounts managed by a wallet {@link RequestAddressesReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { requestAddresses } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n * const accounts = await requestAddresses(client)\n */\nexport async function requestAddresses(client) {\n const addresses = await client.request({ method: 'eth_requestAccounts' });\n return addresses.map((address) => getAddress(address));\n}\n//# sourceMappingURL=requestAddresses.js.map","/**\n * Requests permissions for a wallet.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/requestPermissions.html\n * - JSON-RPC Methods: [`wallet_requestPermissions`](https://eips.ethereum.org/EIPS/eip-2255)\n *\n * @param client - Client to use\n * @param parameters - {@link RequestPermissionsParameters}\n * @returns The wallet permissions. {@link RequestPermissionsReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { requestPermissions } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n * const permissions = await requestPermissions(client, {\n * eth_accounts: {}\n * })\n */\nexport async function requestPermissions(client, permissions) {\n return client.request({\n method: 'wallet_requestPermissions',\n params: [permissions],\n });\n}\n//# sourceMappingURL=requestPermissions.js.map","import { parseAccount } from '../../accounts/utils/parseAccount.js';\nimport { AccountNotFoundError } from '../../errors/account.js';\nimport { stringToHex, toHex } from '../../utils/encoding/toHex.js';\n/**\n * Calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256(\"\\x19Ethereum Signed Message:\\n\" + len(message) + message))`.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/signMessage.html\n * - JSON-RPC Methods:\n * - JSON-RPC Accounts: [`personal_sign`](https://docs.metamask.io/guide/signing-data.html#personal-sign)\n * - Local Accounts: Signs locally. No JSON-RPC request.\n *\n * With the calculated signature, you can:\n * - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage.html) to verify the signature,\n * - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress.html) to recover the signing address from a signature.\n *\n * @param client - Client to use\n * @param parameters - {@link SignMessageParameters}\n * @returns The signed message. {@link SignMessageReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { signMessage } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n * const signature = await signMessage(client, {\n * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * message: 'hello world',\n * })\n *\n * @example\n * // Account Hoisting\n * import { createWalletClient, custom } from 'viem'\n * import { privateKeyToAccount } from 'viem/accounts'\n * import { mainnet } from 'viem/chains'\n * import { signMessage } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * account: privateKeyToAccount('0x…'),\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n * const signature = await signMessage(client, {\n * message: 'hello world',\n * })\n */\nexport async function signMessage(client, { account: account_ = client.account, message, }) {\n if (!account_)\n throw new AccountNotFoundError({\n docsPath: '/docs/actions/wallet/signMessage',\n });\n const account = parseAccount(account_);\n if (account.type === 'local')\n return account.signMessage({ message });\n const message_ = (() => {\n if (typeof message === 'string')\n return stringToHex(message);\n if (message.raw instanceof Uint8Array)\n return toHex(message.raw);\n return message.raw;\n })();\n return client.request({\n method: 'personal_sign',\n params: [message_, account.address],\n });\n}\n//# sourceMappingURL=signMessage.js.map","import { parseAccount } from '../../accounts/utils/parseAccount.js';\nimport { AccountNotFoundError } from '../../errors/account.js';\nimport { isHex } from '../../utils/data/isHex.js';\nimport { stringify } from '../../utils/stringify.js';\nimport { validateTypedData } from '../../utils/typedData.js';\n/**\n * Signs typed data and calculates an Ethereum-specific signature in [https://eips.ethereum.org/EIPS/eip-712](https://eips.ethereum.org/EIPS/eip-712): `sign(keccak256(\"\\x19\\x01\" ‖ domainSeparator ‖ hashStruct(message)))`\n *\n * - Docs: https://viem.sh/docs/actions/wallet/signTypedData.html\n * - JSON-RPC Methods:\n * - JSON-RPC Accounts: [`eth_signTypedData_v4`](https://docs.metamask.io/guide/signing-data.html#signtypeddata-v4)\n * - Local Accounts: Signs locally. No JSON-RPC request.\n *\n * @param client - Client to use\n * @param parameters - {@link SignTypedDataParameters}\n * @returns The signed data. {@link SignTypedDataReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { signTypedData } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n * const signature = await signTypedData(client, {\n * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * domain: {\n * name: 'Ether Mail',\n * version: '1',\n * chainId: 1,\n * verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',\n * },\n * types: {\n * Person: [\n * { name: 'name', type: 'string' },\n * { name: 'wallet', type: 'address' },\n * ],\n * Mail: [\n * { name: 'from', type: 'Person' },\n * { name: 'to', type: 'Person' },\n * { name: 'contents', type: 'string' },\n * ],\n * },\n * primaryType: 'Mail',\n * message: {\n * from: {\n * name: 'Cow',\n * wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826',\n * },\n * to: {\n * name: 'Bob',\n * wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB',\n * },\n * contents: 'Hello, Bob!',\n * },\n * })\n *\n * @example\n * // Account Hoisting\n * import { createWalletClient, http } from 'viem'\n * import { privateKeyToAccount } from 'viem/accounts'\n * import { mainnet } from 'viem/chains'\n * import { signTypedData } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * account: privateKeyToAccount('0x…'),\n * chain: mainnet,\n * transport: http(),\n * })\n * const signature = await signTypedData(client, {\n * domain: {\n * name: 'Ether Mail',\n * version: '1',\n * chainId: 1,\n * verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',\n * },\n * types: {\n * Person: [\n * { name: 'name', type: 'string' },\n * { name: 'wallet', type: 'address' },\n * ],\n * Mail: [\n * { name: 'from', type: 'Person' },\n * { name: 'to', type: 'Person' },\n * { name: 'contents', type: 'string' },\n * ],\n * },\n * primaryType: 'Mail',\n * message: {\n * from: {\n * name: 'Cow',\n * wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826',\n * },\n * to: {\n * name: 'Bob',\n * wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB',\n * },\n * contents: 'Hello, Bob!',\n * },\n * })\n */\nexport async function signTypedData(client, { account: account_ = client.account, domain, message, primaryType, types: types_, }) {\n if (!account_)\n throw new AccountNotFoundError({\n docsPath: '/docs/actions/wallet/signTypedData',\n });\n const account = parseAccount(account_);\n const types = {\n EIP712Domain: [\n typeof domain?.name === 'string' && { name: 'name', type: 'string' },\n domain?.version && { name: 'version', type: 'string' },\n typeof domain?.chainId === 'number' && {\n name: 'chainId',\n type: 'uint256',\n },\n domain?.verifyingContract && {\n name: 'verifyingContract',\n type: 'address',\n },\n domain?.salt && { name: 'salt', type: 'bytes32' },\n ].filter(Boolean),\n ...types_,\n };\n // Need to do a runtime validation check on addresses, byte ranges, integer ranges, etc\n // as we can't statically check this with TypeScript.\n validateTypedData({\n domain,\n message,\n primaryType,\n types,\n });\n if (account.type === 'local')\n return account.signTypedData({\n domain,\n primaryType,\n types,\n message,\n });\n const typedData = stringify({ domain: domain ?? {}, primaryType, types, message }, (_, value) => (isHex(value) ? value.toLowerCase() : value));\n return client.request({\n method: 'eth_signTypedData_v4',\n params: [account.address, typedData],\n });\n}\n//# sourceMappingURL=signTypedData.js.map","import { numberToHex } from '../../utils/encoding/toHex.js';\n/**\n * Switch the target chain in a wallet.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/switchChain.html\n * - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-3326)\n *\n * @param client - Client to use\n * @param parameters - {@link SwitchChainParameters}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet, optimism } from 'viem/chains'\n * import { switchChain } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n * await switchChain(client, { id: optimism.id })\n */\nexport async function switchChain(client, { id }) {\n await client.request({\n method: 'wallet_switchEthereumChain',\n params: [\n {\n chainId: numberToHex(id),\n },\n ],\n });\n}\n//# sourceMappingURL=switchChain.js.map","/**\n * Adds an EVM chain to the wallet.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/watchAsset.html\n * - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-747)\n *\n * @param client - Client to use\n * @param parameters - {@link WatchAssetParameters}\n * @returns Boolean indicating if the token was successfully added. {@link WatchAssetReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { watchAsset } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n * const success = await watchAsset(client, {\n * type: 'ERC20',\n * options: {\n * address: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',\n * decimals: 18,\n * symbol: 'WETH',\n * },\n * })\n */\nexport async function watchAsset(client, params) {\n const added = await client.request({\n method: 'wallet_watchAsset',\n params,\n });\n return added;\n}\n//# sourceMappingURL=watchAsset.js.map","import { getChainId, } from '../../actions/public/getChainId.js';\nimport { addChain, } from '../../actions/wallet/addChain.js';\nimport { deployContract, } from '../../actions/wallet/deployContract.js';\nimport { getAddresses, } from '../../actions/wallet/getAddresses.js';\nimport { getPermissions, } from '../../actions/wallet/getPermissions.js';\nimport { requestAddresses, } from '../../actions/wallet/requestAddresses.js';\nimport { requestPermissions, } from '../../actions/wallet/requestPermissions.js';\nimport { sendTransaction, } from '../../actions/wallet/sendTransaction.js';\nimport { signMessage, } from '../../actions/wallet/signMessage.js';\nimport { signTypedData, } from '../../actions/wallet/signTypedData.js';\nimport { switchChain, } from '../../actions/wallet/switchChain.js';\nimport { watchAsset, } from '../../actions/wallet/watchAsset.js';\nimport { writeContract, } from '../../actions/wallet/writeContract.js';\nexport function walletActions(client) {\n return {\n addChain: (args) => addChain(client, args),\n deployContract: (args) => deployContract(client, args),\n getAddresses: () => getAddresses(client),\n getChainId: () => getChainId(client),\n getPermissions: () => getPermissions(client),\n requestAddresses: () => requestAddresses(client),\n requestPermissions: (args) => requestPermissions(client, args),\n sendTransaction: (args) => sendTransaction(client, args),\n signMessage: (args) => signMessage(client, args),\n signTypedData: (args) => signTypedData(client, args),\n switchChain: (args) => switchChain(client, args),\n watchAsset: (args) => watchAsset(client, args),\n writeContract: (args) => writeContract(client, args),\n };\n}\n//# sourceMappingURL=wallet.js.map","import { createClient } from './createClient.js';\nimport { walletActions } from './decorators/wallet.js';\nexport function createWalletClient(parameters) {\n const { key = 'wallet', name = 'Wallet Client', transport } = parameters;\n const client = createClient({\n ...parameters,\n key,\n name,\n transport: (opts) => transport({ ...opts, retryCount: 0 }),\n type: 'walletClient',\n });\n return client.extend(walletActions);\n}\n//# sourceMappingURL=createWalletClient.js.map","import { RpcRequestError } from '../../errors/request.js';\nimport { UrlRequiredError } from '../../errors/transport.js';\nimport { getSocket, rpc } from '../../utils/rpc.js';\nimport { createTransport, } from './createTransport.js';\n/**\n * @description Creates a WebSocket transport that connects to a JSON-RPC API.\n */\nexport function webSocket(\n/** URL of the JSON-RPC API. Defaults to the chain's public RPC URL. */\nurl, config = {}) {\n const { key = 'webSocket', name = 'WebSocket JSON-RPC', retryDelay } = config;\n return ({ chain, retryCount: retryCount_, timeout: timeout_ }) => {\n const retryCount = config.retryCount ?? retryCount_;\n const timeout = timeout_ ?? config.timeout ?? 10000;\n const url_ = url || chain?.rpcUrls.default.webSocket?.[0];\n if (!url_)\n throw new UrlRequiredError();\n return createTransport({\n key,\n name,\n async request({ method, params }) {\n const body = { method, params };\n const socket = await getSocket(url_);\n const { error, result } = await rpc.webSocketAsync(socket, {\n body,\n timeout,\n });\n if (error)\n throw new RpcRequestError({\n body,\n error,\n url: url_,\n });\n return result;\n },\n retryCount,\n retryDelay,\n timeout,\n type: 'webSocket',\n }, {\n getSocket() {\n return getSocket(url_);\n },\n async subscribe({ params, onData, onError }) {\n const socket = await getSocket(url_);\n const { result: subscriptionId } = await new Promise((resolve, reject) => rpc.webSocket(socket, {\n body: {\n method: 'eth_subscribe',\n params,\n },\n onResponse(response) {\n if (response.error) {\n reject(response.error);\n onError?.(response.error);\n return;\n }\n if (typeof response.id === 'number') {\n resolve(response);\n return;\n }\n if (response.method !== 'eth_subscription')\n return;\n onData(response.params);\n },\n }));\n return {\n subscriptionId,\n async unsubscribe() {\n return new Promise((resolve) => rpc.webSocket(socket, {\n body: {\n method: 'eth_unsubscribe',\n params: [subscriptionId],\n },\n onResponse: resolve,\n }));\n },\n };\n },\n });\n };\n}\n//# sourceMappingURL=webSocket.js.map","export function number(n) {\n if (!Number.isSafeInteger(n) || n < 0)\n throw new Error(`Wrong positive integer: ${n}`);\n}\nexport function bool(b) {\n if (typeof b !== 'boolean')\n throw new Error(`Expected boolean, not ${b}`);\n}\nexport function bytes(b, ...lengths) {\n if (!(b instanceof Uint8Array))\n throw new Error('Expected Uint8Array');\n if (lengths.length > 0 && !lengths.includes(b.length))\n throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`);\n}\nexport function hash(hash) {\n if (typeof hash !== 'function' || typeof hash.create !== 'function')\n throw new Error('Hash should be wrapped by utils.wrapConstructor');\n number(hash.outputLen);\n number(hash.blockLen);\n}\nexport function exists(instance, checkFinished = true) {\n if (instance.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished)\n throw new Error('Hash#digest() has already been called');\n}\nexport function output(out, instance) {\n bytes(out);\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error(`digestInto() expects output buffer of length at least ${min}`);\n }\n}\nconst assert = {\n number,\n bool,\n bytes,\n hash,\n exists,\n output,\n};\nexport default assert;\n//# sourceMappingURL=_assert.js.map","export const crypto = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined;\n//# sourceMappingURL=crypto.js.map","/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// node.js versions earlier than v19 don't declare it in global scope.\n// For node.js, package.json#exports field mapping rewrites import\n// from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated, we can just drop the import.\nimport { crypto } from '@noble/hashes/crypto';\nconst u8a = (a) => a instanceof Uint8Array;\n// Cast array to different type\nexport const u8 = (arr) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\nexport const u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n// Cast array to view\nexport const createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n// The rotate right (circular right shift) operation for uint32\nexport const rotr = (word, shift) => (word << (32 - shift)) | (word >>> shift);\n// big-endian hardware is rare. Just in case someone still decides to run hashes:\n// early-throw an error because we don't support BE yet.\nexport const isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44;\nif (!isLE)\n throw new Error('Non little-endian hardware is not supported');\nconst hexes = Array.from({ length: 256 }, (v, i) => i.toString(16).padStart(2, '0'));\n/**\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nexport function bytesToHex(bytes) {\n if (!u8a(bytes))\n throw new Error('Uint8Array expected');\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\n/**\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new Error('hex string expected, got ' + typeof hex);\n const len = hex.length;\n if (len % 2)\n throw new Error('padded hex string expected, got unpadded hex of length ' + len);\n const array = new Uint8Array(len / 2);\n for (let i = 0; i < array.length; i++) {\n const j = i * 2;\n const hexByte = hex.slice(j, j + 2);\n const byte = Number.parseInt(hexByte, 16);\n if (Number.isNaN(byte) || byte < 0)\n throw new Error('Invalid byte sequence');\n array[i] = byte;\n }\n return array;\n}\n// There is no setImmediate in browser and setTimeout is slow.\n// call of async fn will return Promise, which will be fullfiled only on\n// next scheduler queue processing step and this is exactly what we need.\nexport const nextTick = async () => { };\n// Returns control to thread each 'tick' ms to avoid blocking\nexport async function asyncLoop(iters, tick, cb) {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await nextTick();\n ts += diff;\n }\n}\n/**\n * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new Error(`utf8ToBytes expected string, got ${typeof str}`);\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n/**\n * Normalizes (non-hex) string or Uint8Array to Uint8Array.\n * Warning: when Uint8Array is passed, it would NOT get copied.\n * Keep in mind for future mutable operations.\n */\nexport function toBytes(data) {\n if (typeof data === 'string')\n data = utf8ToBytes(data);\n if (!u8a(data))\n throw new Error(`expected Uint8Array, got ${typeof data}`);\n return data;\n}\n/**\n * Copies several Uint8Arrays into one.\n */\nexport function concatBytes(...arrays) {\n const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0));\n let pad = 0; // walk through each item, ensure they have proper type\n arrays.forEach((a) => {\n if (!u8a(a))\n throw new Error('Uint8Array expected');\n r.set(a, pad);\n pad += a.length;\n });\n return r;\n}\n// For runtime check if class implements interface\nexport class Hash {\n // Safe version that clones internal state\n clone() {\n return this._cloneInto();\n }\n}\n// Check if object doens't have custom constructor (like Uint8Array/Array)\nconst isPlainObject = (obj) => Object.prototype.toString.call(obj) === '[object Object]' && obj.constructor === Object;\nexport function checkOpts(defaults, opts) {\n if (opts !== undefined && (typeof opts !== 'object' || !isPlainObject(opts)))\n throw new Error('Options should be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged;\n}\nexport function wrapConstructor(hashCons) {\n const hashC = (msg) => hashCons().update(toBytes(msg)).digest();\n const tmp = hashCons();\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = () => hashCons();\n return hashC;\n}\nexport function wrapConstructorWithOpts(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\nexport function wrapXOFConstructorWithOpts(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\n/**\n * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS.\n */\nexport function randomBytes(bytesLength = 32) {\n if (crypto && typeof crypto.getRandomValues === 'function') {\n return crypto.getRandomValues(new Uint8Array(bytesLength));\n }\n throw new Error('crypto.getRandomValues must be defined');\n}\n//# sourceMappingURL=utils.js.map","import assert from './_assert.js';\nimport { Hash, createView, toBytes } from './utils.js';\n// Polyfill for Safari 14\nfunction setBigUint64(view, byteOffset, value, isLE) {\n if (typeof view.setBigUint64 === 'function')\n return view.setBigUint64(byteOffset, value, isLE);\n const _32n = BigInt(32);\n const _u32_max = BigInt(0xffffffff);\n const wh = Number((value >> _32n) & _u32_max);\n const wl = Number(value & _u32_max);\n const h = isLE ? 4 : 0;\n const l = isLE ? 0 : 4;\n view.setUint32(byteOffset + h, wh, isLE);\n view.setUint32(byteOffset + l, wl, isLE);\n}\n// Base SHA2 class (RFC 6234)\nexport class SHA2 extends Hash {\n constructor(blockLen, outputLen, padOffset, isLE) {\n super();\n this.blockLen = blockLen;\n this.outputLen = outputLen;\n this.padOffset = padOffset;\n this.isLE = isLE;\n this.finished = false;\n this.length = 0;\n this.pos = 0;\n this.destroyed = false;\n this.buffer = new Uint8Array(blockLen);\n this.view = createView(this.buffer);\n }\n update(data) {\n assert.exists(this);\n const { view, buffer, blockLen } = this;\n data = toBytes(data);\n const len = data.length;\n for (let pos = 0; pos < len;) {\n const take = Math.min(blockLen - this.pos, len - pos);\n // Fast path: we have at least one block in input, cast it to view and process\n if (take === blockLen) {\n const dataView = createView(data);\n for (; blockLen <= len - pos; pos += blockLen)\n this.process(dataView, pos);\n continue;\n }\n buffer.set(data.subarray(pos, pos + take), this.pos);\n this.pos += take;\n pos += take;\n if (this.pos === blockLen) {\n this.process(view, 0);\n this.pos = 0;\n }\n }\n this.length += data.length;\n this.roundClean();\n return this;\n }\n digestInto(out) {\n assert.exists(this);\n assert.output(out, this);\n this.finished = true;\n // Padding\n // We can avoid allocation of buffer for padding completely if it\n // was previously not allocated here. But it won't change performance.\n const { buffer, view, blockLen, isLE } = this;\n let { pos } = this;\n // append the bit '1' to the message\n buffer[pos++] = 0b10000000;\n this.buffer.subarray(pos).fill(0);\n // we have less than padOffset left in buffer, so we cannot put length in current block, need process it and pad again\n if (this.padOffset > blockLen - pos) {\n this.process(view, 0);\n pos = 0;\n }\n // Pad until full block byte with zeros\n for (let i = pos; i < blockLen; i++)\n buffer[i] = 0;\n // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that\n // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen.\n // So we just write lowest 64 bits of that value.\n setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE);\n this.process(view, 0);\n const oview = createView(out);\n const len = this.outputLen;\n // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT\n if (len % 4)\n throw new Error('_sha2: outputLen should be aligned to 32bit');\n const outLen = len / 4;\n const state = this.get();\n if (outLen > state.length)\n throw new Error('_sha2: outputLen bigger than state');\n for (let i = 0; i < outLen; i++)\n oview.setUint32(4 * i, state[i], isLE);\n }\n digest() {\n const { buffer, outputLen } = this;\n this.digestInto(buffer);\n const res = buffer.slice(0, outputLen);\n this.destroy();\n return res;\n }\n _cloneInto(to) {\n to || (to = new this.constructor());\n to.set(...this.get());\n const { blockLen, buffer, length, finished, destroyed, pos } = this;\n to.length = length;\n to.pos = pos;\n to.finished = finished;\n to.destroyed = destroyed;\n if (length % blockLen)\n to.buffer.set(buffer);\n return to;\n }\n}\n//# sourceMappingURL=_sha2.js.map","import { SHA2 } from './_sha2.js';\nimport { rotr, wrapConstructor } from './utils.js';\n// Choice: a ? b : c\nconst Chi = (a, b, c) => (a & b) ^ (~a & c);\n// Majority function, true if any two inpust is true\nconst Maj = (a, b, c) => (a & b) ^ (a & c) ^ (b & c);\n// Round constants:\n// first 32 bits of the fractional parts of the cube roots of the first 64 primes 2..311)\n// prettier-ignore\nconst SHA256_K = new Uint32Array([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\n// Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19):\n// prettier-ignore\nconst IV = new Uint32Array([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19\n]);\n// Temporary buffer, not used to store anything between runs\n// Named this way because it matches specification.\nconst SHA256_W = new Uint32Array(64);\nclass SHA256 extends SHA2 {\n constructor() {\n super(64, 32, 8, false);\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n this.A = IV[0] | 0;\n this.B = IV[1] | 0;\n this.C = IV[2] | 0;\n this.D = IV[3] | 0;\n this.E = IV[4] | 0;\n this.F = IV[5] | 0;\n this.G = IV[6] | 0;\n this.H = IV[7] | 0;\n }\n get() {\n const { A, B, C, D, E, F, G, H } = this;\n return [A, B, C, D, E, F, G, H];\n }\n // prettier-ignore\n set(A, B, C, D, E, F, G, H) {\n this.A = A | 0;\n this.B = B | 0;\n this.C = C | 0;\n this.D = D | 0;\n this.E = E | 0;\n this.F = F | 0;\n this.G = G | 0;\n this.H = H | 0;\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4)\n SHA256_W[i] = view.getUint32(offset, false);\n for (let i = 16; i < 64; i++) {\n const W15 = SHA256_W[i - 15];\n const W2 = SHA256_W[i - 2];\n const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3);\n const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10);\n SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0;\n }\n // Compression function main loop, 64 rounds\n let { A, B, C, D, E, F, G, H } = this;\n for (let i = 0; i < 64; i++) {\n const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);\n const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);\n const T2 = (sigma0 + Maj(A, B, C)) | 0;\n H = G;\n G = F;\n F = E;\n E = (D + T1) | 0;\n D = C;\n C = B;\n B = A;\n A = (T1 + T2) | 0;\n }\n // Add the compressed chunk to the current hash value\n A = (A + this.A) | 0;\n B = (B + this.B) | 0;\n C = (C + this.C) | 0;\n D = (D + this.D) | 0;\n E = (E + this.E) | 0;\n F = (F + this.F) | 0;\n G = (G + this.G) | 0;\n H = (H + this.H) | 0;\n this.set(A, B, C, D, E, F, G, H);\n }\n roundClean() {\n SHA256_W.fill(0);\n }\n destroy() {\n this.set(0, 0, 0, 0, 0, 0, 0, 0);\n this.buffer.fill(0);\n }\n}\n// Constants from https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\nclass SHA224 extends SHA256 {\n constructor() {\n super();\n this.A = 0xc1059ed8 | 0;\n this.B = 0x367cd507 | 0;\n this.C = 0x3070dd17 | 0;\n this.D = 0xf70e5939 | 0;\n this.E = 0xffc00b31 | 0;\n this.F = 0x68581511 | 0;\n this.G = 0x64f98fa7 | 0;\n this.H = 0xbefa4fa4 | 0;\n this.outputLen = 28;\n }\n}\n/**\n * SHA2-256 hash function\n * @param message - data that would be hashed\n */\nexport const sha256 = wrapConstructor(() => new SHA256());\nexport const sha224 = wrapConstructor(() => new SHA224());\n//# sourceMappingURL=sha256.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// Utilities for modular arithmetics and finite fields\nimport { bitMask, numberToBytesBE, numberToBytesLE, bytesToNumberBE, bytesToNumberLE, ensureBytes, validateObject, } from './utils.js';\n// prettier-ignore\nconst _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3);\n// prettier-ignore\nconst _4n = BigInt(4), _5n = BigInt(5), _8n = BigInt(8);\n// prettier-ignore\nconst _9n = BigInt(9), _16n = BigInt(16);\n// Calculates a modulo b\nexport function mod(a, b) {\n const result = a % b;\n return result >= _0n ? result : b + result;\n}\n/**\n * Efficiently raise num to power and do modular division.\n * Unsafe in some contexts: uses ladder, so can expose bigint bits.\n * @example\n * pow(2n, 6n, 11n) // 64n % 11n == 9n\n */\n// TODO: use field version && remove\nexport function pow(num, power, modulo) {\n if (modulo <= _0n || power < _0n)\n throw new Error('Expected power/modulo > 0');\n if (modulo === _1n)\n return _0n;\n let res = _1n;\n while (power > _0n) {\n if (power & _1n)\n res = (res * num) % modulo;\n num = (num * num) % modulo;\n power >>= _1n;\n }\n return res;\n}\n// Does x ^ (2 ^ power) mod p. pow2(30, 4) == 30 ^ (2 ^ 4)\nexport function pow2(x, power, modulo) {\n let res = x;\n while (power-- > _0n) {\n res *= res;\n res %= modulo;\n }\n return res;\n}\n// Inverses number over modulo\nexport function invert(number, modulo) {\n if (number === _0n || modulo <= _0n) {\n throw new Error(`invert: expected positive integers, got n=${number} mod=${modulo}`);\n }\n // Euclidean GCD https://brilliant.org/wiki/extended-euclidean-algorithm/\n // Fermat's little theorem \"CT-like\" version inv(n) = n^(m-2) mod m is 30x slower.\n let a = mod(number, modulo);\n let b = modulo;\n // prettier-ignore\n let x = _0n, y = _1n, u = _1n, v = _0n;\n while (a !== _0n) {\n // JIT applies optimization if those two lines follow each other\n const q = b / a;\n const r = b % a;\n const m = x - u * q;\n const n = y - v * q;\n // prettier-ignore\n b = a, a = r, x = u, y = v, u = m, v = n;\n }\n const gcd = b;\n if (gcd !== _1n)\n throw new Error('invert: does not exist');\n return mod(x, modulo);\n}\n// Tonelli-Shanks algorithm\n// Paper 1: https://eprint.iacr.org/2012/685.pdf (page 12)\n// Paper 2: Square Roots from 1; 24, 51, 10 to Dan Shanks\nexport function tonelliShanks(P) {\n // Legendre constant: used to calculate Legendre symbol (a | p),\n // which denotes the value of a^((p-1)/2) (mod p).\n // (a | p) ≡ 1 if a is a square (mod p)\n // (a | p) ≡ -1 if a is not a square (mod p)\n // (a | p) ≡ 0 if a ≡ 0 (mod p)\n const legendreC = (P - _1n) / _2n;\n let Q, S, Z;\n // Step 1: By factoring out powers of 2 from p - 1,\n // find q and s such that p - 1 = q*(2^s) with q odd\n for (Q = P - _1n, S = 0; Q % _2n === _0n; Q /= _2n, S++)\n ;\n // Step 2: Select a non-square z such that (z | p) ≡ -1 and set c ≡ zq\n for (Z = _2n; Z < P && pow(Z, legendreC, P) !== P - _1n; Z++)\n ;\n // Fast-path\n if (S === 1) {\n const p1div4 = (P + _1n) / _4n;\n return function tonelliFast(Fp, n) {\n const root = Fp.pow(n, p1div4);\n if (!Fp.eql(Fp.sqr(root), n))\n throw new Error('Cannot find square root');\n return root;\n };\n }\n // Slow-path\n const Q1div2 = (Q + _1n) / _2n;\n return function tonelliSlow(Fp, n) {\n // Step 0: Check that n is indeed a square: (n | p) should not be ≡ -1\n if (Fp.pow(n, legendreC) === Fp.neg(Fp.ONE))\n throw new Error('Cannot find square root');\n let r = S;\n // TODO: will fail at Fp2/etc\n let g = Fp.pow(Fp.mul(Fp.ONE, Z), Q); // will update both x and b\n let x = Fp.pow(n, Q1div2); // first guess at the square root\n let b = Fp.pow(n, Q); // first guess at the fudge factor\n while (!Fp.eql(b, Fp.ONE)) {\n if (Fp.eql(b, Fp.ZERO))\n return Fp.ZERO; // https://en.wikipedia.org/wiki/Tonelli%E2%80%93Shanks_algorithm (4. If t = 0, return r = 0)\n // Find m such b^(2^m)==1\n let m = 1;\n for (let t2 = Fp.sqr(b); m < r; m++) {\n if (Fp.eql(t2, Fp.ONE))\n break;\n t2 = Fp.sqr(t2); // t2 *= t2\n }\n // NOTE: r-m-1 can be bigger than 32, need to convert to bigint before shift, otherwise there will be overflow\n const ge = Fp.pow(g, _1n << BigInt(r - m - 1)); // ge = 2^(r-m-1)\n g = Fp.sqr(ge); // g = ge * ge\n x = Fp.mul(x, ge); // x *= ge\n b = Fp.mul(b, g); // b *= g\n r = m;\n }\n return x;\n };\n}\nexport function FpSqrt(P) {\n // NOTE: different algorithms can give different roots, it is up to user to decide which one they want.\n // For example there is FpSqrtOdd/FpSqrtEven to choice root based on oddness (used for hash-to-curve).\n // P ≡ 3 (mod 4)\n // √n = n^((P+1)/4)\n if (P % _4n === _3n) {\n // Not all roots possible!\n // const ORDER =\n // 0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaabn;\n // const NUM = 72057594037927816n;\n const p1div4 = (P + _1n) / _4n;\n return function sqrt3mod4(Fp, n) {\n const root = Fp.pow(n, p1div4);\n // Throw if root**2 != n\n if (!Fp.eql(Fp.sqr(root), n))\n throw new Error('Cannot find square root');\n return root;\n };\n }\n // Atkin algorithm for q ≡ 5 (mod 8), https://eprint.iacr.org/2012/685.pdf (page 10)\n if (P % _8n === _5n) {\n const c1 = (P - _5n) / _8n;\n return function sqrt5mod8(Fp, n) {\n const n2 = Fp.mul(n, _2n);\n const v = Fp.pow(n2, c1);\n const nv = Fp.mul(n, v);\n const i = Fp.mul(Fp.mul(nv, _2n), v);\n const root = Fp.mul(nv, Fp.sub(i, Fp.ONE));\n if (!Fp.eql(Fp.sqr(root), n))\n throw new Error('Cannot find square root');\n return root;\n };\n }\n // P ≡ 9 (mod 16)\n if (P % _16n === _9n) {\n // NOTE: tonelli is too slow for bls-Fp2 calculations even on start\n // Means we cannot use sqrt for constants at all!\n //\n // const c1 = Fp.sqrt(Fp.negate(Fp.ONE)); // 1. c1 = sqrt(-1) in F, i.e., (c1^2) == -1 in F\n // const c2 = Fp.sqrt(c1); // 2. c2 = sqrt(c1) in F, i.e., (c2^2) == c1 in F\n // const c3 = Fp.sqrt(Fp.negate(c1)); // 3. c3 = sqrt(-c1) in F, i.e., (c3^2) == -c1 in F\n // const c4 = (P + _7n) / _16n; // 4. c4 = (q + 7) / 16 # Integer arithmetic\n // sqrt = (x) => {\n // let tv1 = Fp.pow(x, c4); // 1. tv1 = x^c4\n // let tv2 = Fp.mul(c1, tv1); // 2. tv2 = c1 * tv1\n // const tv3 = Fp.mul(c2, tv1); // 3. tv3 = c2 * tv1\n // let tv4 = Fp.mul(c3, tv1); // 4. tv4 = c3 * tv1\n // const e1 = Fp.equals(Fp.square(tv2), x); // 5. e1 = (tv2^2) == x\n // const e2 = Fp.equals(Fp.square(tv3), x); // 6. e2 = (tv3^2) == x\n // tv1 = Fp.cmov(tv1, tv2, e1); // 7. tv1 = CMOV(tv1, tv2, e1) # Select tv2 if (tv2^2) == x\n // tv2 = Fp.cmov(tv4, tv3, e2); // 8. tv2 = CMOV(tv4, tv3, e2) # Select tv3 if (tv3^2) == x\n // const e3 = Fp.equals(Fp.square(tv2), x); // 9. e3 = (tv2^2) == x\n // return Fp.cmov(tv1, tv2, e3); // 10. z = CMOV(tv1, tv2, e3) # Select the sqrt from tv1 and tv2\n // }\n }\n // Other cases: Tonelli-Shanks algorithm\n return tonelliShanks(P);\n}\n// Little-endian check for first LE bit (last BE bit);\nexport const isNegativeLE = (num, modulo) => (mod(num, modulo) & _1n) === _1n;\n// prettier-ignore\nconst FIELD_FIELDS = [\n 'create', 'isValid', 'is0', 'neg', 'inv', 'sqrt', 'sqr',\n 'eql', 'add', 'sub', 'mul', 'pow', 'div',\n 'addN', 'subN', 'mulN', 'sqrN'\n];\nexport function validateField(field) {\n const initial = {\n ORDER: 'bigint',\n MASK: 'bigint',\n BYTES: 'isSafeInteger',\n BITS: 'isSafeInteger',\n };\n const opts = FIELD_FIELDS.reduce((map, val) => {\n map[val] = 'function';\n return map;\n }, initial);\n return validateObject(field, opts);\n}\n// Generic field functions\nexport function FpPow(f, num, power) {\n // Should have same speed as pow for bigints\n // TODO: benchmark!\n if (power < _0n)\n throw new Error('Expected power > 0');\n if (power === _0n)\n return f.ONE;\n if (power === _1n)\n return num;\n let p = f.ONE;\n let d = num;\n while (power > _0n) {\n if (power & _1n)\n p = f.mul(p, d);\n d = f.sqr(d);\n power >>= _1n;\n }\n return p;\n}\n// 0 is non-invertible: non-batched version will throw on 0\nexport function FpInvertBatch(f, nums) {\n const tmp = new Array(nums.length);\n // Walk from first to last, multiply them by each other MOD p\n const lastMultiplied = nums.reduce((acc, num, i) => {\n if (f.is0(num))\n return acc;\n tmp[i] = acc;\n return f.mul(acc, num);\n }, f.ONE);\n // Invert last element\n const inverted = f.inv(lastMultiplied);\n // Walk from last to first, multiply them by inverted each other MOD p\n nums.reduceRight((acc, num, i) => {\n if (f.is0(num))\n return acc;\n tmp[i] = f.mul(acc, tmp[i]);\n return f.mul(acc, num);\n }, inverted);\n return tmp;\n}\nexport function FpDiv(f, lhs, rhs) {\n return f.mul(lhs, typeof rhs === 'bigint' ? invert(rhs, f.ORDER) : f.inv(rhs));\n}\n// This function returns True whenever the value x is a square in the field F.\nexport function FpIsSquare(f) {\n const legendreConst = (f.ORDER - _1n) / _2n; // Integer arithmetic\n return (x) => {\n const p = f.pow(x, legendreConst);\n return f.eql(p, f.ZERO) || f.eql(p, f.ONE);\n };\n}\n// CURVE.n lengths\nexport function nLength(n, nBitLength) {\n // Bit size, byte size of CURVE.n\n const _nBitLength = nBitLength !== undefined ? nBitLength : n.toString(2).length;\n const nByteLength = Math.ceil(_nBitLength / 8);\n return { nBitLength: _nBitLength, nByteLength };\n}\n/**\n * Initializes a galois field over prime. Non-primes are not supported for now.\n * Do not init in loop: slow. Very fragile: always run a benchmark on change.\n * Major performance gains:\n * a) non-normalized operations like mulN instead of mul\n * b) `Object.freeze`\n * c) Same object shape: never add or remove keys\n * @param ORDER prime positive bigint\n * @param bitLen how many bits the field consumes\n * @param isLE (def: false) if encoding / decoding should be in little-endian\n * @param redef optional faster redefinitions of sqrt and other methods\n */\nexport function Field(ORDER, bitLen, isLE = false, redef = {}) {\n if (ORDER <= _0n)\n throw new Error(`Expected Fp ORDER > 0, got ${ORDER}`);\n const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, bitLen);\n if (BYTES > 2048)\n throw new Error('Field lengths over 2048 bytes are not supported');\n const sqrtP = FpSqrt(ORDER);\n const f = Object.freeze({\n ORDER,\n BITS,\n BYTES,\n MASK: bitMask(BITS),\n ZERO: _0n,\n ONE: _1n,\n create: (num) => mod(num, ORDER),\n isValid: (num) => {\n if (typeof num !== 'bigint')\n throw new Error(`Invalid field element: expected bigint, got ${typeof num}`);\n return _0n <= num && num < ORDER; // 0 is valid element, but it's not invertible\n },\n is0: (num) => num === _0n,\n isOdd: (num) => (num & _1n) === _1n,\n neg: (num) => mod(-num, ORDER),\n eql: (lhs, rhs) => lhs === rhs,\n sqr: (num) => mod(num * num, ORDER),\n add: (lhs, rhs) => mod(lhs + rhs, ORDER),\n sub: (lhs, rhs) => mod(lhs - rhs, ORDER),\n mul: (lhs, rhs) => mod(lhs * rhs, ORDER),\n pow: (num, power) => FpPow(f, num, power),\n div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER),\n // Same as above, but doesn't normalize\n sqrN: (num) => num * num,\n addN: (lhs, rhs) => lhs + rhs,\n subN: (lhs, rhs) => lhs - rhs,\n mulN: (lhs, rhs) => lhs * rhs,\n inv: (num) => invert(num, ORDER),\n sqrt: redef.sqrt || ((n) => sqrtP(f, n)),\n invertBatch: (lst) => FpInvertBatch(f, lst),\n // TODO: do we really need constant cmov?\n // We don't have const-time bigints anyway, so probably will be not very useful\n cmov: (a, b, c) => (c ? b : a),\n toBytes: (num) => (isLE ? numberToBytesLE(num, BYTES) : numberToBytesBE(num, BYTES)),\n fromBytes: (bytes) => {\n if (bytes.length !== BYTES)\n throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes.length}`);\n return isLE ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes);\n },\n });\n return Object.freeze(f);\n}\nexport function FpSqrtOdd(Fp, elm) {\n if (!Fp.isOdd)\n throw new Error(`Field doesn't have isOdd`);\n const root = Fp.sqrt(elm);\n return Fp.isOdd(root) ? root : Fp.neg(root);\n}\nexport function FpSqrtEven(Fp, elm) {\n if (!Fp.isOdd)\n throw new Error(`Field doesn't have isOdd`);\n const root = Fp.sqrt(elm);\n return Fp.isOdd(root) ? Fp.neg(root) : root;\n}\n/**\n * FIPS 186 B.4.1-compliant \"constant-time\" private key generation utility.\n * Can take (n+8) or more bytes of uniform input e.g. from CSPRNG or KDF\n * and convert them into private scalar, with the modulo bias being negligible.\n * Needs at least 40 bytes of input for 32-byte private key.\n * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/\n * @param hash hash output from SHA3 or a similar function\n * @param groupOrder size of subgroup - (e.g. curveFn.CURVE.n)\n * @param isLE interpret hash bytes as LE num\n * @returns valid private scalar\n */\nexport function hashToPrivateScalar(hash, groupOrder, isLE = false) {\n hash = ensureBytes('privateHash', hash);\n const hashLen = hash.length;\n const minLen = nLength(groupOrder).nByteLength + 8;\n if (minLen < 24 || hashLen < minLen || hashLen > 1024)\n throw new Error(`hashToPrivateScalar: expected ${minLen}-1024 bytes of input, got ${hashLen}`);\n const num = isLE ? bytesToNumberLE(hash) : bytesToNumberBE(hash);\n return mod(num, groupOrder - _1n) + _1n;\n}\n//# sourceMappingURL=modular.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// Abelian group utilities\nimport { validateField, nLength } from './modular.js';\nimport { validateObject } from './utils.js';\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\n// Elliptic curve multiplication of Point by scalar. Fragile.\n// Scalars should always be less than curve order: this should be checked inside of a curve itself.\n// Creates precomputation tables for fast multiplication:\n// - private scalar is split by fixed size windows of W bits\n// - every window point is collected from window's table & added to accumulator\n// - since windows are different, same point inside tables won't be accessed more than once per calc\n// - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar)\n// - +1 window is neccessary for wNAF\n// - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication\n// TODO: Research returning 2d JS array of windows, instead of a single window. This would allow\n// windows to be in different memory locations\nexport function wNAF(c, bits) {\n const constTimeNegate = (condition, item) => {\n const neg = item.negate();\n return condition ? neg : item;\n };\n const opts = (W) => {\n const windows = Math.ceil(bits / W) + 1; // +1, because\n const windowSize = 2 ** (W - 1); // -1 because we skip zero\n return { windows, windowSize };\n };\n return {\n constTimeNegate,\n // non-const time multiplication ladder\n unsafeLadder(elm, n) {\n let p = c.ZERO;\n let d = elm;\n while (n > _0n) {\n if (n & _1n)\n p = p.add(d);\n d = d.double();\n n >>= _1n;\n }\n return p;\n },\n /**\n * Creates a wNAF precomputation window. Used for caching.\n * Default window size is set by `utils.precompute()` and is equal to 8.\n * Number of precomputed points depends on the curve size:\n * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where:\n * - 𝑊 is the window size\n * - 𝑛 is the bitlength of the curve order.\n * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224.\n * @returns precomputed point tables flattened to a single array\n */\n precomputeWindow(elm, W) {\n const { windows, windowSize } = opts(W);\n const points = [];\n let p = elm;\n let base = p;\n for (let window = 0; window < windows; window++) {\n base = p;\n points.push(base);\n // =1, because we skip zero\n for (let i = 1; i < windowSize; i++) {\n base = base.add(p);\n points.push(base);\n }\n p = base.double();\n }\n return points;\n },\n /**\n * Implements ec multiplication using precomputed tables and w-ary non-adjacent form.\n * @param W window size\n * @param precomputes precomputed tables\n * @param n scalar (we don't check here, but should be less than curve order)\n * @returns real and fake (for const-time) points\n */\n wNAF(W, precomputes, n) {\n // TODO: maybe check that scalar is less than group order? wNAF behavious is undefined otherwise\n // But need to carefully remove other checks before wNAF. ORDER == bits here\n const { windows, windowSize } = opts(W);\n let p = c.ZERO;\n let f = c.BASE;\n const mask = BigInt(2 ** W - 1); // Create mask with W ones: 0b1111 for W=4 etc.\n const maxNumber = 2 ** W;\n const shiftBy = BigInt(W);\n for (let window = 0; window < windows; window++) {\n const offset = window * windowSize;\n // Extract W bits.\n let wbits = Number(n & mask);\n // Shift number by W bits.\n n >>= shiftBy;\n // If the bits are bigger than max size, we'll split those.\n // +224 => 256 - 32\n if (wbits > windowSize) {\n wbits -= maxNumber;\n n += _1n;\n }\n // This code was first written with assumption that 'f' and 'p' will never be infinity point:\n // since each addition is multiplied by 2 ** W, it cannot cancel each other. However,\n // there is negate now: it is possible that negated element from low value\n // would be the same as high element, which will create carry into next window.\n // It's not obvious how this can fail, but still worth investigating later.\n // Check if we're onto Zero point.\n // Add random point inside current window to f.\n const offset1 = offset;\n const offset2 = offset + Math.abs(wbits) - 1; // -1 because we skip zero\n const cond1 = window % 2 !== 0;\n const cond2 = wbits < 0;\n if (wbits === 0) {\n // The most important part for const-time getPublicKey\n f = f.add(constTimeNegate(cond1, precomputes[offset1]));\n }\n else {\n p = p.add(constTimeNegate(cond2, precomputes[offset2]));\n }\n }\n // JIT-compiler should not eliminate f here, since it will later be used in normalizeZ()\n // Even if the variable is still unused, there are some checks which will\n // throw an exception, so compiler needs to prove they won't happen, which is hard.\n // At this point there is a way to F be infinity-point even if p is not,\n // which makes it less const-time: around 1 bigint multiply.\n return { p, f };\n },\n wNAFCached(P, precomputesMap, n, transform) {\n // @ts-ignore\n const W = P._WINDOW_SIZE || 1;\n // Calculate precomputes on a first run, reuse them after\n let comp = precomputesMap.get(P);\n if (!comp) {\n comp = this.precomputeWindow(P, W);\n if (W !== 1) {\n precomputesMap.set(P, transform(comp));\n }\n }\n return this.wNAF(W, comp, n);\n },\n };\n}\nexport function validateBasic(curve) {\n validateField(curve.Fp);\n validateObject(curve, {\n n: 'bigint',\n h: 'bigint',\n Gx: 'field',\n Gy: 'field',\n }, {\n nBitLength: 'isSafeInteger',\n nByteLength: 'isSafeInteger',\n });\n // Set defaults\n return Object.freeze({\n ...nLength(curve.n, curve.nBitLength),\n ...curve,\n ...{ p: curve.Fp.ORDER },\n });\n}\n//# sourceMappingURL=curve.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// Short Weierstrass curve. The formula is: y² = x³ + ax + b\nimport * as mod from './modular.js';\nimport * as ut from './utils.js';\nimport { ensureBytes } from './utils.js';\nimport { wNAF, validateBasic } from './curve.js';\nfunction validatePointOpts(curve) {\n const opts = validateBasic(curve);\n ut.validateObject(opts, {\n a: 'field',\n b: 'field',\n }, {\n allowedPrivateKeyLengths: 'array',\n wrapPrivateKey: 'boolean',\n isTorsionFree: 'function',\n clearCofactor: 'function',\n allowInfinityPoint: 'boolean',\n fromBytes: 'function',\n toBytes: 'function',\n });\n const { endo, Fp, a } = opts;\n if (endo) {\n if (!Fp.eql(a, Fp.ZERO)) {\n throw new Error('Endomorphism can only be defined for Koblitz curves that have a=0');\n }\n if (typeof endo !== 'object' ||\n typeof endo.beta !== 'bigint' ||\n typeof endo.splitScalar !== 'function') {\n throw new Error('Expected endomorphism with beta: bigint and splitScalar: function');\n }\n }\n return Object.freeze({ ...opts });\n}\n// ASN.1 DER encoding utilities\nconst { bytesToNumberBE: b2n, hexToBytes: h2b } = ut;\nexport const DER = {\n // asn.1 DER encoding utils\n Err: class DERErr extends Error {\n constructor(m = '') {\n super(m);\n }\n },\n _parseInt(data) {\n const { Err: E } = DER;\n if (data.length < 2 || data[0] !== 0x02)\n throw new E('Invalid signature integer tag');\n const len = data[1];\n const res = data.subarray(2, len + 2);\n if (!len || res.length !== len)\n throw new E('Invalid signature integer: wrong length');\n // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag,\n // since we always use positive integers here. It must always be empty:\n // - add zero byte if exists\n // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding)\n if (res[0] & 0b10000000)\n throw new E('Invalid signature integer: negative');\n if (res[0] === 0x00 && !(res[1] & 0b10000000))\n throw new E('Invalid signature integer: unnecessary leading zero');\n return { d: b2n(res), l: data.subarray(len + 2) }; // d is data, l is left\n },\n toSig(hex) {\n // parse DER signature\n const { Err: E } = DER;\n const data = typeof hex === 'string' ? h2b(hex) : hex;\n if (!(data instanceof Uint8Array))\n throw new Error('ui8a expected');\n let l = data.length;\n if (l < 2 || data[0] != 0x30)\n throw new E('Invalid signature tag');\n if (data[1] !== l - 2)\n throw new E('Invalid signature: incorrect length');\n const { d: r, l: sBytes } = DER._parseInt(data.subarray(2));\n const { d: s, l: rBytesLeft } = DER._parseInt(sBytes);\n if (rBytesLeft.length)\n throw new E('Invalid signature: left bytes after parsing');\n return { r, s };\n },\n hexFromSig(sig) {\n // Add leading zero if first byte has negative bit enabled. More details in '_parseInt'\n const slice = (s) => (Number.parseInt(s[0], 16) & 0b1000 ? '00' + s : s);\n const h = (num) => {\n const hex = num.toString(16);\n return hex.length & 1 ? `0${hex}` : hex;\n };\n const s = slice(h(sig.s));\n const r = slice(h(sig.r));\n const shl = s.length / 2;\n const rhl = r.length / 2;\n const sl = h(shl);\n const rl = h(rhl);\n return `30${h(rhl + shl + 4)}02${rl}${r}02${sl}${s}`;\n },\n};\n// Be friendly to bad ECMAScript parsers by not using bigint literals\n// prettier-ignore\nconst _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4);\nexport function weierstrassPoints(opts) {\n const CURVE = validatePointOpts(opts);\n const { Fp } = CURVE; // All curves has same field / group length as for now, but they can differ\n const toBytes = CURVE.toBytes ||\n ((c, point, isCompressed) => {\n const a = point.toAffine();\n return ut.concatBytes(Uint8Array.from([0x04]), Fp.toBytes(a.x), Fp.toBytes(a.y));\n });\n const fromBytes = CURVE.fromBytes ||\n ((bytes) => {\n // const head = bytes[0];\n const tail = bytes.subarray(1);\n // if (head !== 0x04) throw new Error('Only non-compressed encoding is supported');\n const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES));\n const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES));\n return { x, y };\n });\n /**\n * y² = x³ + ax + b: Short weierstrass curve formula\n * @returns y²\n */\n function weierstrassEquation(x) {\n const { a, b } = CURVE;\n const x2 = Fp.sqr(x); // x * x\n const x3 = Fp.mul(x2, x); // x2 * x\n return Fp.add(Fp.add(x3, Fp.mul(x, a)), b); // x3 + a * x + b\n }\n // Validate whether the passed curve params are valid.\n // We check if curve equation works for generator point.\n // `assertValidity()` won't work: `isTorsionFree()` is not available at this point in bls12-381.\n // ProjectivePoint class has not been initialized yet.\n if (!Fp.eql(Fp.sqr(CURVE.Gy), weierstrassEquation(CURVE.Gx)))\n throw new Error('bad generator point: equation left != right');\n // Valid group elements reside in range 1..n-1\n function isWithinCurveOrder(num) {\n return typeof num === 'bigint' && _0n < num && num < CURVE.n;\n }\n function assertGE(num) {\n if (!isWithinCurveOrder(num))\n throw new Error('Expected valid bigint: 0 < bigint < curve.n');\n }\n // Validates if priv key is valid and converts it to bigint.\n // Supports options allowedPrivateKeyLengths and wrapPrivateKey.\n function normPrivateKeyToScalar(key) {\n const { allowedPrivateKeyLengths: lengths, nByteLength, wrapPrivateKey, n } = CURVE;\n if (lengths && typeof key !== 'bigint') {\n if (key instanceof Uint8Array)\n key = ut.bytesToHex(key);\n // Normalize to hex string, pad. E.g. P521 would norm 130-132 char hex to 132-char bytes\n if (typeof key !== 'string' || !lengths.includes(key.length))\n throw new Error('Invalid key');\n key = key.padStart(nByteLength * 2, '0');\n }\n let num;\n try {\n num =\n typeof key === 'bigint'\n ? key\n : ut.bytesToNumberBE(ensureBytes('private key', key, nByteLength));\n }\n catch (error) {\n throw new Error(`private key must be ${nByteLength} bytes, hex or bigint, not ${typeof key}`);\n }\n if (wrapPrivateKey)\n num = mod.mod(num, n); // disabled by default, enabled for BLS\n assertGE(num); // num in range [1..N-1]\n return num;\n }\n const pointPrecomputes = new Map();\n function assertPrjPoint(other) {\n if (!(other instanceof Point))\n throw new Error('ProjectivePoint expected');\n }\n /**\n * Projective Point works in 3d / projective (homogeneous) coordinates: (x, y, z) ∋ (x=x/z, y=y/z)\n * Default Point works in 2d / affine coordinates: (x, y)\n * We're doing calculations in projective, because its operations don't require costly inversion.\n */\n class Point {\n constructor(px, py, pz) {\n this.px = px;\n this.py = py;\n this.pz = pz;\n if (px == null || !Fp.isValid(px))\n throw new Error('x required');\n if (py == null || !Fp.isValid(py))\n throw new Error('y required');\n if (pz == null || !Fp.isValid(pz))\n throw new Error('z required');\n }\n // Does not validate if the point is on-curve.\n // Use fromHex instead, or call assertValidity() later.\n static fromAffine(p) {\n const { x, y } = p || {};\n if (!p || !Fp.isValid(x) || !Fp.isValid(y))\n throw new Error('invalid affine point');\n if (p instanceof Point)\n throw new Error('projective point not allowed');\n const is0 = (i) => Fp.eql(i, Fp.ZERO);\n // fromAffine(x:0, y:0) would produce (x:0, y:0, z:1), but we need (x:0, y:1, z:0)\n if (is0(x) && is0(y))\n return Point.ZERO;\n return new Point(x, y, Fp.ONE);\n }\n get x() {\n return this.toAffine().x;\n }\n get y() {\n return this.toAffine().y;\n }\n /**\n * Takes a bunch of Projective Points but executes only one\n * inversion on all of them. Inversion is very slow operation,\n * so this improves performance massively.\n * Optimization: converts a list of projective points to a list of identical points with Z=1.\n */\n static normalizeZ(points) {\n const toInv = Fp.invertBatch(points.map((p) => p.pz));\n return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine);\n }\n /**\n * Converts hash string or Uint8Array to Point.\n * @param hex short/long ECDSA hex\n */\n static fromHex(hex) {\n const P = Point.fromAffine(fromBytes(ensureBytes('pointHex', hex)));\n P.assertValidity();\n return P;\n }\n // Multiplies generator point by privateKey.\n static fromPrivateKey(privateKey) {\n return Point.BASE.multiply(normPrivateKeyToScalar(privateKey));\n }\n // \"Private method\", don't use it directly\n _setWindowSize(windowSize) {\n this._WINDOW_SIZE = windowSize;\n pointPrecomputes.delete(this);\n }\n // A point on curve is valid if it conforms to equation.\n assertValidity() {\n // Zero is valid point too!\n if (this.is0()) {\n if (CURVE.allowInfinityPoint)\n return;\n throw new Error('bad point: ZERO');\n }\n // Some 3rd-party test vectors require different wording between here & `fromCompressedHex`\n const { x, y } = this.toAffine();\n // Check if x, y are valid field elements\n if (!Fp.isValid(x) || !Fp.isValid(y))\n throw new Error('bad point: x or y not FE');\n const left = Fp.sqr(y); // y²\n const right = weierstrassEquation(x); // x³ + ax + b\n if (!Fp.eql(left, right))\n throw new Error('bad point: equation left != right');\n if (!this.isTorsionFree())\n throw new Error('bad point: not in prime-order subgroup');\n }\n hasEvenY() {\n const { y } = this.toAffine();\n if (Fp.isOdd)\n return !Fp.isOdd(y);\n throw new Error(\"Field doesn't support isOdd\");\n }\n /**\n * Compare one point to another.\n */\n equals(other) {\n assertPrjPoint(other);\n const { px: X1, py: Y1, pz: Z1 } = this;\n const { px: X2, py: Y2, pz: Z2 } = other;\n const U1 = Fp.eql(Fp.mul(X1, Z2), Fp.mul(X2, Z1));\n const U2 = Fp.eql(Fp.mul(Y1, Z2), Fp.mul(Y2, Z1));\n return U1 && U2;\n }\n /**\n * Flips point to one corresponding to (x, -y) in Affine coordinates.\n */\n negate() {\n return new Point(this.px, Fp.neg(this.py), this.pz);\n }\n // Renes-Costello-Batina exception-free doubling formula.\n // There is 30% faster Jacobian formula, but it is not complete.\n // https://eprint.iacr.org/2015/1060, algorithm 3\n // Cost: 8M + 3S + 3*a + 2*b3 + 15add.\n double() {\n const { a, b } = CURVE;\n const b3 = Fp.mul(b, _3n);\n const { px: X1, py: Y1, pz: Z1 } = this;\n let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore\n let t0 = Fp.mul(X1, X1); // step 1\n let t1 = Fp.mul(Y1, Y1);\n let t2 = Fp.mul(Z1, Z1);\n let t3 = Fp.mul(X1, Y1);\n t3 = Fp.add(t3, t3); // step 5\n Z3 = Fp.mul(X1, Z1);\n Z3 = Fp.add(Z3, Z3);\n X3 = Fp.mul(a, Z3);\n Y3 = Fp.mul(b3, t2);\n Y3 = Fp.add(X3, Y3); // step 10\n X3 = Fp.sub(t1, Y3);\n Y3 = Fp.add(t1, Y3);\n Y3 = Fp.mul(X3, Y3);\n X3 = Fp.mul(t3, X3);\n Z3 = Fp.mul(b3, Z3); // step 15\n t2 = Fp.mul(a, t2);\n t3 = Fp.sub(t0, t2);\n t3 = Fp.mul(a, t3);\n t3 = Fp.add(t3, Z3);\n Z3 = Fp.add(t0, t0); // step 20\n t0 = Fp.add(Z3, t0);\n t0 = Fp.add(t0, t2);\n t0 = Fp.mul(t0, t3);\n Y3 = Fp.add(Y3, t0);\n t2 = Fp.mul(Y1, Z1); // step 25\n t2 = Fp.add(t2, t2);\n t0 = Fp.mul(t2, t3);\n X3 = Fp.sub(X3, t0);\n Z3 = Fp.mul(t2, t1);\n Z3 = Fp.add(Z3, Z3); // step 30\n Z3 = Fp.add(Z3, Z3);\n return new Point(X3, Y3, Z3);\n }\n // Renes-Costello-Batina exception-free addition formula.\n // There is 30% faster Jacobian formula, but it is not complete.\n // https://eprint.iacr.org/2015/1060, algorithm 1\n // Cost: 12M + 0S + 3*a + 3*b3 + 23add.\n add(other) {\n assertPrjPoint(other);\n const { px: X1, py: Y1, pz: Z1 } = this;\n const { px: X2, py: Y2, pz: Z2 } = other;\n let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore\n const a = CURVE.a;\n const b3 = Fp.mul(CURVE.b, _3n);\n let t0 = Fp.mul(X1, X2); // step 1\n let t1 = Fp.mul(Y1, Y2);\n let t2 = Fp.mul(Z1, Z2);\n let t3 = Fp.add(X1, Y1);\n let t4 = Fp.add(X2, Y2); // step 5\n t3 = Fp.mul(t3, t4);\n t4 = Fp.add(t0, t1);\n t3 = Fp.sub(t3, t4);\n t4 = Fp.add(X1, Z1);\n let t5 = Fp.add(X2, Z2); // step 10\n t4 = Fp.mul(t4, t5);\n t5 = Fp.add(t0, t2);\n t4 = Fp.sub(t4, t5);\n t5 = Fp.add(Y1, Z1);\n X3 = Fp.add(Y2, Z2); // step 15\n t5 = Fp.mul(t5, X3);\n X3 = Fp.add(t1, t2);\n t5 = Fp.sub(t5, X3);\n Z3 = Fp.mul(a, t4);\n X3 = Fp.mul(b3, t2); // step 20\n Z3 = Fp.add(X3, Z3);\n X3 = Fp.sub(t1, Z3);\n Z3 = Fp.add(t1, Z3);\n Y3 = Fp.mul(X3, Z3);\n t1 = Fp.add(t0, t0); // step 25\n t1 = Fp.add(t1, t0);\n t2 = Fp.mul(a, t2);\n t4 = Fp.mul(b3, t4);\n t1 = Fp.add(t1, t2);\n t2 = Fp.sub(t0, t2); // step 30\n t2 = Fp.mul(a, t2);\n t4 = Fp.add(t4, t2);\n t0 = Fp.mul(t1, t4);\n Y3 = Fp.add(Y3, t0);\n t0 = Fp.mul(t5, t4); // step 35\n X3 = Fp.mul(t3, X3);\n X3 = Fp.sub(X3, t0);\n t0 = Fp.mul(t3, t1);\n Z3 = Fp.mul(t5, Z3);\n Z3 = Fp.add(Z3, t0); // step 40\n return new Point(X3, Y3, Z3);\n }\n subtract(other) {\n return this.add(other.negate());\n }\n is0() {\n return this.equals(Point.ZERO);\n }\n wNAF(n) {\n return wnaf.wNAFCached(this, pointPrecomputes, n, (comp) => {\n const toInv = Fp.invertBatch(comp.map((p) => p.pz));\n return comp.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine);\n });\n }\n /**\n * Non-constant-time multiplication. Uses double-and-add algorithm.\n * It's faster, but should only be used when you don't care about\n * an exposed private key e.g. sig verification, which works over *public* keys.\n */\n multiplyUnsafe(n) {\n const I = Point.ZERO;\n if (n === _0n)\n return I;\n assertGE(n); // Will throw on 0\n if (n === _1n)\n return this;\n const { endo } = CURVE;\n if (!endo)\n return wnaf.unsafeLadder(this, n);\n // Apply endomorphism\n let { k1neg, k1, k2neg, k2 } = endo.splitScalar(n);\n let k1p = I;\n let k2p = I;\n let d = this;\n while (k1 > _0n || k2 > _0n) {\n if (k1 & _1n)\n k1p = k1p.add(d);\n if (k2 & _1n)\n k2p = k2p.add(d);\n d = d.double();\n k1 >>= _1n;\n k2 >>= _1n;\n }\n if (k1neg)\n k1p = k1p.negate();\n if (k2neg)\n k2p = k2p.negate();\n k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz);\n return k1p.add(k2p);\n }\n /**\n * Constant time multiplication.\n * Uses wNAF method. Windowed method may be 10% faster,\n * but takes 2x longer to generate and consumes 2x memory.\n * Uses precomputes when available.\n * Uses endomorphism for Koblitz curves.\n * @param scalar by which the point would be multiplied\n * @returns New point\n */\n multiply(scalar) {\n assertGE(scalar);\n let n = scalar;\n let point, fake; // Fake point is used to const-time mult\n const { endo } = CURVE;\n if (endo) {\n const { k1neg, k1, k2neg, k2 } = endo.splitScalar(n);\n let { p: k1p, f: f1p } = this.wNAF(k1);\n let { p: k2p, f: f2p } = this.wNAF(k2);\n k1p = wnaf.constTimeNegate(k1neg, k1p);\n k2p = wnaf.constTimeNegate(k2neg, k2p);\n k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz);\n point = k1p.add(k2p);\n fake = f1p.add(f2p);\n }\n else {\n const { p, f } = this.wNAF(n);\n point = p;\n fake = f;\n }\n // Normalize `z` for both points, but return only real one\n return Point.normalizeZ([point, fake])[0];\n }\n /**\n * Efficiently calculate `aP + bQ`. Unsafe, can expose private key, if used incorrectly.\n * Not using Strauss-Shamir trick: precomputation tables are faster.\n * The trick could be useful if both P and Q are not G (not in our case).\n * @returns non-zero affine point\n */\n multiplyAndAddUnsafe(Q, a, b) {\n const G = Point.BASE; // No Strauss-Shamir trick: we have 10% faster G precomputes\n const mul = (P, a // Select faster multiply() method\n ) => (a === _0n || a === _1n || !P.equals(G) ? P.multiplyUnsafe(a) : P.multiply(a));\n const sum = mul(this, a).add(mul(Q, b));\n return sum.is0() ? undefined : sum;\n }\n // Converts Projective point to affine (x, y) coordinates.\n // Can accept precomputed Z^-1 - for example, from invertBatch.\n // (x, y, z) ∋ (x=x/z, y=y/z)\n toAffine(iz) {\n const { px: x, py: y, pz: z } = this;\n const is0 = this.is0();\n // If invZ was 0, we return zero point. However we still want to execute\n // all operations, so we replace invZ with a random number, 1.\n if (iz == null)\n iz = is0 ? Fp.ONE : Fp.inv(z);\n const ax = Fp.mul(x, iz);\n const ay = Fp.mul(y, iz);\n const zz = Fp.mul(z, iz);\n if (is0)\n return { x: Fp.ZERO, y: Fp.ZERO };\n if (!Fp.eql(zz, Fp.ONE))\n throw new Error('invZ was invalid');\n return { x: ax, y: ay };\n }\n isTorsionFree() {\n const { h: cofactor, isTorsionFree } = CURVE;\n if (cofactor === _1n)\n return true; // No subgroups, always torsion-free\n if (isTorsionFree)\n return isTorsionFree(Point, this);\n throw new Error('isTorsionFree() has not been declared for the elliptic curve');\n }\n clearCofactor() {\n const { h: cofactor, clearCofactor } = CURVE;\n if (cofactor === _1n)\n return this; // Fast-path\n if (clearCofactor)\n return clearCofactor(Point, this);\n return this.multiplyUnsafe(CURVE.h);\n }\n toRawBytes(isCompressed = true) {\n this.assertValidity();\n return toBytes(Point, this, isCompressed);\n }\n toHex(isCompressed = true) {\n return ut.bytesToHex(this.toRawBytes(isCompressed));\n }\n }\n Point.BASE = new Point(CURVE.Gx, CURVE.Gy, Fp.ONE);\n Point.ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ZERO);\n const _bits = CURVE.nBitLength;\n const wnaf = wNAF(Point, CURVE.endo ? Math.ceil(_bits / 2) : _bits);\n // Validate if generator point is on curve\n return {\n CURVE,\n ProjectivePoint: Point,\n normPrivateKeyToScalar,\n weierstrassEquation,\n isWithinCurveOrder,\n };\n}\nfunction validateOpts(curve) {\n const opts = validateBasic(curve);\n ut.validateObject(opts, {\n hash: 'hash',\n hmac: 'function',\n randomBytes: 'function',\n }, {\n bits2int: 'function',\n bits2int_modN: 'function',\n lowS: 'boolean',\n });\n return Object.freeze({ lowS: true, ...opts });\n}\nexport function weierstrass(curveDef) {\n const CURVE = validateOpts(curveDef);\n const { Fp, n: CURVE_ORDER } = CURVE;\n const compressedLen = Fp.BYTES + 1; // e.g. 33 for 32\n const uncompressedLen = 2 * Fp.BYTES + 1; // e.g. 65 for 32\n function isValidFieldElement(num) {\n return _0n < num && num < Fp.ORDER; // 0 is banned since it's not invertible FE\n }\n function modN(a) {\n return mod.mod(a, CURVE_ORDER);\n }\n function invN(a) {\n return mod.invert(a, CURVE_ORDER);\n }\n const { ProjectivePoint: Point, normPrivateKeyToScalar, weierstrassEquation, isWithinCurveOrder, } = weierstrassPoints({\n ...CURVE,\n toBytes(c, point, isCompressed) {\n const a = point.toAffine();\n const x = Fp.toBytes(a.x);\n const cat = ut.concatBytes;\n if (isCompressed) {\n return cat(Uint8Array.from([point.hasEvenY() ? 0x02 : 0x03]), x);\n }\n else {\n return cat(Uint8Array.from([0x04]), x, Fp.toBytes(a.y));\n }\n },\n fromBytes(bytes) {\n const len = bytes.length;\n const head = bytes[0];\n const tail = bytes.subarray(1);\n // this.assertValidity() is done inside of fromHex\n if (len === compressedLen && (head === 0x02 || head === 0x03)) {\n const x = ut.bytesToNumberBE(tail);\n if (!isValidFieldElement(x))\n throw new Error('Point is not on curve');\n const y2 = weierstrassEquation(x); // y² = x³ + ax + b\n let y = Fp.sqrt(y2); // y = y² ^ (p+1)/4\n const isYOdd = (y & _1n) === _1n;\n // ECDSA\n const isHeadOdd = (head & 1) === 1;\n if (isHeadOdd !== isYOdd)\n y = Fp.neg(y);\n return { x, y };\n }\n else if (len === uncompressedLen && head === 0x04) {\n const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES));\n const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES));\n return { x, y };\n }\n else {\n throw new Error(`Point of length ${len} was invalid. Expected ${compressedLen} compressed bytes or ${uncompressedLen} uncompressed bytes`);\n }\n },\n });\n const numToNByteStr = (num) => ut.bytesToHex(ut.numberToBytesBE(num, CURVE.nByteLength));\n function isBiggerThanHalfOrder(number) {\n const HALF = CURVE_ORDER >> _1n;\n return number > HALF;\n }\n function normalizeS(s) {\n return isBiggerThanHalfOrder(s) ? modN(-s) : s;\n }\n // slice bytes num\n const slcNum = (b, from, to) => ut.bytesToNumberBE(b.slice(from, to));\n /**\n * ECDSA signature with its (r, s) properties. Supports DER & compact representations.\n */\n class Signature {\n constructor(r, s, recovery) {\n this.r = r;\n this.s = s;\n this.recovery = recovery;\n this.assertValidity();\n }\n // pair (bytes of r, bytes of s)\n static fromCompact(hex) {\n const l = CURVE.nByteLength;\n hex = ensureBytes('compactSignature', hex, l * 2);\n return new Signature(slcNum(hex, 0, l), slcNum(hex, l, 2 * l));\n }\n // DER encoded ECDSA signature\n // https://bitcoin.stackexchange.com/questions/57644/what-are-the-parts-of-a-bitcoin-transaction-input-script\n static fromDER(hex) {\n const { r, s } = DER.toSig(ensureBytes('DER', hex));\n return new Signature(r, s);\n }\n assertValidity() {\n // can use assertGE here\n if (!isWithinCurveOrder(this.r))\n throw new Error('r must be 0 < r < CURVE.n');\n if (!isWithinCurveOrder(this.s))\n throw new Error('s must be 0 < s < CURVE.n');\n }\n addRecoveryBit(recovery) {\n return new Signature(this.r, this.s, recovery);\n }\n recoverPublicKey(msgHash) {\n const { r, s, recovery: rec } = this;\n const h = bits2int_modN(ensureBytes('msgHash', msgHash)); // Truncate hash\n if (rec == null || ![0, 1, 2, 3].includes(rec))\n throw new Error('recovery id invalid');\n const radj = rec === 2 || rec === 3 ? r + CURVE.n : r;\n if (radj >= Fp.ORDER)\n throw new Error('recovery id 2 or 3 invalid');\n const prefix = (rec & 1) === 0 ? '02' : '03';\n const R = Point.fromHex(prefix + numToNByteStr(radj));\n const ir = invN(radj); // r^-1\n const u1 = modN(-h * ir); // -hr^-1\n const u2 = modN(s * ir); // sr^-1\n const Q = Point.BASE.multiplyAndAddUnsafe(R, u1, u2); // (sr^-1)R-(hr^-1)G = -(hr^-1)G + (sr^-1)\n if (!Q)\n throw new Error('point at infinify'); // unsafe is fine: no priv data leaked\n Q.assertValidity();\n return Q;\n }\n // Signatures should be low-s, to prevent malleability.\n hasHighS() {\n return isBiggerThanHalfOrder(this.s);\n }\n normalizeS() {\n return this.hasHighS() ? new Signature(this.r, modN(-this.s), this.recovery) : this;\n }\n // DER-encoded\n toDERRawBytes() {\n return ut.hexToBytes(this.toDERHex());\n }\n toDERHex() {\n return DER.hexFromSig({ r: this.r, s: this.s });\n }\n // padded bytes of r, then padded bytes of s\n toCompactRawBytes() {\n return ut.hexToBytes(this.toCompactHex());\n }\n toCompactHex() {\n return numToNByteStr(this.r) + numToNByteStr(this.s);\n }\n }\n const utils = {\n isValidPrivateKey(privateKey) {\n try {\n normPrivateKeyToScalar(privateKey);\n return true;\n }\n catch (error) {\n return false;\n }\n },\n normPrivateKeyToScalar: normPrivateKeyToScalar,\n /**\n * Produces cryptographically secure private key from random of size (nBitLength+64)\n * as per FIPS 186 B.4.1 with modulo bias being neglible.\n */\n randomPrivateKey: () => {\n const rand = CURVE.randomBytes(Fp.BYTES + 8);\n const num = mod.hashToPrivateScalar(rand, CURVE_ORDER);\n return ut.numberToBytesBE(num, CURVE.nByteLength);\n },\n /**\n * Creates precompute table for an arbitrary EC point. Makes point \"cached\".\n * Allows to massively speed-up `point.multiply(scalar)`.\n * @returns cached point\n * @example\n * const fast = utils.precompute(8, ProjectivePoint.fromHex(someonesPubKey));\n * fast.multiply(privKey); // much faster ECDH now\n */\n precompute(windowSize = 8, point = Point.BASE) {\n point._setWindowSize(windowSize);\n point.multiply(BigInt(3)); // 3 is arbitrary, just need any number here\n return point;\n },\n };\n /**\n * Computes public key for a private key. Checks for validity of the private key.\n * @param privateKey private key\n * @param isCompressed whether to return compact (default), or full key\n * @returns Public key, full when isCompressed=false; short when isCompressed=true\n */\n function getPublicKey(privateKey, isCompressed = true) {\n return Point.fromPrivateKey(privateKey).toRawBytes(isCompressed);\n }\n /**\n * Quick and dirty check for item being public key. Does not validate hex, or being on-curve.\n */\n function isProbPub(item) {\n const arr = item instanceof Uint8Array;\n const str = typeof item === 'string';\n const len = (arr || str) && item.length;\n if (arr)\n return len === compressedLen || len === uncompressedLen;\n if (str)\n return len === 2 * compressedLen || len === 2 * uncompressedLen;\n if (item instanceof Point)\n return true;\n return false;\n }\n /**\n * ECDH (Elliptic Curve Diffie Hellman).\n * Computes shared public key from private key and public key.\n * Checks: 1) private key validity 2) shared key is on-curve.\n * Does NOT hash the result.\n * @param privateA private key\n * @param publicB different public key\n * @param isCompressed whether to return compact (default), or full key\n * @returns shared public key\n */\n function getSharedSecret(privateA, publicB, isCompressed = true) {\n if (isProbPub(privateA))\n throw new Error('first arg must be private key');\n if (!isProbPub(publicB))\n throw new Error('second arg must be public key');\n const b = Point.fromHex(publicB); // check for being on-curve\n return b.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed);\n }\n // RFC6979: ensure ECDSA msg is X bytes and < N. RFC suggests optional truncating via bits2octets.\n // FIPS 186-4 4.6 suggests the leftmost min(nBitLen, outLen) bits, which matches bits2int.\n // bits2int can produce res>N, we can do mod(res, N) since the bitLen is the same.\n // int2octets can't be used; pads small msgs with 0: unacceptatble for trunc as per RFC vectors\n const bits2int = CURVE.bits2int ||\n function (bytes) {\n // For curves with nBitLength % 8 !== 0: bits2octets(bits2octets(m)) !== bits2octets(m)\n // for some cases, since bytes.length * 8 is not actual bitLength.\n const num = ut.bytesToNumberBE(bytes); // check for == u8 done here\n const delta = bytes.length * 8 - CURVE.nBitLength; // truncate to nBitLength leftmost bits\n return delta > 0 ? num >> BigInt(delta) : num;\n };\n const bits2int_modN = CURVE.bits2int_modN ||\n function (bytes) {\n return modN(bits2int(bytes)); // can't use bytesToNumberBE here\n };\n // NOTE: pads output with zero as per spec\n const ORDER_MASK = ut.bitMask(CURVE.nBitLength);\n /**\n * Converts to bytes. Checks if num in `[0..ORDER_MASK-1]` e.g.: `[0..2^256-1]`.\n */\n function int2octets(num) {\n if (typeof num !== 'bigint')\n throw new Error('bigint expected');\n if (!(_0n <= num && num < ORDER_MASK))\n throw new Error(`bigint expected < 2^${CURVE.nBitLength}`);\n // works with order, can have different size than numToField!\n return ut.numberToBytesBE(num, CURVE.nByteLength);\n }\n // Steps A, D of RFC6979 3.2\n // Creates RFC6979 seed; converts msg/privKey to numbers.\n // Used only in sign, not in verify.\n // NOTE: we cannot assume here that msgHash has same amount of bytes as curve order, this will be wrong at least for P521.\n // Also it can be bigger for P224 + SHA256\n function prepSig(msgHash, privateKey, opts = defaultSigOpts) {\n if (['recovered', 'canonical'].some((k) => k in opts))\n throw new Error('sign() legacy options not supported');\n const { hash, randomBytes } = CURVE;\n let { lowS, prehash, extraEntropy: ent } = opts; // generates low-s sigs by default\n if (lowS == null)\n lowS = true; // RFC6979 3.2: we skip step A, because we already provide hash\n msgHash = ensureBytes('msgHash', msgHash);\n if (prehash)\n msgHash = ensureBytes('prehashed msgHash', hash(msgHash));\n // We can't later call bits2octets, since nested bits2int is broken for curves\n // with nBitLength % 8 !== 0. Because of that, we unwrap it here as int2octets call.\n // const bits2octets = (bits) => int2octets(bits2int_modN(bits))\n const h1int = bits2int_modN(msgHash);\n const d = normPrivateKeyToScalar(privateKey); // validate private key, convert to bigint\n const seedArgs = [int2octets(d), int2octets(h1int)];\n // extraEntropy. RFC6979 3.6: additional k' (optional).\n if (ent != null) {\n // K = HMAC_K(V || 0x00 || int2octets(x) || bits2octets(h1) || k')\n const e = ent === true ? randomBytes(Fp.BYTES) : ent; // generate random bytes OR pass as-is\n seedArgs.push(ensureBytes('extraEntropy', e, Fp.BYTES)); // check for being of size BYTES\n }\n const seed = ut.concatBytes(...seedArgs); // Step D of RFC6979 3.2\n const m = h1int; // NOTE: no need to call bits2int second time here, it is inside truncateHash!\n // Converts signature params into point w r/s, checks result for validity.\n function k2sig(kBytes) {\n // RFC 6979 Section 3.2, step 3: k = bits2int(T)\n const k = bits2int(kBytes); // Cannot use fields methods, since it is group element\n if (!isWithinCurveOrder(k))\n return; // Important: all mod() calls here must be done over N\n const ik = invN(k); // k^-1 mod n\n const q = Point.BASE.multiply(k).toAffine(); // q = Gk\n const r = modN(q.x); // r = q.x mod n\n if (r === _0n)\n return;\n // Can use scalar blinding b^-1(bm + bdr) where b ∈ [1,q−1] according to\n // https://tches.iacr.org/index.php/TCHES/article/view/7337/6509. We've decided against it:\n // a) dependency on CSPRNG b) 15% slowdown c) doesn't really help since bigints are not CT\n const s = modN(ik * modN(m + r * d)); // Not using blinding here\n if (s === _0n)\n return;\n let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n); // recovery bit (2 or 3, when q.x > n)\n let normS = s;\n if (lowS && isBiggerThanHalfOrder(s)) {\n normS = normalizeS(s); // if lowS was passed, ensure s is always\n recovery ^= 1; // // in the bottom half of N\n }\n return new Signature(r, normS, recovery); // use normS, not s\n }\n return { seed, k2sig };\n }\n const defaultSigOpts = { lowS: CURVE.lowS, prehash: false };\n const defaultVerOpts = { lowS: CURVE.lowS, prehash: false };\n /**\n * Signs message hash with a private key.\n * ```\n * sign(m, d, k) where\n * (x, y) = G × k\n * r = x mod n\n * s = (m + dr)/k mod n\n * ```\n * @param msgHash NOT message. msg needs to be hashed to `msgHash`, or use `prehash`.\n * @param privKey private key\n * @param opts lowS for non-malleable sigs. extraEntropy for mixing randomness into k. prehash will hash first arg.\n * @returns signature with recovery param\n */\n function sign(msgHash, privKey, opts = defaultSigOpts) {\n const { seed, k2sig } = prepSig(msgHash, privKey, opts); // Steps A, D of RFC6979 3.2.\n const C = CURVE;\n const drbg = ut.createHmacDrbg(C.hash.outputLen, C.nByteLength, C.hmac);\n return drbg(seed, k2sig); // Steps B, C, D, E, F, G\n }\n // Enable precomputes. Slows down first publicKey computation by 20ms.\n Point.BASE._setWindowSize(8);\n // utils.precompute(8, ProjectivePoint.BASE)\n /**\n * Verifies a signature against message hash and public key.\n * Rejects lowS signatures by default: to override,\n * specify option `{lowS: false}`. Implements section 4.1.4 from https://www.secg.org/sec1-v2.pdf:\n *\n * ```\n * verify(r, s, h, P) where\n * U1 = hs^-1 mod n\n * U2 = rs^-1 mod n\n * R = U1⋅G - U2⋅P\n * mod(R.x, n) == r\n * ```\n */\n function verify(signature, msgHash, publicKey, opts = defaultVerOpts) {\n const sg = signature;\n msgHash = ensureBytes('msgHash', msgHash);\n publicKey = ensureBytes('publicKey', publicKey);\n if ('strict' in opts)\n throw new Error('options.strict was renamed to lowS');\n const { lowS, prehash } = opts;\n let _sig = undefined;\n let P;\n try {\n if (typeof sg === 'string' || sg instanceof Uint8Array) {\n // Signature can be represented in 2 ways: compact (2*nByteLength) & DER (variable-length).\n // Since DER can also be 2*nByteLength bytes, we check for it first.\n try {\n _sig = Signature.fromDER(sg);\n }\n catch (derError) {\n if (!(derError instanceof DER.Err))\n throw derError;\n _sig = Signature.fromCompact(sg);\n }\n }\n else if (typeof sg === 'object' && typeof sg.r === 'bigint' && typeof sg.s === 'bigint') {\n const { r, s } = sg;\n _sig = new Signature(r, s);\n }\n else {\n throw new Error('PARSE');\n }\n P = Point.fromHex(publicKey);\n }\n catch (error) {\n if (error.message === 'PARSE')\n throw new Error(`signature must be Signature instance, Uint8Array or hex string`);\n return false;\n }\n if (lowS && _sig.hasHighS())\n return false;\n if (prehash)\n msgHash = CURVE.hash(msgHash);\n const { r, s } = _sig;\n const h = bits2int_modN(msgHash); // Cannot use fields methods, since it is group element\n const is = invN(s); // s^-1\n const u1 = modN(h * is); // u1 = hs^-1 mod n\n const u2 = modN(r * is); // u2 = rs^-1 mod n\n const R = Point.BASE.multiplyAndAddUnsafe(P, u1, u2)?.toAffine(); // R = u1⋅G + u2⋅P\n if (!R)\n return false;\n const v = modN(R.x);\n return v === r;\n }\n return {\n CURVE,\n getPublicKey,\n getSharedSecret,\n sign,\n verify,\n ProjectivePoint: Point,\n Signature,\n utils,\n };\n}\n/**\n * Implementation of the Shallue and van de Woestijne method for any weierstrass curve.\n * TODO: check if there is a way to merge this with uvRatio in Edwards; move to modular.\n * b = True and y = sqrt(u / v) if (u / v) is square in F, and\n * b = False and y = sqrt(Z * (u / v)) otherwise.\n * @param Fp\n * @param Z\n * @returns\n */\nexport function SWUFpSqrtRatio(Fp, Z) {\n // Generic implementation\n const q = Fp.ORDER;\n let l = _0n;\n for (let o = q - _1n; o % _2n === _0n; o /= _2n)\n l += _1n;\n const c1 = l; // 1. c1, the largest integer such that 2^c1 divides q - 1.\n // We need 2n ** c1 and 2n ** (c1-1). We can't use **; but we can use <<.\n // 2n ** c1 == 2n << (c1-1)\n const _2n_pow_c1_1 = _2n << (c1 - _1n - _1n);\n const _2n_pow_c1 = _2n_pow_c1_1 * _2n;\n const c2 = (q - _1n) / _2n_pow_c1; // 2. c2 = (q - 1) / (2^c1) # Integer arithmetic\n const c3 = (c2 - _1n) / _2n; // 3. c3 = (c2 - 1) / 2 # Integer arithmetic\n const c4 = _2n_pow_c1 - _1n; // 4. c4 = 2^c1 - 1 # Integer arithmetic\n const c5 = _2n_pow_c1_1; // 5. c5 = 2^(c1 - 1) # Integer arithmetic\n const c6 = Fp.pow(Z, c2); // 6. c6 = Z^c2\n const c7 = Fp.pow(Z, (c2 + _1n) / _2n); // 7. c7 = Z^((c2 + 1) / 2)\n let sqrtRatio = (u, v) => {\n let tv1 = c6; // 1. tv1 = c6\n let tv2 = Fp.pow(v, c4); // 2. tv2 = v^c4\n let tv3 = Fp.sqr(tv2); // 3. tv3 = tv2^2\n tv3 = Fp.mul(tv3, v); // 4. tv3 = tv3 * v\n let tv5 = Fp.mul(u, tv3); // 5. tv5 = u * tv3\n tv5 = Fp.pow(tv5, c3); // 6. tv5 = tv5^c3\n tv5 = Fp.mul(tv5, tv2); // 7. tv5 = tv5 * tv2\n tv2 = Fp.mul(tv5, v); // 8. tv2 = tv5 * v\n tv3 = Fp.mul(tv5, u); // 9. tv3 = tv5 * u\n let tv4 = Fp.mul(tv3, tv2); // 10. tv4 = tv3 * tv2\n tv5 = Fp.pow(tv4, c5); // 11. tv5 = tv4^c5\n let isQR = Fp.eql(tv5, Fp.ONE); // 12. isQR = tv5 == 1\n tv2 = Fp.mul(tv3, c7); // 13. tv2 = tv3 * c7\n tv5 = Fp.mul(tv4, tv1); // 14. tv5 = tv4 * tv1\n tv3 = Fp.cmov(tv2, tv3, isQR); // 15. tv3 = CMOV(tv2, tv3, isQR)\n tv4 = Fp.cmov(tv5, tv4, isQR); // 16. tv4 = CMOV(tv5, tv4, isQR)\n // 17. for i in (c1, c1 - 1, ..., 2):\n for (let i = c1; i > _1n; i--) {\n let tv5 = i - _2n; // 18. tv5 = i - 2\n tv5 = _2n << (tv5 - _1n); // 19. tv5 = 2^tv5\n let tvv5 = Fp.pow(tv4, tv5); // 20. tv5 = tv4^tv5\n const e1 = Fp.eql(tvv5, Fp.ONE); // 21. e1 = tv5 == 1\n tv2 = Fp.mul(tv3, tv1); // 22. tv2 = tv3 * tv1\n tv1 = Fp.mul(tv1, tv1); // 23. tv1 = tv1 * tv1\n tvv5 = Fp.mul(tv4, tv1); // 24. tv5 = tv4 * tv1\n tv3 = Fp.cmov(tv2, tv3, e1); // 25. tv3 = CMOV(tv2, tv3, e1)\n tv4 = Fp.cmov(tvv5, tv4, e1); // 26. tv4 = CMOV(tv5, tv4, e1)\n }\n return { isValid: isQR, value: tv3 };\n };\n if (Fp.ORDER % _4n === _3n) {\n // sqrt_ratio_3mod4(u, v)\n const c1 = (Fp.ORDER - _3n) / _4n; // 1. c1 = (q - 3) / 4 # Integer arithmetic\n const c2 = Fp.sqrt(Fp.neg(Z)); // 2. c2 = sqrt(-Z)\n sqrtRatio = (u, v) => {\n let tv1 = Fp.sqr(v); // 1. tv1 = v^2\n const tv2 = Fp.mul(u, v); // 2. tv2 = u * v\n tv1 = Fp.mul(tv1, tv2); // 3. tv1 = tv1 * tv2\n let y1 = Fp.pow(tv1, c1); // 4. y1 = tv1^c1\n y1 = Fp.mul(y1, tv2); // 5. y1 = y1 * tv2\n const y2 = Fp.mul(y1, c2); // 6. y2 = y1 * c2\n const tv3 = Fp.mul(Fp.sqr(y1), v); // 7. tv3 = y1^2; 8. tv3 = tv3 * v\n const isQR = Fp.eql(tv3, u); // 9. isQR = tv3 == u\n let y = Fp.cmov(y2, y1, isQR); // 10. y = CMOV(y2, y1, isQR)\n return { isValid: isQR, value: y }; // 11. return (isQR, y) isQR ? y : y*c2\n };\n }\n // No curves uses that\n // if (Fp.ORDER % _8n === _5n) // sqrt_ratio_5mod8\n return sqrtRatio;\n}\n/**\n * From draft-irtf-cfrg-hash-to-curve-16\n */\nexport function mapToCurveSimpleSWU(Fp, opts) {\n mod.validateField(Fp);\n if (!Fp.isValid(opts.A) || !Fp.isValid(opts.B) || !Fp.isValid(opts.Z))\n throw new Error('mapToCurveSimpleSWU: invalid opts');\n const sqrtRatio = SWUFpSqrtRatio(Fp, opts.Z);\n if (!Fp.isOdd)\n throw new Error('Fp.isOdd is not implemented!');\n // Input: u, an element of F.\n // Output: (x, y), a point on E.\n return (u) => {\n // prettier-ignore\n let tv1, tv2, tv3, tv4, tv5, tv6, x, y;\n tv1 = Fp.sqr(u); // 1. tv1 = u^2\n tv1 = Fp.mul(tv1, opts.Z); // 2. tv1 = Z * tv1\n tv2 = Fp.sqr(tv1); // 3. tv2 = tv1^2\n tv2 = Fp.add(tv2, tv1); // 4. tv2 = tv2 + tv1\n tv3 = Fp.add(tv2, Fp.ONE); // 5. tv3 = tv2 + 1\n tv3 = Fp.mul(tv3, opts.B); // 6. tv3 = B * tv3\n tv4 = Fp.cmov(opts.Z, Fp.neg(tv2), !Fp.eql(tv2, Fp.ZERO)); // 7. tv4 = CMOV(Z, -tv2, tv2 != 0)\n tv4 = Fp.mul(tv4, opts.A); // 8. tv4 = A * tv4\n tv2 = Fp.sqr(tv3); // 9. tv2 = tv3^2\n tv6 = Fp.sqr(tv4); // 10. tv6 = tv4^2\n tv5 = Fp.mul(tv6, opts.A); // 11. tv5 = A * tv6\n tv2 = Fp.add(tv2, tv5); // 12. tv2 = tv2 + tv5\n tv2 = Fp.mul(tv2, tv3); // 13. tv2 = tv2 * tv3\n tv6 = Fp.mul(tv6, tv4); // 14. tv6 = tv6 * tv4\n tv5 = Fp.mul(tv6, opts.B); // 15. tv5 = B * tv6\n tv2 = Fp.add(tv2, tv5); // 16. tv2 = tv2 + tv5\n x = Fp.mul(tv1, tv3); // 17. x = tv1 * tv3\n const { isValid, value } = sqrtRatio(tv2, tv6); // 18. (is_gx1_square, y1) = sqrt_ratio(tv2, tv6)\n y = Fp.mul(tv1, u); // 19. y = tv1 * u -> Z * u^3 * y1\n y = Fp.mul(y, value); // 20. y = y * y1\n x = Fp.cmov(x, tv3, isValid); // 21. x = CMOV(x, tv3, is_gx1_square)\n y = Fp.cmov(y, value, isValid); // 22. y = CMOV(y, y1, is_gx1_square)\n const e1 = Fp.isOdd(u) === Fp.isOdd(y); // 23. e1 = sgn0(u) == sgn0(y)\n y = Fp.cmov(Fp.neg(y), y, e1); // 24. y = CMOV(-y, y, e1)\n x = Fp.div(x, tv4); // 25. x = x / tv4\n return { x, y };\n };\n}\n//# sourceMappingURL=weierstrass.js.map","import assert from './_assert.js';\nimport { Hash, toBytes } from './utils.js';\n// HMAC (RFC 2104)\nexport class HMAC extends Hash {\n constructor(hash, _key) {\n super();\n this.finished = false;\n this.destroyed = false;\n assert.hash(hash);\n const key = toBytes(_key);\n this.iHash = hash.create();\n if (typeof this.iHash.update !== 'function')\n throw new Error('Expected instance of class which extends utils.Hash');\n this.blockLen = this.iHash.blockLen;\n this.outputLen = this.iHash.outputLen;\n const blockLen = this.blockLen;\n const pad = new Uint8Array(blockLen);\n // blockLen can be bigger than outputLen\n pad.set(key.length > blockLen ? hash.create().update(key).digest() : key);\n for (let i = 0; i < pad.length; i++)\n pad[i] ^= 0x36;\n this.iHash.update(pad);\n // By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone\n this.oHash = hash.create();\n // Undo internal XOR && apply outer XOR\n for (let i = 0; i < pad.length; i++)\n pad[i] ^= 0x36 ^ 0x5c;\n this.oHash.update(pad);\n pad.fill(0);\n }\n update(buf) {\n assert.exists(this);\n this.iHash.update(buf);\n return this;\n }\n digestInto(out) {\n assert.exists(this);\n assert.bytes(out, this.outputLen);\n this.finished = true;\n this.iHash.digestInto(out);\n this.oHash.update(out);\n this.oHash.digestInto(out);\n this.destroy();\n }\n digest() {\n const out = new Uint8Array(this.oHash.outputLen);\n this.digestInto(out);\n return out;\n }\n _cloneInto(to) {\n // Create new instance without calling constructor since key already in state and we don't know it.\n to || (to = Object.create(Object.getPrototypeOf(this), {}));\n const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this;\n to = to;\n to.finished = finished;\n to.destroyed = destroyed;\n to.blockLen = blockLen;\n to.outputLen = outputLen;\n to.oHash = oHash._cloneInto(to.oHash);\n to.iHash = iHash._cloneInto(to.iHash);\n return to;\n }\n destroy() {\n this.destroyed = true;\n this.oHash.destroy();\n this.iHash.destroy();\n }\n}\n/**\n * HMAC: RFC2104 message authentication code.\n * @param hash - function that would be used e.g. sha256\n * @param key - message key\n * @param message - message data\n */\nexport const hmac = (hash, key, message) => new HMAC(hash, key).update(message).digest();\nhmac.create = (hash, key) => new HMAC(hash, key);\n//# sourceMappingURL=hmac.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nimport { hmac } from '@noble/hashes/hmac';\nimport { concatBytes, randomBytes } from '@noble/hashes/utils';\nimport { weierstrass } from './abstract/weierstrass.js';\n// connects noble-curves to noble-hashes\nexport function getHash(hash) {\n return {\n hash,\n hmac: (key, ...msgs) => hmac(hash, key, concatBytes(...msgs)),\n randomBytes,\n };\n}\nexport function createCurve(curveDef, defHash) {\n const create = (hash) => weierstrass({ ...curveDef, ...getHash(hash) });\n return Object.freeze({ ...create(defHash), create });\n}\n//# sourceMappingURL=_shortw_utils.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nimport { sha256 } from '@noble/hashes/sha256';\nimport { randomBytes } from '@noble/hashes/utils';\nimport { Field, mod, pow2 } from './abstract/modular.js';\nimport { mapToCurveSimpleSWU } from './abstract/weierstrass.js';\nimport { bytesToNumberBE, concatBytes, ensureBytes, numberToBytesBE } from './abstract/utils.js';\nimport { createHasher, isogenyMap } from './abstract/hash-to-curve.js';\nimport { createCurve } from './_shortw_utils.js';\nconst secp256k1P = BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f');\nconst secp256k1N = BigInt('0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141');\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst divNearest = (a, b) => (a + b / _2n) / b;\n/**\n * √n = n^((p+1)/4) for fields p = 3 mod 4. We unwrap the loop and multiply bit-by-bit.\n * (P+1n/4n).toString(2) would produce bits [223x 1, 0, 22x 1, 4x 0, 11, 00]\n */\nfunction sqrtMod(y) {\n const P = secp256k1P;\n // prettier-ignore\n const _3n = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22);\n // prettier-ignore\n const _23n = BigInt(23), _44n = BigInt(44), _88n = BigInt(88);\n const b2 = (y * y * y) % P; // x^3, 11\n const b3 = (b2 * b2 * y) % P; // x^7\n const b6 = (pow2(b3, _3n, P) * b3) % P;\n const b9 = (pow2(b6, _3n, P) * b3) % P;\n const b11 = (pow2(b9, _2n, P) * b2) % P;\n const b22 = (pow2(b11, _11n, P) * b11) % P;\n const b44 = (pow2(b22, _22n, P) * b22) % P;\n const b88 = (pow2(b44, _44n, P) * b44) % P;\n const b176 = (pow2(b88, _88n, P) * b88) % P;\n const b220 = (pow2(b176, _44n, P) * b44) % P;\n const b223 = (pow2(b220, _3n, P) * b3) % P;\n const t1 = (pow2(b223, _23n, P) * b22) % P;\n const t2 = (pow2(t1, _6n, P) * b2) % P;\n const root = pow2(t2, _2n, P);\n if (!Fp.eql(Fp.sqr(root), y))\n throw new Error('Cannot find square root');\n return root;\n}\nconst Fp = Field(secp256k1P, undefined, undefined, { sqrt: sqrtMod });\nexport const secp256k1 = createCurve({\n a: BigInt(0),\n b: BigInt(7),\n Fp,\n n: secp256k1N,\n // Base point (x, y) aka generator point\n Gx: BigInt('55066263022277343669578718895168534326250603453777594175500187360389116729240'),\n Gy: BigInt('32670510020758816978083085130507043184471273380659243275938904335757337482424'),\n h: BigInt(1),\n lowS: true,\n /**\n * secp256k1 belongs to Koblitz curves: it has efficiently computable endomorphism.\n * Endomorphism uses 2x less RAM, speeds up precomputation by 2x and ECDH / key recovery by 20%.\n * For precomputed wNAF it trades off 1/2 init time & 1/3 ram for 20% perf hit.\n * Explanation: https://gist.github.com/paulmillr/eb670806793e84df628a7c434a873066\n */\n endo: {\n beta: BigInt('0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee'),\n splitScalar: (k) => {\n const n = secp256k1N;\n const a1 = BigInt('0x3086d221a7d46bcde86c90e49284eb15');\n const b1 = -_1n * BigInt('0xe4437ed6010e88286f547fa90abfe4c3');\n const a2 = BigInt('0x114ca50f7a8e2f3f657c1108d9d44cfd8');\n const b2 = a1;\n const POW_2_128 = BigInt('0x100000000000000000000000000000000'); // (2n**128n).toString(16)\n const c1 = divNearest(b2 * k, n);\n const c2 = divNearest(-b1 * k, n);\n let k1 = mod(k - c1 * a1 - c2 * a2, n);\n let k2 = mod(-c1 * b1 - c2 * b2, n);\n const k1neg = k1 > POW_2_128;\n const k2neg = k2 > POW_2_128;\n if (k1neg)\n k1 = n - k1;\n if (k2neg)\n k2 = n - k2;\n if (k1 > POW_2_128 || k2 > POW_2_128) {\n throw new Error('splitScalar: Endomorphism failed, k=' + k);\n }\n return { k1neg, k1, k2neg, k2 };\n },\n },\n}, sha256);\n// Schnorr signatures are superior to ECDSA from above. Below is Schnorr-specific BIP0340 code.\n// https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki\nconst _0n = BigInt(0);\nconst fe = (x) => typeof x === 'bigint' && _0n < x && x < secp256k1P;\nconst ge = (x) => typeof x === 'bigint' && _0n < x && x < secp256k1N;\n/** An object mapping tags to their tagged hash prefix of [SHA256(tag) | SHA256(tag)] */\nconst TAGGED_HASH_PREFIXES = {};\nfunction taggedHash(tag, ...messages) {\n let tagP = TAGGED_HASH_PREFIXES[tag];\n if (tagP === undefined) {\n const tagH = sha256(Uint8Array.from(tag, (c) => c.charCodeAt(0)));\n tagP = concatBytes(tagH, tagH);\n TAGGED_HASH_PREFIXES[tag] = tagP;\n }\n return sha256(concatBytes(tagP, ...messages));\n}\n// ECDSA compact points are 33-byte. Schnorr is 32: we strip first byte 0x02 or 0x03\nconst pointToBytes = (point) => point.toRawBytes(true).slice(1);\nconst numTo32b = (n) => numberToBytesBE(n, 32);\nconst modP = (x) => mod(x, secp256k1P);\nconst modN = (x) => mod(x, secp256k1N);\nconst Point = secp256k1.ProjectivePoint;\nconst GmulAdd = (Q, a, b) => Point.BASE.multiplyAndAddUnsafe(Q, a, b);\n// Calculate point, scalar and bytes\nfunction schnorrGetExtPubKey(priv) {\n let d_ = secp256k1.utils.normPrivateKeyToScalar(priv); // same method executed in fromPrivateKey\n let p = Point.fromPrivateKey(d_); // P = d'⋅G; 0 < d' < n check is done inside\n const scalar = p.hasEvenY() ? d_ : modN(-d_);\n return { scalar: scalar, bytes: pointToBytes(p) };\n}\n/**\n * lift_x from BIP340. Convert 32-byte x coordinate to elliptic curve point.\n * @returns valid point checked for being on-curve\n */\nfunction lift_x(x) {\n if (!fe(x))\n throw new Error('bad x: need 0 < x < p'); // Fail if x ≥ p.\n const xx = modP(x * x);\n const c = modP(xx * x + BigInt(7)); // Let c = x³ + 7 mod p.\n let y = sqrtMod(c); // Let y = c^(p+1)/4 mod p.\n if (y % _2n !== _0n)\n y = modP(-y); // Return the unique point P such that x(P) = x and\n const p = new Point(x, y, _1n); // y(P) = y if y mod 2 = 0 or y(P) = p-y otherwise.\n p.assertValidity();\n return p;\n}\n/**\n * Create tagged hash, convert it to bigint, reduce modulo-n.\n */\nfunction challenge(...args) {\n return modN(bytesToNumberBE(taggedHash('BIP0340/challenge', ...args)));\n}\n/**\n * Schnorr public key is just `x` coordinate of Point as per BIP340.\n */\nfunction schnorrGetPublicKey(privateKey) {\n return schnorrGetExtPubKey(privateKey).bytes; // d'=int(sk). Fail if d'=0 or d'≥n. Ret bytes(d'⋅G)\n}\n/**\n * Creates Schnorr signature as per BIP340. Verifies itself before returning anything.\n * auxRand is optional and is not the sole source of k generation: bad CSPRNG won't be dangerous.\n */\nfunction schnorrSign(message, privateKey, auxRand = randomBytes(32)) {\n const m = ensureBytes('message', message);\n const { bytes: px, scalar: d } = schnorrGetExtPubKey(privateKey); // checks for isWithinCurveOrder\n const a = ensureBytes('auxRand', auxRand, 32); // Auxiliary random data a: a 32-byte array\n const t = numTo32b(d ^ bytesToNumberBE(taggedHash('BIP0340/aux', a))); // Let t be the byte-wise xor of bytes(d) and hash/aux(a)\n const rand = taggedHash('BIP0340/nonce', t, px, m); // Let rand = hash/nonce(t || bytes(P) || m)\n const k_ = modN(bytesToNumberBE(rand)); // Let k' = int(rand) mod n\n if (k_ === _0n)\n throw new Error('sign failed: k is zero'); // Fail if k' = 0.\n const { bytes: rx, scalar: k } = schnorrGetExtPubKey(k_); // Let R = k'⋅G.\n const e = challenge(rx, px, m); // Let e = int(hash/challenge(bytes(R) || bytes(P) || m)) mod n.\n const sig = new Uint8Array(64); // Let sig = bytes(R) || bytes((k + ed) mod n).\n sig.set(rx, 0);\n sig.set(numTo32b(modN(k + e * d)), 32);\n // If Verify(bytes(P), m, sig) (see below) returns failure, abort\n if (!schnorrVerify(sig, m, px))\n throw new Error('sign: Invalid signature produced');\n return sig;\n}\n/**\n * Verifies Schnorr signature.\n * Will swallow errors & return false except for initial type validation of arguments.\n */\nfunction schnorrVerify(signature, message, publicKey) {\n const sig = ensureBytes('signature', signature, 64);\n const m = ensureBytes('message', message);\n const pub = ensureBytes('publicKey', publicKey, 32);\n try {\n const P = lift_x(bytesToNumberBE(pub)); // P = lift_x(int(pk)); fail if that fails\n const r = bytesToNumberBE(sig.subarray(0, 32)); // Let r = int(sig[0:32]); fail if r ≥ p.\n if (!fe(r))\n return false;\n const s = bytesToNumberBE(sig.subarray(32, 64)); // Let s = int(sig[32:64]); fail if s ≥ n.\n if (!ge(s))\n return false;\n const e = challenge(numTo32b(r), pointToBytes(P), m); // int(challenge(bytes(r)||bytes(P)||m))%n\n const R = GmulAdd(P, s, modN(-e)); // R = s⋅G - e⋅P\n if (!R || !R.hasEvenY() || R.toAffine().x !== r)\n return false; // -eP == (n-e)P\n return true; // Fail if is_infinite(R) / not has_even_y(R) / x(R) ≠ r.\n }\n catch (error) {\n return false;\n }\n}\nexport const schnorr = /* @__PURE__ */ (() => ({\n getPublicKey: schnorrGetPublicKey,\n sign: schnorrSign,\n verify: schnorrVerify,\n utils: {\n randomPrivateKey: secp256k1.utils.randomPrivateKey,\n lift_x,\n pointToBytes,\n numberToBytesBE,\n bytesToNumberBE,\n taggedHash,\n mod,\n },\n}))();\nconst isoMap = /* @__PURE__ */ (() => isogenyMap(Fp, [\n // xNum\n [\n '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7',\n '0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581',\n '0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262',\n '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c',\n ],\n // xDen\n [\n '0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b',\n '0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14',\n '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1\n ],\n // yNum\n [\n '0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c',\n '0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3',\n '0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931',\n '0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84',\n ],\n // yDen\n [\n '0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b',\n '0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573',\n '0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f',\n '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1\n ],\n].map((i) => i.map((j) => BigInt(j)))))();\nconst mapSWU = /* @__PURE__ */ (() => mapToCurveSimpleSWU(Fp, {\n A: BigInt('0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533'),\n B: BigInt('1771'),\n Z: Fp.create(BigInt('-11')),\n}))();\nconst htf = /* @__PURE__ */ (() => createHasher(secp256k1.ProjectivePoint, (scalars) => {\n const { x, y } = mapSWU(Fp.create(scalars[0]));\n return isoMap(x, y);\n}, {\n DST: 'secp256k1_XMD:SHA-256_SSWU_RO_',\n encodeDST: 'secp256k1_XMD:SHA-256_SSWU_NU_',\n p: Fp.ORDER,\n m: 1,\n k: 128,\n expand: 'xmd',\n hash: sha256,\n}))();\nexport const hashToCurve = /* @__PURE__ */ (() => htf.hashToCurve)();\nexport const encodeToCurve = /* @__PURE__ */ (() => htf.encodeToCurve)();\n//# sourceMappingURL=secp256k1.js.map","import { secp256k1 } from '@noble/curves/secp256k1';\nimport { hexToBigInt } from '../../utils/encoding/fromHex.js';\nimport { toHex } from '../../utils/encoding/toHex.js';\n/**\n * @description Converts a signature into hex format.\n *\n * @param signature The signature to convert.\n * @returns The signature in hex format.\n *\n * @example\n * signatureToHex({\n * r: '0x6e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf',\n * s: '0x4a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db8',\n * v: 28n\n * })\n * // \"0x6e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf4a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db81c\"\n */\nexport function signatureToHex({ r, s, v }) {\n return `0x${new secp256k1.Signature(hexToBigInt(r), hexToBigInt(s)).toCompactHex()}${toHex(v).slice(2)}`;\n}\n//# sourceMappingURL=signatureToHex.js.map","function t(r,e){throw new Error(e??`Unexpected value: ${r}`)}function o(...r){return r.reduce((e,n)=>n>e?n:e)}function u(...r){return r.reduce((e,n)=>ne?1:0}function*f(r,e){for(let n=0;nr(...e,...n)}function P(r){return r!==void 0}function g(r){return r!==null}function b(r){return new Promise(e=>setTimeout(()=>e(),r))}function T(){return new Promise(r=>{requestIdleCallback(()=>r())})}export{t as assertExhaustive,o as bigIntMax,u as bigIntMin,m as bigIntSort,f as chunk,d as curry,P as isDefined,g as isNotNull,b as wait,T as waitForIdle};\n//# sourceMappingURL=utils.js.map","var r=class extends Error{name=\"MUDError\"};export{r as a};\n//# sourceMappingURL=chunk-UPQEB2HW.js.map","import{isDynamicAbiType as C}from\"@latticexyz/schema-type\";function ne(e){let t=[],s=[];for(let i of e)C(i)?s.push(i):t.push(i);return{staticFields:t,dynamicFields:s}}import{hexToString as K,sliceHex as N}from\"viem\";import{assertExhaustive as R}from\"@latticexyz/common/utils\";import{arrayAbiTypeToStaticAbiType as W,staticAbiTypeToByteLength as _}from\"@latticexyz/schema-type\";import{getAddress as V,hexToBigInt as j,hexToBool as z}from\"viem\";import{assertExhaustive as O}from\"@latticexyz/common/utils\";import{staticAbiTypeToByteLength as U,staticAbiTypeToDefaultValue as M}from\"@latticexyz/schema-type\";import{MUDError as u}from\"@latticexyz/common/errors\";import{staticAbiTypeToByteLength as L}from\"@latticexyz/schema-type\";var d=class extends u{name=\"InvalidHexValueError\";constructor(t){super(`Hex value \"${t}\" is an odd length (${t.length-2}). It must be an even length.`)}},f=class extends u{name=\"InvalidHexLengthForSchemaError\";constructor(t){super(`Hex value \"${t}\" has length of ${t.length-2}, but expected length of 64 for a schema.`)}},x=class extends u{name=\"InvalidHexLengthForPackedCounterError\";constructor(t){super(`Hex value \"${t}\" has length of ${t.length-2}, but expected length of 64 for a packed counter.`)}},g=class extends u{name=\"InvalidHexLengthForStaticFieldError\";constructor(t,s){super(`Hex value \"${s}\" has length of ${s.length-2}, but expected length of ${L[t]*2} for ${t} type.`)}},S=class extends u{name=\"InvalidHexLengthForArrayFieldError\";constructor(t,s){super(`Hex value \"${s}\" has length of ${s.length-2}, but expected a multiple of ${L[t]*2} for ${t}[] type.`)}},A=class extends u{name=\"SchemaStaticLengthMismatchError\";constructor(t,s,i){super(`Schema \"${t}\" static data length (${s}) did not match the summed length of all static fields (${i}). Is \\`staticAbiTypeToByteLength\\` up to date with Solidity schema types?`)}},v=class extends u{name=\"PackedCounterLengthMismatchError\";constructor(t,s,i){super(`PackedCounter \"${t}\" total bytes length (${s}) did not match the summed length of all field byte lengths (${i}).`)}};function p(e,t){if(t.length>3&&t.length%2!==0)throw new d(t);if((t.length-2)/2!==U[e])throw new g(e,t);switch(e){case\"uint8\":case\"uint16\":case\"uint24\":case\"uint32\":case\"uint40\":case\"uint48\":case\"uint56\":case\"uint64\":case\"uint72\":case\"uint80\":case\"uint88\":case\"uint96\":case\"uint104\":case\"uint112\":case\"uint120\":case\"uint128\":case\"uint136\":case\"uint144\":case\"uint152\":case\"uint160\":case\"uint168\":case\"uint176\":case\"uint184\":case\"uint192\":case\"uint200\":case\"uint208\":case\"uint216\":case\"uint224\":case\"uint232\":case\"uint240\":case\"uint248\":case\"uint256\":case\"int8\":case\"int16\":case\"int24\":case\"int32\":case\"int40\":case\"int48\":case\"int56\":case\"int64\":case\"int72\":case\"int80\":case\"int88\":case\"int96\":case\"int104\":case\"int112\":case\"int120\":case\"int128\":case\"int136\":case\"int144\":case\"int152\":case\"int160\":case\"int168\":case\"int176\":case\"int184\":case\"int192\":case\"int200\":case\"int208\":case\"int216\":case\"int224\":case\"int232\":case\"int240\":case\"int248\":case\"int256\":{let i=j(t,{signed:e.startsWith(\"int\")}),a=typeof M[e];if(a===\"number\")return Number(i);if(a===\"bigint\")return i;throw new Error(`Unexpected default value type (${a}) for ABI type (${e})`)}case\"bytes1\":case\"bytes2\":case\"bytes3\":case\"bytes4\":case\"bytes5\":case\"bytes6\":case\"bytes7\":case\"bytes8\":case\"bytes9\":case\"bytes10\":case\"bytes11\":case\"bytes12\":case\"bytes13\":case\"bytes14\":case\"bytes15\":case\"bytes16\":case\"bytes17\":case\"bytes18\":case\"bytes19\":case\"bytes20\":case\"bytes21\":case\"bytes22\":case\"bytes23\":case\"bytes24\":case\"bytes25\":case\"bytes26\":case\"bytes27\":case\"bytes28\":case\"bytes29\":case\"bytes30\":case\"bytes31\":case\"bytes32\":return t;case\"bool\":return z(t);case\"address\":return V(t)}return O(e,`Unsupported static ABI type: ${e}`)}function h(e,t){if(e===\"bytes\")return t;if(e===\"string\")return K(t);if(t.length>3&&t.length%2!==0)throw new d(t);let s=(t.length-2)/2;switch(e){case\"uint8[]\":case\"uint16[]\":case\"uint24[]\":case\"uint32[]\":case\"uint40[]\":case\"uint48[]\":case\"uint56[]\":case\"uint64[]\":case\"uint72[]\":case\"uint80[]\":case\"uint88[]\":case\"uint96[]\":case\"uint104[]\":case\"uint112[]\":case\"uint120[]\":case\"uint128[]\":case\"uint136[]\":case\"uint144[]\":case\"uint152[]\":case\"uint160[]\":case\"uint168[]\":case\"uint176[]\":case\"uint184[]\":case\"uint192[]\":case\"uint200[]\":case\"uint208[]\":case\"uint216[]\":case\"uint224[]\":case\"uint232[]\":case\"uint240[]\":case\"uint248[]\":case\"uint256[]\":case\"int8[]\":case\"int16[]\":case\"int24[]\":case\"int32[]\":case\"int40[]\":case\"int48[]\":case\"int56[]\":case\"int64[]\":case\"int72[]\":case\"int80[]\":case\"int88[]\":case\"int96[]\":case\"int104[]\":case\"int112[]\":case\"int120[]\":case\"int128[]\":case\"int136[]\":case\"int144[]\":case\"int152[]\":case\"int160[]\":case\"int168[]\":case\"int176[]\":case\"int184[]\":case\"int192[]\":case\"int200[]\":case\"int208[]\":case\"int216[]\":case\"int224[]\":case\"int232[]\":case\"int240[]\":case\"int248[]\":case\"int256[]\":case\"bytes1[]\":case\"bytes2[]\":case\"bytes3[]\":case\"bytes4[]\":case\"bytes5[]\":case\"bytes6[]\":case\"bytes7[]\":case\"bytes8[]\":case\"bytes9[]\":case\"bytes10[]\":case\"bytes11[]\":case\"bytes12[]\":case\"bytes13[]\":case\"bytes14[]\":case\"bytes15[]\":case\"bytes16[]\":case\"bytes17[]\":case\"bytes18[]\":case\"bytes19[]\":case\"bytes20[]\":case\"bytes21[]\":case\"bytes22[]\":case\"bytes23[]\":case\"bytes24[]\":case\"bytes25[]\":case\"bytes26[]\":case\"bytes27[]\":case\"bytes28[]\":case\"bytes29[]\":case\"bytes30[]\":case\"bytes31[]\":case\"bytes32[]\":case\"bool[]\":case\"address[]\":{let i=W(e),a=_[i];if(s%a!==0)throw new S(i,t);return new Array(s/a).fill(void 0).map((n,c)=>{let r=N(t,c*a,(c+1)*a);return p(i,r)})}}return R(e,`Unsupported dynamic ABI type: ${e}`)}import{isDynamicAbiType as q}from\"@latticexyz/schema-type\";function ke(e,t){return q(e)?h(e,t):p(e,t)}import{decodeAbiParameters as G}from\"viem\";function ze(e,t){if(e.staticFields.length!==t.length)throw new Error(`key tuple length ${t.length} does not match key schema length ${e.staticFields.length}`);return t.map((s,i)=>G([{type:e.staticFields[i]}],s)[0])}import{staticAbiTypeToByteLength as Q,dynamicAbiTypeToDefaultValue as X}from\"@latticexyz/schema-type\";import{sliceHex as H}from\"viem\";import{sliceHex as $}from\"viem\";function B(e){if(e.length!==66)throw new x(e);let t=p(\"uint56\",$(e,32-7,32)),s=h(\"uint40[]\",$(e,0,32-7)),i=Object.freeze([...s].reverse()),a=BigInt(i.reduce((m,n)=>m+n,0));if(a!==t)throw new v(e,t,a);return{totalByteLength:t,fieldByteLengths:i}}import{staticAbiTypeToByteLength as J}from\"@latticexyz/schema-type\";function P(e){return e.reduce((t,s)=>t+J[s],0)}function ct(e,t){let s=[],i=0;e.staticFields.forEach(n=>{let c=Q[n],r=p(n,H(t,i,i+c));i+=c,s.push(r)});let a=P(e.staticFields),m=i;if(m!==a&&console.warn(\"Decoded static data length does not match schema's expected static data length. Data may get corrupted. Is `getStaticByteLength` outdated?\",{expectedLength:a,actualLength:m,bytesOffset:i}),e.dynamicFields.length>0){let n=B(H(t,i,i+32));i+=32,e.dynamicFields.forEach((r,F)=>{let o=n.fieldByteLengths[F];if(o>0){let y=h(r,H(t,i,i+o));i+=o,s.push(y)}else s.push(X[r])});let c=i-32-m;BigInt(c)!==n.totalByteLength&&console.warn(\"Decoded dynamic data length does not match data layout's expected data length. Data may get corrupted. Did the data layout change?\",{expectedLength:n.totalByteLength,actualLength:c,bytesOffset:i})}return s}import{arrayAbiTypeToStaticAbiType as Y,isArrayAbiType as Z}from\"@latticexyz/schema-type\";import{encodePacked as w}from\"viem\";function l(e,t){if(Z(e)&&Array.isArray(t)){let s=Y(e);return w(t.map(()=>s),t)}return w([e],[t])}import{encodeAbiParameters as ee}from\"viem\";function dt(e,t){return t.map((s,i)=>ee([{type:e.staticFields[i]}],[s]))}function Tt(e,t){let s=t.slice(0,e.staticFields.length),i=t.slice(e.staticFields.length),a=s.map((o,y)=>l(e.staticFields[y],o).replace(/^0x/,\"\")).join(\"\");if(e.dynamicFields.length===0)return`0x${a}`;let m=i.map((o,y)=>l(e.dynamicFields[y],o).replace(/^0x/,\"\")),n=m.map(o=>o.length/2),c=n.reduce((o,y)=>o+BigInt(y),0n),r=m.join(\"\"),F=`${l(\"uint56\",c).replace(/^0x/,\"\")}${n.map(o=>l(\"uint40\",o).replace(/^0x/,\"\")).join(\"\")}`.padEnd(64,\"0\");return`0x${a}${F}${r}`}import{schemaAbiTypes as I,staticAbiTypeToByteLength as te}from\"@latticexyz/schema-type\";import{hexToNumber as T,sliceHex as b}from\"viem\";function D(e){if(e.length!==66)throw new f(e);let t=T(b(e,0,2)),s=T(b(e,2,3)),i=T(b(e,3,4)),a=[],m=[];for(let c=4;c<4+s;c++){let r=T(b(e,c,c+1));a.push(I[r])}for(let c=4+s;c<4+s+i;c++){let r=T(b(e,c,c+1));m.push(I[r])}let n=a.reduce((c,r)=>c+te[r],0);if(n!==t)throw console.warn(`Schema \"${e}\" static data length (${t}) did not match the summed length of all static fields (${n}). Is \\`staticAbiTypeToByteLength\\` up to date with Solidity schema types?`),new A(e,t,n);return{staticFields:a,dynamicFields:m}}import{sliceHex as E}from\"viem\";function Lt(e){let t=D(E(e,0,32));return{keySchema:D(E(e,32,64)),valueSchema:t}}function Bt(e,t){return tk.indexOf(i)),s=e.dynamicFields.map(i=>k.indexOf(i));return`0x${[P(e.staticFields).toString(16).padStart(4,\"0\"),e.staticFields.length.toString(16).padStart(2,\"0\"),e.dynamicFields.length.toString(16).padStart(2,\"0\"),...t.map(i=>i.toString(16).padStart(2,\"0\")),...s.map(i=>i.toString(16).padStart(2,\"0\"))].join(\"\").padEnd(64,\"0\")}`}export{d as InvalidHexLengthError,S as InvalidHexLengthForArrayFieldError,x as InvalidHexLengthForPackedCounterError,f as InvalidHexLengthForSchemaError,g as InvalidHexLengthForStaticFieldError,v as PackedCounterLengthMismatchError,A as SchemaStaticLengthMismatchError,ne as abiTypesToSchema,h as decodeDynamicField,ke as decodeField,ze as decodeKeyTuple,ct as decodeRecord,p as decodeStaticField,l as encodeField,dt as encodeKeyTuple,Tt as encodeRecord,B as hexToPackedCounter,D as hexToSchema,Lt as hexToTableSchema,Bt as schemaIndexToAbiType,kt as schemaToHex,P as staticDataLength};\n//# sourceMappingURL=index.js.map","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","import { secp256k1 } from '@noble/curves/secp256k1';\nimport { toHex } from '../utils/encoding/toHex.js';\n/**\n * @description Generates a random private key.\n *\n * @returns A randomly generated private key.\n */\nexport function generatePrivateKey() {\n return toHex(secp256k1.utils.randomPrivateKey());\n}\n//# sourceMappingURL=generatePrivateKey.js.map","import { InvalidAddressError } from '../errors/address.js';\nimport { isAddress } from '../utils/address/isAddress.js';\n/**\n * @description Creates an Account from a custom signing implementation.\n *\n * @returns A Local Account.\n */\nexport function toAccount(source) {\n if (typeof source === 'string') {\n if (!isAddress(source))\n throw new InvalidAddressError({ address: source });\n return {\n address: source,\n type: 'json-rpc',\n };\n }\n if (!isAddress(source.address))\n throw new InvalidAddressError({ address: source.address });\n return {\n address: source.address,\n signMessage: source.signMessage,\n signTransaction: source.signTransaction,\n signTypedData: source.signTypedData,\n source: 'custom',\n type: 'local',\n };\n}\n//# sourceMappingURL=toAccount.js.map","import { secp256k1 } from '@noble/curves/secp256k1';\nimport { toHex } from '../../utils/encoding/toHex.js';\n/**\n * @description Signs a hash with a given private key.\n *\n * @param hash The hash to sign.\n * @param privateKey The private key to sign with.\n *\n * @returns The signature.\n */\nexport async function sign({ hash, privateKey, }) {\n const { r, s, recovery } = secp256k1.sign(hash.slice(2), privateKey.slice(2));\n return {\n r: toHex(r),\n s: toHex(s),\n v: recovery ? 28n : 27n,\n };\n}\n//# sourceMappingURL=sign.js.map","import { hashMessage } from '../../utils/signature/hashMessage.js';\nimport { signatureToHex } from '../../utils/signature/signatureToHex.js';\nimport { sign } from './sign.js';\n/**\n * @description Calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191):\n * `keccak256(\"\\x19Ethereum Signed Message:\\n\" + len(message) + message))`.\n *\n * @returns The signature.\n */\nexport async function signMessage({ message, privateKey, }) {\n const signature = await sign({ hash: hashMessage(message), privateKey });\n return signatureToHex(signature);\n}\n//# sourceMappingURL=signMessage.js.map","import { keccak256 } from '../../utils/hash/keccak256.js';\nimport { serializeTransaction, } from '../../utils/transaction/serializeTransaction.js';\nimport { sign } from './sign.js';\nexport async function signTransaction({ privateKey, transaction, serializer = serializeTransaction, }) {\n const signature = await sign({\n hash: keccak256(serializer(transaction)),\n privateKey,\n });\n return serializer(transaction, signature);\n}\n//# sourceMappingURL=signTransaction.js.map","import { hashTypedData, } from '../../utils/signature/hashTypedData.js';\nimport { signatureToHex } from '../../utils/signature/signatureToHex.js';\nimport { sign } from './sign.js';\n/**\n * @description Signs typed data and calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191):\n * `keccak256(\"\\x19Ethereum Signed Message:\\n\" + len(message) + message))`.\n *\n * @returns The signature.\n */\nexport async function signTypedData({ privateKey, ...typedData }) {\n const signature = await sign({\n hash: hashTypedData(typedData),\n privateKey,\n });\n return signatureToHex(signature);\n}\n//# sourceMappingURL=signTypedData.js.map","import { secp256k1 } from '@noble/curves/secp256k1';\nimport { toHex } from '../utils/encoding/toHex.js';\nimport { toAccount } from './toAccount.js';\nimport { publicKeyToAddress } from './utils/publicKeyToAddress.js';\nimport { signMessage } from './utils/signMessage.js';\nimport { signTransaction } from './utils/signTransaction.js';\nimport { signTypedData } from './utils/signTypedData.js';\n/**\n * @description Creates an Account from a private key.\n *\n * @returns A Private Key Account.\n */\nexport function privateKeyToAccount(privateKey) {\n const publicKey = toHex(secp256k1.getPublicKey(privateKey.slice(2), false));\n const address = publicKeyToAddress(publicKey);\n const account = toAccount({\n address,\n async signMessage({ message }) {\n return signMessage({ message, privateKey });\n },\n async signTransaction(transaction, { serializer } = {}) {\n return signTransaction({ privateKey, transaction, serializer });\n },\n async signTypedData(typedData) {\n return signTypedData({ ...typedData, privateKey });\n },\n });\n return {\n ...account,\n publicKey,\n source: 'privateKey',\n };\n}\n//# sourceMappingURL=privateKeyToAccount.js.map","function RetryOperation(timeouts, options) {\n // Compatibility for the old (timeouts, retryForever) signature\n if (typeof options === 'boolean') {\n options = { forever: options };\n }\n\n this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));\n this._timeouts = timeouts;\n this._options = options || {};\n this._maxRetryTime = options && options.maxRetryTime || Infinity;\n this._fn = null;\n this._errors = [];\n this._attempts = 1;\n this._operationTimeout = null;\n this._operationTimeoutCb = null;\n this._timeout = null;\n this._operationStart = null;\n this._timer = null;\n\n if (this._options.forever) {\n this._cachedTimeouts = this._timeouts.slice(0);\n }\n}\nmodule.exports = RetryOperation;\n\nRetryOperation.prototype.reset = function() {\n this._attempts = 1;\n this._timeouts = this._originalTimeouts.slice(0);\n}\n\nRetryOperation.prototype.stop = function() {\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n if (this._timer) {\n clearTimeout(this._timer);\n }\n\n this._timeouts = [];\n this._cachedTimeouts = null;\n};\n\nRetryOperation.prototype.retry = function(err) {\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n\n if (!err) {\n return false;\n }\n var currentTime = new Date().getTime();\n if (err && currentTime - this._operationStart >= this._maxRetryTime) {\n this._errors.push(err);\n this._errors.unshift(new Error('RetryOperation timeout occurred'));\n return false;\n }\n\n this._errors.push(err);\n\n var timeout = this._timeouts.shift();\n if (timeout === undefined) {\n if (this._cachedTimeouts) {\n // retry forever, only keep last error\n this._errors.splice(0, this._errors.length - 1);\n timeout = this._cachedTimeouts.slice(-1);\n } else {\n return false;\n }\n }\n\n var self = this;\n this._timer = setTimeout(function() {\n self._attempts++;\n\n if (self._operationTimeoutCb) {\n self._timeout = setTimeout(function() {\n self._operationTimeoutCb(self._attempts);\n }, self._operationTimeout);\n\n if (self._options.unref) {\n self._timeout.unref();\n }\n }\n\n self._fn(self._attempts);\n }, timeout);\n\n if (this._options.unref) {\n this._timer.unref();\n }\n\n return true;\n};\n\nRetryOperation.prototype.attempt = function(fn, timeoutOps) {\n this._fn = fn;\n\n if (timeoutOps) {\n if (timeoutOps.timeout) {\n this._operationTimeout = timeoutOps.timeout;\n }\n if (timeoutOps.cb) {\n this._operationTimeoutCb = timeoutOps.cb;\n }\n }\n\n var self = this;\n if (this._operationTimeoutCb) {\n this._timeout = setTimeout(function() {\n self._operationTimeoutCb();\n }, self._operationTimeout);\n }\n\n this._operationStart = new Date().getTime();\n\n this._fn(this._attempts);\n};\n\nRetryOperation.prototype.try = function(fn) {\n console.log('Using RetryOperation.try() is deprecated');\n this.attempt(fn);\n};\n\nRetryOperation.prototype.start = function(fn) {\n console.log('Using RetryOperation.start() is deprecated');\n this.attempt(fn);\n};\n\nRetryOperation.prototype.start = RetryOperation.prototype.try;\n\nRetryOperation.prototype.errors = function() {\n return this._errors;\n};\n\nRetryOperation.prototype.attempts = function() {\n return this._attempts;\n};\n\nRetryOperation.prototype.mainError = function() {\n if (this._errors.length === 0) {\n return null;\n }\n\n var counts = {};\n var mainError = null;\n var mainErrorCount = 0;\n\n for (var i = 0; i < this._errors.length; i++) {\n var error = this._errors[i];\n var message = error.message;\n var count = (counts[message] || 0) + 1;\n\n counts[message] = count;\n\n if (count >= mainErrorCount) {\n mainError = error;\n mainErrorCount = count;\n }\n }\n\n return mainError;\n};\n","var RetryOperation = require('./retry_operation');\n\nexports.operation = function(options) {\n var timeouts = exports.timeouts(options);\n return new RetryOperation(timeouts, {\n forever: options && (options.forever || options.retries === Infinity),\n unref: options && options.unref,\n maxRetryTime: options && options.maxRetryTime\n });\n};\n\nexports.timeouts = function(options) {\n if (options instanceof Array) {\n return [].concat(options);\n }\n\n var opts = {\n retries: 10,\n factor: 2,\n minTimeout: 1 * 1000,\n maxTimeout: Infinity,\n randomize: false\n };\n for (var key in options) {\n opts[key] = options[key];\n }\n\n if (opts.minTimeout > opts.maxTimeout) {\n throw new Error('minTimeout is greater than maxTimeout');\n }\n\n var timeouts = [];\n for (var i = 0; i < opts.retries; i++) {\n timeouts.push(this.createTimeout(i, opts));\n }\n\n if (options && options.forever && !timeouts.length) {\n timeouts.push(this.createTimeout(i, opts));\n }\n\n // sort the array numerically ascending\n timeouts.sort(function(a,b) {\n return a - b;\n });\n\n return timeouts;\n};\n\nexports.createTimeout = function(attempt, opts) {\n var random = (opts.randomize)\n ? (Math.random() + 1)\n : 1;\n\n var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));\n timeout = Math.min(timeout, opts.maxTimeout);\n\n return timeout;\n};\n\nexports.wrap = function(obj, options, methods) {\n if (options instanceof Array) {\n methods = options;\n options = null;\n }\n\n if (!methods) {\n methods = [];\n for (var key in obj) {\n if (typeof obj[key] === 'function') {\n methods.push(key);\n }\n }\n }\n\n for (var i = 0; i < methods.length; i++) {\n var method = methods[i];\n var original = obj[method];\n\n obj[method] = function retryWrapper(original) {\n var op = exports.operation(options);\n var args = Array.prototype.slice.call(arguments, 1);\n var callback = args.pop();\n\n args.push(function(err) {\n if (op.retry(err)) {\n return;\n }\n if (err) {\n arguments[0] = op.mainError();\n }\n callback.apply(this, arguments);\n });\n\n op.attempt(function() {\n original.apply(obj, args);\n });\n }.bind(obj, original);\n obj[method].options = options;\n }\n};\n","module.exports = require('./lib/retry');","import retry from 'retry';\n\nconst networkErrorMsgs = new Set([\n\t'Failed to fetch', // Chrome\n\t'NetworkError when attempting to fetch resource.', // Firefox\n\t'The Internet connection appears to be offline.', // Safari\n\t'Network request failed', // `cross-fetch`\n\t'fetch failed', // Undici (Node.js)\n]);\n\nexport class AbortError extends Error {\n\tconstructor(message) {\n\t\tsuper();\n\n\t\tif (message instanceof Error) {\n\t\t\tthis.originalError = message;\n\t\t\t({message} = message);\n\t\t} else {\n\t\t\tthis.originalError = new Error(message);\n\t\t\tthis.originalError.stack = this.stack;\n\t\t}\n\n\t\tthis.name = 'AbortError';\n\t\tthis.message = message;\n\t}\n}\n\nconst decorateErrorWithCounts = (error, attemptNumber, options) => {\n\t// Minus 1 from attemptNumber because the first attempt does not count as a retry\n\tconst retriesLeft = options.retries - (attemptNumber - 1);\n\n\terror.attemptNumber = attemptNumber;\n\terror.retriesLeft = retriesLeft;\n\treturn error;\n};\n\nconst isNetworkError = errorMessage => networkErrorMsgs.has(errorMessage);\n\nconst getDOMException = errorMessage => globalThis.DOMException === undefined\n\t? new Error(errorMessage)\n\t: new DOMException(errorMessage);\n\nexport default async function pRetry(input, options) {\n\treturn new Promise((resolve, reject) => {\n\t\toptions = {\n\t\t\tonFailedAttempt() {},\n\t\t\tretries: 10,\n\t\t\t...options,\n\t\t};\n\n\t\tconst operation = retry.operation(options);\n\n\t\toperation.attempt(async attemptNumber => {\n\t\t\ttry {\n\t\t\t\tresolve(await input(attemptNumber));\n\t\t\t} catch (error) {\n\t\t\t\tif (!(error instanceof Error)) {\n\t\t\t\t\treject(new TypeError(`Non-error was thrown: \"${error}\". You should only throw errors.`));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (error instanceof AbortError) {\n\t\t\t\t\toperation.stop();\n\t\t\t\t\treject(error.originalError);\n\t\t\t\t} else if (error instanceof TypeError && !isNetworkError(error.message)) {\n\t\t\t\t\toperation.stop();\n\t\t\t\t\treject(error);\n\t\t\t\t} else {\n\t\t\t\t\tdecorateErrorWithCounts(error, attemptNumber, options);\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait options.onFailedAttempt(error);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!operation.retry(error)) {\n\t\t\t\t\t\treject(operation.mainError());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tif (options.signal && !options.signal.aborted) {\n\t\t\toptions.signal.addEventListener('abort', () => {\n\t\t\t\toperation.stop();\n\t\t\t\tconst reason = options.signal.reason === undefined\n\t\t\t\t\t? getDOMException('The operation was aborted.')\n\t\t\t\t\t: options.signal.reason;\n\t\t\t\treject(reason instanceof Error ? reason : getDOMException(reason));\n\t\t\t}, {\n\t\t\t\tonce: true,\n\t\t\t});\n\t\t}\n\t});\n}\n","import{privateKeyToAccount as W}from\"viem/accounts\";function J(e){return{...W(e)}}import{getContract as M}from\"viem\";import O from\"p-retry\";import{BaseError as k,NonceTooHighError as R,NonceTooLowError as v}from\"viem\";import H from\"debug\";var p=H(\"mud:common\");var x=p.extend(\"createNonceManager\");function b({publicClient:e,address:t,blockTag:r}){let n={current:-1},a=typeof BroadcastChannel<\"u\"?new BroadcastChannel(`mud:createNonceManager:${e.chain?.id}:${t}`):null;a&&a.addEventListener(\"message\",o=>{let T=JSON.parse(o.data);x(\"got nonce from broadcast channel\",T),n.current=T});function c(){return n.current>=0}function d(){if(!c())throw new Error(\"call resetNonce before using nextNonce\");let o=n.current++;return a?.postMessage(JSON.stringify(n.current)),o}async function u(){let o=await e.getTransactionCount({address:t,blockTag:r});n.current=o,a?.postMessage(JSON.stringify(n.current)),x(\"reset nonce to\",n.current)}function C(o){return o instanceof k&&o.walk(T=>T instanceof v||T instanceof R)!=null}return{hasNonce:c,nextNonce:d,resetNonce:u,shouldResetNonce:C}}var m=p.extend(\"createContract\");function E(e){let t=e.length&&Array.isArray(e[0]),r=t?e[0]:[],n=(t?e[1]:e[0])??{};return{args:r,options:n}}function me({abi:e,address:t,publicClient:r,walletClient:n,onWrite:a}){let c=M({abi:e,address:t,publicClient:r,walletClient:n});if(c.write){let d=0,u=b({publicClient:r,address:n.account.address});c.write=new Proxy({},{get(C,o){async function T(s){if(s.gas)return m(\"gas provided, skipping simulate\",o,s),s;m(\"simulating write\",o,s);let{request:l}=await r.simulateContract({...s,account:s.account??n.account});return l}async function w(s){let l=await T(s);return await O(async()=>{u.hasNonce()||await u.resetNonce();let i=u.nextNonce();return m(\"calling write function with nonce\",i,l),await n.writeContract({nonce:i,...l})},{retries:3,onFailedAttempt:async i=>{if(u.shouldResetNonce(i)){m(\"got nonce error, retrying\",i),await u.resetNonce();return}throw i}})}return(...s)=>{let l=`${n.chain.id}:${n.account.address}:${d++}`,{args:i,options:N}=E(s),f={address:t,abi:e,functionName:o,args:i,...N},g=w(f);return a?.({id:l,request:f,result:g}),g}}})}return c}import{generatePrivateKey as S,privateKeyToAccount as A}from\"viem/accounts\";import{isHex as $}from\"viem\";function B(e,t){if(!$(e))throw console.error(\"Private key found in cache is not valid hex\",{privateKey:e,cacheKey:t}),new Error(`Private key found in cache (${t}) is not valid hex`);A(e)}function be(e=\"mud:burnerWallet\"){let t=localStorage.getItem(e);if(t!=null)return B(t,e),t;let r=S();return console.log(\"New burner wallet created:\",A(r)),localStorage.setItem(e,r),r}import{hexToString as h,sliceHex as P}from\"viem\";function ye(e){let t=h(P(e,0,16)).replace(/\\0+$/,\"\"),r=h(P(e,16,32)).replace(/\\0+$/,\"\");return{namespace:t,name:r}}import{stringToHex as y,concatHex as G}from\"viem\";function He(e,t){return G([y(e.substring(0,16),{size:16}),y(t.substring(0,16),{size:16})])}import{keccak256 as q}from\"viem\";var I=p.extend(\"transportObserver\");function Ee(e){return t=>{let r=e(t);return{...r,request:async a=>{if(a.method===\"eth_sendRawTransaction\"&&a.params instanceof Array){let c=a.params.map(d=>q(d));I(\"saw txs\",c)}return r.request(a)}}}}export{J as createBurnerAccount,me as createContract,b as createNonceManager,be as getBurnerPrivateKey,ye as hexToTableId,He as tableIdToHex,Ee as transportObserver};\n//# sourceMappingURL=index.js.map","var I=(t=>(t[t.UINT8=0]=\"UINT8\",t[t.UINT16=1]=\"UINT16\",t[t.UINT24=2]=\"UINT24\",t[t.UINT32=3]=\"UINT32\",t[t.UINT40=4]=\"UINT40\",t[t.UINT48=5]=\"UINT48\",t[t.UINT56=6]=\"UINT56\",t[t.UINT64=7]=\"UINT64\",t[t.UINT72=8]=\"UINT72\",t[t.UINT80=9]=\"UINT80\",t[t.UINT88=10]=\"UINT88\",t[t.UINT96=11]=\"UINT96\",t[t.UINT104=12]=\"UINT104\",t[t.UINT112=13]=\"UINT112\",t[t.UINT120=14]=\"UINT120\",t[t.UINT128=15]=\"UINT128\",t[t.UINT136=16]=\"UINT136\",t[t.UINT144=17]=\"UINT144\",t[t.UINT152=18]=\"UINT152\",t[t.UINT160=19]=\"UINT160\",t[t.UINT168=20]=\"UINT168\",t[t.UINT176=21]=\"UINT176\",t[t.UINT184=22]=\"UINT184\",t[t.UINT192=23]=\"UINT192\",t[t.UINT200=24]=\"UINT200\",t[t.UINT208=25]=\"UINT208\",t[t.UINT216=26]=\"UINT216\",t[t.UINT224=27]=\"UINT224\",t[t.UINT232=28]=\"UINT232\",t[t.UINT240=29]=\"UINT240\",t[t.UINT248=30]=\"UINT248\",t[t.UINT256=31]=\"UINT256\",t[t.INT8=32]=\"INT8\",t[t.INT16=33]=\"INT16\",t[t.INT24=34]=\"INT24\",t[t.INT32=35]=\"INT32\",t[t.INT40=36]=\"INT40\",t[t.INT48=37]=\"INT48\",t[t.INT56=38]=\"INT56\",t[t.INT64=39]=\"INT64\",t[t.INT72=40]=\"INT72\",t[t.INT80=41]=\"INT80\",t[t.INT88=42]=\"INT88\",t[t.INT96=43]=\"INT96\",t[t.INT104=44]=\"INT104\",t[t.INT112=45]=\"INT112\",t[t.INT120=46]=\"INT120\",t[t.INT128=47]=\"INT128\",t[t.INT136=48]=\"INT136\",t[t.INT144=49]=\"INT144\",t[t.INT152=50]=\"INT152\",t[t.INT160=51]=\"INT160\",t[t.INT168=52]=\"INT168\",t[t.INT176=53]=\"INT176\",t[t.INT184=54]=\"INT184\",t[t.INT192=55]=\"INT192\",t[t.INT200=56]=\"INT200\",t[t.INT208=57]=\"INT208\",t[t.INT216=58]=\"INT216\",t[t.INT224=59]=\"INT224\",t[t.INT232=60]=\"INT232\",t[t.INT240=61]=\"INT240\",t[t.INT248=62]=\"INT248\",t[t.INT256=63]=\"INT256\",t[t.BYTES1=64]=\"BYTES1\",t[t.BYTES2=65]=\"BYTES2\",t[t.BYTES3=66]=\"BYTES3\",t[t.BYTES4=67]=\"BYTES4\",t[t.BYTES5=68]=\"BYTES5\",t[t.BYTES6=69]=\"BYTES6\",t[t.BYTES7=70]=\"BYTES7\",t[t.BYTES8=71]=\"BYTES8\",t[t.BYTES9=72]=\"BYTES9\",t[t.BYTES10=73]=\"BYTES10\",t[t.BYTES11=74]=\"BYTES11\",t[t.BYTES12=75]=\"BYTES12\",t[t.BYTES13=76]=\"BYTES13\",t[t.BYTES14=77]=\"BYTES14\",t[t.BYTES15=78]=\"BYTES15\",t[t.BYTES16=79]=\"BYTES16\",t[t.BYTES17=80]=\"BYTES17\",t[t.BYTES18=81]=\"BYTES18\",t[t.BYTES19=82]=\"BYTES19\",t[t.BYTES20=83]=\"BYTES20\",t[t.BYTES21=84]=\"BYTES21\",t[t.BYTES22=85]=\"BYTES22\",t[t.BYTES23=86]=\"BYTES23\",t[t.BYTES24=87]=\"BYTES24\",t[t.BYTES25=88]=\"BYTES25\",t[t.BYTES26=89]=\"BYTES26\",t[t.BYTES27=90]=\"BYTES27\",t[t.BYTES28=91]=\"BYTES28\",t[t.BYTES29=92]=\"BYTES29\",t[t.BYTES30=93]=\"BYTES30\",t[t.BYTES31=94]=\"BYTES31\",t[t.BYTES32=95]=\"BYTES32\",t[t.BOOL=96]=\"BOOL\",t[t.ADDRESS=97]=\"ADDRESS\",t[t.UINT8_ARRAY=98]=\"UINT8_ARRAY\",t[t.UINT16_ARRAY=99]=\"UINT16_ARRAY\",t[t.UINT24_ARRAY=100]=\"UINT24_ARRAY\",t[t.UINT32_ARRAY=101]=\"UINT32_ARRAY\",t[t.UINT40_ARRAY=102]=\"UINT40_ARRAY\",t[t.UINT48_ARRAY=103]=\"UINT48_ARRAY\",t[t.UINT56_ARRAY=104]=\"UINT56_ARRAY\",t[t.UINT64_ARRAY=105]=\"UINT64_ARRAY\",t[t.UINT72_ARRAY=106]=\"UINT72_ARRAY\",t[t.UINT80_ARRAY=107]=\"UINT80_ARRAY\",t[t.UINT88_ARRAY=108]=\"UINT88_ARRAY\",t[t.UINT96_ARRAY=109]=\"UINT96_ARRAY\",t[t.UINT104_ARRAY=110]=\"UINT104_ARRAY\",t[t.UINT112_ARRAY=111]=\"UINT112_ARRAY\",t[t.UINT120_ARRAY=112]=\"UINT120_ARRAY\",t[t.UINT128_ARRAY=113]=\"UINT128_ARRAY\",t[t.UINT136_ARRAY=114]=\"UINT136_ARRAY\",t[t.UINT144_ARRAY=115]=\"UINT144_ARRAY\",t[t.UINT152_ARRAY=116]=\"UINT152_ARRAY\",t[t.UINT160_ARRAY=117]=\"UINT160_ARRAY\",t[t.UINT168_ARRAY=118]=\"UINT168_ARRAY\",t[t.UINT176_ARRAY=119]=\"UINT176_ARRAY\",t[t.UINT184_ARRAY=120]=\"UINT184_ARRAY\",t[t.UINT192_ARRAY=121]=\"UINT192_ARRAY\",t[t.UINT200_ARRAY=122]=\"UINT200_ARRAY\",t[t.UINT208_ARRAY=123]=\"UINT208_ARRAY\",t[t.UINT216_ARRAY=124]=\"UINT216_ARRAY\",t[t.UINT224_ARRAY=125]=\"UINT224_ARRAY\",t[t.UINT232_ARRAY=126]=\"UINT232_ARRAY\",t[t.UINT240_ARRAY=127]=\"UINT240_ARRAY\",t[t.UINT248_ARRAY=128]=\"UINT248_ARRAY\",t[t.UINT256_ARRAY=129]=\"UINT256_ARRAY\",t[t.INT8_ARRAY=130]=\"INT8_ARRAY\",t[t.INT16_ARRAY=131]=\"INT16_ARRAY\",t[t.INT24_ARRAY=132]=\"INT24_ARRAY\",t[t.INT32_ARRAY=133]=\"INT32_ARRAY\",t[t.INT40_ARRAY=134]=\"INT40_ARRAY\",t[t.INT48_ARRAY=135]=\"INT48_ARRAY\",t[t.INT56_ARRAY=136]=\"INT56_ARRAY\",t[t.INT64_ARRAY=137]=\"INT64_ARRAY\",t[t.INT72_ARRAY=138]=\"INT72_ARRAY\",t[t.INT80_ARRAY=139]=\"INT80_ARRAY\",t[t.INT88_ARRAY=140]=\"INT88_ARRAY\",t[t.INT96_ARRAY=141]=\"INT96_ARRAY\",t[t.INT104_ARRAY=142]=\"INT104_ARRAY\",t[t.INT112_ARRAY=143]=\"INT112_ARRAY\",t[t.INT120_ARRAY=144]=\"INT120_ARRAY\",t[t.INT128_ARRAY=145]=\"INT128_ARRAY\",t[t.INT136_ARRAY=146]=\"INT136_ARRAY\",t[t.INT144_ARRAY=147]=\"INT144_ARRAY\",t[t.INT152_ARRAY=148]=\"INT152_ARRAY\",t[t.INT160_ARRAY=149]=\"INT160_ARRAY\",t[t.INT168_ARRAY=150]=\"INT168_ARRAY\",t[t.INT176_ARRAY=151]=\"INT176_ARRAY\",t[t.INT184_ARRAY=152]=\"INT184_ARRAY\",t[t.INT192_ARRAY=153]=\"INT192_ARRAY\",t[t.INT200_ARRAY=154]=\"INT200_ARRAY\",t[t.INT208_ARRAY=155]=\"INT208_ARRAY\",t[t.INT216_ARRAY=156]=\"INT216_ARRAY\",t[t.INT224_ARRAY=157]=\"INT224_ARRAY\",t[t.INT232_ARRAY=158]=\"INT232_ARRAY\",t[t.INT240_ARRAY=159]=\"INT240_ARRAY\",t[t.INT248_ARRAY=160]=\"INT248_ARRAY\",t[t.INT256_ARRAY=161]=\"INT256_ARRAY\",t[t.BYTES1_ARRAY=162]=\"BYTES1_ARRAY\",t[t.BYTES2_ARRAY=163]=\"BYTES2_ARRAY\",t[t.BYTES3_ARRAY=164]=\"BYTES3_ARRAY\",t[t.BYTES4_ARRAY=165]=\"BYTES4_ARRAY\",t[t.BYTES5_ARRAY=166]=\"BYTES5_ARRAY\",t[t.BYTES6_ARRAY=167]=\"BYTES6_ARRAY\",t[t.BYTES7_ARRAY=168]=\"BYTES7_ARRAY\",t[t.BYTES8_ARRAY=169]=\"BYTES8_ARRAY\",t[t.BYTES9_ARRAY=170]=\"BYTES9_ARRAY\",t[t.BYTES10_ARRAY=171]=\"BYTES10_ARRAY\",t[t.BYTES11_ARRAY=172]=\"BYTES11_ARRAY\",t[t.BYTES12_ARRAY=173]=\"BYTES12_ARRAY\",t[t.BYTES13_ARRAY=174]=\"BYTES13_ARRAY\",t[t.BYTES14_ARRAY=175]=\"BYTES14_ARRAY\",t[t.BYTES15_ARRAY=176]=\"BYTES15_ARRAY\",t[t.BYTES16_ARRAY=177]=\"BYTES16_ARRAY\",t[t.BYTES17_ARRAY=178]=\"BYTES17_ARRAY\",t[t.BYTES18_ARRAY=179]=\"BYTES18_ARRAY\",t[t.BYTES19_ARRAY=180]=\"BYTES19_ARRAY\",t[t.BYTES20_ARRAY=181]=\"BYTES20_ARRAY\",t[t.BYTES21_ARRAY=182]=\"BYTES21_ARRAY\",t[t.BYTES22_ARRAY=183]=\"BYTES22_ARRAY\",t[t.BYTES23_ARRAY=184]=\"BYTES23_ARRAY\",t[t.BYTES24_ARRAY=185]=\"BYTES24_ARRAY\",t[t.BYTES25_ARRAY=186]=\"BYTES25_ARRAY\",t[t.BYTES26_ARRAY=187]=\"BYTES26_ARRAY\",t[t.BYTES27_ARRAY=188]=\"BYTES27_ARRAY\",t[t.BYTES28_ARRAY=189]=\"BYTES28_ARRAY\",t[t.BYTES29_ARRAY=190]=\"BYTES29_ARRAY\",t[t.BYTES30_ARRAY=191]=\"BYTES30_ARRAY\",t[t.BYTES31_ARRAY=192]=\"BYTES31_ARRAY\",t[t.BYTES32_ARRAY=193]=\"BYTES32_ARRAY\",t[t.BOOL_ARRAY=194]=\"BOOL_ARRAY\",t[t.ADDRESS_ARRAY=195]=\"ADDRESS_ARRAY\",t[t.BYTES=196]=\"BYTES\",t[t.STRING=197]=\"STRING\",t))(I||{});var Y={[0]:\"uint8\",[1]:\"uint16\",[2]:\"uint24\",[3]:\"uint32\",[4]:\"uint40\",[5]:\"uint48\",[6]:\"uint56\",[7]:\"uint64\",[8]:\"uint72\",[9]:\"uint80\",[10]:\"uint88\",[11]:\"uint96\",[12]:\"uint104\",[13]:\"uint112\",[14]:\"uint120\",[15]:\"uint128\",[16]:\"uint136\",[17]:\"uint144\",[18]:\"uint152\",[19]:\"uint160\",[20]:\"uint168\",[21]:\"uint176\",[22]:\"uint184\",[23]:\"uint192\",[24]:\"uint200\",[25]:\"uint208\",[26]:\"uint216\",[27]:\"uint224\",[28]:\"uint232\",[29]:\"uint240\",[30]:\"uint248\",[31]:\"uint256\",[32]:\"int8\",[33]:\"int16\",[34]:\"int24\",[35]:\"int32\",[36]:\"int40\",[37]:\"int48\",[38]:\"int56\",[39]:\"int64\",[40]:\"int72\",[41]:\"int80\",[42]:\"int88\",[43]:\"int96\",[44]:\"int104\",[45]:\"int112\",[46]:\"int120\",[47]:\"int128\",[48]:\"int136\",[49]:\"int144\",[50]:\"int152\",[51]:\"int160\",[52]:\"int168\",[53]:\"int176\",[54]:\"int184\",[55]:\"int192\",[56]:\"int200\",[57]:\"int208\",[58]:\"int216\",[59]:\"int224\",[60]:\"int232\",[61]:\"int240\",[62]:\"int248\",[63]:\"int256\",[64]:\"bytes1\",[65]:\"bytes2\",[66]:\"bytes3\",[67]:\"bytes4\",[68]:\"bytes5\",[69]:\"bytes6\",[70]:\"bytes7\",[71]:\"bytes8\",[72]:\"bytes9\",[73]:\"bytes10\",[74]:\"bytes11\",[75]:\"bytes12\",[76]:\"bytes13\",[77]:\"bytes14\",[78]:\"bytes15\",[79]:\"bytes16\",[80]:\"bytes17\",[81]:\"bytes18\",[82]:\"bytes19\",[83]:\"bytes20\",[84]:\"bytes21\",[85]:\"bytes22\",[86]:\"bytes23\",[87]:\"bytes24\",[88]:\"bytes25\",[89]:\"bytes26\",[90]:\"bytes27\",[91]:\"bytes28\",[92]:\"bytes29\",[93]:\"bytes30\",[94]:\"bytes31\",[95]:\"bytes32\",[96]:\"bool\",[97]:\"address\",[98]:\"uint8[]\",[99]:\"uint16[]\",[100]:\"uint24[]\",[101]:\"uint32[]\",[102]:\"uint40[]\",[103]:\"uint48[]\",[104]:\"uint56[]\",[105]:\"uint64[]\",[106]:\"uint72[]\",[107]:\"uint80[]\",[108]:\"uint88[]\",[109]:\"uint96[]\",[110]:\"uint104[]\",[111]:\"uint112[]\",[112]:\"uint120[]\",[113]:\"uint128[]\",[114]:\"uint136[]\",[115]:\"uint144[]\",[116]:\"uint152[]\",[117]:\"uint160[]\",[118]:\"uint168[]\",[119]:\"uint176[]\",[120]:\"uint184[]\",[121]:\"uint192[]\",[122]:\"uint200[]\",[123]:\"uint208[]\",[124]:\"uint216[]\",[125]:\"uint224[]\",[126]:\"uint232[]\",[127]:\"uint240[]\",[128]:\"uint248[]\",[129]:\"uint256[]\",[130]:\"int8[]\",[131]:\"int16[]\",[132]:\"int24[]\",[133]:\"int32[]\",[134]:\"int40[]\",[135]:\"int48[]\",[136]:\"int56[]\",[137]:\"int64[]\",[138]:\"int72[]\",[139]:\"int80[]\",[140]:\"int88[]\",[141]:\"int96[]\",[142]:\"int104[]\",[143]:\"int112[]\",[144]:\"int120[]\",[145]:\"int128[]\",[146]:\"int136[]\",[147]:\"int144[]\",[148]:\"int152[]\",[149]:\"int160[]\",[150]:\"int168[]\",[151]:\"int176[]\",[152]:\"int184[]\",[153]:\"int192[]\",[154]:\"int200[]\",[155]:\"int208[]\",[156]:\"int216[]\",[157]:\"int224[]\",[158]:\"int232[]\",[159]:\"int240[]\",[160]:\"int248[]\",[161]:\"int256[]\",[162]:\"bytes1[]\",[163]:\"bytes2[]\",[164]:\"bytes3[]\",[165]:\"bytes4[]\",[166]:\"bytes5[]\",[167]:\"bytes6[]\",[168]:\"bytes7[]\",[169]:\"bytes8[]\",[170]:\"bytes9[]\",[171]:\"bytes10[]\",[172]:\"bytes11[]\",[173]:\"bytes12[]\",[174]:\"bytes13[]\",[175]:\"bytes14[]\",[176]:\"bytes15[]\",[177]:\"bytes16[]\",[178]:\"bytes17[]\",[179]:\"bytes18[]\",[180]:\"bytes19[]\",[181]:\"bytes20[]\",[182]:\"bytes21[]\",[183]:\"bytes22[]\",[184]:\"bytes23[]\",[185]:\"bytes24[]\",[186]:\"bytes25[]\",[187]:\"bytes26[]\",[188]:\"bytes27[]\",[189]:\"bytes28[]\",[190]:\"bytes29[]\",[191]:\"bytes30[]\",[192]:\"bytes31[]\",[193]:\"bytes32[]\",[194]:\"bool[]\",[195]:\"address[]\",[196]:\"bytes\",[197]:\"string\"};var s=Object.values(Y);var _=Object.fromEntries(Object.entries(Y).map(([R,A])=>[A,parseInt(R)]));function n(R){let A=R.valueOf();return A<32?A+1:A<64?A+1-32:A<96?A+1-64:R==96?1:R==97?20:0}var U=s.filter(R=>n(_[R])>0);var u={[98]:0,[99]:1,[100]:2,[101]:3,[102]:4,[103]:5,[104]:6,[105]:7,[106]:8,[107]:9,[108]:10,[109]:11,[110]:12,[111]:13,[112]:14,[113]:15,[114]:16,[115]:17,[116]:18,[117]:19,[118]:20,[119]:21,[120]:22,[121]:23,[122]:24,[123]:25,[124]:26,[125]:27,[126]:28,[127]:29,[128]:30,[129]:31,[130]:32,[131]:33,[132]:34,[133]:35,[134]:36,[135]:37,[136]:38,[137]:39,[138]:40,[139]:41,[140]:42,[141]:43,[142]:44,[143]:45,[144]:46,[145]:47,[146]:48,[147]:49,[148]:50,[149]:51,[150]:52,[151]:53,[152]:54,[153]:55,[154]:56,[155]:57,[156]:58,[157]:59,[158]:60,[159]:61,[160]:62,[161]:63,[162]:64,[163]:65,[164]:66,[165]:67,[166]:68,[167]:69,[168]:70,[169]:71,[170]:72,[171]:73,[172]:74,[173]:75,[174]:76,[175]:77,[176]:78,[177]:79,[178]:80,[179]:81,[180]:82,[181]:83,[182]:84,[183]:85,[184]:86,[185]:87,[186]:88,[187]:89,[188]:90,[189]:91,[190]:92,[191]:93,[192]:94,[193]:95,[194]:96,[195]:97};function o(R){if(R.length>28)throw new Error(\"Schema can only have up to 28 fields\");let A=new Uint8Array(32),T=0,N=0,b=!1;for(let i=0;i0){if(b)throw new Error(\"Static fields must come before dynamic fields in the schema\");N++}else b=!0;T+=E,A[i+4]=R[i]}let r=R.length-N;if(r>14)throw new Error(\"Schema can only have up to 14 dynamic fields\");return new DataView(A.buffer).setUint16(0,T),A[2]=N,A[3]=r,A}var B={uint8:0,uint16:0,uint24:0,uint32:0,uint40:0,uint48:0,uint56:0n,uint64:0n,uint72:0n,uint80:0n,uint88:0n,uint96:0n,uint104:0n,uint112:0n,uint120:0n,uint128:0n,uint136:0n,uint144:0n,uint152:0n,uint160:0n,uint168:0n,uint176:0n,uint184:0n,uint192:0n,uint200:0n,uint208:0n,uint216:0n,uint224:0n,uint232:0n,uint240:0n,uint248:0n,uint256:0n,int8:0,int16:0,int24:0,int32:0,int40:0,int48:0,int56:0n,int64:0n,int72:0n,int80:0n,int88:0n,int96:0n,int104:0n,int112:0n,int120:0n,int128:0n,int136:0n,int144:0n,int152:0n,int160:0n,int168:0n,int176:0n,int184:0n,int192:0n,int200:0n,int208:0n,int216:0n,int224:0n,int232:0n,int240:0n,int248:0n,int256:0n,bytes1:\"0x00\",bytes2:\"0x0000\",bytes3:\"0x000000\",bytes4:\"0x00000000\",bytes5:\"0x0000000000\",bytes6:\"0x000000000000\",bytes7:\"0x00000000000000\",bytes8:\"0x0000000000000000\",bytes9:\"0x000000000000000000\",bytes10:\"0x00000000000000000000\",bytes11:\"0x0000000000000000000000\",bytes12:\"0x000000000000000000000000\",bytes13:\"0x00000000000000000000000000\",bytes14:\"0x0000000000000000000000000000\",bytes15:\"0x000000000000000000000000000000\",bytes16:\"0x00000000000000000000000000000000\",bytes17:\"0x0000000000000000000000000000000000\",bytes18:\"0x000000000000000000000000000000000000\",bytes19:\"0x00000000000000000000000000000000000000\",bytes20:\"0x0000000000000000000000000000000000000000\",bytes21:\"0x000000000000000000000000000000000000000000\",bytes22:\"0x00000000000000000000000000000000000000000000\",bytes23:\"0x0000000000000000000000000000000000000000000000\",bytes24:\"0x000000000000000000000000000000000000000000000000\",bytes25:\"0x00000000000000000000000000000000000000000000000000\",bytes26:\"0x0000000000000000000000000000000000000000000000000000\",bytes27:\"0x000000000000000000000000000000000000000000000000000000\",bytes28:\"0x00000000000000000000000000000000000000000000000000000000\",bytes29:\"0x0000000000000000000000000000000000000000000000000000000000\",bytes30:\"0x000000000000000000000000000000000000000000000000000000000000\",bytes31:\"0x00000000000000000000000000000000000000000000000000000000000000\",bytes32:\"0x0000000000000000000000000000000000000000000000000000000000000000\",bool:!1,address:\"0x0000000000000000000000000000000000000000\",\"uint8[]\":[],\"uint16[]\":[],\"uint24[]\":[],\"uint32[]\":[],\"uint40[]\":[],\"uint48[]\":[],\"uint56[]\":[],\"uint64[]\":[],\"uint72[]\":[],\"uint80[]\":[],\"uint88[]\":[],\"uint96[]\":[],\"uint104[]\":[],\"uint112[]\":[],\"uint120[]\":[],\"uint128[]\":[],\"uint136[]\":[],\"uint144[]\":[],\"uint152[]\":[],\"uint160[]\":[],\"uint168[]\":[],\"uint176[]\":[],\"uint184[]\":[],\"uint192[]\":[],\"uint200[]\":[],\"uint208[]\":[],\"uint216[]\":[],\"uint224[]\":[],\"uint232[]\":[],\"uint240[]\":[],\"uint248[]\":[],\"uint256[]\":[],\"int8[]\":[],\"int16[]\":[],\"int24[]\":[],\"int32[]\":[],\"int40[]\":[],\"int48[]\":[],\"int56[]\":[],\"int64[]\":[],\"int72[]\":[],\"int80[]\":[],\"int88[]\":[],\"int96[]\":[],\"int104[]\":[],\"int112[]\":[],\"int120[]\":[],\"int128[]\":[],\"int136[]\":[],\"int144[]\":[],\"int152[]\":[],\"int160[]\":[],\"int168[]\":[],\"int176[]\":[],\"int184[]\":[],\"int192[]\":[],\"int200[]\":[],\"int208[]\":[],\"int216[]\":[],\"int224[]\":[],\"int232[]\":[],\"int240[]\":[],\"int248[]\":[],\"int256[]\":[],\"bytes1[]\":[],\"bytes2[]\":[],\"bytes3[]\":[],\"bytes4[]\":[],\"bytes5[]\":[],\"bytes6[]\":[],\"bytes7[]\":[],\"bytes8[]\":[],\"bytes9[]\":[],\"bytes10[]\":[],\"bytes11[]\":[],\"bytes12[]\":[],\"bytes13[]\":[],\"bytes14[]\":[],\"bytes15[]\":[],\"bytes16[]\":[],\"bytes17[]\":[],\"bytes18[]\":[],\"bytes19[]\":[],\"bytes20[]\":[],\"bytes21[]\":[],\"bytes22[]\":[],\"bytes23[]\":[],\"bytes24[]\":[],\"bytes25[]\":[],\"bytes26[]\":[],\"bytes27[]\":[],\"bytes28[]\":[],\"bytes29[]\":[],\"bytes30[]\":[],\"bytes31[]\":[],\"bytes32[]\":[],\"bool[]\":[],\"address[]\":[],bytes:\"0x\",string:\"\"};function g(R){let A=R.replace(/(\\w+)\\[\\d+\\]/g,\"$1[]\");return B[A]}export{_ as AbiTypeToSchemaType,s as AbiTypes,I as SchemaType,u as SchemaTypeArrayToElement,Y as SchemaTypeToAbiType,U as StaticAbiTypes,o as encodeSchema,g as getAbiTypeDefaultValue,n as getStaticByteLength};\n//# sourceMappingURL=index.js.map","var util;\n(function (util) {\n util.assertEqual = (val) => val;\n function assertIs(_arg) { }\n util.assertIs = assertIs;\n function assertNever(_x) {\n throw new Error();\n }\n util.assertNever = assertNever;\n util.arrayToEnum = (items) => {\n const obj = {};\n for (const item of items) {\n obj[item] = item;\n }\n return obj;\n };\n util.getValidEnumValues = (obj) => {\n const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== \"number\");\n const filtered = {};\n for (const k of validKeys) {\n filtered[k] = obj[k];\n }\n return util.objectValues(filtered);\n };\n util.objectValues = (obj) => {\n return util.objectKeys(obj).map(function (e) {\n return obj[e];\n });\n };\n util.objectKeys = typeof Object.keys === \"function\" // eslint-disable-line ban/ban\n ? (obj) => Object.keys(obj) // eslint-disable-line ban/ban\n : (object) => {\n const keys = [];\n for (const key in object) {\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n keys.push(key);\n }\n }\n return keys;\n };\n util.find = (arr, checker) => {\n for (const item of arr) {\n if (checker(item))\n return item;\n }\n return undefined;\n };\n util.isInteger = typeof Number.isInteger === \"function\"\n ? (val) => Number.isInteger(val) // eslint-disable-line ban/ban\n : (val) => typeof val === \"number\" && isFinite(val) && Math.floor(val) === val;\n function joinValues(array, separator = \" | \") {\n return array\n .map((val) => (typeof val === \"string\" ? `'${val}'` : val))\n .join(separator);\n }\n util.joinValues = joinValues;\n util.jsonStringifyReplacer = (_, value) => {\n if (typeof value === \"bigint\") {\n return value.toString();\n }\n return value;\n };\n})(util || (util = {}));\nvar objectUtil;\n(function (objectUtil) {\n objectUtil.mergeShapes = (first, second) => {\n return {\n ...first,\n ...second, // second overwrites first\n };\n };\n})(objectUtil || (objectUtil = {}));\nconst ZodParsedType = util.arrayToEnum([\n \"string\",\n \"nan\",\n \"number\",\n \"integer\",\n \"float\",\n \"boolean\",\n \"date\",\n \"bigint\",\n \"symbol\",\n \"function\",\n \"undefined\",\n \"null\",\n \"array\",\n \"object\",\n \"unknown\",\n \"promise\",\n \"void\",\n \"never\",\n \"map\",\n \"set\",\n]);\nconst getParsedType = (data) => {\n const t = typeof data;\n switch (t) {\n case \"undefined\":\n return ZodParsedType.undefined;\n case \"string\":\n return ZodParsedType.string;\n case \"number\":\n return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;\n case \"boolean\":\n return ZodParsedType.boolean;\n case \"function\":\n return ZodParsedType.function;\n case \"bigint\":\n return ZodParsedType.bigint;\n case \"symbol\":\n return ZodParsedType.symbol;\n case \"object\":\n if (Array.isArray(data)) {\n return ZodParsedType.array;\n }\n if (data === null) {\n return ZodParsedType.null;\n }\n if (data.then &&\n typeof data.then === \"function\" &&\n data.catch &&\n typeof data.catch === \"function\") {\n return ZodParsedType.promise;\n }\n if (typeof Map !== \"undefined\" && data instanceof Map) {\n return ZodParsedType.map;\n }\n if (typeof Set !== \"undefined\" && data instanceof Set) {\n return ZodParsedType.set;\n }\n if (typeof Date !== \"undefined\" && data instanceof Date) {\n return ZodParsedType.date;\n }\n return ZodParsedType.object;\n default:\n return ZodParsedType.unknown;\n }\n};\n\nconst ZodIssueCode = util.arrayToEnum([\n \"invalid_type\",\n \"invalid_literal\",\n \"custom\",\n \"invalid_union\",\n \"invalid_union_discriminator\",\n \"invalid_enum_value\",\n \"unrecognized_keys\",\n \"invalid_arguments\",\n \"invalid_return_type\",\n \"invalid_date\",\n \"invalid_string\",\n \"too_small\",\n \"too_big\",\n \"invalid_intersection_types\",\n \"not_multiple_of\",\n \"not_finite\",\n]);\nconst quotelessJson = (obj) => {\n const json = JSON.stringify(obj, null, 2);\n return json.replace(/\"([^\"]+)\":/g, \"$1:\");\n};\nclass ZodError extends Error {\n constructor(issues) {\n super();\n this.issues = [];\n this.addIssue = (sub) => {\n this.issues = [...this.issues, sub];\n };\n this.addIssues = (subs = []) => {\n this.issues = [...this.issues, ...subs];\n };\n const actualProto = new.target.prototype;\n if (Object.setPrototypeOf) {\n // eslint-disable-next-line ban/ban\n Object.setPrototypeOf(this, actualProto);\n }\n else {\n this.__proto__ = actualProto;\n }\n this.name = \"ZodError\";\n this.issues = issues;\n }\n get errors() {\n return this.issues;\n }\n format(_mapper) {\n const mapper = _mapper ||\n function (issue) {\n return issue.message;\n };\n const fieldErrors = { _errors: [] };\n const processError = (error) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\") {\n issue.unionErrors.map(processError);\n }\n else if (issue.code === \"invalid_return_type\") {\n processError(issue.returnTypeError);\n }\n else if (issue.code === \"invalid_arguments\") {\n processError(issue.argumentsError);\n }\n else if (issue.path.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < issue.path.length) {\n const el = issue.path[i];\n const terminal = i === issue.path.length - 1;\n if (!terminal) {\n curr[el] = curr[el] || { _errors: [] };\n // if (typeof el === \"string\") {\n // curr[el] = curr[el] || { _errors: [] };\n // } else if (typeof el === \"number\") {\n // const errorArray: any = [];\n // errorArray._errors = [];\n // curr[el] = curr[el] || errorArray;\n // }\n }\n else {\n curr[el] = curr[el] || { _errors: [] };\n curr[el]._errors.push(mapper(issue));\n }\n curr = curr[el];\n i++;\n }\n }\n }\n };\n processError(this);\n return fieldErrors;\n }\n toString() {\n return this.message;\n }\n get message() {\n return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);\n }\n get isEmpty() {\n return this.issues.length === 0;\n }\n flatten(mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of this.issues) {\n if (sub.path.length > 0) {\n fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];\n fieldErrors[sub.path[0]].push(mapper(sub));\n }\n else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n }\n get formErrors() {\n return this.flatten();\n }\n}\nZodError.create = (issues) => {\n const error = new ZodError(issues);\n return error;\n};\n\nconst errorMap = (issue, _ctx) => {\n let message;\n switch (issue.code) {\n case ZodIssueCode.invalid_type:\n if (issue.received === ZodParsedType.undefined) {\n message = \"Required\";\n }\n else {\n message = `Expected ${issue.expected}, received ${issue.received}`;\n }\n break;\n case ZodIssueCode.invalid_literal:\n message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;\n break;\n case ZodIssueCode.unrecognized_keys:\n message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, \", \")}`;\n break;\n case ZodIssueCode.invalid_union:\n message = `Invalid input`;\n break;\n case ZodIssueCode.invalid_union_discriminator:\n message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;\n break;\n case ZodIssueCode.invalid_enum_value:\n message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;\n break;\n case ZodIssueCode.invalid_arguments:\n message = `Invalid function arguments`;\n break;\n case ZodIssueCode.invalid_return_type:\n message = `Invalid function return type`;\n break;\n case ZodIssueCode.invalid_date:\n message = `Invalid date`;\n break;\n case ZodIssueCode.invalid_string:\n if (typeof issue.validation === \"object\") {\n if (\"includes\" in issue.validation) {\n message = `Invalid input: must include \"${issue.validation.includes}\"`;\n if (typeof issue.validation.position === \"number\") {\n message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;\n }\n }\n else if (\"startsWith\" in issue.validation) {\n message = `Invalid input: must start with \"${issue.validation.startsWith}\"`;\n }\n else if (\"endsWith\" in issue.validation) {\n message = `Invalid input: must end with \"${issue.validation.endsWith}\"`;\n }\n else {\n util.assertNever(issue.validation);\n }\n }\n else if (issue.validation !== \"regex\") {\n message = `Invalid ${issue.validation}`;\n }\n else {\n message = \"Invalid\";\n }\n break;\n case ZodIssueCode.too_small:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact\n ? `exactly equal to `\n : issue.inclusive\n ? `greater than or equal to `\n : `greater than `}${issue.minimum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact\n ? `exactly equal to `\n : issue.inclusive\n ? `greater than or equal to `\n : `greater than `}${new Date(Number(issue.minimum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodIssueCode.too_big:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact\n ? `exactly`\n : issue.inclusive\n ? `less than or equal to`\n : `less than`} ${issue.maximum}`;\n else if (issue.type === \"bigint\")\n message = `BigInt must be ${issue.exact\n ? `exactly`\n : issue.inclusive\n ? `less than or equal to`\n : `less than`} ${issue.maximum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact\n ? `exactly`\n : issue.inclusive\n ? `smaller than or equal to`\n : `smaller than`} ${new Date(Number(issue.maximum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodIssueCode.custom:\n message = `Invalid input`;\n break;\n case ZodIssueCode.invalid_intersection_types:\n message = `Intersection results could not be merged`;\n break;\n case ZodIssueCode.not_multiple_of:\n message = `Number must be a multiple of ${issue.multipleOf}`;\n break;\n case ZodIssueCode.not_finite:\n message = \"Number must be finite\";\n break;\n default:\n message = _ctx.defaultError;\n util.assertNever(issue);\n }\n return { message };\n};\n\nlet overrideErrorMap = errorMap;\nfunction setErrorMap(map) {\n overrideErrorMap = map;\n}\nfunction getErrorMap() {\n return overrideErrorMap;\n}\n\nconst makeIssue = (params) => {\n const { data, path, errorMaps, issueData } = params;\n const fullPath = [...path, ...(issueData.path || [])];\n const fullIssue = {\n ...issueData,\n path: fullPath,\n };\n let errorMessage = \"\";\n const maps = errorMaps\n .filter((m) => !!m)\n .slice()\n .reverse();\n for (const map of maps) {\n errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;\n }\n return {\n ...issueData,\n path: fullPath,\n message: issueData.message || errorMessage,\n };\n};\nconst EMPTY_PATH = [];\nfunction addIssueToContext(ctx, issueData) {\n const issue = makeIssue({\n issueData: issueData,\n data: ctx.data,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap,\n ctx.schemaErrorMap,\n getErrorMap(),\n errorMap, // then global default map\n ].filter((x) => !!x),\n });\n ctx.common.issues.push(issue);\n}\nclass ParseStatus {\n constructor() {\n this.value = \"valid\";\n }\n dirty() {\n if (this.value === \"valid\")\n this.value = \"dirty\";\n }\n abort() {\n if (this.value !== \"aborted\")\n this.value = \"aborted\";\n }\n static mergeArray(status, results) {\n const arrayValue = [];\n for (const s of results) {\n if (s.status === \"aborted\")\n return INVALID;\n if (s.status === \"dirty\")\n status.dirty();\n arrayValue.push(s.value);\n }\n return { status: status.value, value: arrayValue };\n }\n static async mergeObjectAsync(status, pairs) {\n const syncPairs = [];\n for (const pair of pairs) {\n syncPairs.push({\n key: await pair.key,\n value: await pair.value,\n });\n }\n return ParseStatus.mergeObjectSync(status, syncPairs);\n }\n static mergeObjectSync(status, pairs) {\n const finalObject = {};\n for (const pair of pairs) {\n const { key, value } = pair;\n if (key.status === \"aborted\")\n return INVALID;\n if (value.status === \"aborted\")\n return INVALID;\n if (key.status === \"dirty\")\n status.dirty();\n if (value.status === \"dirty\")\n status.dirty();\n if (key.value !== \"__proto__\" &&\n (typeof value.value !== \"undefined\" || pair.alwaysSet)) {\n finalObject[key.value] = value.value;\n }\n }\n return { status: status.value, value: finalObject };\n }\n}\nconst INVALID = Object.freeze({\n status: \"aborted\",\n});\nconst DIRTY = (value) => ({ status: \"dirty\", value });\nconst OK = (value) => ({ status: \"valid\", value });\nconst isAborted = (x) => x.status === \"aborted\";\nconst isDirty = (x) => x.status === \"dirty\";\nconst isValid = (x) => x.status === \"valid\";\nconst isAsync = (x) => typeof Promise !== \"undefined\" && x instanceof Promise;\n\nvar errorUtil;\n(function (errorUtil) {\n errorUtil.errToObj = (message) => typeof message === \"string\" ? { message } : message || {};\n errorUtil.toString = (message) => typeof message === \"string\" ? message : message === null || message === void 0 ? void 0 : message.message;\n})(errorUtil || (errorUtil = {}));\n\nclass ParseInputLazyPath {\n constructor(parent, value, path, key) {\n this._cachedPath = [];\n this.parent = parent;\n this.data = value;\n this._path = path;\n this._key = key;\n }\n get path() {\n if (!this._cachedPath.length) {\n if (this._key instanceof Array) {\n this._cachedPath.push(...this._path, ...this._key);\n }\n else {\n this._cachedPath.push(...this._path, this._key);\n }\n }\n return this._cachedPath;\n }\n}\nconst handleResult = (ctx, result) => {\n if (isValid(result)) {\n return { success: true, data: result.value };\n }\n else {\n if (!ctx.common.issues.length) {\n throw new Error(\"Validation failed but no issues detected.\");\n }\n return {\n success: false,\n get error() {\n if (this._error)\n return this._error;\n const error = new ZodError(ctx.common.issues);\n this._error = error;\n return this._error;\n },\n };\n }\n};\nfunction processCreateParams(params) {\n if (!params)\n return {};\n const { errorMap, invalid_type_error, required_error, description } = params;\n if (errorMap && (invalid_type_error || required_error)) {\n throw new Error(`Can't use \"invalid_type_error\" or \"required_error\" in conjunction with custom error map.`);\n }\n if (errorMap)\n return { errorMap: errorMap, description };\n const customMap = (iss, ctx) => {\n if (iss.code !== \"invalid_type\")\n return { message: ctx.defaultError };\n if (typeof ctx.data === \"undefined\") {\n return { message: required_error !== null && required_error !== void 0 ? required_error : ctx.defaultError };\n }\n return { message: invalid_type_error !== null && invalid_type_error !== void 0 ? invalid_type_error : ctx.defaultError };\n };\n return { errorMap: customMap, description };\n}\nclass ZodType {\n constructor(def) {\n /** Alias of safeParseAsync */\n this.spa = this.safeParseAsync;\n this._def = def;\n this.parse = this.parse.bind(this);\n this.safeParse = this.safeParse.bind(this);\n this.parseAsync = this.parseAsync.bind(this);\n this.safeParseAsync = this.safeParseAsync.bind(this);\n this.spa = this.spa.bind(this);\n this.refine = this.refine.bind(this);\n this.refinement = this.refinement.bind(this);\n this.superRefine = this.superRefine.bind(this);\n this.optional = this.optional.bind(this);\n this.nullable = this.nullable.bind(this);\n this.nullish = this.nullish.bind(this);\n this.array = this.array.bind(this);\n this.promise = this.promise.bind(this);\n this.or = this.or.bind(this);\n this.and = this.and.bind(this);\n this.transform = this.transform.bind(this);\n this.brand = this.brand.bind(this);\n this.default = this.default.bind(this);\n this.catch = this.catch.bind(this);\n this.describe = this.describe.bind(this);\n this.pipe = this.pipe.bind(this);\n this.readonly = this.readonly.bind(this);\n this.isNullable = this.isNullable.bind(this);\n this.isOptional = this.isOptional.bind(this);\n }\n get description() {\n return this._def.description;\n }\n _getType(input) {\n return getParsedType(input.data);\n }\n _getOrReturnCtx(input, ctx) {\n return (ctx || {\n common: input.parent.common,\n data: input.data,\n parsedType: getParsedType(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent,\n });\n }\n _processInputParams(input) {\n return {\n status: new ParseStatus(),\n ctx: {\n common: input.parent.common,\n data: input.data,\n parsedType: getParsedType(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent,\n },\n };\n }\n _parseSync(input) {\n const result = this._parse(input);\n if (isAsync(result)) {\n throw new Error(\"Synchronous parse encountered promise.\");\n }\n return result;\n }\n _parseAsync(input) {\n const result = this._parse(input);\n return Promise.resolve(result);\n }\n parse(data, params) {\n const result = this.safeParse(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n safeParse(data, params) {\n var _a;\n const ctx = {\n common: {\n issues: [],\n async: (_a = params === null || params === void 0 ? void 0 : params.async) !== null && _a !== void 0 ? _a : false,\n contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,\n },\n path: (params === null || params === void 0 ? void 0 : params.path) || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n const result = this._parseSync({ data, path: ctx.path, parent: ctx });\n return handleResult(ctx, result);\n }\n async parseAsync(data, params) {\n const result = await this.safeParseAsync(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n async safeParseAsync(data, params) {\n const ctx = {\n common: {\n issues: [],\n contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,\n async: true,\n },\n path: (params === null || params === void 0 ? void 0 : params.path) || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });\n const result = await (isAsync(maybeAsyncResult)\n ? maybeAsyncResult\n : Promise.resolve(maybeAsyncResult));\n return handleResult(ctx, result);\n }\n refine(check, message) {\n const getIssueProperties = (val) => {\n if (typeof message === \"string\" || typeof message === \"undefined\") {\n return { message };\n }\n else if (typeof message === \"function\") {\n return message(val);\n }\n else {\n return message;\n }\n };\n return this._refinement((val, ctx) => {\n const result = check(val);\n const setError = () => ctx.addIssue({\n code: ZodIssueCode.custom,\n ...getIssueProperties(val),\n });\n if (typeof Promise !== \"undefined\" && result instanceof Promise) {\n return result.then((data) => {\n if (!data) {\n setError();\n return false;\n }\n else {\n return true;\n }\n });\n }\n if (!result) {\n setError();\n return false;\n }\n else {\n return true;\n }\n });\n }\n refinement(check, refinementData) {\n return this._refinement((val, ctx) => {\n if (!check(val)) {\n ctx.addIssue(typeof refinementData === \"function\"\n ? refinementData(val, ctx)\n : refinementData);\n return false;\n }\n else {\n return true;\n }\n });\n }\n _refinement(refinement) {\n return new ZodEffects({\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"refinement\", refinement },\n });\n }\n superRefine(refinement) {\n return this._refinement(refinement);\n }\n optional() {\n return ZodOptional.create(this, this._def);\n }\n nullable() {\n return ZodNullable.create(this, this._def);\n }\n nullish() {\n return this.nullable().optional();\n }\n array() {\n return ZodArray.create(this, this._def);\n }\n promise() {\n return ZodPromise.create(this, this._def);\n }\n or(option) {\n return ZodUnion.create([this, option], this._def);\n }\n and(incoming) {\n return ZodIntersection.create(this, incoming, this._def);\n }\n transform(transform) {\n return new ZodEffects({\n ...processCreateParams(this._def),\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"transform\", transform },\n });\n }\n default(def) {\n const defaultValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodDefault({\n ...processCreateParams(this._def),\n innerType: this,\n defaultValue: defaultValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodDefault,\n });\n }\n brand() {\n return new ZodBranded({\n typeName: ZodFirstPartyTypeKind.ZodBranded,\n type: this,\n ...processCreateParams(this._def),\n });\n }\n catch(def) {\n const catchValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodCatch({\n ...processCreateParams(this._def),\n innerType: this,\n catchValue: catchValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodCatch,\n });\n }\n describe(description) {\n const This = this.constructor;\n return new This({\n ...this._def,\n description,\n });\n }\n pipe(target) {\n return ZodPipeline.create(this, target);\n }\n readonly() {\n return ZodReadonly.create(this);\n }\n isOptional() {\n return this.safeParse(undefined).success;\n }\n isNullable() {\n return this.safeParse(null).success;\n }\n}\nconst cuidRegex = /^c[^\\s-]{8,}$/i;\nconst cuid2Regex = /^[a-z][a-z0-9]*$/;\nconst ulidRegex = /[0-9A-HJKMNP-TV-Z]{26}/;\n// const uuidRegex =\n// /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;\nconst uuidRegex = /^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$/i;\n// from https://stackoverflow.com/a/46181/1550155\n// old version: too slow, didn't support unicode\n// const emailRegex = /^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))$/i;\n//old email regex\n// const emailRegex = /^(([^<>()[\\].,;:\\s@\"]+(\\.[^<>()[\\].,;:\\s@\"]+)*)|(\".+\"))@((?!-)([^<>()[\\].,;:\\s@\"]+\\.)+[^<>()[\\].,;:\\s@\"]{1,})[^-<>()[\\].,;:\\s@\"]$/i;\n// eslint-disable-next-line\n// const emailRegex =\n// /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\])|(\\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\\.[A-Za-z]{2,})+))$/;\n// const emailRegex =\n// /^[a-zA-Z0-9\\.\\!\\#\\$\\%\\&\\'\\*\\+\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~\\-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n// const emailRegex =\n// /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$/i;\nconst emailRegex = /^([A-Z0-9_+-]+\\.?)*[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\\-]*\\.)+[A-Z]{2,}$/i;\n// const emailRegex =\n// /^[a-z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-z0-9-]+(?:\\.[a-z0-9\\-]+)*$/i;\n// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression\nconst emojiRegex = /^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$/u;\nconst ipv4Regex = /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/;\nconst ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;\n// Adapted from https://stackoverflow.com/a/3143231\nconst datetimeRegex = (args) => {\n if (args.precision) {\n if (args.offset) {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}\\\\.\\\\d{${args.precision}}(([+-]\\\\d{2}(:?\\\\d{2})?)|Z)$`);\n }\n else {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}\\\\.\\\\d{${args.precision}}Z$`);\n }\n }\n else if (args.precision === 0) {\n if (args.offset) {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}(([+-]\\\\d{2}(:?\\\\d{2})?)|Z)$`);\n }\n else {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}Z$`);\n }\n }\n else {\n if (args.offset) {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}(\\\\.\\\\d+)?(([+-]\\\\d{2}(:?\\\\d{2})?)|Z)$`);\n }\n else {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}(\\\\.\\\\d+)?Z$`);\n }\n }\n};\nfunction isValidIP(ip, version) {\n if ((version === \"v4\" || !version) && ipv4Regex.test(ip)) {\n return true;\n }\n if ((version === \"v6\" || !version) && ipv6Regex.test(ip)) {\n return true;\n }\n return false;\n}\nclass ZodString extends ZodType {\n constructor() {\n super(...arguments);\n this._regex = (regex, validation, message) => this.refinement((data) => regex.test(data), {\n validation,\n code: ZodIssueCode.invalid_string,\n ...errorUtil.errToObj(message),\n });\n /**\n * @deprecated Use z.string().min(1) instead.\n * @see {@link ZodString.min}\n */\n this.nonempty = (message) => this.min(1, errorUtil.errToObj(message));\n this.trim = () => new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"trim\" }],\n });\n this.toLowerCase = () => new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toLowerCase\" }],\n });\n this.toUpperCase = () => new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toUpperCase\" }],\n });\n }\n _parse(input) {\n if (this._def.coerce) {\n input.data = String(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.string) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.string,\n received: ctx.parsedType,\n }\n //\n );\n return INVALID;\n }\n const status = new ParseStatus();\n let ctx = undefined;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.length < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n if (input.data.length > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"length\") {\n const tooBig = input.data.length > check.value;\n const tooSmall = input.data.length < check.value;\n if (tooBig || tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n if (tooBig) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n }\n else if (tooSmall) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n }\n status.dirty();\n }\n }\n else if (check.kind === \"email\") {\n if (!emailRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"email\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"emoji\") {\n if (!emojiRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"emoji\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"uuid\") {\n if (!uuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"uuid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cuid\") {\n if (!cuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cuid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cuid2\") {\n if (!cuid2Regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cuid2\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"ulid\") {\n if (!ulidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"ulid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"url\") {\n try {\n new URL(input.data);\n }\n catch (_a) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"url\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"regex\") {\n check.regex.lastIndex = 0;\n const testResult = check.regex.test(input.data);\n if (!testResult) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"regex\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"trim\") {\n input.data = input.data.trim();\n }\n else if (check.kind === \"includes\") {\n if (!input.data.includes(check.value, check.position)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { includes: check.value, position: check.position },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"toLowerCase\") {\n input.data = input.data.toLowerCase();\n }\n else if (check.kind === \"toUpperCase\") {\n input.data = input.data.toUpperCase();\n }\n else if (check.kind === \"startsWith\") {\n if (!input.data.startsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { startsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"endsWith\") {\n if (!input.data.endsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { endsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"datetime\") {\n const regex = datetimeRegex(check);\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"datetime\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"ip\") {\n if (!isValidIP(input.data, check.version)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"ip\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n _addCheck(check) {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n email(message) {\n return this._addCheck({ kind: \"email\", ...errorUtil.errToObj(message) });\n }\n url(message) {\n return this._addCheck({ kind: \"url\", ...errorUtil.errToObj(message) });\n }\n emoji(message) {\n return this._addCheck({ kind: \"emoji\", ...errorUtil.errToObj(message) });\n }\n uuid(message) {\n return this._addCheck({ kind: \"uuid\", ...errorUtil.errToObj(message) });\n }\n cuid(message) {\n return this._addCheck({ kind: \"cuid\", ...errorUtil.errToObj(message) });\n }\n cuid2(message) {\n return this._addCheck({ kind: \"cuid2\", ...errorUtil.errToObj(message) });\n }\n ulid(message) {\n return this._addCheck({ kind: \"ulid\", ...errorUtil.errToObj(message) });\n }\n ip(options) {\n return this._addCheck({ kind: \"ip\", ...errorUtil.errToObj(options) });\n }\n datetime(options) {\n var _a;\n if (typeof options === \"string\") {\n return this._addCheck({\n kind: \"datetime\",\n precision: null,\n offset: false,\n message: options,\n });\n }\n return this._addCheck({\n kind: \"datetime\",\n precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === \"undefined\" ? null : options === null || options === void 0 ? void 0 : options.precision,\n offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,\n ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),\n });\n }\n regex(regex, message) {\n return this._addCheck({\n kind: \"regex\",\n regex: regex,\n ...errorUtil.errToObj(message),\n });\n }\n includes(value, options) {\n return this._addCheck({\n kind: \"includes\",\n value: value,\n position: options === null || options === void 0 ? void 0 : options.position,\n ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),\n });\n }\n startsWith(value, message) {\n return this._addCheck({\n kind: \"startsWith\",\n value: value,\n ...errorUtil.errToObj(message),\n });\n }\n endsWith(value, message) {\n return this._addCheck({\n kind: \"endsWith\",\n value: value,\n ...errorUtil.errToObj(message),\n });\n }\n min(minLength, message) {\n return this._addCheck({\n kind: \"min\",\n value: minLength,\n ...errorUtil.errToObj(message),\n });\n }\n max(maxLength, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxLength,\n ...errorUtil.errToObj(message),\n });\n }\n length(len, message) {\n return this._addCheck({\n kind: \"length\",\n value: len,\n ...errorUtil.errToObj(message),\n });\n }\n get isDatetime() {\n return !!this._def.checks.find((ch) => ch.kind === \"datetime\");\n }\n get isEmail() {\n return !!this._def.checks.find((ch) => ch.kind === \"email\");\n }\n get isURL() {\n return !!this._def.checks.find((ch) => ch.kind === \"url\");\n }\n get isEmoji() {\n return !!this._def.checks.find((ch) => ch.kind === \"emoji\");\n }\n get isUUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"uuid\");\n }\n get isCUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid\");\n }\n get isCUID2() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid2\");\n }\n get isULID() {\n return !!this._def.checks.find((ch) => ch.kind === \"ulid\");\n }\n get isIP() {\n return !!this._def.checks.find((ch) => ch.kind === \"ip\");\n }\n get minLength() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxLength() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n}\nZodString.create = (params) => {\n var _a;\n return new ZodString({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodString,\n coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,\n ...processCreateParams(params),\n });\n};\n// https://stackoverflow.com/questions/3966484/why-does-modulus-operator-return-fractional-number-in-javascript/31711034#31711034\nfunction floatSafeRemainder(val, step) {\n const valDecCount = (val.toString().split(\".\")[1] || \"\").length;\n const stepDecCount = (step.toString().split(\".\")[1] || \"\").length;\n const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;\n const valInt = parseInt(val.toFixed(decCount).replace(\".\", \"\"));\n const stepInt = parseInt(step.toFixed(decCount).replace(\".\", \"\"));\n return (valInt % stepInt) / Math.pow(10, decCount);\n}\nclass ZodNumber extends ZodType {\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n this.step = this.multipleOf;\n }\n _parse(input) {\n if (this._def.coerce) {\n input.data = Number(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.number) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.number,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n let ctx = undefined;\n const status = new ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"int\") {\n if (!util.isInteger(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: \"integer\",\n received: \"float\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"min\") {\n const tooSmall = check.inclusive\n ? input.data < check.value\n : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n const tooBig = check.inclusive\n ? input.data > check.value\n : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"multipleOf\") {\n if (floatSafeRemainder(input.data, check.value) !== 0) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"finite\") {\n if (!Number.isFinite(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_finite,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new ZodNumber({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil.toString(message),\n },\n ],\n });\n }\n _addCheck(check) {\n return new ZodNumber({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n int(message) {\n return this._addCheck({\n kind: \"int\",\n message: errorUtil.toString(message),\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value: value,\n message: errorUtil.toString(message),\n });\n }\n finite(message) {\n return this._addCheck({\n kind: \"finite\",\n message: errorUtil.toString(message),\n });\n }\n safe(message) {\n return this._addCheck({\n kind: \"min\",\n inclusive: true,\n value: Number.MIN_SAFE_INTEGER,\n message: errorUtil.toString(message),\n })._addCheck({\n kind: \"max\",\n inclusive: true,\n value: Number.MAX_SAFE_INTEGER,\n message: errorUtil.toString(message),\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n get isInt() {\n return !!this._def.checks.find((ch) => ch.kind === \"int\" ||\n (ch.kind === \"multipleOf\" && util.isInteger(ch.value)));\n }\n get isFinite() {\n let max = null, min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"finite\" ||\n ch.kind === \"int\" ||\n ch.kind === \"multipleOf\") {\n return true;\n }\n else if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n else if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return Number.isFinite(min) && Number.isFinite(max);\n }\n}\nZodNumber.create = (params) => {\n return new ZodNumber({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodNumber,\n coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,\n ...processCreateParams(params),\n });\n};\nclass ZodBigInt extends ZodType {\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n }\n _parse(input) {\n if (this._def.coerce) {\n input.data = BigInt(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.bigint) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.bigint,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n let ctx = undefined;\n const status = new ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n const tooSmall = check.inclusive\n ? input.data < check.value\n : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n type: \"bigint\",\n minimum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n const tooBig = check.inclusive\n ? input.data > check.value\n : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n type: \"bigint\",\n maximum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"multipleOf\") {\n if (input.data % check.value !== BigInt(0)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new ZodBigInt({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil.toString(message),\n },\n ],\n });\n }\n _addCheck(check) {\n return new ZodBigInt({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value,\n message: errorUtil.toString(message),\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n}\nZodBigInt.create = (params) => {\n var _a;\n return new ZodBigInt({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodBigInt,\n coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,\n ...processCreateParams(params),\n });\n};\nclass ZodBoolean extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = Boolean(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.boolean) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.boolean,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodBoolean.create = (params) => {\n return new ZodBoolean({\n typeName: ZodFirstPartyTypeKind.ZodBoolean,\n coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,\n ...processCreateParams(params),\n });\n};\nclass ZodDate extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = new Date(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.date) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.date,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (isNaN(input.data.getTime())) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_date,\n });\n return INVALID;\n }\n const status = new ParseStatus();\n let ctx = undefined;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.getTime() < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n message: check.message,\n inclusive: true,\n exact: false,\n minimum: check.value,\n type: \"date\",\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n if (input.data.getTime() > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n message: check.message,\n inclusive: true,\n exact: false,\n maximum: check.value,\n type: \"date\",\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return {\n status: status.value,\n value: new Date(input.data.getTime()),\n };\n }\n _addCheck(check) {\n return new ZodDate({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n min(minDate, message) {\n return this._addCheck({\n kind: \"min\",\n value: minDate.getTime(),\n message: errorUtil.toString(message),\n });\n }\n max(maxDate, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxDate.getTime(),\n message: errorUtil.toString(message),\n });\n }\n get minDate() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min != null ? new Date(min) : null;\n }\n get maxDate() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max != null ? new Date(max) : null;\n }\n}\nZodDate.create = (params) => {\n return new ZodDate({\n checks: [],\n coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,\n typeName: ZodFirstPartyTypeKind.ZodDate,\n ...processCreateParams(params),\n });\n};\nclass ZodSymbol extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.symbol) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.symbol,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodSymbol.create = (params) => {\n return new ZodSymbol({\n typeName: ZodFirstPartyTypeKind.ZodSymbol,\n ...processCreateParams(params),\n });\n};\nclass ZodUndefined extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.undefined,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodUndefined.create = (params) => {\n return new ZodUndefined({\n typeName: ZodFirstPartyTypeKind.ZodUndefined,\n ...processCreateParams(params),\n });\n};\nclass ZodNull extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.null) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.null,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodNull.create = (params) => {\n return new ZodNull({\n typeName: ZodFirstPartyTypeKind.ZodNull,\n ...processCreateParams(params),\n });\n};\nclass ZodAny extends ZodType {\n constructor() {\n super(...arguments);\n // to prevent instances of other classes from extending ZodAny. this causes issues with catchall in ZodObject.\n this._any = true;\n }\n _parse(input) {\n return OK(input.data);\n }\n}\nZodAny.create = (params) => {\n return new ZodAny({\n typeName: ZodFirstPartyTypeKind.ZodAny,\n ...processCreateParams(params),\n });\n};\nclass ZodUnknown extends ZodType {\n constructor() {\n super(...arguments);\n // required\n this._unknown = true;\n }\n _parse(input) {\n return OK(input.data);\n }\n}\nZodUnknown.create = (params) => {\n return new ZodUnknown({\n typeName: ZodFirstPartyTypeKind.ZodUnknown,\n ...processCreateParams(params),\n });\n};\nclass ZodNever extends ZodType {\n _parse(input) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.never,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n}\nZodNever.create = (params) => {\n return new ZodNever({\n typeName: ZodFirstPartyTypeKind.ZodNever,\n ...processCreateParams(params),\n });\n};\nclass ZodVoid extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.void,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodVoid.create = (params) => {\n return new ZodVoid({\n typeName: ZodFirstPartyTypeKind.ZodVoid,\n ...processCreateParams(params),\n });\n};\nclass ZodArray extends ZodType {\n _parse(input) {\n const { ctx, status } = this._processInputParams(input);\n const def = this._def;\n if (ctx.parsedType !== ZodParsedType.array) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.array,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (def.exactLength !== null) {\n const tooBig = ctx.data.length > def.exactLength.value;\n const tooSmall = ctx.data.length < def.exactLength.value;\n if (tooBig || tooSmall) {\n addIssueToContext(ctx, {\n code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small,\n minimum: (tooSmall ? def.exactLength.value : undefined),\n maximum: (tooBig ? def.exactLength.value : undefined),\n type: \"array\",\n inclusive: true,\n exact: true,\n message: def.exactLength.message,\n });\n status.dirty();\n }\n }\n if (def.minLength !== null) {\n if (ctx.data.length < def.minLength.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: def.minLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.minLength.message,\n });\n status.dirty();\n }\n }\n if (def.maxLength !== null) {\n if (ctx.data.length > def.maxLength.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: def.maxLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.maxLength.message,\n });\n status.dirty();\n }\n }\n if (ctx.common.async) {\n return Promise.all([...ctx.data].map((item, i) => {\n return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n })).then((result) => {\n return ParseStatus.mergeArray(status, result);\n });\n }\n const result = [...ctx.data].map((item, i) => {\n return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n });\n return ParseStatus.mergeArray(status, result);\n }\n get element() {\n return this._def.type;\n }\n min(minLength, message) {\n return new ZodArray({\n ...this._def,\n minLength: { value: minLength, message: errorUtil.toString(message) },\n });\n }\n max(maxLength, message) {\n return new ZodArray({\n ...this._def,\n maxLength: { value: maxLength, message: errorUtil.toString(message) },\n });\n }\n length(len, message) {\n return new ZodArray({\n ...this._def,\n exactLength: { value: len, message: errorUtil.toString(message) },\n });\n }\n nonempty(message) {\n return this.min(1, message);\n }\n}\nZodArray.create = (schema, params) => {\n return new ZodArray({\n type: schema,\n minLength: null,\n maxLength: null,\n exactLength: null,\n typeName: ZodFirstPartyTypeKind.ZodArray,\n ...processCreateParams(params),\n });\n};\nfunction deepPartialify(schema) {\n if (schema instanceof ZodObject) {\n const newShape = {};\n for (const key in schema.shape) {\n const fieldSchema = schema.shape[key];\n newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));\n }\n return new ZodObject({\n ...schema._def,\n shape: () => newShape,\n });\n }\n else if (schema instanceof ZodArray) {\n return new ZodArray({\n ...schema._def,\n type: deepPartialify(schema.element),\n });\n }\n else if (schema instanceof ZodOptional) {\n return ZodOptional.create(deepPartialify(schema.unwrap()));\n }\n else if (schema instanceof ZodNullable) {\n return ZodNullable.create(deepPartialify(schema.unwrap()));\n }\n else if (schema instanceof ZodTuple) {\n return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));\n }\n else {\n return schema;\n }\n}\nclass ZodObject extends ZodType {\n constructor() {\n super(...arguments);\n this._cached = null;\n /**\n * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.\n * If you want to pass through unknown properties, use `.passthrough()` instead.\n */\n this.nonstrict = this.passthrough;\n // extend<\n // Augmentation extends ZodRawShape,\n // NewOutput extends util.flatten<{\n // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation\n // ? Augmentation[k][\"_output\"]\n // : k extends keyof Output\n // ? Output[k]\n // : never;\n // }>,\n // NewInput extends util.flatten<{\n // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation\n // ? Augmentation[k][\"_input\"]\n // : k extends keyof Input\n // ? Input[k]\n // : never;\n // }>\n // >(\n // augmentation: Augmentation\n // ): ZodObject<\n // extendShape,\n // UnknownKeys,\n // Catchall,\n // NewOutput,\n // NewInput\n // > {\n // return new ZodObject({\n // ...this._def,\n // shape: () => ({\n // ...this._def.shape(),\n // ...augmentation,\n // }),\n // }) as any;\n // }\n /**\n * @deprecated Use `.extend` instead\n * */\n this.augment = this.extend;\n }\n _getCached() {\n if (this._cached !== null)\n return this._cached;\n const shape = this._def.shape();\n const keys = util.objectKeys(shape);\n return (this._cached = { shape, keys });\n }\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.object) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const { status, ctx } = this._processInputParams(input);\n const { shape, keys: shapeKeys } = this._getCached();\n const extraKeys = [];\n if (!(this._def.catchall instanceof ZodNever &&\n this._def.unknownKeys === \"strip\")) {\n for (const key in ctx.data) {\n if (!shapeKeys.includes(key)) {\n extraKeys.push(key);\n }\n }\n }\n const pairs = [];\n for (const key of shapeKeys) {\n const keyValidator = shape[key];\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),\n alwaysSet: key in ctx.data,\n });\n }\n if (this._def.catchall instanceof ZodNever) {\n const unknownKeys = this._def.unknownKeys;\n if (unknownKeys === \"passthrough\") {\n for (const key of extraKeys) {\n pairs.push({\n key: { status: \"valid\", value: key },\n value: { status: \"valid\", value: ctx.data[key] },\n });\n }\n }\n else if (unknownKeys === \"strict\") {\n if (extraKeys.length > 0) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.unrecognized_keys,\n keys: extraKeys,\n });\n status.dirty();\n }\n }\n else if (unknownKeys === \"strip\") ;\n else {\n throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);\n }\n }\n else {\n // run catchall validation\n const catchall = this._def.catchall;\n for (const key of extraKeys) {\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key) //, ctx.child(key), value, getParsedType(value)\n ),\n alwaysSet: key in ctx.data,\n });\n }\n }\n if (ctx.common.async) {\n return Promise.resolve()\n .then(async () => {\n const syncPairs = [];\n for (const pair of pairs) {\n const key = await pair.key;\n syncPairs.push({\n key,\n value: await pair.value,\n alwaysSet: pair.alwaysSet,\n });\n }\n return syncPairs;\n })\n .then((syncPairs) => {\n return ParseStatus.mergeObjectSync(status, syncPairs);\n });\n }\n else {\n return ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get shape() {\n return this._def.shape();\n }\n strict(message) {\n errorUtil.errToObj;\n return new ZodObject({\n ...this._def,\n unknownKeys: \"strict\",\n ...(message !== undefined\n ? {\n errorMap: (issue, ctx) => {\n var _a, _b, _c, _d;\n const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;\n if (issue.code === \"unrecognized_keys\")\n return {\n message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError,\n };\n return {\n message: defaultError,\n };\n },\n }\n : {}),\n });\n }\n strip() {\n return new ZodObject({\n ...this._def,\n unknownKeys: \"strip\",\n });\n }\n passthrough() {\n return new ZodObject({\n ...this._def,\n unknownKeys: \"passthrough\",\n });\n }\n // const AugmentFactory =\n // (def: Def) =>\n // (\n // augmentation: Augmentation\n // ): ZodObject<\n // extendShape, Augmentation>,\n // Def[\"unknownKeys\"],\n // Def[\"catchall\"]\n // > => {\n // return new ZodObject({\n // ...def,\n // shape: () => ({\n // ...def.shape(),\n // ...augmentation,\n // }),\n // }) as any;\n // };\n extend(augmentation) {\n return new ZodObject({\n ...this._def,\n shape: () => ({\n ...this._def.shape(),\n ...augmentation,\n }),\n });\n }\n /**\n * Prior to zod@1.0.12 there was a bug in the\n * inferred type of merged objects. Please\n * upgrade if you are experiencing issues.\n */\n merge(merging) {\n const merged = new ZodObject({\n unknownKeys: merging._def.unknownKeys,\n catchall: merging._def.catchall,\n shape: () => ({\n ...this._def.shape(),\n ...merging._def.shape(),\n }),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n });\n return merged;\n }\n // merge<\n // Incoming extends AnyZodObject,\n // Augmentation extends Incoming[\"shape\"],\n // NewOutput extends {\n // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation\n // ? Augmentation[k][\"_output\"]\n // : k extends keyof Output\n // ? Output[k]\n // : never;\n // },\n // NewInput extends {\n // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation\n // ? Augmentation[k][\"_input\"]\n // : k extends keyof Input\n // ? Input[k]\n // : never;\n // }\n // >(\n // merging: Incoming\n // ): ZodObject<\n // extendShape>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"],\n // NewOutput,\n // NewInput\n // > {\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n setKey(key, schema) {\n return this.augment({ [key]: schema });\n }\n // merge(\n // merging: Incoming\n // ): //ZodObject = (merging) => {\n // ZodObject<\n // extendShape>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"]\n // > {\n // // const mergedShape = objectUtil.mergeShapes(\n // // this._def.shape(),\n // // merging._def.shape()\n // // );\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n catchall(index) {\n return new ZodObject({\n ...this._def,\n catchall: index,\n });\n }\n pick(mask) {\n const shape = {};\n util.objectKeys(mask).forEach((key) => {\n if (mask[key] && this.shape[key]) {\n shape[key] = this.shape[key];\n }\n });\n return new ZodObject({\n ...this._def,\n shape: () => shape,\n });\n }\n omit(mask) {\n const shape = {};\n util.objectKeys(this.shape).forEach((key) => {\n if (!mask[key]) {\n shape[key] = this.shape[key];\n }\n });\n return new ZodObject({\n ...this._def,\n shape: () => shape,\n });\n }\n /**\n * @deprecated\n */\n deepPartial() {\n return deepPartialify(this);\n }\n partial(mask) {\n const newShape = {};\n util.objectKeys(this.shape).forEach((key) => {\n const fieldSchema = this.shape[key];\n if (mask && !mask[key]) {\n newShape[key] = fieldSchema;\n }\n else {\n newShape[key] = fieldSchema.optional();\n }\n });\n return new ZodObject({\n ...this._def,\n shape: () => newShape,\n });\n }\n required(mask) {\n const newShape = {};\n util.objectKeys(this.shape).forEach((key) => {\n if (mask && !mask[key]) {\n newShape[key] = this.shape[key];\n }\n else {\n const fieldSchema = this.shape[key];\n let newField = fieldSchema;\n while (newField instanceof ZodOptional) {\n newField = newField._def.innerType;\n }\n newShape[key] = newField;\n }\n });\n return new ZodObject({\n ...this._def,\n shape: () => newShape,\n });\n }\n keyof() {\n return createZodEnum(util.objectKeys(this.shape));\n }\n}\nZodObject.create = (shape, params) => {\n return new ZodObject({\n shape: () => shape,\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nZodObject.strictCreate = (shape, params) => {\n return new ZodObject({\n shape: () => shape,\n unknownKeys: \"strict\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nZodObject.lazycreate = (shape, params) => {\n return new ZodObject({\n shape,\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nclass ZodUnion extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const options = this._def.options;\n function handleResults(results) {\n // return first issue-free validation if it exists\n for (const result of results) {\n if (result.result.status === \"valid\") {\n return result.result;\n }\n }\n for (const result of results) {\n if (result.result.status === \"dirty\") {\n // add issues from dirty option\n ctx.common.issues.push(...result.ctx.common.issues);\n return result.result;\n }\n }\n // return invalid\n const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues));\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union,\n unionErrors,\n });\n return INVALID;\n }\n if (ctx.common.async) {\n return Promise.all(options.map(async (option) => {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n parent: null,\n };\n return {\n result: await option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx,\n }),\n ctx: childCtx,\n };\n })).then(handleResults);\n }\n else {\n let dirty = undefined;\n const issues = [];\n for (const option of options) {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n parent: null,\n };\n const result = option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx,\n });\n if (result.status === \"valid\") {\n return result;\n }\n else if (result.status === \"dirty\" && !dirty) {\n dirty = { result, ctx: childCtx };\n }\n if (childCtx.common.issues.length) {\n issues.push(childCtx.common.issues);\n }\n }\n if (dirty) {\n ctx.common.issues.push(...dirty.ctx.common.issues);\n return dirty.result;\n }\n const unionErrors = issues.map((issues) => new ZodError(issues));\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union,\n unionErrors,\n });\n return INVALID;\n }\n }\n get options() {\n return this._def.options;\n }\n}\nZodUnion.create = (types, params) => {\n return new ZodUnion({\n options: types,\n typeName: ZodFirstPartyTypeKind.ZodUnion,\n ...processCreateParams(params),\n });\n};\n/////////////////////////////////////////////////////\n/////////////////////////////////////////////////////\n////////// //////////\n////////// ZodDiscriminatedUnion //////////\n////////// //////////\n/////////////////////////////////////////////////////\n/////////////////////////////////////////////////////\nconst getDiscriminator = (type) => {\n if (type instanceof ZodLazy) {\n return getDiscriminator(type.schema);\n }\n else if (type instanceof ZodEffects) {\n return getDiscriminator(type.innerType());\n }\n else if (type instanceof ZodLiteral) {\n return [type.value];\n }\n else if (type instanceof ZodEnum) {\n return type.options;\n }\n else if (type instanceof ZodNativeEnum) {\n // eslint-disable-next-line ban/ban\n return Object.keys(type.enum);\n }\n else if (type instanceof ZodDefault) {\n return getDiscriminator(type._def.innerType);\n }\n else if (type instanceof ZodUndefined) {\n return [undefined];\n }\n else if (type instanceof ZodNull) {\n return [null];\n }\n else {\n return null;\n }\n};\nclass ZodDiscriminatedUnion extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.object) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const discriminator = this.discriminator;\n const discriminatorValue = ctx.data[discriminator];\n const option = this.optionsMap.get(discriminatorValue);\n if (!option) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union_discriminator,\n options: Array.from(this.optionsMap.keys()),\n path: [discriminator],\n });\n return INVALID;\n }\n if (ctx.common.async) {\n return option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n }\n else {\n return option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n get discriminator() {\n return this._def.discriminator;\n }\n get options() {\n return this._def.options;\n }\n get optionsMap() {\n return this._def.optionsMap;\n }\n /**\n * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.\n * However, it only allows a union of objects, all of which need to share a discriminator property. This property must\n * have a different value for each object in the union.\n * @param discriminator the name of the discriminator property\n * @param types an array of object schemas\n * @param params\n */\n static create(discriminator, options, params) {\n // Get all the valid discriminator values\n const optionsMap = new Map();\n // try {\n for (const type of options) {\n const discriminatorValues = getDiscriminator(type.shape[discriminator]);\n if (!discriminatorValues) {\n throw new Error(`A discriminator value for key \\`${discriminator}\\` could not be extracted from all schema options`);\n }\n for (const value of discriminatorValues) {\n if (optionsMap.has(value)) {\n throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);\n }\n optionsMap.set(value, type);\n }\n }\n return new ZodDiscriminatedUnion({\n typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,\n discriminator,\n options,\n optionsMap,\n ...processCreateParams(params),\n });\n }\n}\nfunction mergeValues(a, b) {\n const aType = getParsedType(a);\n const bType = getParsedType(b);\n if (a === b) {\n return { valid: true, data: a };\n }\n else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {\n const bKeys = util.objectKeys(b);\n const sharedKeys = util\n .objectKeys(a)\n .filter((key) => bKeys.indexOf(key) !== -1);\n const newObj = { ...a, ...b };\n for (const key of sharedKeys) {\n const sharedValue = mergeValues(a[key], b[key]);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newObj[key] = sharedValue.data;\n }\n return { valid: true, data: newObj };\n }\n else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {\n if (a.length !== b.length) {\n return { valid: false };\n }\n const newArray = [];\n for (let index = 0; index < a.length; index++) {\n const itemA = a[index];\n const itemB = b[index];\n const sharedValue = mergeValues(itemA, itemB);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newArray.push(sharedValue.data);\n }\n return { valid: true, data: newArray };\n }\n else if (aType === ZodParsedType.date &&\n bType === ZodParsedType.date &&\n +a === +b) {\n return { valid: true, data: a };\n }\n else {\n return { valid: false };\n }\n}\nclass ZodIntersection extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const handleParsed = (parsedLeft, parsedRight) => {\n if (isAborted(parsedLeft) || isAborted(parsedRight)) {\n return INVALID;\n }\n const merged = mergeValues(parsedLeft.value, parsedRight.value);\n if (!merged.valid) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_intersection_types,\n });\n return INVALID;\n }\n if (isDirty(parsedLeft) || isDirty(parsedRight)) {\n status.dirty();\n }\n return { status: status.value, value: merged.data };\n };\n if (ctx.common.async) {\n return Promise.all([\n this._def.left._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n this._def.right._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n ]).then(([left, right]) => handleParsed(left, right));\n }\n else {\n return handleParsed(this._def.left._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }), this._def.right._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }));\n }\n }\n}\nZodIntersection.create = (left, right, params) => {\n return new ZodIntersection({\n left: left,\n right: right,\n typeName: ZodFirstPartyTypeKind.ZodIntersection,\n ...processCreateParams(params),\n });\n};\nclass ZodTuple extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.array) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.array,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (ctx.data.length < this._def.items.length) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\",\n });\n return INVALID;\n }\n const rest = this._def.rest;\n if (!rest && ctx.data.length > this._def.items.length) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\",\n });\n status.dirty();\n }\n const items = [...ctx.data]\n .map((item, itemIndex) => {\n const schema = this._def.items[itemIndex] || this._def.rest;\n if (!schema)\n return null;\n return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));\n })\n .filter((x) => !!x); // filter nulls\n if (ctx.common.async) {\n return Promise.all(items).then((results) => {\n return ParseStatus.mergeArray(status, results);\n });\n }\n else {\n return ParseStatus.mergeArray(status, items);\n }\n }\n get items() {\n return this._def.items;\n }\n rest(rest) {\n return new ZodTuple({\n ...this._def,\n rest,\n });\n }\n}\nZodTuple.create = (schemas, params) => {\n if (!Array.isArray(schemas)) {\n throw new Error(\"You must pass an array of schemas to z.tuple([ ... ])\");\n }\n return new ZodTuple({\n items: schemas,\n typeName: ZodFirstPartyTypeKind.ZodTuple,\n rest: null,\n ...processCreateParams(params),\n });\n};\nclass ZodRecord extends ZodType {\n get keySchema() {\n return this._def.keyType;\n }\n get valueSchema() {\n return this._def.valueType;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.object) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const pairs = [];\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n for (const key in ctx.data) {\n pairs.push({\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),\n value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),\n });\n }\n if (ctx.common.async) {\n return ParseStatus.mergeObjectAsync(status, pairs);\n }\n else {\n return ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get element() {\n return this._def.valueType;\n }\n static create(first, second, third) {\n if (second instanceof ZodType) {\n return new ZodRecord({\n keyType: first,\n valueType: second,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(third),\n });\n }\n return new ZodRecord({\n keyType: ZodString.create(),\n valueType: first,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(second),\n });\n }\n}\nclass ZodMap extends ZodType {\n get keySchema() {\n return this._def.keyType;\n }\n get valueSchema() {\n return this._def.valueType;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.map) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.map,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n const pairs = [...ctx.data.entries()].map(([key, value], index) => {\n return {\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, \"key\"])),\n value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, \"value\"])),\n };\n });\n if (ctx.common.async) {\n const finalMap = new Map();\n return Promise.resolve().then(async () => {\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n });\n }\n else {\n const finalMap = new Map();\n for (const pair of pairs) {\n const key = pair.key;\n const value = pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n }\n }\n}\nZodMap.create = (keyType, valueType, params) => {\n return new ZodMap({\n valueType,\n keyType,\n typeName: ZodFirstPartyTypeKind.ZodMap,\n ...processCreateParams(params),\n });\n};\nclass ZodSet extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.set) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.set,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const def = this._def;\n if (def.minSize !== null) {\n if (ctx.data.size < def.minSize.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: def.minSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.minSize.message,\n });\n status.dirty();\n }\n }\n if (def.maxSize !== null) {\n if (ctx.data.size > def.maxSize.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: def.maxSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.maxSize.message,\n });\n status.dirty();\n }\n }\n const valueType = this._def.valueType;\n function finalizeSet(elements) {\n const parsedSet = new Set();\n for (const element of elements) {\n if (element.status === \"aborted\")\n return INVALID;\n if (element.status === \"dirty\")\n status.dirty();\n parsedSet.add(element.value);\n }\n return { status: status.value, value: parsedSet };\n }\n const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));\n if (ctx.common.async) {\n return Promise.all(elements).then((elements) => finalizeSet(elements));\n }\n else {\n return finalizeSet(elements);\n }\n }\n min(minSize, message) {\n return new ZodSet({\n ...this._def,\n minSize: { value: minSize, message: errorUtil.toString(message) },\n });\n }\n max(maxSize, message) {\n return new ZodSet({\n ...this._def,\n maxSize: { value: maxSize, message: errorUtil.toString(message) },\n });\n }\n size(size, message) {\n return this.min(size, message).max(size, message);\n }\n nonempty(message) {\n return this.min(1, message);\n }\n}\nZodSet.create = (valueType, params) => {\n return new ZodSet({\n valueType,\n minSize: null,\n maxSize: null,\n typeName: ZodFirstPartyTypeKind.ZodSet,\n ...processCreateParams(params),\n });\n};\nclass ZodFunction extends ZodType {\n constructor() {\n super(...arguments);\n this.validate = this.implement;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.function) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.function,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n function makeArgsIssue(args, error) {\n return makeIssue({\n data: args,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap,\n ctx.schemaErrorMap,\n getErrorMap(),\n errorMap,\n ].filter((x) => !!x),\n issueData: {\n code: ZodIssueCode.invalid_arguments,\n argumentsError: error,\n },\n });\n }\n function makeReturnsIssue(returns, error) {\n return makeIssue({\n data: returns,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap,\n ctx.schemaErrorMap,\n getErrorMap(),\n errorMap,\n ].filter((x) => !!x),\n issueData: {\n code: ZodIssueCode.invalid_return_type,\n returnTypeError: error,\n },\n });\n }\n const params = { errorMap: ctx.common.contextualErrorMap };\n const fn = ctx.data;\n if (this._def.returns instanceof ZodPromise) {\n // Would love a way to avoid disabling this rule, but we need\n // an alias (using an arrow function was what caused 2651).\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const me = this;\n return OK(async function (...args) {\n const error = new ZodError([]);\n const parsedArgs = await me._def.args\n .parseAsync(args, params)\n .catch((e) => {\n error.addIssue(makeArgsIssue(args, e));\n throw error;\n });\n const result = await Reflect.apply(fn, this, parsedArgs);\n const parsedReturns = await me._def.returns._def.type\n .parseAsync(result, params)\n .catch((e) => {\n error.addIssue(makeReturnsIssue(result, e));\n throw error;\n });\n return parsedReturns;\n });\n }\n else {\n // Would love a way to avoid disabling this rule, but we need\n // an alias (using an arrow function was what caused 2651).\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const me = this;\n return OK(function (...args) {\n const parsedArgs = me._def.args.safeParse(args, params);\n if (!parsedArgs.success) {\n throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);\n }\n const result = Reflect.apply(fn, this, parsedArgs.data);\n const parsedReturns = me._def.returns.safeParse(result, params);\n if (!parsedReturns.success) {\n throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);\n }\n return parsedReturns.data;\n });\n }\n }\n parameters() {\n return this._def.args;\n }\n returnType() {\n return this._def.returns;\n }\n args(...items) {\n return new ZodFunction({\n ...this._def,\n args: ZodTuple.create(items).rest(ZodUnknown.create()),\n });\n }\n returns(returnType) {\n return new ZodFunction({\n ...this._def,\n returns: returnType,\n });\n }\n implement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n strictImplement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n static create(args, returns, params) {\n return new ZodFunction({\n args: (args\n ? args\n : ZodTuple.create([]).rest(ZodUnknown.create())),\n returns: returns || ZodUnknown.create(),\n typeName: ZodFirstPartyTypeKind.ZodFunction,\n ...processCreateParams(params),\n });\n }\n}\nclass ZodLazy extends ZodType {\n get schema() {\n return this._def.getter();\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const lazySchema = this._def.getter();\n return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });\n }\n}\nZodLazy.create = (getter, params) => {\n return new ZodLazy({\n getter: getter,\n typeName: ZodFirstPartyTypeKind.ZodLazy,\n ...processCreateParams(params),\n });\n};\nclass ZodLiteral extends ZodType {\n _parse(input) {\n if (input.data !== this._def.value) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_literal,\n expected: this._def.value,\n });\n return INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n get value() {\n return this._def.value;\n }\n}\nZodLiteral.create = (value, params) => {\n return new ZodLiteral({\n value: value,\n typeName: ZodFirstPartyTypeKind.ZodLiteral,\n ...processCreateParams(params),\n });\n};\nfunction createZodEnum(values, params) {\n return new ZodEnum({\n values,\n typeName: ZodFirstPartyTypeKind.ZodEnum,\n ...processCreateParams(params),\n });\n}\nclass ZodEnum extends ZodType {\n _parse(input) {\n if (typeof input.data !== \"string\") {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n addIssueToContext(ctx, {\n expected: util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodIssueCode.invalid_type,\n });\n return INVALID;\n }\n if (this._def.values.indexOf(input.data) === -1) {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_enum_value,\n options: expectedValues,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n get options() {\n return this._def.values;\n }\n get enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Values() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n extract(values) {\n return ZodEnum.create(values);\n }\n exclude(values) {\n return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)));\n }\n}\nZodEnum.create = createZodEnum;\nclass ZodNativeEnum extends ZodType {\n _parse(input) {\n const nativeEnumValues = util.getValidEnumValues(this._def.values);\n const ctx = this._getOrReturnCtx(input);\n if (ctx.parsedType !== ZodParsedType.string &&\n ctx.parsedType !== ZodParsedType.number) {\n const expectedValues = util.objectValues(nativeEnumValues);\n addIssueToContext(ctx, {\n expected: util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodIssueCode.invalid_type,\n });\n return INVALID;\n }\n if (nativeEnumValues.indexOf(input.data) === -1) {\n const expectedValues = util.objectValues(nativeEnumValues);\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_enum_value,\n options: expectedValues,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n get enum() {\n return this._def.values;\n }\n}\nZodNativeEnum.create = (values, params) => {\n return new ZodNativeEnum({\n values: values,\n typeName: ZodFirstPartyTypeKind.ZodNativeEnum,\n ...processCreateParams(params),\n });\n};\nclass ZodPromise extends ZodType {\n unwrap() {\n return this._def.type;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.promise &&\n ctx.common.async === false) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.promise,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const promisified = ctx.parsedType === ZodParsedType.promise\n ? ctx.data\n : Promise.resolve(ctx.data);\n return OK(promisified.then((data) => {\n return this._def.type.parseAsync(data, {\n path: ctx.path,\n errorMap: ctx.common.contextualErrorMap,\n });\n }));\n }\n}\nZodPromise.create = (schema, params) => {\n return new ZodPromise({\n type: schema,\n typeName: ZodFirstPartyTypeKind.ZodPromise,\n ...processCreateParams(params),\n });\n};\nclass ZodEffects extends ZodType {\n innerType() {\n return this._def.schema;\n }\n sourceType() {\n return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects\n ? this._def.schema.sourceType()\n : this._def.schema;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const effect = this._def.effect || null;\n const checkCtx = {\n addIssue: (arg) => {\n addIssueToContext(ctx, arg);\n if (arg.fatal) {\n status.abort();\n }\n else {\n status.dirty();\n }\n },\n get path() {\n return ctx.path;\n },\n };\n checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);\n if (effect.type === \"preprocess\") {\n const processed = effect.transform(ctx.data, checkCtx);\n if (ctx.common.issues.length) {\n return {\n status: \"dirty\",\n value: ctx.data,\n };\n }\n if (ctx.common.async) {\n return Promise.resolve(processed).then((processed) => {\n return this._def.schema._parseAsync({\n data: processed,\n path: ctx.path,\n parent: ctx,\n });\n });\n }\n else {\n return this._def.schema._parseSync({\n data: processed,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n if (effect.type === \"refinement\") {\n const executeRefinement = (acc\n // effect: RefinementEffect\n ) => {\n const result = effect.refinement(acc, checkCtx);\n if (ctx.common.async) {\n return Promise.resolve(result);\n }\n if (result instanceof Promise) {\n throw new Error(\"Async refinement encountered during synchronous parse operation. Use .parseAsync instead.\");\n }\n return acc;\n };\n if (ctx.common.async === false) {\n const inner = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inner.status === \"aborted\")\n return INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n // return value is ignored\n executeRefinement(inner.value);\n return { status: status.value, value: inner.value };\n }\n else {\n return this._def.schema\n ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })\n .then((inner) => {\n if (inner.status === \"aborted\")\n return INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n return executeRefinement(inner.value).then(() => {\n return { status: status.value, value: inner.value };\n });\n });\n }\n }\n if (effect.type === \"transform\") {\n if (ctx.common.async === false) {\n const base = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (!isValid(base))\n return base;\n const result = effect.transform(base.value, checkCtx);\n if (result instanceof Promise) {\n throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);\n }\n return { status: status.value, value: result };\n }\n else {\n return this._def.schema\n ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })\n .then((base) => {\n if (!isValid(base))\n return base;\n return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status.value, value: result }));\n });\n }\n }\n util.assertNever(effect);\n }\n}\nZodEffects.create = (schema, effect, params) => {\n return new ZodEffects({\n schema,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect,\n ...processCreateParams(params),\n });\n};\nZodEffects.createWithPreprocess = (preprocess, schema, params) => {\n return new ZodEffects({\n schema,\n effect: { type: \"preprocess\", transform: preprocess },\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n ...processCreateParams(params),\n });\n};\nclass ZodOptional extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === ZodParsedType.undefined) {\n return OK(undefined);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nZodOptional.create = (type, params) => {\n return new ZodOptional({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodOptional,\n ...processCreateParams(params),\n });\n};\nclass ZodNullable extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === ZodParsedType.null) {\n return OK(null);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nZodNullable.create = (type, params) => {\n return new ZodNullable({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodNullable,\n ...processCreateParams(params),\n });\n};\nclass ZodDefault extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n let data = ctx.data;\n if (ctx.parsedType === ZodParsedType.undefined) {\n data = this._def.defaultValue();\n }\n return this._def.innerType._parse({\n data,\n path: ctx.path,\n parent: ctx,\n });\n }\n removeDefault() {\n return this._def.innerType;\n }\n}\nZodDefault.create = (type, params) => {\n return new ZodDefault({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodDefault,\n defaultValue: typeof params.default === \"function\"\n ? params.default\n : () => params.default,\n ...processCreateParams(params),\n });\n};\nclass ZodCatch extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n // newCtx is used to not collect issues from inner types in ctx\n const newCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n };\n const result = this._def.innerType._parse({\n data: newCtx.data,\n path: newCtx.path,\n parent: {\n ...newCtx,\n },\n });\n if (isAsync(result)) {\n return result.then((result) => {\n return {\n status: \"valid\",\n value: result.status === \"valid\"\n ? result.value\n : this._def.catchValue({\n get error() {\n return new ZodError(newCtx.common.issues);\n },\n input: newCtx.data,\n }),\n };\n });\n }\n else {\n return {\n status: \"valid\",\n value: result.status === \"valid\"\n ? result.value\n : this._def.catchValue({\n get error() {\n return new ZodError(newCtx.common.issues);\n },\n input: newCtx.data,\n }),\n };\n }\n }\n removeCatch() {\n return this._def.innerType;\n }\n}\nZodCatch.create = (type, params) => {\n return new ZodCatch({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodCatch,\n catchValue: typeof params.catch === \"function\" ? params.catch : () => params.catch,\n ...processCreateParams(params),\n });\n};\nclass ZodNaN extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.nan) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.nan,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n}\nZodNaN.create = (params) => {\n return new ZodNaN({\n typeName: ZodFirstPartyTypeKind.ZodNaN,\n ...processCreateParams(params),\n });\n};\nconst BRAND = Symbol(\"zod_brand\");\nclass ZodBranded extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const data = ctx.data;\n return this._def.type._parse({\n data,\n path: ctx.path,\n parent: ctx,\n });\n }\n unwrap() {\n return this._def.type;\n }\n}\nclass ZodPipeline extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.common.async) {\n const handleAsync = async () => {\n const inResult = await this._def.in._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inResult.status === \"aborted\")\n return INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return DIRTY(inResult.value);\n }\n else {\n return this._def.out._parseAsync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx,\n });\n }\n };\n return handleAsync();\n }\n else {\n const inResult = this._def.in._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inResult.status === \"aborted\")\n return INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return {\n status: \"dirty\",\n value: inResult.value,\n };\n }\n else {\n return this._def.out._parseSync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n }\n static create(a, b) {\n return new ZodPipeline({\n in: a,\n out: b,\n typeName: ZodFirstPartyTypeKind.ZodPipeline,\n });\n }\n}\nclass ZodReadonly extends ZodType {\n _parse(input) {\n const result = this._def.innerType._parse(input);\n if (isValid(result)) {\n result.value = Object.freeze(result.value);\n }\n return result;\n }\n}\nZodReadonly.create = (type, params) => {\n return new ZodReadonly({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodReadonly,\n ...processCreateParams(params),\n });\n};\nconst custom = (check, params = {}, \n/*\n * @deprecated\n *\n * Pass `fatal` into the params object instead:\n *\n * ```ts\n * z.string().custom((val) => val.length > 5, { fatal: false })\n * ```\n *\n */\nfatal) => {\n if (check)\n return ZodAny.create().superRefine((data, ctx) => {\n var _a, _b;\n if (!check(data)) {\n const p = typeof params === \"function\"\n ? params(data)\n : typeof params === \"string\"\n ? { message: params }\n : params;\n const _fatal = (_b = (_a = p.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;\n const p2 = typeof p === \"string\" ? { message: p } : p;\n ctx.addIssue({ code: \"custom\", ...p2, fatal: _fatal });\n }\n });\n return ZodAny.create();\n};\nconst late = {\n object: ZodObject.lazycreate,\n};\nvar ZodFirstPartyTypeKind;\n(function (ZodFirstPartyTypeKind) {\n ZodFirstPartyTypeKind[\"ZodString\"] = \"ZodString\";\n ZodFirstPartyTypeKind[\"ZodNumber\"] = \"ZodNumber\";\n ZodFirstPartyTypeKind[\"ZodNaN\"] = \"ZodNaN\";\n ZodFirstPartyTypeKind[\"ZodBigInt\"] = \"ZodBigInt\";\n ZodFirstPartyTypeKind[\"ZodBoolean\"] = \"ZodBoolean\";\n ZodFirstPartyTypeKind[\"ZodDate\"] = \"ZodDate\";\n ZodFirstPartyTypeKind[\"ZodSymbol\"] = \"ZodSymbol\";\n ZodFirstPartyTypeKind[\"ZodUndefined\"] = \"ZodUndefined\";\n ZodFirstPartyTypeKind[\"ZodNull\"] = \"ZodNull\";\n ZodFirstPartyTypeKind[\"ZodAny\"] = \"ZodAny\";\n ZodFirstPartyTypeKind[\"ZodUnknown\"] = \"ZodUnknown\";\n ZodFirstPartyTypeKind[\"ZodNever\"] = \"ZodNever\";\n ZodFirstPartyTypeKind[\"ZodVoid\"] = \"ZodVoid\";\n ZodFirstPartyTypeKind[\"ZodArray\"] = \"ZodArray\";\n ZodFirstPartyTypeKind[\"ZodObject\"] = \"ZodObject\";\n ZodFirstPartyTypeKind[\"ZodUnion\"] = \"ZodUnion\";\n ZodFirstPartyTypeKind[\"ZodDiscriminatedUnion\"] = \"ZodDiscriminatedUnion\";\n ZodFirstPartyTypeKind[\"ZodIntersection\"] = \"ZodIntersection\";\n ZodFirstPartyTypeKind[\"ZodTuple\"] = \"ZodTuple\";\n ZodFirstPartyTypeKind[\"ZodRecord\"] = \"ZodRecord\";\n ZodFirstPartyTypeKind[\"ZodMap\"] = \"ZodMap\";\n ZodFirstPartyTypeKind[\"ZodSet\"] = \"ZodSet\";\n ZodFirstPartyTypeKind[\"ZodFunction\"] = \"ZodFunction\";\n ZodFirstPartyTypeKind[\"ZodLazy\"] = \"ZodLazy\";\n ZodFirstPartyTypeKind[\"ZodLiteral\"] = \"ZodLiteral\";\n ZodFirstPartyTypeKind[\"ZodEnum\"] = \"ZodEnum\";\n ZodFirstPartyTypeKind[\"ZodEffects\"] = \"ZodEffects\";\n ZodFirstPartyTypeKind[\"ZodNativeEnum\"] = \"ZodNativeEnum\";\n ZodFirstPartyTypeKind[\"ZodOptional\"] = \"ZodOptional\";\n ZodFirstPartyTypeKind[\"ZodNullable\"] = \"ZodNullable\";\n ZodFirstPartyTypeKind[\"ZodDefault\"] = \"ZodDefault\";\n ZodFirstPartyTypeKind[\"ZodCatch\"] = \"ZodCatch\";\n ZodFirstPartyTypeKind[\"ZodPromise\"] = \"ZodPromise\";\n ZodFirstPartyTypeKind[\"ZodBranded\"] = \"ZodBranded\";\n ZodFirstPartyTypeKind[\"ZodPipeline\"] = \"ZodPipeline\";\n ZodFirstPartyTypeKind[\"ZodReadonly\"] = \"ZodReadonly\";\n})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));\nconst instanceOfType = (\n// const instanceOfType = any>(\ncls, params = {\n message: `Input not instance of ${cls.name}`,\n}) => custom((data) => data instanceof cls, params);\nconst stringType = ZodString.create;\nconst numberType = ZodNumber.create;\nconst nanType = ZodNaN.create;\nconst bigIntType = ZodBigInt.create;\nconst booleanType = ZodBoolean.create;\nconst dateType = ZodDate.create;\nconst symbolType = ZodSymbol.create;\nconst undefinedType = ZodUndefined.create;\nconst nullType = ZodNull.create;\nconst anyType = ZodAny.create;\nconst unknownType = ZodUnknown.create;\nconst neverType = ZodNever.create;\nconst voidType = ZodVoid.create;\nconst arrayType = ZodArray.create;\nconst objectType = ZodObject.create;\nconst strictObjectType = ZodObject.strictCreate;\nconst unionType = ZodUnion.create;\nconst discriminatedUnionType = ZodDiscriminatedUnion.create;\nconst intersectionType = ZodIntersection.create;\nconst tupleType = ZodTuple.create;\nconst recordType = ZodRecord.create;\nconst mapType = ZodMap.create;\nconst setType = ZodSet.create;\nconst functionType = ZodFunction.create;\nconst lazyType = ZodLazy.create;\nconst literalType = ZodLiteral.create;\nconst enumType = ZodEnum.create;\nconst nativeEnumType = ZodNativeEnum.create;\nconst promiseType = ZodPromise.create;\nconst effectsType = ZodEffects.create;\nconst optionalType = ZodOptional.create;\nconst nullableType = ZodNullable.create;\nconst preprocessType = ZodEffects.createWithPreprocess;\nconst pipelineType = ZodPipeline.create;\nconst ostring = () => stringType().optional();\nconst onumber = () => numberType().optional();\nconst oboolean = () => booleanType().optional();\nconst coerce = {\n string: ((arg) => ZodString.create({ ...arg, coerce: true })),\n number: ((arg) => ZodNumber.create({ ...arg, coerce: true })),\n boolean: ((arg) => ZodBoolean.create({\n ...arg,\n coerce: true,\n })),\n bigint: ((arg) => ZodBigInt.create({ ...arg, coerce: true })),\n date: ((arg) => ZodDate.create({ ...arg, coerce: true })),\n};\nconst NEVER = INVALID;\n\nvar z = /*#__PURE__*/Object.freeze({\n __proto__: null,\n defaultErrorMap: errorMap,\n setErrorMap: setErrorMap,\n getErrorMap: getErrorMap,\n makeIssue: makeIssue,\n EMPTY_PATH: EMPTY_PATH,\n addIssueToContext: addIssueToContext,\n ParseStatus: ParseStatus,\n INVALID: INVALID,\n DIRTY: DIRTY,\n OK: OK,\n isAborted: isAborted,\n isDirty: isDirty,\n isValid: isValid,\n isAsync: isAsync,\n get util () { return util; },\n get objectUtil () { return objectUtil; },\n ZodParsedType: ZodParsedType,\n getParsedType: getParsedType,\n ZodType: ZodType,\n ZodString: ZodString,\n ZodNumber: ZodNumber,\n ZodBigInt: ZodBigInt,\n ZodBoolean: ZodBoolean,\n ZodDate: ZodDate,\n ZodSymbol: ZodSymbol,\n ZodUndefined: ZodUndefined,\n ZodNull: ZodNull,\n ZodAny: ZodAny,\n ZodUnknown: ZodUnknown,\n ZodNever: ZodNever,\n ZodVoid: ZodVoid,\n ZodArray: ZodArray,\n ZodObject: ZodObject,\n ZodUnion: ZodUnion,\n ZodDiscriminatedUnion: ZodDiscriminatedUnion,\n ZodIntersection: ZodIntersection,\n ZodTuple: ZodTuple,\n ZodRecord: ZodRecord,\n ZodMap: ZodMap,\n ZodSet: ZodSet,\n ZodFunction: ZodFunction,\n ZodLazy: ZodLazy,\n ZodLiteral: ZodLiteral,\n ZodEnum: ZodEnum,\n ZodNativeEnum: ZodNativeEnum,\n ZodPromise: ZodPromise,\n ZodEffects: ZodEffects,\n ZodTransformer: ZodEffects,\n ZodOptional: ZodOptional,\n ZodNullable: ZodNullable,\n ZodDefault: ZodDefault,\n ZodCatch: ZodCatch,\n ZodNaN: ZodNaN,\n BRAND: BRAND,\n ZodBranded: ZodBranded,\n ZodPipeline: ZodPipeline,\n ZodReadonly: ZodReadonly,\n custom: custom,\n Schema: ZodType,\n ZodSchema: ZodType,\n late: late,\n get ZodFirstPartyTypeKind () { return ZodFirstPartyTypeKind; },\n coerce: coerce,\n any: anyType,\n array: arrayType,\n bigint: bigIntType,\n boolean: booleanType,\n date: dateType,\n discriminatedUnion: discriminatedUnionType,\n effect: effectsType,\n 'enum': enumType,\n 'function': functionType,\n 'instanceof': instanceOfType,\n intersection: intersectionType,\n lazy: lazyType,\n literal: literalType,\n map: mapType,\n nan: nanType,\n nativeEnum: nativeEnumType,\n never: neverType,\n 'null': nullType,\n nullable: nullableType,\n number: numberType,\n object: objectType,\n oboolean: oboolean,\n onumber: onumber,\n optional: optionalType,\n ostring: ostring,\n pipeline: pipelineType,\n preprocess: preprocessType,\n promise: promiseType,\n record: recordType,\n set: setType,\n strictObject: strictObjectType,\n string: stringType,\n symbol: symbolType,\n transformer: effectsType,\n tuple: tupleType,\n 'undefined': undefinedType,\n union: unionType,\n unknown: unknownType,\n 'void': voidType,\n NEVER: NEVER,\n ZodIssueCode: ZodIssueCode,\n quotelessJson: quotelessJson,\n ZodError: ZodError\n});\n\nexport { BRAND, DIRTY, EMPTY_PATH, INVALID, NEVER, OK, ParseStatus, ZodType as Schema, ZodAny, ZodArray, ZodBigInt, ZodBoolean, ZodBranded, ZodCatch, ZodDate, ZodDefault, ZodDiscriminatedUnion, ZodEffects, ZodEnum, ZodError, ZodFirstPartyTypeKind, ZodFunction, ZodIntersection, ZodIssueCode, ZodLazy, ZodLiteral, ZodMap, ZodNaN, ZodNativeEnum, ZodNever, ZodNull, ZodNullable, ZodNumber, ZodObject, ZodOptional, ZodParsedType, ZodPipeline, ZodPromise, ZodReadonly, ZodRecord, ZodType as ZodSchema, ZodSet, ZodString, ZodSymbol, ZodEffects as ZodTransformer, ZodTuple, ZodType, ZodUndefined, ZodUnion, ZodUnknown, ZodVoid, addIssueToContext, anyType as any, arrayType as array, bigIntType as bigint, booleanType as boolean, coerce, custom, dateType as date, z as default, errorMap as defaultErrorMap, discriminatedUnionType as discriminatedUnion, effectsType as effect, enumType as enum, functionType as function, getErrorMap, getParsedType, instanceOfType as instanceof, intersectionType as intersection, isAborted, isAsync, isDirty, isValid, late, lazyType as lazy, literalType as literal, makeIssue, mapType as map, nanType as nan, nativeEnumType as nativeEnum, neverType as never, nullType as null, nullableType as nullable, numberType as number, objectType as object, objectUtil, oboolean, onumber, optionalType as optional, ostring, pipelineType as pipeline, preprocessType as preprocess, promiseType as promise, quotelessJson, recordType as record, setType as set, setErrorMap, strictObjectType as strictObject, stringType as string, symbolType as symbol, effectsType as transformer, tupleType as tuple, undefinedType as undefined, unionType as union, unknownType as unknown, util, voidType as void, z };\n","const ANSI_BACKGROUND_OFFSET = 10;\n\nconst wrapAnsi16 = (offset = 0) => code => `\\u001B[${code + offset}m`;\n\nconst wrapAnsi256 = (offset = 0) => code => `\\u001B[${38 + offset};5;${code}m`;\n\nconst wrapAnsi16m = (offset = 0) => (red, green, blue) => `\\u001B[${38 + offset};2;${red};${green};${blue}m`;\n\nconst styles = {\n\tmodifier: {\n\t\treset: [0, 0],\n\t\t// 21 isn't widely supported and 22 does the same thing\n\t\tbold: [1, 22],\n\t\tdim: [2, 22],\n\t\titalic: [3, 23],\n\t\tunderline: [4, 24],\n\t\toverline: [53, 55],\n\t\tinverse: [7, 27],\n\t\thidden: [8, 28],\n\t\tstrikethrough: [9, 29],\n\t},\n\tcolor: {\n\t\tblack: [30, 39],\n\t\tred: [31, 39],\n\t\tgreen: [32, 39],\n\t\tyellow: [33, 39],\n\t\tblue: [34, 39],\n\t\tmagenta: [35, 39],\n\t\tcyan: [36, 39],\n\t\twhite: [37, 39],\n\n\t\t// Bright color\n\t\tblackBright: [90, 39],\n\t\tgray: [90, 39], // Alias of `blackBright`\n\t\tgrey: [90, 39], // Alias of `blackBright`\n\t\tredBright: [91, 39],\n\t\tgreenBright: [92, 39],\n\t\tyellowBright: [93, 39],\n\t\tblueBright: [94, 39],\n\t\tmagentaBright: [95, 39],\n\t\tcyanBright: [96, 39],\n\t\twhiteBright: [97, 39],\n\t},\n\tbgColor: {\n\t\tbgBlack: [40, 49],\n\t\tbgRed: [41, 49],\n\t\tbgGreen: [42, 49],\n\t\tbgYellow: [43, 49],\n\t\tbgBlue: [44, 49],\n\t\tbgMagenta: [45, 49],\n\t\tbgCyan: [46, 49],\n\t\tbgWhite: [47, 49],\n\n\t\t// Bright color\n\t\tbgBlackBright: [100, 49],\n\t\tbgGray: [100, 49], // Alias of `bgBlackBright`\n\t\tbgGrey: [100, 49], // Alias of `bgBlackBright`\n\t\tbgRedBright: [101, 49],\n\t\tbgGreenBright: [102, 49],\n\t\tbgYellowBright: [103, 49],\n\t\tbgBlueBright: [104, 49],\n\t\tbgMagentaBright: [105, 49],\n\t\tbgCyanBright: [106, 49],\n\t\tbgWhiteBright: [107, 49],\n\t},\n};\n\nexport const modifierNames = Object.keys(styles.modifier);\nexport const foregroundColorNames = Object.keys(styles.color);\nexport const backgroundColorNames = Object.keys(styles.bgColor);\nexport const colorNames = [...foregroundColorNames, ...backgroundColorNames];\n\nfunction assembleStyles() {\n\tconst codes = new Map();\n\n\tfor (const [groupName, group] of Object.entries(styles)) {\n\t\tfor (const [styleName, style] of Object.entries(group)) {\n\t\t\tstyles[styleName] = {\n\t\t\t\topen: `\\u001B[${style[0]}m`,\n\t\t\t\tclose: `\\u001B[${style[1]}m`,\n\t\t\t};\n\n\t\t\tgroup[styleName] = styles[styleName];\n\n\t\t\tcodes.set(style[0], style[1]);\n\t\t}\n\n\t\tObject.defineProperty(styles, groupName, {\n\t\t\tvalue: group,\n\t\t\tenumerable: false,\n\t\t});\n\t}\n\n\tObject.defineProperty(styles, 'codes', {\n\t\tvalue: codes,\n\t\tenumerable: false,\n\t});\n\n\tstyles.color.close = '\\u001B[39m';\n\tstyles.bgColor.close = '\\u001B[49m';\n\n\tstyles.color.ansi = wrapAnsi16();\n\tstyles.color.ansi256 = wrapAnsi256();\n\tstyles.color.ansi16m = wrapAnsi16m();\n\tstyles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);\n\n\t// From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js\n\tObject.defineProperties(styles, {\n\t\trgbToAnsi256: {\n\t\t\tvalue(red, green, blue) {\n\t\t\t\t// We use the extended greyscale palette here, with the exception of\n\t\t\t\t// black and white. normal palette only has 4 greyscale shades.\n\t\t\t\tif (red === green && green === blue) {\n\t\t\t\t\tif (red < 8) {\n\t\t\t\t\t\treturn 16;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (red > 248) {\n\t\t\t\t\t\treturn 231;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn Math.round(((red - 8) / 247) * 24) + 232;\n\t\t\t\t}\n\n\t\t\t\treturn 16\n\t\t\t\t\t+ (36 * Math.round(red / 255 * 5))\n\t\t\t\t\t+ (6 * Math.round(green / 255 * 5))\n\t\t\t\t\t+ Math.round(blue / 255 * 5);\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToRgb: {\n\t\t\tvalue(hex) {\n\t\t\t\tconst matches = /[a-f\\d]{6}|[a-f\\d]{3}/i.exec(hex.toString(16));\n\t\t\t\tif (!matches) {\n\t\t\t\t\treturn [0, 0, 0];\n\t\t\t\t}\n\n\t\t\t\tlet [colorString] = matches;\n\n\t\t\t\tif (colorString.length === 3) {\n\t\t\t\t\tcolorString = [...colorString].map(character => character + character).join('');\n\t\t\t\t}\n\n\t\t\t\tconst integer = Number.parseInt(colorString, 16);\n\n\t\t\t\treturn [\n\t\t\t\t\t/* eslint-disable no-bitwise */\n\t\t\t\t\t(integer >> 16) & 0xFF,\n\t\t\t\t\t(integer >> 8) & 0xFF,\n\t\t\t\t\tinteger & 0xFF,\n\t\t\t\t\t/* eslint-enable no-bitwise */\n\t\t\t\t];\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi256: {\n\t\t\tvalue: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t\tansi256ToAnsi: {\n\t\t\tvalue(code) {\n\t\t\t\tif (code < 8) {\n\t\t\t\t\treturn 30 + code;\n\t\t\t\t}\n\n\t\t\t\tif (code < 16) {\n\t\t\t\t\treturn 90 + (code - 8);\n\t\t\t\t}\n\n\t\t\t\tlet red;\n\t\t\t\tlet green;\n\t\t\t\tlet blue;\n\n\t\t\t\tif (code >= 232) {\n\t\t\t\t\tred = (((code - 232) * 10) + 8) / 255;\n\t\t\t\t\tgreen = red;\n\t\t\t\t\tblue = red;\n\t\t\t\t} else {\n\t\t\t\t\tcode -= 16;\n\n\t\t\t\t\tconst remainder = code % 36;\n\n\t\t\t\t\tred = Math.floor(code / 36) / 5;\n\t\t\t\t\tgreen = Math.floor(remainder / 6) / 5;\n\t\t\t\t\tblue = (remainder % 6) / 5;\n\t\t\t\t}\n\n\t\t\t\tconst value = Math.max(red, green, blue) * 2;\n\n\t\t\t\tif (value === 0) {\n\t\t\t\t\treturn 30;\n\t\t\t\t}\n\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tlet result = 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));\n\n\t\t\t\tif (value === 2) {\n\t\t\t\t\tresult += 60;\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\trgbToAnsi: {\n\t\t\tvalue: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi: {\n\t\t\tvalue: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t});\n\n\treturn styles;\n}\n\nconst ansiStyles = assembleStyles();\n\nexport default ansiStyles;\n","/* eslint-env browser */\n\nconst level = (() => {\n\tif (navigator.userAgentData) {\n\t\tconst brand = navigator.userAgentData.brands.find(({brand}) => brand === 'Chromium');\n\t\tif (brand && brand.version > 93) {\n\t\t\treturn 3;\n\t\t}\n\t}\n\n\tif (/\\b(Chrome|Chromium)\\//.test(navigator.userAgent)) {\n\t\treturn 1;\n\t}\n\n\treturn 0;\n})();\n\nconst colorSupport = level !== 0 && {\n\tlevel,\n\thasBasic: true,\n\thas256: level >= 2,\n\thas16m: level >= 3,\n};\n\nconst supportsColor = {\n\tstdout: colorSupport,\n\tstderr: colorSupport,\n};\n\nexport default supportsColor;\n","// TODO: When targeting Node.js 16, use `String.prototype.replaceAll`.\nexport function stringReplaceAll(string, substring, replacer) {\n\tlet index = string.indexOf(substring);\n\tif (index === -1) {\n\t\treturn string;\n\t}\n\n\tconst substringLength = substring.length;\n\tlet endIndex = 0;\n\tlet returnValue = '';\n\tdo {\n\t\treturnValue += string.slice(endIndex, index) + substring + replacer;\n\t\tendIndex = index + substringLength;\n\t\tindex = string.indexOf(substring, endIndex);\n\t} while (index !== -1);\n\n\treturnValue += string.slice(endIndex);\n\treturn returnValue;\n}\n\nexport function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {\n\tlet endIndex = 0;\n\tlet returnValue = '';\n\tdo {\n\t\tconst gotCR = string[index - 1] === '\\r';\n\t\treturnValue += string.slice(endIndex, (gotCR ? index - 1 : index)) + prefix + (gotCR ? '\\r\\n' : '\\n') + postfix;\n\t\tendIndex = index + 1;\n\t\tindex = string.indexOf('\\n', endIndex);\n\t} while (index !== -1);\n\n\treturnValue += string.slice(endIndex);\n\treturn returnValue;\n}\n","import ansiStyles from '#ansi-styles';\nimport supportsColor from '#supports-color';\nimport { // eslint-disable-line import/order\n\tstringReplaceAll,\n\tstringEncaseCRLFWithFirstIndex,\n} from './utilities.js';\n\nconst {stdout: stdoutColor, stderr: stderrColor} = supportsColor;\n\nconst GENERATOR = Symbol('GENERATOR');\nconst STYLER = Symbol('STYLER');\nconst IS_EMPTY = Symbol('IS_EMPTY');\n\n// `supportsColor.level` → `ansiStyles.color[name]` mapping\nconst levelMapping = [\n\t'ansi',\n\t'ansi',\n\t'ansi256',\n\t'ansi16m',\n];\n\nconst styles = Object.create(null);\n\nconst applyOptions = (object, options = {}) => {\n\tif (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {\n\t\tthrow new Error('The `level` option should be an integer from 0 to 3');\n\t}\n\n\t// Detect level if not set manually\n\tconst colorLevel = stdoutColor ? stdoutColor.level : 0;\n\tobject.level = options.level === undefined ? colorLevel : options.level;\n};\n\nexport class Chalk {\n\tconstructor(options) {\n\t\t// eslint-disable-next-line no-constructor-return\n\t\treturn chalkFactory(options);\n\t}\n}\n\nconst chalkFactory = options => {\n\tconst chalk = (...strings) => strings.join(' ');\n\tapplyOptions(chalk, options);\n\n\tObject.setPrototypeOf(chalk, createChalk.prototype);\n\n\treturn chalk;\n};\n\nfunction createChalk(options) {\n\treturn chalkFactory(options);\n}\n\nObject.setPrototypeOf(createChalk.prototype, Function.prototype);\n\nfor (const [styleName, style] of Object.entries(ansiStyles)) {\n\tstyles[styleName] = {\n\t\tget() {\n\t\t\tconst builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);\n\t\t\tObject.defineProperty(this, styleName, {value: builder});\n\t\t\treturn builder;\n\t\t},\n\t};\n}\n\nstyles.visible = {\n\tget() {\n\t\tconst builder = createBuilder(this, this[STYLER], true);\n\t\tObject.defineProperty(this, 'visible', {value: builder});\n\t\treturn builder;\n\t},\n};\n\nconst getModelAnsi = (model, level, type, ...arguments_) => {\n\tif (model === 'rgb') {\n\t\tif (level === 'ansi16m') {\n\t\t\treturn ansiStyles[type].ansi16m(...arguments_);\n\t\t}\n\n\t\tif (level === 'ansi256') {\n\t\t\treturn ansiStyles[type].ansi256(ansiStyles.rgbToAnsi256(...arguments_));\n\t\t}\n\n\t\treturn ansiStyles[type].ansi(ansiStyles.rgbToAnsi(...arguments_));\n\t}\n\n\tif (model === 'hex') {\n\t\treturn getModelAnsi('rgb', level, type, ...ansiStyles.hexToRgb(...arguments_));\n\t}\n\n\treturn ansiStyles[type][model](...arguments_);\n};\n\nconst usedModels = ['rgb', 'hex', 'ansi256'];\n\nfor (const model of usedModels) {\n\tstyles[model] = {\n\t\tget() {\n\t\t\tconst {level} = this;\n\t\t\treturn function (...arguments_) {\n\t\t\t\tconst styler = createStyler(getModelAnsi(model, levelMapping[level], 'color', ...arguments_), ansiStyles.color.close, this[STYLER]);\n\t\t\t\treturn createBuilder(this, styler, this[IS_EMPTY]);\n\t\t\t};\n\t\t},\n\t};\n\n\tconst bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);\n\tstyles[bgModel] = {\n\t\tget() {\n\t\t\tconst {level} = this;\n\t\t\treturn function (...arguments_) {\n\t\t\t\tconst styler = createStyler(getModelAnsi(model, levelMapping[level], 'bgColor', ...arguments_), ansiStyles.bgColor.close, this[STYLER]);\n\t\t\t\treturn createBuilder(this, styler, this[IS_EMPTY]);\n\t\t\t};\n\t\t},\n\t};\n}\n\nconst proto = Object.defineProperties(() => {}, {\n\t...styles,\n\tlevel: {\n\t\tenumerable: true,\n\t\tget() {\n\t\t\treturn this[GENERATOR].level;\n\t\t},\n\t\tset(level) {\n\t\t\tthis[GENERATOR].level = level;\n\t\t},\n\t},\n});\n\nconst createStyler = (open, close, parent) => {\n\tlet openAll;\n\tlet closeAll;\n\tif (parent === undefined) {\n\t\topenAll = open;\n\t\tcloseAll = close;\n\t} else {\n\t\topenAll = parent.openAll + open;\n\t\tcloseAll = close + parent.closeAll;\n\t}\n\n\treturn {\n\t\topen,\n\t\tclose,\n\t\topenAll,\n\t\tcloseAll,\n\t\tparent,\n\t};\n};\n\nconst createBuilder = (self, _styler, _isEmpty) => {\n\t// Single argument is hot path, implicit coercion is faster than anything\n\t// eslint-disable-next-line no-implicit-coercion\n\tconst builder = (...arguments_) => applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' '));\n\n\t// We alter the prototype because we must return a function, but there is\n\t// no way to create a function with a different prototype\n\tObject.setPrototypeOf(builder, proto);\n\n\tbuilder[GENERATOR] = self;\n\tbuilder[STYLER] = _styler;\n\tbuilder[IS_EMPTY] = _isEmpty;\n\n\treturn builder;\n};\n\nconst applyStyle = (self, string) => {\n\tif (self.level <= 0 || !string) {\n\t\treturn self[IS_EMPTY] ? '' : string;\n\t}\n\n\tlet styler = self[STYLER];\n\n\tif (styler === undefined) {\n\t\treturn string;\n\t}\n\n\tconst {openAll, closeAll} = styler;\n\tif (string.includes('\\u001B')) {\n\t\twhile (styler !== undefined) {\n\t\t\t// Replace any instances already present with a re-opening code\n\t\t\t// otherwise only the part of the string until said closing code\n\t\t\t// will be colored, and the rest will simply be 'plain'.\n\t\t\tstring = stringReplaceAll(string, styler.close, styler.open);\n\n\t\t\tstyler = styler.parent;\n\t\t}\n\t}\n\n\t// We can move both next actions out of loop, because remaining actions in loop won't have\n\t// any/visible effect on parts we add here. Close the styling before a linebreak and reopen\n\t// after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92\n\tconst lfIndex = string.indexOf('\\n');\n\tif (lfIndex !== -1) {\n\t\tstring = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);\n\t}\n\n\treturn openAll + string + closeAll;\n};\n\nObject.defineProperties(createChalk.prototype, styles);\n\nconst chalk = createChalk();\nexport const chalkStderr = createChalk({level: stderrColor ? stderrColor.level : 0});\n\nexport {\n\tmodifierNames,\n\tforegroundColorNames,\n\tbackgroundColorNames,\n\tcolorNames,\n\n\t// TODO: Remove these aliases in the next major version\n\tmodifierNames as modifiers,\n\tforegroundColorNames as foregroundColors,\n\tbackgroundColorNames as backgroundColors,\n\tcolorNames as colors,\n} from './vendor/ansi-styles/index.js';\n\nexport {\n\tstdoutColor as supportsColor,\n\tstderrColor as supportsColorStderr,\n};\n\nexport default chalk;\n","const identifierRegex = /[$_\\p{ID_Start}][$\\u200c\\u200d\\p{ID_Continue}]*/u;\nexport function joinPath(path) {\n if (path.length === 1) {\n return path[0].toString();\n }\n return path.reduce((acc, item) => {\n if (typeof item === 'number') {\n return acc + '[' + item.toString() + ']';\n }\n if (item.includes('\"')) {\n return acc + '[\"' + escapeQuotes(item) + '\"]';\n }\n if (!identifierRegex.test(item)) {\n return acc + '[\"' + item + '\"]';\n }\n const separator = acc.length === 0 ? '' : '.';\n return acc + separator + item;\n }, '');\n}\nfunction escapeQuotes(str) {\n return str.replace(/\"/g, '\\\\\"');\n}\n","export function isNonEmptyArray(value) {\n return value.length !== 0;\n}\n","import * as zod from 'zod';\nimport { joinPath } from './utils/joinPath';\nimport { isNonEmptyArray } from './utils/NonEmptyArray';\nconst MAX_ISSUES_IN_MESSAGE = 99;\nconst ISSUE_SEPARATOR = '; ';\nconst UNION_SEPARATOR = ', or ';\nconst PREFIX = 'Validation error';\nconst PREFIX_SEPARATOR = ': ';\nexport class ValidationError extends Error {\n details;\n name;\n constructor(message, details = []) {\n super(message);\n this.details = details;\n this.name = 'ZodValidationError';\n }\n toString() {\n return this.message;\n }\n}\nfunction getMessageFromZodIssue(issue, issueSeparator, unionSeparator) {\n if (issue.code === 'invalid_union') {\n return issue.unionErrors\n .reduce((acc, zodError) => {\n const newIssues = zodError.issues\n .map((issue) => getMessageFromZodIssue(issue, issueSeparator, unionSeparator))\n .join(issueSeparator);\n if (!acc.includes(newIssues)) {\n acc.push(newIssues);\n }\n return acc;\n }, [])\n .join(unionSeparator);\n }\n if (isNonEmptyArray(issue.path)) {\n if (issue.path.length === 1) {\n const identifier = issue.path[0];\n if (typeof identifier === 'number') {\n return `${issue.message} at index ${identifier}`;\n }\n }\n return `${issue.message} at \"${joinPath(issue.path)}\"`;\n }\n return issue.message;\n}\nfunction conditionallyPrefixMessage(reason, prefix, prefixSeparator) {\n if (prefix !== null) {\n if (reason.length > 0) {\n return [prefix, reason].join(prefixSeparator);\n }\n return prefix;\n }\n if (reason.length > 0) {\n return reason;\n }\n return PREFIX;\n}\nexport function fromZodIssue(issue, options = {}) {\n const { issueSeparator = ISSUE_SEPARATOR, unionSeparator = UNION_SEPARATOR, prefixSeparator = PREFIX_SEPARATOR, prefix = PREFIX, } = options;\n const reason = getMessageFromZodIssue(issue, issueSeparator, unionSeparator);\n const message = conditionallyPrefixMessage(reason, prefix, prefixSeparator);\n return new ValidationError(message, [issue]);\n}\nexport function fromZodError(zodError, options = {}) {\n const { maxIssuesInMessage = MAX_ISSUES_IN_MESSAGE, issueSeparator = ISSUE_SEPARATOR, unionSeparator = UNION_SEPARATOR, prefixSeparator = PREFIX_SEPARATOR, prefix = PREFIX, } = options;\n const reason = zodError.errors\n .slice(0, maxIssuesInMessage)\n .map((issue) => getMessageFromZodIssue(issue, issueSeparator, unionSeparator))\n .join(issueSeparator);\n const message = conditionallyPrefixMessage(reason, prefix, prefixSeparator);\n return new ValidationError(message, zodError.errors);\n}\nexport const toValidationError = (options = {}) => (err) => {\n if (err instanceof zod.ZodError) {\n return fromZodError(err, options);\n }\n if (err instanceof Error) {\n return err;\n }\n return new Error('Unknown error');\n};\nexport function isValidationError(err) {\n return err instanceof ValidationError;\n}\nexport function isValidationErrorLike(err) {\n return err instanceof Error && err.name === 'ZodValidationError';\n}\nexport const errorMap = (issue, ctx) => {\n const error = fromZodIssue({\n ...issue,\n message: issue.message ?? ctx.defaultError,\n });\n return {\n message: error.message,\n };\n};\n","var a=Object.defineProperty;var m=(r,e,o)=>e in r?a(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o;var x=(r,e,o)=>(m(r,typeof e!=\"symbol\"?e+\"\":e,o),o);import d from\"chalk\";import{z as c,ZodIssueCode as i}from\"zod\";import{fromZodError as p}from\"zod-validation-error\";var t=class extends Error{name=\"MUDContextAlreadyCreatedError\";message=\"MUD context was already created\"},s=class extends Error{name=\"MUDContextNotCreatedError\";message=\"MUD context has not been created\"};function l(r,e){return p(r,{prefix:d.red(e),prefixSeparator:`\n- `,issueSeparator:`\n- `})}var n=class extends Error{name=\"NotInsideProjectError\";message=\"You are not inside a MUD project\"};function U(r,e){return new c.ZodError([{code:i.custom,path:r,message:`Unrecognized system: \"${e}\"`}])}export{x as a,t as b,s as c,l as d,n as e,U as f};\n//# sourceMappingURL=chunk-AXXYPYMM.js.map","import{a as m,b as f,c as p}from\"./chunk-AXXYPYMM.js\";import{z as s}from\"zod\";import{utils as E}from\"ethers\";import{ZodIssueCode as r}from\"zod\";var g=16;function d(e,t){/^\\w+$/.test(e)||t.addIssue({code:r.custom,message:\"Name must contain only alphanumeric & underscore characters\"})}function x(e,t){d(e,t),/^[A-Z]/.test(e)||t.addIssue({code:r.custom,message:\"Name must start with a capital letter\"})}function C(e,t){d(e,t),/^[a-z]/.test(e)||t.addIssue({code:r.custom,message:\"Name must start with a lowercase letter\"})}function h(e,t){e.length===0&&t.addIssue({code:r.custom,message:\"Enum must not be empty\"}),e.length>=256&&t.addIssue({code:r.custom,message:\"Length of enum must be < 256\"});let o=M(e);o.length>0&&t.addIssue({code:r.custom,message:`Enum must not have duplicate names for: ${o.join(\", \")}`})}function c(e,t){return(o,n)=>{if(o===\"\"){e&&n.addIssue({code:r.custom,message:\"Route must not be empty\"});return}o[0]!==\"/\"&&n.addIssue({code:r.custom,message:'Route must start with \"/\"'}),o[o.length-1]===\"/\"&&n.addIssue({code:r.custom,message:'Route must not end with \"/\"'});let a=o.split(\"/\");t&&a.length>2&&n.addIssue({code:r.custom,message:'Route must only have one level (e.g. \"/foo\")'});for(let u=1;ug&&t.addIssue({code:r.custom,message:`Selector must be <= ${g} characters`}),/^\\w*$/.test(e)||t.addIssue({code:r.custom,message:\"Selector must contain only alphanumeric & underscore characters\"})}function z(e){let t=e.match(/^(\\w+)\\[(\\d+)\\]$/);return t?{elementType:t[1],staticLength:Number.parseInt(t[2])}:null}var v=s.string().superRefine(x),$=s.string().superRefine(C),B=s.string().superRefine(d),G=s.array(v).superRefine(h),O=s.string().superRefine(y),V=s.string().superRefine(b),j=s.string().superRefine(R),k=s.string().superRefine(D),P=s.string().superRefine(U);var l=class{static isCreated(){return this._global.__mudCoreContext!==void 0}static createContext(){if(this.isCreated())throw new f;let t=this._global,o=new l;return t.__mudCoreContext=o,o}static getContext(){let o=this._global.__mudCoreContext;if(o===void 0)throw new p;return o}configExtenders=[]},i=l;m(i,\"_global\",typeof global>\"u\"?window.global??{}:global);function Y(e){let t=e,o=i.getContext();for(let n of o.configExtenders)t=n(t);return t}function q(e){i.getContext().configExtenders.push(e)}import{MUDError as I}from\"@latticexyz/common/errors\";var w=(o=>(o[o.TABLE_ID=0]=\"TABLE_ID\",o[o.SYSTEM_ADDRESS=1]=\"SYSTEM_ADDRESS\",o))(w||{});function ee(e){return{type:0,input:e}}function A(e){return typeof e==\"object\"&&e!==null&&\"type\"in e&&\"input\"in e}async function te(e,t){if(!A(e))return e;let o;if(e.type===0){let n=t.tableIds?.[e.input];o=n&&{value:n,type:\"bytes32\"}}if(o===void 0)throw new I(`Could not resolve dynamic resolution: \n${JSON.stringify(e,null,2)}`);return o}export{g as a,d as b,x as c,C as d,h as e,y as f,R as g,b as h,D as i,M as j,U as k,z as l,v as m,$ as n,B as o,G as p,O as q,V as r,j as s,k as t,P as u,i as v,Y as w,q as x,w as y,ee as z,A,te as B};\n//# sourceMappingURL=chunk-4G6ZGMDP.js.map","var l={storeImportPath:\"@latticexyz/store/src/\",userTypesPath:\"Types\",codegenDirectory:\"codegen\"},g={namespace:\"\",enums:{}},m={directory:\"tables\",keySchema:{key:\"bytes32\"},tableIdArgument:!1,storeArgument:!0,ephemeral:!1};import{AbiTypes as D,StaticAbiTypes as z}from\"@latticexyz/schema-type/deprecated\";import{z as t,ZodIssueCode as o}from\"zod\";import{getDuplicates as p,parseStaticArray as R,STORE_SELECTOR_MAX_LENGTH as L,zObjectName as f,zSelector as S,zUserEnum as k,zValueName as b}from\"@latticexyz/config\";var j=f,O=b,v=b,I=f,d=t.string(),_=t.string(),P=t.record(O,_).default(m.keySchema),U=t.record(v,d).refine(e=>Object.keys(e).length>0,\"Table schema may not be empty\"),K=d.transform(e=>U.parse({value:e})),q=U.or(K),h=t.object({directory:t.string().default(m.directory),name:S.optional(),tableIdArgument:t.boolean().default(m.tableIdArgument),storeArgument:t.boolean().default(m.storeArgument),dataStruct:t.boolean().optional(),keySchema:P,schema:q,ephemeral:t.boolean().default(m.ephemeral)}).transform(e=>(Object.keys(e.schema).length===1?e.dataStruct??=!1:e.dataStruct??=!0,e)),B=d.transform(e=>h.parse({schema:{value:e}})),M=h.or(B),$=t.record(j,M).transform(e=>{for(let n of Object.keys(e)){let s=e[n];s.name=n.slice(0,L),e[n]=s}return e}),H=t.object({enums:t.record(I,k).default(g.enums)}),x=t.object({namespace:S.default(g.namespace),storeImportPath:t.string().default(l.storeImportPath),tables:$,userTypesPath:t.string().default(l.userTypesPath),codegenDirectory:t.string().default(l.codegenDirectory)}).merge(H),se=x.superRefine(C),re=x.catchall(t.any()).superRefine(C);function C(e,n){for(let a of Object.values(e.tables)){let c=Object.keys(a.keySchema),N=Object.keys(a.schema),T=p([...c,...N]);T.length>0&&n.addIssue({code:o.custom,message:`Field and key names within one table must be unique: ${T.join(\", \")}`})}let s=Object.keys(e.tables),r=Object.keys(e.enums),i=r,E=[...s,...i],u=p(E);u.length>0&&n.addIssue({code:o.custom,message:`Table library names, enum names must be globally unique: ${u.join(\", \")}`});let A=Object.values(e.tables).map(({name:a})=>a),y=p(A);y.length>0&&n.addIssue({code:o.custom,message:`Table names must be unique: ${y.join(\", \")}`});for(let a of Object.values(e.tables)){for(let c of Object.values(a.keySchema))F(r,c,n);for(let c of Object.values(a.schema))G(i,r,c,n)}}function G(e,n,s,r){if(!D.includes(s)&&!e.includes(s)){let i=R(s);i?V(n,i.elementType,i.staticLength,r):r.addIssue({code:o.custom,message:`${s} is not a valid abi type, and is not defined in userTypes`})}}function F(e,n,s){!z.includes(n)&&!e.includes(n)&&s.addIssue({code:o.custom,message:`${n} is not a static type`})}function V(e,n,s,r){F(e,n,r),s===0?r.addIssue({code:o.custom,message:\"Static array length must not be 0\"}):s>=2**16&&r.addIssue({code:o.custom,message:\"Static array length must be less than 2**16\"})}export{l as a,g as b,m as c,q as d,M as e,$ as f,H as g,se as h,re as i};\n//# sourceMappingURL=chunk-5AKM5HGJ.js.map","import{v as e,w as o,z as r}from\"../chunk-4G6ZGMDP.js\";import\"../chunk-AXXYPYMM.js\";e.isCreated()||e.createContext();export{o as mudCoreConfig,r as resolveTableId};\n//# sourceMappingURL=index.js.map","import{i as e}from\"./chunk-5AKM5HGJ.js\";import\"@latticexyz/config/register\";import{mudCoreConfig as c,resolveTableId as y}from\"@latticexyz/config/register\";import{extendMUDCoreConfig as t,fromZodErrorCustom as n}from\"@latticexyz/config\";import{ZodError as i}from\"zod\";t(r=>{try{return e.parse(r)}catch(o){throw o instanceof i?n(o,\"StoreConfig Validation Error\"):o}});import{mudCoreConfig as m}from\"@latticexyz/config\";function s(r){return m(r)}export{s as a,c as b,y as c};\n//# sourceMappingURL=chunk-6QMWGFYG.js.map","import{a as e}from\"./chunk-6QMWGFYG.js\";import\"./chunk-5AKM5HGJ.js\";var a=e({storeImportPath:\"../../\",namespace:\"mudstore\",enums:{ExampleEnum:[\"None\",\"First\",\"Second\",\"Third\"]},tables:{Hooks:\"address[]\",Callbacks:\"bytes24[]\",Tables:{keySchema:{tableId:\"bytes32\"},schema:{keySchema:\"bytes32\",valueSchema:\"bytes32\",abiEncodedKeyNames:\"bytes\",abiEncodedFieldNames:\"bytes\"}},Mixed:{schema:{u32:\"uint32\",u128:\"uint128\",a32:\"uint32[]\",s:\"string\"}},Vector2:{schema:{x:\"uint32\",y:\"uint32\"}},KeyEncoding:{keySchema:{k1:\"uint256\",k2:\"int32\",k3:\"bytes16\",k4:\"address\",k5:\"bool\",k6:\"ExampleEnum\"},schema:\"bool\"}}});export{a as default};\n//# sourceMappingURL=mud.config.js.map","import{decodeField as R,decodeKeyTuple as F,decodeRecord as S,abiTypesToSchema as C,hexToSchema as N}from\"@latticexyz/protocol-parser\";import{decodeAbiParameters as v,getAddress as m,parseAbiParameters as h}from\"viem\";import E from\"debug\";var g=E(\"mud:store-sync\");import{isDefined as O}from\"@latticexyz/common/utils\";import{hexToTableId as T,tableIdToHex as V}from\"@latticexyz/common\";import x from\"@latticexyz/store/mud.config\";var k=x.tables.Tables,A=V(x.namespace,k.name);function G({registerTables:I,getTables:L,storeOperations:P}){return async o=>{let t=o.logs.map(e=>{if(e.eventName!==\"StoreSetRecord\"||e.args.table!==A)return;let[a,...f]=e.args.key;f.length&&console.warn(\"registerSchema event is expected to have only one key in key tuple, but got multiple\",e);let b=T(a),c=S(C(Object.values(k.schema)),e.args.data),s=Object.fromEntries(Object.keys(k.schema).map((i,d)=>[i,c[d]])),p=N(s.keySchema),l=N(s.valueSchema),r=v(h(\"string[]\"),s.abiEncodedKeyNames)[0],n=v(h(\"string[]\"),s.abiEncodedFieldNames)[0],u=[...l.staticFields,...l.dynamicFields];return{address:e.address,tableId:a,namespace:b.namespace,name:b.name,keySchema:Object.fromEntries(p.staticFields.map((i,d)=>[r[d],i])),valueSchema:Object.fromEntries(u.map((i,d)=>[n[d],i]))}}).filter(O);t.length>0&&await I({blockNumber:o.blockNumber,tables:t});let j=Array.from(new Set(o.logs.map(e=>JSON.stringify({address:m(e.address),tableId:e.args.table,...T(e.args.table)})))).map(e=>JSON.parse(e)),B=Object.fromEntries((await L({blockNumber:o.blockNumber,tables:j})).map(e=>[`${m(e.address)}:${e.tableId}`,e])),y=o.logs.map(e=>{let a=B[`${m(e.address)}:${e.args.table}`];if(!a){g(\"no table found for event, skipping\",T(e.args.table),e);return}let f=Object.keys(a.keySchema),b=F({staticFields:Object.values(a.keySchema),dynamicFields:[]},e.args.key),c=Object.fromEntries(b.map((r,n)=>[f[n],r])),s=Object.values(a.valueSchema),p=C(s),l=Object.keys(a.valueSchema);if(e.eventName===\"StoreSetRecord\"||e.eventName===\"StoreEphemeralRecord\"){let r=S(p,e.args.data),n=Object.fromEntries(l.map((u,i)=>[u,r[i]]));return{log:e,address:m(e.address),namespace:a.namespace,name:a.name,type:\"SetRecord\",key:c,value:n}}if(e.eventName===\"StoreSetField\"){let r=l[e.args.schemaIndex],n=R(s[e.args.schemaIndex],e.args.data);return{log:e,address:m(e.address),namespace:a.namespace,name:a.name,type:\"SetField\",key:c,fieldName:r,fieldValue:n}}if(e.eventName===\"StoreDeleteRecord\")return{log:e,address:m(e.address),namespace:a.namespace,name:a.name,type:\"DeleteRecord\",key:c};g(\"unknown store event or log, skipping\",e)}).filter(O);return await P({blockNumber:o.blockNumber,operations:y}),{blockNumber:o.blockNumber,operations:y}}}var w=(t=>(t.INITIALIZE=\"initialize\",t.SNAPSHOT=\"snapshot\",t.RPC=\"rpc\",t.LIVE=\"live\",t))(w||{});export{g as a,G as b,w as c};\n//# sourceMappingURL=chunk-SNWOSPCV.js.map","/**\n * @internal\n */ function invert(obj) {\n const newObj = Object.create(null);\n for(const key in obj){\n const v = obj[key];\n newObj[v] = key;\n }\n return newObj;\n}\n\n// reference: https://www.jsonrpc.org/specification\n/**\n * JSON-RPC 2.0 Error codes\n *\n * `-32000` to `-32099` are reserved for implementation-defined server-errors.\n * For tRPC we're copying the last digits of HTTP 4XX errors.\n */ const TRPC_ERROR_CODES_BY_KEY = {\n /**\n * Invalid JSON was received by the server.\n * An error occurred on the server while parsing the JSON text.\n */ PARSE_ERROR: -32700,\n /**\n * The JSON sent is not a valid Request object.\n */ BAD_REQUEST: -32600,\n /**\n * Internal JSON-RPC error.\n */ INTERNAL_SERVER_ERROR: -32603,\n // Implementation specific errors\n UNAUTHORIZED: -32001,\n FORBIDDEN: -32003,\n NOT_FOUND: -32004,\n METHOD_NOT_SUPPORTED: -32005,\n TIMEOUT: -32008,\n CONFLICT: -32009,\n PRECONDITION_FAILED: -32012,\n PAYLOAD_TOO_LARGE: -32013,\n UNPROCESSABLE_CONTENT: -32022,\n TOO_MANY_REQUESTS: -32029,\n CLIENT_CLOSED_REQUEST: -32099\n};\nconst TRPC_ERROR_CODES_BY_NUMBER = invert(TRPC_ERROR_CODES_BY_KEY);\n\nexport { TRPC_ERROR_CODES_BY_KEY as T, TRPC_ERROR_CODES_BY_NUMBER as a, invert as i };\n","import { i as invert, T as TRPC_ERROR_CODES_BY_KEY } from './codes-24aa1ce1.mjs';\n\nconst TRPC_ERROR_CODES_BY_NUMBER = invert(TRPC_ERROR_CODES_BY_KEY);\nconst JSONRPC2_TO_HTTP_CODE = {\n PARSE_ERROR: 400,\n BAD_REQUEST: 400,\n NOT_FOUND: 404,\n INTERNAL_SERVER_ERROR: 500,\n UNAUTHORIZED: 401,\n FORBIDDEN: 403,\n TIMEOUT: 408,\n CONFLICT: 409,\n CLIENT_CLOSED_REQUEST: 499,\n PRECONDITION_FAILED: 412,\n PAYLOAD_TOO_LARGE: 413,\n METHOD_NOT_SUPPORTED: 405,\n UNPROCESSABLE_CONTENT: 422,\n TOO_MANY_REQUESTS: 429\n};\nfunction getStatusCodeFromKey(code) {\n return JSONRPC2_TO_HTTP_CODE[code] ?? 500;\n}\nfunction getHTTPStatusCode(json) {\n const arr = Array.isArray(json) ? json : [\n json\n ];\n const httpStatuses = new Set(arr.map((res)=>{\n if ('error' in res) {\n const data = res.error.data;\n if (typeof data.httpStatus === 'number') {\n return data.httpStatus;\n }\n const code = TRPC_ERROR_CODES_BY_NUMBER[res.error.code];\n return getStatusCodeFromKey(code);\n }\n return 200;\n }));\n if (httpStatuses.size !== 1) {\n return 207;\n }\n const httpStatus = httpStatuses.values().next().value;\n return httpStatus;\n}\nfunction getHTTPStatusCodeFromError(error) {\n const { code } = error;\n return getStatusCodeFromKey(code);\n}\n\nconst noop = ()=>{\n// noop\n};\nfunction createInnerProxy(callback, path) {\n const proxy = new Proxy(noop, {\n get (_obj, key) {\n if (typeof key !== 'string' || key === 'then') {\n // special case for if the proxy is accidentally treated\n // like a PromiseLike (like in `Promise.resolve(proxy)`)\n return undefined;\n }\n return createInnerProxy(callback, [\n ...path,\n key\n ]);\n },\n apply (_1, _2, args) {\n const isApply = path[path.length - 1] === 'apply';\n return callback({\n args: isApply ? args.length >= 2 ? args[1] : [] : args,\n path: isApply ? path.slice(0, -1) : path\n });\n }\n });\n return proxy;\n}\n/**\n * Creates a proxy that calls the callback with the path and arguments\n *\n * @internal\n */ const createRecursiveProxy = (callback)=>createInnerProxy(callback, []);\n/**\n * Used in place of `new Proxy` where each handler will map 1 level deep to another value.\n *\n * @internal\n */ const createFlatProxy = (callback)=>{\n return new Proxy(noop, {\n get (_obj, name) {\n if (typeof name !== 'string' || name === 'then') {\n // special case for if the proxy is accidentally treated\n // like a PromiseLike (like in `Promise.resolve(proxy)`)\n return undefined;\n }\n return callback(name);\n }\n });\n};\n\nexport { TRPC_ERROR_CODES_BY_NUMBER as T, createRecursiveProxy as a, getHTTPStatusCode as b, createFlatProxy as c, getHTTPStatusCodeFromError as g };\n","import { T as TRPCError } from './TRPCError-6a1653a4.mjs';\nimport { a as createRecursiveProxy, g as getHTTPStatusCodeFromError } from './index-044a193b.mjs';\nimport { T as TRPC_ERROR_CODES_BY_KEY } from './codes-24aa1ce1.mjs';\n\n/**\n * @public\n */ /**\n * @internal\n */ function getDataTransformer(transformer) {\n if ('input' in transformer) {\n return transformer;\n }\n return {\n input: transformer,\n output: transformer\n };\n}\n/**\n * @internal\n */ const defaultTransformer = {\n _default: true,\n input: {\n serialize: (obj)=>obj,\n deserialize: (obj)=>obj\n },\n output: {\n serialize: (obj)=>obj,\n deserialize: (obj)=>obj\n }\n};\n\nconst defaultFormatter = ({ shape })=>{\n return shape;\n};\n\n/**\n * Create an object without inheriting anything from `Object.prototype`\n * @internal\n */ function omitPrototype(obj) {\n return Object.assign(Object.create(null), obj);\n}\n\nconst procedureTypes = [\n 'query',\n 'mutation',\n 'subscription'\n];\n\nfunction isRouter(procedureOrRouter) {\n return 'router' in procedureOrRouter._def;\n}\nconst emptyRouter = {\n _ctx: null,\n _errorShape: null,\n _meta: null,\n queries: {},\n mutations: {},\n subscriptions: {},\n errorFormatter: defaultFormatter,\n transformer: defaultTransformer\n};\n/**\n * Reserved words that can't be used as router or procedure names\n */ const reservedWords = [\n /**\n * Then is a reserved word because otherwise we can't return a promise that returns a Proxy\n * since JS will think that `.then` is something that exists\n */ 'then'\n];\n/**\n * @internal\n */ function createRouterFactory(config) {\n return function createRouterInner(procedures) {\n const reservedWordsUsed = new Set(Object.keys(procedures).filter((v)=>reservedWords.includes(v)));\n if (reservedWordsUsed.size > 0) {\n throw new Error('Reserved words used in `router({})` call: ' + Array.from(reservedWordsUsed).join(', '));\n }\n const routerProcedures = omitPrototype({});\n function recursiveGetPaths(procedures, path = '') {\n for (const [key, procedureOrRouter] of Object.entries(procedures ?? {})){\n const newPath = `${path}${key}`;\n if (isRouter(procedureOrRouter)) {\n recursiveGetPaths(procedureOrRouter._def.procedures, `${newPath}.`);\n continue;\n }\n if (routerProcedures[newPath]) {\n throw new Error(`Duplicate key: ${newPath}`);\n }\n routerProcedures[newPath] = procedureOrRouter;\n }\n }\n recursiveGetPaths(procedures);\n const _def = {\n _config: config,\n router: true,\n procedures: routerProcedures,\n ...emptyRouter,\n record: procedures,\n queries: Object.entries(routerProcedures).filter((pair)=>pair[1]._def.query).reduce((acc, [key, val])=>({\n ...acc,\n [key]: val\n }), {}),\n mutations: Object.entries(routerProcedures).filter((pair)=>pair[1]._def.mutation).reduce((acc, [key, val])=>({\n ...acc,\n [key]: val\n }), {}),\n subscriptions: Object.entries(routerProcedures).filter((pair)=>pair[1]._def.subscription).reduce((acc, [key, val])=>({\n ...acc,\n [key]: val\n }), {})\n };\n const router = {\n ...procedures,\n _def,\n createCaller (ctx) {\n const proxy = createRecursiveProxy(({ path , args })=>{\n // interop mode\n if (path.length === 1 && procedureTypes.includes(path[0])) {\n return callProcedure({\n procedures: _def.procedures,\n path: args[0],\n rawInput: args[1],\n ctx,\n type: path[0]\n });\n }\n const fullPath = path.join('.');\n const procedure = _def.procedures[fullPath];\n let type = 'query';\n if (procedure._def.mutation) {\n type = 'mutation';\n } else if (procedure._def.subscription) {\n type = 'subscription';\n }\n return procedure({\n path: fullPath,\n rawInput: args[0],\n ctx,\n type\n });\n });\n return proxy;\n },\n getErrorShape (opts) {\n const { path , error } = opts;\n const { code } = opts.error;\n const shape = {\n message: error.message,\n code: TRPC_ERROR_CODES_BY_KEY[code],\n data: {\n code,\n httpStatus: getHTTPStatusCodeFromError(error)\n }\n };\n if (config.isDev && typeof opts.error.stack === 'string') {\n shape.data.stack = opts.error.stack;\n }\n if (typeof path === 'string') {\n shape.data.path = path;\n }\n return this._def._config.errorFormatter({\n ...opts,\n shape\n });\n }\n };\n return router;\n };\n}\n/**\n * @internal\n */ function callProcedure(opts) {\n const { type , path } = opts;\n if (!(path in opts.procedures) || !opts.procedures[path]?._def[type]) {\n throw new TRPCError({\n code: 'NOT_FOUND',\n message: `No \"${type}\"-procedure on path \"${path}\"`\n });\n }\n const procedure = opts.procedures[path];\n return procedure(opts);\n}\n\n/**\n * The default check to see if we're in a server\n */ const isServerDefault = typeof window === 'undefined' || 'Deno' in window || globalThis.process?.env?.NODE_ENV === 'test' || !!globalThis.process?.env?.JEST_WORKER_ID || !!globalThis.process?.env?.VITEST_WORKER_ID;\n\nexport { defaultTransformer as a, callProcedure as b, createRouterFactory as c, defaultFormatter as d, getDataTransformer as g, isServerDefault as i, procedureTypes as p };\n","var DoubleIndexedKV = /** @class */ (function () {\n function DoubleIndexedKV() {\n this.keyToValue = new Map();\n this.valueToKey = new Map();\n }\n DoubleIndexedKV.prototype.set = function (key, value) {\n this.keyToValue.set(key, value);\n this.valueToKey.set(value, key);\n };\n DoubleIndexedKV.prototype.getByKey = function (key) {\n return this.keyToValue.get(key);\n };\n DoubleIndexedKV.prototype.getByValue = function (value) {\n return this.valueToKey.get(value);\n };\n DoubleIndexedKV.prototype.clear = function () {\n this.keyToValue.clear();\n this.valueToKey.clear();\n };\n return DoubleIndexedKV;\n}());\nexport { DoubleIndexedKV };\n//# sourceMappingURL=double-indexed-kv.js.map","import { DoubleIndexedKV } from './double-indexed-kv';\nvar Registry = /** @class */ (function () {\n function Registry(generateIdentifier) {\n this.generateIdentifier = generateIdentifier;\n this.kv = new DoubleIndexedKV();\n }\n Registry.prototype.register = function (value, identifier) {\n if (this.kv.getByValue(value)) {\n return;\n }\n if (!identifier) {\n identifier = this.generateIdentifier(value);\n }\n this.kv.set(identifier, value);\n };\n Registry.prototype.clear = function () {\n this.kv.clear();\n };\n Registry.prototype.getIdentifier = function (value) {\n return this.kv.getByValue(value);\n };\n Registry.prototype.getValue = function (identifier) {\n return this.kv.getByKey(identifier);\n };\n return Registry;\n}());\nexport { Registry };\n//# sourceMappingURL=registry.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Registry } from './registry';\nvar ClassRegistry = /** @class */ (function (_super) {\n __extends(ClassRegistry, _super);\n function ClassRegistry() {\n var _this = _super.call(this, function (c) { return c.name; }) || this;\n _this.classToAllowedProps = new Map();\n return _this;\n }\n ClassRegistry.prototype.register = function (value, options) {\n if (typeof options === 'object') {\n if (options.allowProps) {\n this.classToAllowedProps.set(value, options.allowProps);\n }\n _super.prototype.register.call(this, value, options.identifier);\n }\n else {\n _super.prototype.register.call(this, value, options);\n }\n };\n ClassRegistry.prototype.getAllowedProps = function (value) {\n return this.classToAllowedProps.get(value);\n };\n return ClassRegistry;\n}(Registry));\nexport { ClassRegistry };\n//# sourceMappingURL=class-registry.js.map","var __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nfunction valuesOfObj(record) {\n if ('values' in Object) {\n // eslint-disable-next-line es5/no-es6-methods\n return Object.values(record);\n }\n var values = [];\n // eslint-disable-next-line no-restricted-syntax\n for (var key in record) {\n if (record.hasOwnProperty(key)) {\n values.push(record[key]);\n }\n }\n return values;\n}\nexport function find(record, predicate) {\n var values = valuesOfObj(record);\n if ('find' in values) {\n // eslint-disable-next-line es5/no-es6-methods\n return values.find(predicate);\n }\n var valuesNotNever = values;\n for (var i = 0; i < valuesNotNever.length; i++) {\n var value = valuesNotNever[i];\n if (predicate(value)) {\n return value;\n }\n }\n return undefined;\n}\nexport function forEach(record, run) {\n Object.entries(record).forEach(function (_a) {\n var _b = __read(_a, 2), key = _b[0], value = _b[1];\n return run(value, key);\n });\n}\nexport function includes(arr, value) {\n return arr.indexOf(value) !== -1;\n}\nexport function findArr(record, predicate) {\n for (var i = 0; i < record.length; i++) {\n var value = record[i];\n if (predicate(value)) {\n return value;\n }\n }\n return undefined;\n}\n//# sourceMappingURL=util.js.map","import { find } from './util';\nvar CustomTransformerRegistry = /** @class */ (function () {\n function CustomTransformerRegistry() {\n this.transfomers = {};\n }\n CustomTransformerRegistry.prototype.register = function (transformer) {\n this.transfomers[transformer.name] = transformer;\n };\n CustomTransformerRegistry.prototype.findApplicable = function (v) {\n return find(this.transfomers, function (transformer) {\n return transformer.isApplicable(v);\n });\n };\n CustomTransformerRegistry.prototype.findByName = function (name) {\n return this.transfomers[name];\n };\n return CustomTransformerRegistry;\n}());\nexport { CustomTransformerRegistry };\n//# sourceMappingURL=custom-transformer-registry.js.map","var getType = function (payload) {\n return Object.prototype.toString.call(payload).slice(8, -1);\n};\nexport var isUndefined = function (payload) {\n return typeof payload === 'undefined';\n};\nexport var isNull = function (payload) { return payload === null; };\nexport var isPlainObject = function (payload) {\n if (typeof payload !== 'object' || payload === null)\n return false;\n if (payload === Object.prototype)\n return false;\n if (Object.getPrototypeOf(payload) === null)\n return true;\n return Object.getPrototypeOf(payload) === Object.prototype;\n};\nexport var isEmptyObject = function (payload) {\n return isPlainObject(payload) && Object.keys(payload).length === 0;\n};\nexport var isArray = function (payload) {\n return Array.isArray(payload);\n};\nexport var isString = function (payload) {\n return typeof payload === 'string';\n};\nexport var isNumber = function (payload) {\n return typeof payload === 'number' && !isNaN(payload);\n};\nexport var isBoolean = function (payload) {\n return typeof payload === 'boolean';\n};\nexport var isRegExp = function (payload) {\n return payload instanceof RegExp;\n};\nexport var isMap = function (payload) {\n return payload instanceof Map;\n};\nexport var isSet = function (payload) {\n return payload instanceof Set;\n};\nexport var isSymbol = function (payload) {\n return getType(payload) === 'Symbol';\n};\nexport var isDate = function (payload) {\n return payload instanceof Date && !isNaN(payload.valueOf());\n};\nexport var isError = function (payload) {\n return payload instanceof Error;\n};\nexport var isNaNValue = function (payload) {\n return typeof payload === 'number' && isNaN(payload);\n};\nexport var isPrimitive = function (payload) {\n return isBoolean(payload) ||\n isNull(payload) ||\n isUndefined(payload) ||\n isNumber(payload) ||\n isString(payload) ||\n isSymbol(payload);\n};\nexport var isBigint = function (payload) {\n return typeof payload === 'bigint';\n};\nexport var isInfinite = function (payload) {\n return payload === Infinity || payload === -Infinity;\n};\nexport var isTypedArray = function (payload) {\n return ArrayBuffer.isView(payload) && !(payload instanceof DataView);\n};\nexport var isURL = function (payload) { return payload instanceof URL; };\n//# sourceMappingURL=is.js.map","export var escapeKey = function (key) { return key.replace(/\\./g, '\\\\.'); };\nexport var stringifyPath = function (path) {\n return path\n .map(String)\n .map(escapeKey)\n .join('.');\n};\nexport var parsePath = function (string) {\n var result = [];\n var segment = '';\n for (var i = 0; i < string.length; i++) {\n var char = string.charAt(i);\n var isEscapedDot = char === '\\\\' && string.charAt(i + 1) === '.';\n if (isEscapedDot) {\n segment += '.';\n i++;\n continue;\n }\n var isEndOfSegment = char === '.';\n if (isEndOfSegment) {\n result.push(segment);\n segment = '';\n continue;\n }\n segment += char;\n }\n var lastSegment = segment;\n result.push(lastSegment);\n return result;\n};\n//# sourceMappingURL=pathstringifier.js.map","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nimport { isBigint, isDate, isInfinite, isMap, isNaNValue, isRegExp, isSet, isUndefined, isSymbol, isArray, isError, isTypedArray, isURL, } from './is';\nimport { findArr } from './util';\nfunction simpleTransformation(isApplicable, annotation, transform, untransform) {\n return {\n isApplicable: isApplicable,\n annotation: annotation,\n transform: transform,\n untransform: untransform\n };\n}\nvar simpleRules = [\n simpleTransformation(isUndefined, 'undefined', function () { return null; }, function () { return undefined; }),\n simpleTransformation(isBigint, 'bigint', function (v) { return v.toString(); }, function (v) {\n if (typeof BigInt !== 'undefined') {\n return BigInt(v);\n }\n console.error('Please add a BigInt polyfill.');\n return v;\n }),\n simpleTransformation(isDate, 'Date', function (v) { return v.toISOString(); }, function (v) { return new Date(v); }),\n simpleTransformation(isError, 'Error', function (v, superJson) {\n var baseError = {\n name: v.name,\n message: v.message\n };\n superJson.allowedErrorProps.forEach(function (prop) {\n baseError[prop] = v[prop];\n });\n return baseError;\n }, function (v, superJson) {\n var e = new Error(v.message);\n e.name = v.name;\n e.stack = v.stack;\n superJson.allowedErrorProps.forEach(function (prop) {\n e[prop] = v[prop];\n });\n return e;\n }),\n simpleTransformation(isRegExp, 'regexp', function (v) { return '' + v; }, function (regex) {\n var body = regex.slice(1, regex.lastIndexOf('/'));\n var flags = regex.slice(regex.lastIndexOf('/') + 1);\n return new RegExp(body, flags);\n }),\n simpleTransformation(isSet, 'set', \n // (sets only exist in es6+)\n // eslint-disable-next-line es5/no-es6-methods\n function (v) { return __spreadArray([], __read(v.values())); }, function (v) { return new Set(v); }),\n simpleTransformation(isMap, 'map', function (v) { return __spreadArray([], __read(v.entries())); }, function (v) { return new Map(v); }),\n simpleTransformation(function (v) { return isNaNValue(v) || isInfinite(v); }, 'number', function (v) {\n if (isNaNValue(v)) {\n return 'NaN';\n }\n if (v > 0) {\n return 'Infinity';\n }\n else {\n return '-Infinity';\n }\n }, Number),\n simpleTransformation(function (v) { return v === 0 && 1 / v === -Infinity; }, 'number', function () {\n return '-0';\n }, Number),\n simpleTransformation(isURL, 'URL', function (v) { return v.toString(); }, function (v) { return new URL(v); }),\n];\nfunction compositeTransformation(isApplicable, annotation, transform, untransform) {\n return {\n isApplicable: isApplicable,\n annotation: annotation,\n transform: transform,\n untransform: untransform\n };\n}\nvar symbolRule = compositeTransformation(function (s, superJson) {\n if (isSymbol(s)) {\n var isRegistered = !!superJson.symbolRegistry.getIdentifier(s);\n return isRegistered;\n }\n return false;\n}, function (s, superJson) {\n var identifier = superJson.symbolRegistry.getIdentifier(s);\n return ['symbol', identifier];\n}, function (v) { return v.description; }, function (_, a, superJson) {\n var value = superJson.symbolRegistry.getValue(a[1]);\n if (!value) {\n throw new Error('Trying to deserialize unknown symbol');\n }\n return value;\n});\nvar constructorToName = [\n Int8Array,\n Uint8Array,\n Int16Array,\n Uint16Array,\n Int32Array,\n Uint32Array,\n Float32Array,\n Float64Array,\n Uint8ClampedArray,\n].reduce(function (obj, ctor) {\n obj[ctor.name] = ctor;\n return obj;\n}, {});\nvar typedArrayRule = compositeTransformation(isTypedArray, function (v) { return ['typed-array', v.constructor.name]; }, function (v) { return __spreadArray([], __read(v)); }, function (v, a) {\n var ctor = constructorToName[a[1]];\n if (!ctor) {\n throw new Error('Trying to deserialize unknown typed array');\n }\n return new ctor(v);\n});\nexport function isInstanceOfRegisteredClass(potentialClass, superJson) {\n if (potentialClass === null || potentialClass === void 0 ? void 0 : potentialClass.constructor) {\n var isRegistered = !!superJson.classRegistry.getIdentifier(potentialClass.constructor);\n return isRegistered;\n }\n return false;\n}\nvar classRule = compositeTransformation(isInstanceOfRegisteredClass, function (clazz, superJson) {\n var identifier = superJson.classRegistry.getIdentifier(clazz.constructor);\n return ['class', identifier];\n}, function (clazz, superJson) {\n var allowedProps = superJson.classRegistry.getAllowedProps(clazz.constructor);\n if (!allowedProps) {\n return __assign({}, clazz);\n }\n var result = {};\n allowedProps.forEach(function (prop) {\n result[prop] = clazz[prop];\n });\n return result;\n}, function (v, a, superJson) {\n var clazz = superJson.classRegistry.getValue(a[1]);\n if (!clazz) {\n throw new Error('Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564');\n }\n return Object.assign(Object.create(clazz.prototype), v);\n});\nvar customRule = compositeTransformation(function (value, superJson) {\n return !!superJson.customTransformerRegistry.findApplicable(value);\n}, function (value, superJson) {\n var transformer = superJson.customTransformerRegistry.findApplicable(value);\n return ['custom', transformer.name];\n}, function (value, superJson) {\n var transformer = superJson.customTransformerRegistry.findApplicable(value);\n return transformer.serialize(value);\n}, function (v, a, superJson) {\n var transformer = superJson.customTransformerRegistry.findByName(a[1]);\n if (!transformer) {\n throw new Error('Trying to deserialize unknown custom value');\n }\n return transformer.deserialize(v);\n});\nvar compositeRules = [classRule, symbolRule, customRule, typedArrayRule];\nexport var transformValue = function (value, superJson) {\n var applicableCompositeRule = findArr(compositeRules, function (rule) {\n return rule.isApplicable(value, superJson);\n });\n if (applicableCompositeRule) {\n return {\n value: applicableCompositeRule.transform(value, superJson),\n type: applicableCompositeRule.annotation(value, superJson)\n };\n }\n var applicableSimpleRule = findArr(simpleRules, function (rule) {\n return rule.isApplicable(value, superJson);\n });\n if (applicableSimpleRule) {\n return {\n value: applicableSimpleRule.transform(value, superJson),\n type: applicableSimpleRule.annotation\n };\n }\n return undefined;\n};\nvar simpleRulesByAnnotation = {};\nsimpleRules.forEach(function (rule) {\n simpleRulesByAnnotation[rule.annotation] = rule;\n});\nexport var untransformValue = function (json, type, superJson) {\n if (isArray(type)) {\n switch (type[0]) {\n case 'symbol':\n return symbolRule.untransform(json, type, superJson);\n case 'class':\n return classRule.untransform(json, type, superJson);\n case 'custom':\n return customRule.untransform(json, type, superJson);\n case 'typed-array':\n return typedArrayRule.untransform(json, type, superJson);\n default:\n throw new Error('Unknown transformation: ' + type);\n }\n }\n else {\n var transformation = simpleRulesByAnnotation[type];\n if (!transformation) {\n throw new Error('Unknown transformation: ' + type);\n }\n return transformation.untransform(json, superJson);\n }\n};\n//# sourceMappingURL=transformer.js.map","import { isMap, isArray, isPlainObject, isSet } from './is';\nimport { includes } from './util';\nvar getNthKey = function (value, n) {\n var keys = value.keys();\n while (n > 0) {\n keys.next();\n n--;\n }\n return keys.next().value;\n};\nfunction validatePath(path) {\n if (includes(path, '__proto__')) {\n throw new Error('__proto__ is not allowed as a property');\n }\n if (includes(path, 'prototype')) {\n throw new Error('prototype is not allowed as a property');\n }\n if (includes(path, 'constructor')) {\n throw new Error('constructor is not allowed as a property');\n }\n}\nexport var getDeep = function (object, path) {\n validatePath(path);\n for (var i = 0; i < path.length; i++) {\n var key = path[i];\n if (isSet(object)) {\n object = getNthKey(object, +key);\n }\n else if (isMap(object)) {\n var row = +key;\n var type = +path[++i] === 0 ? 'key' : 'value';\n var keyOfRow = getNthKey(object, row);\n switch (type) {\n case 'key':\n object = keyOfRow;\n break;\n case 'value':\n object = object.get(keyOfRow);\n break;\n }\n }\n else {\n object = object[key];\n }\n }\n return object;\n};\nexport var setDeep = function (object, path, mapper) {\n validatePath(path);\n if (path.length === 0) {\n return mapper(object);\n }\n var parent = object;\n for (var i = 0; i < path.length - 1; i++) {\n var key = path[i];\n if (isArray(parent)) {\n var index = +key;\n parent = parent[index];\n }\n else if (isPlainObject(parent)) {\n parent = parent[key];\n }\n else if (isSet(parent)) {\n var row = +key;\n parent = getNthKey(parent, row);\n }\n else if (isMap(parent)) {\n var isEnd = i === path.length - 2;\n if (isEnd) {\n break;\n }\n var row = +key;\n var type = +path[++i] === 0 ? 'key' : 'value';\n var keyOfRow = getNthKey(parent, row);\n switch (type) {\n case 'key':\n parent = keyOfRow;\n break;\n case 'value':\n parent = parent.get(keyOfRow);\n break;\n }\n }\n }\n var lastKey = path[path.length - 1];\n if (isArray(parent)) {\n parent[+lastKey] = mapper(parent[+lastKey]);\n }\n else if (isPlainObject(parent)) {\n parent[lastKey] = mapper(parent[lastKey]);\n }\n if (isSet(parent)) {\n var oldValue = getNthKey(parent, +lastKey);\n var newValue = mapper(oldValue);\n if (oldValue !== newValue) {\n parent[\"delete\"](oldValue);\n parent.add(newValue);\n }\n }\n if (isMap(parent)) {\n var row = +path[path.length - 2];\n var keyToRow = getNthKey(parent, row);\n var type = +lastKey === 0 ? 'key' : 'value';\n switch (type) {\n case 'key': {\n var newKey = mapper(keyToRow);\n parent.set(newKey, parent.get(keyToRow));\n if (newKey !== keyToRow) {\n parent[\"delete\"](keyToRow);\n }\n break;\n }\n case 'value': {\n parent.set(keyToRow, mapper(parent.get(keyToRow)));\n break;\n }\n }\n }\n return object;\n};\n//# sourceMappingURL=accessDeep.js.map","var __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nimport { isArray, isEmptyObject, isMap, isPlainObject, isPrimitive, isSet, } from './is';\nimport { escapeKey, stringifyPath } from './pathstringifier';\nimport { isInstanceOfRegisteredClass, transformValue, untransformValue, } from './transformer';\nimport { includes, forEach } from './util';\nimport { parsePath } from './pathstringifier';\nimport { getDeep, setDeep } from './accessDeep';\nfunction traverse(tree, walker, origin) {\n if (origin === void 0) { origin = []; }\n if (!tree) {\n return;\n }\n if (!isArray(tree)) {\n forEach(tree, function (subtree, key) {\n return traverse(subtree, walker, __spreadArray(__spreadArray([], __read(origin)), __read(parsePath(key))));\n });\n return;\n }\n var _a = __read(tree, 2), nodeValue = _a[0], children = _a[1];\n if (children) {\n forEach(children, function (child, key) {\n traverse(child, walker, __spreadArray(__spreadArray([], __read(origin)), __read(parsePath(key))));\n });\n }\n walker(nodeValue, origin);\n}\nexport function applyValueAnnotations(plain, annotations, superJson) {\n traverse(annotations, function (type, path) {\n plain = setDeep(plain, path, function (v) { return untransformValue(v, type, superJson); });\n });\n return plain;\n}\nexport function applyReferentialEqualityAnnotations(plain, annotations) {\n function apply(identicalPaths, path) {\n var object = getDeep(plain, parsePath(path));\n identicalPaths.map(parsePath).forEach(function (identicalObjectPath) {\n plain = setDeep(plain, identicalObjectPath, function () { return object; });\n });\n }\n if (isArray(annotations)) {\n var _a = __read(annotations, 2), root = _a[0], other = _a[1];\n root.forEach(function (identicalPath) {\n plain = setDeep(plain, parsePath(identicalPath), function () { return plain; });\n });\n if (other) {\n forEach(other, apply);\n }\n }\n else {\n forEach(annotations, apply);\n }\n return plain;\n}\nvar isDeep = function (object, superJson) {\n return isPlainObject(object) ||\n isArray(object) ||\n isMap(object) ||\n isSet(object) ||\n isInstanceOfRegisteredClass(object, superJson);\n};\nfunction addIdentity(object, path, identities) {\n var existingSet = identities.get(object);\n if (existingSet) {\n existingSet.push(path);\n }\n else {\n identities.set(object, [path]);\n }\n}\nexport function generateReferentialEqualityAnnotations(identitites) {\n var result = {};\n var rootEqualityPaths = undefined;\n identitites.forEach(function (paths) {\n if (paths.length <= 1) {\n return;\n }\n var _a = __read(paths\n .map(function (path) { return path.map(String); })\n .sort(function (a, b) { return a.length - b.length; })), shortestPath = _a[0], identicalPaths = _a.slice(1);\n if (shortestPath.length === 0) {\n rootEqualityPaths = identicalPaths.map(stringifyPath);\n }\n else {\n result[stringifyPath(shortestPath)] = identicalPaths.map(stringifyPath);\n }\n });\n if (rootEqualityPaths) {\n if (isEmptyObject(result)) {\n return [rootEqualityPaths];\n }\n else {\n return [rootEqualityPaths, result];\n }\n }\n else {\n return isEmptyObject(result) ? undefined : result;\n }\n}\nexport var walker = function (object, identities, superJson, dedupe, path, objectsInThisPath, seenObjects) {\n var _a;\n if (path === void 0) { path = []; }\n if (objectsInThisPath === void 0) { objectsInThisPath = []; }\n if (seenObjects === void 0) { seenObjects = new Map(); }\n var primitive = isPrimitive(object);\n if (!primitive) {\n addIdentity(object, path, identities);\n var seen = seenObjects.get(object);\n if (seen) {\n // short-circuit result if we've seen this object before\n return dedupe\n ? {\n transformedValue: null\n }\n : seen;\n }\n }\n if (!isDeep(object, superJson)) {\n var transformed_1 = transformValue(object, superJson);\n var result_1 = transformed_1\n ? {\n transformedValue: transformed_1.value,\n annotations: [transformed_1.type]\n }\n : {\n transformedValue: object\n };\n if (!primitive) {\n seenObjects.set(object, result_1);\n }\n return result_1;\n }\n if (includes(objectsInThisPath, object)) {\n // prevent circular references\n return {\n transformedValue: null\n };\n }\n var transformationResult = transformValue(object, superJson);\n var transformed = (_a = transformationResult === null || transformationResult === void 0 ? void 0 : transformationResult.value) !== null && _a !== void 0 ? _a : object;\n var transformedValue = isArray(transformed) ? [] : {};\n var innerAnnotations = {};\n forEach(transformed, function (value, index) {\n var recursiveResult = walker(value, identities, superJson, dedupe, __spreadArray(__spreadArray([], __read(path)), [index]), __spreadArray(__spreadArray([], __read(objectsInThisPath)), [object]), seenObjects);\n transformedValue[index] = recursiveResult.transformedValue;\n if (isArray(recursiveResult.annotations)) {\n innerAnnotations[index] = recursiveResult.annotations;\n }\n else if (isPlainObject(recursiveResult.annotations)) {\n forEach(recursiveResult.annotations, function (tree, key) {\n innerAnnotations[escapeKey(index) + '.' + key] = tree;\n });\n }\n });\n var result = isEmptyObject(innerAnnotations)\n ? {\n transformedValue: transformedValue,\n annotations: !!transformationResult\n ? [transformationResult.type]\n : undefined\n }\n : {\n transformedValue: transformedValue,\n annotations: !!transformationResult\n ? [transformationResult.type, innerAnnotations]\n : innerAnnotations\n };\n if (!primitive) {\n seenObjects.set(object, result);\n }\n return result;\n};\n//# sourceMappingURL=plainer.js.map","function getType(payload) {\n return Object.prototype.toString.call(payload).slice(8, -1);\n}\nfunction isUndefined(payload) {\n return getType(payload) === \"Undefined\";\n}\nfunction isNull(payload) {\n return getType(payload) === \"Null\";\n}\nfunction isPlainObject(payload) {\n if (getType(payload) !== \"Object\")\n return false;\n const prototype = Object.getPrototypeOf(payload);\n return !!prototype && prototype.constructor === Object && prototype === Object.prototype;\n}\nfunction isObject(payload) {\n return isPlainObject(payload);\n}\nfunction isEmptyObject(payload) {\n return isPlainObject(payload) && Object.keys(payload).length === 0;\n}\nfunction isFullObject(payload) {\n return isPlainObject(payload) && Object.keys(payload).length > 0;\n}\nfunction isAnyObject(payload) {\n return getType(payload) === \"Object\";\n}\nfunction isObjectLike(payload) {\n return isAnyObject(payload);\n}\nfunction isFunction(payload) {\n return typeof payload === \"function\";\n}\nfunction isArray(payload) {\n return getType(payload) === \"Array\";\n}\nfunction isFullArray(payload) {\n return isArray(payload) && payload.length > 0;\n}\nfunction isEmptyArray(payload) {\n return isArray(payload) && payload.length === 0;\n}\nfunction isString(payload) {\n return getType(payload) === \"String\";\n}\nfunction isFullString(payload) {\n return isString(payload) && payload !== \"\";\n}\nfunction isEmptyString(payload) {\n return payload === \"\";\n}\nfunction isNumber(payload) {\n return getType(payload) === \"Number\" && !isNaN(payload);\n}\nfunction isPositiveNumber(payload) {\n return isNumber(payload) && payload > 0;\n}\nfunction isNegativeNumber(payload) {\n return isNumber(payload) && payload < 0;\n}\nfunction isBoolean(payload) {\n return getType(payload) === \"Boolean\";\n}\nfunction isRegExp(payload) {\n return getType(payload) === \"RegExp\";\n}\nfunction isMap(payload) {\n return getType(payload) === \"Map\";\n}\nfunction isWeakMap(payload) {\n return getType(payload) === \"WeakMap\";\n}\nfunction isSet(payload) {\n return getType(payload) === \"Set\";\n}\nfunction isWeakSet(payload) {\n return getType(payload) === \"WeakSet\";\n}\nfunction isSymbol(payload) {\n return getType(payload) === \"Symbol\";\n}\nfunction isDate(payload) {\n return getType(payload) === \"Date\" && !isNaN(payload);\n}\nfunction isBlob(payload) {\n return getType(payload) === \"Blob\";\n}\nfunction isFile(payload) {\n return getType(payload) === \"File\";\n}\nfunction isPromise(payload) {\n return getType(payload) === \"Promise\";\n}\nfunction isError(payload) {\n return getType(payload) === \"Error\";\n}\nfunction isNaNValue(payload) {\n return getType(payload) === \"Number\" && isNaN(payload);\n}\nfunction isPrimitive(payload) {\n return isBoolean(payload) || isNull(payload) || isUndefined(payload) || isNumber(payload) || isString(payload) || isSymbol(payload);\n}\nconst isNullOrUndefined = isOneOf(isNull, isUndefined);\nfunction isOneOf(a, b, c, d, e) {\n return (value) => a(value) || b(value) || !!c && c(value) || !!d && d(value) || !!e && e(value);\n}\nfunction isType(payload, type) {\n if (!(type instanceof Function)) {\n throw new TypeError(\"Type must be a function\");\n }\n if (!Object.prototype.hasOwnProperty.call(type, \"prototype\")) {\n throw new TypeError(\"Type is not a class\");\n }\n const name = type.name;\n return getType(payload) === name || Boolean(payload && payload.constructor === type);\n}\nfunction isInstanceOf(value, classOrClassName) {\n if (typeof classOrClassName === \"function\") {\n for (let p = value; p; p = Object.getPrototypeOf(p)) {\n if (isType(p, classOrClassName)) {\n return true;\n }\n }\n return false;\n } else {\n for (let p = value; p; p = Object.getPrototypeOf(p)) {\n if (getType(p) === classOrClassName) {\n return true;\n }\n }\n return false;\n }\n}\n\nexport { getType, isAnyObject, isArray, isBlob, isBoolean, isDate, isEmptyArray, isEmptyObject, isEmptyString, isError, isFile, isFullArray, isFullObject, isFullString, isFunction, isInstanceOf, isMap, isNaNValue, isNegativeNumber, isNull, isNullOrUndefined, isNumber, isObject, isObjectLike, isOneOf, isPlainObject, isPositiveNumber, isPrimitive, isPromise, isRegExp, isSet, isString, isSymbol, isType, isUndefined, isWeakMap, isWeakSet };\n","import { isArray, isPlainObject } from 'is-what';\n\nfunction assignProp(carry, key, newVal, originalObject, includeNonenumerable) {\n const propType = {}.propertyIsEnumerable.call(originalObject, key) ? \"enumerable\" : \"nonenumerable\";\n if (propType === \"enumerable\")\n carry[key] = newVal;\n if (includeNonenumerable && propType === \"nonenumerable\") {\n Object.defineProperty(carry, key, {\n value: newVal,\n enumerable: false,\n writable: true,\n configurable: true\n });\n }\n}\nfunction copy(target, options = {}) {\n if (isArray(target)) {\n return target.map((item) => copy(item, options));\n }\n if (!isPlainObject(target)) {\n return target;\n }\n const props = Object.getOwnPropertyNames(target);\n const symbols = Object.getOwnPropertySymbols(target);\n return [...props, ...symbols].reduce((carry, key) => {\n if (isArray(options.props) && !options.props.includes(key)) {\n return carry;\n }\n const val = target[key];\n const newVal = copy(val, options);\n assignProp(carry, key, newVal, target, options.nonenumerable);\n return carry;\n }, {});\n}\n\nexport { copy };\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nimport { ClassRegistry } from './class-registry';\nimport { Registry } from './registry';\nimport { CustomTransformerRegistry, } from './custom-transformer-registry';\nimport { applyReferentialEqualityAnnotations, applyValueAnnotations, generateReferentialEqualityAnnotations, walker, } from './plainer';\nimport { copy } from 'copy-anything';\nvar SuperJSON = /** @class */ (function () {\n /**\n * @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.\n */\n function SuperJSON(_a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.dedupe, dedupe = _c === void 0 ? false : _c;\n this.classRegistry = new ClassRegistry();\n this.symbolRegistry = new Registry(function (s) { var _a; return (_a = s.description) !== null && _a !== void 0 ? _a : ''; });\n this.customTransformerRegistry = new CustomTransformerRegistry();\n this.allowedErrorProps = [];\n this.dedupe = dedupe;\n }\n SuperJSON.prototype.serialize = function (object) {\n var identities = new Map();\n var output = walker(object, identities, this, this.dedupe);\n var res = {\n json: output.transformedValue\n };\n if (output.annotations) {\n res.meta = __assign(__assign({}, res.meta), { values: output.annotations });\n }\n var equalityAnnotations = generateReferentialEqualityAnnotations(identities);\n if (equalityAnnotations) {\n res.meta = __assign(__assign({}, res.meta), { referentialEqualities: equalityAnnotations });\n }\n return res;\n };\n SuperJSON.prototype.deserialize = function (payload) {\n var json = payload.json, meta = payload.meta;\n var result = copy(json);\n if (meta === null || meta === void 0 ? void 0 : meta.values) {\n result = applyValueAnnotations(result, meta.values, this);\n }\n if (meta === null || meta === void 0 ? void 0 : meta.referentialEqualities) {\n result = applyReferentialEqualityAnnotations(result, meta.referentialEqualities);\n }\n return result;\n };\n SuperJSON.prototype.stringify = function (object) {\n return JSON.stringify(this.serialize(object));\n };\n SuperJSON.prototype.parse = function (string) {\n return this.deserialize(JSON.parse(string));\n };\n SuperJSON.prototype.registerClass = function (v, options) {\n this.classRegistry.register(v, options);\n };\n SuperJSON.prototype.registerSymbol = function (v, identifier) {\n this.symbolRegistry.register(v, identifier);\n };\n SuperJSON.prototype.registerCustom = function (transformer, name) {\n this.customTransformerRegistry.register(__assign({ name: name }, transformer));\n };\n SuperJSON.prototype.allowErrorProps = function () {\n var _a;\n var props = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n props[_i] = arguments[_i];\n }\n (_a = this.allowedErrorProps).push.apply(_a, __spreadArray([], __read(props)));\n };\n SuperJSON.defaultInstance = new SuperJSON();\n SuperJSON.serialize = SuperJSON.defaultInstance.serialize.bind(SuperJSON.defaultInstance);\n SuperJSON.deserialize = SuperJSON.defaultInstance.deserialize.bind(SuperJSON.defaultInstance);\n SuperJSON.stringify = SuperJSON.defaultInstance.stringify.bind(SuperJSON.defaultInstance);\n SuperJSON.parse = SuperJSON.defaultInstance.parse.bind(SuperJSON.defaultInstance);\n SuperJSON.registerClass = SuperJSON.defaultInstance.registerClass.bind(SuperJSON.defaultInstance);\n SuperJSON.registerSymbol = SuperJSON.defaultInstance.registerSymbol.bind(SuperJSON.defaultInstance);\n SuperJSON.registerCustom = SuperJSON.defaultInstance.registerCustom.bind(SuperJSON.defaultInstance);\n SuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(SuperJSON.defaultInstance);\n return SuperJSON;\n}());\nexport default SuperJSON;\nexport { SuperJSON };\nexport var serialize = SuperJSON.serialize;\nexport var deserialize = SuperJSON.deserialize;\nexport var stringify = SuperJSON.stringify;\nexport var parse = SuperJSON.parse;\nexport var registerClass = SuperJSON.registerClass;\nexport var registerCustom = SuperJSON.registerCustom;\nexport var registerSymbol = SuperJSON.registerSymbol;\nexport var allowErrorProps = SuperJSON.allowErrorProps;\n//# sourceMappingURL=index.js.map","function identity(x) {\n return x;\n}\n\n/** @internal */ function pipeFromArray(fns) {\n if (fns.length === 0) {\n return identity;\n }\n if (fns.length === 1) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return fns[0];\n }\n return function piped(input) {\n return fns.reduce((prev, fn)=>fn(prev), input);\n };\n}\n\nfunction isObservable(x) {\n return typeof x === 'object' && x !== null && 'subscribe' in x;\n}\nfunction observable(subscribe) {\n const self = {\n subscribe (observer) {\n let teardownRef = null;\n let isDone = false;\n let unsubscribed = false;\n let teardownImmediately = false;\n function unsubscribe() {\n if (teardownRef === null) {\n teardownImmediately = true;\n return;\n }\n if (unsubscribed) {\n return;\n }\n unsubscribed = true;\n if (typeof teardownRef === 'function') {\n teardownRef();\n } else if (teardownRef) {\n teardownRef.unsubscribe();\n }\n }\n teardownRef = subscribe({\n next (value) {\n if (isDone) {\n return;\n }\n observer.next?.(value);\n },\n error (err) {\n if (isDone) {\n return;\n }\n isDone = true;\n observer.error?.(err);\n unsubscribe();\n },\n complete () {\n if (isDone) {\n return;\n }\n isDone = true;\n observer.complete?.();\n unsubscribe();\n }\n });\n if (teardownImmediately) {\n unsubscribe();\n }\n return {\n unsubscribe\n };\n },\n pipe (...operations) {\n return pipeFromArray(operations)(self);\n }\n };\n return self;\n}\n\nexport { isObservable as i, observable as o };\n","export { i as isObservable, o as observable } from '../observable-ade1bad8.mjs';\n\nfunction share(_opts) {\n return (originalObserver)=>{\n let refCount = 0;\n let subscription = null;\n const observers = [];\n function startIfNeeded() {\n if (subscription) {\n return;\n }\n subscription = originalObserver.subscribe({\n next (value) {\n for (const observer of observers){\n observer.next?.(value);\n }\n },\n error (error) {\n for (const observer of observers){\n observer.error?.(error);\n }\n },\n complete () {\n for (const observer of observers){\n observer.complete?.();\n }\n }\n });\n }\n function resetIfNeeded() {\n // \"resetOnRefCountZero\"\n if (refCount === 0 && subscription) {\n const _sub = subscription;\n subscription = null;\n _sub.unsubscribe();\n }\n }\n return {\n subscribe (observer) {\n refCount++;\n observers.push(observer);\n startIfNeeded();\n return {\n unsubscribe () {\n refCount--;\n resetIfNeeded();\n const index = observers.findIndex((v)=>v === observer);\n if (index > -1) {\n observers.splice(index, 1);\n }\n }\n };\n }\n };\n };\n}\n\nfunction map(project) {\n return (originalObserver)=>{\n return {\n subscribe (observer) {\n let index = 0;\n const subscription = originalObserver.subscribe({\n next (value) {\n observer.next?.(project(value, index++));\n },\n error (error) {\n observer.error?.(error);\n },\n complete () {\n observer.complete?.();\n }\n });\n return subscription;\n }\n };\n };\n}\n\nfunction tap(observer) {\n return (originalObserver)=>{\n return {\n subscribe (observer2) {\n return originalObserver.subscribe({\n next (v) {\n observer.next?.(v);\n observer2.next?.(v);\n },\n error (v) {\n observer.error?.(v);\n observer2.error?.(v);\n },\n complete () {\n observer.complete?.();\n observer2.complete?.();\n }\n });\n }\n };\n };\n}\n\nclass ObservableAbortError extends Error {\n constructor(message){\n super(message);\n this.name = 'ObservableAbortError';\n Object.setPrototypeOf(this, ObservableAbortError.prototype);\n }\n}\n/** @internal */ function observableToPromise(observable) {\n let abort;\n const promise = new Promise((resolve, reject)=>{\n let isDone = false;\n function onDone() {\n if (isDone) {\n return;\n }\n isDone = true;\n reject(new ObservableAbortError('This operation was aborted.'));\n obs$.unsubscribe();\n }\n const obs$ = observable.subscribe({\n next (data) {\n isDone = true;\n resolve(data);\n onDone();\n },\n error (data) {\n isDone = true;\n reject(data);\n onDone();\n },\n complete () {\n isDone = true;\n onDone();\n }\n });\n abort = onDone;\n });\n return {\n promise,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n abort: abort\n };\n}\n\nexport { map, observableToPromise, share, tap };\n","import { observable } from '@trpc/server/observable';\n\n/** @internal */ function createChain(opts) {\n return observable((observer)=>{\n function execute(index = 0, op = opts.op) {\n const next = opts.links[index];\n if (!next) {\n throw new Error('No more links to execute - did you forget to add an ending link?');\n }\n const subscription = next({\n op,\n next (nextOp) {\n const nextObserver = execute(index + 1, nextOp);\n return nextObserver;\n }\n });\n return subscription;\n }\n const obs$ = execute();\n return obs$.subscribe(observer);\n });\n}\n\nfunction asArray(value) {\n return Array.isArray(value) ? value : [\n value\n ];\n}\nfunction splitLink(opts) {\n return (runtime)=>{\n const yes = asArray(opts.true).map((link)=>link(runtime));\n const no = asArray(opts.false).map((link)=>link(runtime));\n return (props)=>{\n return observable((observer)=>{\n const links = opts.condition(props.op) ? yes : no;\n return createChain({\n op: props.op,\n links\n }).subscribe(observer);\n });\n };\n };\n}\n\nexport { createChain as c, splitLink as s };\n","function isTRPCClientError(cause) {\n return cause instanceof TRPCClientError || /**\n * @deprecated\n * Delete in next major\n */ cause.name === 'TRPCClientError';\n}\nclass TRPCClientError extends Error {\n static from(cause, opts = {}) {\n if (!(cause instanceof Error)) {\n return new TRPCClientError(cause.error.message ?? '', {\n ...opts,\n cause: undefined,\n result: cause\n });\n }\n if (isTRPCClientError(cause)) {\n if (opts.meta) {\n // Decorate with meta error data\n cause.meta = {\n ...cause.meta,\n ...opts.meta\n };\n }\n return cause;\n }\n return new TRPCClientError(cause.message, {\n ...opts,\n cause,\n result: null\n });\n }\n constructor(message, opts){\n const cause = opts?.cause;\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore https://github.com/tc39/proposal-error-cause\n super(message, {\n cause\n });\n this.meta = opts?.meta;\n this.cause = cause;\n this.shape = opts?.result?.error;\n this.data = opts?.result?.error.data;\n this.name = 'TRPCClientError';\n Object.setPrototypeOf(this, TRPCClientError.prototype);\n }\n}\n\nexport { TRPCClientError as T };\n","import { T as TRPCClientError } from './TRPCClientError-fef6cf44.mjs';\n\nconst isFunction = (fn)=>typeof fn === 'function';\nfunction getFetch(customFetchImpl) {\n if (customFetchImpl) {\n return customFetchImpl;\n }\n if (typeof window !== 'undefined' && isFunction(window.fetch)) {\n return window.fetch;\n }\n if (typeof globalThis !== 'undefined' && isFunction(globalThis.fetch)) {\n return globalThis.fetch;\n }\n throw new Error('No fetch implementation found');\n}\n\nfunction getAbortController(customAbortControllerImpl) {\n if (customAbortControllerImpl) {\n return customAbortControllerImpl;\n }\n if (typeof window !== 'undefined' && window.AbortController) {\n return window.AbortController;\n }\n if (typeof globalThis !== 'undefined' && globalThis.AbortController) {\n return globalThis.AbortController;\n }\n return null;\n}\n\nfunction resolveHTTPLinkOptions(opts) {\n return {\n url: opts.url,\n fetch: opts.fetch,\n AbortController: getAbortController(opts.AbortController)\n };\n}\n// https://github.com/trpc/trpc/pull/669\nfunction arrayToDict(array) {\n const dict = {};\n for(let index = 0; index < array.length; index++){\n const element = array[index];\n dict[index] = element;\n }\n return dict;\n}\nconst METHOD = {\n query: 'GET',\n mutation: 'POST'\n};\nfunction getInput(opts) {\n return 'input' in opts ? opts.runtime.transformer.serialize(opts.input) : arrayToDict(opts.inputs.map((_input)=>opts.runtime.transformer.serialize(_input)));\n}\nconst getUrl = (opts)=>{\n let url = opts.url + '/' + opts.path;\n const queryParts = [];\n if ('inputs' in opts) {\n queryParts.push('batch=1');\n }\n if (opts.type === 'query') {\n const input = getInput(opts);\n if (input !== undefined) {\n queryParts.push(`input=${encodeURIComponent(JSON.stringify(input))}`);\n }\n }\n if (queryParts.length) {\n url += '?' + queryParts.join('&');\n }\n return url;\n};\nconst getBody = (opts)=>{\n if (opts.type === 'query') {\n return undefined;\n }\n const input = getInput(opts);\n return input !== undefined ? JSON.stringify(input) : undefined;\n};\nconst jsonHttpRequester = (opts)=>{\n return httpRequest({\n ...opts,\n contentTypeHeader: 'application/json',\n getUrl,\n getBody\n });\n};\nasync function fetchHTTPResponse(opts, ac) {\n const url = opts.getUrl(opts);\n const body = opts.getBody(opts);\n const { type } = opts;\n const resolvedHeaders = await opts.headers();\n /* istanbul ignore if -- @preserve */ if (type === 'subscription') {\n throw new Error('Subscriptions should use wsLink');\n }\n const headers = {\n ...opts.contentTypeHeader ? {\n 'content-type': opts.contentTypeHeader\n } : {},\n ...opts.batchModeHeader ? {\n 'trpc-batch-mode': opts.batchModeHeader\n } : {},\n ...resolvedHeaders\n };\n return getFetch(opts.fetch)(url, {\n method: METHOD[type],\n signal: ac?.signal,\n body: body,\n headers\n });\n}\nfunction httpRequest(opts) {\n const ac = opts.AbortController ? new opts.AbortController() : null;\n const meta = {};\n const promise = new Promise((resolve, reject)=>{\n fetchHTTPResponse(opts, ac).then((_res)=>{\n meta.response = _res;\n return _res.json();\n }).then((json)=>{\n meta.responseJSON = json;\n resolve({\n json: json,\n meta\n });\n }).catch((err)=>{\n reject(TRPCClientError.from(err, {\n meta\n }));\n });\n });\n const cancel = ()=>{\n ac?.abort();\n };\n return {\n promise,\n cancel\n };\n}\n\nexport { getBody as a, getFetch as b, fetchHTTPResponse as f, getUrl as g, httpRequest as h, jsonHttpRequester as j, resolveHTTPLinkOptions as r };\n","function isObject(value) {\n // check that value is object\n return !!value && !Array.isArray(value) && typeof value === 'object';\n}\n\n// FIXME:\n// - the generics here are probably unnecessary\n// - the RPC-spec could probably be simplified to combine HTTP + WS\n/** @internal */ function transformResultInner(response, runtime) {\n if ('error' in response) {\n const error = runtime.transformer.deserialize(response.error);\n return {\n ok: false,\n error: {\n ...response,\n error\n }\n };\n }\n const result = {\n ...response.result,\n ...(!response.result.type || response.result.type === 'data') && {\n type: 'data',\n data: runtime.transformer.deserialize(response.result.data)\n }\n };\n return {\n ok: true,\n result\n };\n}\nclass TransformResultError extends Error {\n constructor(){\n super('Unable to transform response from server');\n }\n}\n/**\n * Transforms and validates that the result is a valid TRPCResponse\n * @internal\n */ function transformResult(response, runtime) {\n let result;\n try {\n // Use the data transformers on the JSON-response\n result = transformResultInner(response, runtime);\n } catch (err) {\n throw new TransformResultError();\n }\n // check that output of the transformers is a valid TRPCResponse\n if (!result.ok && (!isObject(result.error.error) || typeof result.error.error.code !== 'number')) {\n throw new TransformResultError();\n }\n if (result.ok && !isObject(result.result)) {\n throw new TransformResultError();\n }\n return result;\n}\n\nexport { transformResult as t };\n","import { observable } from '@trpc/server/observable';\nimport { t as transformResult } from './transformResult-7ab522e6.mjs';\nimport { T as TRPCClientError } from './TRPCClientError-fef6cf44.mjs';\nimport { r as resolveHTTPLinkOptions, g as getUrl, j as jsonHttpRequester } from './httpUtils-1efcb902.mjs';\n\n/* eslint-disable @typescript-eslint/no-non-null-assertion */ /**\n * A function that should never be called unless we messed something up.\n */ const throwFatalError = ()=>{\n throw new Error('Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new');\n};\n/**\n * Dataloader that's very inspired by https://github.com/graphql/dataloader\n * Less configuration, no caching, and allows you to cancel requests\n * When cancelling a single fetch the whole batch will be cancelled only when _all_ items are cancelled\n */ function dataLoader(batchLoader) {\n let pendingItems = null;\n let dispatchTimer = null;\n const destroyTimerAndPendingItems = ()=>{\n clearTimeout(dispatchTimer);\n dispatchTimer = null;\n pendingItems = null;\n };\n /**\n * Iterate through the items and split them into groups based on the `batchLoader`'s validate function\n */ function groupItems(items) {\n const groupedItems = [\n []\n ];\n let index = 0;\n while(true){\n const item = items[index];\n if (!item) {\n break;\n }\n const lastGroup = groupedItems[groupedItems.length - 1];\n if (item.aborted) {\n // Item was aborted before it was dispatched\n item.reject?.(new Error('Aborted'));\n index++;\n continue;\n }\n const isValid = batchLoader.validate(lastGroup.concat(item).map((it)=>it.key));\n if (isValid) {\n lastGroup.push(item);\n index++;\n continue;\n }\n if (lastGroup.length === 0) {\n item.reject?.(new Error('Input is too big for a single dispatch'));\n index++;\n continue;\n }\n // Create new group, next iteration will try to add the item to that\n groupedItems.push([]);\n }\n return groupedItems;\n }\n function dispatch() {\n const groupedItems = groupItems(pendingItems);\n destroyTimerAndPendingItems();\n // Create batches for each group of items\n for (const items of groupedItems){\n if (!items.length) {\n continue;\n }\n const batch = {\n items,\n cancel: throwFatalError\n };\n for (const item of items){\n item.batch = batch;\n }\n const unitResolver = (index, value)=>{\n const item = batch.items[index];\n item.resolve?.(value);\n item.batch = null;\n item.reject = null;\n item.resolve = null;\n };\n const { promise , cancel } = batchLoader.fetch(batch.items.map((_item)=>_item.key), unitResolver);\n batch.cancel = cancel;\n promise.then((result)=>{\n for(let i = 0; i < result.length; i++){\n const value = result[i];\n unitResolver(i, value);\n }\n for (const item of batch.items){\n item.reject?.(new Error('Missing result'));\n item.batch = null;\n }\n }).catch((cause)=>{\n for (const item of batch.items){\n item.reject?.(cause);\n item.batch = null;\n }\n });\n }\n }\n function load(key) {\n const item = {\n aborted: false,\n key,\n batch: null,\n resolve: throwFatalError,\n reject: throwFatalError\n };\n const promise = new Promise((resolve, reject)=>{\n item.reject = reject;\n item.resolve = resolve;\n if (!pendingItems) {\n pendingItems = [];\n }\n pendingItems.push(item);\n });\n if (!dispatchTimer) {\n dispatchTimer = setTimeout(dispatch);\n }\n const cancel = ()=>{\n item.aborted = true;\n if (item.batch?.items.every((item)=>item.aborted)) {\n // All items in the batch have been cancelled\n item.batch.cancel();\n item.batch = null;\n }\n };\n return {\n promise,\n cancel\n };\n }\n return {\n load\n };\n}\n\n/**\n * @internal\n */ function createHTTPBatchLink(requester) {\n return function httpBatchLink(opts) {\n const resolvedOpts = resolveHTTPLinkOptions(opts);\n const maxURLLength = opts.maxURLLength ?? Infinity;\n // initialized config\n return (runtime)=>{\n const batchLoader = (type)=>{\n const validate = (batchOps)=>{\n if (maxURLLength === Infinity) {\n // escape hatch for quick calcs\n return true;\n }\n const path = batchOps.map((op)=>op.path).join(',');\n const inputs = batchOps.map((op)=>op.input);\n const url = getUrl({\n ...resolvedOpts,\n runtime,\n type,\n path,\n inputs\n });\n return url.length <= maxURLLength;\n };\n const fetch = requester({\n ...resolvedOpts,\n runtime,\n type,\n opts\n });\n return {\n validate,\n fetch\n };\n };\n const query = dataLoader(batchLoader('query'));\n const mutation = dataLoader(batchLoader('mutation'));\n const subscription = dataLoader(batchLoader('subscription'));\n const loaders = {\n query,\n subscription,\n mutation\n };\n return ({ op })=>{\n return observable((observer)=>{\n const loader = loaders[op.type];\n const { promise , cancel } = loader.load(op);\n let _res = undefined;\n promise.then((res)=>{\n _res = res;\n const transformed = transformResult(res.json, runtime);\n if (!transformed.ok) {\n observer.error(TRPCClientError.from(transformed.error, {\n meta: res.meta\n }));\n return;\n }\n observer.next({\n context: res.meta,\n result: transformed.result\n });\n observer.complete();\n }).catch((err)=>{\n observer.error(TRPCClientError.from(err, {\n meta: _res?.meta\n }));\n });\n return ()=>{\n cancel();\n };\n });\n };\n };\n };\n}\n\nconst batchRequester = (requesterOpts)=>{\n return (batchOps)=>{\n const path = batchOps.map((op)=>op.path).join(',');\n const inputs = batchOps.map((op)=>op.input);\n const { promise , cancel } = jsonHttpRequester({\n ...requesterOpts,\n path,\n inputs,\n headers () {\n if (!requesterOpts.opts.headers) {\n return {};\n }\n if (typeof requesterOpts.opts.headers === 'function') {\n return requesterOpts.opts.headers({\n opList: batchOps\n });\n }\n return requesterOpts.opts.headers;\n }\n });\n return {\n promise: promise.then((res)=>{\n const resJSON = Array.isArray(res.json) ? res.json : batchOps.map(()=>res.json);\n const result = resJSON.map((item)=>({\n meta: res.meta,\n json: item\n }));\n return result;\n }),\n cancel\n };\n };\n};\nconst httpBatchLink = createHTTPBatchLink(batchRequester);\n\nexport { createHTTPBatchLink as c, httpBatchLink as h };\n","import { share, observableToPromise } from '@trpc/server/observable';\nimport { c as createChain } from './splitLink-4c75f7be.mjs';\nexport { s as splitLink } from './splitLink-4c75f7be.mjs';\nimport { T as TRPCClientError } from './TRPCClientError-fef6cf44.mjs';\nexport { T as TRPCClientError } from './TRPCClientError-fef6cf44.mjs';\nimport { createFlatProxy, createRecursiveProxy } from '@trpc/server/shared';\nimport { f as fetchHTTPResponse, g as getUrl, a as getBody$1, h as httpRequest } from './httpUtils-1efcb902.mjs';\nexport { b as getFetch } from './httpUtils-1efcb902.mjs';\nimport { c as createHTTPBatchLink } from './httpBatchLink-fbd7b43c.mjs';\nexport { h as httpBatchLink } from './httpBatchLink-fbd7b43c.mjs';\nimport { httpLinkFactory } from './links/httpLink.mjs';\nexport { httpLink, httpLinkFactory } from './links/httpLink.mjs';\nexport { loggerLink } from './links/loggerLink.mjs';\nexport { createWSClient, wsLink } from './links/wsLink.mjs';\nimport './transformResult-7ab522e6.mjs';\n\nclass TRPCUntypedClient {\n $request({ type , input , path , context ={} }) {\n const chain$ = createChain({\n links: this.links,\n op: {\n id: ++this.requestId,\n type,\n path,\n input,\n context\n }\n });\n return chain$.pipe(share());\n }\n requestAsPromise(opts) {\n const req$ = this.$request(opts);\n const { promise , abort } = observableToPromise(req$);\n const abortablePromise = new Promise((resolve, reject)=>{\n opts.signal?.addEventListener('abort', abort);\n promise.then((envelope)=>{\n resolve(envelope.result.data);\n }).catch((err)=>{\n reject(TRPCClientError.from(err));\n });\n });\n return abortablePromise;\n }\n query(path, input, opts) {\n return this.requestAsPromise({\n type: 'query',\n path,\n input,\n context: opts?.context,\n signal: opts?.signal\n });\n }\n mutation(path, input, opts) {\n return this.requestAsPromise({\n type: 'mutation',\n path,\n input,\n context: opts?.context,\n signal: opts?.signal\n });\n }\n subscription(path, input, opts) {\n const observable$ = this.$request({\n type: 'subscription',\n path,\n input,\n context: opts?.context\n });\n return observable$.subscribe({\n next (envelope) {\n if (envelope.result.type === 'started') {\n opts.onStarted?.();\n } else if (envelope.result.type === 'stopped') {\n opts.onStopped?.();\n } else {\n opts.onData?.(envelope.result.data);\n }\n },\n error (err) {\n opts.onError?.(err);\n },\n complete () {\n opts.onComplete?.();\n }\n });\n }\n constructor(opts){\n this.requestId = 0;\n const combinedTransformer = (()=>{\n const transformer = opts.transformer;\n if (!transformer) {\n return {\n input: {\n serialize: (data)=>data,\n deserialize: (data)=>data\n },\n output: {\n serialize: (data)=>data,\n deserialize: (data)=>data\n }\n };\n }\n if ('input' in transformer) {\n return opts.transformer;\n }\n return {\n input: transformer,\n output: transformer\n };\n })();\n this.runtime = {\n transformer: {\n serialize: (data)=>combinedTransformer.input.serialize(data),\n deserialize: (data)=>combinedTransformer.output.deserialize(data)\n },\n combinedTransformer\n };\n // Initialize the links\n this.links = opts.links.map((link)=>link(this.runtime));\n }\n}\n\nfunction createTRPCUntypedClient(opts) {\n return new TRPCUntypedClient(opts);\n}\n\n/**\n * @deprecated use `createTRPCProxyClient` instead\n */ function createTRPCClient(opts) {\n const client = new TRPCUntypedClient(opts);\n return client;\n}\n\nconst clientCallTypeMap = {\n query: 'query',\n mutate: 'mutation',\n subscribe: 'subscription'\n};\n/** @internal */ const clientCallTypeToProcedureType = (clientCallType)=>{\n return clientCallTypeMap[clientCallType];\n};\n/**\n * @deprecated use `createTRPCProxyClient` instead\n * @internal\n */ function createTRPCClientProxy(client) {\n return createFlatProxy((key)=>{\n if (client.hasOwnProperty(key)) {\n return client[key];\n }\n if (key === '__untypedClient') {\n return client;\n }\n return createRecursiveProxy(({ path , args })=>{\n const pathCopy = [\n key,\n ...path\n ];\n const procedureType = clientCallTypeToProcedureType(pathCopy.pop());\n const fullPath = pathCopy.join('.');\n return client[procedureType](fullPath, ...args);\n });\n });\n}\nfunction createTRPCProxyClient(opts) {\n const client = new TRPCUntypedClient(opts);\n const proxy = createTRPCClientProxy(client);\n return proxy;\n}\n/**\n * Get an untyped client from a proxy client\n * @internal\n */ function getUntypedClient(client) {\n return client.__untypedClient;\n}\n\nfunction getTextDecoder(customTextDecoder) {\n if (customTextDecoder) {\n return customTextDecoder;\n }\n if (typeof window !== 'undefined' && window.TextDecoder) {\n return new window.TextDecoder();\n }\n if (typeof globalThis !== 'undefined' && globalThis.TextDecoder) {\n return new globalThis.TextDecoder();\n }\n throw new Error('No TextDecoder implementation found');\n}\n\n// Stream parsing adapted from https://www.loginradius.com/blog/engineering/guest-post/http-streaming-with-nodejs-and-fetch-api/\n/**\n * @internal\n * @description Take a stream of bytes and call `onLine` with\n * a JSON object for each line in the stream. Expected stream\n * format is:\n * ```json\n * {\"1\": {...}\n * ,\"0\": {...}\n * }\n * ```\n */ async function parseJSONStream(opts) {\n const parse = opts.parse ?? JSON.parse;\n const onLine = (line)=>{\n if (opts.signal?.aborted) return;\n if (!line || line === '}') {\n return;\n }\n /**\n * At this point, `line` can be one of two things:\n * - The first line of the stream `{\"2\":{...}`\n * - A line in the middle of the stream `,\"2\":{...}`\n */ const indexOfColon = line.indexOf(':');\n const indexAsStr = line.substring(2, indexOfColon - 1);\n const text = line.substring(indexOfColon + 1);\n opts.onSingle(Number(indexAsStr), parse(text));\n };\n await readLines(opts.readableStream, onLine, opts.textDecoder);\n}\n/**\n * Handle transforming a stream of bytes into lines of text.\n * To avoid using AsyncIterators / AsyncGenerators,\n * we use a callback for each line.\n *\n * @param readableStream can be a NodeJS stream or a WebAPI stream\n * @param onLine will be called for every line ('\\n' delimited) in the stream\n */ async function readLines(readableStream, onLine, textDecoder) {\n let partOfLine = '';\n const onChunk = (chunk)=>{\n const chunkText = textDecoder.decode(chunk);\n const chunkLines = chunkText.split('\\n');\n if (chunkLines.length === 1) {\n partOfLine += chunkLines[0];\n } else if (chunkLines.length > 1) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- length checked on line above\n onLine(partOfLine + chunkLines[0]);\n for(let i = 1; i < chunkLines.length - 1; i++){\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- length checked on line above\n onLine(chunkLines[i]);\n }\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- length doesn't change, so is necessarily > 1\n partOfLine = chunkLines[chunkLines.length - 1];\n }\n };\n // we handle 2 different types of streams, this if where we figure out which one we have\n if ('getReader' in readableStream) {\n await readStandardChunks(readableStream, onChunk);\n } else {\n await readNodeChunks(readableStream, onChunk);\n }\n onLine(partOfLine);\n}\n/**\n * Handle NodeJS stream\n */ function readNodeChunks(stream, onChunk) {\n return new Promise((resolve)=>{\n stream.on('data', onChunk);\n stream.on('end', resolve);\n });\n}\n/**\n * Handle WebAPI stream\n */ async function readStandardChunks(stream, onChunk) {\n const reader = stream.getReader();\n let readResult = await reader.read();\n while(!readResult.done){\n onChunk(readResult.value);\n readResult = await reader.read();\n }\n}\nconst streamingJsonHttpRequester = (opts, onSingle)=>{\n const ac = opts.AbortController ? new opts.AbortController() : null;\n const responsePromise = fetchHTTPResponse({\n ...opts,\n contentTypeHeader: 'application/json',\n batchModeHeader: 'stream',\n getUrl,\n getBody: getBody$1\n }, ac);\n const cancel = ()=>ac?.abort();\n const promise = responsePromise.then(async (res)=>{\n if (!res.body) throw new Error('Received response without body');\n const meta = {\n response: res\n };\n return parseJSONStream({\n readableStream: res.body,\n onSingle,\n parse: (string)=>({\n json: JSON.parse(string),\n meta\n }),\n signal: ac?.signal,\n textDecoder: opts.textDecoder\n });\n });\n return {\n cancel,\n promise\n };\n};\n\nconst streamRequester = (requesterOpts)=>{\n const textDecoder = getTextDecoder(requesterOpts.opts.textDecoder);\n return (batchOps, unitResolver)=>{\n const path = batchOps.map((op)=>op.path).join(',');\n const inputs = batchOps.map((op)=>op.input);\n const { cancel , promise } = streamingJsonHttpRequester({\n ...requesterOpts,\n textDecoder,\n path,\n inputs,\n headers () {\n if (!requesterOpts.opts.headers) {\n return {};\n }\n if (typeof requesterOpts.opts.headers === 'function') {\n return requesterOpts.opts.headers({\n opList: batchOps\n });\n }\n return requesterOpts.opts.headers;\n }\n }, (index, res)=>{\n unitResolver(index, res);\n });\n return {\n /**\n * return an empty array because the batchLoader expects an array of results\n * but we've already called the `unitResolver` for each of them, there's\n * nothing left to do here.\n */ promise: promise.then(()=>[]),\n cancel\n };\n };\n};\nconst unstable_httpBatchStreamLink = createHTTPBatchLink(streamRequester);\n\nconst getBody = (opts)=>{\n if (!('input' in opts)) {\n return undefined;\n }\n if (!(opts.input instanceof FormData)) {\n throw new Error('Input is not FormData');\n }\n return opts.input;\n};\nconst formDataRequester = (opts)=>{\n if (opts.type !== 'mutation') {\n // TODO(?) handle formdata queries\n throw new Error('We only handle mutations with formdata');\n }\n return httpRequest({\n ...opts,\n getUrl () {\n return `${opts.url}/${opts.path}`;\n },\n getBody\n });\n};\nconst experimental_formDataLink = httpLinkFactory({\n requester: formDataRequester\n});\n\nexport { clientCallTypeToProcedureType, createTRPCClient, createTRPCClientProxy, createTRPCProxyClient, createTRPCUntypedClient, experimental_formDataLink, getUntypedClient, unstable_httpBatchStreamLink };\n","import{z as e}from\"zod\";import{isHex as i}from\"viem\";import{initTRPC as a}from\"@trpc/server\";import u from\"superjson\";function A(){let r=a.context().create({transformer:u});return r.router({findAll:r.procedure.input(e.object({chainId:e.number(),address:e.string().refine(i).optional()})).query(async t=>{let{storageAdapter:o}=t.ctx,{chainId:p,address:n}=t.input;return o.findAll(p,n)})})}import{createTRPCProxyClient as m,httpBatchLink as s}from\"@trpc/client\";import f from\"superjson\";function P({url:r}){return m({transformer:f,links:[s({url:r})]})}export{A as a,P as b};\n//# sourceMappingURL=chunk-A2BQSIM3.js.map","import{a as o,b as r,c as s,d as b,e as n,f as y,g as a,h as p,i}from\"../chunk-5AKM5HGJ.js\";var e=[\"event StoreDeleteRecord(bytes32 table, bytes32[] key)\",\"event StoreSetField(bytes32 table, bytes32[] key, uint8 schemaIndex, bytes data)\",\"event StoreSetRecord(bytes32 table, bytes32[] key, bytes data)\",\"event StoreEphemeralRecord(bytes32 table, bytes32[] key, bytes data)\"];import{parseAbi as t}from\"abitype\";var f=t(e);export{r as DEFAULTS,o as PATH_DEFAULTS,s as TABLE_DEFAULTS,e as storeEvents,f as storeEventsAbi,a as zEnumsConfig,i as zPluginStoreConfig,b as zSchemaConfig,p as zStoreConfig,n as zTableConfig,y as zTablesConfig};\n//# sourceMappingURL=index.js.map","import{EMPTY as p,concatMap as B,from as d,pipe as f,tap as m}from\"rxjs\";import{bigIntMin as b,wait as k}from\"@latticexyz/common/utils\";import g from\"debug\";var u=g(\"mud:block-events-stream\");async function*a({maxBlockRange:c=1000n,maxRetryCount:i=3,publicClient:l,...t}){let e=t.fromBlock,r=b(c,t.toBlock-e),n=0;for(;e<=t.toBlock;)try{let o=e+r,s=await l.getLogs({...t,fromBlock:e,toBlock:o,strict:!0});yield{fromBlock:e,toBlock:o,logs:s},e=o+1n,r=b(c,t.toBlock-e)}catch(o){if(!(o instanceof Error))throw o;if(o.message.includes(\"rate limit exceeded\")&&n{e??=o,r=n}),B(()=>e>r?p:d(a({publicClient:c,address:i,events:l,fromBlock:e,toBlock:r,maxBlockRange:t})).pipe(m(({toBlock:n})=>{e=n+1n}))))}import{Observable as T}from\"rxjs\";function O({publicClient:c,blockTag:i}){return new T(function(t){return c.watchBlocks({blockTag:i,emitOnBegin:!0,onBlock:e=>t.next(e),onError:e=>t.error(e)})})}import{bigIntSort as x,isDefined as y}from\"@latticexyz/common/utils\";function M(c,i){let l=Array.from(new Set(c.map(r=>r.blockNumber)));l.sort(x);let t=l.map(r=>{let n=c.filter(o=>o.blockNumber===r);if(n.length&&(n.sort((o,s)=>o.logIndexs.logIndex?1:0),!!n.length))return{blockNumber:r,logs:n}}).filter(y),e=l.length>0?l[l.length-1]:null;return i!=null&&(e==null||i>e)&&t.push({blockNumber:i,logs:[]}),t}export{P as blockRangeToLogs,O as createBlockStream,a as fetchLogs,M as groupLogsByBlockNumber};\n//# sourceMappingURL=index.js.map","import{a as O,b as R}from\"./chunk-SNWOSPCV.js\";import{b as x}from\"./chunk-A2BQSIM3.js\";import{schemaAbiTypeToDefaultValue as $}from\"@latticexyz/schema-type\";function U(l){return Object.fromEntries(Object.entries(l).map(([n,p])=>[n,$[p]]))}import{storeEventsAbi as E}from\"@latticexyz/store\";import{WaitForTransactionReceiptTimeoutError as I}from\"viem\";import{createBlockStream as M,blockRangeToLogs as W,groupLogsByBlockNumber as D}from\"@latticexyz/block-logs-stream\";import{filter as v,map as b,tap as g,mergeMap as j,from as K,concat as q,concatMap as w,share as H,firstValueFrom as z,defer as G,of as J,catchError as Q,shareReplay as u,combineLatest as X}from\"rxjs\";import Y from\"p-retry\";import{chunk as Z}from\"@latticexyz/common/utils\";var r=O.extend(\"createStoreSync\");async function be({storageAdapter:l,onProgress:n,address:p,publicClient:s,startBlock:h=0n,maxBlockRange:A,initialState:k,indexerUrl:S}){let T=G(async()=>{if(k)return k;if(!S)return;r(\"fetching initial state from indexer\",S),n?.({step:\"snapshot\",percentage:0,latestBlockNumber:0n,lastBlockNumberProcessed:0n,message:\"Fetching snapshot from indexer\"});let e=x({url:S}),t=s.chain?.id??await s.getChainId(),o=await e.findAll.query({chainId:t,address:p});return n?.({step:\"snapshot\",percentage:100,latestBlockNumber:0n,lastBlockNumberProcessed:0n,message:\"Fetched snapshot from indexer\"}),o}).pipe(Q(e=>(r(\"error fetching initial state from indexer\",e),n?.({step:\"snapshot\",percentage:100,latestBlockNumber:0n,lastBlockNumberProcessed:h,message:\"Failed to fetch snapshot from indexer\"}),J(void 0))),u(1)),F=T.pipe(b(e=>e?.blockNumber??h),g(e=>r(\"starting sync from block\",e))),L=T.pipe(v(e=>e!=null&&e.blockNumber!=null&&e.tables.length>0),w(async({blockNumber:e,tables:t})=>{r(\"hydrating from initial state to block\",e),n?.({step:\"snapshot\",percentage:0,latestBlockNumber:0n,lastBlockNumberProcessed:e,message:\"Hydrating from snapshot\"}),await l.registerTables({blockNumber:e,tables:t});let o=t.flatMap(c=>c.records.map(m=>({type:\"SetRecord\",address:c.address,namespace:c.namespace,name:c.name,key:m.key,value:m.value}))),d=Math.max(100,Math.floor(o.length/50)),P=Array.from(Z(o,d));for(let[c,m]of P.entries())await l.storeOperations({blockNumber:e,operations:m}),n?.({step:\"snapshot\",percentage:(c+m.length)/P.length,latestBlockNumber:0n,lastBlockNumberProcessed:e,message:\"Hydrating from snapshot\"});return n?.({step:\"snapshot\",percentage:100,latestBlockNumber:0n,lastBlockNumberProcessed:e,message:\"Hydrated from snapshot\"}),{blockNumber:e,operations:o}}),u(1)),y=M({publicClient:s,blockTag:\"latest\"}).pipe(u(1)),B=y.pipe(b(e=>e.number),g(e=>{r(\"latest block number\",e)}),u(1)),f=null,a=null,N=X([F,B]).pipe(b(([e,t])=>({startBlock:e,endBlock:t})),g(e=>{f=e.startBlock,a=e.endBlock}),W({publicClient:s,address:p,events:E,maxBlockRange:A}),j(({toBlock:e,logs:t})=>K(D(t,e))),H()),i=null,C=q(L,N.pipe(w(R(l)),g(({blockNumber:e,operations:t})=>{if(r(\"stored\",t.length,\"operations for block\",e),i=e,f!=null&&a!=null)if(e(r(\"waiting for tx receipt\",e,\"attempt\",o),s.waitForTransactionReceipt({hash:e,timeout:s.pollingInterval*2*o})),{retries:3,onFailedAttempt:o=>{if(o instanceof I){r(\"timed out waiting for tx receipt, trying again\",e);return}throw o}});return r(\"got tx receipt\",e,t),(i==null||io>=t.blockNumber)))),r(\"tx block was processed\",e,t.blockNumber),{receipt:t}}return{latestBlock$:y,latestBlockNumber$:B,blockLogs$:N,blockStorageOperations$:C,waitForTransaction:V}}export{U as a,be as b};\n//# sourceMappingURL=chunk-IH5UMM4B.js.map","var d={registerFunctionSelector:!0,openAccess:!0,accessList:[]},o={worldContractName:void 0,worldInterfaceName:\"IWorld\",systems:{},excludeSystems:[],postDeployScript:\"PostDeploy\",deploysDirectory:\"./deploys\",worldsFile:\"./worlds.json\",worldgenDirectory:\"world\",worldImportPath:\"@latticexyz/world/src/\",modules:[]};import{getDuplicates as g,STORE_SELECTOR_MAX_LENGTH as w,UnrecognizedSystemErrorFactory as f}from\"@latticexyz/config\";import{MUDError as D}from\"@latticexyz/common/errors\";function R(r,s){let n=s?.filter(t=>t.endsWith(\"System\")&&t!==\"System\"&&!t.match(/^I[A-Z]/))??[],c=Object.keys(r.systems);if(s){for(let t of c)if(!s.includes(t)||t===\"World\")throw f([\"systems\",t],t)}let l=[...new Set([...n,...c])].filter(t=>!r.excludeSystems.includes(t)).reduce((t,u)=>({...t,[u]:b(u,r.systems[u],s)}),{}),i=Object.values(r.tables).map(({name:t})=>t),a=Object.values(l).map(({name:t})=>t),m=g([...i,...a]);if(m.length>0)throw new D(`Table and system names must be unique: ${m.join(\", \")}`);return{systems:l}}function b(r,s,n){let c=s?.name??r.slice(0,w),p=s?.registerFunctionSelectors??!0,l=s?.openAccess??!0,i=[],a=[],m=s&&!s.openAccess?s.accessList:[];for(let t of m)if(t.startsWith(\"0x\"))i.push(t);else{if(n&&!n.includes(t))throw f([\"systems\",r,\"accessList\"],t);a.push(t)}return{name:c,registerFunctionSelectors:p,openAccess:l,accessListAddresses:i,accessListSystems:a}}import{z as e}from\"zod\";import{DynamicResolutionType as A,zEthereumAddress as L,zObjectName as S,zSelector as C}from\"@latticexyz/config\";var y=S,h=S,z=e.array(y.or(L)).default(d.accessList),v=e.intersection(e.object({name:C.optional(),registerFunctionSelectors:e.boolean().default(d.registerFunctionSelector)}),e.discriminatedUnion(\"openAccess\",[e.object({openAccess:e.literal(!0).default(d.openAccess)}),e.object({openAccess:e.literal(!1),accessList:z})])),x=e.object({value:e.union([e.string(),e.number(),e.instanceof(Uint8Array)]),type:e.string()}),E=e.object({type:e.nativeEnum(A),input:e.string()}),N=e.object({name:h,root:e.boolean().default(!1),args:e.array(e.union([x,E])).default([])}),T=e.object({worldContractName:e.string().optional(),worldInterfaceName:e.string().default(o.worldInterfaceName),systems:e.record(y,v).default(o.systems),excludeSystems:e.array(y).default(o.excludeSystems),postDeployScript:e.string().default(o.postDeployScript),deploysDirectory:e.string().default(o.deploysDirectory),worldsFile:e.string().default(o.worldsFile),worldgenDirectory:e.string().default(o.worldgenDirectory),worldImportPath:e.string().default(o.worldImportPath),modules:e.array(N).default(o.modules)}),M=T.catchall(e.any());export{d as a,o as b,R as c,b as d,T as e,M as f};\n//# sourceMappingURL=chunk-JOQBBVRS.js.map","import{f as e}from\"./chunk-JOQBBVRS.js\";import\"@latticexyz/store/register\";import{mudConfig as c,mudCoreConfig as C,resolveTableId as g}from\"@latticexyz/store/register\";import{extendMUDCoreConfig as t,fromZodErrorCustom as i}from\"@latticexyz/config\";import{ZodError as s}from\"zod\";t(r=>{try{return e.parse(r)}catch(o){throw o instanceof s?i(o,\"WorldConfig Validation Error\"):o}});import\"@latticexyz/store/register\";export{c as a,C as b,g as c};\n//# sourceMappingURL=chunk-24XAL2ND.js.map","import{a as e}from\"./chunk-24XAL2ND.js\";import\"./chunk-OWSPJIEF.js\";import\"./chunk-JOQBBVRS.js\";var t=e({worldImportPath:\"../\",worldgenDirectory:\"interfaces\",worldInterfaceName:\"IBaseWorld\",codegenDirectory:\"\",tables:{NamespaceOwner:{keySchema:{namespace:\"bytes16\"},schema:{owner:\"address\"}},ResourceAccess:{keySchema:{resourceSelector:\"bytes32\",caller:\"address\"},schema:{access:\"bool\"}},InstalledModules:{keySchema:{moduleName:\"bytes16\",argumentsHash:\"bytes32\"},schema:{moduleAddress:\"address\"},dataStruct:!0},Systems:{directory:\"modules/core/tables\",keySchema:{resourceSelector:\"bytes32\"},schema:{system:\"address\",publicAccess:\"bool\"},dataStruct:!1},SystemRegistry:{directory:\"modules/core/tables\",keySchema:{system:\"address\"},schema:{resourceSelector:\"bytes32\"}},SystemHooks:{directory:\"modules/core/tables\",keySchema:{resourceSelector:\"bytes32\"},schema:\"address[]\"},ResourceType:{directory:\"modules/core/tables\",keySchema:{resourceSelector:\"bytes32\"},schema:{resourceType:\"Resource\"}},FunctionSelectors:{directory:\"modules/core/tables\",keySchema:{functionSelector:\"bytes4\"},schema:{resourceSelector:\"bytes32\",systemFunctionSelector:\"bytes4\"},dataStruct:!1},KeysWithValue:{directory:\"modules/keyswithvalue/tables\",keySchema:{valueHash:\"bytes32\"},schema:{keysWithValue:\"bytes32[]\"},tableIdArgument:!0},KeysInTable:{directory:\"modules/keysintable/tables\",keySchema:{sourceTable:\"bytes32\"},schema:{keys0:\"bytes32[]\",keys1:\"bytes32[]\",keys2:\"bytes32[]\",keys3:\"bytes32[]\",keys4:\"bytes32[]\"}},UsedKeysIndex:{directory:\"modules/keysintable/tables\",keySchema:{sourceTable:\"bytes32\",keysHash:\"bytes32\"},schema:{has:\"bool\",index:\"uint40\"},dataStruct:!1},UniqueEntity:{directory:\"modules/uniqueentity/tables\",keySchema:{},schema:\"uint256\",tableIdArgument:!0,storeArgument:!0},Bool:{directory:\"../test/tables\",keySchema:{},schema:{value:\"bool\"},tableIdArgument:!0},AddressArray:{directory:\"../test/tables\",schema:\"address[]\",tableIdArgument:!0}},enums:{Resource:[\"NONE\",\"NAMESPACE\",\"TABLE\",\"SYSTEM\"]},excludeSystems:[\"UniqueEntitySystem\",\"StoreRegistrationSystem\",\"EphemeralRecordSystem\"]});export{t as default};\n//# sourceMappingURL=mud.config.js.map","import{a as l,b as d}from\"../chunk-IH5UMM4B.js\";import{a as B}from\"../chunk-SNWOSPCV.js\";import\"../chunk-A2BQSIM3.js\";import{decodeAbiParameters as W}from\"viem\";import{sliceHex as w,size as V,isHex as M}from\"viem\";function T(e){if(!M(e))throw new Error(`entity ${e} is not a hex string`);let i=V(e);if(i%32!==0)throw new Error(`entity length ${i} is not a multiple of 32 bytes`);return new Array(i/32).fill(0).map((r,n)=>w(e,n*32,(n+1)*32))}function ot(e,i){let r=T(i);if(r.length!==Object.keys(e).length)throw new Error(`entity key tuple length ${r.length} does not match key schema length ${Object.keys(e).length}`);return Object.fromEntries(Object.entries(e).map(([n,a],o)=>[n,W([{type:a}],r[o])[0]]))}import{encodeAbiParameters as L}from\"viem\";import{concatHex as D}from\"viem\";function c(e){return D(e)}function u(e,i){if(Object.keys(e).length!==Object.keys(i).length)throw new Error(`key length ${Object.keys(i).length} does not match key schema length ${Object.keys(e).length}`);return c(Object.entries(e).map(([r,n])=>L([{type:n}],[i[r]])))}function ut(e){return e.metadata?.componentName!=null&&e.metadata?.tableName!=null&&e.metadata?.keySchema!=null&&e.metadata?.valueSchema!=null}var g=B.extend(\"recs\");import{getComponentValue as h,removeComponent as z,setComponent as x,updateComponent as F}from\"@latticexyz/recs\";import{isDefined as _}from\"@latticexyz/common/utils\";import{stringToHex as C}from\"viem\";function b(e){return u({address:\"address\",namespace:\"bytes16\",name:\"bytes16\"},{address:e.address,namespace:C(e.namespace,{size:16}),name:C(e.name,{size:16})})}import{tableIdToHex as q}from\"@latticexyz/common\";function R({components:e}){let i=Object.fromEntries(Object.entries(e).map(([r,n])=>[n.id,n]));return{async registerTables({tables:r}){for(let n of r)x(e.RegisteredTables,b(n),{table:n})},async getTables({tables:r}){return r.map(n=>h(e.RegisteredTables,b(n))?.table).filter(_)},async storeOperations({operations:r}){for(let n of r){let a=h(e.RegisteredTables,b({address:n.address,namespace:n.namespace,name:n.name}))?.table;if(!a){g(`skipping update for unknown table: ${n.namespace}:${n.name} at ${n.address}`);continue}let o=q(n.namespace,n.name),m=i[o];if(!m){g(`skipping update for unknown component: ${o}. Available components: ${Object.keys(e)}`);continue}let s=u(a.keySchema,n.key);n.type===\"SetRecord\"?(g(\"setting component\",o,s,n.value),x(m,s,n.value)):n.type===\"SetField\"?(g(\"updating component\",o,s,{[n.fieldName]:n.fieldValue}),F(m,s,{[n.fieldName]:n.fieldValue},l(a.valueSchema))):n.type===\"DeleteRecord\"&&(g(\"deleting component\",o,s),z(m,s))}}}}var f=c([]);import{getComponentValue as Q,setComponent as U}from\"@latticexyz/recs\";import{defineComponent as E,Type as y}from\"@latticexyz/recs\";function N(e){return{RegisteredTables:E(e,{table:y.T},{metadata:{componentName:\"RegisteredTables\"}}),SyncProgress:E(e,{step:y.String,message:y.String,percentage:y.Number,latestBlockNumber:y.BigInt,lastBlockNumberProcessed:y.BigInt},{metadata:{componentName:\"SyncProgress\"}})}}import X from\"@latticexyz/store/mud.config\";import Y from\"@latticexyz/world/mud.config\";import{tableIdToHex as G}from\"@latticexyz/common\";import{defineComponent as J}from\"@latticexyz/recs\";import{Type as t}from\"@latticexyz/recs\";var O={uint8:t.Number,uint16:t.Number,uint24:t.Number,uint32:t.Number,uint40:t.Number,uint48:t.Number,uint56:t.BigInt,uint64:t.BigInt,uint72:t.BigInt,uint80:t.BigInt,uint88:t.BigInt,uint96:t.BigInt,uint104:t.BigInt,uint112:t.BigInt,uint120:t.BigInt,uint128:t.BigInt,uint136:t.BigInt,uint144:t.BigInt,uint152:t.BigInt,uint160:t.BigInt,uint168:t.BigInt,uint176:t.BigInt,uint184:t.BigInt,uint192:t.BigInt,uint200:t.BigInt,uint208:t.BigInt,uint216:t.BigInt,uint224:t.BigInt,uint232:t.BigInt,uint240:t.BigInt,uint248:t.BigInt,uint256:t.BigInt,int8:t.Number,int16:t.Number,int24:t.Number,int32:t.Number,int40:t.Number,int48:t.Number,int56:t.BigInt,int64:t.BigInt,int72:t.BigInt,int80:t.BigInt,int88:t.BigInt,int96:t.BigInt,int104:t.BigInt,int112:t.BigInt,int120:t.BigInt,int128:t.BigInt,int136:t.BigInt,int144:t.BigInt,int152:t.BigInt,int160:t.BigInt,int168:t.BigInt,int176:t.BigInt,int184:t.BigInt,int192:t.BigInt,int200:t.BigInt,int208:t.BigInt,int216:t.BigInt,int224:t.BigInt,int232:t.BigInt,int240:t.BigInt,int248:t.BigInt,int256:t.BigInt,bytes1:t.String,bytes2:t.String,bytes3:t.String,bytes4:t.String,bytes5:t.String,bytes6:t.String,bytes7:t.String,bytes8:t.String,bytes9:t.String,bytes10:t.String,bytes11:t.String,bytes12:t.String,bytes13:t.String,bytes14:t.String,bytes15:t.String,bytes16:t.String,bytes17:t.String,bytes18:t.String,bytes19:t.String,bytes20:t.String,bytes21:t.String,bytes22:t.String,bytes23:t.String,bytes24:t.String,bytes25:t.String,bytes26:t.String,bytes27:t.String,bytes28:t.String,bytes29:t.String,bytes30:t.String,bytes31:t.String,bytes32:t.String,bool:t.Boolean,address:t.String,\"uint8[]\":t.NumberArray,\"uint16[]\":t.NumberArray,\"uint24[]\":t.NumberArray,\"uint32[]\":t.NumberArray,\"uint40[]\":t.NumberArray,\"uint48[]\":t.NumberArray,\"uint56[]\":t.BigIntArray,\"uint64[]\":t.BigIntArray,\"uint72[]\":t.BigIntArray,\"uint80[]\":t.BigIntArray,\"uint88[]\":t.BigIntArray,\"uint96[]\":t.BigIntArray,\"uint104[]\":t.BigIntArray,\"uint112[]\":t.BigIntArray,\"uint120[]\":t.BigIntArray,\"uint128[]\":t.BigIntArray,\"uint136[]\":t.BigIntArray,\"uint144[]\":t.BigIntArray,\"uint152[]\":t.BigIntArray,\"uint160[]\":t.BigIntArray,\"uint168[]\":t.BigIntArray,\"uint176[]\":t.BigIntArray,\"uint184[]\":t.BigIntArray,\"uint192[]\":t.BigIntArray,\"uint200[]\":t.BigIntArray,\"uint208[]\":t.BigIntArray,\"uint216[]\":t.BigIntArray,\"uint224[]\":t.BigIntArray,\"uint232[]\":t.BigIntArray,\"uint240[]\":t.BigIntArray,\"uint248[]\":t.BigIntArray,\"uint256[]\":t.BigIntArray,\"int8[]\":t.NumberArray,\"int16[]\":t.NumberArray,\"int24[]\":t.NumberArray,\"int32[]\":t.NumberArray,\"int40[]\":t.NumberArray,\"int48[]\":t.NumberArray,\"int56[]\":t.BigIntArray,\"int64[]\":t.BigIntArray,\"int72[]\":t.BigIntArray,\"int80[]\":t.BigIntArray,\"int88[]\":t.BigIntArray,\"int96[]\":t.BigIntArray,\"int104[]\":t.BigIntArray,\"int112[]\":t.BigIntArray,\"int120[]\":t.BigIntArray,\"int128[]\":t.BigIntArray,\"int136[]\":t.BigIntArray,\"int144[]\":t.BigIntArray,\"int152[]\":t.BigIntArray,\"int160[]\":t.BigIntArray,\"int168[]\":t.BigIntArray,\"int176[]\":t.BigIntArray,\"int184[]\":t.BigIntArray,\"int192[]\":t.BigIntArray,\"int200[]\":t.BigIntArray,\"int208[]\":t.BigIntArray,\"int216[]\":t.BigIntArray,\"int224[]\":t.BigIntArray,\"int232[]\":t.BigIntArray,\"int240[]\":t.BigIntArray,\"int248[]\":t.BigIntArray,\"int256[]\":t.BigIntArray,\"bytes1[]\":t.StringArray,\"bytes2[]\":t.StringArray,\"bytes3[]\":t.StringArray,\"bytes4[]\":t.StringArray,\"bytes5[]\":t.StringArray,\"bytes6[]\":t.StringArray,\"bytes7[]\":t.StringArray,\"bytes8[]\":t.StringArray,\"bytes9[]\":t.StringArray,\"bytes10[]\":t.StringArray,\"bytes11[]\":t.StringArray,\"bytes12[]\":t.StringArray,\"bytes13[]\":t.StringArray,\"bytes14[]\":t.StringArray,\"bytes15[]\":t.StringArray,\"bytes16[]\":t.StringArray,\"bytes17[]\":t.StringArray,\"bytes18[]\":t.StringArray,\"bytes19[]\":t.StringArray,\"bytes20[]\":t.StringArray,\"bytes21[]\":t.StringArray,\"bytes22[]\":t.StringArray,\"bytes23[]\":t.StringArray,\"bytes24[]\":t.StringArray,\"bytes25[]\":t.StringArray,\"bytes26[]\":t.StringArray,\"bytes27[]\":t.StringArray,\"bytes28[]\":t.StringArray,\"bytes29[]\":t.StringArray,\"bytes30[]\":t.StringArray,\"bytes31[]\":t.StringArray,\"bytes32[]\":t.StringArray,\"bool[]\":t.T,\"address[]\":t.StringArray,bytes:t.String,string:t.String};function S(e,i){return Object.fromEntries(Object.entries(i.tables).map(([r,n])=>[r,J(e,Object.fromEntries(Object.entries(n.schema).map(([a,o])=>[a,O[o]])),{id:G(i.namespace,r),metadata:{componentName:r,tableName:`${i.namespace}:${r}`,keySchema:n.keySchema,valueSchema:n.schema}})]))}async function ae({world:e,config:i,address:r,publicClient:n,startBlock:a,maxBlockRange:o,initialState:m,indexerUrl:s,startSync:k=!0}){let p={...S(e,i),...S(e,X),...S(e,Y),...N(e)};e.registerEntity({id:f});let A=await d({storageAdapter:R({components:p,config:i}),config:i,address:r,publicClient:n,startBlock:a,maxBlockRange:o,indexerUrl:s,initialState:m,onProgress:({step:H,percentage:P,latestBlockNumber:v,lastBlockNumberProcessed:$,message:K})=>{Q(p.SyncProgress,f)?.step!==\"live\"&&U(p.SyncProgress,f,{step:H,percentage:P,latestBlockNumber:v,lastBlockNumberProcessed:$,message:K})}}),j=k?A.blockStorageOperations$.subscribe():null,I=()=>{j?.unsubscribe()};return e.registerDisposer(I),{...A,components:p,stopSync:I}}export{ot as decodeEntity,u as encodeEntity,T as entityToHexKeyTuple,c as hexKeyTupleToEntity,ut as isStoreComponent,R as recsStorage,f as singletonEntity,ae as syncToRecs};\n//# sourceMappingURL=index.js.map","import { getComponentValue,getComponentValueStrict, Has, Not } from \"@latticexyz/recs\";\nimport { ClientComponents } from \"./createClientComponents\";\nimport { SetupNetworkResult } from \"./setupNetwork\";\nimport { singletonEntity } from \"@latticexyz/store-sync/recs\";\n\n\nexport type SystemCalls = ReturnType;\n\nexport function createSystemCalls(\n { worldContract, waitForTransaction }: SetupNetworkResult,\n { Counter,GameState,Game,IsPlayer,Player,AssetsList }: ClientComponents\n) {\n const increment = async () => {\n const tx = await worldContract.write.increment();\n await waitForTransaction(tx);\n return getComponentValue(Counter, singletonEntity);\n };\n const joinGame = async () => {\n const tx = await worldContract.write.joinGame();\n await waitForTransaction(tx);\n return getComponentValue(IsPlayer, singletonEntity);\n };\n const askStart = async () => {\n const tx = await worldContract.write.askStart();\n await waitForTransaction(tx);\n return getComponentValue(GameState, singletonEntity);\n };\n\n const move = async (x:number,y:number) => {\n // const tx = await worldSend(\"move\", [x, y]);\n const tx = await worldContract.write.move([x,y]);\n return await waitForTransaction(tx);\n };\n\n const pickAsset = async (assetType:number) => {\n const tx = await worldContract.write.pickAsset([assetType]);\n await waitForTransaction(tx);\n return getComponentValue(AssetsList, singletonEntity);\n };\n\n const pickFund = async (cardId:number) => {\n const tx = await worldContract.write.pickFund([cardId]);\n await waitForTransaction(tx);\n };\n\n const trade = async (targetPlayer:string,assetType:number,money:number) => {\n const tx = await worldContract.write.trade([targetPlayer,assetType,money]);\n return await waitForTransaction(tx);\n };\n\n const acceptTrade = async () => {\n const tx = await worldContract.write.acceptTrade();\n return await waitForTransaction(tx);\n };\n\n const rejectTrade = async () => {\n const tx = await worldContract.write.rejectTrade();\n return await waitForTransaction(tx);\n };\n\n const finishGame = async () => {\n const tx = await worldContract.write.finishGame();\n return await waitForTransaction(tx);\n };\n\n const pickCoin = async () => {\n const tx = await worldContract.write.pickCoin();\n return await waitForTransaction(tx);\n };\n\n const findPartner = async () => {\n const tx = await worldContract.write.findPartner();\n return await waitForTransaction(tx);\n };\n\n const pay = async () => {\n const tx = await worldContract.write.pay();\n return await waitForTransaction(tx);\n };\n const restartGame = async () => {\n const tx = await worldContract.write.restartGame();\n return await waitForTransaction(tx);\n };\n const checkDebt = async () => {\n const tx = await worldContract.write.checkDebt();\n return await waitForTransaction(tx);\n };\n\n return {\n increment,\n joinGame,\n askStart,\n move,\n pickAsset,\n pickFund,\n trade,\n acceptTrade,\n rejectTrade,\n finishGame,\n pickCoin,\n findPartner,\n pay,\n restartGame,\n checkDebt\n };\n}\n","/**\n * @license\n * Copyright 2009 The Closure Library Authors\n * Copyright 2020 Daniel Wirtz / The long.js Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// WebAssembly optimizations to do native i64 multiplication and divide\nvar wasm = null;\ntry {\n wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([\n 0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11\n ])), {}).exports;\n} catch (e) {\n // no wasm support :(\n}\n\n/**\n * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.\n * See the from* functions below for more convenient ways of constructing Longs.\n * @exports Long\n * @class A Long class for representing a 64 bit two's-complement integer value.\n * @param {number} low The low (signed) 32 bits of the long\n * @param {number} high The high (signed) 32 bits of the long\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @constructor\n */\nfunction Long(low, high, unsigned) {\n\n /**\n * The low 32 bits as a signed value.\n * @type {number}\n */\n this.low = low | 0;\n\n /**\n * The high 32 bits as a signed value.\n * @type {number}\n */\n this.high = high | 0;\n\n /**\n * Whether unsigned or not.\n * @type {boolean}\n */\n this.unsigned = !!unsigned;\n}\n\n// The internal representation of a long is the two given signed, 32-bit values.\n// We use 32-bit pieces because these are the size of integers on which\n// Javascript performs bit-operations. For operations like addition and\n// multiplication, we split each number into 16 bit pieces, which can easily be\n// multiplied within Javascript's floating-point representation without overflow\n// or change in sign.\n//\n// In the algorithms below, we frequently reduce the negative case to the\n// positive case by negating the input(s) and then post-processing the result.\n// Note that we must ALWAYS check specially whether those values are MIN_VALUE\n// (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as\n// a positive number, it overflows back into a negative). Not handling this\n// case would often result in infinite recursion.\n//\n// Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from*\n// methods on which they depend.\n\n/**\n * An indicator used to reliably determine if an object is a Long or not.\n * @type {boolean}\n * @const\n * @private\n */\nLong.prototype.__isLong__;\n\nObject.defineProperty(Long.prototype, \"__isLong__\", { value: true });\n\n/**\n * @function\n * @param {*} obj Object\n * @returns {boolean}\n * @inner\n */\nfunction isLong(obj) {\n return (obj && obj[\"__isLong__\"]) === true;\n}\n\n/**\n * @function\n * @param {*} value number\n * @returns {number}\n * @inner\n */\nfunction ctz32(value) {\n var c = Math.clz32(value & -value);\n return value ? 31 - c : c;\n}\n\n/**\n * Tests if the specified object is a Long.\n * @function\n * @param {*} obj Object\n * @returns {boolean}\n */\nLong.isLong = isLong;\n\n/**\n * A cache of the Long representations of small integer values.\n * @type {!Object}\n * @inner\n */\nvar INT_CACHE = {};\n\n/**\n * A cache of the Long representations of small unsigned integer values.\n * @type {!Object}\n * @inner\n */\nvar UINT_CACHE = {};\n\n/**\n * @param {number} value\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nfunction fromInt(value, unsigned) {\n var obj, cachedObj, cache;\n if (unsigned) {\n value >>>= 0;\n if (cache = (0 <= value && value < 256)) {\n cachedObj = UINT_CACHE[value];\n if (cachedObj)\n return cachedObj;\n }\n obj = fromBits(value, 0, true);\n if (cache)\n UINT_CACHE[value] = obj;\n return obj;\n } else {\n value |= 0;\n if (cache = (-128 <= value && value < 128)) {\n cachedObj = INT_CACHE[value];\n if (cachedObj)\n return cachedObj;\n }\n obj = fromBits(value, value < 0 ? -1 : 0, false);\n if (cache)\n INT_CACHE[value] = obj;\n return obj;\n }\n}\n\n/**\n * Returns a Long representing the given 32 bit integer value.\n * @function\n * @param {number} value The 32 bit integer in question\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\nLong.fromInt = fromInt;\n\n/**\n * @param {number} value\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nfunction fromNumber(value, unsigned) {\n if (isNaN(value))\n return unsigned ? UZERO : ZERO;\n if (unsigned) {\n if (value < 0)\n return UZERO;\n if (value >= TWO_PWR_64_DBL)\n return MAX_UNSIGNED_VALUE;\n } else {\n if (value <= -TWO_PWR_63_DBL)\n return MIN_VALUE;\n if (value + 1 >= TWO_PWR_63_DBL)\n return MAX_VALUE;\n }\n if (value < 0)\n return fromNumber(-value, unsigned).neg();\n return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned);\n}\n\n/**\n * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.\n * @function\n * @param {number} value The number in question\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\nLong.fromNumber = fromNumber;\n\n/**\n * @param {number} lowBits\n * @param {number} highBits\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nfunction fromBits(lowBits, highBits, unsigned) {\n return new Long(lowBits, highBits, unsigned);\n}\n\n/**\n * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is\n * assumed to use 32 bits.\n * @function\n * @param {number} lowBits The low 32 bits\n * @param {number} highBits The high 32 bits\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\nLong.fromBits = fromBits;\n\n/**\n * @function\n * @param {number} base\n * @param {number} exponent\n * @returns {number}\n * @inner\n */\nvar pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4)\n\n/**\n * @param {string} str\n * @param {(boolean|number)=} unsigned\n * @param {number=} radix\n * @returns {!Long}\n * @inner\n */\nfunction fromString(str, unsigned, radix) {\n if (str.length === 0)\n throw Error('empty string');\n if (typeof unsigned === 'number') {\n // For goog.math.long compatibility\n radix = unsigned;\n unsigned = false;\n } else {\n unsigned = !!unsigned;\n }\n if (str === \"NaN\" || str === \"Infinity\" || str === \"+Infinity\" || str === \"-Infinity\")\n return unsigned ? UZERO : ZERO;\n radix = radix || 10;\n if (radix < 2 || 36 < radix)\n throw RangeError('radix');\n\n var p;\n if ((p = str.indexOf('-')) > 0)\n throw Error('interior hyphen');\n else if (p === 0) {\n return fromString(str.substring(1), unsigned, radix).neg();\n }\n\n // Do several (8) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n var radixToPower = fromNumber(pow_dbl(radix, 8));\n\n var result = ZERO;\n for (var i = 0; i < str.length; i += 8) {\n var size = Math.min(8, str.length - i),\n value = parseInt(str.substring(i, i + size), radix);\n if (size < 8) {\n var power = fromNumber(pow_dbl(radix, size));\n result = result.mul(power).add(fromNumber(value));\n } else {\n result = result.mul(radixToPower);\n result = result.add(fromNumber(value));\n }\n }\n result.unsigned = unsigned;\n return result;\n}\n\n/**\n * Returns a Long representation of the given string, written using the specified radix.\n * @function\n * @param {string} str The textual representation of the Long\n * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed\n * @param {number=} radix The radix in which the text is written (2-36), defaults to 10\n * @returns {!Long} The corresponding Long value\n */\nLong.fromString = fromString;\n\n/**\n * @function\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nfunction fromValue(val, unsigned) {\n if (typeof val === 'number')\n return fromNumber(val, unsigned);\n if (typeof val === 'string')\n return fromString(val, unsigned);\n // Throws for non-objects, converts non-instanceof Long:\n return fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned);\n}\n\n/**\n * Converts the specified value to a Long using the appropriate from* function for its type.\n * @function\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long}\n */\nLong.fromValue = fromValue;\n\n// NOTE: the compiler should inline these constant values below and then remove these variables, so there should be\n// no runtime penalty for these.\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_16_DBL = 1 << 16;\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_24_DBL = 1 << 24;\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;\n\n/**\n * @type {!Long}\n * @const\n * @inner\n */\nvar TWO_PWR_24 = fromInt(TWO_PWR_24_DBL);\n\n/**\n * @type {!Long}\n * @inner\n */\nvar ZERO = fromInt(0);\n\n/**\n * Signed zero.\n * @type {!Long}\n */\nLong.ZERO = ZERO;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar UZERO = fromInt(0, true);\n\n/**\n * Unsigned zero.\n * @type {!Long}\n */\nLong.UZERO = UZERO;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar ONE = fromInt(1);\n\n/**\n * Signed one.\n * @type {!Long}\n */\nLong.ONE = ONE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar UONE = fromInt(1, true);\n\n/**\n * Unsigned one.\n * @type {!Long}\n */\nLong.UONE = UONE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar NEG_ONE = fromInt(-1);\n\n/**\n * Signed negative one.\n * @type {!Long}\n */\nLong.NEG_ONE = NEG_ONE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar MAX_VALUE = fromBits(0xFFFFFFFF | 0, 0x7FFFFFFF | 0, false);\n\n/**\n * Maximum signed value.\n * @type {!Long}\n */\nLong.MAX_VALUE = MAX_VALUE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF | 0, 0xFFFFFFFF | 0, true);\n\n/**\n * Maximum unsigned value.\n * @type {!Long}\n */\nLong.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar MIN_VALUE = fromBits(0, 0x80000000 | 0, false);\n\n/**\n * Minimum signed value.\n * @type {!Long}\n */\nLong.MIN_VALUE = MIN_VALUE;\n\n/**\n * @alias Long.prototype\n * @inner\n */\nvar LongPrototype = Long.prototype;\n\n/**\n * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.\n * @this {!Long}\n * @returns {number}\n */\nLongPrototype.toInt = function toInt() {\n return this.unsigned ? this.low >>> 0 : this.low;\n};\n\n/**\n * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).\n * @this {!Long}\n * @returns {number}\n */\nLongPrototype.toNumber = function toNumber() {\n if (this.unsigned)\n return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0);\n return this.high * TWO_PWR_32_DBL + (this.low >>> 0);\n};\n\n/**\n * Converts the Long to a string written in the specified radix.\n * @this {!Long}\n * @param {number=} radix Radix (2-36), defaults to 10\n * @returns {string}\n * @override\n * @throws {RangeError} If `radix` is out of range\n */\nLongPrototype.toString = function toString(radix) {\n radix = radix || 10;\n if (radix < 2 || 36 < radix)\n throw RangeError('radix');\n if (this.isZero())\n return '0';\n if (this.isNegative()) { // Unsigned Longs are never negative\n if (this.eq(MIN_VALUE)) {\n // We need to change the Long value before it can be negated, so we remove\n // the bottom-most digit in this base and then recurse to do the rest.\n var radixLong = fromNumber(radix),\n div = this.div(radixLong),\n rem1 = div.mul(radixLong).sub(this);\n return div.toString(radix) + rem1.toInt().toString(radix);\n } else\n return '-' + this.neg().toString(radix);\n }\n\n // Do several (6) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned),\n rem = this;\n var result = '';\n while (true) {\n var remDiv = rem.div(radixToPower),\n intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0,\n digits = intval.toString(radix);\n rem = remDiv;\n if (rem.isZero())\n return digits + result;\n else {\n while (digits.length < 6)\n digits = '0' + digits;\n result = '' + digits + result;\n }\n }\n};\n\n/**\n * Gets the high 32 bits as a signed integer.\n * @this {!Long}\n * @returns {number} Signed high bits\n */\nLongPrototype.getHighBits = function getHighBits() {\n return this.high;\n};\n\n/**\n * Gets the high 32 bits as an unsigned integer.\n * @this {!Long}\n * @returns {number} Unsigned high bits\n */\nLongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() {\n return this.high >>> 0;\n};\n\n/**\n * Gets the low 32 bits as a signed integer.\n * @this {!Long}\n * @returns {number} Signed low bits\n */\nLongPrototype.getLowBits = function getLowBits() {\n return this.low;\n};\n\n/**\n * Gets the low 32 bits as an unsigned integer.\n * @this {!Long}\n * @returns {number} Unsigned low bits\n */\nLongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() {\n return this.low >>> 0;\n};\n\n/**\n * Gets the number of bits needed to represent the absolute value of this Long.\n * @this {!Long}\n * @returns {number}\n */\nLongPrototype.getNumBitsAbs = function getNumBitsAbs() {\n if (this.isNegative()) // Unsigned Longs are never negative\n return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs();\n var val = this.high != 0 ? this.high : this.low;\n for (var bit = 31; bit > 0; bit--)\n if ((val & (1 << bit)) != 0)\n break;\n return this.high != 0 ? bit + 33 : bit + 1;\n};\n\n/**\n * Tests if this Long's value equals zero.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isZero = function isZero() {\n return this.high === 0 && this.low === 0;\n};\n\n/**\n * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}.\n * @returns {boolean}\n */\nLongPrototype.eqz = LongPrototype.isZero;\n\n/**\n * Tests if this Long's value is negative.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isNegative = function isNegative() {\n return !this.unsigned && this.high < 0;\n};\n\n/**\n * Tests if this Long's value is positive or zero.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isPositive = function isPositive() {\n return this.unsigned || this.high >= 0;\n};\n\n/**\n * Tests if this Long's value is odd.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isOdd = function isOdd() {\n return (this.low & 1) === 1;\n};\n\n/**\n * Tests if this Long's value is even.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isEven = function isEven() {\n return (this.low & 1) === 0;\n};\n\n/**\n * Tests if this Long's value equals the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.equals = function equals(other) {\n if (!isLong(other))\n other = fromValue(other);\n if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1)\n return false;\n return this.high === other.high && this.low === other.low;\n};\n\n/**\n * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.eq = LongPrototype.equals;\n\n/**\n * Tests if this Long's value differs from the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.notEquals = function notEquals(other) {\n return !this.eq(/* validates */ other);\n};\n\n/**\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.neq = LongPrototype.notEquals;\n\n/**\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.ne = LongPrototype.notEquals;\n\n/**\n * Tests if this Long's value is less than the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.lessThan = function lessThan(other) {\n return this.comp(/* validates */ other) < 0;\n};\n\n/**\n * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.lt = LongPrototype.lessThan;\n\n/**\n * Tests if this Long's value is less than or equal the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.lessThanOrEqual = function lessThanOrEqual(other) {\n return this.comp(/* validates */ other) <= 0;\n};\n\n/**\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.lte = LongPrototype.lessThanOrEqual;\n\n/**\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.le = LongPrototype.lessThanOrEqual;\n\n/**\n * Tests if this Long's value is greater than the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.greaterThan = function greaterThan(other) {\n return this.comp(/* validates */ other) > 0;\n};\n\n/**\n * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.gt = LongPrototype.greaterThan;\n\n/**\n * Tests if this Long's value is greater than or equal the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) {\n return this.comp(/* validates */ other) >= 0;\n};\n\n/**\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.gte = LongPrototype.greaterThanOrEqual;\n\n/**\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.ge = LongPrototype.greaterThanOrEqual;\n\n/**\n * Compares this Long's value with the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\n * if the given one is greater\n */\nLongPrototype.compare = function compare(other) {\n if (!isLong(other))\n other = fromValue(other);\n if (this.eq(other))\n return 0;\n var thisNeg = this.isNegative(),\n otherNeg = other.isNegative();\n if (thisNeg && !otherNeg)\n return -1;\n if (!thisNeg && otherNeg)\n return 1;\n // At this point the sign bits are the same\n if (!this.unsigned)\n return this.sub(other).isNegative() ? -1 : 1;\n // Both are positive if at least one is unsigned\n return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1;\n};\n\n/**\n * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\n * if the given one is greater\n */\nLongPrototype.comp = LongPrototype.compare;\n\n/**\n * Negates this Long's value.\n * @this {!Long}\n * @returns {!Long} Negated Long\n */\nLongPrototype.negate = function negate() {\n if (!this.unsigned && this.eq(MIN_VALUE))\n return MIN_VALUE;\n return this.not().add(ONE);\n};\n\n/**\n * Negates this Long's value. This is an alias of {@link Long#negate}.\n * @function\n * @returns {!Long} Negated Long\n */\nLongPrototype.neg = LongPrototype.negate;\n\n/**\n * Returns the sum of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|string} addend Addend\n * @returns {!Long} Sum\n */\nLongPrototype.add = function add(addend) {\n if (!isLong(addend))\n addend = fromValue(addend);\n\n // Divide each number into 4 chunks of 16 bits, and then sum the chunks.\n\n var a48 = this.high >>> 16;\n var a32 = this.high & 0xFFFF;\n var a16 = this.low >>> 16;\n var a00 = this.low & 0xFFFF;\n\n var b48 = addend.high >>> 16;\n var b32 = addend.high & 0xFFFF;\n var b16 = addend.low >>> 16;\n var b00 = addend.low & 0xFFFF;\n\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n c00 += a00 + b00;\n c16 += c00 >>> 16;\n c00 &= 0xFFFF;\n c16 += a16 + b16;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c32 += a32 + b32;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c48 += a48 + b48;\n c48 &= 0xFFFF;\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\n};\n\n/**\n * Returns the difference of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|string} subtrahend Subtrahend\n * @returns {!Long} Difference\n */\nLongPrototype.subtract = function subtract(subtrahend) {\n if (!isLong(subtrahend))\n subtrahend = fromValue(subtrahend);\n return this.add(subtrahend.neg());\n};\n\n/**\n * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}.\n * @function\n * @param {!Long|number|string} subtrahend Subtrahend\n * @returns {!Long} Difference\n */\nLongPrototype.sub = LongPrototype.subtract;\n\n/**\n * Returns the product of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|string} multiplier Multiplier\n * @returns {!Long} Product\n */\nLongPrototype.multiply = function multiply(multiplier) {\n if (this.isZero())\n return this;\n if (!isLong(multiplier))\n multiplier = fromValue(multiplier);\n\n // use wasm support if present\n if (wasm) {\n var low = wasm[\"mul\"](this.low,\n this.high,\n multiplier.low,\n multiplier.high);\n return fromBits(low, wasm[\"get_high\"](), this.unsigned);\n }\n\n if (multiplier.isZero())\n return this.unsigned ? UZERO : ZERO;\n if (this.eq(MIN_VALUE))\n return multiplier.isOdd() ? MIN_VALUE : ZERO;\n if (multiplier.eq(MIN_VALUE))\n return this.isOdd() ? MIN_VALUE : ZERO;\n\n if (this.isNegative()) {\n if (multiplier.isNegative())\n return this.neg().mul(multiplier.neg());\n else\n return this.neg().mul(multiplier).neg();\n } else if (multiplier.isNegative())\n return this.mul(multiplier.neg()).neg();\n\n // If both longs are small, use float multiplication\n if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24))\n return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned);\n\n // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.\n // We can skip products that would overflow.\n\n var a48 = this.high >>> 16;\n var a32 = this.high & 0xFFFF;\n var a16 = this.low >>> 16;\n var a00 = this.low & 0xFFFF;\n\n var b48 = multiplier.high >>> 16;\n var b32 = multiplier.high & 0xFFFF;\n var b16 = multiplier.low >>> 16;\n var b00 = multiplier.low & 0xFFFF;\n\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n c00 += a00 * b00;\n c16 += c00 >>> 16;\n c00 &= 0xFFFF;\n c16 += a16 * b00;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c16 += a00 * b16;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c32 += a32 * b00;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c32 += a16 * b16;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c32 += a00 * b32;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;\n c48 &= 0xFFFF;\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\n};\n\n/**\n * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}.\n * @function\n * @param {!Long|number|string} multiplier Multiplier\n * @returns {!Long} Product\n */\nLongPrototype.mul = LongPrototype.multiply;\n\n/**\n * Returns this Long divided by the specified. The result is signed if this Long is signed or\n * unsigned if this Long is unsigned.\n * @this {!Long}\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Quotient\n */\nLongPrototype.divide = function divide(divisor) {\n if (!isLong(divisor))\n divisor = fromValue(divisor);\n if (divisor.isZero())\n throw Error('division by zero');\n\n // use wasm support if present\n if (wasm) {\n // guard against signed division overflow: the largest\n // negative number / -1 would be 1 larger than the largest\n // positive number, due to two's complement.\n if (!this.unsigned &&\n this.high === -0x80000000 &&\n divisor.low === -1 && divisor.high === -1) {\n // be consistent with non-wasm code path\n return this;\n }\n var low = (this.unsigned ? wasm[\"div_u\"] : wasm[\"div_s\"])(\n this.low,\n this.high,\n divisor.low,\n divisor.high\n );\n return fromBits(low, wasm[\"get_high\"](), this.unsigned);\n }\n\n if (this.isZero())\n return this.unsigned ? UZERO : ZERO;\n var approx, rem, res;\n if (!this.unsigned) {\n // This section is only relevant for signed longs and is derived from the\n // closure library as a whole.\n if (this.eq(MIN_VALUE)) {\n if (divisor.eq(ONE) || divisor.eq(NEG_ONE))\n return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE\n else if (divisor.eq(MIN_VALUE))\n return ONE;\n else {\n // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.\n var halfThis = this.shr(1);\n approx = halfThis.div(divisor).shl(1);\n if (approx.eq(ZERO)) {\n return divisor.isNegative() ? ONE : NEG_ONE;\n } else {\n rem = this.sub(divisor.mul(approx));\n res = approx.add(rem.div(divisor));\n return res;\n }\n }\n } else if (divisor.eq(MIN_VALUE))\n return this.unsigned ? UZERO : ZERO;\n if (this.isNegative()) {\n if (divisor.isNegative())\n return this.neg().div(divisor.neg());\n return this.neg().div(divisor).neg();\n } else if (divisor.isNegative())\n return this.div(divisor.neg()).neg();\n res = ZERO;\n } else {\n // The algorithm below has not been made for unsigned longs. It's therefore\n // required to take special care of the MSB prior to running it.\n if (!divisor.unsigned)\n divisor = divisor.toUnsigned();\n if (divisor.gt(this))\n return UZERO;\n if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true\n return UONE;\n res = UZERO;\n }\n\n // Repeat the following until the remainder is less than other: find a\n // floating-point that approximates remainder / other *from below*, add this\n // into the result, and subtract it from the remainder. It is critical that\n // the approximate value is less than or equal to the real value so that the\n // remainder never becomes negative.\n rem = this;\n while (rem.gte(divisor)) {\n // Approximate the result of division. This may be a little greater or\n // smaller than the actual value.\n approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber()));\n\n // We will tweak the approximate result by changing it in the 48-th digit or\n // the smallest non-fractional digit, whichever is larger.\n var log2 = Math.ceil(Math.log(approx) / Math.LN2),\n delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48),\n\n // Decrease the approximation until it is smaller than the remainder. Note\n // that if it is too large, the product overflows and is negative.\n approxRes = fromNumber(approx),\n approxRem = approxRes.mul(divisor);\n while (approxRem.isNegative() || approxRem.gt(rem)) {\n approx -= delta;\n approxRes = fromNumber(approx, this.unsigned);\n approxRem = approxRes.mul(divisor);\n }\n\n // We know the answer can't be zero... and actually, zero would cause\n // infinite recursion since we would make no progress.\n if (approxRes.isZero())\n approxRes = ONE;\n\n res = res.add(approxRes);\n rem = rem.sub(approxRem);\n }\n return res;\n};\n\n/**\n * Returns this Long divided by the specified. This is an alias of {@link Long#divide}.\n * @function\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Quotient\n */\nLongPrototype.div = LongPrototype.divide;\n\n/**\n * Returns this Long modulo the specified.\n * @this {!Long}\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Remainder\n */\nLongPrototype.modulo = function modulo(divisor) {\n if (!isLong(divisor))\n divisor = fromValue(divisor);\n\n // use wasm support if present\n if (wasm) {\n var low = (this.unsigned ? wasm[\"rem_u\"] : wasm[\"rem_s\"])(\n this.low,\n this.high,\n divisor.low,\n divisor.high\n );\n return fromBits(low, wasm[\"get_high\"](), this.unsigned);\n }\n\n return this.sub(this.div(divisor).mul(divisor));\n};\n\n/**\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\n * @function\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Remainder\n */\nLongPrototype.mod = LongPrototype.modulo;\n\n/**\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\n * @function\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Remainder\n */\nLongPrototype.rem = LongPrototype.modulo;\n\n/**\n * Returns the bitwise NOT of this Long.\n * @this {!Long}\n * @returns {!Long}\n */\nLongPrototype.not = function not() {\n return fromBits(~this.low, ~this.high, this.unsigned);\n};\n\n/**\n * Returns count leading zeros of this Long.\n * @this {!Long}\n * @returns {!number}\n */\nLongPrototype.countLeadingZeros = function countLeadingZeros() {\n return this.high ? Math.clz32(this.high) : Math.clz32(this.low) + 32;\n};\n\n/**\n * Returns count leading zeros. This is an alias of {@link Long#countLeadingZeros}.\n * @function\n * @param {!Long}\n * @returns {!number}\n */\nLongPrototype.clz = LongPrototype.countLeadingZeros;\n\n/**\n * Returns count trailing zeros of this Long.\n * @this {!Long}\n * @returns {!number}\n */\nLongPrototype.countTrailingZeros = function countTrailingZeros() {\n return this.low ? ctz32(this.low) : ctz32(this.high) + 32;\n};\n\n/**\n * Returns count trailing zeros. This is an alias of {@link Long#countTrailingZeros}.\n * @function\n * @param {!Long}\n * @returns {!number}\n */\nLongPrototype.ctz = LongPrototype.countTrailingZeros;\n\n/**\n * Returns the bitwise AND of this Long and the specified.\n * @this {!Long}\n * @param {!Long|number|string} other Other Long\n * @returns {!Long}\n */\nLongPrototype.and = function and(other) {\n if (!isLong(other))\n other = fromValue(other);\n return fromBits(this.low & other.low, this.high & other.high, this.unsigned);\n};\n\n/**\n * Returns the bitwise OR of this Long and the specified.\n * @this {!Long}\n * @param {!Long|number|string} other Other Long\n * @returns {!Long}\n */\nLongPrototype.or = function or(other) {\n if (!isLong(other))\n other = fromValue(other);\n return fromBits(this.low | other.low, this.high | other.high, this.unsigned);\n};\n\n/**\n * Returns the bitwise XOR of this Long and the given one.\n * @this {!Long}\n * @param {!Long|number|string} other Other Long\n * @returns {!Long}\n */\nLongPrototype.xor = function xor(other) {\n if (!isLong(other))\n other = fromValue(other);\n return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned);\n};\n\n/**\n * Returns this Long with bits shifted to the left by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shiftLeft = function shiftLeft(numBits) {\n if (isLong(numBits))\n numBits = numBits.toInt();\n if ((numBits &= 63) === 0)\n return this;\n else if (numBits < 32)\n return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned);\n else\n return fromBits(0, this.low << (numBits - 32), this.unsigned);\n};\n\n/**\n * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shl = LongPrototype.shiftLeft;\n\n/**\n * Returns this Long with bits arithmetically shifted to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shiftRight = function shiftRight(numBits) {\n if (isLong(numBits))\n numBits = numBits.toInt();\n if ((numBits &= 63) === 0)\n return this;\n else if (numBits < 32)\n return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned);\n else\n return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned);\n};\n\n/**\n * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shr = LongPrototype.shiftRight;\n\n/**\n * Returns this Long with bits logically shifted to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) {\n if (isLong(numBits)) numBits = numBits.toInt();\n if ((numBits &= 63) === 0) return this;\n if (numBits < 32) return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >>> numBits, this.unsigned);\n if (numBits === 32) return fromBits(this.high, 0, this.unsigned);\n return fromBits(this.high >>> (numBits - 32), 0, this.unsigned);\n};\n\n/**\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shru = LongPrototype.shiftRightUnsigned;\n\n/**\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shr_u = LongPrototype.shiftRightUnsigned;\n\n/**\n * Returns this Long with bits rotated to the left by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nLongPrototype.rotateLeft = function rotateLeft(numBits) {\n var b;\n if (isLong(numBits)) numBits = numBits.toInt();\n if ((numBits &= 63) === 0) return this;\n if (numBits === 32) return fromBits(this.high, this.low, this.unsigned);\n if (numBits < 32) {\n b = (32 - numBits);\n return fromBits(((this.low << numBits) | (this.high >>> b)), ((this.high << numBits) | (this.low >>> b)), this.unsigned);\n }\n numBits -= 32;\n b = (32 - numBits);\n return fromBits(((this.high << numBits) | (this.low >>> b)), ((this.low << numBits) | (this.high >>> b)), this.unsigned);\n}\n/**\n * Returns this Long with bits rotated to the left by the given amount. This is an alias of {@link Long#rotateLeft}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nLongPrototype.rotl = LongPrototype.rotateLeft;\n\n/**\n * Returns this Long with bits rotated to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nLongPrototype.rotateRight = function rotateRight(numBits) {\n var b;\n if (isLong(numBits)) numBits = numBits.toInt();\n if ((numBits &= 63) === 0) return this;\n if (numBits === 32) return fromBits(this.high, this.low, this.unsigned);\n if (numBits < 32) {\n b = (32 - numBits);\n return fromBits(((this.high << b) | (this.low >>> numBits)), ((this.low << b) | (this.high >>> numBits)), this.unsigned);\n }\n numBits -= 32;\n b = (32 - numBits);\n return fromBits(((this.low << b) | (this.high >>> numBits)), ((this.high << b) | (this.low >>> numBits)), this.unsigned);\n}\n/**\n * Returns this Long with bits rotated to the right by the given amount. This is an alias of {@link Long#rotateRight}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nLongPrototype.rotr = LongPrototype.rotateRight;\n\n/**\n * Converts this Long to signed.\n * @this {!Long}\n * @returns {!Long} Signed long\n */\nLongPrototype.toSigned = function toSigned() {\n if (!this.unsigned)\n return this;\n return fromBits(this.low, this.high, false);\n};\n\n/**\n * Converts this Long to unsigned.\n * @this {!Long}\n * @returns {!Long} Unsigned long\n */\nLongPrototype.toUnsigned = function toUnsigned() {\n if (this.unsigned)\n return this;\n return fromBits(this.low, this.high, true);\n};\n\n/**\n * Converts this Long to its byte representation.\n * @param {boolean=} le Whether little or big endian, defaults to big endian\n * @this {!Long}\n * @returns {!Array.} Byte representation\n */\nLongPrototype.toBytes = function toBytes(le) {\n return le ? this.toBytesLE() : this.toBytesBE();\n};\n\n/**\n * Converts this Long to its little endian byte representation.\n * @this {!Long}\n * @returns {!Array.} Little endian byte representation\n */\nLongPrototype.toBytesLE = function toBytesLE() {\n var hi = this.high,\n lo = this.low;\n return [\n lo & 0xff,\n lo >>> 8 & 0xff,\n lo >>> 16 & 0xff,\n lo >>> 24,\n hi & 0xff,\n hi >>> 8 & 0xff,\n hi >>> 16 & 0xff,\n hi >>> 24\n ];\n};\n\n/**\n * Converts this Long to its big endian byte representation.\n * @this {!Long}\n * @returns {!Array.} Big endian byte representation\n */\nLongPrototype.toBytesBE = function toBytesBE() {\n var hi = this.high,\n lo = this.low;\n return [\n hi >>> 24,\n hi >>> 16 & 0xff,\n hi >>> 8 & 0xff,\n hi & 0xff,\n lo >>> 24,\n lo >>> 16 & 0xff,\n lo >>> 8 & 0xff,\n lo & 0xff\n ];\n};\n\n/**\n * Creates a Long from its byte representation.\n * @param {!Array.} bytes Byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @param {boolean=} le Whether little or big endian, defaults to big endian\n * @returns {Long} The corresponding Long value\n */\nLong.fromBytes = function fromBytes(bytes, unsigned, le) {\n return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned);\n};\n\n/**\n * Creates a Long from its little endian byte representation.\n * @param {!Array.} bytes Little endian byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {Long} The corresponding Long value\n */\nLong.fromBytesLE = function fromBytesLE(bytes, unsigned) {\n return new Long(\n bytes[0] |\n bytes[1] << 8 |\n bytes[2] << 16 |\n bytes[3] << 24,\n bytes[4] |\n bytes[5] << 8 |\n bytes[6] << 16 |\n bytes[7] << 24,\n unsigned\n );\n};\n\n/**\n * Creates a Long from its big endian byte representation.\n * @param {!Array.} bytes Big endian byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {Long} The corresponding Long value\n */\nLong.fromBytesBE = function fromBytesBE(bytes, unsigned) {\n return new Long(\n bytes[4] << 24 |\n bytes[5] << 16 |\n bytes[6] << 8 |\n bytes[7],\n bytes[0] << 24 |\n bytes[1] << 16 |\n bytes[2] << 8 |\n bytes[3],\n unsigned\n );\n};\n\nexport default Long;\n","\"use strict\";\r\nmodule.exports = asPromise;\r\n\r\n/**\r\n * Callback as used by {@link util.asPromise}.\r\n * @typedef asPromiseCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {...*} params Additional arguments\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Returns a promise from a node-style callback function.\r\n * @memberof util\r\n * @param {asPromiseCallback} fn Function to call\r\n * @param {*} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0,\r\n index = 2,\r\n pending = true;\r\n while (index < arguments.length)\r\n params[offset++] = arguments[index++];\r\n return new Promise(function executor(resolve, reject) {\r\n params[offset] = function callback(err/*, varargs */) {\r\n if (pending) {\r\n pending = false;\r\n if (err)\r\n reject(err);\r\n else {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0;\r\n while (offset < params.length)\r\n params[offset++] = arguments[offset];\r\n resolve.apply(null, params);\r\n }\r\n }\r\n };\r\n try {\r\n fn.apply(ctx || null, params);\r\n } catch (err) {\r\n if (pending) {\r\n pending = false;\r\n reject(err);\r\n }\r\n }\r\n });\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal base64 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar base64 = exports;\r\n\r\n/**\r\n * Calculates the byte length of a base64 encoded string.\r\n * @param {string} string Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nbase64.length = function length(string) {\r\n var p = string.length;\r\n if (!p)\r\n return 0;\r\n var n = 0;\r\n while (--p % 4 > 1 && string.charAt(p) === \"=\")\r\n ++n;\r\n return Math.ceil(string.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = new Array(64);\r\n\r\n// Base64 decoding table\r\nvar s64 = new Array(123);\r\n\r\n// 65..90, 97..122, 48..57, 43, 47\r\nfor (var i = 0; i < 64;)\r\n s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nbase64.encode = function encode(buffer, start, end) {\r\n var parts = null,\r\n chunk = [];\r\n var i = 0, // output index\r\n j = 0, // goto index\r\n t; // temporary\r\n while (start < end) {\r\n var b = buffer[start++];\r\n switch (j) {\r\n case 0:\r\n chunk[i++] = b64[b >> 2];\r\n t = (b & 3) << 4;\r\n j = 1;\r\n break;\r\n case 1:\r\n chunk[i++] = b64[t | b >> 4];\r\n t = (b & 15) << 2;\r\n j = 2;\r\n break;\r\n case 2:\r\n chunk[i++] = b64[t | b >> 6];\r\n chunk[i++] = b64[b & 63];\r\n j = 0;\r\n break;\r\n }\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (j) {\r\n chunk[i++] = b64[t];\r\n chunk[i++] = 61;\r\n if (j === 1)\r\n chunk[i++] = 61;\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nbase64.decode = function decode(string, buffer, offset) {\r\n var start = offset;\r\n var j = 0, // goto index\r\n t; // temporary\r\n for (var i = 0; i < string.length;) {\r\n var c = string.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error(invalidEncoding);\r\n switch (j) {\r\n case 0:\r\n t = c;\r\n j = 1;\r\n break;\r\n case 1:\r\n buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n case 2:\r\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n case 3:\r\n buffer[offset++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j === 1)\r\n throw Error(invalidEncoding);\r\n return offset - start;\r\n};\r\n\r\n/**\r\n * Tests if the specified string appears to be base64 encoded.\r\n * @param {string} string String to test\r\n * @returns {boolean} `true` if probably base64 encoded, otherwise false\r\n */\r\nbase64.test = function test(string) {\r\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\r\n};\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {*} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener or any matching listeners if arguments are omitted.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = [],\r\n i = 1;\r\n for (; i < arguments.length;)\r\n args.push(arguments[i++]);\r\n for (i = 0; i < listeners.length;)\r\n listeners[i].fn.apply(listeners[i++].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = factory(factory);\r\n\r\n/**\r\n * Reads / writes floats / doubles from / to buffers.\r\n * @name util.float\r\n * @namespace\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using little endian byte order.\r\n * @name util.float.writeFloatLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using big endian byte order.\r\n * @name util.float.writeFloatBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using little endian byte order.\r\n * @name util.float.readFloatLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using big endian byte order.\r\n * @name util.float.readFloatBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using little endian byte order.\r\n * @name util.float.writeDoubleLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using big endian byte order.\r\n * @name util.float.writeDoubleBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using little endian byte order.\r\n * @name util.float.readDoubleLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using big endian byte order.\r\n * @name util.float.readDoubleBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n// Factory function for the purpose of node-based testing in modified global environments\r\nfunction factory(exports) {\r\n\r\n // float: typed array\r\n if (typeof Float32Array !== \"undefined\") (function() {\r\n\r\n var f32 = new Float32Array([ -0 ]),\r\n f8b = new Uint8Array(f32.buffer),\r\n le = f8b[3] === 128;\r\n\r\n function writeFloat_f32_cpy(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n }\r\n\r\n function writeFloat_f32_rev(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[3];\r\n buf[pos + 1] = f8b[2];\r\n buf[pos + 2] = f8b[1];\r\n buf[pos + 3] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\r\n\r\n function readFloat_f32_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n function readFloat_f32_rev(buf, pos) {\r\n f8b[3] = buf[pos ];\r\n f8b[2] = buf[pos + 1];\r\n f8b[1] = buf[pos + 2];\r\n f8b[0] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\r\n\r\n // float: ieee754\r\n })(); else (function() {\r\n\r\n function writeFloat_ieee754(writeUint, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0)\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\r\n else if (isNaN(val))\r\n writeUint(2143289344, buf, pos);\r\n else if (val > 3.4028234663852886e+38) // +-Infinity\r\n writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\r\n else if (val < 1.1754943508222875e-38) // denormal\r\n writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\r\n else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2),\r\n mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\r\n writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\r\n }\r\n }\r\n\r\n exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\r\n exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\r\n\r\n function readFloat_ieee754(readUint, buf, pos) {\r\n var uint = readUint(buf, pos),\r\n sign = (uint >> 31) * 2 + 1,\r\n exponent = uint >>> 23 & 255,\r\n mantissa = uint & 8388607;\r\n return exponent === 255\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 1.401298464324817e-45 * mantissa\r\n : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\r\n }\r\n\r\n exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\r\n exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\r\n\r\n })();\r\n\r\n // double: typed array\r\n if (typeof Float64Array !== \"undefined\") (function() {\r\n\r\n var f64 = new Float64Array([-0]),\r\n f8b = new Uint8Array(f64.buffer),\r\n le = f8b[7] === 128;\r\n\r\n function writeDouble_f64_cpy(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n buf[pos + 4] = f8b[4];\r\n buf[pos + 5] = f8b[5];\r\n buf[pos + 6] = f8b[6];\r\n buf[pos + 7] = f8b[7];\r\n }\r\n\r\n function writeDouble_f64_rev(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[7];\r\n buf[pos + 1] = f8b[6];\r\n buf[pos + 2] = f8b[5];\r\n buf[pos + 3] = f8b[4];\r\n buf[pos + 4] = f8b[3];\r\n buf[pos + 5] = f8b[2];\r\n buf[pos + 6] = f8b[1];\r\n buf[pos + 7] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\r\n\r\n function readDouble_f64_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n f8b[4] = buf[pos + 4];\r\n f8b[5] = buf[pos + 5];\r\n f8b[6] = buf[pos + 6];\r\n f8b[7] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n function readDouble_f64_rev(buf, pos) {\r\n f8b[7] = buf[pos ];\r\n f8b[6] = buf[pos + 1];\r\n f8b[5] = buf[pos + 2];\r\n f8b[4] = buf[pos + 3];\r\n f8b[3] = buf[pos + 4];\r\n f8b[2] = buf[pos + 5];\r\n f8b[1] = buf[pos + 6];\r\n f8b[0] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\r\n\r\n // double: ieee754\r\n })(); else (function() {\r\n\r\n function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\r\n } else if (isNaN(val)) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(2146959360, buf, pos + off1);\r\n } else if (val > 1.7976931348623157e+308) { // +-Infinity\r\n writeUint(0, buf, pos + off0);\r\n writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\r\n } else {\r\n var mantissa;\r\n if (val < 2.2250738585072014e-308) { // denormal\r\n mantissa = val / 5e-324;\r\n writeUint(mantissa >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\r\n } else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2);\r\n if (exponent === 1024)\r\n exponent = 1023;\r\n mantissa = val * Math.pow(2, -exponent);\r\n writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\r\n }\r\n }\r\n }\r\n\r\n exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\r\n exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\r\n\r\n function readDouble_ieee754(readUint, off0, off1, buf, pos) {\r\n var lo = readUint(buf, pos + off0),\r\n hi = readUint(buf, pos + off1);\r\n var sign = (hi >> 31) * 2 + 1,\r\n exponent = hi >>> 20 & 2047,\r\n mantissa = 4294967296 * (hi & 1048575) + lo;\r\n return exponent === 2047\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 5e-324 * mantissa\r\n : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\r\n }\r\n\r\n exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\r\n exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\r\n\r\n })();\r\n\r\n return exports;\r\n}\r\n\r\n// uint helpers\r\n\r\nfunction writeUintLE(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\nfunction writeUintBE(val, buf, pos) {\r\n buf[pos ] = val >>> 24;\r\n buf[pos + 1] = val >>> 16 & 255;\r\n buf[pos + 2] = val >>> 8 & 255;\r\n buf[pos + 3] = val & 255;\r\n}\r\n\r\nfunction readUintLE(buf, pos) {\r\n return (buf[pos ]\r\n | buf[pos + 1] << 8\r\n | buf[pos + 2] << 16\r\n | buf[pos + 3] << 24) >>> 0;\r\n}\r\n\r\nfunction readUintBE(buf, pos) {\r\n return (buf[pos ] << 24\r\n | buf[pos + 1] << 16\r\n | buf[pos + 2] << 8\r\n | buf[pos + 3]) >>> 0;\r\n}\r\n","\"use strict\";\r\nmodule.exports = inquire;\r\n\r\n/**\r\n * Requires a module only if available.\r\n * @memberof util\r\n * @param {string} moduleName Module to require\r\n * @returns {?Object} Required module if available and not empty, otherwise `null`\r\n */\r\nfunction inquire(moduleName) {\r\n try {\r\n var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval\r\n if (mod && (mod.length || Object.keys(mod).length))\r\n return mod;\r\n } catch (e) {} // eslint-disable-line no-empty\r\n return null;\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} string String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function utf8_length(string) {\r\n var len = 0,\r\n c = 0;\r\n for (var i = 0; i < string.length; ++i) {\r\n c = string.charCodeAt(i);\r\n if (c < 128)\r\n len += 1;\r\n else if (c < 2048)\r\n len += 2;\r\n else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} String read\r\n */\r\nutf8.read = function utf8_read(buffer, start, end) {\r\n var len = end - start;\r\n if (len < 1)\r\n return \"\";\r\n var parts = null,\r\n chunk = [],\r\n i = 0, // char offset\r\n t; // temporary\r\n while (start < end) {\r\n t = buffer[start++];\r\n if (t < 128)\r\n chunk[i++] = t;\r\n else if (t > 191 && t < 224)\r\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n chunk[i++] = 0xD800 + (t >> 10);\r\n chunk[i++] = 0xDC00 + (t & 1023);\r\n } else\r\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function utf8_write(string, buffer, offset) {\r\n var start = offset,\r\n c1, // character 1\r\n c2; // character 2\r\n for (var i = 0; i < string.length; ++i) {\r\n c1 = string.charCodeAt(i);\r\n if (c1 < 128) {\r\n buffer[offset++] = c1;\r\n } else if (c1 < 2048) {\r\n buffer[offset++] = c1 >> 6 | 192;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buffer[offset++] = c1 >> 18 | 240;\r\n buffer[offset++] = c1 >> 12 & 63 | 128;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else {\r\n buffer[offset++] = c1 >> 12 | 224;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n }\r\n }\r\n return offset - start;\r\n};\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * An allocator as used by {@link util.pool}.\r\n * @typedef PoolAllocator\r\n * @type {function}\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\n\r\n/**\r\n * A slicer as used by {@link util.pool}.\r\n * @typedef PoolSlicer\r\n * @type {function}\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {Uint8Array} Buffer slice\r\n * @this {Uint8Array}\r\n */\r\n\r\n/**\r\n * A general purpose buffer pool.\r\n * @memberof util\r\n * @function\r\n * @param {PoolAllocator} alloc Allocator\r\n * @param {PoolSlicer} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {PoolAllocator} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size < 1 || size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\nmodule.exports = LongBits;\n\nvar util = require(\"../util/minimal\");\n\n/**\n * Constructs new long bits.\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\n * @memberof util\n * @constructor\n * @param {number} lo Low 32 bits, unsigned\n * @param {number} hi High 32 bits, unsigned\n */\nfunction LongBits(lo, hi) {\n\n // note that the casts below are theoretically unnecessary as of today, but older statically\n // generated converter code might still call the ctor with signed 32bits. kept for compat.\n\n /**\n * Low bits.\n * @type {number}\n */\n this.lo = lo >>> 0;\n\n /**\n * High bits.\n * @type {number}\n */\n this.hi = hi >>> 0;\n}\n\n/**\n * Zero bits.\n * @memberof util.LongBits\n * @type {util.LongBits}\n */\nvar zero = LongBits.zero = new LongBits(0, 0);\n\nzero.toNumber = function() { return 0; };\nzero.zzEncode = zero.zzDecode = function() { return this; };\nzero.length = function() { return 1; };\n\n/**\n * Zero hash.\n * @memberof util.LongBits\n * @type {string}\n */\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\n\n/**\n * Constructs new long bits from the specified number.\n * @param {number} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.fromNumber = function fromNumber(value) {\n if (value === 0)\n return zero;\n var sign = value < 0;\n if (sign)\n value = -value;\n var lo = value >>> 0,\n hi = (value - lo) / 4294967296 >>> 0;\n if (sign) {\n hi = ~hi >>> 0;\n lo = ~lo >>> 0;\n if (++lo > 4294967295) {\n lo = 0;\n if (++hi > 4294967295)\n hi = 0;\n }\n }\n return new LongBits(lo, hi);\n};\n\n/**\n * Constructs new long bits from a number, long or string.\n * @param {Long|number|string} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.from = function from(value) {\n if (typeof value === \"number\")\n return LongBits.fromNumber(value);\n if (util.isString(value)) {\n /* istanbul ignore else */\n if (util.Long)\n value = util.Long.fromString(value);\n else\n return LongBits.fromNumber(parseInt(value, 10));\n }\n return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\n};\n\n/**\n * Converts this long bits to a possibly unsafe JavaScript number.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {number} Possibly unsafe number\n */\nLongBits.prototype.toNumber = function toNumber(unsigned) {\n if (!unsigned && this.hi >>> 31) {\n var lo = ~this.lo + 1 >>> 0,\n hi = ~this.hi >>> 0;\n if (!lo)\n hi = hi + 1 >>> 0;\n return -(lo + hi * 4294967296);\n }\n return this.lo + this.hi * 4294967296;\n};\n\n/**\n * Converts this long bits to a long.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long} Long\n */\nLongBits.prototype.toLong = function toLong(unsigned) {\n return util.Long\n ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\n /* istanbul ignore next */\n : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\n};\n\nvar charCodeAt = String.prototype.charCodeAt;\n\n/**\n * Constructs new long bits from the specified 8 characters long hash.\n * @param {string} hash Hash\n * @returns {util.LongBits} Bits\n */\nLongBits.fromHash = function fromHash(hash) {\n if (hash === zeroHash)\n return zero;\n return new LongBits(\n ( charCodeAt.call(hash, 0)\n | charCodeAt.call(hash, 1) << 8\n | charCodeAt.call(hash, 2) << 16\n | charCodeAt.call(hash, 3) << 24) >>> 0\n ,\n ( charCodeAt.call(hash, 4)\n | charCodeAt.call(hash, 5) << 8\n | charCodeAt.call(hash, 6) << 16\n | charCodeAt.call(hash, 7) << 24) >>> 0\n );\n};\n\n/**\n * Converts this long bits to a 8 characters long hash.\n * @returns {string} Hash\n */\nLongBits.prototype.toHash = function toHash() {\n return String.fromCharCode(\n this.lo & 255,\n this.lo >>> 8 & 255,\n this.lo >>> 16 & 255,\n this.lo >>> 24 ,\n this.hi & 255,\n this.hi >>> 8 & 255,\n this.hi >>> 16 & 255,\n this.hi >>> 24\n );\n};\n\n/**\n * Zig-zag encodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzEncode = function zzEncode() {\n var mask = this.hi >> 31;\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Zig-zag decodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzDecode = function zzDecode() {\n var mask = -(this.lo & 1);\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Calculates the length of this longbits when encoded as a varint.\n * @returns {number} Length\n */\nLongBits.prototype.length = function length() {\n var part0 = this.lo,\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\n part2 = this.hi >>> 24;\n return part2 === 0\n ? part1 === 0\n ? part0 < 16384\n ? part0 < 128 ? 1 : 2\n : part0 < 2097152 ? 3 : 4\n : part1 < 16384\n ? part1 < 128 ? 5 : 6\n : part1 < 2097152 ? 7 : 8\n : part2 < 128 ? 9 : 10;\n};\n","\"use strict\";\nvar util = exports;\n\n// used to return a Promise where callback is omitted\nutil.asPromise = require(\"@protobufjs/aspromise\");\n\n// converts to / from base64 encoded strings\nutil.base64 = require(\"@protobufjs/base64\");\n\n// base class of rpc.Service\nutil.EventEmitter = require(\"@protobufjs/eventemitter\");\n\n// float handling accross browsers\nutil.float = require(\"@protobufjs/float\");\n\n// requires modules optionally and hides the call from bundlers\nutil.inquire = require(\"@protobufjs/inquire\");\n\n// converts to / from utf8 encoded strings\nutil.utf8 = require(\"@protobufjs/utf8\");\n\n// provides a node-like buffer pool in the browser\nutil.pool = require(\"@protobufjs/pool\");\n\n// utility to work with the low and high bits of a 64 bit value\nutil.LongBits = require(\"./longbits\");\n\n/**\n * Whether running within node or not.\n * @memberof util\n * @type {boolean}\n */\nutil.isNode = Boolean(typeof global !== \"undefined\"\n && global\n && global.process\n && global.process.versions\n && global.process.versions.node);\n\n/**\n * Global object reference.\n * @memberof util\n * @type {Object}\n */\nutil.global = util.isNode && global\n || typeof window !== \"undefined\" && window\n || typeof self !== \"undefined\" && self\n || this; // eslint-disable-line no-invalid-this\n\n/**\n * An immuable empty array.\n * @memberof util\n * @type {Array.<*>}\n * @const\n */\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\n\n/**\n * An immutable empty object.\n * @type {Object}\n * @const\n */\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\n\n/**\n * Tests if the specified value is an integer.\n * @function\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is an integer\n */\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\n};\n\n/**\n * Tests if the specified value is a string.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a string\n */\nutil.isString = function isString(value) {\n return typeof value === \"string\" || value instanceof String;\n};\n\n/**\n * Tests if the specified value is a non-null object.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a non-null object\n */\nutil.isObject = function isObject(value) {\n return value && typeof value === \"object\";\n};\n\n/**\n * Checks if a property on a message is considered to be present.\n * This is an alias of {@link util.isSet}.\n * @function\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isset =\n\n/**\n * Checks if a property on a message is considered to be present.\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isSet = function isSet(obj, prop) {\n var value = obj[prop];\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\n return false;\n};\n\n/**\n * Any compatible Buffer instance.\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\n * @interface Buffer\n * @extends Uint8Array\n */\n\n/**\n * Node's Buffer class if available.\n * @type {Constructor}\n */\nutil.Buffer = (function() {\n try {\n var Buffer = util.inquire(\"buffer\").Buffer;\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\n } catch (e) {\n /* istanbul ignore next */\n return null;\n }\n})();\n\n// Internal alias of or polyfull for Buffer.from.\nutil._Buffer_from = null;\n\n// Internal alias of or polyfill for Buffer.allocUnsafe.\nutil._Buffer_allocUnsafe = null;\n\n/**\n * Creates a new buffer of whatever type supported by the environment.\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\n * @returns {Uint8Array|Buffer} Buffer\n */\nutil.newBuffer = function newBuffer(sizeOrArray) {\n /* istanbul ignore next */\n return typeof sizeOrArray === \"number\"\n ? util.Buffer\n ? util._Buffer_allocUnsafe(sizeOrArray)\n : new util.Array(sizeOrArray)\n : util.Buffer\n ? util._Buffer_from(sizeOrArray)\n : typeof Uint8Array === \"undefined\"\n ? sizeOrArray\n : new Uint8Array(sizeOrArray);\n};\n\n/**\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\n * @type {Constructor}\n */\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\n\n/**\n * Any compatible Long instance.\n * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js.\n * @interface Long\n * @property {number} low Low bits\n * @property {number} high High bits\n * @property {boolean} unsigned Whether unsigned or not\n */\n\n/**\n * Long.js's Long class if available.\n * @type {Constructor}\n */\nutil.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\n || /* istanbul ignore next */ util.global.Long\n || util.inquire(\"long\");\n\n/**\n * Regular expression used to verify 2 bit (`bool`) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key2Re = /^true|false|0|1$/;\n\n/**\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\n\n/**\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\n\n/**\n * Converts a number or long to an 8 characters long hash string.\n * @param {Long|number} value Value to convert\n * @returns {string} Hash\n */\nutil.longToHash = function longToHash(value) {\n return value\n ? util.LongBits.from(value).toHash()\n : util.LongBits.zeroHash;\n};\n\n/**\n * Converts an 8 characters long hash string to a long or number.\n * @param {string} hash Hash\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long|number} Original value\n */\nutil.longFromHash = function longFromHash(hash, unsigned) {\n var bits = util.LongBits.fromHash(hash);\n if (util.Long)\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\n return bits.toNumber(Boolean(unsigned));\n};\n\n/**\n * Merges the properties of the source object into the destination object.\n * @memberof util\n * @param {Object.} dst Destination object\n * @param {Object.} src Source object\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\n * @returns {Object.} Destination object\n */\nfunction merge(dst, src, ifNotSet) { // used by converters\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\n if (dst[keys[i]] === undefined || !ifNotSet)\n dst[keys[i]] = src[keys[i]];\n return dst;\n}\n\nutil.merge = merge;\n\n/**\n * Converts the first character of a string to lower case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.lcFirst = function lcFirst(str) {\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\n/**\n * Creates a custom error constructor.\n * @memberof util\n * @param {string} name Error name\n * @returns {Constructor} Custom error constructor\n */\nfunction newError(name) {\n\n function CustomError(message, properties) {\n\n if (!(this instanceof CustomError))\n return new CustomError(message, properties);\n\n // Error.call(this, message);\n // ^ just returns a new error instance because the ctor can be called as a function\n\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\n\n /* istanbul ignore next */\n if (Error.captureStackTrace) // node\n Error.captureStackTrace(this, CustomError);\n else\n Object.defineProperty(this, \"stack\", { value: new Error().stack || \"\" });\n\n if (properties)\n merge(this, properties);\n }\n\n CustomError.prototype = Object.create(Error.prototype, {\n constructor: {\n value: CustomError,\n writable: true,\n enumerable: false,\n configurable: true,\n },\n name: {\n get: function get() { return name; },\n set: undefined,\n enumerable: false,\n // configurable: false would accurately preserve the behavior of\n // the original, but I'm guessing that was not intentional.\n // For an actual error subclass, this property would\n // be configurable.\n configurable: true,\n },\n toString: {\n value: function value() { return this.name + \": \" + this.message; },\n writable: true,\n enumerable: false,\n configurable: true,\n },\n });\n\n return CustomError;\n}\n\nutil.newError = newError;\n\n/**\n * Constructs a new protocol error.\n * @classdesc Error subclass indicating a protocol specifc error.\n * @memberof util\n * @extends Error\n * @template T extends Message\n * @constructor\n * @param {string} message Error message\n * @param {Object.} [properties] Additional properties\n * @example\n * try {\n * MyMessage.decode(someBuffer); // throws if required fields are missing\n * } catch (e) {\n * if (e instanceof ProtocolError && e.instance)\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\n * }\n */\nutil.ProtocolError = newError(\"ProtocolError\");\n\n/**\n * So far decoded message instance.\n * @name util.ProtocolError#instance\n * @type {Message}\n */\n\n/**\n * A OneOf getter as returned by {@link util.oneOfGetter}.\n * @typedef OneOfGetter\n * @type {function}\n * @returns {string|undefined} Set field name, if any\n */\n\n/**\n * Builds a getter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfGetter} Unbound getter\n */\nutil.oneOfGetter = function getOneOf(fieldNames) {\n var fieldMap = {};\n for (var i = 0; i < fieldNames.length; ++i)\n fieldMap[fieldNames[i]] = 1;\n\n /**\n * @returns {string|undefined} Set field name, if any\n * @this Object\n * @ignore\n */\n return function() { // eslint-disable-line consistent-return\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\n return keys[i];\n };\n};\n\n/**\n * A OneOf setter as returned by {@link util.oneOfSetter}.\n * @typedef OneOfSetter\n * @type {function}\n * @param {string|undefined} value Field name\n * @returns {undefined}\n */\n\n/**\n * Builds a setter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfSetter} Unbound setter\n */\nutil.oneOfSetter = function setOneOf(fieldNames) {\n\n /**\n * @param {string} name Field name\n * @returns {undefined}\n * @this Object\n * @ignore\n */\n return function(name) {\n for (var i = 0; i < fieldNames.length; ++i)\n if (fieldNames[i] !== name)\n delete this[fieldNames[i]];\n };\n};\n\n/**\n * Default conversion options used for {@link Message#toJSON} implementations.\n *\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\n *\n * - Longs become strings\n * - Enums become string keys\n * - Bytes become base64 encoded strings\n * - (Sub-)Messages become plain objects\n * - Maps become plain objects with all string keys\n * - Repeated fields become arrays\n * - NaN and Infinity for float and double fields become strings\n *\n * @type {IConversionOptions}\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\n */\nutil.toJSONOptions = {\n longs: String,\n enums: String,\n bytes: String,\n json: true\n};\n\n// Sets up buffer utility according to the environment (called in index-minimal)\nutil._configure = function() {\n var Buffer = util.Buffer;\n /* istanbul ignore if */\n if (!Buffer) {\n util._Buffer_from = util._Buffer_allocUnsafe = null;\n return;\n }\n // because node 4.x buffers are incompatible & immutable\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\n /* istanbul ignore next */\n function Buffer_from(value, encoding) {\n return new Buffer(value, encoding);\n };\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\n /* istanbul ignore next */\n function Buffer_allocUnsafe(size) {\n return new Buffer(size);\n };\n};\n","\"use strict\";\nmodule.exports = Writer;\n\nvar util = require(\"./util/minimal\");\n\nvar BufferWriter; // cyclic\n\nvar LongBits = util.LongBits,\n base64 = util.base64,\n utf8 = util.utf8;\n\n/**\n * Constructs a new writer operation instance.\n * @classdesc Scheduled writer operation.\n * @constructor\n * @param {function(*, Uint8Array, number)} fn Function to call\n * @param {number} len Value byte length\n * @param {*} val Value to write\n * @ignore\n */\nfunction Op(fn, len, val) {\n\n /**\n * Function to call.\n * @type {function(Uint8Array, number, *)}\n */\n this.fn = fn;\n\n /**\n * Value byte length.\n * @type {number}\n */\n this.len = len;\n\n /**\n * Next operation.\n * @type {Writer.Op|undefined}\n */\n this.next = undefined;\n\n /**\n * Value to write.\n * @type {*}\n */\n this.val = val; // type varies\n}\n\n/* istanbul ignore next */\nfunction noop() {} // eslint-disable-line no-empty-function\n\n/**\n * Constructs a new writer state instance.\n * @classdesc Copied writer state.\n * @memberof Writer\n * @constructor\n * @param {Writer} writer Writer to copy state from\n * @ignore\n */\nfunction State(writer) {\n\n /**\n * Current head.\n * @type {Writer.Op}\n */\n this.head = writer.head;\n\n /**\n * Current tail.\n * @type {Writer.Op}\n */\n this.tail = writer.tail;\n\n /**\n * Current buffer length.\n * @type {number}\n */\n this.len = writer.len;\n\n /**\n * Next state.\n * @type {State|null}\n */\n this.next = writer.states;\n}\n\n/**\n * Constructs a new writer instance.\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n */\nfunction Writer() {\n\n /**\n * Current length.\n * @type {number}\n */\n this.len = 0;\n\n /**\n * Operations head.\n * @type {Object}\n */\n this.head = new Op(noop, 0, 0);\n\n /**\n * Operations tail\n * @type {Object}\n */\n this.tail = this.head;\n\n /**\n * Linked forked states.\n * @type {Object|null}\n */\n this.states = null;\n\n // When a value is written, the writer calculates its byte length and puts it into a linked\n // list of operations to perform when finish() is called. This both allows us to allocate\n // buffers of the exact required size and reduces the amount of work we have to do compared\n // to first calculating over objects and then encoding over objects. In our case, the encoding\n // part is just a linked list walk calling operations with already prepared values.\n}\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup() {\n return (Writer.create = function create_buffer() {\n return new BufferWriter();\n })();\n }\n /* istanbul ignore next */\n : function create_array() {\n return new Writer();\n };\n};\n\n/**\n * Creates a new writer.\n * @function\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\n */\nWriter.create = create();\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Uint8Array} Buffer\n */\nWriter.alloc = function alloc(size) {\n return new util.Array(size);\n};\n\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\n/* istanbul ignore else */\nif (util.Array !== Array)\n Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\n\n/**\n * Pushes a new operation to the queue.\n * @param {function(Uint8Array, number, *)} fn Function to call\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @returns {Writer} `this`\n * @private\n */\nWriter.prototype._push = function push(fn, len, val) {\n this.tail = this.tail.next = new Op(fn, len, val);\n this.len += len;\n return this;\n};\n\nfunction writeByte(val, buf, pos) {\n buf[pos] = val & 255;\n}\n\nfunction writeVarint32(val, buf, pos) {\n while (val > 127) {\n buf[pos++] = val & 127 | 128;\n val >>>= 7;\n }\n buf[pos] = val;\n}\n\n/**\n * Constructs a new varint writer operation instance.\n * @classdesc Scheduled varint writer operation.\n * @extends Op\n * @constructor\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @ignore\n */\nfunction VarintOp(len, val) {\n this.len = len;\n this.next = undefined;\n this.val = val;\n}\n\nVarintOp.prototype = Object.create(Op.prototype);\nVarintOp.prototype.fn = writeVarint32;\n\n/**\n * Writes an unsigned 32 bit value as a varint.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.uint32 = function write_uint32(value) {\n // here, the call to this.push has been inlined and a varint specific Op subclass is used.\n // uint32 is by far the most frequently used operation and benefits significantly from this.\n this.len += (this.tail = this.tail.next = new VarintOp(\n (value = value >>> 0)\n < 128 ? 1\n : value < 16384 ? 2\n : value < 2097152 ? 3\n : value < 268435456 ? 4\n : 5,\n value)).len;\n return this;\n};\n\n/**\n * Writes a signed 32 bit value as a varint.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.int32 = function write_int32(value) {\n return value < 0\n ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\n : this.uint32(value);\n};\n\n/**\n * Writes a 32 bit value as a varint, zig-zag encoded.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sint32 = function write_sint32(value) {\n return this.uint32((value << 1 ^ value >> 31) >>> 0);\n};\n\nfunction writeVarint64(val, buf, pos) {\n while (val.hi) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\n val.hi >>>= 7;\n }\n while (val.lo > 127) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = val.lo >>> 7;\n }\n buf[pos++] = val.lo;\n}\n\n/**\n * Writes an unsigned 64 bit value as a varint.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.uint64 = function write_uint64(value) {\n var bits = LongBits.from(value);\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a signed 64 bit value as a varint.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.int64 = Writer.prototype.uint64;\n\n/**\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sint64 = function write_sint64(value) {\n var bits = LongBits.from(value).zzEncode();\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a boolish value as a varint.\n * @param {boolean} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bool = function write_bool(value) {\n return this._push(writeByte, 1, value ? 1 : 0);\n};\n\nfunction writeFixed32(val, buf, pos) {\n buf[pos ] = val & 255;\n buf[pos + 1] = val >>> 8 & 255;\n buf[pos + 2] = val >>> 16 & 255;\n buf[pos + 3] = val >>> 24;\n}\n\n/**\n * Writes an unsigned 32 bit value as fixed 32 bits.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.fixed32 = function write_fixed32(value) {\n return this._push(writeFixed32, 4, value >>> 0);\n};\n\n/**\n * Writes a signed 32 bit value as fixed 32 bits.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\n\n/**\n * Writes an unsigned 64 bit value as fixed 64 bits.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.fixed64 = function write_fixed64(value) {\n var bits = LongBits.from(value);\n return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\n};\n\n/**\n * Writes a signed 64 bit value as fixed 64 bits.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\n\n/**\n * Writes a float (32 bit).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.float = function write_float(value) {\n return this._push(util.float.writeFloatLE, 4, value);\n};\n\n/**\n * Writes a double (64 bit float).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.double = function write_double(value) {\n return this._push(util.float.writeDoubleLE, 8, value);\n};\n\nvar writeBytes = util.Array.prototype.set\n ? function writeBytes_set(val, buf, pos) {\n buf.set(val, pos); // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytes_for(val, buf, pos) {\n for (var i = 0; i < val.length; ++i)\n buf[pos + i] = val[i];\n };\n\n/**\n * Writes a sequence of bytes.\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bytes = function write_bytes(value) {\n var len = value.length >>> 0;\n if (!len)\n return this._push(writeByte, 1, 0);\n if (util.isString(value)) {\n var buf = Writer.alloc(len = base64.length(value));\n base64.decode(value, buf, 0);\n value = buf;\n }\n return this.uint32(len)._push(writeBytes, len, value);\n};\n\n/**\n * Writes a string.\n * @param {string} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.string = function write_string(value) {\n var len = utf8.length(value);\n return len\n ? this.uint32(len)._push(utf8.write, len, value)\n : this._push(writeByte, 1, 0);\n};\n\n/**\n * Forks this writer's state by pushing it to a stack.\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\n * @returns {Writer} `this`\n */\nWriter.prototype.fork = function fork() {\n this.states = new State(this);\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n return this;\n};\n\n/**\n * Resets this instance to the last state.\n * @returns {Writer} `this`\n */\nWriter.prototype.reset = function reset() {\n if (this.states) {\n this.head = this.states.head;\n this.tail = this.states.tail;\n this.len = this.states.len;\n this.states = this.states.next;\n } else {\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n }\n return this;\n};\n\n/**\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\n * @returns {Writer} `this`\n */\nWriter.prototype.ldelim = function ldelim() {\n var head = this.head,\n tail = this.tail,\n len = this.len;\n this.reset().uint32(len);\n if (len) {\n this.tail.next = head.next; // skip noop\n this.tail = tail;\n this.len += len;\n }\n return this;\n};\n\n/**\n * Finishes the write operation.\n * @returns {Uint8Array} Finished buffer\n */\nWriter.prototype.finish = function finish() {\n var head = this.head.next, // skip noop\n buf = this.constructor.alloc(this.len),\n pos = 0;\n while (head) {\n head.fn(head.val, buf, pos);\n pos += head.len;\n head = head.next;\n }\n // this.head = this.tail = null;\n return buf;\n};\n\nWriter._configure = function(BufferWriter_) {\n BufferWriter = BufferWriter_;\n Writer.create = create();\n BufferWriter._configure();\n};\n","\"use strict\";\nmodule.exports = BufferWriter;\n\n// extends Writer\nvar Writer = require(\"./writer\");\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\n\nvar util = require(\"./util/minimal\");\n\n/**\n * Constructs a new buffer writer instance.\n * @classdesc Wire format writer using node buffers.\n * @extends Writer\n * @constructor\n */\nfunction BufferWriter() {\n Writer.call(this);\n}\n\nBufferWriter._configure = function () {\n /**\n * Allocates a buffer of the specified size.\n * @function\n * @param {number} size Buffer size\n * @returns {Buffer} Buffer\n */\n BufferWriter.alloc = util._Buffer_allocUnsafe;\n\n BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === \"set\"\n ? function writeBytesBuffer_set(val, buf, pos) {\n buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\n // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytesBuffer_copy(val, buf, pos) {\n if (val.copy) // Buffer values\n val.copy(buf, pos, 0, val.length);\n else for (var i = 0; i < val.length;) // plain array values\n buf[pos++] = val[i++];\n };\n};\n\n\n/**\n * @override\n */\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\n if (util.isString(value))\n value = util._Buffer_from(value, \"base64\");\n var len = value.length >>> 0;\n this.uint32(len);\n if (len)\n this._push(BufferWriter.writeBytesBuffer, len, value);\n return this;\n};\n\nfunction writeStringBuffer(val, buf, pos) {\n if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\n util.utf8.write(val, buf, pos);\n else if (buf.utf8Write)\n buf.utf8Write(val, pos);\n else\n buf.write(val, pos);\n}\n\n/**\n * @override\n */\nBufferWriter.prototype.string = function write_string_buffer(value) {\n var len = util.Buffer.byteLength(value);\n this.uint32(len);\n if (len)\n this._push(writeStringBuffer, len, value);\n return this;\n};\n\n\n/**\n * Finishes the write operation.\n * @name BufferWriter#finish\n * @function\n * @returns {Buffer} Finished buffer\n */\n\nBufferWriter._configure();\n","\"use strict\";\nmodule.exports = Reader;\n\nvar util = require(\"./util/minimal\");\n\nvar BufferReader; // cyclic\n\nvar LongBits = util.LongBits,\n utf8 = util.utf8;\n\n/* istanbul ignore next */\nfunction indexOutOfRange(reader, writeLength) {\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\n}\n\n/**\n * Constructs a new reader instance using the specified buffer.\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n * @param {Uint8Array} buffer Buffer to read from\n */\nfunction Reader(buffer) {\n\n /**\n * Read buffer.\n * @type {Uint8Array}\n */\n this.buf = buffer;\n\n /**\n * Read buffer position.\n * @type {number}\n */\n this.pos = 0;\n\n /**\n * Read buffer length.\n * @type {number}\n */\n this.len = buffer.length;\n}\n\nvar create_array = typeof Uint8Array !== \"undefined\"\n ? function create_typed_array(buffer) {\n if (buffer instanceof Uint8Array || Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n }\n /* istanbul ignore next */\n : function create_array(buffer) {\n if (Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n };\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup(buffer) {\n return (Reader.create = function create_buffer(buffer) {\n return util.Buffer.isBuffer(buffer)\n ? new BufferReader(buffer)\n /* istanbul ignore next */\n : create_array(buffer);\n })(buffer);\n }\n /* istanbul ignore next */\n : create_array;\n};\n\n/**\n * Creates a new reader using the specified buffer.\n * @function\n * @param {Uint8Array|Buffer} buffer Buffer to read from\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\n * @throws {Error} If `buffer` is not a valid buffer\n */\nReader.create = create();\n\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\n\n/**\n * Reads a varint as an unsigned 32 bit value.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.uint32 = (function read_uint32_setup() {\n var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\n return function read_uint32() {\n value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\n\n /* istanbul ignore if */\n if ((this.pos += 5) > this.len) {\n this.pos = this.len;\n throw indexOutOfRange(this, 10);\n }\n return value;\n };\n})();\n\n/**\n * Reads a varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.int32 = function read_int32() {\n return this.uint32() | 0;\n};\n\n/**\n * Reads a zig-zag encoded varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.sint32 = function read_sint32() {\n var value = this.uint32();\n return value >>> 1 ^ -(value & 1) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readLongVarint() {\n // tends to deopt with local vars for octet etc.\n var bits = new LongBits(0, 0);\n var i = 0;\n if (this.len - this.pos > 4) { // fast route (lo)\n for (; i < 4; ++i) {\n // 1st..4th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 5th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n i = 0;\n } else {\n for (; i < 3; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 1st..3th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 4th\n bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\n return bits;\n }\n if (this.len - this.pos > 4) { // fast route (hi)\n for (; i < 5; ++i) {\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n } else {\n for (; i < 5; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n }\n /* istanbul ignore next */\n throw Error(\"invalid varint encoding\");\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads a varint as a signed 64 bit value.\n * @name Reader#int64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as an unsigned 64 bit value.\n * @name Reader#uint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a zig-zag encoded varint as a signed 64 bit value.\n * @name Reader#sint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as a boolean.\n * @returns {boolean} Value read\n */\nReader.prototype.bool = function read_bool() {\n return this.uint32() !== 0;\n};\n\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\n return (buf[end - 4]\n | buf[end - 3] << 8\n | buf[end - 2] << 16\n | buf[end - 1] << 24) >>> 0;\n}\n\n/**\n * Reads fixed 32 bits as an unsigned 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.fixed32 = function read_fixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4);\n};\n\n/**\n * Reads fixed 32 bits as a signed 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.sfixed32 = function read_sfixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readFixed64(/* this: Reader */) {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 8);\n\n return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads fixed 64 bits.\n * @name Reader#fixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads zig-zag encoded fixed 64 bits.\n * @name Reader#sfixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a float (32 bit) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.float = function read_float() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readFloatLE(this.buf, this.pos);\n this.pos += 4;\n return value;\n};\n\n/**\n * Reads a double (64 bit float) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.double = function read_double() {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readDoubleLE(this.buf, this.pos);\n this.pos += 8;\n return value;\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @returns {Uint8Array} Value read\n */\nReader.prototype.bytes = function read_bytes() {\n var length = this.uint32(),\n start = this.pos,\n end = this.pos + length;\n\n /* istanbul ignore if */\n if (end > this.len)\n throw indexOutOfRange(this, length);\n\n this.pos += length;\n if (Array.isArray(this.buf)) // plain array\n return this.buf.slice(start, end);\n\n if (start === end) { // fix for IE 10/Win8 and others' subarray returning array of size 1\n var nativeBuffer = util.Buffer;\n return nativeBuffer\n ? nativeBuffer.alloc(0)\n : new this.buf.constructor(0);\n }\n return this._slice.call(this.buf, start, end);\n};\n\n/**\n * Reads a string preceeded by its byte length as a varint.\n * @returns {string} Value read\n */\nReader.prototype.string = function read_string() {\n var bytes = this.bytes();\n return utf8.read(bytes, 0, bytes.length);\n};\n\n/**\n * Skips the specified number of bytes if specified, otherwise skips a varint.\n * @param {number} [length] Length if known, otherwise a varint is assumed\n * @returns {Reader} `this`\n */\nReader.prototype.skip = function skip(length) {\n if (typeof length === \"number\") {\n /* istanbul ignore if */\n if (this.pos + length > this.len)\n throw indexOutOfRange(this, length);\n this.pos += length;\n } else {\n do {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n } while (this.buf[this.pos++] & 128);\n }\n return this;\n};\n\n/**\n * Skips the next element of the specified wire type.\n * @param {number} wireType Wire type received\n * @returns {Reader} `this`\n */\nReader.prototype.skipType = function(wireType) {\n switch (wireType) {\n case 0:\n this.skip();\n break;\n case 1:\n this.skip(8);\n break;\n case 2:\n this.skip(this.uint32());\n break;\n case 3:\n while ((wireType = this.uint32() & 7) !== 4) {\n this.skipType(wireType);\n }\n break;\n case 5:\n this.skip(4);\n break;\n\n /* istanbul ignore next */\n default:\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\n }\n return this;\n};\n\nReader._configure = function(BufferReader_) {\n BufferReader = BufferReader_;\n Reader.create = create();\n BufferReader._configure();\n\n var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\n util.merge(Reader.prototype, {\n\n int64: function read_int64() {\n return readLongVarint.call(this)[fn](false);\n },\n\n uint64: function read_uint64() {\n return readLongVarint.call(this)[fn](true);\n },\n\n sint64: function read_sint64() {\n return readLongVarint.call(this).zzDecode()[fn](false);\n },\n\n fixed64: function read_fixed64() {\n return readFixed64.call(this)[fn](true);\n },\n\n sfixed64: function read_sfixed64() {\n return readFixed64.call(this)[fn](false);\n }\n\n });\n};\n","\"use strict\";\nmodule.exports = BufferReader;\n\n// extends Reader\nvar Reader = require(\"./reader\");\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\n\nvar util = require(\"./util/minimal\");\n\n/**\n * Constructs a new buffer reader instance.\n * @classdesc Wire format reader using node buffers.\n * @extends Reader\n * @constructor\n * @param {Buffer} buffer Buffer to read from\n */\nfunction BufferReader(buffer) {\n Reader.call(this, buffer);\n\n /**\n * Read buffer.\n * @name BufferReader#buf\n * @type {Buffer}\n */\n}\n\nBufferReader._configure = function () {\n /* istanbul ignore else */\n if (util.Buffer)\n BufferReader.prototype._slice = util.Buffer.prototype.slice;\n};\n\n\n/**\n * @override\n */\nBufferReader.prototype.string = function read_string_buffer() {\n var len = this.uint32(); // modifies pos\n return this.buf.utf8Slice\n ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len))\n : this.buf.toString(\"utf-8\", this.pos, this.pos = Math.min(this.pos + len, this.len));\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @name BufferReader#bytes\n * @function\n * @returns {Buffer} Value read\n */\n\nBufferReader._configure();\n","\"use strict\";\nmodule.exports = Service;\n\nvar util = require(\"../util/minimal\");\n\n// Extends EventEmitter\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\n\n/**\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\n *\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\n * @typedef rpc.ServiceMethodCallback\n * @template TRes extends Message\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {TRes} [response] Response message\n * @returns {undefined}\n */\n\n/**\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\n * @typedef rpc.ServiceMethod\n * @template TReq extends Message\n * @template TRes extends Message\n * @type {function}\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message\n * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined`\n */\n\n/**\n * Constructs a new RPC service instance.\n * @classdesc An RPC service as returned by {@link Service#create}.\n * @exports rpc.Service\n * @extends util.EventEmitter\n * @constructor\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n */\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\n\n if (typeof rpcImpl !== \"function\")\n throw TypeError(\"rpcImpl must be a function\");\n\n util.EventEmitter.call(this);\n\n /**\n * RPC implementation. Becomes `null` once the service is ended.\n * @type {RPCImpl|null}\n */\n this.rpcImpl = rpcImpl;\n\n /**\n * Whether requests are length-delimited.\n * @type {boolean}\n */\n this.requestDelimited = Boolean(requestDelimited);\n\n /**\n * Whether responses are length-delimited.\n * @type {boolean}\n */\n this.responseDelimited = Boolean(responseDelimited);\n}\n\n/**\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\n * @param {Method|rpc.ServiceMethod} method Reflected or static method\n * @param {Constructor} requestCtor Request constructor\n * @param {Constructor} responseCtor Response constructor\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} callback Service callback\n * @returns {undefined}\n * @template TReq extends Message\n * @template TRes extends Message\n */\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\n\n if (!request)\n throw TypeError(\"request must be specified\");\n\n var self = this;\n if (!callback)\n return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\n\n if (!self.rpcImpl) {\n setTimeout(function() { callback(Error(\"already ended\")); }, 0);\n return undefined;\n }\n\n try {\n return self.rpcImpl(\n method,\n requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\n function rpcCallback(err, response) {\n\n if (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n\n if (response === null) {\n self.end(/* endedByRPC */ true);\n return undefined;\n }\n\n if (!(response instanceof responseCtor)) {\n try {\n response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\n } catch (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n }\n\n self.emit(\"data\", response, method);\n return callback(null, response);\n }\n );\n } catch (err) {\n self.emit(\"error\", err, method);\n setTimeout(function() { callback(err); }, 0);\n return undefined;\n }\n};\n\n/**\n * Ends this service and emits the `end` event.\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\n * @returns {rpc.Service} `this`\n */\nService.prototype.end = function end(endedByRPC) {\n if (this.rpcImpl) {\n if (!endedByRPC) // signal end to rpcImpl\n this.rpcImpl(null, null, null);\n this.rpcImpl = null;\n this.emit(\"end\").off();\n }\n return this;\n};\n","\"use strict\";\n\n/**\n * Streaming RPC helpers.\n * @namespace\n */\nvar rpc = exports;\n\n/**\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\n * @typedef RPCImpl\n * @type {function}\n * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called\n * @param {Uint8Array} requestData Request data\n * @param {RPCImplCallback} callback Callback function\n * @returns {undefined}\n * @example\n * function rpcImpl(method, requestData, callback) {\n * if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\n * throw Error(\"no such method\");\n * asynchronouslyObtainAResponse(requestData, function(err, responseData) {\n * callback(err, responseData);\n * });\n * }\n */\n\n/**\n * Node-style callback as used by {@link RPCImpl}.\n * @typedef RPCImplCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\n * @returns {undefined}\n */\n\nrpc.Service = require(\"./rpc/service\");\n","\"use strict\";\nmodule.exports = {};\n\n/**\n * Named roots.\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\n * Can also be used manually to make roots available across modules.\n * @name roots\n * @type {Object.}\n * @example\n * // pbjs -r myroot -o compiled.js ...\n *\n * // in another module:\n * require(\"./compiled.js\");\n *\n * // in any subsequent module:\n * var root = protobuf.roots[\"myroot\"];\n */\n","\"use strict\";\nvar protobuf = exports;\n\n/**\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\n * @name build\n * @type {string}\n * @const\n */\nprotobuf.build = \"minimal\";\n\n// Serialization\nprotobuf.Writer = require(\"./writer\");\nprotobuf.BufferWriter = require(\"./writer_buffer\");\nprotobuf.Reader = require(\"./reader\");\nprotobuf.BufferReader = require(\"./reader_buffer\");\n\n// Utility\nprotobuf.util = require(\"./util/minimal\");\nprotobuf.rpc = require(\"./rpc\");\nprotobuf.roots = require(\"./roots\");\nprotobuf.configure = configure;\n\n/* istanbul ignore next */\n/**\n * Reconfigures the library according to the environment.\n * @returns {undefined}\n */\nfunction configure() {\n protobuf.util._configure();\n protobuf.Writer._configure(protobuf.BufferWriter);\n protobuf.Reader._configure(protobuf.BufferReader);\n}\n\n// Set up buffer utility according to the environment\nconfigure();\n","// minimal library entry point.\n\n\"use strict\";\nmodule.exports = require(\"./src/index-minimal\");\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Metadata = void 0;\nexports.Metadata = function Metadata(init) {\n const data = new Map();\n const metadata = {\n set(key, value) {\n key = normalizeKey(key);\n if (Array.isArray(value)) {\n if (value.length === 0) {\n data.delete(key);\n }\n else {\n for (const item of value) {\n validate(key, item);\n }\n data.set(key, key.endsWith('-bin') ? value : [value.join(', ')]);\n }\n }\n else {\n validate(key, value);\n data.set(key, [value]);\n }\n return metadata;\n },\n append(key, value) {\n key = normalizeKey(key);\n validate(key, value);\n let values = data.get(key);\n if (values == null) {\n values = [];\n data.set(key, values);\n }\n values.push(value);\n if (!key.endsWith('-bin')) {\n data.set(key, [values.join(', ')]);\n }\n return metadata;\n },\n delete(key) {\n key = normalizeKey(key);\n data.delete(key);\n },\n get(key) {\n var _a;\n key = normalizeKey(key);\n return (_a = data.get(key)) === null || _a === void 0 ? void 0 : _a[0];\n },\n getAll(key) {\n var _a;\n key = normalizeKey(key);\n return ((_a = data.get(key)) !== null && _a !== void 0 ? _a : []);\n },\n has(key) {\n key = normalizeKey(key);\n return data.has(key);\n },\n [Symbol.iterator]() {\n return data[Symbol.iterator]();\n },\n };\n if (init != null) {\n const entries = isIterable(init) ? init : Object.entries(init);\n for (const [key, value] of entries) {\n metadata.set(key, value);\n }\n }\n return metadata;\n};\nfunction normalizeKey(key) {\n return key.toLowerCase();\n}\nfunction validate(key, value) {\n if (!/^[0-9a-z_.-]+$/.test(key)) {\n throw new Error(`Metadata key '${key}' contains illegal characters`);\n }\n if (key.endsWith('-bin')) {\n if (!(value instanceof Uint8Array)) {\n throw new Error(`Metadata key '${key}' ends with '-bin', thus it must have binary value`);\n }\n }\n else {\n if (typeof value !== 'string') {\n throw new Error(`Metadata key '${key}' doesn't end with '-bin', thus it must have string value`);\n }\n if (!/^[ -~]*$/.test(value)) {\n throw new Error(`Metadata value '${value}' of key '${key}' contains illegal characters`);\n }\n }\n}\nfunction isIterable(value) {\n return Symbol.iterator in value;\n}\n//# sourceMappingURL=Metadata.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Status = void 0;\n/**\n * gRPC status code.\n *\n * See https://grpc.github.io/grpc/core/md_doc_statuscodes.html.\n */\nvar Status;\n(function (Status) {\n /**\n * Not an error; returned on success.\n */\n Status[Status[\"OK\"] = 0] = \"OK\";\n /**\n * The operation was cancelled, typically by the caller.\n */\n Status[Status[\"CANCELLED\"] = 1] = \"CANCELLED\";\n /**\n * Unknown error.\n *\n * For example, this error may be returned when a `Status` value received from\n * another address space belongs to an error space that is not known in this\n * address space.\n *\n * Also errors raised by APIs that do not return enough error information may\n * be converted to this error.\n */\n Status[Status[\"UNKNOWN\"] = 2] = \"UNKNOWN\";\n /**\n * The client specified an invalid argument.\n *\n * Note that this differs from `FAILED_PRECONDITION`. `INVALID_ARGUMENT`\n * indicates arguments that are problematic regardless of the state of the\n * system (e.g., a malformed file name).\n */\n Status[Status[\"INVALID_ARGUMENT\"] = 3] = \"INVALID_ARGUMENT\";\n /**\n * The deadline expired before the operation could complete.\n *\n * For operations that change the state of the system, this error may be\n * returned even if the operation has completed successfully.\n *\n * For example, a successful response from a server could have been delayed\n * long enough for the deadline to expire.\n */\n Status[Status[\"DEADLINE_EXCEEDED\"] = 4] = \"DEADLINE_EXCEEDED\";\n /**\n * Some requested entity (e.g., file or directory) was not found.\n *\n * Note to server developers: if a request is denied for an entire class of\n * users, such as gradual feature rollout or undocumented allowlist,\n * `NOT_FOUND` may be used. If a request is denied for some users within a\n * class of users, such as user-based access control, `PERMISSION_DENIED` must\n * be used.\n */\n Status[Status[\"NOT_FOUND\"] = 5] = \"NOT_FOUND\";\n /**\n * The entity that a client attempted to create (e.g., file or directory)\n * already exists.\n */\n Status[Status[\"ALREADY_EXISTS\"] = 6] = \"ALREADY_EXISTS\";\n /**\n * The caller does not have permission to execute the specified operation.\n *\n * `PERMISSION_DENIED` must not be used for rejections caused by exhausting\n * some resource (use `RESOURCE_EXHAUSTED` instead for those errors).\n * `PERMISSION_DENIED` must not be used if the caller can not be identified\n * (use `UNAUTHENTICATED` instead for those errors).\n *\n * This error code does not imply the request is valid or the requested entity\n * exists or satisfies other pre-conditions.\n */\n Status[Status[\"PERMISSION_DENIED\"] = 7] = \"PERMISSION_DENIED\";\n /**\n * Some resource has been exhausted, perhaps a per-user quota, or perhaps the\n * entire file system is out of space.\n */\n Status[Status[\"RESOURCE_EXHAUSTED\"] = 8] = \"RESOURCE_EXHAUSTED\";\n /**\n * The operation was rejected because the system is not in a state required\n * for the operation's execution.\n *\n * For example, the directory to be deleted is non-empty, an rmdir operation\n * is applied to a non-directory, etc.\n *\n * Service implementors can use the following guidelines to decide between\n * `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`:\n *\n * (a) Use `UNAVAILABLE` if the client can retry just the failing call.\n * (b) Use `ABORTED` if the client should retry at a higher level (e.g.,\n * when a client-specified test-and-set fails, indicating the client\n * should restart a read-modify-write sequence).\n * (c) Use `FAILED_PRECONDITION` if the client should not retry until the\n * system state has been explicitly fixed. E.g., if an \"rmdir\" fails\n * because the directory is non-empty, `FAILED_PRECONDITION` should be\n * returned since the client should not retry unless the files are\n * deleted from the directory.\n */\n Status[Status[\"FAILED_PRECONDITION\"] = 9] = \"FAILED_PRECONDITION\";\n /**\n * The operation was aborted, typically due to a concurrency issue such as a\n * sequencer check failure or transaction abort.\n *\n * See the guidelines above for deciding between `FAILED_PRECONDITION`,\n * `ABORTED`, and `UNAVAILABLE`.\n */\n Status[Status[\"ABORTED\"] = 10] = \"ABORTED\";\n /**\n * The operation was attempted past the valid range.\n *\n * E.g., seeking or reading past end-of-file.\n *\n * Unlike `INVALID_ARGUMENT`, this error indicates a problem that may be fixed\n * if the system state changes. For example, a 32-bit file system will\n * generate `INVALID_ARGUMENT` if asked to read at an offset that is not in\n * the range [0,2^32-1], but it will generate `OUT_OF_RANGE` if asked to read\n * from an offset past the current file size.\n *\n * There is a fair bit of overlap between `FAILED_PRECONDITION` and\n * `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more specific error)\n * when it applies so that callers who are iterating through a space can\n * easily look for an `OUT_OF_RANGE` error to detect when they are done.\n */\n Status[Status[\"OUT_OF_RANGE\"] = 11] = \"OUT_OF_RANGE\";\n /**\n * The operation is not implemented or is not supported/enabled in this\n * service.\n */\n Status[Status[\"UNIMPLEMENTED\"] = 12] = \"UNIMPLEMENTED\";\n /**\n * Internal errors.\n *\n * This means that some invariants expected by the underlying system have been\n * broken. This error code is reserved for serious errors.\n */\n Status[Status[\"INTERNAL\"] = 13] = \"INTERNAL\";\n /**\n * The service is currently unavailable.\n *\n * This is most likely a transient condition, which can be corrected by\n * retrying with a backoff.\n *\n * Note that it is not always safe to retry non-idempotent operations.\n */\n Status[Status[\"UNAVAILABLE\"] = 14] = \"UNAVAILABLE\";\n /**\n * Unrecoverable data loss or corruption.\n */\n Status[Status[\"DATA_LOSS\"] = 15] = \"DATA_LOSS\";\n /**\n * The request does not have valid authentication credentials for the\n * operation.\n */\n Status[Status[\"UNAUTHENTICATED\"] = 16] = \"UNAUTHENTICATED\";\n})(Status = exports.Status || (exports.Status = {}));\n//# sourceMappingURL=Status.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=MethodDescriptor.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=CallOptions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=ClientMiddleware.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.composeClientMiddleware = void 0;\nfunction composeClientMiddleware(middleware1, middleware2) {\n return (call, options) => {\n return middleware2(Object.assign(Object.assign({}, call), { next: (request, options2) => {\n return middleware1(Object.assign(Object.assign({}, call), { request }), options2);\n } }), options);\n };\n}\nexports.composeClientMiddleware = composeClientMiddleware;\n//# sourceMappingURL=composeClientMiddleware.js.map","\"use strict\";\nexports.__esModule = undefined;\nexports.__esModule = true;\n\n// Misc helpers\n\nvar objectSetPrototypeOfIsDefined = typeof Object.setPrototypeOf === \"function\";\nvar objectGetPrototypeOfIsDefined = typeof Object.getPrototypeOf === \"function\";\nvar objectDefinePropertyIsDefined = typeof Object.defineProperty === \"function\";\nvar objectCreateIsDefined = typeof Object.create === \"function\";\nvar objectHasOwnPropertyIsDefined =\n typeof Object.prototype.hasOwnProperty === \"function\";\n\nvar setPrototypeOf = function setPrototypeOf(target, prototype) {\n if (objectSetPrototypeOfIsDefined) {\n Object.setPrototypeOf(target, prototype);\n } else {\n target.__proto__ = prototype;\n }\n};\nexports.setPrototypeOf = setPrototypeOf;\n\nvar getPrototypeOf = function getPrototypeOf(target) {\n if (objectGetPrototypeOfIsDefined) {\n return Object.getPrototypeOf(target);\n } else {\n return target.__proto__ || target.prototype;\n }\n};\nexports.getPrototypeOf = getPrototypeOf;\n\n// Object.defineProperty exists in IE8, but the implementation is buggy, so we\n// need to test if the call fails, and, if so, set a flag to use the shim, as if\n// the function were not defined. When this error is caught the first time, the\n// function is called again recursively, after the flag is set, so the desired\n// effect is achieved anyway.\nvar ie8ObjectDefinePropertyBug = false;\nvar defineProperty = function defineProperty(target, name, propertyDescriptor) {\n if (objectDefinePropertyIsDefined && !ie8ObjectDefinePropertyBug) {\n try {\n Object.defineProperty(target, name, propertyDescriptor);\n } catch (e) {\n ie8ObjectDefinePropertyBug = true;\n defineProperty(target, name, propertyDescriptor);\n }\n } else {\n target[name] = propertyDescriptor.value;\n }\n};\nexports.defineProperty = defineProperty;\n\nvar hasOwnProperty = function hasOwnProperty(target, name) {\n if (objectHasOwnPropertyIsDefined) {\n return target.hasOwnProperty(target, name);\n } else {\n return target[name] === undefined;\n }\n};\nexports.hasOwnProperty = hasOwnProperty;\n\nvar objectCreate = function objectCreate(prototype, propertyDescriptors) {\n if (objectCreateIsDefined) {\n return Object.create(prototype, propertyDescriptors);\n } else {\n var F = function F() {};\n F.prototype = prototype;\n var result = new F();\n if (typeof propertyDescriptors === \"undefined\") {\n return result;\n }\n if (typeof propertyDescriptors === \"null\") {\n throw new Error(\"PropertyDescriptors must not be null.\");\n }\n if (typeof propertyDescriptors === \"object\") {\n for (var key in propertyDescriptors) {\n if (hasOwnProperty(propertyDescriptors, key)) {\n result[key] = propertyDescriptors[key].value;\n }\n }\n }\n\n return result;\n }\n};\nexports.objectCreate = objectCreate;\n","\"use strict\";\nexports.__esModule = undefined;\nexports.__esModule = true;\n\nvar helpers = require(\"./helpers\");\nvar setPrototypeOf = helpers.setPrototypeOf;\nvar getPrototypeOf = helpers.getPrototypeOf;\nvar defineProperty = helpers.defineProperty;\nvar objectCreate = helpers.objectCreate;\n\n// Small test for IE6-8, which checks if the environment prints errors \"nicely\"\n// If not, a toString() method to be added to the error objects with formatting\n// like in more modern browsers\nvar uglyErrorPrinting = new Error().toString() === \"[object Error]\";\n\n// For compatibility\nvar extendableErrorName = \"\";\n\nfunction ExtendableError(message) {\n // Get the constructor\n var originalConstructor = this.constructor;\n // Get the constructor name from the non-standard name property. If undefined\n // (on old IEs), it uses the string representation of the function to extract\n // the name. This should work in all cases, except for directly instantiated\n // ExtendableError objects, for which the name of the ExtendableError class /\n // function is used\n var constructorName =\n originalConstructor.name ||\n (function () {\n var constructorNameMatch = originalConstructor\n .toString()\n .match(/^function\\s*([^\\s(]+)/);\n return constructorNameMatch === null\n ? extendableErrorName\n ? extendableErrorName\n : \"Error\"\n : constructorNameMatch[1];\n })();\n // If the constructor name is \"Error\", ...\n var constructorNameIsError = constructorName === \"Error\";\n // change it to the name of the ExtendableError class / function\n var name = constructorNameIsError ? extendableErrorName : constructorName;\n\n // Obtain a new Error instance. This also sets the message property already.\n var instance = Error.apply(this, arguments);\n\n // Set the prototype of this to the prototype of instance\n setPrototypeOf(instance, getPrototypeOf(this));\n\n // On old IEs, the instance will not extend our subclasses this way. The fix is to use this from the function call instead.\n if (\n !(instance instanceof originalConstructor) ||\n !(instance instanceof ExtendableError)\n ) {\n var instance = this;\n Error.apply(this, arguments);\n defineProperty(instance, \"message\", {\n configurable: true,\n enumerable: false,\n value: message,\n writable: true,\n });\n }\n\n // define the name property\n defineProperty(instance, \"name\", {\n configurable: true,\n enumerable: false,\n value: name,\n writable: true,\n });\n\n // Use Error.captureStackTrace on V8 to capture the proper stack trace excluding any of our error classes\n if (Error.captureStackTrace) {\n // prettier-ignore\n Error.captureStackTrace(\n instance,\n constructorNameIsError ? ExtendableError : originalConstructor\n );\n }\n // instance.stack can still be undefined, in which case the best solution is to create a new Error object and get it from there\n if (instance.stack === undefined) {\n var err = new Error(message);\n err.name = instance.name;\n instance.stack = err.stack;\n }\n\n // If the environment does not have a proper string representation (IE), provide an alternative toString()\n if (uglyErrorPrinting) {\n defineProperty(instance, \"toString\", {\n configurable: true,\n enumerable: false,\n value: function toString() {\n return (\n (this.name || \"Error\") +\n (typeof this.message === \"undefined\" ? \"\" : \": \" + this.message)\n );\n },\n writable: true,\n });\n }\n\n // We're done!\n return instance;\n}\n\n// Get the name of the ExtendableError function or use the string literal\nextendableErrorName = ExtendableError.name || \"ExtendableError\";\n\n// Set the prototype of ExtendableError to an Error object\nExtendableError.prototype = objectCreate(Error.prototype, {\n constructor: {\n value: Error,\n enumerable: false,\n writable: true,\n configurable: true,\n },\n});\n\n// Export\nexports.ExtendableError = ExtendableError;\nexports[\"default\"] = exports.ExtendableError;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ClientError = void 0;\nconst ts_error_1 = require(\"ts-error\");\nconst Status_1 = require(\"../Status\");\n/**\n * Represents gRPC errors returned from client calls.\n */\nclass ClientError extends ts_error_1.ExtendableError {\n constructor(path, code, details) {\n super(`${path} ${Status_1.Status[code]}: ${details}`);\n this.path = path;\n this.code = code;\n this.details = details;\n this.name = 'ClientError';\n Object.defineProperty(this, '@@nice-grpc', {\n value: true,\n });\n Object.defineProperty(this, '@@nice-grpc:ClientError', {\n value: true,\n });\n }\n static [Symbol.hasInstance](instance) {\n // allow instances of ClientError from different versions of nice-grpc\n // to work with `instanceof ClientError`\n if (this !== ClientError) {\n return this.prototype.isPrototypeOf(instance);\n }\n return (typeof instance === 'object' &&\n instance !== null &&\n (instance.constructor === ClientError ||\n instance['@@nice-grpc:ClientError'] === true ||\n (instance.name === 'ClientError' && instance['@@nice-grpc'] === true)));\n }\n}\nexports.ClientError = ClientError;\n//# sourceMappingURL=ClientError.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=CallContext.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=ServerMiddleware.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.composeServerMiddleware = void 0;\nfunction composeServerMiddleware(middleware1, middleware2) {\n return (call, context) => {\n return middleware1(Object.assign(Object.assign({}, call), { next: (request, context1) => {\n return middleware2(Object.assign(Object.assign({}, call), { request }), context1);\n } }), context);\n };\n}\nexports.composeServerMiddleware = composeServerMiddleware;\n//# sourceMappingURL=composeServerMiddleware.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ServerError = void 0;\nconst ts_error_1 = require(\"ts-error\");\nconst Status_1 = require(\"../Status\");\n/**\n * Service implementations may throw this error to report gRPC errors to\n * clients.\n */\nclass ServerError extends ts_error_1.ExtendableError {\n constructor(code, details) {\n super(`${Status_1.Status[code]}: ${details}`);\n this.code = code;\n this.details = details;\n this.name = 'ServerError';\n Object.defineProperty(this, '@@nice-grpc', {\n value: true,\n });\n Object.defineProperty(this, '@@nice-grpc:ServerError', {\n value: true,\n });\n }\n static [Symbol.hasInstance](instance) {\n // allow instances of ServerError from different versions of nice-grpc\n // to work with `instanceof ServerError`\n if (this !== ServerError) {\n return this.prototype.isPrototypeOf(instance);\n }\n return (typeof instance === 'object' &&\n instance !== null &&\n (instance.constructor === ServerError ||\n instance['@@nice-grpc:ServerError'] === true ||\n (instance.name === 'ServerError' && instance['@@nice-grpc'] === true)));\n }\n}\nexports.ServerError = ServerError;\n//# sourceMappingURL=ServerError.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./Metadata\"), exports);\n__exportStar(require(\"./Status\"), exports);\n__exportStar(require(\"./MethodDescriptor\"), exports);\n__exportStar(require(\"./client/CallOptions\"), exports);\n__exportStar(require(\"./client/ClientMiddleware\"), exports);\n__exportStar(require(\"./client/composeClientMiddleware\"), exports);\n__exportStar(require(\"./client/ClientError\"), exports);\n__exportStar(require(\"./server/CallContext\"), exports);\n__exportStar(require(\"./server/ServerMiddleware\"), exports);\n__exportStar(require(\"./server/composeServerMiddleware\"), exports);\n__exportStar(require(\"./server/ServerError\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isGrpcWebServiceDefinition = exports.fromGrpcWebServiceDefinition = void 0;\nfunction fromGrpcWebServiceDefinition(definition) {\n const result = {};\n for (const [key, value] of Object.entries(definition)) {\n if (key === 'serviceName') {\n continue;\n }\n const method = value;\n result[uncapitalize(key)] = {\n path: `/${definition.serviceName}/${key}`,\n requestStream: method.requestStream,\n responseStream: method.responseStream,\n requestDeserialize: method.requestType.deserializeBinary,\n requestSerialize: (value) => value.serializeBinary(),\n responseDeserialize: method.responseType.deserializeBinary,\n responseSerialize: (value) => value.serializeBinary(),\n options: {},\n };\n }\n return result;\n}\nexports.fromGrpcWebServiceDefinition = fromGrpcWebServiceDefinition;\nfunction isGrpcWebServiceDefinition(definition) {\n return 'prototype' in definition;\n}\nexports.isGrpcWebServiceDefinition = isGrpcWebServiceDefinition;\nfunction uncapitalize(value) {\n if (value.length === 0) {\n return value;\n }\n return value[0].toLowerCase() + value.slice(1);\n}\n//# sourceMappingURL=grpc-web.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isTsProtoServiceDefinition = exports.fromTsProtoServiceDefinition = void 0;\nfunction fromTsProtoServiceDefinition(definition) {\n const result = {};\n for (const [key, method] of Object.entries(definition.methods)) {\n const requestEncode = method.requestType.encode;\n const requestFromPartial = method.requestType.fromPartial;\n const responseEncode = method.responseType.encode;\n const responseFromPartial = method.responseType.fromPartial;\n result[key] = {\n path: `/${definition.fullName}/${method.name}`,\n requestStream: method.requestStream,\n responseStream: method.responseStream,\n requestDeserialize: method.requestType.decode,\n requestSerialize: requestFromPartial != null\n ? value => requestEncode(requestFromPartial(value)).finish()\n : value => requestEncode(value).finish(),\n responseDeserialize: method.responseType.decode,\n responseSerialize: responseFromPartial != null\n ? value => responseEncode(responseFromPartial(value)).finish()\n : value => responseEncode(value).finish(),\n options: method.options,\n };\n }\n return result;\n}\nexports.fromTsProtoServiceDefinition = fromTsProtoServiceDefinition;\nfunction isTsProtoServiceDefinition(definition) {\n return ('name' in definition && 'fullName' in definition && 'methods' in definition);\n}\nexports.isTsProtoServiceDefinition = isTsProtoServiceDefinition;\n//# sourceMappingURL=ts-proto.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toGrpcWebMethodDefinition = exports.normalizeServiceDefinition = void 0;\nconst grpc_web_1 = require(\"./grpc-web\");\nconst ts_proto_1 = require(\"./ts-proto\");\n/** @internal */\nfunction normalizeServiceDefinition(definition) {\n if ((0, grpc_web_1.isGrpcWebServiceDefinition)(definition)) {\n return (0, grpc_web_1.fromGrpcWebServiceDefinition)(definition);\n }\n else if ((0, ts_proto_1.isTsProtoServiceDefinition)(definition)) {\n return (0, ts_proto_1.fromTsProtoServiceDefinition)(definition);\n }\n else {\n return definition;\n }\n}\nexports.normalizeServiceDefinition = normalizeServiceDefinition;\n/** @internal */\nfunction toGrpcWebMethodDefinition(definition) {\n const [, serviceName, methodName] = definition.path.split('/');\n return {\n service: {\n serviceName,\n },\n methodName,\n requestStream: definition.requestStream,\n responseStream: definition.responseStream,\n requestType: class {\n constructor() {\n throw new Error('Unexpected instantiation');\n }\n static deserializeBinary(bytes) {\n return definition.requestDeserialize(bytes);\n }\n },\n responseType: class {\n constructor() {\n throw new Error('Unexpected instantiation');\n }\n static deserializeBinary(bytes) {\n return definition.responseDeserialize(bytes);\n }\n },\n };\n}\nexports.toGrpcWebMethodDefinition = toGrpcWebMethodDefinition;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createChannel = void 0;\nfunction createChannel(address, transport) {\n return { address, transport };\n}\nexports.createChannel = createChannel;\n//# sourceMappingURL=channel.js.map","!function(e,t){if(\"object\"==typeof exports&&\"object\"==typeof module)module.exports=t();else if(\"function\"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)(\"object\"==typeof exports?exports:e)[n]=r[n]}}(this,(function(){return e={418:function(e,t){!function(e,t){for(var r in t)e[r]=t[r]}(t,function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\"a\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\"\",r(r.s=1)}([function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=r(3),o=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t={splitValues:!1});var r,o=this;this.headersMap={},e&&(\"undefined\"!=typeof Headers&&e instanceof Headers?n.getHeaderKeys(e).forEach((function(r){n.getHeaderValues(e,r).forEach((function(e){t.splitValues?o.append(r,n.splitHeaderValue(e)):o.append(r,e)}))})):\"object\"==typeof(r=e)&&\"object\"==typeof r.headersMap&&\"function\"==typeof r.forEach?e.forEach((function(e,t){o.append(e,t)})):\"undefined\"!=typeof Map&&e instanceof Map?e.forEach((function(e,t){o.append(t,e)})):\"string\"==typeof e?this.appendFromString(e):\"object\"==typeof e&&Object.getOwnPropertyNames(e).forEach((function(t){var r=e[t];Array.isArray(r)?r.forEach((function(e){o.append(t,e)})):o.append(t,r)})))}return e.prototype.appendFromString=function(e){for(var t=e.split(\"\\r\\n\"),r=0;r0){var s=n.substring(0,o).trim(),i=n.substring(o+1).trim();this.append(s,i)}}},e.prototype.delete=function(e,t){var r=n.normalizeName(e);if(void 0===t)delete this.headersMap[r];else{var o=this.headersMap[r];if(o){var s=o.indexOf(t);s>=0&&o.splice(s,1),0===o.length&&delete this.headersMap[r]}}},e.prototype.append=function(e,t){var r=this,o=n.normalizeName(e);Array.isArray(this.headersMap[o])||(this.headersMap[o]=[]),Array.isArray(t)?t.forEach((function(e){r.headersMap[o].push(n.normalizeValue(e))})):this.headersMap[o].push(n.normalizeValue(t))},e.prototype.set=function(e,t){var r=n.normalizeName(e);if(Array.isArray(t)){var o=[];t.forEach((function(e){o.push(n.normalizeValue(e))})),this.headersMap[r]=o}else this.headersMap[r]=[n.normalizeValue(t)]},e.prototype.has=function(e,t){var r=this.headersMap[n.normalizeName(e)];if(!Array.isArray(r))return!1;if(void 0!==t){var o=n.normalizeValue(t);return r.indexOf(o)>=0}return!0},e.prototype.get=function(e){var t=this.headersMap[n.normalizeName(e)];return void 0!==t?t.concat():[]},e.prototype.forEach=function(e){var t=this;Object.getOwnPropertyNames(this.headersMap).forEach((function(r){e(r,t.headersMap[r])}),this)},e.prototype.toHeaders=function(){if(\"undefined\"!=typeof Headers){var e=new Headers;return this.forEach((function(t,r){r.forEach((function(r){e.append(t,r)}))})),e}throw new Error(\"Headers class is not defined\")},e}();t.BrowserHeaders=o},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=r(0);t.BrowserHeaders=n.BrowserHeaders},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.iterateHeaders=function(e,t){for(var r=e[Symbol.iterator](),n=r.next();!n.done;)t(n.value[0]),n=r.next()},t.iterateHeadersKeys=function(e,t){for(var r=e.keys(),n=r.next();!n.done;)t(n.value),n=r.next()}},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=r(2);t.normalizeName=function(e){if(\"string\"!=typeof e&&(e=String(e)),/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(e))throw new TypeError(\"Invalid character in header field name\");return e.toLowerCase()},t.normalizeValue=function(e){return\"string\"!=typeof e&&(e=String(e)),e},t.getHeaderValues=function(e,t){var r=e;if(r instanceof Headers&&r.getAll)return r.getAll(t);var n=r.get(t);return n&&\"string\"==typeof n?[n]:n},t.getHeaderKeys=function(e){var t=e,r={},o=[];return t.keys?n.iterateHeadersKeys(t,(function(e){r[e]||(r[e]=!0,o.push(e))})):t.forEach?t.forEach((function(e,t){r[t]||(r[t]=!0,o.push(t))})):n.iterateHeaders(t,(function(e){var t=e[0];r[t]||(r[t]=!0,o.push(t))})),o},t.splitHeaderValue=function(e){var t=[];return e.split(\", \").forEach((function(e){e.split(\",\").forEach((function(e){t.push(e)}))})),t}}]))},617:function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.ChunkParser=t.ChunkType=t.encodeASCII=t.decodeASCII=void 0;var n,o=r(65);function s(e){return 9===(t=e)||10===t||13===t||e>=32&&e<=126;var t}function i(e){for(var t=0;t!==e.length;++t)if(!s(e[t]))throw new Error(\"Metadata is not valid (printable) ASCII\");return String.fromCharCode.apply(String,Array.prototype.slice.call(e))}function a(e){return 128==(128&e.getUint8(0))}function u(e){return e.getUint32(1,!1)}function d(e,t,r){return e.byteLength-t>=r}function c(e,t,r){if(e.slice)return e.slice(t,r);var n=e.length;void 0!==r&&(n=r);for(var o=new Uint8Array(n-t),s=0,i=t;i=0?r:s.httpStatusToCode(t);this.props.debug&&i.debug(\"onHeaders.code\",n);var o=e.get(\"grpc-message\")||[];if(this.props.debug&&i.debug(\"onHeaders.gRPCMessage\",o),this.rawOnHeaders(e),n!==s.Code.OK){var a=this.decodeGRPCStatus(o[0]);this.rawOnError(n,a,e)}}},e.prototype.onTransportChunk=function(e){var t=this;if(this.closed)this.props.debug&&i.debug(\"grpc.onChunk received after request was closed - ignoring\");else{var r=[];try{r=this.parser.parse(e)}catch(e){return this.props.debug&&i.debug(\"onChunk.parsing error\",e,e.message),void this.rawOnError(s.Code.Internal,\"parsing error: \"+e.message)}r.forEach((function(e){if(e.chunkType===o.ChunkType.MESSAGE){var r=t.methodDefinition.responseType.deserializeBinary(e.data);t.rawOnMessage(r)}else e.chunkType===o.ChunkType.TRAILERS&&(t.responseHeaders?(t.responseTrailers=new n.Metadata(e.trailers),t.props.debug&&i.debug(\"onChunk.trailers\",t.responseTrailers)):(t.responseHeaders=new n.Metadata(e.trailers),t.rawOnHeaders(t.responseHeaders)))}))}},e.prototype.onTransportEnd=function(){if(this.props.debug&&i.debug(\"grpc.onEnd\"),this.closed)this.props.debug&&i.debug(\"grpc.onEnd received after request was closed - ignoring\");else if(void 0!==this.responseTrailers){var e=c(this.responseTrailers);if(null!==e){var t=this.responseTrailers.get(\"grpc-message\"),r=this.decodeGRPCStatus(t[0]);this.rawOnEnd(e,r,this.responseTrailers)}else this.rawOnError(s.Code.Internal,\"Response closed without grpc-status (Trailers provided)\")}else{if(void 0===this.responseHeaders)return void this.rawOnError(s.Code.Unknown,\"Response closed without headers\");var n=c(this.responseHeaders),o=this.responseHeaders.get(\"grpc-message\");if(this.props.debug&&i.debug(\"grpc.headers only response \",n,o),null===n)return void this.rawOnEnd(s.Code.Unknown,\"Response closed without grpc-status (Headers only)\",this.responseHeaders);var a=this.decodeGRPCStatus(o[0]);this.rawOnEnd(n,a,this.responseHeaders)}},e.prototype.decodeGRPCStatus=function(e){if(!e)return\"\";try{return decodeURIComponent(e)}catch(t){return e}},e.prototype.rawOnEnd=function(e,t,r){var n=this;this.props.debug&&i.debug(\"rawOnEnd\",e,t,r),this.completed||(this.completed=!0,this.onEndCallbacks.forEach((function(o){if(!n.closed)try{o(e,t,r)}catch(e){setTimeout((function(){throw e}),0)}})))},e.prototype.rawOnHeaders=function(e){this.props.debug&&i.debug(\"rawOnHeaders\",e),this.completed||this.onHeadersCallbacks.forEach((function(t){try{t(e)}catch(e){setTimeout((function(){throw e}),0)}}))},e.prototype.rawOnError=function(e,t,r){var o=this;void 0===r&&(r=new n.Metadata),this.props.debug&&i.debug(\"rawOnError\",e,t),this.completed||(this.completed=!0,this.onEndCallbacks.forEach((function(n){if(!o.closed)try{n(e,t,r)}catch(e){setTimeout((function(){throw e}),0)}})))},e.prototype.rawOnMessage=function(e){var t=this;this.props.debug&&i.debug(\"rawOnMessage\",e.toObject()),this.completed||this.closed||this.onMessageCallbacks.forEach((function(r){if(!t.closed)try{r(e)}catch(e){setTimeout((function(){throw e}),0)}}))},e.prototype.onHeaders=function(e){this.onHeadersCallbacks.push(e)},e.prototype.onMessage=function(e){this.onMessageCallbacks.push(e)},e.prototype.onEnd=function(e){this.onEndCallbacks.push(e)},e.prototype.start=function(e){if(this.started)throw new Error(\"Client already started - cannot .start()\");this.started=!0;var t=new n.Metadata(e||{});t.set(\"content-type\",\"application/grpc-web+proto\"),t.set(\"x-grpc-web\",\"1\"),this.transport.start(t)},e.prototype.send=function(e){if(!this.started)throw new Error(\"Client not started - .start() must be called before .send()\");if(this.closed)throw new Error(\"Client already closed - cannot .send()\");if(this.finishedSending)throw new Error(\"Client already finished sending - cannot .send()\");if(!this.methodDefinition.requestStream&&this.sentFirstMessage)throw new Error(\"Message already sent for non-client-streaming method - cannot .send()\");this.sentFirstMessage=!0;var t=u.frameRequest(e);this.transport.sendMessage(t)},e.prototype.finishSend=function(){if(!this.started)throw new Error(\"Client not started - .finishSend() must be called before .close()\");if(this.closed)throw new Error(\"Client already closed - cannot .send()\");if(this.finishedSending)throw new Error(\"Client already finished sending - cannot .finishSend()\");this.finishedSending=!0,this.transport.finishSend()},e.prototype.close=function(){if(!this.started)throw new Error(\"Client not started - .start() must be called before .close()\");if(this.closed)throw new Error(\"Client already closed - cannot .close()\");this.closed=!0,this.props.debug&&i.debug(\"request.abort aborting request\"),this.transport.cancel()},e}();function c(e){var t=e.get(\"grpc-status\")||[];if(t.length>0)try{var r=t[0];return parseInt(r,10)}catch(e){return null}return null}},346:function(e,t){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.debug=void 0,t.debug=function(){for(var e=[],t=0;t=55296&&r<=56319){var n=e.charCodeAt(t+1);n>=56320&&n<=57343&&(r=65536+(r-55296<<10)+(n-56320))}return r}function p(e){for(var t=new Uint8Array(e.length),r=0,n=0;n {\n if (signal.aborted) {\n reject(new AbortError());\n return;\n }\n let removeAbortListener;\n let finished = false;\n function finish() {\n if (!finished) {\n finished = true;\n if (removeAbortListener != null) {\n removeAbortListener();\n }\n }\n }\n const callback = executor(value => {\n resolve(value);\n finish();\n }, reason => {\n reject(reason);\n finish();\n });\n if (!finished) {\n const listener = () => {\n const callbackResult = callback();\n if (callbackResult == null) {\n reject(new AbortError());\n }\n else {\n callbackResult.then(() => {\n reject(new AbortError());\n }, reason => {\n reject(reason);\n });\n }\n finish();\n };\n signal.addEventListener('abort', listener);\n removeAbortListener = () => {\n signal.removeEventListener('abort', listener);\n };\n }\n });\n}\n//# sourceMappingURL=execute.js.map","import { execute } from './execute';\n/**\n * Wrap a promise to reject with `AbortError` once `signal` is aborted.\n *\n * Useful to wrap non-abortable promises.\n * Note that underlying process will NOT be aborted.\n */\nexport function abortable(signal, promise) {\n if (signal.aborted) {\n // prevent unhandled rejection\n const noop = () => { };\n promise.then(noop, noop);\n }\n return execute(signal, (resolve, reject) => {\n promise.then(resolve, reject);\n return () => { };\n });\n}\n//# sourceMappingURL=abortable.js.map","import { execute } from './execute';\n/**\n * Returns a promise that fulfills after delay and rejects with\n * `AbortError` once `signal` is aborted.\n *\n * The delay time is specified as a `Date` object or as an integer denoting\n * milliseconds to wait.\n *\n * Example:\n *\n * // Make requests repeatedly with a delay between consecutive requests\n * while (true) {\n * await makeRequest(signal, params);\n * await delay(signal, 1000);\n * }\n *\n * Example:\n *\n * // Make requests repeatedly with a fixed interval\n * import {addMilliseconds} from 'date-fns';\n *\n * let date = new Date();\n *\n * while (true) {\n * await makeRequest(signal, params);\n *\n * date = addMilliseconds(date, 1000);\n * await delay(signal, date);\n * }\n */\nexport function delay(signal, dueTime) {\n return execute(signal, resolve => {\n const ms = typeof dueTime === 'number' ? dueTime : dueTime.getTime() - Date.now();\n const timer = setTimeout(resolve, ms);\n return () => {\n clearTimeout(timer);\n };\n });\n}\n//# sourceMappingURL=delay.js.map","import { execute } from './execute';\n/**\n * Return a promise that never fulfills and only rejects with `AbortError` once\n * `signal` is aborted.\n */\nexport function forever(signal) {\n return execute(signal, () => () => { });\n}\n//# sourceMappingURL=forever.js.map","import { execute } from './execute';\n/**\n * Returns a promise that fulfills when an event of specific type is emitted\n * from given event target and rejects with `AbortError` once `signal` is\n * aborted.\n *\n * Example:\n *\n * // Create a WebSocket and wait for connection\n * const webSocket = new WebSocket(url);\n *\n * const openEvent = await race(signal, signal => [\n * waitForEvent(signal, webSocket, 'open'),\n * waitForEvent(signal, webSocket, 'close').then(\n * event => {\n * throw new Error(`Failed to connect to ${url}: ${event.reason}`);\n * },\n * ),\n * ]);\n */\nexport function waitForEvent(signal, target, eventName, options) {\n return execute(signal, resolve => {\n let unlisten;\n let finished = false;\n const handler = (...args) => {\n resolve(args.length > 1 ? args : args[0]);\n finished = true;\n if (unlisten != null) {\n unlisten();\n }\n };\n unlisten = listen(target, eventName, handler, options);\n if (finished) {\n unlisten();\n }\n return () => {\n finished = true;\n if (unlisten != null) {\n unlisten();\n }\n };\n });\n}\nfunction listen(target, eventName, handler, options) {\n if (isEventTarget(target)) {\n target.addEventListener(eventName, handler, options);\n return () => target.removeEventListener(eventName, handler, options);\n }\n if (isJQueryStyleEventEmitter(target)) {\n target.on(eventName, handler);\n return () => target.off(eventName, handler);\n }\n if (isNodeStyleEventEmitter(target)) {\n target.addListener(eventName, handler);\n return () => target.removeListener(eventName, handler);\n }\n throw new Error('Invalid event target');\n}\nfunction isNodeStyleEventEmitter(sourceObj) {\n return (isFunction(sourceObj.addListener) && isFunction(sourceObj.removeListener));\n}\nfunction isJQueryStyleEventEmitter(sourceObj) {\n return isFunction(sourceObj.on) && isFunction(sourceObj.off);\n}\nfunction isEventTarget(sourceObj) {\n return (isFunction(sourceObj.addEventListener) &&\n isFunction(sourceObj.removeEventListener));\n}\nconst isFunction = (obj) => typeof obj === 'function';\n//# sourceMappingURL=waitForEvent.js.map","import { AbortError, isAbortError } from './AbortError';\nexport function all(signal, executor) {\n return new Promise((resolve, reject) => {\n if (signal.aborted) {\n reject(new AbortError());\n return;\n }\n const innerAbortController = new AbortController();\n const promises = executor(innerAbortController.signal);\n if (promises.length === 0) {\n resolve([]);\n return;\n }\n const abortListener = () => {\n innerAbortController.abort();\n };\n signal.addEventListener('abort', abortListener);\n let rejection;\n const results = new Array(promises.length);\n let settledCount = 0;\n function settled() {\n settledCount += 1;\n if (settledCount === promises.length) {\n signal.removeEventListener('abort', abortListener);\n if (rejection != null) {\n reject(rejection.reason);\n }\n else {\n resolve(results);\n }\n }\n }\n for (const [i, promise] of promises.entries()) {\n promise.then(value => {\n results[i] = value;\n settled();\n }, reason => {\n innerAbortController.abort();\n if (rejection == null ||\n (!isAbortError(reason) && isAbortError(rejection.reason))) {\n rejection = { reason };\n }\n settled();\n });\n }\n });\n}\n//# sourceMappingURL=all.js.map","import { AbortError, isAbortError } from './AbortError';\n/**\n * Abortable version of `Promise.race`.\n *\n * Creates new inner `AbortSignal` and passes it to `executor`. That signal is\n * aborted when `signal` is aborted or any of the promises returned from\n * `executor` are fulfilled or rejected.\n *\n * Returns a promise that fulfills or rejects when any of the promises returned\n * from `executor` are fulfilled or rejected, and rejects with `AbortError` when\n * `signal` is aborted.\n *\n * The promises returned from `executor` must be abortable, i.e. once\n * `innerSignal` is aborted, they must reject with `AbortError` either\n * immediately, or after doing any async cleanup.\n *\n * Example:\n *\n * const result = await race(signal, signal => [\n * delay(signal, 1000).then(() => ({status: 'timeout'})),\n * makeRequest(signal, params).then(value => ({status: 'success', value})),\n * ]);\n *\n * if (result.status === 'timeout') {\n * // request timed out\n * } else {\n * const response = result.value;\n * }\n */\nexport function race(signal, executor) {\n return new Promise((resolve, reject) => {\n if (signal.aborted) {\n reject(new AbortError());\n return;\n }\n const innerAbortController = new AbortController();\n const promises = executor(innerAbortController.signal);\n const abortListener = () => {\n innerAbortController.abort();\n };\n signal.addEventListener('abort', abortListener);\n let settledCount = 0;\n function settled(result) {\n innerAbortController.abort();\n settledCount += 1;\n if (settledCount === promises.length) {\n signal.removeEventListener('abort', abortListener);\n if (result.status === 'fulfilled') {\n resolve(result.value);\n }\n else {\n reject(result.reason);\n }\n }\n }\n let result;\n for (const promise of promises) {\n promise.then(value => {\n if (result == null) {\n result = { status: 'fulfilled', value };\n }\n settled(result);\n }, reason => {\n if (result == null ||\n (!isAbortError(reason) &&\n (result.status === 'fulfilled' || isAbortError(result.reason)))) {\n result = { status: 'rejected', reason };\n }\n settled(result);\n });\n }\n });\n}\n//# sourceMappingURL=race.js.map","import { delay } from './delay';\nimport { rethrowAbortError } from './AbortError';\n/**\n * Retry function with exponential backoff.\n *\n * The function receives AbortSignal, attempt number starting with 0, and reset\n * function that sets attempt number to -1 so that the next attempt will be\n * made without delay.\n */\nexport async function retry(signal, fn, options = {}) {\n const { baseMs = 1000, maxDelayMs = 30000, onError, maxAttempts = Infinity, } = options;\n let attempt = 0;\n const reset = () => {\n attempt = -1;\n };\n while (true) {\n try {\n return await fn(signal, attempt, reset);\n }\n catch (error) {\n rethrowAbortError(error);\n if (attempt >= maxAttempts) {\n throw error;\n }\n let delayMs;\n if (attempt === -1) {\n delayMs = 0;\n }\n else {\n // https://aws.amazon.com/ru/blogs/architecture/exponential-backoff-and-jitter/\n const backoff = Math.min(maxDelayMs, Math.pow(2, attempt) * baseMs);\n delayMs = Math.round((backoff * (1 + Math.random())) / 2);\n }\n if (onError) {\n onError(error, attempt, delayMs);\n }\n if (delayMs !== 0) {\n await delay(signal, delayMs);\n }\n attempt += 1;\n }\n }\n}\n//# sourceMappingURL=retry.js.map","import { AbortError, catchAbortError, isAbortError } from './AbortError';\n/**\n * Run an abortable function with `fork` and `defer` effects attached to it.\n *\n * `spawn` allows to write Go-style coroutines.\n *\n * Example:\n *\n * // Connect to a database, then start a server, then block until abort.\n * // On abort, gracefully shutdown the server, and once done, disconnect\n * // from the database.\n * spawn(signal, async (signal, {defer}) => {\n * const db = await connectToDb();\n *\n * defer(async () => {\n * await db.close();\n * });\n *\n * const server = await startServer(db);\n *\n * defer(async () => {\n * await server.close();\n * });\n *\n * await forever(signal);\n * });\n *\n * Example:\n *\n * // Connect to a database, then start an infinite polling loop.\n * // On abort, disconnect from the database.\n * spawn(signal, async (signal, {defer}) => {\n * const db = await connectToDb();\n *\n * defer(async () => {\n * await db.close();\n * });\n *\n * while (true) {\n * await poll(signal, db);\n * await delay(signal, 5000);\n * }\n * });\n *\n * Example:\n *\n * // Acquire a lock and execute a function.\n * // Extend the lock while the function is running.\n * // Once the function finishes or the signal is aborted, stop extending\n * // the lock and release it.\n * import Redlock = require('redlock');\n *\n * const lockTtl = 30_000;\n *\n * function withLock(\n * signal: AbortSignal,\n * redlock: Redlock,\n * key: string,\n * fn: (signal: AbortSignal) => Promise,\n * ): Promise {\n * return spawn(signal, async (signal, {fork, defer}) => {\n * const lock = await redlock.lock(key, lockTtl);\n *\n * defer(() => lock.unlock());\n * ​\n * fork(async signal => {\n * while (true) {\n * await delay(signal, lockTtl / 10);\n * await lock.extend(lockTtl);\n * }\n * });\n *\n * return await fn(signal);\n * });\n * }\n *\n * const redlock = new Redlock([redis], {\n * retryCount: -1,\n * });\n *\n * await withLock(signal, redlock, 'the-lock-key', async signal => {\n * // ...\n * });\n */\nexport function spawn(signal, fn) {\n if (signal.aborted) {\n return Promise.reject(new AbortError());\n }\n const deferredFunctions = [];\n /**\n * Aborted when spawned function finishes\n * or one of forked functions throws\n * or parent signal aborted.\n */\n const spawnAbortController = new AbortController();\n const spawnSignal = spawnAbortController.signal;\n const abortSpawn = () => {\n spawnAbortController.abort();\n };\n signal.addEventListener('abort', abortSpawn);\n const removeAbortListener = () => {\n signal.removeEventListener('abort', abortSpawn);\n };\n const tasks = new Set();\n const abortTasks = () => {\n for (const task of tasks) {\n task.abort();\n }\n };\n spawnSignal.addEventListener('abort', abortTasks);\n const removeSpawnAbortListener = () => {\n spawnSignal.removeEventListener('abort', abortTasks);\n };\n let promise = new Promise((resolve, reject) => {\n let result;\n let failure;\n fork(signal => fn(signal, {\n defer(fn) {\n deferredFunctions.push(fn);\n },\n fork,\n }))\n .join()\n .then(value => {\n spawnAbortController.abort();\n result = { value };\n }, error => {\n spawnAbortController.abort();\n if (!isAbortError(error) || failure == null) {\n failure = { error };\n }\n });\n function fork(forkFn) {\n if (spawnSignal.aborted) {\n // return already aborted task\n return {\n abort() { },\n async join() {\n throw new AbortError();\n },\n };\n }\n const taskAbortController = new AbortController();\n const taskSignal = taskAbortController.signal;\n const taskPromise = forkFn(taskSignal);\n const task = {\n abort() {\n taskAbortController.abort();\n },\n join: () => taskPromise,\n };\n tasks.add(task);\n taskPromise\n .catch(catchAbortError)\n .catch(error => {\n failure = { error };\n // error in forked function\n spawnAbortController.abort();\n })\n .finally(() => {\n tasks.delete(task);\n if (tasks.size === 0) {\n if (failure != null) {\n reject(failure.error);\n }\n else {\n resolve(result.value);\n }\n }\n });\n return task;\n }\n });\n promise = promise.finally(() => {\n removeAbortListener();\n removeSpawnAbortListener();\n let deferPromise = Promise.resolve();\n for (let i = deferredFunctions.length - 1; i >= 0; i--) {\n deferPromise = deferPromise.finally(deferredFunctions[i]);\n }\n return deferPromise;\n });\n return promise;\n}\n//# sourceMappingURL=spawn.js.map","import { catchAbortError } from './AbortError';\n/**\n * Invokes an abortable function with implicitly created `AbortSignal`.\n *\n * Returns a function that aborts that signal and waits until passed function\n * finishes.\n *\n * Any error other than `AbortError` thrown from passed function will result in\n * unhandled promise rejection.\n *\n * Example:\n *\n * const stop = run(async signal => {\n * try {\n * while (true) {\n * await delay(signal, 1000);\n * console.log('tick');\n * }\n * } finally {\n * await doCleanup();\n * }\n * });\n *\n * // abort and wait until cleanup is done\n * await stop();\n */\nexport function run(fn) {\n const abortController = new AbortController();\n const promise = fn(abortController.signal).catch(catchAbortError);\n return () => {\n abortController.abort();\n return promise;\n };\n}\n//# sourceMappingURL=run.js.map","import { isAbortError, catchAbortError } from './AbortError';\nimport { delay } from './delay';\nimport { execute } from './execute';\n/**\n * Proactively retry a function with exponential backoff.\n *\n * Also known as hedging.\n *\n * The function will be called multiple times in parallel until it succeeds, in\n * which case all the other calls will be aborted.\n */\nexport function proactiveRetry(signal, fn, options = {}) {\n const { baseMs = 1000, onError, maxAttempts = Infinity } = options;\n return execute(signal, (resolve, reject) => {\n const innerAbortController = new AbortController();\n let attemptsExhausted = false;\n const promises = new Map();\n function handleFulfilled(value) {\n innerAbortController.abort();\n promises.clear();\n resolve(value);\n }\n function handleRejected(err, attempt) {\n promises.delete(attempt);\n if (attemptsExhausted && promises.size === 0) {\n reject(err);\n return;\n }\n if (isAbortError(err)) {\n return;\n }\n if (onError) {\n try {\n onError(err, attempt);\n }\n catch (err) {\n innerAbortController.abort();\n promises.clear();\n reject(err);\n }\n }\n }\n async function makeAttempts(signal) {\n for (let attempt = 0;; attempt++) {\n const promise = fn(signal, attempt);\n promises.set(attempt, promise);\n promise.then(handleFulfilled, err => handleRejected(err, attempt));\n if (attempt + 1 >= maxAttempts) {\n break;\n }\n // https://aws.amazon.com/ru/blogs/architecture/exponential-backoff-and-jitter/\n const backoff = Math.pow(2, attempt) * baseMs;\n const delayMs = Math.round((backoff * (1 + Math.random())) / 2);\n await delay(signal, delayMs);\n }\n attemptsExhausted = true;\n }\n makeAttempts(innerAbortController.signal).catch(catchAbortError);\n return () => {\n innerAbortController.abort();\n };\n });\n}\n//# sourceMappingURL=proactiveRetry.js.map","\"use strict\";\n// borrowed from IxJS\n// https://github.com/ReactiveX/IxJS/blob/v4.5.1/src/asynciterable/asyncsink.ts\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AsyncSink = void 0;\nconst ARRAY_VALUE = 'value';\nconst ARRAY_ERROR = 'error';\nclass AsyncSink {\n constructor() {\n this._ended = false;\n this._values = [];\n this._resolvers = [];\n }\n [Symbol.asyncIterator]() {\n return this;\n }\n write(value) {\n this._push({ type: ARRAY_VALUE, value });\n }\n error(error) {\n this._push({ type: ARRAY_ERROR, error });\n }\n _push(item) {\n if (this._ended) {\n throw new Error('AsyncSink already ended');\n }\n if (this._resolvers.length > 0) {\n const { resolve, reject } = this._resolvers.shift();\n if (item.type === ARRAY_ERROR) {\n reject(item.error);\n }\n else {\n resolve({ done: false, value: item.value });\n }\n }\n else {\n this._values.push(item);\n }\n }\n next() {\n if (this._values.length > 0) {\n const { type, value, error } = this._values.shift();\n if (type === ARRAY_ERROR) {\n return Promise.reject(error);\n }\n else {\n return Promise.resolve({ done: false, value });\n }\n }\n if (this._ended) {\n return Promise.resolve({ done: true });\n }\n return new Promise((resolve, reject) => {\n this._resolvers.push({ resolve, reject });\n });\n }\n end() {\n while (this._resolvers.length > 0) {\n this._resolvers.shift().resolve({ done: true });\n }\n this._ended = true;\n }\n}\nexports.AsyncSink = AsyncSink;\n//# sourceMappingURL=AsyncSink.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isAsyncIterable = void 0;\n/** @internal */\nfunction isAsyncIterable(value) {\n return value != null && Symbol.asyncIterator in value;\n}\nexports.isAsyncIterable = isAsyncIterable;\n//# sourceMappingURL=isAsyncIterable.js.map","//\n// THIS FILE IS AUTOMATICALLY GENERATED! DO NOT EDIT BY HAND!\n//\n;\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n ? module.exports = factory()\n : typeof define === 'function' && define.amd\n ? define(factory) :\n // cf. https://github.com/dankogai/js-base64/issues/119\n (function () {\n // existing version for noConflict()\n var _Base64 = global.Base64;\n var gBase64 = factory();\n gBase64.noConflict = function () {\n global.Base64 = _Base64;\n return gBase64;\n };\n if (global.Meteor) { // Meteor.js\n Base64 = gBase64;\n }\n global.Base64 = gBase64;\n })();\n}((typeof self !== 'undefined' ? self\n : typeof window !== 'undefined' ? window\n : typeof global !== 'undefined' ? global\n : this), function () {\n 'use strict';\n /**\n * base64.ts\n *\n * Licensed under the BSD 3-Clause License.\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * References:\n * http://en.wikipedia.org/wiki/Base64\n *\n * @author Dan Kogai (https://github.com/dankogai)\n */\n var version = '3.7.5';\n /**\n * @deprecated use lowercase `version`.\n */\n var VERSION = version;\n var _hasatob = typeof atob === 'function';\n var _hasbtoa = typeof btoa === 'function';\n var _hasBuffer = typeof Buffer === 'function';\n var _TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined;\n var _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;\n var b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n var b64chs = Array.prototype.slice.call(b64ch);\n var b64tab = (function (a) {\n var tab = {};\n a.forEach(function (c, i) { return tab[c] = i; });\n return tab;\n })(b64chs);\n var b64re = /^(?:[A-Za-z\\d+\\/]{4})*?(?:[A-Za-z\\d+\\/]{2}(?:==)?|[A-Za-z\\d+\\/]{3}=?)?$/;\n var _fromCC = String.fromCharCode.bind(String);\n var _U8Afrom = typeof Uint8Array.from === 'function'\n ? Uint8Array.from.bind(Uint8Array)\n : function (it) { return new Uint8Array(Array.prototype.slice.call(it, 0)); };\n var _mkUriSafe = function (src) { return src\n .replace(/=/g, '').replace(/[+\\/]/g, function (m0) { return m0 == '+' ? '-' : '_'; }); };\n var _tidyB64 = function (s) { return s.replace(/[^A-Za-z0-9\\+\\/]/g, ''); };\n /**\n * polyfill version of `btoa`\n */\n var btoaPolyfill = function (bin) {\n // console.log('polyfilled');\n var u32, c0, c1, c2, asc = '';\n var pad = bin.length % 3;\n for (var i = 0; i < bin.length;) {\n if ((c0 = bin.charCodeAt(i++)) > 255 ||\n (c1 = bin.charCodeAt(i++)) > 255 ||\n (c2 = bin.charCodeAt(i++)) > 255)\n throw new TypeError('invalid character found');\n u32 = (c0 << 16) | (c1 << 8) | c2;\n asc += b64chs[u32 >> 18 & 63]\n + b64chs[u32 >> 12 & 63]\n + b64chs[u32 >> 6 & 63]\n + b64chs[u32 & 63];\n }\n return pad ? asc.slice(0, pad - 3) + \"===\".substring(pad) : asc;\n };\n /**\n * does what `window.btoa` of web browsers do.\n * @param {String} bin binary string\n * @returns {string} Base64-encoded string\n */\n var _btoa = _hasbtoa ? function (bin) { return btoa(bin); }\n : _hasBuffer ? function (bin) { return Buffer.from(bin, 'binary').toString('base64'); }\n : btoaPolyfill;\n var _fromUint8Array = _hasBuffer\n ? function (u8a) { return Buffer.from(u8a).toString('base64'); }\n : function (u8a) {\n // cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326\n var maxargs = 0x1000;\n var strs = [];\n for (var i = 0, l = u8a.length; i < l; i += maxargs) {\n strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));\n }\n return _btoa(strs.join(''));\n };\n /**\n * converts a Uint8Array to a Base64 string.\n * @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5\n * @returns {string} Base64 string\n */\n var fromUint8Array = function (u8a, urlsafe) {\n if (urlsafe === void 0) { urlsafe = false; }\n return urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);\n };\n // This trick is found broken https://github.com/dankogai/js-base64/issues/130\n // const utob = (src: string) => unescape(encodeURIComponent(src));\n // reverting good old fationed regexp\n var cb_utob = function (c) {\n if (c.length < 2) {\n var cc = c.charCodeAt(0);\n return cc < 0x80 ? c\n : cc < 0x800 ? (_fromCC(0xc0 | (cc >>> 6))\n + _fromCC(0x80 | (cc & 0x3f)))\n : (_fromCC(0xe0 | ((cc >>> 12) & 0x0f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n else {\n var cc = 0x10000\n + (c.charCodeAt(0) - 0xD800) * 0x400\n + (c.charCodeAt(1) - 0xDC00);\n return (_fromCC(0xf0 | ((cc >>> 18) & 0x07))\n + _fromCC(0x80 | ((cc >>> 12) & 0x3f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n };\n var re_utob = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFFF]|[^\\x00-\\x7F]/g;\n /**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-8 string\n * @returns {string} UTF-16 string\n */\n var utob = function (u) { return u.replace(re_utob, cb_utob); };\n //\n var _encode = _hasBuffer\n ? function (s) { return Buffer.from(s, 'utf8').toString('base64'); }\n : _TE\n ? function (s) { return _fromUint8Array(_TE.encode(s)); }\n : function (s) { return _btoa(utob(s)); };\n /**\n * converts a UTF-8-encoded string to a Base64 string.\n * @param {boolean} [urlsafe] if `true` make the result URL-safe\n * @returns {string} Base64 string\n */\n var encode = function (src, urlsafe) {\n if (urlsafe === void 0) { urlsafe = false; }\n return urlsafe\n ? _mkUriSafe(_encode(src))\n : _encode(src);\n };\n /**\n * converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5.\n * @returns {string} Base64 string\n */\n var encodeURI = function (src) { return encode(src, true); };\n // This trick is found broken https://github.com/dankogai/js-base64/issues/130\n // const btou = (src: string) => decodeURIComponent(escape(src));\n // reverting good old fationed regexp\n var re_btou = /[\\xC0-\\xDF][\\x80-\\xBF]|[\\xE0-\\xEF][\\x80-\\xBF]{2}|[\\xF0-\\xF7][\\x80-\\xBF]{3}/g;\n var cb_btou = function (cccc) {\n switch (cccc.length) {\n case 4:\n var cp = ((0x07 & cccc.charCodeAt(0)) << 18)\n | ((0x3f & cccc.charCodeAt(1)) << 12)\n | ((0x3f & cccc.charCodeAt(2)) << 6)\n | (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000;\n return (_fromCC((offset >>> 10) + 0xD800)\n + _fromCC((offset & 0x3FF) + 0xDC00));\n case 3:\n return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12)\n | ((0x3f & cccc.charCodeAt(1)) << 6)\n | (0x3f & cccc.charCodeAt(2)));\n default:\n return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6)\n | (0x3f & cccc.charCodeAt(1)));\n }\n };\n /**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-16 string\n * @returns {string} UTF-8 string\n */\n var btou = function (b) { return b.replace(re_btou, cb_btou); };\n /**\n * polyfill version of `atob`\n */\n var atobPolyfill = function (asc) {\n // console.log('polyfilled');\n asc = asc.replace(/\\s+/g, '');\n if (!b64re.test(asc))\n throw new TypeError('malformed base64.');\n asc += '=='.slice(2 - (asc.length & 3));\n var u24, bin = '', r1, r2;\n for (var i = 0; i < asc.length;) {\n u24 = b64tab[asc.charAt(i++)] << 18\n | b64tab[asc.charAt(i++)] << 12\n | (r1 = b64tab[asc.charAt(i++)]) << 6\n | (r2 = b64tab[asc.charAt(i++)]);\n bin += r1 === 64 ? _fromCC(u24 >> 16 & 255)\n : r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255)\n : _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255);\n }\n return bin;\n };\n /**\n * does what `window.atob` of web browsers do.\n * @param {String} asc Base64-encoded string\n * @returns {string} binary string\n */\n var _atob = _hasatob ? function (asc) { return atob(_tidyB64(asc)); }\n : _hasBuffer ? function (asc) { return Buffer.from(asc, 'base64').toString('binary'); }\n : atobPolyfill;\n //\n var _toUint8Array = _hasBuffer\n ? function (a) { return _U8Afrom(Buffer.from(a, 'base64')); }\n : function (a) { return _U8Afrom(_atob(a).split('').map(function (c) { return c.charCodeAt(0); })); };\n /**\n * converts a Base64 string to a Uint8Array.\n */\n var toUint8Array = function (a) { return _toUint8Array(_unURI(a)); };\n //\n var _decode = _hasBuffer\n ? function (a) { return Buffer.from(a, 'base64').toString('utf8'); }\n : _TD\n ? function (a) { return _TD.decode(_toUint8Array(a)); }\n : function (a) { return btou(_atob(a)); };\n var _unURI = function (a) { return _tidyB64(a.replace(/[-_]/g, function (m0) { return m0 == '-' ? '+' : '/'; })); };\n /**\n * converts a Base64 string to a UTF-8 string.\n * @param {String} src Base64 string. Both normal and URL-safe are supported\n * @returns {string} UTF-8 string\n */\n var decode = function (src) { return _decode(_unURI(src)); };\n /**\n * check if a value is a valid Base64 string\n * @param {String} src a value to check\n */\n var isValid = function (src) {\n if (typeof src !== 'string')\n return false;\n var s = src.replace(/\\s+/g, '').replace(/={0,2}$/, '');\n return !/[^\\s0-9a-zA-Z\\+/]/.test(s) || !/[^\\s0-9a-zA-Z\\-_]/.test(s);\n };\n //\n var _noEnum = function (v) {\n return {\n value: v, enumerable: false, writable: true, configurable: true\n };\n };\n /**\n * extend String.prototype with relevant methods\n */\n var extendString = function () {\n var _add = function (name, body) { return Object.defineProperty(String.prototype, name, _noEnum(body)); };\n _add('fromBase64', function () { return decode(this); });\n _add('toBase64', function (urlsafe) { return encode(this, urlsafe); });\n _add('toBase64URI', function () { return encode(this, true); });\n _add('toBase64URL', function () { return encode(this, true); });\n _add('toUint8Array', function () { return toUint8Array(this); });\n };\n /**\n * extend Uint8Array.prototype with relevant methods\n */\n var extendUint8Array = function () {\n var _add = function (name, body) { return Object.defineProperty(Uint8Array.prototype, name, _noEnum(body)); };\n _add('toBase64', function (urlsafe) { return fromUint8Array(this, urlsafe); });\n _add('toBase64URI', function () { return fromUint8Array(this, true); });\n _add('toBase64URL', function () { return fromUint8Array(this, true); });\n };\n /**\n * extend Builtin prototypes with relevant methods\n */\n var extendBuiltins = function () {\n extendString();\n extendUint8Array();\n };\n var gBase64 = {\n version: version,\n VERSION: VERSION,\n atob: _atob,\n atobPolyfill: atobPolyfill,\n btoa: _btoa,\n btoaPolyfill: btoaPolyfill,\n fromBase64: decode,\n toBase64: encode,\n encode: encode,\n encodeURI: encodeURI,\n encodeURL: encodeURI,\n utob: utob,\n btou: btou,\n decode: decode,\n isValid: isValid,\n fromUint8Array: fromUint8Array,\n toUint8Array: toUint8Array,\n extendString: extendString,\n extendUint8Array: extendUint8Array,\n extendBuiltins: extendBuiltins\n };\n //\n // export Base64 to the namespace\n //\n // ES5 is yet to have Object.assign() that may make transpilers unhappy.\n // gBase64.Base64 = Object.assign({}, gBase64);\n gBase64.Base64 = {};\n Object.keys(gBase64).forEach(function (k) { return gBase64.Base64[k] = gBase64[k]; });\n return gBase64;\n}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.convertMetadataFromGrpcWeb = exports.convertMetadataToGrpcWeb = void 0;\nconst grpc_web_1 = require(\"@improbable-eng/grpc-web\");\nconst nice_grpc_common_1 = require(\"nice-grpc-common\");\nconst js_base64_1 = require(\"js-base64\");\nfunction convertMetadataToGrpcWeb(metadata) {\n const grpcMetadata = new grpc_web_1.grpc.Metadata();\n for (const [key, values] of metadata) {\n for (const value of values) {\n grpcMetadata.append(key, typeof value === 'string' ? value : js_base64_1.Base64.fromUint8Array(value));\n }\n }\n return grpcMetadata;\n}\nexports.convertMetadataToGrpcWeb = convertMetadataToGrpcWeb;\nfunction convertMetadataFromGrpcWeb(grpcMetadata) {\n const metadata = (0, nice_grpc_common_1.Metadata)();\n for (const [key, values] of Object.entries(grpcMetadata.headersMap)) {\n if (key.endsWith('-bin')) {\n for (const value of values) {\n for (const item of value.split(/,\\s?/)) {\n metadata.append(key, js_base64_1.Base64.toUint8Array(item));\n }\n }\n }\n else {\n metadata.set(key, values);\n }\n }\n return metadata;\n}\nexports.convertMetadataFromGrpcWeb = convertMetadataFromGrpcWeb;\n//# sourceMappingURL=convertMetadata.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createBidiStreamingMethod = void 0;\nconst nice_grpc_common_1 = require(\"nice-grpc-common\");\nconst grpc_web_1 = require(\"@improbable-eng/grpc-web\");\nconst abort_controller_x_1 = require(\"abort-controller-x\");\nconst AsyncSink_1 = require(\"../utils/AsyncSink\");\nconst service_definitions_1 = require(\"../service-definitions\");\nconst isAsyncIterable_1 = require(\"../utils/isAsyncIterable\");\nconst convertMetadata_1 = require(\"../utils/convertMetadata\");\n/** @internal */\nfunction createBidiStreamingMethod(definition, channel, middleware, defaultOptions) {\n const grpcMethodDefinition = (0, service_definitions_1.toGrpcWebMethodDefinition)(definition);\n const methodDescriptor = {\n path: definition.path,\n requestStream: definition.requestStream,\n responseStream: definition.responseStream,\n options: definition.options,\n };\n async function* bidiStreamingMethod(request, options) {\n if (!(0, isAsyncIterable_1.isAsyncIterable)(request)) {\n throw new Error('A middleware passed invalid request to next(): expected a single message for bidirectional streaming method');\n }\n const { metadata = (0, nice_grpc_common_1.Metadata)(), signal = new AbortController().signal, onHeader, onTrailer, } = options;\n const pipeAbortController = new AbortController();\n const sink = new AsyncSink_1.AsyncSink();\n const client = grpc_web_1.grpc.client(grpcMethodDefinition, {\n host: channel.address,\n transport: channel.transport,\n });\n client.onHeaders(headers => {\n onHeader === null || onHeader === void 0 ? void 0 : onHeader((0, convertMetadata_1.convertMetadataFromGrpcWeb)(headers));\n });\n client.onMessage(message => {\n sink.write(message);\n });\n client.onEnd((code, message, trailers) => {\n onTrailer === null || onTrailer === void 0 ? void 0 : onTrailer((0, convertMetadata_1.convertMetadataFromGrpcWeb)(trailers));\n if (code === grpc_web_1.grpc.Code.OK) {\n sink.end();\n }\n else {\n sink.error(new nice_grpc_common_1.ClientError(definition.path, +code, message));\n }\n });\n client.start((0, convertMetadata_1.convertMetadataToGrpcWeb)(metadata));\n let pipeError;\n pipeRequest(pipeAbortController.signal, request, client, definition).then(() => {\n client.finishSend();\n }, err => {\n if (!(0, abort_controller_x_1.isAbortError)(err)) {\n pipeError = err;\n client.close();\n sink.end();\n }\n });\n const abortListener = () => {\n sink.error(new abort_controller_x_1.AbortError());\n pipeAbortController.abort();\n client.close();\n };\n signal.addEventListener('abort', abortListener);\n try {\n yield* sink;\n }\n finally {\n pipeAbortController.abort();\n signal.removeEventListener('abort', abortListener);\n (0, abort_controller_x_1.throwIfAborted)(signal);\n if (pipeError) {\n throw pipeError;\n }\n }\n }\n const method = middleware == null\n ? bidiStreamingMethod\n : (request, options) => middleware({\n method: methodDescriptor,\n requestStream: true,\n request,\n responseStream: true,\n next: bidiStreamingMethod,\n }, options);\n return (request, options) => {\n const iterable = method(request, {\n ...defaultOptions,\n ...options,\n });\n const iterator = iterable[Symbol.asyncIterator]();\n return {\n [Symbol.asyncIterator]() {\n return {\n async next() {\n const result = await iterator.next();\n if (result.done && result.value != null) {\n return await iterator.throw(new Error('A middleware returned a message, but expected to return void for bidirectional streaming method'));\n }\n return result;\n },\n return() {\n return iterator.return();\n },\n throw(err) {\n return iterator.throw(err);\n },\n };\n },\n };\n };\n}\nexports.createBidiStreamingMethod = createBidiStreamingMethod;\nasync function pipeRequest(signal, request, client, definition) {\n for await (const item of request) {\n (0, abort_controller_x_1.throwIfAborted)(signal);\n client.send({\n serializeBinary: () => definition.requestSerialize(item),\n });\n }\n}\n//# sourceMappingURL=createBidiStreamingMethod.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createClientStreamingMethod = void 0;\nconst nice_grpc_common_1 = require(\"nice-grpc-common\");\nconst grpc_web_1 = require(\"@improbable-eng/grpc-web\");\nconst abort_controller_x_1 = require(\"abort-controller-x\");\nconst service_definitions_1 = require(\"../service-definitions\");\nconst isAsyncIterable_1 = require(\"../utils/isAsyncIterable\");\nconst convertMetadata_1 = require(\"../utils/convertMetadata\");\n/** @internal */\nfunction createClientStreamingMethod(definition, channel, middleware, defaultOptions) {\n const grpcMethodDefinition = (0, service_definitions_1.toGrpcWebMethodDefinition)(definition);\n const methodDescriptor = {\n path: definition.path,\n requestStream: definition.requestStream,\n responseStream: definition.responseStream,\n options: definition.options,\n };\n async function* clientStreamingMethod(request, options) {\n if (!(0, isAsyncIterable_1.isAsyncIterable)(request)) {\n throw new Error('A middleware passed invalid request to next(): expected a single message for client streaming method');\n }\n const { metadata = (0, nice_grpc_common_1.Metadata)(), signal = new AbortController().signal, onHeader, onTrailer, } = options;\n return await (0, abort_controller_x_1.execute)(signal, (resolve, reject) => {\n const pipeAbortController = new AbortController();\n let response;\n const client = grpc_web_1.grpc.client(grpcMethodDefinition, {\n host: channel.address,\n transport: channel.transport,\n });\n client.onHeaders(headers => {\n onHeader === null || onHeader === void 0 ? void 0 : onHeader((0, convertMetadata_1.convertMetadataFromGrpcWeb)(headers));\n });\n client.onMessage(message => {\n response = message;\n });\n client.onEnd((code, message, trailers) => {\n onTrailer === null || onTrailer === void 0 ? void 0 : onTrailer((0, convertMetadata_1.convertMetadataFromGrpcWeb)(trailers));\n pipeAbortController.abort();\n if (code === grpc_web_1.grpc.Code.OK) {\n resolve(response);\n }\n else {\n reject(new nice_grpc_common_1.ClientError(definition.path, +code, message));\n }\n });\n client.start((0, convertMetadata_1.convertMetadataToGrpcWeb)(metadata));\n pipeRequest(pipeAbortController.signal, request, client, definition).then(() => {\n client.finishSend();\n }, err => {\n if (!(0, abort_controller_x_1.isAbortError)(err)) {\n reject(err);\n client.close();\n }\n });\n return () => {\n pipeAbortController.abort();\n client.close();\n };\n });\n }\n const method = middleware == null\n ? clientStreamingMethod\n : (request, options) => middleware({\n method: methodDescriptor,\n requestStream: true,\n request,\n responseStream: false,\n next: clientStreamingMethod,\n }, options);\n return async (request, options) => {\n const iterable = method(request, {\n ...defaultOptions,\n ...options,\n });\n const iterator = iterable[Symbol.asyncIterator]();\n let result = await iterator.next();\n while (true) {\n if (!result.done) {\n result = await iterator.throw(new Error('A middleware yielded a message, but expected to only return a message for client streaming method'));\n continue;\n }\n if (result.value == null) {\n result = await iterator.throw(new Error('A middleware returned void, but expected to return a message for client streaming method'));\n continue;\n }\n return result.value;\n }\n };\n}\nexports.createClientStreamingMethod = createClientStreamingMethod;\nasync function pipeRequest(signal, request, client, definition) {\n for await (const item of request) {\n (0, abort_controller_x_1.throwIfAborted)(signal);\n client.send({\n serializeBinary: () => definition.requestSerialize(item),\n });\n }\n}\n//# sourceMappingURL=createClientStreamingMethod.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createServerStreamingMethod = void 0;\nconst grpc_web_1 = require(\"@improbable-eng/grpc-web\");\nconst abort_controller_x_1 = require(\"abort-controller-x\");\nconst AsyncSink_1 = require(\"../utils/AsyncSink\");\nconst nice_grpc_common_1 = require(\"nice-grpc-common\");\nconst service_definitions_1 = require(\"../service-definitions\");\nconst convertMetadata_1 = require(\"../utils/convertMetadata\");\nconst isAsyncIterable_1 = require(\"../utils/isAsyncIterable\");\n/** @internal */\nfunction createServerStreamingMethod(definition, channel, middleware, defaultOptions) {\n const grpcMethodDefinition = (0, service_definitions_1.toGrpcWebMethodDefinition)(definition);\n const methodDescriptor = {\n path: definition.path,\n requestStream: definition.requestStream,\n responseStream: definition.responseStream,\n options: definition.options,\n };\n async function* serverStreamingMethod(request, options) {\n if ((0, isAsyncIterable_1.isAsyncIterable)(request)) {\n throw new Error('A middleware passed invalid request to next(): expected a single message for server streaming method');\n }\n const { metadata = (0, nice_grpc_common_1.Metadata)(), signal = new AbortController().signal, onHeader, onTrailer, } = options;\n const sink = new AsyncSink_1.AsyncSink();\n const client = grpc_web_1.grpc.client(grpcMethodDefinition, {\n host: channel.address,\n transport: channel.transport,\n });\n client.onHeaders(headers => {\n onHeader === null || onHeader === void 0 ? void 0 : onHeader((0, convertMetadata_1.convertMetadataFromGrpcWeb)(headers));\n });\n client.onMessage(message => {\n sink.write(message);\n });\n client.onEnd((code, message, trailers) => {\n onTrailer === null || onTrailer === void 0 ? void 0 : onTrailer((0, convertMetadata_1.convertMetadataFromGrpcWeb)(trailers));\n if (code === grpc_web_1.grpc.Code.OK) {\n sink.end();\n }\n else {\n sink.error(new nice_grpc_common_1.ClientError(definition.path, +code, message));\n }\n });\n client.start((0, convertMetadata_1.convertMetadataToGrpcWeb)(metadata));\n client.send({\n serializeBinary: () => definition.requestSerialize(request),\n });\n client.finishSend();\n const abortListener = () => {\n sink.error(new abort_controller_x_1.AbortError());\n client.close();\n };\n signal.addEventListener('abort', abortListener);\n try {\n yield* sink;\n }\n finally {\n signal.removeEventListener('abort', abortListener);\n (0, abort_controller_x_1.throwIfAborted)(signal);\n }\n }\n const method = middleware == null\n ? serverStreamingMethod\n : (request, options) => middleware({\n method: methodDescriptor,\n requestStream: false,\n request,\n responseStream: true,\n next: serverStreamingMethod,\n }, options);\n return (request, options) => {\n const iterable = method(request, {\n ...defaultOptions,\n ...options,\n });\n const iterator = iterable[Symbol.asyncIterator]();\n return {\n [Symbol.asyncIterator]() {\n return {\n async next() {\n const result = await iterator.next();\n if (result.done && result.value != null) {\n return await iterator.throw(new Error('A middleware returned a message, but expected to return void for server streaming method'));\n }\n return result;\n },\n return() {\n return iterator.return();\n },\n throw(err) {\n return iterator.throw(err);\n },\n };\n },\n };\n };\n}\nexports.createServerStreamingMethod = createServerStreamingMethod;\n//# sourceMappingURL=createServerStreamingMethod.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createUnaryMethod = void 0;\nconst nice_grpc_common_1 = require(\"nice-grpc-common\");\nconst grpc_web_1 = require(\"@improbable-eng/grpc-web\");\nconst abort_controller_x_1 = require(\"abort-controller-x\");\nconst service_definitions_1 = require(\"../service-definitions\");\nconst isAsyncIterable_1 = require(\"../utils/isAsyncIterable\");\nconst convertMetadata_1 = require(\"../utils/convertMetadata\");\n/** @internal */\nfunction createUnaryMethod(definition, channel, middleware, defaultOptions) {\n const grpcMethodDefinition = (0, service_definitions_1.toGrpcWebMethodDefinition)(definition);\n const methodDescriptor = {\n path: definition.path,\n requestStream: definition.requestStream,\n responseStream: definition.responseStream,\n options: definition.options,\n };\n async function* unaryMethod(request, options) {\n if ((0, isAsyncIterable_1.isAsyncIterable)(request)) {\n throw new Error('A middleware passed invalid request to next(): expected a single message for unary method');\n }\n const { metadata = (0, nice_grpc_common_1.Metadata)(), signal = new AbortController().signal, onHeader, onTrailer, } = options;\n return await (0, abort_controller_x_1.execute)(signal, (resolve, reject) => {\n let response;\n const client = grpc_web_1.grpc.client(grpcMethodDefinition, {\n host: channel.address,\n transport: channel.transport,\n });\n client.onHeaders(headers => {\n onHeader === null || onHeader === void 0 ? void 0 : onHeader((0, convertMetadata_1.convertMetadataFromGrpcWeb)(headers));\n });\n client.onMessage(message => {\n response = message;\n });\n client.onEnd((code, message, trailers) => {\n onTrailer === null || onTrailer === void 0 ? void 0 : onTrailer((0, convertMetadata_1.convertMetadataFromGrpcWeb)(trailers));\n if (code === grpc_web_1.grpc.Code.OK) {\n resolve(response);\n }\n else {\n reject(new nice_grpc_common_1.ClientError(definition.path, +code, message));\n }\n });\n client.start((0, convertMetadata_1.convertMetadataToGrpcWeb)(metadata));\n client.send({\n serializeBinary: () => definition.requestSerialize(request),\n });\n client.finishSend();\n return () => {\n client.close();\n };\n });\n }\n const method = middleware == null\n ? unaryMethod\n : (request, options) => middleware({\n method: methodDescriptor,\n requestStream: false,\n request,\n responseStream: false,\n next: unaryMethod,\n }, options);\n return async (request, options) => {\n const iterable = method(request, {\n ...defaultOptions,\n ...options,\n });\n const iterator = iterable[Symbol.asyncIterator]();\n let result = await iterator.next();\n while (true) {\n if (!result.done) {\n result = await iterator.throw(new Error('A middleware yielded a message, but expected to only return a message for unary method'));\n continue;\n }\n if (result.value == null) {\n result = await iterator.throw(new Error('A middleware returned void, but expected to return a message for unary method'));\n continue;\n }\n return result.value;\n }\n };\n}\nexports.createUnaryMethod = createUnaryMethod;\n//# sourceMappingURL=createUnaryMethod.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createClient = exports.createClientFactory = void 0;\nconst nice_grpc_common_1 = require(\"nice-grpc-common\");\nconst service_definitions_1 = require(\"../service-definitions\");\nconst createBidiStreamingMethod_1 = require(\"./createBidiStreamingMethod\");\nconst createClientStreamingMethod_1 = require(\"./createClientStreamingMethod\");\nconst createServerStreamingMethod_1 = require(\"./createServerStreamingMethod\");\nconst createUnaryMethod_1 = require(\"./createUnaryMethod\");\nfunction createClientFactory() {\n return createClientFactoryWithMiddleware();\n}\nexports.createClientFactory = createClientFactory;\nfunction createClient(definition, channel, defaultCallOptions) {\n return createClientFactory().create(definition, channel, defaultCallOptions);\n}\nexports.createClient = createClient;\nfunction createClientFactoryWithMiddleware(middleware) {\n return {\n use(newMiddleware) {\n return createClientFactoryWithMiddleware(middleware == null\n ? newMiddleware\n : (0, nice_grpc_common_1.composeClientMiddleware)(middleware, newMiddleware));\n },\n create(definition, channel, defaultCallOptions = {}) {\n const client = {};\n const methodEntries = Object.entries((0, service_definitions_1.normalizeServiceDefinition)(definition));\n for (const [methodName, methodDefinition] of methodEntries) {\n const defaultOptions = {\n ...defaultCallOptions['*'],\n ...defaultCallOptions[methodName],\n };\n if (!methodDefinition.requestStream) {\n if (!methodDefinition.responseStream) {\n client[methodName] = (0, createUnaryMethod_1.createUnaryMethod)(methodDefinition, channel, middleware, defaultOptions);\n }\n else {\n client[methodName] = (0, createServerStreamingMethod_1.createServerStreamingMethod)(methodDefinition, channel, middleware, defaultOptions);\n }\n }\n else {\n if (!methodDefinition.responseStream) {\n client[methodName] = (0, createClientStreamingMethod_1.createClientStreamingMethod)(methodDefinition, channel, middleware, defaultOptions);\n }\n else {\n client[methodName] = (0, createBidiStreamingMethod_1.createBidiStreamingMethod)(methodDefinition, channel, middleware, defaultOptions);\n }\n }\n }\n return client;\n },\n };\n}\n//# sourceMappingURL=ClientFactory.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=Client.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Status = exports.Metadata = exports.composeClientMiddleware = exports.ClientError = void 0;\nvar nice_grpc_common_1 = require(\"nice-grpc-common\");\nObject.defineProperty(exports, \"ClientError\", { enumerable: true, get: function () { return nice_grpc_common_1.ClientError; } });\nObject.defineProperty(exports, \"composeClientMiddleware\", { enumerable: true, get: function () { return nice_grpc_common_1.composeClientMiddleware; } });\nObject.defineProperty(exports, \"Metadata\", { enumerable: true, get: function () { return nice_grpc_common_1.Metadata; } });\nObject.defineProperty(exports, \"Status\", { enumerable: true, get: function () { return nice_grpc_common_1.Status; } });\n__exportStar(require(\"./service-definitions\"), exports);\n__exportStar(require(\"./client/channel\"), exports);\n__exportStar(require(\"./client/ClientFactory\"), exports);\n__exportStar(require(\"./client/Client\"), exports);\n//# sourceMappingURL=index.js.map","// protobuf/ts/faucet/faucet.ts\nimport Long from \"long\";\nimport _m0 from \"protobufjs/minimal.js\";\nvar protobufPackage = \"faucet\";\nfunction createBaseLinkedTwitterPair() {\n return { username: \"\", address: \"\" };\n}\nvar LinkedTwitterPair = {\n encode(message, writer = _m0.Writer.create()) {\n if (message.username !== \"\") {\n writer.uint32(10).string(message.username);\n }\n if (message.address !== \"\") {\n writer.uint32(18).string(message.address);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseLinkedTwitterPair();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 10) {\n break;\n }\n message.username = reader.string();\n continue;\n case 2:\n if (tag != 18) {\n break;\n }\n message.address = reader.string();\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return LinkedTwitterPair.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseLinkedTwitterPair();\n message.username = object.username ?? \"\";\n message.address = object.address ?? \"\";\n return message;\n }\n};\nfunction createBaseFaucetStore() {\n return { addressToUsername: {}, usernameToAddress: {}, latestDrip: {}, totalDripCount: 0 };\n}\nvar FaucetStore = {\n encode(message, writer = _m0.Writer.create()) {\n Object.entries(message.addressToUsername).forEach(([key, value]) => {\n FaucetStore_AddressToUsernameEntry.encode({ key, value }, writer.uint32(10).fork()).ldelim();\n });\n Object.entries(message.usernameToAddress).forEach(([key, value]) => {\n FaucetStore_UsernameToAddressEntry.encode({ key, value }, writer.uint32(18).fork()).ldelim();\n });\n Object.entries(message.latestDrip).forEach(([key, value]) => {\n FaucetStore_LatestDripEntry.encode({ key, value }, writer.uint32(26).fork()).ldelim();\n });\n if (message.totalDripCount !== 0) {\n writer.uint32(33).double(message.totalDripCount);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseFaucetStore();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 10) {\n break;\n }\n const entry1 = FaucetStore_AddressToUsernameEntry.decode(reader, reader.uint32());\n if (entry1.value !== void 0) {\n message.addressToUsername[entry1.key] = entry1.value;\n }\n continue;\n case 2:\n if (tag != 18) {\n break;\n }\n const entry2 = FaucetStore_UsernameToAddressEntry.decode(reader, reader.uint32());\n if (entry2.value !== void 0) {\n message.usernameToAddress[entry2.key] = entry2.value;\n }\n continue;\n case 3:\n if (tag != 26) {\n break;\n }\n const entry3 = FaucetStore_LatestDripEntry.decode(reader, reader.uint32());\n if (entry3.value !== void 0) {\n message.latestDrip[entry3.key] = entry3.value;\n }\n continue;\n case 4:\n if (tag != 33) {\n break;\n }\n message.totalDripCount = reader.double();\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return FaucetStore.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseFaucetStore();\n message.addressToUsername = Object.entries(object.addressToUsername ?? {}).reduce(\n (acc, [key, value]) => {\n if (value !== void 0) {\n acc[key] = String(value);\n }\n return acc;\n },\n {}\n );\n message.usernameToAddress = Object.entries(object.usernameToAddress ?? {}).reduce(\n (acc, [key, value]) => {\n if (value !== void 0) {\n acc[key] = String(value);\n }\n return acc;\n },\n {}\n );\n message.latestDrip = Object.entries(object.latestDrip ?? {}).reduce(\n (acc, [key, value]) => {\n if (value !== void 0) {\n acc[key] = Number(value);\n }\n return acc;\n },\n {}\n );\n message.totalDripCount = object.totalDripCount ?? 0;\n return message;\n }\n};\nfunction createBaseFaucetStore_AddressToUsernameEntry() {\n return { key: \"\", value: \"\" };\n}\nvar FaucetStore_AddressToUsernameEntry = {\n encode(message, writer = _m0.Writer.create()) {\n if (message.key !== \"\") {\n writer.uint32(10).string(message.key);\n }\n if (message.value !== \"\") {\n writer.uint32(18).string(message.value);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseFaucetStore_AddressToUsernameEntry();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 10) {\n break;\n }\n message.key = reader.string();\n continue;\n case 2:\n if (tag != 18) {\n break;\n }\n message.value = reader.string();\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return FaucetStore_AddressToUsernameEntry.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseFaucetStore_AddressToUsernameEntry();\n message.key = object.key ?? \"\";\n message.value = object.value ?? \"\";\n return message;\n }\n};\nfunction createBaseFaucetStore_UsernameToAddressEntry() {\n return { key: \"\", value: \"\" };\n}\nvar FaucetStore_UsernameToAddressEntry = {\n encode(message, writer = _m0.Writer.create()) {\n if (message.key !== \"\") {\n writer.uint32(10).string(message.key);\n }\n if (message.value !== \"\") {\n writer.uint32(18).string(message.value);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseFaucetStore_UsernameToAddressEntry();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 10) {\n break;\n }\n message.key = reader.string();\n continue;\n case 2:\n if (tag != 18) {\n break;\n }\n message.value = reader.string();\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return FaucetStore_UsernameToAddressEntry.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseFaucetStore_UsernameToAddressEntry();\n message.key = object.key ?? \"\";\n message.value = object.value ?? \"\";\n return message;\n }\n};\nfunction createBaseFaucetStore_LatestDripEntry() {\n return { key: \"\", value: 0 };\n}\nvar FaucetStore_LatestDripEntry = {\n encode(message, writer = _m0.Writer.create()) {\n if (message.key !== \"\") {\n writer.uint32(10).string(message.key);\n }\n if (message.value !== 0) {\n writer.uint32(16).int64(message.value);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseFaucetStore_LatestDripEntry();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 10) {\n break;\n }\n message.key = reader.string();\n continue;\n case 2:\n if (tag != 16) {\n break;\n }\n message.value = longToNumber(reader.int64());\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return FaucetStore_LatestDripEntry.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseFaucetStore_LatestDripEntry();\n message.key = object.key ?? \"\";\n message.value = object.value ?? 0;\n return message;\n }\n};\nfunction createBaseDripRequest() {\n return { username: \"\", address: \"\" };\n}\nvar DripRequest = {\n encode(message, writer = _m0.Writer.create()) {\n if (message.username !== \"\") {\n writer.uint32(10).string(message.username);\n }\n if (message.address !== \"\") {\n writer.uint32(18).string(message.address);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseDripRequest();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 10) {\n break;\n }\n message.username = reader.string();\n continue;\n case 2:\n if (tag != 18) {\n break;\n }\n message.address = reader.string();\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return DripRequest.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseDripRequest();\n message.username = object.username ?? \"\";\n message.address = object.address ?? \"\";\n return message;\n }\n};\nfunction createBaseDripDevRequest() {\n return { address: \"\" };\n}\nvar DripDevRequest = {\n encode(message, writer = _m0.Writer.create()) {\n if (message.address !== \"\") {\n writer.uint32(10).string(message.address);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseDripDevRequest();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 10) {\n break;\n }\n message.address = reader.string();\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return DripDevRequest.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseDripDevRequest();\n message.address = object.address ?? \"\";\n return message;\n }\n};\nfunction createBaseDripResponse() {\n return { dripTxHash: \"\", ecsTxHash: \"\" };\n}\nvar DripResponse = {\n encode(message, writer = _m0.Writer.create()) {\n if (message.dripTxHash !== \"\") {\n writer.uint32(10).string(message.dripTxHash);\n }\n if (message.ecsTxHash !== \"\") {\n writer.uint32(18).string(message.ecsTxHash);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseDripResponse();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 10) {\n break;\n }\n message.dripTxHash = reader.string();\n continue;\n case 2:\n if (tag != 18) {\n break;\n }\n message.ecsTxHash = reader.string();\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return DripResponse.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseDripResponse();\n message.dripTxHash = object.dripTxHash ?? \"\";\n message.ecsTxHash = object.ecsTxHash ?? \"\";\n return message;\n }\n};\nfunction createBaseTimeUntilDripResponse() {\n return { timeUntilDripMinutes: 0, timeUntilDripSeconds: 0 };\n}\nvar TimeUntilDripResponse = {\n encode(message, writer = _m0.Writer.create()) {\n if (message.timeUntilDripMinutes !== 0) {\n writer.uint32(9).double(message.timeUntilDripMinutes);\n }\n if (message.timeUntilDripSeconds !== 0) {\n writer.uint32(17).double(message.timeUntilDripSeconds);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseTimeUntilDripResponse();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 9) {\n break;\n }\n message.timeUntilDripMinutes = reader.double();\n continue;\n case 2:\n if (tag != 17) {\n break;\n }\n message.timeUntilDripSeconds = reader.double();\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return TimeUntilDripResponse.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseTimeUntilDripResponse();\n message.timeUntilDripMinutes = object.timeUntilDripMinutes ?? 0;\n message.timeUntilDripSeconds = object.timeUntilDripSeconds ?? 0;\n return message;\n }\n};\nfunction createBaseGetLinkedTwittersRequest() {\n return {};\n}\nvar GetLinkedTwittersRequest = {\n encode(_, writer = _m0.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseGetLinkedTwittersRequest();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return GetLinkedTwittersRequest.fromPartial(base ?? {});\n },\n fromPartial(_) {\n const message = createBaseGetLinkedTwittersRequest();\n return message;\n }\n};\nfunction createBaseGetLinkedTwittersResponse() {\n return { linkedTwitters: [] };\n}\nvar GetLinkedTwittersResponse = {\n encode(message, writer = _m0.Writer.create()) {\n for (const v of message.linkedTwitters) {\n LinkedTwitterPair.encode(v, writer.uint32(10).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseGetLinkedTwittersResponse();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 10) {\n break;\n }\n message.linkedTwitters.push(LinkedTwitterPair.decode(reader, reader.uint32()));\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return GetLinkedTwittersResponse.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseGetLinkedTwittersResponse();\n message.linkedTwitters = object.linkedTwitters?.map((e) => LinkedTwitterPair.fromPartial(e)) || [];\n return message;\n }\n};\nfunction createBaseLinkedTwitterForAddressRequest() {\n return { address: \"\" };\n}\nvar LinkedTwitterForAddressRequest = {\n encode(message, writer = _m0.Writer.create()) {\n if (message.address !== \"\") {\n writer.uint32(10).string(message.address);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseLinkedTwitterForAddressRequest();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 10) {\n break;\n }\n message.address = reader.string();\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return LinkedTwitterForAddressRequest.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseLinkedTwitterForAddressRequest();\n message.address = object.address ?? \"\";\n return message;\n }\n};\nfunction createBaseLinkedTwitterForAddressResponse() {\n return { username: \"\" };\n}\nvar LinkedTwitterForAddressResponse = {\n encode(message, writer = _m0.Writer.create()) {\n if (message.username !== \"\") {\n writer.uint32(10).string(message.username);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseLinkedTwitterForAddressResponse();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 10) {\n break;\n }\n message.username = reader.string();\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return LinkedTwitterForAddressResponse.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseLinkedTwitterForAddressResponse();\n message.username = object.username ?? \"\";\n return message;\n }\n};\nfunction createBaseLinkedAddressForTwitterRequest() {\n return { username: \"\" };\n}\nvar LinkedAddressForTwitterRequest = {\n encode(message, writer = _m0.Writer.create()) {\n if (message.username !== \"\") {\n writer.uint32(10).string(message.username);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseLinkedAddressForTwitterRequest();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 10) {\n break;\n }\n message.username = reader.string();\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return LinkedAddressForTwitterRequest.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseLinkedAddressForTwitterRequest();\n message.username = object.username ?? \"\";\n return message;\n }\n};\nfunction createBaseLinkedAddressForTwitterResponse() {\n return { address: \"\" };\n}\nvar LinkedAddressForTwitterResponse = {\n encode(message, writer = _m0.Writer.create()) {\n if (message.address !== \"\") {\n writer.uint32(10).string(message.address);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseLinkedAddressForTwitterResponse();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 10) {\n break;\n }\n message.address = reader.string();\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return LinkedAddressForTwitterResponse.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseLinkedAddressForTwitterResponse();\n message.address = object.address ?? \"\";\n return message;\n }\n};\nfunction createBaseSetLinkedTwitterRequest() {\n return { address: \"\", username: \"\", signature: \"\" };\n}\nvar SetLinkedTwitterRequest = {\n encode(message, writer = _m0.Writer.create()) {\n if (message.address !== \"\") {\n writer.uint32(10).string(message.address);\n }\n if (message.username !== \"\") {\n writer.uint32(18).string(message.username);\n }\n if (message.signature !== \"\") {\n writer.uint32(26).string(message.signature);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseSetLinkedTwitterRequest();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 10) {\n break;\n }\n message.address = reader.string();\n continue;\n case 2:\n if (tag != 18) {\n break;\n }\n message.username = reader.string();\n continue;\n case 3:\n if (tag != 26) {\n break;\n }\n message.signature = reader.string();\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return SetLinkedTwitterRequest.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseSetLinkedTwitterRequest();\n message.address = object.address ?? \"\";\n message.username = object.username ?? \"\";\n message.signature = object.signature ?? \"\";\n return message;\n }\n};\nfunction createBaseSetLinkedTwitterResponse() {\n return {};\n}\nvar SetLinkedTwitterResponse = {\n encode(_, writer = _m0.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseSetLinkedTwitterResponse();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return SetLinkedTwitterResponse.fromPartial(base ?? {});\n },\n fromPartial(_) {\n const message = createBaseSetLinkedTwitterResponse();\n return message;\n }\n};\nvar FaucetServiceDefinition = {\n name: \"FaucetService\",\n fullName: \"faucet.FaucetService\",\n methods: {\n drip: {\n name: \"Drip\",\n requestType: DripRequest,\n requestStream: false,\n responseType: DripResponse,\n responseStream: false,\n options: {}\n },\n dripDev: {\n name: \"DripDev\",\n requestType: DripDevRequest,\n requestStream: false,\n responseType: DripResponse,\n responseStream: false,\n options: {}\n },\n dripVerifyTweet: {\n name: \"DripVerifyTweet\",\n requestType: DripRequest,\n requestStream: false,\n responseType: DripResponse,\n responseStream: false,\n options: {}\n },\n timeUntilDrip: {\n name: \"TimeUntilDrip\",\n requestType: DripRequest,\n requestStream: false,\n responseType: TimeUntilDripResponse,\n responseStream: false,\n options: {}\n },\n getLinkedTwitters: {\n name: \"GetLinkedTwitters\",\n requestType: GetLinkedTwittersRequest,\n requestStream: false,\n responseType: GetLinkedTwittersResponse,\n responseStream: false,\n options: {}\n },\n getLinkedTwitterForAddress: {\n name: \"GetLinkedTwitterForAddress\",\n requestType: LinkedTwitterForAddressRequest,\n requestStream: false,\n responseType: LinkedTwitterForAddressResponse,\n responseStream: false,\n options: {}\n },\n getLinkedAddressForTwitter: {\n name: \"GetLinkedAddressForTwitter\",\n requestType: LinkedAddressForTwitterRequest,\n requestStream: false,\n responseType: LinkedAddressForTwitterResponse,\n responseStream: false,\n options: {}\n },\n /** Admin utility endpoints for modifying state. Requires a signature with faucet private key. */\n setLinkedTwitter: {\n name: \"SetLinkedTwitter\",\n requestType: SetLinkedTwitterRequest,\n requestStream: false,\n responseType: SetLinkedTwitterResponse,\n responseStream: false,\n options: {}\n }\n }\n};\nvar tsProtoGlobalThis = (() => {\n if (typeof globalThis !== \"undefined\") {\n return globalThis;\n }\n if (typeof self !== \"undefined\") {\n return self;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n throw \"Unable to locate global object\";\n})();\nfunction longToNumber(long) {\n if (long.gt(Number.MAX_SAFE_INTEGER)) {\n throw new tsProtoGlobalThis.Error(\"Value is larger than Number.MAX_SAFE_INTEGER\");\n }\n return long.toNumber();\n}\nif (_m0.util.Long !== Long) {\n _m0.util.Long = Long;\n _m0.configure();\n}\n\n// ts/faucet/createFaucetService.ts\nimport { createChannel, createClient } from \"nice-grpc-web\";\nfunction createFaucetService(url) {\n return createClient(FaucetServiceDefinition, createChannel(url));\n}\nexport {\n DripDevRequest,\n DripRequest,\n DripResponse,\n FaucetServiceDefinition,\n FaucetStore,\n FaucetStore_AddressToUsernameEntry,\n FaucetStore_LatestDripEntry,\n FaucetStore_UsernameToAddressEntry,\n GetLinkedTwittersRequest,\n GetLinkedTwittersResponse,\n LinkedAddressForTwitterRequest,\n LinkedAddressForTwitterResponse,\n LinkedTwitterForAddressRequest,\n LinkedTwitterForAddressResponse,\n LinkedTwitterPair,\n SetLinkedTwitterRequest,\n SetLinkedTwitterResponse,\n TimeUntilDripResponse,\n createFaucetService,\n protobufPackage\n};\n//# sourceMappingURL=faucet.js.map","// src/arbitrum.ts\nvar arbitrum = {\n id: 42161,\n name: \"Arbitrum One\",\n network: \"arbitrum\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n alchemy: {\n http: [\"https://arb-mainnet.g.alchemy.com/v2\"],\n webSocket: [\"wss://arb-mainnet.g.alchemy.com/v2\"]\n },\n infura: {\n http: [\"https://arbitrum-mainnet.infura.io/v3\"],\n webSocket: [\"wss://arbitrum-mainnet.infura.io/ws/v3\"]\n },\n default: {\n http: [\"https://arb1.arbitrum.io/rpc\"]\n },\n public: {\n http: [\"https://arb1.arbitrum.io/rpc\"]\n }\n },\n blockExplorers: {\n etherscan: { name: \"Arbiscan\", url: \"https://arbiscan.io\" },\n default: { name: \"Arbiscan\", url: \"https://arbiscan.io\" }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 7654707\n }\n }\n};\n\n// src/arbitrumGoerli.ts\nvar arbitrumGoerli = {\n id: 421613,\n name: \"Arbitrum Goerli\",\n network: \"arbitrum-goerli\",\n nativeCurrency: {\n name: \"Arbitrum Goerli Ether\",\n symbol: \"ETH\",\n decimals: 18\n },\n rpcUrls: {\n alchemy: {\n http: [\"https://arb-goerli.g.alchemy.com/v2\"],\n webSocket: [\"wss://arb-goerli.g.alchemy.com/v2\"]\n },\n infura: {\n http: [\"https://arbitrum-goerli.infura.io/v3\"],\n webSocket: [\"wss://arbitrum-goerli.infura.io/ws/v3\"]\n },\n default: {\n http: [\"https://goerli-rollup.arbitrum.io/rpc\"]\n },\n public: {\n http: [\"https://goerli-rollup.arbitrum.io/rpc\"]\n }\n },\n blockExplorers: {\n etherscan: { name: \"Arbiscan\", url: \"https://goerli.arbiscan.io/\" },\n default: { name: \"Arbiscan\", url: \"https://goerli.arbiscan.io/\" }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 88114\n }\n },\n testnet: true\n};\n\n// src/arbitrumNova.ts\nvar arbitrumNova = {\n id: 42170,\n name: \"Arbitrum Nova\",\n network: \"arbitrum-nova\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n blast: {\n http: [\"https://arbitrum-nova.public.blastapi.io\"],\n webSocket: [\"wss://arbitrum-nova.public.blastapi.io\"]\n },\n default: {\n http: [\"https://nova.arbitrum.io/rpc\"]\n },\n public: {\n http: [\"https://nova.arbitrum.io/rpc\"]\n }\n },\n blockExplorers: {\n etherscan: { name: \"Arbiscan\", url: \"https://nova.arbiscan.io\" },\n blockScout: {\n name: \"BlockScout\",\n url: \"https://nova-explorer.arbitrum.io/\"\n },\n default: { name: \"Arbiscan\", url: \"https://nova.arbiscan.io\" }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 1746963\n }\n }\n};\n\n// src/aurora.ts\nvar aurora = {\n id: 1313161554,\n name: \"Aurora\",\n network: \"aurora\",\n nativeCurrency: {\n decimals: 18,\n name: \"Ether\",\n symbol: \"ETH\"\n },\n rpcUrls: {\n infura: { http: [\"https://aurora-mainnet.infura.io/v3\"] },\n default: { http: [\"https://mainnet.aurora.dev\"] },\n public: { http: [\"https://mainnet.aurora.dev\"] }\n },\n blockExplorers: {\n etherscan: { name: \"Aurorascan\", url: \"https://aurorascan.dev\" },\n default: { name: \"Aurorascan\", url: \"https://aurorascan.dev\" }\n }\n};\n\n// src/auroraTestnet.ts\nvar auroraTestnet = {\n id: 1313161555,\n name: \"Aurora Testnet\",\n network: \"aurora-testnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"Ether\",\n symbol: \"ETH\"\n },\n rpcUrls: {\n infura: { http: [\"https://aurora-testnet.infura.io/v3\"] },\n default: { http: [\"https://testnet.aurora.dev\"] },\n public: { http: [\"https://testnet.aurora.dev\"] }\n },\n blockExplorers: {\n etherscan: { name: \"Aurorascan\", url: \"https://testnet.aurorascan.dev\" },\n default: { name: \"Aurorascan\", url: \"https://testnet.aurorascan.dev\" }\n },\n testnet: true\n};\n\n// src/avalanche.ts\nvar avalanche = {\n id: 43114,\n name: \"Avalanche\",\n network: \"avalanche\",\n nativeCurrency: {\n decimals: 18,\n name: \"Avalanche\",\n symbol: \"AVAX\"\n },\n rpcUrls: {\n default: { http: [\"https://api.avax.network/ext/bc/C/rpc\"] },\n public: { http: [\"https://api.avax.network/ext/bc/C/rpc\"] }\n },\n blockExplorers: {\n etherscan: { name: \"SnowTrace\", url: \"https://snowtrace.io\" },\n default: { name: \"SnowTrace\", url: \"https://snowtrace.io\" }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 11907934\n }\n }\n};\n\n// src/avalancheFuji.ts\nvar avalancheFuji = {\n id: 43113,\n name: \"Avalanche Fuji\",\n network: \"avalanche-fuji\",\n nativeCurrency: {\n decimals: 18,\n name: \"Avalanche Fuji\",\n symbol: \"AVAX\"\n },\n rpcUrls: {\n default: { http: [\"https://api.avax-test.network/ext/bc/C/rpc\"] },\n public: { http: [\"https://api.avax-test.network/ext/bc/C/rpc\"] }\n },\n blockExplorers: {\n etherscan: { name: \"SnowTrace\", url: \"https://testnet.snowtrace.io\" },\n default: { name: \"SnowTrace\", url: \"https://testnet.snowtrace.io\" }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 7096959\n }\n },\n testnet: true\n};\n\n// src/base.ts\nvar base = {\n id: 8453,\n network: \"base\",\n name: \"Base\",\n nativeCurrency: { name: \"Base\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://developer-access-mainnet.base.org\"]\n },\n public: {\n http: [\"https://developer-access-mainnet.base.org\"]\n }\n },\n blockExplorers: {\n blockscout: {\n name: \"Basescout\",\n url: \"https://base.blockscout.com\"\n },\n default: {\n name: \"Basescan\",\n url: \"https://basescan.org\"\n },\n etherscan: {\n name: \"Basescan\",\n url: \"https://basescan.org\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 5022\n }\n }\n};\n\n// src/baseGoerli.ts\nvar baseGoerli = {\n id: 84531,\n network: \"base-goerli\",\n name: \"Base Goerli\",\n nativeCurrency: { name: \"Base Goerli\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://goerli.base.org\"]\n },\n public: {\n http: [\"https://goerli.base.org\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"Basescan\",\n url: \"https://goerli.basescan.org\"\n },\n default: {\n name: \"Basescan\",\n url: \"https://goerli.basescan.org\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 1376988\n }\n },\n testnet: true\n};\n\n// src/bearNetworkChainMainnet.ts\nvar bearNetworkChainMainnet = {\n id: 641230,\n name: \"Bear Network Chain Mainnet\",\n network: \"BearNetworkChainMainnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"BearNetworkChain\",\n symbol: \"BRNKC\"\n },\n rpcUrls: {\n public: { http: [\"https://brnkc-mainnet.bearnetwork.net\"] },\n default: { http: [\"https://brnkc-mainnet.bearnetwork.net\"] }\n },\n blockExplorers: {\n default: { name: \"BrnkScan\", url: \"https://brnkscan.bearnetwork.net\" }\n }\n};\n\n// src/bearNetworkChainTestnet.ts\nvar bearNetworkChainTestnet = {\n id: 751230,\n name: \"Bear Network Chain Testnet\",\n network: \"BearNetworkChainTestnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"tBRNKC\",\n symbol: \"tBRNKC\"\n },\n rpcUrls: {\n public: { http: [\"https://brnkc-test.bearnetwork.net\"] },\n default: { http: [\"https://brnkc-test.bearnetwork.net\"] }\n },\n blockExplorers: {\n default: {\n name: \"BrnkTestScan\",\n url: \"https://brnktest-scan.bearnetwork.net\"\n }\n },\n testnet: true\n};\n\n// src/boba.ts\nvar boba = {\n id: 288,\n name: \"Boba Network\",\n network: \"boba\",\n nativeCurrency: {\n decimals: 18,\n name: \"Boba\",\n symbol: \"BOBA\"\n },\n rpcUrls: {\n default: { http: [\"https://mainnet.boba.network\"] },\n public: { http: [\"https://mainnet.boba.network\"] }\n },\n blockExplorers: {\n etherscan: { name: \"BOBAScan\", url: \"https://bobascan.com\" },\n default: { name: \"BOBAScan\", url: \"https://bobascan.com\" }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 446859\n }\n }\n};\n\n// src/bronos.ts\nvar bronos = {\n id: 1039,\n name: \"Bronos\",\n network: \"bronos\",\n nativeCurrency: {\n decimals: 18,\n name: \"BRO\",\n symbol: \"BRO\"\n },\n rpcUrls: {\n default: { http: [\"https://evm.bronos.org\"] },\n public: { http: [\"https://evm.bronos.org\"] }\n },\n blockExplorers: {\n default: { name: \"BronoScan\", url: \"https://broscan.bronos.org\" }\n }\n};\n\n// src/bronosTestnet.ts\nvar bronosTestnet = {\n id: 1038,\n name: \"Bronos Testnet\",\n network: \"bronos-testnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"Bronos Coin\",\n symbol: \"tBRO\"\n },\n rpcUrls: {\n default: { http: [\"https://evm-testnet.bronos.org\"] },\n public: { http: [\"https://evm-testnet.bronos.org\"] }\n },\n blockExplorers: {\n default: { name: \"BronoScan\", url: \"https://tbroscan.bronos.org\" }\n },\n testnet: true\n};\n\n// src/bsc.ts\nvar bsc = {\n id: 56,\n name: \"BNB Smart Chain\",\n network: \"bsc\",\n nativeCurrency: {\n decimals: 18,\n name: \"BNB\",\n symbol: \"BNB\"\n },\n rpcUrls: {\n default: { http: [\"https://rpc.ankr.com/bsc\"] },\n public: { http: [\"https://rpc.ankr.com/bsc\"] }\n },\n blockExplorers: {\n etherscan: { name: \"BscScan\", url: \"https://bscscan.com\" },\n default: { name: \"BscScan\", url: \"https://bscscan.com\" }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 15921452\n }\n }\n};\n\n// src/bscTestnet.ts\nvar bscTestnet = {\n id: 97,\n name: \"Binance Smart Chain Testnet\",\n network: \"bsc-testnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"BNB\",\n symbol: \"tBNB\"\n },\n rpcUrls: {\n default: { http: [\"https://data-seed-prebsc-1-s1.binance.org:8545\"] },\n public: { http: [\"https://data-seed-prebsc-1-s1.binance.org:8545\"] }\n },\n blockExplorers: {\n etherscan: { name: \"BscScan\", url: \"https://testnet.bscscan.com\" },\n default: { name: \"BscScan\", url: \"https://testnet.bscscan.com\" }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 17422483\n }\n },\n testnet: true\n};\n\n// src/bxn.ts\nvar bxn = {\n id: 4999,\n name: \"BlackFort Exchange Network\",\n network: \"bxn\",\n nativeCurrency: { name: \"BlackFort Token\", symbol: \"BXN\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://mainnet.blackfort.network/rpc\"]\n },\n public: {\n http: [\"https://mainnet.blackfort.network/rpc\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Blockscout\",\n url: \"https://explorer.blackfort.network\"\n }\n }\n};\n\n// src/bxnTestnet.ts\nvar bxnTestnet = {\n id: 4777,\n name: \"BlackFort Exchange Network Testnet\",\n network: \"bxnTestnet\",\n nativeCurrency: {\n name: \"BlackFort Testnet Token\",\n symbol: \"TBXN\",\n decimals: 18\n },\n rpcUrls: {\n default: {\n http: [\"https://testnet.blackfort.network/rpc\"]\n },\n public: {\n http: [\"https://testnet.blackfort.network/rpc\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Blockscout\",\n url: \"https://testnet-explorer.blackfort.network\"\n }\n }\n};\n\n// src/canto.ts\nvar canto = {\n id: 7700,\n name: \"Canto\",\n network: \"canto\",\n nativeCurrency: {\n decimals: 18,\n name: \"Canto\",\n symbol: \"CANTO\"\n },\n rpcUrls: {\n default: { http: [\"https://canto.gravitychain.io\"] },\n public: { http: [\"https://canto.gravitychain.io\"] }\n },\n blockExplorers: {\n default: {\n name: \"Tuber.Build (Blockscout)\",\n url: \"https://tuber.build\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 2905789\n }\n }\n};\n\n// src/celo.ts\nvar celo = {\n id: 42220,\n name: \"Celo\",\n network: \"celo\",\n nativeCurrency: {\n decimals: 18,\n name: \"CELO\",\n symbol: \"CELO\"\n },\n rpcUrls: {\n default: { http: [\"https://forno.celo.org\"] },\n infura: {\n http: [\"https://celo-mainnet.infura.io/v3\"]\n },\n public: {\n http: [\"https://forno.celo.org\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Celo Explorer\",\n url: \"https://explorer.celo.org/mainnet\"\n },\n etherscan: { name: \"CeloScan\", url: \"https://celoscan.io\" }\n },\n contracts: {\n multicall3: {\n address: \"0xcA11bde05977b3631167028862bE2a173976CA11\",\n blockCreated: 13112599\n }\n },\n testnet: false\n};\n\n// src/celoAlfajores.ts\nvar celoAlfajores = {\n id: 44787,\n name: \"Alfajores\",\n network: \"celo-alfajores\",\n nativeCurrency: {\n decimals: 18,\n name: \"CELO\",\n symbol: \"A-CELO\"\n },\n rpcUrls: {\n default: {\n http: [\"https://alfajores-forno.celo-testnet.org\"]\n },\n infura: {\n http: [\"https://celo-alfajores.infura.io/v3\"]\n },\n public: {\n http: [\"https://alfajores-forno.celo-testnet.org\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Celo Explorer\",\n url: \"https://explorer.celo.org/alfajores\"\n },\n etherscan: { name: \"CeloScan\", url: \"https://alfajores.celoscan.io/\" }\n },\n contracts: {\n multicall3: {\n address: \"0xcA11bde05977b3631167028862bE2a173976CA11\",\n blockCreated: 14569001\n }\n },\n testnet: true\n};\n\n// src/celoCannoli.ts\nvar celoCannoli = {\n id: 17323,\n name: \"Cannoli\",\n network: \"celo-cannoli\",\n nativeCurrency: {\n decimals: 18,\n name: \"CELO\",\n symbol: \"C-CELO\"\n },\n rpcUrls: {\n default: {\n http: [\"https://forno.cannoli.celo-testnet.org\"]\n },\n public: {\n http: [\"https://forno.cannoli.celo-testnet.org\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Celo Explorer\",\n url: \"https://explorer.celo.org/cannoli\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0x5Acb0aa8BF4E8Ff0d882Ee187140713C12BF9718\",\n blockCreated: 87429\n }\n },\n testnet: true\n};\n\n// src/confluxESpace.ts\nvar confluxESpace = {\n id: 1030,\n name: \"Conflux eSpace\",\n network: \"cfx-espace\",\n nativeCurrency: { name: \"Conflux\", symbol: \"CFX\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://evm.confluxrpc.org\"]\n },\n public: {\n http: [\"https://evm.confluxrpc.org\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"ConfluxScan\",\n url: \"https://evm.confluxscan.io\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xEFf0078910f638cd81996cc117bccD3eDf2B072F\",\n blockCreated: 68602935\n }\n }\n};\n\n// src/cronos.ts\nvar cronos = {\n id: 25,\n name: \"Cronos\",\n network: \"cronos\",\n nativeCurrency: {\n decimals: 18,\n name: \"Cronos\",\n symbol: \"CRO\"\n },\n rpcUrls: {\n default: { http: [\"https://node.croswap.com/rpc\"] },\n public: { http: [\"https://node.croswap.com/rpc\"] }\n },\n blockExplorers: {\n default: { name: \"CronosScan\", url: \"https://cronoscan.com\" }\n },\n contracts: {\n multicall3: {\n address: \"0xcA11bde05977b3631167028862bE2a173976CA11\",\n blockCreated: 1963112\n }\n }\n};\n\n// src/cronosTestnet.ts\nvar cronosTestnet = {\n id: 338,\n name: \"Cronos Testnet\",\n network: \"cronos-testnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"CRO\",\n symbol: \"tCRO\"\n },\n rpcUrls: {\n default: { http: [\"https://evm-t3.cronos.org\"] },\n public: { http: [\"https://evm-t3.cronos.org\"] }\n },\n blockExplorers: {\n default: {\n name: \"Cronos Explorer\",\n url: \"https://cronos.org/explorer/testnet3\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xcA11bde05977b3631167028862bE2a173976CA11\",\n blockCreated: 10191251\n }\n },\n testnet: true\n};\n\n// src/crossbell.ts\nvar crossbell = {\n id: 3737,\n network: \"crossbell\",\n name: \"Crossbell\",\n nativeCurrency: {\n decimals: 18,\n name: \"CSB\",\n symbol: \"CSB\"\n },\n rpcUrls: {\n default: {\n http: [\"https://rpc.crossbell.io\"]\n },\n public: {\n http: [\"https://rpc.crossbell.io\"]\n }\n },\n blockExplorers: {\n default: { name: \"CrossScan\", url: \"https://scan.crossbell.io\" }\n },\n contracts: {\n multicall3: {\n address: \"0xBB9759009cDaC82774EfC84D94cD9F7440f75Fcf\",\n blockCreated: 23499787\n }\n }\n};\n\n// src/dfk.ts\nvar dfk = {\n id: 53935,\n name: \"DFK Chain\",\n network: \"dfk\",\n nativeCurrency: {\n decimals: 18,\n name: \"Jewel\",\n symbol: \"JEWEL\"\n },\n rpcUrls: {\n default: {\n http: [\"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc\"]\n },\n public: {\n http: [\"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"DFKSubnetScan\",\n url: \"https://subnets.avax.network/defi-kingdoms\"\n },\n default: {\n name: \"DFKSubnetScan\",\n url: \"https://subnets.avax.network/defi-kingdoms\"\n }\n }\n};\n\n// src/dogechain.ts\nvar dogechain = {\n id: 2e3,\n name: \"Dogechain\",\n network: \"dogechain\",\n nativeCurrency: {\n decimals: 18,\n name: \"Dogechain\",\n symbol: \"DC\"\n },\n rpcUrls: {\n default: { http: [\"https://rpc.dogechain.dog\"] },\n public: { http: [\"https://rpc.dogechain.dog\"] }\n },\n blockExplorers: {\n etherscan: {\n name: \"DogeChainExplorer\",\n url: \"https://explorer.dogechain.dog\"\n },\n default: {\n name: \"DogeChainExplorer\",\n url: \"https://explorer.dogechain.dog\"\n }\n }\n};\n\n// src/edgeware.ts\nvar edgeware = {\n id: 2021,\n name: \"Edgeware EdgeEVM Mainnet\",\n network: \"edgeware\",\n nativeCurrency: {\n decimals: 18,\n name: \"Edgeware\",\n symbol: \"EDG\"\n },\n rpcUrls: {\n default: { http: [\"https://edgeware-evm.jelliedowl.net\"] },\n public: { http: [\"https://edgeware-evm.jelliedowl.net\"] }\n },\n blockExplorers: {\n etherscan: { name: \"Edgscan by Bharathcoorg\", url: \"https://edgscan.live\" },\n default: { name: \"Edgscan by Bharathcoorg\", url: \"https://edgscan.live\" }\n },\n contracts: {\n multicall3: {\n address: \"0xDDF47eEB4e5FF4AA60e063E0Ec4f7C35B47Ed445\",\n blockCreated: 17126780\n }\n }\n};\n\n// src/edgewareTestnet.ts\nvar edgewareTestnet = {\n id: 2022,\n name: \"Beresheet BereEVM Testnet\",\n network: \"edgewareTestnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"Testnet EDG\",\n symbol: \"tEDG\"\n },\n rpcUrls: {\n default: { http: [\"https://beresheet-evm.jelliedowl.net\"] },\n public: { http: [\"https://beresheet-evm.jelliedowl.net\"] }\n },\n blockExplorers: {\n etherscan: {\n name: \"Edgscan by Bharathcoorg\",\n url: \"https://testnet.edgscan.live\"\n },\n default: {\n name: \"Edgscan by Bharathcoorg\",\n url: \"https://testnet.edgscan.live\"\n }\n }\n};\n\n// src/eos.ts\nvar eos = {\n id: 17777,\n name: \"EOS EVM\",\n network: \"eos\",\n nativeCurrency: {\n decimals: 18,\n name: \"EOS\",\n symbol: \"EOS\"\n },\n rpcUrls: {\n default: { http: [\"https://api.evm.eosnetwork.com\"] },\n public: { http: [\"https://api.evm.eosnetwork.com\"] }\n },\n blockExplorers: {\n etherscan: {\n name: \"EOS EVM Explorer\",\n url: \"https://explorer.evm.eosnetwork.com\"\n },\n default: {\n name: \"EOS EVM Explorer\",\n url: \"https://explorer.evm.eosnetwork.com\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 7943933\n }\n }\n};\n\n// src/eosTestnet.ts\nvar eosTestnet = {\n id: 15557,\n name: \"EOS EVM Testnet\",\n network: \"eos\",\n nativeCurrency: {\n decimals: 18,\n name: \"EOS\",\n symbol: \"EOS\"\n },\n rpcUrls: {\n default: { http: [\"https://api.testnet.evm.eosnetwork.com\"] },\n public: { http: [\"https://api.testnet.evm.eosnetwork.com\"] }\n },\n blockExplorers: {\n etherscan: {\n name: \"EOS EVM Testnet Explorer\",\n url: \"https://explorer.testnet.evm.eosnetwork.com\"\n },\n default: {\n name: \"EOS EVM Testnet Explorer\",\n url: \"https://explorer.testnet.evm.eosnetwork.com\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 9067940\n }\n },\n testnet: true\n};\n\n// src/evmos.ts\nvar evmos = {\n id: 9001,\n name: \"Evmos\",\n network: \"evmos\",\n nativeCurrency: {\n decimals: 18,\n name: \"Evmos\",\n symbol: \"EVMOS\"\n },\n rpcUrls: {\n default: { http: [\"https://eth.bd.evmos.org:8545\"] },\n public: { http: [\"https://eth.bd.evmos.org:8545\"] }\n },\n blockExplorers: {\n default: { name: \"Evmos Block Explorer\", url: \"https://escan.live\" }\n }\n};\n\n// src/evmosTestnet.ts\nvar evmosTestnet = {\n id: 9e3,\n name: \"Evmos Testnet\",\n network: \"evmos-testnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"Evmos\",\n symbol: \"EVMOS\"\n },\n rpcUrls: {\n default: { http: [\"https://eth.bd.evmos.dev:8545\"] },\n public: { http: [\"https://eth.bd.evmos.dev:8545\"] }\n },\n blockExplorers: {\n default: {\n name: \"Evmos Testnet Block Explorer\",\n url: \"https://evm.evmos.dev/\"\n }\n }\n};\n\n// src/ekta.ts\nvar ekta = {\n id: 1994,\n name: \"Ekta\",\n network: \"ekta\",\n nativeCurrency: {\n decimals: 18,\n name: \"EKTA\",\n symbol: \"EKTA\"\n },\n rpcUrls: {\n public: { http: [\"https://main.ekta.io\"] },\n default: { http: [\"https://main.ekta.io\"] }\n },\n blockExplorers: {\n default: { name: \"Ektascan\", url: \"https://ektascan.io\" }\n }\n};\n\n// src/ektaTestnet.ts\nvar ektaTestnet = {\n id: 1004,\n name: \"Ekta Testnet\",\n network: \"ekta-testnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"EKTA\",\n symbol: \"EKTA\"\n },\n rpcUrls: {\n public: { http: [\"https://test.ekta.io:8545\"] },\n default: { http: [\"https://test.ekta.io:8545\"] }\n },\n blockExplorers: {\n default: { name: \"Test Ektascan\", url: \"https://test.ektascan.io\" }\n },\n testnet: true\n};\n\n// src/fantom.ts\nvar fantom = {\n id: 250,\n name: \"Fantom\",\n network: \"fantom\",\n nativeCurrency: {\n decimals: 18,\n name: \"Fantom\",\n symbol: \"FTM\"\n },\n rpcUrls: {\n default: { http: [\"https://rpc.ankr.com/fantom\"] },\n public: { http: [\"https://rpc.ankr.com/fantom\"] }\n },\n blockExplorers: {\n etherscan: { name: \"FTMScan\", url: \"https://ftmscan.com\" },\n default: { name: \"FTMScan\", url: \"https://ftmscan.com\" }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 33001987\n }\n }\n};\n\n// src/fantomTestnet.ts\nvar fantomTestnet = {\n id: 4002,\n name: \"Fantom Testnet\",\n network: \"fantom-testnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"Fantom\",\n symbol: \"FTM\"\n },\n rpcUrls: {\n default: { http: [\"https://rpc.testnet.fantom.network\"] },\n public: { http: [\"https://rpc.testnet.fantom.network\"] }\n },\n blockExplorers: {\n etherscan: { name: \"FTMScan\", url: \"https://testnet.ftmscan.com\" },\n default: { name: \"FTMScan\", url: \"https://testnet.ftmscan.com\" }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 8328688\n }\n }\n};\n\n// src/fibo.ts\nvar fibo = {\n id: 12306,\n name: \"Fibo Chain\",\n network: \"fibochain\",\n nativeCurrency: {\n decimals: 18,\n name: \"fibo\",\n symbol: \"FIBO\"\n },\n rpcUrls: {\n default: { http: [\"https://network.hzroc.art\"] },\n public: { http: [\"https://network.hzroc.art\"] }\n },\n blockExplorers: {\n default: { name: \"FiboScan\", url: \"https://scan.fibochain.org\" }\n }\n};\n\n// src/filecoin.ts\nvar filecoin = {\n id: 314,\n name: \"Filecoin Mainnet\",\n network: \"filecoin-mainnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"filecoin\",\n symbol: \"FIL\"\n },\n rpcUrls: {\n default: { http: [\"https://api.node.glif.io/rpc/v1\"] },\n public: { http: [\"https://api.node.glif.io/rpc/v1\"] }\n },\n blockExplorers: {\n default: { name: \"Filfox\", url: \"https://filfox.info/en\" },\n filscan: { name: \"Filscan\", url: \"https://filscan.io\" },\n filscout: { name: \"Filscout\", url: \"https://filscout.io/en\" },\n glif: { name: \"Glif\", url: \"https://explorer.glif.io\" }\n }\n};\n\n// src/filecoinCalibration.ts\nvar filecoinCalibration = {\n id: 314159,\n name: \"Filecoin Calibration\",\n network: \"filecoin-calibration\",\n nativeCurrency: {\n decimals: 18,\n name: \"testnet filecoin\",\n symbol: \"tFIL\"\n },\n rpcUrls: {\n default: { http: [\"https://api.calibration.node.glif.io/rpc/v1\"] },\n public: { http: [\"https://api.calibration.node.glif.io/rpc/v1\"] }\n },\n blockExplorers: {\n default: { name: \"Filscan\", url: \"https://calibration.filscan.io\" }\n }\n};\n\n// src/filecoinHyperspace.ts\nvar filecoinHyperspace = {\n id: 3141,\n name: \"Filecoin Hyperspace\",\n network: \"filecoin-hyperspace\",\n nativeCurrency: {\n decimals: 18,\n name: \"testnet filecoin\",\n symbol: \"tFIL\"\n },\n rpcUrls: {\n default: { http: [\"https://api.hyperspace.node.glif.io/rpc/v1\"] },\n public: { http: [\"https://api.hyperspace.node.glif.io/rpc/v1\"] }\n },\n blockExplorers: {\n default: { name: \"Filfox\", url: \"https://hyperspace.filfox.info/en\" },\n filscan: { name: \"Filscan\", url: \"https://hyperspace.filscan.io\" }\n }\n};\n\n// src/flare.ts\nvar flare = {\n id: 14,\n name: \"Flare Mainnet\",\n network: \"flare-mainnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"flare\",\n symbol: \"FLR\"\n },\n rpcUrls: {\n default: { http: [\"https://flare-api.flare.network/ext/C/rpc\"] },\n public: { http: [\"https://flare-api.flare.network/ext/C/rpc\"] }\n },\n blockExplorers: {\n default: {\n name: \"Flare Explorer\",\n url: \"https://flare-explorer.flare.network\"\n }\n }\n};\n\n// src/flareTestnet.ts\nvar flareTestnet = {\n id: 114,\n name: \"Coston2\",\n network: \"coston2\",\n nativeCurrency: {\n decimals: 18,\n name: \"coston2flare\",\n symbol: \"C2FLR\"\n },\n rpcUrls: {\n default: { http: [\"https://coston2-api.flare.network/ext/C/rpc\"] },\n public: { http: [\"https://coston2-api.flare.network/ext/C/rpc\"] }\n },\n blockExplorers: {\n default: {\n name: \"Coston2 Explorer\",\n url: \"https://coston2-explorer.flare.network\"\n }\n },\n testnet: true\n};\n\n// src/foundry.ts\nvar foundry = {\n id: 31337,\n name: \"Foundry\",\n network: \"foundry\",\n nativeCurrency: {\n decimals: 18,\n name: \"Ether\",\n symbol: \"ETH\"\n },\n rpcUrls: {\n default: {\n http: [\"http://127.0.0.1:8545\"],\n webSocket: [\"ws://127.0.0.1:8545\"]\n },\n public: {\n http: [\"http://127.0.0.1:8545\"],\n webSocket: [\"ws://127.0.0.1:8545\"]\n }\n }\n};\n\n// src/fuse.ts\nvar fuse = {\n id: 122,\n name: \"Fuse\",\n network: \"fuse\",\n nativeCurrency: { name: \"Fuse\", symbol: \"FUSE\", decimals: 18 },\n rpcUrls: {\n default: { http: [\"https://rpc.fuse.io\"] },\n public: { http: [\"https://fuse-mainnet.chainstacklabs.com\"] }\n },\n blockExplorers: {\n default: { name: \"Fuse Explorer\", url: \"https://explorer.fuse.io\" }\n }\n};\n\n// src/iotex.ts\nvar iotex = {\n id: 4689,\n name: \"IoTeX\",\n network: \"iotex\",\n nativeCurrency: {\n decimals: 18,\n name: \"IoTeX\",\n symbol: \"IOTX\"\n },\n rpcUrls: {\n default: {\n http: [\"https://babel-api.mainnet.iotex.io\"],\n webSocket: [\"wss://babel-api.mainnet.iotex.io\"]\n },\n public: {\n http: [\"https://babel-api.mainnet.iotex.io\"],\n webSocket: [\"wss://babel-api.mainnet.iotex.io\"]\n }\n },\n blockExplorers: {\n default: { name: \"IoTeXScan\", url: \"https://iotexscan.io\" }\n }\n};\n\n// src/iotexTestnet.ts\nvar iotexTestnet = {\n id: 4690,\n name: \"IoTeX Testnet\",\n network: \"iotex-testnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"IoTeX\",\n symbol: \"IOTX\"\n },\n rpcUrls: {\n default: {\n http: [\"https://babel-api.testnet.iotex.io\"],\n webSocket: [\"wss://babel-api.testnet.iotex.io\"]\n },\n public: {\n http: [\"https://babel-api.testnet.iotex.io\"],\n webSocket: [\"wss://babel-api.testnet.iotex.io\"]\n }\n },\n blockExplorers: {\n default: { name: \"IoTeXScan\", url: \"https://testnet.iotexscan.io\" }\n }\n};\n\n// src/goerli.ts\nvar goerli = {\n id: 5,\n network: \"goerli\",\n name: \"Goerli\",\n nativeCurrency: { name: \"Goerli Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n alchemy: {\n http: [\"https://eth-goerli.g.alchemy.com/v2\"],\n webSocket: [\"wss://eth-goerli.g.alchemy.com/v2\"]\n },\n infura: {\n http: [\"https://goerli.infura.io/v3\"],\n webSocket: [\"wss://goerli.infura.io/ws/v3\"]\n },\n default: {\n http: [\"https://rpc.ankr.com/eth_goerli\"]\n },\n public: {\n http: [\"https://rpc.ankr.com/eth_goerli\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"Etherscan\",\n url: \"https://goerli.etherscan.io\"\n },\n default: {\n name: \"Etherscan\",\n url: \"https://goerli.etherscan.io\"\n }\n },\n contracts: {\n ensRegistry: {\n address: \"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e\"\n },\n ensUniversalResolver: {\n address: \"0x56522D00C410a43BFfDF00a9A569489297385790\",\n blockCreated: 8765204\n },\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 6507670\n }\n },\n testnet: true\n};\n\n// src/gnosis.ts\nvar gnosis = {\n id: 100,\n name: \"Gnosis\",\n network: \"gnosis\",\n nativeCurrency: {\n decimals: 18,\n name: \"Gnosis\",\n symbol: \"xDAI\"\n },\n rpcUrls: {\n default: { http: [\"https://rpc.gnosischain.com\"] },\n public: { http: [\"https://rpc.gnosischain.com\"] }\n },\n blockExplorers: {\n etherscan: {\n name: \"Gnosisscan\",\n url: \"https://gnosisscan.io\"\n },\n default: {\n name: \"Gnosis Chain Explorer\",\n url: \"https://blockscout.com/xdai/mainnet\"\n }\n }\n};\n\n// src/gnosisChiado.ts\nvar gnosisChiado = {\n id: 10200,\n name: \"Gnosis Chiado\",\n network: \"chiado\",\n nativeCurrency: {\n decimals: 18,\n name: \"Gnosis\",\n symbol: \"xDAI\"\n },\n rpcUrls: {\n default: { http: [\"https://rpc.chiadochain.net\"] },\n public: { http: [\"https://rpc.chiadochain.net\"] }\n },\n blockExplorers: {\n default: {\n name: \"Blockscout\",\n url: \"https://blockscout.chiadochain.net\"\n }\n }\n};\n\n// src/hardhat.ts\nvar hardhat = {\n id: 31337,\n name: \"Hardhat\",\n network: \"hardhat\",\n nativeCurrency: {\n decimals: 18,\n name: \"Ether\",\n symbol: \"ETH\"\n },\n rpcUrls: {\n default: { http: [\"http://127.0.0.1:8545\"] },\n public: { http: [\"http://127.0.0.1:8545\"] }\n }\n};\n\n// src/harmonyOne.ts\nvar harmonyOne = {\n id: 16666e5,\n name: \"Harmony One\",\n network: \"harmony\",\n nativeCurrency: {\n name: \"Harmony\",\n symbol: \"ONE\",\n decimals: 18\n },\n rpcUrls: {\n public: { http: [\"https://rpc.ankr.com/harmony\"] },\n default: { http: [\"https://rpc.ankr.com/harmony\"] }\n },\n blockExplorers: {\n default: { name: \"Harmony Explorer\", url: \"https://explorer.harmony.one\" }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 24185753\n }\n }\n};\n\n// src/haqqMainnet.ts\nvar haqqMainnet = {\n id: 11235,\n name: \"HAQQ Mainnet\",\n network: \"haqq-mainnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"Islamic Coin\",\n symbol: \"ISLM\"\n },\n rpcUrls: {\n default: {\n http: [\"https://rpc.eth.haqq.network\"]\n },\n public: {\n http: [\"https://rpc.eth.haqq.network\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"HAQQ Explorer\",\n url: \"https://explorer.haqq.network\"\n }\n }\n};\n\n// src/haqqTestedge2.ts\nvar haqqTestedge2 = {\n id: 54211,\n name: \"HAQQ Testedge 2\",\n network: \"haqq-testedge-2\",\n nativeCurrency: {\n decimals: 18,\n name: \"Islamic Coin\",\n symbol: \"ISLMT\"\n },\n rpcUrls: {\n default: {\n http: [\"https://rpc.eth.testedge2.haqq.network\"]\n },\n public: {\n http: [\"https://rpc.eth.testedge2.haqq.network\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"HAQQ Explorer\",\n url: \"https://explorer.testedge2.haqq.network\"\n }\n }\n};\n\n// src/klaytn.ts\nvar klaytn = {\n id: 8217,\n name: \"Klaytn\",\n network: \"klaytn\",\n nativeCurrency: {\n decimals: 18,\n name: \"Klaytn\",\n symbol: \"KLAY\"\n },\n rpcUrls: {\n default: { http: [\"https://cypress.fautor.app/archive\"] },\n public: { http: [\"https://cypress.fautor.app/archive\"] }\n },\n blockExplorers: {\n etherscan: { name: \"KlaytnScope\", url: \"https://scope.klaytn.com\" },\n default: { name: \"KlaytnScope\", url: \"https://scope.klaytn.com\" }\n }\n};\n\n// src/lineaTestnet.ts\nvar lineaTestnet = {\n id: 59140,\n name: \"Linea Goerli Testnet\",\n network: \"linea-testnet\",\n nativeCurrency: { name: \"Linea Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n infura: {\n http: [\"https://consensys-zkevm-goerli-prealpha.infura.io/v3\"],\n webSocket: [\"wss://consensys-zkevm-goerli-prealpha.infura.io/ws/v3\"]\n },\n default: {\n http: [\"https://rpc.goerli.linea.build\"],\n webSocket: [\"wss://rpc.goerli.linea.build\"]\n },\n public: {\n http: [\"https://rpc.goerli.linea.build\"],\n webSocket: [\"wss://rpc.goerli.linea.build\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"BlockScout\",\n url: \"https://explorer.goerli.linea.build\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 498623\n }\n },\n testnet: true\n};\n\n// src/localhost.ts\nvar localhost = {\n id: 1337,\n name: \"Localhost\",\n network: \"localhost\",\n nativeCurrency: {\n decimals: 18,\n name: \"Ether\",\n symbol: \"ETH\"\n },\n rpcUrls: {\n default: { http: [\"http://127.0.0.1:8545\"] },\n public: { http: [\"http://127.0.0.1:8545\"] }\n }\n};\n\n// src/mainnet.ts\nvar mainnet = {\n id: 1,\n network: \"homestead\",\n name: \"Ethereum\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n alchemy: {\n http: [\"https://eth-mainnet.g.alchemy.com/v2\"],\n webSocket: [\"wss://eth-mainnet.g.alchemy.com/v2\"]\n },\n infura: {\n http: [\"https://mainnet.infura.io/v3\"],\n webSocket: [\"wss://mainnet.infura.io/ws/v3\"]\n },\n default: {\n http: [\"https://cloudflare-eth.com\"]\n },\n public: {\n http: [\"https://cloudflare-eth.com\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"Etherscan\",\n url: \"https://etherscan.io\"\n },\n default: {\n name: \"Etherscan\",\n url: \"https://etherscan.io\"\n }\n },\n contracts: {\n ensRegistry: {\n address: \"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e\"\n },\n ensUniversalResolver: {\n address: \"0xc0497E381f536Be9ce14B0dD3817cBcAe57d2F62\",\n blockCreated: 16966585\n },\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 14353601\n }\n }\n};\n\n// src/mantle.ts\nvar mantle = {\n id: 5e3,\n name: \"Mantle\",\n network: \"mantle\",\n nativeCurrency: {\n decimals: 18,\n name: \"MNT\",\n symbol: \"MNT\"\n },\n rpcUrls: {\n default: { http: [\"https://rpc.mantle.xyz\"] },\n public: { http: [\"https://rpc.mantle.xyz\"] }\n },\n blockExplorers: {\n etherscan: {\n name: \"Mantle Testnet Explorer\",\n url: \"https://explorer.mantle.xyz\"\n },\n default: {\n name: \"Mantle Testnet Explorer\",\n url: \"https://explorer.mantle.xyz\"\n }\n }\n};\n\n// src/mantleTestnet.ts\nvar mantleTestnet = {\n id: 5001,\n name: \"Mantle Testnet\",\n network: \"mantle\",\n nativeCurrency: {\n decimals: 18,\n name: \"MNT\",\n symbol: \"MNT\"\n },\n rpcUrls: {\n default: { http: [\"https://rpc.testnet.mantle.xyz\"] },\n public: { http: [\"https://rpc.testnet.mantle.xyz\"] }\n },\n blockExplorers: {\n etherscan: {\n name: \"Mantle Testnet Explorer\",\n url: \"https://explorer.testnet.mantle.xyz\"\n },\n default: {\n name: \"Mantle Testnet Explorer\",\n url: \"https://explorer.testnet.mantle.xyz\"\n }\n },\n testnet: true\n};\n\n// src/metis.ts\nvar metis = {\n id: 1088,\n name: \"Metis\",\n network: \"andromeda\",\n nativeCurrency: {\n decimals: 18,\n name: \"Metis\",\n symbol: \"METIS\"\n },\n rpcUrls: {\n default: { http: [\"https://andromeda.metis.io/?owner=1088\"] },\n public: { http: [\"https://andromeda.metis.io/?owner=1088\"] }\n },\n blockExplorers: {\n default: {\n name: \"Andromeda Explorer\",\n url: \"https://andromeda-explorer.metis.io\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 2338552\n }\n }\n};\n\n// src/metisGoerli.ts\nvar metisGoerli = {\n id: 599,\n name: \"Metis Goerli\",\n network: \"metis-goerli\",\n nativeCurrency: {\n decimals: 18,\n name: \"Metis Goerli\",\n symbol: \"METIS\"\n },\n rpcUrls: {\n default: { http: [\"https://goerli.gateway.metisdevops.link\"] },\n public: { http: [\"https://goerli.gateway.metisdevops.link\"] }\n },\n blockExplorers: {\n default: {\n name: \"Metis Goerli Explorer\",\n url: \"https://goerli.explorer.metisdevops.link\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 1006207\n }\n }\n};\n\n// src/mev.ts\nvar mev = {\n id: 7518,\n network: \"MEVerse\",\n name: \"MEVerse Chain Mainnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"MEVerse\",\n symbol: \"MEV\"\n },\n rpcUrls: {\n default: {\n http: [\"https://rpc.meversemainnet.io\"]\n },\n public: {\n http: [\"https://rpc.meversemainnet.io\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Explorer\",\n url: \"https://www.meversescan.io\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 86881340\n }\n }\n};\n\n// src/mevTestnet.ts\nvar mevTestnet = {\n id: 4759,\n network: \"MEVerse Testnet\",\n name: \"MEVerse Chain Testnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"MEVerse\",\n symbol: \"MEV\"\n },\n rpcUrls: {\n default: {\n http: [\"https://rpc.meversetestnet.io\"]\n },\n public: {\n http: [\"https://rpc.meversetestnet.io\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Explorer\",\n url: \"https://testnet.meversescan.io/\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 64371115\n }\n },\n testnet: true\n};\n\n// src/moonbaseAlpha.ts\nvar moonbaseAlpha = {\n id: 1287,\n name: \"Moonbase Alpha\",\n network: \"moonbase-alpha\",\n nativeCurrency: {\n decimals: 18,\n name: \"DEV\",\n symbol: \"DEV\"\n },\n rpcUrls: {\n default: {\n http: [\"https://rpc.api.moonbase.moonbeam.network\"],\n webSocket: [\"wss://wss.api.moonbase.moonbeam.network\"]\n },\n public: {\n http: [\"https://rpc.api.moonbase.moonbeam.network\"],\n webSocket: [\"wss://wss.api.moonbase.moonbeam.network\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Moonscan\",\n url: \"https://moonbase.moonscan.io\"\n },\n etherscan: {\n name: \"Moonscan\",\n url: \"https://moonbase.moonscan.io\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xcA11bde05977b3631167028862bE2a173976CA11\",\n blockCreated: 1850686\n }\n },\n testnet: true\n};\n\n// src/moonbeam.ts\nvar moonbeam = {\n id: 1284,\n name: \"Moonbeam\",\n network: \"moonbeam\",\n nativeCurrency: {\n decimals: 18,\n name: \"GLMR\",\n symbol: \"GLMR\"\n },\n rpcUrls: {\n public: {\n http: [\"https://moonbeam.public.blastapi.io\"],\n webSocket: [\"wss://moonbeam.public.blastapi.io\"]\n },\n default: {\n http: [\"https://moonbeam.public.blastapi.io\"],\n webSocket: [\"wss://moonbeam.public.blastapi.io\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Moonscan\",\n url: \"https://moonscan.io\"\n },\n etherscan: {\n name: \"Moonscan\",\n url: \"https://moonscan.io\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xcA11bde05977b3631167028862bE2a173976CA11\",\n blockCreated: 609002\n }\n },\n testnet: false\n};\n\n// src/moonriver.ts\nvar moonriver = {\n id: 1285,\n name: \"Moonriver\",\n network: \"moonriver\",\n nativeCurrency: {\n decimals: 18,\n name: \"MOVR\",\n symbol: \"MOVR\"\n },\n rpcUrls: {\n public: {\n http: [\"https://moonriver.public.blastapi.io\"],\n webSocket: [\"wss://moonriver.public.blastapi.io\"]\n },\n default: {\n http: [\"https://moonriver.public.blastapi.io\"],\n webSocket: [\"wss://moonriver.public.blastapi.io\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Moonscan\",\n url: \"https://moonriver.moonscan.io\"\n },\n etherscan: {\n name: \"Moonscan\",\n url: \"https://moonriver.moonscan.io\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xcA11bde05977b3631167028862bE2a173976CA11\",\n blockCreated: 1597904\n }\n },\n testnet: false\n};\n\n// src/neonDevnet.ts\nvar neonDevnet = {\n id: 245022926,\n network: \"neonDevnet\",\n name: \"Neon EVM DevNet\",\n nativeCurrency: { name: \"NEON\", symbol: \"NEON\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://devnet.neonevm.org\"]\n },\n public: {\n http: [\"https://devnet.neonevm.org\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Neonscan\",\n url: \"https://neonscan.org\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 205206112\n }\n },\n testnet: true\n};\n\n// src/nexi.ts\nvar nexi = {\n id: 4242,\n name: \"Nexi\",\n network: \"nexi\",\n nativeCurrency: { name: \"Nexi\", symbol: \"NEXI\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://rpc.chain.nexi.technology\"]\n },\n public: {\n http: [\"https://rpc.chain.nexi.technology\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"NexiScan\",\n url: \"https://www.nexiscan.com\"\n },\n default: {\n name: \"NexiScan\",\n url: \"https://www.nexiscan.com\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0x0277A46Cc69A57eE3A6C8c158bA874832F718B8E\",\n blockCreated: 25770160\n }\n }\n};\n\n// src/nexilix.ts\nvar nexilix = {\n id: 240,\n name: \"Nexilix Smart Chain\",\n network: \"nexilix\",\n nativeCurrency: {\n decimals: 18,\n name: \"Nexilix\",\n symbol: \"NEXILIX\"\n },\n rpcUrls: {\n default: { http: [\"https://rpcurl.pos.nexilix.com\"] },\n public: { http: [\"https://rpcurl.pos.nexilix.com\"] }\n },\n blockExplorers: {\n etherscan: { name: \"NexilixScan\", url: \"https://scan.nexilix.com\" },\n default: { name: \"NexilixScan\", url: \"https://scan.nexilix.com\" }\n },\n contracts: {\n multicall3: {\n address: \"0x58381c8e2BF9d0C2C4259cA14BdA9Afe02831244\",\n blockCreated: 74448\n }\n }\n};\n\n// src/oasys.ts\nvar oasys = {\n id: 248,\n name: \"Oasys\",\n network: \"oasys\",\n nativeCurrency: { name: \"Oasys\", symbol: \"OAS\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://rpc.mainnet.oasys.games\"]\n },\n public: {\n http: [\"https://rpc.mainnet.oasys.games\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"OasysScan\",\n url: \"https://scan.oasys.games\"\n }\n }\n};\n\n// src/okc.ts\nvar okc = {\n id: 66,\n name: \"OKC\",\n network: \"okc\",\n nativeCurrency: {\n decimals: 18,\n name: \"OKT\",\n symbol: \"OKT\"\n },\n rpcUrls: {\n default: { http: [\"https://exchainrpc.okex.org\"] },\n public: { http: [\"https://exchainrpc.okex.org\"] }\n },\n blockExplorers: {\n default: { name: \"oklink\", url: \"https://www.oklink.com/okc\" }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 10364792\n }\n }\n};\n\n// src/optimism.ts\nvar optimism = {\n id: 10,\n name: \"OP Mainnet\",\n network: \"optimism\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n alchemy: {\n http: [\"https://opt-mainnet.g.alchemy.com/v2\"],\n webSocket: [\"wss://opt-mainnet.g.alchemy.com/v2\"]\n },\n infura: {\n http: [\"https://optimism-mainnet.infura.io/v3\"],\n webSocket: [\"wss://optimism-mainnet.infura.io/ws/v3\"]\n },\n default: {\n http: [\"https://mainnet.optimism.io\"]\n },\n public: {\n http: [\"https://mainnet.optimism.io\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"Etherscan\",\n url: \"https://optimistic.etherscan.io\"\n },\n default: {\n name: \"Optimism Explorer\",\n url: \"https://explorer.optimism.io\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 4286263\n }\n }\n};\n\n// src/optimismGoerli.ts\nvar optimismGoerli = {\n id: 420,\n name: \"Optimism Goerli\",\n network: \"optimism-goerli\",\n nativeCurrency: { name: \"Goerli Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n alchemy: {\n http: [\"https://opt-goerli.g.alchemy.com/v2\"],\n webSocket: [\"wss://opt-goerli.g.alchemy.com/v2\"]\n },\n infura: {\n http: [\"https://optimism-goerli.infura.io/v3\"],\n webSocket: [\"wss://optimism-goerli.infura.io/ws/v3\"]\n },\n default: {\n http: [\"https://goerli.optimism.io\"]\n },\n public: {\n http: [\"https://goerli.optimism.io\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"Etherscan\",\n url: \"https://goerli-optimism.etherscan.io\"\n },\n default: {\n name: \"Etherscan\",\n url: \"https://goerli-optimism.etherscan.io\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 49461\n }\n },\n testnet: true\n};\n\n// src/polygon.ts\nvar polygon = {\n id: 137,\n name: \"Polygon\",\n network: \"matic\",\n nativeCurrency: { name: \"MATIC\", symbol: \"MATIC\", decimals: 18 },\n rpcUrls: {\n alchemy: {\n http: [\"https://polygon-mainnet.g.alchemy.com/v2\"],\n webSocket: [\"wss://polygon-mainnet.g.alchemy.com/v2\"]\n },\n infura: {\n http: [\"https://polygon-mainnet.infura.io/v3\"],\n webSocket: [\"wss://polygon-mainnet.infura.io/ws/v3\"]\n },\n default: {\n http: [\"https://polygon-rpc.com\"]\n },\n public: {\n http: [\"https://polygon-rpc.com\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"PolygonScan\",\n url: \"https://polygonscan.com\"\n },\n default: {\n name: \"PolygonScan\",\n url: \"https://polygonscan.com\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 25770160\n }\n }\n};\n\n// src/polygonMumbai.ts\nvar polygonMumbai = {\n id: 80001,\n name: \"Polygon Mumbai\",\n network: \"maticmum\",\n nativeCurrency: { name: \"MATIC\", symbol: \"MATIC\", decimals: 18 },\n rpcUrls: {\n alchemy: {\n http: [\"https://polygon-mumbai.g.alchemy.com/v2\"],\n webSocket: [\"wss://polygon-mumbai.g.alchemy.com/v2\"]\n },\n infura: {\n http: [\"https://polygon-mumbai.infura.io/v3\"],\n webSocket: [\"wss://polygon-mumbai.infura.io/ws/v3\"]\n },\n default: {\n http: [\"https://matic-mumbai.chainstacklabs.com\"]\n },\n public: {\n http: [\"https://matic-mumbai.chainstacklabs.com\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"PolygonScan\",\n url: \"https://mumbai.polygonscan.com\"\n },\n default: {\n name: \"PolygonScan\",\n url: \"https://mumbai.polygonscan.com\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 25770160\n }\n },\n testnet: true\n};\n\n// src/polygonZkEvmTestnet.ts\nvar polygonZkEvmTestnet = {\n id: 1442,\n name: \"Polygon zkEVM Testnet\",\n network: \"polygon-zkevm-testnet\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://rpc.public.zkevm-test.net\"]\n },\n public: {\n http: [\"https://rpc.public.zkevm-test.net\"]\n }\n },\n blockExplorers: {\n blockscout: {\n name: \"Blockscout\",\n url: \"https://explorer.public.zkevm-test.net\"\n },\n default: {\n name: \"PolygonScan\",\n url: \"https://testnet-zkevm.polygonscan.com\"\n }\n },\n testnet: true,\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 525686\n }\n }\n};\n\n// src/polygonZkEvm.ts\nvar polygonZkEvm = {\n id: 1101,\n name: \"Polygon zkEVM\",\n network: \"polygon-zkevm\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://zkevm-rpc.com\"]\n },\n public: {\n http: [\"https://zkevm-rpc.com\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"PolygonScan\",\n url: \"https://zkevm.polygonscan.com\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 57746\n }\n }\n};\n\n// src/pulsechain.ts\nvar pulsechain = {\n id: 369,\n network: \"pulsechain\",\n name: \"PulseChain\",\n nativeCurrency: { name: \"Pulse\", symbol: \"PLS\", decimals: 18 },\n testnet: false,\n rpcUrls: {\n default: {\n http: [\"https://rpc.pulsechain.com\"],\n webSocket: [\"wss://ws.pulsechain.com\"]\n },\n public: {\n http: [\"https://rpc.pulsechain.com\"],\n webSocket: [\"wss://ws.pulsechain.com\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"PulseScan\",\n url: \"https://scan.pulsechain.com\"\n }\n },\n contracts: {\n ensRegistry: {\n address: \"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e\"\n },\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 14353601\n }\n }\n};\n\n// src/pulsechainV4.ts\nvar pulsechainV4 = {\n id: 943,\n network: \"pulsechainV4\",\n name: \"PulseChain V4\",\n testnet: true,\n nativeCurrency: { name: \"V4 Pulse\", symbol: \"v4PLS\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://rpc.v4.testnet.pulsechain.com\"],\n webSocket: [\"wss://ws.v4.testnet.pulsechain.com\"]\n },\n public: {\n http: [\"https://rpc.v4.testnet.pulsechain.com\"],\n webSocket: [\"wss://ws.v4.testnet.pulsechain.com\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"PulseScan\",\n url: \"https://scan.v4.testnet.pulsechain.com\"\n }\n },\n contracts: {\n ensRegistry: {\n address: \"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e\"\n },\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 14353601\n }\n }\n};\n\n// src/scrollTestnet.ts\nvar scrollTestnet = {\n id: 534353,\n name: \"Scroll Testnet\",\n network: \"scroll-testnet\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://alpha-rpc.scroll.io/l2\"],\n webSocket: [\"wss://alpha-rpc.scroll.io/l2/ws\"]\n },\n public: {\n http: [\"https://alpha-rpc.scroll.io/l2\"],\n webSocket: [\"wss://alpha-rpc.scroll.io/l2/ws\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Blockscout\",\n url: \"https://blockscout.scroll.io\"\n }\n },\n testnet: true\n};\n\n// src/sepolia.ts\nvar sepolia = {\n id: 11155111,\n network: \"sepolia\",\n name: \"Sepolia\",\n nativeCurrency: { name: \"Sepolia Ether\", symbol: \"SEP\", decimals: 18 },\n rpcUrls: {\n alchemy: {\n http: [\"https://eth-sepolia.g.alchemy.com/v2\"],\n webSocket: [\"wss://eth-sepolia.g.alchemy.com/v2\"]\n },\n infura: {\n http: [\"https://sepolia.infura.io/v3\"],\n webSocket: [\"wss://sepolia.infura.io/ws/v3\"]\n },\n default: {\n http: [\"https://rpc.sepolia.org\"]\n },\n public: {\n http: [\"https://rpc.sepolia.org\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"Etherscan\",\n url: \"https://sepolia.etherscan.io\"\n },\n default: {\n name: \"Etherscan\",\n url: \"https://sepolia.etherscan.io\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 6507670\n }\n },\n testnet: true\n};\n\n// src/skale/brawl.ts\nvar skaleBlockBrawlers = {\n id: 391845894,\n name: \"SKALE | Block Brawlers\",\n network: \"skale-brawl\",\n nativeCurrency: { name: \"BRAWL\", symbol: \"BRAWL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://mainnet.skalenodes.com/v1/frayed-decent-antares\"]\n },\n public: {\n http: [\"https://mainnet.skalenodes.com/v1/frayed-decent-antares\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://frayed-decent-antares.explorer.mainnet.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://frayed-decent-antares.explorer.mainnet.skalenodes.com\"\n }\n },\n contracts: {}\n};\n\n// src/skale/calypso.ts\nvar skaleCalypso = {\n id: 1564830818,\n name: \"SKALE | Calypso NFT Hub\",\n network: \"skale-calypso\",\n nativeCurrency: { name: \"sFUEL\", symbol: \"sFUEL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://mainnet.skalenodes.com/v1/honorable-steel-rasalhague\"]\n },\n public: {\n http: [\"https://mainnet.skalenodes.com/v1/honorable-steel-rasalhague\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://honorable-steel-rasalhague.explorer.mainnet.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://honorable-steel-rasalhague.explorer.mainnet.skalenodes.com\"\n }\n },\n contracts: {}\n};\n\n// src/skale/calypsoTestnet.ts\nvar skaleCalypsoTestnet = {\n id: 344106930,\n name: \"SKALE | Calypso NFT Hub Testnet\",\n network: \"skale-calypso-testnet\",\n nativeCurrency: { name: \"sFUEL\", symbol: \"sFUEL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\n \"https://staging-v3.skalenodes.com/v1/staging-utter-unripe-menkar\"\n ]\n },\n public: {\n http: [\n \"https://staging-v3.skalenodes.com/v1/staging-utter-unripe-menkar\"\n ]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://staging-utter-unripe-menkar.explorer.staging-v3.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://staging-utter-unripe-menkar.explorer.staging-v3.skalenodes.com\"\n }\n },\n contracts: {},\n testnet: true\n};\n\n// src/skale/chaosTestnet.ts\nvar skaleChaosTestnet = {\n id: 1351057110,\n name: \"SKALE | Chaos Testnet\",\n network: \"skale-chaos-testnet\",\n nativeCurrency: { name: \"sFUEL\", symbol: \"sFUEL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\n \"https://staging-v3.skalenodes.com/v1/staging-fast-active-bellatrix\"\n ]\n },\n public: {\n http: [\n \"https://staging-v3.skalenodes.com/v1/staging-fast-active-bellatrix\"\n ]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://staging-fast-active-bellatrix.explorer.staging-v3.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://staging-fast-active-bellatrix.explorer.staging-v3.skalenodes.com\"\n }\n },\n contracts: {},\n testnet: true\n};\n\n// src/skale/cryptoBlades.ts\nvar skaleCryptoBlades = {\n id: 1026062157,\n name: \"SKALE | CryptoBlades\",\n network: \"skale-cryptoblades\",\n nativeCurrency: { name: \"sFUEL\", symbol: \"sFUEL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://mainnet.skalenodes.com/v1/affectionate-immediate-pollux\"]\n },\n public: {\n http: [\"https://mainnet.skalenodes.com/v1/affectionate-immediate-pollux\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://affectionate-immediate-pollux.explorer.mainnet.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://affectionate-immediate-pollux.explorer.mainnet.skalenodes.com\"\n }\n },\n contracts: {}\n};\n\n// src/skale/cryptoColosseum.ts\nvar skaleCryptoColosseum = {\n id: 2046399126,\n name: \"SKALE | Crypto Colosseum\",\n network: \"skale-crypto-coloseeum\",\n nativeCurrency: { name: \"sFUEL\", symbol: \"sFUEL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://mainnet.skalenodes.com/v1/haunting-devoted-deneb\"]\n },\n public: {\n http: [\"https://mainnet.skalenodes.com/v1/haunting-devoted-deneb\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://haunting-devoted-deneb.explorer.mainnet.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://haunting-devoted-deneb.explorer.mainnet.skalenodes.com\"\n }\n },\n contracts: {}\n};\n\n// src/skale/europa.ts\nvar skaleEuropa = {\n id: 2046399126,\n name: \"SKALE | Europa Liquidity Hub\",\n network: \"skale-europa\",\n nativeCurrency: { name: \"sFUEL\", symbol: \"sFUEL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://mainnet.skalenodes.com/v1/elated-tan-skat\"]\n },\n public: {\n http: [\"https://mainnet.skalenodes.com/v1/elated-tan-skat\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://elated-tan-skat.explorer.mainnet.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://elated-tan-skat.explorer.mainnet.skalenodes.com\"\n }\n },\n contracts: {}\n};\n\n// src/skale/europaTestnet.ts\nvar skaleEuropaTestnet = {\n id: 476158412,\n name: \"SKALE | Europa Liquidity Hub Testnet\",\n network: \"skale-europa-testnet\",\n nativeCurrency: { name: \"sFUEL\", symbol: \"sFUEL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://staging-v3.skalenodes.com/v1/staging-legal-crazy-castor\"]\n },\n public: {\n http: [\"https://staging-v3.skalenodes.com/v1/staging-legal-crazy-castor\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://staging-legal-crazy-castor.explorer.staging-v3.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://staging-legal-crazy-castor.explorer.staging-v3.skalenodes.com\"\n }\n },\n contracts: {},\n testnet: true\n};\n\n// src/skale/exorde.ts\nvar skaleExorde = {\n id: 2139927552,\n name: \"SKALE | Exorde\",\n network: \"skale-exorde\",\n nativeCurrency: { name: \"sFUEL\", symbol: \"sFUEL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://mainnet.skalenodes.com/v1/light-vast-diphda\"]\n },\n public: {\n http: [\"https://mainnet.skalenodes.com/v1/light-vast-diphda\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://light-vast-diphda.explorer.mainnet.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://light-vast-diphda.explorer.mainnet.skalenodes.com\"\n }\n },\n contracts: {}\n};\n\n// src/skale/humanProtocol.ts\nvar skaleHumanProtocol = {\n id: 1273227453,\n name: \"SKALE | Human Protocol\",\n network: \"skale-human-protocol\",\n nativeCurrency: { name: \"sFUEL\", symbol: \"sFUEL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://mainnet.skalenodes.com/v1/wan-red-ain\"]\n },\n public: {\n http: [\"https://mainnet.skalenodes.com/v1/wan-red-ain\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://wan-red-ain.explorer.mainnet.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://wan-red-ain.explorer.mainnet.skalenodes.com\"\n }\n },\n contracts: {}\n};\n\n// src/skale/nebula.ts\nvar skaleNebula = {\n id: 1482601649,\n name: \"SKALE | Nebula Gaming Hub\",\n network: \"skale-nebula\",\n nativeCurrency: { name: \"sFUEL\", symbol: \"sFUEL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://mainnet.skalenodes.com/v1/green-giddy-denebola\"]\n },\n public: {\n http: [\"https://mainnet.skalenodes.com/v1/green-giddy-denebola\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://green-giddy-denebola.explorer.mainnet.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://green-giddy-denebola.explorer.mainnet.skalenodes.com\"\n }\n },\n contracts: {}\n};\n\n// src/skale/nebulaTestnet.ts\nvar skaleNebulaTestnet = {\n id: 503129905,\n name: \"SKALE | Nebula Gaming Hub Testnet\",\n network: \"skale-nebula-testnet\",\n nativeCurrency: { name: \"sFUEL\", symbol: \"sFUEL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://staging-v3.skalenodes.com/v1/staging-faint-slimy-achird\"]\n },\n public: {\n http: [\"https://staging-v3.skalenodes.com/v1/staging-faint-slimy-achird\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://staging-faint-slimy-achird.explorer.staging-v3.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://staging-faint-slimy-achird.explorer.staging-v3.skalenodes.com\"\n }\n },\n contracts: {},\n testnet: true\n};\n\n// src/skale/razor.ts\nvar skaleRazor = {\n id: 278611351,\n name: \"SKALE | Razor Network\",\n network: \"skale-razor\",\n nativeCurrency: { name: \"sFUEL\", symbol: \"sFUEL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://mainnet.skalenodes.com/v1/turbulent-unique-scheat\"]\n },\n public: {\n http: [\"https://mainnet.skalenodes.com/v1/turbulent-unique-scheat\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://turbulent-unique-scheat.explorer.mainnet.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://turbulent-unique-scheat.explorer.mainnet.skalenodes.com\"\n }\n },\n contracts: {}\n};\n\n// src/skale/titan.ts\nvar skaleTitan = {\n id: 1350216234,\n name: \"SKALE | Titan Community Hub\",\n network: \"skale-titan\",\n nativeCurrency: { name: \"sFUEL\", symbol: \"sFUEL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://mainnet.skalenodes.com/v1/parallel-stormy-spica\"]\n },\n public: {\n http: [\"https://mainnet.skalenodes.com/v1/parallel-stormy-spica\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://parallel-stormy-spica.explorer.mainnet.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://parallel-stormy-spica.explorer.mainnet.skalenodes.com\"\n }\n },\n contracts: {}\n};\n\n// src/skale/titanTestnet.ts\nvar skaleTitanTestnet = {\n id: 1517929550,\n name: \"SKALE | Titan Community Hub Testnet\",\n network: \"skale-titan-testnet\",\n nativeCurrency: { name: \"sFUEL\", symbol: \"sFUEL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\n \"https://staging-v3.skalenodes.com/v1/staging-aware-chief-gianfar\"\n ]\n },\n public: {\n http: [\n \"https://staging-v3.skalenodes.com/v1/staging-aware-chief-gianfar\"\n ]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://staging-aware-chief-gianfar.explorer.staging-v3.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://staging-aware-chief-gianfar.explorer.staging-v3.skalenodes.com\"\n }\n },\n contracts: {},\n testnet: true\n};\n\n// src/songbird.ts\nvar songbird = {\n id: 19,\n name: \"Songbird Mainnet\",\n network: \"songbird-mainnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"songbird\",\n symbol: \"SGB\"\n },\n rpcUrls: {\n default: { http: [\"https://songbird-api.flare.network/ext/C/rpc\"] },\n public: { http: [\"https://songbird-api.flare.network/ext/C/rpc\"] }\n },\n blockExplorers: {\n default: {\n name: \"Songbird Explorer\",\n url: \"https://songbird-explorer.flare.network\"\n }\n }\n};\n\n// src/songbirdTestnet.ts\nvar songbirdTestnet = {\n id: 16,\n name: \"Coston\",\n network: \"coston\",\n nativeCurrency: {\n decimals: 18,\n name: \"costonflare\",\n symbol: \"CFLR\"\n },\n rpcUrls: {\n default: { http: [\"https://coston-api.flare.network/ext/C/rpc\"] },\n public: { http: [\"https://coston-api.flare.network/ext/C/rpc\"] }\n },\n blockExplorers: {\n default: {\n name: \"Coston Explorer\",\n url: \"https://coston-explorer.flare.network\"\n }\n },\n testnet: true\n};\n\n// src/shardeumSphinx.ts\nvar shardeumSphinx = {\n id: 8082,\n name: \"Shardeum Sphinx\",\n network: \"shmSphinx\",\n nativeCurrency: { name: \"SHARDEUM\", symbol: \"SHM\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://sphinx.shardeum.org\"]\n },\n public: {\n http: [\"https://sphinx.shardeum.org\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Shardeum Explorer\",\n url: \"https://explorer-sphinx.shardeum.org\"\n }\n },\n testnet: true\n};\n\n// src/syscoin.ts\nvar syscoin = {\n id: 57,\n name: \"Syscoin Mainnet\",\n network: \"syscoin\",\n nativeCurrency: {\n decimals: 8,\n name: \"Syscoin\",\n symbol: \"SYS\"\n },\n rpcUrls: {\n default: { http: [\"https://rpc.syscoin.org\"] },\n public: { http: [\"https://rpc.syscoin.org\"] }\n },\n blockExplorers: {\n default: { name: \"SyscoinExplorer\", url: \"https://explorer.syscoin.org\" }\n },\n contracts: {\n multicall3: {\n address: \"0x000562033783B1136159E10d976B519C929cdE8e\",\n blockCreated: 80637\n }\n }\n};\n\n// src/taraxa.ts\nvar taraxa = {\n id: 841,\n name: \"Taraxa Mainnet\",\n network: \"taraxa\",\n nativeCurrency: { name: \"Tara\", symbol: \"TARA\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://rpc.mainnet.taraxa.io\"]\n },\n public: {\n http: [\"https://rpc.mainnet.taraxa.io\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Taraxa Explorer\",\n url: \"https://explorer.mainnet.taraxa.io\"\n }\n }\n};\n\n// src/taikoTestnetSepolia.ts\nvar taikoTestnetSepolia = {\n id: 167005,\n name: \"Taiko (Alpha-3 Testnet)\",\n network: \"taiko-sepolia\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://rpc.test.taiko.xyz\"]\n },\n public: {\n http: [\"https://rpc.test.taiko.xyz\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"blockscout\",\n url: \"https://explorer.test.taiko.xyz\"\n }\n }\n};\n\n// src/taraxaTestnet.ts\nvar taraxaTestnet = {\n id: 842,\n name: \"Taraxa Testnet\",\n network: \"taraxa-testnet\",\n nativeCurrency: { name: \"Tara\", symbol: \"TARA\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://rpc.testnet.taraxa.io\"]\n },\n public: {\n http: [\"https://rpc.testnet.taraxa.io\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Taraxa Explorer\",\n url: \"https://explorer.testnet.taraxa.io\"\n }\n },\n testnet: true\n};\n\n// src/telos.ts\nvar telos = {\n id: 40,\n name: \"Telos\",\n network: \"telos\",\n nativeCurrency: {\n decimals: 18,\n name: \"Telos\",\n symbol: \"TLOS\"\n },\n rpcUrls: {\n default: { http: [\"https://mainnet.telos.net/evm\"] },\n public: { http: [\"https://mainnet.telos.net/evm\"] }\n },\n blockExplorers: {\n default: {\n name: \"Teloscan\",\n url: \"https://www.teloscan.io/\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xcA11bde05977b3631167028862bE2a173976CA11\",\n blockCreated: 246530709\n }\n }\n};\n\n// src/telosTestnet.ts\nvar telosTestnet = {\n id: 41,\n name: \"Telos\",\n network: \"telosTestnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"Telos\",\n symbol: \"TLOS\"\n },\n rpcUrls: {\n default: { http: [\"https://testnet.telos.net/evm\"] },\n public: { http: [\"https://testnet.telos.net/evm\"] }\n },\n blockExplorers: {\n default: {\n name: \"Teloscan (testnet)\",\n url: \"https://testnet.teloscan.io/\"\n }\n },\n testnet: true\n};\n\n// src/thunderTestnet.ts\nvar thunderTestnet = {\n id: 997,\n name: \"5ireChain Thunder Testnet\",\n network: \"5ireChain\",\n nativeCurrency: { name: \"5ire Token\", symbol: \"5IRE\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://rpc-testnet.5ire.network\"]\n },\n public: {\n http: [\"https://rpc-testnet.5ire.network\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"5ireChain Explorer\",\n url: \"https://explorer.5ire.network\"\n }\n },\n testnet: true\n};\n\n// src/wanchain.ts\nvar wanchain = {\n id: 888,\n name: \"Wanchain\",\n network: \"wanchain\",\n nativeCurrency: { name: \"WANCHAIN\", symbol: \"WAN\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\n \"https://gwan-ssl.wandevs.org:56891\",\n \"https://gwan2-ssl.wandevs.org\"\n ]\n },\n public: {\n http: [\n \"https://gwan-ssl.wandevs.org:56891\",\n \"https://gwan2-ssl.wandevs.org\"\n ]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"WanScan\",\n url: \"https://wanscan.org\"\n },\n default: {\n name: \"WanScan\",\n url: \"https://wanscan.org\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xcDF6A1566e78EB4594c86Fe73Fcdc82429e97fbB\",\n blockCreated: 25312390\n }\n }\n};\n\n// src/wanchainTestnet.ts\nvar wanchainTestnet = {\n id: 999,\n name: \"Wanchain Testnet\",\n network: \"wanchainTestnet\",\n nativeCurrency: { name: \"WANCHAIN\", symbol: \"WANt\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://gwan-ssl.wandevs.org:46891\"]\n },\n public: {\n http: [\"https://gwan-ssl.wandevs.org:46891\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"WanScanTest\",\n url: \"https://wanscan.org\"\n },\n default: {\n name: \"WanScanTest\",\n url: \"https://wanscan.org\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0x11c89bF4496c39FB80535Ffb4c92715839CC5324\",\n blockCreated: 24743448\n }\n },\n testnet: true\n};\n\n// src/xdc.ts\nvar xdc = {\n id: 50,\n name: \"XinFin Network\",\n network: \"xdc\",\n nativeCurrency: {\n decimals: 18,\n name: \"XDC\",\n symbol: \"XDC\"\n },\n rpcUrls: {\n default: { http: [\"https://rpc.xinfin.network\"] },\n public: { http: [\"https://rpc.xinfin.network\"] }\n },\n blockExplorers: {\n xinfin: { name: \"XinFin\", url: \"https://explorer.xinfin.network\" },\n default: { name: \"Blocksscan\", url: \"https://xdc.blocksscan.io\" }\n }\n};\n\n// src/xdcTestnet.ts\nvar xdcTestnet = {\n id: 51,\n name: \"Apothem Network\",\n network: \"xdc-testnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"TXDC\",\n symbol: \"TXDC\"\n },\n rpcUrls: {\n default: { http: [\"https://erpc.apothem.network\"] },\n public: { http: [\"https://erpc.apothem.network\"] }\n },\n blockExplorers: {\n xinfin: { name: \"XinFin\", url: \"https://explorer.apothem.network\" },\n default: { name: \"Blocksscan\", url: \"https://apothem.blocksscan.io\" }\n }\n};\n\n// src/zhejiang.ts\nvar zhejiang = {\n id: 1337803,\n network: \"zhejiang\",\n name: \"Zhejiang\",\n nativeCurrency: { name: \"Zhejiang Ether\", symbol: \"ZhejETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://rpc.zhejiang.ethpandaops.io\"]\n },\n public: {\n http: [\"https://rpc.zhejiang.ethpandaops.io\"]\n }\n },\n blockExplorers: {\n beaconchain: {\n name: \"Etherscan\",\n url: \"https://zhejiang.beaconcha.in\"\n },\n blockscout: {\n name: \"Blockscout\",\n url: \"https://blockscout.com/eth/zhejiang-testnet\"\n },\n default: {\n name: \"Beaconchain\",\n url: \"https://zhejiang.beaconcha.in\"\n }\n },\n testnet: true\n};\n\n// src/zkSync.ts\nvar zkSync = {\n id: 324,\n name: \"zkSync Era\",\n network: \"zksync-era\",\n nativeCurrency: {\n decimals: 18,\n name: \"Ether\",\n symbol: \"ETH\"\n },\n rpcUrls: {\n default: {\n http: [\"https://mainnet.era.zksync.io\"],\n webSocket: [\"wss://mainnet.era.zksync.io/ws\"]\n },\n public: {\n http: [\"https://mainnet.era.zksync.io\"],\n webSocket: [\"wss://mainnet.era.zksync.io/ws\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"zkExplorer\",\n url: \"https://explorer.zksync.io\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xF9cda624FBC7e059355ce98a31693d299FACd963\"\n }\n }\n};\n\n// src/zkSyncTestnet.ts\nvar zkSyncTestnet = {\n id: 280,\n name: \"zkSync Era Testnet\",\n network: \"zksync-era-testnet\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://testnet.era.zksync.dev\"],\n webSocket: [\"wss://testnet.era.zksync.dev/ws\"]\n },\n public: {\n http: [\"https://testnet.era.zksync.dev\"],\n webSocket: [\"wss://testnet.era.zksync.dev/ws\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"zkExplorer\",\n url: \"https://goerli.explorer.zksync.io\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xF9cda624FBC7e059355ce98a31693d299FACd963\"\n }\n },\n testnet: true\n};\n\n// src/zora.ts\nvar zora = {\n id: 7777777,\n name: \"Zora\",\n network: \"zora\",\n nativeCurrency: {\n decimals: 18,\n name: \"Ether\",\n symbol: \"ETH\"\n },\n rpcUrls: {\n default: {\n http: [\"https://rpc.zora.energy\"],\n webSocket: [\"wss://rpc.zora.energy\"]\n },\n public: {\n http: [\"https://rpc.zora.energy\"],\n webSocket: [\"wss://rpc.zora.energy\"]\n }\n },\n blockExplorers: {\n default: { name: \"Explorer\", url: \"https://explorer.zora.energy\" }\n },\n contracts: {\n multicall3: {\n address: \"0xcA11bde05977b3631167028862bE2a173976CA11\",\n blockCreated: 5882\n }\n }\n};\n\n// src/zoraTestnet.ts\nvar zoraTestnet = {\n id: 999,\n name: \"Zora Goerli Testnet\",\n network: \"zora-testnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"Zora Goerli\",\n symbol: \"ETH\"\n },\n rpcUrls: {\n default: {\n http: [\"https://testnet.rpc.zora.energy\"],\n webSocket: [\"wss://testnet.rpc.zora.energy\"]\n },\n public: {\n http: [\"https://testnet.rpc.zora.energy\"],\n webSocket: [\"wss://testnet.rpc.zora.energy\"]\n }\n },\n blockExplorers: {\n default: { name: \"Explorer\", url: \"https://testnet.explorer.zora.energy\" }\n },\n contracts: {\n multicall3: {\n address: \"0xcA11bde05977b3631167028862bE2a173976CA11\",\n blockCreated: 189123\n }\n },\n testnet: true\n};\nexport {\n arbitrum,\n arbitrumGoerli,\n arbitrumNova,\n aurora,\n auroraTestnet,\n avalanche,\n avalancheFuji,\n base,\n baseGoerli,\n bearNetworkChainMainnet,\n bearNetworkChainTestnet,\n boba,\n bronos,\n bronosTestnet,\n bsc,\n bscTestnet,\n bxn,\n bxnTestnet,\n canto,\n celo,\n celoAlfajores,\n celoCannoli,\n confluxESpace,\n cronos,\n cronosTestnet,\n crossbell,\n dfk,\n dogechain,\n edgeware,\n edgewareTestnet,\n ekta,\n ektaTestnet,\n eos,\n eosTestnet,\n evmos,\n evmosTestnet,\n fantom,\n fantomTestnet,\n fibo,\n filecoin,\n filecoinCalibration,\n filecoinHyperspace,\n flare,\n flareTestnet,\n foundry,\n fuse,\n gnosis,\n gnosisChiado,\n goerli,\n haqqMainnet,\n haqqTestedge2,\n hardhat,\n harmonyOne,\n iotex,\n iotexTestnet,\n klaytn,\n lineaTestnet,\n localhost,\n mainnet,\n mantle,\n mantleTestnet,\n metis,\n metisGoerli,\n mev,\n mevTestnet,\n moonbaseAlpha,\n moonbeam,\n moonriver,\n neonDevnet,\n nexi,\n nexilix,\n oasys,\n okc,\n optimism,\n optimismGoerli,\n polygon,\n polygonMumbai,\n polygonZkEvm,\n polygonZkEvmTestnet,\n pulsechain,\n pulsechainV4,\n scrollTestnet,\n sepolia,\n shardeumSphinx,\n skaleBlockBrawlers,\n skaleCalypso,\n skaleCalypsoTestnet,\n skaleChaosTestnet,\n skaleCryptoBlades,\n skaleCryptoColosseum,\n skaleEuropa,\n skaleEuropaTestnet,\n skaleExorde,\n skaleHumanProtocol,\n skaleNebula,\n skaleNebulaTestnet,\n skaleRazor,\n skaleTitan,\n skaleTitanTestnet,\n songbird,\n songbirdTestnet,\n syscoin,\n taikoTestnetSepolia,\n taraxa,\n taraxaTestnet,\n telos,\n telosTestnet,\n thunderTestnet,\n wanchain,\n wanchainTestnet,\n xdc,\n xdcTestnet,\n zhejiang,\n zkSync,\n zkSyncTestnet,\n zora,\n zoraTestnet\n};\n","import * as chains from '@wagmi/chains';\nimport { defineChain } from '../utils/chain.js';\nimport { formattersCelo } from './celo/formatters.js';\nimport { serializersCelo } from './celo/serializers.js';\nimport { feesOptimism } from './optimism/fees.js';\nimport { formattersOptimism } from './optimism/formatters.js';\nexport const arbitrum = /*#__PURE__*/ defineChain(chains.arbitrum);\nexport const arbitrumGoerli = /*#__PURE__*/ defineChain(chains.arbitrumGoerli);\nexport const aurora = /*#__PURE__*/ defineChain(chains.aurora);\nexport const auroraTestnet = /*#__PURE__*/ defineChain(chains.auroraTestnet);\nexport const avalanche = /*#__PURE__*/ defineChain(chains.avalanche);\nexport const avalancheFuji = /*#__PURE__*/ defineChain(chains.avalancheFuji);\nexport const base = /*#__PURE__*/ defineChain(chains.base, {\n fees: feesOptimism,\n formatters: formattersOptimism,\n});\nexport const baseGoerli = /*#__PURE__*/ defineChain(chains.baseGoerli, {\n fees: feesOptimism,\n formatters: formattersOptimism,\n});\nexport const boba = /*#__PURE__*/ defineChain(chains.boba);\nexport const bronos = /*#__PURE__*/ defineChain(chains.bronos);\nexport const bronosTestnet = /*#__PURE__*/ defineChain(chains.bronosTestnet);\nexport const bsc = /*#__PURE__*/ defineChain(chains.bsc);\nexport const bscTestnet = /*#__PURE__*/ defineChain(chains.bscTestnet);\nexport const canto = /*#__PURE__*/ defineChain(chains.canto);\nexport const celo = /*#__PURE__*/ defineChain(chains.celo, {\n formatters: formattersCelo,\n serializers: serializersCelo,\n});\nexport const celoAlfajores = /*#__PURE__*/ defineChain(chains.celoAlfajores, {\n formatters: formattersCelo,\n serializers: serializersCelo,\n});\nexport const celoCannoli = /*#__PURE__*/ defineChain(chains.celoCannoli, {\n formatters: formattersCelo,\n serializers: serializersCelo,\n});\nexport const cronos = /*#__PURE__*/ defineChain(chains.cronos);\nexport const crossbell = /*#__PURE__*/ defineChain(chains.crossbell);\nexport const dfk = /*#__PURE__*/ defineChain(chains.dfk);\nexport const dogechain = /*#__PURE__*/ defineChain(chains.dogechain);\nexport const evmos = /*#__PURE__*/ defineChain(chains.evmos);\nexport const evmosTestnet = /*#__PURE__*/ defineChain(chains.evmosTestnet);\nexport const fantom = /*#__PURE__*/ defineChain(chains.fantom);\nexport const fantomTestnet = /*#__PURE__*/ defineChain(chains.fantomTestnet);\nexport const filecoin = /*#__PURE__*/ defineChain(chains.filecoin);\nexport const filecoinCalibration = /*#__PURE__*/ defineChain(chains.filecoinCalibration);\nexport const filecoinHyperspace = /*#__PURE__*/ defineChain(chains.filecoinHyperspace);\nexport const flare = /*#__PURE__*/ defineChain(chains.flare);\nexport const flareTestnet = /*#__PURE__*/ defineChain(chains.flareTestnet);\nexport const foundry = /*#__PURE__*/ defineChain(chains.foundry);\nexport const iotex = /*#__PURE__*/ defineChain(chains.iotex);\nexport const iotexTestnet = /*#__PURE__*/ defineChain(chains.iotexTestnet);\nexport const goerli = /*#__PURE__*/ defineChain(chains.goerli);\nexport const gnosis = /*#__PURE__*/ defineChain(chains.gnosis);\nexport const gnosisChiado = /*#__PURE__*/ defineChain(chains.gnosisChiado);\nexport const haqqMainnet = /*#__PURE__*/ defineChain(chains.haqqMainnet);\nexport const haqqTestedge2 = /*#__PURE__*/ defineChain(chains.haqqTestedge2);\nexport const hardhat = /*#__PURE__*/ defineChain(chains.hardhat);\nexport const harmonyOne = /*#__PURE__*/ defineChain(chains.harmonyOne);\nexport const klaytn = /*#__PURE__*/ defineChain(chains.klaytn);\nexport const lineaTestnet = /*#__PURE__*/ defineChain(chains.lineaTestnet);\nexport const localhost = /*#__PURE__*/ defineChain(chains.localhost);\nexport const mainnet = /*#__PURE__*/ defineChain(chains.mainnet);\nexport const metis = /*#__PURE__*/ defineChain(chains.metis);\nexport const metisGoerli = /*#__PURE__*/ defineChain(chains.metisGoerli);\nexport const mev = /*#__PURE__*/ defineChain(chains.mev);\nexport const mevTestnet = /*#__PURE__*/ defineChain(chains.mevTestnet);\nexport const moonbaseAlpha = /*#__PURE__*/ defineChain(chains.moonbaseAlpha);\nexport const moonbeam = /*#__PURE__*/ defineChain(chains.moonbeam);\nexport const moonriver = /*#__PURE__*/ defineChain(chains.moonriver);\nexport const nexi = /*#__PURE__*/ defineChain(chains.nexi);\nexport const okc = /*#__PURE__*/ defineChain(chains.okc);\nexport const optimism = /*#__PURE__*/ defineChain(chains.optimism, {\n fees: feesOptimism,\n formatters: formattersOptimism,\n});\nexport const optimismGoerli = /*#__PURE__*/ defineChain(chains.optimismGoerli, {\n fees: feesOptimism,\n formatters: formattersOptimism,\n});\nexport const polygon = /*#__PURE__*/ defineChain(chains.polygon);\nexport const polygonMumbai = /*#__PURE__*/ defineChain(chains.polygonMumbai);\nexport const polygonZkEvm = /*#__PURE__*/ defineChain(chains.polygonZkEvm);\nexport const polygonZkEvmTestnet = /*#__PURE__*/ defineChain(chains.polygonZkEvmTestnet);\nexport const pulsechain = /*#__PURE__*/ defineChain(chains.pulsechain);\nexport const pulsechainV4 = /*#__PURE__*/ defineChain(chains.pulsechainV4);\nexport const scrollTestnet = /*#__PURE__*/ defineChain(chains.scrollTestnet);\nexport const sepolia = /*#__PURE__*/ defineChain(chains.sepolia);\nexport const skaleBlockBrawlers = /*#__PURE__*/ defineChain(chains.skaleBlockBrawlers);\nexport const skaleCalypso = /*#__PURE__*/ defineChain(chains.skaleCalypso);\nexport const skaleCalypsoTestnet = /*#__PURE__*/ defineChain(chains.skaleCalypsoTestnet);\nexport const skaleChaosTestnet = /*#__PURE__*/ defineChain(chains.skaleChaosTestnet);\nexport const skaleCryptoBlades = /*#__PURE__*/ defineChain(chains.skaleCryptoBlades);\nexport const skaleCryptoColosseum = /*#__PURE__*/ defineChain(chains.skaleCryptoColosseum);\nexport const skaleEuropa = /*#__PURE__*/ defineChain(chains.skaleEuropa);\nexport const skaleEuropaTestnet = /*#__PURE__*/ defineChain(chains.skaleEuropaTestnet);\nexport const skaleExorde = /*#__PURE__*/ defineChain(chains.skaleExorde);\nexport const skaleHumanProtocol = /*#__PURE__*/ defineChain(chains.skaleHumanProtocol);\nexport const skaleNebula = /*#__PURE__*/ defineChain(chains.skaleNebula);\nexport const skaleNebulaTestnet = /*#__PURE__*/ defineChain(chains.skaleNebulaTestnet);\nexport const skaleRazor = /*#__PURE__*/ defineChain(chains.skaleRazor);\nexport const skaleTitan = /*#__PURE__*/ defineChain(chains.skaleTitan);\nexport const skaleTitanTestnet = /*#__PURE__*/ defineChain(chains.skaleTitanTestnet);\nexport const songbird = /*#__PURE__*/ defineChain(chains.songbird);\nexport const songbirdTestnet = /*#__PURE__*/ defineChain(chains.songbirdTestnet);\nexport const shardeumSphinx = /*#__PURE__*/ defineChain(chains.shardeumSphinx);\nexport const syscoin = /*#__PURE__*/ defineChain(chains.syscoin);\nexport const taraxa = /*#__PURE__*/ defineChain(chains.taraxa);\nexport const taraxaTestnet = /*#__PURE__*/ defineChain(chains.taraxaTestnet);\nexport const telos = /*#__PURE__*/ defineChain(chains.telos);\nexport const telosTestnet = /*#__PURE__*/ defineChain(chains.telosTestnet);\nexport const thunderTestnet = /*#__PURE__*/ defineChain(chains.thunderTestnet);\nexport const wanchain = /*#__PURE__*/ defineChain(chains.wanchain);\nexport const wanchainTestnet = /*#__PURE__*/ defineChain(chains.wanchainTestnet);\nexport const xdc = /*#__PURE__*/ defineChain(chains.xdc);\nexport const xdcTestnet = /*#__PURE__*/ defineChain(chains.xdcTestnet);\nexport const zhejiang = /*#__PURE__*/ defineChain(chains.zhejiang);\nexport const zkSync = /*#__PURE__*/ defineChain(chains.zkSync);\nexport const zkSyncTestnet = /*#__PURE__*/ defineChain(chains.zkSyncTestnet);\nexport const zora = /*#__PURE__*/ defineChain(chains.zora, {\n fees: feesOptimism,\n formatters: formattersOptimism,\n});\nexport const zoraTestnet = /*#__PURE__*/ defineChain(chains.zoraTestnet, {\n fees: feesOptimism,\n formatters: formattersOptimism,\n});\n//# sourceMappingURL=index.js.map","var t={name:\"Lattice Testnet\",id:4242,network:\"lattice-testnet\",nativeCurrency:{decimals:18,name:\"Ether\",symbol:\"ETH\"},rpcUrls:{default:{http:[\"https://follower.testnet-chain.linfra.xyz\"],webSocket:[\"wss://follower.testnet-chain.linfra.xyz\"]},public:{http:[\"https://follower.testnet-chain.linfra.xyz\"],webSocket:[\"wss://follower.testnet-chain.linfra.xyz\"]}},blockExplorers:{otterscan:{name:\"Otterscan\",url:\"https://explorer.testnet-chain.linfra.xyz\"},default:{name:\"Otterscan\",url:\"https://explorer.testnet-chain.linfra.xyz\"}},faucetUrl:\"https://faucet.testnet-mud-services.linfra.xyz\"};import{foundry as e}from\"viem/chains\";var r={...e,fees:{defaultPriorityFee:0n}};export{t as latticeTestnet,r as mudFoundry};\n//# sourceMappingURL=chains.js.map","import { MUDChain, latticeTestnet, mudFoundry } from \"@latticexyz/common/chains\";\n\n// import type { MUDChain } from \"./types\";\n\nexport const redStone = {\n name: \"Red Stone\",\n id: 17001,\n network: \"red-stone\",\n nativeCurrency: { decimals: 18, name: \"Ether\", symbol: \"ETH\" },\n rpcUrls: {\n default: {\n http: [\"https://rpc.holesky.redstone.xyz\"],\n webSocket: [\"wss://rpc.holesky.redstone.xyz/ws\"],\n },\n public: {\n http: [\"https://rpc.holesky.redstone.xyz\"],\n webSocket: [\"wss://rpc.holesky.redstone.xyz/ws\"],\n },\n },\n blockExplorers: {\n otterscan: {\n name: \"Otterscan\",\n url: \"https://explorer.holesky.redstone.xyz\",\n },\n default: {\n name: \"Otterscan\",\n url: \"https://explorer.holesky.redstone.xyz\",\n },\n },\n faucetUrl: \"https://faucet.testnet-mud-services.linfra.xyz\",\n} as const satisfies MUDChain;\n\n\n// If you are deploying to chains other than anvil or Lattice testnet, add them here\nexport const supportedChains: MUDChain[] = [mudFoundry, latticeTestnet, redStone];","import { getBurnerPrivateKey } from \"@latticexyz/common\";\nimport worldsJson from \"contracts/worlds.json\";\nimport { supportedChains } from \"./supportedChains\";\n\nconst worlds = worldsJson as Partial>;\n\nexport async function getNetworkConfig() {\n const params = new URLSearchParams(window.location.search);\n const chainId = Number(params.get(\"chainId\") || params.get(\"chainid\") || import.meta.env.VITE_CHAIN_ID || 31337);\n const chainIndex = supportedChains.findIndex((c) => c.id === chainId);\n const chain = supportedChains[chainIndex];\n if (!chain) {\n throw new Error(`Chain ${chainId} not found`);\n }\n\n const world = worlds[chain.id.toString()];\n const worldAddress = params.get(\"worldAddress\") || world?.address;\n if (!worldAddress) {\n throw new Error(`No world address found for chain ${chainId}. Did you run \\`mud deploy\\`?`);\n }\n\n const initialBlockNumber = params.has(\"initialBlockNumber\")\n ? Number(params.get(\"initialBlockNumber\"))\n : world?.blockNumber ?? 0n;\n\n return {\n privateKey: getBurnerPrivateKey(),\n chainId,\n chain,\n faucetServiceUrl: params.get(\"faucet\") ?? chain.faucetUrl,\n worldAddress,\n initialBlockNumber,\n };\n}\n","import { createWorld } from \"@latticexyz/recs\";\n\nexport const world = createWorld();\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\n\nimport { Contract, Signer, utils } from \"ethers\";\nimport type { Provider } from \"@ethersproject/providers\";\nimport type { IWorld, IWorldInterface } from \"../IWorld\";\n\nconst _abi = [\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"resource\",\n type: \"string\",\n },\n {\n internalType: \"address\",\n name: \"caller\",\n type: \"address\",\n },\n ],\n name: \"AccessDenied\",\n type: \"error\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"functionSelector\",\n type: \"bytes4\",\n },\n ],\n name: \"FunctionSelectorExists\",\n type: \"error\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"functionSelector\",\n type: \"bytes4\",\n },\n ],\n name: \"FunctionSelectorNotFound\",\n type: \"error\",\n },\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"resource\",\n type: \"string\",\n },\n ],\n name: \"InvalidSelector\",\n type: \"error\",\n },\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"module\",\n type: \"string\",\n },\n ],\n name: \"ModuleAlreadyInstalled\",\n type: \"error\",\n },\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"resource\",\n type: \"string\",\n },\n ],\n name: \"ResourceExists\",\n type: \"error\",\n },\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"resource\",\n type: \"string\",\n },\n ],\n name: \"ResourceNotFound\",\n type: \"error\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"length\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"received\",\n type: \"uint256\",\n },\n ],\n name: \"StoreCore_DataIndexOverflow\",\n type: \"error\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"expected\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"received\",\n type: \"uint256\",\n },\n ],\n name: \"StoreCore_InvalidDataLength\",\n type: \"error\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"expected\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"received\",\n type: \"uint256\",\n },\n ],\n name: \"StoreCore_InvalidFieldNamesLength\",\n type: \"error\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"expected\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"received\",\n type: \"uint256\",\n },\n ],\n name: \"StoreCore_InvalidKeyNamesLength\",\n type: \"error\",\n },\n {\n inputs: [],\n name: \"StoreCore_NotDynamicField\",\n type: \"error\",\n },\n {\n inputs: [],\n name: \"StoreCore_NotImplemented\",\n type: \"error\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"tableId\",\n type: \"bytes32\",\n },\n {\n internalType: \"string\",\n name: \"tableIdString\",\n type: \"string\",\n },\n ],\n name: \"StoreCore_TableAlreadyExists\",\n type: \"error\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"tableId\",\n type: \"bytes32\",\n },\n {\n internalType: \"string\",\n name: \"tableIdString\",\n type: \"string\",\n },\n ],\n name: \"StoreCore_TableNotFound\",\n type: \"error\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"system\",\n type: \"address\",\n },\n ],\n name: \"SystemExists\",\n type: \"error\",\n },\n {\n anonymous: false,\n inputs: [],\n name: \"HelloWorld\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n indexed: false,\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n ],\n name: \"StoreDeleteRecord\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n indexed: false,\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"StoreEphemeralRecord\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n indexed: false,\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n {\n indexed: false,\n internalType: \"uint8\",\n name: \"schemaIndex\",\n type: \"uint8\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"StoreSetField\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n indexed: false,\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"StoreSetRecord\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"acceptTrade\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"askStart\",\n outputs: [\n {\n internalType: \"uint32\",\n name: \"\",\n type: \"uint32\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"resourceSelector\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes\",\n name: \"funcSelectorAndArgs\",\n type: \"bytes\",\n },\n ],\n name: \"call\",\n outputs: [\n {\n internalType: \"bytes\",\n name: \"\",\n type: \"bytes\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"checkDebt\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"str\",\n type: \"string\",\n },\n {\n internalType: \"uint256\",\n name: \"num\",\n type: \"uint256\",\n },\n ],\n name: \"concatenate\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n {\n internalType: \"Schema\",\n name: \"valueSchema\",\n type: \"bytes32\",\n },\n ],\n name: \"deleteRecord\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n {\n internalType: \"Schema\",\n name: \"valueSchema\",\n type: \"bytes32\",\n },\n ],\n name: \"emitEphemeralRecord\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"findPartner\",\n outputs: [\n {\n internalType: \"uint32\",\n name: \"\",\n type: \"uint32\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"finishGame\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n {\n internalType: \"uint8\",\n name: \"schemaIndex\",\n type: \"uint8\",\n },\n {\n internalType: \"Schema\",\n name: \"valueSchema\",\n type: \"bytes32\",\n },\n ],\n name: \"getField\",\n outputs: [\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n {\n internalType: \"uint8\",\n name: \"schemaIndex\",\n type: \"uint8\",\n },\n {\n internalType: \"Schema\",\n name: \"valueSchema\",\n type: \"bytes32\",\n },\n ],\n name: \"getFieldLength\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n {\n internalType: \"uint8\",\n name: \"schemaIndex\",\n type: \"uint8\",\n },\n {\n internalType: \"Schema\",\n name: \"valueSchema\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint256\",\n name: \"start\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"end\",\n type: \"uint256\",\n },\n ],\n name: \"getFieldSlice\",\n outputs: [\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n ],\n name: \"getKeySchema\",\n outputs: [\n {\n internalType: \"Schema\",\n name: \"schema\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n {\n internalType: \"Schema\",\n name: \"valueSchema\",\n type: \"bytes32\",\n },\n ],\n name: \"getRecord\",\n outputs: [\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n ],\n name: \"getValueSchema\",\n outputs: [\n {\n internalType: \"Schema\",\n name: \"schema\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"resourceSelector\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"grantee\",\n type: \"address\",\n },\n ],\n name: \"grantAccess\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"increment\",\n outputs: [\n {\n internalType: \"uint32\",\n name: \"\",\n type: \"uint32\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"contract IModule\",\n name: \"module\",\n type: \"address\",\n },\n {\n internalType: \"bytes\",\n name: \"args\",\n type: \"bytes\",\n },\n ],\n name: \"installModule\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"contract IModule\",\n name: \"module\",\n type: \"address\",\n },\n {\n internalType: \"bytes\",\n name: \"args\",\n type: \"bytes\",\n },\n ],\n name: \"installRootModule\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"joinGame\",\n outputs: [\n {\n internalType: \"uint32\",\n name: \"\",\n type: \"uint32\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"targetX\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"targetY\",\n type: \"uint256\",\n },\n ],\n name: \"move\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"pay\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint8\",\n name: \"assetKind\",\n type: \"uint8\",\n },\n ],\n name: \"pickAsset\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"pickCoin\",\n outputs: [\n {\n internalType: \"uint32\",\n name: \"\",\n type: \"uint32\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint8\",\n name: \"cardId\",\n type: \"uint8\",\n },\n ],\n name: \"pickFund\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n {\n internalType: \"uint8\",\n name: \"schemaIndex\",\n type: \"uint8\",\n },\n {\n internalType: \"uint256\",\n name: \"byteLengthToPop\",\n type: \"uint256\",\n },\n {\n internalType: \"Schema\",\n name: \"valueSchema\",\n type: \"bytes32\",\n },\n ],\n name: \"popFromField\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n {\n internalType: \"uint8\",\n name: \"schemaIndex\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes\",\n name: \"dataToPush\",\n type: \"bytes\",\n },\n {\n internalType: \"Schema\",\n name: \"valueSchema\",\n type: \"bytes32\",\n },\n ],\n name: \"pushToField\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"resourceSelector\",\n type: \"bytes32\",\n },\n {\n internalType: \"string\",\n name: \"systemFunctionName\",\n type: \"string\",\n },\n {\n internalType: \"string\",\n name: \"systemFunctionArguments\",\n type: \"string\",\n },\n ],\n name: \"registerFunctionSelector\",\n outputs: [\n {\n internalType: \"bytes4\",\n name: \"worldFunctionSelector\",\n type: \"bytes4\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes16\",\n name: \"namespace\",\n type: \"bytes16\",\n },\n ],\n name: \"registerNamespace\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"resourceSelector\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes4\",\n name: \"worldFunctionSelector\",\n type: \"bytes4\",\n },\n {\n internalType: \"bytes4\",\n name: \"systemFunctionSelector\",\n type: \"bytes4\",\n },\n ],\n name: \"registerRootFunctionSelector\",\n outputs: [\n {\n internalType: \"bytes4\",\n name: \"\",\n type: \"bytes4\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n internalType: \"contract IStoreHook\",\n name: \"hook\",\n type: \"address\",\n },\n ],\n name: \"registerStoreHook\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"resourceSelector\",\n type: \"bytes32\",\n },\n {\n internalType: \"contract System\",\n name: \"system\",\n type: \"address\",\n },\n {\n internalType: \"bool\",\n name: \"publicAccess\",\n type: \"bool\",\n },\n ],\n name: \"registerSystem\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"resourceSelector\",\n type: \"bytes32\",\n },\n {\n internalType: \"contract ISystemHook\",\n name: \"hook\",\n type: \"address\",\n },\n ],\n name: \"registerSystemHook\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n internalType: \"Schema\",\n name: \"keySchema\",\n type: \"bytes32\",\n },\n {\n internalType: \"Schema\",\n name: \"valueSchema\",\n type: \"bytes32\",\n },\n {\n internalType: \"string[]\",\n name: \"keyNames\",\n type: \"string[]\",\n },\n {\n internalType: \"string[]\",\n name: \"fieldNames\",\n type: \"string[]\",\n },\n ],\n name: \"registerTable\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"rejectTrade\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"restartGame\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"resourceSelector\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"grantee\",\n type: \"address\",\n },\n ],\n name: \"revokeAccess\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n {\n internalType: \"uint8\",\n name: \"schemaIndex\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n {\n internalType: \"Schema\",\n name: \"valueSchema\",\n type: \"bytes32\",\n },\n ],\n name: \"setField\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n {\n internalType: \"Schema\",\n name: \"valueSchema\",\n type: \"bytes32\",\n },\n ],\n name: \"setRecord\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"targetPlayer\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"assetKind\",\n type: \"uint8\",\n },\n {\n internalType: \"uint32\",\n name: \"money\",\n type: \"uint32\",\n },\n ],\n name: \"trade\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n {\n internalType: \"uint8\",\n name: \"schemaIndex\",\n type: \"uint8\",\n },\n {\n internalType: \"uint256\",\n name: \"startByteIndex\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"dataToSet\",\n type: \"bytes\",\n },\n {\n internalType: \"Schema\",\n name: \"valueSchema\",\n type: \"bytes32\",\n },\n ],\n name: \"updateInField\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n] as const;\n\nexport class IWorld__factory {\n static readonly abi = _abi;\n static createInterface(): IWorldInterface {\n return new utils.Interface(_abi) as IWorldInterface;\n }\n static connect(address: string, signerOrProvider: Signer | Provider): IWorld {\n return new Contract(address, _abi, signerOrProvider) as IWorld;\n }\n}\n","import { mudConfig } from \"@latticexyz/world/register\";\nimport { resolveTableId } from \"@latticexyz/store/register\";\n\nexport default mudConfig({\n enums: {\n // GameState: [\"NotInited\", \"InGame\", \"Waiting\"]\n },\n modules: [\n {\n name: \"UniqueEntityModule\",\n root: true,\n args: [],\n },\n {\n name: \"KeysInTableModule\",\n root: true,\n args: [resolveTableId(\"Player\")],\n },\n {\n name: \"KeysWithValueModule\",\n root: true,\n args: [resolveTableId(\"Player\")],\n },\n {\n name: \"KeysInTableModule\",\n root: true,\n args: [resolveTableId(\"MapItem\")],\n },\n {\n name: \"KeysWithValueModule\",\n root: true,\n args: [resolveTableId(\"MapItem\")],\n },\n ],\n tables: {\n Counter: {\n keySchema: {},\n schema: \"uint32\",\n },\n Game:{\n keySchema: {},\n schema:{\n gameId:'uint256',\n startTime:'uint256',\n endTime:'uint256',\n finishTime:'uint256'//可以开始下一局游戏了\n }\n },\n GameState:{\n keySchema: {},\n schema:\"uint32\",\n },\n GameMap: {\n keySchema: {},\n schema: {\n width: \"uint256\",\n height: \"uint256\",\n mapArray:\"bytes\"\n }\n },\n FundCards:{\n keySchema:{},\n schema:{\n allCard:\"uint16[72]\"\n }\n },\n FundPool:{\n keySchema:{},\n schema:{\n placeHolder:\"uint256\",\n array:\"uint16[9]\"\n }\n },\n MapItem:{\n schema:{\n x:'uint256',\n y:'uint256'\n }\n },\n MapItemValue:{\n schema:'uint32'\n },\n IsPlayer:{\n dataStruct:false,\n schema:'bool'\n },\n Player:{\n dataStruct:true,\n schema:{\n gameId:'uint256',\n state:'uint32',\n money:'uint32',\n x:'uint256',\n y:'uint256'\n }\n },\n RaiseColddown:{\n dataStruct:true,\n schema:{\n start:'uint256',\n end:'uint256',\n }\n },\n AssetsList:{\n dataStruct:true,\n schema:{\n gpu:'int8',\n bitcoin:'int8',\n battery:'int8',\n leiter:'int8',\n gold:'int8',\n oil:'int8'\n }\n },\n OwnedCards:{\n schema:{\n array:\"uint256[]\"\n }\n },\n HasDebt:{\n schema:\"bool\"\n },\n Debt:{\n schema:\"uint32\"\n },\n Log:{\n dataStruct:true,\n schema:'uint256',\n },\n //Partner list\n TransactionList:{\n dataStruct:true,\n schema:{\n list:'bytes32[]'\n }\n },\n //trade transaction list\n TradeList:{\n dataStruct:true,\n schema:{\n list:'bytes'\n }\n },\n IsTrading:{\n dataStruct:false,\n schema:'bool'\n },\n PlayerGameResult:{\n dataStruct:true,\n schema:{\n rank:'int32',\n points:'int32',\n gpu:'int8',\n bitcoin:'int8',\n battery:'int8',\n leiter:'int8',\n gold:'int8',\n oil:'int8',\n }\n },\n IsEliminated:{\n schema:\"bool\"\n },\n UnsolicitedTransaction:{\n dataStruct:true,\n schema:{\n asset:'uint8',\n money:'uint32',\n to:'bytes32'\n }\n },\n PassiveTransaction:{\n dataStruct:true,\n schema:{\n asset:'uint8',\n money:'uint32',\n from:'bytes32'\n }\n }\n },\n});\n","import { createPublicClient, fallback, webSocket, http, createWalletClient, Hex, parseEther, ClientConfig } from \"viem\";\nimport { createFaucetService } from \"@latticexyz/services/faucet\";\nimport { encodeEntity, syncToRecs } from \"@latticexyz/store-sync/recs\";\nimport { getNetworkConfig } from \"./getNetworkConfig\";\nimport { world } from \"./world\";\nimport { IWorld__factory } from \"contracts/types/ethers-contracts/factories/IWorld__factory\";\nimport { createBurnerAccount, createContract, transportObserver, ContractWrite } from \"@latticexyz/common\";\nimport { Subject, share } from \"rxjs\";\nimport mudConfig from \"contracts/mud.config\";\n\nexport type SetupNetworkResult = Awaited>;\n\nexport async function setupNetwork() {\n const networkConfig = await getNetworkConfig();\n\n const clientOptions = {\n chain: networkConfig.chain,\n transport: transportObserver(fallback([webSocket(), http()])),\n pollingInterval: 1000,\n } as const satisfies ClientConfig;\n\n const publicClient = createPublicClient(clientOptions);\n\n const burnerAccount = createBurnerAccount(networkConfig.privateKey as Hex);\n const burnerWalletClient = createWalletClient({\n ...clientOptions,\n account: burnerAccount,\n });\n\n const write$ = new Subject();\n const worldContract = createContract({\n address: networkConfig.worldAddress as Hex,\n abi: IWorld__factory.abi,\n publicClient,\n walletClient: burnerWalletClient,\n onWrite: (write) => write$.next(write),\n });\n\n const { components, latestBlock$, blockStorageOperations$, waitForTransaction } = await syncToRecs({\n world,\n config: mudConfig,\n address: networkConfig.worldAddress as Hex,\n publicClient,\n // startSync: false,\n startBlock: BigInt(networkConfig.initialBlockNumber),\n });\n\n \n // Request drip from faucet\n // if (true) {\n // // const address = burnerAccount.address;\n // const faucetUrl = \"https://faucet.testnet-mud-services.linfra.xyz\"\n // const address = \"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266\"\n // console.info(\"[Dev Faucet]: Player address -> \", address);\n\n // const faucet = createFaucetService(faucetUrl);\n\n // const requestDrip = async () => {\n // const balance = await publicClient.getBalance({ address });\n // console.info(`[Dev Faucet]: Player balance -> ${balance}`);\n // const lowBalance = balance < parseEther(\"1\");\n // await faucet.dripDev({ address });\n // if (lowBalance) { \n // console.info(\"[Dev Faucet]: Balance is low, dripping funds to player\");\n // // Double drip\n // await faucet.dripDev({ address });\n // await faucet.dripDev({ address });\n // }\n // };\n\n\n // requestDrip();\n // // Request a drip every 20 seconds\n // setInterval(requestDrip, 20000);\n // }\n // Request drip from faucet\n if (networkConfig.faucetServiceUrl) {\n const address = burnerAccount.address;\n console.info(\"[Dev Faucet]: Player address -> \", address);\n\n const faucet = createFaucetService(networkConfig.faucetServiceUrl);\n\n const requestDrip = async () => {\n const balance = await publicClient.getBalance({ address });\n console.info(`[Dev Faucet]: Player balance -> ${balance}`);\n const lowBalance = balance < parseEther(\"1\");\n if (lowBalance) {\n console.info(\"[Dev Faucet]: Balance is low, dripping funds to player\");\n // Double drip\n await faucet.dripDev({ address });\n await faucet.dripDev({ address });\n }\n };\n\n requestDrip();\n // Request a drip every 20 seconds\n setInterval(requestDrip, 20000);\n }\n\n return {\n world,\n components,\n playerEntity: encodeEntity({ address: \"address\" }, { address: burnerWalletClient.account.address }),\n publicClient,\n walletClient: burnerWalletClient,\n latestBlock$,\n blockStorageOperations$,\n waitForTransaction,\n worldContract,\n write$: write$.asObservable().pipe(share()),\n };\n}\n","import { createClientComponents } from \"./createClientComponents\";\nimport { createSystemCalls } from \"./createSystemCalls\";\nimport { setupNetwork } from \"./setupNetwork\";\n\nexport type SetupResult = Awaited>;\n\nexport async function setup() {\n const network = await setupNetwork();\n const components = createClientComponents(network);\n const systemCalls = createSystemCalls(network, components);\n return {\n network,\n components,\n systemCalls,\n };\n}\n","\nimport { setup } from \"./mud/setup\";\nimport mudConfig from \"contracts/mud.config\";\nimport { runQuery ,getComponentValue,getComponentValueStrict, Has, Not } from \"@latticexyz/recs\";\n\nconst {\n components,\n systemCalls: {checkDebt, restartGame, pay,increment,joinGame,askStart,move,pickAsset,pickFund,trade,acceptTrade,rejectTrade,finishGame,pickCoin,findPartner },\n network,\n} = await setup();\n\nglobalThis.ponzi = {\n counter:0,\n currentPlayer:network.playerEntity,\n gameState:null,\n game:null,\n gameMap:null,\n mapItems:null,\n players:null,\n transactionList:null,\n percentage:0,\n}\n\nglobalThis.env = {\n components:components\n}\n\n// Components expose a stream that triggers when the component is updated.\ncomponents.GameState.update$.subscribe((update) => {\n const [nextValue, prevValue] = update.value;\n console.log(\"GameState updated\", update, { nextValue, prevValue });\n globalThis.ponzi.gameState = nextValue?nextValue.value:null;\n globalThis.ponzi.gamestate_update?.(prevValue?.value, nextValue?.value);\n});\n\n// Update initial sync status in the UI\ncomponents.SyncProgress.update$.subscribe((obj) => {\n console.log(\"onSyncProgressUpdate:\",obj);\n globalThis.ponzi.percentage = obj.value[0].percentage/100;\n globalThis.ponzi.syncprogress_update?.(globalThis.ponzi.percentage);\n});\n\n// components.Counter.update$.subscribe((update) => {\n// const [nextValue, prevValue] = update.value;\n// console.log(\"Counter updated\", update, { nextValue, prevValue });\n// globalThis.ponzi.counter = nextValue;\n// globalThis.ponzi.counter_update?.(prevValue, nextValue);\n// });\n\ncomponents.Game.update$.subscribe((update) => {\n const [nextValue, prevValue] = update.value;\n console.log(\"Game updated\", update, { nextValue, prevValue });\n globalThis.ponzi.game = nextValue;\n globalThis.ponzi.game_update?.(prevValue, nextValue);\n});\n\ncomponents.Player.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"Player updated\", update, { nextValue, prevValue });\n // globalThis.ponzi.player_update?.(prevValue, nextValue);\n globalThis.ponzi.player_update?.(update);\n});\n\ncomponents.GameMap.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"GameMap updated\", { nextValue, prevValue });\n globalThis.ponzi.gameMap = nextValue\n globalThis.ponzi.gamemap_update?.(prevValue, nextValue);\n});\n\ncomponents.FundPool.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"FundPool updated\", update);\n globalThis.ponzi.fundpool_update?.(update);\n});\n\ncomponents.MapItem.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n // console.log(\"MapItems updated\", { nextValue, prevValue });\n globalThis.ponzi.mapitems_update?.(prevValue, nextValue);\n});\n\ncomponents.IsPlayer.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"IsPlayer updated\", update);\n globalThis.ponzi.isplayer_update?.(update);\n});\n\ncomponents.IsEliminated.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"IsEliminated updated\", update);\n globalThis.ponzi.iseliminated_update?.(update);\n});\n\n// components.IsFinishGame.update$.subscribe((update)=>{\n// const [nextValue, prevValue] = update.value;\n// console.log(\"IsFinishGame updated\", update);\n// globalThis.ponzi.isfinishgame_update?.(update);\n// });\n\ncomponents.OwnedCards.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"OwnedCards updated\", update);\n // globalThis.ponzi.isplayer_update?.(update);\n});\n\ncomponents.TransactionList.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"TransactionList updated\", update);\n\n globalThis.ponzi.transactionList = nextValue\n globalThis.ponzi.transactionlist_update?.(update);\n});\n\ncomponents.Log.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"Log updated\", update);\n});\n\ncomponents.AssetsList.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"AssetsList updated\", update);\n globalThis.ponzi.assetslist_update?.(update);\n});\n\ncomponents.RaiseColddown.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"RaiseColddown updated\", update);\n globalThis.ponzi.raiseColddown_update?.(update);\n});\n\n//Trade\ncomponents.PassiveTransaction.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"PassiveTransaction updated\", update);\n globalThis.ponzi.passivetransaction_update?.(update);\n});\ncomponents.TradeList.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"TradeList updated\", update);\n globalThis.ponzi.tradelist_update?.(update);\n});\ncomponents.PlayerGameResult.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"PlayerGameResult updated\", update);\n globalThis.ponzi.playergameresult_update?.(update);\n});\ncomponents.HasDebt.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"HasDebt updated\", update);\n globalThis.ponzi.hasdebt_update?.(update);\n});\ncomponents.TransactionList.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"TransactionList updated\", update);\n globalThis.ponzi.transactionlist_update?.(update);\n});\n\n//get functions\n(window as any).getPlayers = () => {\n return components.Player.values;\n}\n\n(window as any).getIsPlayers = () => {\n return components.IsPlayer.values;\n}\n\n(window as any).getMapItems = ()=>{\n return components.MapItem.values;\n}\n\n(window as any).getAssetsList = ()=>{\n return components.AssetsList.values;\n}\n\n(window as any).getTransactionList = ()=>{\n return components.TransactionList.values;\n}\n\n(window as any).getFundPool = ()=>{\n return components.FundPool.values;\n}\n\n//Query\n(window as any).queryValue = async (component, entity) => {\n const data = getComponentValueStrict(component, entity)\n console.log(\"getValueByComAndEntity:\", data);\n return data;\n};\n\n(window as any).queryPlayingAssetsList = async ()=>{\n const matchingEntities = runQuery([\n Has(components.AssetsList),\n Has(components.Player)\n ])\n\n return matchingEntities;\n}\n\n(window as any).queryResultAssetsList = async ()=>{\n const matchingEntities = runQuery([\n Has(components.AssetsList),\n Not(components.IsEliminated)\n ])\n\n return matchingEntities;\n}\n\n\n// Just for demonstration purposes: we create a global function that can be\n// called to invoke the Increment system contract via the world. (See IncrementSystem.sol.)\n(window as any).increment = async () => {\n let data = await increment();\n console.log(\"new counter value:\", data);\n return data;\n};\n(window as any).joinGame = async () => {\n let data = await joinGame();\n console.log(\"joinGame:\", data);\n return data;\n};\n(window as any).askStart = async () => {\n let data = await askStart();\n console.log(\"askStart:\", data);\n return data;\n};\n(window as any).move = async (x,y) => {\n let data = await move(x,y);\n console.log(\"move:\", data);\n return data;\n};\n(window as any).pickAsset = async (assetKind) => {\n console.log(\"send pickAsset:\", assetKind);\n await pickAsset(assetKind);\n};\n(window as any).pickFund = async (cardId) => {\n console.log(\"send pickFund:\", cardId);\n await pickFund(cardId);\n};\n(window as any).trade = async (targetPlayer:string,assetKind:number,money:number) => {\n console.log(\"send trade:\", targetPlayer, money, assetKind);\n await trade(targetPlayer,assetKind,money);\n};\n(window as any).acceptTrade = async () => {\n let data = await acceptTrade();\n console.log(\"send acceptTrade:\"+data);\n};\n(window as any).rejectTrade = async () => {\n let data = await rejectTrade();\n console.log(\"send rejectTrade:\"+data);\n};\n\n(window as any).finishGame = async () => {\n console.log(\"send finishGame\");\n let data = await finishGame();\n};\n\n(window as any).pickCoin = async () => {\n console.log(\"send pickCoin...\");\n let data = await pickCoin();\n console.log(\"send pickCoin data:\"+data);\n};\n\n(window as any).searchPartner = async () => {\n console.log(\"send searchPartner...\");\n let data = await findPartner();\n // console.log(\"send findPartner data:\"+data);\n};\n(window as any).payDebt = async () => {\n console.log(\"send pay...\");\n let data = await pay();\n};\n(window as any).restartGame = async () => {\n console.log(\"send restartGame...\");\n let data = await restartGame();\n};\n(window as any).checkDebt = async ()=>{\n console.log(\"send checkDebt...\");\n let data = await checkDebt();\n}\n// // start sync manually by subscribing to `blockStorageOperation$`\n// const subcription = network.blockStorageOperation$.subscribe();\n \n// // clean up subscription\n// subscription.unsubscribe();\n\n\n// https://vitejs.dev/guide/env-and-mode.html\nif (true||import.meta.env.DEV) {\n const { mount: mountDevTools } = await import(\"@latticexyz/dev-tools\");\n console.log(\"============================\");\n mountDevTools({\n config: mudConfig,\n publicClient: network.publicClient,\n walletClient: network.walletClient,\n latestBlock$: network.latestBlock$,\n blockStorageOperations$: network.blockStorageOperations$,\n worldAddress: network.worldContract.address,\n worldAbi: network.worldContract.abi,\n write$: network.write$,\n recsWorld: network.world,\n });\n}","import { hexToArray } from \"@latticexyz/utils\";\n\nwindow.mudutils = {};\nwindow.mudutils.hexToArray = function(width, height, mapArray){\n const terrain = Array.from(hexToArray(mapArray)).map((value:number, index) => {\n return value;\n });\n\n const terrainArray = [];\n for (let i = 0; i < terrain.length; i += Number(width)) {\n const row = terrain.slice(i, i + Number(width));\n terrainArray.push(row);\n }\n\n return terrainArray;\n}"],"names":["components","error","_len","args","_key","defineProperty","func","invoked","noop","isFunction","fn","value","t","isObject","isPlainObject","proto","protoConstructor","obj","constructor","object","propName","name","theClass","x","thing","keys","symbols","s","target","prop","res","key","props","i","descriptor","Constructor","protoProps","staticProps","source","subClass","superClass","o","p","self","minLen","n","arr","len","arr2","allowArrayLike","it","input","hint","prim","arg","annotation","decorator","property","prototype","Atom","name_","_proto","listener","onBecomeObservedHandler","onBecomeUnobservedHandler","atom","a","b","v","_","observable","newValue","oldValue","options","adm","_this$options_","actionDescriptor","proxyTrap","_ref","_ref2","safeDescriptors","_annotation$options_","_annotation$options_$","_annotation$options_2","_annotation$options_$2","_annotation$options_3","_annotation$options_4","_adm$proxy_2","_adm$proxy_","flowDescriptor","_this$options_2","bound","_this$options_$enhanc","_this$options_3","_this$options_4","set","flowAnnotation","actionAnnotation","observableAnnotation","_this$options_5","_this$options_6","_options$defaultDecor","arg2","arg3","initialValues","decorators","arg1","opts","actionName","autoAction","ref","canRunAsDerivation","scope","runInfo","err","notifySpy_","startTime_","prevDerivation_","runAsAction","prevAllowStateChanges_","prevAllowStateReads_","allowStateChanges","prev","_Atom","ObservableValue","enhancer","notifySpy","equals","_this","change","handler","fireImmediately","ComputedValue","prevTrackingContext","result","wasSuspended","changed","track","e","firstTime","prevValue","prevU","IDerivationState_","TraceMode","cause","derivation","prevAllowStateReads","prevUntracked","obs","l","f","context","prevTracking","prevObserving","observing","lowestNewObservingDerivationState","i0","dep","_dep","_dep2","action","allowStateReads","global","node","list","d","Reaction","onInvalidate_","errorHandler_","requiresObservable_","prevReaction","message","abortSignal","_this2","dispose","enterBreakPoint","allReactions","iterations","remainingReactions","event","view","_opts$name","_opts","_opts2","_opts2$signal","_opts3","runSync","reaction","reactionRunner","scheduler","isScheduled","run","hook","cb","listenersKey","hookListeners","properties","annotations","descriptors","generator","ctx","runId","gen","rejector","pendingPromise","promise","resolve","reject","stepId","onFulfilled","ret","next","onRejected","_res","yieldedPromise","thisArg","_getAdm$set_","_getAdm$delete_","_getAdm$definePropert","_target$$mobx","_target$$mobx$proxy_","interceptable","interceptors","idx","listenable","listeners","ObservableArrayAdministration","owned_","legacyMode_","newV","oldV","values","newLength","currentLength","newItems","oldLength","delta","index","deleteCount","length","lengthDelta","_this$values_","oldItems","_i","notify","added","removed","owned","proxy","_len2","items","_key2","_len3","_key3","copy","funcName","funcFactory","dehancedValues","callback","element","_this3","accumulator","currentValue","ObservableMap","initialData","enhancer_","entry","newEntry","hasKey","_change","_this3$hasMap_$get","_this4","_this4$hasMap_$get","_keys$next","done","_keys$next2","_iterator","_step","_step$value","other","_this5","_this6","_iterator2","_step2","_this7","replacementMap","orderedData","keysReportChangedCalled","_iterator3","_step3","deleted","_iterator4","_step4","_step4$value","_value","keyExisted","_value2","iter1","iter2","next1","next2","dataStructure","map","ObservableSet","callbackFn","_change2","nextIndex","observableValues","ObservableObjectAdministration","target_","values_","defaultAnnotation_","_this$target_$storedA","outcome","deleteOutcome","cachedDescriptor","_this$pendingKeys_","_this$pendingKeys_$ge","_getDescriptor","_this$pendingKeys_2","_this$pendingKeys_2$g","_options$name","_adm$target_$storedAn","ctor","_StubArray","_Symbol$toStringTag","_Symbol$iterator","LegacyObservableArray","arrays","max","_observable","named","depth","aStack","bStack","type","className","areArrays","aCtor","bCtor","iterator","m","g","__extends","__","__awaiter","_arguments","P","adopt","fulfilled","step","rejected","body","y","verb","op","__read","r","ar","__spreadArray","to","from","pack","q","resume","settle","fulfill","createImpl","_super","instance","ctorFunc","errors","item","Subscription","initialTeardown","e_1","_a","e_2","_b","_parentage","_parentage_1","_parentage_1_1","parent_1","e_1_1","initialFinalizer","_finalizers","_finalizers_1","_finalizers_1_1","finalizer","e_2_1","teardown","parent","empty","timeout","delegate","handle","Subscriber","destination","complete","ConsumerObserver","partialObserver","SafeSubscriber","observerOrNext","context_1","identity","fns","pipeFromArray","Observable","subscribe","operator","subscriber","sink","promiseCtor","Symbol_observable","operations","init","liftedSource","onNext","onComplete","onError","onFinalize","OperatorSubscriber","shouldUnsubscribe","closed_1","Subject","subject","_c","observer","observers","hasError","isStopped","thrownError","AnonymousSubject","ReplaySubject","_bufferSize","_windowTime","_timestampProvider","_buffer","_infiniteTimeWindow","subscription","adjustedBufferSize","now","last","defaultValue","isAsyncIterable","isIterable","Symbol_iterator","readableStream","reader","array","iterable","iterable_1","iterable_1_1","asyncIterable","process","asyncIterable_1","asyncIterable_1_1","parentSubscription","work","delay","repeat","scheduleSubscription","config","hasConfig","project","isArray","getPrototypeOf","first_1","resultSelector","observables","valueTransform","active","remainingFirstValues","_loop_1","hasFirstValue","execute","concurrent","onBeforeNext","expand","innerSubScheduler","additionalFinalizer","buffer","isComplete","checkComplete","outerNext","doInnerSub","innerComplete","innerValue","bufferedValue","ii","concat","observableFactory","sources","predicate","selector","innerSub","syncUnsub","handledResult","count","seen","share","connector","resetOnError","resetOnComplete","_d","resetOnRefCountZero","wrapperSource","connection","resetConnection","refCount","hasCompleted","hasErrored","cancelReset","reset","resetAndUnsubscribe","conn","dest","on","configOrBufferSize","windowTime","bufferSize","tapObserver","isUnsub","module","exports","assert","val","msg","inherits","superCtor","TempCtor","BN","number","base","endian","Buffer","num","left","right","start","j","w","off","parseHex4Bits","string","c","parseHexByte","lowerBound","parseLength","parseBase","str","end","mul","limbLen","limbPow","total","mod","word","pow","move","src","size","inspect","zeros","groupSizes","groupBases","padding","out","carry","groupSize","groupBase","allocate","ArrayType","byteLength","reqLength","postfix","position","shift","hi","toBitArray","bit","wbit","width","bytesNeeded","bitsLeft","cmp","smallMulTo","lo","k","ncarry","rword","maxJ","comb10MulTo","mid","a0","al0","ah0","a1","al1","ah1","a2","al2","ah2","a3","al3","ah3","a4","al4","ah4","a5","al5","ah5","a6","al6","ah6","a7","al7","ah7","a8","al8","ah8","a9","al9","ah9","b0","bl0","bh0","b1","bl1","bh1","b2","bl2","bh2","b3","bl3","bh3","b4","bl4","bh4","b5","bl5","bh5","b6","bl6","bh6","b7","bl7","bh7","b8","bl8","bh8","b9","bl9","bh9","w0","w1","w2","w3","w4","w5","w6","w7","w8","w9","w10","w11","w12","w13","w14","w15","w16","w17","w18","bigMulTo","hncarry","jumboMulTo","isNegNum","bits","carryMask","newCarry","extended","h","mask","maskedWords","mode","bhi","bhiBits","diff","qj","positive","div","dm","half","r2","acc","A","B","C","D","yp","xp","im","jm","x1","x2","negative","Red","primes","MPrime","tmp","rlen","K256","output","outLen","P224","P192","P25519","prime","mod3","one","nOne","lpow","z","inv","windowSize","wnd","current","currentLen","Mont","u","this","version","missing","form","LogLevel","ErrorCode","logLevel","level","code","params","messageDetails","hex","reason","url","fault","condition","expectedCount","kind","censorship","permanent","logger","objects","accum","offset","data","endOffset","_BN","_constructorGuard","constructorGuard","toHex","anyValue","operation","promises","info","param","allowIndexed","originalParam","throwError","newNode","child","sibling","match","format","comp","ParamTypify","allowIndex","anonymous","modifier","comps","state","parens","returns","fragment","sig","checkErrors","path","childPath","localName","dynamic","wordSize","writer","bytes","paddingOffset","Reader","coerceFunc","allowLoose","loose","alignedLength","INPUT_ERROR","FINALIZE_ERROR","WINDOW","root","WEB_WORKER","NODE_JS","COMMON_JS","ARRAY_BUFFER","HEX_CHARS","SHAKE_PADDING","CSHAKE_PADDING","KECCAK_PADDING","PADDING","SHIFT","RC","BITS","SHAKE_BITS","OUTPUT_TYPES","CSHAKE_BYTEPAD","createOutputMethod","outputType","Keccak","createShakeOutputMethod","outputBits","createCshakeOutputMethod","methods","createKmacOutputMethod","createOutputMethods","method","createMethod","createShakeMethod","createCshakeMethod","createKmacMethod","Kmac","algorithms","methodNames","algorithm","methodName","newMethodName","notString","blocks","byteCount","blockCount","strs","paddingBytes","outputBlocks","extraBytes","block","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","b10","b11","b12","b13","b14","b15","b16","b17","b18","b19","b20","b21","b22","b23","b24","b25","b26","b27","b28","b29","b30","b31","b32","b33","b34","b35","b36","b37","b38","b39","b40","b41","b42","b43","b44","b45","b46","b47","b48","b49","keccak256","payload","address","chars","expanded","hashed","checksum","getAddress","isAddress","getContractAddress","transaction","nonce","coder","coders","arrayValues","unique","staticWriter","Writer","dynamicWriter","updateFuncs","dynamicOffset","updateFunc","baseOffset","baseReader","offsetReader","uniqueNames","defaultChild","signed","maxUintValue","bounds","UnicodeNormalizationForm","Utf8ErrorReason","badCodepoint","extraLength","overlongMask","nextChar","pair","codePoints","codePoint","types","component","id","text","wrap","fragments","abi","bucket","signature","eventFragment","nameOrSignatureOrSighash","matching","nameOrSignatureOrTopic","topichash","getSighash","functionFragment","errorArgs","errorName","errorSignature","builtin","topics","encodeTopic","dataTypes","dataValues","topicHash","indexed","nonIndexed","resultIndexed","resultNonIndexed","nonIndexedIndex","indexedIndex","tx","log","hexData","gasPrice","lastBaseFeePerGas","maxFeePerGas","maxPriorityFeePerGas","eventName","blockTag","signedTx","hasEip1559","feeData","results","provider","domain","TransactionTypes","addr","storageKeys","storageKey","resolver","nameOrPromise","paramType","contract","overrides","check","resolved","ro","intrinsic","roValue","leftovers","signerOrProvider","wait","confirmations","receipt","parsed","collapseSimple","txRequest","filter","topic","tag","once","listenerCount","argsCopy","contractInterface","addressOrName","uniqueFilters","eventSignature","filters","uniqueSignatures","signatures","runningEvent","emit","wrappedEmit","fromBlockOrBlockhash","toBlock","logs","E","tr","fe","I","K","H","S","$","ne","te","ee","R","oe","T","O","Y","G","J","V","ue","se","le","ye","de","me","ae","pe","ce","Te","BaseError","shortMessage","details","docsPath","regex","bytesRegex","integerRegex","abiParameter","structs","inputParams","inputs","inputLength","outputs","outputParams","outputLength","abiParameters","parameterCacheKey","isTuple","components_","char","tail","shallowStructs","signaturesLength","propertiesLength","trimmed","resolvedStructs","entries","entriesLength","parameters","ancestors","parseAbiParameter_","abiItem","includeName","strict","getUrl","expectedLength","givenLength","expectedSize","functionName","givenSize","targetSize","hexOrBytes","dir","hex_","paddedBytes","padEnd","min","maxSize","sliceLength","size_","hexToNumber","hexToBytes","hexes","_v","bytesToHex","hexString","value_","maxValue","minValue","suffix","encoder","toBytes","hexByte","byte","def","parts","bool","lengths","hash","exists","checkFinished","lst","Ah","Al","Bh","Bl","Cl","low","Ch","Dl","Dh","El","Eh","isLE","utf8ToBytes","wrapConstructor","hashConstructor","hashC","hashCons","_0n","_1n","_2n","round","rounds","idx1","idx0","B0","B1","Th","Tl","curH","curL","PI","Hash","blockLen","outputLen","enableXOF","pos","take","bufferOut","to_","concatBytes","preparedParams","arrayComponents","staticSize","encoded","staticParams","dynamicParams","dynamicSize","dynamicChild","preparedParam","paramSize","bytesSize","hexValue","partsLength","param_","matches","abiItems","argType","abiParameterType","definition","indexedInputs","args_","client","requestMap","method_","status","transport","fromBlock","getRequest","account","address_","chainId","hexAddress","decodedValues","consumed","decodedChild","hasUnnamedChild","replacer","space","includeFunctionName","decimals","display","integer","fraction","wei","unit","maxLength","chain","gas","prettyArgs","blockHash","blockNumber","identifier","account_","contractAddress","sender","formattedArgs","functionWithParams","decodedData","metaMessages","firstArg","errorWithParams","headers","transactionRequest","transaction_","transactions","blockTag_","includeTransactions_","includeTransactions","blockNumberHex","request","defaultPriorityFee","accessList","rest","balance","currentChainId","fees","formatters","serializers","shouldSplitBatch","exec","getScheduler","flush","getBatchedArgs","setScheduler","batch","response","offchainLookup","offchainLookupSignature","request_","batchSize","multicallAddress_","multicallAddress","schedule","requests","calls","calldata","returnData","success","callRequest","dataSuffix","observerId","callbacks","callbackId","getListeners","unsubscribe","unwatch","cleanup","time","emitOnBegin","initialWaitTime","interval","initialWait","poll","cacheKey","buildCache","cache","cacheTime","maxAge","strict_","argTopics","isUnnamed","nonIndexedInputs","_client","events_","events","onLogs","poll_","pollingInterval","previousBlockNumber","initialized","unsubscribe_","formatted","chainIdHex","serializer","signedRequest","publicClient","walletClient","hasPublicClient","hasWalletClient","hasReadFunction","hasWriteFunction","hasEvent","abiEvent","hasArgs","nativeCurrency","rpcUrls","blockExplorers","publicKey","createClient","extend","extendFn","combined","delay_","retryCount","shouldRetry","attemptRetry","retry","retryDelay","err_","retryAfter","transports_","rank","transports","onResponse","fetch","rankOptions","onTransports","sampleCount","weights","stabilityWeight","latencyWeight","samples","rankTransports_","sample","transport_","maxLatency","latency","scores","latencies","latencyScore","successes","stabilityScore","errorInstance","signal","timeoutId","controller","http","fetchOptions","signal_","url_","urlKey","socket","WebSocket","webSocket","subscriptions","onMessage","isSubscription","onClose","socket_","id_","rpc","retryCount_","timeout_","callType","primaryType","types_","validateData","struct","type_","integerMatch","_type","bytesMatch","bytecode","description","transactionReceipt","domain_","encodedTypes","encodedValues","field","encodedHashType","unsortedDeps","deps","primaryType_","parsedType","typeValuePairs","messageBytes","prefixBytes","serializedAccessList","serializedTransaction","rounded","ether","label","labels","hashFromEncodedLabel","packet","coinType","universalResolverAddress_","universalResolverAddress","functionData","uri","namespace","img","custom","defaultGateway","gatewayUrls","isEncoded","ipfsGateway","arweaveGateway","networkRegexMatch","protocol","subpath","subtarget","isIPNS","isIPFS","replacedUri","parsedUri","resolvedURI","isOnChain","uri_","reference","asset_namespace","tokenID","eip_namespace","chainID","erc_namespace","nft","record","nftUri","resolvedNftUri","encodedJson","decoded","uriTokenId","reverseNode","resolverAddress","feeHistory","reward","rewardPercentiles","slot","transactionBlockNumber","allowFailure","batchSize_","contracts_","contracts","chunkedCalls","currentChunk","currentChunkSize","callData","u8a","title","sum","pad","hashLen","qByteLen","hmacFn","reseed","seed","sl","pred","validators","optValidators","checkField","fieldName","isOptional","checkVal","a_","b_","signatureHex","emitMissed","onBlockNumber","enablePolling","prevBlockNumber","onReplaced","replacedTransaction","retrying","_unobserve","_unwatch","blockNumber_","replacementTransaction","onBlock","prevBlock","onTransactions","hashes","permissions","signMessage","message_","signTypedData","typedData","onData","subscriptionId","bytesLength","byteOffset","_32n","_u32_max","wh","wl","padOffset","dataView","oview","finished","destroyed","F","W15","W2","s0","s1","sigma1","T1","T2","_3n","power","modulo","invert","legendreC","Q","Z","p1div4","Fp","Q1div2","t2","ge","n2","nv","initial","nums","lastMultiplied","inverted","nBitLength","_nBitLength","nByteLength","ORDER","bitLen","redef","BYTES","sqrtP","lhs","rhs","groupOrder","constTimeNegate","neg","W","windows","elm","points","window","precomputes","maxNumber","shiftBy","wbits","offset1","offset2","cond1","cond2","precomputesMap","transform","curve","ut.validateObject","endo","ut","sBytes","rBytesLeft","slice","shl","rhl","rl","CURVE","point","isCompressed","ut.concatBytes","fromBytes","weierstrassEquation","x3","isWithinCurveOrder","assertGE","normPrivateKeyToScalar","wrapPrivateKey","ut.bytesToHex","ut.bytesToNumberBE","mod.mod","pointPrecomputes","assertPrjPoint","Point","px","py","pz","is0","toInv","privateKey","X1","Y1","Z1","X2","Y2","Z2","U1","U2","X3","Y3","Z3","t0","t1","t3","t4","t5","wnaf","k1neg","k1","k2neg","k2","k1p","k2p","scalar","fake","f1p","f2p","iz","ax","ay","zz","cofactor","isTorsionFree","clearCofactor","_bits","curveDef","CURVE_ORDER","compressedLen","uncompressedLen","isValidFieldElement","modN","invN","mod.invert","cat","head","y2","isYOdd","numToNByteStr","ut.numberToBytesBE","isBiggerThanHalfOrder","HALF","normalizeS","slcNum","Signature","recovery","msgHash","rec","bits2int_modN","radj","prefix","ir","u1","u2","ut.hexToBytes","utils","rand","mod.hashToPrivateScalar","getPublicKey","isProbPub","getSharedSecret","privateA","publicB","bits2int","ORDER_MASK","ut.bitMask","int2octets","prepSig","defaultSigOpts","randomBytes","lowS","prehash","ent","h1int","seedArgs","k2sig","kBytes","ik","normS","defaultVerOpts","sign","privKey","ut.createHmacDrbg","verify","sg","_sig","derError","is","buf","oHash","iHash","msgs","defHash","create","_6n","_11n","_22n","_23n","_44n","_88n","b88","b176","b220","b223","POW_2_128","L","U","M","N","X","parse","fmtLong","fmtShort","ms","msAbs","plural","isPlural","setup","env","createDebug","coerce","disable","enable","enabled","require$$0","destroy","selectColor","prevTime","enableOverride","namespacesCache","enabledCache","debug","curr","formatter","delimiter","newDebug","namespaces","split","toNamespace","regexp","formatArgs","save","load","useColors","localstorage","warned","lastC","timeouts","currentTime","timeoutOps","counts","mainError","mainErrorCount","RetryOperation","attempt","random","original","attemptNumber","retriesLeft","errorMessage","AbortError","be","util","assertIs","_arg","assertNever","_x","validKeys","filtered","checker","joinValues","separator","objectUtil","first","second","issues","sub","subs","actualProto","_mapper","mapper","issue","fieldErrors","processError","el","formErrors","_ctx","errorMaps","issueData","fullPath","fullIssue","maps","arrayValue","pairs","syncPairs","finalObject","errorUtil","errorMap","invalid_type_error","required_error","iss","maybeAsyncResult","getIssueProperties","setError","refinementData","refinement","option","incoming","defaultValueFunc","catchValueFunc","This","ip","validation","tooBig","tooSmall","minLength","ch","valDecCount","stepDecCount","decCount","valInt","stepInt","inclusive","minDate","maxDate","schema","newShape","fieldSchema","shape","shapeKeys","extraKeys","keyValidator","unknownKeys","catchall","defaultError","augmentation","merging","newField","handleResults","unionErrors","childCtx","dirty","discriminator","discriminatorValue","optionsMap","discriminatorValues","aType","bType","bKeys","sharedKeys","newObj","sharedValue","newArray","itemA","itemB","handleParsed","parsedLeft","parsedRight","merged","itemIndex","schemas","keyType","valueType","third","finalMap","finalizeSet","elements","parsedSet","minSize","makeArgsIssue","makeReturnsIssue","parsedArgs","parsedReturns","returnType","getter","expectedValues","enumValues","opt","nativeEnumValues","promisified","effect","checkCtx","processed","executeRefinement","inner","preprocess","newCtx","inResult","fatal","_fatal","p2","ZodFirstPartyTypeKind","cls","red","green","blue","styles","codes","groupName","group","styleName","style","colorString","character","remainder","brand","substring","substringLength","endIndex","returnValue","gotCR","supportsColor","colorLevel","chalk","strings","ansiStyles","builder","model","arguments_","styler","bgModel","open","close","openAll","closeAll","_styler","_isEmpty","lfIndex","issueSeparator","unionSeparator","zodError","newIssues","prefixSeparator","maxIssuesInMessage","E.isAddress","_obj","_1","_2","isApply","DoubleIndexedKV","Registry","generateIdentifier","extendStatics","ClassRegistry","valuesNotNever","CustomTransformerRegistry","transformer","getType","segment","isEscapedDot","isEndOfSegment","lastSegment","__assign","il","isApplicable","untransform","superJson","baseError","flags","isRegistered","potentialClass","clazz","allowedProps","applicableCompositeRule","rule","applicableSimpleRule","json","transformation","row","keyOfRow","isEnd","lastKey","keyToRow","newKey","tree","walker","origin","subtree","nodeValue","children","plain","apply","identicalPaths","identicalObjectPath","identicalPath","identities","existingSet","identitites","rootEqualityPaths","paths","shortestPath","dedupe","objectsInThisPath","seenObjects","primitive","transformed_1","result_1","transformationResult","transformed","transformedValue","innerAnnotations","recursiveResult","newVal","originalObject","includeNonenumerable","propType","SuperJSON","equalityAnnotations","meta","teardownRef","isDone","unsubscribed","teardownImmediately","originalObserver","startIfNeeded","resetIfNeeded","_sub","abort","onDone","obs$","nextOp","customFetchImpl","customAbortControllerImpl","dict","_input","queryParts","ac","resolvedHeaders","runtime","batchLoader","pendingItems","dispatchTimer","destroyTimerAndPendingItems","groupItems","groupedItems","lastGroup","dispatch","unitResolver","cancel","_item","requester","resolvedOpts","maxURLLength","validate","batchOps","query","mutation","loaders","loader","requesterOpts","req$","envelope","combinedTransformer","link","clientCallType","pathCopy","procedureType","worldContract","waitForTransaction","Counter","GameState","Game","IsPlayer","Player","AssetsList","getComponentValue","singletonEntity","assetType","cardId","targetPlayer","money","high","unsigned","cachedObj","lowBits","highBits","radix","radixToPower","radixLong","rem1","rem","remDiv","intval","digits","thisNeg","otherNeg","addend","a48","a32","a16","a00","b00","c48","c32","c16","c00","subtrahend","multiplier","divisor","approx","halfThis","log2","approxRes","approxRem","numBits","pending","base64","b64","s64","chunk","invalidEncoding","evt","f32","f8b","writeFloat_f32_cpy","writeFloat_f32_rev","readFloat_f32_cpy","readFloat_f32_rev","writeFloat_ieee754","writeUint","exponent","mantissa","readFloat_ieee754","readUint","uint","f64","writeDouble_f64_cpy","writeDouble_f64_rev","readDouble_f64_cpy","readDouble_f64_rev","writeDouble_ieee754","off0","off1","readDouble_ieee754","utf8","alloc","SIZE","MAX","slab","LongBits","zero","zeroHash","charCodeAt","part0","part1","part2","require$$1","require$$2","require$$3","require$$4","require$$5","require$$6","require$$7","sizeOrArray","merge","dst","ifNotSet","newError","CustomError","fieldNames","fieldMap","encoding","BufferWriter","push","write_uint32","write_int32","write_sint32","write_uint64","write_sint64","write_bool","write_fixed32","write_fixed64","write_float","write_double","writeBytes_set","writeBytes_for","write_bytes","write_string","fork","ldelim","finish","BufferWriter_","write_bytes_buffer","write_string_buffer","BufferReader","writeLength","create_typed_array","create_array","read_uint32_setup","read_int32","read_sint32","read_bool","read_fixed32","read_sfixed32","read_float","read_double","read_bytes","nativeBuffer","read_string","skip","wireType","BufferReader_","read_string_buffer","rpcImpl","requestDelimited","responseDelimited","rpcCall","requestCtor","responseCtor","endedByRPC","protobuf","configure","Metadata","metadata","Status","composeClientMiddleware_1","middleware1","middleware2","call","options2","setPrototypeOf","propertyDescriptor","hasOwnProperty","objectCreate","propertyDescriptors","helpers","uglyErrorPrinting","extendableErrorName","ExtendableError","originalConstructor","constructorName","constructorNameMatch","constructorNameIsError","ClientError_1","ts_error_1","Status_1","composeServerMiddleware_1","context1","ServerError_1","__createBinding","desc","__exportStar","require$$8","require$$9","require$$10","requestEncode","requestFromPartial","responseEncode","responseFromPartial","grpc_web_1","serviceName","executor","removeAbortListener","callbackResult","dueTime","timer","unlisten","sourceObj","innerAbortController","abortListener","rejection","settledCount","settled","baseMs","maxDelayMs","maxAttempts","delayMs","backoff","deferredFunctions","spawnAbortController","spawnSignal","abortSpawn","tasks","abortTasks","task","removeSpawnAbortListener","failure","forkFn","taskAbortController","taskSignal","taskPromise","deferPromise","abortController","attemptsExhausted","handleFulfilled","handleRejected","makeAttempts","AsyncSink_1","isAsyncIterable_1","factory","VERSION","_hasatob","_hasbtoa","_hasBuffer","_TD","_TE","b64ch","b64chs","b64tab","tab","b64re","_fromCC","_U8Afrom","_mkUriSafe","m0","_tidyB64","btoaPolyfill","bin","u32","asc","_btoa","_fromUint8Array","maxargs","fromUint8Array","urlsafe","cb_utob","cc","re_utob","utob","_encode","encode","encodeURI","re_btou","cb_btou","cccc","cp","btou","atobPolyfill","u24","r1","_atob","_toUint8Array","toUint8Array","_unURI","_decode","decode","isValid","_noEnum","extendString","_add","extendUint8Array","extendBuiltins","gBase64","nice_grpc_common_1","grpcMetadata","createBidiStreamingMethod_1","abort_controller_x_1","service_definitions_1","convertMetadata_1","channel","middleware","defaultOptions","grpcMethodDefinition","methodDescriptor","bidiStreamingMethod","onHeader","onTrailer","pipeAbortController","trailers","pipeError","pipeRequest","createClientStreamingMethod_1","clientStreamingMethod","createServerStreamingMethod_1","serverStreamingMethod","createUnaryMethod_1","unaryMethod","defaultCallOptions","newMiddleware","methodEntries","methodDefinition","createChannel","foundry","chains.foundry","mudFoundry","latticeTestnet","chainIndex","world","worldAddress","initialBlockNumber","getBurnerPrivateKey","createWorld","utils.Interface","mudConfig","resolveTableId","networkConfig","clientOptions","transportObserver","burnerAccount","createBurnerAccount","burnerWalletClient","write$","createContract","write","latestBlock$","blockStorageOperations$","syncToRecs","faucet","requestDrip","encodeEntity","network","systemCalls","update","nextValue","entity","getComponentValueStrict","runQuery","Has","Not","assetKind","mountDevTools","height","mapArray","terrain","hexToArray","terrainArray"],"mappings":"uiDAIgB,SAAA,uBAAuB,CAAE,WAAAA,GAAkC,CAClE,MAAA,CACL,GAAGA,CAAA,CAGP,CCoEA,SAAS,IAAIC,EAAO,CAClB,QAASC,EAAO,UAAU,OAAQC,EAAO,IAAI,MAAMD,EAAO,EAAIA,EAAO,EAAI,CAAC,EAAGE,GAAO,EAAGA,GAAOF,EAAME,KAClGD,EAAKC,GAAO,CAAC,EAAI,UAAUA,EAAI,EAOjC,MAAM,IAAI,MAAM,OAAOH,GAAU,SAAW,6BAA+BA,GAASE,EAAK,OAAS,IAAMA,EAAK,IAAI,MAAM,EAAE,KAAK,GAAG,EAAI,IAAM,iGAAmG,UAAYF,CAAK,CACjQ,CAEA,IAAI,WAAa,CAAA,EACjB,SAAS,WAAY,CACnB,OAAI,OAAO,WAAe,IACjB,WAEL,OAAO,OAAW,IACb,OAEL,OAAO,OAAW,IACb,OAEL,OAAO,KAAS,IACX,KAEF,UACT,CAGA,IAAI,OAAS,OAAO,OAChB,cAAgB,OAAO,yBACvBI,iBAAiB,OAAO,eACxB,gBAAkB,OAAO,UACzB,YAAc,CAAA,EAClB,OAAO,OAAO,WAAW,EACzB,IAAI,aAAe,CAAA,EACnB,OAAO,OAAO,YAAY,EAC1B,IAAI,SAAW,OAAO,MAAU,IAC5B,kBAAiC,OAAO,WAC5C,SAAS,eAAgB,CAClB,UACH,IAA0K,qBAAqB,CAEnM,CAYA,SAAS,KAAKC,EAAM,CAClB,IAAIC,EAAU,GACd,OAAO,UAAY,CACjB,GAAI,CAAAA,EAGJ,OAAAA,EAAU,GACHD,EAAK,MAAM,KAAM,SAAS,CACrC,CACA,CACA,IAAIE,OAAO,UAAgB,G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MAAM,MAAQE,GAAY,ECM3B,KAAO,CACX,CACE,OAAQ,CACN,CACE,aAAc,SACd,KAAM,WACN,KAAM,QACR,EACA,CACE,aAAc,UACd,KAAM,SACN,KAAM,SACR,CACF,EACA,KAAM,eACN,KAAM,OACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,SACd,KAAM,mBACN,KAAM,QACR,CACF,EACA,KAAM,yBACN,KAAM,OACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,SACd,KAAM,mBACN,KAAM,QACR,CACF,EACA,KAAM,2BACN,KAAM,OACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,SACd,KAAM,WACN,KAAM,QACR,CACF,EACA,KAAM,kBACN,KAAM,OACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,SACd,KAAM,SACN,KAAM,QACR,CACF,EACA,KAAM,yBACN,KAAM,OACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,SACd,KAAM,WACN,KAAM,QACR,CACF,EACA,KAAM,iBACN,KAAM,OACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,SACd,KAAM,WACN,KAAM,QACR,CACF,EACA,KAAM,mBACN,KAAM,OACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,SACN,KAAM,SACR,EACA,CACE,aAAc,UACd,KAAM,WACN,KAAM,SACR,CACF,EACA,KAAM,8BACN,KAAM,OACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,WACN,KAAM,SACR,EACA,CACE,aAAc,UACd,KAAM,WACN,KAAM,SACR,CACF,EACA,KAAM,8BACN,KAAM,OACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,WACN,KAAM,SACR,EACA,CACE,aAAc,UACd,KAAM,WACN,KAAM,SACR,CACF,EACA,KAAM,oCACN,KAAM,OACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,WACN,KAAM,SACR,EACA,CACE,aAAc,UACd,KAAM,WACN,KAAM,SACR,CACF,EACA,KAAM,kCACN,KAAM,OACR,EACA,CACE,OAAQ,CAAC,EACT,KAAM,4BACN,KAAM,OACR,EACA,CACE,OAAQ,CAAC,EACT,KAAM,2BACN,KAAM,OACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,UACN,KAAM,SACR,EACA,CACE,aAAc,SACd,KAAM,gBACN,KAAM,QACR,CACF,EACA,KAAM,+BACN,KAAM,OACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,UACN,KAAM,SACR,EACA,CACE,aAAc,SACd,KAAM,gBACN,KAAM,QACR,CACF,EACA,KAAM,0BACN,KAAM,OACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,SACN,KAAM,SACR,CACF,EACA,KAAM,eACN,KAAM,OACR,EACA,CACE,UAAW,GACX,OAAQ,CAAC,EACT,KAAM,aACN,KAAM,OACR,EACA,CACE,UAAW,GACX,OAAQ,CACN,CACE,QAAS,GACT,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,QAAS,GACT,aAAc,YACd,KAAM,MACN,KAAM,WACR,CACF,EACA,KAAM,oBACN,KAAM,OACR,EACA,CACE,UAAW,GACX,OAAQ,CACN,CACE,QAAS,GACT,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,QAAS,GACT,aAAc,YACd,KAAM,MACN,KAAM,WACR,EACA,CACE,QAAS,GACT,aAAc,QACd,KAAM,OACN,KAAM,OACR,CACF,EACA,KAAM,uBACN,KAAM,OACR,EACA,CACE,UAAW,GACX,OAAQ,CACN,CACE,QAAS,GACT,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,QAAS,GACT,aAAc,YACd,KAAM,MACN,KAAM,WACR,EACA,CACE,QAAS,GACT,aAAc,QACd,KAAM,cACN,KAAM,OACR,EACA,CACE,QAAS,GACT,aAAc,QACd,KAAM,OACN,KAAM,OACR,CACF,EACA,KAAM,gBACN,KAAM,OACR,EACA,CACE,UAAW,GACX,OAAQ,CACN,CACE,QAAS,GACT,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,QAAS,GACT,aAAc,YACd,KAAM,MACN,KAAM,WACR,EACA,CACE,QAAS,GACT,aAAc,QACd,KAAM,OACN,KAAM,OACR,CACF,EACA,KAAM,iBACN,KAAM,OACR,EACA,CACE,OAAQ,CAAC,EACT,KAAM,cACN,QAAS,CACP,CACE,aAAc,OACd,KAAM,GACN,KAAM,MACR,CACF,EACA,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CAAC,EACT,KAAM,WACN,QAAS,CACP,CACE,aAAc,SACd,KAAM,GACN,KAAM,QACR,CACF,EACA,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,mBACN,KAAM,SACR,EACA,CACE,aAAc,QACd,KAAM,sBACN,KAAM,OACR,CACF,EACA,KAAM,OACN,QAAS,CACP,CACE,aAAc,QACd,KAAM,GACN,KAAM,OACR,CACF,EACA,gBAAiB,UACjB,KAAM,UACR,EACA,CACE,OAAQ,CAAC,EACT,KAAM,YACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,SACd,KAAM,MACN,KAAM,QACR,EACA,CACE,aAAc,UACd,KAAM,MACN,KAAM,SACR,CACF,EACA,KAAM,cACN,QAAS,CACP,CACE,aAAc,SACd,KAAM,GACN,KAAM,QACR,CACF,EACA,gBAAiB,OACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,aAAc,YACd,KAAM,MACN,KAAM,WACR,EACA,CACE,aAAc,SACd,KAAM,cACN,KAAM,SACR,CACF,EACA,KAAM,eACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,aAAc,YACd,KAAM,MACN,KAAM,WACR,EACA,CACE,aAAc,QACd,KAAM,OACN,KAAM,OACR,EACA,CACE,aAAc,SACd,KAAM,cACN,KAAM,SACR,CACF,EACA,KAAM,sBACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CAAC,EACT,KAAM,cACN,QAAS,CACP,CACE,aAAc,SACd,KAAM,GACN,KAAM,QACR,CACF,EACA,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CAAC,EACT,KAAM,aACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,aAAc,YACd,KAAM,MACN,KAAM,WACR,EACA,CACE,aAAc,QACd,KAAM,cACN,KAAM,OACR,EACA,CACE,aAAc,SACd,KAAM,cACN,KAAM,SACR,CACF,EACA,KAAM,WACN,QAAS,CACP,CACE,aAAc,QACd,KAAM,OACN,KAAM,OACR,CACF,EACA,gBAAiB,OACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,aAAc,YACd,KAAM,MACN,KAAM,WACR,EACA,CACE,aAAc,QACd,KAAM,cACN,KAAM,OACR,EACA,CACE,aAAc,SACd,KAAM,cACN,KAAM,SACR,CACF,EACA,KAAM,iBACN,QAAS,CACP,CACE,aAAc,UACd,KAAM,GACN,KAAM,SACR,CACF,EACA,gBAAiB,OACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,aAAc,YACd,KAAM,MACN,KAAM,WACR,EACA,CACE,aAAc,QACd,KAAM,cACN,KAAM,OACR,EACA,CACE,aAAc,SACd,KAAM,cACN,KAAM,SACR,EACA,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,aAAc,UACd,KAAM,MACN,KAAM,SACR,CACF,EACA,KAAM,gBACN,QAAS,CACP,CACE,aAAc,QACd,KAAM,OACN,KAAM,OACR,CACF,EACA,gBAAiB,OACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,CACF,EACA,KAAM,eACN,QAAS,CACP,CACE,aAAc,SACd,KAAM,SACN,KAAM,SACR,CACF,EACA,gBAAiB,OACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,aAAc,YACd,KAAM,MACN,KAAM,WACR,EACA,CACE,aAAc,SACd,KAAM,cACN,KAAM,SACR,CACF,EACA,KAAM,YACN,QAAS,CACP,CACE,aAAc,QACd,KAAM,OACN,KAAM,OACR,CACF,EACA,gBAAiB,OACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,CACF,EACA,KAAM,iBACN,QAAS,CACP,CACE,aAAc,SACd,KAAM,SACN,KAAM,SACR,CACF,EACA,gBAAiB,OACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,mBACN,KAAM,SACR,EACA,CACE,aAAc,UACd,KAAM,UACN,KAAM,SACR,CACF,EACA,KAAM,cACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CAAC,EACT,KAAM,YACN,QAAS,CACP,CACE,aAAc,SACd,KAAM,GACN,KAAM,QACR,CACF,EACA,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,mBACd,KAAM,SACN,KAAM,SACR,EACA,CACE,aAAc,QACd,KAAM,OACN,KAAM,OACR,CACF,EACA,KAAM,gBACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,mBACd,KAAM,SACN,KAAM,SACR,EACA,CACE,aAAc,QACd,KAAM,OACN,KAAM,OACR,CACF,EACA,KAAM,oBACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CAAC,EACT,KAAM,WACN,QAAS,CACP,CACE,aAAc,SACd,KAAM,GACN,KAAM,QACR,CACF,EACA,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,UACN,KAAM,SACR,EACA,CACE,aAAc,UACd,KAAM,UACN,KAAM,SACR,CACF,EACA,KAAM,OACN,QAAS,CACP,CACE,aAAc,OACd,KAAM,GACN,KAAM,MACR,CACF,EACA,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CAAC,EACT,KAAM,MACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,QACd,KAAM,YACN,KAAM,OACR,CACF,EACA,KAAM,YACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CAAC,EACT,KAAM,WACN,QAAS,CACP,CACE,aAAc,SACd,KAAM,GACN,KAAM,QACR,CACF,EACA,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,QACd,KAAM,SACN,KAAM,OACR,CACF,EACA,KAAM,WACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,aAAc,YACd,KAAM,MACN,KAAM,WACR,EACA,CACE,aAAc,QACd,KAAM,cACN,KAAM,OACR,EACA,CACE,aAAc,UACd,KAAM,kBACN,KAAM,SACR,EACA,CACE,aAAc,SACd,KAAM,cACN,KAAM,SACR,CACF,EACA,KAAM,eACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,aAAc,YACd,KAAM,MACN,KAAM,WACR,EACA,CACE,aAAc,QACd,KAAM,cACN,KAAM,OACR,EACA,CACE,aAAc,QACd,KAAM,aACN,KAAM,OACR,EACA,CACE,aAAc,SACd,KAAM,cACN,KAAM,SACR,CACF,EACA,KAAM,cACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,mBACN,KAAM,SACR,EACA,CACE,aAAc,SACd,KAAM,qBACN,KAAM,QACR,EACA,CACE,aAAc,SACd,KAAM,0BACN,KAAM,QACR,CACF,EACA,KAAM,2BACN,QAAS,CACP,CACE,aAAc,SACd,KAAM,wBACN,KAAM,QACR,CACF,EACA,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,YACN,KAAM,SACR,CACF,EACA,KAAM,oBACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,mBACN,KAAM,SACR,EACA,CACE,aAAc,SACd,KAAM,wBACN,KAAM,QACR,EACA,CACE,aAAc,SACd,KAAM,yBACN,KAAM,QACR,CACF,EACA,KAAM,+BACN,QAAS,CACP,CACE,aAAc,SACd,KAAM,GACN,KAAM,QACR,CACF,EACA,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,aAAc,sBACd,KAAM,OACN,KAAM,SACR,CACF,EACA,KAAM,oBACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,mBACN,KAAM,SACR,EACA,CACE,aAAc,kBACd,KAAM,SACN,KAAM,SACR,EACA,CACE,aAAc,OACd,KAAM,eACN,KAAM,MACR,CACF,EACA,KAAM,iBACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,mBACN,KAAM,SACR,EACA,CACE,aAAc,uBACd,KAAM,OACN,KAAM,SACR,CACF,EACA,KAAM,qBACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,aAAc,SACd,KAAM,YACN,KAAM,SACR,EACA,CACE,aAAc,SACd,KAAM,cACN,KAAM,SACR,EACA,CACE,aAAc,WACd,KAAM,WACN,KAAM,UACR,EACA,CACE,aAAc,WACd,KAAM,aACN,KAAM,UACR,CACF,EACA,KAAM,gBACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CAAC,EACT,KAAM,cACN,QAAS,CACP,CACE,aAAc,OACd,KAAM,GACN,KAAM,MACR,CACF,EACA,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CAAC,EACT,KAAM,cACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,mBACN,KAAM,SACR,EACA,CACE,aAAc,UACd,KAAM,UACN,KAAM,SACR,CACF,EACA,KAAM,eACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,aAAc,YACd,KAAM,MACN,KAAM,WACR,EACA,CACE,aAAc,QACd,KAAM,cACN,KAAM,OACR,EACA,CACE,aAAc,QACd,KAAM,OACN,KAAM,OACR,EACA,CACE,aAAc,SACd,KAAM,cACN,KAAM,SACR,CACF,EACA,KAAM,WACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,aAAc,YACd,KAAM,MACN,KAAM,WACR,EACA,CACE,aAAc,QACd,KAAM,OACN,KAAM,OACR,EACA,CACE,aAAc,SACd,KAAM,cACN,KAAM,SACR,CACF,EACA,KAAM,YACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,eACN,KAAM,SACR,EACA,CACE,aAAc,QACd,KAAM,YACN,KAAM,OACR,EACA,CACE,aAAc,SACd,KAAM,QACN,KAAM,QACR,CACF,EACA,KAAM,QACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,aAAc,YACd,KAAM,MACN,KAAM,WACR,EACA,CACE,aAAc,QACd,KAAM,cACN,KAAM,OACR,EACA,CACE,aAAc,UACd,KAAM,iBACN,KAAM,SACR,EACA,CACE,aAAc,QACd,KAAM,YACN,KAAM,OACR,EACA,CACE,aAAc,SACd,KAAM,cACN,KAAM,SACR,CACF,EACA,KAAM,gBACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,CACF,EAEO,MAAM,eAAgB,CAE3B,OAAO,iBAAmC,CACjC,OAAA,IAAIC,UAAgB,IAAI,CACjC,CACA,OAAO,QAAQ38C,EAAiBkG,EAA6C,CAC3E,OAAO,IAAI,SAASlG,EAAS,KAAMkG,CAAgB,CACrD,CACF,CARa,gBACK,IAAM,KChqCxB,MAAA,UAAe02C,EAAU,CACvB,MAAO,CAEP,EACA,QAAS,CACP,CACE,KAAM,qBACN,KAAM,GACN,KAAM,CAAC,CACT,EACA,CACE,KAAM,oBACN,KAAM,GACN,KAAM,CAACC,GAAe,QAAQ,CAAC,CACjC,EACA,CACE,KAAM,sBACN,KAAM,GACN,KAAM,CAACA,GAAe,QAAQ,CAAC,CACjC,EACA,CACE,KAAM,oBACN,KAAM,GACN,KAAM,CAACA,GAAe,SAAS,CAAC,CAClC,EACA,CACE,KAAM,sBACN,KAAM,GACN,KAAM,CAACA,GAAe,SAAS,CAAC,CAClC,CACF,EACA,OAAQ,CACN,QAAS,CACP,UAAW,CAAC,EACZ,OAAQ,QACV,EACA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a,SAASnyD,EAAOoyD,EAAQC,EAAS,CACpD,MAAAC,GAAU,MAAM,KAAKC,IAAWF,CAAQ,CAAC,EAAE,IAAI,CAACh2E,GAAckO,KACzDlO,EACV,EAEKm2E,GAAe,CAAA,EACZ,QAAA70E,GAAI,EAAGA,GAAI20E,GAAQ,OAAQ30E,IAAK,OAAOqiB,CAAK,EAAG,CACpD,MAAMy2C,GAAM6b,GAAQ,MAAM30E,GAAGA,GAAI,OAAOqiB,CAAK,CAAC,EAC9CwyD,GAAa,KAAK/b,EAAG,EAGlB,OAAA+b,EACX","x_google_ignoreList":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443]} \ No newline at end of file +{"version":3,"file":"index-58a95187.js","sources":["../../src/mud/createClientComponents.ts","../../../../node_modules/.pnpm/mobx@6.10.0/node_modules/mobx/dist/mobx.esm.js","../../../../node_modules/.pnpm/tslib@2.6.2/node_modules/tslib/tslib.es6.mjs","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/util/isFunction.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/Subscription.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/config.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/util/noop.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/util/errorContext.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/Subscriber.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/symbol/observable.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/util/identity.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/util/pipe.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/Observable.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/util/lift.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/util/ObjectUnsubscribedError.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/Subject.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/scheduler/dateTimestampProvider.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/ReplaySubject.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/observable/empty.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/util/isScheduler.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/util/args.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/util/isArrayLike.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/util/isPromise.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/util/isInteropObservable.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/util/isAsyncIterable.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/util/throwUnobservableError.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/symbol/iterator.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/util/isIterable.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/util/isReadableStreamLike.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/observable/innerFrom.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/util/executeSchedule.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/operators/observeOn.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/operators/subscribeOn.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/scheduled/scheduleObservable.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/scheduled/schedulePromise.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/scheduled/scheduleArray.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/scheduled/scheduleIterable.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/scheduled/scheduleAsyncIterable.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/scheduled/scheduleReadableStreamLike.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/scheduled/scheduled.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/observable/from.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/observable/of.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/util/EmptyError.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/firstValueFrom.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/operators/map.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/util/mapOneOrManyArgs.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/util/argsArgArrayOrObject.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/util/createObject.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/observable/combineLatest.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/operators/mergeInternals.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/operators/mergeMap.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/operators/mergeAll.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/operators/concatAll.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/observable/concat.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/observable/defer.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/observable/merge.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/operators/filter.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/operators/catchError.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/operators/concatMap.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/operators/take.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/operators/share.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/operators/shareReplay.js","../../../../node_modules/.pnpm/rxjs@7.5.5/node_modules/rxjs/dist/esm5/internal/operators/tap.js","../../__vite-browser-external","../../../../node_modules/.pnpm/bn.js@5.2.1/node_modules/bn.js/lib/bn.js","../../../../node_modules/.pnpm/@ethersproject+logger@5.7.0/node_modules/@ethersproject/logger/lib.esm/_version.js","../../../../node_modules/.pnpm/@ethersproject+logger@5.7.0/node_modules/@ethersproject/logger/lib.esm/index.js","../../../../node_modules/.pnpm/@ethersproject+bytes@5.7.0/node_modules/@ethersproject/bytes/lib.esm/_version.js","../../../../node_modules/.pnpm/@ethersproject+bytes@5.7.0/node_modules/@ethersproject/bytes/lib.esm/index.js","../../../../node_modules/.pnpm/@ethersproject+bignumber@5.7.0/node_modules/@ethersproject/bignumber/lib.esm/_version.js","../../../../node_modules/.pnpm/@ethersproject+bignumber@5.7.0/node_modules/@ethersproject/bignumber/lib.esm/bignumber.js","../../../../node_modules/.pnpm/@ethersproject+properties@5.7.0/node_modules/@ethersproject/properties/lib.esm/_version.js","../../../../node_modules/.pnpm/@ethersproject+properties@5.7.0/node_modules/@ethersproject/properties/lib.esm/index.js","../../../../node_modules/.pnpm/@ethersproject+abi@5.7.0/node_modules/@ethersproject/abi/lib.esm/_version.js","../../../../node_modules/.pnpm/@ethersproject+abi@5.7.0/node_modules/@ethersproject/abi/lib.esm/fragments.js","../../../../node_modules/.pnpm/@ethersproject+abi@5.7.0/node_modules/@ethersproject/abi/lib.esm/coders/abstract-coder.js","../../../../node_modules/.pnpm/js-sha3@0.8.0/node_modules/js-sha3/src/sha3.js","../../../../node_modules/.pnpm/@ethersproject+keccak256@5.7.0/node_modules/@ethersproject/keccak256/lib.esm/index.js","../../../../node_modules/.pnpm/@ethersproject+rlp@5.7.0/node_modules/@ethersproject/rlp/lib.esm/_version.js","../../../../node_modules/.pnpm/@ethersproject+rlp@5.7.0/node_modules/@ethersproject/rlp/lib.esm/index.js","../../../../node_modules/.pnpm/@ethersproject+address@5.7.0/node_modules/@ethersproject/address/lib.esm/_version.js","../../../../node_modules/.pnpm/@ethersproject+address@5.7.0/node_modules/@ethersproject/address/lib.esm/index.js","../../../../node_modules/.pnpm/@ethersproject+abi@5.7.0/node_modules/@ethersproject/abi/lib.esm/coders/address.js","../../../../node_modules/.pnpm/@ethersproject+abi@5.7.0/node_modules/@ethersproject/abi/lib.esm/coders/anonymous.js","../../../../node_modules/.pnpm/@ethersproject+abi@5.7.0/node_modules/@ethersproject/abi/lib.esm/coders/array.js","../../../../node_modules/.pnpm/@ethersproject+abi@5.7.0/node_modules/@ethersproject/abi/lib.esm/coders/boolean.js","../../../../node_modules/.pnpm/@ethersproject+abi@5.7.0/node_modules/@ethersproject/abi/lib.esm/coders/bytes.js","../../../../node_modules/.pnpm/@ethersproject+abi@5.7.0/node_modules/@ethersproject/abi/lib.esm/coders/fixed-bytes.js","../../../../node_modules/.pnpm/@ethersproject+abi@5.7.0/node_modules/@ethersproject/abi/lib.esm/coders/null.js","../../../../node_modules/.pnpm/@ethersproject+constants@5.7.0/node_modules/@ethersproject/constants/lib.esm/bignumbers.js","../../../../node_modules/.pnpm/@ethersproject+abi@5.7.0/node_modules/@ethersproject/abi/lib.esm/coders/number.js","../../../../node_modules/.pnpm/@ethersproject+strings@5.7.0/node_modules/@ethersproject/strings/lib.esm/_version.js","../../../../node_modules/.pnpm/@ethersproject+strings@5.7.0/node_modules/@ethersproject/strings/lib.esm/utf8.js","../../../../node_modules/.pnpm/@ethersproject+abi@5.7.0/node_modules/@ethersproject/abi/lib.esm/coders/string.js","../../../../node_modules/.pnpm/@ethersproject+abi@5.7.0/node_modules/@ethersproject/abi/lib.esm/coders/tuple.js","../../../../node_modules/.pnpm/@ethersproject+abi@5.7.0/node_modules/@ethersproject/abi/lib.esm/abi-coder.js","../../../../node_modules/.pnpm/@ethersproject+hash@5.7.0/node_modules/@ethersproject/hash/lib.esm/id.js","../../../../node_modules/.pnpm/@ethersproject+abi@5.7.0/node_modules/@ethersproject/abi/lib.esm/interface.js","../../../../node_modules/.pnpm/@ethersproject+abstract-provider@5.7.0/node_modules/@ethersproject/abstract-provider/lib.esm/_version.js","../../../../node_modules/.pnpm/@ethersproject+abstract-provider@5.7.0/node_modules/@ethersproject/abstract-provider/lib.esm/index.js","../../../../node_modules/.pnpm/@ethersproject+abstract-signer@5.7.0/node_modules/@ethersproject/abstract-signer/lib.esm/_version.js","../../../../node_modules/.pnpm/@ethersproject+abstract-signer@5.7.0/node_modules/@ethersproject/abstract-signer/lib.esm/index.js","../../../../node_modules/.pnpm/@ethersproject+transactions@5.7.0/node_modules/@ethersproject/transactions/lib.esm/_version.js","../../../../node_modules/.pnpm/@ethersproject+transactions@5.7.0/node_modules/@ethersproject/transactions/lib.esm/index.js","../../../../node_modules/.pnpm/@ethersproject+contracts@5.7.0/node_modules/@ethersproject/contracts/lib.esm/_version.js","../../../../node_modules/.pnpm/@ethersproject+contracts@5.7.0/node_modules/@ethersproject/contracts/lib.esm/index.js","../../../../node_modules/.pnpm/@latticexyz+utils@2.0.0-next.3/node_modules/@latticexyz/utils/dist/index.js","../../../../node_modules/.pnpm/@latticexyz+recs@2.0.0-next.3_typescript@5.1.6_zod@3.22.2/node_modules/@latticexyz/recs/dist/index.js","../../../../node_modules/.pnpm/@latticexyz+schema-type@2.0.0-next.3_typescript@5.1.6_zod@3.22.2/node_modules/@latticexyz/schema-type/dist/typescript/index.js","../../../../node_modules/.pnpm/abitype@0.9.3_typescript@5.1.6_zod@3.22.2/node_modules/abitype/dist/esm/version.js","../../../../node_modules/.pnpm/abitype@0.9.3_typescript@5.1.6_zod@3.22.2/node_modules/abitype/dist/esm/errors.js","../../../../node_modules/.pnpm/abitype@0.9.3_typescript@5.1.6_zod@3.22.2/node_modules/abitype/dist/esm/regex.js","../../../../node_modules/.pnpm/abitype@0.9.3_typescript@5.1.6_zod@3.22.2/node_modules/abitype/dist/esm/human-readable/runtime/signatures.js","../../../../node_modules/.pnpm/abitype@0.9.3_typescript@5.1.6_zod@3.22.2/node_modules/abitype/dist/esm/human-readable/errors/abiItem.js","../../../../node_modules/.pnpm/abitype@0.9.3_typescript@5.1.6_zod@3.22.2/node_modules/abitype/dist/esm/human-readable/errors/abiParameter.js","../../../../node_modules/.pnpm/abitype@0.9.3_typescript@5.1.6_zod@3.22.2/node_modules/abitype/dist/esm/human-readable/errors/signature.js","../../../../node_modules/.pnpm/abitype@0.9.3_typescript@5.1.6_zod@3.22.2/node_modules/abitype/dist/esm/human-readable/errors/struct.js","../../../../node_modules/.pnpm/abitype@0.9.3_typescript@5.1.6_zod@3.22.2/node_modules/abitype/dist/esm/human-readable/errors/splitParameters.js","../../../../node_modules/.pnpm/abitype@0.9.3_typescript@5.1.6_zod@3.22.2/node_modules/abitype/dist/esm/human-readable/runtime/cache.js","../../../../node_modules/.pnpm/abitype@0.9.3_typescript@5.1.6_zod@3.22.2/node_modules/abitype/dist/esm/human-readable/runtime/utils.js","../../../../node_modules/.pnpm/abitype@0.9.3_typescript@5.1.6_zod@3.22.2/node_modules/abitype/dist/esm/human-readable/runtime/structs.js","../../../../node_modules/.pnpm/abitype@0.9.3_typescript@5.1.6_zod@3.22.2/node_modules/abitype/dist/esm/human-readable/parseAbi.js","../../../../node_modules/.pnpm/abitype@0.9.3_typescript@5.1.6_zod@3.22.2/node_modules/abitype/dist/esm/human-readable/parseAbiParameters.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/abi/formatAbiItem.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/data/isHex.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/data/size.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/errors/version.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/errors/utils.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/errors/base.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/errors/abi.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/errors/log.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/errors/data.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/data/pad.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/errors/encoding.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/data/trim.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/encoding/fromHex.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/encoding/toHex.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/encoding/toBytes.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/contract/extractFunctionParts.js","../../../../node_modules/.pnpm/@noble+hashes@1.3.0/node_modules/@noble/hashes/esm/_assert.js","../../../../node_modules/.pnpm/@noble+hashes@1.3.0/node_modules/@noble/hashes/esm/_u64.js","../../../../node_modules/.pnpm/@noble+hashes@1.3.0/node_modules/@noble/hashes/esm/utils.js","../../../../node_modules/.pnpm/@noble+hashes@1.3.0/node_modules/@noble/hashes/esm/sha3.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/hash/keccak256.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/hash/hashFunction.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/hash/getEventSelector.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/errors/address.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/address/isAddress.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/data/concat.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/data/slice.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/abi/encodeAbiParameters.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/abi/getAbiItem.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/abi/encodeEventTopics.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/filters/createFilterRequestScope.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/createContractEventFilter.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/accounts/utils/parseAccount.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/hash/getFunctionSelector.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/abi/encodeFunctionData.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/constants/solidity.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/address/getAddress.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/abi/decodeAbiParameters.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/abi/decodeErrorResult.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/stringify.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/abi/formatAbiItemWithArgs.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/constants/unit.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/unit/formatUnits.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/unit/formatEther.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/unit/formatGwei.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/errors/transaction.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/errors/contract.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/errors/getContractError.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/errors/account.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/errors/estimateGas.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/errors/node.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/errors/request.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/errors/rpc.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/errors/getNodeError.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/errors/getEstimateGasError.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/formatters/extract.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/formatters/transactionRequest.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/transaction/assertRequest.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/errors/block.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/formatters/transaction.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/formatters/block.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/getBlock.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/getGasPrice.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/getTransactionCount.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/transaction/prepareRequest.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/estimateGas.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/estimateContractGas.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/abi/decodeFunctionResult.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/constants/abis.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/constants/contract.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/errors/chain.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/chain.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/errors/getCallError.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/promise/createBatchScheduler.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/call.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/readContract.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/simulateContract.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/observe.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/wait.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/poll.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/promise/withCache.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/getBlockNumber.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/abi/decodeEventLog.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/formatters/log.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/getFilterChanges.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/getLogs.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/uninstallFilter.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/watchContractEvent.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/errors/getTransactionError.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/getChainId.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/wallet/sendTransaction.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/wallet/writeContract.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/getContract.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/wallet/addChain.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/accounts/utils/publicKeyToAddress.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/uid.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/clients/createClient.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/promise/withRetry.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/buildRequest.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/clients/transports/createTransport.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/clients/transports/fallback.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/errors/transport.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/promise/withTimeout.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/rpc.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/clients/transports/http.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/ens/errors.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/regex.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/typedData.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/abi/encodeDeployData.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/encoding/toRlp.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/formatters/transactionReceipt.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/signature/hashTypedData.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/signature/hashMessage.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/transaction/getTransactionType.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/transaction/assertTransaction.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/transaction/serializeAccessList.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/transaction/serializeTransaction.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/unit/parseUnits.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/unit/parseEther.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/ens/encodedLabelToLabelhash.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/ens/namehash.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/ens/encodeLabelhash.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/ens/labelhash.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/ens/packetToBytes.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/ens/getEnsAddress.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/errors/ens.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/ens/avatar/utils.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/ens/avatar/parseAvatarRecord.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/ens/getEnsText.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/ens/getEnsAvatar.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/ens/getEnsName.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/ens/getEnsResolver.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/createBlockFilter.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/createEventFilter.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/createPendingTransactionFilter.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/getBalance.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/getBlockTransactionCount.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/getBytecode.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/formatters/feeHistory.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/getFeeHistory.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/getFilterLogs.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/getStorageAt.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/getTransaction.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/getTransactionConfirmations.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/getTransactionReceipt.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/multicall.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/constants/contracts.js","../../../../node_modules/.pnpm/@noble+curves@1.1.0/node_modules/@noble/curves/esm/abstract/utils.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/data/isBytesEqual.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/verifyHash.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/verifyMessage.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/verifyTypedData.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/watchBlockNumber.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/waitForTransactionReceipt.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/watchBlocks.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/watchEvent.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/public/watchPendingTransactions.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/clients/decorators/public.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/clients/createPublicClient.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/wallet/deployContract.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/wallet/getAddresses.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/wallet/getPermissions.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/wallet/requestAddresses.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/wallet/requestPermissions.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/wallet/signMessage.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/wallet/signTypedData.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/wallet/switchChain.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/actions/wallet/watchAsset.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/clients/decorators/wallet.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/clients/createWalletClient.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/clients/transports/webSocket.js","../../../../node_modules/.pnpm/@noble+hashes@1.3.1/node_modules/@noble/hashes/esm/_assert.js","../../../../node_modules/.pnpm/@noble+hashes@1.3.1/node_modules/@noble/hashes/esm/crypto.js","../../../../node_modules/.pnpm/@noble+hashes@1.3.1/node_modules/@noble/hashes/esm/utils.js","../../../../node_modules/.pnpm/@noble+hashes@1.3.1/node_modules/@noble/hashes/esm/_sha2.js","../../../../node_modules/.pnpm/@noble+hashes@1.3.1/node_modules/@noble/hashes/esm/sha256.js","../../../../node_modules/.pnpm/@noble+curves@1.1.0/node_modules/@noble/curves/esm/abstract/modular.js","../../../../node_modules/.pnpm/@noble+curves@1.1.0/node_modules/@noble/curves/esm/abstract/curve.js","../../../../node_modules/.pnpm/@noble+curves@1.1.0/node_modules/@noble/curves/esm/abstract/weierstrass.js","../../../../node_modules/.pnpm/@noble+hashes@1.3.1/node_modules/@noble/hashes/esm/hmac.js","../../../../node_modules/.pnpm/@noble+curves@1.1.0/node_modules/@noble/curves/esm/_shortw_utils.js","../../../../node_modules/.pnpm/@noble+curves@1.1.0/node_modules/@noble/curves/esm/secp256k1.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/utils/signature/signatureToHex.js","../../../../node_modules/.pnpm/@latticexyz+common@2.0.0-next.3_typescript@5.1.6_zod@3.22.2/node_modules/@latticexyz/common/dist/utils.js","../../../../node_modules/.pnpm/@latticexyz+common@2.0.0-next.3_typescript@5.1.6_zod@3.22.2/node_modules/@latticexyz/common/dist/chunk-UPQEB2HW.js","../../../../node_modules/.pnpm/@latticexyz+protocol-parser@2.0.0-next.3_typescript@5.1.6_zod@3.22.2/node_modules/@latticexyz/protocol-parser/dist/index.js","../../../../node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js","../../../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/common.js","../../../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/browser.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/accounts/generatePrivateKey.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/accounts/toAccount.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/accounts/utils/sign.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/accounts/utils/signMessage.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/accounts/utils/signTransaction.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/accounts/utils/signTypedData.js","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/accounts/privateKeyToAccount.js","../../../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js","../../../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js","../../../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js","../../../../node_modules/.pnpm/p-retry@5.1.2/node_modules/p-retry/index.js","../../../../node_modules/.pnpm/@latticexyz+common@2.0.0-next.3_typescript@5.1.6_zod@3.22.2/node_modules/@latticexyz/common/dist/index.js","../../../../node_modules/.pnpm/@latticexyz+schema-type@2.0.0-next.3_typescript@5.1.6_zod@3.22.2/node_modules/@latticexyz/schema-type/dist/typescript/deprecated/index.js","../../../../node_modules/.pnpm/zod@3.22.2/node_modules/zod/lib/index.mjs","../../../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/ansi-styles/index.js","../../../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/supports-color/browser.js","../../../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/utilities.js","../../../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/index.js","../../../../node_modules/.pnpm/zod-validation-error@1.5.0_zod@3.22.2/node_modules/zod-validation-error/dist/esm/utils/joinPath.js","../../../../node_modules/.pnpm/zod-validation-error@1.5.0_zod@3.22.2/node_modules/zod-validation-error/dist/esm/utils/NonEmptyArray.js","../../../../node_modules/.pnpm/zod-validation-error@1.5.0_zod@3.22.2/node_modules/zod-validation-error/dist/esm/ValidationError.js","../../../../node_modules/.pnpm/@latticexyz+config@2.0.0-next.3_typescript@5.1.6/node_modules/@latticexyz/config/dist/chunk-AXXYPYMM.js","../../../../node_modules/.pnpm/@latticexyz+config@2.0.0-next.3_typescript@5.1.6/node_modules/@latticexyz/config/dist/chunk-4G6ZGMDP.js","../../../../node_modules/.pnpm/@latticexyz+store@2.0.0-next.3_typescript@5.1.6/node_modules/@latticexyz/store/dist/chunk-5AKM5HGJ.js","../../../../node_modules/.pnpm/@latticexyz+config@2.0.0-next.3_typescript@5.1.6/node_modules/@latticexyz/config/dist/register/index.js","../../../../node_modules/.pnpm/@latticexyz+store@2.0.0-next.3_typescript@5.1.6/node_modules/@latticexyz/store/dist/chunk-6QMWGFYG.js","../../../../node_modules/.pnpm/@latticexyz+store@2.0.0-next.3_typescript@5.1.6/node_modules/@latticexyz/store/dist/mud.config.js","../../../../node_modules/.pnpm/@latticexyz+store-sync@2.0.0-next.3_typescript@5.1.6/node_modules/@latticexyz/store-sync/dist/chunk-SNWOSPCV.js","../../../../node_modules/.pnpm/@trpc+server@10.34.0/node_modules/@trpc/server/dist/codes-24aa1ce1.mjs","../../../../node_modules/.pnpm/@trpc+server@10.34.0/node_modules/@trpc/server/dist/index-044a193b.mjs","../../../../node_modules/.pnpm/@trpc+server@10.34.0/node_modules/@trpc/server/dist/config-7eddc5bb.mjs","../../../../node_modules/.pnpm/superjson@1.13.1/node_modules/superjson/dist/esm/double-indexed-kv.js","../../../../node_modules/.pnpm/superjson@1.13.1/node_modules/superjson/dist/esm/registry.js","../../../../node_modules/.pnpm/superjson@1.13.1/node_modules/superjson/dist/esm/class-registry.js","../../../../node_modules/.pnpm/superjson@1.13.1/node_modules/superjson/dist/esm/util.js","../../../../node_modules/.pnpm/superjson@1.13.1/node_modules/superjson/dist/esm/custom-transformer-registry.js","../../../../node_modules/.pnpm/superjson@1.13.1/node_modules/superjson/dist/esm/is.js","../../../../node_modules/.pnpm/superjson@1.13.1/node_modules/superjson/dist/esm/pathstringifier.js","../../../../node_modules/.pnpm/superjson@1.13.1/node_modules/superjson/dist/esm/transformer.js","../../../../node_modules/.pnpm/superjson@1.13.1/node_modules/superjson/dist/esm/accessDeep.js","../../../../node_modules/.pnpm/superjson@1.13.1/node_modules/superjson/dist/esm/plainer.js","../../../../node_modules/.pnpm/is-what@4.1.15/node_modules/is-what/dist/index.js","../../../../node_modules/.pnpm/copy-anything@3.0.5/node_modules/copy-anything/dist/index.js","../../../../node_modules/.pnpm/superjson@1.13.1/node_modules/superjson/dist/esm/index.js","../../../../node_modules/.pnpm/@trpc+server@10.34.0/node_modules/@trpc/server/dist/observable-ade1bad8.mjs","../../../../node_modules/.pnpm/@trpc+server@10.34.0/node_modules/@trpc/server/dist/observable/index.mjs","../../../../node_modules/.pnpm/@trpc+client@10.34.0_@trpc+server@10.34.0/node_modules/@trpc/client/dist/splitLink-4c75f7be.mjs","../../../../node_modules/.pnpm/@trpc+client@10.34.0_@trpc+server@10.34.0/node_modules/@trpc/client/dist/TRPCClientError-fef6cf44.mjs","../../../../node_modules/.pnpm/@trpc+client@10.34.0_@trpc+server@10.34.0/node_modules/@trpc/client/dist/httpUtils-1efcb902.mjs","../../../../node_modules/.pnpm/@trpc+client@10.34.0_@trpc+server@10.34.0/node_modules/@trpc/client/dist/transformResult-7ab522e6.mjs","../../../../node_modules/.pnpm/@trpc+client@10.34.0_@trpc+server@10.34.0/node_modules/@trpc/client/dist/httpBatchLink-fbd7b43c.mjs","../../../../node_modules/.pnpm/@trpc+client@10.34.0_@trpc+server@10.34.0/node_modules/@trpc/client/dist/index.mjs","../../../../node_modules/.pnpm/@latticexyz+store-sync@2.0.0-next.3_typescript@5.1.6/node_modules/@latticexyz/store-sync/dist/chunk-A2BQSIM3.js","../../../../node_modules/.pnpm/@latticexyz+store@2.0.0-next.3_typescript@5.1.6/node_modules/@latticexyz/store/dist/ts/index.js","../../../../node_modules/.pnpm/@latticexyz+block-logs-stream@2.0.0-next.3_typescript@5.1.6_zod@3.22.2/node_modules/@latticexyz/block-logs-stream/dist/index.js","../../../../node_modules/.pnpm/@latticexyz+store-sync@2.0.0-next.3_typescript@5.1.6/node_modules/@latticexyz/store-sync/dist/chunk-IH5UMM4B.js","../../../../node_modules/.pnpm/@latticexyz+world@2.0.0-next.3_typescript@5.1.6/node_modules/@latticexyz/world/dist/chunk-JOQBBVRS.js","../../../../node_modules/.pnpm/@latticexyz+world@2.0.0-next.3_typescript@5.1.6/node_modules/@latticexyz/world/dist/chunk-24XAL2ND.js","../../../../node_modules/.pnpm/@latticexyz+world@2.0.0-next.3_typescript@5.1.6/node_modules/@latticexyz/world/dist/mud.config.js","../../../../node_modules/.pnpm/@latticexyz+store-sync@2.0.0-next.3_typescript@5.1.6/node_modules/@latticexyz/store-sync/dist/recs/index.js","../../src/mud/createSystemCalls.ts","../../../../node_modules/.pnpm/long@5.2.3/node_modules/long/index.js","../../../../node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/index.js","../../../../node_modules/.pnpm/@protobufjs+base64@1.1.2/node_modules/@protobufjs/base64/index.js","../../../../node_modules/.pnpm/@protobufjs+eventemitter@1.1.0/node_modules/@protobufjs/eventemitter/index.js","../../../../node_modules/.pnpm/@protobufjs+float@1.0.2/node_modules/@protobufjs/float/index.js","../../../../node_modules/.pnpm/@protobufjs+inquire@1.1.0/node_modules/@protobufjs/inquire/index.js","../../../../node_modules/.pnpm/@protobufjs+utf8@1.1.0/node_modules/@protobufjs/utf8/index.js","../../../../node_modules/.pnpm/@protobufjs+pool@1.1.0/node_modules/@protobufjs/pool/index.js","../../../../node_modules/.pnpm/protobufjs@7.2.5/node_modules/protobufjs/src/util/longbits.js","../../../../node_modules/.pnpm/protobufjs@7.2.5/node_modules/protobufjs/src/util/minimal.js","../../../../node_modules/.pnpm/protobufjs@7.2.5/node_modules/protobufjs/src/writer.js","../../../../node_modules/.pnpm/protobufjs@7.2.5/node_modules/protobufjs/src/writer_buffer.js","../../../../node_modules/.pnpm/protobufjs@7.2.5/node_modules/protobufjs/src/reader.js","../../../../node_modules/.pnpm/protobufjs@7.2.5/node_modules/protobufjs/src/reader_buffer.js","../../../../node_modules/.pnpm/protobufjs@7.2.5/node_modules/protobufjs/src/rpc/service.js","../../../../node_modules/.pnpm/protobufjs@7.2.5/node_modules/protobufjs/src/rpc.js","../../../../node_modules/.pnpm/protobufjs@7.2.5/node_modules/protobufjs/src/roots.js","../../../../node_modules/.pnpm/protobufjs@7.2.5/node_modules/protobufjs/src/index-minimal.js","../../../../node_modules/.pnpm/protobufjs@7.2.5/node_modules/protobufjs/minimal.js","../../../../node_modules/.pnpm/nice-grpc-common@2.0.2/node_modules/nice-grpc-common/lib/Metadata.js","../../../../node_modules/.pnpm/nice-grpc-common@2.0.2/node_modules/nice-grpc-common/lib/Status.js","../../../../node_modules/.pnpm/nice-grpc-common@2.0.2/node_modules/nice-grpc-common/lib/MethodDescriptor.js","../../../../node_modules/.pnpm/nice-grpc-common@2.0.2/node_modules/nice-grpc-common/lib/client/CallOptions.js","../../../../node_modules/.pnpm/nice-grpc-common@2.0.2/node_modules/nice-grpc-common/lib/client/ClientMiddleware.js","../../../../node_modules/.pnpm/nice-grpc-common@2.0.2/node_modules/nice-grpc-common/lib/client/composeClientMiddleware.js","../../../../node_modules/.pnpm/ts-error@1.0.6/node_modules/ts-error/lib/helpers.js","../../../../node_modules/.pnpm/ts-error@1.0.6/node_modules/ts-error/lib/cjs.js","../../../../node_modules/.pnpm/nice-grpc-common@2.0.2/node_modules/nice-grpc-common/lib/client/ClientError.js","../../../../node_modules/.pnpm/nice-grpc-common@2.0.2/node_modules/nice-grpc-common/lib/server/CallContext.js","../../../../node_modules/.pnpm/nice-grpc-common@2.0.2/node_modules/nice-grpc-common/lib/server/ServerMiddleware.js","../../../../node_modules/.pnpm/nice-grpc-common@2.0.2/node_modules/nice-grpc-common/lib/server/composeServerMiddleware.js","../../../../node_modules/.pnpm/nice-grpc-common@2.0.2/node_modules/nice-grpc-common/lib/server/ServerError.js","../../../../node_modules/.pnpm/nice-grpc-common@2.0.2/node_modules/nice-grpc-common/lib/index.js","../../../../node_modules/.pnpm/nice-grpc-web@2.0.2_google-protobuf@3.21.2/node_modules/nice-grpc-web/lib/service-definitions/grpc-web.js","../../../../node_modules/.pnpm/nice-grpc-web@2.0.2_google-protobuf@3.21.2/node_modules/nice-grpc-web/lib/service-definitions/ts-proto.js","../../../../node_modules/.pnpm/nice-grpc-web@2.0.2_google-protobuf@3.21.2/node_modules/nice-grpc-web/lib/service-definitions/index.js","../../../../node_modules/.pnpm/nice-grpc-web@2.0.2_google-protobuf@3.21.2/node_modules/nice-grpc-web/lib/client/channel.js","../../../../node_modules/.pnpm/@improbable-eng+grpc-web@0.15.0_google-protobuf@3.21.2/node_modules/@improbable-eng/grpc-web/dist/grpc-web-client.umd.js","../../../../node_modules/.pnpm/abort-controller-x@0.4.3/node_modules/abort-controller-x/es/AbortError.js","../../../../node_modules/.pnpm/abort-controller-x@0.4.3/node_modules/abort-controller-x/es/execute.js","../../../../node_modules/.pnpm/abort-controller-x@0.4.3/node_modules/abort-controller-x/es/abortable.js","../../../../node_modules/.pnpm/abort-controller-x@0.4.3/node_modules/abort-controller-x/es/delay.js","../../../../node_modules/.pnpm/abort-controller-x@0.4.3/node_modules/abort-controller-x/es/forever.js","../../../../node_modules/.pnpm/abort-controller-x@0.4.3/node_modules/abort-controller-x/es/waitForEvent.js","../../../../node_modules/.pnpm/abort-controller-x@0.4.3/node_modules/abort-controller-x/es/all.js","../../../../node_modules/.pnpm/abort-controller-x@0.4.3/node_modules/abort-controller-x/es/race.js","../../../../node_modules/.pnpm/abort-controller-x@0.4.3/node_modules/abort-controller-x/es/retry.js","../../../../node_modules/.pnpm/abort-controller-x@0.4.3/node_modules/abort-controller-x/es/spawn.js","../../../../node_modules/.pnpm/abort-controller-x@0.4.3/node_modules/abort-controller-x/es/run.js","../../../../node_modules/.pnpm/abort-controller-x@0.4.3/node_modules/abort-controller-x/es/proactiveRetry.js","../../../../node_modules/.pnpm/nice-grpc-web@2.0.2_google-protobuf@3.21.2/node_modules/nice-grpc-web/lib/utils/AsyncSink.js","../../../../node_modules/.pnpm/nice-grpc-web@2.0.2_google-protobuf@3.21.2/node_modules/nice-grpc-web/lib/utils/isAsyncIterable.js","../../../../node_modules/.pnpm/js-base64@3.7.5/node_modules/js-base64/base64.js","../../../../node_modules/.pnpm/nice-grpc-web@2.0.2_google-protobuf@3.21.2/node_modules/nice-grpc-web/lib/utils/convertMetadata.js","../../../../node_modules/.pnpm/nice-grpc-web@2.0.2_google-protobuf@3.21.2/node_modules/nice-grpc-web/lib/client/createBidiStreamingMethod.js","../../../../node_modules/.pnpm/nice-grpc-web@2.0.2_google-protobuf@3.21.2/node_modules/nice-grpc-web/lib/client/createClientStreamingMethod.js","../../../../node_modules/.pnpm/nice-grpc-web@2.0.2_google-protobuf@3.21.2/node_modules/nice-grpc-web/lib/client/createServerStreamingMethod.js","../../../../node_modules/.pnpm/nice-grpc-web@2.0.2_google-protobuf@3.21.2/node_modules/nice-grpc-web/lib/client/createUnaryMethod.js","../../../../node_modules/.pnpm/nice-grpc-web@2.0.2_google-protobuf@3.21.2/node_modules/nice-grpc-web/lib/client/ClientFactory.js","../../../../node_modules/.pnpm/nice-grpc-web@2.0.2_google-protobuf@3.21.2/node_modules/nice-grpc-web/lib/client/Client.js","../../../../node_modules/.pnpm/nice-grpc-web@2.0.2_google-protobuf@3.21.2/node_modules/nice-grpc-web/lib/index.js","../../../../node_modules/.pnpm/@latticexyz+services@2.0.0-next.3_google-protobuf@3.21.2/node_modules/@latticexyz/services/dist/faucet.js","../../../../node_modules/.pnpm/@wagmi+chains@1.6.0_typescript@5.1.6/node_modules/@wagmi/chains/dist/index.mjs","../../../../node_modules/.pnpm/viem@1.6.0_typescript@5.1.6_zod@3.22.2/node_modules/viem/dist/esm/chains/index.js","../../../../node_modules/.pnpm/@latticexyz+common@2.0.0-next.3_typescript@5.1.6_zod@3.22.2/node_modules/@latticexyz/common/dist/chains.js","../../src/mud/supportedChains.ts","../../src/mud/getNetworkConfig.ts","../../src/mud/world.ts","../../../contracts/types/ethers-contracts/factories/IWorld__factory.ts","../../../contracts/mud.config.ts","../../src/mud/setupNetwork.ts","../../src/mud/setup.ts","../../src/index.ts","../../src/mud_bridge.ts"],"sourcesContent":["import { SetupNetworkResult } from \"./setupNetwork\";\n\nexport type ClientComponents = ReturnType;\n\nexport function createClientComponents({ components }: SetupNetworkResult) {\n return {\n ...components,\n // add your client components or overrides here\n };\n}\n","var niceErrors = {\n 0: \"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'\",\n 1: function _(annotationType, key) {\n return \"Cannot apply '\" + annotationType + \"' to '\" + key.toString() + \"': Field not found.\";\n },\n /*\r\n 2(prop) {\r\n return `invalid decorator for '${prop.toString()}'`\r\n },\r\n 3(prop) {\r\n return `Cannot decorate '${prop.toString()}': action can only be used on properties with a function value.`\r\n },\r\n 4(prop) {\r\n return `Cannot decorate '${prop.toString()}': computed can only be used on getter properties.`\r\n },\r\n */\n 5: \"'keys()' can only be used on observable objects, arrays, sets and maps\",\n 6: \"'values()' can only be used on observable objects, arrays, sets and maps\",\n 7: \"'entries()' can only be used on observable objects, arrays and maps\",\n 8: \"'set()' can only be used on observable objects, arrays and maps\",\n 9: \"'remove()' can only be used on observable objects, arrays and maps\",\n 10: \"'has()' can only be used on observable objects, arrays and maps\",\n 11: \"'get()' can only be used on observable objects, arrays and maps\",\n 12: \"Invalid annotation\",\n 13: \"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 14: \"Intercept handlers should return nothing or a change object\",\n 15: \"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 16: \"Modification exception: the internal structure of an observable array was changed.\",\n 17: function _(index, length) {\n return \"[mobx.array] Index out of bounds, \" + index + \" is larger than \" + length;\n },\n 18: \"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js\",\n 19: function _(other) {\n return \"Cannot initialize from classes that inherit from Map: \" + other.constructor.name;\n },\n 20: function _(other) {\n return \"Cannot initialize map from \" + other;\n },\n 21: function _(dataStructure) {\n return \"Cannot convert to map from '\" + dataStructure + \"'\";\n },\n 22: \"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js\",\n 23: \"It is not possible to get index atoms from arrays\",\n 24: function _(thing) {\n return \"Cannot obtain administration from \" + thing;\n },\n 25: function _(property, name) {\n return \"the entry '\" + property + \"' does not exist in the observable map '\" + name + \"'\";\n },\n 26: \"please specify a property\",\n 27: function _(property, name) {\n return \"no observable property '\" + property.toString() + \"' found on the observable object '\" + name + \"'\";\n },\n 28: function _(thing) {\n return \"Cannot obtain atom from \" + thing;\n },\n 29: \"Expecting some object\",\n 30: \"invalid action stack. did you forget to finish an action?\",\n 31: \"missing option for computed: get\",\n 32: function _(name, derivation) {\n return \"Cycle detected in computation \" + name + \": \" + derivation;\n },\n 33: function _(name) {\n return \"The setter of computed value '\" + name + \"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?\";\n },\n 34: function _(name) {\n return \"[ComputedValue '\" + name + \"'] It is not possible to assign a new value to a computed value.\";\n },\n 35: \"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`\",\n 36: \"isolateGlobalState should be called before MobX is running any reactions\",\n 37: function _(method) {\n return \"[mobx] `observableArray.\" + method + \"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice().\" + method + \"()` instead\";\n },\n 38: \"'ownKeys()' can only be used on observable objects\",\n 39: \"'defineProperty()' can only be used on observable objects\"\n};\nvar errors = process.env.NODE_ENV !== \"production\" ? niceErrors : {};\nfunction die(error) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n if (process.env.NODE_ENV !== \"production\") {\n var e = typeof error === \"string\" ? error : errors[error];\n if (typeof e === \"function\") e = e.apply(null, args);\n throw new Error(\"[MobX] \" + e);\n }\n throw new Error(typeof error === \"number\" ? \"[MobX] minified error nr: \" + error + (args.length ? \" \" + args.map(String).join(\",\") : \"\") + \". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts\" : \"[MobX] \" + error);\n}\n\nvar mockGlobal = {};\nfunction getGlobal() {\n if (typeof globalThis !== \"undefined\") {\n return globalThis;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n if (typeof self !== \"undefined\") {\n return self;\n }\n return mockGlobal;\n}\n\n// We shorten anything used > 5 times\nvar assign = Object.assign;\nvar getDescriptor = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar objectPrototype = Object.prototype;\nvar EMPTY_ARRAY = [];\nObject.freeze(EMPTY_ARRAY);\nvar EMPTY_OBJECT = {};\nObject.freeze(EMPTY_OBJECT);\nvar hasProxy = typeof Proxy !== \"undefined\";\nvar plainObjectString = /*#__PURE__*/Object.toString();\nfunction assertProxies() {\n if (!hasProxy) {\n die(process.env.NODE_ENV !== \"production\" ? \"`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`\" : \"Proxy not available\");\n }\n}\nfunction warnAboutProxyRequirement(msg) {\n if (process.env.NODE_ENV !== \"production\" && globalState.verifyProxies) {\n die(\"MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to \" + msg);\n }\n}\nfunction getNextId() {\n return ++globalState.mobxGuid;\n}\n/**\r\n * Makes sure that the provided function is invoked at most once.\r\n */\nfunction once(func) {\n var invoked = false;\n return function () {\n if (invoked) {\n return;\n }\n invoked = true;\n return func.apply(this, arguments);\n };\n}\nvar noop = function noop() {};\nfunction isFunction(fn) {\n return typeof fn === \"function\";\n}\nfunction isStringish(value) {\n var t = typeof value;\n switch (t) {\n case \"string\":\n case \"symbol\":\n case \"number\":\n return true;\n }\n return false;\n}\nfunction isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nfunction isPlainObject(value) {\n if (!isObject(value)) {\n return false;\n }\n var proto = Object.getPrototypeOf(value);\n if (proto == null) {\n return true;\n }\n var protoConstructor = Object.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n return typeof protoConstructor === \"function\" && protoConstructor.toString() === plainObjectString;\n}\n// https://stackoverflow.com/a/37865170\nfunction isGenerator(obj) {\n var constructor = obj == null ? void 0 : obj.constructor;\n if (!constructor) {\n return false;\n }\n if (\"GeneratorFunction\" === constructor.name || \"GeneratorFunction\" === constructor.displayName) {\n return true;\n }\n return false;\n}\nfunction addHiddenProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: true,\n configurable: true,\n value: value\n });\n}\nfunction addHiddenFinalProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: false,\n configurable: true,\n value: value\n });\n}\nfunction createInstanceofPredicate(name, theClass) {\n var propName = \"isMobX\" + name;\n theClass.prototype[propName] = true;\n return function (x) {\n return isObject(x) && x[propName] === true;\n };\n}\nfunction isES6Map(thing) {\n return thing instanceof Map;\n}\nfunction isES6Set(thing) {\n return thing instanceof Set;\n}\nvar hasGetOwnPropertySymbols = typeof Object.getOwnPropertySymbols !== \"undefined\";\n/**\r\n * Returns the following: own enumerable keys and symbols.\r\n */\nfunction getPlainObjectKeys(object) {\n var keys = Object.keys(object);\n // Not supported in IE, so there are not going to be symbol props anyway...\n if (!hasGetOwnPropertySymbols) {\n return keys;\n }\n var symbols = Object.getOwnPropertySymbols(object);\n if (!symbols.length) {\n return keys;\n }\n return [].concat(keys, symbols.filter(function (s) {\n return objectPrototype.propertyIsEnumerable.call(object, s);\n }));\n}\n// From Immer utils\n// Returns all own keys, including non-enumerable and symbolic\nvar ownKeys = typeof Reflect !== \"undefined\" && Reflect.ownKeys ? Reflect.ownKeys : hasGetOwnPropertySymbols ? function (obj) {\n return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));\n} : /* istanbul ignore next */Object.getOwnPropertyNames;\nfunction stringifyKey(key) {\n if (typeof key === \"string\") {\n return key;\n }\n if (typeof key === \"symbol\") {\n return key.toString();\n }\n return new String(key).toString();\n}\nfunction toPrimitive(value) {\n return value === null ? null : typeof value === \"object\" ? \"\" + value : value;\n}\nfunction hasProp(target, prop) {\n return objectPrototype.hasOwnProperty.call(target, prop);\n}\n// From Immer utils\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(target) {\n // Polyfill needed for Hermes and IE, see https://github.com/facebook/hermes/issues/274\n var res = {};\n // Note: without polyfill for ownKeys, symbols won't be picked up\n ownKeys(target).forEach(function (key) {\n res[key] = getDescriptor(target, key);\n });\n return res;\n};\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n _setPrototypeOf(subClass, superClass);\n}\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n if (it) return (it = it.call(o)).next.bind(it);\n if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n return function () {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n };\n }\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction _toPrimitive(input, hint) {\n if (typeof input !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (typeof res !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nfunction _toPropertyKey(arg) {\n var key = _toPrimitive(arg, \"string\");\n return typeof key === \"symbol\" ? key : String(key);\n}\n\nvar storedAnnotationsSymbol = /*#__PURE__*/Symbol(\"mobx-stored-annotations\");\n/**\r\n * Creates a function that acts as\r\n * - decorator\r\n * - annotation object\r\n */\nfunction createDecoratorAnnotation(annotation) {\n function decorator(target, property) {\n storeAnnotation(target, property, annotation);\n }\n return Object.assign(decorator, annotation);\n}\n/**\r\n * Stores annotation to prototype,\r\n * so it can be inspected later by `makeObservable` called from constructor\r\n */\nfunction storeAnnotation(prototype, key, annotation) {\n if (!hasProp(prototype, storedAnnotationsSymbol)) {\n addHiddenProp(prototype, storedAnnotationsSymbol, _extends({}, prototype[storedAnnotationsSymbol]));\n }\n // @override must override something\n if (process.env.NODE_ENV !== \"production\" && isOverride(annotation) && !hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n die(\"'\" + fieldName + \"' is decorated with 'override', \" + \"but no such decorated member was found on prototype.\");\n }\n // Cannot re-decorate\n assertNotDecorated(prototype, annotation, key);\n // Ignore override\n if (!isOverride(annotation)) {\n prototype[storedAnnotationsSymbol][key] = annotation;\n }\n}\nfunction assertNotDecorated(prototype, annotation, key) {\n if (process.env.NODE_ENV !== \"production\" && !isOverride(annotation) && hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n var currentAnnotationType = prototype[storedAnnotationsSymbol][key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '@\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already decorated with '@\" + currentAnnotationType + \"'.\") + \"\\nRe-decorating fields is not allowed.\" + \"\\nUse '@override' decorator for methods overridden by subclass.\");\n }\n}\n/**\r\n * Collects annotations from prototypes and stores them on target (instance)\r\n */\nfunction collectStoredAnnotations(target) {\n if (!hasProp(target, storedAnnotationsSymbol)) {\n if (process.env.NODE_ENV !== \"production\" && !target[storedAnnotationsSymbol]) {\n die(\"No annotations were passed to makeObservable, but no decorated members have been found either\");\n }\n // We need a copy as we will remove annotation from the list once it's applied.\n addHiddenProp(target, storedAnnotationsSymbol, _extends({}, target[storedAnnotationsSymbol]));\n }\n return target[storedAnnotationsSymbol];\n}\n\nvar $mobx = /*#__PURE__*/Symbol(\"mobx administration\");\nvar Atom = /*#__PURE__*/function () {\n // for effective unobserving. BaseAtom has true, for extra optimization, so its onBecomeUnobserved never gets called, because it's not needed\n\n /**\r\n * Create a new atom. For debugging purposes it is recommended to give it a name.\r\n * The onBecomeObserved and onBecomeUnobserved callbacks can be used for resource management.\r\n */\n function Atom(name_) {\n if (name_ === void 0) {\n name_ = process.env.NODE_ENV !== \"production\" ? \"Atom@\" + getNextId() : \"Atom\";\n }\n this.name_ = void 0;\n this.isPendingUnobservation_ = false;\n this.isBeingObserved_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.NOT_TRACKING_;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n this.name_ = name_;\n }\n // onBecomeObservedListeners\n var _proto = Atom.prototype;\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\r\n * Invoke this method to notify mobx that your atom has been used somehow.\r\n * Returns true if there is currently a reactive context.\r\n */;\n _proto.reportObserved = function reportObserved$1() {\n return reportObserved(this);\n }\n /**\r\n * Invoke this method _after_ this method has changed to signal mobx that all its observers should invalidate.\r\n */;\n _proto.reportChanged = function reportChanged() {\n startBatch();\n propagateChanged(this);\n // We could update state version only at the end of batch,\n // but we would still have to switch some global flag here to signal a change.\n globalState.stateVersion = globalState.stateVersion < Number.MAX_SAFE_INTEGER ? globalState.stateVersion + 1 : Number.MIN_SAFE_INTEGER;\n endBatch();\n };\n _proto.toString = function toString() {\n return this.name_;\n };\n return Atom;\n}();\nvar isAtom = /*#__PURE__*/createInstanceofPredicate(\"Atom\", Atom);\nfunction createAtom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) {\n if (onBecomeObservedHandler === void 0) {\n onBecomeObservedHandler = noop;\n }\n if (onBecomeUnobservedHandler === void 0) {\n onBecomeUnobservedHandler = noop;\n }\n var atom = new Atom(name);\n // default `noop` listener will not initialize the hook Set\n if (onBecomeObservedHandler !== noop) {\n onBecomeObserved(atom, onBecomeObservedHandler);\n }\n if (onBecomeUnobservedHandler !== noop) {\n onBecomeUnobserved(atom, onBecomeUnobservedHandler);\n }\n return atom;\n}\n\nfunction identityComparer(a, b) {\n return a === b;\n}\nfunction structuralComparer(a, b) {\n return deepEqual(a, b);\n}\nfunction shallowComparer(a, b) {\n return deepEqual(a, b, 1);\n}\nfunction defaultComparer(a, b) {\n if (Object.is) {\n return Object.is(a, b);\n }\n return a === b ? a !== 0 || 1 / a === 1 / b : a !== a && b !== b;\n}\nvar comparer = {\n identity: identityComparer,\n structural: structuralComparer,\n \"default\": defaultComparer,\n shallow: shallowComparer\n};\n\nfunction deepEnhancer(v, _, name) {\n // it is an observable already, done\n if (isObservable(v)) {\n return v;\n }\n // something that can be converted and mutated?\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name\n });\n }\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name\n });\n }\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name\n });\n }\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name\n });\n }\n if (typeof v === \"function\" && !isAction(v) && !isFlow(v)) {\n if (isGenerator(v)) {\n return flow(v);\n } else {\n return autoAction(name, v);\n }\n }\n return v;\n}\nfunction shallowEnhancer(v, _, name) {\n if (v === undefined || v === null) {\n return v;\n }\n if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v) || isObservableSet(v)) {\n return v;\n }\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name,\n deep: false\n });\n }\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name,\n deep: false\n });\n }\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name,\n deep: false\n });\n }\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name,\n deep: false\n });\n }\n if (process.env.NODE_ENV !== \"production\") {\n die(\"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets\");\n }\n}\nfunction referenceEnhancer(newValue) {\n // never turn into an observable\n return newValue;\n}\nfunction refStructEnhancer(v, oldValue) {\n if (process.env.NODE_ENV !== \"production\" && isObservable(v)) {\n die(\"observable.struct should not be used with observable values\");\n }\n if (deepEqual(v, oldValue)) {\n return oldValue;\n }\n return v;\n}\n\nvar OVERRIDE = \"override\";\nvar override = /*#__PURE__*/createDecoratorAnnotation({\n annotationType_: OVERRIDE,\n make_: make_,\n extend_: extend_\n});\nfunction isOverride(annotation) {\n return annotation.annotationType_ === OVERRIDE;\n}\nfunction make_(adm, key) {\n // Must not be plain object\n if (process.env.NODE_ENV !== \"production\" && adm.isPlainObject_) {\n die(\"Cannot apply '\" + this.annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + this.annotationType_ + \"' cannot be used on plain objects.\"));\n }\n // Must override something\n if (process.env.NODE_ENV !== \"production\" && !hasProp(adm.appliedAnnotations_, key)) {\n die(\"'\" + adm.name_ + \".\" + key.toString() + \"' is annotated with '\" + this.annotationType_ + \"', \" + \"but no such annotated member was found on prototype.\");\n }\n return 0 /* Cancel */;\n}\n\nfunction extend_(adm, key, descriptor, proxyTrap) {\n die(\"'\" + this.annotationType_ + \"' can only be used with 'makeObservable'\");\n}\n\nfunction createActionAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$1,\n extend_: extend_$1\n };\n}\nfunction make_$1(adm, key, descriptor, source) {\n var _this$options_;\n // bound\n if ((_this$options_ = this.options_) != null && _this$options_.bound) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* Cancel */ : 1 /* Break */;\n }\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* Cancel */ : 2 /* Continue */;\n }\n // prototype\n if (isAction(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1 /* Break */;\n }\n\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor, false);\n defineProperty(source, key, actionDescriptor);\n return 2 /* Continue */;\n}\n\nfunction extend_$1(adm, key, descriptor, proxyTrap) {\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor);\n return adm.defineProperty_(key, actionDescriptor, proxyTrap);\n}\nfunction assertActionDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n if (process.env.NODE_ENV !== \"production\" && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a function value.\"));\n }\n}\nfunction createActionDescriptor(adm, annotation, key, descriptor,\n// provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n var _annotation$options_, _annotation$options_$, _annotation$options_2, _annotation$options_$2, _annotation$options_3, _annotation$options_4, _adm$proxy_2;\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n assertActionDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n if ((_annotation$options_ = annotation.options_) != null && _annotation$options_.bound) {\n var _adm$proxy_;\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n return {\n value: createAction((_annotation$options_$ = (_annotation$options_2 = annotation.options_) == null ? void 0 : _annotation$options_2.name) != null ? _annotation$options_$ : key.toString(), value, (_annotation$options_$2 = (_annotation$options_3 = annotation.options_) == null ? void 0 : _annotation$options_3.autoAction) != null ? _annotation$options_$2 : false,\n // https://github.com/mobxjs/mobx/discussions/3140\n (_annotation$options_4 = annotation.options_) != null && _annotation$options_4.bound ? (_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_ : undefined),\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createFlowAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$2,\n extend_: extend_$2\n };\n}\nfunction make_$2(adm, key, descriptor, source) {\n var _this$options_;\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* Cancel */ : 2 /* Continue */;\n }\n // prototype\n // bound - must annotate protos to support super.flow()\n if ((_this$options_ = this.options_) != null && _this$options_.bound && (!hasProp(adm.target_, key) || !isFlow(adm.target_[key]))) {\n if (this.extend_(adm, key, descriptor, false) === null) {\n return 0 /* Cancel */;\n }\n }\n\n if (isFlow(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1 /* Break */;\n }\n\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, false, false);\n defineProperty(source, key, flowDescriptor);\n return 2 /* Continue */;\n}\n\nfunction extend_$2(adm, key, descriptor, proxyTrap) {\n var _this$options_2;\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, (_this$options_2 = this.options_) == null ? void 0 : _this$options_2.bound);\n return adm.defineProperty_(key, flowDescriptor, proxyTrap);\n}\nfunction assertFlowDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n if (process.env.NODE_ENV !== \"production\" && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a generator function value.\"));\n }\n}\nfunction createFlowDescriptor(adm, annotation, key, descriptor, bound,\n// provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n assertFlowDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n // In case of flow.bound, the descriptor can be from already annotated prototype\n if (!isFlow(value)) {\n value = flow(value);\n }\n if (bound) {\n var _adm$proxy_;\n // We do not keep original function around, so we bind the existing flow\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n // This is normally set by `flow`, but `bind` returns new function...\n value.isMobXFlow = true;\n }\n return {\n value: value,\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createComputedAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$3,\n extend_: extend_$3\n };\n}\nfunction make_$3(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* Cancel */ : 1 /* Break */;\n}\n\nfunction extend_$3(adm, key, descriptor, proxyTrap) {\n assertComputedDescriptor(adm, this, key, descriptor);\n return adm.defineComputedProperty_(key, _extends({}, this.options_, {\n get: descriptor.get,\n set: descriptor.set\n }), proxyTrap);\n}\nfunction assertComputedDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var get = _ref2.get;\n if (process.env.NODE_ENV !== \"production\" && !get) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on getter(+setter) properties.\"));\n }\n}\n\nfunction createObservableAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$4,\n extend_: extend_$4\n };\n}\nfunction make_$4(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0 /* Cancel */ : 1 /* Break */;\n}\n\nfunction extend_$4(adm, key, descriptor, proxyTrap) {\n var _this$options_$enhanc, _this$options_;\n assertObservableDescriptor(adm, this, key, descriptor);\n return adm.defineObservableProperty_(key, descriptor.value, (_this$options_$enhanc = (_this$options_ = this.options_) == null ? void 0 : _this$options_.enhancer) != null ? _this$options_$enhanc : deepEnhancer, proxyTrap);\n}\nfunction assertObservableDescriptor(adm, _ref, key, descriptor) {\n var annotationType_ = _ref.annotationType_;\n if (process.env.NODE_ENV !== \"production\" && !(\"value\" in descriptor)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' cannot be used on getter/setter properties\"));\n }\n}\n\nvar AUTO = \"true\";\nvar autoAnnotation = /*#__PURE__*/createAutoAnnotation();\nfunction createAutoAnnotation(options) {\n return {\n annotationType_: AUTO,\n options_: options,\n make_: make_$5,\n extend_: extend_$5\n };\n}\nfunction make_$5(adm, key, descriptor, source) {\n var _this$options_3, _this$options_4;\n // getter -> computed\n if (descriptor.get) {\n return computed.make_(adm, key, descriptor, source);\n }\n // lone setter -> action setter\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.make_\n var set = createAction(key.toString(), descriptor.set);\n // own\n if (source === adm.target_) {\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: set\n }) === null ? 0 /* Cancel */ : 2 /* Continue */;\n }\n // proto\n defineProperty(source, key, {\n configurable: true,\n set: set\n });\n return 2 /* Continue */;\n }\n // function on proto -> autoAction/flow\n if (source !== adm.target_ && typeof descriptor.value === \"function\") {\n var _this$options_2;\n if (isGenerator(descriptor.value)) {\n var _this$options_;\n var flowAnnotation = (_this$options_ = this.options_) != null && _this$options_.autoBind ? flow.bound : flow;\n return flowAnnotation.make_(adm, key, descriptor, source);\n }\n var actionAnnotation = (_this$options_2 = this.options_) != null && _this$options_2.autoBind ? autoAction.bound : autoAction;\n return actionAnnotation.make_(adm, key, descriptor, source);\n }\n // other -> observable\n // Copy props from proto as well, see test:\n // \"decorate should work with Object.create\"\n var observableAnnotation = ((_this$options_3 = this.options_) == null ? void 0 : _this$options_3.deep) === false ? observable.ref : observable;\n // if function respect autoBind option\n if (typeof descriptor.value === \"function\" && (_this$options_4 = this.options_) != null && _this$options_4.autoBind) {\n var _adm$proxy_;\n descriptor.value = descriptor.value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n return observableAnnotation.make_(adm, key, descriptor, source);\n}\nfunction extend_$5(adm, key, descriptor, proxyTrap) {\n var _this$options_5, _this$options_6;\n // getter -> computed\n if (descriptor.get) {\n return computed.extend_(adm, key, descriptor, proxyTrap);\n }\n // lone setter -> action setter\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.extend_\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: createAction(key.toString(), descriptor.set)\n }, proxyTrap);\n }\n // other -> observable\n // if function respect autoBind option\n if (typeof descriptor.value === \"function\" && (_this$options_5 = this.options_) != null && _this$options_5.autoBind) {\n var _adm$proxy_2;\n descriptor.value = descriptor.value.bind((_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_);\n }\n var observableAnnotation = ((_this$options_6 = this.options_) == null ? void 0 : _this$options_6.deep) === false ? observable.ref : observable;\n return observableAnnotation.extend_(adm, key, descriptor, proxyTrap);\n}\n\nvar OBSERVABLE = \"observable\";\nvar OBSERVABLE_REF = \"observable.ref\";\nvar OBSERVABLE_SHALLOW = \"observable.shallow\";\nvar OBSERVABLE_STRUCT = \"observable.struct\";\n// Predefined bags of create observable options, to avoid allocating temporarily option objects\n// in the majority of cases\nvar defaultCreateObservableOptions = {\n deep: true,\n name: undefined,\n defaultDecorator: undefined,\n proxy: true\n};\nObject.freeze(defaultCreateObservableOptions);\nfunction asCreateObservableOptions(thing) {\n return thing || defaultCreateObservableOptions;\n}\nvar observableAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE);\nvar observableRefAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_REF, {\n enhancer: referenceEnhancer\n});\nvar observableShallowAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_SHALLOW, {\n enhancer: shallowEnhancer\n});\nvar observableStructAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_STRUCT, {\n enhancer: refStructEnhancer\n});\nvar observableDecoratorAnnotation = /*#__PURE__*/createDecoratorAnnotation(observableAnnotation);\nfunction getEnhancerFromOptions(options) {\n return options.deep === true ? deepEnhancer : options.deep === false ? referenceEnhancer : getEnhancerFromAnnotation(options.defaultDecorator);\n}\nfunction getAnnotationFromOptions(options) {\n var _options$defaultDecor;\n return options ? (_options$defaultDecor = options.defaultDecorator) != null ? _options$defaultDecor : createAutoAnnotation(options) : undefined;\n}\nfunction getEnhancerFromAnnotation(annotation) {\n var _annotation$options_$, _annotation$options_;\n return !annotation ? deepEnhancer : (_annotation$options_$ = (_annotation$options_ = annotation.options_) == null ? void 0 : _annotation$options_.enhancer) != null ? _annotation$options_$ : deepEnhancer;\n}\n/**\r\n * Turns an object, array or function into a reactive structure.\r\n * @param v the value which should become observable.\r\n */\nfunction createObservable(v, arg2, arg3) {\n // @observable someProp;\n if (isStringish(arg2)) {\n storeAnnotation(v, arg2, observableAnnotation);\n return;\n }\n // already observable - ignore\n if (isObservable(v)) {\n return v;\n }\n // plain object\n if (isPlainObject(v)) {\n return observable.object(v, arg2, arg3);\n }\n // Array\n if (Array.isArray(v)) {\n return observable.array(v, arg2);\n }\n // Map\n if (isES6Map(v)) {\n return observable.map(v, arg2);\n }\n // Set\n if (isES6Set(v)) {\n return observable.set(v, arg2);\n }\n // other object - ignore\n if (typeof v === \"object\" && v !== null) {\n return v;\n }\n // anything else\n return observable.box(v, arg2);\n}\nassign(createObservable, observableDecoratorAnnotation);\nvar observableFactories = {\n box: function box(value, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableValue(value, getEnhancerFromOptions(o), o.name, true, o.equals);\n },\n array: function array(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return (globalState.useProxies === false || o.proxy === false ? createLegacyArray : createObservableArray)(initialValues, getEnhancerFromOptions(o), o.name);\n },\n map: function map(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableMap(initialValues, getEnhancerFromOptions(o), o.name);\n },\n set: function set(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableSet(initialValues, getEnhancerFromOptions(o), o.name);\n },\n object: function object(props, decorators, options) {\n return extendObservable(globalState.useProxies === false || (options == null ? void 0 : options.proxy) === false ? asObservableObject({}, options) : asDynamicObservableObject({}, options), props, decorators);\n },\n ref: /*#__PURE__*/createDecoratorAnnotation(observableRefAnnotation),\n shallow: /*#__PURE__*/createDecoratorAnnotation(observableShallowAnnotation),\n deep: observableDecoratorAnnotation,\n struct: /*#__PURE__*/createDecoratorAnnotation(observableStructAnnotation)\n};\n// eslint-disable-next-line\nvar observable = /*#__PURE__*/assign(createObservable, observableFactories);\n\nvar COMPUTED = \"computed\";\nvar COMPUTED_STRUCT = \"computed.struct\";\nvar computedAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED);\nvar computedStructAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED_STRUCT, {\n equals: comparer.structural\n});\n/**\r\n * Decorator for class properties: @computed get value() { return expr; }.\r\n * For legacy purposes also invokable as ES5 observable created: `computed(() => expr)`;\r\n */\nvar computed = function computed(arg1, arg2) {\n if (isStringish(arg2)) {\n // @computed\n return storeAnnotation(arg1, arg2, computedAnnotation);\n }\n if (isPlainObject(arg1)) {\n // @computed({ options })\n return createDecoratorAnnotation(createComputedAnnotation(COMPUTED, arg1));\n }\n // computed(expr, options?)\n if (process.env.NODE_ENV !== \"production\") {\n if (!isFunction(arg1)) {\n die(\"First argument to `computed` should be an expression.\");\n }\n if (isFunction(arg2)) {\n die(\"A setter as second argument is no longer supported, use `{ set: fn }` option instead\");\n }\n }\n var opts = isPlainObject(arg2) ? arg2 : {};\n opts.get = arg1;\n opts.name || (opts.name = arg1.name || \"\"); /* for generated name */\n return new ComputedValue(opts);\n};\nObject.assign(computed, computedAnnotation);\ncomputed.struct = /*#__PURE__*/createDecoratorAnnotation(computedStructAnnotation);\n\nvar _getDescriptor$config, _getDescriptor;\n// we don't use globalState for these in order to avoid possible issues with multiple\n// mobx versions\nvar currentActionId = 0;\nvar nextActionId = 1;\nvar isFunctionNameConfigurable = (_getDescriptor$config = (_getDescriptor = /*#__PURE__*/getDescriptor(function () {}, \"name\")) == null ? void 0 : _getDescriptor.configurable) != null ? _getDescriptor$config : false;\n// we can safely recycle this object\nvar tmpNameDescriptor = {\n value: \"action\",\n configurable: true,\n writable: false,\n enumerable: false\n};\nfunction createAction(actionName, fn, autoAction, ref) {\n if (autoAction === void 0) {\n autoAction = false;\n }\n if (process.env.NODE_ENV !== \"production\") {\n if (!isFunction(fn)) {\n die(\"`action` can only be invoked on functions\");\n }\n if (typeof actionName !== \"string\" || !actionName) {\n die(\"actions should have valid names, got: '\" + actionName + \"'\");\n }\n }\n function res() {\n return executeAction(actionName, autoAction, fn, ref || this, arguments);\n }\n res.isMobxAction = true;\n if (isFunctionNameConfigurable) {\n tmpNameDescriptor.value = actionName;\n defineProperty(res, \"name\", tmpNameDescriptor);\n }\n return res;\n}\nfunction executeAction(actionName, canRunAsDerivation, fn, scope, args) {\n var runInfo = _startAction(actionName, canRunAsDerivation, scope, args);\n try {\n return fn.apply(scope, args);\n } catch (err) {\n runInfo.error_ = err;\n throw err;\n } finally {\n _endAction(runInfo);\n }\n}\nfunction _startAction(actionName, canRunAsDerivation,\n// true for autoAction\nscope, args) {\n var notifySpy_ = process.env.NODE_ENV !== \"production\" && isSpyEnabled() && !!actionName;\n var startTime_ = 0;\n if (process.env.NODE_ENV !== \"production\" && notifySpy_) {\n startTime_ = Date.now();\n var flattenedArgs = args ? Array.from(args) : EMPTY_ARRAY;\n spyReportStart({\n type: ACTION,\n name: actionName,\n object: scope,\n arguments: flattenedArgs\n });\n }\n var prevDerivation_ = globalState.trackingDerivation;\n var runAsAction = !canRunAsDerivation || !prevDerivation_;\n startBatch();\n var prevAllowStateChanges_ = globalState.allowStateChanges; // by default preserve previous allow\n if (runAsAction) {\n untrackedStart();\n prevAllowStateChanges_ = allowStateChangesStart(true);\n }\n var prevAllowStateReads_ = allowStateReadsStart(true);\n var runInfo = {\n runAsAction_: runAsAction,\n prevDerivation_: prevDerivation_,\n prevAllowStateChanges_: prevAllowStateChanges_,\n prevAllowStateReads_: prevAllowStateReads_,\n notifySpy_: notifySpy_,\n startTime_: startTime_,\n actionId_: nextActionId++,\n parentActionId_: currentActionId\n };\n currentActionId = runInfo.actionId_;\n return runInfo;\n}\nfunction _endAction(runInfo) {\n if (currentActionId !== runInfo.actionId_) {\n die(30);\n }\n currentActionId = runInfo.parentActionId_;\n if (runInfo.error_ !== undefined) {\n globalState.suppressReactionErrors = true;\n }\n allowStateChangesEnd(runInfo.prevAllowStateChanges_);\n allowStateReadsEnd(runInfo.prevAllowStateReads_);\n endBatch();\n if (runInfo.runAsAction_) {\n untrackedEnd(runInfo.prevDerivation_);\n }\n if (process.env.NODE_ENV !== \"production\" && runInfo.notifySpy_) {\n spyReportEnd({\n time: Date.now() - runInfo.startTime_\n });\n }\n globalState.suppressReactionErrors = false;\n}\nfunction allowStateChanges(allowStateChanges, func) {\n var prev = allowStateChangesStart(allowStateChanges);\n try {\n return func();\n } finally {\n allowStateChangesEnd(prev);\n }\n}\nfunction allowStateChangesStart(allowStateChanges) {\n var prev = globalState.allowStateChanges;\n globalState.allowStateChanges = allowStateChanges;\n return prev;\n}\nfunction allowStateChangesEnd(prev) {\n globalState.allowStateChanges = prev;\n}\n\nvar _Symbol$toPrimitive;\nvar CREATE = \"create\";\n_Symbol$toPrimitive = Symbol.toPrimitive;\nvar ObservableValue = /*#__PURE__*/function (_Atom) {\n _inheritsLoose(ObservableValue, _Atom);\n function ObservableValue(value, enhancer, name_, notifySpy, equals) {\n var _this;\n if (name_ === void 0) {\n name_ = process.env.NODE_ENV !== \"production\" ? \"ObservableValue@\" + getNextId() : \"ObservableValue\";\n }\n if (notifySpy === void 0) {\n notifySpy = true;\n }\n if (equals === void 0) {\n equals = comparer[\"default\"];\n }\n _this = _Atom.call(this, name_) || this;\n _this.enhancer = void 0;\n _this.name_ = void 0;\n _this.equals = void 0;\n _this.hasUnreportedChange_ = false;\n _this.interceptors_ = void 0;\n _this.changeListeners_ = void 0;\n _this.value_ = void 0;\n _this.dehancer = void 0;\n _this.enhancer = enhancer;\n _this.name_ = name_;\n _this.equals = equals;\n _this.value_ = enhancer(value, undefined, name_);\n if (process.env.NODE_ENV !== \"production\" && notifySpy && isSpyEnabled()) {\n // only notify spy if this is a stand-alone observable\n spyReport({\n type: CREATE,\n object: _assertThisInitialized(_this),\n observableKind: \"value\",\n debugObjectName: _this.name_,\n newValue: \"\" + _this.value_\n });\n }\n return _this;\n }\n var _proto = ObservableValue.prototype;\n _proto.dehanceValue = function dehanceValue(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.set = function set(newValue) {\n var oldValue = this.value_;\n newValue = this.prepareNewValue_(newValue);\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportStart({\n type: UPDATE,\n object: this,\n observableKind: \"value\",\n debugObjectName: this.name_,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n this.setNewValue_(newValue);\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportEnd();\n }\n }\n };\n _proto.prepareNewValue_ = function prepareNewValue_(newValue) {\n checkIfStateModificationsAreAllowed(this);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this,\n type: UPDATE,\n newValue: newValue\n });\n if (!change) {\n return globalState.UNCHANGED;\n }\n newValue = change.newValue;\n }\n // apply modifier\n newValue = this.enhancer(newValue, this.value_, this.name_);\n return this.equals(this.value_, newValue) ? globalState.UNCHANGED : newValue;\n };\n _proto.setNewValue_ = function setNewValue_(newValue) {\n var oldValue = this.value_;\n this.value_ = newValue;\n this.reportChanged();\n if (hasListeners(this)) {\n notifyListeners(this, {\n type: UPDATE,\n object: this,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n };\n _proto.get = function get() {\n this.reportObserved();\n return this.dehanceValue(this.value_);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately) {\n listener({\n observableKind: \"value\",\n debugObjectName: this.name_,\n object: this,\n type: UPDATE,\n newValue: this.value_,\n oldValue: undefined\n });\n }\n return registerListener(this, listener);\n };\n _proto.raw = function raw() {\n // used by MST ot get undehanced value\n return this.value_;\n };\n _proto.toJSON = function toJSON() {\n return this.get();\n };\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.value_ + \"]\";\n };\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n _proto[_Symbol$toPrimitive] = function () {\n return this.valueOf();\n };\n return ObservableValue;\n}(Atom);\nvar isObservableValue = /*#__PURE__*/createInstanceofPredicate(\"ObservableValue\", ObservableValue);\n\nvar _Symbol$toPrimitive$1;\n/**\r\n * A node in the state dependency root that observes other nodes, and can be observed itself.\r\n *\r\n * ComputedValue will remember the result of the computation for the duration of the batch, or\r\n * while being observed.\r\n *\r\n * During this time it will recompute only when one of its direct dependencies changed,\r\n * but only when it is being accessed with `ComputedValue.get()`.\r\n *\r\n * Implementation description:\r\n * 1. First time it's being accessed it will compute and remember result\r\n * give back remembered result until 2. happens\r\n * 2. First time any deep dependency change, propagate POSSIBLY_STALE to all observers, wait for 3.\r\n * 3. When it's being accessed, recompute if any shallow dependency changed.\r\n * if result changed: propagate STALE to all observers, that were POSSIBLY_STALE from the last step.\r\n * go to step 2. either way\r\n *\r\n * If at any point it's outside batch and it isn't observed: reset everything and go to 1.\r\n */\n_Symbol$toPrimitive$1 = Symbol.toPrimitive;\nvar ComputedValue = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n // during tracking it's an array with new observed observers\n\n // to check for cycles\n\n // N.B: unminified as it is used by MST\n\n /**\r\n * Create a new computed value based on a function expression.\r\n *\r\n * The `name` property is for debug purposes only.\r\n *\r\n * The `equals` property specifies the comparer function to use to determine if a newly produced\r\n * value differs from the previous value. Two comparers are provided in the library; `defaultComparer`\r\n * compares based on identity comparison (===), and `structuralComparer` deeply compares the structure.\r\n * Structural comparison can be convenient if you always produce a new aggregated object and\r\n * don't want to notify observers if it is structurally the same.\r\n * This is useful for working with vectors, mouse coordinates etc.\r\n */\n function ComputedValue(options) {\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.observing_ = [];\n this.newObserving_ = null;\n this.isBeingObserved_ = false;\n this.isPendingUnobservation_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n this.unboundDepsCount_ = 0;\n this.value_ = new CaughtException(null);\n this.name_ = void 0;\n this.triggeredBy_ = void 0;\n this.isComputing_ = false;\n this.isRunningSetter_ = false;\n this.derivation = void 0;\n this.setter_ = void 0;\n this.isTracing_ = TraceMode.NONE;\n this.scope_ = void 0;\n this.equals_ = void 0;\n this.requiresReaction_ = void 0;\n this.keepAlive_ = void 0;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n if (!options.get) {\n die(31);\n }\n this.derivation = options.get;\n this.name_ = options.name || (process.env.NODE_ENV !== \"production\" ? \"ComputedValue@\" + getNextId() : \"ComputedValue\");\n if (options.set) {\n this.setter_ = createAction(process.env.NODE_ENV !== \"production\" ? this.name_ + \"-setter\" : \"ComputedValue-setter\", options.set);\n }\n this.equals_ = options.equals || (options.compareStructural || options.struct ? comparer.structural : comparer[\"default\"]);\n this.scope_ = options.context;\n this.requiresReaction_ = options.requiresReaction;\n this.keepAlive_ = !!options.keepAlive;\n }\n var _proto = ComputedValue.prototype;\n _proto.onBecomeStale_ = function onBecomeStale_() {\n propagateMaybeChanged(this);\n };\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\r\n * Returns the current value of this computed value.\r\n * Will evaluate its computation first if needed.\r\n */;\n _proto.get = function get() {\n if (this.isComputing_) {\n die(32, this.name_, this.derivation);\n }\n if (globalState.inBatch === 0 &&\n // !globalState.trackingDerivatpion &&\n this.observers_.size === 0 && !this.keepAlive_) {\n if (shouldCompute(this)) {\n this.warnAboutUntrackedRead_();\n startBatch(); // See perf test 'computed memoization'\n this.value_ = this.computeValue_(false);\n endBatch();\n }\n } else {\n reportObserved(this);\n if (shouldCompute(this)) {\n var prevTrackingContext = globalState.trackingContext;\n if (this.keepAlive_ && !prevTrackingContext) {\n globalState.trackingContext = this;\n }\n if (this.trackAndCompute()) {\n propagateChangeConfirmed(this);\n }\n globalState.trackingContext = prevTrackingContext;\n }\n }\n var result = this.value_;\n if (isCaughtException(result)) {\n throw result.cause;\n }\n return result;\n };\n _proto.set = function set(value) {\n if (this.setter_) {\n if (this.isRunningSetter_) {\n die(33, this.name_);\n }\n this.isRunningSetter_ = true;\n try {\n this.setter_.call(this.scope_, value);\n } finally {\n this.isRunningSetter_ = false;\n }\n } else {\n die(34, this.name_);\n }\n };\n _proto.trackAndCompute = function trackAndCompute() {\n // N.B: unminified as it is used by MST\n var oldValue = this.value_;\n var wasSuspended = /* see #1208 */this.dependenciesState_ === IDerivationState_.NOT_TRACKING_;\n var newValue = this.computeValue_(true);\n var changed = wasSuspended || isCaughtException(oldValue) || isCaughtException(newValue) || !this.equals_(oldValue, newValue);\n if (changed) {\n this.value_ = newValue;\n if (process.env.NODE_ENV !== \"production\" && isSpyEnabled()) {\n spyReport({\n observableKind: \"computed\",\n debugObjectName: this.name_,\n object: this.scope_,\n type: \"update\",\n oldValue: oldValue,\n newValue: newValue\n });\n }\n }\n return changed;\n };\n _proto.computeValue_ = function computeValue_(track) {\n this.isComputing_ = true;\n // don't allow state changes during computation\n var prev = allowStateChangesStart(false);\n var res;\n if (track) {\n res = trackDerivedFunction(this, this.derivation, this.scope_);\n } else {\n if (globalState.disableErrorBoundaries === true) {\n res = this.derivation.call(this.scope_);\n } else {\n try {\n res = this.derivation.call(this.scope_);\n } catch (e) {\n res = new CaughtException(e);\n }\n }\n }\n allowStateChangesEnd(prev);\n this.isComputing_ = false;\n return res;\n };\n _proto.suspend_ = function suspend_() {\n if (!this.keepAlive_) {\n clearObserving(this);\n this.value_ = undefined; // don't hold on to computed value!\n if (process.env.NODE_ENV !== \"production\" && this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' was suspended and it will recompute on the next access.\");\n }\n }\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n var _this = this;\n var firstTime = true;\n var prevValue = undefined;\n return autorun(function () {\n // TODO: why is this in a different place than the spyReport() function? in all other observables it's called in the same place\n var newValue = _this.get();\n if (!firstTime || fireImmediately) {\n var prevU = untrackedStart();\n listener({\n observableKind: \"computed\",\n debugObjectName: _this.name_,\n type: UPDATE,\n object: _this,\n newValue: newValue,\n oldValue: prevValue\n });\n untrackedEnd(prevU);\n }\n firstTime = false;\n prevValue = newValue;\n });\n };\n _proto.warnAboutUntrackedRead_ = function warnAboutUntrackedRead_() {\n if (!(process.env.NODE_ENV !== \"production\")) {\n return;\n }\n if (this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n if (typeof this.requiresReaction_ === \"boolean\" ? this.requiresReaction_ : globalState.computedRequiresReaction) {\n console.warn(\"[mobx] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n };\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.derivation.toString() + \"]\";\n };\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n _proto[_Symbol$toPrimitive$1] = function () {\n return this.valueOf();\n };\n return ComputedValue;\n}();\nvar isComputedValue = /*#__PURE__*/createInstanceofPredicate(\"ComputedValue\", ComputedValue);\n\nvar IDerivationState_;\n(function (IDerivationState_) {\n // before being run or (outside batch and not being observed)\n // at this point derivation is not holding any data about dependency tree\n IDerivationState_[IDerivationState_[\"NOT_TRACKING_\"] = -1] = \"NOT_TRACKING_\";\n // no shallow dependency changed since last computation\n // won't recalculate derivation\n // this is what makes mobx fast\n IDerivationState_[IDerivationState_[\"UP_TO_DATE_\"] = 0] = \"UP_TO_DATE_\";\n // some deep dependency changed, but don't know if shallow dependency changed\n // will require to check first if UP_TO_DATE or POSSIBLY_STALE\n // currently only ComputedValue will propagate POSSIBLY_STALE\n //\n // having this state is second big optimization:\n // don't have to recompute on every dependency change, but only when it's needed\n IDerivationState_[IDerivationState_[\"POSSIBLY_STALE_\"] = 1] = \"POSSIBLY_STALE_\";\n // A shallow dependency has changed since last computation and the derivation\n // will need to recompute when it's needed next.\n IDerivationState_[IDerivationState_[\"STALE_\"] = 2] = \"STALE_\";\n})(IDerivationState_ || (IDerivationState_ = {}));\nvar TraceMode;\n(function (TraceMode) {\n TraceMode[TraceMode[\"NONE\"] = 0] = \"NONE\";\n TraceMode[TraceMode[\"LOG\"] = 1] = \"LOG\";\n TraceMode[TraceMode[\"BREAK\"] = 2] = \"BREAK\";\n})(TraceMode || (TraceMode = {}));\nvar CaughtException = function CaughtException(cause) {\n this.cause = void 0;\n this.cause = cause;\n // Empty\n};\n\nfunction isCaughtException(e) {\n return e instanceof CaughtException;\n}\n/**\r\n * Finds out whether any dependency of the derivation has actually changed.\r\n * If dependenciesState is 1 then it will recalculate dependencies,\r\n * if any dependency changed it will propagate it by changing dependenciesState to 2.\r\n *\r\n * By iterating over the dependencies in the same order that they were reported and\r\n * stopping on the first change, all the recalculations are only called for ComputedValues\r\n * that will be tracked by derivation. That is because we assume that if the first x\r\n * dependencies of the derivation doesn't change then the derivation should run the same way\r\n * up until accessing x-th dependency.\r\n */\nfunction shouldCompute(derivation) {\n switch (derivation.dependenciesState_) {\n case IDerivationState_.UP_TO_DATE_:\n return false;\n case IDerivationState_.NOT_TRACKING_:\n case IDerivationState_.STALE_:\n return true;\n case IDerivationState_.POSSIBLY_STALE_:\n {\n // state propagation can occur outside of action/reactive context #2195\n var prevAllowStateReads = allowStateReadsStart(true);\n var prevUntracked = untrackedStart(); // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\n var obs = derivation.observing_,\n l = obs.length;\n for (var i = 0; i < l; i++) {\n var obj = obs[i];\n if (isComputedValue(obj)) {\n if (globalState.disableErrorBoundaries) {\n obj.get();\n } else {\n try {\n obj.get();\n } catch (e) {\n // we are not interested in the value *or* exception at this moment, but if there is one, notify all\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\n // and `derivation` is an observer of `obj`\n // invariantShouldCompute(derivation)\n if (derivation.dependenciesState_ === IDerivationState_.STALE_) {\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n }\n changeDependenciesStateTo0(derivation);\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return false;\n }\n }\n}\nfunction isComputingDerivation() {\n return globalState.trackingDerivation !== null; // filter out actions inside computations\n}\n\nfunction checkIfStateModificationsAreAllowed(atom) {\n if (!(process.env.NODE_ENV !== \"production\")) {\n return;\n }\n var hasObservers = atom.observers_.size > 0;\n // Should not be possible to change observed state outside strict mode, except during initialization, see #563\n if (!globalState.allowStateChanges && (hasObservers || globalState.enforceActions === \"always\")) {\n console.warn(\"[MobX] \" + (globalState.enforceActions ? \"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: \" : \"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: \") + atom.name_);\n }\n}\nfunction checkIfStateReadsAreAllowed(observable) {\n if (process.env.NODE_ENV !== \"production\" && !globalState.allowStateReads && globalState.observableRequiresReaction) {\n console.warn(\"[mobx] Observable '\" + observable.name_ + \"' being read outside a reactive context.\");\n }\n}\n/**\r\n * Executes the provided function `f` and tracks which observables are being accessed.\r\n * The tracking information is stored on the `derivation` object and the derivation is registered\r\n * as observer of any of the accessed observables.\r\n */\nfunction trackDerivedFunction(derivation, f, context) {\n var prevAllowStateReads = allowStateReadsStart(true);\n // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n changeDependenciesStateTo0(derivation);\n derivation.newObserving_ = new Array(derivation.observing_.length + 100);\n derivation.unboundDepsCount_ = 0;\n derivation.runId_ = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n globalState.inBatch++;\n var result;\n if (globalState.disableErrorBoundaries === true) {\n result = f.call(context);\n } else {\n try {\n result = f.call(context);\n } catch (e) {\n result = new CaughtException(e);\n }\n }\n globalState.inBatch--;\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n warnAboutDerivationWithoutDependencies(derivation);\n allowStateReadsEnd(prevAllowStateReads);\n return result;\n}\nfunction warnAboutDerivationWithoutDependencies(derivation) {\n if (!(process.env.NODE_ENV !== \"production\")) {\n return;\n }\n if (derivation.observing_.length !== 0) {\n return;\n }\n if (typeof derivation.requiresObservable_ === \"boolean\" ? derivation.requiresObservable_ : globalState.reactionRequiresObservable) {\n console.warn(\"[mobx] Derivation '\" + derivation.name_ + \"' is created/updated without reading any observable value.\");\n }\n}\n/**\r\n * diffs newObserving with observing.\r\n * update observing to be newObserving with unique observables\r\n * notify observers that become observed/unobserved\r\n */\nfunction bindDependencies(derivation) {\n // invariant(derivation.dependenciesState !== IDerivationState.NOT_TRACKING, \"INTERNAL ERROR bindDependencies expects derivation.dependenciesState !== -1\");\n var prevObserving = derivation.observing_;\n var observing = derivation.observing_ = derivation.newObserving_;\n var lowestNewObservingDerivationState = IDerivationState_.UP_TO_DATE_;\n // Go through all new observables and check diffValue: (this list can contain duplicates):\n // 0: first occurrence, change to 1 and keep it\n // 1: extra occurrence, drop it\n var i0 = 0,\n l = derivation.unboundDepsCount_;\n for (var i = 0; i < l; i++) {\n var dep = observing[i];\n if (dep.diffValue_ === 0) {\n dep.diffValue_ = 1;\n if (i0 !== i) {\n observing[i0] = dep;\n }\n i0++;\n }\n // Upcast is 'safe' here, because if dep is IObservable, `dependenciesState` will be undefined,\n // not hitting the condition\n if (dep.dependenciesState_ > lowestNewObservingDerivationState) {\n lowestNewObservingDerivationState = dep.dependenciesState_;\n }\n }\n observing.length = i0;\n derivation.newObserving_ = null; // newObserving shouldn't be needed outside tracking (statement moved down to work around FF bug, see #614)\n // Go through all old observables and check diffValue: (it is unique after last bindDependencies)\n // 0: it's not in new observables, unobserve it\n // 1: it keeps being observed, don't want to notify it. change to 0\n l = prevObserving.length;\n while (l--) {\n var _dep = prevObserving[l];\n if (_dep.diffValue_ === 0) {\n removeObserver(_dep, derivation);\n }\n _dep.diffValue_ = 0;\n }\n // Go through all new observables and check diffValue: (now it should be unique)\n // 0: it was set to 0 in last loop. don't need to do anything.\n // 1: it wasn't observed, let's observe it. set back to 0\n while (i0--) {\n var _dep2 = observing[i0];\n if (_dep2.diffValue_ === 1) {\n _dep2.diffValue_ = 0;\n addObserver(_dep2, derivation);\n }\n }\n // Some new observed derivations may become stale during this derivation computation\n // so they have had no chance to propagate staleness (#916)\n if (lowestNewObservingDerivationState !== IDerivationState_.UP_TO_DATE_) {\n derivation.dependenciesState_ = lowestNewObservingDerivationState;\n derivation.onBecomeStale_();\n }\n}\nfunction clearObserving(derivation) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR clearObserving should be called only inside batch\");\n var obs = derivation.observing_;\n derivation.observing_ = [];\n var i = obs.length;\n while (i--) {\n removeObserver(obs[i], derivation);\n }\n derivation.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n}\nfunction untracked(action) {\n var prev = untrackedStart();\n try {\n return action();\n } finally {\n untrackedEnd(prev);\n }\n}\nfunction untrackedStart() {\n var prev = globalState.trackingDerivation;\n globalState.trackingDerivation = null;\n return prev;\n}\nfunction untrackedEnd(prev) {\n globalState.trackingDerivation = prev;\n}\nfunction allowStateReadsStart(allowStateReads) {\n var prev = globalState.allowStateReads;\n globalState.allowStateReads = allowStateReads;\n return prev;\n}\nfunction allowStateReadsEnd(prev) {\n globalState.allowStateReads = prev;\n}\n/**\r\n * needed to keep `lowestObserverState` correct. when changing from (2 or 1) to 0\r\n *\r\n */\nfunction changeDependenciesStateTo0(derivation) {\n if (derivation.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n return;\n }\n derivation.dependenciesState_ = IDerivationState_.UP_TO_DATE_;\n var obs = derivation.observing_;\n var i = obs.length;\n while (i--) {\n obs[i].lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n}\n\n/**\r\n * These values will persist if global state is reset\r\n */\nvar persistentKeys = [\"mobxGuid\", \"spyListeners\", \"enforceActions\", \"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"allowStateReads\", \"disableErrorBoundaries\", \"runId\", \"UNCHANGED\", \"useProxies\"];\nvar MobXGlobals = function MobXGlobals() {\n this.version = 6;\n this.UNCHANGED = {};\n this.trackingDerivation = null;\n this.trackingContext = null;\n this.runId = 0;\n this.mobxGuid = 0;\n this.inBatch = 0;\n this.pendingUnobservations = [];\n this.pendingReactions = [];\n this.isRunningReactions = false;\n this.allowStateChanges = false;\n this.allowStateReads = true;\n this.enforceActions = true;\n this.spyListeners = [];\n this.globalReactionErrorHandlers = [];\n this.computedRequiresReaction = false;\n this.reactionRequiresObservable = false;\n this.observableRequiresReaction = false;\n this.disableErrorBoundaries = false;\n this.suppressReactionErrors = false;\n this.useProxies = true;\n this.verifyProxies = false;\n this.safeDescriptors = true;\n this.stateVersion = Number.MIN_SAFE_INTEGER;\n};\nvar canMergeGlobalState = true;\nvar isolateCalled = false;\nvar globalState = /*#__PURE__*/function () {\n var global = /*#__PURE__*/getGlobal();\n if (global.__mobxInstanceCount > 0 && !global.__mobxGlobals) {\n canMergeGlobalState = false;\n }\n if (global.__mobxGlobals && global.__mobxGlobals.version !== new MobXGlobals().version) {\n canMergeGlobalState = false;\n }\n if (!canMergeGlobalState) {\n // Because this is a IIFE we need to let isolateCalled a chance to change\n // so we run it after the event loop completed at least 1 iteration\n setTimeout(function () {\n if (!isolateCalled) {\n die(35);\n }\n }, 1);\n return new MobXGlobals();\n } else if (global.__mobxGlobals) {\n global.__mobxInstanceCount += 1;\n if (!global.__mobxGlobals.UNCHANGED) {\n global.__mobxGlobals.UNCHANGED = {};\n } // make merge backward compatible\n return global.__mobxGlobals;\n } else {\n global.__mobxInstanceCount = 1;\n return global.__mobxGlobals = /*#__PURE__*/new MobXGlobals();\n }\n}();\nfunction isolateGlobalState() {\n if (globalState.pendingReactions.length || globalState.inBatch || globalState.isRunningReactions) {\n die(36);\n }\n isolateCalled = true;\n if (canMergeGlobalState) {\n var global = getGlobal();\n if (--global.__mobxInstanceCount === 0) {\n global.__mobxGlobals = undefined;\n }\n globalState = new MobXGlobals();\n }\n}\nfunction getGlobalState() {\n return globalState;\n}\n/**\r\n * For testing purposes only; this will break the internal state of existing observables,\r\n * but can be used to get back at a stable state after throwing errors\r\n */\nfunction resetGlobalState() {\n var defaultGlobals = new MobXGlobals();\n for (var key in defaultGlobals) {\n if (persistentKeys.indexOf(key) === -1) {\n globalState[key] = defaultGlobals[key];\n }\n }\n globalState.allowStateChanges = !globalState.enforceActions;\n}\n\nfunction hasObservers(observable) {\n return observable.observers_ && observable.observers_.size > 0;\n}\nfunction getObservers(observable) {\n return observable.observers_;\n}\n// function invariantObservers(observable: IObservable) {\n// const list = observable.observers\n// const map = observable.observersIndexes\n// const l = list.length\n// for (let i = 0; i < l; i++) {\n// const id = list[i].__mapid\n// if (i) {\n// invariant(map[id] === i, \"INTERNAL ERROR maps derivation.__mapid to index in list\") // for performance\n// } else {\n// invariant(!(id in map), \"INTERNAL ERROR observer on index 0 shouldn't be held in map.\") // for performance\n// }\n// }\n// invariant(\n// list.length === 0 || Object.keys(map).length === list.length - 1,\n// \"INTERNAL ERROR there is no junk in map\"\n// )\n// }\nfunction addObserver(observable, node) {\n // invariant(node.dependenciesState !== -1, \"INTERNAL ERROR, can add only dependenciesState !== -1\");\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR add already added node\");\n // invariantObservers(observable);\n observable.observers_.add(node);\n if (observable.lowestObserverState_ > node.dependenciesState_) {\n observable.lowestObserverState_ = node.dependenciesState_;\n }\n // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR didn't add node\");\n}\n\nfunction removeObserver(observable, node) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR, remove should be called only inside batch\");\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR remove already removed node\");\n // invariantObservers(observable);\n observable.observers_[\"delete\"](node);\n if (observable.observers_.size === 0) {\n // deleting last observer\n queueForUnobservation(observable);\n }\n // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR remove already removed node2\");\n}\n\nfunction queueForUnobservation(observable) {\n if (observable.isPendingUnobservation_ === false) {\n // invariant(observable._observers.length === 0, \"INTERNAL ERROR, should only queue for unobservation unobserved observables\");\n observable.isPendingUnobservation_ = true;\n globalState.pendingUnobservations.push(observable);\n }\n}\n/**\r\n * Batch starts a transaction, at least for purposes of memoizing ComputedValues when nothing else does.\r\n * During a batch `onBecomeUnobserved` will be called at most once per observable.\r\n * Avoids unnecessary recalculations.\r\n */\nfunction startBatch() {\n globalState.inBatch++;\n}\nfunction endBatch() {\n if (--globalState.inBatch === 0) {\n runReactions();\n // the batch is actually about to finish, all unobserving should happen here.\n var list = globalState.pendingUnobservations;\n for (var i = 0; i < list.length; i++) {\n var observable = list[i];\n observable.isPendingUnobservation_ = false;\n if (observable.observers_.size === 0) {\n if (observable.isBeingObserved_) {\n // if this observable had reactive observers, trigger the hooks\n observable.isBeingObserved_ = false;\n observable.onBUO();\n }\n if (observable instanceof ComputedValue) {\n // computed values are automatically teared down when the last observer leaves\n // this process happens recursively, this computed might be the last observabe of another, etc..\n observable.suspend_();\n }\n }\n }\n globalState.pendingUnobservations = [];\n }\n}\nfunction reportObserved(observable) {\n checkIfStateReadsAreAllowed(observable);\n var derivation = globalState.trackingDerivation;\n if (derivation !== null) {\n /**\r\n * Simple optimization, give each derivation run an unique id (runId)\r\n * Check if last time this observable was accessed the same runId is used\r\n * if this is the case, the relation is already known\r\n */\n if (derivation.runId_ !== observable.lastAccessedBy_) {\n observable.lastAccessedBy_ = derivation.runId_;\n // Tried storing newObserving, or observing, or both as Set, but performance didn't come close...\n derivation.newObserving_[derivation.unboundDepsCount_++] = observable;\n if (!observable.isBeingObserved_ && globalState.trackingContext) {\n observable.isBeingObserved_ = true;\n observable.onBO();\n }\n }\n return observable.isBeingObserved_;\n } else if (observable.observers_.size === 0 && globalState.inBatch > 0) {\n queueForUnobservation(observable);\n }\n return false;\n}\n// function invariantLOS(observable: IObservable, msg: string) {\n// // it's expensive so better not run it in produciton. but temporarily helpful for testing\n// const min = getObservers(observable).reduce((a, b) => Math.min(a, b.dependenciesState), 2)\n// if (min >= observable.lowestObserverState) return // <- the only assumption about `lowestObserverState`\n// throw new Error(\n// \"lowestObserverState is wrong for \" +\n// msg +\n// \" because \" +\n// min +\n// \" < \" +\n// observable.lowestObserverState\n// )\n// }\n/**\r\n * NOTE: current propagation mechanism will in case of self reruning autoruns behave unexpectedly\r\n * It will propagate changes to observers from previous run\r\n * It's hard or maybe impossible (with reasonable perf) to get it right with current approach\r\n * Hopefully self reruning autoruns aren't a feature people should depend on\r\n * Also most basic use cases should be ok\r\n */\n// Called by Atom when its value changes\nfunction propagateChanged(observable) {\n // invariantLOS(observable, \"changed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n observable.lowestObserverState_ = IDerivationState_.STALE_;\n // Ideally we use for..of here, but the downcompiled version is really slow...\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n if (process.env.NODE_ENV !== \"production\" && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n d.onBecomeStale_();\n }\n d.dependenciesState_ = IDerivationState_.STALE_;\n });\n // invariantLOS(observable, \"changed end\");\n}\n// Called by ComputedValue when it recalculate and its value changed\nfunction propagateChangeConfirmed(observable) {\n // invariantLOS(observable, \"confirmed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n observable.lowestObserverState_ = IDerivationState_.STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.POSSIBLY_STALE_) {\n d.dependenciesState_ = IDerivationState_.STALE_;\n if (process.env.NODE_ENV !== \"production\" && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n } else if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_ // this happens during computing of `d`, just keep lowestObserverState up to date.\n ) {\n observable.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n });\n // invariantLOS(observable, \"confirmed end\");\n}\n// Used by computed when its dependency changed, but we don't wan't to immediately recompute.\nfunction propagateMaybeChanged(observable) {\n // invariantLOS(observable, \"maybe start\");\n if (observable.lowestObserverState_ !== IDerivationState_.UP_TO_DATE_) {\n return;\n }\n observable.lowestObserverState_ = IDerivationState_.POSSIBLY_STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n d.dependenciesState_ = IDerivationState_.POSSIBLY_STALE_;\n d.onBecomeStale_();\n }\n });\n // invariantLOS(observable, \"maybe end\");\n}\n\nfunction logTraceInfo(derivation, observable) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' is invalidated due to a change in: '\" + observable.name_ + \"'\");\n if (derivation.isTracing_ === TraceMode.BREAK) {\n var lines = [];\n printDepTree(getDependencyTree(derivation), lines, 1);\n // prettier-ignore\n new Function(\"debugger;\\n/*\\nTracing '\" + derivation.name_ + \"'\\n\\nYou are entering this break point because derivation '\" + derivation.name_ + \"' is being traced and '\" + observable.name_ + \"' is now forcing it to update.\\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\\n\\n\" + (derivation instanceof ComputedValue ? derivation.derivation.toString().replace(/[*]\\//g, \"/\") : \"\") + \"\\n\\nThe dependencies for this derivation are:\\n\\n\" + lines.join(\"\\n\") + \"\\n*/\\n \")();\n }\n}\nfunction printDepTree(tree, lines, depth) {\n if (lines.length >= 1000) {\n lines.push(\"(and many more)\");\n return;\n }\n lines.push(\"\" + \"\\t\".repeat(depth - 1) + tree.name);\n if (tree.dependencies) {\n tree.dependencies.forEach(function (child) {\n return printDepTree(child, lines, depth + 1);\n });\n }\n}\n\nvar Reaction = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n\n function Reaction(name_, onInvalidate_, errorHandler_, requiresObservable_) {\n if (name_ === void 0) {\n name_ = process.env.NODE_ENV !== \"production\" ? \"Reaction@\" + getNextId() : \"Reaction\";\n }\n this.name_ = void 0;\n this.onInvalidate_ = void 0;\n this.errorHandler_ = void 0;\n this.requiresObservable_ = void 0;\n this.observing_ = [];\n this.newObserving_ = [];\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.unboundDepsCount_ = 0;\n this.isDisposed_ = false;\n this.isScheduled_ = false;\n this.isTrackPending_ = false;\n this.isRunning_ = false;\n this.isTracing_ = TraceMode.NONE;\n this.name_ = name_;\n this.onInvalidate_ = onInvalidate_;\n this.errorHandler_ = errorHandler_;\n this.requiresObservable_ = requiresObservable_;\n }\n var _proto = Reaction.prototype;\n _proto.onBecomeStale_ = function onBecomeStale_() {\n this.schedule_();\n };\n _proto.schedule_ = function schedule_() {\n if (!this.isScheduled_) {\n this.isScheduled_ = true;\n globalState.pendingReactions.push(this);\n runReactions();\n }\n };\n _proto.isScheduled = function isScheduled() {\n return this.isScheduled_;\n }\n /**\r\n * internal, use schedule() if you intend to kick off a reaction\r\n */;\n _proto.runReaction_ = function runReaction_() {\n if (!this.isDisposed_) {\n startBatch();\n this.isScheduled_ = false;\n var prev = globalState.trackingContext;\n globalState.trackingContext = this;\n if (shouldCompute(this)) {\n this.isTrackPending_ = true;\n try {\n this.onInvalidate_();\n if (process.env.NODE_ENV !== \"production\" && this.isTrackPending_ && isSpyEnabled()) {\n // onInvalidate didn't trigger track right away..\n spyReport({\n name: this.name_,\n type: \"scheduled-reaction\"\n });\n }\n } catch (e) {\n this.reportExceptionInDerivation_(e);\n }\n }\n globalState.trackingContext = prev;\n endBatch();\n }\n };\n _proto.track = function track(fn) {\n if (this.isDisposed_) {\n return;\n // console.warn(\"Reaction already disposed\") // Note: Not a warning / error in mobx 4 either\n }\n\n startBatch();\n var notify = isSpyEnabled();\n var startTime;\n if (process.env.NODE_ENV !== \"production\" && notify) {\n startTime = Date.now();\n spyReportStart({\n name: this.name_,\n type: \"reaction\"\n });\n }\n this.isRunning_ = true;\n var prevReaction = globalState.trackingContext; // reactions could create reactions...\n globalState.trackingContext = this;\n var result = trackDerivedFunction(this, fn, undefined);\n globalState.trackingContext = prevReaction;\n this.isRunning_ = false;\n this.isTrackPending_ = false;\n if (this.isDisposed_) {\n // disposed during last run. Clean up everything that was bound after the dispose call.\n clearObserving(this);\n }\n if (isCaughtException(result)) {\n this.reportExceptionInDerivation_(result.cause);\n }\n if (process.env.NODE_ENV !== \"production\" && notify) {\n spyReportEnd({\n time: Date.now() - startTime\n });\n }\n endBatch();\n };\n _proto.reportExceptionInDerivation_ = function reportExceptionInDerivation_(error) {\n var _this = this;\n if (this.errorHandler_) {\n this.errorHandler_(error, this);\n return;\n }\n if (globalState.disableErrorBoundaries) {\n throw error;\n }\n var message = process.env.NODE_ENV !== \"production\" ? \"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '\" + this + \"'\" : \"[mobx] uncaught error in '\" + this + \"'\";\n if (!globalState.suppressReactionErrors) {\n console.error(message, error);\n /** If debugging brought you here, please, read the above message :-). Tnx! */\n } else if (process.env.NODE_ENV !== \"production\") {\n console.warn(\"[mobx] (error in reaction '\" + this.name_ + \"' suppressed, fix error of causing action below)\");\n } // prettier-ignore\n if (process.env.NODE_ENV !== \"production\" && isSpyEnabled()) {\n spyReport({\n type: \"error\",\n name: this.name_,\n message: message,\n error: \"\" + error\n });\n }\n globalState.globalReactionErrorHandlers.forEach(function (f) {\n return f(error, _this);\n });\n };\n _proto.dispose = function dispose() {\n if (!this.isDisposed_) {\n this.isDisposed_ = true;\n if (!this.isRunning_) {\n // if disposed while running, clean up later. Maybe not optimal, but rare case\n startBatch();\n clearObserving(this);\n endBatch();\n }\n }\n };\n _proto.getDisposer_ = function getDisposer_(abortSignal) {\n var _this2 = this;\n var dispose = function dispose() {\n _this2.dispose();\n abortSignal == null ? void 0 : abortSignal.removeEventListener == null ? void 0 : abortSignal.removeEventListener(\"abort\", dispose);\n };\n abortSignal == null ? void 0 : abortSignal.addEventListener == null ? void 0 : abortSignal.addEventListener(\"abort\", dispose);\n dispose[$mobx] = this;\n return dispose;\n };\n _proto.toString = function toString() {\n return \"Reaction[\" + this.name_ + \"]\";\n };\n _proto.trace = function trace$1(enterBreakPoint) {\n if (enterBreakPoint === void 0) {\n enterBreakPoint = false;\n }\n trace(this, enterBreakPoint);\n };\n return Reaction;\n}();\nfunction onReactionError(handler) {\n globalState.globalReactionErrorHandlers.push(handler);\n return function () {\n var idx = globalState.globalReactionErrorHandlers.indexOf(handler);\n if (idx >= 0) {\n globalState.globalReactionErrorHandlers.splice(idx, 1);\n }\n };\n}\n/**\r\n * Magic number alert!\r\n * Defines within how many times a reaction is allowed to re-trigger itself\r\n * until it is assumed that this is gonna be a never ending loop...\r\n */\nvar MAX_REACTION_ITERATIONS = 100;\nvar reactionScheduler = function reactionScheduler(f) {\n return f();\n};\nfunction runReactions() {\n // Trampolining, if runReactions are already running, new reactions will be picked up\n if (globalState.inBatch > 0 || globalState.isRunningReactions) {\n return;\n }\n reactionScheduler(runReactionsHelper);\n}\nfunction runReactionsHelper() {\n globalState.isRunningReactions = true;\n var allReactions = globalState.pendingReactions;\n var iterations = 0;\n // While running reactions, new reactions might be triggered.\n // Hence we work with two variables and check whether\n // we converge to no remaining reactions after a while.\n while (allReactions.length > 0) {\n if (++iterations === MAX_REACTION_ITERATIONS) {\n console.error(process.env.NODE_ENV !== \"production\" ? \"Reaction doesn't converge to a stable state after \" + MAX_REACTION_ITERATIONS + \" iterations.\" + (\" Probably there is a cycle in the reactive function: \" + allReactions[0]) : \"[mobx] cycle in reaction: \" + allReactions[0]);\n allReactions.splice(0); // clear reactions\n }\n\n var remainingReactions = allReactions.splice(0);\n for (var i = 0, l = remainingReactions.length; i < l; i++) {\n remainingReactions[i].runReaction_();\n }\n }\n globalState.isRunningReactions = false;\n}\nvar isReaction = /*#__PURE__*/createInstanceofPredicate(\"Reaction\", Reaction);\nfunction setReactionScheduler(fn) {\n var baseScheduler = reactionScheduler;\n reactionScheduler = function reactionScheduler(f) {\n return fn(function () {\n return baseScheduler(f);\n });\n };\n}\n\nfunction isSpyEnabled() {\n return process.env.NODE_ENV !== \"production\" && !!globalState.spyListeners.length;\n}\nfunction spyReport(event) {\n if (!(process.env.NODE_ENV !== \"production\")) {\n return;\n } // dead code elimination can do the rest\n if (!globalState.spyListeners.length) {\n return;\n }\n var listeners = globalState.spyListeners;\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](event);\n }\n}\nfunction spyReportStart(event) {\n if (!(process.env.NODE_ENV !== \"production\")) {\n return;\n }\n var change = _extends({}, event, {\n spyReportStart: true\n });\n spyReport(change);\n}\nvar END_EVENT = {\n type: \"report-end\",\n spyReportEnd: true\n};\nfunction spyReportEnd(change) {\n if (!(process.env.NODE_ENV !== \"production\")) {\n return;\n }\n if (change) {\n spyReport(_extends({}, change, {\n type: \"report-end\",\n spyReportEnd: true\n }));\n } else {\n spyReport(END_EVENT);\n }\n}\nfunction spy(listener) {\n if (!(process.env.NODE_ENV !== \"production\")) {\n console.warn(\"[mobx.spy] Is a no-op in production builds\");\n return function () {};\n } else {\n globalState.spyListeners.push(listener);\n return once(function () {\n globalState.spyListeners = globalState.spyListeners.filter(function (l) {\n return l !== listener;\n });\n });\n }\n}\n\nvar ACTION = \"action\";\nvar ACTION_BOUND = \"action.bound\";\nvar AUTOACTION = \"autoAction\";\nvar AUTOACTION_BOUND = \"autoAction.bound\";\nvar DEFAULT_ACTION_NAME = \"\";\nvar actionAnnotation = /*#__PURE__*/createActionAnnotation(ACTION);\nvar actionBoundAnnotation = /*#__PURE__*/createActionAnnotation(ACTION_BOUND, {\n bound: true\n});\nvar autoActionAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION, {\n autoAction: true\n});\nvar autoActionBoundAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION_BOUND, {\n autoAction: true,\n bound: true\n});\nfunction createActionFactory(autoAction) {\n var res = function action(arg1, arg2) {\n // action(fn() {})\n if (isFunction(arg1)) {\n return createAction(arg1.name || DEFAULT_ACTION_NAME, arg1, autoAction);\n }\n // action(\"name\", fn() {})\n if (isFunction(arg2)) {\n return createAction(arg1, arg2, autoAction);\n }\n // @action\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, autoAction ? autoActionAnnotation : actionAnnotation);\n }\n // action(\"name\") & @action(\"name\")\n if (isStringish(arg1)) {\n return createDecoratorAnnotation(createActionAnnotation(autoAction ? AUTOACTION : ACTION, {\n name: arg1,\n autoAction: autoAction\n }));\n }\n if (process.env.NODE_ENV !== \"production\") {\n die(\"Invalid arguments for `action`\");\n }\n };\n return res;\n}\nvar action = /*#__PURE__*/createActionFactory(false);\nObject.assign(action, actionAnnotation);\nvar autoAction = /*#__PURE__*/createActionFactory(true);\nObject.assign(autoAction, autoActionAnnotation);\naction.bound = /*#__PURE__*/createDecoratorAnnotation(actionBoundAnnotation);\nautoAction.bound = /*#__PURE__*/createDecoratorAnnotation(autoActionBoundAnnotation);\nfunction runInAction(fn) {\n return executeAction(fn.name || DEFAULT_ACTION_NAME, false, fn, this, undefined);\n}\nfunction isAction(thing) {\n return isFunction(thing) && thing.isMobxAction === true;\n}\n\n/**\r\n * Creates a named reactive view and keeps it alive, so that the view is always\r\n * updated if one of the dependencies changes, even when the view is not further used by something else.\r\n * @param view The reactive view\r\n * @returns disposer function, which can be used to stop the view from being updated in the future.\r\n */\nfunction autorun(view, opts) {\n var _opts$name, _opts, _opts2, _opts2$signal, _opts3;\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n if (process.env.NODE_ENV !== \"production\") {\n if (!isFunction(view)) {\n die(\"Autorun expects a function as first argument\");\n }\n if (isAction(view)) {\n die(\"Autorun does not accept actions since actions are untrackable\");\n }\n }\n var name = (_opts$name = (_opts = opts) == null ? void 0 : _opts.name) != null ? _opts$name : process.env.NODE_ENV !== \"production\" ? view.name || \"Autorun@\" + getNextId() : \"Autorun\";\n var runSync = !opts.scheduler && !opts.delay;\n var reaction;\n if (runSync) {\n // normal autorun\n reaction = new Reaction(name, function () {\n this.track(reactionRunner);\n }, opts.onError, opts.requiresObservable);\n } else {\n var scheduler = createSchedulerFromOptions(opts);\n // debounced autorun\n var isScheduled = false;\n reaction = new Reaction(name, function () {\n if (!isScheduled) {\n isScheduled = true;\n scheduler(function () {\n isScheduled = false;\n if (!reaction.isDisposed_) {\n reaction.track(reactionRunner);\n }\n });\n }\n }, opts.onError, opts.requiresObservable);\n }\n function reactionRunner() {\n view(reaction);\n }\n if (!((_opts2 = opts) != null && (_opts2$signal = _opts2.signal) != null && _opts2$signal.aborted)) {\n reaction.schedule_();\n }\n return reaction.getDisposer_((_opts3 = opts) == null ? void 0 : _opts3.signal);\n}\nvar run = function run(f) {\n return f();\n};\nfunction createSchedulerFromOptions(opts) {\n return opts.scheduler ? opts.scheduler : opts.delay ? function (f) {\n return setTimeout(f, opts.delay);\n } : run;\n}\nfunction reaction(expression, effect, opts) {\n var _opts$name2, _opts4, _opts4$signal, _opts5;\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n if (process.env.NODE_ENV !== \"production\") {\n if (!isFunction(expression) || !isFunction(effect)) {\n die(\"First and second argument to reaction should be functions\");\n }\n if (!isPlainObject(opts)) {\n die(\"Third argument of reactions should be an object\");\n }\n }\n var name = (_opts$name2 = opts.name) != null ? _opts$name2 : process.env.NODE_ENV !== \"production\" ? \"Reaction@\" + getNextId() : \"Reaction\";\n var effectAction = action(name, opts.onError ? wrapErrorHandler(opts.onError, effect) : effect);\n var runSync = !opts.scheduler && !opts.delay;\n var scheduler = createSchedulerFromOptions(opts);\n var firstTime = true;\n var isScheduled = false;\n var value;\n var oldValue;\n var equals = opts.compareStructural ? comparer.structural : opts.equals || comparer[\"default\"];\n var r = new Reaction(name, function () {\n if (firstTime || runSync) {\n reactionRunner();\n } else if (!isScheduled) {\n isScheduled = true;\n scheduler(reactionRunner);\n }\n }, opts.onError, opts.requiresObservable);\n function reactionRunner() {\n isScheduled = false;\n if (r.isDisposed_) {\n return;\n }\n var changed = false;\n r.track(function () {\n var nextValue = allowStateChanges(false, function () {\n return expression(r);\n });\n changed = firstTime || !equals(value, nextValue);\n oldValue = value;\n value = nextValue;\n });\n if (firstTime && opts.fireImmediately) {\n effectAction(value, oldValue, r);\n } else if (!firstTime && changed) {\n effectAction(value, oldValue, r);\n }\n firstTime = false;\n }\n if (!((_opts4 = opts) != null && (_opts4$signal = _opts4.signal) != null && _opts4$signal.aborted)) {\n r.schedule_();\n }\n return r.getDisposer_((_opts5 = opts) == null ? void 0 : _opts5.signal);\n}\nfunction wrapErrorHandler(errorHandler, baseFn) {\n return function () {\n try {\n return baseFn.apply(this, arguments);\n } catch (e) {\n errorHandler.call(this, e);\n }\n };\n}\n\nvar ON_BECOME_OBSERVED = \"onBO\";\nvar ON_BECOME_UNOBSERVED = \"onBUO\";\nfunction onBecomeObserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_OBSERVED, thing, arg2, arg3);\n}\nfunction onBecomeUnobserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_UNOBSERVED, thing, arg2, arg3);\n}\nfunction interceptHook(hook, thing, arg2, arg3) {\n var atom = typeof arg3 === \"function\" ? getAtom(thing, arg2) : getAtom(thing);\n var cb = isFunction(arg3) ? arg3 : arg2;\n var listenersKey = hook + \"L\";\n if (atom[listenersKey]) {\n atom[listenersKey].add(cb);\n } else {\n atom[listenersKey] = new Set([cb]);\n }\n return function () {\n var hookListeners = atom[listenersKey];\n if (hookListeners) {\n hookListeners[\"delete\"](cb);\n if (hookListeners.size === 0) {\n delete atom[listenersKey];\n }\n }\n };\n}\n\nvar NEVER = \"never\";\nvar ALWAYS = \"always\";\nvar OBSERVED = \"observed\";\n// const IF_AVAILABLE = \"ifavailable\"\nfunction configure(options) {\n if (options.isolateGlobalState === true) {\n isolateGlobalState();\n }\n var useProxies = options.useProxies,\n enforceActions = options.enforceActions;\n if (useProxies !== undefined) {\n globalState.useProxies = useProxies === ALWAYS ? true : useProxies === NEVER ? false : typeof Proxy !== \"undefined\";\n }\n if (useProxies === \"ifavailable\") {\n globalState.verifyProxies = true;\n }\n if (enforceActions !== undefined) {\n var ea = enforceActions === ALWAYS ? ALWAYS : enforceActions === OBSERVED;\n globalState.enforceActions = ea;\n globalState.allowStateChanges = ea === true || ea === ALWAYS ? false : true;\n }\n [\"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"disableErrorBoundaries\", \"safeDescriptors\"].forEach(function (key) {\n if (key in options) {\n globalState[key] = !!options[key];\n }\n });\n globalState.allowStateReads = !globalState.observableRequiresReaction;\n if (process.env.NODE_ENV !== \"production\" && globalState.disableErrorBoundaries === true) {\n console.warn(\"WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled.\");\n }\n if (options.reactionScheduler) {\n setReactionScheduler(options.reactionScheduler);\n }\n}\n\nfunction extendObservable(target, properties, annotations, options) {\n if (process.env.NODE_ENV !== \"production\") {\n if (arguments.length > 4) {\n die(\"'extendObservable' expected 2-4 arguments\");\n }\n if (typeof target !== \"object\") {\n die(\"'extendObservable' expects an object as first argument\");\n }\n if (isObservableMap(target)) {\n die(\"'extendObservable' should not be used on maps, use map.merge instead\");\n }\n if (!isPlainObject(properties)) {\n die(\"'extendObservable' only accepts plain objects as second argument\");\n }\n if (isObservable(properties) || isObservable(annotations)) {\n die(\"Extending an object with another observable (object) is not supported\");\n }\n }\n // Pull descriptors first, so we don't have to deal with props added by administration ($mobx)\n var descriptors = getOwnPropertyDescriptors(properties);\n var adm = asObservableObject(target, options)[$mobx];\n startBatch();\n try {\n ownKeys(descriptors).forEach(function (key) {\n adm.extend_(key, descriptors[key],\n // must pass \"undefined\" for { key: undefined }\n !annotations ? true : key in annotations ? annotations[key] : true);\n });\n } finally {\n endBatch();\n }\n return target;\n}\n\nfunction getDependencyTree(thing, property) {\n return nodeToDependencyTree(getAtom(thing, property));\n}\nfunction nodeToDependencyTree(node) {\n var result = {\n name: node.name_\n };\n if (node.observing_ && node.observing_.length > 0) {\n result.dependencies = unique(node.observing_).map(nodeToDependencyTree);\n }\n return result;\n}\nfunction getObserverTree(thing, property) {\n return nodeToObserverTree(getAtom(thing, property));\n}\nfunction nodeToObserverTree(node) {\n var result = {\n name: node.name_\n };\n if (hasObservers(node)) {\n result.observers = Array.from(getObservers(node)).map(nodeToObserverTree);\n }\n return result;\n}\nfunction unique(list) {\n return Array.from(new Set(list));\n}\n\nvar generatorId = 0;\nfunction FlowCancellationError() {\n this.message = \"FLOW_CANCELLED\";\n}\nFlowCancellationError.prototype = /*#__PURE__*/Object.create(Error.prototype);\nfunction isFlowCancellationError(error) {\n return error instanceof FlowCancellationError;\n}\nvar flowAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow\");\nvar flowBoundAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow.bound\", {\n bound: true\n});\nvar flow = /*#__PURE__*/Object.assign(function flow(arg1, arg2) {\n // @flow\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, flowAnnotation);\n }\n // flow(fn)\n if (process.env.NODE_ENV !== \"production\" && arguments.length !== 1) {\n die(\"Flow expects single argument with generator function\");\n }\n var generator = arg1;\n var name = generator.name || \"\";\n // Implementation based on https://github.com/tj/co/blob/master/index.js\n var res = function res() {\n var ctx = this;\n var args = arguments;\n var runId = ++generatorId;\n var gen = action(name + \" - runid: \" + runId + \" - init\", generator).apply(ctx, args);\n var rejector;\n var pendingPromise = undefined;\n var promise = new Promise(function (resolve, reject) {\n var stepId = 0;\n rejector = reject;\n function onFulfilled(res) {\n pendingPromise = undefined;\n var ret;\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen.next).call(gen, res);\n } catch (e) {\n return reject(e);\n }\n next(ret);\n }\n function onRejected(err) {\n pendingPromise = undefined;\n var ret;\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen[\"throw\"]).call(gen, err);\n } catch (e) {\n return reject(e);\n }\n next(ret);\n }\n function next(ret) {\n if (isFunction(ret == null ? void 0 : ret.then)) {\n // an async iterator\n ret.then(next, reject);\n return;\n }\n if (ret.done) {\n return resolve(ret.value);\n }\n pendingPromise = Promise.resolve(ret.value);\n return pendingPromise.then(onFulfilled, onRejected);\n }\n onFulfilled(undefined); // kick off the process\n });\n\n promise.cancel = action(name + \" - runid: \" + runId + \" - cancel\", function () {\n try {\n if (pendingPromise) {\n cancelPromise(pendingPromise);\n }\n // Finally block can return (or yield) stuff..\n var _res = gen[\"return\"](undefined);\n // eat anything that promise would do, it's cancelled!\n var yieldedPromise = Promise.resolve(_res.value);\n yieldedPromise.then(noop, noop);\n cancelPromise(yieldedPromise); // maybe it can be cancelled :)\n // reject our original promise\n rejector(new FlowCancellationError());\n } catch (e) {\n rejector(e); // there could be a throwing finally block\n }\n });\n\n return promise;\n };\n res.isMobXFlow = true;\n return res;\n}, flowAnnotation);\nflow.bound = /*#__PURE__*/createDecoratorAnnotation(flowBoundAnnotation);\nfunction cancelPromise(promise) {\n if (isFunction(promise.cancel)) {\n promise.cancel();\n }\n}\nfunction flowResult(result) {\n return result; // just tricking TypeScript :)\n}\n\nfunction isFlow(fn) {\n return (fn == null ? void 0 : fn.isMobXFlow) === true;\n}\n\nfunction interceptReads(thing, propOrHandler, handler) {\n var target;\n if (isObservableMap(thing) || isObservableArray(thing) || isObservableValue(thing)) {\n target = getAdministration(thing);\n } else if (isObservableObject(thing)) {\n if (process.env.NODE_ENV !== \"production\" && !isStringish(propOrHandler)) {\n return die(\"InterceptReads can only be used with a specific property, not with an object in general\");\n }\n target = getAdministration(thing, propOrHandler);\n } else if (process.env.NODE_ENV !== \"production\") {\n return die(\"Expected observable map, object or array as first array\");\n }\n if (process.env.NODE_ENV !== \"production\" && target.dehancer !== undefined) {\n return die(\"An intercept reader was already established\");\n }\n target.dehancer = typeof propOrHandler === \"function\" ? propOrHandler : handler;\n return function () {\n target.dehancer = undefined;\n };\n}\n\nfunction intercept(thing, propOrHandler, handler) {\n if (isFunction(handler)) {\n return interceptProperty(thing, propOrHandler, handler);\n } else {\n return interceptInterceptable(thing, propOrHandler);\n }\n}\nfunction interceptInterceptable(thing, handler) {\n return getAdministration(thing).intercept_(handler);\n}\nfunction interceptProperty(thing, property, handler) {\n return getAdministration(thing, property).intercept_(handler);\n}\n\nfunction _isComputed(value, property) {\n if (property === undefined) {\n return isComputedValue(value);\n }\n if (isObservableObject(value) === false) {\n return false;\n }\n if (!value[$mobx].values_.has(property)) {\n return false;\n }\n var atom = getAtom(value, property);\n return isComputedValue(atom);\n}\nfunction isComputed(value) {\n if (process.env.NODE_ENV !== \"production\" && arguments.length > 1) {\n return die(\"isComputed expects only 1 argument. Use isComputedProp to inspect the observability of a property\");\n }\n return _isComputed(value);\n}\nfunction isComputedProp(value, propName) {\n if (process.env.NODE_ENV !== \"production\" && !isStringish(propName)) {\n return die(\"isComputed expected a property name as second argument\");\n }\n return _isComputed(value, propName);\n}\n\nfunction _isObservable(value, property) {\n if (!value) {\n return false;\n }\n if (property !== undefined) {\n if (process.env.NODE_ENV !== \"production\" && (isObservableMap(value) || isObservableArray(value))) {\n return die(\"isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.\");\n }\n if (isObservableObject(value)) {\n return value[$mobx].values_.has(property);\n }\n return false;\n }\n // For first check, see #701\n return isObservableObject(value) || !!value[$mobx] || isAtom(value) || isReaction(value) || isComputedValue(value);\n}\nfunction isObservable(value) {\n if (process.env.NODE_ENV !== \"production\" && arguments.length !== 1) {\n die(\"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property\");\n }\n return _isObservable(value);\n}\nfunction isObservableProp(value, propName) {\n if (process.env.NODE_ENV !== \"production\" && !isStringish(propName)) {\n return die(\"expected a property name as second argument\");\n }\n return _isObservable(value, propName);\n}\n\nfunction keys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].keys_();\n }\n if (isObservableMap(obj) || isObservableSet(obj)) {\n return Array.from(obj.keys());\n }\n if (isObservableArray(obj)) {\n return obj.map(function (_, index) {\n return index;\n });\n }\n die(5);\n}\nfunction values(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return obj[key];\n });\n }\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return obj.get(key);\n });\n }\n if (isObservableSet(obj)) {\n return Array.from(obj.values());\n }\n if (isObservableArray(obj)) {\n return obj.slice();\n }\n die(6);\n}\nfunction entries(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj[key]];\n });\n }\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj.get(key)];\n });\n }\n if (isObservableSet(obj)) {\n return Array.from(obj.entries());\n }\n if (isObservableArray(obj)) {\n return obj.map(function (key, index) {\n return [index, key];\n });\n }\n die(7);\n}\nfunction set(obj, key, value) {\n if (arguments.length === 2 && !isObservableSet(obj)) {\n startBatch();\n var _values = key;\n try {\n for (var _key in _values) {\n set(obj, _key, _values[_key]);\n }\n } finally {\n endBatch();\n }\n return;\n }\n if (isObservableObject(obj)) {\n obj[$mobx].set_(key, value);\n } else if (isObservableMap(obj)) {\n obj.set(key, value);\n } else if (isObservableSet(obj)) {\n obj.add(key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n if (key < 0) {\n die(\"Invalid index: '\" + key + \"'\");\n }\n startBatch();\n if (key >= obj.length) {\n obj.length = key + 1;\n }\n obj[key] = value;\n endBatch();\n } else {\n die(8);\n }\n}\nfunction remove(obj, key) {\n if (isObservableObject(obj)) {\n obj[$mobx].delete_(key);\n } else if (isObservableMap(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableSet(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n obj.splice(key, 1);\n } else {\n die(9);\n }\n}\nfunction has(obj, key) {\n if (isObservableObject(obj)) {\n return obj[$mobx].has_(key);\n } else if (isObservableMap(obj)) {\n return obj.has(key);\n } else if (isObservableSet(obj)) {\n return obj.has(key);\n } else if (isObservableArray(obj)) {\n return key >= 0 && key < obj.length;\n }\n die(10);\n}\nfunction get(obj, key) {\n if (!has(obj, key)) {\n return undefined;\n }\n if (isObservableObject(obj)) {\n return obj[$mobx].get_(key);\n } else if (isObservableMap(obj)) {\n return obj.get(key);\n } else if (isObservableArray(obj)) {\n return obj[key];\n }\n die(11);\n}\nfunction apiDefineProperty(obj, key, descriptor) {\n if (isObservableObject(obj)) {\n return obj[$mobx].defineProperty_(key, descriptor);\n }\n die(39);\n}\nfunction apiOwnKeys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].ownKeys_();\n }\n die(38);\n}\n\nfunction observe(thing, propOrCb, cbOrFire, fireImmediately) {\n if (isFunction(cbOrFire)) {\n return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately);\n } else {\n return observeObservable(thing, propOrCb, cbOrFire);\n }\n}\nfunction observeObservable(thing, listener, fireImmediately) {\n return getAdministration(thing).observe_(listener, fireImmediately);\n}\nfunction observeObservableProperty(thing, property, listener, fireImmediately) {\n return getAdministration(thing, property).observe_(listener, fireImmediately);\n}\n\nfunction cache(map, key, value) {\n map.set(key, value);\n return value;\n}\nfunction toJSHelper(source, __alreadySeen) {\n if (source == null || typeof source !== \"object\" || source instanceof Date || !isObservable(source)) {\n return source;\n }\n if (isObservableValue(source) || isComputedValue(source)) {\n return toJSHelper(source.get(), __alreadySeen);\n }\n if (__alreadySeen.has(source)) {\n return __alreadySeen.get(source);\n }\n if (isObservableArray(source)) {\n var res = cache(__alreadySeen, source, new Array(source.length));\n source.forEach(function (value, idx) {\n res[idx] = toJSHelper(value, __alreadySeen);\n });\n return res;\n }\n if (isObservableSet(source)) {\n var _res = cache(__alreadySeen, source, new Set());\n source.forEach(function (value) {\n _res.add(toJSHelper(value, __alreadySeen));\n });\n return _res;\n }\n if (isObservableMap(source)) {\n var _res2 = cache(__alreadySeen, source, new Map());\n source.forEach(function (value, key) {\n _res2.set(key, toJSHelper(value, __alreadySeen));\n });\n return _res2;\n } else {\n // must be observable object\n var _res3 = cache(__alreadySeen, source, {});\n apiOwnKeys(source).forEach(function (key) {\n if (objectPrototype.propertyIsEnumerable.call(source, key)) {\n _res3[key] = toJSHelper(source[key], __alreadySeen);\n }\n });\n return _res3;\n }\n}\n/**\r\n * Recursively converts an observable to it's non-observable native counterpart.\r\n * It does NOT recurse into non-observables, these are left as they are, even if they contain observables.\r\n * Computed and other non-enumerable properties are completely ignored.\r\n * Complex scenarios require custom solution, eg implementing `toJSON` or using `serializr` lib.\r\n */\nfunction toJS(source, options) {\n if (process.env.NODE_ENV !== \"production\" && options) {\n die(\"toJS no longer supports options\");\n }\n return toJSHelper(source, new Map());\n}\n\nfunction trace() {\n if (!(process.env.NODE_ENV !== \"production\")) {\n return;\n }\n var enterBreakPoint = false;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n if (typeof args[args.length - 1] === \"boolean\") {\n enterBreakPoint = args.pop();\n }\n var derivation = getAtomFromArgs(args);\n if (!derivation) {\n return die(\"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly\");\n }\n if (derivation.isTracing_ === TraceMode.NONE) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' tracing enabled\");\n }\n derivation.isTracing_ = enterBreakPoint ? TraceMode.BREAK : TraceMode.LOG;\n}\nfunction getAtomFromArgs(args) {\n switch (args.length) {\n case 0:\n return globalState.trackingDerivation;\n case 1:\n return getAtom(args[0]);\n case 2:\n return getAtom(args[0], args[1]);\n }\n}\n\n/**\r\n * During a transaction no views are updated until the end of the transaction.\r\n * The transaction will be run synchronously nonetheless.\r\n *\r\n * @param action a function that updates some reactive state\r\n * @returns any value that was returned by the 'action' parameter.\r\n */\nfunction transaction(action, thisArg) {\n if (thisArg === void 0) {\n thisArg = undefined;\n }\n startBatch();\n try {\n return action.apply(thisArg);\n } finally {\n endBatch();\n }\n}\n\nfunction when(predicate, arg1, arg2) {\n if (arguments.length === 1 || arg1 && typeof arg1 === \"object\") {\n return whenPromise(predicate, arg1);\n }\n return _when(predicate, arg1, arg2 || {});\n}\nfunction _when(predicate, effect, opts) {\n var timeoutHandle;\n if (typeof opts.timeout === \"number\") {\n var error = new Error(\"WHEN_TIMEOUT\");\n timeoutHandle = setTimeout(function () {\n if (!disposer[$mobx].isDisposed_) {\n disposer();\n if (opts.onError) {\n opts.onError(error);\n } else {\n throw error;\n }\n }\n }, opts.timeout);\n }\n opts.name = process.env.NODE_ENV !== \"production\" ? opts.name || \"When@\" + getNextId() : \"When\";\n var effectAction = createAction(process.env.NODE_ENV !== \"production\" ? opts.name + \"-effect\" : \"When-effect\", effect);\n // eslint-disable-next-line\n var disposer = autorun(function (r) {\n // predicate should not change state\n var cond = allowStateChanges(false, predicate);\n if (cond) {\n r.dispose();\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n effectAction();\n }\n }, opts);\n return disposer;\n}\nfunction whenPromise(predicate, opts) {\n var _opts$signal;\n if (process.env.NODE_ENV !== \"production\" && opts && opts.onError) {\n return die(\"the options 'onError' and 'promise' cannot be combined\");\n }\n if (opts != null && (_opts$signal = opts.signal) != null && _opts$signal.aborted) {\n return Object.assign(Promise.reject(new Error(\"WHEN_ABORTED\")), {\n cancel: function cancel() {\n return null;\n }\n });\n }\n var cancel;\n var abort;\n var res = new Promise(function (resolve, reject) {\n var _opts$signal2;\n var disposer = _when(predicate, resolve, _extends({}, opts, {\n onError: reject\n }));\n cancel = function cancel() {\n disposer();\n reject(new Error(\"WHEN_CANCELLED\"));\n };\n abort = function abort() {\n disposer();\n reject(new Error(\"WHEN_ABORTED\"));\n };\n opts == null ? void 0 : (_opts$signal2 = opts.signal) == null ? void 0 : _opts$signal2.addEventListener == null ? void 0 : _opts$signal2.addEventListener(\"abort\", abort);\n })[\"finally\"](function () {\n var _opts$signal3;\n return opts == null ? void 0 : (_opts$signal3 = opts.signal) == null ? void 0 : _opts$signal3.removeEventListener == null ? void 0 : _opts$signal3.removeEventListener(\"abort\", abort);\n });\n res.cancel = cancel;\n return res;\n}\n\nfunction getAdm(target) {\n return target[$mobx];\n}\n// Optimization: we don't need the intermediate objects and could have a completely custom administration for DynamicObjects,\n// and skip either the internal values map, or the base object with its property descriptors!\nvar objectProxyTraps = {\n has: function has(target, name) {\n if (process.env.NODE_ENV !== \"production\" && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"detect new properties using the 'in' operator. Use 'has' from 'mobx' instead.\");\n }\n return getAdm(target).has_(name);\n },\n get: function get(target, name) {\n return getAdm(target).get_(name);\n },\n set: function set(target, name, value) {\n var _getAdm$set_;\n if (!isStringish(name)) {\n return false;\n }\n if (process.env.NODE_ENV !== \"production\" && !getAdm(target).values_.has(name)) {\n warnAboutProxyRequirement(\"add a new observable property through direct assignment. Use 'set' from 'mobx' instead.\");\n }\n // null (intercepted) -> true (success)\n return (_getAdm$set_ = getAdm(target).set_(name, value, true)) != null ? _getAdm$set_ : true;\n },\n deleteProperty: function deleteProperty(target, name) {\n var _getAdm$delete_;\n if (process.env.NODE_ENV !== \"production\") {\n warnAboutProxyRequirement(\"delete properties from an observable object. Use 'remove' from 'mobx' instead.\");\n }\n if (!isStringish(name)) {\n return false;\n }\n // null (intercepted) -> true (success)\n return (_getAdm$delete_ = getAdm(target).delete_(name, true)) != null ? _getAdm$delete_ : true;\n },\n defineProperty: function defineProperty(target, name, descriptor) {\n var _getAdm$definePropert;\n if (process.env.NODE_ENV !== \"production\") {\n warnAboutProxyRequirement(\"define property on an observable object. Use 'defineProperty' from 'mobx' instead.\");\n }\n // null (intercepted) -> true (success)\n return (_getAdm$definePropert = getAdm(target).defineProperty_(name, descriptor)) != null ? _getAdm$definePropert : true;\n },\n ownKeys: function ownKeys(target) {\n if (process.env.NODE_ENV !== \"production\" && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead.\");\n }\n return getAdm(target).ownKeys_();\n },\n preventExtensions: function preventExtensions(target) {\n die(13);\n }\n};\nfunction asDynamicObservableObject(target, options) {\n var _target$$mobx, _target$$mobx$proxy_;\n assertProxies();\n target = asObservableObject(target, options);\n return (_target$$mobx$proxy_ = (_target$$mobx = target[$mobx]).proxy_) != null ? _target$$mobx$proxy_ : _target$$mobx.proxy_ = new Proxy(target, objectProxyTraps);\n}\n\nfunction hasInterceptors(interceptable) {\n return interceptable.interceptors_ !== undefined && interceptable.interceptors_.length > 0;\n}\nfunction registerInterceptor(interceptable, handler) {\n var interceptors = interceptable.interceptors_ || (interceptable.interceptors_ = []);\n interceptors.push(handler);\n return once(function () {\n var idx = interceptors.indexOf(handler);\n if (idx !== -1) {\n interceptors.splice(idx, 1);\n }\n });\n}\nfunction interceptChange(interceptable, change) {\n var prevU = untrackedStart();\n try {\n // Interceptor can modify the array, copy it to avoid concurrent modification, see #1950\n var interceptors = [].concat(interceptable.interceptors_ || []);\n for (var i = 0, l = interceptors.length; i < l; i++) {\n change = interceptors[i](change);\n if (change && !change.type) {\n die(14);\n }\n if (!change) {\n break;\n }\n }\n return change;\n } finally {\n untrackedEnd(prevU);\n }\n}\n\nfunction hasListeners(listenable) {\n return listenable.changeListeners_ !== undefined && listenable.changeListeners_.length > 0;\n}\nfunction registerListener(listenable, handler) {\n var listeners = listenable.changeListeners_ || (listenable.changeListeners_ = []);\n listeners.push(handler);\n return once(function () {\n var idx = listeners.indexOf(handler);\n if (idx !== -1) {\n listeners.splice(idx, 1);\n }\n });\n}\nfunction notifyListeners(listenable, change) {\n var prevU = untrackedStart();\n var listeners = listenable.changeListeners_;\n if (!listeners) {\n return;\n }\n listeners = listeners.slice();\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](change);\n }\n untrackedEnd(prevU);\n}\n\nfunction makeObservable(target, annotations, options) {\n var adm = asObservableObject(target, options)[$mobx];\n startBatch();\n try {\n var _annotations;\n if (process.env.NODE_ENV !== \"production\" && annotations && target[storedAnnotationsSymbol]) {\n die(\"makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported.\");\n }\n // Default to decorators\n (_annotations = annotations) != null ? _annotations : annotations = collectStoredAnnotations(target);\n // Annotate\n ownKeys(annotations).forEach(function (key) {\n return adm.make_(key, annotations[key]);\n });\n } finally {\n endBatch();\n }\n return target;\n}\n// proto[keysSymbol] = new Set()\nvar keysSymbol = /*#__PURE__*/Symbol(\"mobx-keys\");\nfunction makeAutoObservable(target, overrides, options) {\n if (process.env.NODE_ENV !== \"production\") {\n if (!isPlainObject(target) && !isPlainObject(Object.getPrototypeOf(target))) {\n die(\"'makeAutoObservable' can only be used for classes that don't have a superclass\");\n }\n if (isObservableObject(target)) {\n die(\"makeAutoObservable can only be used on objects not already made observable\");\n }\n }\n // Optimization: avoid visiting protos\n // Assumes that annotation.make_/.extend_ works the same for plain objects\n if (isPlainObject(target)) {\n return extendObservable(target, target, overrides, options);\n }\n var adm = asObservableObject(target, options)[$mobx];\n // Optimization: cache keys on proto\n // Assumes makeAutoObservable can be called only once per object and can't be used in subclass\n if (!target[keysSymbol]) {\n var proto = Object.getPrototypeOf(target);\n var keys = new Set([].concat(ownKeys(target), ownKeys(proto)));\n keys[\"delete\"](\"constructor\");\n keys[\"delete\"]($mobx);\n addHiddenProp(proto, keysSymbol, keys);\n }\n startBatch();\n try {\n target[keysSymbol].forEach(function (key) {\n return adm.make_(key,\n // must pass \"undefined\" for { key: undefined }\n !overrides ? true : key in overrides ? overrides[key] : true);\n });\n } finally {\n endBatch();\n }\n return target;\n}\n\nvar SPLICE = \"splice\";\nvar UPDATE = \"update\";\nvar MAX_SPLICE_SIZE = 10000; // See e.g. https://github.com/mobxjs/mobx/issues/859\nvar arrayTraps = {\n get: function get(target, name) {\n var adm = target[$mobx];\n if (name === $mobx) {\n return adm;\n }\n if (name === \"length\") {\n return adm.getArrayLength_();\n }\n if (typeof name === \"string\" && !isNaN(name)) {\n return adm.get_(parseInt(name));\n }\n if (hasProp(arrayExtensions, name)) {\n return arrayExtensions[name];\n }\n return target[name];\n },\n set: function set(target, name, value) {\n var adm = target[$mobx];\n if (name === \"length\") {\n adm.setArrayLength_(value);\n }\n if (typeof name === \"symbol\" || isNaN(name)) {\n target[name] = value;\n } else {\n // numeric string\n adm.set_(parseInt(name), value);\n }\n return true;\n },\n preventExtensions: function preventExtensions() {\n die(15);\n }\n};\nvar ObservableArrayAdministration = /*#__PURE__*/function () {\n // this is the prop that gets proxied, so can't replace it!\n\n function ObservableArrayAdministration(name, enhancer, owned_, legacyMode_) {\n if (name === void 0) {\n name = process.env.NODE_ENV !== \"production\" ? \"ObservableArray@\" + getNextId() : \"ObservableArray\";\n }\n this.owned_ = void 0;\n this.legacyMode_ = void 0;\n this.atom_ = void 0;\n this.values_ = [];\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.enhancer_ = void 0;\n this.dehancer = void 0;\n this.proxy_ = void 0;\n this.lastKnownLength_ = 0;\n this.owned_ = owned_;\n this.legacyMode_ = legacyMode_;\n this.atom_ = new Atom(name);\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, process.env.NODE_ENV !== \"production\" ? name + \"[..]\" : \"ObservableArray[..]\");\n };\n }\n var _proto = ObservableArrayAdministration.prototype;\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.dehanceValues_ = function dehanceValues_(values) {\n if (this.dehancer !== undefined && values.length > 0) {\n return values.map(this.dehancer);\n }\n return values;\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately === void 0) {\n fireImmediately = false;\n }\n if (fireImmediately) {\n listener({\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: \"splice\",\n index: 0,\n added: this.values_.slice(),\n addedCount: this.values_.length,\n removed: [],\n removedCount: 0\n });\n }\n return registerListener(this, listener);\n };\n _proto.getArrayLength_ = function getArrayLength_() {\n this.atom_.reportObserved();\n return this.values_.length;\n };\n _proto.setArrayLength_ = function setArrayLength_(newLength) {\n if (typeof newLength !== \"number\" || isNaN(newLength) || newLength < 0) {\n die(\"Out of range: \" + newLength);\n }\n var currentLength = this.values_.length;\n if (newLength === currentLength) {\n return;\n } else if (newLength > currentLength) {\n var newItems = new Array(newLength - currentLength);\n for (var i = 0; i < newLength - currentLength; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n this.spliceWithArray_(currentLength, 0, newItems);\n } else {\n this.spliceWithArray_(newLength, currentLength - newLength);\n }\n };\n _proto.updateArrayLength_ = function updateArrayLength_(oldLength, delta) {\n if (oldLength !== this.lastKnownLength_) {\n die(16);\n }\n this.lastKnownLength_ += delta;\n if (this.legacyMode_ && delta > 0) {\n reserveArrayBuffer(oldLength + delta + 1);\n }\n };\n _proto.spliceWithArray_ = function spliceWithArray_(index, deleteCount, newItems) {\n var _this = this;\n checkIfStateModificationsAreAllowed(this.atom_);\n var length = this.values_.length;\n if (index === undefined) {\n index = 0;\n } else if (index > length) {\n index = length;\n } else if (index < 0) {\n index = Math.max(0, length + index);\n }\n if (arguments.length === 1) {\n deleteCount = length - index;\n } else if (deleteCount === undefined || deleteCount === null) {\n deleteCount = 0;\n } else {\n deleteCount = Math.max(0, Math.min(deleteCount, length - index));\n }\n if (newItems === undefined) {\n newItems = EMPTY_ARRAY;\n }\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_,\n type: SPLICE,\n index: index,\n removedCount: deleteCount,\n added: newItems\n });\n if (!change) {\n return EMPTY_ARRAY;\n }\n deleteCount = change.removedCount;\n newItems = change.added;\n }\n newItems = newItems.length === 0 ? newItems : newItems.map(function (v) {\n return _this.enhancer_(v, undefined);\n });\n if (this.legacyMode_ || process.env.NODE_ENV !== \"production\") {\n var lengthDelta = newItems.length - deleteCount;\n this.updateArrayLength_(length, lengthDelta); // checks if internal array wasn't modified\n }\n\n var res = this.spliceItemsIntoValues_(index, deleteCount, newItems);\n if (deleteCount !== 0 || newItems.length !== 0) {\n this.notifyArraySplice_(index, newItems, res);\n }\n return this.dehanceValues_(res);\n };\n _proto.spliceItemsIntoValues_ = function spliceItemsIntoValues_(index, deleteCount, newItems) {\n if (newItems.length < MAX_SPLICE_SIZE) {\n var _this$values_;\n return (_this$values_ = this.values_).splice.apply(_this$values_, [index, deleteCount].concat(newItems));\n } else {\n // The items removed by the splice\n var res = this.values_.slice(index, index + deleteCount);\n // The items that that should remain at the end of the array\n var oldItems = this.values_.slice(index + deleteCount);\n // New length is the previous length + addition count - deletion count\n this.values_.length += newItems.length - deleteCount;\n for (var i = 0; i < newItems.length; i++) {\n this.values_[index + i] = newItems[i];\n }\n for (var _i = 0; _i < oldItems.length; _i++) {\n this.values_[index + newItems.length + _i] = oldItems[_i];\n }\n return res;\n }\n };\n _proto.notifyArrayChildUpdate_ = function notifyArrayChildUpdate_(index, newValue, oldValue) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n type: UPDATE,\n debugObjectName: this.atom_.name_,\n index: index,\n newValue: newValue,\n oldValue: oldValue\n } : null;\n // The reason why this is on right hand side here (and not above), is this way the uglifier will drop it, but it won't\n // cause any runtime overhead in development mode without NODE_ENV set, unless spying is enabled\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportStart(change);\n }\n this.atom_.reportChanged();\n if (notify) {\n notifyListeners(this, change);\n }\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportEnd();\n }\n };\n _proto.notifyArraySplice_ = function notifyArraySplice_(index, added, removed) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: SPLICE,\n index: index,\n removed: removed,\n added: added,\n removedCount: removed.length,\n addedCount: added.length\n } : null;\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportStart(change);\n }\n this.atom_.reportChanged();\n // conform: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/observe\n if (notify) {\n notifyListeners(this, change);\n }\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportEnd();\n }\n };\n _proto.get_ = function get_(index) {\n if (this.legacyMode_ && index >= this.values_.length) {\n console.warn(process.env.NODE_ENV !== \"production\" ? \"[mobx.array] Attempt to read an array index (\" + index + \") that is out of bounds (\" + this.values_.length + \"). Please check length first. Out of bound indices will not be tracked by MobX\" : \"[mobx] Out of bounds read: \" + index);\n return undefined;\n }\n this.atom_.reportObserved();\n return this.dehanceValue_(this.values_[index]);\n };\n _proto.set_ = function set_(index, newValue) {\n var values = this.values_;\n if (this.legacyMode_ && index > values.length) {\n // out of bounds\n die(17, index, values.length);\n }\n if (index < values.length) {\n // update at index in range\n checkIfStateModificationsAreAllowed(this.atom_);\n var oldValue = values[index];\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_,\n index: index,\n newValue: newValue\n });\n if (!change) {\n return;\n }\n newValue = change.newValue;\n }\n newValue = this.enhancer_(newValue, oldValue);\n var changed = newValue !== oldValue;\n if (changed) {\n values[index] = newValue;\n this.notifyArrayChildUpdate_(index, newValue, oldValue);\n }\n } else {\n // For out of bound index, we don't create an actual sparse array,\n // but rather fill the holes with undefined (same as setArrayLength_).\n // This could be considered a bug.\n var newItems = new Array(index + 1 - values.length);\n for (var i = 0; i < newItems.length - 1; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n newItems[newItems.length - 1] = newValue;\n this.spliceWithArray_(values.length, 0, newItems);\n }\n };\n return ObservableArrayAdministration;\n}();\nfunction createObservableArray(initialValues, enhancer, name, owned) {\n if (name === void 0) {\n name = process.env.NODE_ENV !== \"production\" ? \"ObservableArray@\" + getNextId() : \"ObservableArray\";\n }\n if (owned === void 0) {\n owned = false;\n }\n assertProxies();\n var adm = new ObservableArrayAdministration(name, enhancer, owned, false);\n addHiddenFinalProp(adm.values_, $mobx, adm);\n var proxy = new Proxy(adm.values_, arrayTraps);\n adm.proxy_ = proxy;\n if (initialValues && initialValues.length) {\n var prev = allowStateChangesStart(true);\n adm.spliceWithArray_(0, 0, initialValues);\n allowStateChangesEnd(prev);\n }\n return proxy;\n}\n// eslint-disable-next-line\nvar arrayExtensions = {\n clear: function clear() {\n return this.splice(0);\n },\n replace: function replace(newItems) {\n var adm = this[$mobx];\n return adm.spliceWithArray_(0, adm.values_.length, newItems);\n },\n // Used by JSON.stringify\n toJSON: function toJSON() {\n return this.slice();\n },\n /*\r\n * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)\r\n * since these functions alter the inner structure of the array, the have side effects.\r\n * Because the have side effects, they should not be used in computed function,\r\n * and for that reason the do not call dependencyState.notifyObserved\r\n */\n splice: function splice(index, deleteCount) {\n for (var _len = arguments.length, newItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n newItems[_key - 2] = arguments[_key];\n }\n var adm = this[$mobx];\n switch (arguments.length) {\n case 0:\n return [];\n case 1:\n return adm.spliceWithArray_(index);\n case 2:\n return adm.spliceWithArray_(index, deleteCount);\n }\n return adm.spliceWithArray_(index, deleteCount, newItems);\n },\n spliceWithArray: function spliceWithArray(index, deleteCount, newItems) {\n return this[$mobx].spliceWithArray_(index, deleteCount, newItems);\n },\n push: function push() {\n var adm = this[$mobx];\n for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n items[_key2] = arguments[_key2];\n }\n adm.spliceWithArray_(adm.values_.length, 0, items);\n return adm.values_.length;\n },\n pop: function pop() {\n return this.splice(Math.max(this[$mobx].values_.length - 1, 0), 1)[0];\n },\n shift: function shift() {\n return this.splice(0, 1)[0];\n },\n unshift: function unshift() {\n var adm = this[$mobx];\n for (var _len3 = arguments.length, items = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n items[_key3] = arguments[_key3];\n }\n adm.spliceWithArray_(0, 0, items);\n return adm.values_.length;\n },\n reverse: function reverse() {\n // reverse by default mutates in place before returning the result\n // which makes it both a 'derivation' and a 'mutation'.\n if (globalState.trackingDerivation) {\n die(37, \"reverse\");\n }\n this.replace(this.slice().reverse());\n return this;\n },\n sort: function sort() {\n // sort by default mutates in place before returning the result\n // which goes against all good practices. Let's not change the array in place!\n if (globalState.trackingDerivation) {\n die(37, \"sort\");\n }\n var copy = this.slice();\n copy.sort.apply(copy, arguments);\n this.replace(copy);\n return this;\n },\n remove: function remove(value) {\n var adm = this[$mobx];\n var idx = adm.dehanceValues_(adm.values_).indexOf(value);\n if (idx > -1) {\n this.splice(idx, 1);\n return true;\n }\n return false;\n }\n};\n/**\r\n * Wrap function from prototype\r\n * Without this, everything works as well, but this works\r\n * faster as everything works on unproxied values\r\n */\naddArrayExtension(\"concat\", simpleFunc);\naddArrayExtension(\"flat\", simpleFunc);\naddArrayExtension(\"includes\", simpleFunc);\naddArrayExtension(\"indexOf\", simpleFunc);\naddArrayExtension(\"join\", simpleFunc);\naddArrayExtension(\"lastIndexOf\", simpleFunc);\naddArrayExtension(\"slice\", simpleFunc);\naddArrayExtension(\"toString\", simpleFunc);\naddArrayExtension(\"toLocaleString\", simpleFunc);\n// map\naddArrayExtension(\"every\", mapLikeFunc);\naddArrayExtension(\"filter\", mapLikeFunc);\naddArrayExtension(\"find\", mapLikeFunc);\naddArrayExtension(\"findIndex\", mapLikeFunc);\naddArrayExtension(\"flatMap\", mapLikeFunc);\naddArrayExtension(\"forEach\", mapLikeFunc);\naddArrayExtension(\"map\", mapLikeFunc);\naddArrayExtension(\"some\", mapLikeFunc);\n// reduce\naddArrayExtension(\"reduce\", reduceLikeFunc);\naddArrayExtension(\"reduceRight\", reduceLikeFunc);\nfunction addArrayExtension(funcName, funcFactory) {\n if (typeof Array.prototype[funcName] === \"function\") {\n arrayExtensions[funcName] = funcFactory(funcName);\n }\n}\n// Report and delegate to dehanced array\nfunction simpleFunc(funcName) {\n return function () {\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n}\n// Make sure callbacks recieve correct array arg #2326\nfunction mapLikeFunc(funcName) {\n return function (callback, thisArg) {\n var _this2 = this;\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName](function (element, index) {\n return callback.call(thisArg, element, index, _this2);\n });\n };\n}\n// Make sure callbacks recieve correct array arg #2326\nfunction reduceLikeFunc(funcName) {\n return function () {\n var _this3 = this;\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n // #2432 - reduce behavior depends on arguments.length\n var callback = arguments[0];\n arguments[0] = function (accumulator, currentValue, index) {\n return callback(accumulator, currentValue, index, _this3);\n };\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n}\nvar isObservableArrayAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableArrayAdministration\", ObservableArrayAdministration);\nfunction isObservableArray(thing) {\n return isObject(thing) && isObservableArrayAdministration(thing[$mobx]);\n}\n\nvar _Symbol$iterator, _Symbol$toStringTag;\nvar ObservableMapMarker = {};\nvar ADD = \"add\";\nvar DELETE = \"delete\";\n// just extend Map? See also https://gist.github.com/nestharus/13b4d74f2ef4a2f4357dbd3fc23c1e54\n// But: https://github.com/mobxjs/mobx/issues/1556\n_Symbol$iterator = Symbol.iterator;\n_Symbol$toStringTag = Symbol.toStringTag;\nvar ObservableMap = /*#__PURE__*/function () {\n // hasMap, not hashMap >-).\n\n function ObservableMap(initialData, enhancer_, name_) {\n var _this = this;\n if (enhancer_ === void 0) {\n enhancer_ = deepEnhancer;\n }\n if (name_ === void 0) {\n name_ = process.env.NODE_ENV !== \"production\" ? \"ObservableMap@\" + getNextId() : \"ObservableMap\";\n }\n this.enhancer_ = void 0;\n this.name_ = void 0;\n this[$mobx] = ObservableMapMarker;\n this.data_ = void 0;\n this.hasMap_ = void 0;\n this.keysAtom_ = void 0;\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = enhancer_;\n this.name_ = name_;\n if (!isFunction(Map)) {\n die(18);\n }\n this.keysAtom_ = createAtom(process.env.NODE_ENV !== \"production\" ? this.name_ + \".keys()\" : \"ObservableMap.keys()\");\n this.data_ = new Map();\n this.hasMap_ = new Map();\n allowStateChanges(true, function () {\n _this.merge(initialData);\n });\n }\n var _proto = ObservableMap.prototype;\n _proto.has_ = function has_(key) {\n return this.data_.has(key);\n };\n _proto.has = function has(key) {\n var _this2 = this;\n if (!globalState.trackingDerivation) {\n return this.has_(key);\n }\n var entry = this.hasMap_.get(key);\n if (!entry) {\n var newEntry = entry = new ObservableValue(this.has_(key), referenceEnhancer, process.env.NODE_ENV !== \"production\" ? this.name_ + \".\" + stringifyKey(key) + \"?\" : \"ObservableMap.key?\", false);\n this.hasMap_.set(key, newEntry);\n onBecomeUnobserved(newEntry, function () {\n return _this2.hasMap_[\"delete\"](key);\n });\n }\n return entry.get();\n };\n _proto.set = function set(key, value) {\n var hasKey = this.has_(key);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: hasKey ? UPDATE : ADD,\n object: this,\n newValue: value,\n name: key\n });\n if (!change) {\n return this;\n }\n value = change.newValue;\n }\n if (hasKey) {\n this.updateValue_(key, value);\n } else {\n this.addValue_(key, value);\n }\n return this;\n };\n _proto[\"delete\"] = function _delete(key) {\n var _this3 = this;\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n name: key\n });\n if (!change) {\n return false;\n }\n }\n if (this.has_(key)) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var _change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: this.data_.get(key).value_,\n name: key\n } : null;\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportStart(_change);\n } // TODO fix type\n transaction(function () {\n var _this3$hasMap_$get;\n _this3.keysAtom_.reportChanged();\n (_this3$hasMap_$get = _this3.hasMap_.get(key)) == null ? void 0 : _this3$hasMap_$get.setNewValue_(false);\n var observable = _this3.data_.get(key);\n observable.setNewValue_(undefined);\n _this3.data_[\"delete\"](key);\n });\n if (notify) {\n notifyListeners(this, _change);\n }\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportEnd();\n }\n return true;\n }\n return false;\n };\n _proto.updateValue_ = function updateValue_(key, newValue) {\n var observable = this.data_.get(key);\n newValue = observable.prepareNewValue_(newValue);\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: UPDATE,\n object: this,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n observable.setNewValue_(newValue);\n if (notify) {\n notifyListeners(this, change);\n }\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportEnd();\n }\n }\n };\n _proto.addValue_ = function addValue_(key, newValue) {\n var _this4 = this;\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n transaction(function () {\n var _this4$hasMap_$get;\n var observable = new ObservableValue(newValue, _this4.enhancer_, process.env.NODE_ENV !== \"production\" ? _this4.name_ + \".\" + stringifyKey(key) : \"ObservableMap.key\", false);\n _this4.data_.set(key, observable);\n newValue = observable.value_; // value might have been changed\n (_this4$hasMap_$get = _this4.hasMap_.get(key)) == null ? void 0 : _this4$hasMap_$get.setNewValue_(true);\n _this4.keysAtom_.reportChanged();\n });\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n name: key,\n newValue: newValue\n } : null;\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n if (notify) {\n notifyListeners(this, change);\n }\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportEnd();\n }\n };\n _proto.get = function get(key) {\n if (this.has(key)) {\n return this.dehanceValue_(this.data_.get(key).get());\n }\n return this.dehanceValue_(undefined);\n };\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.keys = function keys() {\n this.keysAtom_.reportObserved();\n return this.data_.keys();\n };\n _proto.values = function values() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next = keys.next(),\n done = _keys$next.done,\n value = _keys$next.value;\n return {\n done: done,\n value: done ? undefined : self.get(value)\n };\n }\n });\n };\n _proto.entries = function entries() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next2 = keys.next(),\n done = _keys$next2.done,\n value = _keys$next2.value;\n return {\n done: done,\n value: done ? undefined : [value, self.get(value)]\n };\n }\n });\n };\n _proto[_Symbol$iterator] = function () {\n return this.entries();\n };\n _proto.forEach = function forEach(callback, thisArg) {\n for (var _iterator = _createForOfIteratorHelperLoose(this), _step; !(_step = _iterator()).done;) {\n var _step$value = _step.value,\n key = _step$value[0],\n value = _step$value[1];\n callback.call(thisArg, value, key, this);\n }\n }\n /** Merge another object into this object, returns this. */;\n _proto.merge = function merge(other) {\n var _this5 = this;\n if (isObservableMap(other)) {\n other = new Map(other);\n }\n transaction(function () {\n if (isPlainObject(other)) {\n getPlainObjectKeys(other).forEach(function (key) {\n return _this5.set(key, other[key]);\n });\n } else if (Array.isArray(other)) {\n other.forEach(function (_ref) {\n var key = _ref[0],\n value = _ref[1];\n return _this5.set(key, value);\n });\n } else if (isES6Map(other)) {\n if (other.constructor !== Map) {\n die(19, other);\n }\n other.forEach(function (value, key) {\n return _this5.set(key, value);\n });\n } else if (other !== null && other !== undefined) {\n die(20, other);\n }\n });\n return this;\n };\n _proto.clear = function clear() {\n var _this6 = this;\n transaction(function () {\n untracked(function () {\n for (var _iterator2 = _createForOfIteratorHelperLoose(_this6.keys()), _step2; !(_step2 = _iterator2()).done;) {\n var key = _step2.value;\n _this6[\"delete\"](key);\n }\n });\n });\n };\n _proto.replace = function replace(values) {\n var _this7 = this;\n // Implementation requirements:\n // - respect ordering of replacement map\n // - allow interceptors to run and potentially prevent individual operations\n // - don't recreate observables that already exist in original map (so we don't destroy existing subscriptions)\n // - don't _keysAtom.reportChanged if the keys of resulting map are indentical (order matters!)\n // - note that result map may differ from replacement map due to the interceptors\n transaction(function () {\n // Convert to map so we can do quick key lookups\n var replacementMap = convertToMap(values);\n var orderedData = new Map();\n // Used for optimization\n var keysReportChangedCalled = false;\n // Delete keys that don't exist in replacement map\n // if the key deletion is prevented by interceptor\n // add entry at the beginning of the result map\n for (var _iterator3 = _createForOfIteratorHelperLoose(_this7.data_.keys()), _step3; !(_step3 = _iterator3()).done;) {\n var key = _step3.value;\n // Concurrently iterating/deleting keys\n // iterator should handle this correctly\n if (!replacementMap.has(key)) {\n var deleted = _this7[\"delete\"](key);\n // Was the key removed?\n if (deleted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n } else {\n // Delete prevented by interceptor\n var value = _this7.data_.get(key);\n orderedData.set(key, value);\n }\n }\n }\n // Merge entries\n for (var _iterator4 = _createForOfIteratorHelperLoose(replacementMap.entries()), _step4; !(_step4 = _iterator4()).done;) {\n var _step4$value = _step4.value,\n _key = _step4$value[0],\n _value = _step4$value[1];\n // We will want to know whether a new key is added\n var keyExisted = _this7.data_.has(_key);\n // Add or update value\n _this7.set(_key, _value);\n // The addition could have been prevent by interceptor\n if (_this7.data_.has(_key)) {\n // The update could have been prevented by interceptor\n // and also we want to preserve existing values\n // so use value from _data map (instead of replacement map)\n var _value2 = _this7.data_.get(_key);\n orderedData.set(_key, _value2);\n // Was a new key added?\n if (!keyExisted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n }\n }\n }\n // Check for possible key order change\n if (!keysReportChangedCalled) {\n if (_this7.data_.size !== orderedData.size) {\n // If size differs, keys are definitely modified\n _this7.keysAtom_.reportChanged();\n } else {\n var iter1 = _this7.data_.keys();\n var iter2 = orderedData.keys();\n var next1 = iter1.next();\n var next2 = iter2.next();\n while (!next1.done) {\n if (next1.value !== next2.value) {\n _this7.keysAtom_.reportChanged();\n break;\n }\n next1 = iter1.next();\n next2 = iter2.next();\n }\n }\n }\n // Use correctly ordered map\n _this7.data_ = orderedData;\n });\n return this;\n };\n _proto.toString = function toString() {\n return \"[object ObservableMap]\";\n };\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n /**\r\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n * for callback details\r\n */\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (process.env.NODE_ENV !== \"production\" && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with maps.\");\n }\n return registerListener(this, listener);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _createClass(ObservableMap, [{\n key: \"size\",\n get: function get() {\n this.keysAtom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Map\";\n }\n }]);\n return ObservableMap;\n}();\n// eslint-disable-next-line\nvar isObservableMap = /*#__PURE__*/createInstanceofPredicate(\"ObservableMap\", ObservableMap);\nfunction convertToMap(dataStructure) {\n if (isES6Map(dataStructure) || isObservableMap(dataStructure)) {\n return dataStructure;\n } else if (Array.isArray(dataStructure)) {\n return new Map(dataStructure);\n } else if (isPlainObject(dataStructure)) {\n var map = new Map();\n for (var key in dataStructure) {\n map.set(key, dataStructure[key]);\n }\n return map;\n } else {\n return die(21, dataStructure);\n }\n}\n\nvar _Symbol$iterator$1, _Symbol$toStringTag$1;\nvar ObservableSetMarker = {};\n_Symbol$iterator$1 = Symbol.iterator;\n_Symbol$toStringTag$1 = Symbol.toStringTag;\nvar ObservableSet = /*#__PURE__*/function () {\n function ObservableSet(initialData, enhancer, name_) {\n if (enhancer === void 0) {\n enhancer = deepEnhancer;\n }\n if (name_ === void 0) {\n name_ = process.env.NODE_ENV !== \"production\" ? \"ObservableSet@\" + getNextId() : \"ObservableSet\";\n }\n this.name_ = void 0;\n this[$mobx] = ObservableSetMarker;\n this.data_ = new Set();\n this.atom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = void 0;\n this.name_ = name_;\n if (!isFunction(Set)) {\n die(22);\n }\n this.atom_ = createAtom(this.name_);\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, name_);\n };\n if (initialData) {\n this.replace(initialData);\n }\n }\n var _proto = ObservableSet.prototype;\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n return value;\n };\n _proto.clear = function clear() {\n var _this = this;\n transaction(function () {\n untracked(function () {\n for (var _iterator = _createForOfIteratorHelperLoose(_this.data_.values()), _step; !(_step = _iterator()).done;) {\n var value = _step.value;\n _this[\"delete\"](value);\n }\n });\n });\n };\n _proto.forEach = function forEach(callbackFn, thisArg) {\n for (var _iterator2 = _createForOfIteratorHelperLoose(this), _step2; !(_step2 = _iterator2()).done;) {\n var value = _step2.value;\n callbackFn.call(thisArg, value, value, this);\n }\n };\n _proto.add = function add(value) {\n var _this2 = this;\n checkIfStateModificationsAreAllowed(this.atom_);\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: ADD,\n object: this,\n newValue: value\n });\n if (!change) {\n return this;\n }\n // ideally, value = change.value would be done here, so that values can be\n // changed by interceptor. Same applies for other Set and Map api's.\n }\n\n if (!this.has(value)) {\n transaction(function () {\n _this2.data_.add(_this2.enhancer_(value, undefined));\n _this2.atom_.reportChanged();\n });\n var notifySpy = process.env.NODE_ENV !== \"production\" && isSpyEnabled();\n var notify = hasListeners(this);\n var _change = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n newValue: value\n } : null;\n if (notifySpy && process.env.NODE_ENV !== \"production\") {\n spyReportStart(_change);\n }\n if (notify) {\n notifyListeners(this, _change);\n }\n if (notifySpy && process.env.NODE_ENV !== \"production\") {\n spyReportEnd();\n }\n }\n return this;\n };\n _proto[\"delete\"] = function _delete(value) {\n var _this3 = this;\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n oldValue: value\n });\n if (!change) {\n return false;\n }\n }\n if (this.has(value)) {\n var notifySpy = process.env.NODE_ENV !== \"production\" && isSpyEnabled();\n var notify = hasListeners(this);\n var _change2 = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: value\n } : null;\n if (notifySpy && process.env.NODE_ENV !== \"production\") {\n spyReportStart(_change2);\n }\n transaction(function () {\n _this3.atom_.reportChanged();\n _this3.data_[\"delete\"](value);\n });\n if (notify) {\n notifyListeners(this, _change2);\n }\n if (notifySpy && process.env.NODE_ENV !== \"production\") {\n spyReportEnd();\n }\n return true;\n }\n return false;\n };\n _proto.has = function has(value) {\n this.atom_.reportObserved();\n return this.data_.has(this.dehanceValue_(value));\n };\n _proto.entries = function entries() {\n var nextIndex = 0;\n var keys = Array.from(this.keys());\n var values = Array.from(this.values());\n return makeIterable({\n next: function next() {\n var index = nextIndex;\n nextIndex += 1;\n return index < values.length ? {\n value: [keys[index], values[index]],\n done: false\n } : {\n done: true\n };\n }\n });\n };\n _proto.keys = function keys() {\n return this.values();\n };\n _proto.values = function values() {\n this.atom_.reportObserved();\n var self = this;\n var nextIndex = 0;\n var observableValues = Array.from(this.data_.values());\n return makeIterable({\n next: function next() {\n return nextIndex < observableValues.length ? {\n value: self.dehanceValue_(observableValues[nextIndex++]),\n done: false\n } : {\n done: true\n };\n }\n });\n };\n _proto.replace = function replace(other) {\n var _this4 = this;\n if (isObservableSet(other)) {\n other = new Set(other);\n }\n transaction(function () {\n if (Array.isArray(other)) {\n _this4.clear();\n other.forEach(function (value) {\n return _this4.add(value);\n });\n } else if (isES6Set(other)) {\n _this4.clear();\n other.forEach(function (value) {\n return _this4.add(value);\n });\n } else if (other !== null && other !== undefined) {\n die(\"Cannot initialize set from \" + other);\n }\n });\n return this;\n };\n _proto.observe_ = function observe_(listener, fireImmediately) {\n // ... 'fireImmediately' could also be true?\n if (process.env.NODE_ENV !== \"production\" && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with sets.\");\n }\n return registerListener(this, listener);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n _proto.toString = function toString() {\n return \"[object ObservableSet]\";\n };\n _proto[_Symbol$iterator$1] = function () {\n return this.values();\n };\n _createClass(ObservableSet, [{\n key: \"size\",\n get: function get() {\n this.atom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag$1,\n get: function get() {\n return \"Set\";\n }\n }]);\n return ObservableSet;\n}();\n// eslint-disable-next-line\nvar isObservableSet = /*#__PURE__*/createInstanceofPredicate(\"ObservableSet\", ObservableSet);\n\nvar descriptorCache = /*#__PURE__*/Object.create(null);\nvar REMOVE = \"remove\";\nvar ObservableObjectAdministration = /*#__PURE__*/function () {\n function ObservableObjectAdministration(target_, values_, name_,\n // Used anytime annotation is not explicitely provided\n defaultAnnotation_) {\n if (values_ === void 0) {\n values_ = new Map();\n }\n if (defaultAnnotation_ === void 0) {\n defaultAnnotation_ = autoAnnotation;\n }\n this.target_ = void 0;\n this.values_ = void 0;\n this.name_ = void 0;\n this.defaultAnnotation_ = void 0;\n this.keysAtom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.proxy_ = void 0;\n this.isPlainObject_ = void 0;\n this.appliedAnnotations_ = void 0;\n this.pendingKeys_ = void 0;\n this.target_ = target_;\n this.values_ = values_;\n this.name_ = name_;\n this.defaultAnnotation_ = defaultAnnotation_;\n this.keysAtom_ = new Atom(process.env.NODE_ENV !== \"production\" ? this.name_ + \".keys\" : \"ObservableObject.keys\");\n // Optimization: we use this frequently\n this.isPlainObject_ = isPlainObject(this.target_);\n if (process.env.NODE_ENV !== \"production\" && !isAnnotation(this.defaultAnnotation_)) {\n die(\"defaultAnnotation must be valid annotation\");\n }\n if (process.env.NODE_ENV !== \"production\") {\n // Prepare structure for tracking which fields were already annotated\n this.appliedAnnotations_ = {};\n }\n }\n var _proto = ObservableObjectAdministration.prototype;\n _proto.getObservablePropValue_ = function getObservablePropValue_(key) {\n return this.values_.get(key).get();\n };\n _proto.setObservablePropValue_ = function setObservablePropValue_(key, newValue) {\n var observable = this.values_.get(key);\n if (observable instanceof ComputedValue) {\n observable.set(newValue);\n return true;\n }\n // intercept\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: newValue\n });\n if (!change) {\n return null;\n }\n newValue = change.newValue;\n }\n newValue = observable.prepareNewValue_(newValue);\n // notify spy & observers\n if (newValue !== globalState.UNCHANGED) {\n var notify = hasListeners(this);\n var notifySpy = process.env.NODE_ENV !== \"production\" && isSpyEnabled();\n var _change = notify || notifySpy ? {\n type: UPDATE,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportStart(_change);\n }\n observable.setNewValue_(newValue);\n if (notify) {\n notifyListeners(this, _change);\n }\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportEnd();\n }\n }\n return true;\n };\n _proto.get_ = function get_(key) {\n if (globalState.trackingDerivation && !hasProp(this.target_, key)) {\n // Key doesn't exist yet, subscribe for it in case it's added later\n this.has_(key);\n }\n return this.target_[key];\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {any} value\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */;\n _proto.set_ = function set_(key, value, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n // Don't use .has(key) - we care about own\n if (hasProp(this.target_, key)) {\n // Existing prop\n if (this.values_.has(key)) {\n // Observable (can be intercepted)\n return this.setObservablePropValue_(key, value);\n } else if (proxyTrap) {\n // Non-observable - proxy\n return Reflect.set(this.target_, key, value);\n } else {\n // Non-observable\n this.target_[key] = value;\n return true;\n }\n } else {\n // New prop\n return this.extend_(key, {\n value: value,\n enumerable: true,\n writable: true,\n configurable: true\n }, this.defaultAnnotation_, proxyTrap);\n }\n }\n // Trap for \"in\"\n ;\n _proto.has_ = function has_(key) {\n if (!globalState.trackingDerivation) {\n // Skip key subscription outside derivation\n return key in this.target_;\n }\n this.pendingKeys_ || (this.pendingKeys_ = new Map());\n var entry = this.pendingKeys_.get(key);\n if (!entry) {\n entry = new ObservableValue(key in this.target_, referenceEnhancer, process.env.NODE_ENV !== \"production\" ? this.name_ + \".\" + stringifyKey(key) + \"?\" : \"ObservableObject.key?\", false);\n this.pendingKeys_.set(key, entry);\n }\n return entry.get();\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - ignore prop\r\n */;\n _proto.make_ = function make_(key, annotation) {\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n if (annotation === false) {\n return;\n }\n assertAnnotable(this, annotation, key);\n if (!(key in this.target_)) {\n var _this$target_$storedA;\n // Throw on missing key, except for decorators:\n // Decorator annotations are collected from whole prototype chain.\n // When called from super() some props may not exist yet.\n // However we don't have to worry about missing prop,\n // because the decorator must have been applied to something.\n if ((_this$target_$storedA = this.target_[storedAnnotationsSymbol]) != null && _this$target_$storedA[key]) {\n return; // will be annotated by subclass constructor\n } else {\n die(1, annotation.annotationType_, this.name_ + \".\" + key.toString());\n }\n }\n var source = this.target_;\n while (source && source !== objectPrototype) {\n var descriptor = getDescriptor(source, key);\n if (descriptor) {\n var outcome = annotation.make_(this, key, descriptor, source);\n if (outcome === 0 /* Cancel */) {\n return;\n }\n if (outcome === 1 /* Break */) {\n break;\n }\n }\n source = Object.getPrototypeOf(source);\n }\n recordAnnotationApplied(this, annotation, key);\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */;\n _proto.extend_ = function extend_(key, descriptor, annotation, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n if (annotation === false) {\n return this.defineProperty_(key, descriptor, proxyTrap);\n }\n assertAnnotable(this, annotation, key);\n var outcome = annotation.extend_(this, key, descriptor, proxyTrap);\n if (outcome) {\n recordAnnotationApplied(this, annotation, key);\n }\n return outcome;\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */;\n _proto.defineProperty_ = function defineProperty_(key, descriptor, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n try {\n startBatch();\n // Delete\n var deleteOutcome = this.delete_(key);\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n }\n // ADD interceptor\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: descriptor.value\n });\n if (!change) {\n return null;\n }\n var newValue = change.newValue;\n if (descriptor.value !== newValue) {\n descriptor = _extends({}, descriptor, {\n value: newValue\n });\n }\n }\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n // Notify\n this.notifyPropertyAddition_(key, descriptor.value);\n } finally {\n endBatch();\n }\n return true;\n }\n // If original descriptor becomes relevant, move this to annotation directly\n ;\n _proto.defineObservableProperty_ = function defineObservableProperty_(key, value, enhancer, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n try {\n startBatch();\n // Delete\n var deleteOutcome = this.delete_(key);\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n }\n // ADD interceptor\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: value\n });\n if (!change) {\n return null;\n }\n value = change.newValue;\n }\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: true,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n };\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n var observable = new ObservableValue(value, enhancer, process.env.NODE_ENV !== \"production\" ? this.name_ + \".\" + key.toString() : \"ObservableObject.key\", false);\n this.values_.set(key, observable);\n // Notify (value possibly changed by ObservableValue)\n this.notifyPropertyAddition_(key, observable.value_);\n } finally {\n endBatch();\n }\n return true;\n }\n // If original descriptor becomes relevant, move this to annotation directly\n ;\n _proto.defineComputedProperty_ = function defineComputedProperty_(key, options, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n try {\n startBatch();\n // Delete\n var deleteOutcome = this.delete_(key);\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n }\n // ADD interceptor\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: undefined\n });\n if (!change) {\n return null;\n }\n }\n options.name || (options.name = process.env.NODE_ENV !== \"production\" ? this.name_ + \".\" + key.toString() : \"ObservableObject.key\");\n options.context = this.proxy_ || this.target_;\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: false,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n };\n // Define\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n this.values_.set(key, new ComputedValue(options));\n // Notify\n this.notifyPropertyAddition_(key, undefined);\n } finally {\n endBatch();\n }\n return true;\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */;\n _proto.delete_ = function delete_(key, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n // No such prop\n if (!hasProp(this.target_, key)) {\n return true;\n }\n // Intercept\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: REMOVE\n });\n // Cancelled\n if (!change) {\n return null;\n }\n }\n // Delete\n try {\n var _this$pendingKeys_, _this$pendingKeys_$ge;\n startBatch();\n var notify = hasListeners(this);\n var notifySpy = process.env.NODE_ENV !== \"production\" && isSpyEnabled();\n var observable = this.values_.get(key);\n // Value needed for spies/listeners\n var value = undefined;\n // Optimization: don't pull the value unless we will need it\n if (!observable && (notify || notifySpy)) {\n var _getDescriptor;\n value = (_getDescriptor = getDescriptor(this.target_, key)) == null ? void 0 : _getDescriptor.value;\n }\n // delete prop (do first, may fail)\n if (proxyTrap) {\n if (!Reflect.deleteProperty(this.target_, key)) {\n return false;\n }\n } else {\n delete this.target_[key];\n }\n // Allow re-annotating this field\n if (process.env.NODE_ENV !== \"production\") {\n delete this.appliedAnnotations_[key];\n }\n // Clear observable\n if (observable) {\n this.values_[\"delete\"](key);\n // for computed, value is undefined\n if (observable instanceof ObservableValue) {\n value = observable.value_;\n }\n // Notify: autorun(() => obj[key]), see #1796\n propagateChanged(observable);\n }\n // Notify \"keys/entries/values\" observers\n this.keysAtom_.reportChanged();\n // Notify \"has\" observers\n // \"in\" as it may still exist in proto\n (_this$pendingKeys_ = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_$ge = _this$pendingKeys_.get(key)) == null ? void 0 : _this$pendingKeys_$ge.set(key in this.target_);\n // Notify spies/listeners\n if (notify || notifySpy) {\n var _change2 = {\n type: REMOVE,\n observableKind: \"object\",\n object: this.proxy_ || this.target_,\n debugObjectName: this.name_,\n oldValue: value,\n name: key\n };\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportStart(_change2);\n }\n if (notify) {\n notifyListeners(this, _change2);\n }\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportEnd();\n }\n }\n } finally {\n endBatch();\n }\n return true;\n }\n /**\r\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n * for callback details\r\n */;\n _proto.observe_ = function observe_(callback, fireImmediately) {\n if (process.env.NODE_ENV !== \"production\" && fireImmediately === true) {\n die(\"`observe` doesn't support the fire immediately property for observable objects.\");\n }\n return registerListener(this, callback);\n };\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n _proto.notifyPropertyAddition_ = function notifyPropertyAddition_(key, value) {\n var _this$pendingKeys_2, _this$pendingKeys_2$g;\n var notify = hasListeners(this);\n var notifySpy = process.env.NODE_ENV !== \"production\" && isSpyEnabled();\n if (notify || notifySpy) {\n var change = notify || notifySpy ? {\n type: ADD,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: value\n } : null;\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportStart(change);\n }\n if (notify) {\n notifyListeners(this, change);\n }\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportEnd();\n }\n }\n (_this$pendingKeys_2 = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_2$g = _this$pendingKeys_2.get(key)) == null ? void 0 : _this$pendingKeys_2$g.set(true);\n // Notify \"keys/entries/values\" observers\n this.keysAtom_.reportChanged();\n };\n _proto.ownKeys_ = function ownKeys_() {\n this.keysAtom_.reportObserved();\n return ownKeys(this.target_);\n };\n _proto.keys_ = function keys_() {\n // Returns enumerable && own, but unfortunately keysAtom will report on ANY key change.\n // There is no way to distinguish between Object.keys(object) and Reflect.ownKeys(object) - both are handled by ownKeys trap.\n // We can either over-report in Object.keys(object) or under-report in Reflect.ownKeys(object)\n // We choose to over-report in Object.keys(object), because:\n // - typically it's used with simple data objects\n // - when symbolic/non-enumerable keys are relevant Reflect.ownKeys works as expected\n this.keysAtom_.reportObserved();\n return Object.keys(this.target_);\n };\n return ObservableObjectAdministration;\n}();\nfunction asObservableObject(target, options) {\n var _options$name;\n if (process.env.NODE_ENV !== \"production\" && options && isObservableObject(target)) {\n die(\"Options can't be provided for already observable objects.\");\n }\n if (hasProp(target, $mobx)) {\n if (process.env.NODE_ENV !== \"production\" && !(getAdministration(target) instanceof ObservableObjectAdministration)) {\n die(\"Cannot convert '\" + getDebugName(target) + \"' into observable object:\" + \"\\nThe target is already observable of different type.\" + \"\\nExtending builtins is not supported.\");\n }\n return target;\n }\n if (process.env.NODE_ENV !== \"production\" && !Object.isExtensible(target)) {\n die(\"Cannot make the designated object observable; it is not extensible\");\n }\n var name = (_options$name = options == null ? void 0 : options.name) != null ? _options$name : process.env.NODE_ENV !== \"production\" ? (isPlainObject(target) ? \"ObservableObject\" : target.constructor.name) + \"@\" + getNextId() : \"ObservableObject\";\n var adm = new ObservableObjectAdministration(target, new Map(), String(name), getAnnotationFromOptions(options));\n addHiddenProp(target, $mobx, adm);\n return target;\n}\nvar isObservableObjectAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableObjectAdministration\", ObservableObjectAdministration);\nfunction getCachedObservablePropDescriptor(key) {\n return descriptorCache[key] || (descriptorCache[key] = {\n get: function get() {\n return this[$mobx].getObservablePropValue_(key);\n },\n set: function set(value) {\n return this[$mobx].setObservablePropValue_(key, value);\n }\n });\n}\nfunction isObservableObject(thing) {\n if (isObject(thing)) {\n return isObservableObjectAdministration(thing[$mobx]);\n }\n return false;\n}\nfunction recordAnnotationApplied(adm, annotation, key) {\n var _adm$target_$storedAn;\n if (process.env.NODE_ENV !== \"production\") {\n adm.appliedAnnotations_[key] = annotation;\n }\n // Remove applied decorator annotation so we don't try to apply it again in subclass constructor\n (_adm$target_$storedAn = adm.target_[storedAnnotationsSymbol]) == null ? true : delete _adm$target_$storedAn[key];\n}\nfunction assertAnnotable(adm, annotation, key) {\n // Valid annotation\n if (process.env.NODE_ENV !== \"production\" && !isAnnotation(annotation)) {\n die(\"Cannot annotate '\" + adm.name_ + \".\" + key.toString() + \"': Invalid annotation.\");\n }\n /*\r\n // Configurable, not sealed, not frozen\r\n // Possibly not needed, just a little better error then the one thrown by engine.\r\n // Cases where this would be useful the most (subclass field initializer) are not interceptable by this.\r\n if (__DEV__) {\r\n const configurable = getDescriptor(adm.target_, key)?.configurable\r\n const frozen = Object.isFrozen(adm.target_)\r\n const sealed = Object.isSealed(adm.target_)\r\n if (!configurable || frozen || sealed) {\r\n const fieldName = `${adm.name_}.${key.toString()}`\r\n const requestedAnnotationType = annotation.annotationType_\r\n let error = `Cannot apply '${requestedAnnotationType}' to '${fieldName}':`\r\n if (frozen) {\r\n error += `\\nObject is frozen.`\r\n }\r\n if (sealed) {\r\n error += `\\nObject is sealed.`\r\n }\r\n if (!configurable) {\r\n error += `\\nproperty is not configurable.`\r\n // Mention only if caused by us to avoid confusion\r\n if (hasProp(adm.appliedAnnotations!, key)) {\r\n error += `\\nTo prevent accidental re-definition of a field by a subclass, `\r\n error += `all annotated fields of non-plain objects (classes) are not configurable.`\r\n }\r\n }\r\n die(error)\r\n }\r\n }\r\n */\n // Not annotated\n if (process.env.NODE_ENV !== \"production\" && !isOverride(annotation) && hasProp(adm.appliedAnnotations_, key)) {\n var fieldName = adm.name_ + \".\" + key.toString();\n var currentAnnotationType = adm.appliedAnnotations_[key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already annotated with '\" + currentAnnotationType + \"'.\") + \"\\nRe-annotating fields is not allowed.\" + \"\\nUse 'override' annotation for methods overridden by subclass.\");\n }\n}\n\n// Bug in safari 9.* (or iOS 9 safari mobile). See #364\nvar ENTRY_0 = /*#__PURE__*/createArrayEntryDescriptor(0);\n/**\r\n * This array buffer contains two lists of properties, so that all arrays\r\n * can recycle their property definitions, which significantly improves performance of creating\r\n * properties on the fly.\r\n */\nvar OBSERVABLE_ARRAY_BUFFER_SIZE = 0;\n// Typescript workaround to make sure ObservableArray extends Array\nvar StubArray = function StubArray() {};\nfunction inherit(ctor, proto) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(ctor.prototype, proto);\n } else if (ctor.prototype.__proto__ !== undefined) {\n ctor.prototype.__proto__ = proto;\n } else {\n ctor.prototype = proto;\n }\n}\ninherit(StubArray, Array.prototype);\n// Weex proto freeze protection was here,\n// but it is unclear why the hack is need as MobX never changed the prototype\n// anyway, so removed it in V6\nvar LegacyObservableArray = /*#__PURE__*/function (_StubArray, _Symbol$toStringTag, _Symbol$iterator) {\n _inheritsLoose(LegacyObservableArray, _StubArray);\n function LegacyObservableArray(initialValues, enhancer, name, owned) {\n var _this;\n if (name === void 0) {\n name = process.env.NODE_ENV !== \"production\" ? \"ObservableArray@\" + getNextId() : \"ObservableArray\";\n }\n if (owned === void 0) {\n owned = false;\n }\n _this = _StubArray.call(this) || this;\n var adm = new ObservableArrayAdministration(name, enhancer, owned, true);\n adm.proxy_ = _assertThisInitialized(_this);\n addHiddenFinalProp(_assertThisInitialized(_this), $mobx, adm);\n if (initialValues && initialValues.length) {\n var prev = allowStateChangesStart(true);\n // @ts-ignore\n _this.spliceWithArray(0, 0, initialValues);\n allowStateChangesEnd(prev);\n }\n {\n // Seems that Safari won't use numeric prototype setter untill any * numeric property is\n // defined on the instance. After that it works fine, even if this property is deleted.\n Object.defineProperty(_assertThisInitialized(_this), \"0\", ENTRY_0);\n }\n return _this;\n }\n var _proto = LegacyObservableArray.prototype;\n _proto.concat = function concat() {\n this[$mobx].atom_.reportObserved();\n for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) {\n arrays[_key] = arguments[_key];\n }\n return Array.prototype.concat.apply(this.slice(),\n //@ts-ignore\n arrays.map(function (a) {\n return isObservableArray(a) ? a.slice() : a;\n }));\n };\n _proto[_Symbol$iterator] = function () {\n var self = this;\n var nextIndex = 0;\n return makeIterable({\n next: function next() {\n return nextIndex < self.length ? {\n value: self[nextIndex++],\n done: false\n } : {\n done: true,\n value: undefined\n };\n }\n });\n };\n _createClass(LegacyObservableArray, [{\n key: \"length\",\n get: function get() {\n return this[$mobx].getArrayLength_();\n },\n set: function set(newLength) {\n this[$mobx].setArrayLength_(newLength);\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Array\";\n }\n }]);\n return LegacyObservableArray;\n}(StubArray, Symbol.toStringTag, Symbol.iterator);\nObject.entries(arrayExtensions).forEach(function (_ref) {\n var prop = _ref[0],\n fn = _ref[1];\n if (prop !== \"concat\") {\n addHiddenProp(LegacyObservableArray.prototype, prop, fn);\n }\n});\nfunction createArrayEntryDescriptor(index) {\n return {\n enumerable: false,\n configurable: true,\n get: function get() {\n return this[$mobx].get_(index);\n },\n set: function set(value) {\n this[$mobx].set_(index, value);\n }\n };\n}\nfunction createArrayBufferItem(index) {\n defineProperty(LegacyObservableArray.prototype, \"\" + index, createArrayEntryDescriptor(index));\n}\nfunction reserveArrayBuffer(max) {\n if (max > OBSERVABLE_ARRAY_BUFFER_SIZE) {\n for (var index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max + 100; index++) {\n createArrayBufferItem(index);\n }\n OBSERVABLE_ARRAY_BUFFER_SIZE = max;\n }\n}\nreserveArrayBuffer(1000);\nfunction createLegacyArray(initialValues, enhancer, name) {\n return new LegacyObservableArray(initialValues, enhancer, name);\n}\n\nfunction getAtom(thing, property) {\n if (typeof thing === \"object\" && thing !== null) {\n if (isObservableArray(thing)) {\n if (property !== undefined) {\n die(23);\n }\n return thing[$mobx].atom_;\n }\n if (isObservableSet(thing)) {\n return thing.atom_;\n }\n if (isObservableMap(thing)) {\n if (property === undefined) {\n return thing.keysAtom_;\n }\n var observable = thing.data_.get(property) || thing.hasMap_.get(property);\n if (!observable) {\n die(25, property, getDebugName(thing));\n }\n return observable;\n }\n if (isObservableObject(thing)) {\n if (!property) {\n return die(26);\n }\n var _observable = thing[$mobx].values_.get(property);\n if (!_observable) {\n die(27, property, getDebugName(thing));\n }\n return _observable;\n }\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n } else if (isFunction(thing)) {\n if (isReaction(thing[$mobx])) {\n // disposer function\n return thing[$mobx];\n }\n }\n die(28);\n}\nfunction getAdministration(thing, property) {\n if (!thing) {\n die(29);\n }\n if (property !== undefined) {\n return getAdministration(getAtom(thing, property));\n }\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n if (isObservableMap(thing) || isObservableSet(thing)) {\n return thing;\n }\n if (thing[$mobx]) {\n return thing[$mobx];\n }\n die(24, thing);\n}\nfunction getDebugName(thing, property) {\n var named;\n if (property !== undefined) {\n named = getAtom(thing, property);\n } else if (isAction(thing)) {\n return thing.name;\n } else if (isObservableObject(thing) || isObservableMap(thing) || isObservableSet(thing)) {\n named = getAdministration(thing);\n } else {\n // valid for arrays as well\n named = getAtom(thing);\n }\n return named.name_;\n}\n\nvar toString = objectPrototype.toString;\nfunction deepEqual(a, b, depth) {\n if (depth === void 0) {\n depth = -1;\n }\n return eq(a, b, depth);\n}\n// Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289\n// Internal recursive comparison function for `isEqual`.\nfunction eq(a, b, depth, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) {\n return a !== 0 || 1 / a === 1 / b;\n }\n // `null` or `undefined` only equal to itself (strict comparison).\n if (a == null || b == null) {\n return false;\n }\n // `NaN`s are equivalent, but non-reflexive.\n if (a !== a) {\n return b !== b;\n }\n // Exhaust primitive checks\n var type = typeof a;\n if (type !== \"function\" && type !== \"object\" && typeof b != \"object\") {\n return false;\n }\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className !== toString.call(b)) {\n return false;\n }\n switch (className) {\n // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n case \"[object RegExp]\":\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n case \"[object String]\":\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return \"\" + a === \"\" + b;\n case \"[object Number]\":\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) {\n return +b !== +b;\n }\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n case \"[object Date]\":\n case \"[object Boolean]\":\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n case \"[object Symbol]\":\n return typeof Symbol !== \"undefined\" && Symbol.valueOf.call(a) === Symbol.valueOf.call(b);\n case \"[object Map]\":\n case \"[object Set]\":\n // Maps and Sets are unwrapped to arrays of entry-pairs, adding an incidental level.\n // Hide this extra level by increasing the depth.\n if (depth >= 0) {\n depth++;\n }\n break;\n }\n // Unwrap any wrapped objects.\n a = unwrap(a);\n b = unwrap(b);\n var areArrays = className === \"[object Array]\";\n if (!areArrays) {\n if (typeof a != \"object\" || typeof b != \"object\") {\n return false;\n }\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n var aCtor = a.constructor,\n bCtor = b.constructor;\n if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && isFunction(bCtor) && bCtor instanceof bCtor) && \"constructor\" in a && \"constructor\" in b) {\n return false;\n }\n }\n if (depth === 0) {\n return false;\n } else if (depth < 0) {\n depth = -1;\n }\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) {\n return bStack[length] === b;\n }\n }\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) {\n return false;\n }\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], depth - 1, aStack, bStack)) {\n return false;\n }\n }\n } else {\n // Deep compare objects.\n var keys = Object.keys(a);\n var key;\n length = keys.length;\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (Object.keys(b).length !== length) {\n return false;\n }\n while (length--) {\n // Deep compare each member\n key = keys[length];\n if (!(hasProp(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack))) {\n return false;\n }\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return true;\n}\nfunction unwrap(a) {\n if (isObservableArray(a)) {\n return a.slice();\n }\n if (isES6Map(a) || isObservableMap(a)) {\n return Array.from(a.entries());\n }\n if (isES6Set(a) || isObservableSet(a)) {\n return Array.from(a.entries());\n }\n return a;\n}\n\nfunction makeIterable(iterator) {\n iterator[Symbol.iterator] = getSelf;\n return iterator;\n}\nfunction getSelf() {\n return this;\n}\n\nfunction isAnnotation(thing) {\n return (\n // Can be function\n thing instanceof Object && typeof thing.annotationType_ === \"string\" && isFunction(thing.make_) && isFunction(thing.extend_)\n );\n}\n\n/**\r\n * (c) Michel Weststrate 2015 - 2020\r\n * MIT Licensed\r\n *\r\n * Welcome to the mobx sources! To get a global overview of how MobX internally works,\r\n * this is a good place to start:\r\n * https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74\r\n *\r\n * Source folders:\r\n * ===============\r\n *\r\n * - api/ Most of the public static methods exposed by the module can be found here.\r\n * - core/ Implementation of the MobX algorithm; atoms, derivations, reactions, dependency trees, optimizations. Cool stuff can be found here.\r\n * - types/ All the magic that is need to have observable objects, arrays and values is in this folder. Including the modifiers like `asFlat`.\r\n * - utils/ Utility stuff.\r\n *\r\n */\n[\"Symbol\", \"Map\", \"Set\"].forEach(function (m) {\n var g = getGlobal();\n if (typeof g[m] === \"undefined\") {\n die(\"MobX requires global '\" + m + \"' to be available or polyfilled\");\n }\n});\nif (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === \"object\") {\n // See: https://github.com/andykog/mobx-devtools/\n __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({\n spy: spy,\n extras: {\n getDebugName: getDebugName\n },\n $mobx: $mobx\n });\n}\n\nexport { $mobx, FlowCancellationError, ObservableMap, ObservableSet, Reaction, allowStateChanges as _allowStateChanges, runInAction as _allowStateChangesInsideComputed, allowStateReadsEnd as _allowStateReadsEnd, allowStateReadsStart as _allowStateReadsStart, autoAction as _autoAction, _endAction, getAdministration as _getAdministration, getGlobalState as _getGlobalState, interceptReads as _interceptReads, isComputingDerivation as _isComputingDerivation, resetGlobalState as _resetGlobalState, _startAction, action, autorun, comparer, computed, configure, createAtom, apiDefineProperty as defineProperty, entries, extendObservable, flow, flowResult, get, getAtom, getDebugName, getDependencyTree, getObserverTree, has, intercept, isAction, isObservableValue as isBoxedObservable, isComputed, isComputedProp, isFlow, isFlowCancellationError, isObservable, isObservableArray, isObservableMap, isObservableObject, isObservableProp, isObservableSet, keys, makeAutoObservable, makeObservable, observable, observe, onBecomeObserved, onBecomeUnobserved, onReactionError, override, apiOwnKeys as ownKeys, reaction, remove, runInAction, set, spy, toJS, trace, transaction, untracked, values, when };\n//# sourceMappingURL=mobx.esm.js.map\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n function next() {\n while (env.stack.length) {\n var rec = env.stack.pop();\n try {\n var result = rec.dispose && rec.dispose.call(rec.value);\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n catch (e) {\n fail(e);\n }\n }\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","export function isFunction(value) {\n return typeof value === 'function';\n}\n//# sourceMappingURL=isFunction.js.map","export function createErrorClass(createImpl) {\n var _super = function (instance) {\n Error.call(instance);\n instance.stack = new Error().stack;\n };\n var ctorFunc = createImpl(_super);\n ctorFunc.prototype = Object.create(Error.prototype);\n ctorFunc.prototype.constructor = ctorFunc;\n return ctorFunc;\n}\n//# sourceMappingURL=createErrorClass.js.map","import { createErrorClass } from './createErrorClass';\nexport var UnsubscriptionError = createErrorClass(function (_super) {\n return function UnsubscriptionErrorImpl(errors) {\n _super(this);\n this.message = errors\n ? errors.length + \" errors occurred during unsubscription:\\n\" + errors.map(function (err, i) { return i + 1 + \") \" + err.toString(); }).join('\\n ')\n : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n };\n});\n//# sourceMappingURL=UnsubscriptionError.js.map","export function arrRemove(arr, item) {\n if (arr) {\n var index = arr.indexOf(item);\n 0 <= index && arr.splice(index, 1);\n }\n}\n//# sourceMappingURL=arrRemove.js.map","import { __read, __spreadArray, __values } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { arrRemove } from './util/arrRemove';\nvar Subscription = (function () {\n function Subscription(initialTeardown) {\n this.initialTeardown = initialTeardown;\n this.closed = false;\n this._parentage = null;\n this._finalizers = null;\n }\n Subscription.prototype.unsubscribe = function () {\n var e_1, _a, e_2, _b;\n var errors;\n if (!this.closed) {\n this.closed = true;\n var _parentage = this._parentage;\n if (_parentage) {\n this._parentage = null;\n if (Array.isArray(_parentage)) {\n try {\n for (var _parentage_1 = __values(_parentage), _parentage_1_1 = _parentage_1.next(); !_parentage_1_1.done; _parentage_1_1 = _parentage_1.next()) {\n var parent_1 = _parentage_1_1.value;\n parent_1.remove(this);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_parentage_1_1 && !_parentage_1_1.done && (_a = _parentage_1.return)) _a.call(_parentage_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n else {\n _parentage.remove(this);\n }\n }\n var initialFinalizer = this.initialTeardown;\n if (isFunction(initialFinalizer)) {\n try {\n initialFinalizer();\n }\n catch (e) {\n errors = e instanceof UnsubscriptionError ? e.errors : [e];\n }\n }\n var _finalizers = this._finalizers;\n if (_finalizers) {\n this._finalizers = null;\n try {\n for (var _finalizers_1 = __values(_finalizers), _finalizers_1_1 = _finalizers_1.next(); !_finalizers_1_1.done; _finalizers_1_1 = _finalizers_1.next()) {\n var finalizer = _finalizers_1_1.value;\n try {\n execFinalizer(finalizer);\n }\n catch (err) {\n errors = errors !== null && errors !== void 0 ? errors : [];\n if (err instanceof UnsubscriptionError) {\n errors = __spreadArray(__spreadArray([], __read(errors)), __read(err.errors));\n }\n else {\n errors.push(err);\n }\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_finalizers_1_1 && !_finalizers_1_1.done && (_b = _finalizers_1.return)) _b.call(_finalizers_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n };\n Subscription.prototype.add = function (teardown) {\n var _a;\n if (teardown && teardown !== this) {\n if (this.closed) {\n execFinalizer(teardown);\n }\n else {\n if (teardown instanceof Subscription) {\n if (teardown.closed || teardown._hasParent(this)) {\n return;\n }\n teardown._addParent(this);\n }\n (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);\n }\n }\n };\n Subscription.prototype._hasParent = function (parent) {\n var _parentage = this._parentage;\n return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));\n };\n Subscription.prototype._addParent = function (parent) {\n var _parentage = this._parentage;\n this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;\n };\n Subscription.prototype._removeParent = function (parent) {\n var _parentage = this._parentage;\n if (_parentage === parent) {\n this._parentage = null;\n }\n else if (Array.isArray(_parentage)) {\n arrRemove(_parentage, parent);\n }\n };\n Subscription.prototype.remove = function (teardown) {\n var _finalizers = this._finalizers;\n _finalizers && arrRemove(_finalizers, teardown);\n if (teardown instanceof Subscription) {\n teardown._removeParent(this);\n }\n };\n Subscription.EMPTY = (function () {\n var empty = new Subscription();\n empty.closed = true;\n return empty;\n })();\n return Subscription;\n}());\nexport { Subscription };\nexport var EMPTY_SUBSCRIPTION = Subscription.EMPTY;\nexport function isSubscription(value) {\n return (value instanceof Subscription ||\n (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));\n}\nfunction execFinalizer(finalizer) {\n if (isFunction(finalizer)) {\n finalizer();\n }\n else {\n finalizer.unsubscribe();\n }\n}\n//# sourceMappingURL=Subscription.js.map","export var config = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: undefined,\n useDeprecatedSynchronousErrorHandling: false,\n useDeprecatedNextContext: false,\n};\n//# sourceMappingURL=config.js.map","import { __read, __spreadArray } from \"tslib\";\nexport var timeoutProvider = {\n setTimeout: function (handler, timeout) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var delegate = timeoutProvider.delegate;\n if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {\n return delegate.setTimeout.apply(delegate, __spreadArray([handler, timeout], __read(args)));\n }\n return setTimeout.apply(void 0, __spreadArray([handler, timeout], __read(args)));\n },\n clearTimeout: function (handle) {\n var delegate = timeoutProvider.delegate;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);\n },\n delegate: undefined,\n};\n//# sourceMappingURL=timeoutProvider.js.map","import { config } from '../config';\nimport { timeoutProvider } from '../scheduler/timeoutProvider';\nexport function reportUnhandledError(err) {\n timeoutProvider.setTimeout(function () {\n var onUnhandledError = config.onUnhandledError;\n if (onUnhandledError) {\n onUnhandledError(err);\n }\n else {\n throw err;\n }\n });\n}\n//# sourceMappingURL=reportUnhandledError.js.map","export function noop() { }\n//# sourceMappingURL=noop.js.map","import { config } from '../config';\nvar context = null;\nexport function errorContext(cb) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n var isRoot = !context;\n if (isRoot) {\n context = { errorThrown: false, error: null };\n }\n cb();\n if (isRoot) {\n var _a = context, errorThrown = _a.errorThrown, error = _a.error;\n context = null;\n if (errorThrown) {\n throw error;\n }\n }\n }\n else {\n cb();\n }\n}\nexport function captureError(err) {\n if (config.useDeprecatedSynchronousErrorHandling && context) {\n context.errorThrown = true;\n context.error = err;\n }\n}\n//# sourceMappingURL=errorContext.js.map","import { __extends } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { isSubscription, Subscription } from './Subscription';\nimport { config } from './config';\nimport { reportUnhandledError } from './util/reportUnhandledError';\nimport { noop } from './util/noop';\nimport { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';\nimport { timeoutProvider } from './scheduler/timeoutProvider';\nimport { captureError } from './util/errorContext';\nvar Subscriber = (function (_super) {\n __extends(Subscriber, _super);\n function Subscriber(destination) {\n var _this = _super.call(this) || this;\n _this.isStopped = false;\n if (destination) {\n _this.destination = destination;\n if (isSubscription(destination)) {\n destination.add(_this);\n }\n }\n else {\n _this.destination = EMPTY_OBSERVER;\n }\n return _this;\n }\n Subscriber.create = function (next, error, complete) {\n return new SafeSubscriber(next, error, complete);\n };\n Subscriber.prototype.next = function (value) {\n if (this.isStopped) {\n handleStoppedNotification(nextNotification(value), this);\n }\n else {\n this._next(value);\n }\n };\n Subscriber.prototype.error = function (err) {\n if (this.isStopped) {\n handleStoppedNotification(errorNotification(err), this);\n }\n else {\n this.isStopped = true;\n this._error(err);\n }\n };\n Subscriber.prototype.complete = function () {\n if (this.isStopped) {\n handleStoppedNotification(COMPLETE_NOTIFICATION, this);\n }\n else {\n this.isStopped = true;\n this._complete();\n }\n };\n Subscriber.prototype.unsubscribe = function () {\n if (!this.closed) {\n this.isStopped = true;\n _super.prototype.unsubscribe.call(this);\n this.destination = null;\n }\n };\n Subscriber.prototype._next = function (value) {\n this.destination.next(value);\n };\n Subscriber.prototype._error = function (err) {\n try {\n this.destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n };\n Subscriber.prototype._complete = function () {\n try {\n this.destination.complete();\n }\n finally {\n this.unsubscribe();\n }\n };\n return Subscriber;\n}(Subscription));\nexport { Subscriber };\nvar _bind = Function.prototype.bind;\nfunction bind(fn, thisArg) {\n return _bind.call(fn, thisArg);\n}\nvar ConsumerObserver = (function () {\n function ConsumerObserver(partialObserver) {\n this.partialObserver = partialObserver;\n }\n ConsumerObserver.prototype.next = function (value) {\n var partialObserver = this.partialObserver;\n if (partialObserver.next) {\n try {\n partialObserver.next(value);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n ConsumerObserver.prototype.error = function (err) {\n var partialObserver = this.partialObserver;\n if (partialObserver.error) {\n try {\n partialObserver.error(err);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n else {\n handleUnhandledError(err);\n }\n };\n ConsumerObserver.prototype.complete = function () {\n var partialObserver = this.partialObserver;\n if (partialObserver.complete) {\n try {\n partialObserver.complete();\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n return ConsumerObserver;\n}());\nvar SafeSubscriber = (function (_super) {\n __extends(SafeSubscriber, _super);\n function SafeSubscriber(observerOrNext, error, complete) {\n var _this = _super.call(this) || this;\n var partialObserver;\n if (isFunction(observerOrNext) || !observerOrNext) {\n partialObserver = {\n next: observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined,\n error: error !== null && error !== void 0 ? error : undefined,\n complete: complete !== null && complete !== void 0 ? complete : undefined,\n };\n }\n else {\n var context_1;\n if (_this && config.useDeprecatedNextContext) {\n context_1 = Object.create(observerOrNext);\n context_1.unsubscribe = function () { return _this.unsubscribe(); };\n partialObserver = {\n next: observerOrNext.next && bind(observerOrNext.next, context_1),\n error: observerOrNext.error && bind(observerOrNext.error, context_1),\n complete: observerOrNext.complete && bind(observerOrNext.complete, context_1),\n };\n }\n else {\n partialObserver = observerOrNext;\n }\n }\n _this.destination = new ConsumerObserver(partialObserver);\n return _this;\n }\n return SafeSubscriber;\n}(Subscriber));\nexport { SafeSubscriber };\nfunction handleUnhandledError(error) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n captureError(error);\n }\n else {\n reportUnhandledError(error);\n }\n}\nfunction defaultErrorHandler(err) {\n throw err;\n}\nfunction handleStoppedNotification(notification, subscriber) {\n var onStoppedNotification = config.onStoppedNotification;\n onStoppedNotification && timeoutProvider.setTimeout(function () { return onStoppedNotification(notification, subscriber); });\n}\nexport var EMPTY_OBSERVER = {\n closed: true,\n next: noop,\n error: defaultErrorHandler,\n complete: noop,\n};\n//# sourceMappingURL=Subscriber.js.map","export var observable = (function () { return (typeof Symbol === 'function' && Symbol.observable) || '@@observable'; })();\n//# sourceMappingURL=observable.js.map","export function identity(x) {\n return x;\n}\n//# sourceMappingURL=identity.js.map","import { identity } from './identity';\nexport function pipe() {\n var fns = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n fns[_i] = arguments[_i];\n }\n return pipeFromArray(fns);\n}\nexport function pipeFromArray(fns) {\n if (fns.length === 0) {\n return identity;\n }\n if (fns.length === 1) {\n return fns[0];\n }\n return function piped(input) {\n return fns.reduce(function (prev, fn) { return fn(prev); }, input);\n };\n}\n//# sourceMappingURL=pipe.js.map","import { SafeSubscriber, Subscriber } from './Subscriber';\nimport { isSubscription } from './Subscription';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nimport { isFunction } from './util/isFunction';\nimport { errorContext } from './util/errorContext';\nvar Observable = (function () {\n function Observable(subscribe) {\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n Observable.prototype.lift = function (operator) {\n var observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n };\n Observable.prototype.subscribe = function (observerOrNext, error, complete) {\n var _this = this;\n var subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);\n errorContext(function () {\n var _a = _this, operator = _a.operator, source = _a.source;\n subscriber.add(operator\n ?\n operator.call(subscriber, source)\n : source\n ?\n _this._subscribe(subscriber)\n :\n _this._trySubscribe(subscriber));\n });\n return subscriber;\n };\n Observable.prototype._trySubscribe = function (sink) {\n try {\n return this._subscribe(sink);\n }\n catch (err) {\n sink.error(err);\n }\n };\n Observable.prototype.forEach = function (next, promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var subscriber = new SafeSubscriber({\n next: function (value) {\n try {\n next(value);\n }\n catch (err) {\n reject(err);\n subscriber.unsubscribe();\n }\n },\n error: reject,\n complete: resolve,\n });\n _this.subscribe(subscriber);\n });\n };\n Observable.prototype._subscribe = function (subscriber) {\n var _a;\n return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);\n };\n Observable.prototype[Symbol_observable] = function () {\n return this;\n };\n Observable.prototype.pipe = function () {\n var operations = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operations[_i] = arguments[_i];\n }\n return pipeFromArray(operations)(this);\n };\n Observable.prototype.toPromise = function (promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var value;\n _this.subscribe(function (x) { return (value = x); }, function (err) { return reject(err); }, function () { return resolve(value); });\n });\n };\n Observable.create = function (subscribe) {\n return new Observable(subscribe);\n };\n return Observable;\n}());\nexport { Observable };\nfunction getPromiseCtor(promiseCtor) {\n var _a;\n return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;\n}\nfunction isObserver(value) {\n return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);\n}\nfunction isSubscriber(value) {\n return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));\n}\n//# sourceMappingURL=Observable.js.map","import { isFunction } from './isFunction';\nexport function hasLift(source) {\n return isFunction(source === null || source === void 0 ? void 0 : source.lift);\n}\nexport function operate(init) {\n return function (source) {\n if (hasLift(source)) {\n return source.lift(function (liftedSource) {\n try {\n return init(liftedSource, this);\n }\n catch (err) {\n this.error(err);\n }\n });\n }\n throw new TypeError('Unable to lift unknown Observable type');\n };\n}\n//# sourceMappingURL=lift.js.map","import { __extends } from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nexport function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {\n return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);\n}\nvar OperatorSubscriber = (function (_super) {\n __extends(OperatorSubscriber, _super);\n function OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {\n var _this = _super.call(this, destination) || this;\n _this.onFinalize = onFinalize;\n _this.shouldUnsubscribe = shouldUnsubscribe;\n _this._next = onNext\n ? function (value) {\n try {\n onNext(value);\n }\n catch (err) {\n destination.error(err);\n }\n }\n : _super.prototype._next;\n _this._error = onError\n ? function (err) {\n try {\n onError(err);\n }\n catch (err) {\n destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n }\n : _super.prototype._error;\n _this._complete = onComplete\n ? function () {\n try {\n onComplete();\n }\n catch (err) {\n destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n }\n : _super.prototype._complete;\n return _this;\n }\n OperatorSubscriber.prototype.unsubscribe = function () {\n var _a;\n if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {\n var closed_1 = this.closed;\n _super.prototype.unsubscribe.call(this);\n !closed_1 && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));\n }\n };\n return OperatorSubscriber;\n}(Subscriber));\nexport { OperatorSubscriber };\n//# sourceMappingURL=OperatorSubscriber.js.map","import { createErrorClass } from './createErrorClass';\nexport var ObjectUnsubscribedError = createErrorClass(function (_super) {\n return function ObjectUnsubscribedErrorImpl() {\n _super(this);\n this.name = 'ObjectUnsubscribedError';\n this.message = 'object unsubscribed';\n };\n});\n//# sourceMappingURL=ObjectUnsubscribedError.js.map","import { __extends, __values } from \"tslib\";\nimport { Observable } from './Observable';\nimport { Subscription, EMPTY_SUBSCRIPTION } from './Subscription';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { arrRemove } from './util/arrRemove';\nimport { errorContext } from './util/errorContext';\nvar Subject = (function (_super) {\n __extends(Subject, _super);\n function Subject() {\n var _this = _super.call(this) || this;\n _this.closed = false;\n _this.currentObservers = null;\n _this.observers = [];\n _this.isStopped = false;\n _this.hasError = false;\n _this.thrownError = null;\n return _this;\n }\n Subject.prototype.lift = function (operator) {\n var subject = new AnonymousSubject(this, this);\n subject.operator = operator;\n return subject;\n };\n Subject.prototype._throwIfClosed = function () {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n };\n Subject.prototype.next = function (value) {\n var _this = this;\n errorContext(function () {\n var e_1, _a;\n _this._throwIfClosed();\n if (!_this.isStopped) {\n if (!_this.currentObservers) {\n _this.currentObservers = Array.from(_this.observers);\n }\n try {\n for (var _b = __values(_this.currentObservers), _c = _b.next(); !_c.done; _c = _b.next()) {\n var observer = _c.value;\n observer.next(value);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n });\n };\n Subject.prototype.error = function (err) {\n var _this = this;\n errorContext(function () {\n _this._throwIfClosed();\n if (!_this.isStopped) {\n _this.hasError = _this.isStopped = true;\n _this.thrownError = err;\n var observers = _this.observers;\n while (observers.length) {\n observers.shift().error(err);\n }\n }\n });\n };\n Subject.prototype.complete = function () {\n var _this = this;\n errorContext(function () {\n _this._throwIfClosed();\n if (!_this.isStopped) {\n _this.isStopped = true;\n var observers = _this.observers;\n while (observers.length) {\n observers.shift().complete();\n }\n }\n });\n };\n Subject.prototype.unsubscribe = function () {\n this.isStopped = this.closed = true;\n this.observers = this.currentObservers = null;\n };\n Object.defineProperty(Subject.prototype, \"observed\", {\n get: function () {\n var _a;\n return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;\n },\n enumerable: false,\n configurable: true\n });\n Subject.prototype._trySubscribe = function (subscriber) {\n this._throwIfClosed();\n return _super.prototype._trySubscribe.call(this, subscriber);\n };\n Subject.prototype._subscribe = function (subscriber) {\n this._throwIfClosed();\n this._checkFinalizedStatuses(subscriber);\n return this._innerSubscribe(subscriber);\n };\n Subject.prototype._innerSubscribe = function (subscriber) {\n var _this = this;\n var _a = this, hasError = _a.hasError, isStopped = _a.isStopped, observers = _a.observers;\n if (hasError || isStopped) {\n return EMPTY_SUBSCRIPTION;\n }\n this.currentObservers = null;\n observers.push(subscriber);\n return new Subscription(function () {\n _this.currentObservers = null;\n arrRemove(observers, subscriber);\n });\n };\n Subject.prototype._checkFinalizedStatuses = function (subscriber) {\n var _a = this, hasError = _a.hasError, thrownError = _a.thrownError, isStopped = _a.isStopped;\n if (hasError) {\n subscriber.error(thrownError);\n }\n else if (isStopped) {\n subscriber.complete();\n }\n };\n Subject.prototype.asObservable = function () {\n var observable = new Observable();\n observable.source = this;\n return observable;\n };\n Subject.create = function (destination, source) {\n return new AnonymousSubject(destination, source);\n };\n return Subject;\n}(Observable));\nexport { Subject };\nvar AnonymousSubject = (function (_super) {\n __extends(AnonymousSubject, _super);\n function AnonymousSubject(destination, source) {\n var _this = _super.call(this) || this;\n _this.destination = destination;\n _this.source = source;\n return _this;\n }\n AnonymousSubject.prototype.next = function (value) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value);\n };\n AnonymousSubject.prototype.error = function (err) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err);\n };\n AnonymousSubject.prototype.complete = function () {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a);\n };\n AnonymousSubject.prototype._subscribe = function (subscriber) {\n var _a, _b;\n return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : EMPTY_SUBSCRIPTION;\n };\n return AnonymousSubject;\n}(Subject));\nexport { AnonymousSubject };\n//# sourceMappingURL=Subject.js.map","export var dateTimestampProvider = {\n now: function () {\n return (dateTimestampProvider.delegate || Date).now();\n },\n delegate: undefined,\n};\n//# sourceMappingURL=dateTimestampProvider.js.map","import { __extends } from \"tslib\";\nimport { Subject } from './Subject';\nimport { dateTimestampProvider } from './scheduler/dateTimestampProvider';\nvar ReplaySubject = (function (_super) {\n __extends(ReplaySubject, _super);\n function ReplaySubject(_bufferSize, _windowTime, _timestampProvider) {\n if (_bufferSize === void 0) { _bufferSize = Infinity; }\n if (_windowTime === void 0) { _windowTime = Infinity; }\n if (_timestampProvider === void 0) { _timestampProvider = dateTimestampProvider; }\n var _this = _super.call(this) || this;\n _this._bufferSize = _bufferSize;\n _this._windowTime = _windowTime;\n _this._timestampProvider = _timestampProvider;\n _this._buffer = [];\n _this._infiniteTimeWindow = true;\n _this._infiniteTimeWindow = _windowTime === Infinity;\n _this._bufferSize = Math.max(1, _bufferSize);\n _this._windowTime = Math.max(1, _windowTime);\n return _this;\n }\n ReplaySubject.prototype.next = function (value) {\n var _a = this, isStopped = _a.isStopped, _buffer = _a._buffer, _infiniteTimeWindow = _a._infiniteTimeWindow, _timestampProvider = _a._timestampProvider, _windowTime = _a._windowTime;\n if (!isStopped) {\n _buffer.push(value);\n !_infiniteTimeWindow && _buffer.push(_timestampProvider.now() + _windowTime);\n }\n this._trimBuffer();\n _super.prototype.next.call(this, value);\n };\n ReplaySubject.prototype._subscribe = function (subscriber) {\n this._throwIfClosed();\n this._trimBuffer();\n var subscription = this._innerSubscribe(subscriber);\n var _a = this, _infiniteTimeWindow = _a._infiniteTimeWindow, _buffer = _a._buffer;\n var copy = _buffer.slice();\n for (var i = 0; i < copy.length && !subscriber.closed; i += _infiniteTimeWindow ? 1 : 2) {\n subscriber.next(copy[i]);\n }\n this._checkFinalizedStatuses(subscriber);\n return subscription;\n };\n ReplaySubject.prototype._trimBuffer = function () {\n var _a = this, _bufferSize = _a._bufferSize, _timestampProvider = _a._timestampProvider, _buffer = _a._buffer, _infiniteTimeWindow = _a._infiniteTimeWindow;\n var adjustedBufferSize = (_infiniteTimeWindow ? 1 : 2) * _bufferSize;\n _bufferSize < Infinity && adjustedBufferSize < _buffer.length && _buffer.splice(0, _buffer.length - adjustedBufferSize);\n if (!_infiniteTimeWindow) {\n var now = _timestampProvider.now();\n var last = 0;\n for (var i = 1; i < _buffer.length && _buffer[i] <= now; i += 2) {\n last = i;\n }\n last && _buffer.splice(0, last + 1);\n }\n };\n return ReplaySubject;\n}(Subject));\nexport { ReplaySubject };\n//# sourceMappingURL=ReplaySubject.js.map","import { Observable } from '../Observable';\nexport var EMPTY = new Observable(function (subscriber) { return subscriber.complete(); });\nexport function empty(scheduler) {\n return scheduler ? emptyScheduled(scheduler) : EMPTY;\n}\nfunction emptyScheduled(scheduler) {\n return new Observable(function (subscriber) { return scheduler.schedule(function () { return subscriber.complete(); }); });\n}\n//# sourceMappingURL=empty.js.map","import { isFunction } from './isFunction';\nexport function isScheduler(value) {\n return value && isFunction(value.schedule);\n}\n//# sourceMappingURL=isScheduler.js.map","import { isFunction } from './isFunction';\nimport { isScheduler } from './isScheduler';\nfunction last(arr) {\n return arr[arr.length - 1];\n}\nexport function popResultSelector(args) {\n return isFunction(last(args)) ? args.pop() : undefined;\n}\nexport function popScheduler(args) {\n return isScheduler(last(args)) ? args.pop() : undefined;\n}\nexport function popNumber(args, defaultValue) {\n return typeof last(args) === 'number' ? args.pop() : defaultValue;\n}\n//# sourceMappingURL=args.js.map","export var isArrayLike = (function (x) { return x && typeof x.length === 'number' && typeof x !== 'function'; });\n//# sourceMappingURL=isArrayLike.js.map","import { isFunction } from \"./isFunction\";\nexport function isPromise(value) {\n return isFunction(value === null || value === void 0 ? void 0 : value.then);\n}\n//# sourceMappingURL=isPromise.js.map","import { observable as Symbol_observable } from '../symbol/observable';\nimport { isFunction } from './isFunction';\nexport function isInteropObservable(input) {\n return isFunction(input[Symbol_observable]);\n}\n//# sourceMappingURL=isInteropObservable.js.map","import { isFunction } from './isFunction';\nexport function isAsyncIterable(obj) {\n return Symbol.asyncIterator && isFunction(obj === null || obj === void 0 ? void 0 : obj[Symbol.asyncIterator]);\n}\n//# sourceMappingURL=isAsyncIterable.js.map","export function createInvalidObservableTypeError(input) {\n return new TypeError(\"You provided \" + (input !== null && typeof input === 'object' ? 'an invalid object' : \"'\" + input + \"'\") + \" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.\");\n}\n//# sourceMappingURL=throwUnobservableError.js.map","export function getSymbolIterator() {\n if (typeof Symbol !== 'function' || !Symbol.iterator) {\n return '@@iterator';\n }\n return Symbol.iterator;\n}\nexport var iterator = getSymbolIterator();\n//# sourceMappingURL=iterator.js.map","import { iterator as Symbol_iterator } from '../symbol/iterator';\nimport { isFunction } from './isFunction';\nexport function isIterable(input) {\n return isFunction(input === null || input === void 0 ? void 0 : input[Symbol_iterator]);\n}\n//# sourceMappingURL=isIterable.js.map","import { __asyncGenerator, __await, __generator } from \"tslib\";\nimport { isFunction } from './isFunction';\nexport function readableStreamLikeToAsyncGenerator(readableStream) {\n return __asyncGenerator(this, arguments, function readableStreamLikeToAsyncGenerator_1() {\n var reader, _a, value, done;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n reader = readableStream.getReader();\n _b.label = 1;\n case 1:\n _b.trys.push([1, , 9, 10]);\n _b.label = 2;\n case 2:\n if (!true) return [3, 8];\n return [4, __await(reader.read())];\n case 3:\n _a = _b.sent(), value = _a.value, done = _a.done;\n if (!done) return [3, 5];\n return [4, __await(void 0)];\n case 4: return [2, _b.sent()];\n case 5: return [4, __await(value)];\n case 6: return [4, _b.sent()];\n case 7:\n _b.sent();\n return [3, 2];\n case 8: return [3, 10];\n case 9:\n reader.releaseLock();\n return [7];\n case 10: return [2];\n }\n });\n });\n}\nexport function isReadableStreamLike(obj) {\n return isFunction(obj === null || obj === void 0 ? void 0 : obj.getReader);\n}\n//# sourceMappingURL=isReadableStreamLike.js.map","import { __asyncValues, __awaiter, __generator, __values } from \"tslib\";\nimport { isArrayLike } from '../util/isArrayLike';\nimport { isPromise } from '../util/isPromise';\nimport { Observable } from '../Observable';\nimport { isInteropObservable } from '../util/isInteropObservable';\nimport { isAsyncIterable } from '../util/isAsyncIterable';\nimport { createInvalidObservableTypeError } from '../util/throwUnobservableError';\nimport { isIterable } from '../util/isIterable';\nimport { isReadableStreamLike, readableStreamLikeToAsyncGenerator } from '../util/isReadableStreamLike';\nimport { isFunction } from '../util/isFunction';\nimport { reportUnhandledError } from '../util/reportUnhandledError';\nimport { observable as Symbol_observable } from '../symbol/observable';\nexport function innerFrom(input) {\n if (input instanceof Observable) {\n return input;\n }\n if (input != null) {\n if (isInteropObservable(input)) {\n return fromInteropObservable(input);\n }\n if (isArrayLike(input)) {\n return fromArrayLike(input);\n }\n if (isPromise(input)) {\n return fromPromise(input);\n }\n if (isAsyncIterable(input)) {\n return fromAsyncIterable(input);\n }\n if (isIterable(input)) {\n return fromIterable(input);\n }\n if (isReadableStreamLike(input)) {\n return fromReadableStreamLike(input);\n }\n }\n throw createInvalidObservableTypeError(input);\n}\nexport function fromInteropObservable(obj) {\n return new Observable(function (subscriber) {\n var obs = obj[Symbol_observable]();\n if (isFunction(obs.subscribe)) {\n return obs.subscribe(subscriber);\n }\n throw new TypeError('Provided object does not correctly implement Symbol.observable');\n });\n}\nexport function fromArrayLike(array) {\n return new Observable(function (subscriber) {\n for (var i = 0; i < array.length && !subscriber.closed; i++) {\n subscriber.next(array[i]);\n }\n subscriber.complete();\n });\n}\nexport function fromPromise(promise) {\n return new Observable(function (subscriber) {\n promise\n .then(function (value) {\n if (!subscriber.closed) {\n subscriber.next(value);\n subscriber.complete();\n }\n }, function (err) { return subscriber.error(err); })\n .then(null, reportUnhandledError);\n });\n}\nexport function fromIterable(iterable) {\n return new Observable(function (subscriber) {\n var e_1, _a;\n try {\n for (var iterable_1 = __values(iterable), iterable_1_1 = iterable_1.next(); !iterable_1_1.done; iterable_1_1 = iterable_1.next()) {\n var value = iterable_1_1.value;\n subscriber.next(value);\n if (subscriber.closed) {\n return;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (iterable_1_1 && !iterable_1_1.done && (_a = iterable_1.return)) _a.call(iterable_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n subscriber.complete();\n });\n}\nexport function fromAsyncIterable(asyncIterable) {\n return new Observable(function (subscriber) {\n process(asyncIterable, subscriber).catch(function (err) { return subscriber.error(err); });\n });\n}\nexport function fromReadableStreamLike(readableStream) {\n return fromAsyncIterable(readableStreamLikeToAsyncGenerator(readableStream));\n}\nfunction process(asyncIterable, subscriber) {\n var asyncIterable_1, asyncIterable_1_1;\n var e_2, _a;\n return __awaiter(this, void 0, void 0, function () {\n var value, e_2_1;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _b.trys.push([0, 5, 6, 11]);\n asyncIterable_1 = __asyncValues(asyncIterable);\n _b.label = 1;\n case 1: return [4, asyncIterable_1.next()];\n case 2:\n if (!(asyncIterable_1_1 = _b.sent(), !asyncIterable_1_1.done)) return [3, 4];\n value = asyncIterable_1_1.value;\n subscriber.next(value);\n if (subscriber.closed) {\n return [2];\n }\n _b.label = 3;\n case 3: return [3, 1];\n case 4: return [3, 11];\n case 5:\n e_2_1 = _b.sent();\n e_2 = { error: e_2_1 };\n return [3, 11];\n case 6:\n _b.trys.push([6, , 9, 10]);\n if (!(asyncIterable_1_1 && !asyncIterable_1_1.done && (_a = asyncIterable_1.return))) return [3, 8];\n return [4, _a.call(asyncIterable_1)];\n case 7:\n _b.sent();\n _b.label = 8;\n case 8: return [3, 10];\n case 9:\n if (e_2) throw e_2.error;\n return [7];\n case 10: return [7];\n case 11:\n subscriber.complete();\n return [2];\n }\n });\n });\n}\n//# sourceMappingURL=innerFrom.js.map","export function executeSchedule(parentSubscription, scheduler, work, delay, repeat) {\n if (delay === void 0) { delay = 0; }\n if (repeat === void 0) { repeat = false; }\n var scheduleSubscription = scheduler.schedule(function () {\n work();\n if (repeat) {\n parentSubscription.add(this.schedule(null, delay));\n }\n else {\n this.unsubscribe();\n }\n }, delay);\n parentSubscription.add(scheduleSubscription);\n if (!repeat) {\n return scheduleSubscription;\n }\n}\n//# sourceMappingURL=executeSchedule.js.map","import { executeSchedule } from '../util/executeSchedule';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function observeOn(scheduler, delay) {\n if (delay === void 0) { delay = 0; }\n return operate(function (source, subscriber) {\n source.subscribe(createOperatorSubscriber(subscriber, function (value) { return executeSchedule(subscriber, scheduler, function () { return subscriber.next(value); }, delay); }, function () { return executeSchedule(subscriber, scheduler, function () { return subscriber.complete(); }, delay); }, function (err) { return executeSchedule(subscriber, scheduler, function () { return subscriber.error(err); }, delay); }));\n });\n}\n//# sourceMappingURL=observeOn.js.map","import { operate } from '../util/lift';\nexport function subscribeOn(scheduler, delay) {\n if (delay === void 0) { delay = 0; }\n return operate(function (source, subscriber) {\n subscriber.add(scheduler.schedule(function () { return source.subscribe(subscriber); }, delay));\n });\n}\n//# sourceMappingURL=subscribeOn.js.map","import { innerFrom } from '../observable/innerFrom';\nimport { observeOn } from '../operators/observeOn';\nimport { subscribeOn } from '../operators/subscribeOn';\nexport function scheduleObservable(input, scheduler) {\n return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));\n}\n//# sourceMappingURL=scheduleObservable.js.map","import { innerFrom } from '../observable/innerFrom';\nimport { observeOn } from '../operators/observeOn';\nimport { subscribeOn } from '../operators/subscribeOn';\nexport function schedulePromise(input, scheduler) {\n return innerFrom(input).pipe(subscribeOn(scheduler), observeOn(scheduler));\n}\n//# sourceMappingURL=schedulePromise.js.map","import { Observable } from '../Observable';\nexport function scheduleArray(input, scheduler) {\n return new Observable(function (subscriber) {\n var i = 0;\n return scheduler.schedule(function () {\n if (i === input.length) {\n subscriber.complete();\n }\n else {\n subscriber.next(input[i++]);\n if (!subscriber.closed) {\n this.schedule();\n }\n }\n });\n });\n}\n//# sourceMappingURL=scheduleArray.js.map","import { Observable } from '../Observable';\nimport { iterator as Symbol_iterator } from '../symbol/iterator';\nimport { isFunction } from '../util/isFunction';\nimport { executeSchedule } from '../util/executeSchedule';\nexport function scheduleIterable(input, scheduler) {\n return new Observable(function (subscriber) {\n var iterator;\n executeSchedule(subscriber, scheduler, function () {\n iterator = input[Symbol_iterator]();\n executeSchedule(subscriber, scheduler, function () {\n var _a;\n var value;\n var done;\n try {\n (_a = iterator.next(), value = _a.value, done = _a.done);\n }\n catch (err) {\n subscriber.error(err);\n return;\n }\n if (done) {\n subscriber.complete();\n }\n else {\n subscriber.next(value);\n }\n }, 0, true);\n });\n return function () { return isFunction(iterator === null || iterator === void 0 ? void 0 : iterator.return) && iterator.return(); };\n });\n}\n//# sourceMappingURL=scheduleIterable.js.map","import { Observable } from '../Observable';\nimport { executeSchedule } from '../util/executeSchedule';\nexport function scheduleAsyncIterable(input, scheduler) {\n if (!input) {\n throw new Error('Iterable cannot be null');\n }\n return new Observable(function (subscriber) {\n executeSchedule(subscriber, scheduler, function () {\n var iterator = input[Symbol.asyncIterator]();\n executeSchedule(subscriber, scheduler, function () {\n iterator.next().then(function (result) {\n if (result.done) {\n subscriber.complete();\n }\n else {\n subscriber.next(result.value);\n }\n });\n }, 0, true);\n });\n });\n}\n//# sourceMappingURL=scheduleAsyncIterable.js.map","import { scheduleAsyncIterable } from './scheduleAsyncIterable';\nimport { readableStreamLikeToAsyncGenerator } from '../util/isReadableStreamLike';\nexport function scheduleReadableStreamLike(input, scheduler) {\n return scheduleAsyncIterable(readableStreamLikeToAsyncGenerator(input), scheduler);\n}\n//# sourceMappingURL=scheduleReadableStreamLike.js.map","import { scheduleObservable } from './scheduleObservable';\nimport { schedulePromise } from './schedulePromise';\nimport { scheduleArray } from './scheduleArray';\nimport { scheduleIterable } from './scheduleIterable';\nimport { scheduleAsyncIterable } from './scheduleAsyncIterable';\nimport { isInteropObservable } from '../util/isInteropObservable';\nimport { isPromise } from '../util/isPromise';\nimport { isArrayLike } from '../util/isArrayLike';\nimport { isIterable } from '../util/isIterable';\nimport { isAsyncIterable } from '../util/isAsyncIterable';\nimport { createInvalidObservableTypeError } from '../util/throwUnobservableError';\nimport { isReadableStreamLike } from '../util/isReadableStreamLike';\nimport { scheduleReadableStreamLike } from './scheduleReadableStreamLike';\nexport function scheduled(input, scheduler) {\n if (input != null) {\n if (isInteropObservable(input)) {\n return scheduleObservable(input, scheduler);\n }\n if (isArrayLike(input)) {\n return scheduleArray(input, scheduler);\n }\n if (isPromise(input)) {\n return schedulePromise(input, scheduler);\n }\n if (isAsyncIterable(input)) {\n return scheduleAsyncIterable(input, scheduler);\n }\n if (isIterable(input)) {\n return scheduleIterable(input, scheduler);\n }\n if (isReadableStreamLike(input)) {\n return scheduleReadableStreamLike(input, scheduler);\n }\n }\n throw createInvalidObservableTypeError(input);\n}\n//# sourceMappingURL=scheduled.js.map","import { scheduled } from '../scheduled/scheduled';\nimport { innerFrom } from './innerFrom';\nexport function from(input, scheduler) {\n return scheduler ? scheduled(input, scheduler) : innerFrom(input);\n}\n//# sourceMappingURL=from.js.map","import { popScheduler } from '../util/args';\nimport { from } from './from';\nexport function of() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var scheduler = popScheduler(args);\n return from(args, scheduler);\n}\n//# sourceMappingURL=of.js.map","import { createErrorClass } from './createErrorClass';\nexport var EmptyError = createErrorClass(function (_super) { return function EmptyErrorImpl() {\n _super(this);\n this.name = 'EmptyError';\n this.message = 'no elements in sequence';\n}; });\n//# sourceMappingURL=EmptyError.js.map","import { EmptyError } from './util/EmptyError';\nimport { SafeSubscriber } from './Subscriber';\nexport function firstValueFrom(source, config) {\n var hasConfig = typeof config === 'object';\n return new Promise(function (resolve, reject) {\n var subscriber = new SafeSubscriber({\n next: function (value) {\n resolve(value);\n subscriber.unsubscribe();\n },\n error: reject,\n complete: function () {\n if (hasConfig) {\n resolve(config.defaultValue);\n }\n else {\n reject(new EmptyError());\n }\n },\n });\n source.subscribe(subscriber);\n });\n}\n//# sourceMappingURL=firstValueFrom.js.map","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function map(project, thisArg) {\n return operate(function (source, subscriber) {\n var index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n subscriber.next(project.call(thisArg, value, index++));\n }));\n });\n}\n//# sourceMappingURL=map.js.map","import { __read, __spreadArray } from \"tslib\";\nimport { map } from \"../operators/map\";\nvar isArray = Array.isArray;\nfunction callOrApply(fn, args) {\n return isArray(args) ? fn.apply(void 0, __spreadArray([], __read(args))) : fn(args);\n}\nexport function mapOneOrManyArgs(fn) {\n return map(function (args) { return callOrApply(fn, args); });\n}\n//# sourceMappingURL=mapOneOrManyArgs.js.map","var isArray = Array.isArray;\nvar getPrototypeOf = Object.getPrototypeOf, objectProto = Object.prototype, getKeys = Object.keys;\nexport function argsArgArrayOrObject(args) {\n if (args.length === 1) {\n var first_1 = args[0];\n if (isArray(first_1)) {\n return { args: first_1, keys: null };\n }\n if (isPOJO(first_1)) {\n var keys = getKeys(first_1);\n return {\n args: keys.map(function (key) { return first_1[key]; }),\n keys: keys,\n };\n }\n }\n return { args: args, keys: null };\n}\nfunction isPOJO(obj) {\n return obj && typeof obj === 'object' && getPrototypeOf(obj) === objectProto;\n}\n//# sourceMappingURL=argsArgArrayOrObject.js.map","export function createObject(keys, values) {\n return keys.reduce(function (result, key, i) { return ((result[key] = values[i]), result); }, {});\n}\n//# sourceMappingURL=createObject.js.map","import { Observable } from '../Observable';\nimport { argsArgArrayOrObject } from '../util/argsArgArrayOrObject';\nimport { from } from './from';\nimport { identity } from '../util/identity';\nimport { mapOneOrManyArgs } from '../util/mapOneOrManyArgs';\nimport { popResultSelector, popScheduler } from '../util/args';\nimport { createObject } from '../util/createObject';\nimport { createOperatorSubscriber } from '../operators/OperatorSubscriber';\nimport { executeSchedule } from '../util/executeSchedule';\nexport function combineLatest() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var scheduler = popScheduler(args);\n var resultSelector = popResultSelector(args);\n var _a = argsArgArrayOrObject(args), observables = _a.args, keys = _a.keys;\n if (observables.length === 0) {\n return from([], scheduler);\n }\n var result = new Observable(combineLatestInit(observables, scheduler, keys\n ?\n function (values) { return createObject(keys, values); }\n :\n identity));\n return resultSelector ? result.pipe(mapOneOrManyArgs(resultSelector)) : result;\n}\nexport function combineLatestInit(observables, scheduler, valueTransform) {\n if (valueTransform === void 0) { valueTransform = identity; }\n return function (subscriber) {\n maybeSchedule(scheduler, function () {\n var length = observables.length;\n var values = new Array(length);\n var active = length;\n var remainingFirstValues = length;\n var _loop_1 = function (i) {\n maybeSchedule(scheduler, function () {\n var source = from(observables[i], scheduler);\n var hasFirstValue = false;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n values[i] = value;\n if (!hasFirstValue) {\n hasFirstValue = true;\n remainingFirstValues--;\n }\n if (!remainingFirstValues) {\n subscriber.next(valueTransform(values.slice()));\n }\n }, function () {\n if (!--active) {\n subscriber.complete();\n }\n }));\n }, subscriber);\n };\n for (var i = 0; i < length; i++) {\n _loop_1(i);\n }\n }, subscriber);\n };\n}\nfunction maybeSchedule(scheduler, execute, subscription) {\n if (scheduler) {\n executeSchedule(subscription, scheduler, execute);\n }\n else {\n execute();\n }\n}\n//# sourceMappingURL=combineLatest.js.map","import { innerFrom } from '../observable/innerFrom';\nimport { executeSchedule } from '../util/executeSchedule';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function mergeInternals(source, subscriber, project, concurrent, onBeforeNext, expand, innerSubScheduler, additionalFinalizer) {\n var buffer = [];\n var active = 0;\n var index = 0;\n var isComplete = false;\n var checkComplete = function () {\n if (isComplete && !buffer.length && !active) {\n subscriber.complete();\n }\n };\n var outerNext = function (value) { return (active < concurrent ? doInnerSub(value) : buffer.push(value)); };\n var doInnerSub = function (value) {\n expand && subscriber.next(value);\n active++;\n var innerComplete = false;\n innerFrom(project(value, index++)).subscribe(createOperatorSubscriber(subscriber, function (innerValue) {\n onBeforeNext === null || onBeforeNext === void 0 ? void 0 : onBeforeNext(innerValue);\n if (expand) {\n outerNext(innerValue);\n }\n else {\n subscriber.next(innerValue);\n }\n }, function () {\n innerComplete = true;\n }, undefined, function () {\n if (innerComplete) {\n try {\n active--;\n var _loop_1 = function () {\n var bufferedValue = buffer.shift();\n if (innerSubScheduler) {\n executeSchedule(subscriber, innerSubScheduler, function () { return doInnerSub(bufferedValue); });\n }\n else {\n doInnerSub(bufferedValue);\n }\n };\n while (buffer.length && active < concurrent) {\n _loop_1();\n }\n checkComplete();\n }\n catch (err) {\n subscriber.error(err);\n }\n }\n }));\n };\n source.subscribe(createOperatorSubscriber(subscriber, outerNext, function () {\n isComplete = true;\n checkComplete();\n }));\n return function () {\n additionalFinalizer === null || additionalFinalizer === void 0 ? void 0 : additionalFinalizer();\n };\n}\n//# sourceMappingURL=mergeInternals.js.map","import { map } from './map';\nimport { innerFrom } from '../observable/innerFrom';\nimport { operate } from '../util/lift';\nimport { mergeInternals } from './mergeInternals';\nimport { isFunction } from '../util/isFunction';\nexport function mergeMap(project, resultSelector, concurrent) {\n if (concurrent === void 0) { concurrent = Infinity; }\n if (isFunction(resultSelector)) {\n return mergeMap(function (a, i) { return map(function (b, ii) { return resultSelector(a, b, i, ii); })(innerFrom(project(a, i))); }, concurrent);\n }\n else if (typeof resultSelector === 'number') {\n concurrent = resultSelector;\n }\n return operate(function (source, subscriber) { return mergeInternals(source, subscriber, project, concurrent); });\n}\n//# sourceMappingURL=mergeMap.js.map","import { mergeMap } from './mergeMap';\nimport { identity } from '../util/identity';\nexport function mergeAll(concurrent) {\n if (concurrent === void 0) { concurrent = Infinity; }\n return mergeMap(identity, concurrent);\n}\n//# sourceMappingURL=mergeAll.js.map","import { mergeAll } from './mergeAll';\nexport function concatAll() {\n return mergeAll(1);\n}\n//# sourceMappingURL=concatAll.js.map","import { concatAll } from '../operators/concatAll';\nimport { popScheduler } from '../util/args';\nimport { from } from './from';\nexport function concat() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return concatAll()(from(args, popScheduler(args)));\n}\n//# sourceMappingURL=concat.js.map","import { Observable } from '../Observable';\nimport { innerFrom } from './innerFrom';\nexport function defer(observableFactory) {\n return new Observable(function (subscriber) {\n innerFrom(observableFactory()).subscribe(subscriber);\n });\n}\n//# sourceMappingURL=defer.js.map","import { mergeAll } from '../operators/mergeAll';\nimport { innerFrom } from './innerFrom';\nimport { EMPTY } from './empty';\nimport { popNumber, popScheduler } from '../util/args';\nimport { from } from './from';\nexport function merge() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var scheduler = popScheduler(args);\n var concurrent = popNumber(args, Infinity);\n var sources = args;\n return !sources.length\n ?\n EMPTY\n : sources.length === 1\n ?\n innerFrom(sources[0])\n :\n mergeAll(concurrent)(from(sources, scheduler));\n}\n//# sourceMappingURL=merge.js.map","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function filter(predicate, thisArg) {\n return operate(function (source, subscriber) {\n var index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) { return predicate.call(thisArg, value, index++) && subscriber.next(value); }));\n });\n}\n//# sourceMappingURL=filter.js.map","import { innerFrom } from '../observable/innerFrom';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { operate } from '../util/lift';\nexport function catchError(selector) {\n return operate(function (source, subscriber) {\n var innerSub = null;\n var syncUnsub = false;\n var handledResult;\n innerSub = source.subscribe(createOperatorSubscriber(subscriber, undefined, undefined, function (err) {\n handledResult = innerFrom(selector(err, catchError(selector)(source)));\n if (innerSub) {\n innerSub.unsubscribe();\n innerSub = null;\n handledResult.subscribe(subscriber);\n }\n else {\n syncUnsub = true;\n }\n }));\n if (syncUnsub) {\n innerSub.unsubscribe();\n innerSub = null;\n handledResult.subscribe(subscriber);\n }\n });\n}\n//# sourceMappingURL=catchError.js.map","import { mergeMap } from './mergeMap';\nimport { isFunction } from '../util/isFunction';\nexport function concatMap(project, resultSelector) {\n return isFunction(resultSelector) ? mergeMap(project, resultSelector, 1) : mergeMap(project, 1);\n}\n//# sourceMappingURL=concatMap.js.map","import { EMPTY } from '../observable/empty';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function take(count) {\n return count <= 0\n ?\n function () { return EMPTY; }\n : operate(function (source, subscriber) {\n var seen = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n if (++seen <= count) {\n subscriber.next(value);\n if (count <= seen) {\n subscriber.complete();\n }\n }\n }));\n });\n}\n//# sourceMappingURL=take.js.map","import { __read, __spreadArray } from \"tslib\";\nimport { from } from '../observable/from';\nimport { take } from '../operators/take';\nimport { Subject } from '../Subject';\nimport { SafeSubscriber } from '../Subscriber';\nimport { operate } from '../util/lift';\nexport function share(options) {\n if (options === void 0) { options = {}; }\n var _a = options.connector, connector = _a === void 0 ? function () { return new Subject(); } : _a, _b = options.resetOnError, resetOnError = _b === void 0 ? true : _b, _c = options.resetOnComplete, resetOnComplete = _c === void 0 ? true : _c, _d = options.resetOnRefCountZero, resetOnRefCountZero = _d === void 0 ? true : _d;\n return function (wrapperSource) {\n var connection = null;\n var resetConnection = null;\n var subject = null;\n var refCount = 0;\n var hasCompleted = false;\n var hasErrored = false;\n var cancelReset = function () {\n resetConnection === null || resetConnection === void 0 ? void 0 : resetConnection.unsubscribe();\n resetConnection = null;\n };\n var reset = function () {\n cancelReset();\n connection = subject = null;\n hasCompleted = hasErrored = false;\n };\n var resetAndUnsubscribe = function () {\n var conn = connection;\n reset();\n conn === null || conn === void 0 ? void 0 : conn.unsubscribe();\n };\n return operate(function (source, subscriber) {\n refCount++;\n if (!hasErrored && !hasCompleted) {\n cancelReset();\n }\n var dest = (subject = subject !== null && subject !== void 0 ? subject : connector());\n subscriber.add(function () {\n refCount--;\n if (refCount === 0 && !hasErrored && !hasCompleted) {\n resetConnection = handleReset(resetAndUnsubscribe, resetOnRefCountZero);\n }\n });\n dest.subscribe(subscriber);\n if (!connection) {\n connection = new SafeSubscriber({\n next: function (value) { return dest.next(value); },\n error: function (err) {\n hasErrored = true;\n cancelReset();\n resetConnection = handleReset(reset, resetOnError, err);\n dest.error(err);\n },\n complete: function () {\n hasCompleted = true;\n cancelReset();\n resetConnection = handleReset(reset, resetOnComplete);\n dest.complete();\n },\n });\n from(source).subscribe(connection);\n }\n })(wrapperSource);\n };\n}\nfunction handleReset(reset, on) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n if (on === true) {\n reset();\n return null;\n }\n if (on === false) {\n return null;\n }\n return on.apply(void 0, __spreadArray([], __read(args))).pipe(take(1))\n .subscribe(function () { return reset(); });\n}\n//# sourceMappingURL=share.js.map","import { ReplaySubject } from '../ReplaySubject';\nimport { share } from './share';\nexport function shareReplay(configOrBufferSize, windowTime, scheduler) {\n var _a, _b, _c;\n var bufferSize;\n var refCount = false;\n if (configOrBufferSize && typeof configOrBufferSize === 'object') {\n (_a = configOrBufferSize.bufferSize, bufferSize = _a === void 0 ? Infinity : _a, _b = configOrBufferSize.windowTime, windowTime = _b === void 0 ? Infinity : _b, _c = configOrBufferSize.refCount, refCount = _c === void 0 ? false : _c, scheduler = configOrBufferSize.scheduler);\n }\n else {\n bufferSize = configOrBufferSize !== null && configOrBufferSize !== void 0 ? configOrBufferSize : Infinity;\n }\n return share({\n connector: function () { return new ReplaySubject(bufferSize, windowTime, scheduler); },\n resetOnError: true,\n resetOnComplete: false,\n resetOnRefCountZero: refCount,\n });\n}\n//# sourceMappingURL=shareReplay.js.map","import { isFunction } from '../util/isFunction';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { identity } from '../util/identity';\nexport function tap(observerOrNext, error, complete) {\n var tapObserver = isFunction(observerOrNext) || error || complete\n ?\n { next: observerOrNext, error: error, complete: complete }\n : observerOrNext;\n return tapObserver\n ? operate(function (source, subscriber) {\n var _a;\n (_a = tapObserver.subscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);\n var isUnsub = true;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n var _a;\n (_a = tapObserver.next) === null || _a === void 0 ? void 0 : _a.call(tapObserver, value);\n subscriber.next(value);\n }, function () {\n var _a;\n isUnsub = false;\n (_a = tapObserver.complete) === null || _a === void 0 ? void 0 : _a.call(tapObserver);\n subscriber.complete();\n }, function (err) {\n var _a;\n isUnsub = false;\n (_a = tapObserver.error) === null || _a === void 0 ? void 0 : _a.call(tapObserver, err);\n subscriber.error(err);\n }, function () {\n var _a, _b;\n if (isUnsub) {\n (_a = tapObserver.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);\n }\n (_b = tapObserver.finalize) === null || _b === void 0 ? void 0 : _b.call(tapObserver);\n }));\n })\n :\n identity;\n}\n//# sourceMappingURL=tap.js.map","export default {}","(function (module, exports) {\n 'use strict';\n\n // Utils\n function assert (val, msg) {\n if (!val) throw new Error(msg || 'Assertion failed');\n }\n\n // Could use `inherits` module, but don't want to move from single file\n // architecture yet.\n function inherits (ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function () {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n\n // BN\n\n function BN (number, base, endian) {\n if (BN.isBN(number)) {\n return number;\n }\n\n this.negative = 0;\n this.words = null;\n this.length = 0;\n\n // Reduction context\n this.red = null;\n\n if (number !== null) {\n if (base === 'le' || base === 'be') {\n endian = base;\n base = 10;\n }\n\n this._init(number || 0, base || 10, endian || 'be');\n }\n }\n if (typeof module === 'object') {\n module.exports = BN;\n } else {\n exports.BN = BN;\n }\n\n BN.BN = BN;\n BN.wordSize = 26;\n\n var Buffer;\n try {\n if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') {\n Buffer = window.Buffer;\n } else {\n Buffer = require('buffer').Buffer;\n }\n } catch (e) {\n }\n\n BN.isBN = function isBN (num) {\n if (num instanceof BN) {\n return true;\n }\n\n return num !== null && typeof num === 'object' &&\n num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n };\n\n BN.max = function max (left, right) {\n if (left.cmp(right) > 0) return left;\n return right;\n };\n\n BN.min = function min (left, right) {\n if (left.cmp(right) < 0) return left;\n return right;\n };\n\n BN.prototype._init = function init (number, base, endian) {\n if (typeof number === 'number') {\n return this._initNumber(number, base, endian);\n }\n\n if (typeof number === 'object') {\n return this._initArray(number, base, endian);\n }\n\n if (base === 'hex') {\n base = 16;\n }\n assert(base === (base | 0) && base >= 2 && base <= 36);\n\n number = number.toString().replace(/\\s+/g, '');\n var start = 0;\n if (number[0] === '-') {\n start++;\n this.negative = 1;\n }\n\n if (start < number.length) {\n if (base === 16) {\n this._parseHex(number, start, endian);\n } else {\n this._parseBase(number, base, start);\n if (endian === 'le') {\n this._initArray(this.toArray(), base, endian);\n }\n }\n }\n };\n\n BN.prototype._initNumber = function _initNumber (number, base, endian) {\n if (number < 0) {\n this.negative = 1;\n number = -number;\n }\n if (number < 0x4000000) {\n this.words = [number & 0x3ffffff];\n this.length = 1;\n } else if (number < 0x10000000000000) {\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff\n ];\n this.length = 2;\n } else {\n assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff,\n 1\n ];\n this.length = 3;\n }\n\n if (endian !== 'le') return;\n\n // Reverse the bytes\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initArray = function _initArray (number, base, endian) {\n // Perhaps a Uint8Array\n assert(typeof number.length === 'number');\n if (number.length <= 0) {\n this.words = [0];\n this.length = 1;\n return this;\n }\n\n this.length = Math.ceil(number.length / 3);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n var off = 0;\n if (endian === 'be') {\n for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n } else if (endian === 'le') {\n for (i = 0, j = 0; i < number.length; i += 3) {\n w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n }\n return this._strip();\n };\n\n function parseHex4Bits (string, index) {\n var c = string.charCodeAt(index);\n // '0' - '9'\n if (c >= 48 && c <= 57) {\n return c - 48;\n // 'A' - 'F'\n } else if (c >= 65 && c <= 70) {\n return c - 55;\n // 'a' - 'f'\n } else if (c >= 97 && c <= 102) {\n return c - 87;\n } else {\n assert(false, 'Invalid character in ' + string);\n }\n }\n\n function parseHexByte (string, lowerBound, index) {\n var r = parseHex4Bits(string, index);\n if (index - 1 >= lowerBound) {\n r |= parseHex4Bits(string, index - 1) << 4;\n }\n return r;\n }\n\n BN.prototype._parseHex = function _parseHex (number, start, endian) {\n // Create possibly bigger array to ensure that it fits the number\n this.length = Math.ceil((number.length - start) / 6);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n // 24-bits chunks\n var off = 0;\n var j = 0;\n\n var w;\n if (endian === 'be') {\n for (i = number.length - 1; i >= start; i -= 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n } else {\n var parseLength = number.length - start;\n for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n }\n\n this._strip();\n };\n\n function parseBase (str, start, end, mul) {\n var r = 0;\n var b = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r *= mul;\n\n // 'a'\n if (c >= 49) {\n b = c - 49 + 0xa;\n\n // 'A'\n } else if (c >= 17) {\n b = c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n b = c;\n }\n assert(c >= 0 && b < mul, 'Invalid character');\n r += b;\n }\n return r;\n }\n\n BN.prototype._parseBase = function _parseBase (number, base, start) {\n // Initialize as zero\n this.words = [0];\n this.length = 1;\n\n // Find length of limb in base\n for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n limbLen++;\n }\n limbLen--;\n limbPow = (limbPow / base) | 0;\n\n var total = number.length - start;\n var mod = total % limbLen;\n var end = Math.min(total, total - mod) + start;\n\n var word = 0;\n for (var i = start; i < end; i += limbLen) {\n word = parseBase(number, i, i + limbLen, base);\n\n this.imuln(limbPow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n if (mod !== 0) {\n var pow = 1;\n word = parseBase(number, i, number.length, base);\n\n for (i = 0; i < mod; i++) {\n pow *= base;\n }\n\n this.imuln(pow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n this._strip();\n };\n\n BN.prototype.copy = function copy (dest) {\n dest.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n dest.words[i] = this.words[i];\n }\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n };\n\n function move (dest, src) {\n dest.words = src.words;\n dest.length = src.length;\n dest.negative = src.negative;\n dest.red = src.red;\n }\n\n BN.prototype._move = function _move (dest) {\n move(dest, this);\n };\n\n BN.prototype.clone = function clone () {\n var r = new BN(null);\n this.copy(r);\n return r;\n };\n\n BN.prototype._expand = function _expand (size) {\n while (this.length < size) {\n this.words[this.length++] = 0;\n }\n return this;\n };\n\n // Remove leading `0` from `this`\n BN.prototype._strip = function strip () {\n while (this.length > 1 && this.words[this.length - 1] === 0) {\n this.length--;\n }\n return this._normSign();\n };\n\n BN.prototype._normSign = function _normSign () {\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0) {\n this.negative = 0;\n }\n return this;\n };\n\n // Check Symbol.for because not everywhere where Symbol defined\n // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#Browser_compatibility\n if (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function') {\n try {\n BN.prototype[Symbol.for('nodejs.util.inspect.custom')] = inspect;\n } catch (e) {\n BN.prototype.inspect = inspect;\n }\n } else {\n BN.prototype.inspect = inspect;\n }\n\n function inspect () {\n return (this.red ? '';\n }\n\n /*\n\n var zeros = [];\n var groupSizes = [];\n var groupBases = [];\n\n var s = '';\n var i = -1;\n while (++i < BN.wordSize) {\n zeros[i] = s;\n s += '0';\n }\n groupSizes[0] = 0;\n groupSizes[1] = 0;\n groupBases[0] = 0;\n groupBases[1] = 0;\n var base = 2 - 1;\n while (++base < 36 + 1) {\n var groupSize = 0;\n var groupBase = 1;\n while (groupBase < (1 << BN.wordSize) / base) {\n groupBase *= base;\n groupSize += 1;\n }\n groupSizes[base] = groupSize;\n groupBases[base] = groupBase;\n }\n\n */\n\n var zeros = [\n '',\n '0',\n '00',\n '000',\n '0000',\n '00000',\n '000000',\n '0000000',\n '00000000',\n '000000000',\n '0000000000',\n '00000000000',\n '000000000000',\n '0000000000000',\n '00000000000000',\n '000000000000000',\n '0000000000000000',\n '00000000000000000',\n '000000000000000000',\n '0000000000000000000',\n '00000000000000000000',\n '000000000000000000000',\n '0000000000000000000000',\n '00000000000000000000000',\n '000000000000000000000000',\n '0000000000000000000000000'\n ];\n\n var groupSizes = [\n 0, 0,\n 25, 16, 12, 11, 10, 9, 8,\n 8, 7, 7, 7, 7, 6, 6,\n 6, 6, 6, 6, 6, 5, 5,\n 5, 5, 5, 5, 5, 5, 5,\n 5, 5, 5, 5, 5, 5, 5\n ];\n\n var groupBases = [\n 0, 0,\n 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n ];\n\n BN.prototype.toString = function toString (base, padding) {\n base = base || 10;\n padding = padding | 0 || 1;\n\n var out;\n if (base === 16 || base === 'hex') {\n out = '';\n var off = 0;\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = this.words[i];\n var word = (((w << off) | carry) & 0xffffff).toString(16);\n carry = (w >>> (24 - off)) & 0xffffff;\n off += 2;\n if (off >= 26) {\n off -= 26;\n i--;\n }\n if (carry !== 0 || i !== this.length - 1) {\n out = zeros[6 - word.length] + word + out;\n } else {\n out = word + out;\n }\n }\n if (carry !== 0) {\n out = carry.toString(16) + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n if (base === (base | 0) && base >= 2 && base <= 36) {\n // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n var groupSize = groupSizes[base];\n // var groupBase = Math.pow(base, groupSize);\n var groupBase = groupBases[base];\n out = '';\n var c = this.clone();\n c.negative = 0;\n while (!c.isZero()) {\n var r = c.modrn(groupBase).toString(base);\n c = c.idivn(groupBase);\n\n if (!c.isZero()) {\n out = zeros[groupSize - r.length] + r + out;\n } else {\n out = r + out;\n }\n }\n if (this.isZero()) {\n out = '0' + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n assert(false, 'Base should be between 2 and 36');\n };\n\n BN.prototype.toNumber = function toNumber () {\n var ret = this.words[0];\n if (this.length === 2) {\n ret += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // NOTE: at this stage it is known that the top bit is set\n ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n } else if (this.length > 2) {\n assert(false, 'Number can only safely store up to 53 bits');\n }\n return (this.negative !== 0) ? -ret : ret;\n };\n\n BN.prototype.toJSON = function toJSON () {\n return this.toString(16, 2);\n };\n\n if (Buffer) {\n BN.prototype.toBuffer = function toBuffer (endian, length) {\n return this.toArrayLike(Buffer, endian, length);\n };\n }\n\n BN.prototype.toArray = function toArray (endian, length) {\n return this.toArrayLike(Array, endian, length);\n };\n\n var allocate = function allocate (ArrayType, size) {\n if (ArrayType.allocUnsafe) {\n return ArrayType.allocUnsafe(size);\n }\n return new ArrayType(size);\n };\n\n BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n this._strip();\n\n var byteLength = this.byteLength();\n var reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, 'byte array longer than desired length');\n assert(reqLength > 0, 'Requested array length <= 0');\n\n var res = allocate(ArrayType, reqLength);\n var postfix = endian === 'le' ? 'LE' : 'BE';\n this['_toArrayLike' + postfix](res, byteLength);\n return res;\n };\n\n BN.prototype._toArrayLikeLE = function _toArrayLikeLE (res, byteLength) {\n var position = 0;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position++] = word & 0xff;\n if (position < res.length) {\n res[position++] = (word >> 8) & 0xff;\n }\n if (position < res.length) {\n res[position++] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position < res.length) {\n res[position++] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position < res.length) {\n res[position++] = carry;\n\n while (position < res.length) {\n res[position++] = 0;\n }\n }\n };\n\n BN.prototype._toArrayLikeBE = function _toArrayLikeBE (res, byteLength) {\n var position = res.length - 1;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position--] = word & 0xff;\n if (position >= 0) {\n res[position--] = (word >> 8) & 0xff;\n }\n if (position >= 0) {\n res[position--] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position >= 0) {\n res[position--] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position >= 0) {\n res[position--] = carry;\n\n while (position >= 0) {\n res[position--] = 0;\n }\n }\n };\n\n if (Math.clz32) {\n BN.prototype._countBits = function _countBits (w) {\n return 32 - Math.clz32(w);\n };\n } else {\n BN.prototype._countBits = function _countBits (w) {\n var t = w;\n var r = 0;\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n return r + t;\n };\n }\n\n BN.prototype._zeroBits = function _zeroBits (w) {\n // Short-cut\n if (w === 0) return 26;\n\n var t = w;\n var r = 0;\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n if ((t & 0x1) === 0) {\n r++;\n }\n return r;\n };\n\n // Return number of used bits in a BN\n BN.prototype.bitLength = function bitLength () {\n var w = this.words[this.length - 1];\n var hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n\n function toBitArray (num) {\n var w = new Array(num.bitLength());\n\n for (var bit = 0; bit < w.length; bit++) {\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n w[bit] = (num.words[off] >>> wbit) & 0x01;\n }\n\n return w;\n }\n\n // Number of trailing zero bits\n BN.prototype.zeroBits = function zeroBits () {\n if (this.isZero()) return 0;\n\n var r = 0;\n for (var i = 0; i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n r += b;\n if (b !== 26) break;\n }\n return r;\n };\n\n BN.prototype.byteLength = function byteLength () {\n return Math.ceil(this.bitLength() / 8);\n };\n\n BN.prototype.toTwos = function toTwos (width) {\n if (this.negative !== 0) {\n return this.abs().inotn(width).iaddn(1);\n }\n return this.clone();\n };\n\n BN.prototype.fromTwos = function fromTwos (width) {\n if (this.testn(width - 1)) {\n return this.notn(width).iaddn(1).ineg();\n }\n return this.clone();\n };\n\n BN.prototype.isNeg = function isNeg () {\n return this.negative !== 0;\n };\n\n // Return negative clone of `this`\n BN.prototype.neg = function neg () {\n return this.clone().ineg();\n };\n\n BN.prototype.ineg = function ineg () {\n if (!this.isZero()) {\n this.negative ^= 1;\n }\n\n return this;\n };\n\n // Or `num` with `this` in-place\n BN.prototype.iuor = function iuor (num) {\n while (this.length < num.length) {\n this.words[this.length++] = 0;\n }\n\n for (var i = 0; i < num.length; i++) {\n this.words[i] = this.words[i] | num.words[i];\n }\n\n return this._strip();\n };\n\n BN.prototype.ior = function ior (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuor(num);\n };\n\n // Or `num` with `this`\n BN.prototype.or = function or (num) {\n if (this.length > num.length) return this.clone().ior(num);\n return num.clone().ior(this);\n };\n\n BN.prototype.uor = function uor (num) {\n if (this.length > num.length) return this.clone().iuor(num);\n return num.clone().iuor(this);\n };\n\n // And `num` with `this` in-place\n BN.prototype.iuand = function iuand (num) {\n // b = min-length(num, this)\n var b;\n if (this.length > num.length) {\n b = num;\n } else {\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = this.words[i] & num.words[i];\n }\n\n this.length = b.length;\n\n return this._strip();\n };\n\n BN.prototype.iand = function iand (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuand(num);\n };\n\n // And `num` with `this`\n BN.prototype.and = function and (num) {\n if (this.length > num.length) return this.clone().iand(num);\n return num.clone().iand(this);\n };\n\n BN.prototype.uand = function uand (num) {\n if (this.length > num.length) return this.clone().iuand(num);\n return num.clone().iuand(this);\n };\n\n // Xor `num` with `this` in-place\n BN.prototype.iuxor = function iuxor (num) {\n // a.length > b.length\n var a;\n var b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = a.words[i] ^ b.words[i];\n }\n\n if (this !== a) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = a.length;\n\n return this._strip();\n };\n\n BN.prototype.ixor = function ixor (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuxor(num);\n };\n\n // Xor `num` with `this`\n BN.prototype.xor = function xor (num) {\n if (this.length > num.length) return this.clone().ixor(num);\n return num.clone().ixor(this);\n };\n\n BN.prototype.uxor = function uxor (num) {\n if (this.length > num.length) return this.clone().iuxor(num);\n return num.clone().iuxor(this);\n };\n\n // Not ``this`` with ``width`` bitwidth\n BN.prototype.inotn = function inotn (width) {\n assert(typeof width === 'number' && width >= 0);\n\n var bytesNeeded = Math.ceil(width / 26) | 0;\n var bitsLeft = width % 26;\n\n // Extend the buffer with leading zeroes\n this._expand(bytesNeeded);\n\n if (bitsLeft > 0) {\n bytesNeeded--;\n }\n\n // Handle complete words\n for (var i = 0; i < bytesNeeded; i++) {\n this.words[i] = ~this.words[i] & 0x3ffffff;\n }\n\n // Handle the residue\n if (bitsLeft > 0) {\n this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n }\n\n // And remove leading zeroes\n return this._strip();\n };\n\n BN.prototype.notn = function notn (width) {\n return this.clone().inotn(width);\n };\n\n // Set `bit` of `this`\n BN.prototype.setn = function setn (bit, val) {\n assert(typeof bit === 'number' && bit >= 0);\n\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n this._expand(off + 1);\n\n if (val) {\n this.words[off] = this.words[off] | (1 << wbit);\n } else {\n this.words[off] = this.words[off] & ~(1 << wbit);\n }\n\n return this._strip();\n };\n\n // Add `num` to `this` in-place\n BN.prototype.iadd = function iadd (num) {\n var r;\n\n // negative + positive\n if (this.negative !== 0 && num.negative === 0) {\n this.negative = 0;\n r = this.isub(num);\n this.negative ^= 1;\n return this._normSign();\n\n // positive + negative\n } else if (this.negative === 0 && num.negative !== 0) {\n num.negative = 0;\n r = this.isub(num);\n num.negative = 1;\n return r._normSign();\n }\n\n // a.length > b.length\n var a, b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n\n this.length = a.length;\n if (carry !== 0) {\n this.words[this.length] = carry;\n this.length++;\n // Copy the rest of the words\n } else if (a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n return this;\n };\n\n // Add `num` to `this`\n BN.prototype.add = function add (num) {\n var res;\n if (num.negative !== 0 && this.negative === 0) {\n num.negative = 0;\n res = this.sub(num);\n num.negative ^= 1;\n return res;\n } else if (num.negative === 0 && this.negative !== 0) {\n this.negative = 0;\n res = num.sub(this);\n this.negative = 1;\n return res;\n }\n\n if (this.length > num.length) return this.clone().iadd(num);\n\n return num.clone().iadd(this);\n };\n\n // Subtract `num` from `this` in-place\n BN.prototype.isub = function isub (num) {\n // this - (-num) = this + num\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n num.negative = 1;\n return r._normSign();\n\n // -this - num = -(this + num)\n } else if (this.negative !== 0) {\n this.negative = 0;\n this.iadd(num);\n this.negative = 1;\n return this._normSign();\n }\n\n // At this point both numbers are positive\n var cmp = this.cmp(num);\n\n // Optimization - zeroify\n if (cmp === 0) {\n this.negative = 0;\n this.length = 1;\n this.words[0] = 0;\n return this;\n }\n\n // a > b\n var a, b;\n if (cmp > 0) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n\n // Copy rest of the words\n if (carry === 0 && i < a.length && a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = Math.max(this.length, i);\n\n if (a !== this) {\n this.negative = 1;\n }\n\n return this._strip();\n };\n\n // Subtract `num` from `this`\n BN.prototype.sub = function sub (num) {\n return this.clone().isub(num);\n };\n\n function smallMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n var len = (self.length + num.length) | 0;\n out.length = len;\n len = (len - 1) | 0;\n\n // Peel one iteration (compiler can't do it, because of code complexity)\n var a = self.words[0] | 0;\n var b = num.words[0] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n var carry = (r / 0x4000000) | 0;\n out.words[0] = lo;\n\n for (var k = 1; k < len; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = carry >>> 26;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = (k - j) | 0;\n a = self.words[i] | 0;\n b = num.words[j] | 0;\n r = a * b + rword;\n ncarry += (r / 0x4000000) | 0;\n rword = r & 0x3ffffff;\n }\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n if (carry !== 0) {\n out.words[k] = carry | 0;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n // TODO(indutny): it may be reasonable to omit it for users who don't need\n // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n // multiplication (like elliptic secp256k1).\n var comb10MulTo = function comb10MulTo (self, num, out) {\n var a = self.words;\n var b = num.words;\n var o = out.words;\n var c = 0;\n var lo;\n var mid;\n var hi;\n var a0 = a[0] | 0;\n var al0 = a0 & 0x1fff;\n var ah0 = a0 >>> 13;\n var a1 = a[1] | 0;\n var al1 = a1 & 0x1fff;\n var ah1 = a1 >>> 13;\n var a2 = a[2] | 0;\n var al2 = a2 & 0x1fff;\n var ah2 = a2 >>> 13;\n var a3 = a[3] | 0;\n var al3 = a3 & 0x1fff;\n var ah3 = a3 >>> 13;\n var a4 = a[4] | 0;\n var al4 = a4 & 0x1fff;\n var ah4 = a4 >>> 13;\n var a5 = a[5] | 0;\n var al5 = a5 & 0x1fff;\n var ah5 = a5 >>> 13;\n var a6 = a[6] | 0;\n var al6 = a6 & 0x1fff;\n var ah6 = a6 >>> 13;\n var a7 = a[7] | 0;\n var al7 = a7 & 0x1fff;\n var ah7 = a7 >>> 13;\n var a8 = a[8] | 0;\n var al8 = a8 & 0x1fff;\n var ah8 = a8 >>> 13;\n var a9 = a[9] | 0;\n var al9 = a9 & 0x1fff;\n var ah9 = a9 >>> 13;\n var b0 = b[0] | 0;\n var bl0 = b0 & 0x1fff;\n var bh0 = b0 >>> 13;\n var b1 = b[1] | 0;\n var bl1 = b1 & 0x1fff;\n var bh1 = b1 >>> 13;\n var b2 = b[2] | 0;\n var bl2 = b2 & 0x1fff;\n var bh2 = b2 >>> 13;\n var b3 = b[3] | 0;\n var bl3 = b3 & 0x1fff;\n var bh3 = b3 >>> 13;\n var b4 = b[4] | 0;\n var bl4 = b4 & 0x1fff;\n var bh4 = b4 >>> 13;\n var b5 = b[5] | 0;\n var bl5 = b5 & 0x1fff;\n var bh5 = b5 >>> 13;\n var b6 = b[6] | 0;\n var bl6 = b6 & 0x1fff;\n var bh6 = b6 >>> 13;\n var b7 = b[7] | 0;\n var bl7 = b7 & 0x1fff;\n var bh7 = b7 >>> 13;\n var b8 = b[8] | 0;\n var bl8 = b8 & 0x1fff;\n var bh8 = b8 >>> 13;\n var b9 = b[9] | 0;\n var bl9 = b9 & 0x1fff;\n var bh9 = b9 >>> 13;\n\n out.negative = self.negative ^ num.negative;\n out.length = 19;\n /* k = 0 */\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = (mid + Math.imul(ah0, bl0)) | 0;\n hi = Math.imul(ah0, bh0);\n var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n w0 &= 0x3ffffff;\n /* k = 1 */\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = (mid + Math.imul(ah1, bl0)) | 0;\n hi = Math.imul(ah1, bh0);\n lo = (lo + Math.imul(al0, bl1)) | 0;\n mid = (mid + Math.imul(al0, bh1)) | 0;\n mid = (mid + Math.imul(ah0, bl1)) | 0;\n hi = (hi + Math.imul(ah0, bh1)) | 0;\n var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n w1 &= 0x3ffffff;\n /* k = 2 */\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = (mid + Math.imul(ah2, bl0)) | 0;\n hi = Math.imul(ah2, bh0);\n lo = (lo + Math.imul(al1, bl1)) | 0;\n mid = (mid + Math.imul(al1, bh1)) | 0;\n mid = (mid + Math.imul(ah1, bl1)) | 0;\n hi = (hi + Math.imul(ah1, bh1)) | 0;\n lo = (lo + Math.imul(al0, bl2)) | 0;\n mid = (mid + Math.imul(al0, bh2)) | 0;\n mid = (mid + Math.imul(ah0, bl2)) | 0;\n hi = (hi + Math.imul(ah0, bh2)) | 0;\n var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n w2 &= 0x3ffffff;\n /* k = 3 */\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = (mid + Math.imul(ah3, bl0)) | 0;\n hi = Math.imul(ah3, bh0);\n lo = (lo + Math.imul(al2, bl1)) | 0;\n mid = (mid + Math.imul(al2, bh1)) | 0;\n mid = (mid + Math.imul(ah2, bl1)) | 0;\n hi = (hi + Math.imul(ah2, bh1)) | 0;\n lo = (lo + Math.imul(al1, bl2)) | 0;\n mid = (mid + Math.imul(al1, bh2)) | 0;\n mid = (mid + Math.imul(ah1, bl2)) | 0;\n hi = (hi + Math.imul(ah1, bh2)) | 0;\n lo = (lo + Math.imul(al0, bl3)) | 0;\n mid = (mid + Math.imul(al0, bh3)) | 0;\n mid = (mid + Math.imul(ah0, bl3)) | 0;\n hi = (hi + Math.imul(ah0, bh3)) | 0;\n var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n w3 &= 0x3ffffff;\n /* k = 4 */\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = (mid + Math.imul(ah4, bl0)) | 0;\n hi = Math.imul(ah4, bh0);\n lo = (lo + Math.imul(al3, bl1)) | 0;\n mid = (mid + Math.imul(al3, bh1)) | 0;\n mid = (mid + Math.imul(ah3, bl1)) | 0;\n hi = (hi + Math.imul(ah3, bh1)) | 0;\n lo = (lo + Math.imul(al2, bl2)) | 0;\n mid = (mid + Math.imul(al2, bh2)) | 0;\n mid = (mid + Math.imul(ah2, bl2)) | 0;\n hi = (hi + Math.imul(ah2, bh2)) | 0;\n lo = (lo + Math.imul(al1, bl3)) | 0;\n mid = (mid + Math.imul(al1, bh3)) | 0;\n mid = (mid + Math.imul(ah1, bl3)) | 0;\n hi = (hi + Math.imul(ah1, bh3)) | 0;\n lo = (lo + Math.imul(al0, bl4)) | 0;\n mid = (mid + Math.imul(al0, bh4)) | 0;\n mid = (mid + Math.imul(ah0, bl4)) | 0;\n hi = (hi + Math.imul(ah0, bh4)) | 0;\n var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n w4 &= 0x3ffffff;\n /* k = 5 */\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = (mid + Math.imul(ah5, bl0)) | 0;\n hi = Math.imul(ah5, bh0);\n lo = (lo + Math.imul(al4, bl1)) | 0;\n mid = (mid + Math.imul(al4, bh1)) | 0;\n mid = (mid + Math.imul(ah4, bl1)) | 0;\n hi = (hi + Math.imul(ah4, bh1)) | 0;\n lo = (lo + Math.imul(al3, bl2)) | 0;\n mid = (mid + Math.imul(al3, bh2)) | 0;\n mid = (mid + Math.imul(ah3, bl2)) | 0;\n hi = (hi + Math.imul(ah3, bh2)) | 0;\n lo = (lo + Math.imul(al2, bl3)) | 0;\n mid = (mid + Math.imul(al2, bh3)) | 0;\n mid = (mid + Math.imul(ah2, bl3)) | 0;\n hi = (hi + Math.imul(ah2, bh3)) | 0;\n lo = (lo + Math.imul(al1, bl4)) | 0;\n mid = (mid + Math.imul(al1, bh4)) | 0;\n mid = (mid + Math.imul(ah1, bl4)) | 0;\n hi = (hi + Math.imul(ah1, bh4)) | 0;\n lo = (lo + Math.imul(al0, bl5)) | 0;\n mid = (mid + Math.imul(al0, bh5)) | 0;\n mid = (mid + Math.imul(ah0, bl5)) | 0;\n hi = (hi + Math.imul(ah0, bh5)) | 0;\n var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n w5 &= 0x3ffffff;\n /* k = 6 */\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = (mid + Math.imul(ah6, bl0)) | 0;\n hi = Math.imul(ah6, bh0);\n lo = (lo + Math.imul(al5, bl1)) | 0;\n mid = (mid + Math.imul(al5, bh1)) | 0;\n mid = (mid + Math.imul(ah5, bl1)) | 0;\n hi = (hi + Math.imul(ah5, bh1)) | 0;\n lo = (lo + Math.imul(al4, bl2)) | 0;\n mid = (mid + Math.imul(al4, bh2)) | 0;\n mid = (mid + Math.imul(ah4, bl2)) | 0;\n hi = (hi + Math.imul(ah4, bh2)) | 0;\n lo = (lo + Math.imul(al3, bl3)) | 0;\n mid = (mid + Math.imul(al3, bh3)) | 0;\n mid = (mid + Math.imul(ah3, bl3)) | 0;\n hi = (hi + Math.imul(ah3, bh3)) | 0;\n lo = (lo + Math.imul(al2, bl4)) | 0;\n mid = (mid + Math.imul(al2, bh4)) | 0;\n mid = (mid + Math.imul(ah2, bl4)) | 0;\n hi = (hi + Math.imul(ah2, bh4)) | 0;\n lo = (lo + Math.imul(al1, bl5)) | 0;\n mid = (mid + Math.imul(al1, bh5)) | 0;\n mid = (mid + Math.imul(ah1, bl5)) | 0;\n hi = (hi + Math.imul(ah1, bh5)) | 0;\n lo = (lo + Math.imul(al0, bl6)) | 0;\n mid = (mid + Math.imul(al0, bh6)) | 0;\n mid = (mid + Math.imul(ah0, bl6)) | 0;\n hi = (hi + Math.imul(ah0, bh6)) | 0;\n var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n w6 &= 0x3ffffff;\n /* k = 7 */\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = (mid + Math.imul(ah7, bl0)) | 0;\n hi = Math.imul(ah7, bh0);\n lo = (lo + Math.imul(al6, bl1)) | 0;\n mid = (mid + Math.imul(al6, bh1)) | 0;\n mid = (mid + Math.imul(ah6, bl1)) | 0;\n hi = (hi + Math.imul(ah6, bh1)) | 0;\n lo = (lo + Math.imul(al5, bl2)) | 0;\n mid = (mid + Math.imul(al5, bh2)) | 0;\n mid = (mid + Math.imul(ah5, bl2)) | 0;\n hi = (hi + Math.imul(ah5, bh2)) | 0;\n lo = (lo + Math.imul(al4, bl3)) | 0;\n mid = (mid + Math.imul(al4, bh3)) | 0;\n mid = (mid + Math.imul(ah4, bl3)) | 0;\n hi = (hi + Math.imul(ah4, bh3)) | 0;\n lo = (lo + Math.imul(al3, bl4)) | 0;\n mid = (mid + Math.imul(al3, bh4)) | 0;\n mid = (mid + Math.imul(ah3, bl4)) | 0;\n hi = (hi + Math.imul(ah3, bh4)) | 0;\n lo = (lo + Math.imul(al2, bl5)) | 0;\n mid = (mid + Math.imul(al2, bh5)) | 0;\n mid = (mid + Math.imul(ah2, bl5)) | 0;\n hi = (hi + Math.imul(ah2, bh5)) | 0;\n lo = (lo + Math.imul(al1, bl6)) | 0;\n mid = (mid + Math.imul(al1, bh6)) | 0;\n mid = (mid + Math.imul(ah1, bl6)) | 0;\n hi = (hi + Math.imul(ah1, bh6)) | 0;\n lo = (lo + Math.imul(al0, bl7)) | 0;\n mid = (mid + Math.imul(al0, bh7)) | 0;\n mid = (mid + Math.imul(ah0, bl7)) | 0;\n hi = (hi + Math.imul(ah0, bh7)) | 0;\n var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n w7 &= 0x3ffffff;\n /* k = 8 */\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = (mid + Math.imul(ah8, bl0)) | 0;\n hi = Math.imul(ah8, bh0);\n lo = (lo + Math.imul(al7, bl1)) | 0;\n mid = (mid + Math.imul(al7, bh1)) | 0;\n mid = (mid + Math.imul(ah7, bl1)) | 0;\n hi = (hi + Math.imul(ah7, bh1)) | 0;\n lo = (lo + Math.imul(al6, bl2)) | 0;\n mid = (mid + Math.imul(al6, bh2)) | 0;\n mid = (mid + Math.imul(ah6, bl2)) | 0;\n hi = (hi + Math.imul(ah6, bh2)) | 0;\n lo = (lo + Math.imul(al5, bl3)) | 0;\n mid = (mid + Math.imul(al5, bh3)) | 0;\n mid = (mid + Math.imul(ah5, bl3)) | 0;\n hi = (hi + Math.imul(ah5, bh3)) | 0;\n lo = (lo + Math.imul(al4, bl4)) | 0;\n mid = (mid + Math.imul(al4, bh4)) | 0;\n mid = (mid + Math.imul(ah4, bl4)) | 0;\n hi = (hi + Math.imul(ah4, bh4)) | 0;\n lo = (lo + Math.imul(al3, bl5)) | 0;\n mid = (mid + Math.imul(al3, bh5)) | 0;\n mid = (mid + Math.imul(ah3, bl5)) | 0;\n hi = (hi + Math.imul(ah3, bh5)) | 0;\n lo = (lo + Math.imul(al2, bl6)) | 0;\n mid = (mid + Math.imul(al2, bh6)) | 0;\n mid = (mid + Math.imul(ah2, bl6)) | 0;\n hi = (hi + Math.imul(ah2, bh6)) | 0;\n lo = (lo + Math.imul(al1, bl7)) | 0;\n mid = (mid + Math.imul(al1, bh7)) | 0;\n mid = (mid + Math.imul(ah1, bl7)) | 0;\n hi = (hi + Math.imul(ah1, bh7)) | 0;\n lo = (lo + Math.imul(al0, bl8)) | 0;\n mid = (mid + Math.imul(al0, bh8)) | 0;\n mid = (mid + Math.imul(ah0, bl8)) | 0;\n hi = (hi + Math.imul(ah0, bh8)) | 0;\n var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n w8 &= 0x3ffffff;\n /* k = 9 */\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = (mid + Math.imul(ah9, bl0)) | 0;\n hi = Math.imul(ah9, bh0);\n lo = (lo + Math.imul(al8, bl1)) | 0;\n mid = (mid + Math.imul(al8, bh1)) | 0;\n mid = (mid + Math.imul(ah8, bl1)) | 0;\n hi = (hi + Math.imul(ah8, bh1)) | 0;\n lo = (lo + Math.imul(al7, bl2)) | 0;\n mid = (mid + Math.imul(al7, bh2)) | 0;\n mid = (mid + Math.imul(ah7, bl2)) | 0;\n hi = (hi + Math.imul(ah7, bh2)) | 0;\n lo = (lo + Math.imul(al6, bl3)) | 0;\n mid = (mid + Math.imul(al6, bh3)) | 0;\n mid = (mid + Math.imul(ah6, bl3)) | 0;\n hi = (hi + Math.imul(ah6, bh3)) | 0;\n lo = (lo + Math.imul(al5, bl4)) | 0;\n mid = (mid + Math.imul(al5, bh4)) | 0;\n mid = (mid + Math.imul(ah5, bl4)) | 0;\n hi = (hi + Math.imul(ah5, bh4)) | 0;\n lo = (lo + Math.imul(al4, bl5)) | 0;\n mid = (mid + Math.imul(al4, bh5)) | 0;\n mid = (mid + Math.imul(ah4, bl5)) | 0;\n hi = (hi + Math.imul(ah4, bh5)) | 0;\n lo = (lo + Math.imul(al3, bl6)) | 0;\n mid = (mid + Math.imul(al3, bh6)) | 0;\n mid = (mid + Math.imul(ah3, bl6)) | 0;\n hi = (hi + Math.imul(ah3, bh6)) | 0;\n lo = (lo + Math.imul(al2, bl7)) | 0;\n mid = (mid + Math.imul(al2, bh7)) | 0;\n mid = (mid + Math.imul(ah2, bl7)) | 0;\n hi = (hi + Math.imul(ah2, bh7)) | 0;\n lo = (lo + Math.imul(al1, bl8)) | 0;\n mid = (mid + Math.imul(al1, bh8)) | 0;\n mid = (mid + Math.imul(ah1, bl8)) | 0;\n hi = (hi + Math.imul(ah1, bh8)) | 0;\n lo = (lo + Math.imul(al0, bl9)) | 0;\n mid = (mid + Math.imul(al0, bh9)) | 0;\n mid = (mid + Math.imul(ah0, bl9)) | 0;\n hi = (hi + Math.imul(ah0, bh9)) | 0;\n var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n w9 &= 0x3ffffff;\n /* k = 10 */\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = (mid + Math.imul(ah9, bl1)) | 0;\n hi = Math.imul(ah9, bh1);\n lo = (lo + Math.imul(al8, bl2)) | 0;\n mid = (mid + Math.imul(al8, bh2)) | 0;\n mid = (mid + Math.imul(ah8, bl2)) | 0;\n hi = (hi + Math.imul(ah8, bh2)) | 0;\n lo = (lo + Math.imul(al7, bl3)) | 0;\n mid = (mid + Math.imul(al7, bh3)) | 0;\n mid = (mid + Math.imul(ah7, bl3)) | 0;\n hi = (hi + Math.imul(ah7, bh3)) | 0;\n lo = (lo + Math.imul(al6, bl4)) | 0;\n mid = (mid + Math.imul(al6, bh4)) | 0;\n mid = (mid + Math.imul(ah6, bl4)) | 0;\n hi = (hi + Math.imul(ah6, bh4)) | 0;\n lo = (lo + Math.imul(al5, bl5)) | 0;\n mid = (mid + Math.imul(al5, bh5)) | 0;\n mid = (mid + Math.imul(ah5, bl5)) | 0;\n hi = (hi + Math.imul(ah5, bh5)) | 0;\n lo = (lo + Math.imul(al4, bl6)) | 0;\n mid = (mid + Math.imul(al4, bh6)) | 0;\n mid = (mid + Math.imul(ah4, bl6)) | 0;\n hi = (hi + Math.imul(ah4, bh6)) | 0;\n lo = (lo + Math.imul(al3, bl7)) | 0;\n mid = (mid + Math.imul(al3, bh7)) | 0;\n mid = (mid + Math.imul(ah3, bl7)) | 0;\n hi = (hi + Math.imul(ah3, bh7)) | 0;\n lo = (lo + Math.imul(al2, bl8)) | 0;\n mid = (mid + Math.imul(al2, bh8)) | 0;\n mid = (mid + Math.imul(ah2, bl8)) | 0;\n hi = (hi + Math.imul(ah2, bh8)) | 0;\n lo = (lo + Math.imul(al1, bl9)) | 0;\n mid = (mid + Math.imul(al1, bh9)) | 0;\n mid = (mid + Math.imul(ah1, bl9)) | 0;\n hi = (hi + Math.imul(ah1, bh9)) | 0;\n var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n w10 &= 0x3ffffff;\n /* k = 11 */\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = (mid + Math.imul(ah9, bl2)) | 0;\n hi = Math.imul(ah9, bh2);\n lo = (lo + Math.imul(al8, bl3)) | 0;\n mid = (mid + Math.imul(al8, bh3)) | 0;\n mid = (mid + Math.imul(ah8, bl3)) | 0;\n hi = (hi + Math.imul(ah8, bh3)) | 0;\n lo = (lo + Math.imul(al7, bl4)) | 0;\n mid = (mid + Math.imul(al7, bh4)) | 0;\n mid = (mid + Math.imul(ah7, bl4)) | 0;\n hi = (hi + Math.imul(ah7, bh4)) | 0;\n lo = (lo + Math.imul(al6, bl5)) | 0;\n mid = (mid + Math.imul(al6, bh5)) | 0;\n mid = (mid + Math.imul(ah6, bl5)) | 0;\n hi = (hi + Math.imul(ah6, bh5)) | 0;\n lo = (lo + Math.imul(al5, bl6)) | 0;\n mid = (mid + Math.imul(al5, bh6)) | 0;\n mid = (mid + Math.imul(ah5, bl6)) | 0;\n hi = (hi + Math.imul(ah5, bh6)) | 0;\n lo = (lo + Math.imul(al4, bl7)) | 0;\n mid = (mid + Math.imul(al4, bh7)) | 0;\n mid = (mid + Math.imul(ah4, bl7)) | 0;\n hi = (hi + Math.imul(ah4, bh7)) | 0;\n lo = (lo + Math.imul(al3, bl8)) | 0;\n mid = (mid + Math.imul(al3, bh8)) | 0;\n mid = (mid + Math.imul(ah3, bl8)) | 0;\n hi = (hi + Math.imul(ah3, bh8)) | 0;\n lo = (lo + Math.imul(al2, bl9)) | 0;\n mid = (mid + Math.imul(al2, bh9)) | 0;\n mid = (mid + Math.imul(ah2, bl9)) | 0;\n hi = (hi + Math.imul(ah2, bh9)) | 0;\n var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n w11 &= 0x3ffffff;\n /* k = 12 */\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = (mid + Math.imul(ah9, bl3)) | 0;\n hi = Math.imul(ah9, bh3);\n lo = (lo + Math.imul(al8, bl4)) | 0;\n mid = (mid + Math.imul(al8, bh4)) | 0;\n mid = (mid + Math.imul(ah8, bl4)) | 0;\n hi = (hi + Math.imul(ah8, bh4)) | 0;\n lo = (lo + Math.imul(al7, bl5)) | 0;\n mid = (mid + Math.imul(al7, bh5)) | 0;\n mid = (mid + Math.imul(ah7, bl5)) | 0;\n hi = (hi + Math.imul(ah7, bh5)) | 0;\n lo = (lo + Math.imul(al6, bl6)) | 0;\n mid = (mid + Math.imul(al6, bh6)) | 0;\n mid = (mid + Math.imul(ah6, bl6)) | 0;\n hi = (hi + Math.imul(ah6, bh6)) | 0;\n lo = (lo + Math.imul(al5, bl7)) | 0;\n mid = (mid + Math.imul(al5, bh7)) | 0;\n mid = (mid + Math.imul(ah5, bl7)) | 0;\n hi = (hi + Math.imul(ah5, bh7)) | 0;\n lo = (lo + Math.imul(al4, bl8)) | 0;\n mid = (mid + Math.imul(al4, bh8)) | 0;\n mid = (mid + Math.imul(ah4, bl8)) | 0;\n hi = (hi + Math.imul(ah4, bh8)) | 0;\n lo = (lo + Math.imul(al3, bl9)) | 0;\n mid = (mid + Math.imul(al3, bh9)) | 0;\n mid = (mid + Math.imul(ah3, bl9)) | 0;\n hi = (hi + Math.imul(ah3, bh9)) | 0;\n var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n w12 &= 0x3ffffff;\n /* k = 13 */\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = (mid + Math.imul(ah9, bl4)) | 0;\n hi = Math.imul(ah9, bh4);\n lo = (lo + Math.imul(al8, bl5)) | 0;\n mid = (mid + Math.imul(al8, bh5)) | 0;\n mid = (mid + Math.imul(ah8, bl5)) | 0;\n hi = (hi + Math.imul(ah8, bh5)) | 0;\n lo = (lo + Math.imul(al7, bl6)) | 0;\n mid = (mid + Math.imul(al7, bh6)) | 0;\n mid = (mid + Math.imul(ah7, bl6)) | 0;\n hi = (hi + Math.imul(ah7, bh6)) | 0;\n lo = (lo + Math.imul(al6, bl7)) | 0;\n mid = (mid + Math.imul(al6, bh7)) | 0;\n mid = (mid + Math.imul(ah6, bl7)) | 0;\n hi = (hi + Math.imul(ah6, bh7)) | 0;\n lo = (lo + Math.imul(al5, bl8)) | 0;\n mid = (mid + Math.imul(al5, bh8)) | 0;\n mid = (mid + Math.imul(ah5, bl8)) | 0;\n hi = (hi + Math.imul(ah5, bh8)) | 0;\n lo = (lo + Math.imul(al4, bl9)) | 0;\n mid = (mid + Math.imul(al4, bh9)) | 0;\n mid = (mid + Math.imul(ah4, bl9)) | 0;\n hi = (hi + Math.imul(ah4, bh9)) | 0;\n var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n w13 &= 0x3ffffff;\n /* k = 14 */\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = (mid + Math.imul(ah9, bl5)) | 0;\n hi = Math.imul(ah9, bh5);\n lo = (lo + Math.imul(al8, bl6)) | 0;\n mid = (mid + Math.imul(al8, bh6)) | 0;\n mid = (mid + Math.imul(ah8, bl6)) | 0;\n hi = (hi + Math.imul(ah8, bh6)) | 0;\n lo = (lo + Math.imul(al7, bl7)) | 0;\n mid = (mid + Math.imul(al7, bh7)) | 0;\n mid = (mid + Math.imul(ah7, bl7)) | 0;\n hi = (hi + Math.imul(ah7, bh7)) | 0;\n lo = (lo + Math.imul(al6, bl8)) | 0;\n mid = (mid + Math.imul(al6, bh8)) | 0;\n mid = (mid + Math.imul(ah6, bl8)) | 0;\n hi = (hi + Math.imul(ah6, bh8)) | 0;\n lo = (lo + Math.imul(al5, bl9)) | 0;\n mid = (mid + Math.imul(al5, bh9)) | 0;\n mid = (mid + Math.imul(ah5, bl9)) | 0;\n hi = (hi + Math.imul(ah5, bh9)) | 0;\n var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n w14 &= 0x3ffffff;\n /* k = 15 */\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = (mid + Math.imul(ah9, bl6)) | 0;\n hi = Math.imul(ah9, bh6);\n lo = (lo + Math.imul(al8, bl7)) | 0;\n mid = (mid + Math.imul(al8, bh7)) | 0;\n mid = (mid + Math.imul(ah8, bl7)) | 0;\n hi = (hi + Math.imul(ah8, bh7)) | 0;\n lo = (lo + Math.imul(al7, bl8)) | 0;\n mid = (mid + Math.imul(al7, bh8)) | 0;\n mid = (mid + Math.imul(ah7, bl8)) | 0;\n hi = (hi + Math.imul(ah7, bh8)) | 0;\n lo = (lo + Math.imul(al6, bl9)) | 0;\n mid = (mid + Math.imul(al6, bh9)) | 0;\n mid = (mid + Math.imul(ah6, bl9)) | 0;\n hi = (hi + Math.imul(ah6, bh9)) | 0;\n var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n w15 &= 0x3ffffff;\n /* k = 16 */\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = (mid + Math.imul(ah9, bl7)) | 0;\n hi = Math.imul(ah9, bh7);\n lo = (lo + Math.imul(al8, bl8)) | 0;\n mid = (mid + Math.imul(al8, bh8)) | 0;\n mid = (mid + Math.imul(ah8, bl8)) | 0;\n hi = (hi + Math.imul(ah8, bh8)) | 0;\n lo = (lo + Math.imul(al7, bl9)) | 0;\n mid = (mid + Math.imul(al7, bh9)) | 0;\n mid = (mid + Math.imul(ah7, bl9)) | 0;\n hi = (hi + Math.imul(ah7, bh9)) | 0;\n var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n w16 &= 0x3ffffff;\n /* k = 17 */\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = (mid + Math.imul(ah9, bl8)) | 0;\n hi = Math.imul(ah9, bh8);\n lo = (lo + Math.imul(al8, bl9)) | 0;\n mid = (mid + Math.imul(al8, bh9)) | 0;\n mid = (mid + Math.imul(ah8, bl9)) | 0;\n hi = (hi + Math.imul(ah8, bh9)) | 0;\n var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n w17 &= 0x3ffffff;\n /* k = 18 */\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = (mid + Math.imul(ah9, bl9)) | 0;\n hi = Math.imul(ah9, bh9);\n var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n w18 &= 0x3ffffff;\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n if (c !== 0) {\n o[19] = c;\n out.length++;\n }\n return out;\n };\n\n // Polyfill comb\n if (!Math.imul) {\n comb10MulTo = smallMulTo;\n }\n\n function bigMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n out.length = self.length + num.length;\n\n var carry = 0;\n var hncarry = 0;\n for (var k = 0; k < out.length - 1; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = hncarry;\n hncarry = 0;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = k - j;\n var a = self.words[i] | 0;\n var b = num.words[j] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n lo = (lo + rword) | 0;\n rword = lo & 0x3ffffff;\n ncarry = (ncarry + (lo >>> 26)) | 0;\n\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n if (carry !== 0) {\n out.words[k] = carry;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n function jumboMulTo (self, num, out) {\n // Temporary disable, see https://github.com/indutny/bn.js/issues/211\n // var fftm = new FFTM();\n // return fftm.mulp(self, num, out);\n return bigMulTo(self, num, out);\n }\n\n BN.prototype.mulTo = function mulTo (num, out) {\n var res;\n var len = this.length + num.length;\n if (this.length === 10 && num.length === 10) {\n res = comb10MulTo(this, num, out);\n } else if (len < 63) {\n res = smallMulTo(this, num, out);\n } else if (len < 1024) {\n res = bigMulTo(this, num, out);\n } else {\n res = jumboMulTo(this, num, out);\n }\n\n return res;\n };\n\n // Cooley-Tukey algorithm for FFT\n // slightly revisited to rely on looping instead of recursion\n\n function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }\n\n FFTM.prototype.makeRBT = function makeRBT (N) {\n var t = new Array(N);\n var l = BN.prototype._countBits(N) - 1;\n for (var i = 0; i < N; i++) {\n t[i] = this.revBin(i, l, N);\n }\n\n return t;\n };\n\n // Returns binary-reversed representation of `x`\n FFTM.prototype.revBin = function revBin (x, l, N) {\n if (x === 0 || x === N - 1) return x;\n\n var rb = 0;\n for (var i = 0; i < l; i++) {\n rb |= (x & 1) << (l - i - 1);\n x >>= 1;\n }\n\n return rb;\n };\n\n // Performs \"tweedling\" phase, therefore 'emulating'\n // behaviour of the recursive algorithm\n FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n for (var i = 0; i < N; i++) {\n rtws[i] = rws[rbt[i]];\n itws[i] = iws[rbt[i]];\n }\n };\n\n FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n\n for (var s = 1; s < N; s <<= 1) {\n var l = s << 1;\n\n var rtwdf = Math.cos(2 * Math.PI / l);\n var itwdf = Math.sin(2 * Math.PI / l);\n\n for (var p = 0; p < N; p += l) {\n var rtwdf_ = rtwdf;\n var itwdf_ = itwdf;\n\n for (var j = 0; j < s; j++) {\n var re = rtws[p + j];\n var ie = itws[p + j];\n\n var ro = rtws[p + j + s];\n var io = itws[p + j + s];\n\n var rx = rtwdf_ * ro - itwdf_ * io;\n\n io = rtwdf_ * io + itwdf_ * ro;\n ro = rx;\n\n rtws[p + j] = re + ro;\n itws[p + j] = ie + io;\n\n rtws[p + j + s] = re - ro;\n itws[p + j + s] = ie - io;\n\n /* jshint maxdepth : false */\n if (j !== l) {\n rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n rtwdf_ = rx;\n }\n }\n }\n }\n };\n\n FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n var N = Math.max(m, n) | 1;\n var odd = N & 1;\n var i = 0;\n for (N = N / 2 | 0; N; N = N >>> 1) {\n i++;\n }\n\n return 1 << i + 1 + odd;\n };\n\n FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n if (N <= 1) return;\n\n for (var i = 0; i < N / 2; i++) {\n var t = rws[i];\n\n rws[i] = rws[N - i - 1];\n rws[N - i - 1] = t;\n\n t = iws[i];\n\n iws[i] = -iws[N - i - 1];\n iws[N - i - 1] = -t;\n }\n };\n\n FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n var carry = 0;\n for (var i = 0; i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n Math.round(ws[2 * i] / N) +\n carry;\n\n ws[i] = w & 0x3ffffff;\n\n if (w < 0x4000000) {\n carry = 0;\n } else {\n carry = w / 0x4000000 | 0;\n }\n }\n\n return ws;\n };\n\n FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n var carry = 0;\n for (var i = 0; i < len; i++) {\n carry = carry + (ws[i] | 0);\n\n rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n }\n\n // Pad with zeroes\n for (i = 2 * len; i < N; ++i) {\n rws[i] = 0;\n }\n\n assert(carry === 0);\n assert((carry & ~0x1fff) === 0);\n };\n\n FFTM.prototype.stub = function stub (N) {\n var ph = new Array(N);\n for (var i = 0; i < N; i++) {\n ph[i] = 0;\n }\n\n return ph;\n };\n\n FFTM.prototype.mulp = function mulp (x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length);\n\n var rbt = this.makeRBT(N);\n\n var _ = this.stub(N);\n\n var rws = new Array(N);\n var rwst = new Array(N);\n var iwst = new Array(N);\n\n var nrws = new Array(N);\n var nrwst = new Array(N);\n var niwst = new Array(N);\n\n var rmws = out.words;\n rmws.length = N;\n\n this.convert13b(x.words, x.length, rws, N);\n this.convert13b(y.words, y.length, nrws, N);\n\n this.transform(rws, _, rwst, iwst, N, rbt);\n this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n for (var i = 0; i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n rwst[i] = rx;\n }\n\n this.conjugate(rwst, iwst, N);\n this.transform(rwst, iwst, rmws, _, N, rbt);\n this.conjugate(rmws, _, N);\n this.normalize13b(rmws, N);\n\n out.negative = x.negative ^ y.negative;\n out.length = x.length + y.length;\n return out._strip();\n };\n\n // Multiply `this` by `num`\n BN.prototype.mul = function mul (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return this.mulTo(num, out);\n };\n\n // Multiply employing FFT\n BN.prototype.mulf = function mulf (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return jumboMulTo(this, num, out);\n };\n\n // In-place Multiplication\n BN.prototype.imul = function imul (num) {\n return this.clone().mulTo(num, this);\n };\n\n BN.prototype.imuln = function imuln (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n\n // Carry\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = (this.words[i] | 0) * num;\n var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n carry >>= 26;\n carry += (w / 0x4000000) | 0;\n // NOTE: lo is 27bit maximum\n carry += lo >>> 26;\n this.words[i] = lo & 0x3ffffff;\n }\n\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.muln = function muln (num) {\n return this.clone().imuln(num);\n };\n\n // `this` * `this`\n BN.prototype.sqr = function sqr () {\n return this.mul(this);\n };\n\n // `this` * `this` in-place\n BN.prototype.isqr = function isqr () {\n return this.imul(this.clone());\n };\n\n // Math.pow(`this`, `num`)\n BN.prototype.pow = function pow (num) {\n var w = toBitArray(num);\n if (w.length === 0) return new BN(1);\n\n // Skip leading zeroes\n var res = this;\n for (var i = 0; i < w.length; i++, res = res.sqr()) {\n if (w[i] !== 0) break;\n }\n\n if (++i < w.length) {\n for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n if (w[i] === 0) continue;\n\n res = res.mul(q);\n }\n }\n\n return res;\n };\n\n // Shift-left in-place\n BN.prototype.iushln = function iushln (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n var i;\n\n if (r !== 0) {\n var carry = 0;\n\n for (i = 0; i < this.length; i++) {\n var newCarry = this.words[i] & carryMask;\n var c = ((this.words[i] | 0) - newCarry) << r;\n this.words[i] = c | carry;\n carry = newCarry >>> (26 - r);\n }\n\n if (carry) {\n this.words[i] = carry;\n this.length++;\n }\n }\n\n if (s !== 0) {\n for (i = this.length - 1; i >= 0; i--) {\n this.words[i + s] = this.words[i];\n }\n\n for (i = 0; i < s; i++) {\n this.words[i] = 0;\n }\n\n this.length += s;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishln = function ishln (bits) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushln(bits);\n };\n\n // Shift-right in-place\n // NOTE: `hint` is a lowest bit before trailing zeroes\n // NOTE: if `extended` is present - it will be filled with destroyed bits\n BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n assert(typeof bits === 'number' && bits >= 0);\n var h;\n if (hint) {\n h = (hint - (hint % 26)) / 26;\n } else {\n h = 0;\n }\n\n var r = bits % 26;\n var s = Math.min((bits - r) / 26, this.length);\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n var maskedWords = extended;\n\n h -= s;\n h = Math.max(0, h);\n\n // Extended mode, copy masked part\n if (maskedWords) {\n for (var i = 0; i < s; i++) {\n maskedWords.words[i] = this.words[i];\n }\n maskedWords.length = s;\n }\n\n if (s === 0) {\n // No-op, we should not move anything at all\n } else if (this.length > s) {\n this.length -= s;\n for (i = 0; i < this.length; i++) {\n this.words[i] = this.words[i + s];\n }\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n var carry = 0;\n for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = (carry << (26 - r)) | (word >>> r);\n carry = word & mask;\n }\n\n // Push carried bits as a mask\n if (maskedWords && carry !== 0) {\n maskedWords.words[maskedWords.length++] = carry;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushrn(bits, hint, extended);\n };\n\n // Shift-left\n BN.prototype.shln = function shln (bits) {\n return this.clone().ishln(bits);\n };\n\n BN.prototype.ushln = function ushln (bits) {\n return this.clone().iushln(bits);\n };\n\n // Shift-right\n BN.prototype.shrn = function shrn (bits) {\n return this.clone().ishrn(bits);\n };\n\n BN.prototype.ushrn = function ushrn (bits) {\n return this.clone().iushrn(bits);\n };\n\n // Test if n bit is set\n BN.prototype.testn = function testn (bit) {\n assert(typeof bit === 'number' && bit >= 0);\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) return false;\n\n // Check bit and return\n var w = this.words[s];\n\n return !!(w & q);\n };\n\n // Return only lowers bits of number (in-place)\n BN.prototype.imaskn = function imaskn (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n\n assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n if (this.length <= s) {\n return this;\n }\n\n if (r !== 0) {\n s++;\n }\n this.length = Math.min(s, this.length);\n\n if (r !== 0) {\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n this.words[this.length - 1] &= mask;\n }\n\n return this._strip();\n };\n\n // Return only lowers bits of number\n BN.prototype.maskn = function maskn (bits) {\n return this.clone().imaskn(bits);\n };\n\n // Add plain number `num` to `this`\n BN.prototype.iaddn = function iaddn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.isubn(-num);\n\n // Possible sign change\n if (this.negative !== 0) {\n if (this.length === 1 && (this.words[0] | 0) <= num) {\n this.words[0] = num - (this.words[0] | 0);\n this.negative = 0;\n return this;\n }\n\n this.negative = 0;\n this.isubn(num);\n this.negative = 1;\n return this;\n }\n\n // Add without checks\n return this._iaddn(num);\n };\n\n BN.prototype._iaddn = function _iaddn (num) {\n this.words[0] += num;\n\n // Carry\n for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n if (i === this.length - 1) {\n this.words[i + 1] = 1;\n } else {\n this.words[i + 1]++;\n }\n }\n this.length = Math.max(this.length, i + 1);\n\n return this;\n };\n\n // Subtract plain number `num` from `this`\n BN.prototype.isubn = function isubn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.iaddn(-num);\n\n if (this.negative !== 0) {\n this.negative = 0;\n this.iaddn(num);\n this.negative = 1;\n return this;\n }\n\n this.words[0] -= num;\n\n if (this.length === 1 && this.words[0] < 0) {\n this.words[0] = -this.words[0];\n this.negative = 1;\n } else {\n // Carry\n for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n }\n\n return this._strip();\n };\n\n BN.prototype.addn = function addn (num) {\n return this.clone().iaddn(num);\n };\n\n BN.prototype.subn = function subn (num) {\n return this.clone().isubn(num);\n };\n\n BN.prototype.iabs = function iabs () {\n this.negative = 0;\n\n return this;\n };\n\n BN.prototype.abs = function abs () {\n return this.clone().iabs();\n };\n\n BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n var len = num.length + shift;\n var i;\n\n this._expand(len);\n\n var w;\n var carry = 0;\n for (i = 0; i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 0x3ffffff;\n carry = (w >> 26) - ((right / 0x4000000) | 0);\n this.words[i + shift] = w & 0x3ffffff;\n }\n for (; i < this.length - shift; i++) {\n w = (this.words[i + shift] | 0) + carry;\n carry = w >> 26;\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0) return this._strip();\n\n // Subtraction overflow\n assert(carry === -1);\n carry = 0;\n for (i = 0; i < this.length; i++) {\n w = -(this.words[i] | 0) + carry;\n carry = w >> 26;\n this.words[i] = w & 0x3ffffff;\n }\n this.negative = 1;\n\n return this._strip();\n };\n\n BN.prototype._wordDiv = function _wordDiv (num, mode) {\n var shift = this.length - num.length;\n\n var a = this.clone();\n var b = num;\n\n // Normalize\n var bhi = b.words[b.length - 1] | 0;\n var bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits;\n if (shift !== 0) {\n b = b.ushln(shift);\n a.iushln(shift);\n bhi = b.words[b.length - 1] | 0;\n }\n\n // Initialize quotient\n var m = a.length - b.length;\n var q;\n\n if (mode !== 'mod') {\n q = new BN(null);\n q.length = m + 1;\n q.words = new Array(q.length);\n for (var i = 0; i < q.length; i++) {\n q.words[i] = 0;\n }\n }\n\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n if (diff.negative === 0) {\n a = diff;\n if (q) {\n q.words[m] = 1;\n }\n }\n\n for (var j = m - 1; j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n (a.words[b.length + j - 1] | 0);\n\n // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n // (0x7ffffff)\n qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n while (a.negative !== 0) {\n qj--;\n a.negative = 0;\n a._ishlnsubmul(b, 1, j);\n if (!a.isZero()) {\n a.negative ^= 1;\n }\n }\n if (q) {\n q.words[j] = qj;\n }\n }\n if (q) {\n q._strip();\n }\n a._strip();\n\n // Denormalize\n if (mode !== 'div' && shift !== 0) {\n a.iushrn(shift);\n }\n\n return {\n div: q || null,\n mod: a\n };\n };\n\n // NOTE: 1) `mode` can be set to `mod` to request mod only,\n // to `div` to request div only, or be absent to\n // request both div & mod\n // 2) `positive` is true if unsigned mod is requested\n BN.prototype.divmod = function divmod (num, mode, positive) {\n assert(!num.isZero());\n\n if (this.isZero()) {\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n }\n\n var div, mod, res;\n if (this.negative !== 0 && num.negative === 0) {\n res = this.neg().divmod(num, mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.iadd(num);\n }\n }\n\n return {\n div: div,\n mod: mod\n };\n }\n\n if (this.negative === 0 && num.negative !== 0) {\n res = this.divmod(num.neg(), mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n return {\n div: div,\n mod: res.mod\n };\n }\n\n if ((this.negative & num.negative) !== 0) {\n res = this.neg().divmod(num.neg(), mode);\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.isub(num);\n }\n }\n\n return {\n div: res.div,\n mod: mod\n };\n }\n\n // Both numbers are positive at this point\n\n // Strip both numbers to approximate shift value\n if (num.length > this.length || this.cmp(num) < 0) {\n return {\n div: new BN(0),\n mod: this\n };\n }\n\n // Very short reduction\n if (num.length === 1) {\n if (mode === 'div') {\n return {\n div: this.divn(num.words[0]),\n mod: null\n };\n }\n\n if (mode === 'mod') {\n return {\n div: null,\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return {\n div: this.divn(num.words[0]),\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return this._wordDiv(num, mode);\n };\n\n // Find `this` / `num`\n BN.prototype.div = function div (num) {\n return this.divmod(num, 'div', false).div;\n };\n\n // Find `this` % `num`\n BN.prototype.mod = function mod (num) {\n return this.divmod(num, 'mod', false).mod;\n };\n\n BN.prototype.umod = function umod (num) {\n return this.divmod(num, 'mod', true).mod;\n };\n\n // Find Round(`this` / `num`)\n BN.prototype.divRound = function divRound (num) {\n var dm = this.divmod(num);\n\n // Fast case - exact division\n if (dm.mod.isZero()) return dm.div;\n\n var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n\n var half = num.ushrn(1);\n var r2 = num.andln(1);\n var cmp = mod.cmp(half);\n\n // Round down\n if (cmp < 0 || (r2 === 1 && cmp === 0)) return dm.div;\n\n // Round up\n return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n };\n\n BN.prototype.modrn = function modrn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n var p = (1 << 26) % num;\n\n var acc = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n acc = (p * acc + (this.words[i] | 0)) % num;\n }\n\n return isNegNum ? -acc : acc;\n };\n\n // WARNING: DEPRECATED\n BN.prototype.modn = function modn (num) {\n return this.modrn(num);\n };\n\n // In-place division by number\n BN.prototype.idivn = function idivn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n\n var carry = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 0x4000000;\n this.words[i] = (w / num) | 0;\n carry = w % num;\n }\n\n this._strip();\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.divn = function divn (num) {\n return this.clone().idivn(num);\n };\n\n BN.prototype.egcd = function egcd (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var x = this;\n var y = p.clone();\n\n if (x.negative !== 0) {\n x = x.umod(p);\n } else {\n x = x.clone();\n }\n\n // A * x + B * y = x\n var A = new BN(1);\n var B = new BN(0);\n\n // C * x + D * y = y\n var C = new BN(0);\n var D = new BN(1);\n\n var g = 0;\n\n while (x.isEven() && y.isEven()) {\n x.iushrn(1);\n y.iushrn(1);\n ++g;\n }\n\n var yp = y.clone();\n var xp = x.clone();\n\n while (!x.isZero()) {\n for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n x.iushrn(i);\n while (i-- > 0) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n y.iushrn(j);\n while (j-- > 0) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n };\n\n // This is reduced incarnation of the binary EEA\n // above, designated to invert members of the\n // _prime_ fields F(p) at a maximal speed\n BN.prototype._invmp = function _invmp (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var a = this;\n var b = p.clone();\n\n if (a.negative !== 0) {\n a = a.umod(p);\n } else {\n a = a.clone();\n }\n\n var x1 = new BN(1);\n var x2 = new BN(0);\n\n var delta = b.clone();\n\n while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n a.iushrn(i);\n while (i-- > 0) {\n if (x1.isOdd()) {\n x1.iadd(delta);\n }\n\n x1.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n b.iushrn(j);\n while (j-- > 0) {\n if (x2.isOdd()) {\n x2.iadd(delta);\n }\n\n x2.iushrn(1);\n }\n }\n\n if (a.cmp(b) >= 0) {\n a.isub(b);\n x1.isub(x2);\n } else {\n b.isub(a);\n x2.isub(x1);\n }\n }\n\n var res;\n if (a.cmpn(1) === 0) {\n res = x1;\n } else {\n res = x2;\n }\n\n if (res.cmpn(0) < 0) {\n res.iadd(p);\n }\n\n return res;\n };\n\n BN.prototype.gcd = function gcd (num) {\n if (this.isZero()) return num.abs();\n if (num.isZero()) return this.abs();\n\n var a = this.clone();\n var b = num.clone();\n a.negative = 0;\n b.negative = 0;\n\n // Remove common factor of two\n for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n a.iushrn(1);\n b.iushrn(1);\n }\n\n do {\n while (a.isEven()) {\n a.iushrn(1);\n }\n while (b.isEven()) {\n b.iushrn(1);\n }\n\n var r = a.cmp(b);\n if (r < 0) {\n // Swap `a` and `b` to make `a` always bigger than `b`\n var t = a;\n a = b;\n b = t;\n } else if (r === 0 || b.cmpn(1) === 0) {\n break;\n }\n\n a.isub(b);\n } while (true);\n\n return b.iushln(shift);\n };\n\n // Invert number in the field F(num)\n BN.prototype.invm = function invm (num) {\n return this.egcd(num).a.umod(num);\n };\n\n BN.prototype.isEven = function isEven () {\n return (this.words[0] & 1) === 0;\n };\n\n BN.prototype.isOdd = function isOdd () {\n return (this.words[0] & 1) === 1;\n };\n\n // And first word and num\n BN.prototype.andln = function andln (num) {\n return this.words[0] & num;\n };\n\n // Increment at the bit position in-line\n BN.prototype.bincn = function bincn (bit) {\n assert(typeof bit === 'number');\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) {\n this._expand(s + 1);\n this.words[s] |= q;\n return this;\n }\n\n // Add bit and propagate, if needed\n var carry = q;\n for (var i = s; carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry;\n carry = w >>> 26;\n w &= 0x3ffffff;\n this.words[i] = w;\n }\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n return this;\n };\n\n BN.prototype.isZero = function isZero () {\n return this.length === 1 && this.words[0] === 0;\n };\n\n BN.prototype.cmpn = function cmpn (num) {\n var negative = num < 0;\n\n if (this.negative !== 0 && !negative) return -1;\n if (this.negative === 0 && negative) return 1;\n\n this._strip();\n\n var res;\n if (this.length > 1) {\n res = 1;\n } else {\n if (negative) {\n num = -num;\n }\n\n assert(num <= 0x3ffffff, 'Number is too big');\n\n var w = this.words[0] | 0;\n res = w === num ? 0 : w < num ? -1 : 1;\n }\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Compare two numbers and return:\n // 1 - if `this` > `num`\n // 0 - if `this` == `num`\n // -1 - if `this` < `num`\n BN.prototype.cmp = function cmp (num) {\n if (this.negative !== 0 && num.negative === 0) return -1;\n if (this.negative === 0 && num.negative !== 0) return 1;\n\n var res = this.ucmp(num);\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Unsigned comparison\n BN.prototype.ucmp = function ucmp (num) {\n // At this point both numbers have the same sign\n if (this.length > num.length) return 1;\n if (this.length < num.length) return -1;\n\n var res = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var a = this.words[i] | 0;\n var b = num.words[i] | 0;\n\n if (a === b) continue;\n if (a < b) {\n res = -1;\n } else if (a > b) {\n res = 1;\n }\n break;\n }\n return res;\n };\n\n BN.prototype.gtn = function gtn (num) {\n return this.cmpn(num) === 1;\n };\n\n BN.prototype.gt = function gt (num) {\n return this.cmp(num) === 1;\n };\n\n BN.prototype.gten = function gten (num) {\n return this.cmpn(num) >= 0;\n };\n\n BN.prototype.gte = function gte (num) {\n return this.cmp(num) >= 0;\n };\n\n BN.prototype.ltn = function ltn (num) {\n return this.cmpn(num) === -1;\n };\n\n BN.prototype.lt = function lt (num) {\n return this.cmp(num) === -1;\n };\n\n BN.prototype.lten = function lten (num) {\n return this.cmpn(num) <= 0;\n };\n\n BN.prototype.lte = function lte (num) {\n return this.cmp(num) <= 0;\n };\n\n BN.prototype.eqn = function eqn (num) {\n return this.cmpn(num) === 0;\n };\n\n BN.prototype.eq = function eq (num) {\n return this.cmp(num) === 0;\n };\n\n //\n // A reduce context, could be using montgomery or something better, depending\n // on the `m` itself.\n //\n BN.red = function red (num) {\n return new Red(num);\n };\n\n BN.prototype.toRed = function toRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n assert(this.negative === 0, 'red works only with positives');\n return ctx.convertTo(this)._forceRed(ctx);\n };\n\n BN.prototype.fromRed = function fromRed () {\n assert(this.red, 'fromRed works only with numbers in reduction context');\n return this.red.convertFrom(this);\n };\n\n BN.prototype._forceRed = function _forceRed (ctx) {\n this.red = ctx;\n return this;\n };\n\n BN.prototype.forceRed = function forceRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n return this._forceRed(ctx);\n };\n\n BN.prototype.redAdd = function redAdd (num) {\n assert(this.red, 'redAdd works only with red numbers');\n return this.red.add(this, num);\n };\n\n BN.prototype.redIAdd = function redIAdd (num) {\n assert(this.red, 'redIAdd works only with red numbers');\n return this.red.iadd(this, num);\n };\n\n BN.prototype.redSub = function redSub (num) {\n assert(this.red, 'redSub works only with red numbers');\n return this.red.sub(this, num);\n };\n\n BN.prototype.redISub = function redISub (num) {\n assert(this.red, 'redISub works only with red numbers');\n return this.red.isub(this, num);\n };\n\n BN.prototype.redShl = function redShl (num) {\n assert(this.red, 'redShl works only with red numbers');\n return this.red.shl(this, num);\n };\n\n BN.prototype.redMul = function redMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.mul(this, num);\n };\n\n BN.prototype.redIMul = function redIMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.imul(this, num);\n };\n\n BN.prototype.redSqr = function redSqr () {\n assert(this.red, 'redSqr works only with red numbers');\n this.red._verify1(this);\n return this.red.sqr(this);\n };\n\n BN.prototype.redISqr = function redISqr () {\n assert(this.red, 'redISqr works only with red numbers');\n this.red._verify1(this);\n return this.red.isqr(this);\n };\n\n // Square root over p\n BN.prototype.redSqrt = function redSqrt () {\n assert(this.red, 'redSqrt works only with red numbers');\n this.red._verify1(this);\n return this.red.sqrt(this);\n };\n\n BN.prototype.redInvm = function redInvm () {\n assert(this.red, 'redInvm works only with red numbers');\n this.red._verify1(this);\n return this.red.invm(this);\n };\n\n // Return negative clone of `this` % `red modulo`\n BN.prototype.redNeg = function redNeg () {\n assert(this.red, 'redNeg works only with red numbers');\n this.red._verify1(this);\n return this.red.neg(this);\n };\n\n BN.prototype.redPow = function redPow (num) {\n assert(this.red && !num.red, 'redPow(normalNum)');\n this.red._verify1(this);\n return this.red.pow(this, num);\n };\n\n // Prime numbers with efficient reduction\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n\n // Pseudo-Mersenne prime\n function MPrime (name, p) {\n // P = 2 ^ N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = new BN(1).iushln(this.n).isub(this.p);\n\n this.tmp = this._tmp();\n }\n\n MPrime.prototype._tmp = function _tmp () {\n var tmp = new BN(null);\n tmp.words = new Array(Math.ceil(this.n / 13));\n return tmp;\n };\n\n MPrime.prototype.ireduce = function ireduce (num) {\n // Assumes that `num` is less than `P^2`\n // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n var r = num;\n var rlen;\n\n do {\n this.split(r, this.tmp);\n r = this.imulK(r);\n r = r.iadd(this.tmp);\n rlen = r.bitLength();\n } while (rlen > this.n);\n\n var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n if (cmp === 0) {\n r.words[0] = 0;\n r.length = 1;\n } else if (cmp > 0) {\n r.isub(this.p);\n } else {\n if (r.strip !== undefined) {\n // r is a BN v4 instance\n r.strip();\n } else {\n // r is a BN v5 instance\n r._strip();\n }\n }\n\n return r;\n };\n\n MPrime.prototype.split = function split (input, out) {\n input.iushrn(this.n, 0, out);\n };\n\n MPrime.prototype.imulK = function imulK (num) {\n return num.imul(this.k);\n };\n\n function K256 () {\n MPrime.call(\n this,\n 'k256',\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n }\n inherits(K256, MPrime);\n\n K256.prototype.split = function split (input, output) {\n // 256 = 9 * 26 + 22\n var mask = 0x3fffff;\n\n var outLen = Math.min(input.length, 9);\n for (var i = 0; i < outLen; i++) {\n output.words[i] = input.words[i];\n }\n output.length = outLen;\n\n if (input.length <= 9) {\n input.words[0] = 0;\n input.length = 1;\n return;\n }\n\n // Shift by 9 limbs\n var prev = input.words[9];\n output.words[output.length++] = prev & mask;\n\n for (i = 10; i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n prev = next;\n }\n prev >>>= 22;\n input.words[i - 10] = prev;\n if (prev === 0 && input.length > 10) {\n input.length -= 10;\n } else {\n input.length -= 9;\n }\n };\n\n K256.prototype.imulK = function imulK (num) {\n // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n num.words[num.length] = 0;\n num.words[num.length + 1] = 0;\n num.length += 2;\n\n // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n var lo = 0;\n for (var i = 0; i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 0x3d1;\n num.words[i] = lo & 0x3ffffff;\n lo = w * 0x40 + ((lo / 0x4000000) | 0);\n }\n\n // Fast length reduction\n if (num.words[num.length - 1] === 0) {\n num.length--;\n if (num.words[num.length - 1] === 0) {\n num.length--;\n }\n }\n return num;\n };\n\n function P224 () {\n MPrime.call(\n this,\n 'p224',\n 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n }\n inherits(P224, MPrime);\n\n function P192 () {\n MPrime.call(\n this,\n 'p192',\n 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n }\n inherits(P192, MPrime);\n\n function P25519 () {\n // 2 ^ 255 - 19\n MPrime.call(\n this,\n '25519',\n '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n }\n inherits(P25519, MPrime);\n\n P25519.prototype.imulK = function imulK (num) {\n // K = 0x13\n var carry = 0;\n for (var i = 0; i < num.length; i++) {\n var hi = (num.words[i] | 0) * 0x13 + carry;\n var lo = hi & 0x3ffffff;\n hi >>>= 26;\n\n num.words[i] = lo;\n carry = hi;\n }\n if (carry !== 0) {\n num.words[num.length++] = carry;\n }\n return num;\n };\n\n // Exported mostly for testing purposes, use plain name instead\n BN._prime = function prime (name) {\n // Cached version of prime\n if (primes[name]) return primes[name];\n\n var prime;\n if (name === 'k256') {\n prime = new K256();\n } else if (name === 'p224') {\n prime = new P224();\n } else if (name === 'p192') {\n prime = new P192();\n } else if (name === 'p25519') {\n prime = new P25519();\n } else {\n throw new Error('Unknown prime ' + name);\n }\n primes[name] = prime;\n\n return prime;\n };\n\n //\n // Base reduction engine\n //\n function Red (m) {\n if (typeof m === 'string') {\n var prime = BN._prime(m);\n this.m = prime.p;\n this.prime = prime;\n } else {\n assert(m.gtn(1), 'modulus must be greater than 1');\n this.m = m;\n this.prime = null;\n }\n }\n\n Red.prototype._verify1 = function _verify1 (a) {\n assert(a.negative === 0, 'red works only with positives');\n assert(a.red, 'red works only with red numbers');\n };\n\n Red.prototype._verify2 = function _verify2 (a, b) {\n assert((a.negative | b.negative) === 0, 'red works only with positives');\n assert(a.red && a.red === b.red,\n 'red works only with red numbers');\n };\n\n Red.prototype.imod = function imod (a) {\n if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n\n move(a, a.umod(this.m)._forceRed(this));\n return a;\n };\n\n Red.prototype.neg = function neg (a) {\n if (a.isZero()) {\n return a.clone();\n }\n\n return this.m.sub(a)._forceRed(this);\n };\n\n Red.prototype.add = function add (a, b) {\n this._verify2(a, b);\n\n var res = a.add(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.iadd = function iadd (a, b) {\n this._verify2(a, b);\n\n var res = a.iadd(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res;\n };\n\n Red.prototype.sub = function sub (a, b) {\n this._verify2(a, b);\n\n var res = a.sub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.isub = function isub (a, b) {\n this._verify2(a, b);\n\n var res = a.isub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res;\n };\n\n Red.prototype.shl = function shl (a, num) {\n this._verify1(a);\n return this.imod(a.ushln(num));\n };\n\n Red.prototype.imul = function imul (a, b) {\n this._verify2(a, b);\n return this.imod(a.imul(b));\n };\n\n Red.prototype.mul = function mul (a, b) {\n this._verify2(a, b);\n return this.imod(a.mul(b));\n };\n\n Red.prototype.isqr = function isqr (a) {\n return this.imul(a, a.clone());\n };\n\n Red.prototype.sqr = function sqr (a) {\n return this.mul(a, a);\n };\n\n Red.prototype.sqrt = function sqrt (a) {\n if (a.isZero()) return a.clone();\n\n var mod3 = this.m.andln(3);\n assert(mod3 % 2 === 1);\n\n // Fast case\n if (mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n\n // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n //\n // Find Q and S, that Q * 2 ^ S = (P - 1)\n var q = this.m.subn(1);\n var s = 0;\n while (!q.isZero() && q.andln(1) === 0) {\n s++;\n q.iushrn(1);\n }\n assert(!q.isZero());\n\n var one = new BN(1).toRed(this);\n var nOne = one.redNeg();\n\n // Find quadratic non-residue\n // NOTE: Max is such because of generalized Riemann hypothesis.\n var lpow = this.m.subn(1).iushrn(1);\n var z = this.m.bitLength();\n z = new BN(2 * z * z).toRed(this);\n\n while (this.pow(z, lpow).cmp(nOne) !== 0) {\n z.redIAdd(nOne);\n }\n\n var c = this.pow(z, q);\n var r = this.pow(a, q.addn(1).iushrn(1));\n var t = this.pow(a, q);\n var m = s;\n while (t.cmp(one) !== 0) {\n var tmp = t;\n for (var i = 0; tmp.cmp(one) !== 0; i++) {\n tmp = tmp.redSqr();\n }\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n r = r.redMul(b);\n c = b.redSqr();\n t = t.redMul(c);\n m = i;\n }\n\n return r;\n };\n\n Red.prototype.invm = function invm (a) {\n var inv = a._invmp(this.m);\n if (inv.negative !== 0) {\n inv.negative = 0;\n return this.imod(inv).redNeg();\n } else {\n return this.imod(inv);\n }\n };\n\n Red.prototype.pow = function pow (a, num) {\n if (num.isZero()) return new BN(1).toRed(this);\n if (num.cmpn(1) === 0) return a.clone();\n\n var windowSize = 4;\n var wnd = new Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this);\n wnd[1] = a;\n for (var i = 2; i < wnd.length; i++) {\n wnd[i] = this.mul(wnd[i - 1], a);\n }\n\n var res = wnd[0];\n var current = 0;\n var currentLen = 0;\n var start = num.bitLength() % 26;\n if (start === 0) {\n start = 26;\n }\n\n for (i = num.length - 1; i >= 0; i--) {\n var word = num.words[i];\n for (var j = start - 1; j >= 0; j--) {\n var bit = (word >> j) & 1;\n if (res !== wnd[0]) {\n res = this.sqr(res);\n }\n\n if (bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n\n current <<= 1;\n current |= bit;\n currentLen++;\n if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n res = this.mul(res, wnd[current]);\n currentLen = 0;\n current = 0;\n }\n start = 26;\n }\n\n return res;\n };\n\n Red.prototype.convertTo = function convertTo (num) {\n var r = num.umod(this.m);\n\n return r === num ? r.clone() : r;\n };\n\n Red.prototype.convertFrom = function convertFrom (num) {\n var res = num.clone();\n res.red = null;\n return res;\n };\n\n //\n // Montgomery method engine\n //\n\n BN.mont = function mont (num) {\n return new Mont(num);\n };\n\n function Mont (m) {\n Red.call(this, m);\n\n this.shift = this.m.bitLength();\n if (this.shift % 26 !== 0) {\n this.shift += 26 - (this.shift % 26);\n }\n\n this.r = new BN(1).iushln(this.shift);\n this.r2 = this.imod(this.r.sqr());\n this.rinv = this.r._invmp(this.m);\n\n this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n this.minv = this.minv.umod(this.r);\n this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red);\n\n Mont.prototype.convertTo = function convertTo (num) {\n return this.imod(num.ushln(this.shift));\n };\n\n Mont.prototype.convertFrom = function convertFrom (num) {\n var r = this.imod(num.mul(this.rinv));\n r.red = null;\n return r;\n };\n\n Mont.prototype.imul = function imul (a, b) {\n if (a.isZero() || b.isZero()) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n var t = a.imul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.mul = function mul (a, b) {\n if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n var t = a.mul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.invm = function invm (a) {\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n})(typeof module === 'undefined' || module, this);\n","export const version = \"logger/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nlet _permanentCensorErrors = false;\nlet _censorErrors = false;\nconst LogLevels = { debug: 1, \"default\": 2, info: 2, warning: 3, error: 4, off: 5 };\nlet _logLevel = LogLevels[\"default\"];\nimport { version } from \"./_version\";\nlet _globalLogger = null;\nfunction _checkNormalize() {\n try {\n const missing = [];\n // Make sure all forms of normalization are supported\n [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].forEach((form) => {\n try {\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad normalize\");\n }\n ;\n }\n catch (error) {\n missing.push(form);\n }\n });\n if (missing.length) {\n throw new Error(\"missing \" + missing.join(\", \"));\n }\n if (String.fromCharCode(0xe9).normalize(\"NFD\") !== String.fromCharCode(0x65, 0x0301)) {\n throw new Error(\"broken implementation\");\n }\n }\n catch (error) {\n return error.message;\n }\n return null;\n}\nconst _normalizeError = _checkNormalize();\nexport var LogLevel;\n(function (LogLevel) {\n LogLevel[\"DEBUG\"] = \"DEBUG\";\n LogLevel[\"INFO\"] = \"INFO\";\n LogLevel[\"WARNING\"] = \"WARNING\";\n LogLevel[\"ERROR\"] = \"ERROR\";\n LogLevel[\"OFF\"] = \"OFF\";\n})(LogLevel || (LogLevel = {}));\nexport var ErrorCode;\n(function (ErrorCode) {\n ///////////////////\n // Generic Errors\n // Unknown Error\n ErrorCode[\"UNKNOWN_ERROR\"] = \"UNKNOWN_ERROR\";\n // Not Implemented\n ErrorCode[\"NOT_IMPLEMENTED\"] = \"NOT_IMPLEMENTED\";\n // Unsupported Operation\n // - operation\n ErrorCode[\"UNSUPPORTED_OPERATION\"] = \"UNSUPPORTED_OPERATION\";\n // Network Error (i.e. Ethereum Network, such as an invalid chain ID)\n // - event (\"noNetwork\" is not re-thrown in provider.ready; otherwise thrown)\n ErrorCode[\"NETWORK_ERROR\"] = \"NETWORK_ERROR\";\n // Some sort of bad response from the server\n ErrorCode[\"SERVER_ERROR\"] = \"SERVER_ERROR\";\n // Timeout\n ErrorCode[\"TIMEOUT\"] = \"TIMEOUT\";\n ///////////////////\n // Operational Errors\n // Buffer Overrun\n ErrorCode[\"BUFFER_OVERRUN\"] = \"BUFFER_OVERRUN\";\n // Numeric Fault\n // - operation: the operation being executed\n // - fault: the reason this faulted\n ErrorCode[\"NUMERIC_FAULT\"] = \"NUMERIC_FAULT\";\n ///////////////////\n // Argument Errors\n // Missing new operator to an object\n // - name: The name of the class\n ErrorCode[\"MISSING_NEW\"] = \"MISSING_NEW\";\n // Invalid argument (e.g. value is incompatible with type) to a function:\n // - argument: The argument name that was invalid\n // - value: The value of the argument\n ErrorCode[\"INVALID_ARGUMENT\"] = \"INVALID_ARGUMENT\";\n // Missing argument to a function:\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"MISSING_ARGUMENT\"] = \"MISSING_ARGUMENT\";\n // Too many arguments\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"UNEXPECTED_ARGUMENT\"] = \"UNEXPECTED_ARGUMENT\";\n ///////////////////\n // Blockchain Errors\n // Call exception\n // - transaction: the transaction\n // - address?: the contract address\n // - args?: The arguments passed into the function\n // - method?: The Solidity method signature\n // - errorSignature?: The EIP848 error signature\n // - errorArgs?: The EIP848 error parameters\n // - reason: The reason (only for EIP848 \"Error(string)\")\n ErrorCode[\"CALL_EXCEPTION\"] = \"CALL_EXCEPTION\";\n // Insufficient funds (< value + gasLimit * gasPrice)\n // - transaction: the transaction attempted\n ErrorCode[\"INSUFFICIENT_FUNDS\"] = \"INSUFFICIENT_FUNDS\";\n // Nonce has already been used\n // - transaction: the transaction attempted\n ErrorCode[\"NONCE_EXPIRED\"] = \"NONCE_EXPIRED\";\n // The replacement fee for the transaction is too low\n // - transaction: the transaction attempted\n ErrorCode[\"REPLACEMENT_UNDERPRICED\"] = \"REPLACEMENT_UNDERPRICED\";\n // The gas limit could not be estimated\n // - transaction: the transaction passed to estimateGas\n ErrorCode[\"UNPREDICTABLE_GAS_LIMIT\"] = \"UNPREDICTABLE_GAS_LIMIT\";\n // The transaction was replaced by one with a higher gas price\n // - reason: \"cancelled\", \"replaced\" or \"repriced\"\n // - cancelled: true if reason == \"cancelled\" or reason == \"replaced\")\n // - hash: original transaction hash\n // - replacement: the full TransactionsResponse for the replacement\n // - receipt: the receipt of the replacement\n ErrorCode[\"TRANSACTION_REPLACED\"] = \"TRANSACTION_REPLACED\";\n ///////////////////\n // Interaction Errors\n // The user rejected the action, such as signing a message or sending\n // a transaction\n ErrorCode[\"ACTION_REJECTED\"] = \"ACTION_REJECTED\";\n})(ErrorCode || (ErrorCode = {}));\n;\nconst HEX = \"0123456789abcdef\";\nexport class Logger {\n constructor(version) {\n Object.defineProperty(this, \"version\", {\n enumerable: true,\n value: version,\n writable: false\n });\n }\n _log(logLevel, args) {\n const level = logLevel.toLowerCase();\n if (LogLevels[level] == null) {\n this.throwArgumentError(\"invalid log level name\", \"logLevel\", logLevel);\n }\n if (_logLevel > LogLevels[level]) {\n return;\n }\n console.log.apply(console, args);\n }\n debug(...args) {\n this._log(Logger.levels.DEBUG, args);\n }\n info(...args) {\n this._log(Logger.levels.INFO, args);\n }\n warn(...args) {\n this._log(Logger.levels.WARNING, args);\n }\n makeError(message, code, params) {\n // Errors are being censored\n if (_censorErrors) {\n return this.makeError(\"censored error\", code, {});\n }\n if (!code) {\n code = Logger.errors.UNKNOWN_ERROR;\n }\n if (!params) {\n params = {};\n }\n const messageDetails = [];\n Object.keys(params).forEach((key) => {\n const value = params[key];\n try {\n if (value instanceof Uint8Array) {\n let hex = \"\";\n for (let i = 0; i < value.length; i++) {\n hex += HEX[value[i] >> 4];\n hex += HEX[value[i] & 0x0f];\n }\n messageDetails.push(key + \"=Uint8Array(0x\" + hex + \")\");\n }\n else {\n messageDetails.push(key + \"=\" + JSON.stringify(value));\n }\n }\n catch (error) {\n messageDetails.push(key + \"=\" + JSON.stringify(params[key].toString()));\n }\n });\n messageDetails.push(`code=${code}`);\n messageDetails.push(`version=${this.version}`);\n const reason = message;\n let url = \"\";\n switch (code) {\n case ErrorCode.NUMERIC_FAULT: {\n url = \"NUMERIC_FAULT\";\n const fault = message;\n switch (fault) {\n case \"overflow\":\n case \"underflow\":\n case \"division-by-zero\":\n url += \"-\" + fault;\n break;\n case \"negative-power\":\n case \"negative-width\":\n url += \"-unsupported\";\n break;\n case \"unbound-bitwise-result\":\n url += \"-unbound-result\";\n break;\n }\n break;\n }\n case ErrorCode.CALL_EXCEPTION:\n case ErrorCode.INSUFFICIENT_FUNDS:\n case ErrorCode.MISSING_NEW:\n case ErrorCode.NONCE_EXPIRED:\n case ErrorCode.REPLACEMENT_UNDERPRICED:\n case ErrorCode.TRANSACTION_REPLACED:\n case ErrorCode.UNPREDICTABLE_GAS_LIMIT:\n url = code;\n break;\n }\n if (url) {\n message += \" [ See: https:/\\/links.ethers.org/v5-errors-\" + url + \" ]\";\n }\n if (messageDetails.length) {\n message += \" (\" + messageDetails.join(\", \") + \")\";\n }\n // @TODO: Any??\n const error = new Error(message);\n error.reason = reason;\n error.code = code;\n Object.keys(params).forEach(function (key) {\n error[key] = params[key];\n });\n return error;\n }\n throwError(message, code, params) {\n throw this.makeError(message, code, params);\n }\n throwArgumentError(message, name, value) {\n return this.throwError(message, Logger.errors.INVALID_ARGUMENT, {\n argument: name,\n value: value\n });\n }\n assert(condition, message, code, params) {\n if (!!condition) {\n return;\n }\n this.throwError(message, code, params);\n }\n assertArgument(condition, message, name, value) {\n if (!!condition) {\n return;\n }\n this.throwArgumentError(message, name, value);\n }\n checkNormalize(message) {\n if (message == null) {\n message = \"platform missing String.prototype.normalize\";\n }\n if (_normalizeError) {\n this.throwError(\"platform missing String.prototype.normalize\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"String.prototype.normalize\", form: _normalizeError\n });\n }\n }\n checkSafeUint53(value, message) {\n if (typeof (value) !== \"number\") {\n return;\n }\n if (message == null) {\n message = \"value not safe\";\n }\n if (value < 0 || value >= 0x1fffffffffffff) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"out-of-safe-range\",\n value: value\n });\n }\n if (value % 1) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"non-integer\",\n value: value\n });\n }\n }\n checkArgumentCount(count, expectedCount, message) {\n if (message) {\n message = \": \" + message;\n }\n else {\n message = \"\";\n }\n if (count < expectedCount) {\n this.throwError(\"missing argument\" + message, Logger.errors.MISSING_ARGUMENT, {\n count: count,\n expectedCount: expectedCount\n });\n }\n if (count > expectedCount) {\n this.throwError(\"too many arguments\" + message, Logger.errors.UNEXPECTED_ARGUMENT, {\n count: count,\n expectedCount: expectedCount\n });\n }\n }\n checkNew(target, kind) {\n if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, { name: kind.name });\n }\n }\n checkAbstract(target, kind) {\n if (target === kind) {\n this.throwError(\"cannot instantiate abstract class \" + JSON.stringify(kind.name) + \" directly; use a sub-class\", Logger.errors.UNSUPPORTED_OPERATION, { name: target.name, operation: \"new\" });\n }\n else if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, { name: kind.name });\n }\n }\n static globalLogger() {\n if (!_globalLogger) {\n _globalLogger = new Logger(version);\n }\n return _globalLogger;\n }\n static setCensorship(censorship, permanent) {\n if (!censorship && permanent) {\n this.globalLogger().throwError(\"cannot permanently disable censorship\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\"\n });\n }\n if (_permanentCensorErrors) {\n if (!censorship) {\n return;\n }\n this.globalLogger().throwError(\"error censorship permanent\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\"\n });\n }\n _censorErrors = !!censorship;\n _permanentCensorErrors = !!permanent;\n }\n static setLogLevel(logLevel) {\n const level = LogLevels[logLevel.toLowerCase()];\n if (level == null) {\n Logger.globalLogger().warn(\"invalid log level - \" + logLevel);\n return;\n }\n _logLevel = level;\n }\n static from(version) {\n return new Logger(version);\n }\n}\nLogger.errors = ErrorCode;\nLogger.levels = LogLevel;\n//# sourceMappingURL=index.js.map","export const version = \"bytes/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n///////////////////////////////\nfunction isHexable(value) {\n return !!(value.toHexString);\n}\nfunction addSlice(array) {\n if (array.slice) {\n return array;\n }\n array.slice = function () {\n const args = Array.prototype.slice.call(arguments);\n return addSlice(new Uint8Array(Array.prototype.slice.apply(array, args)));\n };\n return array;\n}\nexport function isBytesLike(value) {\n return ((isHexString(value) && !(value.length % 2)) || isBytes(value));\n}\nfunction isInteger(value) {\n return (typeof (value) === \"number\" && value == value && (value % 1) === 0);\n}\nexport function isBytes(value) {\n if (value == null) {\n return false;\n }\n if (value.constructor === Uint8Array) {\n return true;\n }\n if (typeof (value) === \"string\") {\n return false;\n }\n if (!isInteger(value.length) || value.length < 0) {\n return false;\n }\n for (let i = 0; i < value.length; i++) {\n const v = value[i];\n if (!isInteger(v) || v < 0 || v >= 256) {\n return false;\n }\n }\n return true;\n}\nexport function arrayify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof (value) === \"number\") {\n logger.checkSafeUint53(value, \"invalid arrayify value\");\n const result = [];\n while (value) {\n result.unshift(value & 0xff);\n value = parseInt(String(value / 256));\n }\n if (result.length === 0) {\n result.push(0);\n }\n return addSlice(new Uint8Array(result));\n }\n if (options.allowMissingPrefix && typeof (value) === \"string\" && value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n value = value.toHexString();\n }\n if (isHexString(value)) {\n let hex = value.substring(2);\n if (hex.length % 2) {\n if (options.hexPad === \"left\") {\n hex = \"0\" + hex;\n }\n else if (options.hexPad === \"right\") {\n hex += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n const result = [];\n for (let i = 0; i < hex.length; i += 2) {\n result.push(parseInt(hex.substring(i, i + 2), 16));\n }\n return addSlice(new Uint8Array(result));\n }\n if (isBytes(value)) {\n return addSlice(new Uint8Array(value));\n }\n return logger.throwArgumentError(\"invalid arrayify value\", \"value\", value);\n}\nexport function concat(items) {\n const objects = items.map(item => arrayify(item));\n const length = objects.reduce((accum, item) => (accum + item.length), 0);\n const result = new Uint8Array(length);\n objects.reduce((offset, object) => {\n result.set(object, offset);\n return offset + object.length;\n }, 0);\n return addSlice(result);\n}\nexport function stripZeros(value) {\n let result = arrayify(value);\n if (result.length === 0) {\n return result;\n }\n // Find the first non-zero entry\n let start = 0;\n while (start < result.length && result[start] === 0) {\n start++;\n }\n // If we started with zeros, strip them\n if (start) {\n result = result.slice(start);\n }\n return result;\n}\nexport function zeroPad(value, length) {\n value = arrayify(value);\n if (value.length > length) {\n logger.throwArgumentError(\"value out of range\", \"value\", arguments[0]);\n }\n const result = new Uint8Array(length);\n result.set(value, length - value.length);\n return addSlice(result);\n}\nexport function isHexString(value, length) {\n if (typeof (value) !== \"string\" || !value.match(/^0x[0-9A-Fa-f]*$/)) {\n return false;\n }\n if (length && value.length !== 2 + 2 * length) {\n return false;\n }\n return true;\n}\nconst HexCharacters = \"0123456789abcdef\";\nexport function hexlify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof (value) === \"number\") {\n logger.checkSafeUint53(value, \"invalid hexlify value\");\n let hex = \"\";\n while (value) {\n hex = HexCharacters[value & 0xf] + hex;\n value = Math.floor(value / 16);\n }\n if (hex.length) {\n if (hex.length % 2) {\n hex = \"0\" + hex;\n }\n return \"0x\" + hex;\n }\n return \"0x00\";\n }\n if (typeof (value) === \"bigint\") {\n value = value.toString(16);\n if (value.length % 2) {\n return (\"0x0\" + value);\n }\n return \"0x\" + value;\n }\n if (options.allowMissingPrefix && typeof (value) === \"string\" && value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n return value.toHexString();\n }\n if (isHexString(value)) {\n if (value.length % 2) {\n if (options.hexPad === \"left\") {\n value = \"0x0\" + value.substring(2);\n }\n else if (options.hexPad === \"right\") {\n value += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n return value.toLowerCase();\n }\n if (isBytes(value)) {\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n let v = value[i];\n result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f];\n }\n return result;\n }\n return logger.throwArgumentError(\"invalid hexlify value\", \"value\", value);\n}\n/*\nfunction unoddify(value: BytesLike | Hexable | number): BytesLike | Hexable | number {\n if (typeof(value) === \"string\" && value.length % 2 && value.substring(0, 2) === \"0x\") {\n return \"0x0\" + value.substring(2);\n }\n return value;\n}\n*/\nexport function hexDataLength(data) {\n if (typeof (data) !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || (data.length % 2)) {\n return null;\n }\n return (data.length - 2) / 2;\n}\nexport function hexDataSlice(data, offset, endOffset) {\n if (typeof (data) !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || (data.length % 2)) {\n logger.throwArgumentError(\"invalid hexData\", \"value\", data);\n }\n offset = 2 + 2 * offset;\n if (endOffset != null) {\n return \"0x\" + data.substring(offset, 2 + 2 * endOffset);\n }\n return \"0x\" + data.substring(offset);\n}\nexport function hexConcat(items) {\n let result = \"0x\";\n items.forEach((item) => {\n result += hexlify(item).substring(2);\n });\n return result;\n}\nexport function hexValue(value) {\n const trimmed = hexStripZeros(hexlify(value, { hexPad: \"left\" }));\n if (trimmed === \"0x\") {\n return \"0x0\";\n }\n return trimmed;\n}\nexport function hexStripZeros(value) {\n if (typeof (value) !== \"string\") {\n value = hexlify(value);\n }\n if (!isHexString(value)) {\n logger.throwArgumentError(\"invalid hex string\", \"value\", value);\n }\n value = value.substring(2);\n let offset = 0;\n while (offset < value.length && value[offset] === \"0\") {\n offset++;\n }\n return \"0x\" + value.substring(offset);\n}\nexport function hexZeroPad(value, length) {\n if (typeof (value) !== \"string\") {\n value = hexlify(value);\n }\n else if (!isHexString(value)) {\n logger.throwArgumentError(\"invalid hex string\", \"value\", value);\n }\n if (value.length > 2 * length + 2) {\n logger.throwArgumentError(\"value out of range\", \"value\", arguments[1]);\n }\n while (value.length < 2 * length + 2) {\n value = \"0x0\" + value.substring(2);\n }\n return value;\n}\nexport function splitSignature(signature) {\n const result = {\n r: \"0x\",\n s: \"0x\",\n _vs: \"0x\",\n recoveryParam: 0,\n v: 0,\n yParityAndS: \"0x\",\n compact: \"0x\"\n };\n if (isBytesLike(signature)) {\n let bytes = arrayify(signature);\n // Get the r, s and v\n if (bytes.length === 64) {\n // EIP-2098; pull the v from the top bit of s and clear it\n result.v = 27 + (bytes[32] >> 7);\n bytes[32] &= 0x7f;\n result.r = hexlify(bytes.slice(0, 32));\n result.s = hexlify(bytes.slice(32, 64));\n }\n else if (bytes.length === 65) {\n result.r = hexlify(bytes.slice(0, 32));\n result.s = hexlify(bytes.slice(32, 64));\n result.v = bytes[64];\n }\n else {\n logger.throwArgumentError(\"invalid signature string\", \"signature\", signature);\n }\n // Allow a recid to be used as the v\n if (result.v < 27) {\n if (result.v === 0 || result.v === 1) {\n result.v += 27;\n }\n else {\n logger.throwArgumentError(\"signature invalid v byte\", \"signature\", signature);\n }\n }\n // Compute recoveryParam from v\n result.recoveryParam = 1 - (result.v % 2);\n // Compute _vs from recoveryParam and s\n if (result.recoveryParam) {\n bytes[32] |= 0x80;\n }\n result._vs = hexlify(bytes.slice(32, 64));\n }\n else {\n result.r = signature.r;\n result.s = signature.s;\n result.v = signature.v;\n result.recoveryParam = signature.recoveryParam;\n result._vs = signature._vs;\n // If the _vs is available, use it to populate missing s, v and recoveryParam\n // and verify non-missing s, v and recoveryParam\n if (result._vs != null) {\n const vs = zeroPad(arrayify(result._vs), 32);\n result._vs = hexlify(vs);\n // Set or check the recid\n const recoveryParam = ((vs[0] >= 128) ? 1 : 0);\n if (result.recoveryParam == null) {\n result.recoveryParam = recoveryParam;\n }\n else if (result.recoveryParam !== recoveryParam) {\n logger.throwArgumentError(\"signature recoveryParam mismatch _vs\", \"signature\", signature);\n }\n // Set or check the s\n vs[0] &= 0x7f;\n const s = hexlify(vs);\n if (result.s == null) {\n result.s = s;\n }\n else if (result.s !== s) {\n logger.throwArgumentError(\"signature v mismatch _vs\", \"signature\", signature);\n }\n }\n // Use recid and v to populate each other\n if (result.recoveryParam == null) {\n if (result.v == null) {\n logger.throwArgumentError(\"signature missing v and recoveryParam\", \"signature\", signature);\n }\n else if (result.v === 0 || result.v === 1) {\n result.recoveryParam = result.v;\n }\n else {\n result.recoveryParam = 1 - (result.v % 2);\n }\n }\n else {\n if (result.v == null) {\n result.v = 27 + result.recoveryParam;\n }\n else {\n const recId = (result.v === 0 || result.v === 1) ? result.v : (1 - (result.v % 2));\n if (result.recoveryParam !== recId) {\n logger.throwArgumentError(\"signature recoveryParam mismatch v\", \"signature\", signature);\n }\n }\n }\n if (result.r == null || !isHexString(result.r)) {\n logger.throwArgumentError(\"signature missing or invalid r\", \"signature\", signature);\n }\n else {\n result.r = hexZeroPad(result.r, 32);\n }\n if (result.s == null || !isHexString(result.s)) {\n logger.throwArgumentError(\"signature missing or invalid s\", \"signature\", signature);\n }\n else {\n result.s = hexZeroPad(result.s, 32);\n }\n const vs = arrayify(result.s);\n if (vs[0] >= 128) {\n logger.throwArgumentError(\"signature s out of range\", \"signature\", signature);\n }\n if (result.recoveryParam) {\n vs[0] |= 0x80;\n }\n const _vs = hexlify(vs);\n if (result._vs) {\n if (!isHexString(result._vs)) {\n logger.throwArgumentError(\"signature invalid _vs\", \"signature\", signature);\n }\n result._vs = hexZeroPad(result._vs, 32);\n }\n // Set or check the _vs\n if (result._vs == null) {\n result._vs = _vs;\n }\n else if (result._vs !== _vs) {\n logger.throwArgumentError(\"signature _vs mismatch v and s\", \"signature\", signature);\n }\n }\n result.yParityAndS = result._vs;\n result.compact = result.r + result.yParityAndS.substring(2);\n return result;\n}\nexport function joinSignature(signature) {\n signature = splitSignature(signature);\n return hexlify(concat([\n signature.r,\n signature.s,\n (signature.recoveryParam ? \"0x1c\" : \"0x1b\")\n ]));\n}\n//# sourceMappingURL=index.js.map","export const version = \"bignumber/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\n/**\n * BigNumber\n *\n * A wrapper around the BN.js object. We use the BN.js library\n * because it is used by elliptic, so it is required regardless.\n *\n */\nimport _BN from \"bn.js\";\nvar BN = _BN.BN;\nimport { hexlify, isBytes, isHexString } from \"@ethersproject/bytes\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nconst _constructorGuard = {};\nconst MAX_SAFE = 0x1fffffffffffff;\nexport function isBigNumberish(value) {\n return (value != null) && (BigNumber.isBigNumber(value) ||\n (typeof (value) === \"number\" && (value % 1) === 0) ||\n (typeof (value) === \"string\" && !!value.match(/^-?[0-9]+$/)) ||\n isHexString(value) ||\n (typeof (value) === \"bigint\") ||\n isBytes(value));\n}\n// Only warn about passing 10 into radix once\nlet _warnedToStringRadix = false;\nexport class BigNumber {\n constructor(constructorGuard, hex) {\n if (constructorGuard !== _constructorGuard) {\n logger.throwError(\"cannot call constructor directly; use BigNumber.from\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"new (BigNumber)\"\n });\n }\n this._hex = hex;\n this._isBigNumber = true;\n Object.freeze(this);\n }\n fromTwos(value) {\n return toBigNumber(toBN(this).fromTwos(value));\n }\n toTwos(value) {\n return toBigNumber(toBN(this).toTwos(value));\n }\n abs() {\n if (this._hex[0] === \"-\") {\n return BigNumber.from(this._hex.substring(1));\n }\n return this;\n }\n add(other) {\n return toBigNumber(toBN(this).add(toBN(other)));\n }\n sub(other) {\n return toBigNumber(toBN(this).sub(toBN(other)));\n }\n div(other) {\n const o = BigNumber.from(other);\n if (o.isZero()) {\n throwFault(\"division-by-zero\", \"div\");\n }\n return toBigNumber(toBN(this).div(toBN(other)));\n }\n mul(other) {\n return toBigNumber(toBN(this).mul(toBN(other)));\n }\n mod(other) {\n const value = toBN(other);\n if (value.isNeg()) {\n throwFault(\"division-by-zero\", \"mod\");\n }\n return toBigNumber(toBN(this).umod(value));\n }\n pow(other) {\n const value = toBN(other);\n if (value.isNeg()) {\n throwFault(\"negative-power\", \"pow\");\n }\n return toBigNumber(toBN(this).pow(value));\n }\n and(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"unbound-bitwise-result\", \"and\");\n }\n return toBigNumber(toBN(this).and(value));\n }\n or(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"unbound-bitwise-result\", \"or\");\n }\n return toBigNumber(toBN(this).or(value));\n }\n xor(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"unbound-bitwise-result\", \"xor\");\n }\n return toBigNumber(toBN(this).xor(value));\n }\n mask(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"negative-width\", \"mask\");\n }\n return toBigNumber(toBN(this).maskn(value));\n }\n shl(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"negative-width\", \"shl\");\n }\n return toBigNumber(toBN(this).shln(value));\n }\n shr(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"negative-width\", \"shr\");\n }\n return toBigNumber(toBN(this).shrn(value));\n }\n eq(other) {\n return toBN(this).eq(toBN(other));\n }\n lt(other) {\n return toBN(this).lt(toBN(other));\n }\n lte(other) {\n return toBN(this).lte(toBN(other));\n }\n gt(other) {\n return toBN(this).gt(toBN(other));\n }\n gte(other) {\n return toBN(this).gte(toBN(other));\n }\n isNegative() {\n return (this._hex[0] === \"-\");\n }\n isZero() {\n return toBN(this).isZero();\n }\n toNumber() {\n try {\n return toBN(this).toNumber();\n }\n catch (error) {\n throwFault(\"overflow\", \"toNumber\", this.toString());\n }\n return null;\n }\n toBigInt() {\n try {\n return BigInt(this.toString());\n }\n catch (e) { }\n return logger.throwError(\"this platform does not support BigInt\", Logger.errors.UNSUPPORTED_OPERATION, {\n value: this.toString()\n });\n }\n toString() {\n // Lots of people expect this, which we do not support, so check (See: #889)\n if (arguments.length > 0) {\n if (arguments[0] === 10) {\n if (!_warnedToStringRadix) {\n _warnedToStringRadix = true;\n logger.warn(\"BigNumber.toString does not accept any parameters; base-10 is assumed\");\n }\n }\n else if (arguments[0] === 16) {\n logger.throwError(\"BigNumber.toString does not accept any parameters; use bigNumber.toHexString()\", Logger.errors.UNEXPECTED_ARGUMENT, {});\n }\n else {\n logger.throwError(\"BigNumber.toString does not accept parameters\", Logger.errors.UNEXPECTED_ARGUMENT, {});\n }\n }\n return toBN(this).toString(10);\n }\n toHexString() {\n return this._hex;\n }\n toJSON(key) {\n return { type: \"BigNumber\", hex: this.toHexString() };\n }\n static from(value) {\n if (value instanceof BigNumber) {\n return value;\n }\n if (typeof (value) === \"string\") {\n if (value.match(/^-?0x[0-9a-f]+$/i)) {\n return new BigNumber(_constructorGuard, toHex(value));\n }\n if (value.match(/^-?[0-9]+$/)) {\n return new BigNumber(_constructorGuard, toHex(new BN(value)));\n }\n return logger.throwArgumentError(\"invalid BigNumber string\", \"value\", value);\n }\n if (typeof (value) === \"number\") {\n if (value % 1) {\n throwFault(\"underflow\", \"BigNumber.from\", value);\n }\n if (value >= MAX_SAFE || value <= -MAX_SAFE) {\n throwFault(\"overflow\", \"BigNumber.from\", value);\n }\n return BigNumber.from(String(value));\n }\n const anyValue = value;\n if (typeof (anyValue) === \"bigint\") {\n return BigNumber.from(anyValue.toString());\n }\n if (isBytes(anyValue)) {\n return BigNumber.from(hexlify(anyValue));\n }\n if (anyValue) {\n // Hexable interface (takes priority)\n if (anyValue.toHexString) {\n const hex = anyValue.toHexString();\n if (typeof (hex) === \"string\") {\n return BigNumber.from(hex);\n }\n }\n else {\n // For now, handle legacy JSON-ified values (goes away in v6)\n let hex = anyValue._hex;\n // New-form JSON\n if (hex == null && anyValue.type === \"BigNumber\") {\n hex = anyValue.hex;\n }\n if (typeof (hex) === \"string\") {\n if (isHexString(hex) || (hex[0] === \"-\" && isHexString(hex.substring(1)))) {\n return BigNumber.from(hex);\n }\n }\n }\n }\n return logger.throwArgumentError(\"invalid BigNumber value\", \"value\", value);\n }\n static isBigNumber(value) {\n return !!(value && value._isBigNumber);\n }\n}\n// Normalize the hex string\nfunction toHex(value) {\n // For BN, call on the hex string\n if (typeof (value) !== \"string\") {\n return toHex(value.toString(16));\n }\n // If negative, prepend the negative sign to the normalized positive value\n if (value[0] === \"-\") {\n // Strip off the negative sign\n value = value.substring(1);\n // Cannot have multiple negative signs (e.g. \"--0x04\")\n if (value[0] === \"-\") {\n logger.throwArgumentError(\"invalid hex\", \"value\", value);\n }\n // Call toHex on the positive component\n value = toHex(value);\n // Do not allow \"-0x00\"\n if (value === \"0x00\") {\n return value;\n }\n // Negate the value\n return \"-\" + value;\n }\n // Add a \"0x\" prefix if missing\n if (value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n // Normalize zero\n if (value === \"0x\") {\n return \"0x00\";\n }\n // Make the string even length\n if (value.length % 2) {\n value = \"0x0\" + value.substring(2);\n }\n // Trim to smallest even-length string\n while (value.length > 4 && value.substring(0, 4) === \"0x00\") {\n value = \"0x\" + value.substring(4);\n }\n return value;\n}\nfunction toBigNumber(value) {\n return BigNumber.from(toHex(value));\n}\nfunction toBN(value) {\n const hex = BigNumber.from(value).toHexString();\n if (hex[0] === \"-\") {\n return (new BN(\"-\" + hex.substring(3), 16));\n }\n return new BN(hex.substring(2), 16);\n}\nfunction throwFault(fault, operation, value) {\n const params = { fault: fault, operation: operation };\n if (value != null) {\n params.value = value;\n }\n return logger.throwError(fault, Logger.errors.NUMERIC_FAULT, params);\n}\n// value should have no prefix\nexport function _base36To16(value) {\n return (new BN(value, 36)).toString(16);\n}\n// value should have no prefix\nexport function _base16To36(value) {\n return (new BN(value, 16)).toString(36);\n}\n//# sourceMappingURL=bignumber.js.map","export const version = \"properties/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nexport function defineReadOnly(object, name, value) {\n Object.defineProperty(object, name, {\n enumerable: true,\n value: value,\n writable: false,\n });\n}\n// Crawl up the constructor chain to find a static method\nexport function getStatic(ctor, key) {\n for (let i = 0; i < 32; i++) {\n if (ctor[key]) {\n return ctor[key];\n }\n if (!ctor.prototype || typeof (ctor.prototype) !== \"object\") {\n break;\n }\n ctor = Object.getPrototypeOf(ctor.prototype).constructor;\n }\n return null;\n}\nexport function resolveProperties(object) {\n return __awaiter(this, void 0, void 0, function* () {\n const promises = Object.keys(object).map((key) => {\n const value = object[key];\n return Promise.resolve(value).then((v) => ({ key: key, value: v }));\n });\n const results = yield Promise.all(promises);\n return results.reduce((accum, result) => {\n accum[(result.key)] = result.value;\n return accum;\n }, {});\n });\n}\nexport function checkProperties(object, properties) {\n if (!object || typeof (object) !== \"object\") {\n logger.throwArgumentError(\"invalid object\", \"object\", object);\n }\n Object.keys(object).forEach((key) => {\n if (!properties[key]) {\n logger.throwArgumentError(\"invalid object key - \" + key, \"transaction:\" + key, object);\n }\n });\n}\nexport function shallowCopy(object) {\n const result = {};\n for (const key in object) {\n result[key] = object[key];\n }\n return result;\n}\nconst opaque = { bigint: true, boolean: true, \"function\": true, number: true, string: true };\nfunction _isFrozen(object) {\n // Opaque objects are not mutable, so safe to copy by assignment\n if (object === undefined || object === null || opaque[typeof (object)]) {\n return true;\n }\n if (Array.isArray(object) || typeof (object) === \"object\") {\n if (!Object.isFrozen(object)) {\n return false;\n }\n const keys = Object.keys(object);\n for (let i = 0; i < keys.length; i++) {\n let value = null;\n try {\n value = object[keys[i]];\n }\n catch (error) {\n // If accessing a value triggers an error, it is a getter\n // designed to do so (e.g. Result) and is therefore \"frozen\"\n continue;\n }\n if (!_isFrozen(value)) {\n return false;\n }\n }\n return true;\n }\n return logger.throwArgumentError(`Cannot deepCopy ${typeof (object)}`, \"object\", object);\n}\n// Returns a new copy of object, such that no properties may be replaced.\n// New properties may be added only to objects.\nfunction _deepCopy(object) {\n if (_isFrozen(object)) {\n return object;\n }\n // Arrays are mutable, so we need to create a copy\n if (Array.isArray(object)) {\n return Object.freeze(object.map((item) => deepCopy(item)));\n }\n if (typeof (object) === \"object\") {\n const result = {};\n for (const key in object) {\n const value = object[key];\n if (value === undefined) {\n continue;\n }\n defineReadOnly(result, key, deepCopy(value));\n }\n return result;\n }\n return logger.throwArgumentError(`Cannot deepCopy ${typeof (object)}`, \"object\", object);\n}\nexport function deepCopy(object) {\n return _deepCopy(object);\n}\nexport class Description {\n constructor(info) {\n for (const key in info) {\n this[key] = deepCopy(info[key]);\n }\n }\n}\n//# sourceMappingURL=index.js.map","export const version = \"abi/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n;\nconst _constructorGuard = {};\nlet ModifiersBytes = { calldata: true, memory: true, storage: true };\nlet ModifiersNest = { calldata: true, memory: true };\nfunction checkModifier(type, name) {\n if (type === \"bytes\" || type === \"string\") {\n if (ModifiersBytes[name]) {\n return true;\n }\n }\n else if (type === \"address\") {\n if (name === \"payable\") {\n return true;\n }\n }\n else if (type.indexOf(\"[\") >= 0 || type === \"tuple\") {\n if (ModifiersNest[name]) {\n return true;\n }\n }\n if (ModifiersBytes[name] || name === \"payable\") {\n logger.throwArgumentError(\"invalid modifier\", \"name\", name);\n }\n return false;\n}\n// @TODO: Make sure that children of an indexed tuple are marked with a null indexed\nfunction parseParamType(param, allowIndexed) {\n let originalParam = param;\n function throwError(i) {\n logger.throwArgumentError(`unexpected character at position ${i}`, \"param\", param);\n }\n param = param.replace(/\\s/g, \" \");\n function newNode(parent) {\n let node = { type: \"\", name: \"\", parent: parent, state: { allowType: true } };\n if (allowIndexed) {\n node.indexed = false;\n }\n return node;\n }\n let parent = { type: \"\", name: \"\", state: { allowType: true } };\n let node = parent;\n for (let i = 0; i < param.length; i++) {\n let c = param[i];\n switch (c) {\n case \"(\":\n if (node.state.allowType && node.type === \"\") {\n node.type = \"tuple\";\n }\n else if (!node.state.allowParams) {\n throwError(i);\n }\n node.state.allowType = false;\n node.type = verifyType(node.type);\n node.components = [newNode(node)];\n node = node.components[0];\n break;\n case \")\":\n delete node.state;\n if (node.name === \"indexed\") {\n if (!allowIndexed) {\n throwError(i);\n }\n node.indexed = true;\n node.name = \"\";\n }\n if (checkModifier(node.type, node.name)) {\n node.name = \"\";\n }\n node.type = verifyType(node.type);\n let child = node;\n node = node.parent;\n if (!node) {\n throwError(i);\n }\n delete child.parent;\n node.state.allowParams = false;\n node.state.allowName = true;\n node.state.allowArray = true;\n break;\n case \",\":\n delete node.state;\n if (node.name === \"indexed\") {\n if (!allowIndexed) {\n throwError(i);\n }\n node.indexed = true;\n node.name = \"\";\n }\n if (checkModifier(node.type, node.name)) {\n node.name = \"\";\n }\n node.type = verifyType(node.type);\n let sibling = newNode(node.parent);\n //{ type: \"\", name: \"\", parent: node.parent, state: { allowType: true } };\n node.parent.components.push(sibling);\n delete node.parent;\n node = sibling;\n break;\n // Hit a space...\n case \" \":\n // If reading type, the type is done and may read a param or name\n if (node.state.allowType) {\n if (node.type !== \"\") {\n node.type = verifyType(node.type);\n delete node.state.allowType;\n node.state.allowName = true;\n node.state.allowParams = true;\n }\n }\n // If reading name, the name is done\n if (node.state.allowName) {\n if (node.name !== \"\") {\n if (node.name === \"indexed\") {\n if (!allowIndexed) {\n throwError(i);\n }\n if (node.indexed) {\n throwError(i);\n }\n node.indexed = true;\n node.name = \"\";\n }\n else if (checkModifier(node.type, node.name)) {\n node.name = \"\";\n }\n else {\n node.state.allowName = false;\n }\n }\n }\n break;\n case \"[\":\n if (!node.state.allowArray) {\n throwError(i);\n }\n node.type += c;\n node.state.allowArray = false;\n node.state.allowName = false;\n node.state.readArray = true;\n break;\n case \"]\":\n if (!node.state.readArray) {\n throwError(i);\n }\n node.type += c;\n node.state.readArray = false;\n node.state.allowArray = true;\n node.state.allowName = true;\n break;\n default:\n if (node.state.allowType) {\n node.type += c;\n node.state.allowParams = true;\n node.state.allowArray = true;\n }\n else if (node.state.allowName) {\n node.name += c;\n delete node.state.allowArray;\n }\n else if (node.state.readArray) {\n node.type += c;\n }\n else {\n throwError(i);\n }\n }\n }\n if (node.parent) {\n logger.throwArgumentError(\"unexpected eof\", \"param\", param);\n }\n delete parent.state;\n if (node.name === \"indexed\") {\n if (!allowIndexed) {\n throwError(originalParam.length - 7);\n }\n if (node.indexed) {\n throwError(originalParam.length - 7);\n }\n node.indexed = true;\n node.name = \"\";\n }\n else if (checkModifier(node.type, node.name)) {\n node.name = \"\";\n }\n parent.type = verifyType(parent.type);\n return parent;\n}\nfunction populate(object, params) {\n for (let key in params) {\n defineReadOnly(object, key, params[key]);\n }\n}\nexport const FormatTypes = Object.freeze({\n // Bare formatting, as is needed for computing a sighash of an event or function\n sighash: \"sighash\",\n // Human-Readable with Minimal spacing and without names (compact human-readable)\n minimal: \"minimal\",\n // Human-Readable with nice spacing, including all names\n full: \"full\",\n // JSON-format a la Solidity\n json: \"json\"\n});\nconst paramTypeArray = new RegExp(/^(.*)\\[([0-9]*)\\]$/);\nexport class ParamType {\n constructor(constructorGuard, params) {\n if (constructorGuard !== _constructorGuard) {\n logger.throwError(\"use fromString\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"new ParamType()\"\n });\n }\n populate(this, params);\n let match = this.type.match(paramTypeArray);\n if (match) {\n populate(this, {\n arrayLength: parseInt(match[2] || \"-1\"),\n arrayChildren: ParamType.fromObject({\n type: match[1],\n components: this.components\n }),\n baseType: \"array\"\n });\n }\n else {\n populate(this, {\n arrayLength: null,\n arrayChildren: null,\n baseType: ((this.components != null) ? \"tuple\" : this.type)\n });\n }\n this._isParamType = true;\n Object.freeze(this);\n }\n // Format the parameter fragment\n // - sighash: \"(uint256,address)\"\n // - minimal: \"tuple(uint256,address) indexed\"\n // - full: \"tuple(uint256 foo, address bar) indexed baz\"\n format(format) {\n if (!format) {\n format = FormatTypes.sighash;\n }\n if (!FormatTypes[format]) {\n logger.throwArgumentError(\"invalid format type\", \"format\", format);\n }\n if (format === FormatTypes.json) {\n let result = {\n type: ((this.baseType === \"tuple\") ? \"tuple\" : this.type),\n name: (this.name || undefined)\n };\n if (typeof (this.indexed) === \"boolean\") {\n result.indexed = this.indexed;\n }\n if (this.components) {\n result.components = this.components.map((comp) => JSON.parse(comp.format(format)));\n }\n return JSON.stringify(result);\n }\n let result = \"\";\n // Array\n if (this.baseType === \"array\") {\n result += this.arrayChildren.format(format);\n result += \"[\" + (this.arrayLength < 0 ? \"\" : String(this.arrayLength)) + \"]\";\n }\n else {\n if (this.baseType === \"tuple\") {\n if (format !== FormatTypes.sighash) {\n result += this.type;\n }\n result += \"(\" + this.components.map((comp) => comp.format(format)).join((format === FormatTypes.full) ? \", \" : \",\") + \")\";\n }\n else {\n result += this.type;\n }\n }\n if (format !== FormatTypes.sighash) {\n if (this.indexed === true) {\n result += \" indexed\";\n }\n if (format === FormatTypes.full && this.name) {\n result += \" \" + this.name;\n }\n }\n return result;\n }\n static from(value, allowIndexed) {\n if (typeof (value) === \"string\") {\n return ParamType.fromString(value, allowIndexed);\n }\n return ParamType.fromObject(value);\n }\n static fromObject(value) {\n if (ParamType.isParamType(value)) {\n return value;\n }\n return new ParamType(_constructorGuard, {\n name: (value.name || null),\n type: verifyType(value.type),\n indexed: ((value.indexed == null) ? null : !!value.indexed),\n components: (value.components ? value.components.map(ParamType.fromObject) : null)\n });\n }\n static fromString(value, allowIndexed) {\n function ParamTypify(node) {\n return ParamType.fromObject({\n name: node.name,\n type: node.type,\n indexed: node.indexed,\n components: node.components\n });\n }\n return ParamTypify(parseParamType(value, !!allowIndexed));\n }\n static isParamType(value) {\n return !!(value != null && value._isParamType);\n }\n}\n;\nfunction parseParams(value, allowIndex) {\n return splitNesting(value).map((param) => ParamType.fromString(param, allowIndex));\n}\nexport class Fragment {\n constructor(constructorGuard, params) {\n if (constructorGuard !== _constructorGuard) {\n logger.throwError(\"use a static from method\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"new Fragment()\"\n });\n }\n populate(this, params);\n this._isFragment = true;\n Object.freeze(this);\n }\n static from(value) {\n if (Fragment.isFragment(value)) {\n return value;\n }\n if (typeof (value) === \"string\") {\n return Fragment.fromString(value);\n }\n return Fragment.fromObject(value);\n }\n static fromObject(value) {\n if (Fragment.isFragment(value)) {\n return value;\n }\n switch (value.type) {\n case \"function\":\n return FunctionFragment.fromObject(value);\n case \"event\":\n return EventFragment.fromObject(value);\n case \"constructor\":\n return ConstructorFragment.fromObject(value);\n case \"error\":\n return ErrorFragment.fromObject(value);\n case \"fallback\":\n case \"receive\":\n // @TODO: Something? Maybe return a FunctionFragment? A custom DefaultFunctionFragment?\n return null;\n }\n return logger.throwArgumentError(\"invalid fragment object\", \"value\", value);\n }\n static fromString(value) {\n // Make sure the \"returns\" is surrounded by a space and all whitespace is exactly one space\n value = value.replace(/\\s/g, \" \");\n value = value.replace(/\\(/g, \" (\").replace(/\\)/g, \") \").replace(/\\s+/g, \" \");\n value = value.trim();\n if (value.split(\" \")[0] === \"event\") {\n return EventFragment.fromString(value.substring(5).trim());\n }\n else if (value.split(\" \")[0] === \"function\") {\n return FunctionFragment.fromString(value.substring(8).trim());\n }\n else if (value.split(\"(\")[0].trim() === \"constructor\") {\n return ConstructorFragment.fromString(value.trim());\n }\n else if (value.split(\" \")[0] === \"error\") {\n return ErrorFragment.fromString(value.substring(5).trim());\n }\n return logger.throwArgumentError(\"unsupported fragment\", \"value\", value);\n }\n static isFragment(value) {\n return !!(value && value._isFragment);\n }\n}\nexport class EventFragment extends Fragment {\n format(format) {\n if (!format) {\n format = FormatTypes.sighash;\n }\n if (!FormatTypes[format]) {\n logger.throwArgumentError(\"invalid format type\", \"format\", format);\n }\n if (format === FormatTypes.json) {\n return JSON.stringify({\n type: \"event\",\n anonymous: this.anonymous,\n name: this.name,\n inputs: this.inputs.map((input) => JSON.parse(input.format(format)))\n });\n }\n let result = \"\";\n if (format !== FormatTypes.sighash) {\n result += \"event \";\n }\n result += this.name + \"(\" + this.inputs.map((input) => input.format(format)).join((format === FormatTypes.full) ? \", \" : \",\") + \") \";\n if (format !== FormatTypes.sighash) {\n if (this.anonymous) {\n result += \"anonymous \";\n }\n }\n return result.trim();\n }\n static from(value) {\n if (typeof (value) === \"string\") {\n return EventFragment.fromString(value);\n }\n return EventFragment.fromObject(value);\n }\n static fromObject(value) {\n if (EventFragment.isEventFragment(value)) {\n return value;\n }\n if (value.type !== \"event\") {\n logger.throwArgumentError(\"invalid event object\", \"value\", value);\n }\n const params = {\n name: verifyIdentifier(value.name),\n anonymous: value.anonymous,\n inputs: (value.inputs ? value.inputs.map(ParamType.fromObject) : []),\n type: \"event\"\n };\n return new EventFragment(_constructorGuard, params);\n }\n static fromString(value) {\n let match = value.match(regexParen);\n if (!match) {\n logger.throwArgumentError(\"invalid event string\", \"value\", value);\n }\n let anonymous = false;\n match[3].split(\" \").forEach((modifier) => {\n switch (modifier.trim()) {\n case \"anonymous\":\n anonymous = true;\n break;\n case \"\":\n break;\n default:\n logger.warn(\"unknown modifier: \" + modifier);\n }\n });\n return EventFragment.fromObject({\n name: match[1].trim(),\n anonymous: anonymous,\n inputs: parseParams(match[2], true),\n type: \"event\"\n });\n }\n static isEventFragment(value) {\n return (value && value._isFragment && value.type === \"event\");\n }\n}\nfunction parseGas(value, params) {\n params.gas = null;\n let comps = value.split(\"@\");\n if (comps.length !== 1) {\n if (comps.length > 2) {\n logger.throwArgumentError(\"invalid human-readable ABI signature\", \"value\", value);\n }\n if (!comps[1].match(/^[0-9]+$/)) {\n logger.throwArgumentError(\"invalid human-readable ABI signature gas\", \"value\", value);\n }\n params.gas = BigNumber.from(comps[1]);\n return comps[0];\n }\n return value;\n}\nfunction parseModifiers(value, params) {\n params.constant = false;\n params.payable = false;\n params.stateMutability = \"nonpayable\";\n value.split(\" \").forEach((modifier) => {\n switch (modifier.trim()) {\n case \"constant\":\n params.constant = true;\n break;\n case \"payable\":\n params.payable = true;\n params.stateMutability = \"payable\";\n break;\n case \"nonpayable\":\n params.payable = false;\n params.stateMutability = \"nonpayable\";\n break;\n case \"pure\":\n params.constant = true;\n params.stateMutability = \"pure\";\n break;\n case \"view\":\n params.constant = true;\n params.stateMutability = \"view\";\n break;\n case \"external\":\n case \"public\":\n case \"\":\n break;\n default:\n console.log(\"unknown modifier: \" + modifier);\n }\n });\n}\nfunction verifyState(value) {\n let result = {\n constant: false,\n payable: true,\n stateMutability: \"payable\"\n };\n if (value.stateMutability != null) {\n result.stateMutability = value.stateMutability;\n // Set (and check things are consistent) the constant property\n result.constant = (result.stateMutability === \"view\" || result.stateMutability === \"pure\");\n if (value.constant != null) {\n if ((!!value.constant) !== result.constant) {\n logger.throwArgumentError(\"cannot have constant function with mutability \" + result.stateMutability, \"value\", value);\n }\n }\n // Set (and check things are consistent) the payable property\n result.payable = (result.stateMutability === \"payable\");\n if (value.payable != null) {\n if ((!!value.payable) !== result.payable) {\n logger.throwArgumentError(\"cannot have payable function with mutability \" + result.stateMutability, \"value\", value);\n }\n }\n }\n else if (value.payable != null) {\n result.payable = !!value.payable;\n // If payable we can assume non-constant; otherwise we can't assume\n if (value.constant == null && !result.payable && value.type !== \"constructor\") {\n logger.throwArgumentError(\"unable to determine stateMutability\", \"value\", value);\n }\n result.constant = !!value.constant;\n if (result.constant) {\n result.stateMutability = \"view\";\n }\n else {\n result.stateMutability = (result.payable ? \"payable\" : \"nonpayable\");\n }\n if (result.payable && result.constant) {\n logger.throwArgumentError(\"cannot have constant payable function\", \"value\", value);\n }\n }\n else if (value.constant != null) {\n result.constant = !!value.constant;\n result.payable = !result.constant;\n result.stateMutability = (result.constant ? \"view\" : \"payable\");\n }\n else if (value.type !== \"constructor\") {\n logger.throwArgumentError(\"unable to determine stateMutability\", \"value\", value);\n }\n return result;\n}\nexport class ConstructorFragment extends Fragment {\n format(format) {\n if (!format) {\n format = FormatTypes.sighash;\n }\n if (!FormatTypes[format]) {\n logger.throwArgumentError(\"invalid format type\", \"format\", format);\n }\n if (format === FormatTypes.json) {\n return JSON.stringify({\n type: \"constructor\",\n stateMutability: ((this.stateMutability !== \"nonpayable\") ? this.stateMutability : undefined),\n payable: this.payable,\n gas: (this.gas ? this.gas.toNumber() : undefined),\n inputs: this.inputs.map((input) => JSON.parse(input.format(format)))\n });\n }\n if (format === FormatTypes.sighash) {\n logger.throwError(\"cannot format a constructor for sighash\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"format(sighash)\"\n });\n }\n let result = \"constructor(\" + this.inputs.map((input) => input.format(format)).join((format === FormatTypes.full) ? \", \" : \",\") + \") \";\n if (this.stateMutability && this.stateMutability !== \"nonpayable\") {\n result += this.stateMutability + \" \";\n }\n return result.trim();\n }\n static from(value) {\n if (typeof (value) === \"string\") {\n return ConstructorFragment.fromString(value);\n }\n return ConstructorFragment.fromObject(value);\n }\n static fromObject(value) {\n if (ConstructorFragment.isConstructorFragment(value)) {\n return value;\n }\n if (value.type !== \"constructor\") {\n logger.throwArgumentError(\"invalid constructor object\", \"value\", value);\n }\n let state = verifyState(value);\n if (state.constant) {\n logger.throwArgumentError(\"constructor cannot be constant\", \"value\", value);\n }\n const params = {\n name: null,\n type: value.type,\n inputs: (value.inputs ? value.inputs.map(ParamType.fromObject) : []),\n payable: state.payable,\n stateMutability: state.stateMutability,\n gas: (value.gas ? BigNumber.from(value.gas) : null)\n };\n return new ConstructorFragment(_constructorGuard, params);\n }\n static fromString(value) {\n let params = { type: \"constructor\" };\n value = parseGas(value, params);\n let parens = value.match(regexParen);\n if (!parens || parens[1].trim() !== \"constructor\") {\n logger.throwArgumentError(\"invalid constructor string\", \"value\", value);\n }\n params.inputs = parseParams(parens[2].trim(), false);\n parseModifiers(parens[3].trim(), params);\n return ConstructorFragment.fromObject(params);\n }\n static isConstructorFragment(value) {\n return (value && value._isFragment && value.type === \"constructor\");\n }\n}\nexport class FunctionFragment extends ConstructorFragment {\n format(format) {\n if (!format) {\n format = FormatTypes.sighash;\n }\n if (!FormatTypes[format]) {\n logger.throwArgumentError(\"invalid format type\", \"format\", format);\n }\n if (format === FormatTypes.json) {\n return JSON.stringify({\n type: \"function\",\n name: this.name,\n constant: this.constant,\n stateMutability: ((this.stateMutability !== \"nonpayable\") ? this.stateMutability : undefined),\n payable: this.payable,\n gas: (this.gas ? this.gas.toNumber() : undefined),\n inputs: this.inputs.map((input) => JSON.parse(input.format(format))),\n outputs: this.outputs.map((output) => JSON.parse(output.format(format))),\n });\n }\n let result = \"\";\n if (format !== FormatTypes.sighash) {\n result += \"function \";\n }\n result += this.name + \"(\" + this.inputs.map((input) => input.format(format)).join((format === FormatTypes.full) ? \", \" : \",\") + \") \";\n if (format !== FormatTypes.sighash) {\n if (this.stateMutability) {\n if (this.stateMutability !== \"nonpayable\") {\n result += (this.stateMutability + \" \");\n }\n }\n else if (this.constant) {\n result += \"view \";\n }\n if (this.outputs && this.outputs.length) {\n result += \"returns (\" + this.outputs.map((output) => output.format(format)).join(\", \") + \") \";\n }\n if (this.gas != null) {\n result += \"@\" + this.gas.toString() + \" \";\n }\n }\n return result.trim();\n }\n static from(value) {\n if (typeof (value) === \"string\") {\n return FunctionFragment.fromString(value);\n }\n return FunctionFragment.fromObject(value);\n }\n static fromObject(value) {\n if (FunctionFragment.isFunctionFragment(value)) {\n return value;\n }\n if (value.type !== \"function\") {\n logger.throwArgumentError(\"invalid function object\", \"value\", value);\n }\n let state = verifyState(value);\n const params = {\n type: value.type,\n name: verifyIdentifier(value.name),\n constant: state.constant,\n inputs: (value.inputs ? value.inputs.map(ParamType.fromObject) : []),\n outputs: (value.outputs ? value.outputs.map(ParamType.fromObject) : []),\n payable: state.payable,\n stateMutability: state.stateMutability,\n gas: (value.gas ? BigNumber.from(value.gas) : null)\n };\n return new FunctionFragment(_constructorGuard, params);\n }\n static fromString(value) {\n let params = { type: \"function\" };\n value = parseGas(value, params);\n let comps = value.split(\" returns \");\n if (comps.length > 2) {\n logger.throwArgumentError(\"invalid function string\", \"value\", value);\n }\n let parens = comps[0].match(regexParen);\n if (!parens) {\n logger.throwArgumentError(\"invalid function signature\", \"value\", value);\n }\n params.name = parens[1].trim();\n if (params.name) {\n verifyIdentifier(params.name);\n }\n params.inputs = parseParams(parens[2], false);\n parseModifiers(parens[3].trim(), params);\n // We have outputs\n if (comps.length > 1) {\n let returns = comps[1].match(regexParen);\n if (returns[1].trim() != \"\" || returns[3].trim() != \"\") {\n logger.throwArgumentError(\"unexpected tokens\", \"value\", value);\n }\n params.outputs = parseParams(returns[2], false);\n }\n else {\n params.outputs = [];\n }\n return FunctionFragment.fromObject(params);\n }\n static isFunctionFragment(value) {\n return (value && value._isFragment && value.type === \"function\");\n }\n}\n//export class StructFragment extends Fragment {\n//}\nfunction checkForbidden(fragment) {\n const sig = fragment.format();\n if (sig === \"Error(string)\" || sig === \"Panic(uint256)\") {\n logger.throwArgumentError(`cannot specify user defined ${sig} error`, \"fragment\", fragment);\n }\n return fragment;\n}\nexport class ErrorFragment extends Fragment {\n format(format) {\n if (!format) {\n format = FormatTypes.sighash;\n }\n if (!FormatTypes[format]) {\n logger.throwArgumentError(\"invalid format type\", \"format\", format);\n }\n if (format === FormatTypes.json) {\n return JSON.stringify({\n type: \"error\",\n name: this.name,\n inputs: this.inputs.map((input) => JSON.parse(input.format(format))),\n });\n }\n let result = \"\";\n if (format !== FormatTypes.sighash) {\n result += \"error \";\n }\n result += this.name + \"(\" + this.inputs.map((input) => input.format(format)).join((format === FormatTypes.full) ? \", \" : \",\") + \") \";\n return result.trim();\n }\n static from(value) {\n if (typeof (value) === \"string\") {\n return ErrorFragment.fromString(value);\n }\n return ErrorFragment.fromObject(value);\n }\n static fromObject(value) {\n if (ErrorFragment.isErrorFragment(value)) {\n return value;\n }\n if (value.type !== \"error\") {\n logger.throwArgumentError(\"invalid error object\", \"value\", value);\n }\n const params = {\n type: value.type,\n name: verifyIdentifier(value.name),\n inputs: (value.inputs ? value.inputs.map(ParamType.fromObject) : [])\n };\n return checkForbidden(new ErrorFragment(_constructorGuard, params));\n }\n static fromString(value) {\n let params = { type: \"error\" };\n let parens = value.match(regexParen);\n if (!parens) {\n logger.throwArgumentError(\"invalid error signature\", \"value\", value);\n }\n params.name = parens[1].trim();\n if (params.name) {\n verifyIdentifier(params.name);\n }\n params.inputs = parseParams(parens[2], false);\n return checkForbidden(ErrorFragment.fromObject(params));\n }\n static isErrorFragment(value) {\n return (value && value._isFragment && value.type === \"error\");\n }\n}\nfunction verifyType(type) {\n // These need to be transformed to their full description\n if (type.match(/^uint($|[^1-9])/)) {\n type = \"uint256\" + type.substring(4);\n }\n else if (type.match(/^int($|[^1-9])/)) {\n type = \"int256\" + type.substring(3);\n }\n // @TODO: more verification\n return type;\n}\n// See: https://github.com/ethereum/solidity/blob/1f8f1a3db93a548d0555e3e14cfc55a10e25b60e/docs/grammar/SolidityLexer.g4#L234\nconst regexIdentifier = new RegExp(\"^[a-zA-Z$_][a-zA-Z0-9$_]*$\");\nfunction verifyIdentifier(value) {\n if (!value || !value.match(regexIdentifier)) {\n logger.throwArgumentError(`invalid identifier \"${value}\"`, \"value\", value);\n }\n return value;\n}\nconst regexParen = new RegExp(\"^([^)(]*)\\\\((.*)\\\\)([^)(]*)$\");\nfunction splitNesting(value) {\n value = value.trim();\n let result = [];\n let accum = \"\";\n let depth = 0;\n for (let offset = 0; offset < value.length; offset++) {\n let c = value[offset];\n if (c === \",\" && depth === 0) {\n result.push(accum);\n accum = \"\";\n }\n else {\n accum += c;\n if (c === \"(\") {\n depth++;\n }\n else if (c === \")\") {\n depth--;\n if (depth === -1) {\n logger.throwArgumentError(\"unbalanced parenthesis\", \"value\", value);\n }\n }\n }\n }\n if (accum) {\n result.push(accum);\n }\n return result;\n}\n//# sourceMappingURL=fragments.js.map","\"use strict\";\nimport { arrayify, concat, hexConcat, hexlify } from \"@ethersproject/bytes\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"../_version\";\nconst logger = new Logger(version);\nexport function checkResultErrors(result) {\n // Find the first error (if any)\n const errors = [];\n const checkErrors = function (path, object) {\n if (!Array.isArray(object)) {\n return;\n }\n for (let key in object) {\n const childPath = path.slice();\n childPath.push(key);\n try {\n checkErrors(childPath, object[key]);\n }\n catch (error) {\n errors.push({ path: childPath, error: error });\n }\n }\n };\n checkErrors([], result);\n return errors;\n}\nexport class Coder {\n constructor(name, type, localName, dynamic) {\n // @TODO: defineReadOnly these\n this.name = name;\n this.type = type;\n this.localName = localName;\n this.dynamic = dynamic;\n }\n _throwError(message, value) {\n logger.throwArgumentError(message, this.localName, value);\n }\n}\nexport class Writer {\n constructor(wordSize) {\n defineReadOnly(this, \"wordSize\", wordSize || 32);\n this._data = [];\n this._dataLength = 0;\n this._padding = new Uint8Array(wordSize);\n }\n get data() {\n return hexConcat(this._data);\n }\n get length() { return this._dataLength; }\n _writeData(data) {\n this._data.push(data);\n this._dataLength += data.length;\n return data.length;\n }\n appendWriter(writer) {\n return this._writeData(concat(writer._data));\n }\n // Arrayish items; padded on the right to wordSize\n writeBytes(value) {\n let bytes = arrayify(value);\n const paddingOffset = bytes.length % this.wordSize;\n if (paddingOffset) {\n bytes = concat([bytes, this._padding.slice(paddingOffset)]);\n }\n return this._writeData(bytes);\n }\n _getValue(value) {\n let bytes = arrayify(BigNumber.from(value));\n if (bytes.length > this.wordSize) {\n logger.throwError(\"value out-of-bounds\", Logger.errors.BUFFER_OVERRUN, {\n length: this.wordSize,\n offset: bytes.length\n });\n }\n if (bytes.length % this.wordSize) {\n bytes = concat([this._padding.slice(bytes.length % this.wordSize), bytes]);\n }\n return bytes;\n }\n // BigNumberish items; padded on the left to wordSize\n writeValue(value) {\n return this._writeData(this._getValue(value));\n }\n writeUpdatableValue() {\n const offset = this._data.length;\n this._data.push(this._padding);\n this._dataLength += this.wordSize;\n return (value) => {\n this._data[offset] = this._getValue(value);\n };\n }\n}\nexport class Reader {\n constructor(data, wordSize, coerceFunc, allowLoose) {\n defineReadOnly(this, \"_data\", arrayify(data));\n defineReadOnly(this, \"wordSize\", wordSize || 32);\n defineReadOnly(this, \"_coerceFunc\", coerceFunc);\n defineReadOnly(this, \"allowLoose\", allowLoose);\n this._offset = 0;\n }\n get data() { return hexlify(this._data); }\n get consumed() { return this._offset; }\n // The default Coerce function\n static coerce(name, value) {\n let match = name.match(\"^u?int([0-9]+)$\");\n if (match && parseInt(match[1]) <= 48) {\n value = value.toNumber();\n }\n return value;\n }\n coerce(name, value) {\n if (this._coerceFunc) {\n return this._coerceFunc(name, value);\n }\n return Reader.coerce(name, value);\n }\n _peekBytes(offset, length, loose) {\n let alignedLength = Math.ceil(length / this.wordSize) * this.wordSize;\n if (this._offset + alignedLength > this._data.length) {\n if (this.allowLoose && loose && this._offset + length <= this._data.length) {\n alignedLength = length;\n }\n else {\n logger.throwError(\"data out-of-bounds\", Logger.errors.BUFFER_OVERRUN, {\n length: this._data.length,\n offset: this._offset + alignedLength\n });\n }\n }\n return this._data.slice(this._offset, this._offset + alignedLength);\n }\n subReader(offset) {\n return new Reader(this._data.slice(this._offset + offset), this.wordSize, this._coerceFunc, this.allowLoose);\n }\n readBytes(length, loose) {\n let bytes = this._peekBytes(0, length, !!loose);\n this._offset += bytes.length;\n // @TODO: Make sure the length..end bytes are all 0?\n return bytes.slice(0, length);\n }\n readValue() {\n return BigNumber.from(this.readBytes(this.wordSize));\n }\n}\n//# sourceMappingURL=abstract-coder.js.map","/**\n * [js-sha3]{@link https://github.com/emn178/js-sha3}\n *\n * @version 0.8.0\n * @author Chen, Yi-Cyuan [emn178@gmail.com]\n * @copyright Chen, Yi-Cyuan 2015-2018\n * @license MIT\n */\n/*jslint bitwise: true */\n(function () {\n 'use strict';\n\n var INPUT_ERROR = 'input is invalid type';\n var FINALIZE_ERROR = 'finalize already called';\n var WINDOW = typeof window === 'object';\n var root = WINDOW ? window : {};\n if (root.JS_SHA3_NO_WINDOW) {\n WINDOW = false;\n }\n var WEB_WORKER = !WINDOW && typeof self === 'object';\n var NODE_JS = !root.JS_SHA3_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;\n if (NODE_JS) {\n root = global;\n } else if (WEB_WORKER) {\n root = self;\n }\n var COMMON_JS = !root.JS_SHA3_NO_COMMON_JS && typeof module === 'object' && module.exports;\n var AMD = typeof define === 'function' && define.amd;\n var ARRAY_BUFFER = !root.JS_SHA3_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined';\n var HEX_CHARS = '0123456789abcdef'.split('');\n var SHAKE_PADDING = [31, 7936, 2031616, 520093696];\n var CSHAKE_PADDING = [4, 1024, 262144, 67108864];\n var KECCAK_PADDING = [1, 256, 65536, 16777216];\n var PADDING = [6, 1536, 393216, 100663296];\n var SHIFT = [0, 8, 16, 24];\n var RC = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649,\n 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0,\n 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771,\n 2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648,\n 2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648];\n var BITS = [224, 256, 384, 512];\n var SHAKE_BITS = [128, 256];\n var OUTPUT_TYPES = ['hex', 'buffer', 'arrayBuffer', 'array', 'digest'];\n var CSHAKE_BYTEPAD = {\n '128': 168,\n '256': 136\n };\n\n if (root.JS_SHA3_NO_NODE_JS || !Array.isArray) {\n Array.isArray = function (obj) {\n return Object.prototype.toString.call(obj) === '[object Array]';\n };\n }\n\n if (ARRAY_BUFFER && (root.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) {\n ArrayBuffer.isView = function (obj) {\n return typeof obj === 'object' && obj.buffer && obj.buffer.constructor === ArrayBuffer;\n };\n }\n\n var createOutputMethod = function (bits, padding, outputType) {\n return function (message) {\n return new Keccak(bits, padding, bits).update(message)[outputType]();\n };\n };\n\n var createShakeOutputMethod = function (bits, padding, outputType) {\n return function (message, outputBits) {\n return new Keccak(bits, padding, outputBits).update(message)[outputType]();\n };\n };\n\n var createCshakeOutputMethod = function (bits, padding, outputType) {\n return function (message, outputBits, n, s) {\n return methods['cshake' + bits].update(message, outputBits, n, s)[outputType]();\n };\n };\n\n var createKmacOutputMethod = function (bits, padding, outputType) {\n return function (key, message, outputBits, s) {\n return methods['kmac' + bits].update(key, message, outputBits, s)[outputType]();\n };\n };\n\n var createOutputMethods = function (method, createMethod, bits, padding) {\n for (var i = 0; i < OUTPUT_TYPES.length; ++i) {\n var type = OUTPUT_TYPES[i];\n method[type] = createMethod(bits, padding, type);\n }\n return method;\n };\n\n var createMethod = function (bits, padding) {\n var method = createOutputMethod(bits, padding, 'hex');\n method.create = function () {\n return new Keccak(bits, padding, bits);\n };\n method.update = function (message) {\n return method.create().update(message);\n };\n return createOutputMethods(method, createOutputMethod, bits, padding);\n };\n\n var createShakeMethod = function (bits, padding) {\n var method = createShakeOutputMethod(bits, padding, 'hex');\n method.create = function (outputBits) {\n return new Keccak(bits, padding, outputBits);\n };\n method.update = function (message, outputBits) {\n return method.create(outputBits).update(message);\n };\n return createOutputMethods(method, createShakeOutputMethod, bits, padding);\n };\n\n var createCshakeMethod = function (bits, padding) {\n var w = CSHAKE_BYTEPAD[bits];\n var method = createCshakeOutputMethod(bits, padding, 'hex');\n method.create = function (outputBits, n, s) {\n if (!n && !s) {\n return methods['shake' + bits].create(outputBits);\n } else {\n return new Keccak(bits, padding, outputBits).bytepad([n, s], w);\n }\n };\n method.update = function (message, outputBits, n, s) {\n return method.create(outputBits, n, s).update(message);\n };\n return createOutputMethods(method, createCshakeOutputMethod, bits, padding);\n };\n\n var createKmacMethod = function (bits, padding) {\n var w = CSHAKE_BYTEPAD[bits];\n var method = createKmacOutputMethod(bits, padding, 'hex');\n method.create = function (key, outputBits, s) {\n return new Kmac(bits, padding, outputBits).bytepad(['KMAC', s], w).bytepad([key], w);\n };\n method.update = function (key, message, outputBits, s) {\n return method.create(key, outputBits, s).update(message);\n };\n return createOutputMethods(method, createKmacOutputMethod, bits, padding);\n };\n\n var algorithms = [\n { name: 'keccak', padding: KECCAK_PADDING, bits: BITS, createMethod: createMethod },\n { name: 'sha3', padding: PADDING, bits: BITS, createMethod: createMethod },\n { name: 'shake', padding: SHAKE_PADDING, bits: SHAKE_BITS, createMethod: createShakeMethod },\n { name: 'cshake', padding: CSHAKE_PADDING, bits: SHAKE_BITS, createMethod: createCshakeMethod },\n { name: 'kmac', padding: CSHAKE_PADDING, bits: SHAKE_BITS, createMethod: createKmacMethod }\n ];\n\n var methods = {}, methodNames = [];\n\n for (var i = 0; i < algorithms.length; ++i) {\n var algorithm = algorithms[i];\n var bits = algorithm.bits;\n for (var j = 0; j < bits.length; ++j) {\n var methodName = algorithm.name + '_' + bits[j];\n methodNames.push(methodName);\n methods[methodName] = algorithm.createMethod(bits[j], algorithm.padding);\n if (algorithm.name !== 'sha3') {\n var newMethodName = algorithm.name + bits[j];\n methodNames.push(newMethodName);\n methods[newMethodName] = methods[methodName];\n }\n }\n }\n\n function Keccak(bits, padding, outputBits) {\n this.blocks = [];\n this.s = [];\n this.padding = padding;\n this.outputBits = outputBits;\n this.reset = true;\n this.finalized = false;\n this.block = 0;\n this.start = 0;\n this.blockCount = (1600 - (bits << 1)) >> 5;\n this.byteCount = this.blockCount << 2;\n this.outputBlocks = outputBits >> 5;\n this.extraBytes = (outputBits & 31) >> 3;\n\n for (var i = 0; i < 50; ++i) {\n this.s[i] = 0;\n }\n }\n\n Keccak.prototype.update = function (message) {\n if (this.finalized) {\n throw new Error(FINALIZE_ERROR);\n }\n var notString, type = typeof message;\n if (type !== 'string') {\n if (type === 'object') {\n if (message === null) {\n throw new Error(INPUT_ERROR);\n } else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {\n message = new Uint8Array(message);\n } else if (!Array.isArray(message)) {\n if (!ARRAY_BUFFER || !ArrayBuffer.isView(message)) {\n throw new Error(INPUT_ERROR);\n }\n }\n } else {\n throw new Error(INPUT_ERROR);\n }\n notString = true;\n }\n var blocks = this.blocks, byteCount = this.byteCount, length = message.length,\n blockCount = this.blockCount, index = 0, s = this.s, i, code;\n\n while (index < length) {\n if (this.reset) {\n this.reset = false;\n blocks[0] = this.block;\n for (i = 1; i < blockCount + 1; ++i) {\n blocks[i] = 0;\n }\n }\n if (notString) {\n for (i = this.start; index < length && i < byteCount; ++index) {\n blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];\n }\n } else {\n for (i = this.start; index < length && i < byteCount; ++index) {\n code = message.charCodeAt(index);\n if (code < 0x80) {\n blocks[i >> 2] |= code << SHIFT[i++ & 3];\n } else if (code < 0x800) {\n blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else if (code < 0xd800 || code >= 0xe000) {\n blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else {\n code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));\n blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n }\n }\n }\n this.lastByteIndex = i;\n if (i >= byteCount) {\n this.start = i - byteCount;\n this.block = blocks[blockCount];\n for (i = 0; i < blockCount; ++i) {\n s[i] ^= blocks[i];\n }\n f(s);\n this.reset = true;\n } else {\n this.start = i;\n }\n }\n return this;\n };\n\n Keccak.prototype.encode = function (x, right) {\n var o = x & 255, n = 1;\n var bytes = [o];\n x = x >> 8;\n o = x & 255;\n while (o > 0) {\n bytes.unshift(o);\n x = x >> 8;\n o = x & 255;\n ++n;\n }\n if (right) {\n bytes.push(n);\n } else {\n bytes.unshift(n);\n }\n this.update(bytes);\n return bytes.length;\n };\n\n Keccak.prototype.encodeString = function (str) {\n var notString, type = typeof str;\n if (type !== 'string') {\n if (type === 'object') {\n if (str === null) {\n throw new Error(INPUT_ERROR);\n } else if (ARRAY_BUFFER && str.constructor === ArrayBuffer) {\n str = new Uint8Array(str);\n } else if (!Array.isArray(str)) {\n if (!ARRAY_BUFFER || !ArrayBuffer.isView(str)) {\n throw new Error(INPUT_ERROR);\n }\n }\n } else {\n throw new Error(INPUT_ERROR);\n }\n notString = true;\n }\n var bytes = 0, length = str.length;\n if (notString) {\n bytes = length;\n } else {\n for (var i = 0; i < str.length; ++i) {\n var code = str.charCodeAt(i);\n if (code < 0x80) {\n bytes += 1;\n } else if (code < 0x800) {\n bytes += 2;\n } else if (code < 0xd800 || code >= 0xe000) {\n bytes += 3;\n } else {\n code = 0x10000 + (((code & 0x3ff) << 10) | (str.charCodeAt(++i) & 0x3ff));\n bytes += 4;\n }\n }\n }\n bytes += this.encode(bytes * 8);\n this.update(str);\n return bytes;\n };\n\n Keccak.prototype.bytepad = function (strs, w) {\n var bytes = this.encode(w);\n for (var i = 0; i < strs.length; ++i) {\n bytes += this.encodeString(strs[i]);\n }\n var paddingBytes = w - bytes % w;\n var zeros = [];\n zeros.length = paddingBytes;\n this.update(zeros);\n return this;\n };\n\n Keccak.prototype.finalize = function () {\n if (this.finalized) {\n return;\n }\n this.finalized = true;\n var blocks = this.blocks, i = this.lastByteIndex, blockCount = this.blockCount, s = this.s;\n blocks[i >> 2] |= this.padding[i & 3];\n if (this.lastByteIndex === this.byteCount) {\n blocks[0] = blocks[blockCount];\n for (i = 1; i < blockCount + 1; ++i) {\n blocks[i] = 0;\n }\n }\n blocks[blockCount - 1] |= 0x80000000;\n for (i = 0; i < blockCount; ++i) {\n s[i] ^= blocks[i];\n }\n f(s);\n };\n\n Keccak.prototype.toString = Keccak.prototype.hex = function () {\n this.finalize();\n\n var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,\n extraBytes = this.extraBytes, i = 0, j = 0;\n var hex = '', block;\n while (j < outputBlocks) {\n for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\n block = s[i];\n hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F] +\n HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F] +\n HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F] +\n HEX_CHARS[(block >> 28) & 0x0F] + HEX_CHARS[(block >> 24) & 0x0F];\n }\n if (j % blockCount === 0) {\n f(s);\n i = 0;\n }\n }\n if (extraBytes) {\n block = s[i];\n hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F];\n if (extraBytes > 1) {\n hex += HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F];\n }\n if (extraBytes > 2) {\n hex += HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F];\n }\n }\n return hex;\n };\n\n Keccak.prototype.arrayBuffer = function () {\n this.finalize();\n\n var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,\n extraBytes = this.extraBytes, i = 0, j = 0;\n var bytes = this.outputBits >> 3;\n var buffer;\n if (extraBytes) {\n buffer = new ArrayBuffer((outputBlocks + 1) << 2);\n } else {\n buffer = new ArrayBuffer(bytes);\n }\n var array = new Uint32Array(buffer);\n while (j < outputBlocks) {\n for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\n array[j] = s[i];\n }\n if (j % blockCount === 0) {\n f(s);\n }\n }\n if (extraBytes) {\n array[i] = s[i];\n buffer = buffer.slice(0, bytes);\n }\n return buffer;\n };\n\n Keccak.prototype.buffer = Keccak.prototype.arrayBuffer;\n\n Keccak.prototype.digest = Keccak.prototype.array = function () {\n this.finalize();\n\n var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,\n extraBytes = this.extraBytes, i = 0, j = 0;\n var array = [], offset, block;\n while (j < outputBlocks) {\n for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\n offset = j << 2;\n block = s[i];\n array[offset] = block & 0xFF;\n array[offset + 1] = (block >> 8) & 0xFF;\n array[offset + 2] = (block >> 16) & 0xFF;\n array[offset + 3] = (block >> 24) & 0xFF;\n }\n if (j % blockCount === 0) {\n f(s);\n }\n }\n if (extraBytes) {\n offset = j << 2;\n block = s[i];\n array[offset] = block & 0xFF;\n if (extraBytes > 1) {\n array[offset + 1] = (block >> 8) & 0xFF;\n }\n if (extraBytes > 2) {\n array[offset + 2] = (block >> 16) & 0xFF;\n }\n }\n return array;\n };\n\n function Kmac(bits, padding, outputBits) {\n Keccak.call(this, bits, padding, outputBits);\n }\n\n Kmac.prototype = new Keccak();\n\n Kmac.prototype.finalize = function () {\n this.encode(this.outputBits, true);\n return Keccak.prototype.finalize.call(this);\n };\n\n var f = function (s) {\n var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9,\n b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17,\n b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33,\n b34, b35, b36, b37, b38, b39, b40, b41, b42, b43, b44, b45, b46, b47, b48, b49;\n for (n = 0; n < 48; n += 2) {\n c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40];\n c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41];\n c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42];\n c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43];\n c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44];\n c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45];\n c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46];\n c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47];\n c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48];\n c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49];\n\n h = c8 ^ ((c2 << 1) | (c3 >>> 31));\n l = c9 ^ ((c3 << 1) | (c2 >>> 31));\n s[0] ^= h;\n s[1] ^= l;\n s[10] ^= h;\n s[11] ^= l;\n s[20] ^= h;\n s[21] ^= l;\n s[30] ^= h;\n s[31] ^= l;\n s[40] ^= h;\n s[41] ^= l;\n h = c0 ^ ((c4 << 1) | (c5 >>> 31));\n l = c1 ^ ((c5 << 1) | (c4 >>> 31));\n s[2] ^= h;\n s[3] ^= l;\n s[12] ^= h;\n s[13] ^= l;\n s[22] ^= h;\n s[23] ^= l;\n s[32] ^= h;\n s[33] ^= l;\n s[42] ^= h;\n s[43] ^= l;\n h = c2 ^ ((c6 << 1) | (c7 >>> 31));\n l = c3 ^ ((c7 << 1) | (c6 >>> 31));\n s[4] ^= h;\n s[5] ^= l;\n s[14] ^= h;\n s[15] ^= l;\n s[24] ^= h;\n s[25] ^= l;\n s[34] ^= h;\n s[35] ^= l;\n s[44] ^= h;\n s[45] ^= l;\n h = c4 ^ ((c8 << 1) | (c9 >>> 31));\n l = c5 ^ ((c9 << 1) | (c8 >>> 31));\n s[6] ^= h;\n s[7] ^= l;\n s[16] ^= h;\n s[17] ^= l;\n s[26] ^= h;\n s[27] ^= l;\n s[36] ^= h;\n s[37] ^= l;\n s[46] ^= h;\n s[47] ^= l;\n h = c6 ^ ((c0 << 1) | (c1 >>> 31));\n l = c7 ^ ((c1 << 1) | (c0 >>> 31));\n s[8] ^= h;\n s[9] ^= l;\n s[18] ^= h;\n s[19] ^= l;\n s[28] ^= h;\n s[29] ^= l;\n s[38] ^= h;\n s[39] ^= l;\n s[48] ^= h;\n s[49] ^= l;\n\n b0 = s[0];\n b1 = s[1];\n b32 = (s[11] << 4) | (s[10] >>> 28);\n b33 = (s[10] << 4) | (s[11] >>> 28);\n b14 = (s[20] << 3) | (s[21] >>> 29);\n b15 = (s[21] << 3) | (s[20] >>> 29);\n b46 = (s[31] << 9) | (s[30] >>> 23);\n b47 = (s[30] << 9) | (s[31] >>> 23);\n b28 = (s[40] << 18) | (s[41] >>> 14);\n b29 = (s[41] << 18) | (s[40] >>> 14);\n b20 = (s[2] << 1) | (s[3] >>> 31);\n b21 = (s[3] << 1) | (s[2] >>> 31);\n b2 = (s[13] << 12) | (s[12] >>> 20);\n b3 = (s[12] << 12) | (s[13] >>> 20);\n b34 = (s[22] << 10) | (s[23] >>> 22);\n b35 = (s[23] << 10) | (s[22] >>> 22);\n b16 = (s[33] << 13) | (s[32] >>> 19);\n b17 = (s[32] << 13) | (s[33] >>> 19);\n b48 = (s[42] << 2) | (s[43] >>> 30);\n b49 = (s[43] << 2) | (s[42] >>> 30);\n b40 = (s[5] << 30) | (s[4] >>> 2);\n b41 = (s[4] << 30) | (s[5] >>> 2);\n b22 = (s[14] << 6) | (s[15] >>> 26);\n b23 = (s[15] << 6) | (s[14] >>> 26);\n b4 = (s[25] << 11) | (s[24] >>> 21);\n b5 = (s[24] << 11) | (s[25] >>> 21);\n b36 = (s[34] << 15) | (s[35] >>> 17);\n b37 = (s[35] << 15) | (s[34] >>> 17);\n b18 = (s[45] << 29) | (s[44] >>> 3);\n b19 = (s[44] << 29) | (s[45] >>> 3);\n b10 = (s[6] << 28) | (s[7] >>> 4);\n b11 = (s[7] << 28) | (s[6] >>> 4);\n b42 = (s[17] << 23) | (s[16] >>> 9);\n b43 = (s[16] << 23) | (s[17] >>> 9);\n b24 = (s[26] << 25) | (s[27] >>> 7);\n b25 = (s[27] << 25) | (s[26] >>> 7);\n b6 = (s[36] << 21) | (s[37] >>> 11);\n b7 = (s[37] << 21) | (s[36] >>> 11);\n b38 = (s[47] << 24) | (s[46] >>> 8);\n b39 = (s[46] << 24) | (s[47] >>> 8);\n b30 = (s[8] << 27) | (s[9] >>> 5);\n b31 = (s[9] << 27) | (s[8] >>> 5);\n b12 = (s[18] << 20) | (s[19] >>> 12);\n b13 = (s[19] << 20) | (s[18] >>> 12);\n b44 = (s[29] << 7) | (s[28] >>> 25);\n b45 = (s[28] << 7) | (s[29] >>> 25);\n b26 = (s[38] << 8) | (s[39] >>> 24);\n b27 = (s[39] << 8) | (s[38] >>> 24);\n b8 = (s[48] << 14) | (s[49] >>> 18);\n b9 = (s[49] << 14) | (s[48] >>> 18);\n\n s[0] = b0 ^ (~b2 & b4);\n s[1] = b1 ^ (~b3 & b5);\n s[10] = b10 ^ (~b12 & b14);\n s[11] = b11 ^ (~b13 & b15);\n s[20] = b20 ^ (~b22 & b24);\n s[21] = b21 ^ (~b23 & b25);\n s[30] = b30 ^ (~b32 & b34);\n s[31] = b31 ^ (~b33 & b35);\n s[40] = b40 ^ (~b42 & b44);\n s[41] = b41 ^ (~b43 & b45);\n s[2] = b2 ^ (~b4 & b6);\n s[3] = b3 ^ (~b5 & b7);\n s[12] = b12 ^ (~b14 & b16);\n s[13] = b13 ^ (~b15 & b17);\n s[22] = b22 ^ (~b24 & b26);\n s[23] = b23 ^ (~b25 & b27);\n s[32] = b32 ^ (~b34 & b36);\n s[33] = b33 ^ (~b35 & b37);\n s[42] = b42 ^ (~b44 & b46);\n s[43] = b43 ^ (~b45 & b47);\n s[4] = b4 ^ (~b6 & b8);\n s[5] = b5 ^ (~b7 & b9);\n s[14] = b14 ^ (~b16 & b18);\n s[15] = b15 ^ (~b17 & b19);\n s[24] = b24 ^ (~b26 & b28);\n s[25] = b25 ^ (~b27 & b29);\n s[34] = b34 ^ (~b36 & b38);\n s[35] = b35 ^ (~b37 & b39);\n s[44] = b44 ^ (~b46 & b48);\n s[45] = b45 ^ (~b47 & b49);\n s[6] = b6 ^ (~b8 & b0);\n s[7] = b7 ^ (~b9 & b1);\n s[16] = b16 ^ (~b18 & b10);\n s[17] = b17 ^ (~b19 & b11);\n s[26] = b26 ^ (~b28 & b20);\n s[27] = b27 ^ (~b29 & b21);\n s[36] = b36 ^ (~b38 & b30);\n s[37] = b37 ^ (~b39 & b31);\n s[46] = b46 ^ (~b48 & b40);\n s[47] = b47 ^ (~b49 & b41);\n s[8] = b8 ^ (~b0 & b2);\n s[9] = b9 ^ (~b1 & b3);\n s[18] = b18 ^ (~b10 & b12);\n s[19] = b19 ^ (~b11 & b13);\n s[28] = b28 ^ (~b20 & b22);\n s[29] = b29 ^ (~b21 & b23);\n s[38] = b38 ^ (~b30 & b32);\n s[39] = b39 ^ (~b31 & b33);\n s[48] = b48 ^ (~b40 & b42);\n s[49] = b49 ^ (~b41 & b43);\n\n s[0] ^= RC[n];\n s[1] ^= RC[n + 1];\n }\n };\n\n if (COMMON_JS) {\n module.exports = methods;\n } else {\n for (i = 0; i < methodNames.length; ++i) {\n root[methodNames[i]] = methods[methodNames[i]];\n }\n if (AMD) {\n define(function () {\n return methods;\n });\n }\n }\n})();\n","\"use strict\";\nimport sha3 from \"js-sha3\";\nimport { arrayify } from \"@ethersproject/bytes\";\nexport function keccak256(data) {\n return '0x' + sha3.keccak_256(arrayify(data));\n}\n//# sourceMappingURL=index.js.map","export const version = \"rlp/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\n//See: https://github.com/ethereum/wiki/wiki/RLP\nimport { arrayify, hexlify, isBytesLike } from \"@ethersproject/bytes\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nfunction arrayifyInteger(value) {\n const result = [];\n while (value) {\n result.unshift(value & 0xff);\n value >>= 8;\n }\n return result;\n}\nfunction unarrayifyInteger(data, offset, length) {\n let result = 0;\n for (let i = 0; i < length; i++) {\n result = (result * 256) + data[offset + i];\n }\n return result;\n}\nfunction _encode(object) {\n if (Array.isArray(object)) {\n let payload = [];\n object.forEach(function (child) {\n payload = payload.concat(_encode(child));\n });\n if (payload.length <= 55) {\n payload.unshift(0xc0 + payload.length);\n return payload;\n }\n const length = arrayifyInteger(payload.length);\n length.unshift(0xf7 + length.length);\n return length.concat(payload);\n }\n if (!isBytesLike(object)) {\n logger.throwArgumentError(\"RLP object must be BytesLike\", \"object\", object);\n }\n const data = Array.prototype.slice.call(arrayify(object));\n if (data.length === 1 && data[0] <= 0x7f) {\n return data;\n }\n else if (data.length <= 55) {\n data.unshift(0x80 + data.length);\n return data;\n }\n const length = arrayifyInteger(data.length);\n length.unshift(0xb7 + length.length);\n return length.concat(data);\n}\nexport function encode(object) {\n return hexlify(_encode(object));\n}\nfunction _decodeChildren(data, offset, childOffset, length) {\n const result = [];\n while (childOffset < offset + 1 + length) {\n const decoded = _decode(data, childOffset);\n result.push(decoded.result);\n childOffset += decoded.consumed;\n if (childOffset > offset + 1 + length) {\n logger.throwError(\"child data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n }\n return { consumed: (1 + length), result: result };\n}\n// returns { consumed: number, result: Object }\nfunction _decode(data, offset) {\n if (data.length === 0) {\n logger.throwError(\"data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n // Array with extra length prefix\n if (data[offset] >= 0xf8) {\n const lengthLength = data[offset] - 0xf7;\n if (offset + 1 + lengthLength > data.length) {\n logger.throwError(\"data short segment too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n if (offset + 1 + lengthLength + length > data.length) {\n logger.throwError(\"data long segment too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length);\n }\n else if (data[offset] >= 0xc0) {\n const length = data[offset] - 0xc0;\n if (offset + 1 + length > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n return _decodeChildren(data, offset, offset + 1, length);\n }\n else if (data[offset] >= 0xb8) {\n const lengthLength = data[offset] - 0xb7;\n if (offset + 1 + lengthLength > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n if (offset + 1 + lengthLength + length > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const result = hexlify(data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length));\n return { consumed: (1 + lengthLength + length), result: result };\n }\n else if (data[offset] >= 0x80) {\n const length = data[offset] - 0x80;\n if (offset + 1 + length > data.length) {\n logger.throwError(\"data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const result = hexlify(data.slice(offset + 1, offset + 1 + length));\n return { consumed: (1 + length), result: result };\n }\n return { consumed: 1, result: hexlify(data[offset]) };\n}\nexport function decode(data) {\n const bytes = arrayify(data);\n const decoded = _decode(bytes, 0);\n if (decoded.consumed !== bytes.length) {\n logger.throwArgumentError(\"invalid rlp data\", \"data\", data);\n }\n return decoded.result;\n}\n//# sourceMappingURL=index.js.map","export const version = \"address/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nimport { arrayify, concat, hexDataLength, hexDataSlice, isHexString, stripZeros } from \"@ethersproject/bytes\";\nimport { BigNumber, _base16To36, _base36To16 } from \"@ethersproject/bignumber\";\nimport { keccak256 } from \"@ethersproject/keccak256\";\nimport { encode } from \"@ethersproject/rlp\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nfunction getChecksumAddress(address) {\n if (!isHexString(address, 20)) {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n address = address.toLowerCase();\n const chars = address.substring(2).split(\"\");\n const expanded = new Uint8Array(40);\n for (let i = 0; i < 40; i++) {\n expanded[i] = chars[i].charCodeAt(0);\n }\n const hashed = arrayify(keccak256(expanded));\n for (let i = 0; i < 40; i += 2) {\n if ((hashed[i >> 1] >> 4) >= 8) {\n chars[i] = chars[i].toUpperCase();\n }\n if ((hashed[i >> 1] & 0x0f) >= 8) {\n chars[i + 1] = chars[i + 1].toUpperCase();\n }\n }\n return \"0x\" + chars.join(\"\");\n}\n// Shims for environments that are missing some required constants and functions\nconst MAX_SAFE_INTEGER = 0x1fffffffffffff;\nfunction log10(x) {\n if (Math.log10) {\n return Math.log10(x);\n }\n return Math.log(x) / Math.LN10;\n}\n// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number\n// Create lookup table\nconst ibanLookup = {};\nfor (let i = 0; i < 10; i++) {\n ibanLookup[String(i)] = String(i);\n}\nfor (let i = 0; i < 26; i++) {\n ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);\n}\n// How many decimal digits can we process? (for 64-bit float, this is 15)\nconst safeDigits = Math.floor(log10(MAX_SAFE_INTEGER));\nfunction ibanChecksum(address) {\n address = address.toUpperCase();\n address = address.substring(4) + address.substring(0, 2) + \"00\";\n let expanded = address.split(\"\").map((c) => { return ibanLookup[c]; }).join(\"\");\n // Javascript can handle integers safely up to 15 (decimal) digits\n while (expanded.length >= safeDigits) {\n let block = expanded.substring(0, safeDigits);\n expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);\n }\n let checksum = String(98 - (parseInt(expanded, 10) % 97));\n while (checksum.length < 2) {\n checksum = \"0\" + checksum;\n }\n return checksum;\n}\n;\nexport function getAddress(address) {\n let result = null;\n if (typeof (address) !== \"string\") {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) {\n // Missing the 0x prefix\n if (address.substring(0, 2) !== \"0x\") {\n address = \"0x\" + address;\n }\n result = getChecksumAddress(address);\n // It is a checksummed address with a bad checksum\n if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {\n logger.throwArgumentError(\"bad address checksum\", \"address\", address);\n }\n // Maybe ICAP? (we only support direct mode)\n }\n else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {\n // It is an ICAP address with a bad checksum\n if (address.substring(2, 4) !== ibanChecksum(address)) {\n logger.throwArgumentError(\"bad icap checksum\", \"address\", address);\n }\n result = _base36To16(address.substring(4));\n while (result.length < 40) {\n result = \"0\" + result;\n }\n result = getChecksumAddress(\"0x\" + result);\n }\n else {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n return result;\n}\nexport function isAddress(address) {\n try {\n getAddress(address);\n return true;\n }\n catch (error) { }\n return false;\n}\nexport function getIcapAddress(address) {\n let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase();\n while (base36.length < 30) {\n base36 = \"0\" + base36;\n }\n return \"XE\" + ibanChecksum(\"XE00\" + base36) + base36;\n}\n// http://ethereum.stackexchange.com/questions/760/how-is-the-address-of-an-ethereum-contract-computed\nexport function getContractAddress(transaction) {\n let from = null;\n try {\n from = getAddress(transaction.from);\n }\n catch (error) {\n logger.throwArgumentError(\"missing from address\", \"transaction\", transaction);\n }\n const nonce = stripZeros(arrayify(BigNumber.from(transaction.nonce).toHexString()));\n return getAddress(hexDataSlice(keccak256(encode([from, nonce])), 12));\n}\nexport function getCreate2Address(from, salt, initCodeHash) {\n if (hexDataLength(salt) !== 32) {\n logger.throwArgumentError(\"salt must be 32 bytes\", \"salt\", salt);\n }\n if (hexDataLength(initCodeHash) !== 32) {\n logger.throwArgumentError(\"initCodeHash must be 32 bytes\", \"initCodeHash\", initCodeHash);\n }\n return getAddress(hexDataSlice(keccak256(concat([\"0xff\", getAddress(from), salt, initCodeHash])), 12));\n}\n//# sourceMappingURL=index.js.map","\"use strict\";\nimport { getAddress } from \"@ethersproject/address\";\nimport { hexZeroPad } from \"@ethersproject/bytes\";\nimport { Coder } from \"./abstract-coder\";\nexport class AddressCoder extends Coder {\n constructor(localName) {\n super(\"address\", \"address\", localName, false);\n }\n defaultValue() {\n return \"0x0000000000000000000000000000000000000000\";\n }\n encode(writer, value) {\n try {\n value = getAddress(value);\n }\n catch (error) {\n this._throwError(error.message, value);\n }\n return writer.writeValue(value);\n }\n decode(reader) {\n return getAddress(hexZeroPad(reader.readValue().toHexString(), 20));\n }\n}\n//# sourceMappingURL=address.js.map","\"use strict\";\nimport { Coder } from \"./abstract-coder\";\n// Clones the functionality of an existing Coder, but without a localName\nexport class AnonymousCoder extends Coder {\n constructor(coder) {\n super(coder.name, coder.type, undefined, coder.dynamic);\n this.coder = coder;\n }\n defaultValue() {\n return this.coder.defaultValue();\n }\n encode(writer, value) {\n return this.coder.encode(writer, value);\n }\n decode(reader) {\n return this.coder.decode(reader);\n }\n}\n//# sourceMappingURL=anonymous.js.map","\"use strict\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"../_version\";\nconst logger = new Logger(version);\nimport { Coder, Writer } from \"./abstract-coder\";\nimport { AnonymousCoder } from \"./anonymous\";\nexport function pack(writer, coders, values) {\n let arrayValues = null;\n if (Array.isArray(values)) {\n arrayValues = values;\n }\n else if (values && typeof (values) === \"object\") {\n let unique = {};\n arrayValues = coders.map((coder) => {\n const name = coder.localName;\n if (!name) {\n logger.throwError(\"cannot encode object for signature with missing names\", Logger.errors.INVALID_ARGUMENT, {\n argument: \"values\",\n coder: coder,\n value: values\n });\n }\n if (unique[name]) {\n logger.throwError(\"cannot encode object for signature with duplicate names\", Logger.errors.INVALID_ARGUMENT, {\n argument: \"values\",\n coder: coder,\n value: values\n });\n }\n unique[name] = true;\n return values[name];\n });\n }\n else {\n logger.throwArgumentError(\"invalid tuple value\", \"tuple\", values);\n }\n if (coders.length !== arrayValues.length) {\n logger.throwArgumentError(\"types/value length mismatch\", \"tuple\", values);\n }\n let staticWriter = new Writer(writer.wordSize);\n let dynamicWriter = new Writer(writer.wordSize);\n let updateFuncs = [];\n coders.forEach((coder, index) => {\n let value = arrayValues[index];\n if (coder.dynamic) {\n // Get current dynamic offset (for the future pointer)\n let dynamicOffset = dynamicWriter.length;\n // Encode the dynamic value into the dynamicWriter\n coder.encode(dynamicWriter, value);\n // Prepare to populate the correct offset once we are done\n let updateFunc = staticWriter.writeUpdatableValue();\n updateFuncs.push((baseOffset) => {\n updateFunc(baseOffset + dynamicOffset);\n });\n }\n else {\n coder.encode(staticWriter, value);\n }\n });\n // Backfill all the dynamic offsets, now that we know the static length\n updateFuncs.forEach((func) => { func(staticWriter.length); });\n let length = writer.appendWriter(staticWriter);\n length += writer.appendWriter(dynamicWriter);\n return length;\n}\nexport function unpack(reader, coders) {\n let values = [];\n // A reader anchored to this base\n let baseReader = reader.subReader(0);\n coders.forEach((coder) => {\n let value = null;\n if (coder.dynamic) {\n let offset = reader.readValue();\n let offsetReader = baseReader.subReader(offset.toNumber());\n try {\n value = coder.decode(offsetReader);\n }\n catch (error) {\n // Cannot recover from this\n if (error.code === Logger.errors.BUFFER_OVERRUN) {\n throw error;\n }\n value = error;\n value.baseType = coder.name;\n value.name = coder.localName;\n value.type = coder.type;\n }\n }\n else {\n try {\n value = coder.decode(reader);\n }\n catch (error) {\n // Cannot recover from this\n if (error.code === Logger.errors.BUFFER_OVERRUN) {\n throw error;\n }\n value = error;\n value.baseType = coder.name;\n value.name = coder.localName;\n value.type = coder.type;\n }\n }\n if (value != undefined) {\n values.push(value);\n }\n });\n // We only output named properties for uniquely named coders\n const uniqueNames = coders.reduce((accum, coder) => {\n const name = coder.localName;\n if (name) {\n if (!accum[name]) {\n accum[name] = 0;\n }\n accum[name]++;\n }\n return accum;\n }, {});\n // Add any named parameters (i.e. tuples)\n coders.forEach((coder, index) => {\n let name = coder.localName;\n if (!name || uniqueNames[name] !== 1) {\n return;\n }\n if (name === \"length\") {\n name = \"_length\";\n }\n if (values[name] != null) {\n return;\n }\n const value = values[index];\n if (value instanceof Error) {\n Object.defineProperty(values, name, {\n enumerable: true,\n get: () => { throw value; }\n });\n }\n else {\n values[name] = value;\n }\n });\n for (let i = 0; i < values.length; i++) {\n const value = values[i];\n if (value instanceof Error) {\n Object.defineProperty(values, i, {\n enumerable: true,\n get: () => { throw value; }\n });\n }\n }\n return Object.freeze(values);\n}\nexport class ArrayCoder extends Coder {\n constructor(coder, length, localName) {\n const type = (coder.type + \"[\" + (length >= 0 ? length : \"\") + \"]\");\n const dynamic = (length === -1 || coder.dynamic);\n super(\"array\", type, localName, dynamic);\n this.coder = coder;\n this.length = length;\n }\n defaultValue() {\n // Verifies the child coder is valid (even if the array is dynamic or 0-length)\n const defaultChild = this.coder.defaultValue();\n const result = [];\n for (let i = 0; i < this.length; i++) {\n result.push(defaultChild);\n }\n return result;\n }\n encode(writer, value) {\n if (!Array.isArray(value)) {\n this._throwError(\"expected array value\", value);\n }\n let count = this.length;\n if (count === -1) {\n count = value.length;\n writer.writeValue(value.length);\n }\n logger.checkArgumentCount(value.length, count, \"coder array\" + (this.localName ? (\" \" + this.localName) : \"\"));\n let coders = [];\n for (let i = 0; i < value.length; i++) {\n coders.push(this.coder);\n }\n return pack(writer, coders, value);\n }\n decode(reader) {\n let count = this.length;\n if (count === -1) {\n count = reader.readValue().toNumber();\n // Check that there is *roughly* enough data to ensure\n // stray random data is not being read as a length. Each\n // slot requires at least 32 bytes for their value (or 32\n // bytes as a link to the data). This could use a much\n // tighter bound, but we are erroring on the side of safety.\n if (count * 32 > reader._data.length) {\n logger.throwError(\"insufficient data length\", Logger.errors.BUFFER_OVERRUN, {\n length: reader._data.length,\n count: count\n });\n }\n }\n let coders = [];\n for (let i = 0; i < count; i++) {\n coders.push(new AnonymousCoder(this.coder));\n }\n return reader.coerce(this.name, unpack(reader, coders));\n }\n}\n//# sourceMappingURL=array.js.map","\"use strict\";\nimport { Coder } from \"./abstract-coder\";\nexport class BooleanCoder extends Coder {\n constructor(localName) {\n super(\"bool\", \"bool\", localName, false);\n }\n defaultValue() {\n return false;\n }\n encode(writer, value) {\n return writer.writeValue(value ? 1 : 0);\n }\n decode(reader) {\n return reader.coerce(this.type, !reader.readValue().isZero());\n }\n}\n//# sourceMappingURL=boolean.js.map","\"use strict\";\nimport { arrayify, hexlify } from \"@ethersproject/bytes\";\nimport { Coder } from \"./abstract-coder\";\nexport class DynamicBytesCoder extends Coder {\n constructor(type, localName) {\n super(type, type, localName, true);\n }\n defaultValue() {\n return \"0x\";\n }\n encode(writer, value) {\n value = arrayify(value);\n let length = writer.writeValue(value.length);\n length += writer.writeBytes(value);\n return length;\n }\n decode(reader) {\n return reader.readBytes(reader.readValue().toNumber(), true);\n }\n}\nexport class BytesCoder extends DynamicBytesCoder {\n constructor(localName) {\n super(\"bytes\", localName);\n }\n decode(reader) {\n return reader.coerce(this.name, hexlify(super.decode(reader)));\n }\n}\n//# sourceMappingURL=bytes.js.map","\"use strict\";\nimport { arrayify, hexlify } from \"@ethersproject/bytes\";\nimport { Coder } from \"./abstract-coder\";\n// @TODO: Merge this with bytes\nexport class FixedBytesCoder extends Coder {\n constructor(size, localName) {\n let name = \"bytes\" + String(size);\n super(name, name, localName, false);\n this.size = size;\n }\n defaultValue() {\n return (\"0x0000000000000000000000000000000000000000000000000000000000000000\").substring(0, 2 + this.size * 2);\n }\n encode(writer, value) {\n let data = arrayify(value);\n if (data.length !== this.size) {\n this._throwError(\"incorrect data length\", value);\n }\n return writer.writeBytes(data);\n }\n decode(reader) {\n return reader.coerce(this.name, hexlify(reader.readBytes(this.size)));\n }\n}\n//# sourceMappingURL=fixed-bytes.js.map","\"use strict\";\nimport { Coder } from \"./abstract-coder\";\nexport class NullCoder extends Coder {\n constructor(localName) {\n super(\"null\", \"\", localName, false);\n }\n defaultValue() {\n return null;\n }\n encode(writer, value) {\n if (value != null) {\n this._throwError(\"not null\", value);\n }\n return writer.writeBytes([]);\n }\n decode(reader) {\n reader.readBytes(0);\n return reader.coerce(this.name, null);\n }\n}\n//# sourceMappingURL=null.js.map","import { BigNumber } from \"@ethersproject/bignumber\";\nconst NegativeOne = ( /*#__PURE__*/BigNumber.from(-1));\nconst Zero = ( /*#__PURE__*/BigNumber.from(0));\nconst One = ( /*#__PURE__*/BigNumber.from(1));\nconst Two = ( /*#__PURE__*/BigNumber.from(2));\nconst WeiPerEther = ( /*#__PURE__*/BigNumber.from(\"1000000000000000000\"));\nconst MaxUint256 = ( /*#__PURE__*/BigNumber.from(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\"));\nconst MinInt256 = ( /*#__PURE__*/BigNumber.from(\"-0x8000000000000000000000000000000000000000000000000000000000000000\"));\nconst MaxInt256 = ( /*#__PURE__*/BigNumber.from(\"0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\"));\nexport { NegativeOne, Zero, One, Two, WeiPerEther, MaxUint256, MinInt256, MaxInt256, };\n//# sourceMappingURL=bignumbers.js.map","\"use strict\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { MaxUint256, NegativeOne, One, Zero } from \"@ethersproject/constants\";\nimport { Coder } from \"./abstract-coder\";\nexport class NumberCoder extends Coder {\n constructor(size, signed, localName) {\n const name = ((signed ? \"int\" : \"uint\") + (size * 8));\n super(name, name, localName, false);\n this.size = size;\n this.signed = signed;\n }\n defaultValue() {\n return 0;\n }\n encode(writer, value) {\n let v = BigNumber.from(value);\n // Check bounds are safe for encoding\n let maxUintValue = MaxUint256.mask(writer.wordSize * 8);\n if (this.signed) {\n let bounds = maxUintValue.mask(this.size * 8 - 1);\n if (v.gt(bounds) || v.lt(bounds.add(One).mul(NegativeOne))) {\n this._throwError(\"value out-of-bounds\", value);\n }\n }\n else if (v.lt(Zero) || v.gt(maxUintValue.mask(this.size * 8))) {\n this._throwError(\"value out-of-bounds\", value);\n }\n v = v.toTwos(this.size * 8).mask(this.size * 8);\n if (this.signed) {\n v = v.fromTwos(this.size * 8).toTwos(8 * writer.wordSize);\n }\n return writer.writeValue(v);\n }\n decode(reader) {\n let value = reader.readValue().mask(this.size * 8);\n if (this.signed) {\n value = value.fromTwos(this.size * 8);\n }\n return reader.coerce(this.name, value);\n }\n}\n//# sourceMappingURL=number.js.map","export const version = \"strings/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nimport { arrayify } from \"@ethersproject/bytes\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n///////////////////////////////\nexport var UnicodeNormalizationForm;\n(function (UnicodeNormalizationForm) {\n UnicodeNormalizationForm[\"current\"] = \"\";\n UnicodeNormalizationForm[\"NFC\"] = \"NFC\";\n UnicodeNormalizationForm[\"NFD\"] = \"NFD\";\n UnicodeNormalizationForm[\"NFKC\"] = \"NFKC\";\n UnicodeNormalizationForm[\"NFKD\"] = \"NFKD\";\n})(UnicodeNormalizationForm || (UnicodeNormalizationForm = {}));\n;\nexport var Utf8ErrorReason;\n(function (Utf8ErrorReason) {\n // A continuation byte was present where there was nothing to continue\n // - offset = the index the codepoint began in\n Utf8ErrorReason[\"UNEXPECTED_CONTINUE\"] = \"unexpected continuation byte\";\n // An invalid (non-continuation) byte to start a UTF-8 codepoint was found\n // - offset = the index the codepoint began in\n Utf8ErrorReason[\"BAD_PREFIX\"] = \"bad codepoint prefix\";\n // The string is too short to process the expected codepoint\n // - offset = the index the codepoint began in\n Utf8ErrorReason[\"OVERRUN\"] = \"string overrun\";\n // A missing continuation byte was expected but not found\n // - offset = the index the continuation byte was expected at\n Utf8ErrorReason[\"MISSING_CONTINUE\"] = \"missing continuation byte\";\n // The computed code point is outside the range for UTF-8\n // - offset = start of this codepoint\n // - badCodepoint = the computed codepoint; outside the UTF-8 range\n Utf8ErrorReason[\"OUT_OF_RANGE\"] = \"out of UTF-8 range\";\n // UTF-8 strings may not contain UTF-16 surrogate pairs\n // - offset = start of this codepoint\n // - badCodepoint = the computed codepoint; inside the UTF-16 surrogate range\n Utf8ErrorReason[\"UTF16_SURROGATE\"] = \"UTF-16 surrogate\";\n // The string is an overlong representation\n // - offset = start of this codepoint\n // - badCodepoint = the computed codepoint; already bounds checked\n Utf8ErrorReason[\"OVERLONG\"] = \"overlong representation\";\n})(Utf8ErrorReason || (Utf8ErrorReason = {}));\n;\nfunction errorFunc(reason, offset, bytes, output, badCodepoint) {\n return logger.throwArgumentError(`invalid codepoint at offset ${offset}; ${reason}`, \"bytes\", bytes);\n}\nfunction ignoreFunc(reason, offset, bytes, output, badCodepoint) {\n // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes\n if (reason === Utf8ErrorReason.BAD_PREFIX || reason === Utf8ErrorReason.UNEXPECTED_CONTINUE) {\n let i = 0;\n for (let o = offset + 1; o < bytes.length; o++) {\n if (bytes[o] >> 6 !== 0x02) {\n break;\n }\n i++;\n }\n return i;\n }\n // This byte runs us past the end of the string, so just jump to the end\n // (but the first byte was read already read and therefore skipped)\n if (reason === Utf8ErrorReason.OVERRUN) {\n return bytes.length - offset - 1;\n }\n // Nothing to skip\n return 0;\n}\nfunction replaceFunc(reason, offset, bytes, output, badCodepoint) {\n // Overlong representations are otherwise \"valid\" code points; just non-deistingtished\n if (reason === Utf8ErrorReason.OVERLONG) {\n output.push(badCodepoint);\n return 0;\n }\n // Put the replacement character into the output\n output.push(0xfffd);\n // Otherwise, process as if ignoring errors\n return ignoreFunc(reason, offset, bytes, output, badCodepoint);\n}\n// Common error handing strategies\nexport const Utf8ErrorFuncs = Object.freeze({\n error: errorFunc,\n ignore: ignoreFunc,\n replace: replaceFunc\n});\n// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499\nfunction getUtf8CodePoints(bytes, onError) {\n if (onError == null) {\n onError = Utf8ErrorFuncs.error;\n }\n bytes = arrayify(bytes);\n const result = [];\n let i = 0;\n // Invalid bytes are ignored\n while (i < bytes.length) {\n const c = bytes[i++];\n // 0xxx xxxx\n if (c >> 7 === 0) {\n result.push(c);\n continue;\n }\n // Multibyte; how many bytes left for this character?\n let extraLength = null;\n let overlongMask = null;\n // 110x xxxx 10xx xxxx\n if ((c & 0xe0) === 0xc0) {\n extraLength = 1;\n overlongMask = 0x7f;\n // 1110 xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf0) === 0xe0) {\n extraLength = 2;\n overlongMask = 0x7ff;\n // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf8) === 0xf0) {\n extraLength = 3;\n overlongMask = 0xffff;\n }\n else {\n if ((c & 0xc0) === 0x80) {\n i += onError(Utf8ErrorReason.UNEXPECTED_CONTINUE, i - 1, bytes, result);\n }\n else {\n i += onError(Utf8ErrorReason.BAD_PREFIX, i - 1, bytes, result);\n }\n continue;\n }\n // Do we have enough bytes in our data?\n if (i - 1 + extraLength >= bytes.length) {\n i += onError(Utf8ErrorReason.OVERRUN, i - 1, bytes, result);\n continue;\n }\n // Remove the length prefix from the char\n let res = c & ((1 << (8 - extraLength - 1)) - 1);\n for (let j = 0; j < extraLength; j++) {\n let nextChar = bytes[i];\n // Invalid continuation byte\n if ((nextChar & 0xc0) != 0x80) {\n i += onError(Utf8ErrorReason.MISSING_CONTINUE, i, bytes, result);\n res = null;\n break;\n }\n ;\n res = (res << 6) | (nextChar & 0x3f);\n i++;\n }\n // See above loop for invalid continuation byte\n if (res === null) {\n continue;\n }\n // Maximum code point\n if (res > 0x10ffff) {\n i += onError(Utf8ErrorReason.OUT_OF_RANGE, i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Reserved for UTF-16 surrogate halves\n if (res >= 0xd800 && res <= 0xdfff) {\n i += onError(Utf8ErrorReason.UTF16_SURROGATE, i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Check for overlong sequences (more bytes than needed)\n if (res <= overlongMask) {\n i += onError(Utf8ErrorReason.OVERLONG, i - 1 - extraLength, bytes, result, res);\n continue;\n }\n result.push(res);\n }\n return result;\n}\n// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array\nexport function toUtf8Bytes(str, form = UnicodeNormalizationForm.current) {\n if (form != UnicodeNormalizationForm.current) {\n logger.checkNormalize();\n str = str.normalize(form);\n }\n let result = [];\n for (let i = 0; i < str.length; i++) {\n const c = str.charCodeAt(i);\n if (c < 0x80) {\n result.push(c);\n }\n else if (c < 0x800) {\n result.push((c >> 6) | 0xc0);\n result.push((c & 0x3f) | 0x80);\n }\n else if ((c & 0xfc00) == 0xd800) {\n i++;\n const c2 = str.charCodeAt(i);\n if (i >= str.length || (c2 & 0xfc00) !== 0xdc00) {\n throw new Error(\"invalid utf-8 string\");\n }\n // Surrogate Pair\n const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);\n result.push((pair >> 18) | 0xf0);\n result.push(((pair >> 12) & 0x3f) | 0x80);\n result.push(((pair >> 6) & 0x3f) | 0x80);\n result.push((pair & 0x3f) | 0x80);\n }\n else {\n result.push((c >> 12) | 0xe0);\n result.push(((c >> 6) & 0x3f) | 0x80);\n result.push((c & 0x3f) | 0x80);\n }\n }\n return arrayify(result);\n}\n;\nfunction escapeChar(value) {\n const hex = (\"0000\" + value.toString(16));\n return \"\\\\u\" + hex.substring(hex.length - 4);\n}\nexport function _toEscapedUtf8String(bytes, onError) {\n return '\"' + getUtf8CodePoints(bytes, onError).map((codePoint) => {\n if (codePoint < 256) {\n switch (codePoint) {\n case 8: return \"\\\\b\";\n case 9: return \"\\\\t\";\n case 10: return \"\\\\n\";\n case 13: return \"\\\\r\";\n case 34: return \"\\\\\\\"\";\n case 92: return \"\\\\\\\\\";\n }\n if (codePoint >= 32 && codePoint < 127) {\n return String.fromCharCode(codePoint);\n }\n }\n if (codePoint <= 0xffff) {\n return escapeChar(codePoint);\n }\n codePoint -= 0x10000;\n return escapeChar(((codePoint >> 10) & 0x3ff) + 0xd800) + escapeChar((codePoint & 0x3ff) + 0xdc00);\n }).join(\"\") + '\"';\n}\nexport function _toUtf8String(codePoints) {\n return codePoints.map((codePoint) => {\n if (codePoint <= 0xffff) {\n return String.fromCharCode(codePoint);\n }\n codePoint -= 0x10000;\n return String.fromCharCode((((codePoint >> 10) & 0x3ff) + 0xd800), ((codePoint & 0x3ff) + 0xdc00));\n }).join(\"\");\n}\nexport function toUtf8String(bytes, onError) {\n return _toUtf8String(getUtf8CodePoints(bytes, onError));\n}\nexport function toUtf8CodePoints(str, form = UnicodeNormalizationForm.current) {\n return getUtf8CodePoints(toUtf8Bytes(str, form));\n}\n//# sourceMappingURL=utf8.js.map","\"use strict\";\nimport { toUtf8Bytes, toUtf8String } from \"@ethersproject/strings\";\nimport { DynamicBytesCoder } from \"./bytes\";\nexport class StringCoder extends DynamicBytesCoder {\n constructor(localName) {\n super(\"string\", localName);\n }\n defaultValue() {\n return \"\";\n }\n encode(writer, value) {\n return super.encode(writer, toUtf8Bytes(value));\n }\n decode(reader) {\n return toUtf8String(super.decode(reader));\n }\n}\n//# sourceMappingURL=string.js.map","\"use strict\";\nimport { Coder } from \"./abstract-coder\";\nimport { pack, unpack } from \"./array\";\nexport class TupleCoder extends Coder {\n constructor(coders, localName) {\n let dynamic = false;\n const types = [];\n coders.forEach((coder) => {\n if (coder.dynamic) {\n dynamic = true;\n }\n types.push(coder.type);\n });\n const type = (\"tuple(\" + types.join(\",\") + \")\");\n super(\"tuple\", type, localName, dynamic);\n this.coders = coders;\n }\n defaultValue() {\n const values = [];\n this.coders.forEach((coder) => {\n values.push(coder.defaultValue());\n });\n // We only output named properties for uniquely named coders\n const uniqueNames = this.coders.reduce((accum, coder) => {\n const name = coder.localName;\n if (name) {\n if (!accum[name]) {\n accum[name] = 0;\n }\n accum[name]++;\n }\n return accum;\n }, {});\n // Add named values\n this.coders.forEach((coder, index) => {\n let name = coder.localName;\n if (!name || uniqueNames[name] !== 1) {\n return;\n }\n if (name === \"length\") {\n name = \"_length\";\n }\n if (values[name] != null) {\n return;\n }\n values[name] = values[index];\n });\n return Object.freeze(values);\n }\n encode(writer, value) {\n return pack(writer, this.coders, value);\n }\n decode(reader) {\n return reader.coerce(this.name, unpack(reader, this.coders));\n }\n}\n//# sourceMappingURL=tuple.js.map","\"use strict\";\n// See: https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI\nimport { arrayify } from \"@ethersproject/bytes\";\nimport { defineReadOnly } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nimport { Reader, Writer } from \"./coders/abstract-coder\";\nimport { AddressCoder } from \"./coders/address\";\nimport { ArrayCoder } from \"./coders/array\";\nimport { BooleanCoder } from \"./coders/boolean\";\nimport { BytesCoder } from \"./coders/bytes\";\nimport { FixedBytesCoder } from \"./coders/fixed-bytes\";\nimport { NullCoder } from \"./coders/null\";\nimport { NumberCoder } from \"./coders/number\";\nimport { StringCoder } from \"./coders/string\";\nimport { TupleCoder } from \"./coders/tuple\";\nimport { ParamType } from \"./fragments\";\nconst paramTypeBytes = new RegExp(/^bytes([0-9]*)$/);\nconst paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/);\nexport class AbiCoder {\n constructor(coerceFunc) {\n defineReadOnly(this, \"coerceFunc\", coerceFunc || null);\n }\n _getCoder(param) {\n switch (param.baseType) {\n case \"address\":\n return new AddressCoder(param.name);\n case \"bool\":\n return new BooleanCoder(param.name);\n case \"string\":\n return new StringCoder(param.name);\n case \"bytes\":\n return new BytesCoder(param.name);\n case \"array\":\n return new ArrayCoder(this._getCoder(param.arrayChildren), param.arrayLength, param.name);\n case \"tuple\":\n return new TupleCoder((param.components || []).map((component) => {\n return this._getCoder(component);\n }), param.name);\n case \"\":\n return new NullCoder(param.name);\n }\n // u?int[0-9]*\n let match = param.type.match(paramTypeNumber);\n if (match) {\n let size = parseInt(match[2] || \"256\");\n if (size === 0 || size > 256 || (size % 8) !== 0) {\n logger.throwArgumentError(\"invalid \" + match[1] + \" bit length\", \"param\", param);\n }\n return new NumberCoder(size / 8, (match[1] === \"int\"), param.name);\n }\n // bytes[0-9]+\n match = param.type.match(paramTypeBytes);\n if (match) {\n let size = parseInt(match[1]);\n if (size === 0 || size > 32) {\n logger.throwArgumentError(\"invalid bytes length\", \"param\", param);\n }\n return new FixedBytesCoder(size, param.name);\n }\n return logger.throwArgumentError(\"invalid type\", \"type\", param.type);\n }\n _getWordSize() { return 32; }\n _getReader(data, allowLoose) {\n return new Reader(data, this._getWordSize(), this.coerceFunc, allowLoose);\n }\n _getWriter() {\n return new Writer(this._getWordSize());\n }\n getDefaultValue(types) {\n const coders = types.map((type) => this._getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.defaultValue();\n }\n encode(types, values) {\n if (types.length !== values.length) {\n logger.throwError(\"types/values length mismatch\", Logger.errors.INVALID_ARGUMENT, {\n count: { types: types.length, values: values.length },\n value: { types: types, values: values }\n });\n }\n const coders = types.map((type) => this._getCoder(ParamType.from(type)));\n const coder = (new TupleCoder(coders, \"_\"));\n const writer = this._getWriter();\n coder.encode(writer, values);\n return writer.data;\n }\n decode(types, data, loose) {\n const coders = types.map((type) => this._getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.decode(this._getReader(arrayify(data), loose));\n }\n}\nexport const defaultAbiCoder = new AbiCoder();\n//# sourceMappingURL=abi-coder.js.map","import { keccak256 } from \"@ethersproject/keccak256\";\nimport { toUtf8Bytes } from \"@ethersproject/strings\";\nexport function id(text) {\n return keccak256(toUtf8Bytes(text));\n}\n//# sourceMappingURL=id.js.map","\"use strict\";\nimport { getAddress } from \"@ethersproject/address\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { arrayify, concat, hexDataSlice, hexlify, hexZeroPad, isHexString } from \"@ethersproject/bytes\";\nimport { id } from \"@ethersproject/hash\";\nimport { keccak256 } from \"@ethersproject/keccak256\";\nimport { defineReadOnly, Description, getStatic } from \"@ethersproject/properties\";\nimport { defaultAbiCoder } from \"./abi-coder\";\nimport { checkResultErrors } from \"./coders/abstract-coder\";\nimport { ConstructorFragment, EventFragment, FormatTypes, Fragment, FunctionFragment, ParamType } from \"./fragments\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nexport { checkResultErrors };\nexport class LogDescription extends Description {\n}\nexport class TransactionDescription extends Description {\n}\nexport class ErrorDescription extends Description {\n}\nexport class Indexed extends Description {\n static isIndexed(value) {\n return !!(value && value._isIndexed);\n }\n}\nconst BuiltinErrors = {\n \"0x08c379a0\": { signature: \"Error(string)\", name: \"Error\", inputs: [\"string\"], reason: true },\n \"0x4e487b71\": { signature: \"Panic(uint256)\", name: \"Panic\", inputs: [\"uint256\"] }\n};\nfunction wrapAccessError(property, error) {\n const wrap = new Error(`deferred error during ABI decoding triggered accessing ${property}`);\n wrap.error = error;\n return wrap;\n}\n/*\nfunction checkNames(fragment: Fragment, type: \"input\" | \"output\", params: Array): void {\n params.reduce((accum, param) => {\n if (param.name) {\n if (accum[param.name]) {\n logger.throwArgumentError(`duplicate ${ type } parameter ${ JSON.stringify(param.name) } in ${ fragment.format(\"full\") }`, \"fragment\", fragment);\n }\n accum[param.name] = true;\n }\n return accum;\n }, <{ [ name: string ]: boolean }>{ });\n}\n*/\nexport class Interface {\n constructor(fragments) {\n let abi = [];\n if (typeof (fragments) === \"string\") {\n abi = JSON.parse(fragments);\n }\n else {\n abi = fragments;\n }\n defineReadOnly(this, \"fragments\", abi.map((fragment) => {\n return Fragment.from(fragment);\n }).filter((fragment) => (fragment != null)));\n defineReadOnly(this, \"_abiCoder\", getStatic(new.target, \"getAbiCoder\")());\n defineReadOnly(this, \"functions\", {});\n defineReadOnly(this, \"errors\", {});\n defineReadOnly(this, \"events\", {});\n defineReadOnly(this, \"structs\", {});\n // Add all fragments by their signature\n this.fragments.forEach((fragment) => {\n let bucket = null;\n switch (fragment.type) {\n case \"constructor\":\n if (this.deploy) {\n logger.warn(\"duplicate definition - constructor\");\n return;\n }\n //checkNames(fragment, \"input\", fragment.inputs);\n defineReadOnly(this, \"deploy\", fragment);\n return;\n case \"function\":\n //checkNames(fragment, \"input\", fragment.inputs);\n //checkNames(fragment, \"output\", (fragment).outputs);\n bucket = this.functions;\n break;\n case \"event\":\n //checkNames(fragment, \"input\", fragment.inputs);\n bucket = this.events;\n break;\n case \"error\":\n bucket = this.errors;\n break;\n default:\n return;\n }\n let signature = fragment.format();\n if (bucket[signature]) {\n logger.warn(\"duplicate definition - \" + signature);\n return;\n }\n bucket[signature] = fragment;\n });\n // If we do not have a constructor add a default\n if (!this.deploy) {\n defineReadOnly(this, \"deploy\", ConstructorFragment.from({\n payable: false,\n type: \"constructor\"\n }));\n }\n defineReadOnly(this, \"_isInterface\", true);\n }\n format(format) {\n if (!format) {\n format = FormatTypes.full;\n }\n if (format === FormatTypes.sighash) {\n logger.throwArgumentError(\"interface does not support formatting sighash\", \"format\", format);\n }\n const abi = this.fragments.map((fragment) => fragment.format(format));\n // We need to re-bundle the JSON fragments a bit\n if (format === FormatTypes.json) {\n return JSON.stringify(abi.map((j) => JSON.parse(j)));\n }\n return abi;\n }\n // Sub-classes can override these to handle other blockchains\n static getAbiCoder() {\n return defaultAbiCoder;\n }\n static getAddress(address) {\n return getAddress(address);\n }\n static getSighash(fragment) {\n return hexDataSlice(id(fragment.format()), 0, 4);\n }\n static getEventTopic(eventFragment) {\n return id(eventFragment.format());\n }\n // Find a function definition by any means necessary (unless it is ambiguous)\n getFunction(nameOrSignatureOrSighash) {\n if (isHexString(nameOrSignatureOrSighash)) {\n for (const name in this.functions) {\n if (nameOrSignatureOrSighash === this.getSighash(name)) {\n return this.functions[name];\n }\n }\n logger.throwArgumentError(\"no matching function\", \"sighash\", nameOrSignatureOrSighash);\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (nameOrSignatureOrSighash.indexOf(\"(\") === -1) {\n const name = nameOrSignatureOrSighash.trim();\n const matching = Object.keys(this.functions).filter((f) => (f.split(\"(\" /* fix:) */)[0] === name));\n if (matching.length === 0) {\n logger.throwArgumentError(\"no matching function\", \"name\", name);\n }\n else if (matching.length > 1) {\n logger.throwArgumentError(\"multiple matching functions\", \"name\", name);\n }\n return this.functions[matching[0]];\n }\n // Normalize the signature and lookup the function\n const result = this.functions[FunctionFragment.fromString(nameOrSignatureOrSighash).format()];\n if (!result) {\n logger.throwArgumentError(\"no matching function\", \"signature\", nameOrSignatureOrSighash);\n }\n return result;\n }\n // Find an event definition by any means necessary (unless it is ambiguous)\n getEvent(nameOrSignatureOrTopic) {\n if (isHexString(nameOrSignatureOrTopic)) {\n const topichash = nameOrSignatureOrTopic.toLowerCase();\n for (const name in this.events) {\n if (topichash === this.getEventTopic(name)) {\n return this.events[name];\n }\n }\n logger.throwArgumentError(\"no matching event\", \"topichash\", topichash);\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (nameOrSignatureOrTopic.indexOf(\"(\") === -1) {\n const name = nameOrSignatureOrTopic.trim();\n const matching = Object.keys(this.events).filter((f) => (f.split(\"(\" /* fix:) */)[0] === name));\n if (matching.length === 0) {\n logger.throwArgumentError(\"no matching event\", \"name\", name);\n }\n else if (matching.length > 1) {\n logger.throwArgumentError(\"multiple matching events\", \"name\", name);\n }\n return this.events[matching[0]];\n }\n // Normalize the signature and lookup the function\n const result = this.events[EventFragment.fromString(nameOrSignatureOrTopic).format()];\n if (!result) {\n logger.throwArgumentError(\"no matching event\", \"signature\", nameOrSignatureOrTopic);\n }\n return result;\n }\n // Find a function definition by any means necessary (unless it is ambiguous)\n getError(nameOrSignatureOrSighash) {\n if (isHexString(nameOrSignatureOrSighash)) {\n const getSighash = getStatic(this.constructor, \"getSighash\");\n for (const name in this.errors) {\n const error = this.errors[name];\n if (nameOrSignatureOrSighash === getSighash(error)) {\n return this.errors[name];\n }\n }\n logger.throwArgumentError(\"no matching error\", \"sighash\", nameOrSignatureOrSighash);\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (nameOrSignatureOrSighash.indexOf(\"(\") === -1) {\n const name = nameOrSignatureOrSighash.trim();\n const matching = Object.keys(this.errors).filter((f) => (f.split(\"(\" /* fix:) */)[0] === name));\n if (matching.length === 0) {\n logger.throwArgumentError(\"no matching error\", \"name\", name);\n }\n else if (matching.length > 1) {\n logger.throwArgumentError(\"multiple matching errors\", \"name\", name);\n }\n return this.errors[matching[0]];\n }\n // Normalize the signature and lookup the function\n const result = this.errors[FunctionFragment.fromString(nameOrSignatureOrSighash).format()];\n if (!result) {\n logger.throwArgumentError(\"no matching error\", \"signature\", nameOrSignatureOrSighash);\n }\n return result;\n }\n // Get the sighash (the bytes4 selector) used by Solidity to identify a function\n getSighash(fragment) {\n if (typeof (fragment) === \"string\") {\n try {\n fragment = this.getFunction(fragment);\n }\n catch (error) {\n try {\n fragment = this.getError(fragment);\n }\n catch (_) {\n throw error;\n }\n }\n }\n return getStatic(this.constructor, \"getSighash\")(fragment);\n }\n // Get the topic (the bytes32 hash) used by Solidity to identify an event\n getEventTopic(eventFragment) {\n if (typeof (eventFragment) === \"string\") {\n eventFragment = this.getEvent(eventFragment);\n }\n return getStatic(this.constructor, \"getEventTopic\")(eventFragment);\n }\n _decodeParams(params, data) {\n return this._abiCoder.decode(params, data);\n }\n _encodeParams(params, values) {\n return this._abiCoder.encode(params, values);\n }\n encodeDeploy(values) {\n return this._encodeParams(this.deploy.inputs, values || []);\n }\n decodeErrorResult(fragment, data) {\n if (typeof (fragment) === \"string\") {\n fragment = this.getError(fragment);\n }\n const bytes = arrayify(data);\n if (hexlify(bytes.slice(0, 4)) !== this.getSighash(fragment)) {\n logger.throwArgumentError(`data signature does not match error ${fragment.name}.`, \"data\", hexlify(bytes));\n }\n return this._decodeParams(fragment.inputs, bytes.slice(4));\n }\n encodeErrorResult(fragment, values) {\n if (typeof (fragment) === \"string\") {\n fragment = this.getError(fragment);\n }\n return hexlify(concat([\n this.getSighash(fragment),\n this._encodeParams(fragment.inputs, values || [])\n ]));\n }\n // Decode the data for a function call (e.g. tx.data)\n decodeFunctionData(functionFragment, data) {\n if (typeof (functionFragment) === \"string\") {\n functionFragment = this.getFunction(functionFragment);\n }\n const bytes = arrayify(data);\n if (hexlify(bytes.slice(0, 4)) !== this.getSighash(functionFragment)) {\n logger.throwArgumentError(`data signature does not match function ${functionFragment.name}.`, \"data\", hexlify(bytes));\n }\n return this._decodeParams(functionFragment.inputs, bytes.slice(4));\n }\n // Encode the data for a function call (e.g. tx.data)\n encodeFunctionData(functionFragment, values) {\n if (typeof (functionFragment) === \"string\") {\n functionFragment = this.getFunction(functionFragment);\n }\n return hexlify(concat([\n this.getSighash(functionFragment),\n this._encodeParams(functionFragment.inputs, values || [])\n ]));\n }\n // Decode the result from a function call (e.g. from eth_call)\n decodeFunctionResult(functionFragment, data) {\n if (typeof (functionFragment) === \"string\") {\n functionFragment = this.getFunction(functionFragment);\n }\n let bytes = arrayify(data);\n let reason = null;\n let message = \"\";\n let errorArgs = null;\n let errorName = null;\n let errorSignature = null;\n switch (bytes.length % this._abiCoder._getWordSize()) {\n case 0:\n try {\n return this._abiCoder.decode(functionFragment.outputs, bytes);\n }\n catch (error) { }\n break;\n case 4: {\n const selector = hexlify(bytes.slice(0, 4));\n const builtin = BuiltinErrors[selector];\n if (builtin) {\n errorArgs = this._abiCoder.decode(builtin.inputs, bytes.slice(4));\n errorName = builtin.name;\n errorSignature = builtin.signature;\n if (builtin.reason) {\n reason = errorArgs[0];\n }\n if (errorName === \"Error\") {\n message = `; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(errorArgs[0])}`;\n }\n else if (errorName === \"Panic\") {\n message = `; VM Exception while processing transaction: reverted with panic code ${errorArgs[0]}`;\n }\n }\n else {\n try {\n const error = this.getError(selector);\n errorArgs = this._abiCoder.decode(error.inputs, bytes.slice(4));\n errorName = error.name;\n errorSignature = error.format();\n }\n catch (error) { }\n }\n break;\n }\n }\n return logger.throwError(\"call revert exception\" + message, Logger.errors.CALL_EXCEPTION, {\n method: functionFragment.format(),\n data: hexlify(data), errorArgs, errorName, errorSignature, reason\n });\n }\n // Encode the result for a function call (e.g. for eth_call)\n encodeFunctionResult(functionFragment, values) {\n if (typeof (functionFragment) === \"string\") {\n functionFragment = this.getFunction(functionFragment);\n }\n return hexlify(this._abiCoder.encode(functionFragment.outputs, values || []));\n }\n // Create the filter for the event with search criteria (e.g. for eth_filterLog)\n encodeFilterTopics(eventFragment, values) {\n if (typeof (eventFragment) === \"string\") {\n eventFragment = this.getEvent(eventFragment);\n }\n if (values.length > eventFragment.inputs.length) {\n logger.throwError(\"too many arguments for \" + eventFragment.format(), Logger.errors.UNEXPECTED_ARGUMENT, {\n argument: \"values\",\n value: values\n });\n }\n let topics = [];\n if (!eventFragment.anonymous) {\n topics.push(this.getEventTopic(eventFragment));\n }\n const encodeTopic = (param, value) => {\n if (param.type === \"string\") {\n return id(value);\n }\n else if (param.type === \"bytes\") {\n return keccak256(hexlify(value));\n }\n if (param.type === \"bool\" && typeof (value) === \"boolean\") {\n value = (value ? \"0x01\" : \"0x00\");\n }\n if (param.type.match(/^u?int/)) {\n value = BigNumber.from(value).toHexString();\n }\n // Check addresses are valid\n if (param.type === \"address\") {\n this._abiCoder.encode([\"address\"], [value]);\n }\n return hexZeroPad(hexlify(value), 32);\n };\n values.forEach((value, index) => {\n let param = eventFragment.inputs[index];\n if (!param.indexed) {\n if (value != null) {\n logger.throwArgumentError(\"cannot filter non-indexed parameters; must be null\", (\"contract.\" + param.name), value);\n }\n return;\n }\n if (value == null) {\n topics.push(null);\n }\n else if (param.baseType === \"array\" || param.baseType === \"tuple\") {\n logger.throwArgumentError(\"filtering with tuples or arrays not supported\", (\"contract.\" + param.name), value);\n }\n else if (Array.isArray(value)) {\n topics.push(value.map((value) => encodeTopic(param, value)));\n }\n else {\n topics.push(encodeTopic(param, value));\n }\n });\n // Trim off trailing nulls\n while (topics.length && topics[topics.length - 1] === null) {\n topics.pop();\n }\n return topics;\n }\n encodeEventLog(eventFragment, values) {\n if (typeof (eventFragment) === \"string\") {\n eventFragment = this.getEvent(eventFragment);\n }\n const topics = [];\n const dataTypes = [];\n const dataValues = [];\n if (!eventFragment.anonymous) {\n topics.push(this.getEventTopic(eventFragment));\n }\n if (values.length !== eventFragment.inputs.length) {\n logger.throwArgumentError(\"event arguments/values mismatch\", \"values\", values);\n }\n eventFragment.inputs.forEach((param, index) => {\n const value = values[index];\n if (param.indexed) {\n if (param.type === \"string\") {\n topics.push(id(value));\n }\n else if (param.type === \"bytes\") {\n topics.push(keccak256(value));\n }\n else if (param.baseType === \"tuple\" || param.baseType === \"array\") {\n // @TODO\n throw new Error(\"not implemented\");\n }\n else {\n topics.push(this._abiCoder.encode([param.type], [value]));\n }\n }\n else {\n dataTypes.push(param);\n dataValues.push(value);\n }\n });\n return {\n data: this._abiCoder.encode(dataTypes, dataValues),\n topics: topics\n };\n }\n // Decode a filter for the event and the search criteria\n decodeEventLog(eventFragment, data, topics) {\n if (typeof (eventFragment) === \"string\") {\n eventFragment = this.getEvent(eventFragment);\n }\n if (topics != null && !eventFragment.anonymous) {\n let topicHash = this.getEventTopic(eventFragment);\n if (!isHexString(topics[0], 32) || topics[0].toLowerCase() !== topicHash) {\n logger.throwError(\"fragment/topic mismatch\", Logger.errors.INVALID_ARGUMENT, { argument: \"topics[0]\", expected: topicHash, value: topics[0] });\n }\n topics = topics.slice(1);\n }\n let indexed = [];\n let nonIndexed = [];\n let dynamic = [];\n eventFragment.inputs.forEach((param, index) => {\n if (param.indexed) {\n if (param.type === \"string\" || param.type === \"bytes\" || param.baseType === \"tuple\" || param.baseType === \"array\") {\n indexed.push(ParamType.fromObject({ type: \"bytes32\", name: param.name }));\n dynamic.push(true);\n }\n else {\n indexed.push(param);\n dynamic.push(false);\n }\n }\n else {\n nonIndexed.push(param);\n dynamic.push(false);\n }\n });\n let resultIndexed = (topics != null) ? this._abiCoder.decode(indexed, concat(topics)) : null;\n let resultNonIndexed = this._abiCoder.decode(nonIndexed, data, true);\n let result = [];\n let nonIndexedIndex = 0, indexedIndex = 0;\n eventFragment.inputs.forEach((param, index) => {\n if (param.indexed) {\n if (resultIndexed == null) {\n result[index] = new Indexed({ _isIndexed: true, hash: null });\n }\n else if (dynamic[index]) {\n result[index] = new Indexed({ _isIndexed: true, hash: resultIndexed[indexedIndex++] });\n }\n else {\n try {\n result[index] = resultIndexed[indexedIndex++];\n }\n catch (error) {\n result[index] = error;\n }\n }\n }\n else {\n try {\n result[index] = resultNonIndexed[nonIndexedIndex++];\n }\n catch (error) {\n result[index] = error;\n }\n }\n // Add the keyword argument if named and safe\n if (param.name && result[param.name] == null) {\n const value = result[index];\n // Make error named values throw on access\n if (value instanceof Error) {\n Object.defineProperty(result, param.name, {\n enumerable: true,\n get: () => { throw wrapAccessError(`property ${JSON.stringify(param.name)}`, value); }\n });\n }\n else {\n result[param.name] = value;\n }\n }\n });\n // Make all error indexed values throw on access\n for (let i = 0; i < result.length; i++) {\n const value = result[i];\n if (value instanceof Error) {\n Object.defineProperty(result, i, {\n enumerable: true,\n get: () => { throw wrapAccessError(`index ${i}`, value); }\n });\n }\n }\n return Object.freeze(result);\n }\n // Given a transaction, find the matching function fragment (if any) and\n // determine all its properties and call parameters\n parseTransaction(tx) {\n let fragment = this.getFunction(tx.data.substring(0, 10).toLowerCase());\n if (!fragment) {\n return null;\n }\n return new TransactionDescription({\n args: this._abiCoder.decode(fragment.inputs, \"0x\" + tx.data.substring(10)),\n functionFragment: fragment,\n name: fragment.name,\n signature: fragment.format(),\n sighash: this.getSighash(fragment),\n value: BigNumber.from(tx.value || \"0\"),\n });\n }\n // @TODO\n //parseCallResult(data: BytesLike): ??\n // Given an event log, find the matching event fragment (if any) and\n // determine all its properties and values\n parseLog(log) {\n let fragment = this.getEvent(log.topics[0]);\n if (!fragment || fragment.anonymous) {\n return null;\n }\n // @TODO: If anonymous, and the only method, and the input count matches, should we parse?\n // Probably not, because just because it is the only event in the ABI does\n // not mean we have the full ABI; maybe just a fragment?\n return new LogDescription({\n eventFragment: fragment,\n name: fragment.name,\n signature: fragment.format(),\n topic: this.getEventTopic(fragment),\n args: this.decodeEventLog(fragment, log.data, log.topics)\n });\n }\n parseError(data) {\n const hexData = hexlify(data);\n let fragment = this.getError(hexData.substring(0, 10).toLowerCase());\n if (!fragment) {\n return null;\n }\n return new ErrorDescription({\n args: this._abiCoder.decode(fragment.inputs, \"0x\" + hexData.substring(10)),\n errorFragment: fragment,\n name: fragment.name,\n signature: fragment.format(),\n sighash: this.getSighash(fragment),\n });\n }\n /*\n static from(value: Array | string | Interface) {\n if (Interface.isInterface(value)) {\n return value;\n }\n if (typeof(value) === \"string\") {\n return new Interface(JSON.parse(value));\n }\n return new Interface(value);\n }\n */\n static isInterface(value) {\n return !!(value && value._isInterface);\n }\n}\n//# sourceMappingURL=interface.js.map","export const version = \"abstract-provider/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { isHexString } from \"@ethersproject/bytes\";\nimport { Description, defineReadOnly, resolveProperties } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n;\n;\n//export type CallTransactionable = {\n// call(transaction: TransactionRequest): Promise;\n//};\nexport class ForkEvent extends Description {\n static isForkEvent(value) {\n return !!(value && value._isForkEvent);\n }\n}\nexport class BlockForkEvent extends ForkEvent {\n constructor(blockHash, expiry) {\n if (!isHexString(blockHash, 32)) {\n logger.throwArgumentError(\"invalid blockHash\", \"blockHash\", blockHash);\n }\n super({\n _isForkEvent: true,\n _isBlockForkEvent: true,\n expiry: (expiry || 0),\n blockHash: blockHash\n });\n }\n}\nexport class TransactionForkEvent extends ForkEvent {\n constructor(hash, expiry) {\n if (!isHexString(hash, 32)) {\n logger.throwArgumentError(\"invalid transaction hash\", \"hash\", hash);\n }\n super({\n _isForkEvent: true,\n _isTransactionForkEvent: true,\n expiry: (expiry || 0),\n hash: hash\n });\n }\n}\nexport class TransactionOrderForkEvent extends ForkEvent {\n constructor(beforeHash, afterHash, expiry) {\n if (!isHexString(beforeHash, 32)) {\n logger.throwArgumentError(\"invalid transaction hash\", \"beforeHash\", beforeHash);\n }\n if (!isHexString(afterHash, 32)) {\n logger.throwArgumentError(\"invalid transaction hash\", \"afterHash\", afterHash);\n }\n super({\n _isForkEvent: true,\n _isTransactionOrderForkEvent: true,\n expiry: (expiry || 0),\n beforeHash: beforeHash,\n afterHash: afterHash\n });\n }\n}\n///////////////////////////////\n// Exported Abstracts\nexport class Provider {\n constructor() {\n logger.checkAbstract(new.target, Provider);\n defineReadOnly(this, \"_isProvider\", true);\n }\n getFeeData() {\n return __awaiter(this, void 0, void 0, function* () {\n const { block, gasPrice } = yield resolveProperties({\n block: this.getBlock(\"latest\"),\n gasPrice: this.getGasPrice().catch((error) => {\n // @TODO: Why is this now failing on Calaveras?\n //console.log(error);\n return null;\n })\n });\n let lastBaseFeePerGas = null, maxFeePerGas = null, maxPriorityFeePerGas = null;\n if (block && block.baseFeePerGas) {\n // We may want to compute this more accurately in the future,\n // using the formula \"check if the base fee is correct\".\n // See: https://eips.ethereum.org/EIPS/eip-1559\n lastBaseFeePerGas = block.baseFeePerGas;\n maxPriorityFeePerGas = BigNumber.from(\"1500000000\");\n maxFeePerGas = block.baseFeePerGas.mul(2).add(maxPriorityFeePerGas);\n }\n return { lastBaseFeePerGas, maxFeePerGas, maxPriorityFeePerGas, gasPrice };\n });\n }\n // Alias for \"on\"\n addListener(eventName, listener) {\n return this.on(eventName, listener);\n }\n // Alias for \"off\"\n removeListener(eventName, listener) {\n return this.off(eventName, listener);\n }\n static isProvider(value) {\n return !!(value && value._isProvider);\n }\n}\n//# sourceMappingURL=index.js.map","export const version = \"abstract-signer/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { defineReadOnly, resolveProperties, shallowCopy } from \"@ethersproject/properties\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nconst allowedTransactionKeys = [\n \"accessList\", \"ccipReadEnabled\", \"chainId\", \"customData\", \"data\", \"from\", \"gasLimit\", \"gasPrice\", \"maxFeePerGas\", \"maxPriorityFeePerGas\", \"nonce\", \"to\", \"type\", \"value\"\n];\nconst forwardErrors = [\n Logger.errors.INSUFFICIENT_FUNDS,\n Logger.errors.NONCE_EXPIRED,\n Logger.errors.REPLACEMENT_UNDERPRICED,\n];\n;\n;\nexport class Signer {\n ///////////////////\n // Sub-classes MUST call super\n constructor() {\n logger.checkAbstract(new.target, Signer);\n defineReadOnly(this, \"_isSigner\", true);\n }\n ///////////////////\n // Sub-classes MAY override these\n getBalance(blockTag) {\n return __awaiter(this, void 0, void 0, function* () {\n this._checkProvider(\"getBalance\");\n return yield this.provider.getBalance(this.getAddress(), blockTag);\n });\n }\n getTransactionCount(blockTag) {\n return __awaiter(this, void 0, void 0, function* () {\n this._checkProvider(\"getTransactionCount\");\n return yield this.provider.getTransactionCount(this.getAddress(), blockTag);\n });\n }\n // Populates \"from\" if unspecified, and estimates the gas for the transaction\n estimateGas(transaction) {\n return __awaiter(this, void 0, void 0, function* () {\n this._checkProvider(\"estimateGas\");\n const tx = yield resolveProperties(this.checkTransaction(transaction));\n return yield this.provider.estimateGas(tx);\n });\n }\n // Populates \"from\" if unspecified, and calls with the transaction\n call(transaction, blockTag) {\n return __awaiter(this, void 0, void 0, function* () {\n this._checkProvider(\"call\");\n const tx = yield resolveProperties(this.checkTransaction(transaction));\n return yield this.provider.call(tx, blockTag);\n });\n }\n // Populates all fields in a transaction, signs it and sends it to the network\n sendTransaction(transaction) {\n return __awaiter(this, void 0, void 0, function* () {\n this._checkProvider(\"sendTransaction\");\n const tx = yield this.populateTransaction(transaction);\n const signedTx = yield this.signTransaction(tx);\n return yield this.provider.sendTransaction(signedTx);\n });\n }\n getChainId() {\n return __awaiter(this, void 0, void 0, function* () {\n this._checkProvider(\"getChainId\");\n const network = yield this.provider.getNetwork();\n return network.chainId;\n });\n }\n getGasPrice() {\n return __awaiter(this, void 0, void 0, function* () {\n this._checkProvider(\"getGasPrice\");\n return yield this.provider.getGasPrice();\n });\n }\n getFeeData() {\n return __awaiter(this, void 0, void 0, function* () {\n this._checkProvider(\"getFeeData\");\n return yield this.provider.getFeeData();\n });\n }\n resolveName(name) {\n return __awaiter(this, void 0, void 0, function* () {\n this._checkProvider(\"resolveName\");\n return yield this.provider.resolveName(name);\n });\n }\n // Checks a transaction does not contain invalid keys and if\n // no \"from\" is provided, populates it.\n // - does NOT require a provider\n // - adds \"from\" is not present\n // - returns a COPY (safe to mutate the result)\n // By default called from: (overriding these prevents it)\n // - call\n // - estimateGas\n // - populateTransaction (and therefor sendTransaction)\n checkTransaction(transaction) {\n for (const key in transaction) {\n if (allowedTransactionKeys.indexOf(key) === -1) {\n logger.throwArgumentError(\"invalid transaction key: \" + key, \"transaction\", transaction);\n }\n }\n const tx = shallowCopy(transaction);\n if (tx.from == null) {\n tx.from = this.getAddress();\n }\n else {\n // Make sure any provided address matches this signer\n tx.from = Promise.all([\n Promise.resolve(tx.from),\n this.getAddress()\n ]).then((result) => {\n if (result[0].toLowerCase() !== result[1].toLowerCase()) {\n logger.throwArgumentError(\"from address mismatch\", \"transaction\", transaction);\n }\n return result[0];\n });\n }\n return tx;\n }\n // Populates ALL keys for a transaction and checks that \"from\" matches\n // this Signer. Should be used by sendTransaction but NOT by signTransaction.\n // By default called from: (overriding these prevents it)\n // - sendTransaction\n //\n // Notes:\n // - We allow gasPrice for EIP-1559 as long as it matches maxFeePerGas\n populateTransaction(transaction) {\n return __awaiter(this, void 0, void 0, function* () {\n const tx = yield resolveProperties(this.checkTransaction(transaction));\n if (tx.to != null) {\n tx.to = Promise.resolve(tx.to).then((to) => __awaiter(this, void 0, void 0, function* () {\n if (to == null) {\n return null;\n }\n const address = yield this.resolveName(to);\n if (address == null) {\n logger.throwArgumentError(\"provided ENS name resolves to null\", \"tx.to\", to);\n }\n return address;\n }));\n // Prevent this error from causing an UnhandledPromiseException\n tx.to.catch((error) => { });\n }\n // Do not allow mixing pre-eip-1559 and eip-1559 properties\n const hasEip1559 = (tx.maxFeePerGas != null || tx.maxPriorityFeePerGas != null);\n if (tx.gasPrice != null && (tx.type === 2 || hasEip1559)) {\n logger.throwArgumentError(\"eip-1559 transaction do not support gasPrice\", \"transaction\", transaction);\n }\n else if ((tx.type === 0 || tx.type === 1) && hasEip1559) {\n logger.throwArgumentError(\"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas\", \"transaction\", transaction);\n }\n if ((tx.type === 2 || tx.type == null) && (tx.maxFeePerGas != null && tx.maxPriorityFeePerGas != null)) {\n // Fully-formed EIP-1559 transaction (skip getFeeData)\n tx.type = 2;\n }\n else if (tx.type === 0 || tx.type === 1) {\n // Explicit Legacy or EIP-2930 transaction\n // Populate missing gasPrice\n if (tx.gasPrice == null) {\n tx.gasPrice = this.getGasPrice();\n }\n }\n else {\n // We need to get fee data to determine things\n const feeData = yield this.getFeeData();\n if (tx.type == null) {\n // We need to auto-detect the intended type of this transaction...\n if (feeData.maxFeePerGas != null && feeData.maxPriorityFeePerGas != null) {\n // The network supports EIP-1559!\n // Upgrade transaction from null to eip-1559\n tx.type = 2;\n if (tx.gasPrice != null) {\n // Using legacy gasPrice property on an eip-1559 network,\n // so use gasPrice as both fee properties\n const gasPrice = tx.gasPrice;\n delete tx.gasPrice;\n tx.maxFeePerGas = gasPrice;\n tx.maxPriorityFeePerGas = gasPrice;\n }\n else {\n // Populate missing fee data\n if (tx.maxFeePerGas == null) {\n tx.maxFeePerGas = feeData.maxFeePerGas;\n }\n if (tx.maxPriorityFeePerGas == null) {\n tx.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas;\n }\n }\n }\n else if (feeData.gasPrice != null) {\n // Network doesn't support EIP-1559...\n // ...but they are trying to use EIP-1559 properties\n if (hasEip1559) {\n logger.throwError(\"network does not support EIP-1559\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"populateTransaction\"\n });\n }\n // Populate missing fee data\n if (tx.gasPrice == null) {\n tx.gasPrice = feeData.gasPrice;\n }\n // Explicitly set untyped transaction to legacy\n tx.type = 0;\n }\n else {\n // getFeeData has failed us.\n logger.throwError(\"failed to get consistent fee data\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"signer.getFeeData\"\n });\n }\n }\n else if (tx.type === 2) {\n // Explicitly using EIP-1559\n // Populate missing fee data\n if (tx.maxFeePerGas == null) {\n tx.maxFeePerGas = feeData.maxFeePerGas;\n }\n if (tx.maxPriorityFeePerGas == null) {\n tx.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas;\n }\n }\n }\n if (tx.nonce == null) {\n tx.nonce = this.getTransactionCount(\"pending\");\n }\n if (tx.gasLimit == null) {\n tx.gasLimit = this.estimateGas(tx).catch((error) => {\n if (forwardErrors.indexOf(error.code) >= 0) {\n throw error;\n }\n return logger.throwError(\"cannot estimate gas; transaction may fail or may require manual gas limit\", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {\n error: error,\n tx: tx\n });\n });\n }\n if (tx.chainId == null) {\n tx.chainId = this.getChainId();\n }\n else {\n tx.chainId = Promise.all([\n Promise.resolve(tx.chainId),\n this.getChainId()\n ]).then((results) => {\n if (results[1] !== 0 && results[0] !== results[1]) {\n logger.throwArgumentError(\"chainId address mismatch\", \"transaction\", transaction);\n }\n return results[0];\n });\n }\n return yield resolveProperties(tx);\n });\n }\n ///////////////////\n // Sub-classes SHOULD leave these alone\n _checkProvider(operation) {\n if (!this.provider) {\n logger.throwError(\"missing provider\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: (operation || \"_checkProvider\")\n });\n }\n }\n static isSigner(value) {\n return !!(value && value._isSigner);\n }\n}\nexport class VoidSigner extends Signer {\n constructor(address, provider) {\n super();\n defineReadOnly(this, \"address\", address);\n defineReadOnly(this, \"provider\", provider || null);\n }\n getAddress() {\n return Promise.resolve(this.address);\n }\n _fail(message, operation) {\n return Promise.resolve().then(() => {\n logger.throwError(message, Logger.errors.UNSUPPORTED_OPERATION, { operation: operation });\n });\n }\n signMessage(message) {\n return this._fail(\"VoidSigner cannot sign messages\", \"signMessage\");\n }\n signTransaction(transaction) {\n return this._fail(\"VoidSigner cannot sign transactions\", \"signTransaction\");\n }\n _signTypedData(domain, types, value) {\n return this._fail(\"VoidSigner cannot sign typed data\", \"signTypedData\");\n }\n connect(provider) {\n return new VoidSigner(this.address, provider);\n }\n}\n//# sourceMappingURL=index.js.map","export const version = \"transactions/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nimport { getAddress } from \"@ethersproject/address\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { arrayify, hexConcat, hexDataLength, hexDataSlice, hexlify, hexZeroPad, isBytesLike, splitSignature, stripZeros, } from \"@ethersproject/bytes\";\nimport { Zero } from \"@ethersproject/constants\";\nimport { keccak256 } from \"@ethersproject/keccak256\";\nimport { checkProperties } from \"@ethersproject/properties\";\nimport * as RLP from \"@ethersproject/rlp\";\nimport { computePublicKey, recoverPublicKey } from \"@ethersproject/signing-key\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\nexport var TransactionTypes;\n(function (TransactionTypes) {\n TransactionTypes[TransactionTypes[\"legacy\"] = 0] = \"legacy\";\n TransactionTypes[TransactionTypes[\"eip2930\"] = 1] = \"eip2930\";\n TransactionTypes[TransactionTypes[\"eip1559\"] = 2] = \"eip1559\";\n})(TransactionTypes || (TransactionTypes = {}));\n;\n///////////////////////////////\nfunction handleAddress(value) {\n if (value === \"0x\") {\n return null;\n }\n return getAddress(value);\n}\nfunction handleNumber(value) {\n if (value === \"0x\") {\n return Zero;\n }\n return BigNumber.from(value);\n}\n// Legacy Transaction Fields\nconst transactionFields = [\n { name: \"nonce\", maxLength: 32, numeric: true },\n { name: \"gasPrice\", maxLength: 32, numeric: true },\n { name: \"gasLimit\", maxLength: 32, numeric: true },\n { name: \"to\", length: 20 },\n { name: \"value\", maxLength: 32, numeric: true },\n { name: \"data\" },\n];\nconst allowedTransactionKeys = {\n chainId: true, data: true, gasLimit: true, gasPrice: true, nonce: true, to: true, type: true, value: true\n};\nexport function computeAddress(key) {\n const publicKey = computePublicKey(key);\n return getAddress(hexDataSlice(keccak256(hexDataSlice(publicKey, 1)), 12));\n}\nexport function recoverAddress(digest, signature) {\n return computeAddress(recoverPublicKey(arrayify(digest), signature));\n}\nfunction formatNumber(value, name) {\n const result = stripZeros(BigNumber.from(value).toHexString());\n if (result.length > 32) {\n logger.throwArgumentError(\"invalid length for \" + name, (\"transaction:\" + name), value);\n }\n return result;\n}\nfunction accessSetify(addr, storageKeys) {\n return {\n address: getAddress(addr),\n storageKeys: (storageKeys || []).map((storageKey, index) => {\n if (hexDataLength(storageKey) !== 32) {\n logger.throwArgumentError(\"invalid access list storageKey\", `accessList[${addr}:${index}]`, storageKey);\n }\n return storageKey.toLowerCase();\n })\n };\n}\nexport function accessListify(value) {\n if (Array.isArray(value)) {\n return value.map((set, index) => {\n if (Array.isArray(set)) {\n if (set.length > 2) {\n logger.throwArgumentError(\"access list expected to be [ address, storageKeys[] ]\", `value[${index}]`, set);\n }\n return accessSetify(set[0], set[1]);\n }\n return accessSetify(set.address, set.storageKeys);\n });\n }\n const result = Object.keys(value).map((addr) => {\n const storageKeys = value[addr].reduce((accum, storageKey) => {\n accum[storageKey] = true;\n return accum;\n }, {});\n return accessSetify(addr, Object.keys(storageKeys).sort());\n });\n result.sort((a, b) => (a.address.localeCompare(b.address)));\n return result;\n}\nfunction formatAccessList(value) {\n return accessListify(value).map((set) => [set.address, set.storageKeys]);\n}\nfunction _serializeEip1559(transaction, signature) {\n // If there is an explicit gasPrice, make sure it matches the\n // EIP-1559 fees; otherwise they may not understand what they\n // think they are setting in terms of fee.\n if (transaction.gasPrice != null) {\n const gasPrice = BigNumber.from(transaction.gasPrice);\n const maxFeePerGas = BigNumber.from(transaction.maxFeePerGas || 0);\n if (!gasPrice.eq(maxFeePerGas)) {\n logger.throwArgumentError(\"mismatch EIP-1559 gasPrice != maxFeePerGas\", \"tx\", {\n gasPrice, maxFeePerGas\n });\n }\n }\n const fields = [\n formatNumber(transaction.chainId || 0, \"chainId\"),\n formatNumber(transaction.nonce || 0, \"nonce\"),\n formatNumber(transaction.maxPriorityFeePerGas || 0, \"maxPriorityFeePerGas\"),\n formatNumber(transaction.maxFeePerGas || 0, \"maxFeePerGas\"),\n formatNumber(transaction.gasLimit || 0, \"gasLimit\"),\n ((transaction.to != null) ? getAddress(transaction.to) : \"0x\"),\n formatNumber(transaction.value || 0, \"value\"),\n (transaction.data || \"0x\"),\n (formatAccessList(transaction.accessList || []))\n ];\n if (signature) {\n const sig = splitSignature(signature);\n fields.push(formatNumber(sig.recoveryParam, \"recoveryParam\"));\n fields.push(stripZeros(sig.r));\n fields.push(stripZeros(sig.s));\n }\n return hexConcat([\"0x02\", RLP.encode(fields)]);\n}\nfunction _serializeEip2930(transaction, signature) {\n const fields = [\n formatNumber(transaction.chainId || 0, \"chainId\"),\n formatNumber(transaction.nonce || 0, \"nonce\"),\n formatNumber(transaction.gasPrice || 0, \"gasPrice\"),\n formatNumber(transaction.gasLimit || 0, \"gasLimit\"),\n ((transaction.to != null) ? getAddress(transaction.to) : \"0x\"),\n formatNumber(transaction.value || 0, \"value\"),\n (transaction.data || \"0x\"),\n (formatAccessList(transaction.accessList || []))\n ];\n if (signature) {\n const sig = splitSignature(signature);\n fields.push(formatNumber(sig.recoveryParam, \"recoveryParam\"));\n fields.push(stripZeros(sig.r));\n fields.push(stripZeros(sig.s));\n }\n return hexConcat([\"0x01\", RLP.encode(fields)]);\n}\n// Legacy Transactions and EIP-155\nfunction _serialize(transaction, signature) {\n checkProperties(transaction, allowedTransactionKeys);\n const raw = [];\n transactionFields.forEach(function (fieldInfo) {\n let value = transaction[fieldInfo.name] || ([]);\n const options = {};\n if (fieldInfo.numeric) {\n options.hexPad = \"left\";\n }\n value = arrayify(hexlify(value, options));\n // Fixed-width field\n if (fieldInfo.length && value.length !== fieldInfo.length && value.length > 0) {\n logger.throwArgumentError(\"invalid length for \" + fieldInfo.name, (\"transaction:\" + fieldInfo.name), value);\n }\n // Variable-width (with a maximum)\n if (fieldInfo.maxLength) {\n value = stripZeros(value);\n if (value.length > fieldInfo.maxLength) {\n logger.throwArgumentError(\"invalid length for \" + fieldInfo.name, (\"transaction:\" + fieldInfo.name), value);\n }\n }\n raw.push(hexlify(value));\n });\n let chainId = 0;\n if (transaction.chainId != null) {\n // A chainId was provided; if non-zero we'll use EIP-155\n chainId = transaction.chainId;\n if (typeof (chainId) !== \"number\") {\n logger.throwArgumentError(\"invalid transaction.chainId\", \"transaction\", transaction);\n }\n }\n else if (signature && !isBytesLike(signature) && signature.v > 28) {\n // No chainId provided, but the signature is signing with EIP-155; derive chainId\n chainId = Math.floor((signature.v - 35) / 2);\n }\n // We have an EIP-155 transaction (chainId was specified and non-zero)\n if (chainId !== 0) {\n raw.push(hexlify(chainId)); // @TODO: hexValue?\n raw.push(\"0x\");\n raw.push(\"0x\");\n }\n // Requesting an unsigned transaction\n if (!signature) {\n return RLP.encode(raw);\n }\n // The splitSignature will ensure the transaction has a recoveryParam in the\n // case that the signTransaction function only adds a v.\n const sig = splitSignature(signature);\n // We pushed a chainId and null r, s on for hashing only; remove those\n let v = 27 + sig.recoveryParam;\n if (chainId !== 0) {\n raw.pop();\n raw.pop();\n raw.pop();\n v += chainId * 2 + 8;\n // If an EIP-155 v (directly or indirectly; maybe _vs) was provided, check it!\n if (sig.v > 28 && sig.v !== v) {\n logger.throwArgumentError(\"transaction.chainId/signature.v mismatch\", \"signature\", signature);\n }\n }\n else if (sig.v !== v) {\n logger.throwArgumentError(\"transaction.chainId/signature.v mismatch\", \"signature\", signature);\n }\n raw.push(hexlify(v));\n raw.push(stripZeros(arrayify(sig.r)));\n raw.push(stripZeros(arrayify(sig.s)));\n return RLP.encode(raw);\n}\nexport function serialize(transaction, signature) {\n // Legacy and EIP-155 Transactions\n if (transaction.type == null || transaction.type === 0) {\n if (transaction.accessList != null) {\n logger.throwArgumentError(\"untyped transactions do not support accessList; include type: 1\", \"transaction\", transaction);\n }\n return _serialize(transaction, signature);\n }\n // Typed Transactions (EIP-2718)\n switch (transaction.type) {\n case 1:\n return _serializeEip2930(transaction, signature);\n case 2:\n return _serializeEip1559(transaction, signature);\n default:\n break;\n }\n return logger.throwError(`unsupported transaction type: ${transaction.type}`, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"serializeTransaction\",\n transactionType: transaction.type\n });\n}\nfunction _parseEipSignature(tx, fields, serialize) {\n try {\n const recid = handleNumber(fields[0]).toNumber();\n if (recid !== 0 && recid !== 1) {\n throw new Error(\"bad recid\");\n }\n tx.v = recid;\n }\n catch (error) {\n logger.throwArgumentError(\"invalid v for transaction type: 1\", \"v\", fields[0]);\n }\n tx.r = hexZeroPad(fields[1], 32);\n tx.s = hexZeroPad(fields[2], 32);\n try {\n const digest = keccak256(serialize(tx));\n tx.from = recoverAddress(digest, { r: tx.r, s: tx.s, recoveryParam: tx.v });\n }\n catch (error) { }\n}\nfunction _parseEip1559(payload) {\n const transaction = RLP.decode(payload.slice(1));\n if (transaction.length !== 9 && transaction.length !== 12) {\n logger.throwArgumentError(\"invalid component count for transaction type: 2\", \"payload\", hexlify(payload));\n }\n const maxPriorityFeePerGas = handleNumber(transaction[2]);\n const maxFeePerGas = handleNumber(transaction[3]);\n const tx = {\n type: 2,\n chainId: handleNumber(transaction[0]).toNumber(),\n nonce: handleNumber(transaction[1]).toNumber(),\n maxPriorityFeePerGas: maxPriorityFeePerGas,\n maxFeePerGas: maxFeePerGas,\n gasPrice: null,\n gasLimit: handleNumber(transaction[4]),\n to: handleAddress(transaction[5]),\n value: handleNumber(transaction[6]),\n data: transaction[7],\n accessList: accessListify(transaction[8]),\n };\n // Unsigned EIP-1559 Transaction\n if (transaction.length === 9) {\n return tx;\n }\n tx.hash = keccak256(payload);\n _parseEipSignature(tx, transaction.slice(9), _serializeEip1559);\n return tx;\n}\nfunction _parseEip2930(payload) {\n const transaction = RLP.decode(payload.slice(1));\n if (transaction.length !== 8 && transaction.length !== 11) {\n logger.throwArgumentError(\"invalid component count for transaction type: 1\", \"payload\", hexlify(payload));\n }\n const tx = {\n type: 1,\n chainId: handleNumber(transaction[0]).toNumber(),\n nonce: handleNumber(transaction[1]).toNumber(),\n gasPrice: handleNumber(transaction[2]),\n gasLimit: handleNumber(transaction[3]),\n to: handleAddress(transaction[4]),\n value: handleNumber(transaction[5]),\n data: transaction[6],\n accessList: accessListify(transaction[7])\n };\n // Unsigned EIP-2930 Transaction\n if (transaction.length === 8) {\n return tx;\n }\n tx.hash = keccak256(payload);\n _parseEipSignature(tx, transaction.slice(8), _serializeEip2930);\n return tx;\n}\n// Legacy Transactions and EIP-155\nfunction _parse(rawTransaction) {\n const transaction = RLP.decode(rawTransaction);\n if (transaction.length !== 9 && transaction.length !== 6) {\n logger.throwArgumentError(\"invalid raw transaction\", \"rawTransaction\", rawTransaction);\n }\n const tx = {\n nonce: handleNumber(transaction[0]).toNumber(),\n gasPrice: handleNumber(transaction[1]),\n gasLimit: handleNumber(transaction[2]),\n to: handleAddress(transaction[3]),\n value: handleNumber(transaction[4]),\n data: transaction[5],\n chainId: 0\n };\n // Legacy unsigned transaction\n if (transaction.length === 6) {\n return tx;\n }\n try {\n tx.v = BigNumber.from(transaction[6]).toNumber();\n }\n catch (error) {\n // @TODO: What makes snese to do? The v is too big\n return tx;\n }\n tx.r = hexZeroPad(transaction[7], 32);\n tx.s = hexZeroPad(transaction[8], 32);\n if (BigNumber.from(tx.r).isZero() && BigNumber.from(tx.s).isZero()) {\n // EIP-155 unsigned transaction\n tx.chainId = tx.v;\n tx.v = 0;\n }\n else {\n // Signed Transaction\n tx.chainId = Math.floor((tx.v - 35) / 2);\n if (tx.chainId < 0) {\n tx.chainId = 0;\n }\n let recoveryParam = tx.v - 27;\n const raw = transaction.slice(0, 6);\n if (tx.chainId !== 0) {\n raw.push(hexlify(tx.chainId));\n raw.push(\"0x\");\n raw.push(\"0x\");\n recoveryParam -= tx.chainId * 2 + 8;\n }\n const digest = keccak256(RLP.encode(raw));\n try {\n tx.from = recoverAddress(digest, { r: hexlify(tx.r), s: hexlify(tx.s), recoveryParam: recoveryParam });\n }\n catch (error) { }\n tx.hash = keccak256(rawTransaction);\n }\n tx.type = null;\n return tx;\n}\nexport function parse(rawTransaction) {\n const payload = arrayify(rawTransaction);\n // Legacy and EIP-155 Transactions\n if (payload[0] > 0x7f) {\n return _parse(payload);\n }\n // Typed Transaction (EIP-2718)\n switch (payload[0]) {\n case 1:\n return _parseEip2930(payload);\n case 2:\n return _parseEip1559(payload);\n default:\n break;\n }\n return logger.throwError(`unsupported transaction type: ${payload[0]}`, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"parseTransaction\",\n transactionType: payload[0]\n });\n}\n//# sourceMappingURL=index.js.map","export const version = \"contracts/5.7.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { checkResultErrors, Indexed, Interface } from \"@ethersproject/abi\";\nimport { Provider } from \"@ethersproject/abstract-provider\";\nimport { Signer, VoidSigner } from \"@ethersproject/abstract-signer\";\nimport { getAddress, getContractAddress } from \"@ethersproject/address\";\nimport { BigNumber } from \"@ethersproject/bignumber\";\nimport { arrayify, concat, hexlify, isBytes, isHexString } from \"@ethersproject/bytes\";\nimport { defineReadOnly, deepCopy, getStatic, resolveProperties, shallowCopy } from \"@ethersproject/properties\";\nimport { accessListify } from \"@ethersproject/transactions\";\nimport { Logger } from \"@ethersproject/logger\";\nimport { version } from \"./_version\";\nconst logger = new Logger(version);\n;\n;\n///////////////////////////////\nconst allowedTransactionKeys = {\n chainId: true, data: true, from: true, gasLimit: true, gasPrice: true, nonce: true, to: true, value: true,\n type: true, accessList: true,\n maxFeePerGas: true, maxPriorityFeePerGas: true,\n customData: true,\n ccipReadEnabled: true\n};\nfunction resolveName(resolver, nameOrPromise) {\n return __awaiter(this, void 0, void 0, function* () {\n const name = yield nameOrPromise;\n if (typeof (name) !== \"string\") {\n logger.throwArgumentError(\"invalid address or ENS name\", \"name\", name);\n }\n // If it is already an address, just use it (after adding checksum)\n try {\n return getAddress(name);\n }\n catch (error) { }\n if (!resolver) {\n logger.throwError(\"a provider or signer is needed to resolve ENS names\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"resolveName\"\n });\n }\n const address = yield resolver.resolveName(name);\n if (address == null) {\n logger.throwArgumentError(\"resolver or addr is not configured for ENS name\", \"name\", name);\n }\n return address;\n });\n}\n// Recursively replaces ENS names with promises to resolve the name and resolves all properties\nfunction resolveAddresses(resolver, value, paramType) {\n return __awaiter(this, void 0, void 0, function* () {\n if (Array.isArray(paramType)) {\n return yield Promise.all(paramType.map((paramType, index) => {\n return resolveAddresses(resolver, ((Array.isArray(value)) ? value[index] : value[paramType.name]), paramType);\n }));\n }\n if (paramType.type === \"address\") {\n return yield resolveName(resolver, value);\n }\n if (paramType.type === \"tuple\") {\n return yield resolveAddresses(resolver, value, paramType.components);\n }\n if (paramType.baseType === \"array\") {\n if (!Array.isArray(value)) {\n return Promise.reject(logger.makeError(\"invalid value for array\", Logger.errors.INVALID_ARGUMENT, {\n argument: \"value\",\n value\n }));\n }\n return yield Promise.all(value.map((v) => resolveAddresses(resolver, v, paramType.arrayChildren)));\n }\n return value;\n });\n}\nfunction populateTransaction(contract, fragment, args) {\n return __awaiter(this, void 0, void 0, function* () {\n // If an extra argument is given, it is overrides\n let overrides = {};\n if (args.length === fragment.inputs.length + 1 && typeof (args[args.length - 1]) === \"object\") {\n overrides = shallowCopy(args.pop());\n }\n // Make sure the parameter count matches\n logger.checkArgumentCount(args.length, fragment.inputs.length, \"passed to contract\");\n // Populate \"from\" override (allow promises)\n if (contract.signer) {\n if (overrides.from) {\n // Contracts with a Signer are from the Signer's frame-of-reference;\n // but we allow overriding \"from\" if it matches the signer\n overrides.from = resolveProperties({\n override: resolveName(contract.signer, overrides.from),\n signer: contract.signer.getAddress()\n }).then((check) => __awaiter(this, void 0, void 0, function* () {\n if (getAddress(check.signer) !== check.override) {\n logger.throwError(\"Contract with a Signer cannot override from\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"overrides.from\"\n });\n }\n return check.override;\n }));\n }\n else {\n overrides.from = contract.signer.getAddress();\n }\n }\n else if (overrides.from) {\n overrides.from = resolveName(contract.provider, overrides.from);\n //} else {\n // Contracts without a signer can override \"from\", and if\n // unspecified the zero address is used\n //overrides.from = AddressZero;\n }\n // Wait for all dependencies to be resolved (prefer the signer over the provider)\n const resolved = yield resolveProperties({\n args: resolveAddresses(contract.signer || contract.provider, args, fragment.inputs),\n address: contract.resolvedAddress,\n overrides: (resolveProperties(overrides) || {})\n });\n // The ABI coded transaction\n const data = contract.interface.encodeFunctionData(fragment, resolved.args);\n const tx = {\n data: data,\n to: resolved.address\n };\n // Resolved Overrides\n const ro = resolved.overrides;\n // Populate simple overrides\n if (ro.nonce != null) {\n tx.nonce = BigNumber.from(ro.nonce).toNumber();\n }\n if (ro.gasLimit != null) {\n tx.gasLimit = BigNumber.from(ro.gasLimit);\n }\n if (ro.gasPrice != null) {\n tx.gasPrice = BigNumber.from(ro.gasPrice);\n }\n if (ro.maxFeePerGas != null) {\n tx.maxFeePerGas = BigNumber.from(ro.maxFeePerGas);\n }\n if (ro.maxPriorityFeePerGas != null) {\n tx.maxPriorityFeePerGas = BigNumber.from(ro.maxPriorityFeePerGas);\n }\n if (ro.from != null) {\n tx.from = ro.from;\n }\n if (ro.type != null) {\n tx.type = ro.type;\n }\n if (ro.accessList != null) {\n tx.accessList = accessListify(ro.accessList);\n }\n // If there was no \"gasLimit\" override, but the ABI specifies a default, use it\n if (tx.gasLimit == null && fragment.gas != null) {\n // Compute the intrinsic gas cost for this transaction\n // @TODO: This is based on the yellow paper as of Petersburg; this is something\n // we may wish to parameterize in v6 as part of the Network object. Since this\n // is always a non-nil to address, we can ignore G_create, but may wish to add\n // similar logic to the ContractFactory.\n let intrinsic = 21000;\n const bytes = arrayify(data);\n for (let i = 0; i < bytes.length; i++) {\n intrinsic += 4;\n if (bytes[i]) {\n intrinsic += 64;\n }\n }\n tx.gasLimit = BigNumber.from(fragment.gas).add(intrinsic);\n }\n // Populate \"value\" override\n if (ro.value) {\n const roValue = BigNumber.from(ro.value);\n if (!roValue.isZero() && !fragment.payable) {\n logger.throwError(\"non-payable method cannot override value\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"overrides.value\",\n value: overrides.value\n });\n }\n tx.value = roValue;\n }\n if (ro.customData) {\n tx.customData = shallowCopy(ro.customData);\n }\n if (ro.ccipReadEnabled) {\n tx.ccipReadEnabled = !!ro.ccipReadEnabled;\n }\n // Remove the overrides\n delete overrides.nonce;\n delete overrides.gasLimit;\n delete overrides.gasPrice;\n delete overrides.from;\n delete overrides.value;\n delete overrides.type;\n delete overrides.accessList;\n delete overrides.maxFeePerGas;\n delete overrides.maxPriorityFeePerGas;\n delete overrides.customData;\n delete overrides.ccipReadEnabled;\n // Make sure there are no stray overrides, which may indicate a\n // typo or using an unsupported key.\n const leftovers = Object.keys(overrides).filter((key) => (overrides[key] != null));\n if (leftovers.length) {\n logger.throwError(`cannot override ${leftovers.map((l) => JSON.stringify(l)).join(\",\")}`, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"overrides\",\n overrides: leftovers\n });\n }\n return tx;\n });\n}\nfunction buildPopulate(contract, fragment) {\n return function (...args) {\n return populateTransaction(contract, fragment, args);\n };\n}\nfunction buildEstimate(contract, fragment) {\n const signerOrProvider = (contract.signer || contract.provider);\n return function (...args) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!signerOrProvider) {\n logger.throwError(\"estimate require a provider or signer\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"estimateGas\"\n });\n }\n const tx = yield populateTransaction(contract, fragment, args);\n return yield signerOrProvider.estimateGas(tx);\n });\n };\n}\nfunction addContractWait(contract, tx) {\n const wait = tx.wait.bind(tx);\n tx.wait = (confirmations) => {\n return wait(confirmations).then((receipt) => {\n receipt.events = receipt.logs.map((log) => {\n let event = deepCopy(log);\n let parsed = null;\n try {\n parsed = contract.interface.parseLog(log);\n }\n catch (e) { }\n // Successfully parsed the event log; include it\n if (parsed) {\n event.args = parsed.args;\n event.decode = (data, topics) => {\n return contract.interface.decodeEventLog(parsed.eventFragment, data, topics);\n };\n event.event = parsed.name;\n event.eventSignature = parsed.signature;\n }\n // Useful operations\n event.removeListener = () => { return contract.provider; };\n event.getBlock = () => {\n return contract.provider.getBlock(receipt.blockHash);\n };\n event.getTransaction = () => {\n return contract.provider.getTransaction(receipt.transactionHash);\n };\n event.getTransactionReceipt = () => {\n return Promise.resolve(receipt);\n };\n return event;\n });\n return receipt;\n });\n };\n}\nfunction buildCall(contract, fragment, collapseSimple) {\n const signerOrProvider = (contract.signer || contract.provider);\n return function (...args) {\n return __awaiter(this, void 0, void 0, function* () {\n // Extract the \"blockTag\" override if present\n let blockTag = undefined;\n if (args.length === fragment.inputs.length + 1 && typeof (args[args.length - 1]) === \"object\") {\n const overrides = shallowCopy(args.pop());\n if (overrides.blockTag != null) {\n blockTag = yield overrides.blockTag;\n }\n delete overrides.blockTag;\n args.push(overrides);\n }\n // If the contract was just deployed, wait until it is mined\n if (contract.deployTransaction != null) {\n yield contract._deployed(blockTag);\n }\n // Call a node and get the result\n const tx = yield populateTransaction(contract, fragment, args);\n const result = yield signerOrProvider.call(tx, blockTag);\n try {\n let value = contract.interface.decodeFunctionResult(fragment, result);\n if (collapseSimple && fragment.outputs.length === 1) {\n value = value[0];\n }\n return value;\n }\n catch (error) {\n if (error.code === Logger.errors.CALL_EXCEPTION) {\n error.address = contract.address;\n error.args = args;\n error.transaction = tx;\n }\n throw error;\n }\n });\n };\n}\nfunction buildSend(contract, fragment) {\n return function (...args) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!contract.signer) {\n logger.throwError(\"sending a transaction requires a signer\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"sendTransaction\"\n });\n }\n // If the contract was just deployed, wait until it is mined\n if (contract.deployTransaction != null) {\n yield contract._deployed();\n }\n const txRequest = yield populateTransaction(contract, fragment, args);\n const tx = yield contract.signer.sendTransaction(txRequest);\n // Tweak the tx.wait so the receipt has extra properties\n addContractWait(contract, tx);\n return tx;\n });\n };\n}\nfunction buildDefault(contract, fragment, collapseSimple) {\n if (fragment.constant) {\n return buildCall(contract, fragment, collapseSimple);\n }\n return buildSend(contract, fragment);\n}\nfunction getEventTag(filter) {\n if (filter.address && (filter.topics == null || filter.topics.length === 0)) {\n return \"*\";\n }\n return (filter.address || \"*\") + \"@\" + (filter.topics ? filter.topics.map((topic) => {\n if (Array.isArray(topic)) {\n return topic.join(\"|\");\n }\n return topic;\n }).join(\":\") : \"\");\n}\nclass RunningEvent {\n constructor(tag, filter) {\n defineReadOnly(this, \"tag\", tag);\n defineReadOnly(this, \"filter\", filter);\n this._listeners = [];\n }\n addListener(listener, once) {\n this._listeners.push({ listener: listener, once: once });\n }\n removeListener(listener) {\n let done = false;\n this._listeners = this._listeners.filter((item) => {\n if (done || item.listener !== listener) {\n return true;\n }\n done = true;\n return false;\n });\n }\n removeAllListeners() {\n this._listeners = [];\n }\n listeners() {\n return this._listeners.map((i) => i.listener);\n }\n listenerCount() {\n return this._listeners.length;\n }\n run(args) {\n const listenerCount = this.listenerCount();\n this._listeners = this._listeners.filter((item) => {\n const argsCopy = args.slice();\n // Call the callback in the next event loop\n setTimeout(() => {\n item.listener.apply(this, argsCopy);\n }, 0);\n // Reschedule it if it not \"once\"\n return !(item.once);\n });\n return listenerCount;\n }\n prepareEvent(event) {\n }\n // Returns the array that will be applied to an emit\n getEmit(event) {\n return [event];\n }\n}\nclass ErrorRunningEvent extends RunningEvent {\n constructor() {\n super(\"error\", null);\n }\n}\n// @TODO Fragment should inherit Wildcard? and just override getEmit?\n// or have a common abstract super class, with enough constructor\n// options to configure both.\n// A Fragment Event will populate all the properties that Wildcard\n// will, and additionally dereference the arguments when emitting\nclass FragmentRunningEvent extends RunningEvent {\n constructor(address, contractInterface, fragment, topics) {\n const filter = {\n address: address\n };\n let topic = contractInterface.getEventTopic(fragment);\n if (topics) {\n if (topic !== topics[0]) {\n logger.throwArgumentError(\"topic mismatch\", \"topics\", topics);\n }\n filter.topics = topics.slice();\n }\n else {\n filter.topics = [topic];\n }\n super(getEventTag(filter), filter);\n defineReadOnly(this, \"address\", address);\n defineReadOnly(this, \"interface\", contractInterface);\n defineReadOnly(this, \"fragment\", fragment);\n }\n prepareEvent(event) {\n super.prepareEvent(event);\n event.event = this.fragment.name;\n event.eventSignature = this.fragment.format();\n event.decode = (data, topics) => {\n return this.interface.decodeEventLog(this.fragment, data, topics);\n };\n try {\n event.args = this.interface.decodeEventLog(this.fragment, event.data, event.topics);\n }\n catch (error) {\n event.args = null;\n event.decodeError = error;\n }\n }\n getEmit(event) {\n const errors = checkResultErrors(event.args);\n if (errors.length) {\n throw errors[0].error;\n }\n const args = (event.args || []).slice();\n args.push(event);\n return args;\n }\n}\n// A Wildcard Event will attempt to populate:\n// - event The name of the event name\n// - eventSignature The full signature of the event\n// - decode A function to decode data and topics\n// - args The decoded data and topics\nclass WildcardRunningEvent extends RunningEvent {\n constructor(address, contractInterface) {\n super(\"*\", { address: address });\n defineReadOnly(this, \"address\", address);\n defineReadOnly(this, \"interface\", contractInterface);\n }\n prepareEvent(event) {\n super.prepareEvent(event);\n try {\n const parsed = this.interface.parseLog(event);\n event.event = parsed.name;\n event.eventSignature = parsed.signature;\n event.decode = (data, topics) => {\n return this.interface.decodeEventLog(parsed.eventFragment, data, topics);\n };\n event.args = parsed.args;\n }\n catch (error) {\n // No matching event\n }\n }\n}\nexport class BaseContract {\n constructor(addressOrName, contractInterface, signerOrProvider) {\n // @TODO: Maybe still check the addressOrName looks like a valid address or name?\n //address = getAddress(address);\n defineReadOnly(this, \"interface\", getStatic(new.target, \"getInterface\")(contractInterface));\n if (signerOrProvider == null) {\n defineReadOnly(this, \"provider\", null);\n defineReadOnly(this, \"signer\", null);\n }\n else if (Signer.isSigner(signerOrProvider)) {\n defineReadOnly(this, \"provider\", signerOrProvider.provider || null);\n defineReadOnly(this, \"signer\", signerOrProvider);\n }\n else if (Provider.isProvider(signerOrProvider)) {\n defineReadOnly(this, \"provider\", signerOrProvider);\n defineReadOnly(this, \"signer\", null);\n }\n else {\n logger.throwArgumentError(\"invalid signer or provider\", \"signerOrProvider\", signerOrProvider);\n }\n defineReadOnly(this, \"callStatic\", {});\n defineReadOnly(this, \"estimateGas\", {});\n defineReadOnly(this, \"functions\", {});\n defineReadOnly(this, \"populateTransaction\", {});\n defineReadOnly(this, \"filters\", {});\n {\n const uniqueFilters = {};\n Object.keys(this.interface.events).forEach((eventSignature) => {\n const event = this.interface.events[eventSignature];\n defineReadOnly(this.filters, eventSignature, (...args) => {\n return {\n address: this.address,\n topics: this.interface.encodeFilterTopics(event, args)\n };\n });\n if (!uniqueFilters[event.name]) {\n uniqueFilters[event.name] = [];\n }\n uniqueFilters[event.name].push(eventSignature);\n });\n Object.keys(uniqueFilters).forEach((name) => {\n const filters = uniqueFilters[name];\n if (filters.length === 1) {\n defineReadOnly(this.filters, name, this.filters[filters[0]]);\n }\n else {\n logger.warn(`Duplicate definition of ${name} (${filters.join(\", \")})`);\n }\n });\n }\n defineReadOnly(this, \"_runningEvents\", {});\n defineReadOnly(this, \"_wrappedEmits\", {});\n if (addressOrName == null) {\n logger.throwArgumentError(\"invalid contract address or ENS name\", \"addressOrName\", addressOrName);\n }\n defineReadOnly(this, \"address\", addressOrName);\n if (this.provider) {\n defineReadOnly(this, \"resolvedAddress\", resolveName(this.provider, addressOrName));\n }\n else {\n try {\n defineReadOnly(this, \"resolvedAddress\", Promise.resolve(getAddress(addressOrName)));\n }\n catch (error) {\n // Without a provider, we cannot use ENS names\n logger.throwError(\"provider is required to use ENS name as contract address\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"new Contract\"\n });\n }\n }\n // Swallow bad ENS names to prevent Unhandled Exceptions\n this.resolvedAddress.catch((e) => { });\n const uniqueNames = {};\n const uniqueSignatures = {};\n Object.keys(this.interface.functions).forEach((signature) => {\n const fragment = this.interface.functions[signature];\n // Check that the signature is unique; if not the ABI generation has\n // not been cleaned or may be incorrectly generated\n if (uniqueSignatures[signature]) {\n logger.warn(`Duplicate ABI entry for ${JSON.stringify(signature)}`);\n return;\n }\n uniqueSignatures[signature] = true;\n // Track unique names; we only expose bare named functions if they\n // are ambiguous\n {\n const name = fragment.name;\n if (!uniqueNames[`%${name}`]) {\n uniqueNames[`%${name}`] = [];\n }\n uniqueNames[`%${name}`].push(signature);\n }\n if (this[signature] == null) {\n defineReadOnly(this, signature, buildDefault(this, fragment, true));\n }\n // We do not collapse simple calls on this bucket, which allows\n // frameworks to safely use this without introspection as well as\n // allows decoding error recovery.\n if (this.functions[signature] == null) {\n defineReadOnly(this.functions, signature, buildDefault(this, fragment, false));\n }\n if (this.callStatic[signature] == null) {\n defineReadOnly(this.callStatic, signature, buildCall(this, fragment, true));\n }\n if (this.populateTransaction[signature] == null) {\n defineReadOnly(this.populateTransaction, signature, buildPopulate(this, fragment));\n }\n if (this.estimateGas[signature] == null) {\n defineReadOnly(this.estimateGas, signature, buildEstimate(this, fragment));\n }\n });\n Object.keys(uniqueNames).forEach((name) => {\n // Ambiguous names to not get attached as bare names\n const signatures = uniqueNames[name];\n if (signatures.length > 1) {\n return;\n }\n // Strip off the leading \"%\" used for prototype protection\n name = name.substring(1);\n const signature = signatures[0];\n // If overwriting a member property that is null, swallow the error\n try {\n if (this[name] == null) {\n defineReadOnly(this, name, this[signature]);\n }\n }\n catch (e) { }\n if (this.functions[name] == null) {\n defineReadOnly(this.functions, name, this.functions[signature]);\n }\n if (this.callStatic[name] == null) {\n defineReadOnly(this.callStatic, name, this.callStatic[signature]);\n }\n if (this.populateTransaction[name] == null) {\n defineReadOnly(this.populateTransaction, name, this.populateTransaction[signature]);\n }\n if (this.estimateGas[name] == null) {\n defineReadOnly(this.estimateGas, name, this.estimateGas[signature]);\n }\n });\n }\n static getContractAddress(transaction) {\n return getContractAddress(transaction);\n }\n static getInterface(contractInterface) {\n if (Interface.isInterface(contractInterface)) {\n return contractInterface;\n }\n return new Interface(contractInterface);\n }\n // @TODO: Allow timeout?\n deployed() {\n return this._deployed();\n }\n _deployed(blockTag) {\n if (!this._deployedPromise) {\n // If we were just deployed, we know the transaction we should occur in\n if (this.deployTransaction) {\n this._deployedPromise = this.deployTransaction.wait().then(() => {\n return this;\n });\n }\n else {\n // @TODO: Once we allow a timeout to be passed in, we will wait\n // up to that many blocks for getCode\n // Otherwise, poll for our code to be deployed\n this._deployedPromise = this.provider.getCode(this.address, blockTag).then((code) => {\n if (code === \"0x\") {\n logger.throwError(\"contract not deployed\", Logger.errors.UNSUPPORTED_OPERATION, {\n contractAddress: this.address,\n operation: \"getDeployed\"\n });\n }\n return this;\n });\n }\n }\n return this._deployedPromise;\n }\n // @TODO:\n // estimateFallback(overrides?: TransactionRequest): Promise\n // @TODO:\n // estimateDeploy(bytecode: string, ...args): Promise\n fallback(overrides) {\n if (!this.signer) {\n logger.throwError(\"sending a transactions require a signer\", Logger.errors.UNSUPPORTED_OPERATION, { operation: \"sendTransaction(fallback)\" });\n }\n const tx = shallowCopy(overrides || {});\n [\"from\", \"to\"].forEach(function (key) {\n if (tx[key] == null) {\n return;\n }\n logger.throwError(\"cannot override \" + key, Logger.errors.UNSUPPORTED_OPERATION, { operation: key });\n });\n tx.to = this.resolvedAddress;\n return this.deployed().then(() => {\n return this.signer.sendTransaction(tx);\n });\n }\n // Reconnect to a different signer or provider\n connect(signerOrProvider) {\n if (typeof (signerOrProvider) === \"string\") {\n signerOrProvider = new VoidSigner(signerOrProvider, this.provider);\n }\n const contract = new (this.constructor)(this.address, this.interface, signerOrProvider);\n if (this.deployTransaction) {\n defineReadOnly(contract, \"deployTransaction\", this.deployTransaction);\n }\n return contract;\n }\n // Re-attach to a different on-chain instance of this contract\n attach(addressOrName) {\n return new (this.constructor)(addressOrName, this.interface, this.signer || this.provider);\n }\n static isIndexed(value) {\n return Indexed.isIndexed(value);\n }\n _normalizeRunningEvent(runningEvent) {\n // Already have an instance of this event running; we can re-use it\n if (this._runningEvents[runningEvent.tag]) {\n return this._runningEvents[runningEvent.tag];\n }\n return runningEvent;\n }\n _getRunningEvent(eventName) {\n if (typeof (eventName) === \"string\") {\n // Listen for \"error\" events (if your contract has an error event, include\n // the full signature to bypass this special event keyword)\n if (eventName === \"error\") {\n return this._normalizeRunningEvent(new ErrorRunningEvent());\n }\n // Listen for any event that is registered\n if (eventName === \"event\") {\n return this._normalizeRunningEvent(new RunningEvent(\"event\", null));\n }\n // Listen for any event\n if (eventName === \"*\") {\n return this._normalizeRunningEvent(new WildcardRunningEvent(this.address, this.interface));\n }\n // Get the event Fragment (throws if ambiguous/unknown event)\n const fragment = this.interface.getEvent(eventName);\n return this._normalizeRunningEvent(new FragmentRunningEvent(this.address, this.interface, fragment));\n }\n // We have topics to filter by...\n if (eventName.topics && eventName.topics.length > 0) {\n // Is it a known topichash? (throws if no matching topichash)\n try {\n const topic = eventName.topics[0];\n if (typeof (topic) !== \"string\") {\n throw new Error(\"invalid topic\"); // @TODO: May happen for anonymous events\n }\n const fragment = this.interface.getEvent(topic);\n return this._normalizeRunningEvent(new FragmentRunningEvent(this.address, this.interface, fragment, eventName.topics));\n }\n catch (error) { }\n // Filter by the unknown topichash\n const filter = {\n address: this.address,\n topics: eventName.topics\n };\n return this._normalizeRunningEvent(new RunningEvent(getEventTag(filter), filter));\n }\n return this._normalizeRunningEvent(new WildcardRunningEvent(this.address, this.interface));\n }\n _checkRunningEvents(runningEvent) {\n if (runningEvent.listenerCount() === 0) {\n delete this._runningEvents[runningEvent.tag];\n // If we have a poller for this, remove it\n const emit = this._wrappedEmits[runningEvent.tag];\n if (emit && runningEvent.filter) {\n this.provider.off(runningEvent.filter, emit);\n delete this._wrappedEmits[runningEvent.tag];\n }\n }\n }\n // Subclasses can override this to gracefully recover\n // from parse errors if they wish\n _wrapEvent(runningEvent, log, listener) {\n const event = deepCopy(log);\n event.removeListener = () => {\n if (!listener) {\n return;\n }\n runningEvent.removeListener(listener);\n this._checkRunningEvents(runningEvent);\n };\n event.getBlock = () => { return this.provider.getBlock(log.blockHash); };\n event.getTransaction = () => { return this.provider.getTransaction(log.transactionHash); };\n event.getTransactionReceipt = () => { return this.provider.getTransactionReceipt(log.transactionHash); };\n // This may throw if the topics and data mismatch the signature\n runningEvent.prepareEvent(event);\n return event;\n }\n _addEventListener(runningEvent, listener, once) {\n if (!this.provider) {\n logger.throwError(\"events require a provider or a signer with a provider\", Logger.errors.UNSUPPORTED_OPERATION, { operation: \"once\" });\n }\n runningEvent.addListener(listener, once);\n // Track this running event and its listeners (may already be there; but no hard in updating)\n this._runningEvents[runningEvent.tag] = runningEvent;\n // If we are not polling the provider, start polling\n if (!this._wrappedEmits[runningEvent.tag]) {\n const wrappedEmit = (log) => {\n let event = this._wrapEvent(runningEvent, log, listener);\n // Try to emit the result for the parameterized event...\n if (event.decodeError == null) {\n try {\n const args = runningEvent.getEmit(event);\n this.emit(runningEvent.filter, ...args);\n }\n catch (error) {\n event.decodeError = error.error;\n }\n }\n // Always emit \"event\" for fragment-base events\n if (runningEvent.filter != null) {\n this.emit(\"event\", event);\n }\n // Emit \"error\" if there was an error\n if (event.decodeError != null) {\n this.emit(\"error\", event.decodeError, event);\n }\n };\n this._wrappedEmits[runningEvent.tag] = wrappedEmit;\n // Special events, like \"error\" do not have a filter\n if (runningEvent.filter != null) {\n this.provider.on(runningEvent.filter, wrappedEmit);\n }\n }\n }\n queryFilter(event, fromBlockOrBlockhash, toBlock) {\n const runningEvent = this._getRunningEvent(event);\n const filter = shallowCopy(runningEvent.filter);\n if (typeof (fromBlockOrBlockhash) === \"string\" && isHexString(fromBlockOrBlockhash, 32)) {\n if (toBlock != null) {\n logger.throwArgumentError(\"cannot specify toBlock with blockhash\", \"toBlock\", toBlock);\n }\n filter.blockHash = fromBlockOrBlockhash;\n }\n else {\n filter.fromBlock = ((fromBlockOrBlockhash != null) ? fromBlockOrBlockhash : 0);\n filter.toBlock = ((toBlock != null) ? toBlock : \"latest\");\n }\n return this.provider.getLogs(filter).then((logs) => {\n return logs.map((log) => this._wrapEvent(runningEvent, log, null));\n });\n }\n on(event, listener) {\n this._addEventListener(this._getRunningEvent(event), listener, false);\n return this;\n }\n once(event, listener) {\n this._addEventListener(this._getRunningEvent(event), listener, true);\n return this;\n }\n emit(eventName, ...args) {\n if (!this.provider) {\n return false;\n }\n const runningEvent = this._getRunningEvent(eventName);\n const result = (runningEvent.run(args) > 0);\n // May have drained all the \"once\" events; check for living events\n this._checkRunningEvents(runningEvent);\n return result;\n }\n listenerCount(eventName) {\n if (!this.provider) {\n return 0;\n }\n if (eventName == null) {\n return Object.keys(this._runningEvents).reduce((accum, key) => {\n return accum + this._runningEvents[key].listenerCount();\n }, 0);\n }\n return this._getRunningEvent(eventName).listenerCount();\n }\n listeners(eventName) {\n if (!this.provider) {\n return [];\n }\n if (eventName == null) {\n const result = [];\n for (let tag in this._runningEvents) {\n this._runningEvents[tag].listeners().forEach((listener) => {\n result.push(listener);\n });\n }\n return result;\n }\n return this._getRunningEvent(eventName).listeners();\n }\n removeAllListeners(eventName) {\n if (!this.provider) {\n return this;\n }\n if (eventName == null) {\n for (const tag in this._runningEvents) {\n const runningEvent = this._runningEvents[tag];\n runningEvent.removeAllListeners();\n this._checkRunningEvents(runningEvent);\n }\n return this;\n }\n // Delete any listeners\n const runningEvent = this._getRunningEvent(eventName);\n runningEvent.removeAllListeners();\n this._checkRunningEvents(runningEvent);\n return this;\n }\n off(eventName, listener) {\n if (!this.provider) {\n return this;\n }\n const runningEvent = this._getRunningEvent(eventName);\n runningEvent.removeListener(listener);\n this._checkRunningEvents(runningEvent);\n return this;\n }\n removeListener(eventName, listener) {\n return this.off(eventName, listener);\n }\n}\nexport class Contract extends BaseContract {\n}\nexport class ContractFactory {\n constructor(contractInterface, bytecode, signer) {\n let bytecodeHex = null;\n if (typeof (bytecode) === \"string\") {\n bytecodeHex = bytecode;\n }\n else if (isBytes(bytecode)) {\n bytecodeHex = hexlify(bytecode);\n }\n else if (bytecode && typeof (bytecode.object) === \"string\") {\n // Allow the bytecode object from the Solidity compiler\n bytecodeHex = bytecode.object;\n }\n else {\n // Crash in the next verification step\n bytecodeHex = \"!\";\n }\n // Make sure it is 0x prefixed\n if (bytecodeHex.substring(0, 2) !== \"0x\") {\n bytecodeHex = \"0x\" + bytecodeHex;\n }\n // Make sure the final result is valid bytecode\n if (!isHexString(bytecodeHex) || (bytecodeHex.length % 2)) {\n logger.throwArgumentError(\"invalid bytecode\", \"bytecode\", bytecode);\n }\n // If we have a signer, make sure it is valid\n if (signer && !Signer.isSigner(signer)) {\n logger.throwArgumentError(\"invalid signer\", \"signer\", signer);\n }\n defineReadOnly(this, \"bytecode\", bytecodeHex);\n defineReadOnly(this, \"interface\", getStatic(new.target, \"getInterface\")(contractInterface));\n defineReadOnly(this, \"signer\", signer || null);\n }\n // @TODO: Future; rename to populateTransaction?\n getDeployTransaction(...args) {\n let tx = {};\n // If we have 1 additional argument, we allow transaction overrides\n if (args.length === this.interface.deploy.inputs.length + 1 && typeof (args[args.length - 1]) === \"object\") {\n tx = shallowCopy(args.pop());\n for (const key in tx) {\n if (!allowedTransactionKeys[key]) {\n throw new Error(\"unknown transaction override \" + key);\n }\n }\n }\n // Do not allow these to be overridden in a deployment transaction\n [\"data\", \"from\", \"to\"].forEach((key) => {\n if (tx[key] == null) {\n return;\n }\n logger.throwError(\"cannot override \" + key, Logger.errors.UNSUPPORTED_OPERATION, { operation: key });\n });\n if (tx.value) {\n const value = BigNumber.from(tx.value);\n if (!value.isZero() && !this.interface.deploy.payable) {\n logger.throwError(\"non-payable constructor cannot override value\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"overrides.value\",\n value: tx.value\n });\n }\n }\n // Make sure the call matches the constructor signature\n logger.checkArgumentCount(args.length, this.interface.deploy.inputs.length, \" in Contract constructor\");\n // Set the data to the bytecode + the encoded constructor arguments\n tx.data = hexlify(concat([\n this.bytecode,\n this.interface.encodeDeploy(args)\n ]));\n return tx;\n }\n deploy(...args) {\n return __awaiter(this, void 0, void 0, function* () {\n let overrides = {};\n // If 1 extra parameter was passed in, it contains overrides\n if (args.length === this.interface.deploy.inputs.length + 1) {\n overrides = args.pop();\n }\n // Make sure the call matches the constructor signature\n logger.checkArgumentCount(args.length, this.interface.deploy.inputs.length, \" in Contract constructor\");\n // Resolve ENS names and promises in the arguments\n const params = yield resolveAddresses(this.signer, args, this.interface.deploy.inputs);\n params.push(overrides);\n // Get the deployment transaction (with optional overrides)\n const unsignedTx = this.getDeployTransaction(...params);\n // Send the deployment transaction\n const tx = yield this.signer.sendTransaction(unsignedTx);\n const address = getStatic(this.constructor, \"getContractAddress\")(tx);\n const contract = getStatic(this.constructor, \"getContract\")(address, this.interface, this.signer);\n // Add the modified wait that wraps events\n addContractWait(contract, tx);\n defineReadOnly(contract, \"deployTransaction\", tx);\n return contract;\n });\n }\n attach(address) {\n return (this.constructor).getContract(address, this.interface, this.signer);\n }\n connect(signer) {\n return new (this.constructor)(this.interface, this.bytecode, signer);\n }\n static fromSolidity(compilerOutput, signer) {\n if (compilerOutput == null) {\n logger.throwError(\"missing compiler output\", Logger.errors.MISSING_ARGUMENT, { argument: \"compilerOutput\" });\n }\n if (typeof (compilerOutput) === \"string\") {\n compilerOutput = JSON.parse(compilerOutput);\n }\n const abi = compilerOutput.abi;\n let bytecode = null;\n if (compilerOutput.bytecode) {\n bytecode = compilerOutput.bytecode;\n }\n else if (compilerOutput.evm && compilerOutput.evm.bytecode) {\n bytecode = compilerOutput.evm.bytecode;\n }\n return new this(abi, bytecode, signer);\n }\n static getInterface(contractInterface) {\n return Contract.getInterface(contractInterface);\n }\n static getContractAddress(tx) {\n return getContractAddress(tx);\n }\n static getContract(address, contractInterface, signer) {\n return new Contract(address, contractInterface, signer);\n }\n}\n//# sourceMappingURL=index.js.map","function Ir(r){return r.length!==0}function vr(r){return r.filter(e=>e!=null)}function p(){let r=null,e=null,t=new Promise((o,n)=>{r=i=>o(i),e=i=>n(i)});return[r,e,t]}import{reaction as G}from\"mobx\";async function R(r){let[e,,t]=p(),o=G(()=>r.get(),i=>{i&&e(i)},{fireImmediately:!0}),n=await t;return o(),n}function B(r){return typeof r==\"object\"&&!Array.isArray(r)&&r!==null}function O(r){return r instanceof Function}import{reaction as q}from\"mobx\";import Q from\"proxy-deep\";function S(r,e){if(e.length===0)return r;if(e.length===1)return r[e[0]];let[t,...o]=e,n=r[t];if(!B(n))throw new Error(\"Path does not exist on the target\");return S(n,o)}function $r(r){let e=[],t=new Q({},{get(o,n){let i=r.get();return i?n===\"proxied\"?!1:Reflect.get(i,n):n===\"proxied\"?!0:n===\"name\"?\"ProxiedTarget\":n===\"toJSON\"?()=>({proxied:!0}):this.nest(()=>{})},apply(o,n,i){let s=r.get();if(s){let a=S(s,this.path);if(!O(a))throw new Error(\"Target is not callable\");return Reflect.apply(a,n,i)}else{let[a,l,u]=p();return e.push({path:this.path,args:i,resolve:a,reject:l}),u}}});return q(()=>r.get(),o=>{if(!o)return;let n=e.splice(0);for(let{path:i,args:s,resolve:a,reject:l}of n){let u=S(o,i);s&&O(u)?(async()=>{try{a(await u(...s))}catch(f){l(f)}})():a(u)}}),t}function Yr(r){let e=[];for(let t of Object.values(r))isNaN(Number(t))||e.push(Number(t));return e}function Jr(r,e){let t={};for(let o in r)t[o]=e(r[o],o);return t}function Z(r,e=0){return Math.floor(Math.random()*(r-e+1))+e}function Xr(r){return r[Z(r.length-1)]}import{concatMap as rr,delay as er,filter as tr,first as or,mergeMap as nr,of as ir,pipe as E,ReplaySubject as F,scan as ar,timestamp as sr}from\"rxjs\";import{computed as U,observable as P,reaction as _,runInAction as j,toJS as ur}from\"mobx\";function lr(){return E(tr(r=>r!=null))}function oe(){return E(rr(r=>r))}function ne(r){return E(sr(),ar((e,t)=>{let o=0;if(e!==null){let n=t.timestamp-e.timestamp;o=n>r?0:r-n}return{timestamp:t.timestamp,delay:o,value:t.value}},null),lr(),nr(e=>ir(e.value).pipe(er(e.delay)),1))}function ie(r){return U(()=>r.get())}function ae(r){let e=new F(1);return _(()=>r.get(),t=>{t!=null&&e.next(t)},{fireImmediately:!0}),e}function se(r){let e=new F(1);return _(()=>ur(r),t=>{t!=null&&e.next(t)},{fireImmediately:!0}),e}function ue(r){let e=P.box();return r.subscribe(t=>j(()=>e.set(t))),U(()=>e.get())}async function le(r){let e=P.box();r.subscribe(o=>j(()=>e.set(o)));let t=U(()=>e.get());return await R(t),t}async function cr(r,e=t=>t!=null){let[t,,o]=p();return r.pipe(or(e)).subscribe(t),o}async function ce(r){let e={};return r.subscribe(t=>e.current=t),e.current=await cr(r),e}var fe=function(){let r=mr,e=fr;return e(r(32),8)+\"-\"+e(r(16),4)+\"-\"+e(16384|r(12),4)+\"-\"+e(32768|r(14),4)+\"-\"+e(r(48),12)},mr=function(r){if(r<0||r>53)return NaN;let e=0|Math.random()*1073741824;return r>30?e+(0|Math.random()*(1<>>30-r},fr=function(r,e){let t=r.toString(16),o=e-t.length,n=\"0\";for(;o>0;o>>>=1,n+=n)o&1&&(t=n+t);return t};function M(r,e){return new Promise(t=>setTimeout(()=>t(e),r))}var be=function*(r=0,e=1,t=0){for(let o=0;oPromise.race([r,pr(e,t)]),ye=(r,e=[],t=10,o=1e3)=>{let[n,i,s]=p();return(async()=>{let l;for(let u=0;u=r.length;return o?{done:o,value:null}:{value:r[e++]}}})}function ve(r,e){return e.x>=r.x&&e.y>=r.y&&e.xr.postMessage(t)),D(r,\"message\").pipe(Y(t=>t.data))}function Pe(r){let e=D(self,\"message\");r.work(e.pipe(Y(o=>o.data))).subscribe(o=>self.postMessage(o))}function br(r,e){return r&2**e-1}function gr(r,e){if(e.reduce((o,n)=>o+n,0)>32)throw new Error(\"JS pretends integers are 32 bit when bitshifts are involved\");if(r.length!==e.length)throw new Error(\"Arrays' lengths must match\");for(let o=0;o2**e[o]-1){let n=`Overflow: ${r[o]} does not fit in ${e[o]} bits`;throw new Error(n)}}let t=0;for(let o=0;o=0;n--)t.unshift(br(o,e[n])),o=o>>>e[n];return t}function je(r){return gr(r,[8,24])}function $e(r){return yr(r,[8,24])}var hr=2**16-1,h=2**15-1;function We(r,e){let t=new A;for(let o of r.coords())e.get(o)||t.set(o,!0);return t}function v(r){return r.x<<16|r.y&hr}function W(r){let e=r>>16,t=r<<16>>16;return{x:e,y:t}}var A=class{map;defaultValue;constructor(e){this.map=new Map,this.defaultValue=e?.defaultValue}static from(e){let t=new A;return t.map=e.map,t.defaultValue=e.defaultValue,t}set(e,t){if(e.x>h||e.x<-1*h||e.y>h||e.y<-1*h)throw new Error(`CoordMap only supports coords up to ${h}`);return this.map.set(v(e),t)}get(e){return this.map.get(v(e))??this.defaultValue}keys(){return this.map.keys()}coords(){return I(this.map.keys(),e=>W(e))}entries(){return this.map.entries()}toArray(){return Array.from(this.map.entries()).map(([t,o])=>[W(t),o])}values(){return this.map.values()}delete(e){return this.map.delete(v(e))}has(e){return this.map.has(v(e))}clear(){for(let e of this.map.keys())this.map.delete(e)}get size(){return this.map.size}};function k(r){return`${r.x}/${r.y}/${r.z}`}function J(r){let e=r.split(\"/\");return{x:Number(e[0]),y:Number(e[1]),z:Number(e[2])}}var V=class{map;defaultValue;constructor(e){this.map=new Map,this.defaultValue=e?.defaultValue}static from(e){let t=new V;return t.map=e.map,t.defaultValue=e.defaultValue,t}set(e,t){return this.map.set(k(e),t)}get(e){return this.map.get(k(e))??this.defaultValue}keys(){return this.map.keys()}coords(){return I(this.map.keys(),e=>J(e))}entries(){return this.map.entries()}toArray(){return Array.from(this.map.entries()).map(([t,o])=>[J(t),o])}values(){return this.map.values()}delete(e){return this.map.delete(k(e))}has(e){return this.map.has(k(e))}clear(){for(let e of this.map.keys())this.map.delete(e)}get size(){return this.map.size}};function H(r,e){r.substring(0,2)==\"0x\"&&(r=r.substring(2));let t=e/4;return r=r.padStart(t,\"0\"),r=r.substring(r.length-t),`0x${r}`}function X(r){return H(r,160)}function ze(r){return H(r,256)}function Ke(r){if(r[0]!==\"0\"&&r[1]!==\"x\")throw new Error(\"Invalid hex string\");return\"0x\"+r.substring(10)}function d(r,e,t){return(((e^t)*134775813^r+e)*(1103515245*e<<16^1103515245*t-134775813)>>>0)/4294967295}function m(r,e){if(r<0)for(;r<0;)r+=e;return r%e}function N(r,e,t,o,n,i,s){let a=o-t-(r-e);return(e*Math.pow(i,3)+n*(t*Math.pow(i,2)+r*i*(-i+n)+n*(-(e+a)*i+a*n)))*s}function Ge(r,e,t,o=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return{seed:Math.floor(r*Number.MAX_SAFE_INTEGER),periodX:o,periodY:n,octave:e,scale:t}}function qe(r,e){let t=Math.floor(e),o=e-t;return N(d(r.seed,m(t-1,r.periodX),0),d(r.seed,m(t,r.periodX),0),d(r.seed,m(t+1,r.periodX),0),d(r.seed,m(t+2,r.periodX),0),o,1,1)*.666666+.166666}function Qe({octave:r,periodX:e,periodY:t,seed:o,scale:n},i,s){let a=Math.floor(i/r),l=Math.floor(i*1e3/r)-a*1e3,u=Math.floor(s/r),f=Math.floor(s*1e3/r)-u*1e3,T=m(a-1,e),c=m(a,e),b=m(a+1,e),L=m(a+2,e),g=new Array(4);for(let w=0;w<4;++w){let C=m(u-1+w,t);g[w]=N(d(o,T,C),d(o,c,C),d(o,b,C),d(o,L,C),l,1e3,1)}return Math.floor(N(g[0],g[1],g[2],g[3],f,1e3,n)/Math.pow(1e3,6))}var x=\"mud-logger-topics\";function rt(){let r=window.console,e=!!localStorage.getItem(x),t=localStorage.getItem(x),o=t?JSON.parse(t):[];function n(...c){e||r.log(...c)}function i(c,...b){(!e||o.includes(c))&&(r.log(`--- BETTER CONSOLE / TOPIC ${c} ---`),r.log(...b))}function s(){localStorage.setItem(x,JSON.stringify([])),e=!0}function a(){localStorage.removeItem(x),e=!1}function l(c){o.push(c),localStorage.setItem(x,JSON.stringify(o))}function u(c){o=o.filter(b=>b!==c),localStorage.setItem(x,JSON.stringify(o))}function f(){o=[],localStorage.setItem(x,JSON.stringify(o))}let T={...r,log:n,logWithTopic:i,enableFilters:s,disableFilters:a,addTopic:l,removeTopic:u,resetTopics:f};return window.logger=T,window.console=T,T}function tt(r,e){if(r.length!==e.length)throw new Error(\"points must have same dimension\");return Math.sqrt(r.reduce((t,o,n)=>t+Math.pow(r[n]-e[n],2),0))}function nt(r){return(r<0?-1:1)*Math.floor(Math.abs(r))}var at=r=>`0x${[...new Uint8Array(r)].map(e=>e.toString(16).padStart(2,\"0\")).join(\"\")}`;var ut=r=>[...r].map(e=>String.fromCharCode(e)).join(\"\");function z(r){return/^(0x)?([\\da-f]{2})*$/i.test(r)}var K=r=>{if(!z(r))throw console.error(\"Invalid hex string\",r),new Error(\"Invalid hex string\");let e=r.match(/[\\da-f]{2}/gi);return e?new Uint8Array(e.map(t=>parseInt(t,16))):new Uint8Array([])};var pt=r=>{if(r.length>16)throw new Error(\"string too long\");return new Uint8Array(16).map((e,t)=>r.charCodeAt(t))},dt=r=>{if(r.length>32)throw new Error(\"string too long\");return new Uint8Array(32).map((e,t)=>r.charCodeAt(t))};function Ar(r){return r.substring(0,2)==\"0x\"&&(r=r.substring(2)),(r.length%2!==0?\"0x0\":\"0x\")+r}function wr(r){return K(r)}function It(r){return r.length===0?\"0x00\":Ar(r.reduce((e,t)=>e+t.toString(16).padStart(2,\"0\"),\"\"))}function vt(...r){return Uint8Array.from(r.reduce((e,t)=>[...e,...t],[]))}function kt(r,e){let t=[],o=0;for(let n of e){let i=new Uint8Array(n);t.push(i);for(let s=0;s64)throw new Error(\"Maximum size is 64\");let e=2**(r-1)-1,t=-e-1;return o=>{if(o=o<<0,o>e||oe,o(y[y.Boolean=0]=\"Boolean\",y[y.Number=1]=\"Number\",y[y.OptionalNumber=2]=\"OptionalNumber\",y[y.BigInt=3]=\"BigInt\",y[y.OptionalBigInt=4]=\"OptionalBigInt\",y[y.String=5]=\"String\",y[y.OptionalString=6]=\"OptionalString\",y[y.NumberArray=7]=\"NumberArray\",y[y.OptionalNumberArray=8]=\"OptionalNumberArray\",y[y.BigIntArray=9]=\"BigIntArray\",y[y.OptionalBigIntArray=10]=\"OptionalBigIntArray\",y[y.StringArray=11]=\"StringArray\",y[y.OptionalStringArray=12]=\"OptionalStringArray\",y[y.Entity=13]=\"Entity\",y[y.OptionalEntity=14]=\"OptionalEntity\",y[y.EntityArray=15]=\"EntityArray\",y[y.OptionalEntityArray=16]=\"OptionalEntityArray\",y[y.T=17]=\"T\",y[y.OptionalT=18]=\"OptionalT\",y))(W||{}),Q=(r=>(r[r.Enter=0]=\"Enter\",r[r.Exit=1]=\"Exit\",r[r.Update=2]=\"Update\",r[r.Noop=3]=\"Noop\",r))(Q||{}),H=[14,16,2,8,4,10,6,12,18];function he(e,t,n){let o=e.registerEntity(n??{});if(t)for(let[r,p]of t)T(r,o,p);return o}function S(e){return Symbol.for(e)}function C(e){return Symbol.keyFor(e)}function $(e){let t=new Map;function n(a){let m=t.get(o(a));return m?new Set([...m].map(C)):new Set}function o(a){return Object.values(a).join(\"/\")}function r(a,m){if(!m)return;let c=o(m),u=t.get(c);u||(u=new Set,t.set(c,u)),u.add(a)}function p(a,m){if(!m)return;let c=o(m),u=t.get(c);u&&u.delete(a)}for(let a of b(e)){let m=x(e,a);r(S(a),m)}let i=e.update$.subscribe(({entity:a,value:m})=>{p(S(a),m[1]),r(S(a),m[0])});return e.world.registerDisposer(()=>i?.unsubscribe()),{...e,getEntitiesWithValue:n}}import{map as ee,pipe as te}from\"rxjs\";function Ne(e,t){return e.component===t}function ne(e,t){let n=x(t,e);return{entity:e,component:t,value:[n,void 0],type:n==null?3:0}}function I(e){return te(ee(t=>ne(t,e)))}function B(e){return\"getEntitiesWithValue\"in e}function R(e,t){return Object.keys(e.schema).every(n=>n in t)}function h(e){return e.metadata?.componentName??e.metadata?.tableName??e.metadata?.tableId??e.metadata?.contractId??e.id}function Re(e,t,n){if(Object.keys(t).length===0)throw new Error(\"Component schema must have at least one key\");let o=n?.id??oe(),r=D(t,()=>new Map),p=new q,i=n?.metadata,m={values:r,schema:t,id:o,update$:p,metadata:i,entities:()=>j(Object.values(r)[0].keys(),C),world:e};return n?.indexed&&(m=$(m)),e.registerComponent(m),m}function T(e,t,n){let o=S(t),r=x(e,t);for(let[p,i]of Object.entries(n))e.values[p]?e.values[p].set(o,i):e.metadata?.tableId&&/^\\d+$/.test(p)||console.warn(\"Component definition for\",h(e),\"is missing key\",p,\", ignoring value\",i,\"for entity\",t,\". Existing keys: \",Object.keys(e.values));e.update$.next({entity:t,value:[n,r],component:e})}function je(e,t,n,o){let r=x(e,t);if(r===void 0){if(o===void 0)throw new Error(`Can't update component ${h(e)} without a current value or initial value`);T(e,t,{...o,...n})}else T(e,t,{...r,...n})}function w(e,t){let n=S(t),o=x(e,t);for(let r of Object.keys(e.values))e.values[r].delete(n);e.update$.next({entity:t,value:[void 0,o],component:e})}function v(e,t){let n=S(t);return Object.values(e.values)[0].has(n)}function x(e,t){let n={},o=S(t),r=Object.keys(e.schema);for(let p of r){let i=e.values[p].get(o);if(i===void 0&&!H.includes(e.schema[p]))return;n[p]=i}return n}function De(e,t){let n=x(e,t);if(!n)throw new Error(`No value for component ${h(e)} on entity ${t}`);return n}function k(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;let n=!0;for(let o of Object.keys(e))if(n=e[o]===t[o],!n)return!1;return n}function qe(e,t){return[e,t]}function A(e,t){if(B(e)&&R(e,t))return e.getEntitiesWithValue(t);let n=new Set;for(let o of b(e)){let r=x(e,o);k(t,r)&&n.add(o)}return n}function b(e){return e.entities()}function Le(e){let t=0,n=new Map,o=new Map,r=new q;function p(l,s){n.set(l,{update:s,nonce:t++}),g(s.entity,s.value)}function i(l){let s=n.get(l)?.update.entity;if(n.delete(l),s==null)return;let E=[...n.values()].filter(f=>f.update.entity===s).sort((f,N)=>f.nonce0){let f=E[E.length-1];g(s,f.update.value)}else g(s,void 0)}function a(l){let s=x(e,l),E=S(l),f=o.get(E);return(s||f)&&f!==null?{...s,...f}:void 0}let m=l=>({get(s,E){return E===\"get\"?f=>{let N=s.get(f),M=o.get(f);return M&&M[l]!=null?M[l]:N}:E===\"has\"?f=>s.has(f)||o.has(f):E===\"keys\"?()=>new Set([...s.keys(),...o.keys()]).values():Reflect.get(s,E,s)}}),c={};for(let l of Object.keys(e.values))c[l]=new Proxy(e.values[l],m(l));let u=c,d=new Proxy(e,{get(l,s){return s===\"addOverride\"?p:s===\"removeOverride\"?i:s===\"values\"?u:s===\"update$\"?r:s===\"entities\"?()=>new Set([...j(o.keys(),C),...l.entities()]).values():Reflect.get(l,s)},has(l,s){return s===\"addOverride\"||s===\"removeOverride\"?!0:s in l}});function g(l,s){let E=S(l),f=a(l);s!==void 0?o.set(E,s):o.delete(E),r.next({entity:l,value:[a(l),f],component:d})}return e.update$.pipe(re(l=>!o.get(S(l.entity))),ie(l=>({...l,component:d}))).subscribe(r),d}function L(e,t){return`localcache-${t}-${e.id}`}function Ke(e,t){localStorage.removeItem(L(e,t))}function Je(e,t){let{world:n,update$:o,values:r}=e,p=L(e,t),i=0,a=Date.now(),m=localStorage.getItem(p);if(m){let u=JSON.parse(m),d={};for(let[g,l]of u)for(let[s,E]of l)d[s]=d[s]||{},d[s][g]=E;for(let[g,l]of Object.entries(d)){let s=n.registerEntity({id:g});T(e,s,l)}console.info(\"Loading component\",h(e),\"from local cache.\")}let c=o.subscribe(()=>{i++;let u=JSON.stringify(Object.entries(D(r,d=>[...d.entries()].map(g=>[C(g[0]),g[1]]))));localStorage.setItem(p,u),i>200&&console.warn(\"Component\",h(e),\"was locally cached\",i,\"times since\",new Date(a).toLocaleTimeString(),\"- the local cache is in an alpha state and should not be used with components that update frequently yet\")});return e.world.registerDisposer(()=>c?.unsubscribe()),e}import{concat as xe,EMPTY as ge,from as Ee}from\"rxjs\";import{filterNullish as ae}from\"@latticexyz/utils\";import{observable as ue}from\"mobx\";import{concat as pe,concatMap as ye,filter as U,from as se,map as me,merge as le,of as de,share as ce}from\"rxjs\";var K=(i=>(i[i.Has=0]=\"Has\",i[i.HasValue=1]=\"HasValue\",i[i.Not=2]=\"Not\",i[i.NotValue=3]=\"NotValue\",i[i.ProxyRead=4]=\"ProxyRead\",i[i.ProxyExpand=5]=\"ProxyExpand\",i))(K||{});function Ge(e){return[2,4,6,14,16,8,10,12].includes(e)}function Xe(e){return[7,8,9,10,11,12,15,16].includes(e)}function Ze(e){return[1,2].includes(e)}function _e(e){return[13,14].includes(e)}function Ft(e){return{type:0,component:e}}function Qt(e){return{type:2,component:e}}function It(e,t){return{type:1,component:e,value:t}}function wt(e,t){return{type:3,component:e,value:t}}function kt(e,t){return{type:4,component:e,depth:t}}function Nt(e,t){return{type:5,component:e,depth:t}}function O(e,t){if(t.type===0)return v(t.component,e);if(t.type===1)return k(t.value,x(t.component,e));if(t.type===2)return!v(t.component,e);if(t.type===3)return!k(t.value,x(t.component,e));throw new Error(\"Unknown query fragment\")}function fe(e){return e.type===0||e.type==1}function Y(e){return e.type===2||e.type==3}function Se(e){return e.type===5||e.type==4}function G(e,t){return e&&fe(t)||!e&&Y(t)}function J(e,t,n){let o=e,r=!1;for(let p=0;p[...P(p,t,n-1)]).flat();return new Set([...o,...r])}function z(e,t){let n=t?new Set([...t]):void 0,o,r;for(let p=0;p0&&!G(m,i)&&(m=J(a,i,o)??m),m||n.delete(a),r&&r.depth>0){let c=P(a,r.component,r.depth);for(let u of c)(O(u,i)||o&&o.depth>0&&J(u,i,o))&&n.add(u)}}else{if(Y(i))throw new Error(\"First EntityQueryFragment must be Has or HasValue\");if(n=i.type===0?new Set([...b(i.component)]):A(i.component,i.value),r&&r.depth>0)for(let a of[...n])for(let m of P(a,r.component,r.depth))n.add(m)}}return n??new Set}function V(e,t){let n=t?.runOnInit||t?.initialSet?z(e,t.initialSet):new Set,o=ue(n),r=se(o).pipe(I(e[0].component)),p=e.findIndex(a=>[5,4].includes(a.type))!==-1,i=le(...e.map(a=>a.component.update$)).pipe(p?ye(a=>{let m=z(e,t?.initialSet),c=[];for(let u of o)m.has(u)||(o.delete(u),c.push({entity:u,type:1,component:a.component,value:[void 0,void 0]}));for(let u of m)o.has(u)?c.push({entity:u,type:2,component:a.component,value:[x(a.component,u),void 0]}):(o.add(u),c.push({entity:u,type:0,component:a.component,value:[x(a.component,u),void 0]}));return de(...c)}):me(a=>{if(o.has(a.entity))return e.filter(d=>d.component.id===a.component.id).every(d=>O(a.entity,d))?{...a,type:2}:(o.delete(a.entity),{...a,type:1});if(e.every(c=>O(a.entity,c)))return o.add(a.entity),{...a,type:0}}),ae());return{matching:o,update$:pe(r,i).pipe(ce())}}function X(e,t){return V(e,t).update$.pipe(U(n=>n.type===2))}function Z(e,t){return V(e,t).update$.pipe(U(n=>n.type===0))}function _(e,t){return V(e,t).update$.pipe(U(n=>n.type===1))}function F(e,t,n){let o=t.subscribe(n);e.registerDisposer(()=>o?.unsubscribe())}function Bt(e,t,n,o={runOnInit:!0}){F(e,X(t,o),n)}function Rt(e,t,n,o={runOnInit:!0}){F(e,Z(t,o),n)}function jt(e,t,n,o={runOnInit:!0}){F(e,_(t,o),n)}function Ce(e,t,n,o={runOnInit:!0}){F(e,V(t,o).update$,n)}function Dt(e,t,n,o={runOnInit:!0}){let r=o?.runOnInit?Ee(b(t)).pipe(I(t)):ge;F(e,xe(r,t.update$),n)}function qt(e,t,n,o,r={update:!1,runOnInit:!0}){Ce(e,t,({entity:p,type:i})=>{i===0&&T(n(p),p,o(p)),i===1&&w(n(p),p),r?.update&&i===2&&T(n(p),p,o(p))},r)}import{transformIterator as Te}from\"@latticexyz/utils\";function Yt(){let e=new Set,t=[],n=[];function o({id:u,idSuffix:d}={}){let g=u||e.size+(d?\"-\"+d:\"\"),l=S(g);return e.add(l),g}function r(){return Te(e.values(),C)}function p(u){t.push(u)}function i(u){for(let[,d]of n.filter(g=>!u||g[0]===u))d();n=n.filter(d=>u&&d[0]!==u)}function a(u,d=\"\"){n.push([d,u])}function m(u){let d=S(u);return e.has(d)}function c(u){for(let d of t)v(d,u)&&w(d,u);e.delete(S(u))}return{registerEntity:o,components:t,registerComponent:p,dispose:i,registerDisposer:a,hasEntity:m,getEntities:r,entitySymbols:e,deleteEntity:c}}function Gt(e,t){return{...e,registerDisposer:n=>e.registerDisposer(n,t),dispose:()=>e.dispose(t)}}function Xt(e,t){return e.components.filter(n=>v(n,t))}export{Ft as Has,It as HasValue,Qt as Not,wt as NotValue,H as OptionalTypes,Nt as ProxyExpand,kt as ProxyRead,K as QueryFragmentType,W as Type,Q as UpdateType,Ke as clearLocalCache,k as componentValueEquals,he as createEntity,$ as createIndexer,Je as createLocalCache,Yt as createWorld,Re as defineComponent,Dt as defineComponentSystem,Z as defineEnterQuery,Rt as defineEnterSystem,_ as defineExitQuery,jt as defineExitSystem,V as defineQuery,F as defineRxSystem,qt as defineSyncSystem,Ce as defineSystem,X as defineUpdateQuery,Bt as defineUpdateSystem,P as getChildEntities,b as getComponentEntities,x as getComponentValue,De as getComponentValueStrict,A as getEntitiesWithValue,Xt as getEntityComponents,C as getEntityString,S as getEntitySymbol,v as hasComponent,Xe as isArrayType,Ne as isComponentUpdate,_e as isEntityType,R as isFullComponentValue,B as isIndexer,Ze as isNumberType,Ge as isOptionalType,Gt as namespaceWorld,Le as overridableComponent,w as removeComponent,z as runQuery,T as setComponent,ne as toUpdate,I as toUpdateStream,je as updateComponent,qe as withValue};\n//# sourceMappingURL=index.js.map","var i=/\\[\\]$/;function b(t){return i.test(t)}function r(t){return t.replace(i,\"\")}var n=[\"uint8\",\"uint16\",\"uint24\",\"uint32\",\"uint40\",\"uint48\",\"uint56\",\"uint64\",\"uint72\",\"uint80\",\"uint88\",\"uint96\",\"uint104\",\"uint112\",\"uint120\",\"uint128\",\"uint136\",\"uint144\",\"uint152\",\"uint160\",\"uint168\",\"uint176\",\"uint184\",\"uint192\",\"uint200\",\"uint208\",\"uint216\",\"uint224\",\"uint232\",\"uint240\",\"uint248\",\"uint256\",\"int8\",\"int16\",\"int24\",\"int32\",\"int40\",\"int48\",\"int56\",\"int64\",\"int72\",\"int80\",\"int88\",\"int96\",\"int104\",\"int112\",\"int120\",\"int128\",\"int136\",\"int144\",\"int152\",\"int160\",\"int168\",\"int176\",\"int184\",\"int192\",\"int200\",\"int208\",\"int216\",\"int224\",\"int232\",\"int240\",\"int248\",\"int256\",\"bytes1\",\"bytes2\",\"bytes3\",\"bytes4\",\"bytes5\",\"bytes6\",\"bytes7\",\"bytes8\",\"bytes9\",\"bytes10\",\"bytes11\",\"bytes12\",\"bytes13\",\"bytes14\",\"bytes15\",\"bytes16\",\"bytes17\",\"bytes18\",\"bytes19\",\"bytes20\",\"bytes21\",\"bytes22\",\"bytes23\",\"bytes24\",\"bytes25\",\"bytes26\",\"bytes27\",\"bytes28\",\"bytes29\",\"bytes30\",\"bytes31\",\"bytes32\",\"bool\",\"address\",\"uint8[]\",\"uint16[]\",\"uint24[]\",\"uint32[]\",\"uint40[]\",\"uint48[]\",\"uint56[]\",\"uint64[]\",\"uint72[]\",\"uint80[]\",\"uint88[]\",\"uint96[]\",\"uint104[]\",\"uint112[]\",\"uint120[]\",\"uint128[]\",\"uint136[]\",\"uint144[]\",\"uint152[]\",\"uint160[]\",\"uint168[]\",\"uint176[]\",\"uint184[]\",\"uint192[]\",\"uint200[]\",\"uint208[]\",\"uint216[]\",\"uint224[]\",\"uint232[]\",\"uint240[]\",\"uint248[]\",\"uint256[]\",\"int8[]\",\"int16[]\",\"int24[]\",\"int32[]\",\"int40[]\",\"int48[]\",\"int56[]\",\"int64[]\",\"int72[]\",\"int80[]\",\"int88[]\",\"int96[]\",\"int104[]\",\"int112[]\",\"int120[]\",\"int128[]\",\"int136[]\",\"int144[]\",\"int152[]\",\"int160[]\",\"int168[]\",\"int176[]\",\"int184[]\",\"int192[]\",\"int200[]\",\"int208[]\",\"int216[]\",\"int224[]\",\"int232[]\",\"int240[]\",\"int248[]\",\"int256[]\",\"bytes1[]\",\"bytes2[]\",\"bytes3[]\",\"bytes4[]\",\"bytes5[]\",\"bytes6[]\",\"bytes7[]\",\"bytes8[]\",\"bytes9[]\",\"bytes10[]\",\"bytes11[]\",\"bytes12[]\",\"bytes13[]\",\"bytes14[]\",\"bytes15[]\",\"bytes16[]\",\"bytes17[]\",\"bytes18[]\",\"bytes19[]\",\"bytes20[]\",\"bytes21[]\",\"bytes22[]\",\"bytes23[]\",\"bytes24[]\",\"bytes25[]\",\"bytes26[]\",\"bytes27[]\",\"bytes28[]\",\"bytes29[]\",\"bytes30[]\",\"bytes31[]\",\"bytes32[]\",\"bool[]\",\"address[]\",\"bytes\",\"string\"],e=n.slice(0,98),y=n.slice(98);var s={\"uint8[]\":[],\"uint16[]\":[],\"uint24[]\":[],\"uint32[]\":[],\"uint40[]\":[],\"uint48[]\":[],\"uint56[]\":[],\"uint64[]\":[],\"uint72[]\":[],\"uint80[]\":[],\"uint88[]\":[],\"uint96[]\":[],\"uint104[]\":[],\"uint112[]\":[],\"uint120[]\":[],\"uint128[]\":[],\"uint136[]\":[],\"uint144[]\":[],\"uint152[]\":[],\"uint160[]\":[],\"uint168[]\":[],\"uint176[]\":[],\"uint184[]\":[],\"uint192[]\":[],\"uint200[]\":[],\"uint208[]\":[],\"uint216[]\":[],\"uint224[]\":[],\"uint232[]\":[],\"uint240[]\":[],\"uint248[]\":[],\"uint256[]\":[],\"int8[]\":[],\"int16[]\":[],\"int24[]\":[],\"int32[]\":[],\"int40[]\":[],\"int48[]\":[],\"int56[]\":[],\"int64[]\":[],\"int72[]\":[],\"int80[]\":[],\"int88[]\":[],\"int96[]\":[],\"int104[]\":[],\"int112[]\":[],\"int120[]\":[],\"int128[]\":[],\"int136[]\":[],\"int144[]\":[],\"int152[]\":[],\"int160[]\":[],\"int168[]\":[],\"int176[]\":[],\"int184[]\":[],\"int192[]\":[],\"int200[]\":[],\"int208[]\":[],\"int216[]\":[],\"int224[]\":[],\"int232[]\":[],\"int240[]\":[],\"int248[]\":[],\"int256[]\":[],\"bytes1[]\":[],\"bytes2[]\":[],\"bytes3[]\":[],\"bytes4[]\":[],\"bytes5[]\":[],\"bytes6[]\":[],\"bytes7[]\":[],\"bytes8[]\":[],\"bytes9[]\":[],\"bytes10[]\":[],\"bytes11[]\":[],\"bytes12[]\":[],\"bytes13[]\":[],\"bytes14[]\":[],\"bytes15[]\":[],\"bytes16[]\":[],\"bytes17[]\":[],\"bytes18[]\":[],\"bytes19[]\":[],\"bytes20[]\":[],\"bytes21[]\":[],\"bytes22[]\":[],\"bytes23[]\":[],\"bytes24[]\":[],\"bytes25[]\":[],\"bytes26[]\":[],\"bytes27[]\":[],\"bytes28[]\":[],\"bytes29[]\":[],\"bytes30[]\":[],\"bytes31[]\":[],\"bytes32[]\":[],\"bool[]\":[],\"address[]\":[],bytes:\"0x\",string:\"\"};function T(t){return y.includes(t)}var a={uint8:0,uint16:0,uint24:0,uint32:0,uint40:0,uint48:0,uint56:0n,uint64:0n,uint72:0n,uint80:0n,uint88:0n,uint96:0n,uint104:0n,uint112:0n,uint120:0n,uint128:0n,uint136:0n,uint144:0n,uint152:0n,uint160:0n,uint168:0n,uint176:0n,uint184:0n,uint192:0n,uint200:0n,uint208:0n,uint216:0n,uint224:0n,uint232:0n,uint240:0n,uint248:0n,uint256:0n,int8:0,int16:0,int24:0,int32:0,int40:0,int48:0,int56:0n,int64:0n,int72:0n,int80:0n,int88:0n,int96:0n,int104:0n,int112:0n,int120:0n,int128:0n,int136:0n,int144:0n,int152:0n,int160:0n,int168:0n,int176:0n,int184:0n,int192:0n,int200:0n,int208:0n,int216:0n,int224:0n,int232:0n,int240:0n,int248:0n,int256:0n,bytes1:\"0x00\",bytes2:\"0x0000\",bytes3:\"0x000000\",bytes4:\"0x00000000\",bytes5:\"0x0000000000\",bytes6:\"0x000000000000\",bytes7:\"0x00000000000000\",bytes8:\"0x0000000000000000\",bytes9:\"0x000000000000000000\",bytes10:\"0x00000000000000000000\",bytes11:\"0x0000000000000000000000\",bytes12:\"0x000000000000000000000000\",bytes13:\"0x00000000000000000000000000\",bytes14:\"0x0000000000000000000000000000\",bytes15:\"0x000000000000000000000000000000\",bytes16:\"0x00000000000000000000000000000000\",bytes17:\"0x0000000000000000000000000000000000\",bytes18:\"0x000000000000000000000000000000000000\",bytes19:\"0x00000000000000000000000000000000000000\",bytes20:\"0x0000000000000000000000000000000000000000\",bytes21:\"0x000000000000000000000000000000000000000000\",bytes22:\"0x00000000000000000000000000000000000000000000\",bytes23:\"0x0000000000000000000000000000000000000000000000\",bytes24:\"0x000000000000000000000000000000000000000000000000\",bytes25:\"0x00000000000000000000000000000000000000000000000000\",bytes26:\"0x0000000000000000000000000000000000000000000000000000\",bytes27:\"0x000000000000000000000000000000000000000000000000000000\",bytes28:\"0x00000000000000000000000000000000000000000000000000000000\",bytes29:\"0x0000000000000000000000000000000000000000000000000000000000\",bytes30:\"0x000000000000000000000000000000000000000000000000000000000000\",bytes31:\"0x00000000000000000000000000000000000000000000000000000000000000\",bytes32:\"0x0000000000000000000000000000000000000000000000000000000000000000\",bool:!1,address:\"0x0000000000000000000000000000000000000000\"},A={uint8:1,uint16:2,uint24:3,uint32:4,uint40:5,uint48:6,uint56:7,uint64:8,uint72:9,uint80:10,uint88:11,uint96:12,uint104:13,uint112:14,uint120:15,uint128:16,uint136:17,uint144:18,uint152:19,uint160:20,uint168:21,uint176:22,uint184:23,uint192:24,uint200:25,uint208:26,uint216:27,uint224:28,uint232:29,uint240:30,uint248:31,uint256:32,int8:1,int16:2,int24:3,int32:4,int40:5,int48:6,int56:7,int64:8,int72:9,int80:10,int88:11,int96:12,int104:13,int112:14,int120:15,int128:16,int136:17,int144:18,int152:19,int160:20,int168:21,int176:22,int184:23,int192:24,int200:25,int208:26,int216:27,int224:28,int232:29,int240:30,int248:31,int256:32,bytes1:1,bytes2:2,bytes3:3,bytes4:4,bytes5:5,bytes6:6,bytes7:7,bytes8:8,bytes9:9,bytes10:10,bytes11:11,bytes12:12,bytes13:13,bytes14:14,bytes15:15,bytes16:16,bytes17:17,bytes18:18,bytes19:19,bytes20:20,bytes21:21,bytes22:22,bytes23:23,bytes24:24,bytes25:25,bytes26:26,bytes27:27,bytes28:28,bytes29:29,bytes30:30,bytes31:31,bytes32:32,bool:1,address:20};function g(t){return e.includes(t)}var P={...a,...s};export{r as arrayAbiTypeToStaticAbiType,s as dynamicAbiTypeToDefaultValue,y as dynamicAbiTypes,b as isArrayAbiType,T as isDynamicAbiType,g as isStaticAbiType,P as schemaAbiTypeToDefaultValue,n as schemaAbiTypes,A as staticAbiTypeToByteLength,a as staticAbiTypeToDefaultValue,e as staticAbiTypes};\n//# sourceMappingURL=index.js.map","export const version = '0.9.3';\n//# sourceMappingURL=version.js.map","import { version } from './version.js';\nexport class BaseError extends Error {\n constructor(shortMessage, args = {}) {\n const details = args.cause instanceof BaseError\n ? args.cause.details\n : args.cause?.message\n ? args.cause.message\n : args.details;\n const docsPath = args.cause instanceof BaseError\n ? args.cause.docsPath || args.docsPath\n : args.docsPath;\n const message = [\n shortMessage || 'An error occurred.',\n '',\n ...(args.metaMessages ? [...args.metaMessages, ''] : []),\n ...(docsPath ? [`Docs: https://abitype.dev${docsPath}`] : []),\n ...(details ? [`Details: ${details}`] : []),\n `Version: abitype@${version}`,\n ].join('\\n');\n super(message);\n Object.defineProperty(this, \"details\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"docsPath\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"metaMessages\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"shortMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiTypeError'\n });\n if (args.cause)\n this.cause = args.cause;\n this.details = details;\n this.docsPath = docsPath;\n this.metaMessages = args.metaMessages;\n this.shortMessage = shortMessage;\n }\n}\n//# sourceMappingURL=errors.js.map","export function execTyped(regex, string) {\n const match = regex.exec(string);\n return match?.groups;\n}\nexport const bytesRegex = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/;\nexport const integerRegex = /^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;\nexport const isTupleRegex = /^\\(.+?\\).*?$/;\n//# sourceMappingURL=regex.js.map","import { execTyped } from '../../regex.js';\nconst errorSignatureRegex = /^error (?[a-zA-Z$_][a-zA-Z0-9$_]*)\\((?.*?)\\)$/;\nexport function isErrorSignature(signature) {\n return errorSignatureRegex.test(signature);\n}\nexport function execErrorSignature(signature) {\n return execTyped(errorSignatureRegex, signature);\n}\nconst eventSignatureRegex = /^event (?[a-zA-Z$_][a-zA-Z0-9$_]*)\\((?.*?)\\)$/;\nexport function isEventSignature(signature) {\n return eventSignatureRegex.test(signature);\n}\nexport function execEventSignature(signature) {\n return execTyped(eventSignatureRegex, signature);\n}\nconst functionSignatureRegex = /^function (?[a-zA-Z$_][a-zA-Z0-9$_]*)\\((?.*?)\\)(?: (?external|public{1}))?(?: (?pure|view|nonpayable|payable{1}))?(?: returns\\s?\\((?.*?)\\))?$/;\nexport function isFunctionSignature(signature) {\n return functionSignatureRegex.test(signature);\n}\nexport function execFunctionSignature(signature) {\n return execTyped(functionSignatureRegex, signature);\n}\nconst structSignatureRegex = /^struct (?[a-zA-Z$_][a-zA-Z0-9$_]*) \\{(?.*?)\\}$/;\nexport function isStructSignature(signature) {\n return structSignatureRegex.test(signature);\n}\nexport function execStructSignature(signature) {\n return execTyped(structSignatureRegex, signature);\n}\nconst constructorSignatureRegex = /^constructor\\((?.*?)\\)(?:\\s(?payable{1}))?$/;\nexport function isConstructorSignature(signature) {\n return constructorSignatureRegex.test(signature);\n}\nexport function execConstructorSignature(signature) {\n return execTyped(constructorSignatureRegex, signature);\n}\nconst fallbackSignatureRegex = /^fallback\\(\\)$/;\nexport function isFallbackSignature(signature) {\n return fallbackSignatureRegex.test(signature);\n}\nconst receiveSignatureRegex = /^receive\\(\\) external payable$/;\nexport function isReceiveSignature(signature) {\n return receiveSignatureRegex.test(signature);\n}\nexport const modifiers = new Set([\n 'memory',\n 'indexed',\n 'storage',\n 'calldata',\n]);\nexport const eventModifiers = new Set(['indexed']);\nexport const functionModifiers = new Set([\n 'calldata',\n 'memory',\n 'storage',\n]);\n//# sourceMappingURL=signatures.js.map","import { BaseError } from '../../errors.js';\nexport class InvalidAbiItemError extends BaseError {\n constructor({ signature }) {\n super('Failed to parse ABI item.', {\n details: `parseAbiItem(${JSON.stringify(signature, null, 2)})`,\n docsPath: '/api/human.html#parseabiitem-1',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidAbiItemError'\n });\n }\n}\nexport class UnknownTypeError extends BaseError {\n constructor({ type }) {\n super('Unknown type.', {\n metaMessages: [\n `Type \"${type}\" is not a valid ABI type. Perhaps you forgot to include a struct signature?`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'UnknownTypeError'\n });\n }\n}\nexport class UnknownSolidityTypeError extends BaseError {\n constructor({ type }) {\n super('Unknown type.', {\n metaMessages: [`Type \"${type}\" is not a valid ABI type.`],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'UnknownSolidityTypeError'\n });\n }\n}\n//# sourceMappingURL=abiItem.js.map","import { BaseError } from '../../errors.js';\nexport class InvalidAbiParameterError extends BaseError {\n constructor({ param }) {\n super('Failed to parse ABI parameter.', {\n details: `parseAbiParameter(${JSON.stringify(param, null, 2)})`,\n docsPath: '/api/human.html#parseabiparameter-1',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidAbiParameterError'\n });\n }\n}\nexport class InvalidAbiParametersError extends BaseError {\n constructor({ params }) {\n super('Failed to parse ABI parameters.', {\n details: `parseAbiParameters(${JSON.stringify(params, null, 2)})`,\n docsPath: '/api/human.html#parseabiparameters-1',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidAbiParametersError'\n });\n }\n}\nexport class InvalidParameterError extends BaseError {\n constructor({ param }) {\n super('Invalid ABI parameter.', {\n details: param,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidParameterError'\n });\n }\n}\nexport class SolidityProtectedKeywordError extends BaseError {\n constructor({ param, name }) {\n super('Invalid ABI parameter.', {\n details: param,\n metaMessages: [\n `\"${name}\" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'SolidityProtectedKeywordError'\n });\n }\n}\nexport class InvalidModifierError extends BaseError {\n constructor({ param, type, modifier, }) {\n super('Invalid ABI parameter.', {\n details: param,\n metaMessages: [\n `Modifier \"${modifier}\" not allowed${type ? ` in \"${type}\" type` : ''}.`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidModifierError'\n });\n }\n}\nexport class InvalidFunctionModifierError extends BaseError {\n constructor({ param, type, modifier, }) {\n super('Invalid ABI parameter.', {\n details: param,\n metaMessages: [\n `Modifier \"${modifier}\" not allowed${type ? ` in \"${type}\" type` : ''}.`,\n `Data location can only be specified for array, struct, or mapping types, but \"${modifier}\" was given.`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidFunctionModifierError'\n });\n }\n}\nexport class InvalidAbiTypeParameterError extends BaseError {\n constructor({ abiParameter, }) {\n super('Invalid ABI parameter.', {\n details: JSON.stringify(abiParameter, null, 2),\n metaMessages: ['ABI parameter type is invalid.'],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidAbiTypeParameterError'\n });\n }\n}\n//# sourceMappingURL=abiParameter.js.map","import { BaseError } from '../../errors.js';\nexport class InvalidSignatureError extends BaseError {\n constructor({ signature, type, }) {\n super(`Invalid ${type} signature.`, {\n details: signature,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidSignatureError'\n });\n }\n}\nexport class UnknownSignatureError extends BaseError {\n constructor({ signature }) {\n super('Unknown signature.', {\n details: signature,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'UnknownSignatureError'\n });\n }\n}\nexport class InvalidStructSignatureError extends BaseError {\n constructor({ signature }) {\n super('Invalid struct signature.', {\n details: signature,\n metaMessages: ['No properties exist.'],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidStructSignatureError'\n });\n }\n}\n//# sourceMappingURL=signature.js.map","import { BaseError } from '../../errors.js';\nexport class CircularReferenceError extends BaseError {\n constructor({ type }) {\n super('Circular reference detected.', {\n metaMessages: [`Struct \"${type}\" is a circular reference.`],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'CircularReferenceError'\n });\n }\n}\n//# sourceMappingURL=struct.js.map","import { BaseError } from '../../errors.js';\nexport class InvalidParenthesisError extends BaseError {\n constructor({ current, depth }) {\n super('Unbalanced parentheses.', {\n metaMessages: [\n `\"${current.trim()}\" has too many ${depth > 0 ? 'opening' : 'closing'} parentheses.`,\n ],\n details: `Depth \"${depth}\"`,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidParenthesisError'\n });\n }\n}\n//# sourceMappingURL=splitParameters.js.map","export function getParameterCacheKey(param, type) {\n if (type)\n return `${type}:${param}`;\n return param;\n}\nexport const parameterCache = new Map([\n ['address', { type: 'address' }],\n ['bool', { type: 'bool' }],\n ['bytes', { type: 'bytes' }],\n ['bytes32', { type: 'bytes32' }],\n ['int', { type: 'int256' }],\n ['int256', { type: 'int256' }],\n ['string', { type: 'string' }],\n ['uint', { type: 'uint256' }],\n ['uint8', { type: 'uint8' }],\n ['uint16', { type: 'uint16' }],\n ['uint24', { type: 'uint24' }],\n ['uint32', { type: 'uint32' }],\n ['uint64', { type: 'uint64' }],\n ['uint96', { type: 'uint96' }],\n ['uint112', { type: 'uint112' }],\n ['uint160', { type: 'uint160' }],\n ['uint192', { type: 'uint192' }],\n ['uint256', { type: 'uint256' }],\n ['address owner', { type: 'address', name: 'owner' }],\n ['address to', { type: 'address', name: 'to' }],\n ['bool approved', { type: 'bool', name: 'approved' }],\n ['bytes _data', { type: 'bytes', name: '_data' }],\n ['bytes data', { type: 'bytes', name: 'data' }],\n ['bytes signature', { type: 'bytes', name: 'signature' }],\n ['bytes32 hash', { type: 'bytes32', name: 'hash' }],\n ['bytes32 r', { type: 'bytes32', name: 'r' }],\n ['bytes32 root', { type: 'bytes32', name: 'root' }],\n ['bytes32 s', { type: 'bytes32', name: 's' }],\n ['string name', { type: 'string', name: 'name' }],\n ['string symbol', { type: 'string', name: 'symbol' }],\n ['string tokenURI', { type: 'string', name: 'tokenURI' }],\n ['uint tokenId', { type: 'uint256', name: 'tokenId' }],\n ['uint8 v', { type: 'uint8', name: 'v' }],\n ['uint256 balance', { type: 'uint256', name: 'balance' }],\n ['uint256 tokenId', { type: 'uint256', name: 'tokenId' }],\n ['uint256 value', { type: 'uint256', name: 'value' }],\n [\n 'event:address indexed from',\n { type: 'address', name: 'from', indexed: true },\n ],\n ['event:address indexed to', { type: 'address', name: 'to', indexed: true }],\n [\n 'event:uint indexed tokenId',\n { type: 'uint256', name: 'tokenId', indexed: true },\n ],\n [\n 'event:uint256 indexed tokenId',\n { type: 'uint256', name: 'tokenId', indexed: true },\n ],\n]);\n//# sourceMappingURL=cache.js.map","import { bytesRegex, execTyped, integerRegex, isTupleRegex, } from '../../regex.js';\nimport { UnknownSolidityTypeError } from '../errors/abiItem.js';\nimport { InvalidFunctionModifierError, InvalidModifierError, InvalidParameterError, SolidityProtectedKeywordError, } from '../errors/abiParameter.js';\nimport { InvalidSignatureError, UnknownSignatureError, } from '../errors/signature.js';\nimport { InvalidParenthesisError } from '../errors/splitParameters.js';\nimport { getParameterCacheKey, parameterCache } from './cache.js';\nimport { eventModifiers, execConstructorSignature, execErrorSignature, execEventSignature, execFunctionSignature, functionModifiers, isConstructorSignature, isErrorSignature, isEventSignature, isFallbackSignature, isFunctionSignature, isReceiveSignature, } from './signatures.js';\nexport function parseSignature(signature, structs = {}) {\n if (isFunctionSignature(signature)) {\n const match = execFunctionSignature(signature);\n if (!match)\n throw new InvalidSignatureError({ signature, type: 'function' });\n const inputParams = splitParameters(match.parameters);\n const inputs = [];\n const inputLength = inputParams.length;\n for (let i = 0; i < inputLength; i++) {\n inputs.push(parseAbiParameter(inputParams[i], {\n modifiers: functionModifiers,\n structs,\n type: 'function',\n }));\n }\n const outputs = [];\n if (match.returns) {\n const outputParams = splitParameters(match.returns);\n const outputLength = outputParams.length;\n for (let i = 0; i < outputLength; i++) {\n outputs.push(parseAbiParameter(outputParams[i], {\n modifiers: functionModifiers,\n structs,\n type: 'function',\n }));\n }\n }\n return {\n name: match.name,\n type: 'function',\n stateMutability: match.stateMutability ?? 'nonpayable',\n inputs,\n outputs,\n };\n }\n if (isEventSignature(signature)) {\n const match = execEventSignature(signature);\n if (!match)\n throw new InvalidSignatureError({ signature, type: 'event' });\n const params = splitParameters(match.parameters);\n const abiParameters = [];\n const length = params.length;\n for (let i = 0; i < length; i++) {\n abiParameters.push(parseAbiParameter(params[i], {\n modifiers: eventModifiers,\n structs,\n type: 'event',\n }));\n }\n return { name: match.name, type: 'event', inputs: abiParameters };\n }\n if (isErrorSignature(signature)) {\n const match = execErrorSignature(signature);\n if (!match)\n throw new InvalidSignatureError({ signature, type: 'error' });\n const params = splitParameters(match.parameters);\n const abiParameters = [];\n const length = params.length;\n for (let i = 0; i < length; i++) {\n abiParameters.push(parseAbiParameter(params[i], { structs, type: 'error' }));\n }\n return { name: match.name, type: 'error', inputs: abiParameters };\n }\n if (isConstructorSignature(signature)) {\n const match = execConstructorSignature(signature);\n if (!match)\n throw new InvalidSignatureError({ signature, type: 'constructor' });\n const params = splitParameters(match.parameters);\n const abiParameters = [];\n const length = params.length;\n for (let i = 0; i < length; i++) {\n abiParameters.push(parseAbiParameter(params[i], { structs, type: 'constructor' }));\n }\n return {\n type: 'constructor',\n stateMutability: match.stateMutability ?? 'nonpayable',\n inputs: abiParameters,\n };\n }\n if (isFallbackSignature(signature))\n return { type: 'fallback' };\n if (isReceiveSignature(signature))\n return {\n type: 'receive',\n stateMutability: 'payable',\n };\n throw new UnknownSignatureError({ signature });\n}\nconst abiParameterWithoutTupleRegex = /^(?[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\\[\\d*?\\])+?)?(?:\\s(?calldata|indexed|memory|storage{1}))?(?:\\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/;\nconst abiParameterWithTupleRegex = /^\\((?.+?)\\)(?(?:\\[\\d*?\\])+?)?(?:\\s(?calldata|indexed|memory|storage{1}))?(?:\\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/;\nconst dynamicIntegerRegex = /^u?int$/;\nexport function parseAbiParameter(param, options) {\n const parameterCacheKey = getParameterCacheKey(param, options?.type);\n if (parameterCache.has(parameterCacheKey))\n return parameterCache.get(parameterCacheKey);\n const isTuple = isTupleRegex.test(param);\n const match = execTyped(isTuple ? abiParameterWithTupleRegex : abiParameterWithoutTupleRegex, param);\n if (!match)\n throw new InvalidParameterError({ param });\n if (match.name && isSolidityKeyword(match.name))\n throw new SolidityProtectedKeywordError({ param, name: match.name });\n const name = match.name ? { name: match.name } : {};\n const indexed = match.modifier === 'indexed' ? { indexed: true } : {};\n const structs = options?.structs ?? {};\n let type;\n let components = {};\n if (isTuple) {\n type = 'tuple';\n const params = splitParameters(match.type);\n const components_ = [];\n const length = params.length;\n for (let i = 0; i < length; i++) {\n components_.push(parseAbiParameter(params[i], { structs }));\n }\n components = { components: components_ };\n }\n else if (match.type in structs) {\n type = 'tuple';\n components = { components: structs[match.type] };\n }\n else if (dynamicIntegerRegex.test(match.type)) {\n type = `${match.type}256`;\n }\n else {\n type = match.type;\n if (!(options?.type === 'struct') && !isSolidityType(type))\n throw new UnknownSolidityTypeError({ type });\n }\n if (match.modifier) {\n if (!options?.modifiers?.has?.(match.modifier))\n throw new InvalidModifierError({\n param,\n type: options?.type,\n modifier: match.modifier,\n });\n if (functionModifiers.has(match.modifier) &&\n !isValidDataLocation(type, !!match.array))\n throw new InvalidFunctionModifierError({\n param,\n type: options?.type,\n modifier: match.modifier,\n });\n }\n const abiParameter = {\n type: `${type}${match.array ?? ''}`,\n ...name,\n ...indexed,\n ...components,\n };\n parameterCache.set(parameterCacheKey, abiParameter);\n return abiParameter;\n}\nexport function splitParameters(params, result = [], current = '', depth = 0) {\n if (params === '') {\n if (current === '')\n return result;\n if (depth !== 0)\n throw new InvalidParenthesisError({ current, depth });\n result.push(current.trim());\n return result;\n }\n const length = params.length;\n for (let i = 0; i < length; i++) {\n const char = params[i];\n const tail = params.slice(i + 1);\n switch (char) {\n case ',':\n return depth === 0\n ? splitParameters(tail, [...result, current.trim()])\n : splitParameters(tail, result, `${current}${char}`, depth);\n case '(':\n return splitParameters(tail, result, `${current}${char}`, depth + 1);\n case ')':\n return splitParameters(tail, result, `${current}${char}`, depth - 1);\n default:\n return splitParameters(tail, result, `${current}${char}`, depth);\n }\n }\n return [];\n}\nexport function isSolidityType(type) {\n return (type === 'address' ||\n type === 'bool' ||\n type === 'function' ||\n type === 'string' ||\n bytesRegex.test(type) ||\n integerRegex.test(type));\n}\nconst protectedKeywordsRegex = /^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;\nexport function isSolidityKeyword(name) {\n return (name === 'address' ||\n name === 'bool' ||\n name === 'function' ||\n name === 'string' ||\n name === 'tuple' ||\n bytesRegex.test(name) ||\n integerRegex.test(name) ||\n protectedKeywordsRegex.test(name));\n}\nexport function isValidDataLocation(type, isArray) {\n return isArray || type === 'bytes' || type === 'string' || type === 'tuple';\n}\n//# sourceMappingURL=utils.js.map","import { execTyped, isTupleRegex } from '../../regex.js';\nimport { UnknownTypeError } from '../errors/abiItem.js';\nimport { InvalidAbiTypeParameterError } from '../errors/abiParameter.js';\nimport { InvalidSignatureError, InvalidStructSignatureError, } from '../errors/signature.js';\nimport { CircularReferenceError } from '../errors/struct.js';\nimport { execStructSignature, isStructSignature } from './signatures.js';\nimport { isSolidityType, parseAbiParameter } from './utils.js';\nexport function parseStructs(signatures) {\n const shallowStructs = {};\n const signaturesLength = signatures.length;\n for (let i = 0; i < signaturesLength; i++) {\n const signature = signatures[i];\n if (!isStructSignature(signature))\n continue;\n const match = execStructSignature(signature);\n if (!match)\n throw new InvalidSignatureError({ signature, type: 'struct' });\n const properties = match.properties.split(';');\n const components = [];\n const propertiesLength = properties.length;\n for (let k = 0; k < propertiesLength; k++) {\n const property = properties[k];\n const trimmed = property.trim();\n if (!trimmed)\n continue;\n const abiParameter = parseAbiParameter(trimmed, {\n type: 'struct',\n });\n components.push(abiParameter);\n }\n if (!components.length)\n throw new InvalidStructSignatureError({ signature });\n shallowStructs[match.name] = components;\n }\n const resolvedStructs = {};\n const entries = Object.entries(shallowStructs);\n const entriesLength = entries.length;\n for (let i = 0; i < entriesLength; i++) {\n const [name, parameters] = entries[i];\n resolvedStructs[name] = resolveStructs(parameters, shallowStructs);\n }\n return resolvedStructs;\n}\nconst typeWithoutTupleRegex = /^(?[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\\[\\d*?\\])+?)?$/;\nfunction resolveStructs(abiParameters, structs, ancestors = new Set()) {\n const components = [];\n const length = abiParameters.length;\n for (let i = 0; i < length; i++) {\n const abiParameter = abiParameters[i];\n const isTuple = isTupleRegex.test(abiParameter.type);\n if (isTuple)\n components.push(abiParameter);\n else {\n const match = execTyped(typeWithoutTupleRegex, abiParameter.type);\n if (!match?.type)\n throw new InvalidAbiTypeParameterError({ abiParameter });\n const { array, type } = match;\n if (type in structs) {\n if (ancestors.has(type))\n throw new CircularReferenceError({ type });\n components.push({\n ...abiParameter,\n type: `tuple${array ?? ''}`,\n components: resolveStructs(structs[type] ?? [], structs, new Set([...ancestors, type])),\n });\n }\n else {\n if (isSolidityType(type))\n components.push(abiParameter);\n else\n throw new UnknownTypeError({ type });\n }\n }\n }\n return components;\n}\n//# sourceMappingURL=structs.js.map","import { isStructSignature } from './runtime/signatures.js';\nimport { parseStructs } from './runtime/structs.js';\nimport { parseSignature } from './runtime/utils.js';\nexport function parseAbi(signatures) {\n const structs = parseStructs(signatures);\n const abi = [];\n const length = signatures.length;\n for (let i = 0; i < length; i++) {\n const signature = signatures[i];\n if (isStructSignature(signature))\n continue;\n abi.push(parseSignature(signature, structs));\n }\n return abi;\n}\n//# sourceMappingURL=parseAbi.js.map","import { InvalidAbiParametersError } from '../index.js';\nimport { isStructSignature, modifiers } from './runtime/signatures.js';\nimport { parseStructs } from './runtime/structs.js';\nimport { splitParameters } from './runtime/utils.js';\nimport { parseAbiParameter as parseAbiParameter_ } from './runtime/utils.js';\nexport function parseAbiParameters(params) {\n const abiParameters = [];\n if (typeof params === 'string') {\n const parameters = splitParameters(params);\n const length = parameters.length;\n for (let i = 0; i < length; i++) {\n abiParameters.push(parseAbiParameter_(parameters[i], { modifiers }));\n }\n }\n else {\n const structs = parseStructs(params);\n const length = params.length;\n for (let i = 0; i < length; i++) {\n const signature = params[i];\n if (isStructSignature(signature))\n continue;\n const parameters = splitParameters(signature);\n const length = parameters.length;\n for (let k = 0; k < length; k++) {\n abiParameters.push(parseAbiParameter_(parameters[k], { modifiers, structs }));\n }\n }\n }\n if (abiParameters.length === 0)\n throw new InvalidAbiParametersError({ params });\n return abiParameters;\n}\n//# sourceMappingURL=parseAbiParameters.js.map","import { InvalidDefinitionTypeError } from '../../errors/abi.js';\nexport function formatAbiItem(abiItem, { includeName = false } = {}) {\n if (abiItem.type !== 'function' &&\n abiItem.type !== 'event' &&\n abiItem.type !== 'error')\n throw new InvalidDefinitionTypeError(abiItem.type);\n return `${abiItem.name}(${formatAbiParams(abiItem.inputs, { includeName })})`;\n}\nexport function formatAbiParams(params, { includeName = false } = {}) {\n if (!params)\n return '';\n return params\n .map((param) => formatAbiParam(param, { includeName }))\n .join(includeName ? ', ' : ',');\n}\nfunction formatAbiParam(param, { includeName }) {\n if (param.type.startsWith('tuple')) {\n return `(${formatAbiParams(param.components, { includeName })})${param.type.slice('tuple'.length)}`;\n }\n return param.type + (includeName && param.name ? ` ${param.name}` : '');\n}\n//# sourceMappingURL=formatAbiItem.js.map","export function isHex(value, { strict = true } = {}) {\n if (!value)\n return false;\n if (typeof value !== 'string')\n return false;\n return strict ? /^0x[0-9a-fA-F]*$/.test(value) : value.startsWith('0x');\n}\n//# sourceMappingURL=isHex.js.map","import { isHex } from './isHex.js';\n/**\n * @description Retrieves the size of the value (in bytes).\n *\n * @param value The value (hex or byte array) to retrieve the size of.\n * @returns The size of the value (in bytes).\n */\nexport function size(value) {\n if (isHex(value, { strict: false }))\n return Math.ceil((value.length - 2) / 2);\n return value.length;\n}\n//# sourceMappingURL=size.js.map","export const version = '1.5.4';\n//# sourceMappingURL=version.js.map","import { version } from './version.js';\nexport const getContractAddress = (address) => address;\nexport const getUrl = (url) => url;\nexport const getVersion = () => `viem@${version}`;\n//# sourceMappingURL=utils.js.map","import { getVersion } from './utils.js';\nexport class BaseError extends Error {\n constructor(shortMessage, args = {}) {\n super();\n Object.defineProperty(this, \"details\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"docsPath\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"metaMessages\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"shortMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ViemError'\n });\n Object.defineProperty(this, \"version\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: getVersion()\n });\n const details = args.cause instanceof BaseError\n ? args.cause.details\n : args.cause?.message\n ? args.cause.message\n : args.details;\n const docsPath = args.cause instanceof BaseError\n ? args.cause.docsPath || args.docsPath\n : args.docsPath;\n this.message = [\n shortMessage || 'An error occurred.',\n '',\n ...(args.metaMessages ? [...args.metaMessages, ''] : []),\n ...(docsPath\n ? [\n `Docs: https://viem.sh${docsPath}.html${args.docsSlug ? `#${args.docsSlug}` : ''}`,\n ]\n : []),\n ...(details ? [`Details: ${details}`] : []),\n `Version: ${this.version}`,\n ].join('\\n');\n if (args.cause)\n this.cause = args.cause;\n this.details = details;\n this.docsPath = docsPath;\n this.metaMessages = args.metaMessages;\n this.shortMessage = shortMessage;\n }\n walk(fn) {\n return walk(this, fn);\n }\n}\nfunction walk(err, fn) {\n if (fn?.(err))\n return err;\n if (err && typeof err === 'object' && 'cause' in err)\n return walk(err.cause, fn);\n return fn ? null : err;\n}\n//# sourceMappingURL=base.js.map","import { formatAbiItem, formatAbiParams } from '../utils/abi/formatAbiItem.js';\nimport { size } from '../utils/data/size.js';\nimport { BaseError } from './base.js';\nexport class AbiConstructorNotFoundError extends BaseError {\n constructor({ docsPath }) {\n super([\n 'A constructor was not found on the ABI.',\n 'Make sure you are using the correct ABI and that the constructor exists on it.',\n ].join('\\n'), {\n docsPath,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiConstructorNotFoundError'\n });\n }\n}\nexport class AbiConstructorParamsNotFoundError extends BaseError {\n constructor({ docsPath }) {\n super([\n 'Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.',\n 'Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists.',\n ].join('\\n'), {\n docsPath,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiConstructorParamsNotFoundError'\n });\n }\n}\nexport class AbiDecodingDataSizeInvalidError extends BaseError {\n constructor({ data, size }) {\n super([\n `Data size of ${size} bytes is invalid.`,\n 'Size must be in increments of 32 bytes (size % 32 === 0).',\n ].join('\\n'), { metaMessages: [`Data: ${data} (${size} bytes)`] });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiDecodingDataSizeInvalidError'\n });\n }\n}\nexport class AbiDecodingDataSizeTooSmallError extends BaseError {\n constructor({ data, params, size, }) {\n super([`Data size of ${size} bytes is too small for given parameters.`].join('\\n'), {\n metaMessages: [\n `Params: (${formatAbiParams(params, { includeName: true })})`,\n `Data: ${data} (${size} bytes)`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiDecodingDataSizeTooSmallError'\n });\n Object.defineProperty(this, \"data\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"params\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"size\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.data = data;\n this.params = params;\n this.size = size;\n }\n}\nexport class AbiDecodingZeroDataError extends BaseError {\n constructor() {\n super('Cannot decode zero data (\"0x\") with ABI parameters.');\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiDecodingZeroDataError'\n });\n }\n}\nexport class AbiEncodingArrayLengthMismatchError extends BaseError {\n constructor({ expectedLength, givenLength, type, }) {\n super([\n `ABI encoding array length mismatch for type ${type}.`,\n `Expected length: ${expectedLength}`,\n `Given length: ${givenLength}`,\n ].join('\\n'));\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiEncodingArrayLengthMismatchError'\n });\n }\n}\nexport class AbiEncodingBytesSizeMismatchError extends BaseError {\n constructor({ expectedSize, value }) {\n super(`Size of bytes \"${value}\" (bytes${size(value)}) does not match expected size (bytes${expectedSize}).`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiEncodingBytesSizeMismatchError'\n });\n }\n}\nexport class AbiEncodingLengthMismatchError extends BaseError {\n constructor({ expectedLength, givenLength, }) {\n super([\n 'ABI encoding params/values length mismatch.',\n `Expected length (params): ${expectedLength}`,\n `Given length (values): ${givenLength}`,\n ].join('\\n'));\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiEncodingLengthMismatchError'\n });\n }\n}\nexport class AbiErrorInputsNotFoundError extends BaseError {\n constructor(errorName, { docsPath }) {\n super([\n `Arguments (\\`args\\`) were provided to \"${errorName}\", but \"${errorName}\" on the ABI does not contain any parameters (\\`inputs\\`).`,\n 'Cannot encode error result without knowing what the parameter types are.',\n 'Make sure you are using the correct ABI and that the inputs exist on it.',\n ].join('\\n'), {\n docsPath,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiErrorInputsNotFoundError'\n });\n }\n}\nexport class AbiErrorNotFoundError extends BaseError {\n constructor(errorName, { docsPath } = {}) {\n super([\n `Error ${errorName ? `\"${errorName}\" ` : ''}not found on ABI.`,\n 'Make sure you are using the correct ABI and that the error exists on it.',\n ].join('\\n'), {\n docsPath,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiErrorNotFoundError'\n });\n }\n}\nexport class AbiErrorSignatureNotFoundError extends BaseError {\n constructor(signature, { docsPath }) {\n super([\n `Encoded error signature \"${signature}\" not found on ABI.`,\n 'Make sure you are using the correct ABI and that the error exists on it.',\n `You can look up the decoded signature here: https://openchain.xyz/signatures?query=${signature}.`,\n ].join('\\n'), {\n docsPath,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiErrorSignatureNotFoundError'\n });\n Object.defineProperty(this, \"signature\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.signature = signature;\n }\n}\nexport class AbiEventSignatureEmptyTopicsError extends BaseError {\n constructor({ docsPath }) {\n super('Cannot extract event signature from empty topics.', {\n docsPath,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiEventSignatureEmptyTopicsError'\n });\n }\n}\nexport class AbiEventSignatureNotFoundError extends BaseError {\n constructor(signature, { docsPath }) {\n super([\n `Encoded event signature \"${signature}\" not found on ABI.`,\n 'Make sure you are using the correct ABI and that the event exists on it.',\n `You can look up the signature here: https://openchain.xyz/signatures?query=${signature}.`,\n ].join('\\n'), {\n docsPath,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiEventSignatureNotFoundError'\n });\n }\n}\nexport class AbiEventNotFoundError extends BaseError {\n constructor(eventName, { docsPath } = {}) {\n super([\n `Event ${eventName ? `\"${eventName}\" ` : ''}not found on ABI.`,\n 'Make sure you are using the correct ABI and that the event exists on it.',\n ].join('\\n'), {\n docsPath,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiEventNotFoundError'\n });\n }\n}\nexport class AbiFunctionNotFoundError extends BaseError {\n constructor(functionName, { docsPath } = {}) {\n super([\n `Function ${functionName ? `\"${functionName}\" ` : ''}not found on ABI.`,\n 'Make sure you are using the correct ABI and that the function exists on it.',\n ].join('\\n'), {\n docsPath,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiFunctionNotFoundError'\n });\n }\n}\nexport class AbiFunctionOutputsNotFoundError extends BaseError {\n constructor(functionName, { docsPath }) {\n super([\n `Function \"${functionName}\" does not contain any \\`outputs\\` on ABI.`,\n 'Cannot decode function result without knowing what the parameter types are.',\n 'Make sure you are using the correct ABI and that the function exists on it.',\n ].join('\\n'), {\n docsPath,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiFunctionOutputsNotFoundError'\n });\n }\n}\nexport class AbiFunctionSignatureNotFoundError extends BaseError {\n constructor(signature, { docsPath }) {\n super([\n `Encoded function signature \"${signature}\" not found on ABI.`,\n 'Make sure you are using the correct ABI and that the function exists on it.',\n `You can look up the signature here: https://openchain.xyz/signatures?query=${signature}.`,\n ].join('\\n'), {\n docsPath,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AbiFunctionSignatureNotFoundError'\n });\n }\n}\nexport class BytesSizeMismatchError extends BaseError {\n constructor({ expectedSize, givenSize, }) {\n super(`Expected bytes${expectedSize}, got bytes${givenSize}.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'BytesSizeMismatchError'\n });\n }\n}\nexport class DecodeLogDataMismatch extends BaseError {\n constructor({ abiItem, data, params, size, }) {\n super([\n `Data size of ${size} bytes is too small for non-indexed event parameters.`,\n ].join('\\n'), {\n metaMessages: [\n `Params: (${formatAbiParams(params, { includeName: true })})`,\n `Data: ${data} (${size} bytes)`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'DecodeLogDataMismatch'\n });\n Object.defineProperty(this, \"abiItem\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"data\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"params\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"size\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.abiItem = abiItem;\n this.data = data;\n this.params = params;\n this.size = size;\n }\n}\nexport class DecodeLogTopicsMismatch extends BaseError {\n constructor({ abiItem, param, }) {\n super([\n `Expected a topic for indexed event parameter${param.name ? ` \"${param.name}\"` : ''} on event \"${formatAbiItem(abiItem, { includeName: true })}\".`,\n ].join('\\n'));\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'DecodeLogTopicsMismatch'\n });\n Object.defineProperty(this, \"abiItem\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.abiItem = abiItem;\n }\n}\nexport class InvalidAbiEncodingTypeError extends BaseError {\n constructor(type, { docsPath }) {\n super([\n `Type \"${type}\" is not a valid encoding type.`,\n 'Please provide a valid ABI type.',\n ].join('\\n'), { docsPath });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidAbiEncodingType'\n });\n }\n}\nexport class InvalidAbiDecodingTypeError extends BaseError {\n constructor(type, { docsPath }) {\n super([\n `Type \"${type}\" is not a valid decoding type.`,\n 'Please provide a valid ABI type.',\n ].join('\\n'), { docsPath });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidAbiDecodingType'\n });\n }\n}\nexport class InvalidArrayError extends BaseError {\n constructor(value) {\n super([`Value \"${value}\" is not a valid array.`].join('\\n'));\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidArrayError'\n });\n }\n}\nexport class InvalidDefinitionTypeError extends BaseError {\n constructor(type) {\n super([\n `\"${type}\" is not a valid definition type.`,\n 'Valid types: \"function\", \"event\", \"error\"',\n ].join('\\n'));\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidDefinitionTypeError'\n });\n }\n}\nexport class UnsupportedPackedAbiType extends BaseError {\n constructor(type) {\n super(`Type \"${type}\" is not supported for packed encoding.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'UnsupportedPackedAbiType'\n });\n }\n}\n//# sourceMappingURL=abi.js.map","import { BaseError } from './base.js';\nexport class FilterTypeNotSupportedError extends BaseError {\n constructor(type) {\n super(`Filter type \"${type}\" is not supported.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'FilterTypeNotSupportedError'\n });\n }\n}\n//# sourceMappingURL=log.js.map","import { BaseError } from './base.js';\nexport class SliceOffsetOutOfBoundsError extends BaseError {\n constructor({ offset, position, size, }) {\n super(`Slice ${position === 'start' ? 'starting' : 'ending'} at offset \"${offset}\" is out-of-bounds (size: ${size}).`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'SliceOffsetOutOfBoundsError'\n });\n }\n}\nexport class SizeExceedsPaddingSizeError extends BaseError {\n constructor({ size, targetSize, type, }) {\n super(`${type.charAt(0).toUpperCase()}${type\n .slice(1)\n .toLowerCase()} size (${size}) exceeds padding size (${targetSize}).`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'SizeExceedsPaddingSizeError'\n });\n }\n}\n//# sourceMappingURL=data.js.map","import { SizeExceedsPaddingSizeError } from '../../errors/data.js';\nexport function pad(hexOrBytes, { dir, size = 32 } = {}) {\n if (typeof hexOrBytes === 'string')\n return padHex(hexOrBytes, { dir, size });\n return padBytes(hexOrBytes, { dir, size });\n}\nexport function padHex(hex_, { dir, size = 32 } = {}) {\n if (size === null)\n return hex_;\n const hex = hex_.replace('0x', '');\n if (hex.length > size * 2)\n throw new SizeExceedsPaddingSizeError({\n size: Math.ceil(hex.length / 2),\n targetSize: size,\n type: 'hex',\n });\n return `0x${hex[dir === 'right' ? 'padEnd' : 'padStart'](size * 2, '0')}`;\n}\nexport function padBytes(bytes, { dir, size = 32 } = {}) {\n if (size === null)\n return bytes;\n if (bytes.length > size)\n throw new SizeExceedsPaddingSizeError({\n size: bytes.length,\n targetSize: size,\n type: 'bytes',\n });\n const paddedBytes = new Uint8Array(size);\n for (let i = 0; i < size; i++) {\n const padEnd = dir === 'right';\n paddedBytes[padEnd ? i : size - i - 1] =\n bytes[padEnd ? i : bytes.length - i - 1];\n }\n return paddedBytes;\n}\n//# sourceMappingURL=pad.js.map","import { BaseError } from './base.js';\nexport class DataLengthTooLongError extends BaseError {\n constructor({ consumed, length }) {\n super(`Consumed bytes (${consumed}) is shorter than data length (${length - 1}).`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'DataLengthTooLongError'\n });\n }\n}\nexport class DataLengthTooShortError extends BaseError {\n constructor({ length, dataLength }) {\n super(`Data length (${dataLength - 1}) is shorter than prefix length (${length - 1}).`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'DataLengthTooShortError'\n });\n }\n}\nexport class IntegerOutOfRangeError extends BaseError {\n constructor({ max, min, signed, size, value, }) {\n super(`Number \"${value}\" is not in safe ${size ? `${size * 8}-bit ${signed ? 'signed' : 'unsigned'} ` : ''}integer range ${max ? `(${min} to ${max})` : `(above ${min})`}`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'IntegerOutOfRangeError'\n });\n }\n}\nexport class InvalidBytesBooleanError extends BaseError {\n constructor(bytes) {\n super(`Bytes value \"${bytes}\" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidBytesBooleanError'\n });\n }\n}\nexport class InvalidHexBooleanError extends BaseError {\n constructor(hex) {\n super(`Hex value \"${hex}\" is not a valid boolean. The hex value must be \"0x0\" (false) or \"0x1\" (true).`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidHexBooleanError'\n });\n }\n}\nexport class InvalidHexValueError extends BaseError {\n constructor(value) {\n super(`Hex value \"${value}\" is an odd length (${value.length}). It must be an even length.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidHexValueError'\n });\n }\n}\nexport class OffsetOutOfBoundsError extends BaseError {\n constructor({ nextOffset, offset }) {\n super(`Next offset (${nextOffset}) is greater than previous offset + consumed bytes (${offset})`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'OffsetOutOfBoundsError'\n });\n }\n}\nexport class SizeOverflowError extends BaseError {\n constructor({ givenSize, maxSize }) {\n super(`Size cannot exceed ${maxSize} bytes. Given size: ${givenSize} bytes.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'SizeOverflowError'\n });\n }\n}\n//# sourceMappingURL=encoding.js.map","export function trim(hexOrBytes, { dir = 'left' } = {}) {\n let data = typeof hexOrBytes === 'string' ? hexOrBytes.replace('0x', '') : hexOrBytes;\n let sliceLength = 0;\n for (let i = 0; i < data.length - 1; i++) {\n if (data[dir === 'left' ? i : data.length - i - 1].toString() === '0')\n sliceLength++;\n else\n break;\n }\n data =\n dir === 'left'\n ? data.slice(sliceLength)\n : data.slice(0, data.length - sliceLength);\n if (typeof hexOrBytes === 'string') {\n if (data.length === 1 && dir === 'right')\n data = `${data}0`;\n return `0x${data.length % 2 === 1 ? `0${data}` : data}`;\n }\n return data;\n}\n//# sourceMappingURL=trim.js.map","import { InvalidHexBooleanError, SizeOverflowError, } from '../../errors/encoding.js';\nimport { size as size_ } from '../data/size.js';\nimport { trim } from '../data/trim.js';\nimport { hexToBytes } from './toBytes.js';\nexport function assertSize(hexOrBytes, { size }) {\n if (size_(hexOrBytes) > size)\n throw new SizeOverflowError({\n givenSize: size_(hexOrBytes),\n maxSize: size,\n });\n}\n/**\n * Decodes a hex string into a string, number, bigint, boolean, or byte array.\n *\n * - Docs: https://viem.sh/docs/utilities/fromHex.html\n * - Example: https://viem.sh/docs/utilities/fromHex.html#usage\n *\n * @param hex Hex string to decode.\n * @param toOrOpts Type to convert to or options.\n * @returns Decoded value.\n *\n * @example\n * import { fromHex } from 'viem'\n * const data = fromHex('0x1a4', 'number')\n * // 420\n *\n * @example\n * import { fromHex } from 'viem'\n * const data = fromHex('0x48656c6c6f20576f726c6421', 'string')\n * // 'Hello world'\n *\n * @example\n * import { fromHex } from 'viem'\n * const data = fromHex('0x48656c6c6f20576f726c64210000000000000000000000000000000000000000', {\n * size: 32,\n * to: 'string'\n * })\n * // 'Hello world'\n */\nexport function fromHex(hex, toOrOpts) {\n const opts = typeof toOrOpts === 'string' ? { to: toOrOpts } : toOrOpts;\n const to = opts.to;\n if (to === 'number')\n return hexToNumber(hex, opts);\n if (to === 'bigint')\n return hexToBigInt(hex, opts);\n if (to === 'string')\n return hexToString(hex, opts);\n if (to === 'boolean')\n return hexToBool(hex, opts);\n return hexToBytes(hex, opts);\n}\n/**\n * Decodes a hex value into a bigint.\n *\n * - Docs: https://viem.sh/docs/utilities/fromHex.html#hextobigint\n *\n * @param hex Hex value to decode.\n * @param opts Options.\n * @returns BigInt value.\n *\n * @example\n * import { hexToBigInt } from 'viem'\n * const data = hexToBigInt('0x1a4', { signed: true })\n * // 420n\n *\n * @example\n * import { hexToBigInt } from 'viem'\n * const data = hexToBigInt('0x00000000000000000000000000000000000000000000000000000000000001a4', { size: 32 })\n * // 420n\n */\nexport function hexToBigInt(hex, opts = {}) {\n const { signed } = opts;\n if (opts.size)\n assertSize(hex, { size: opts.size });\n const value = BigInt(hex);\n if (!signed)\n return value;\n const size = (hex.length - 2) / 2;\n const max = (1n << (BigInt(size) * 8n - 1n)) - 1n;\n if (value <= max)\n return value;\n return value - BigInt(`0x${'f'.padStart(size * 2, 'f')}`) - 1n;\n}\n/**\n * Decodes a hex value into a boolean.\n *\n * - Docs: https://viem.sh/docs/utilities/fromHex.html#hextobool\n *\n * @param hex Hex value to decode.\n * @param opts Options.\n * @returns Boolean value.\n *\n * @example\n * import { hexToBool } from 'viem'\n * const data = hexToBool('0x01')\n * // true\n *\n * @example\n * import { hexToBool } from 'viem'\n * const data = hexToBool('0x0000000000000000000000000000000000000000000000000000000000000001', { size: 32 })\n * // true\n */\nexport function hexToBool(hex_, opts = {}) {\n let hex = hex_;\n if (opts.size) {\n assertSize(hex, { size: opts.size });\n hex = trim(hex);\n }\n if (trim(hex) === '0x00')\n return false;\n if (trim(hex) === '0x01')\n return true;\n throw new InvalidHexBooleanError(hex);\n}\n/**\n * Decodes a hex string into a number.\n *\n * - Docs: https://viem.sh/docs/utilities/fromHex.html#hextonumber\n *\n * @param hex Hex value to decode.\n * @param opts Options.\n * @returns Number value.\n *\n * @example\n * import { hexToNumber } from 'viem'\n * const data = hexToNumber('0x1a4')\n * // 420\n *\n * @example\n * import { hexToNumber } from 'viem'\n * const data = hexToBigInt('0x00000000000000000000000000000000000000000000000000000000000001a4', { size: 32 })\n * // 420\n */\nexport function hexToNumber(hex, opts = {}) {\n return Number(hexToBigInt(hex, opts));\n}\n/**\n * Decodes a hex value into a UTF-8 string.\n *\n * - Docs: https://viem.sh/docs/utilities/fromHex.html#hextostring\n *\n * @param hex Hex value to decode.\n * @param opts Options.\n * @returns String value.\n *\n * @example\n * import { hexToString } from 'viem'\n * const data = hexToString('0x48656c6c6f20576f726c6421')\n * // 'Hello world!'\n *\n * @example\n * import { hexToString } from 'viem'\n * const data = hexToString('0x48656c6c6f20576f726c64210000000000000000000000000000000000000000', {\n * size: 32,\n * })\n * // 'Hello world'\n */\nexport function hexToString(hex, opts = {}) {\n let bytes = hexToBytes(hex);\n if (opts.size) {\n assertSize(bytes, { size: opts.size });\n bytes = trim(bytes, { dir: 'right' });\n }\n return new TextDecoder().decode(bytes);\n}\n//# sourceMappingURL=fromHex.js.map","import { IntegerOutOfRangeError } from '../../errors/encoding.js';\nimport { pad } from '../data/pad.js';\nimport { assertSize } from './fromHex.js';\nconst hexes = /*#__PURE__*/ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, '0'));\n/**\n * Encodes a string, number, bigint, or ByteArray into a hex string\n *\n * - Docs: https://viem.sh/docs/utilities/toHex.html\n * - Example: https://viem.sh/docs/utilities/toHex.html#usage\n *\n * @param value Value to encode.\n * @param opts Options.\n * @returns Hex value.\n *\n * @example\n * import { toHex } from 'viem'\n * const data = toHex('Hello world')\n * // '0x48656c6c6f20776f726c6421'\n *\n * @example\n * import { toHex } from 'viem'\n * const data = toHex(420)\n * // '0x1a4'\n *\n * @example\n * import { toHex } from 'viem'\n * const data = toHex('Hello world', { size: 32 })\n * // '0x48656c6c6f20776f726c64210000000000000000000000000000000000000000'\n */\nexport function toHex(value, opts = {}) {\n if (typeof value === 'number' || typeof value === 'bigint')\n return numberToHex(value, opts);\n if (typeof value === 'string') {\n return stringToHex(value, opts);\n }\n if (typeof value === 'boolean')\n return boolToHex(value, opts);\n return bytesToHex(value, opts);\n}\n/**\n * Encodes a boolean into a hex string\n *\n * - Docs: https://viem.sh/docs/utilities/toHex.html#booltohex\n *\n * @param value Value to encode.\n * @param opts Options.\n * @returns Hex value.\n *\n * @example\n * import { boolToHex } from 'viem'\n * const data = boolToHex(true)\n * // '0x1'\n *\n * @example\n * import { boolToHex } from 'viem'\n * const data = boolToHex(false)\n * // '0x0'\n *\n * @example\n * import { boolToHex } from 'viem'\n * const data = boolToHex(true, { size: 32 })\n * // '0x0000000000000000000000000000000000000000000000000000000000000001'\n */\nexport function boolToHex(value, opts = {}) {\n const hex = `0x${Number(value)}`;\n if (typeof opts.size === 'number') {\n assertSize(hex, { size: opts.size });\n return pad(hex, { size: opts.size });\n }\n return hex;\n}\n/**\n * Encodes a bytes array into a hex string\n *\n * - Docs: https://viem.sh/docs/utilities/toHex.html#bytestohex\n *\n * @param value Value to encode.\n * @param opts Options.\n * @returns Hex value.\n *\n * @example\n * import { bytesToHex } from 'viem'\n * const data = bytesToHex(Uint8Array.from([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33])\n * // '0x48656c6c6f20576f726c6421'\n *\n * @example\n * import { bytesToHex } from 'viem'\n * const data = bytesToHex(Uint8Array.from([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33]), { size: 32 })\n * // '0x48656c6c6f20576f726c64210000000000000000000000000000000000000000'\n */\nexport function bytesToHex(value, opts = {}) {\n let hexString = '';\n for (let i = 0; i < value.length; i++) {\n hexString += hexes[value[i]];\n }\n const hex = `0x${hexString}`;\n if (typeof opts.size === 'number') {\n assertSize(hex, { size: opts.size });\n return pad(hex, { dir: 'right', size: opts.size });\n }\n return hex;\n}\n/**\n * Encodes a number or bigint into a hex string\n *\n * - Docs: https://viem.sh/docs/utilities/toHex.html#numbertohex\n *\n * @param value Value to encode.\n * @param opts Options.\n * @returns Hex value.\n *\n * @example\n * import { numberToHex } from 'viem'\n * const data = numberToHex(420)\n * // '0x1a4'\n *\n * @example\n * import { numberToHex } from 'viem'\n * const data = numberToHex(420, { size: 32 })\n * // '0x00000000000000000000000000000000000000000000000000000000000001a4'\n */\nexport function numberToHex(value_, opts = {}) {\n const { signed, size } = opts;\n const value = BigInt(value_);\n let maxValue;\n if (size) {\n if (signed)\n maxValue = (1n << (BigInt(size) * 8n - 1n)) - 1n;\n else\n maxValue = 2n ** (BigInt(size) * 8n) - 1n;\n }\n else if (typeof value_ === 'number') {\n maxValue = BigInt(Number.MAX_SAFE_INTEGER);\n }\n const minValue = typeof maxValue === 'bigint' && signed ? -maxValue - 1n : 0;\n if ((maxValue && value > maxValue) || value < minValue) {\n const suffix = typeof value_ === 'bigint' ? 'n' : '';\n throw new IntegerOutOfRangeError({\n max: maxValue ? `${maxValue}${suffix}` : undefined,\n min: `${minValue}${suffix}`,\n signed,\n size,\n value: `${value_}${suffix}`,\n });\n }\n const hex = `0x${(signed && value < 0\n ? (1n << BigInt(size * 8)) + BigInt(value)\n : value).toString(16)}`;\n if (size)\n return pad(hex, { size });\n return hex;\n}\nconst encoder = /*#__PURE__*/ new TextEncoder();\n/**\n * Encodes a UTF-8 string into a hex string\n *\n * - Docs: https://viem.sh/docs/utilities/toHex.html#stringtohex\n *\n * @param value Value to encode.\n * @param opts Options.\n * @returns Hex value.\n *\n * @example\n * import { stringToHex } from 'viem'\n * const data = stringToHex('Hello World!')\n * // '0x48656c6c6f20576f726c6421'\n *\n * @example\n * import { stringToHex } from 'viem'\n * const data = stringToHex('Hello World!', { size: 32 })\n * // '0x48656c6c6f20576f726c64210000000000000000000000000000000000000000'\n */\nexport function stringToHex(value_, opts = {}) {\n const value = encoder.encode(value_);\n return bytesToHex(value, opts);\n}\n//# sourceMappingURL=toHex.js.map","import { BaseError } from '../../errors/base.js';\nimport { isHex } from '../data/isHex.js';\nimport { pad } from '../data/pad.js';\nimport { assertSize } from './fromHex.js';\nimport { numberToHex } from './toHex.js';\nconst encoder = /*#__PURE__*/ new TextEncoder();\n/**\n * Encodes a UTF-8 string, hex value, bigint, number or boolean to a byte array.\n *\n * - Docs: https://viem.sh/docs/utilities/toBytes.html\n * - Example: https://viem.sh/docs/utilities/toBytes.html#usage\n *\n * @param value Value to encode.\n * @param opts Options.\n * @returns Byte array value.\n *\n * @example\n * import { toBytes } from 'viem'\n * const data = toBytes('Hello world')\n * // Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33])\n *\n * @example\n * import { toBytes } from 'viem'\n * const data = toBytes(420)\n * // Uint8Array([1, 164])\n *\n * @example\n * import { toBytes } from 'viem'\n * const data = toBytes(420, { size: 4 })\n * // Uint8Array([0, 0, 1, 164])\n */\nexport function toBytes(value, opts = {}) {\n if (typeof value === 'number' || typeof value === 'bigint')\n return numberToBytes(value, opts);\n if (typeof value === 'boolean')\n return boolToBytes(value, opts);\n if (isHex(value))\n return hexToBytes(value, opts);\n return stringToBytes(value, opts);\n}\n/**\n * Encodes a boolean into a byte array.\n *\n * - Docs: https://viem.sh/docs/utilities/toBytes.html#booltobytes\n *\n * @param value Boolean value to encode.\n * @param opts Options.\n * @returns Byte array value.\n *\n * @example\n * import { boolToBytes } from 'viem'\n * const data = boolToBytes(true)\n * // Uint8Array([1])\n *\n * @example\n * import { boolToBytes } from 'viem'\n * const data = boolToBytes(true, { size: 32 })\n * // 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, 1])\n */\nexport function boolToBytes(value, opts = {}) {\n const bytes = new Uint8Array(1);\n bytes[0] = Number(value);\n if (typeof opts.size === 'number') {\n assertSize(bytes, { size: opts.size });\n return pad(bytes, { size: opts.size });\n }\n return bytes;\n}\n/**\n * Encodes a hex string into a byte array.\n *\n * - Docs: https://viem.sh/docs/utilities/toBytes.html#hextobytes\n *\n * @param hex Hex string to encode.\n * @param opts Options.\n * @returns Byte array value.\n *\n * @example\n * import { hexToBytes } from 'viem'\n * const data = hexToBytes('0x48656c6c6f20776f726c6421')\n * // Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33])\n *\n * @example\n * import { hexToBytes } from 'viem'\n * const data = hexToBytes('0x48656c6c6f20776f726c6421', { size: 32 })\n * // Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])\n */\nexport function hexToBytes(hex_, opts = {}) {\n let hex = hex_;\n if (opts.size) {\n assertSize(hex, { size: opts.size });\n hex = pad(hex, { dir: 'right', size: opts.size });\n }\n let hexString = hex.slice(2);\n if (hexString.length % 2)\n hexString = `0${hexString}`;\n const bytes = new Uint8Array(hexString.length / 2);\n for (let index = 0; index < bytes.length; index++) {\n const start = index * 2;\n const hexByte = hexString.slice(start, start + 2);\n const byte = Number.parseInt(hexByte, 16);\n if (Number.isNaN(byte) || byte < 0)\n throw new BaseError(`Invalid byte sequence (\"${hexByte}\" in \"${hexString}\").`);\n bytes[index] = byte;\n }\n return bytes;\n}\n/**\n * Encodes a number into a byte array.\n *\n * - Docs: https://viem.sh/docs/utilities/toBytes.html#numbertobytes\n *\n * @param value Number to encode.\n * @param opts Options.\n * @returns Byte array value.\n *\n * @example\n * import { numberToBytes } from 'viem'\n * const data = numberToBytes(420)\n * // Uint8Array([1, 164])\n *\n * @example\n * import { numberToBytes } from 'viem'\n * const data = numberToBytes(420, { size: 4 })\n * // Uint8Array([0, 0, 1, 164])\n */\nexport function numberToBytes(value, opts) {\n const hex = numberToHex(value, opts);\n return hexToBytes(hex);\n}\n/**\n * Encodes a UTF-8 string into a byte array.\n *\n * - Docs: https://viem.sh/docs/utilities/toBytes.html#stringtobytes\n *\n * @param value String to encode.\n * @param opts Options.\n * @returns Byte array value.\n *\n * @example\n * import { stringToBytes } from 'viem'\n * const data = stringToBytes('Hello world!')\n * // Uint8Array([72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100, 33])\n *\n * @example\n * import { stringToBytes } from 'viem'\n * const data = stringToBytes('Hello world!', { size: 32 })\n * // Uint8Array([72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])\n */\nexport function stringToBytes(value, opts = {}) {\n const bytes = encoder.encode(value);\n if (typeof opts.size === 'number') {\n assertSize(bytes, { size: opts.size });\n return pad(bytes, { dir: 'right', size: opts.size });\n }\n return bytes;\n}\n//# sourceMappingURL=toBytes.js.map","const paramsRegex = /((function|event)\\s)?(.*)(\\((.*)\\))/;\nexport function extractFunctionParts(def) {\n const parts = def.match(paramsRegex);\n const type = parts?.[2] || undefined;\n const name = parts?.[3];\n const params = parts?.[5] || undefined;\n return { type, name, params };\n}\nexport function extractFunctionName(def) {\n return extractFunctionParts(def).name;\n}\nexport function extractFunctionParams(def) {\n const params = extractFunctionParts(def).params;\n const splitParams = params?.split(',').map((x) => x.trim().split(' '));\n return splitParams?.map((param) => ({\n type: param[0],\n name: param[1] === 'indexed' ? param[2] : param[1],\n ...(param[1] === 'indexed' ? { indexed: true } : {}),\n }));\n}\nexport function extractFunctionType(def) {\n return extractFunctionParts(def).type;\n}\n//# sourceMappingURL=extractFunctionParts.js.map","export function number(n) {\n if (!Number.isSafeInteger(n) || n < 0)\n throw new Error(`Wrong positive integer: ${n}`);\n}\nexport function bool(b) {\n if (typeof b !== 'boolean')\n throw new Error(`Expected boolean, not ${b}`);\n}\nexport function bytes(b, ...lengths) {\n if (!(b instanceof Uint8Array))\n throw new TypeError('Expected Uint8Array');\n if (lengths.length > 0 && !lengths.includes(b.length))\n throw new TypeError(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`);\n}\nexport function hash(hash) {\n if (typeof hash !== 'function' || typeof hash.create !== 'function')\n throw new Error('Hash should be wrapped by utils.wrapConstructor');\n number(hash.outputLen);\n number(hash.blockLen);\n}\nexport function exists(instance, checkFinished = true) {\n if (instance.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished)\n throw new Error('Hash#digest() has already been called');\n}\nexport function output(out, instance) {\n bytes(out);\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error(`digestInto() expects output buffer of length at least ${min}`);\n }\n}\nconst assert = {\n number,\n bool,\n bytes,\n hash,\n exists,\n output,\n};\nexport default assert;\n//# sourceMappingURL=_assert.js.map","const U32_MASK64 = BigInt(2 ** 32 - 1);\nconst _32n = BigInt(32);\n// We are not using BigUint64Array, because they are extremely slow as per 2022\nexport function fromBig(n, le = false) {\n if (le)\n return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\n}\nexport function split(lst, le = false) {\n let Ah = new Uint32Array(lst.length);\n let Al = new Uint32Array(lst.length);\n for (let i = 0; i < lst.length; i++) {\n const { h, l } = fromBig(lst[i], le);\n [Ah[i], Al[i]] = [h, l];\n }\n return [Ah, Al];\n}\nexport const toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\n// for Shift in [0, 32)\nconst shrSH = (h, l, s) => h >>> s;\nconst shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in [1, 32)\nconst rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));\nconst rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));\nconst rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));\n// Right rotate for shift===32 (just swaps l&h)\nconst rotr32H = (h, l) => l;\nconst rotr32L = (h, l) => h;\n// Left rotate for Shift in [1, 32)\nconst rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));\nconst rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));\n// Left rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));\nconst rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));\n// JS uses 32-bit signed integers for bitwise operations which means we cannot\n// simple take carry out of low bit sum by shift, we need to use division.\n// Removing \"export\" has 5% perf penalty -_-\nexport function add(Ah, Al, Bh, Bl) {\n const l = (Al >>> 0) + (Bl >>> 0);\n return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\n}\n// Addition with more than 2 elements\nconst add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\nconst add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;\nconst add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\nconst add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;\nconst add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\nconst add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\n// prettier-ignore\nconst u64 = {\n fromBig, split, toBig,\n shrSH, shrSL,\n rotrSH, rotrSL, rotrBH, rotrBL,\n rotr32H, rotr32L,\n rotlSH, rotlSL, rotlBH, rotlBL,\n add, add3L, add3H, add4L, add4H, add5H, add5L,\n};\nexport default u64;\n//# sourceMappingURL=_u64.js.map","/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// We use `globalThis.crypto`, but node.js versions earlier than v19 don't\n// declare it in global scope. For node.js, package.json#exports field mapping\n// rewrites import from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated, we can just drop the import.\nimport { crypto } from '@noble/hashes/crypto';\n// Cast array to different type\nexport const u8 = (arr) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\nexport const u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n// Cast array to view\nexport const createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n// The rotate right (circular right shift) operation for uint32\nexport const rotr = (word, shift) => (word << (32 - shift)) | (word >>> shift);\n// big-endian hardware is rare. Just in case someone still decides to run hashes:\n// early-throw an error because we don't support BE yet.\nexport const isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44;\nif (!isLE)\n throw new Error('Non little-endian hardware is not supported');\nconst hexes = Array.from({ length: 256 }, (v, i) => i.toString(16).padStart(2, '0'));\n/**\n * @example bytesToHex(Uint8Array.from([0xde, 0xad, 0xbe, 0xef])) // 'deadbeef'\n */\nexport function bytesToHex(uint8a) {\n // pre-caching improves the speed 6x\n if (!(uint8a instanceof Uint8Array))\n throw new Error('Uint8Array expected');\n let hex = '';\n for (let i = 0; i < uint8a.length; i++) {\n hex += hexes[uint8a[i]];\n }\n return hex;\n}\n/**\n * @example hexToBytes('deadbeef') // Uint8Array.from([0xde, 0xad, 0xbe, 0xef])\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string') {\n throw new TypeError('hexToBytes: expected string, got ' + typeof hex);\n }\n if (hex.length % 2)\n throw new Error('hexToBytes: received invalid unpadded hex');\n const array = new Uint8Array(hex.length / 2);\n for (let i = 0; i < array.length; i++) {\n const j = i * 2;\n const hexByte = hex.slice(j, j + 2);\n const byte = Number.parseInt(hexByte, 16);\n if (Number.isNaN(byte) || byte < 0)\n throw new Error('Invalid byte sequence');\n array[i] = byte;\n }\n return array;\n}\n// There is no setImmediate in browser and setTimeout is slow.\n// call of async fn will return Promise, which will be fullfiled only on\n// next scheduler queue processing step and this is exactly what we need.\nexport const nextTick = async () => { };\n// Returns control to thread each 'tick' ms to avoid blocking\nexport async function asyncLoop(iters, tick, cb) {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await nextTick();\n ts += diff;\n }\n}\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string') {\n throw new TypeError(`utf8ToBytes expected string, got ${typeof str}`);\n }\n return new TextEncoder().encode(str);\n}\nexport function toBytes(data) {\n if (typeof data === 'string')\n data = utf8ToBytes(data);\n if (!(data instanceof Uint8Array))\n throw new TypeError(`Expected input type is Uint8Array (got ${typeof data})`);\n return data;\n}\n/**\n * Concats Uint8Array-s into one; like `Buffer.concat([buf1, buf2])`\n * @example concatBytes(buf1, buf2)\n */\nexport function concatBytes(...arrays) {\n if (!arrays.every((a) => a instanceof Uint8Array))\n throw new Error('Uint8Array list expected');\n if (arrays.length === 1)\n return arrays[0];\n const length = arrays.reduce((a, arr) => a + arr.length, 0);\n const result = new Uint8Array(length);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const arr = arrays[i];\n result.set(arr, pad);\n pad += arr.length;\n }\n return result;\n}\n// For runtime check if class implements interface\nexport class Hash {\n // Safe version that clones internal state\n clone() {\n return this._cloneInto();\n }\n}\n// Check if object doens't have custom constructor (like Uint8Array/Array)\nconst isPlainObject = (obj) => Object.prototype.toString.call(obj) === '[object Object]' && obj.constructor === Object;\nexport function checkOpts(defaults, opts) {\n if (opts !== undefined && (typeof opts !== 'object' || !isPlainObject(opts)))\n throw new TypeError('Options should be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged;\n}\nexport function wrapConstructor(hashConstructor) {\n const hashC = (message) => hashConstructor().update(toBytes(message)).digest();\n const tmp = hashConstructor();\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = () => hashConstructor();\n return hashC;\n}\nexport function wrapConstructorWithOpts(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\n/**\n * Secure PRNG. Uses `globalThis.crypto` or node.js crypto module.\n */\nexport function randomBytes(bytesLength = 32) {\n if (crypto && typeof crypto.getRandomValues === 'function') {\n return crypto.getRandomValues(new Uint8Array(bytesLength));\n }\n throw new Error('crypto.getRandomValues must be defined');\n}\n//# sourceMappingURL=utils.js.map","import assert from './_assert.js';\nimport u64 from './_u64.js';\nimport { Hash, u32, toBytes, wrapConstructor, wrapConstructorWithOpts, } from './utils.js';\n// Various per round constants calculations\nconst [SHA3_PI, SHA3_ROTL, _SHA3_IOTA] = [[], [], []];\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst _7n = BigInt(7);\nconst _256n = BigInt(256);\nconst _0x71n = BigInt(0x71);\nfor (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {\n // Pi\n [x, y] = [y, (2 * x + 3 * y) % 5];\n SHA3_PI.push(2 * (5 * y + x));\n // Rotational\n SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64);\n // Iota\n let t = _0n;\n for (let j = 0; j < 7; j++) {\n R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n;\n if (R & _2n)\n t ^= _1n << ((_1n << BigInt(j)) - _1n);\n }\n _SHA3_IOTA.push(t);\n}\nconst [SHA3_IOTA_H, SHA3_IOTA_L] = u64.split(_SHA3_IOTA, true);\n// Left rotation (without 0, 32, 64)\nconst rotlH = (h, l, s) => s > 32 ? u64.rotlBH(h, l, s) : u64.rotlSH(h, l, s);\nconst rotlL = (h, l, s) => s > 32 ? u64.rotlBL(h, l, s) : u64.rotlSL(h, l, s);\n// Same as keccakf1600, but allows to skip some rounds\nexport function keccakP(s, rounds = 24) {\n const B = new Uint32Array(5 * 2);\n // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js)\n for (let round = 24 - rounds; round < 24; round++) {\n // Theta θ\n for (let x = 0; x < 10; x++)\n B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];\n for (let x = 0; x < 10; x += 2) {\n const idx1 = (x + 8) % 10;\n const idx0 = (x + 2) % 10;\n const B0 = B[idx0];\n const B1 = B[idx0 + 1];\n const Th = rotlH(B0, B1, 1) ^ B[idx1];\n const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];\n for (let y = 0; y < 50; y += 10) {\n s[x + y] ^= Th;\n s[x + y + 1] ^= Tl;\n }\n }\n // Rho (ρ) and Pi (π)\n let curH = s[2];\n let curL = s[3];\n for (let t = 0; t < 24; t++) {\n const shift = SHA3_ROTL[t];\n const Th = rotlH(curH, curL, shift);\n const Tl = rotlL(curH, curL, shift);\n const PI = SHA3_PI[t];\n curH = s[PI];\n curL = s[PI + 1];\n s[PI] = Th;\n s[PI + 1] = Tl;\n }\n // Chi (χ)\n for (let y = 0; y < 50; y += 10) {\n for (let x = 0; x < 10; x++)\n B[x] = s[y + x];\n for (let x = 0; x < 10; x++)\n s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];\n }\n // Iota (ι)\n s[0] ^= SHA3_IOTA_H[round];\n s[1] ^= SHA3_IOTA_L[round];\n }\n B.fill(0);\n}\nexport class Keccak extends Hash {\n // NOTE: we accept arguments in bytes instead of bits here.\n constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {\n super();\n this.blockLen = blockLen;\n this.suffix = suffix;\n this.outputLen = outputLen;\n this.enableXOF = enableXOF;\n this.rounds = rounds;\n this.pos = 0;\n this.posOut = 0;\n this.finished = false;\n this.destroyed = false;\n // Can be passed from user as dkLen\n assert.number(outputLen);\n // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes\n if (0 >= this.blockLen || this.blockLen >= 200)\n throw new Error('Sha3 supports only keccak-f1600 function');\n this.state = new Uint8Array(200);\n this.state32 = u32(this.state);\n }\n keccak() {\n keccakP(this.state32, this.rounds);\n this.posOut = 0;\n this.pos = 0;\n }\n update(data) {\n assert.exists(this);\n const { blockLen, state } = this;\n data = toBytes(data);\n const len = data.length;\n for (let pos = 0; pos < len;) {\n const take = Math.min(blockLen - this.pos, len - pos);\n for (let i = 0; i < take; i++)\n state[this.pos++] ^= data[pos++];\n if (this.pos === blockLen)\n this.keccak();\n }\n return this;\n }\n finish() {\n if (this.finished)\n return;\n this.finished = true;\n const { state, suffix, pos, blockLen } = this;\n // Do the padding\n state[pos] ^= suffix;\n if ((suffix & 0x80) !== 0 && pos === blockLen - 1)\n this.keccak();\n state[blockLen - 1] ^= 0x80;\n this.keccak();\n }\n writeInto(out) {\n assert.exists(this, false);\n assert.bytes(out);\n this.finish();\n const bufferOut = this.state;\n const { blockLen } = this;\n for (let pos = 0, len = out.length; pos < len;) {\n if (this.posOut >= blockLen)\n this.keccak();\n const take = Math.min(blockLen - this.posOut, len - pos);\n out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);\n this.posOut += take;\n pos += take;\n }\n return out;\n }\n xofInto(out) {\n // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF\n if (!this.enableXOF)\n throw new Error('XOF is not possible for this instance');\n return this.writeInto(out);\n }\n xof(bytes) {\n assert.number(bytes);\n return this.xofInto(new Uint8Array(bytes));\n }\n digestInto(out) {\n assert.output(out, this);\n if (this.finished)\n throw new Error('digest() was already called');\n this.writeInto(out);\n this.destroy();\n return out;\n }\n digest() {\n return this.digestInto(new Uint8Array(this.outputLen));\n }\n destroy() {\n this.destroyed = true;\n this.state.fill(0);\n }\n _cloneInto(to) {\n const { blockLen, suffix, outputLen, rounds, enableXOF } = this;\n to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds));\n to.state32.set(this.state32);\n to.pos = this.pos;\n to.posOut = this.posOut;\n to.finished = this.finished;\n to.rounds = rounds;\n // Suffix can change in cSHAKE\n to.suffix = suffix;\n to.outputLen = outputLen;\n to.enableXOF = enableXOF;\n to.destroyed = this.destroyed;\n return to;\n }\n}\nconst gen = (suffix, blockLen, outputLen) => wrapConstructor(() => new Keccak(blockLen, suffix, outputLen));\nexport const sha3_224 = gen(0x06, 144, 224 / 8);\n/**\n * SHA3-256 hash function\n * @param message - that would be hashed\n */\nexport const sha3_256 = gen(0x06, 136, 256 / 8);\nexport const sha3_384 = gen(0x06, 104, 384 / 8);\nexport const sha3_512 = gen(0x06, 72, 512 / 8);\nexport const keccak_224 = gen(0x01, 144, 224 / 8);\n/**\n * keccak-256 hash function. Different from SHA3-256.\n * @param message - that would be hashed\n */\nexport const keccak_256 = gen(0x01, 136, 256 / 8);\nexport const keccak_384 = gen(0x01, 104, 384 / 8);\nexport const keccak_512 = gen(0x01, 72, 512 / 8);\nconst genShake = (suffix, blockLen, outputLen) => wrapConstructorWithOpts((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true));\nexport const shake128 = genShake(0x1f, 168, 128 / 8);\nexport const shake256 = genShake(0x1f, 136, 256 / 8);\n//# sourceMappingURL=sha3.js.map","import { keccak_256 } from '@noble/hashes/sha3';\nimport { isHex } from '../data/isHex.js';\nimport { toBytes } from '../encoding/toBytes.js';\nimport { toHex } from '../encoding/toHex.js';\nexport function keccak256(value, to_) {\n const to = to_ || 'hex';\n const bytes = keccak_256(isHex(value, { strict: false }) ? toBytes(value) : value);\n if (to === 'bytes')\n return bytes;\n return toHex(bytes);\n}\n//# sourceMappingURL=keccak256.js.map","import { formatAbiItem } from '../abi/formatAbiItem.js';\nimport { extractFunctionName, extractFunctionParams, } from '../contract/extractFunctionParts.js';\nimport { toBytes } from '../encoding/toBytes.js';\nimport { keccak256 } from './keccak256.js';\nconst hash = (value) => keccak256(toBytes(value));\nexport function hashFunction(def) {\n const name = extractFunctionName(def);\n const params = extractFunctionParams(def) || [];\n return hash(`${name}(${params.map(({ type }) => type).join(',')})`);\n}\nexport function hashAbiItem(abiItem) {\n return hash(formatAbiItem(abiItem));\n}\n//# sourceMappingURL=hashFunction.js.map","import { hashAbiItem, hashFunction } from './hashFunction.js';\nexport const getEventSelector = (event) => {\n if (typeof event === 'string')\n return hashFunction(event);\n return hashAbiItem(event);\n};\n//# sourceMappingURL=getEventSelector.js.map","import { BaseError } from './base.js';\nexport class InvalidAddressError extends BaseError {\n constructor({ address }) {\n super(`Address \"${address}\" is invalid.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidAddressError'\n });\n }\n}\n//# sourceMappingURL=address.js.map","const addressRegex = /^0x[a-fA-F0-9]{40}$/;\nexport function isAddress(address) {\n return addressRegex.test(address);\n}\n//# sourceMappingURL=isAddress.js.map","export function concat(values) {\n if (typeof values[0] === 'string')\n return concatHex(values);\n return concatBytes(values);\n}\nexport function concatBytes(values) {\n let length = 0;\n for (const arr of values) {\n length += arr.length;\n }\n const result = new Uint8Array(length);\n let offset = 0;\n for (const arr of values) {\n result.set(arr, offset);\n offset += arr.length;\n }\n return result;\n}\nexport function concatHex(values) {\n return `0x${values.reduce((acc, x) => acc + x.replace('0x', ''), '')}`;\n}\n//# sourceMappingURL=concat.js.map","import { SliceOffsetOutOfBoundsError } from '../../errors/data.js';\nimport { isHex } from './isHex.js';\nimport { size } from './size.js';\n/**\n * @description Returns a section of the hex or byte array given a start/end bytes offset.\n *\n * @param value The hex or byte array to slice.\n * @param start The start offset (in bytes).\n * @param end The end offset (in bytes).\n */\nexport function slice(value, start, end, { strict } = {}) {\n if (isHex(value, { strict: false }))\n return sliceHex(value, start, end, {\n strict,\n });\n return sliceBytes(value, start, end, {\n strict,\n });\n}\nfunction assertStartOffset(value, start) {\n if (typeof start === 'number' && start > 0 && start > size(value) - 1)\n throw new SliceOffsetOutOfBoundsError({\n offset: start,\n position: 'start',\n size: size(value),\n });\n}\nfunction assertEndOffset(value, start, end) {\n if (typeof start === 'number' &&\n typeof end === 'number' &&\n size(value) !== end - start) {\n throw new SliceOffsetOutOfBoundsError({\n offset: end,\n position: 'end',\n size: size(value),\n });\n }\n}\n/**\n * @description Returns a section of the byte array given a start/end bytes offset.\n *\n * @param value The byte array to slice.\n * @param start The start offset (in bytes).\n * @param end The end offset (in bytes).\n */\nexport function sliceBytes(value_, start, end, { strict } = {}) {\n assertStartOffset(value_, start);\n const value = value_.slice(start, end);\n if (strict)\n assertEndOffset(value, start, end);\n return value;\n}\n/**\n * @description Returns a section of the hex value given a start/end bytes offset.\n *\n * @param value The hex value to slice.\n * @param start The start offset (in bytes).\n * @param end The end offset (in bytes).\n */\nexport function sliceHex(value_, start, end, { strict } = {}) {\n assertStartOffset(value_, start);\n const value = `0x${value_\n .replace('0x', '')\n .slice((start ?? 0) * 2, (end ?? value_.length) * 2)}`;\n if (strict)\n assertEndOffset(value, start, end);\n return value;\n}\n//# sourceMappingURL=slice.js.map","import { AbiEncodingArrayLengthMismatchError, AbiEncodingBytesSizeMismatchError, AbiEncodingLengthMismatchError, InvalidAbiEncodingTypeError, InvalidArrayError, } from '../../errors/abi.js';\nimport { InvalidAddressError } from '../../errors/address.js';\nimport { isAddress } from '../address/isAddress.js';\nimport { concat } from '../data/concat.js';\nimport { padHex } from '../data/pad.js';\nimport { size } from '../data/size.js';\nimport { slice } from '../data/slice.js';\nimport { boolToHex, numberToHex, stringToHex } from '../encoding/toHex.js';\n/**\n * @description Encodes a list of primitive values into an ABI-encoded hex value.\n */\nexport function encodeAbiParameters(params, values) {\n if (params.length !== values.length)\n throw new AbiEncodingLengthMismatchError({\n expectedLength: params.length,\n givenLength: values.length,\n });\n // Prepare the parameters to determine dynamic types to encode.\n const preparedParams = prepareParams({\n params: params,\n values,\n });\n const data = encodeParams(preparedParams);\n if (data.length === 0)\n return '0x';\n return data;\n}\nfunction prepareParams({ params, values, }) {\n const preparedParams = [];\n for (let i = 0; i < params.length; i++) {\n preparedParams.push(prepareParam({ param: params[i], value: values[i] }));\n }\n return preparedParams;\n}\nfunction prepareParam({ param, value, }) {\n const arrayComponents = getArrayComponents(param.type);\n if (arrayComponents) {\n const [length, type] = arrayComponents;\n return encodeArray(value, { length, param: { ...param, type } });\n }\n if (param.type === 'tuple') {\n return encodeTuple(value, {\n param: param,\n });\n }\n if (param.type === 'address') {\n return encodeAddress(value);\n }\n if (param.type === 'bool') {\n return encodeBool(value);\n }\n if (param.type.startsWith('uint') || param.type.startsWith('int')) {\n const signed = param.type.startsWith('int');\n return encodeNumber(value, { signed });\n }\n if (param.type.startsWith('bytes')) {\n return encodeBytes(value, { param });\n }\n if (param.type === 'string') {\n return encodeString(value);\n }\n throw new InvalidAbiEncodingTypeError(param.type, {\n docsPath: '/docs/contract/encodeAbiParameters',\n });\n}\n/////////////////////////////////////////////////////////////////\nfunction encodeParams(preparedParams) {\n // 1. Compute the size of the static part of the parameters.\n let staticSize = 0;\n for (let i = 0; i < preparedParams.length; i++) {\n const { dynamic, encoded } = preparedParams[i];\n if (dynamic)\n staticSize += 32;\n else\n staticSize += size(encoded);\n }\n // 2. Split the parameters into static and dynamic parts.\n const staticParams = [];\n const dynamicParams = [];\n let dynamicSize = 0;\n for (let i = 0; i < preparedParams.length; i++) {\n const { dynamic, encoded } = preparedParams[i];\n if (dynamic) {\n staticParams.push(numberToHex(staticSize + dynamicSize, { size: 32 }));\n dynamicParams.push(encoded);\n dynamicSize += size(encoded);\n }\n else {\n staticParams.push(encoded);\n }\n }\n // 3. Concatenate static and dynamic parts.\n return concat([...staticParams, ...dynamicParams]);\n}\n/////////////////////////////////////////////////////////////////\nfunction encodeAddress(value) {\n if (!isAddress(value))\n throw new InvalidAddressError({ address: value });\n return { dynamic: false, encoded: padHex(value.toLowerCase()) };\n}\nfunction encodeArray(value, { length, param, }) {\n const dynamic = length === null;\n if (!Array.isArray(value))\n throw new InvalidArrayError(value);\n if (!dynamic && value.length !== length)\n throw new AbiEncodingArrayLengthMismatchError({\n expectedLength: length,\n givenLength: value.length,\n type: `${param.type}[${length}]`,\n });\n let dynamicChild = false;\n const preparedParams = [];\n for (let i = 0; i < value.length; i++) {\n const preparedParam = prepareParam({ param, value: value[i] });\n if (preparedParam.dynamic)\n dynamicChild = true;\n preparedParams.push(preparedParam);\n }\n if (dynamic || dynamicChild) {\n const data = encodeParams(preparedParams);\n if (dynamic) {\n const length = numberToHex(preparedParams.length, { size: 32 });\n return {\n dynamic: true,\n encoded: preparedParams.length > 0 ? concat([length, data]) : length,\n };\n }\n if (dynamicChild)\n return { dynamic: true, encoded: data };\n }\n return {\n dynamic: false,\n encoded: concat(preparedParams.map(({ encoded }) => encoded)),\n };\n}\nfunction encodeBytes(value, { param }) {\n const [, paramSize] = param.type.split('bytes');\n const bytesSize = size(value);\n if (!paramSize) {\n let value_ = value;\n // If the size is not divisible by 32 bytes, pad the end\n // with empty bytes to the ceiling 32 bytes.\n if (bytesSize % 32 !== 0)\n value_ = padHex(value_, {\n dir: 'right',\n size: Math.ceil((value.length - 2) / 2 / 32) * 32,\n });\n return {\n dynamic: true,\n encoded: concat([padHex(numberToHex(bytesSize, { size: 32 })), value_]),\n };\n }\n if (bytesSize !== parseInt(paramSize))\n throw new AbiEncodingBytesSizeMismatchError({\n expectedSize: parseInt(paramSize),\n value,\n });\n return { dynamic: false, encoded: padHex(value, { dir: 'right' }) };\n}\nfunction encodeBool(value) {\n return { dynamic: false, encoded: padHex(boolToHex(value)) };\n}\nfunction encodeNumber(value, { signed }) {\n return {\n dynamic: false,\n encoded: numberToHex(value, {\n size: 32,\n signed,\n }),\n };\n}\nfunction encodeString(value) {\n const hexValue = stringToHex(value);\n const partsLength = Math.ceil(size(hexValue) / 32);\n const parts = [];\n for (let i = 0; i < partsLength; i++) {\n parts.push(padHex(slice(hexValue, i * 32, (i + 1) * 32), {\n dir: 'right',\n }));\n }\n return {\n dynamic: true,\n encoded: concat([\n padHex(numberToHex(size(hexValue), { size: 32 })),\n ...parts,\n ]),\n };\n}\nfunction encodeTuple(value, { param }) {\n let dynamic = false;\n const preparedParams = [];\n for (let i = 0; i < param.components.length; i++) {\n const param_ = param.components[i];\n const index = Array.isArray(value) ? i : param_.name;\n const preparedParam = prepareParam({\n param: param_,\n value: value[index],\n });\n preparedParams.push(preparedParam);\n if (preparedParam.dynamic)\n dynamic = true;\n }\n return {\n dynamic,\n encoded: dynamic\n ? encodeParams(preparedParams)\n : concat(preparedParams.map(({ encoded }) => encoded)),\n };\n}\nexport function getArrayComponents(type) {\n const matches = type.match(/^(.*)\\[(\\d+)?\\]$/);\n return matches\n ? // Return `null` if the array is dynamic.\n [matches[2] ? Number(matches[2]) : null, matches[1]]\n : undefined;\n}\n//# sourceMappingURL=encodeAbiParameters.js.map","import { isAddress } from '../address/isAddress.js';\nexport function getAbiItem({ abi, args = [], name, }) {\n const abiItems = abi.filter((x) => 'name' in x && x.name === name);\n if (abiItems.length === 0)\n return undefined;\n if (abiItems.length === 1)\n return abiItems[0];\n for (const abiItem of abiItems) {\n if (!('inputs' in abiItem))\n continue;\n if (!args || args.length === 0) {\n if (!abiItem.inputs || abiItem.inputs.length === 0)\n return abiItem;\n continue;\n }\n if (!abiItem.inputs)\n continue;\n if (abiItem.inputs.length === 0)\n continue;\n if (abiItem.inputs.length !== args.length)\n continue;\n const matched = args.every((arg, index) => {\n const abiParameter = 'inputs' in abiItem && abiItem.inputs[index];\n if (!abiParameter)\n return false;\n return isArgOfType(arg, abiParameter);\n });\n if (matched)\n return abiItem;\n }\n return abiItems[0];\n}\nexport function isArgOfType(arg, abiParameter) {\n const argType = typeof arg;\n const abiParameterType = abiParameter.type;\n switch (abiParameterType) {\n case 'address':\n return isAddress(arg);\n case 'bool':\n return argType === 'boolean';\n case 'function':\n return argType === 'string';\n case 'string':\n return argType === 'string';\n default: {\n if (abiParameterType === 'tuple' && 'components' in abiParameter)\n return Object.values(abiParameter.components).every((component, index) => {\n return isArgOfType(Object.values(arg)[index], component);\n });\n // `(u)int`: (un)signed integer type of `M` bits, `0 < M <= 256`, `M % 8 == 0`\n // https://regexr.com/6v8hp\n if (/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(abiParameterType))\n return argType === 'number' || argType === 'bigint';\n // `bytes`: binary type of `M` bytes, `0 < M <= 32`\n // https://regexr.com/6va55\n if (/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(abiParameterType))\n return argType === 'string' || arg instanceof Uint8Array;\n // fixed-length (`[M]`) and dynamic (`[]`) arrays\n // https://regexr.com/6va6i\n if (/[a-z]+[1-9]{0,3}(\\[[0-9]{0,}\\])+$/.test(abiParameterType)) {\n return (Array.isArray(arg) &&\n arg.every((x) => isArgOfType(x, {\n ...abiParameter,\n // Pop off `[]` or `[M]` from end of type\n type: abiParameterType.replace(/(\\[[0-9]{0,}\\])$/, ''),\n })));\n }\n return false;\n }\n }\n}\n//# sourceMappingURL=getAbiItem.js.map","import { AbiEventNotFoundError } from '../../errors/abi.js';\nimport { FilterTypeNotSupportedError } from '../../errors/log.js';\nimport { toBytes } from '../encoding/toBytes.js';\nimport { getEventSelector } from '../hash/getEventSelector.js';\nimport { keccak256 } from '../hash/keccak256.js';\nimport { encodeAbiParameters } from './encodeAbiParameters.js';\nimport { formatAbiItem } from './formatAbiItem.js';\nimport { getAbiItem } from './getAbiItem.js';\nexport function encodeEventTopics({ abi, eventName, args }) {\n let abiItem = abi[0];\n if (eventName) {\n abiItem = getAbiItem({\n abi,\n args,\n name: eventName,\n });\n if (!abiItem)\n throw new AbiEventNotFoundError(eventName, {\n docsPath: '/docs/contract/encodeEventTopics',\n });\n }\n if (abiItem.type !== 'event')\n throw new AbiEventNotFoundError(undefined, {\n docsPath: '/docs/contract/encodeEventTopics',\n });\n const definition = formatAbiItem(abiItem);\n const signature = getEventSelector(definition);\n let topics = [];\n if (args && 'inputs' in abiItem) {\n const indexedInputs = abiItem.inputs?.filter((param) => 'indexed' in param && param.indexed);\n const args_ = Array.isArray(args)\n ? args\n : Object.values(args).length > 0\n ? indexedInputs?.map((x) => args[x.name]) ?? []\n : [];\n if (args_.length > 0) {\n topics =\n indexedInputs?.map((param, i) => Array.isArray(args_[i])\n ? args_[i].map((_, j) => encodeArg({ param, value: args_[i][j] }))\n : args_[i]\n ? encodeArg({ param, value: args_[i] })\n : null) ?? [];\n }\n }\n return [signature, ...topics];\n}\nfunction encodeArg({ param, value, }) {\n if (param.type === 'string' || param.type === 'bytes')\n return keccak256(toBytes(value));\n if (param.type === 'tuple' || param.type.match(/^(.*)\\[(\\d+)?\\]$/))\n throw new FilterTypeNotSupportedError(param.type);\n return encodeAbiParameters([param], [value]);\n}\n//# sourceMappingURL=encodeEventTopics.js.map","/**\n * Scopes `request` to the filter ID. If the client is a fallback, it will\n * listen for responses and scope the child transport `request` function\n * to the successful filter ID.\n */\nexport function createFilterRequestScope(client, { method }) {\n const requestMap = {};\n if (client.transport.type === 'fallback')\n client.transport.onResponse?.(({ method: method_, response: id, status, transport, }) => {\n if (status === 'success' && method === method_)\n requestMap[id] = transport.request;\n });\n return ((id) => requestMap[id] || client.request);\n}\n//# sourceMappingURL=createFilterRequestScope.js.map","import { encodeEventTopics, } from '../../utils/abi/encodeEventTopics.js';\nimport { numberToHex } from '../../utils/encoding/toHex.js';\nimport { createFilterRequestScope } from '../../utils/filters/createFilterRequestScope.js';\n/**\n * Creates a Filter to retrieve event logs that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html) or [`getFilterLogs`](https://viem.sh/docs/actions/public/getFilterLogs.html).\n *\n * - Docs: https://viem.sh/docs/contract/createContractEventFilter.html\n *\n * @param client - Client to use\n * @param parameters - {@link CreateContractEventFilterParameters}\n * @returns [`Filter`](https://viem.sh/docs/glossary/types.html#filter). {@link CreateContractEventFilterReturnType}\n *\n * @example\n * import { createPublicClient, http, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createContractEventFilter } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createContractEventFilter(client, {\n * abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']),\n * })\n */\nexport async function createContractEventFilter(client, { address, abi, args, eventName, fromBlock, strict, toBlock, }) {\n const getRequest = createFilterRequestScope(client, {\n method: 'eth_newFilter',\n });\n const topics = eventName\n ? encodeEventTopics({\n abi,\n args,\n eventName,\n })\n : undefined;\n const id = await client.request({\n method: 'eth_newFilter',\n params: [\n {\n address,\n fromBlock: typeof fromBlock === 'bigint' ? numberToHex(fromBlock) : fromBlock,\n toBlock: typeof toBlock === 'bigint' ? numberToHex(toBlock) : toBlock,\n topics,\n },\n ],\n });\n return {\n abi,\n args,\n eventName,\n id,\n request: getRequest(id),\n strict,\n type: 'event',\n };\n}\n//# sourceMappingURL=createContractEventFilter.js.map","export function parseAccount(account) {\n if (typeof account === 'string')\n return { address: account, type: 'json-rpc' };\n return account;\n}\n//# sourceMappingURL=parseAccount.js.map","import { slice } from '../data/slice.js';\nimport { hashAbiItem, hashFunction } from './hashFunction.js';\nexport const getFunctionSelector = (fn) => {\n if (typeof fn === 'string')\n return slice(hashFunction(fn), 0, 4);\n return slice(hashAbiItem(fn), 0, 4);\n};\n//# sourceMappingURL=getFunctionSelector.js.map","import { AbiFunctionNotFoundError } from '../../errors/abi.js';\nimport { concatHex } from '../data/concat.js';\nimport { getFunctionSelector } from '../hash/getFunctionSelector.js';\nimport { encodeAbiParameters } from './encodeAbiParameters.js';\nimport { formatAbiItem } from './formatAbiItem.js';\nimport { getAbiItem } from './getAbiItem.js';\nexport function encodeFunctionData({ abi, args, functionName, }) {\n let abiItem = abi[0];\n if (functionName) {\n abiItem = getAbiItem({\n abi,\n args,\n name: functionName,\n });\n if (!abiItem)\n throw new AbiFunctionNotFoundError(functionName, {\n docsPath: '/docs/contract/encodeFunctionData',\n });\n }\n if (abiItem.type !== 'function')\n throw new AbiFunctionNotFoundError(undefined, {\n docsPath: '/docs/contract/encodeFunctionData',\n });\n const definition = formatAbiItem(abiItem);\n const signature = getFunctionSelector(definition);\n const data = 'inputs' in abiItem && abiItem.inputs\n ? encodeAbiParameters(abiItem.inputs, (args ?? []))\n : undefined;\n return concatHex([signature, data ?? '0x']);\n}\n//# sourceMappingURL=encodeFunctionData.js.map","// https://docs.soliditylang.org/en/v0.8.16/control-structures.html#panic-via-assert-and-error-via-require\nexport const panicReasons = {\n 1: 'An `assert` condition failed.',\n 17: 'Arithmic operation resulted in underflow or overflow.',\n 18: 'Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).',\n 33: 'Attempted to convert to an invalid type.',\n 34: 'Attempted to access a storage byte array that is incorrectly encoded.',\n 49: 'Performed `.pop()` on an empty array',\n 50: 'Array index is out of bounds.',\n 65: 'Allocated too much memory or created an array which is too large.',\n 81: 'Attempted to call a zero-initialized variable of internal function type.',\n};\nexport const solidityError = {\n inputs: [\n {\n name: 'message',\n type: 'string',\n },\n ],\n name: 'Error',\n type: 'error',\n};\nexport const solidityPanic = {\n inputs: [\n {\n name: 'reason',\n type: 'uint256',\n },\n ],\n name: 'Panic',\n type: 'error',\n};\n//# sourceMappingURL=solidity.js.map","import { InvalidAddressError } from '../../errors/address.js';\nimport { stringToBytes } from '../encoding/toBytes.js';\nimport { keccak256 } from '../hash/keccak256.js';\nimport { isAddress } from './isAddress.js';\nexport function checksumAddress(address_, chainId) {\n const hexAddress = chainId\n ? `${chainId}${address_.toLowerCase()}`\n : address_.substring(2).toLowerCase();\n const hash = keccak256(stringToBytes(hexAddress), 'bytes');\n const address = (chainId ? hexAddress.substring(`${chainId}0x`.length) : hexAddress).split('');\n for (let i = 0; i < 40; i += 2) {\n if (hash[i >> 1] >> 4 >= 8 && address[i]) {\n address[i] = address[i].toUpperCase();\n }\n if ((hash[i >> 1] & 0x0f) >= 8 && address[i + 1]) {\n address[i + 1] = address[i + 1].toUpperCase();\n }\n }\n return `0x${address.join('')}`;\n}\nexport function getAddress(address, chainId) {\n if (!isAddress(address))\n throw new InvalidAddressError({ address });\n return checksumAddress(address, chainId);\n}\n//# sourceMappingURL=getAddress.js.map","import { AbiDecodingDataSizeTooSmallError, AbiDecodingZeroDataError, InvalidAbiDecodingTypeError, } from '../../errors/abi.js';\nimport { checksumAddress } from '../address/getAddress.js';\nimport { size } from '../data/size.js';\nimport { slice } from '../data/slice.js';\nimport { trim } from '../data/trim.js';\nimport { hexToBigInt, hexToBool, hexToNumber, hexToString, } from '../encoding/fromHex.js';\nimport { getArrayComponents } from './encodeAbiParameters.js';\nexport function decodeAbiParameters(params, data) {\n if (data === '0x' && params.length > 0)\n throw new AbiDecodingZeroDataError();\n if (size(data) && size(data) < 32)\n throw new AbiDecodingDataSizeTooSmallError({\n data,\n params: params,\n size: size(data),\n });\n return decodeParams({\n data,\n params: params,\n });\n}\nfunction decodeParams({ data, params, }) {\n const decodedValues = [];\n let position = 0;\n for (let i = 0; i < params.length; i++) {\n if (position >= size(data))\n throw new AbiDecodingDataSizeTooSmallError({\n data,\n params,\n size: size(data),\n });\n const param = params[i];\n const { consumed, value } = decodeParam({ data, param, position });\n decodedValues.push(value);\n // Step across the data by the amount of data consumed by this parameter.\n position += consumed;\n }\n return decodedValues;\n}\nfunction decodeParam({ data, param, position, }) {\n const arrayComponents = getArrayComponents(param.type);\n if (arrayComponents) {\n const [length, type] = arrayComponents;\n return decodeArray(data, {\n length,\n param: { ...param, type: type },\n position,\n });\n }\n if (param.type === 'tuple') {\n return decodeTuple(data, { param: param, position });\n }\n if (param.type === 'string') {\n return decodeString(data, { position });\n }\n if (param.type.startsWith('bytes')) {\n return decodeBytes(data, { param, position });\n }\n const value = slice(data, position, position + 32, { strict: true });\n if (param.type.startsWith('uint') || param.type.startsWith('int')) {\n return decodeNumber(value, { param });\n }\n if (param.type === 'address') {\n return decodeAddress(value);\n }\n if (param.type === 'bool') {\n return decodeBool(value);\n }\n throw new InvalidAbiDecodingTypeError(param.type, {\n docsPath: '/docs/contract/decodeAbiParameters',\n });\n}\n////////////////////////////////////////////////////////////////////\nfunction decodeAddress(value) {\n return { consumed: 32, value: checksumAddress(slice(value, -20)) };\n}\nfunction decodeArray(data, { param, length, position, }) {\n // If the length of the array is not known in advance (dynamic array),\n // we will need to decode the offset of the array data.\n if (!length) {\n // Get the offset of the array data.\n const offset = hexToNumber(slice(data, position, position + 32, { strict: true }));\n // Get the length of the array from the offset.\n const length = hexToNumber(slice(data, offset, offset + 32, { strict: true }));\n let consumed = 0;\n const value = [];\n for (let i = 0; i < length; ++i) {\n const decodedChild = decodeParam({\n data: slice(data, offset + 32),\n param,\n position: consumed,\n });\n consumed += decodedChild.consumed;\n value.push(decodedChild.value);\n }\n return { value, consumed: 32 };\n }\n // If the length of the array is known in advance,\n // and the length of an element deeply nested in the array is not known,\n // we need to decode the offset of the array data.\n if (hasDynamicChild(param)) {\n // Get the child type of the array.\n const arrayComponents = getArrayComponents(param.type);\n // If the child type is not known, the array is dynamic.\n const dynamicChild = !arrayComponents?.[0];\n let consumed = 0;\n const value = [];\n for (let i = 0; i < length; ++i) {\n const offset = hexToNumber(slice(data, position, position + 32, { strict: true }));\n const decodedChild = decodeParam({\n data: slice(data, offset),\n param,\n position: dynamicChild ? consumed : i * 32,\n });\n consumed += decodedChild.consumed;\n value.push(decodedChild.value);\n }\n return { value, consumed: 32 };\n }\n // If the length of the array is known in advance,\n // and the length of each element in the array is known,\n // the array data is encoded contiguously after the array.\n let consumed = 0;\n const value = [];\n for (let i = 0; i < length; ++i) {\n const decodedChild = decodeParam({\n data,\n param,\n position: position + consumed,\n });\n consumed += decodedChild.consumed;\n value.push(decodedChild.value);\n }\n return { value, consumed };\n}\nfunction decodeBool(value) {\n return { consumed: 32, value: hexToBool(value) };\n}\nfunction decodeBytes(data, { param, position }) {\n const [_, size] = param.type.split('bytes');\n if (!size) {\n // If we don't have a size, we're dealing with a dynamic-size array\n // so we need to read the offset of the data part first.\n const offset = hexToNumber(slice(data, position, position + 32, { strict: true }));\n const length = hexToNumber(slice(data, offset, offset + 32, { strict: true }));\n // If there is no length, we have zero data.\n if (length === 0)\n return { consumed: 32, value: '0x' };\n const value = slice(data, offset + 32, offset + 32 + length, {\n strict: true,\n });\n return { consumed: 32, value };\n }\n const value = slice(data, position, position + parseInt(size), {\n strict: true,\n });\n return { consumed: 32, value };\n}\nfunction decodeNumber(value, { param }) {\n const signed = param.type.startsWith('int');\n const size = parseInt(param.type.split('int')[1] || '256');\n return {\n consumed: 32,\n value: size > 48\n ? hexToBigInt(value, { signed })\n : hexToNumber(value, { signed }),\n };\n}\nfunction decodeString(data, { position }) {\n const offset = hexToNumber(slice(data, position, position + 32, { strict: true }));\n const length = hexToNumber(slice(data, offset, offset + 32, { strict: true }));\n // If there is no length, we have zero data (empty string).\n if (length === 0)\n return { consumed: 32, value: '' };\n const value = hexToString(trim(slice(data, offset + 32, offset + 32 + length, { strict: true })));\n return { consumed: 32, value };\n}\nfunction decodeTuple(data, { param, position }) {\n // Tuples can have unnamed components (i.e. they are arrays), so we must\n // determine whether the tuple is named or unnamed. In the case of a named\n // tuple, the value will be an object where each property is the name of the\n // component. In the case of an unnamed tuple, the value will be an array.\n const hasUnnamedChild = param.components.length === 0 || param.components.some(({ name }) => !name);\n // Initialize the value to an object or an array, depending on whether the\n // tuple is named or unnamed.\n const value = hasUnnamedChild ? [] : {};\n let consumed = 0;\n // If the tuple has a dynamic child, we must first decode the offset to the\n // tuple data.\n if (hasDynamicChild(param)) {\n const offset = hexToNumber(slice(data, position, position + 32, { strict: true }));\n // Decode each component of the tuple, starting at the offset.\n for (let i = 0; i < param.components.length; ++i) {\n const component = param.components[i];\n const decodedChild = decodeParam({\n data: slice(data, offset),\n param: component,\n position: consumed,\n });\n consumed += decodedChild.consumed;\n value[hasUnnamedChild ? i : component?.name] = decodedChild.value;\n }\n return { consumed: 32, value };\n }\n // If the tuple has static children, we can just decode each component\n // in sequence.\n for (let i = 0; i < param.components.length; ++i) {\n const component = param.components[i];\n const decodedChild = decodeParam({\n data,\n param: component,\n position: position + consumed,\n });\n consumed += decodedChild.consumed;\n value[hasUnnamedChild ? i : component?.name] = decodedChild.value;\n }\n return { consumed, value };\n}\nfunction hasDynamicChild(param) {\n const { type } = param;\n if (type === 'string')\n return true;\n if (type === 'bytes')\n return true;\n if (type.endsWith('[]'))\n return true;\n if (type === 'tuple')\n return param.components?.some(hasDynamicChild);\n const arrayComponents = getArrayComponents(param.type);\n if (arrayComponents &&\n hasDynamicChild({ ...param, type: arrayComponents[1] }))\n return true;\n return false;\n}\n//# sourceMappingURL=decodeAbiParameters.js.map","import { solidityError, solidityPanic } from '../../constants/solidity.js';\nimport { AbiDecodingZeroDataError, AbiErrorSignatureNotFoundError, } from '../../errors/abi.js';\nimport { slice } from '../data/slice.js';\nimport { getFunctionSelector } from '../hash/getFunctionSelector.js';\nimport { decodeAbiParameters } from './decodeAbiParameters.js';\nimport { formatAbiItem } from './formatAbiItem.js';\nexport function decodeErrorResult({ abi, data, }) {\n const signature = slice(data, 0, 4);\n if (signature === '0x')\n throw new AbiDecodingZeroDataError();\n const abi_ = [...(abi || []), solidityError, solidityPanic];\n const abiItem = abi_.find((x) => x.type === 'error' && signature === getFunctionSelector(formatAbiItem(x)));\n if (!abiItem)\n throw new AbiErrorSignatureNotFoundError(signature, {\n docsPath: '/docs/contract/decodeErrorResult',\n });\n return {\n abiItem,\n args: ('inputs' in abiItem && abiItem.inputs && abiItem.inputs.length > 0\n ? decodeAbiParameters(abiItem.inputs, slice(data, 4))\n : undefined),\n errorName: abiItem.name,\n };\n}\n//# sourceMappingURL=decodeErrorResult.js.map","export const stringify = (value, replacer, space) => JSON.stringify(value, (key, value_) => {\n const value = typeof value_ === 'bigint' ? value_.toString() : value_;\n return typeof replacer === 'function' ? replacer(key, value) : value;\n}, space);\n//# sourceMappingURL=stringify.js.map","import { stringify } from '../stringify.js';\nexport function formatAbiItemWithArgs({ abiItem, args, includeFunctionName = true, includeName = false, }) {\n if (!('name' in abiItem))\n return;\n if (!('inputs' in abiItem))\n return;\n if (!abiItem.inputs)\n return;\n return `${includeFunctionName ? abiItem.name : ''}(${abiItem.inputs\n .map((input, i) => `${includeName && input.name ? `${input.name}: ` : ''}${typeof args[i] === 'object' ? stringify(args[i]) : args[i]}`)\n .join(', ')})`;\n}\n//# sourceMappingURL=formatAbiItemWithArgs.js.map","export const etherUnits = {\n gwei: 9,\n wei: 18,\n};\nexport const gweiUnits = {\n ether: -9,\n wei: 9,\n};\nexport const weiUnits = {\n ether: -18,\n gwei: -9,\n};\n//# sourceMappingURL=unit.js.map","export function formatUnits(value, decimals) {\n let display = value.toString();\n const negative = display.startsWith('-');\n if (negative)\n display = display.slice(1);\n display = display.padStart(decimals, '0');\n let [integer, fraction] = [\n display.slice(0, display.length - decimals),\n display.slice(display.length - decimals),\n ];\n fraction = fraction.replace(/(0+)$/, '');\n return `${negative ? '-' : ''}${integer || '0'}${fraction ? `.${fraction}` : ''}`;\n}\n//# sourceMappingURL=formatUnits.js.map","import { etherUnits } from '../../constants/unit.js';\nimport { formatUnits } from './formatUnits.js';\nexport function formatEther(wei, unit = 'wei') {\n return formatUnits(wei, etherUnits[unit]);\n}\n//# sourceMappingURL=formatEther.js.map","import { gweiUnits } from '../../constants/unit.js';\nimport { formatUnits } from './formatUnits.js';\nexport function formatGwei(wei, unit = 'wei') {\n return formatUnits(wei, gweiUnits[unit]);\n}\n//# sourceMappingURL=formatGwei.js.map","import { formatEther } from '../utils/unit/formatEther.js';\nimport { formatGwei } from '../utils/unit/formatGwei.js';\nimport { BaseError } from './base.js';\nexport function prettyPrint(args) {\n const entries = Object.entries(args)\n .map(([key, value]) => {\n if (value === undefined || value === false)\n return null;\n return [key, value];\n })\n .filter(Boolean);\n const maxLength = entries.reduce((acc, [key]) => Math.max(acc, key.length), 0);\n return entries\n .map(([key, value]) => ` ${`${key}:`.padEnd(maxLength + 1)} ${value}`)\n .join('\\n');\n}\nexport class FeeConflictError extends BaseError {\n constructor() {\n super([\n 'Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.',\n 'Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others.',\n ].join('\\n'));\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'FeeConflictError'\n });\n }\n}\nexport class InvalidLegacyVError extends BaseError {\n constructor({ v }) {\n super(`Invalid \\`v\\` value \"${v}\". Expected 27 or 28.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidLegacyVError'\n });\n }\n}\nexport class InvalidSerializableTransactionError extends BaseError {\n constructor({ transaction }) {\n super('Cannot infer a transaction type from provided transaction.', {\n metaMessages: [\n 'Provided Transaction:',\n '{',\n prettyPrint(transaction),\n '}',\n '',\n 'To infer the type, either provide:',\n '- a `type` to the Transaction, or',\n '- an EIP-1559 Transaction with `maxFeePerGas`, or',\n '- an EIP-2930 Transaction with `gasPrice` & `accessList`, or',\n '- a Legacy Transaction with `gasPrice`',\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidSerializableTransactionError'\n });\n }\n}\nexport class InvalidSerializedTransactionTypeError extends BaseError {\n constructor({ serializedType }) {\n super(`Serialized transaction type \"${serializedType}\" is invalid.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidSerializedTransactionType'\n });\n Object.defineProperty(this, \"serializedType\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.serializedType = serializedType;\n }\n}\nexport class InvalidSerializedTransactionError extends BaseError {\n constructor({ attributes, serializedTransaction, type, }) {\n const missing = Object.entries(attributes)\n .map(([key, value]) => (typeof value === 'undefined' ? key : undefined))\n .filter(Boolean);\n super(`Invalid serialized transaction of type \"${type}\" was provided.`, {\n metaMessages: [\n `Serialized Transaction: \"${serializedTransaction}\"`,\n missing.length > 0 ? `Missing Attributes: ${missing.join(', ')}` : '',\n ].filter(Boolean),\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidSerializedTransactionError'\n });\n Object.defineProperty(this, \"serializedTransaction\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"type\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.serializedTransaction = serializedTransaction;\n this.type = type;\n }\n}\nexport class InvalidStorageKeySizeError extends BaseError {\n constructor({ storageKey }) {\n super(`Size for storage key \"${storageKey}\" is invalid. Expected 32 bytes. Got ${Math.floor((storageKey.length - 2) / 2)} bytes.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidStorageKeySizeError'\n });\n }\n}\nexport class TransactionExecutionError extends BaseError {\n constructor(cause, { account, docsPath, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, }) {\n const prettyArgs = prettyPrint({\n chain: chain && `${chain?.name} (id: ${chain?.id})`,\n from: account?.address,\n to,\n value: typeof value !== 'undefined' &&\n `${formatEther(value)} ${chain?.nativeCurrency.symbol || 'ETH'}`,\n data,\n gas,\n gasPrice: typeof gasPrice !== 'undefined' && `${formatGwei(gasPrice)} gwei`,\n maxFeePerGas: typeof maxFeePerGas !== 'undefined' &&\n `${formatGwei(maxFeePerGas)} gwei`,\n maxPriorityFeePerGas: typeof maxPriorityFeePerGas !== 'undefined' &&\n `${formatGwei(maxPriorityFeePerGas)} gwei`,\n nonce,\n });\n super(cause.shortMessage, {\n cause,\n docsPath,\n metaMessages: [\n ...(cause.metaMessages ? [...cause.metaMessages, ' '] : []),\n 'Request Arguments:',\n prettyArgs,\n ].filter(Boolean),\n });\n Object.defineProperty(this, \"cause\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'TransactionExecutionError'\n });\n this.cause = cause;\n }\n}\nexport class TransactionNotFoundError extends BaseError {\n constructor({ blockHash, blockNumber, blockTag, hash, index, }) {\n let identifier = 'Transaction';\n if (blockTag && index !== undefined)\n identifier = `Transaction at block time \"${blockTag}\" at index \"${index}\"`;\n if (blockHash && index !== undefined)\n identifier = `Transaction at block hash \"${blockHash}\" at index \"${index}\"`;\n if (blockNumber && index !== undefined)\n identifier = `Transaction at block number \"${blockNumber}\" at index \"${index}\"`;\n if (hash)\n identifier = `Transaction with hash \"${hash}\"`;\n super(`${identifier} could not be found.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'TransactionNotFoundError'\n });\n }\n}\nexport class TransactionReceiptNotFoundError extends BaseError {\n constructor({ hash }) {\n super(`Transaction receipt with hash \"${hash}\" could not be found. The Transaction may not be processed on a block yet.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'TransactionReceiptNotFoundError'\n });\n }\n}\nexport class WaitForTransactionReceiptTimeoutError extends BaseError {\n constructor({ hash }) {\n super(`Timed out while waiting for transaction with hash \"${hash}\" to be confirmed.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'WaitForTransactionReceiptTimeoutError'\n });\n }\n}\n//# sourceMappingURL=transaction.js.map","import { parseAccount } from '../accounts/utils/parseAccount.js';\nimport { panicReasons } from '../constants/solidity.js';\nimport { decodeErrorResult, } from '../utils/abi/decodeErrorResult.js';\nimport { formatAbiItem } from '../utils/abi/formatAbiItem.js';\nimport { formatAbiItemWithArgs } from '../utils/abi/formatAbiItemWithArgs.js';\nimport { getAbiItem } from '../utils/abi/getAbiItem.js';\nimport { formatEther } from '../utils/unit/formatEther.js';\nimport { formatGwei } from '../utils/unit/formatGwei.js';\nimport { AbiErrorSignatureNotFoundError } from './abi.js';\nimport { BaseError } from './base.js';\nimport { prettyPrint } from './transaction.js';\nimport { getContractAddress } from './utils.js';\nexport class CallExecutionError extends BaseError {\n constructor(cause, { account: account_, docsPath, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, }) {\n const account = account_ ? parseAccount(account_) : undefined;\n const prettyArgs = prettyPrint({\n from: account?.address,\n to,\n value: typeof value !== 'undefined' &&\n `${formatEther(value)} ${chain?.nativeCurrency.symbol || 'ETH'}`,\n data,\n gas,\n gasPrice: typeof gasPrice !== 'undefined' && `${formatGwei(gasPrice)} gwei`,\n maxFeePerGas: typeof maxFeePerGas !== 'undefined' &&\n `${formatGwei(maxFeePerGas)} gwei`,\n maxPriorityFeePerGas: typeof maxPriorityFeePerGas !== 'undefined' &&\n `${formatGwei(maxPriorityFeePerGas)} gwei`,\n nonce,\n });\n super(cause.shortMessage, {\n cause,\n docsPath,\n metaMessages: [\n ...(cause.metaMessages ? [...cause.metaMessages, ' '] : []),\n 'Raw Call Arguments:',\n prettyArgs,\n ].filter(Boolean),\n });\n Object.defineProperty(this, \"cause\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'CallExecutionError'\n });\n this.cause = cause;\n }\n}\nexport class ContractFunctionExecutionError extends BaseError {\n constructor(cause, { abi, args, contractAddress, docsPath, functionName, sender, }) {\n const abiItem = getAbiItem({ abi, args, name: functionName });\n const formattedArgs = abiItem\n ? formatAbiItemWithArgs({\n abiItem,\n args,\n includeFunctionName: false,\n includeName: false,\n })\n : undefined;\n const functionWithParams = abiItem\n ? formatAbiItem(abiItem, { includeName: true })\n : undefined;\n const prettyArgs = prettyPrint({\n address: contractAddress && getContractAddress(contractAddress),\n function: functionWithParams,\n args: formattedArgs &&\n formattedArgs !== '()' &&\n `${[...Array(functionName?.length ?? 0).keys()]\n .map(() => ' ')\n .join('')}${formattedArgs}`,\n sender,\n });\n super(cause.shortMessage ||\n `An unknown error occurred while executing the contract function \"${functionName}\".`, {\n cause,\n docsPath,\n metaMessages: [\n ...(cause.metaMessages ? [...cause.metaMessages, ' '] : []),\n 'Contract Call:',\n prettyArgs,\n ].filter(Boolean),\n });\n Object.defineProperty(this, \"abi\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"args\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"cause\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"contractAddress\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"formattedArgs\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"functionName\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"sender\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ContractFunctionExecutionError'\n });\n this.abi = abi;\n this.args = args;\n this.cause = cause;\n this.contractAddress = contractAddress;\n this.functionName = functionName;\n this.sender = sender;\n }\n}\nexport class ContractFunctionRevertedError extends BaseError {\n constructor({ abi, data, functionName, message, }) {\n let cause;\n let decodedData = undefined;\n let metaMessages;\n let reason;\n if (data && data !== '0x') {\n try {\n decodedData = decodeErrorResult({ abi, data });\n const { abiItem, errorName, args: errorArgs } = decodedData;\n if (errorName === 'Error') {\n reason = errorArgs[0];\n }\n else if (errorName === 'Panic') {\n const [firstArg] = errorArgs;\n reason = panicReasons[firstArg];\n }\n else {\n const errorWithParams = abiItem\n ? formatAbiItem(abiItem, { includeName: true })\n : undefined;\n const formattedArgs = abiItem && errorArgs\n ? formatAbiItemWithArgs({\n abiItem,\n args: errorArgs,\n includeFunctionName: false,\n includeName: false,\n })\n : undefined;\n metaMessages = [\n errorWithParams ? `Error: ${errorWithParams}` : '',\n formattedArgs && formattedArgs !== '()'\n ? ` ${[...Array(errorName?.length ?? 0).keys()]\n .map(() => ' ')\n .join('')}${formattedArgs}`\n : '',\n ];\n }\n }\n catch (err) {\n cause = err;\n }\n }\n else if (message)\n reason = message;\n let signature;\n if (cause instanceof AbiErrorSignatureNotFoundError) {\n signature = cause.signature;\n metaMessages = [\n `Unable to decode signature \"${signature}\" as it was not found on the provided ABI.`,\n 'Make sure you are using the correct ABI and that the error exists on it.',\n `You can look up the decoded signature here: https://openchain.xyz/signatures?query=${signature}.`,\n ];\n }\n super((reason && reason !== 'execution reverted') || signature\n ? [\n `The contract function \"${functionName}\" reverted with the following ${signature ? 'signature' : 'reason'}:`,\n reason || signature,\n ].join('\\n')\n : `The contract function \"${functionName}\" reverted.`, {\n cause,\n metaMessages,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ContractFunctionRevertedError'\n });\n Object.defineProperty(this, \"data\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"reason\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"signature\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.data = decodedData;\n this.reason = reason;\n this.signature = signature;\n }\n}\nexport class ContractFunctionZeroDataError extends BaseError {\n constructor({ functionName }) {\n super(`The contract function \"${functionName}\" returned no data (\"0x\").`, {\n metaMessages: [\n 'This could be due to any of the following:',\n ` - The contract does not have the function \"${functionName}\",`,\n ' - The parameters passed to the contract function may be invalid, or',\n ' - The address is not a contract.',\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ContractFunctionZeroDataError'\n });\n }\n}\nexport class RawContractError extends BaseError {\n constructor({ data, message, }) {\n super(message || '');\n Object.defineProperty(this, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 3\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'RawContractError'\n });\n Object.defineProperty(this, \"data\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.data = data;\n }\n}\n//# sourceMappingURL=contract.js.map","import { AbiDecodingZeroDataError } from '../../errors/abi.js';\nimport { BaseError } from '../../errors/base.js';\nimport { ContractFunctionExecutionError, ContractFunctionRevertedError, ContractFunctionZeroDataError, RawContractError, } from '../../errors/contract.js';\nconst EXECUTION_REVERTED_ERROR_CODE = 3;\nexport function getContractError(err, { abi, address, args, docsPath, functionName, sender, }) {\n const { code, data, message, shortMessage } = (err instanceof RawContractError\n ? err\n : err instanceof BaseError\n ? err.walk((err) => 'data' in err) || err.walk()\n : {});\n let cause = err;\n if (err instanceof AbiDecodingZeroDataError) {\n cause = new ContractFunctionZeroDataError({ functionName });\n }\n else if (code === EXECUTION_REVERTED_ERROR_CODE &&\n (data || message || shortMessage)) {\n cause = new ContractFunctionRevertedError({\n abi,\n data: typeof data === 'object' ? data.data : data,\n functionName,\n message: shortMessage ?? message,\n });\n }\n return new ContractFunctionExecutionError(cause, {\n abi,\n args,\n contractAddress: address,\n docsPath,\n functionName,\n sender,\n });\n}\n//# sourceMappingURL=getContractError.js.map","import { BaseError } from './base.js';\nexport class AccountNotFoundError extends BaseError {\n constructor({ docsPath } = {}) {\n super([\n 'Could not find an Account to execute with this Action.',\n 'Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the WalletClient.',\n ].join('\\n'), {\n docsPath,\n docsSlug: 'account',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'AccountNotFoundError'\n });\n }\n}\n//# sourceMappingURL=account.js.map","import { formatEther } from '../utils/unit/formatEther.js';\nimport { formatGwei } from '../utils/unit/formatGwei.js';\nimport { BaseError } from './base.js';\nimport { prettyPrint } from './transaction.js';\nexport class EstimateGasExecutionError extends BaseError {\n constructor(cause, { account, docsPath, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, }) {\n const prettyArgs = prettyPrint({\n from: account?.address,\n to,\n value: typeof value !== 'undefined' &&\n `${formatEther(value)} ${chain?.nativeCurrency.symbol || 'ETH'}`,\n data,\n gas,\n gasPrice: typeof gasPrice !== 'undefined' && `${formatGwei(gasPrice)} gwei`,\n maxFeePerGas: typeof maxFeePerGas !== 'undefined' &&\n `${formatGwei(maxFeePerGas)} gwei`,\n maxPriorityFeePerGas: typeof maxPriorityFeePerGas !== 'undefined' &&\n `${formatGwei(maxPriorityFeePerGas)} gwei`,\n nonce,\n });\n super(cause.shortMessage, {\n cause,\n docsPath,\n metaMessages: [\n ...(cause.metaMessages ? [...cause.metaMessages, ' '] : []),\n 'Estimate Gas Arguments:',\n prettyArgs,\n ].filter(Boolean),\n });\n Object.defineProperty(this, \"cause\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'EstimateGasExecutionError'\n });\n this.cause = cause;\n }\n}\n//# sourceMappingURL=estimateGas.js.map","import { formatGwei } from '../utils/unit/formatGwei.js';\nimport { BaseError } from './base.js';\n/**\n * geth: https://github.com/ethereum/go-ethereum/blob/master/core/error.go\n * https://github.com/ethereum/go-ethereum/blob/master/core/types/transaction.go#L34-L41\n *\n * erigon: https://github.com/ledgerwatch/erigon/blob/master/core/error.go\n * https://github.com/ledgerwatch/erigon/blob/master/core/types/transaction.go#L41-L46\n *\n * anvil: https://github.com/foundry-rs/foundry/blob/master/anvil/src/eth/error.rs#L108\n */\nclass ExecutionRevertedError extends BaseError {\n constructor({ cause, message, } = {}) {\n const reason = message\n ?.replace('execution reverted: ', '')\n ?.replace('execution reverted', '');\n super(`Execution reverted ${reason ? `with reason: ${reason}` : 'for an unknown reason'}.`, {\n cause,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ExecutionRevertedError'\n });\n }\n}\nObject.defineProperty(ExecutionRevertedError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 3\n});\nObject.defineProperty(ExecutionRevertedError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /execution reverted/\n});\nexport { ExecutionRevertedError };\nclass FeeCapTooHighError extends BaseError {\n constructor({ cause, maxFeePerGas, } = {}) {\n super(`The fee cap (\\`maxFeePerGas\\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)} gwei` : ''}) cannot be higher than the maximum allowed value (2^256-1).`, {\n cause,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'FeeCapTooHigh'\n });\n }\n}\nObject.defineProperty(FeeCapTooHighError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /max fee per gas higher than 2\\^256-1|fee cap higher than 2\\^256-1/\n});\nexport { FeeCapTooHighError };\nclass FeeCapTooLowError extends BaseError {\n constructor({ cause, maxFeePerGas, } = {}) {\n super(`The fee cap (\\`maxFeePerGas\\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)}` : ''} gwei) cannot be lower than the block base fee.`, {\n cause,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'FeeCapTooLow'\n });\n }\n}\nObject.defineProperty(FeeCapTooLowError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/\n});\nexport { FeeCapTooLowError };\nclass NonceTooHighError extends BaseError {\n constructor({ cause, nonce } = {}) {\n super(`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ''}is higher than the next one expected.`, { cause });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'NonceTooHighError'\n });\n }\n}\nObject.defineProperty(NonceTooHighError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /nonce too high/\n});\nexport { NonceTooHighError };\nclass NonceTooLowError extends BaseError {\n constructor({ cause, nonce } = {}) {\n super([\n `Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ''}is lower than the current nonce of the account.`,\n 'Try increasing the nonce or find the latest nonce with `getTransactionCount`.',\n ].join('\\n'), { cause });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'NonceTooLowError'\n });\n }\n}\nObject.defineProperty(NonceTooLowError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /nonce too low|transaction already imported|already known/\n});\nexport { NonceTooLowError };\nclass NonceMaxValueError extends BaseError {\n constructor({ cause, nonce } = {}) {\n super(`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ''}exceeds the maximum allowed nonce.`, { cause });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'NonceMaxValueError'\n });\n }\n}\nObject.defineProperty(NonceMaxValueError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /nonce has max value/\n});\nexport { NonceMaxValueError };\nclass InsufficientFundsError extends BaseError {\n constructor({ cause } = {}) {\n super([\n 'The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account.',\n ].join('\\n'), {\n cause,\n metaMessages: [\n 'This error could arise when the account does not have enough funds to:',\n ' - pay for the total gas fee,',\n ' - pay for the value to send.',\n ' ',\n 'The cost of the transaction is calculated as `gas * gas fee + value`, where:',\n ' - `gas` is the amount of gas needed for transaction to execute,',\n ' - `gas fee` is the gas fee,',\n ' - `value` is the amount of ether to send to the recipient.',\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InsufficientFundsError'\n });\n }\n}\nObject.defineProperty(InsufficientFundsError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /insufficient funds/\n});\nexport { InsufficientFundsError };\nclass IntrinsicGasTooHighError extends BaseError {\n constructor({ cause, gas } = {}) {\n super(`The amount of gas ${gas ? `(${gas}) ` : ''}provided for the transaction exceeds the limit allowed for the block.`, {\n cause,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'IntrinsicGasTooHighError'\n });\n }\n}\nObject.defineProperty(IntrinsicGasTooHighError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /intrinsic gas too high|gas limit reached/\n});\nexport { IntrinsicGasTooHighError };\nclass IntrinsicGasTooLowError extends BaseError {\n constructor({ cause, gas } = {}) {\n super(`The amount of gas ${gas ? `(${gas}) ` : ''}provided for the transaction is too low.`, {\n cause,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'IntrinsicGasTooLowError'\n });\n }\n}\nObject.defineProperty(IntrinsicGasTooLowError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /intrinsic gas too low/\n});\nexport { IntrinsicGasTooLowError };\nclass TransactionTypeNotSupportedError extends BaseError {\n constructor({ cause }) {\n super('The transaction type is not supported for this chain.', {\n cause,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'TransactionTypeNotSupportedError'\n });\n }\n}\nObject.defineProperty(TransactionTypeNotSupportedError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /transaction type not valid/\n});\nexport { TransactionTypeNotSupportedError };\nclass TipAboveFeeCapError extends BaseError {\n constructor({ cause, maxPriorityFeePerGas, maxFeePerGas, } = {}) {\n super([\n `The provided tip (\\`maxPriorityFeePerGas\\`${maxPriorityFeePerGas\n ? ` = ${formatGwei(maxPriorityFeePerGas)} gwei`\n : ''}) cannot be higher than the fee cap (\\`maxFeePerGas\\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)} gwei` : ''}).`,\n ].join('\\n'), {\n cause,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'TipAboveFeeCapError'\n });\n }\n}\nObject.defineProperty(TipAboveFeeCapError, \"nodeMessage\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: /max priority fee per gas higher than max fee per gas|tip higher than fee cap/\n});\nexport { TipAboveFeeCapError };\nexport class UnknownNodeError extends BaseError {\n constructor({ cause }) {\n super(`An error occurred while executing: ${cause?.message}`, {\n cause,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'UnknownNodeError'\n });\n }\n}\n//# sourceMappingURL=node.js.map","import { stringify } from '../utils/stringify.js';\nimport { BaseError } from './base.js';\nimport { getUrl } from './utils.js';\nexport class HttpRequestError extends BaseError {\n constructor({ body, details, headers, status, url, }) {\n super('HTTP request failed.', {\n details,\n metaMessages: [\n status && `Status: ${status}`,\n `URL: ${getUrl(url)}`,\n body && `Request body: ${stringify(body)}`,\n ].filter(Boolean),\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'HttpRequestError'\n });\n Object.defineProperty(this, \"body\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"headers\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"status\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"url\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.body = body;\n this.headers = headers;\n this.status = status;\n this.url = url;\n }\n}\nexport class WebSocketRequestError extends BaseError {\n constructor({ body, details, url, }) {\n super('WebSocket request failed.', {\n details,\n metaMessages: [`URL: ${getUrl(url)}`, `Request body: ${stringify(body)}`],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'WebSocketRequestError'\n });\n }\n}\nexport class RpcRequestError extends BaseError {\n constructor({ body, error, url, }) {\n super('RPC Request failed.', {\n cause: error,\n details: error.message,\n metaMessages: [`URL: ${getUrl(url)}`, `Request body: ${stringify(body)}`],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'RpcRequestError'\n });\n Object.defineProperty(this, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.code = error.code;\n }\n}\nexport class TimeoutError extends BaseError {\n constructor({ body, url, }) {\n super('The request took too long to respond.', {\n details: 'The request timed out.',\n metaMessages: [`URL: ${getUrl(url)}`, `Request body: ${stringify(body)}`],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'TimeoutError'\n });\n }\n}\n//# sourceMappingURL=request.js.map","import { BaseError } from './base.js';\nimport { RpcRequestError } from './request.js';\nconst unknownErrorCode = -1;\n/**\n * Error subclass implementing JSON RPC 2.0 errors and Ethereum RPC errors per EIP-1474.\n *\n * - EIP https://eips.ethereum.org/EIPS/eip-1474\n */\nexport class RpcError extends BaseError {\n constructor(cause, { code, docsPath, metaMessages, shortMessage }) {\n super(shortMessage, {\n cause,\n docsPath,\n metaMessages: metaMessages || cause?.metaMessages,\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'RpcError'\n });\n Object.defineProperty(this, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.name = cause.name;\n this.code = (cause instanceof RpcRequestError ? cause.code : code ?? unknownErrorCode);\n }\n}\n/**\n * Error subclass implementing Ethereum Provider errors per EIP-1193.\n *\n * - EIP https://eips.ethereum.org/EIPS/eip-1193\n */\nexport class ProviderRpcError extends RpcError {\n constructor(cause, options) {\n super(cause, options);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ProviderRpcError'\n });\n Object.defineProperty(this, \"data\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.data = options.data;\n }\n}\n/**\n * Subclass for a \"Parse error\" EIP-1474 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nclass ParseRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: ParseRpcError.code,\n shortMessage: 'Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ParseRpcError'\n });\n }\n}\nObject.defineProperty(ParseRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32700\n});\nexport { ParseRpcError };\n/**\n * Subclass for a \"Invalid request\" EIP-1474 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nclass InvalidRequestRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: InvalidRequestRpcError.code,\n shortMessage: 'JSON is not a valid request object.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidRequestRpcError'\n });\n }\n}\nObject.defineProperty(InvalidRequestRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32600\n});\nexport { InvalidRequestRpcError };\n/**\n * Subclass for a \"Method not found\" EIP-1474 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nclass MethodNotFoundRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: MethodNotFoundRpcError.code,\n shortMessage: 'The method does not exist / is not available.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'MethodNotFoundRpcError'\n });\n }\n}\nObject.defineProperty(MethodNotFoundRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32601\n});\nexport { MethodNotFoundRpcError };\n/**\n * Subclass for an \"Invalid params\" EIP-1474 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nclass InvalidParamsRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: InvalidParamsRpcError.code,\n shortMessage: [\n 'Invalid parameters were provided to the RPC method.',\n 'Double check you have provided the correct parameters.',\n ].join('\\n'),\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidParamsRpcError'\n });\n }\n}\nObject.defineProperty(InvalidParamsRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32602\n});\nexport { InvalidParamsRpcError };\n/**\n * Subclass for an \"Internal error\" EIP-1474 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nclass InternalRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: InternalRpcError.code,\n shortMessage: 'An internal error was received.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InternalRpcError'\n });\n }\n}\nObject.defineProperty(InternalRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32603\n});\nexport { InternalRpcError };\n/**\n * Subclass for an \"Invalid input\" EIP-1474 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nclass InvalidInputRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: InvalidInputRpcError.code,\n shortMessage: [\n 'Missing or invalid parameters.',\n 'Double check you have provided the correct parameters.',\n ].join('\\n'),\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidInputRpcError'\n });\n }\n}\nObject.defineProperty(InvalidInputRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32000\n});\nexport { InvalidInputRpcError };\n/**\n * Subclass for a \"Resource not found\" EIP-1474 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nclass ResourceNotFoundRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: ResourceNotFoundRpcError.code,\n shortMessage: 'Requested resource not found.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ResourceNotFoundRpcError'\n });\n }\n}\nObject.defineProperty(ResourceNotFoundRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32001\n});\nexport { ResourceNotFoundRpcError };\n/**\n * Subclass for a \"Resource unavailable\" EIP-1474 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nclass ResourceUnavailableRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: ResourceUnavailableRpcError.code,\n shortMessage: 'Requested resource not available.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ResourceUnavailableRpcError'\n });\n }\n}\nObject.defineProperty(ResourceUnavailableRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32002\n});\nexport { ResourceUnavailableRpcError };\n/**\n * Subclass for a \"Transaction rejected\" EIP-1474 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nclass TransactionRejectedRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: TransactionRejectedRpcError.code,\n shortMessage: 'Transaction creation failed.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'TransactionRejectedRpcError'\n });\n }\n}\nObject.defineProperty(TransactionRejectedRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32003\n});\nexport { TransactionRejectedRpcError };\n/**\n * Subclass for a \"Method not supported\" EIP-1474 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nclass MethodNotSupportedRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: MethodNotSupportedRpcError.code,\n shortMessage: 'Method is not implemented.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'MethodNotSupportedRpcError'\n });\n }\n}\nObject.defineProperty(MethodNotSupportedRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32004\n});\nexport { MethodNotSupportedRpcError };\n/**\n * Subclass for a \"Limit exceeded\" EIP-1474 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nclass LimitExceededRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: LimitExceededRpcError.code,\n shortMessage: 'Request exceeds defined limit.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'LimitExceededRpcError'\n });\n }\n}\nObject.defineProperty(LimitExceededRpcError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32005\n});\nexport { LimitExceededRpcError };\n/**\n * Subclass for a \"JSON-RPC version not supported\" EIP-1474 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1474#error-codes\n */\nclass JsonRpcVersionUnsupportedError extends RpcError {\n constructor(cause) {\n super(cause, {\n code: JsonRpcVersionUnsupportedError.code,\n shortMessage: 'Version of JSON-RPC protocol is not supported.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'JsonRpcVersionUnsupportedError'\n });\n }\n}\nObject.defineProperty(JsonRpcVersionUnsupportedError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: -32006\n});\nexport { JsonRpcVersionUnsupportedError };\n/**\n * Subclass for a \"User Rejected Request\" EIP-1193 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1193#provider-errors\n */\nclass UserRejectedRequestError extends ProviderRpcError {\n constructor(cause) {\n super(cause, {\n code: UserRejectedRequestError.code,\n shortMessage: 'User rejected the request.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'UserRejectedRequestError'\n });\n }\n}\nObject.defineProperty(UserRejectedRequestError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 4001\n});\nexport { UserRejectedRequestError };\n/**\n * Subclass for an \"Unauthorized\" EIP-1193 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1193#provider-errors\n */\nclass UnauthorizedProviderError extends ProviderRpcError {\n constructor(cause) {\n super(cause, {\n code: UnauthorizedProviderError.code,\n shortMessage: 'The requested method and/or account has not been authorized by the user.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'UnauthorizedProviderError'\n });\n }\n}\nObject.defineProperty(UnauthorizedProviderError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 4100\n});\nexport { UnauthorizedProviderError };\n/**\n * Subclass for an \"Unsupported Method\" EIP-1193 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1193#provider-errors\n */\nclass UnsupportedProviderMethodError extends ProviderRpcError {\n constructor(cause) {\n super(cause, {\n code: UnsupportedProviderMethodError.code,\n shortMessage: 'The Provider does not support the requested method.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'UnsupportedProviderMethodError'\n });\n }\n}\nObject.defineProperty(UnsupportedProviderMethodError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 4200\n});\nexport { UnsupportedProviderMethodError };\n/**\n * Subclass for an \"Disconnected\" EIP-1193 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1193#provider-errors\n */\nclass ProviderDisconnectedError extends ProviderRpcError {\n constructor(cause) {\n super(cause, {\n code: ProviderDisconnectedError.code,\n shortMessage: 'The Provider is disconnected from all chains.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ProviderDisconnectedError'\n });\n }\n}\nObject.defineProperty(ProviderDisconnectedError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 4900\n});\nexport { ProviderDisconnectedError };\n/**\n * Subclass for an \"Chain Disconnected\" EIP-1193 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1193#provider-errors\n */\nclass ChainDisconnectedError extends ProviderRpcError {\n constructor(cause) {\n super(cause, {\n code: ChainDisconnectedError.code,\n shortMessage: 'The Provider is not connected to the requested chain.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ChainDisconnectedError'\n });\n }\n}\nObject.defineProperty(ChainDisconnectedError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 4901\n});\nexport { ChainDisconnectedError };\n/**\n * Subclass for an \"Switch Chain\" EIP-1193 error.\n *\n * EIP https://eips.ethereum.org/EIPS/eip-1193#provider-errors\n */\nclass SwitchChainError extends ProviderRpcError {\n constructor(cause) {\n super(cause, {\n code: SwitchChainError.code,\n shortMessage: 'An error occurred when attempting to switch chain.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'SwitchChainError'\n });\n }\n}\nObject.defineProperty(SwitchChainError, \"code\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 4902\n});\nexport { SwitchChainError };\n/**\n * Subclass for an unknown RPC error.\n */\nexport class UnknownRpcError extends RpcError {\n constructor(cause) {\n super(cause, {\n shortMessage: 'An unknown RPC error occurred.',\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'UnknownRpcError'\n });\n }\n}\n//# sourceMappingURL=rpc.js.map","import { ExecutionRevertedError, FeeCapTooHighError, FeeCapTooLowError, InsufficientFundsError, IntrinsicGasTooHighError, IntrinsicGasTooLowError, NonceMaxValueError, NonceTooHighError, NonceTooLowError, TipAboveFeeCapError, TransactionTypeNotSupportedError, UnknownNodeError, } from '../../errors/node.js';\nimport { RpcRequestError } from '../../errors/request.js';\nimport { InvalidInputRpcError, TransactionRejectedRpcError, } from '../../errors/rpc.js';\nexport function containsNodeError(err) {\n return (err instanceof TransactionRejectedRpcError ||\n err instanceof InvalidInputRpcError ||\n (err instanceof RpcRequestError && err.code === ExecutionRevertedError.code));\n}\nexport function getNodeError(err, args) {\n const message = err.details.toLowerCase();\n if (FeeCapTooHighError.nodeMessage.test(message))\n return new FeeCapTooHighError({\n cause: err,\n maxFeePerGas: args?.maxFeePerGas,\n });\n else if (FeeCapTooLowError.nodeMessage.test(message))\n return new FeeCapTooLowError({\n cause: err,\n maxFeePerGas: args?.maxFeePerGas,\n });\n else if (NonceTooHighError.nodeMessage.test(message))\n return new NonceTooHighError({ cause: err, nonce: args?.nonce });\n else if (NonceTooLowError.nodeMessage.test(message))\n return new NonceTooLowError({ cause: err, nonce: args?.nonce });\n else if (NonceMaxValueError.nodeMessage.test(message))\n return new NonceMaxValueError({ cause: err, nonce: args?.nonce });\n else if (InsufficientFundsError.nodeMessage.test(message))\n return new InsufficientFundsError({ cause: err });\n else if (IntrinsicGasTooHighError.nodeMessage.test(message))\n return new IntrinsicGasTooHighError({ cause: err, gas: args?.gas });\n else if (IntrinsicGasTooLowError.nodeMessage.test(message))\n return new IntrinsicGasTooLowError({ cause: err, gas: args?.gas });\n else if (TransactionTypeNotSupportedError.nodeMessage.test(message))\n return new TransactionTypeNotSupportedError({ cause: err });\n else if (TipAboveFeeCapError.nodeMessage.test(message))\n return new TipAboveFeeCapError({\n cause: err,\n maxFeePerGas: args?.maxFeePerGas,\n maxPriorityFeePerGas: args?.maxPriorityFeePerGas,\n });\n else if (message.match(ExecutionRevertedError.nodeMessage) ||\n ('code' in err.cause &&\n err.cause?.code === ExecutionRevertedError.code))\n return new ExecutionRevertedError({\n cause: err,\n message: err.cause.details || err.details,\n });\n return new UnknownNodeError({\n cause: err.cause.cause,\n });\n}\n//# sourceMappingURL=getNodeError.js.map","import { EstimateGasExecutionError } from '../../errors/estimateGas.js';\nimport { containsNodeError, getNodeError, } from './getNodeError.js';\nexport function getEstimateGasError(err, { docsPath, ...args }) {\n let cause = err;\n if (containsNodeError(err))\n cause = getNodeError(err, args);\n return new EstimateGasExecutionError(cause, {\n docsPath,\n ...args,\n });\n}\n//# sourceMappingURL=getEstimateGasError.js.map","/**\n * @description Picks out the keys from `value` that exist in the formatter.\n */\nexport function extract(value, { format }) {\n if (!format)\n return {};\n const keys = Object.keys(format({}));\n return keys.reduce((data, key) => {\n // rome-ignore lint/suspicious/noPrototypeBuiltins:\n if (value?.hasOwnProperty(key)) {\n data[key] = value[key];\n }\n return data;\n }, {});\n}\n//# sourceMappingURL=extract.js.map","import { numberToHex } from '../encoding/toHex.js';\nimport { defineFormatter } from './formatter.js';\nexport function formatTransactionRequest(transactionRequest) {\n return {\n ...transactionRequest,\n gas: typeof transactionRequest.gas !== 'undefined'\n ? numberToHex(transactionRequest.gas)\n : undefined,\n gasPrice: typeof transactionRequest.gasPrice !== 'undefined'\n ? numberToHex(transactionRequest.gasPrice)\n : undefined,\n maxFeePerGas: typeof transactionRequest.maxFeePerGas !== 'undefined'\n ? numberToHex(transactionRequest.maxFeePerGas)\n : undefined,\n maxPriorityFeePerGas: typeof transactionRequest.maxPriorityFeePerGas !== 'undefined'\n ? numberToHex(transactionRequest.maxPriorityFeePerGas)\n : undefined,\n nonce: typeof transactionRequest.nonce !== 'undefined'\n ? numberToHex(transactionRequest.nonce)\n : undefined,\n value: typeof transactionRequest.value !== 'undefined'\n ? numberToHex(transactionRequest.value)\n : undefined,\n };\n}\nexport const defineTransactionRequest = /*#__PURE__*/ defineFormatter('transactionRequest', formatTransactionRequest);\n//# sourceMappingURL=transactionRequest.js.map","import { parseAccount } from '../../accounts/utils/parseAccount.js';\nimport { InvalidAddressError } from '../../errors/address.js';\nimport { FeeCapTooHighError, TipAboveFeeCapError } from '../../errors/node.js';\nimport { FeeConflictError } from '../../errors/transaction.js';\nimport { isAddress } from '../address/isAddress.js';\nexport function assertRequest(args) {\n const { account: account_, gasPrice, maxFeePerGas, maxPriorityFeePerGas, to, } = args;\n const account = account_ ? parseAccount(account_) : undefined;\n if (account && !isAddress(account.address))\n throw new InvalidAddressError({ address: account.address });\n if (to && !isAddress(to))\n throw new InvalidAddressError({ address: to });\n if (typeof gasPrice !== 'undefined' &&\n (typeof maxFeePerGas !== 'undefined' ||\n typeof maxPriorityFeePerGas !== 'undefined'))\n throw new FeeConflictError();\n if (maxFeePerGas && maxFeePerGas > 2n ** 256n - 1n)\n throw new FeeCapTooHighError({ maxFeePerGas });\n if (maxPriorityFeePerGas &&\n maxFeePerGas &&\n maxPriorityFeePerGas > maxFeePerGas)\n throw new TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas });\n}\n//# sourceMappingURL=assertRequest.js.map","import { BaseError } from './base.js';\nexport class BlockNotFoundError extends BaseError {\n constructor({ blockHash, blockNumber, }) {\n let identifier = 'Block';\n if (blockHash)\n identifier = `Block at hash \"${blockHash}\"`;\n if (blockNumber)\n identifier = `Block at number \"${blockNumber}\"`;\n super(`${identifier} could not be found.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'BlockNotFoundError'\n });\n }\n}\n//# sourceMappingURL=block.js.map","import { hexToNumber } from '../encoding/fromHex.js';\nimport { defineFormatter } from './formatter.js';\nexport const transactionType = {\n '0x0': 'legacy',\n '0x1': 'eip2930',\n '0x2': 'eip1559',\n};\nexport function formatTransaction(transaction) {\n const transaction_ = {\n ...transaction,\n blockHash: transaction.blockHash ? transaction.blockHash : null,\n blockNumber: transaction.blockNumber\n ? BigInt(transaction.blockNumber)\n : null,\n chainId: transaction.chainId ? hexToNumber(transaction.chainId) : undefined,\n gas: transaction.gas ? BigInt(transaction.gas) : undefined,\n gasPrice: transaction.gasPrice ? BigInt(transaction.gasPrice) : undefined,\n maxFeePerGas: transaction.maxFeePerGas\n ? BigInt(transaction.maxFeePerGas)\n : undefined,\n maxPriorityFeePerGas: transaction.maxPriorityFeePerGas\n ? BigInt(transaction.maxPriorityFeePerGas)\n : undefined,\n nonce: transaction.nonce ? hexToNumber(transaction.nonce) : undefined,\n to: transaction.to ? transaction.to : null,\n transactionIndex: transaction.transactionIndex\n ? Number(transaction.transactionIndex)\n : null,\n type: transaction.type ? transactionType[transaction.type] : undefined,\n typeHex: transaction.type ? transaction.type : undefined,\n value: transaction.value ? BigInt(transaction.value) : undefined,\n v: transaction.v ? BigInt(transaction.v) : undefined,\n };\n if (transaction_.type === 'legacy') {\n delete transaction_['accessList'];\n delete transaction_['maxFeePerGas'];\n delete transaction_['maxPriorityFeePerGas'];\n }\n if (transaction_.type === 'eip2930') {\n delete transaction_['maxFeePerGas'];\n delete transaction_['maxPriorityFeePerGas'];\n }\n return transaction_;\n}\nexport const defineTransaction = /*#__PURE__*/ defineFormatter('transaction', formatTransaction);\n//# sourceMappingURL=transaction.js.map","import { defineFormatter } from './formatter.js';\nimport { formatTransaction } from './transaction.js';\nexport function formatBlock(block) {\n const transactions = block.transactions?.map((transaction) => {\n if (typeof transaction === 'string')\n return transaction;\n return formatTransaction(transaction);\n });\n return {\n ...block,\n baseFeePerGas: block.baseFeePerGas ? BigInt(block.baseFeePerGas) : null,\n difficulty: block.difficulty ? BigInt(block.difficulty) : undefined,\n gasLimit: block.gasLimit ? BigInt(block.gasLimit) : undefined,\n gasUsed: block.gasUsed ? BigInt(block.gasUsed) : undefined,\n hash: block.hash ? block.hash : null,\n logsBloom: block.logsBloom ? block.logsBloom : null,\n nonce: block.nonce ? block.nonce : null,\n number: block.number ? BigInt(block.number) : null,\n size: block.size ? BigInt(block.size) : undefined,\n timestamp: block.timestamp ? BigInt(block.timestamp) : undefined,\n transactions,\n totalDifficulty: block.totalDifficulty\n ? BigInt(block.totalDifficulty)\n : null,\n };\n}\nexport const defineBlock = /*#__PURE__*/ defineFormatter('block', formatBlock);\n//# sourceMappingURL=block.js.map","import { BlockNotFoundError } from '../../errors/block.js';\nimport { numberToHex } from '../../utils/encoding/toHex.js';\nimport { formatBlock, } from '../../utils/formatters/block.js';\n/**\n * Returns information about a block at a block number, hash, or tag.\n *\n * - Docs: https://viem.sh/docs/actions/public/getBlock.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/fetching-blocks\n * - JSON-RPC Methods:\n * - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) for `blockNumber` & `blockTag`.\n * - Calls [`eth_getBlockByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbyhash) for `blockHash`.\n *\n * @param client - Client to use\n * @param parameters - {@link GetBlockParameters}\n * @returns Information about the block. {@link GetBlockReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getBlock } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const block = await getBlock(client)\n */\nexport async function getBlock(client, { blockHash, blockNumber, blockTag: blockTag_, includeTransactions: includeTransactions_, } = {}) {\n const blockTag = blockTag_ ?? 'latest';\n const includeTransactions = includeTransactions_ ?? false;\n const blockNumberHex = blockNumber !== undefined ? numberToHex(blockNumber) : undefined;\n let block = null;\n if (blockHash) {\n block = await client.request({\n method: 'eth_getBlockByHash',\n params: [blockHash, includeTransactions],\n });\n }\n else {\n block = await client.request({\n method: 'eth_getBlockByNumber',\n params: [blockNumberHex || blockTag, includeTransactions],\n });\n }\n if (!block)\n throw new BlockNotFoundError({ blockHash, blockNumber });\n const format = client.chain?.formatters?.block?.format || formatBlock;\n return format(block);\n}\n//# sourceMappingURL=getBlock.js.map","/**\n * Returns the current price of gas (in wei).\n *\n * - Docs: https://viem.sh/docs/actions/public/getGasPrice.html\n * - JSON-RPC Methods: [`eth_gasPrice`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gasprice)\n *\n * @param client - Client to use\n * @returns The gas price (in wei). {@link GetGasPriceReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getGasPrice } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const gasPrice = await getGasPrice(client)\n */\nexport async function getGasPrice(client) {\n const gasPrice = await client.request({\n method: 'eth_gasPrice',\n });\n return BigInt(gasPrice);\n}\n//# sourceMappingURL=getGasPrice.js.map","import { hexToNumber } from '../../utils/encoding/fromHex.js';\nimport { numberToHex } from '../../utils/encoding/toHex.js';\n/**\n * Returns the number of [Transactions](https://viem.sh/docs/glossary/terms.html#transaction) an Account has broadcast / sent.\n *\n * - Docs: https://viem.sh/docs/actions/public/getTransactionCount.html\n * - JSON-RPC Methods: [`eth_getTransactionCount`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactioncount)\n *\n * @param client - Client to use\n * @param parameters - {@link GetTransactionCountParameters}\n * @returns The number of transactions an account has sent. {@link GetTransactionCountReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getTransactionCount } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const transactionCount = await getTransactionCount(client, {\n * address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * })\n */\nexport async function getTransactionCount(client, { address, blockTag = 'latest', blockNumber }) {\n const count = await client.request({\n method: 'eth_getTransactionCount',\n params: [address, blockNumber ? numberToHex(blockNumber) : blockTag],\n });\n return hexToNumber(count);\n}\n//# sourceMappingURL=getTransactionCount.js.map","import { parseAccount } from '../../accounts/utils/parseAccount.js';\nimport { estimateGas, } from '../../actions/public/estimateGas.js';\nimport { getBlock } from '../../actions/public/getBlock.js';\nimport { getGasPrice } from '../../actions/public/getGasPrice.js';\nimport { getTransactionCount } from '../../actions/public/getTransactionCount.js';\nimport { AccountNotFoundError } from '../../errors/account.js';\nimport { BaseError } from '../../errors/base.js';\nimport { assertRequest } from './assertRequest.js';\nexport async function prepareRequest(client, args) {\n const { account: account_, chain = client.chain, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, } = args;\n if (!account_)\n throw new AccountNotFoundError();\n const account = parseAccount(account_);\n const block = await getBlock(client, { blockTag: 'latest' });\n const request = { ...args, from: account.address };\n if (typeof nonce === 'undefined')\n request.nonce = await getTransactionCount(client, {\n address: account.address,\n blockTag: 'pending',\n });\n if (typeof block.baseFeePerGas === 'bigint' &&\n typeof gasPrice === 'undefined') {\n let defaultPriorityFee = 1500000000n; // 1.5 gwei\n if (typeof chain?.fees?.defaultPriorityFee !== 'undefined') {\n defaultPriorityFee =\n typeof chain.fees.defaultPriorityFee === 'bigint'\n ? chain.fees.defaultPriorityFee\n : await chain.fees.defaultPriorityFee({\n block,\n request: request,\n });\n }\n // EIP-1559 fees\n if (typeof maxFeePerGas === 'undefined') {\n // Set a buffer of 1.2x on top of the base fee to account for fluctuations.\n request.maxPriorityFeePerGas = maxPriorityFeePerGas ?? defaultPriorityFee;\n request.maxFeePerGas =\n (block.baseFeePerGas * 120n) / 100n + request.maxPriorityFeePerGas;\n }\n else {\n if (typeof maxPriorityFeePerGas === 'undefined' &&\n maxFeePerGas < defaultPriorityFee)\n throw new BaseError('`maxFeePerGas` cannot be less than the default `maxPriorityFeePerGas` (1.5 gwei).');\n request.maxFeePerGas = maxFeePerGas;\n request.maxPriorityFeePerGas = maxPriorityFeePerGas ?? defaultPriorityFee;\n }\n }\n else if (typeof gasPrice === 'undefined') {\n // Legacy fees\n if (typeof maxFeePerGas !== 'undefined' ||\n typeof maxPriorityFeePerGas !== 'undefined')\n throw new BaseError('Chain does not support EIP-1559 fees.');\n // Set a buffer of 1.2x on top of the base fee to account for fluctuations.\n request.gasPrice = ((await getGasPrice(client)) * 120n) / 100n;\n }\n if (typeof gas === 'undefined')\n request.gas = await estimateGas(client, {\n ...request,\n account: { address: account.address, type: 'json-rpc' },\n });\n assertRequest(request);\n return request;\n}\n//# sourceMappingURL=prepareRequest.js.map","import { parseAccount } from '../../accounts/utils/parseAccount.js';\nimport { AccountNotFoundError } from '../../errors/account.js';\nimport { numberToHex } from '../../utils/encoding/toHex.js';\nimport { getEstimateGasError } from '../../utils/errors/getEstimateGasError.js';\nimport { extract } from '../../utils/formatters/extract.js';\nimport { formatTransactionRequest, } from '../../utils/formatters/transactionRequest.js';\nimport { assertRequest, } from '../../utils/transaction/assertRequest.js';\nimport { prepareRequest, } from '../../utils/transaction/prepareRequest.js';\n/**\n * Estimates the gas necessary to complete a transaction without submitting it to the network.\n *\n * - Docs: https://viem.sh/docs/actions/public/estimateGas.html\n * - JSON-RPC Methods: [`eth_estimateGas`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_estimategas)\n *\n * @param client - Client to use\n * @param parameters - {@link EstimateGasParameters}\n * @returns The gas estimate (in wei). {@link EstimateGasReturnType}\n *\n * @example\n * import { createPublicClient, http, parseEther } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { estimateGas } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const gasEstimate = await estimateGas(client, {\n * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',\n * value: parseEther('1'),\n * })\n */\nexport async function estimateGas(client, args) {\n const account_ = args.account ?? client.account;\n if (!account_)\n throw new AccountNotFoundError({\n docsPath: '/docs/actions/public/estimateGas',\n });\n const account = parseAccount(account_);\n try {\n const { accessList, blockNumber, blockTag, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, ...rest } = account.type === 'local'\n ? (await prepareRequest(client, args))\n : args;\n const blockNumberHex = blockNumber ? numberToHex(blockNumber) : undefined;\n const block = blockNumberHex || blockTag;\n assertRequest(args);\n const format = client.chain?.formatters?.transactionRequest?.format ||\n formatTransactionRequest;\n const request = format({\n // Pick out extra data that might exist on the chain's transaction request type.\n ...extract(rest, { format }),\n from: account.address,\n accessList,\n data,\n gas,\n gasPrice,\n maxFeePerGas,\n maxPriorityFeePerGas,\n nonce,\n to,\n value,\n });\n const balance = await client.request({\n method: 'eth_estimateGas',\n params: block ? [request, block] : [request],\n });\n return BigInt(balance);\n }\n catch (err) {\n throw getEstimateGasError(err, {\n ...args,\n account,\n chain: client.chain,\n });\n }\n}\n//# sourceMappingURL=estimateGas.js.map","import { parseAccount } from '../../accounts/utils/parseAccount.js';\nimport { encodeFunctionData, } from '../../utils/abi/encodeFunctionData.js';\nimport { getContractError } from '../../utils/errors/getContractError.js';\nimport { estimateGas } from './estimateGas.js';\n/**\n * Estimates the gas required to successfully execute a contract write function call.\n *\n * - Docs: https://viem.sh/docs/contract/estimateContractGas.html\n *\n * Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`estimateGas` action](https://viem.sh/docs/actions/public/estimateGas.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html).\n *\n * @param client - Client to use\n * @param parameters - {@link EstimateContractGasParameters}\n * @returns The gas estimate (in wei). {@link EstimateContractGasReturnType}\n *\n * @example\n * import { createPublicClient, http, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { estimateContractGas } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const gas = await estimateContractGas(client, {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * abi: parseAbi(['function mint() public']),\n * functionName: 'mint',\n * account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',\n * })\n */\nexport async function estimateContractGas(client, { abi, address, args, functionName, ...request }) {\n const data = encodeFunctionData({\n abi,\n args,\n functionName,\n });\n try {\n const gas = await estimateGas(client, {\n data,\n to: address,\n ...request,\n });\n return gas;\n }\n catch (err) {\n const account = request.account ? parseAccount(request.account) : undefined;\n throw getContractError(err, {\n abi: abi,\n address,\n args,\n docsPath: '/docs/contract/estimateContractGas',\n functionName,\n sender: account?.address,\n });\n }\n}\n//# sourceMappingURL=estimateContractGas.js.map","import { AbiFunctionNotFoundError, AbiFunctionOutputsNotFoundError, } from '../../errors/abi.js';\nimport { decodeAbiParameters } from './decodeAbiParameters.js';\nimport { getAbiItem } from './getAbiItem.js';\nconst docsPath = '/docs/contract/decodeFunctionResult';\nexport function decodeFunctionResult({ abi, args, functionName, data, }) {\n let abiItem = abi[0];\n if (functionName) {\n abiItem = getAbiItem({\n abi,\n args,\n name: functionName,\n });\n if (!abiItem)\n throw new AbiFunctionNotFoundError(functionName, { docsPath });\n }\n if (abiItem.type !== 'function')\n throw new AbiFunctionNotFoundError(undefined, { docsPath });\n if (!abiItem.outputs)\n throw new AbiFunctionOutputsNotFoundError(abiItem.name, { docsPath });\n const values = decodeAbiParameters(abiItem.outputs, data);\n if (values && values.length > 1)\n return values;\n if (values && values.length === 1)\n return values[0];\n return undefined;\n}\n//# sourceMappingURL=decodeFunctionResult.js.map","/* [Multicall3](https://github.com/mds1/multicall) */\nexport const multicall3Abi = [\n {\n inputs: [\n {\n components: [\n {\n name: 'target',\n type: 'address',\n },\n {\n name: 'allowFailure',\n type: 'bool',\n },\n {\n name: 'callData',\n type: 'bytes',\n },\n ],\n name: 'calls',\n type: 'tuple[]',\n },\n ],\n name: 'aggregate3',\n outputs: [\n {\n components: [\n {\n name: 'success',\n type: 'bool',\n },\n {\n name: 'returnData',\n type: 'bytes',\n },\n ],\n name: 'returnData',\n type: 'tuple[]',\n },\n ],\n stateMutability: 'view',\n type: 'function',\n },\n];\nconst universalResolverErrors = [\n {\n inputs: [],\n name: 'ResolverNotFound',\n type: 'error',\n },\n {\n inputs: [],\n name: 'ResolverWildcardNotSupported',\n type: 'error',\n },\n];\nexport const universalResolverResolveAbi = [\n ...universalResolverErrors,\n {\n name: 'resolve',\n type: 'function',\n stateMutability: 'view',\n inputs: [\n { name: 'name', type: 'bytes' },\n { name: 'data', type: 'bytes' },\n ],\n outputs: [\n { name: '', type: 'bytes' },\n { name: 'address', type: 'address' },\n ],\n },\n];\nexport const universalResolverReverseAbi = [\n ...universalResolverErrors,\n {\n name: 'reverse',\n type: 'function',\n stateMutability: 'view',\n inputs: [{ type: 'bytes', name: 'reverseName' }],\n outputs: [\n { type: 'string', name: 'resolvedName' },\n { type: 'address', name: 'resolvedAddress' },\n { type: 'address', name: 'reverseResolver' },\n { type: 'address', name: 'resolver' },\n ],\n },\n];\nexport const textResolverAbi = [\n {\n name: 'text',\n type: 'function',\n stateMutability: 'view',\n inputs: [\n { name: 'name', type: 'bytes32' },\n { name: 'key', type: 'string' },\n ],\n outputs: [{ name: '', type: 'string' }],\n },\n];\nexport const addressResolverAbi = [\n {\n name: 'addr',\n type: 'function',\n stateMutability: 'view',\n inputs: [{ name: 'name', type: 'bytes32' }],\n outputs: [{ name: '', type: 'address' }],\n },\n {\n name: 'addr',\n type: 'function',\n stateMutability: 'view',\n inputs: [\n { name: 'name', type: 'bytes32' },\n { name: 'coinType', type: 'uint256' },\n ],\n outputs: [{ name: '', type: 'bytes' }],\n },\n];\n// ERC-1271\n// isValidSignature(bytes32 hash, bytes signature) → bytes4 magicValue\nexport const smartAccountAbi = [\n {\n name: 'isValidSignature',\n type: 'function',\n stateMutability: 'view',\n inputs: [\n { name: 'hash', type: 'bytes32' },\n { name: 'signature', type: 'bytes' },\n ],\n outputs: [{ name: '', type: 'bytes4' }],\n },\n];\n// ERC-6492 - universal deployless signature validator contract\n// constructor(address _signer, bytes32 _hash, bytes _signature) → bytes4 returnValue\n// returnValue is either 0x1 (valid) or 0x0 (invalid)\nexport const universalSignatureValidatorAbi = [\n {\n inputs: [\n {\n internalType: 'address',\n name: '_signer',\n type: 'address',\n },\n {\n internalType: 'bytes32',\n name: '_hash',\n type: 'bytes32',\n },\n {\n internalType: 'bytes',\n name: '_signature',\n type: 'bytes',\n },\n ],\n stateMutability: 'nonpayable',\n type: 'constructor',\n },\n];\n//# sourceMappingURL=abis.js.map","export const aggregate3Signature = '0x82ad56cb';\n//# sourceMappingURL=contract.js.map","import { BaseError } from './base.js';\nexport class ChainDoesNotSupportContract extends BaseError {\n constructor({ blockNumber, chain, contract, }) {\n super(`Chain \"${chain.name}\" does not support contract \"${contract.name}\".`, {\n metaMessages: [\n 'This could be due to any of the following:',\n ...(blockNumber &&\n contract.blockCreated &&\n contract.blockCreated > blockNumber\n ? [\n `- The contract \"${contract.name}\" was not deployed until block ${contract.blockCreated} (current block ${blockNumber}).`,\n ]\n : [\n `- The chain does not have the contract \"${contract.name}\" configured.`,\n ]),\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ChainDoesNotSupportContract'\n });\n }\n}\nexport class ChainMismatchError extends BaseError {\n constructor({ chain, currentChainId, }) {\n super(`The current chain of the wallet (id: ${currentChainId}) does not match the target chain for the transaction (id: ${chain.id} – ${chain.name}).`, {\n metaMessages: [\n `Current Chain ID: ${currentChainId}`,\n `Expected Chain ID: ${chain.id} – ${chain.name}`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ChainMismatchError'\n });\n }\n}\nexport class ChainNotFoundError extends BaseError {\n constructor() {\n super([\n 'No chain was provided to the request.',\n 'Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient.',\n ].join('\\n'));\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ChainNotFoundError'\n });\n }\n}\nexport class ClientChainNotConfiguredError extends BaseError {\n constructor() {\n super('No chain was provided to the Client.');\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'ClientChainNotConfiguredError'\n });\n }\n}\nexport class InvalidChainIdError extends BaseError {\n constructor({ chainId }) {\n super(`Chain ID \"${chainId}\" is invalid.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'InvalidChainIdError'\n });\n }\n}\n//# sourceMappingURL=chain.js.map","import { ChainDoesNotSupportContract, ChainMismatchError, ChainNotFoundError, } from '../errors/chain.js';\nexport function assertCurrentChain({ chain, currentChainId, }) {\n if (!chain)\n throw new ChainNotFoundError();\n if (currentChainId !== chain.id)\n throw new ChainMismatchError({ chain, currentChainId });\n}\nexport function defineChain(chain, config = {}) {\n const { fees = chain.fees, formatters = chain.formatters, serializers = chain.serializers, } = config;\n return {\n ...chain,\n fees,\n formatters,\n serializers,\n };\n}\nexport function getChainContractAddress({ blockNumber, chain, contract: name, }) {\n const contract = chain?.contracts?.[name];\n if (!contract)\n throw new ChainDoesNotSupportContract({\n chain,\n contract: { name },\n });\n if (blockNumber &&\n contract.blockCreated &&\n contract.blockCreated > blockNumber)\n throw new ChainDoesNotSupportContract({\n blockNumber,\n chain,\n contract: {\n name,\n blockCreated: contract.blockCreated,\n },\n });\n return contract.address;\n}\n//# sourceMappingURL=chain.js.map","import { CallExecutionError } from '../../errors/contract.js';\nimport { containsNodeError, getNodeError, } from './getNodeError.js';\nexport function getCallError(err, { docsPath, ...args }) {\n let cause = err;\n if (containsNodeError(err))\n cause = getNodeError(err, args);\n return new CallExecutionError(cause, {\n docsPath,\n ...args,\n });\n}\n//# sourceMappingURL=getCallError.js.map","const schedulerCache = /*#__PURE__*/ new Map();\nexport function createBatchScheduler({ fn, id, shouldSplitBatch, wait = 0, }) {\n const exec = async () => {\n const scheduler = getScheduler();\n flush();\n const args = scheduler.map(({ args }) => args);\n if (args.length === 0)\n return;\n fn(args)\n .then((data) => {\n scheduler.forEach(({ pendingPromise }, i) => pendingPromise.resolve?.([data[i], data]));\n })\n .catch((err) => {\n scheduler.forEach(({ pendingPromise }) => pendingPromise.reject?.(err));\n });\n };\n const flush = () => schedulerCache.delete(id);\n const getBatchedArgs = () => getScheduler().map(({ args }) => args);\n const getScheduler = () => schedulerCache.get(id) || [];\n const setScheduler = (item) => schedulerCache.set(id, [...getScheduler(), item]);\n return {\n flush,\n async schedule(args) {\n const pendingPromise = {};\n const promise = new Promise((resolve, reject) => {\n pendingPromise.resolve = resolve;\n pendingPromise.reject = reject;\n });\n const split = shouldSplitBatch?.([...getBatchedArgs(), args]);\n if (split)\n exec();\n const hasActiveScheduler = getScheduler().length > 0;\n if (hasActiveScheduler) {\n setScheduler({ args, pendingPromise });\n return promise;\n }\n setScheduler({ args, pendingPromise });\n setTimeout(exec, wait);\n return promise;\n },\n };\n}\n//# sourceMappingURL=createBatchScheduler.js.map","import { parseAccount } from '../../accounts/utils/parseAccount.js';\nimport { multicall3Abi } from '../../constants/abis.js';\nimport { aggregate3Signature } from '../../constants/contract.js';\nimport { BaseError } from '../../errors/base.js';\nimport { ChainDoesNotSupportContract, ClientChainNotConfiguredError, } from '../../errors/chain.js';\nimport { RawContractError } from '../../errors/contract.js';\nimport { decodeFunctionResult } from '../../utils/abi/decodeFunctionResult.js';\nimport { encodeFunctionData } from '../../utils/abi/encodeFunctionData.js';\nimport { getChainContractAddress } from '../../utils/chain.js';\nimport { numberToHex } from '../../utils/encoding/toHex.js';\nimport { getCallError } from '../../utils/errors/getCallError.js';\nimport { extract } from '../../utils/formatters/extract.js';\nimport { formatTransactionRequest, } from '../../utils/formatters/transactionRequest.js';\nimport { createBatchScheduler } from '../../utils/promise/createBatchScheduler.js';\nimport { assertRequest } from '../../utils/transaction/assertRequest.js';\n/**\n * Executes a new message call immediately without submitting a transaction to the network.\n *\n * - Docs: https://viem.sh/docs/actions/public/call.html\n * - JSON-RPC Methods: [`eth_call`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_call)\n *\n * @param client - Client to use\n * @param parameters - {@link CallParameters}\n * @returns The call data. {@link CallReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { call } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const data = await call(client, {\n * account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',\n * data: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',\n * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',\n * })\n */\nexport async function call(client, args) {\n const { account: account_, batch = Boolean(client.batch?.multicall), blockNumber, blockTag = 'latest', accessList, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, ...rest } = args;\n const account = account_ ? parseAccount(account_) : undefined;\n try {\n assertRequest(args);\n const blockNumberHex = blockNumber ? numberToHex(blockNumber) : undefined;\n const block = blockNumberHex || blockTag;\n const format = client.chain?.formatters?.transactionRequest?.format ||\n formatTransactionRequest;\n const request = format({\n // Pick out extra data that might exist on the chain's transaction request type.\n ...extract(rest, { format }),\n from: account?.address,\n accessList,\n data,\n gas,\n gasPrice,\n maxFeePerGas,\n maxPriorityFeePerGas,\n nonce,\n to,\n value,\n });\n if (batch && shouldPerformMulticall({ request })) {\n try {\n return await scheduleMulticall(client, {\n ...request,\n blockNumber,\n blockTag,\n });\n }\n catch (err) {\n if (!(err instanceof ClientChainNotConfiguredError) &&\n !(err instanceof ChainDoesNotSupportContract))\n throw err;\n }\n }\n const response = await client.request({\n method: 'eth_call',\n params: block\n ? [request, block]\n : [request],\n });\n if (response === '0x')\n return { data: undefined };\n return { data: response };\n }\n catch (err) {\n const data = getRevertErrorData(err);\n const { offchainLookup, offchainLookupSignature } = await import('../../utils/ccip.js');\n if (data?.slice(0, 10) === offchainLookupSignature && to) {\n return { data: await offchainLookup(client, { data, to }) };\n }\n throw getCallError(err, {\n ...args,\n account,\n chain: client.chain,\n });\n }\n}\n// We only want to perform a scheduled multicall if:\n// - The request has calldata,\n// - The request has a target address,\n// - The target address is not already the aggregate3 signature,\n// - The request has no other properties (`nonce`, `gas`, etc cannot be sent with a multicall).\nfunction shouldPerformMulticall({ request }) {\n const { data, to, ...request_ } = request;\n if (!data)\n return false;\n if (data.startsWith(aggregate3Signature))\n return false;\n if (!to)\n return false;\n if (Object.values(request_).filter((x) => typeof x !== 'undefined').length > 0)\n return false;\n return true;\n}\nasync function scheduleMulticall(client, args) {\n const { batchSize = 1024, wait = 0 } = typeof client.batch?.multicall === 'object' ? client.batch.multicall : {};\n const { blockNumber, blockTag = 'latest', data, multicallAddress: multicallAddress_, to, } = args;\n let multicallAddress = multicallAddress_;\n if (!multicallAddress) {\n if (!client.chain)\n throw new ClientChainNotConfiguredError();\n multicallAddress = getChainContractAddress({\n blockNumber,\n chain: client.chain,\n contract: 'multicall3',\n });\n }\n const blockNumberHex = blockNumber ? numberToHex(blockNumber) : undefined;\n const block = blockNumberHex || blockTag;\n const { schedule } = createBatchScheduler({\n id: `${client.uid}.${block}`,\n wait,\n shouldSplitBatch(args) {\n const size = args.reduce((size, { data }) => size + (data.length - 2), 0);\n return size > batchSize * 2;\n },\n fn: async (requests) => {\n const calls = requests.map((request) => ({\n allowFailure: true,\n callData: request.data,\n target: request.to,\n }));\n const calldata = encodeFunctionData({\n abi: multicall3Abi,\n args: [calls],\n functionName: 'aggregate3',\n });\n const data = await client.request({\n method: 'eth_call',\n params: [\n {\n data: calldata,\n to: multicallAddress,\n },\n block,\n ],\n });\n return decodeFunctionResult({\n abi: multicall3Abi,\n args: [calls],\n functionName: 'aggregate3',\n data: data || '0x',\n });\n },\n });\n const [{ returnData, success }] = await schedule({ data, to });\n if (!success)\n throw new RawContractError({ data: returnData });\n if (returnData === '0x')\n return { data: undefined };\n return { data: returnData };\n}\nexport function getRevertErrorData(err) {\n if (!(err instanceof BaseError))\n return undefined;\n const error = err.walk();\n return typeof error.data === 'object' ? error.data.data : error.data;\n}\n//# sourceMappingURL=call.js.map","import { decodeFunctionResult, } from '../../utils/abi/decodeFunctionResult.js';\nimport { encodeFunctionData, } from '../../utils/abi/encodeFunctionData.js';\nimport { getContractError } from '../../utils/errors/getContractError.js';\nimport { call } from './call.js';\n/**\n * Calls a read-only function on a contract, and returns the response.\n *\n * - Docs: https://viem.sh/docs/contract/readContract.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/reading-contracts\n *\n * A \"read-only\" function (constant function) on a Solidity contract is denoted by a `view` or `pure` keyword. They can only read the state of the contract, and cannot make any changes to it. Since read-only methods do not change the state of the contract, they do not require any gas to be executed, and can be called by any user without the need to pay for gas.\n *\n * Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`call` action](https://viem.sh/docs/actions/public/call.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html).\n *\n * @param client - Client to use\n * @param parameters - {@link ReadContractParameters}\n * @returns The response from the contract. Type is inferred. {@link ReadContractReturnType}\n *\n * @example\n * import { createPublicClient, http, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { readContract } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const result = await readContract(client, {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * abi: parseAbi(['function balanceOf(address) view returns (uint256)']),\n * functionName: 'balanceOf',\n * args: ['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'],\n * })\n * // 424122n\n */\nexport async function readContract(client, { abi, address, args, functionName, ...callRequest }) {\n const calldata = encodeFunctionData({\n abi,\n args,\n functionName,\n });\n try {\n const { data } = await call(client, {\n data: calldata,\n to: address,\n ...callRequest,\n });\n return decodeFunctionResult({\n abi,\n args,\n functionName,\n data: data || '0x',\n });\n }\n catch (err) {\n throw getContractError(err, {\n abi: abi,\n address,\n args,\n docsPath: '/docs/contract/readContract',\n functionName,\n });\n }\n}\n//# sourceMappingURL=readContract.js.map","import { parseAccount } from '../../accounts/utils/parseAccount.js';\nimport { decodeFunctionResult, } from '../../utils/abi/decodeFunctionResult.js';\nimport { encodeFunctionData, } from '../../utils/abi/encodeFunctionData.js';\nimport { getContractError } from '../../utils/errors/getContractError.js';\nimport { call } from './call.js';\n/**\n * Simulates/validates a contract interaction. This is useful for retrieving **return data** and **revert reasons** of contract write functions.\n *\n * - Docs: https://viem.sh/docs/contract/simulateContract.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/writing-to-contracts\n *\n * This function does not require gas to execute and _**does not**_ change the state of the blockchain. It is almost identical to [`readContract`](https://viem.sh/docs/contract/readContract.html), but also supports contract write functions.\n *\n * Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`call` action](https://viem.sh/docs/actions/public/call.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html).\n *\n * @param client - Client to use\n * @param parameters - {@link SimulateContractParameters}\n * @returns The simulation result and write request. {@link SimulateContractReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { simulateContract } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const result = await simulateContract(client, {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * abi: parseAbi(['function mint(uint32) view returns (uint32)']),\n * functionName: 'mint',\n * args: ['69420'],\n * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * })\n */\nexport async function simulateContract(client, { abi, address, args, dataSuffix, functionName, ...callRequest }) {\n const account = callRequest.account\n ? parseAccount(callRequest.account)\n : undefined;\n const calldata = encodeFunctionData({\n abi,\n args,\n functionName,\n });\n try {\n const { data } = await call(client, {\n batch: false,\n data: `${calldata}${dataSuffix ? dataSuffix.replace('0x', '') : ''}`,\n to: address,\n ...callRequest,\n });\n const result = decodeFunctionResult({\n abi,\n args,\n functionName,\n data: data || '0x',\n });\n return {\n result,\n request: {\n abi,\n address,\n args,\n dataSuffix,\n functionName,\n ...callRequest,\n },\n };\n }\n catch (err) {\n throw getContractError(err, {\n abi: abi,\n address,\n args,\n docsPath: '/docs/contract/simulateContract',\n functionName,\n sender: account?.address,\n });\n }\n}\n//# sourceMappingURL=simulateContract.js.map","export const listenersCache = /*#__PURE__*/ new Map();\nexport const cleanupCache = /*#__PURE__*/ new Map();\nlet callbackCount = 0;\n/**\n * @description Sets up an observer for a given function. If another function\n * is set up under the same observer id, the function will only be called once\n * for both instances of the observer.\n */\nexport function observe(observerId, callbacks, fn) {\n const callbackId = ++callbackCount;\n const getListeners = () => listenersCache.get(observerId) || [];\n const unsubscribe = () => {\n const listeners = getListeners();\n listenersCache.set(observerId, listeners.filter((cb) => cb.id !== callbackId));\n };\n const unwatch = () => {\n const cleanup = cleanupCache.get(observerId);\n if (getListeners().length === 1 && cleanup)\n cleanup();\n unsubscribe();\n };\n const listeners = getListeners();\n listenersCache.set(observerId, [\n ...listeners,\n { id: callbackId, fns: callbacks },\n ]);\n if (listeners && listeners.length > 0)\n return unwatch;\n const emit = {};\n for (const key in callbacks) {\n emit[key] = ((...args) => {\n const listeners = getListeners();\n if (listeners.length === 0)\n return;\n listeners.forEach((listener) => listener.fns[key]?.(...args));\n });\n }\n const cleanup = fn(emit);\n if (typeof cleanup === 'function')\n cleanupCache.set(observerId, cleanup);\n return unwatch;\n}\n//# sourceMappingURL=observe.js.map","export async function wait(time) {\n return new Promise((res) => setTimeout(res, time));\n}\n//# sourceMappingURL=wait.js.map","import { wait } from './wait.js';\n/**\n * @description Polls a function at a specified interval.\n */\nexport function poll(fn, { emitOnBegin, initialWaitTime, interval }) {\n let active = true;\n const unwatch = () => (active = false);\n const watch = async () => {\n let data;\n if (emitOnBegin)\n data = await fn({ unpoll: unwatch });\n const initialWait = (await initialWaitTime?.(data)) ?? interval;\n await wait(initialWait);\n const poll = async () => {\n if (!active)\n return;\n await fn({ unpoll: unwatch });\n await wait(interval);\n poll();\n };\n poll();\n };\n watch();\n return unwatch;\n}\n//# sourceMappingURL=poll.js.map","export const promiseCache = /*#__PURE__*/ new Map();\nexport const responseCache = /*#__PURE__*/ new Map();\nexport function getCache(cacheKey) {\n const buildCache = (cacheKey, cache) => ({\n clear: () => cache.delete(cacheKey),\n get: () => cache.get(cacheKey),\n set: (data) => cache.set(cacheKey, data),\n });\n const promise = buildCache(cacheKey, promiseCache);\n const response = buildCache(cacheKey, responseCache);\n return {\n clear: () => {\n promise.clear();\n response.clear();\n },\n promise,\n response,\n };\n}\n/**\n * @description Returns the result of a given promise, and caches the result for\n * subsequent invocations against a provided cache key.\n */\nexport async function withCache(fn, { cacheKey, cacheTime = Infinity }) {\n const cache = getCache(cacheKey);\n // If a response exists in the cache, and it's not expired, return it\n // and do not invoke the promise.\n // If the max age is 0, the cache is disabled.\n const response = cache.response.get();\n if (response && cacheTime > 0) {\n const age = new Date().getTime() - response.created.getTime();\n if (age < cacheTime)\n return response.data;\n }\n let promise = cache.promise.get();\n if (!promise) {\n promise = fn();\n // Store the promise in the cache so that subsequent invocations\n // will wait for the same promise to resolve (deduping).\n cache.promise.set(promise);\n }\n try {\n const data = await promise;\n // Store the response in the cache so that subsequent invocations\n // will return the same response.\n cache.response.set({ created: new Date(), data });\n return data;\n }\n finally {\n // Clear the promise cache so that subsequent invocations will\n // invoke the promise again.\n cache.promise.clear();\n }\n}\n//# sourceMappingURL=withCache.js.map","import { getCache, withCache } from '../../utils/promise/withCache.js';\nconst cacheKey = (id) => `blockNumber.${id}`;\nexport function getBlockNumberCache(id) {\n return getCache(cacheKey(id));\n}\n/**\n * Returns the number of the most recent block seen.\n *\n * - Docs: https://viem.sh/docs/actions/public/getBlockNumber.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/fetching-blocks\n * - JSON-RPC Methods: [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber)\n *\n * @param client - Client to use\n * @param parameters - {@link GetBlockNumberParameters}\n * @returns The number of the block. {@link GetBlockNumberReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getBlockNumber } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const blockNumber = await getBlockNumber(client)\n * // 69420n\n */\nexport async function getBlockNumber(client, { cacheTime = client.cacheTime, maxAge } = {}) {\n const blockNumberHex = await withCache(() => client.request({\n method: 'eth_blockNumber',\n }), { cacheKey: cacheKey(client.uid), cacheTime: maxAge ?? cacheTime });\n return BigInt(blockNumberHex);\n}\n//# sourceMappingURL=getBlockNumber.js.map","import { AbiDecodingDataSizeTooSmallError, AbiEventSignatureEmptyTopicsError, AbiEventSignatureNotFoundError, DecodeLogDataMismatch, DecodeLogTopicsMismatch, } from '../../errors/abi.js';\nimport { getEventSelector } from '../hash/getEventSelector.js';\nimport { decodeAbiParameters } from './decodeAbiParameters.js';\nimport { formatAbiItem } from './formatAbiItem.js';\nconst docsPath = '/docs/contract/decodeEventLog';\nexport function decodeEventLog({ abi, data, strict: strict_, topics, }) {\n const strict = strict_ ?? true;\n const [signature, ...argTopics] = topics;\n if (!signature)\n throw new AbiEventSignatureEmptyTopicsError({\n docsPath,\n });\n const abiItem = abi.find((x) => x.type === 'event' &&\n signature === getEventSelector(formatAbiItem(x)));\n if (!(abiItem && 'name' in abiItem) || abiItem.type !== 'event')\n throw new AbiEventSignatureNotFoundError(signature, {\n docsPath,\n });\n const { name, inputs } = abiItem;\n const isUnnamed = inputs?.some((x) => !('name' in x && x.name));\n let args = isUnnamed ? [] : {};\n // Decode topics (indexed args).\n const indexedInputs = inputs.filter((x) => 'indexed' in x && x.indexed);\n if (argTopics.length > 0) {\n for (let i = 0; i < indexedInputs.length; i++) {\n const param = indexedInputs[i];\n const topic = argTopics[i];\n if (!topic)\n throw new DecodeLogTopicsMismatch({\n abiItem,\n param: param,\n });\n args[param.name || i] = decodeTopic({ param, value: topic });\n }\n }\n // Decode data (non-indexed args).\n const nonIndexedInputs = inputs.filter((x) => !('indexed' in x && x.indexed));\n if (nonIndexedInputs.length > 0) {\n if (data && data !== '0x') {\n try {\n const decodedData = decodeAbiParameters(nonIndexedInputs, data);\n if (decodedData) {\n if (isUnnamed)\n args = [...args, ...decodedData];\n else {\n for (let i = 0; i < nonIndexedInputs.length; i++) {\n args[nonIndexedInputs[i].name] = decodedData[i];\n }\n }\n }\n }\n catch (err) {\n if (strict) {\n if (err instanceof AbiDecodingDataSizeTooSmallError)\n throw new DecodeLogDataMismatch({\n abiItem,\n data: err.data,\n params: err.params,\n size: err.size,\n });\n throw err;\n }\n }\n }\n else if (strict) {\n throw new DecodeLogDataMismatch({\n abiItem,\n data: '0x',\n params: nonIndexedInputs,\n size: 0,\n });\n }\n }\n return {\n eventName: name,\n args: Object.values(args).length > 0 ? args : undefined,\n };\n}\nfunction decodeTopic({ param, value }) {\n if (param.type === 'string' ||\n param.type === 'bytes' ||\n param.type === 'tuple' ||\n param.type.match(/^(.*)\\[(\\d+)?\\]$/))\n return value;\n const decodedArg = decodeAbiParameters([param], value) || [];\n return decodedArg[0];\n}\n//# sourceMappingURL=decodeEventLog.js.map","export function formatLog(log, { args, eventName } = {}) {\n return {\n ...log,\n blockHash: log.blockHash ? log.blockHash : null,\n blockNumber: log.blockNumber ? BigInt(log.blockNumber) : null,\n logIndex: log.logIndex ? Number(log.logIndex) : null,\n transactionHash: log.transactionHash ? log.transactionHash : null,\n transactionIndex: log.transactionIndex\n ? Number(log.transactionIndex)\n : null,\n ...(eventName ? { args, eventName } : {}),\n };\n}\n//# sourceMappingURL=log.js.map","import { DecodeLogDataMismatch, DecodeLogTopicsMismatch, } from '../../errors/abi.js';\nimport { decodeEventLog } from '../../utils/abi/decodeEventLog.js';\nimport { formatLog } from '../../utils/formatters/log.js';\n/**\n * Returns a list of logs or hashes based on a [Filter](/docs/glossary/terms#filter) since the last time it was called.\n *\n * - Docs: https://viem.sh/docs/actions/public/getFilterChanges.html\n * - JSON-RPC Methods: [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges)\n *\n * A Filter can be created from the following actions:\n *\n * - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter.html)\n * - [`createContractEventFilter`](https://viem.sh/docs/contract/createContractEventFilter.html)\n * - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter.html)\n * - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter.html)\n *\n * Depending on the type of filter, the return value will be different:\n *\n * - If the filter was created with `createContractEventFilter` or `createEventFilter`, it returns a list of logs.\n * - If the filter was created with `createPendingTransactionFilter`, it returns a list of transaction hashes.\n * - If the filter was created with `createBlockFilter`, it returns a list of block hashes.\n *\n * @param client - Client to use\n * @param parameters - {@link GetFilterChangesParameters}\n * @returns Logs or hashes. {@link GetFilterChangesReturnType}\n *\n * @example\n * // Blocks\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createBlockFilter, getFilterChanges } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createBlockFilter(client)\n * const hashes = await getFilterChanges(client, { filter })\n *\n * @example\n * // Contract Events\n * import { createPublicClient, http, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createContractEventFilter, getFilterChanges } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createContractEventFilter(client, {\n * address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',\n * abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']),\n * eventName: 'Transfer',\n * })\n * const logs = await getFilterChanges(client, { filter })\n *\n * @example\n * // Raw Events\n * import { createPublicClient, http, parseAbiItem } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createEventFilter, getFilterChanges } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createEventFilter(client, {\n * address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',\n * event: parseAbiItem('event Transfer(address indexed, address indexed, uint256)'),\n * })\n * const logs = await getFilterChanges(client, { filter })\n *\n * @example\n * // Transactions\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createPendingTransactionFilter, getFilterChanges } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createPendingTransactionFilter(client)\n * const hashes = await getFilterChanges(client, { filter })\n */\nexport async function getFilterChanges(_client, { filter, }) {\n const strict = 'strict' in filter && filter.strict;\n const logs = await filter.request({\n method: 'eth_getFilterChanges',\n params: [filter.id],\n });\n return logs\n .map((log) => {\n if (typeof log === 'string')\n return log;\n try {\n const { eventName, args } = 'abi' in filter && filter.abi\n ? decodeEventLog({\n abi: filter.abi,\n data: log.data,\n topics: log.topics,\n strict,\n })\n : { eventName: undefined, args: undefined };\n return formatLog(log, { args, eventName });\n }\n catch (err) {\n let eventName;\n let isUnnamed;\n if (err instanceof DecodeLogDataMismatch ||\n err instanceof DecodeLogTopicsMismatch) {\n // If strict mode is on, and log data/topics do not match event definition, skip.\n if ('strict' in filter && filter.strict)\n return;\n eventName = err.abiItem.name;\n isUnnamed = err.abiItem.inputs?.some((x) => !('name' in x && x.name));\n }\n // Set args undefined if there is an error decoding (e.g. indexed/non-indexed params mismatch).\n return formatLog(log, { args: isUnnamed ? [] : {}, eventName });\n }\n })\n .filter(Boolean);\n}\n//# sourceMappingURL=getFilterChanges.js.map","import { DecodeLogDataMismatch, DecodeLogTopicsMismatch, } from '../../errors/abi.js';\nimport { decodeEventLog } from '../../utils/abi/decodeEventLog.js';\nimport { encodeEventTopics, } from '../../utils/abi/encodeEventTopics.js';\nimport { numberToHex } from '../../utils/encoding/toHex.js';\nimport { formatLog } from '../../utils/formatters/log.js';\n/**\n * Returns a list of event logs matching the provided parameters.\n *\n * - Docs: https://viem.sh/docs/actions/public/getLogs.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/filters-and-logs/event-logs\n * - JSON-RPC Methods: [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs)\n *\n * @param client - Client to use\n * @param parameters - {@link GetLogsParameters}\n * @returns A list of event logs. {@link GetLogsReturnType}\n *\n * @example\n * import { createPublicClient, http, parseAbiItem } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getLogs } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const logs = await getLogs(client)\n */\nexport async function getLogs(client, { address, blockHash, fromBlock, toBlock, event, events: events_, args, strict: strict_, } = {}) {\n const strict = strict_ ?? false;\n const events = events_ ?? (event ? [event] : undefined);\n let topics = [];\n if (events) {\n topics = [\n events.flatMap((event) => encodeEventTopics({\n abi: [event],\n eventName: event.name,\n args,\n })),\n ];\n if (event)\n topics = topics[0];\n }\n let logs;\n if (blockHash) {\n logs = await client.request({\n method: 'eth_getLogs',\n params: [{ address, topics, blockHash }],\n });\n }\n else {\n logs = await client.request({\n method: 'eth_getLogs',\n params: [\n {\n address,\n topics,\n fromBlock: typeof fromBlock === 'bigint' ? numberToHex(fromBlock) : fromBlock,\n toBlock: typeof toBlock === 'bigint' ? numberToHex(toBlock) : toBlock,\n },\n ],\n });\n }\n return logs\n .map((log) => {\n try {\n const { eventName, args } = events\n ? decodeEventLog({\n abi: events,\n data: log.data,\n topics: log.topics,\n strict,\n })\n : { eventName: undefined, args: undefined };\n return formatLog(log, { args, eventName: eventName });\n }\n catch (err) {\n let eventName;\n let isUnnamed;\n if (err instanceof DecodeLogDataMismatch ||\n err instanceof DecodeLogTopicsMismatch) {\n // If strict mode is on, and log data/topics do not match event definition, skip.\n if (strict)\n return;\n eventName = err.abiItem.name;\n isUnnamed = err.abiItem.inputs?.some((x) => !('name' in x && x.name));\n }\n // Set args to empty if there is an error decoding (e.g. indexed/non-indexed params mismatch).\n return formatLog(log, { args: isUnnamed ? [] : {}, eventName });\n }\n })\n .filter(Boolean);\n}\n//# sourceMappingURL=getLogs.js.map","/**\n * Destroys a [`Filter`](https://viem.sh/docs/glossary/types.html#filter).\n *\n * - Docs: https://viem.sh/docs/actions/public/uninstallFilter.html\n * - JSON-RPC Methods: [`eth_uninstallFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_uninstallFilter)\n *\n * Destroys a Filter that was created from one of the following Actions:\n * - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter.html)\n * - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter.html)\n * - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter.html)\n *\n * @param client - Client to use\n * @param parameters - {@link UninstallFilterParameters}\n * @returns A boolean indicating if the Filter was successfully uninstalled. {@link UninstallFilterReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createPendingTransactionFilter, uninstallFilter } from 'viem/public'\n *\n * const filter = await createPendingTransactionFilter(client)\n * const uninstalled = await uninstallFilter(client, { filter })\n * // true\n */\nexport async function uninstallFilter(_client, { filter }) {\n return filter.request({\n method: 'eth_uninstallFilter',\n params: [filter.id],\n });\n}\n//# sourceMappingURL=uninstallFilter.js.map","import { getAbiItem, } from '../../utils/abi/getAbiItem.js';\nimport { observe } from '../../utils/observe.js';\nimport { poll } from '../../utils/poll.js';\nimport { stringify } from '../../utils/stringify.js';\nimport { DecodeLogDataMismatch } from '../../errors/abi.js';\nimport { DecodeLogTopicsMismatch, InvalidInputRpcError, decodeEventLog, encodeEventTopics, formatLog, } from '../../index.js';\nimport { createContractEventFilter, } from './createContractEventFilter.js';\nimport { getBlockNumber } from './getBlockNumber.js';\nimport { getFilterChanges } from './getFilterChanges.js';\nimport { getLogs } from './getLogs.js';\nimport { uninstallFilter } from './uninstallFilter.js';\n/**\n * Watches and returns emitted contract event logs.\n *\n * - Docs: https://viem.sh/docs/contract/watchContractEvent.html\n *\n * This Action will batch up all the event logs found within the [`pollingInterval`](https://viem.sh/docs/contract/watchContractEvent.html#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/contract/watchContractEvent.html#onLogs).\n *\n * `watchContractEvent` will attempt to create an [Event Filter](https://viem.sh/docs/contract/createContractEventFilter.html) and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. `eth_newFilter`), then `watchContractEvent` will fall back to using [`getLogs`](https://viem.sh/docs/actions/public/getLogs) instead.\n *\n * @param client - Client to use\n * @param parameters - {@link WatchContractEventParameters}\n * @returns A function that can be invoked to stop watching for new event logs. {@link WatchContractEventReturnType}\n *\n * @example\n * import { createPublicClient, http, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { watchContractEvent } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const unwatch = watchContractEvent(client, {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * abi: parseAbi(['event Transfer(address indexed from, address indexed to, uint256 value)']),\n * eventName: 'Transfer',\n * args: { from: '0xc961145a54C96E3aE9bAA048c4F4D6b04C13916b' },\n * onLogs: (logs) => console.log(logs),\n * })\n */\nexport function watchContractEvent(client, { abi, address, args, batch = true, eventName, onError, onLogs, poll: poll_, pollingInterval = client.pollingInterval, strict: strict_, }) {\n const enablePolling = typeof poll_ !== 'undefined' ? poll_ : client.transport.type !== 'webSocket';\n const pollContractEvent = () => {\n const observerId = stringify([\n 'watchContractEvent',\n address,\n args,\n batch,\n client.uid,\n eventName,\n pollingInterval,\n ]);\n const strict = strict_ ?? false;\n return observe(observerId, { onLogs, onError }, (emit) => {\n let previousBlockNumber;\n let filter;\n let initialized = false;\n const unwatch = poll(async () => {\n if (!initialized) {\n try {\n filter = (await createContractEventFilter(client, {\n abi,\n address,\n args,\n eventName,\n strict,\n }));\n }\n catch { }\n initialized = true;\n return;\n }\n try {\n let logs;\n if (filter) {\n logs = await getFilterChanges(client, { filter });\n }\n else {\n // If the filter doesn't exist, we will fall back to use `getLogs`.\n // The fall back exists because some RPC Providers do not support filters.\n // Fetch the block number to use for `getLogs`.\n const blockNumber = await getBlockNumber(client);\n // If the block number has changed, we will need to fetch the logs.\n // If the block number doesn't exist, we are yet to reach the first poll interval,\n // so do not emit any logs.\n if (previousBlockNumber && previousBlockNumber !== blockNumber) {\n logs = await getLogs(client, {\n address,\n args,\n fromBlock: previousBlockNumber + 1n,\n toBlock: blockNumber,\n event: getAbiItem({\n abi,\n name: eventName,\n }),\n });\n }\n else {\n logs = [];\n }\n previousBlockNumber = blockNumber;\n }\n if (logs.length === 0)\n return;\n if (batch)\n emit.onLogs(logs);\n else\n logs.forEach((log) => emit.onLogs([log]));\n }\n catch (err) {\n // If a filter has been set and gets uninstalled, providers will throw an InvalidInput error.\n // Reinitalize the filter when this occurs\n if (filter && err instanceof InvalidInputRpcError)\n initialized = false;\n emit.onError?.(err);\n }\n }, {\n emitOnBegin: true,\n interval: pollingInterval,\n });\n return async () => {\n if (filter)\n await uninstallFilter(client, { filter });\n unwatch();\n };\n });\n };\n const subscribeContractEvent = () => {\n let active = true;\n let unsubscribe = () => (active = false);\n (async () => {\n try {\n const topics = eventName\n ? encodeEventTopics({\n abi: abi,\n eventName: eventName,\n args,\n })\n : [];\n const { unsubscribe: unsubscribe_ } = await client.transport.subscribe({\n params: ['logs', { address, topics }],\n onData(data) {\n if (!active)\n return;\n const log = data.result;\n try {\n const { eventName, args } = decodeEventLog({\n abi: abi,\n data: log.data,\n topics: log.topics,\n strict: strict_,\n });\n const formatted = formatLog(log, {\n args,\n eventName: eventName,\n });\n onLogs([formatted]);\n }\n catch (err) {\n let eventName;\n let isUnnamed;\n if (err instanceof DecodeLogDataMismatch ||\n err instanceof DecodeLogTopicsMismatch) {\n // If strict mode is on, and log data/topics do not match event definition, skip.\n if (strict_)\n return;\n eventName = err.abiItem.name;\n isUnnamed = err.abiItem.inputs?.some((x) => !('name' in x && x.name));\n }\n // Set args to empty if there is an error decoding (e.g. indexed/non-indexed params mismatch).\n const formatted = formatLog(log, {\n args: isUnnamed ? [] : {},\n eventName,\n });\n onLogs([formatted]);\n }\n },\n onError(error) {\n onError?.(error);\n },\n });\n unsubscribe = unsubscribe_;\n if (!active)\n unsubscribe();\n }\n catch (err) {\n onError?.(err);\n }\n })();\n return unsubscribe;\n };\n return enablePolling ? pollContractEvent() : subscribeContractEvent();\n}\n//# sourceMappingURL=watchContractEvent.js.map","import { TransactionExecutionError } from '../../errors/transaction.js';\nimport { containsNodeError, getNodeError, } from './getNodeError.js';\nexport function getTransactionError(err, { docsPath, ...args }) {\n let cause = err;\n if (containsNodeError(err))\n cause = getNodeError(err, args);\n return new TransactionExecutionError(cause, {\n docsPath,\n ...args,\n });\n}\n//# sourceMappingURL=getTransactionError.js.map","import { hexToNumber } from '../../utils/encoding/fromHex.js';\n/**\n * Returns the chain ID associated with the current network.\n *\n * - Docs: https://viem.sh/docs/actions/public/getChainId.html\n * - JSON-RPC Methods: [`eth_chainId`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_chainid)\n *\n * @param client - Client to use\n * @returns The current chain ID. {@link GetChainIdReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getChainId } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const chainId = await getChainId(client)\n * // 1\n */\nexport async function getChainId(client) {\n const chainIdHex = await client.request({\n method: 'eth_chainId',\n });\n return hexToNumber(chainIdHex);\n}\n//# sourceMappingURL=getChainId.js.map","import { parseAccount } from '../../accounts/utils/parseAccount.js';\nimport { AccountNotFoundError } from '../../errors/account.js';\nimport { assertCurrentChain } from '../../utils/chain.js';\nimport { getTransactionError } from '../../utils/errors/getTransactionError.js';\nimport { extract } from '../../utils/formatters/extract.js';\nimport { formatTransactionRequest, } from '../../utils/formatters/transactionRequest.js';\nimport { assertRequest, } from '../../utils/transaction/assertRequest.js';\nimport { prepareRequest } from '../../utils/transaction/prepareRequest.js';\nimport { getChainId } from '../public/getChainId.js';\n/**\n * Creates, signs, and sends a new transaction to the network.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/sendTransaction.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/sending-transactions\n * - JSON-RPC Methods:\n * - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction)\n * - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction)\n *\n * @param client - Client to use\n * @param parameters - {@link SendTransactionParameters}\n * @returns The [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) hash. {@link SendTransactionReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { sendTransaction } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n * const hash = await sendTransaction(client, {\n * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',\n * value: 1000000000000000000n,\n * })\n *\n * @example\n * // Account Hoisting\n * import { createWalletClient, http } from 'viem'\n * import { privateKeyToAccount } from 'viem/accounts'\n * import { mainnet } from 'viem/chains'\n * import { sendTransaction } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * account: privateKeyToAccount('0x…'),\n * chain: mainnet,\n * transport: http(),\n * })\n * const hash = await sendTransaction(client, {\n * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',\n * value: 1000000000000000000n,\n * })\n */\nexport async function sendTransaction(client, args) {\n const { account: account_ = client.account, chain = client.chain, accessList, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, ...rest } = args;\n if (!account_)\n throw new AccountNotFoundError({\n docsPath: '/docs/actions/wallet/sendTransaction',\n });\n const account = parseAccount(account_);\n try {\n assertRequest(args);\n let chainId;\n if (chain !== null) {\n chainId = await getChainId(client);\n assertCurrentChain({\n currentChainId: chainId,\n chain,\n });\n }\n if (account.type === 'local') {\n // Prepare the request for signing (assign appropriate fees, etc.)\n const request = await prepareRequest(client, {\n account,\n accessList,\n chain,\n data,\n gas,\n gasPrice,\n maxFeePerGas,\n maxPriorityFeePerGas,\n nonce,\n to,\n value,\n ...rest,\n });\n if (!chainId)\n chainId = await getChainId(client);\n const serializer = chain?.serializers?.transaction;\n const signedRequest = (await account.signTransaction({\n ...request,\n chainId,\n }, { serializer }));\n return await client.request({\n method: 'eth_sendRawTransaction',\n params: [signedRequest],\n });\n }\n const format = chain?.formatters?.transactionRequest?.format || formatTransactionRequest;\n const request = format({\n // Pick out extra data that might exist on the chain's transaction request type.\n ...extract(rest, { format }),\n accessList,\n data,\n from: account.address,\n gas,\n gasPrice,\n maxFeePerGas,\n maxPriorityFeePerGas,\n nonce,\n to,\n value,\n });\n return await client.request({\n method: 'eth_sendTransaction',\n params: [request],\n });\n }\n catch (err) {\n throw getTransactionError(err, {\n ...args,\n account,\n chain: args.chain || undefined,\n });\n }\n}\n//# sourceMappingURL=sendTransaction.js.map","import { encodeFunctionData, } from '../../utils/abi/encodeFunctionData.js';\nimport { sendTransaction, } from './sendTransaction.js';\n/**\n * Executes a write function on a contract.\n *\n * - Docs: https://viem.sh/docs/contract/writeContract.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/writing-to-contracts\n *\n * A \"write\" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms.html) is needed to be broadcast in order to change the state.\n *\n * Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet.html) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html).\n *\n * __Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract.html#usage) before you execute it.__\n *\n * @param client - Client to use\n * @param parameters - {@link WriteContractParameters}\n * @returns A [Transaction Hash](https://viem.sh/docs/glossary/terms.html#hash). {@link WriteContractReturnType}\n *\n * @example\n * import { createWalletClient, custom, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { writeContract } from 'viem/contract'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n * const hash = await writeContract(client, {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * abi: parseAbi(['function mint(uint32 tokenId) nonpayable']),\n * functionName: 'mint',\n * args: [69420],\n * })\n *\n * @example\n * // With Validation\n * import { createWalletClient, http, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { simulateContract, writeContract } from 'viem/contract'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const { request } = await simulateContract(client, {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * abi: parseAbi(['function mint(uint32 tokenId) nonpayable']),\n * functionName: 'mint',\n * args: [69420],\n * }\n * const hash = await writeContract(client, request)\n */\nexport async function writeContract(client, { abi, address, args, dataSuffix, functionName, ...request }) {\n const data = encodeFunctionData({\n abi,\n args,\n functionName,\n });\n const hash = await sendTransaction(client, {\n data: `${data}${dataSuffix ? dataSuffix.replace('0x', '') : ''}`,\n to: address,\n ...request,\n });\n return hash;\n}\n//# sourceMappingURL=writeContract.js.map","import { createContractEventFilter, } from './public/createContractEventFilter.js';\nimport { estimateContractGas, } from './public/estimateContractGas.js';\nimport { readContract, } from './public/readContract.js';\nimport { simulateContract, } from './public/simulateContract.js';\nimport { watchContractEvent, } from './public/watchContractEvent.js';\nimport { writeContract, } from './wallet/writeContract.js';\n/**\n * Gets type-safe interface for performing contract-related actions with a specific `abi` and `address`.\n *\n * - Docs https://viem.sh/docs/contract/getContract.html\n *\n * Using Contract Instances can make it easier to work with contracts if you don't want to pass the `abi` and `address` properites every time you perform contract actions, e.g. [`readContract`](https://viem.sh/docs/contract/readContract.html), [`writeContract`](https://viem.sh/docs/contract/writeContract.html), [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas.html), etc.\n *\n * @example\n * import { createPublicClient, getContract, http, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n *\n * const publicClient = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const contract = getContract({\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * abi: parseAbi([\n * 'function balanceOf(address owner) view returns (uint256)',\n * 'function ownerOf(uint256 tokenId) view returns (address)',\n * 'function totalSupply() view returns (uint256)',\n * ]),\n * publicClient,\n * })\n */\nexport function getContract({ abi, address, publicClient, walletClient, }) {\n const hasPublicClient = publicClient !== undefined && publicClient !== null;\n const hasWalletClient = walletClient !== undefined && walletClient !== null;\n const contract = {};\n let hasReadFunction = false;\n let hasWriteFunction = false;\n let hasEvent = false;\n for (const item of abi) {\n if (item.type === 'function')\n if (item.stateMutability === 'view' || item.stateMutability === 'pure')\n hasReadFunction = true;\n else\n hasWriteFunction = true;\n else if (item.type === 'event')\n hasEvent = true;\n // Exit early if all flags are `true`\n if (hasReadFunction && hasWriteFunction && hasEvent)\n break;\n }\n if (hasPublicClient) {\n if (hasReadFunction)\n contract.read = new Proxy({}, {\n get(_, functionName) {\n return (...parameters) => {\n const { args, options } = getFunctionParameters(parameters);\n return readContract(publicClient, {\n abi,\n address,\n functionName,\n args,\n ...options,\n });\n };\n },\n });\n if (hasWriteFunction)\n contract.simulate = new Proxy({}, {\n get(_, functionName) {\n return (...parameters) => {\n const { args, options } = getFunctionParameters(parameters);\n return simulateContract(publicClient, {\n abi,\n address,\n functionName,\n args,\n ...options,\n });\n };\n },\n });\n if (hasEvent) {\n contract.createEventFilter = new Proxy({}, {\n get(_, eventName) {\n return (...parameters) => {\n const abiEvent = abi.find((x) => x.type === 'event' && x.name === eventName);\n const { args, options } = getEventParameters(parameters, abiEvent);\n return createContractEventFilter(publicClient, {\n abi,\n address,\n eventName,\n args,\n ...options,\n });\n };\n },\n });\n contract.watchEvent = new Proxy({}, {\n get(_, eventName) {\n return (...parameters) => {\n const abiEvent = abi.find((x) => x.type === 'event' && x.name === eventName);\n const { args, options } = getEventParameters(parameters, abiEvent);\n return watchContractEvent(publicClient, {\n abi,\n address,\n eventName,\n args,\n ...options,\n });\n };\n },\n });\n }\n }\n if (hasWalletClient) {\n if (hasWriteFunction)\n contract.write = new Proxy({}, {\n get(_, functionName) {\n return (...parameters) => {\n const { args, options } = getFunctionParameters(parameters);\n return writeContract(walletClient, {\n abi,\n address,\n functionName,\n args,\n ...options,\n });\n };\n },\n });\n }\n if (hasPublicClient || hasWalletClient)\n if (hasWriteFunction)\n contract.estimateGas = new Proxy({}, {\n get(_, functionName) {\n return (...parameters) => {\n const { args, options } = getFunctionParameters(parameters);\n const client = (publicClient ?? walletClient);\n return estimateContractGas(client, {\n abi,\n address,\n functionName,\n args,\n ...options,\n account: options.account ??\n walletClient.account,\n });\n };\n },\n });\n contract.address = address;\n contract.abi = abi;\n return contract;\n}\n/**\n * @internal exporting for testing only\n */\nexport function getFunctionParameters(values) {\n const hasArgs = values.length && Array.isArray(values[0]);\n const args = hasArgs ? values[0] : [];\n const options = (hasArgs ? values[1] : values[0]) ?? {};\n return { args, options };\n}\n/**\n * @internal exporting for testing only\n */\nexport function getEventParameters(values, abiEvent) {\n let hasArgs = false;\n // If first item is array, must be `args`\n if (Array.isArray(values[0]))\n hasArgs = true;\n // Check if first item is `args` or `options`\n else if (values.length === 1) {\n // if event has indexed inputs, must have `args`\n hasArgs = abiEvent.inputs.some((x) => x.indexed);\n // If there are two items in array, must have `args`\n }\n else if (values.length === 2) {\n hasArgs = true;\n }\n const args = hasArgs ? values[0] : undefined;\n const options = (hasArgs ? values[1] : values[0]) ?? {};\n return { args, options };\n}\n//# sourceMappingURL=getContract.js.map","import { numberToHex } from '../../utils/encoding/toHex.js';\n/**\n * Adds an EVM chain to the wallet.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/addChain.html\n * - JSON-RPC Methods: [`eth_addEthereumChain`](https://eips.ethereum.org/EIPS/eip-3085)\n *\n * @param client - Client to use\n * @param parameters - {@link AddChainParameters}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { optimism } from 'viem/chains'\n * import { addChain } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * transport: custom(window.ethereum),\n * })\n * await addChain(client, { chain: optimism })\n */\nexport async function addChain(client, { chain }) {\n const { id, name, nativeCurrency, rpcUrls, blockExplorers } = chain;\n await client.request({\n method: 'wallet_addEthereumChain',\n params: [\n {\n chainId: numberToHex(id),\n chainName: name,\n nativeCurrency,\n rpcUrls: rpcUrls.default.http,\n blockExplorerUrls: blockExplorers\n ? Object.values(blockExplorers).map(({ url }) => url)\n : undefined,\n },\n ],\n });\n}\n//# sourceMappingURL=addChain.js.map","import { checksumAddress } from '../../utils/address/getAddress.js';\nimport { keccak256 } from '../../utils/hash/keccak256.js';\n/**\n * @description Converts an ECDSA public key to an address.\n *\n * @param publicKey The public key to convert.\n *\n * @returns The address.\n */\nexport function publicKeyToAddress(publicKey) {\n const address = keccak256(`0x${publicKey.substring(4)}`).substring(26);\n return checksumAddress(`0x${address}`);\n}\n//# sourceMappingURL=publicKeyToAddress.js.map","const size = 256;\nlet index = size;\nlet buffer;\nexport function uid(length = 11) {\n if (!buffer || index + length > size * 2) {\n buffer = '';\n index = 0;\n for (let i = 0; i < size; i++) {\n buffer += ((256 + Math.random() * 256) | 0).toString(16).substring(1);\n }\n }\n return buffer.substring(index, index++ + length);\n}\n//# sourceMappingURL=uid.js.map","import { parseAccount } from '../utils/accounts.js';\nimport { uid } from '../utils/uid.js';\nexport function createClient(parameters) {\n const { batch, cacheTime = parameters.pollingInterval ?? 4000, key = 'base', name = 'Base Client', pollingInterval = 4000, type = 'base', } = parameters;\n const chain = parameters.chain;\n const account = parameters.account\n ? parseAccount(parameters.account)\n : undefined;\n const { config, request, value } = parameters.transport({\n chain,\n pollingInterval,\n });\n const transport = { ...config, ...value };\n const client = {\n account,\n batch,\n cacheTime,\n chain,\n key,\n name,\n pollingInterval,\n request,\n transport,\n type,\n uid: uid(),\n };\n function extend(base) {\n return (extendFn) => {\n const extended = extendFn(base);\n for (const key in client)\n delete extended[key];\n const combined = { ...base, ...extended };\n return Object.assign(combined, { extend: extend(combined) });\n };\n }\n return Object.assign(client, { extend: extend(client) });\n}\n//# sourceMappingURL=createClient.js.map","import { wait } from '../wait.js';\nexport function withRetry(fn, { delay: delay_ = 100, retryCount = 2, shouldRetry = () => true, } = {}) {\n return new Promise((resolve, reject) => {\n const attemptRetry = async ({ count = 0 } = {}) => {\n const retry = async ({ error }) => {\n const delay = typeof delay_ === 'function' ? delay_({ count, error }) : delay_;\n if (delay)\n await wait(delay);\n attemptRetry({ count: count + 1 });\n };\n try {\n const data = await fn();\n resolve(data);\n }\n catch (err) {\n if (count < retryCount &&\n (await shouldRetry({ count, error: err })))\n return retry({ error: err });\n reject(err);\n }\n };\n attemptRetry();\n });\n}\n//# sourceMappingURL=withRetry.js.map","import { BaseError } from '../errors/base.js';\nimport { HttpRequestError } from '../errors/request.js';\nimport { ChainDisconnectedError, InternalRpcError, InvalidInputRpcError, InvalidParamsRpcError, InvalidRequestRpcError, JsonRpcVersionUnsupportedError, LimitExceededRpcError, MethodNotFoundRpcError, MethodNotSupportedRpcError, ParseRpcError, ProviderDisconnectedError, ResourceNotFoundRpcError, ResourceUnavailableRpcError, SwitchChainError, TransactionRejectedRpcError, UnauthorizedProviderError, UnknownRpcError, UnsupportedProviderMethodError, UserRejectedRequestError, } from '../errors/rpc.js';\nimport { withRetry } from './promise/withRetry.js';\nexport const isDeterministicError = (error) => {\n if ('code' in error)\n return (error.code !== -1 &&\n error.code !== -32004 &&\n error.code !== -32005 &&\n error.code !== -32042 &&\n error.code !== -32603);\n if (error instanceof HttpRequestError && error.status)\n return (error.status !== 403 &&\n error.status !== 408 &&\n error.status !== 413 &&\n error.status !== 429 &&\n error.status !== 500 &&\n error.status !== 502 &&\n error.status !== 503 &&\n error.status !== 504);\n return false;\n};\nexport function buildRequest(request, { retryDelay = 150, retryCount = 3, } = {}) {\n return (async (args) => withRetry(async () => {\n try {\n return await request(args);\n }\n catch (err_) {\n const err = err_;\n switch (err.code) {\n // -32700\n case ParseRpcError.code:\n throw new ParseRpcError(err);\n // -32600\n case InvalidRequestRpcError.code:\n throw new InvalidRequestRpcError(err);\n // -32601\n case MethodNotFoundRpcError.code:\n throw new MethodNotFoundRpcError(err);\n // -32602\n case InvalidParamsRpcError.code:\n throw new InvalidParamsRpcError(err);\n // -32603\n case InternalRpcError.code:\n throw new InternalRpcError(err);\n // -32000\n case InvalidInputRpcError.code:\n throw new InvalidInputRpcError(err);\n // -32001\n case ResourceNotFoundRpcError.code:\n throw new ResourceNotFoundRpcError(err);\n // -32002\n case ResourceUnavailableRpcError.code:\n throw new ResourceUnavailableRpcError(err);\n // -32003\n case TransactionRejectedRpcError.code:\n throw new TransactionRejectedRpcError(err);\n // -32004\n case MethodNotSupportedRpcError.code:\n throw new MethodNotSupportedRpcError(err);\n // -32005\n case LimitExceededRpcError.code:\n throw new LimitExceededRpcError(err);\n // -32006\n case JsonRpcVersionUnsupportedError.code:\n throw new JsonRpcVersionUnsupportedError(err);\n // 4001\n case UserRejectedRequestError.code:\n throw new UserRejectedRequestError(err);\n // 4100\n case UnauthorizedProviderError.code:\n throw new UnauthorizedProviderError(err);\n // 4200\n case UnsupportedProviderMethodError.code:\n throw new UnsupportedProviderMethodError(err);\n // 4900\n case ProviderDisconnectedError.code:\n throw new ProviderDisconnectedError(err);\n // 4901\n case ChainDisconnectedError.code:\n throw new ChainDisconnectedError(err);\n // 4902\n case SwitchChainError.code:\n throw new SwitchChainError(err);\n default:\n if (err_ instanceof BaseError)\n throw err_;\n throw new UnknownRpcError(err);\n }\n }\n }, {\n delay: ({ count, error }) => {\n // If we find a Retry-After header, let's retry after the given time.\n if (error && error instanceof HttpRequestError) {\n const retryAfter = error?.headers?.get('Retry-After');\n if (retryAfter?.match(/\\d/))\n return parseInt(retryAfter) * 1000;\n }\n // Otherwise, let's retry with an exponential backoff.\n return ~~(1 << count) * retryDelay;\n },\n retryCount,\n shouldRetry: ({ error }) => !isDeterministicError(error),\n }));\n}\n//# sourceMappingURL=buildRequest.js.map","import { buildRequest } from '../../utils/buildRequest.js';\n/**\n * @description Creates an transport intended to be used with a client.\n */\nexport function createTransport({ key, name, request, retryCount = 3, retryDelay = 150, timeout, type, }, value) {\n return {\n config: { key, name, request, retryCount, retryDelay, timeout, type },\n request: buildRequest(request, { retryCount, retryDelay }),\n value,\n };\n}\n//# sourceMappingURL=createTransport.js.map","import { isDeterministicError } from '../../utils/buildRequest.js';\nimport { wait } from '../../utils/wait.js';\nimport { createTransport, } from './createTransport.js';\nexport function fallback(transports_, config = {}) {\n const { key = 'fallback', name = 'Fallback', rank = false, retryCount, retryDelay, } = config;\n return ({ chain, pollingInterval = 4000, timeout }) => {\n let transports = transports_;\n let onResponse = () => { };\n const transport = createTransport({\n key,\n name,\n async request({ method, params }) {\n const fetch = async (i = 0) => {\n const transport = transports[i]({ chain, retryCount: 0, timeout });\n try {\n const response = await transport.request({\n method,\n params,\n });\n onResponse({\n method,\n params: params,\n response,\n transport,\n status: 'success',\n });\n return response;\n }\n catch (err) {\n onResponse({\n error: err,\n method,\n params: params,\n transport,\n status: 'error',\n });\n // If the error is deterministic, we don't need to fall back.\n // So throw the error.\n if (isDeterministicError(err))\n throw err;\n // If we've reached the end of the fallbacks, throw the error.\n if (i === transports.length - 1)\n throw err;\n // Otherwise, try the next fallback.\n return fetch(i + 1);\n }\n };\n return fetch();\n },\n retryCount,\n retryDelay,\n type: 'fallback',\n }, {\n onResponse: (fn) => (onResponse = fn),\n transports: transports.map((fn) => fn({ chain, retryCount: 0 })),\n });\n if (rank) {\n const rankOptions = (typeof rank === 'object' ? rank : {});\n rankTransports({\n chain,\n interval: rankOptions.interval ?? pollingInterval,\n onTransports: (transports_) => (transports = transports_),\n sampleCount: rankOptions.sampleCount,\n timeout: rankOptions.timeout,\n transports,\n weights: rankOptions.weights,\n });\n }\n return transport;\n };\n}\nexport function rankTransports({ chain, interval = 4000, onTransports, sampleCount = 10, timeout = 1000, transports, weights = {}, }) {\n const { stability: stabilityWeight = 0.7, latency: latencyWeight = 0.3 } = weights;\n const samples = [];\n const rankTransports_ = async () => {\n // 1. Take a sample from each Transport.\n const sample = await Promise.all(transports.map(async (transport) => {\n const transport_ = transport({ chain, retryCount: 0, timeout });\n const start = Date.now();\n let end;\n let success;\n try {\n await transport_.request({ method: 'net_listening' });\n success = 1;\n }\n catch {\n success = 0;\n }\n finally {\n end = Date.now();\n }\n const latency = end - start;\n return { latency, success };\n }));\n // 2. Store the sample. If we have more than `sampleCount` samples, remove\n // the oldest sample.\n samples.push(sample);\n if (samples.length > sampleCount)\n samples.shift();\n // 3. Calculate the max latency from samples.\n const maxLatency = Math.max(...samples.map((sample) => Math.max(...sample.map(({ latency }) => latency))));\n // 4. Calculate the score for each Transport.\n const scores = transports\n .map((_, i) => {\n const latencies = samples.map((sample) => sample[i].latency);\n const meanLatency = latencies.reduce((acc, latency) => acc + latency, 0) /\n latencies.length;\n const latencyScore = 1 - meanLatency / maxLatency;\n const successes = samples.map((sample) => sample[i].success);\n const stabilityScore = successes.reduce((acc, success) => acc + success, 0) /\n successes.length;\n if (stabilityScore === 0)\n return [0, i];\n return [\n latencyWeight * latencyScore + stabilityWeight * stabilityScore,\n i,\n ];\n })\n .sort((a, b) => b[0] - a[0]);\n // 5. Sort the Transports by score.\n onTransports(scores.map(([, i]) => transports[i]));\n // 6. Wait, and then rank again.\n await wait(interval);\n rankTransports_();\n };\n rankTransports_();\n}\n//# sourceMappingURL=fallback.js.map","import { BaseError } from './base.js';\nexport class UrlRequiredError extends BaseError {\n constructor() {\n super('No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.', {\n docsPath: '/docs/clients/intro',\n });\n }\n}\n//# sourceMappingURL=transport.js.map","export function withTimeout(fn, { errorInstance, timeout, signal, }) {\n return new Promise((resolve, reject) => {\n ;\n (async () => {\n let timeoutId;\n try {\n const controller = new AbortController();\n if (timeout > 0) {\n timeoutId = setTimeout(() => {\n if (signal) {\n controller.abort();\n }\n else {\n reject(errorInstance);\n }\n }, timeout);\n }\n resolve(await fn({ signal: controller?.signal }));\n }\n catch (err) {\n if (err.name === 'AbortError')\n reject(errorInstance);\n reject(err);\n }\n finally {\n clearTimeout(timeoutId);\n }\n })();\n });\n}\n//# sourceMappingURL=withTimeout.js.map","import { HttpRequestError, TimeoutError, WebSocketRequestError, } from '../errors/request.js';\nimport { createBatchScheduler } from './promise/createBatchScheduler.js';\nimport { withTimeout } from './promise/withTimeout.js';\nimport { stringify } from './stringify.js';\nlet id = 0;\nasync function http(url, { body, fetchOptions = {}, timeout = 10000 }) {\n const { headers, method, signal: signal_ } = fetchOptions;\n try {\n const response = await withTimeout(async ({ signal }) => {\n const response = await fetch(url, {\n ...fetchOptions,\n body: Array.isArray(body)\n ? stringify(body.map((body) => ({\n jsonrpc: '2.0',\n id: id++,\n ...body,\n })))\n : stringify({ jsonrpc: '2.0', id: id++, ...body }),\n headers: {\n ...headers,\n 'Content-Type': 'application/json',\n },\n method: method || 'POST',\n signal: signal_ || (timeout > 0 ? signal : undefined),\n });\n return response;\n }, {\n errorInstance: new TimeoutError({ body, url }),\n timeout,\n signal: true,\n });\n let data;\n if (response.headers.get('Content-Type')?.startsWith('application/json')) {\n data = await response.json();\n }\n else {\n data = await response.text();\n }\n if (!response.ok) {\n throw new HttpRequestError({\n body,\n details: stringify(data.error) || response.statusText,\n headers: response.headers,\n status: response.status,\n url,\n });\n }\n return data;\n }\n catch (err) {\n if (err instanceof HttpRequestError)\n throw err;\n if (err instanceof TimeoutError)\n throw err;\n throw new HttpRequestError({\n body,\n details: err.message,\n url,\n });\n }\n}\nconst sockets = /*#__PURE__*/ new Map();\nexport async function getSocket(url_) {\n const url = new URL(url_);\n const urlKey = url.toString();\n let socket = sockets.get(urlKey);\n // If the socket already exists, return it.\n if (socket)\n return socket;\n const { schedule } = createBatchScheduler({\n id: urlKey,\n fn: async () => {\n let WebSocket = await import('isomorphic-ws');\n // Workaround for Vite.\n // https://github.com/vitejs/vite/issues/9703\n // TODO: Remove when issue is resolved.\n if (WebSocket.default\n ?.constructor)\n WebSocket = WebSocket\n .default;\n else\n WebSocket = WebSocket.WebSocket;\n const webSocket = new WebSocket(url);\n // Set up a cache for incoming \"synchronous\" requests.\n const requests = new Map();\n // Set up a cache for subscriptions (eth_subscribe).\n const subscriptions = new Map();\n const onMessage = ({ data }) => {\n const message = JSON.parse(data);\n const isSubscription = message.method === 'eth_subscription';\n const id = isSubscription ? message.params.subscription : message.id;\n const cache = isSubscription ? subscriptions : requests;\n const callback = cache.get(id);\n if (callback)\n callback({ data });\n if (!isSubscription)\n cache.delete(id);\n };\n const onClose = () => {\n sockets.delete(urlKey);\n webSocket.removeEventListener('close', onClose);\n webSocket.removeEventListener('message', onMessage);\n };\n // Setup event listeners for RPC & subscription responses.\n webSocket.addEventListener('close', onClose);\n webSocket.addEventListener('message', onMessage);\n // Wait for the socket to open.\n if (webSocket.readyState === WebSocket.CONNECTING) {\n await new Promise((resolve, reject) => {\n if (!webSocket)\n return;\n webSocket.onopen = resolve;\n webSocket.onerror = reject;\n });\n }\n // Create a new socket instance.\n socket = Object.assign(webSocket, {\n requests,\n subscriptions,\n });\n sockets.set(urlKey, socket);\n return [socket];\n },\n });\n const [_, [socket_]] = await schedule();\n return socket_;\n}\nfunction webSocket(socket, { body, onResponse }) {\n if (socket.readyState === socket.CLOSED ||\n socket.readyState === socket.CLOSING)\n throw new WebSocketRequestError({\n body,\n url: socket.url,\n details: 'Socket is closed.',\n });\n const id_ = id++;\n const callback = ({ data }) => {\n const message = JSON.parse(data);\n if (typeof message.id === 'number' && id_ !== message.id)\n return;\n onResponse?.(message);\n // If we are subscribing to a topic, we want to set up a listener for incoming\n // messages.\n if (body.method === 'eth_subscribe' && typeof message.result === 'string') {\n socket.subscriptions.set(message.result, callback);\n }\n // If we are unsubscribing from a topic, we want to remove the listener.\n if (body.method === 'eth_unsubscribe') {\n socket.subscriptions.delete(body.params?.[0]);\n }\n };\n socket.requests.set(id_, callback);\n socket.send(JSON.stringify({ jsonrpc: '2.0', ...body, id: id_ }));\n return socket;\n}\nasync function webSocketAsync(socket, { body, timeout = 10000 }) {\n return withTimeout(() => new Promise((onResponse) => rpc.webSocket(socket, {\n body,\n onResponse,\n })), {\n errorInstance: new TimeoutError({ body, url: socket.url }),\n timeout,\n });\n}\n///////////////////////////////////////////////////\nexport const rpc = {\n http,\n webSocket,\n webSocketAsync,\n};\n//# sourceMappingURL=rpc.js.map","import { RpcRequestError } from '../../errors/request.js';\nimport { UrlRequiredError } from '../../errors/transport.js';\nimport { createBatchScheduler } from '../../utils/promise/createBatchScheduler.js';\nimport { rpc } from '../../utils/rpc.js';\nimport { createTransport, } from './createTransport.js';\n/**\n * @description Creates a HTTP transport that connects to a JSON-RPC API.\n */\nexport function http(\n/** URL of the JSON-RPC API. Defaults to the chain's public RPC URL. */\nurl, config = {}) {\n const { batch, fetchOptions, key = 'http', name = 'HTTP JSON-RPC', retryDelay, } = config;\n return ({ chain, retryCount: retryCount_, timeout: timeout_ }) => {\n const { batchSize = 1000, wait = 0 } = typeof batch === 'object' ? batch : {};\n const retryCount = config.retryCount ?? retryCount_;\n const timeout = timeout_ ?? config.timeout ?? 10000;\n const url_ = url || chain?.rpcUrls.default.http[0];\n if (!url_)\n throw new UrlRequiredError();\n return createTransport({\n key,\n name,\n async request({ method, params }) {\n const body = { method, params };\n const { schedule } = createBatchScheduler({\n id: `${url}`,\n wait,\n shouldSplitBatch(requests) {\n return requests.length > batchSize;\n },\n fn: (body) => rpc.http(url_, {\n body,\n fetchOptions,\n timeout,\n }),\n });\n const fn = async (body) => batch\n ? schedule(body)\n : [await rpc.http(url_, { body, fetchOptions, timeout })];\n const [{ error, result }] = await fn(body);\n if (error)\n throw new RpcRequestError({\n body,\n error,\n url: url_,\n });\n return result;\n },\n retryCount,\n retryDelay,\n timeout,\n type: 'http',\n }, {\n url,\n });\n };\n}\n//# sourceMappingURL=http.js.map","import { panicReasons } from '../../constants/solidity.js';\nimport { BaseError } from '../../errors/base.js';\nimport { ContractFunctionRevertedError } from '../../errors/contract.js';\n/*\n * @description Checks if error is a valid null result UniversalResolver error\n */\nexport function isNullUniversalResolverError(err, callType) {\n if (!(err instanceof BaseError))\n return false;\n const cause = err.walk((e) => e instanceof ContractFunctionRevertedError);\n if (!(cause instanceof ContractFunctionRevertedError))\n return false;\n if (cause.data?.errorName === 'ResolverNotFound')\n return true;\n if (cause.data?.errorName === 'ResolverWildcardNotSupported')\n return true;\n // Backwards compatibility for older UniversalResolver contracts\n if (cause.reason?.includes('Wildcard on non-extended resolvers is not supported'))\n return true;\n // No primary name set for address.\n if (callType === 'reverse' && cause.reason === panicReasons[50])\n return true;\n return false;\n}\n//# sourceMappingURL=errors.js.map","export const arrayRegex = /^(.*)\\[([0-9]*)\\]$/;\n// `bytes`: binary type of `M` bytes, `0 < M <= 32`\n// https://regexr.com/6va55\nexport const bytesRegex = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/;\n// `(u)int`: (un)signed integer type of `M` bits, `0 < M <= 256`, `M % 8 == 0`\n// https://regexr.com/6v8hp\nexport const integerRegex = /^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;\n//# sourceMappingURL=regex.js.map","import { BytesSizeMismatchError } from '../errors/abi.js';\nimport { InvalidAddressError } from '../errors/address.js';\nimport { isAddress } from './address/isAddress.js';\nimport { size } from './data/size.js';\nimport { numberToHex } from './encoding/toHex.js';\nimport { bytesRegex, integerRegex } from './regex.js';\nexport function validateTypedData({ domain, message, primaryType, types: types_, }) {\n const types = types_;\n const validateData = (struct, value_) => {\n for (const param of struct) {\n const { name, type: type_ } = param;\n const type = type_;\n const value = value_[name];\n const integerMatch = type.match(integerRegex);\n if (integerMatch &&\n (typeof value === 'number' || typeof value === 'bigint')) {\n const [_type, base, size_] = integerMatch;\n // If number cannot be cast to a sized hex value, it is out of range\n // and will throw.\n numberToHex(value, {\n signed: base === 'int',\n size: parseInt(size_) / 8,\n });\n }\n if (type === 'address' && typeof value === 'string' && !isAddress(value))\n throw new InvalidAddressError({ address: value });\n const bytesMatch = type.match(bytesRegex);\n if (bytesMatch) {\n const [_type, size_] = bytesMatch;\n if (size_ && size(value) !== parseInt(size_))\n throw new BytesSizeMismatchError({\n expectedSize: parseInt(size_),\n givenSize: size(value),\n });\n }\n const struct = types[type];\n if (struct)\n validateData(struct, value);\n }\n };\n // Validate domain types.\n if (types['EIP712Domain'] && domain)\n validateData(types['EIP712Domain'], domain);\n if (primaryType !== 'EIP712Domain') {\n // Validate message types.\n const type = types[primaryType];\n validateData(type, message);\n }\n}\n//# sourceMappingURL=typedData.js.map","import { AbiConstructorNotFoundError, AbiConstructorParamsNotFoundError, } from '../../errors/abi.js';\nimport { concatHex } from '../data/concat.js';\nimport { encodeAbiParameters } from './encodeAbiParameters.js';\nconst docsPath = '/docs/contract/encodeDeployData';\nexport function encodeDeployData({ abi, args, bytecode, }) {\n if (!args || args.length === 0)\n return bytecode;\n const description = abi.find((x) => 'type' in x && x.type === 'constructor');\n if (!description)\n throw new AbiConstructorNotFoundError({ docsPath });\n if (!('inputs' in description))\n throw new AbiConstructorParamsNotFoundError({ docsPath });\n if (!description.inputs || description.inputs.length === 0)\n throw new AbiConstructorParamsNotFoundError({ docsPath });\n const data = encodeAbiParameters(description.inputs, args);\n return concatHex([bytecode, data]);\n}\n//# sourceMappingURL=encodeDeployData.js.map","import { concat } from '../data/concat.js';\nimport { toBytes } from './toBytes.js';\nimport { bytesToHex } from './toHex.js';\nexport function toRlp(hexOrBytes, to_) {\n const to = to_ || 'hex';\n return format(bytesToRlp(parse(hexOrBytes)), to);\n}\nfunction parse(hexOrBytes) {\n if (Array.isArray(hexOrBytes))\n return hexOrBytes.map(parse);\n return typeof hexOrBytes === 'string' ? toBytes(hexOrBytes) : hexOrBytes;\n}\nfunction format(bytes, type = 'bytes') {\n return type === 'hex' ? bytesToHex(bytes) : bytes;\n}\nexport function bytesToRlp(bytes) {\n if (Array.isArray(bytes)) {\n const encoded = concat(bytes.map(bytesToRlp));\n return new Uint8Array([...encodeLength(encoded.length, 0xc0), ...encoded]);\n }\n if (bytes.length === 1 && bytes[0] < 0x80)\n return bytes;\n return new Uint8Array([...encodeLength(bytes.length, 0x80), ...bytes]);\n}\nfunction encodeLength(length, offset) {\n if (length < 56)\n return [offset + length];\n return [toBytes(length).length + offset + 55, ...toBytes(length)];\n}\n//# sourceMappingURL=toRlp.js.map","import { hexToNumber } from '../encoding/fromHex.js';\nimport { defineFormatter } from './formatter.js';\nimport { formatLog } from './log.js';\nimport { transactionType } from './transaction.js';\nconst statuses = {\n '0x0': 'reverted',\n '0x1': 'success',\n};\nexport function formatTransactionReceipt(transactionReceipt) {\n return {\n ...transactionReceipt,\n blockNumber: transactionReceipt.blockNumber\n ? BigInt(transactionReceipt.blockNumber)\n : null,\n contractAddress: transactionReceipt.contractAddress\n ? transactionReceipt.contractAddress\n : null,\n cumulativeGasUsed: transactionReceipt.cumulativeGasUsed\n ? BigInt(transactionReceipt.cumulativeGasUsed)\n : null,\n effectiveGasPrice: transactionReceipt.effectiveGasPrice\n ? BigInt(transactionReceipt.effectiveGasPrice)\n : null,\n gasUsed: transactionReceipt.gasUsed\n ? BigInt(transactionReceipt.gasUsed)\n : null,\n logs: transactionReceipt.logs\n ? transactionReceipt.logs.map((log) => formatLog(log))\n : null,\n to: transactionReceipt.to ? transactionReceipt.to : null,\n transactionIndex: transactionReceipt.transactionIndex\n ? hexToNumber(transactionReceipt.transactionIndex)\n : null,\n status: transactionReceipt.status\n ? statuses[transactionReceipt.status]\n : null,\n type: transactionReceipt.type\n ? transactionType[transactionReceipt.type] || transactionReceipt.type\n : null,\n };\n}\nexport const defineTransactionReceipt = /*#__PURE__*/ defineFormatter('transactionReceipt', formatTransactionReceipt);\n//# sourceMappingURL=transactionReceipt.js.map","// Implementation forked and adapted from https://github.com/MetaMask/eth-sig-util/blob/main/src/sign-typed-data.ts\nimport { encodeAbiParameters } from '../abi/encodeAbiParameters.js';\nimport { concat } from '../data/concat.js';\nimport { toHex } from '../encoding/toHex.js';\nimport { keccak256 } from '../hash/keccak256.js';\nimport { validateTypedData } from '../typedData.js';\nexport function hashTypedData({ domain: domain_, message, primaryType, types: types_, }) {\n const domain = typeof domain_ === 'undefined' ? {} : domain_;\n const types = {\n EIP712Domain: [\n typeof domain?.name === 'string' && { name: 'name', type: 'string' },\n domain?.version && { name: 'version', type: 'string' },\n typeof domain?.chainId === 'number' && {\n name: 'chainId',\n type: 'uint256',\n },\n domain?.verifyingContract && {\n name: 'verifyingContract',\n type: 'address',\n },\n domain?.salt && { name: 'salt', type: 'bytes32' },\n ].filter(Boolean),\n ...types_,\n };\n // Need to do a runtime validation check on addresses, byte ranges, integer ranges, etc\n // as we can't statically check this with TypeScript.\n validateTypedData({\n domain,\n message,\n primaryType,\n types,\n });\n const parts = ['0x1901'];\n if (domain)\n parts.push(hashDomain({\n domain,\n types: types,\n }));\n if (primaryType !== 'EIP712Domain') {\n parts.push(hashStruct({\n data: message,\n primaryType: primaryType,\n types: types,\n }));\n }\n return keccak256(concat(parts));\n}\nfunction hashDomain({ domain, types, }) {\n return hashStruct({\n data: domain,\n primaryType: 'EIP712Domain',\n types,\n });\n}\nfunction hashStruct({ data, primaryType, types, }) {\n const encoded = encodeData({\n data,\n primaryType,\n types,\n });\n return keccak256(encoded);\n}\nfunction encodeData({ data, primaryType, types, }) {\n const encodedTypes = [{ type: 'bytes32' }];\n const encodedValues = [hashType({ primaryType, types })];\n for (const field of types[primaryType]) {\n const [type, value] = encodeField({\n types,\n name: field.name,\n type: field.type,\n value: data[field.name],\n });\n encodedTypes.push(type);\n encodedValues.push(value);\n }\n return encodeAbiParameters(encodedTypes, encodedValues);\n}\nfunction hashType({ primaryType, types, }) {\n const encodedHashType = toHex(encodeType({ primaryType, types }));\n return keccak256(encodedHashType);\n}\nfunction encodeType({ primaryType, types, }) {\n let result = '';\n const unsortedDeps = findTypeDependencies({ primaryType, types });\n unsortedDeps.delete(primaryType);\n const deps = [primaryType, ...Array.from(unsortedDeps).sort()];\n for (const type of deps) {\n result += `${type}(${types[type]\n .map(({ name, type: t }) => `${t} ${name}`)\n .join(',')})`;\n }\n return result;\n}\nfunction findTypeDependencies({ primaryType: primaryType_, types, }, results = new Set()) {\n const match = primaryType_.match(/^\\w*/u);\n const primaryType = match?.[0];\n if (results.has(primaryType) || types[primaryType] === undefined) {\n return results;\n }\n results.add(primaryType);\n for (const field of types[primaryType]) {\n findTypeDependencies({ primaryType: field.type, types }, results);\n }\n return results;\n}\nfunction encodeField({ types, name, type, value, }) {\n if (types[type] !== undefined) {\n return [\n { type: 'bytes32' },\n keccak256(encodeData({ data: value, primaryType: type, types })),\n ];\n }\n if (type === 'bytes') {\n const prepend = value.length % 2 ? '0' : '';\n value = `0x${prepend + value.slice(2)}`;\n return [{ type: 'bytes32' }, keccak256(value)];\n }\n if (type === 'string')\n return [{ type: 'bytes32' }, keccak256(toHex(value))];\n if (type.lastIndexOf(']') === type.length - 1) {\n const parsedType = type.slice(0, type.lastIndexOf('['));\n const typeValuePairs = value.map((item) => encodeField({\n name,\n type: parsedType,\n types,\n value: item,\n }));\n return [\n { type: 'bytes32' },\n keccak256(encodeAbiParameters(typeValuePairs.map(([t]) => t), typeValuePairs.map(([, v]) => v))),\n ];\n }\n return [{ type }, value];\n}\n//# sourceMappingURL=hashTypedData.js.map","import { concat } from '../data/concat.js';\nimport { stringToBytes, toBytes } from '../encoding/toBytes.js';\nimport { keccak256 } from '../hash/keccak256.js';\nexport function hashMessage(message, to_) {\n const messageBytes = (() => {\n if (typeof message === 'string')\n return stringToBytes(message);\n if (message.raw instanceof Uint8Array)\n return message.raw;\n return toBytes(message.raw);\n })();\n const prefixBytes = stringToBytes(`\\x19Ethereum Signed Message:\\n${messageBytes.length}`);\n return keccak256(concat([prefixBytes, messageBytes]), to_);\n}\n//# sourceMappingURL=hashMessage.js.map","import { InvalidSerializableTransactionError } from '../../errors/transaction.js';\nexport function getTransactionType(transaction) {\n if (transaction.type)\n return transaction.type;\n if (typeof transaction.maxFeePerGas !== 'undefined' ||\n typeof transaction.maxPriorityFeePerGas !== 'undefined')\n return 'eip1559';\n if (typeof transaction.gasPrice !== 'undefined') {\n if (typeof transaction.accessList !== 'undefined')\n return 'eip2930';\n return 'legacy';\n }\n throw new InvalidSerializableTransactionError({ transaction });\n}\n//# sourceMappingURL=getTransactionType.js.map","import { InvalidAddressError } from '../../errors/address.js';\nimport { BaseError } from '../../errors/base.js';\nimport { InvalidChainIdError } from '../../errors/chain.js';\nimport { FeeCapTooHighError, TipAboveFeeCapError } from '../../errors/node.js';\nimport { isAddress } from '../address/isAddress.js';\nexport function assertTransactionEIP1559(transaction) {\n const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to } = transaction;\n if (chainId <= 0)\n throw new InvalidChainIdError({ chainId });\n if (to && !isAddress(to))\n throw new InvalidAddressError({ address: to });\n if (gasPrice)\n throw new BaseError('`gasPrice` is not a valid EIP-1559 Transaction attribute.');\n if (maxFeePerGas && maxFeePerGas > 2n ** 256n - 1n)\n throw new FeeCapTooHighError({ maxFeePerGas });\n if (maxPriorityFeePerGas &&\n maxFeePerGas &&\n maxPriorityFeePerGas > maxFeePerGas)\n throw new TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas });\n}\nexport function assertTransactionEIP2930(transaction) {\n const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to } = transaction;\n if (chainId <= 0)\n throw new InvalidChainIdError({ chainId });\n if (to && !isAddress(to))\n throw new InvalidAddressError({ address: to });\n if (maxPriorityFeePerGas || maxFeePerGas)\n throw new BaseError('`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.');\n if (gasPrice && gasPrice > 2n ** 256n - 1n)\n throw new FeeCapTooHighError({ maxFeePerGas: gasPrice });\n}\nexport function assertTransactionLegacy(transaction) {\n const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to, accessList, } = transaction;\n if (to && !isAddress(to))\n throw new InvalidAddressError({ address: to });\n if (typeof chainId !== 'undefined' && chainId <= 0)\n throw new InvalidChainIdError({ chainId });\n if (maxPriorityFeePerGas || maxFeePerGas)\n throw new BaseError('`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.');\n if (gasPrice && gasPrice > 2n ** 256n - 1n)\n throw new FeeCapTooHighError({ maxFeePerGas: gasPrice });\n if (accessList)\n throw new BaseError('`accessList` is not a valid Legacy Transaction attribute.');\n}\n//# sourceMappingURL=assertTransaction.js.map","import { InvalidAddressError } from '../../errors/address.js';\nimport { InvalidStorageKeySizeError } from '../../errors/transaction.js';\nimport { isAddress } from '../address/isAddress.js';\nimport {} from '../encoding/toRlp.js';\n/*\n * Serialize an EIP-2930 access list\n * @remarks\n * Use to create a transaction serializer with support for EIP-2930 access lists\n *\n * @param accessList - Array of objects of address and arrays of Storage Keys\n * @throws InvalidAddressError, InvalidStorageKeySizeError\n * @returns Array of hex strings\n */\nexport function serializeAccessList(accessList) {\n if (!accessList || accessList.length === 0)\n return [];\n const serializedAccessList = [];\n for (let i = 0; i < accessList.length; i++) {\n const { address, storageKeys } = accessList[i];\n for (let j = 0; j < storageKeys.length; j++) {\n if (storageKeys[j].length - 2 !== 64) {\n throw new InvalidStorageKeySizeError({ storageKey: storageKeys[j] });\n }\n }\n if (!isAddress(address)) {\n throw new InvalidAddressError({ address });\n }\n serializedAccessList.push([address, storageKeys]);\n }\n return serializedAccessList;\n}\n//# sourceMappingURL=serializeAccessList.js.map","import { InvalidLegacyVError } from '../../errors/transaction.js';\nimport { concatHex } from '../data/concat.js';\nimport { trim } from '../data/trim.js';\nimport { toHex } from '../encoding/toHex.js';\nimport { toRlp } from '../encoding/toRlp.js';\nimport { assertTransactionEIP1559, assertTransactionEIP2930, assertTransactionLegacy, } from './assertTransaction.js';\nimport { getTransactionType, } from './getTransactionType.js';\nimport { serializeAccessList } from './serializeAccessList.js';\nexport function serializeTransaction(transaction, signature) {\n const type = getTransactionType(transaction);\n if (type === 'eip1559')\n return serializeTransactionEIP1559(transaction, signature);\n if (type === 'eip2930')\n return serializeTransactionEIP2930(transaction, signature);\n return serializeTransactionLegacy(transaction, signature);\n}\nfunction serializeTransactionEIP1559(transaction, signature) {\n const { chainId, gas, nonce, to, value, maxFeePerGas, maxPriorityFeePerGas, accessList, data, } = transaction;\n assertTransactionEIP1559(transaction);\n const serializedAccessList = serializeAccessList(accessList);\n const serializedTransaction = [\n toHex(chainId),\n nonce ? toHex(nonce) : '0x',\n maxPriorityFeePerGas ? toHex(maxPriorityFeePerGas) : '0x',\n maxFeePerGas ? toHex(maxFeePerGas) : '0x',\n gas ? toHex(gas) : '0x',\n to ?? '0x',\n value ? toHex(value) : '0x',\n data ?? '0x',\n serializedAccessList,\n ];\n if (signature)\n serializedTransaction.push(signature.v === 27n ? '0x' : toHex(1), // yParity\n trim(signature.r), trim(signature.s));\n return concatHex([\n '0x02',\n toRlp(serializedTransaction),\n ]);\n}\nfunction serializeTransactionEIP2930(transaction, signature) {\n const { chainId, gas, data, nonce, to, value, accessList, gasPrice } = transaction;\n assertTransactionEIP2930(transaction);\n const serializedAccessList = serializeAccessList(accessList);\n const serializedTransaction = [\n toHex(chainId),\n nonce ? toHex(nonce) : '0x',\n gasPrice ? toHex(gasPrice) : '0x',\n gas ? toHex(gas) : '0x',\n to ?? '0x',\n value ? toHex(value) : '0x',\n data ?? '0x',\n serializedAccessList,\n ];\n if (signature)\n serializedTransaction.push(signature.v === 27n ? '0x' : toHex(1), // yParity\n signature.r, signature.s);\n return concatHex([\n '0x01',\n toRlp(serializedTransaction),\n ]);\n}\nfunction serializeTransactionLegacy(transaction, signature) {\n const { chainId = 0, gas, data, nonce, to, value, gasPrice } = transaction;\n assertTransactionLegacy(transaction);\n let serializedTransaction = [\n nonce ? toHex(nonce) : '0x',\n gasPrice ? toHex(gasPrice) : '0x',\n gas ? toHex(gas) : '0x',\n to ?? '0x',\n value ? toHex(value) : '0x',\n data ?? '0x',\n ];\n if (signature) {\n let v = 27n + (signature.v === 27n ? 0n : 1n);\n if (chainId > 0)\n v = BigInt(chainId * 2) + BigInt(35n + signature.v - 27n);\n else if (signature.v !== v)\n throw new InvalidLegacyVError({ v: signature.v });\n serializedTransaction = [\n ...serializedTransaction,\n toHex(v),\n signature.r,\n signature.s,\n ];\n }\n else if (chainId > 0) {\n serializedTransaction = [\n ...serializedTransaction,\n toHex(chainId),\n '0x',\n '0x',\n ];\n }\n return toRlp(serializedTransaction);\n}\n//# sourceMappingURL=serializeTransaction.js.map","export function parseUnits(value, decimals) {\n let [integer, fraction = '0'] = value.split('.');\n const negative = integer.startsWith('-');\n if (negative)\n integer = integer.slice(1);\n // trim leading zeros.\n fraction = fraction.replace(/(0+)$/, '');\n // round off if the fraction is larger than the number of decimals.\n if (decimals === 0) {\n if (Math.round(Number(`.${fraction}`)) === 1)\n integer = `${BigInt(integer) + 1n}`;\n fraction = '';\n }\n else if (fraction.length > decimals) {\n const [left, unit, right] = [\n fraction.slice(0, decimals - 1),\n fraction.slice(decimals - 1, decimals),\n fraction.slice(decimals),\n ];\n const rounded = Math.round(Number(`${unit}.${right}`));\n if (rounded > 9)\n fraction = `${BigInt(left) + BigInt(1)}0`.padStart(left.length + 1, '0');\n else\n fraction = `${left}${rounded}`;\n if (fraction.length > decimals) {\n fraction = fraction.slice(1);\n integer = `${BigInt(integer) + 1n}`;\n }\n fraction = fraction.slice(0, decimals);\n }\n else {\n fraction = fraction.padEnd(decimals, '0');\n }\n return BigInt(`${negative ? '-' : ''}${integer}${fraction}`);\n}\n//# sourceMappingURL=parseUnits.js.map","import { etherUnits } from '../../constants/unit.js';\nimport { parseUnits } from './parseUnits.js';\nexport function parseEther(ether, unit = 'wei') {\n return parseUnits(ether, etherUnits[unit]);\n}\n//# sourceMappingURL=parseEther.js.map","import { isHex } from '../index.js';\nexport function encodedLabelToLabelhash(label) {\n if (label.length !== 66)\n return null;\n if (label.indexOf('[') !== 0)\n return null;\n if (label.indexOf(']') !== 65)\n return null;\n const hash = `0x${label.slice(1, 65)}`;\n if (!isHex(hash))\n return null;\n return hash;\n}\n//# sourceMappingURL=encodedLabelToLabelhash.js.map","import { concat } from '../data/concat.js';\nimport { stringToBytes, toBytes } from '../encoding/toBytes.js';\nimport { bytesToHex } from '../encoding/toHex.js';\nimport { keccak256 } from '../hash/keccak256.js';\nimport { encodedLabelToLabelhash } from './encodedLabelToLabelhash.js';\n/**\n * @description Hashes ENS name\n *\n * - Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `namehash`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this.\n *\n * @example\n * namehash('wagmi-dev.eth')\n * '0xf246651c1b9a6b141d19c2604e9a58f567973833990f830d882534a747801359'\n *\n * @link https://eips.ethereum.org/EIPS/eip-137\n */\nexport function namehash(name) {\n let result = new Uint8Array(32).fill(0);\n if (!name)\n return bytesToHex(result);\n const labels = name.split('.');\n // Iterate in reverse order building up hash\n for (let i = labels.length - 1; i >= 0; i -= 1) {\n const hashFromEncodedLabel = encodedLabelToLabelhash(labels[i]);\n const hashed = hashFromEncodedLabel\n ? toBytes(hashFromEncodedLabel)\n : keccak256(stringToBytes(labels[i]), 'bytes');\n result = keccak256(concat([result, hashed]), 'bytes');\n }\n return bytesToHex(result);\n}\n//# sourceMappingURL=namehash.js.map","export function encodeLabelhash(hash) {\n return `[${hash.slice(2)}]`;\n}\n//# sourceMappingURL=encodeLabelhash.js.map","import { stringToBytes } from '../encoding/toBytes.js';\nimport { bytesToHex } from '../encoding/toHex.js';\nimport { keccak256 } from '../hash/keccak256.js';\nimport { encodedLabelToLabelhash } from './encodedLabelToLabelhash.js';\n/**\n * @description Hashes ENS label\n *\n * - Since ENS labels prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS labels](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `labelhash`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this.\n *\n * @example\n * labelhash('eth')\n * '0x4f5b812789fc606be1b3b16908db13fc7a9adf7ca72641f84d75b47069d3d7f0'\n */\nexport function labelhash(label) {\n const result = new Uint8Array(32).fill(0);\n if (!label)\n return bytesToHex(result);\n return encodedLabelToLabelhash(label) || keccak256(stringToBytes(label));\n}\n//# sourceMappingURL=labelhash.js.map","import { stringToBytes } from '../encoding/toBytes.js';\nimport { encodeLabelhash } from './encodeLabelhash.js';\nimport { labelhash } from './labelhash.js';\n/*\n * @description Encodes a DNS packet into a ByteArray containing a UDP payload.\n */\nexport function packetToBytes(packet) {\n // strip leading and trailing `.`\n const value = packet.replace(/^\\.|\\.$/gm, '');\n if (value.length === 0)\n return new Uint8Array(1);\n const bytes = new Uint8Array(stringToBytes(value).byteLength + 2);\n let offset = 0;\n const list = value.split('.');\n for (let i = 0; i < list.length; i++) {\n let encoded = stringToBytes(list[i]);\n // if the length is > 255, make the encoded label value a labelhash\n // this is compatible with the universal resolver\n if (encoded.byteLength > 255)\n encoded = stringToBytes(encodeLabelhash(labelhash(list[i])));\n bytes[offset] = encoded.length;\n bytes.set(encoded, offset + 1);\n offset += encoded.length + 1;\n }\n if (bytes.byteLength !== offset + 1)\n return bytes.slice(0, offset + 1);\n return bytes;\n}\n//# sourceMappingURL=packetToBytes.js.map","import { addressResolverAbi, universalResolverResolveAbi, } from '../../constants/abis.js';\nimport { decodeFunctionResult } from '../../utils/abi/decodeFunctionResult.js';\nimport { encodeFunctionData } from '../../utils/abi/encodeFunctionData.js';\nimport { getChainContractAddress } from '../../utils/chain.js';\nimport { trim } from '../../utils/data/trim.js';\nimport { toHex } from '../../utils/encoding/toHex.js';\nimport { isNullUniversalResolverError } from '../../utils/ens/errors.js';\nimport { namehash } from '../../utils/ens/namehash.js';\nimport { packetToBytes } from '../../utils/ens/packetToBytes.js';\nimport { readContract, } from '../public/readContract.js';\n/**\n * Gets address for ENS name.\n *\n * - Docs: https://viem.sh/docs/ens/actions/getEnsAddress.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens\n *\n * Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract.\n *\n * Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this.\n *\n * @param client - Client to use\n * @param parameters - {@link GetEnsAddressParameters}\n * @returns Address for ENS name or `null` if not found. {@link GetEnsAddressReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getEnsAddress, normalize } from 'viem/ens'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const ensAddress = await getEnsAddress(client, {\n * name: normalize('wagmi-dev.eth'),\n * })\n * // '0xd2135CfB216b74109775236E36d4b433F1DF507B'\n */\nexport async function getEnsAddress(client, { blockNumber, blockTag, coinType, name, universalResolverAddress: universalResolverAddress_, }) {\n let universalResolverAddress = universalResolverAddress_;\n if (!universalResolverAddress) {\n if (!client.chain)\n throw new Error('client chain not configured. universalResolverAddress is required.');\n universalResolverAddress = getChainContractAddress({\n blockNumber,\n chain: client.chain,\n contract: 'ensUniversalResolver',\n });\n }\n try {\n const functionData = encodeFunctionData({\n abi: addressResolverAbi,\n functionName: 'addr',\n ...(coinType != null\n ? { args: [namehash(name), BigInt(coinType)] }\n : { args: [namehash(name)] }),\n });\n const res = await readContract(client, {\n address: universalResolverAddress,\n abi: universalResolverResolveAbi,\n functionName: 'resolve',\n args: [toHex(packetToBytes(name)), functionData],\n blockNumber,\n blockTag,\n });\n if (res[0] === '0x')\n return null;\n const address = trim(decodeFunctionResult({\n abi: addressResolverAbi,\n args: coinType != null ? [namehash(name), BigInt(coinType)] : undefined,\n functionName: 'addr',\n data: res[0],\n }));\n if (address === '0x')\n return null;\n if (trim(address) === '0x00')\n return null;\n return address;\n }\n catch (err) {\n if (isNullUniversalResolverError(err, 'resolve'))\n return null;\n throw err;\n }\n}\n//# sourceMappingURL=getEnsAddress.js.map","import { BaseError } from './base.js';\nexport class EnsAvatarInvalidMetadataError extends BaseError {\n constructor({ data }) {\n super('Unable to extract image from metadata. The metadata may be malformed or invalid.', {\n metaMessages: [\n '- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.',\n '',\n `Provided data: ${JSON.stringify(data)}`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'EnsAvatarInvalidMetadataError'\n });\n }\n}\nexport class EnsAvatarInvalidNftUriError extends BaseError {\n constructor({ reason }) {\n super(`ENS NFT avatar URI is invalid. ${reason}`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'EnsAvatarInvalidNftUriError'\n });\n }\n}\nexport class EnsAvatarUriResolutionError extends BaseError {\n constructor({ uri }) {\n super(`Unable to resolve ENS avatar URI \"${uri}\". The URI may be malformed, invalid, or does not respond with a valid image.`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'EnsAvatarUriResolutionError'\n });\n }\n}\nexport class EnsAvatarUnsupportedNamespaceError extends BaseError {\n constructor({ namespace }) {\n super(`ENS NFT avatar namespace \"${namespace}\" is not supported. Must be \"erc721\" or \"erc1155\".`);\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'EnsAvatarUnsupportedNamespaceError'\n });\n }\n}\n//# sourceMappingURL=ens.js.map","import { readContract } from '../../../actions/public/readContract.js';\nimport { EnsAvatarInvalidMetadataError, EnsAvatarInvalidNftUriError, EnsAvatarUnsupportedNamespaceError, EnsAvatarUriResolutionError, } from '../../../errors/ens.js';\nconst networkRegex = /(?https?:\\/\\/[^\\/]*|ipfs:\\/|ipns:\\/|ar:\\/)?(?\\/)?(?ipfs\\/|ipns\\/)?(?[\\w\\-.]+)(?\\/.*)?/;\nconst ipfsHashRegex = /^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\\/(?[\\w\\-.]+))?(?\\/.*)?$/;\nconst base64Regex = /^data:([a-zA-Z\\-/+]*);base64,([^\"].*)/;\nconst dataURIRegex = /^data:([a-zA-Z\\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;\nexport async function isImageUri(uri) {\n try {\n const res = await fetch(uri, { method: 'HEAD' });\n // retrieve content type header to check if content is image\n if (res.status === 200) {\n const contentType = res.headers.get('content-type');\n return contentType?.startsWith('image/');\n }\n return false;\n }\n catch (error) {\n // if error is not cors related then fail\n if (typeof error === 'object' && typeof error.response !== 'undefined') {\n return false;\n }\n // fail in NodeJS, since the error is not cors but any other network issue\n // rome-ignore lint/suspicious/noPrototypeBuiltins:\n if (!globalThis.hasOwnProperty('Image'))\n return false;\n // in case of cors, use image api to validate if given url is an actual image\n return new Promise((resolve) => {\n const img = new Image();\n img.onload = () => {\n resolve(true);\n };\n img.onerror = () => {\n resolve(false);\n };\n img.src = uri;\n });\n }\n}\nexport function getGateway(custom, defaultGateway) {\n if (!custom)\n return defaultGateway;\n if (custom.endsWith('/'))\n return custom.slice(0, -1);\n return custom;\n}\nexport function resolveAvatarUri({ uri, gatewayUrls, }) {\n const isEncoded = base64Regex.test(uri);\n if (isEncoded)\n return { uri, isOnChain: true, isEncoded };\n const ipfsGateway = getGateway(gatewayUrls?.ipfs, 'https://ipfs.io');\n const arweaveGateway = getGateway(gatewayUrls?.arweave, 'https://arweave.net');\n const networkRegexMatch = uri.match(networkRegex);\n const { protocol, subpath, target, subtarget = '', } = networkRegexMatch?.groups || {};\n const isIPNS = protocol === 'ipns:/' || subpath === 'ipns/';\n const isIPFS = protocol === 'ipfs:/' || subpath === 'ipfs/' || ipfsHashRegex.test(uri);\n if (uri.startsWith('http') && !isIPNS && !isIPFS) {\n let replacedUri = uri;\n if (gatewayUrls?.arweave)\n replacedUri = uri.replace(/https:\\/\\/arweave.net/g, gatewayUrls?.arweave);\n return { uri: replacedUri, isOnChain: false, isEncoded: false };\n }\n if ((isIPNS || isIPFS) && target) {\n return {\n uri: `${ipfsGateway}/${isIPNS ? 'ipns' : 'ipfs'}/${target}${subtarget}`,\n isOnChain: false,\n isEncoded: false,\n };\n }\n else if (protocol === 'ar:/' && target) {\n return {\n uri: `${arweaveGateway}/${target}${subtarget || ''}`,\n isOnChain: false,\n isEncoded: false,\n };\n }\n let parsedUri = uri.replace(dataURIRegex, '');\n if (parsedUri.startsWith(' res.json());\n const image = await parseAvatarUri({\n gatewayUrls,\n uri: getJsonImage(res),\n });\n return image;\n }\n catch {\n throw new EnsAvatarUriResolutionError({ uri });\n }\n}\nexport async function parseAvatarUri({ gatewayUrls, uri, }) {\n const { uri: resolvedURI, isOnChain } = resolveAvatarUri({ uri, gatewayUrls });\n if (isOnChain)\n return resolvedURI;\n // check if resolvedURI is an image, if it is return the url\n const isImage = await isImageUri(resolvedURI);\n if (isImage)\n return resolvedURI;\n throw new EnsAvatarUriResolutionError({ uri });\n}\nexport function parseNftUri(uri_) {\n let uri = uri_;\n // parse valid nft spec (CAIP-22/CAIP-29)\n // @see: https://github.com/ChainAgnostic/CAIPs/tree/master/CAIPs\n if (uri.startsWith('did:nft:')) {\n // convert DID to CAIP\n uri = uri.replace('did:nft:', '').replace(/_/g, '/');\n }\n const [reference, asset_namespace, tokenID] = uri.split('/');\n const [eip_namespace, chainID] = reference.split(':');\n const [erc_namespace, contractAddress] = asset_namespace.split(':');\n if (!eip_namespace || eip_namespace.toLowerCase() !== 'eip155')\n throw new EnsAvatarInvalidNftUriError({ reason: 'Only EIP-155 supported' });\n if (!chainID)\n throw new EnsAvatarInvalidNftUriError({ reason: 'Chain ID not found' });\n if (!contractAddress)\n throw new EnsAvatarInvalidNftUriError({\n reason: 'Contract address not found',\n });\n if (!tokenID)\n throw new EnsAvatarInvalidNftUriError({ reason: 'Token ID not found' });\n if (!erc_namespace)\n throw new EnsAvatarInvalidNftUriError({ reason: 'ERC namespace not found' });\n return {\n chainID: parseInt(chainID),\n namespace: erc_namespace.toLowerCase(),\n contractAddress: contractAddress,\n tokenID,\n };\n}\nexport async function getNftTokenUri(client, { nft }) {\n if (nft.namespace === 'erc721') {\n return readContract(client, {\n address: nft.contractAddress,\n abi: [\n {\n name: 'tokenURI',\n type: 'function',\n stateMutability: 'view',\n inputs: [{ name: 'tokenId', type: 'uint256' }],\n outputs: [{ name: '', type: 'string' }],\n },\n ],\n functionName: 'tokenURI',\n args: [BigInt(nft.tokenID)],\n });\n }\n if (nft.namespace === 'erc1155') {\n return readContract(client, {\n address: nft.contractAddress,\n abi: [\n {\n name: 'uri',\n type: 'function',\n stateMutability: 'view',\n inputs: [{ name: '_id', type: 'uint256' }],\n outputs: [{ name: '', type: 'string' }],\n },\n ],\n functionName: 'uri',\n args: [BigInt(nft.tokenID)],\n });\n }\n throw new EnsAvatarUnsupportedNamespaceError({ namespace: nft.namespace });\n}\n//# sourceMappingURL=utils.js.map","import { getJsonImage, getMetadataAvatarUri, getNftTokenUri, parseAvatarUri, parseNftUri, resolveAvatarUri, } from './utils.js';\nexport async function parseAvatarRecord(client, { gatewayUrls, record, }) {\n if (/eip155:/i.test(record))\n return parseNftAvatarUri(client, { gatewayUrls, record });\n return parseAvatarUri({ uri: record, gatewayUrls });\n}\nasync function parseNftAvatarUri(client, { gatewayUrls, record, }) {\n // parse NFT URI into properties\n const nft = parseNftUri(record);\n // fetch tokenURI from the NFT contract\n const nftUri = await getNftTokenUri(client, { nft });\n // resolve the URI from the fetched tokenURI\n const { uri: resolvedNftUri, isOnChain, isEncoded, } = resolveAvatarUri({ uri: nftUri, gatewayUrls });\n // if the resolved URI is on chain, return the data\n if (isOnChain &&\n (resolvedNftUri.includes('data:application/json;base64,') ||\n resolvedNftUri.startsWith('{'))) {\n const encodedJson = isEncoded\n ? // if it is encoded, decode it\n atob(resolvedNftUri.replace('data:application/json;base64,', ''))\n : // if it isn't encoded assume it is a JSON string, but it could be anything (it will error if it is)\n resolvedNftUri;\n const decoded = JSON.parse(encodedJson);\n return parseAvatarUri({ uri: getJsonImage(decoded), gatewayUrls });\n }\n let uriTokenId = nft.tokenID;\n if (nft.namespace === 'erc1155')\n uriTokenId = uriTokenId.replace('0x', '').padStart(64, '0');\n return getMetadataAvatarUri({\n gatewayUrls,\n uri: resolvedNftUri.replace(/(?:0x)?{id}/, uriTokenId),\n });\n}\n//# sourceMappingURL=parseAvatarRecord.js.map","import { textResolverAbi, universalResolverResolveAbi, } from '../../constants/abis.js';\nimport { decodeFunctionResult } from '../../utils/abi/decodeFunctionResult.js';\nimport { encodeFunctionData } from '../../utils/abi/encodeFunctionData.js';\nimport { getChainContractAddress } from '../../utils/chain.js';\nimport { toHex } from '../../utils/encoding/toHex.js';\nimport { isNullUniversalResolverError } from '../../utils/ens/errors.js';\nimport { namehash } from '../../utils/ens/namehash.js';\nimport { packetToBytes } from '../../utils/ens/packetToBytes.js';\nimport { readContract, } from '../public/readContract.js';\n/**\n * Gets a text record for specified ENS name.\n *\n * - Docs: https://viem.sh/docs/ens/actions/getEnsResolver.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens\n *\n * Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract.\n *\n * Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this.\n *\n * @param client - Client to use\n * @param parameters - {@link GetEnsTextParameters}\n * @returns Address for ENS resolver. {@link GetEnsTextReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getEnsText, normalize } from 'viem/ens'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const twitterRecord = await getEnsText(client, {\n * name: normalize('wagmi-dev.eth'),\n * key: 'com.twitter',\n * })\n * // 'wagmi_sh'\n */\nexport async function getEnsText(client, { blockNumber, blockTag, name, key, universalResolverAddress: universalResolverAddress_, }) {\n let universalResolverAddress = universalResolverAddress_;\n if (!universalResolverAddress) {\n if (!client.chain)\n throw new Error('client chain not configured. universalResolverAddress is required.');\n universalResolverAddress = getChainContractAddress({\n blockNumber,\n chain: client.chain,\n contract: 'ensUniversalResolver',\n });\n }\n try {\n const res = await readContract(client, {\n address: universalResolverAddress,\n abi: universalResolverResolveAbi,\n functionName: 'resolve',\n args: [\n toHex(packetToBytes(name)),\n encodeFunctionData({\n abi: textResolverAbi,\n functionName: 'text',\n args: [namehash(name), key],\n }),\n ],\n blockNumber,\n blockTag,\n });\n if (res[0] === '0x')\n return null;\n const record = decodeFunctionResult({\n abi: textResolverAbi,\n functionName: 'text',\n data: res[0],\n });\n return record === '' ? null : record;\n }\n catch (err) {\n if (isNullUniversalResolverError(err, 'resolve'))\n return null;\n throw err;\n }\n}\n//# sourceMappingURL=getEnsText.js.map","import { parseAvatarRecord } from '../../utils/ens/avatar/parseAvatarRecord.js';\nimport { getEnsText } from './getEnsText.js';\n/**\n * Gets the avatar of an ENS name.\n *\n * - Docs: https://viem.sh/docs/ens/actions/getEnsAvatar.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens\n *\n * Calls [`getEnsText`](https://viem.sh/docs/ens/actions/getEnsText.html) with `key` set to `'avatar'`.\n *\n * Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this.\n *\n * @param client - Client to use\n * @param parameters - {@link GetEnsAvatarParameters}\n * @returns Avatar URI or `null` if not found. {@link GetEnsAvatarReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getEnsAvatar, normalize } from 'viem/ens'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const ensAvatar = await getEnsAvatar(client, {\n * name: normalize('wagmi-dev.eth'),\n * })\n * // 'https://ipfs.io/ipfs/Qma8mnp6xV3J2cRNf3mTth5C8nV11CAnceVinc3y8jSbio'\n */\nexport async function getEnsAvatar(client, { blockNumber, blockTag, gatewayUrls, name, universalResolverAddress, }) {\n const record = await getEnsText(client, {\n blockNumber,\n blockTag,\n key: 'avatar',\n name,\n universalResolverAddress,\n });\n if (!record)\n return null;\n try {\n return await parseAvatarRecord(client, { record, gatewayUrls });\n }\n catch {\n return null;\n }\n}\n//# sourceMappingURL=getEnsAvatar.js.map","import { universalResolverReverseAbi } from '../../constants/abis.js';\nimport { getChainContractAddress } from '../../utils/chain.js';\nimport { toHex } from '../../utils/encoding/toHex.js';\nimport { isNullUniversalResolverError } from '../../utils/ens/errors.js';\nimport { packetToBytes } from '../../utils/ens/packetToBytes.js';\nimport { readContract, } from '../public/readContract.js';\n/**\n * Gets primary name for specified address.\n *\n * - Docs: https://viem.sh/docs/ens/actions/getEnsName.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens\n *\n * Calls `reverse(bytes)` on ENS Universal Resolver Contract to \"reverse resolve\" the address to the primary ENS name.\n *\n * @param client - Client to use\n * @param parameters - {@link GetEnsNameParameters}\n * @returns Name or `null` if not found. {@link GetEnsNameReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getEnsName } from 'viem/ens'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const ensName = await getEnsName(client, {\n * address: '0xd2135CfB216b74109775236E36d4b433F1DF507B',\n * })\n * // 'wagmi-dev.eth'\n */\nexport async function getEnsName(client, { address, blockNumber, blockTag, universalResolverAddress: universalResolverAddress_, }) {\n let universalResolverAddress = universalResolverAddress_;\n if (!universalResolverAddress) {\n if (!client.chain)\n throw new Error('client chain not configured. universalResolverAddress is required.');\n universalResolverAddress = getChainContractAddress({\n blockNumber,\n chain: client.chain,\n contract: 'ensUniversalResolver',\n });\n }\n const reverseNode = `${address.toLowerCase().substring(2)}.addr.reverse`;\n try {\n const res = await readContract(client, {\n address: universalResolverAddress,\n abi: universalResolverReverseAbi,\n functionName: 'reverse',\n args: [toHex(packetToBytes(reverseNode))],\n blockNumber,\n blockTag,\n });\n return res[0];\n }\n catch (err) {\n if (isNullUniversalResolverError(err, 'reverse'))\n return null;\n throw err;\n }\n}\n//# sourceMappingURL=getEnsName.js.map","import { getChainContractAddress } from '../../utils/chain.js';\nimport { toHex } from '../../utils/encoding/toHex.js';\nimport { packetToBytes } from '../../utils/ens/packetToBytes.js';\nimport { readContract, } from '../public/readContract.js';\n/**\n * Gets resolver for ENS name.\n *\n * - Docs: https://viem.sh/docs/ens/actions/getEnsResolver.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens\n *\n * Calls `findResolver(bytes)` on ENS Universal Resolver Contract to retrieve the resolver of an ENS name.\n *\n * Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this.\n *\n * @param client - Client to use\n * @param parameters - {@link GetEnsResolverParameters}\n * @returns Address for ENS resolver. {@link GetEnsResolverReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getEnsResolver, normalize } from 'viem/ens'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const resolverAddress = await getEnsResolver(client, {\n * name: normalize('wagmi-dev.eth'),\n * })\n * // '0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41'\n */\nexport async function getEnsResolver(client, { blockNumber, blockTag, name, universalResolverAddress: universalResolverAddress_, }) {\n let universalResolverAddress = universalResolverAddress_;\n if (!universalResolverAddress) {\n if (!client.chain)\n throw new Error('client chain not configured. universalResolverAddress is required.');\n universalResolverAddress = getChainContractAddress({\n blockNumber,\n chain: client.chain,\n contract: 'ensUniversalResolver',\n });\n }\n const [resolverAddress] = await readContract(client, {\n address: universalResolverAddress,\n abi: [\n {\n inputs: [{ type: 'bytes' }],\n name: 'findResolver',\n outputs: [{ type: 'address' }, { type: 'bytes32' }],\n stateMutability: 'view',\n type: 'function',\n },\n ],\n functionName: 'findResolver',\n args: [toHex(packetToBytes(name))],\n blockNumber,\n blockTag,\n });\n return resolverAddress;\n}\n//# sourceMappingURL=getEnsResolver.js.map","import { createFilterRequestScope } from '../../utils/filters/createFilterRequestScope.js';\n/**\n * Creates a [`Filter`](https://viem.sh/docs/glossary/types.html#filter) to listen for new block hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html).\n *\n * - Docs: https://viem.sh/docs/actions/public/createBlockFilter.html\n * - JSON-RPC Methods: [`eth_newBlockFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newBlockFilter)\n *\n * @param client - Client to use\n * @returns [`Filter`](https://viem.sh/docs/glossary/types.html#filter). {@link CreateBlockFilterReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createBlockFilter } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createBlockFilter(client)\n * // { id: \"0x345a6572337856574a76364e457a4366\", type: 'block' }\n */\nexport async function createBlockFilter(client) {\n const getRequest = createFilterRequestScope(client, {\n method: 'eth_newBlockFilter',\n });\n const id = await client.request({\n method: 'eth_newBlockFilter',\n });\n return { id, request: getRequest(id), type: 'block' };\n}\n//# sourceMappingURL=createBlockFilter.js.map","import { encodeEventTopics, } from '../../utils/abi/encodeEventTopics.js';\nimport { numberToHex } from '../../utils/encoding/toHex.js';\nimport { createFilterRequestScope } from '../../utils/filters/createFilterRequestScope.js';\n/**\n * Creates a [`Filter`](https://viem.sh/docs/glossary/types.html#filter) to listen for new events that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html).\n *\n * - Docs: https://viem.sh/docs/actions/public/createEventFilter.html\n * - JSON-RPC Methods: [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter)\n *\n * @param client - Client to use\n * @param parameters - {@link CreateEventFilterParameters}\n * @returns [`Filter`](https://viem.sh/docs/glossary/types.html#filter). {@link CreateEventFilterReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createEventFilter } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createEventFilter(client, {\n * address: '0xfba3912ca04dd458c843e2ee08967fc04f3579c2',\n * })\n */\nexport async function createEventFilter(client, { address, args, event, events: events_, fromBlock, strict, toBlock, } = {}) {\n const events = events_ ?? (event ? [event] : undefined);\n const getRequest = createFilterRequestScope(client, {\n method: 'eth_newFilter',\n });\n let topics = [];\n if (events) {\n topics = [\n events.flatMap((event) => encodeEventTopics({\n abi: [event],\n eventName: event.name,\n args,\n })),\n ];\n if (event)\n topics = topics[0];\n }\n const id = await client.request({\n method: 'eth_newFilter',\n params: [\n {\n address,\n fromBlock: typeof fromBlock === 'bigint' ? numberToHex(fromBlock) : fromBlock,\n toBlock: typeof toBlock === 'bigint' ? numberToHex(toBlock) : toBlock,\n ...(topics.length ? { topics } : {}),\n },\n ],\n });\n return {\n abi: events,\n args,\n eventName: event ? event.name : undefined,\n fromBlock,\n id,\n request: getRequest(id),\n strict,\n toBlock,\n type: 'event',\n };\n}\n//# sourceMappingURL=createEventFilter.js.map","import { createFilterRequestScope } from '../../utils/filters/createFilterRequestScope.js';\n/**\n * Creates a Filter to listen for new pending transaction hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html).\n *\n * - Docs: https://viem.sh/docs/actions/public/createPendingTransactionFilter.html\n * - JSON-RPC Methods: [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter)\n *\n * @param client - Client to use\n * @returns [`Filter`](https://viem.sh/docs/glossary/types.html#filter). {@link CreateBlockFilterReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createPendingTransactionFilter } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createPendingTransactionFilter(client)\n * // { id: \"0x345a6572337856574a76364e457a4366\", type: 'transaction' }\n */\nexport async function createPendingTransactionFilter(client) {\n const getRequest = createFilterRequestScope(client, {\n method: 'eth_newPendingTransactionFilter',\n });\n const id = await client.request({\n method: 'eth_newPendingTransactionFilter',\n });\n return { id, request: getRequest(id), type: 'transaction' };\n}\n//# sourceMappingURL=createPendingTransactionFilter.js.map","import { numberToHex } from '../../utils/encoding/toHex.js';\n/**\n * Returns the balance of an address in wei.\n *\n * - Docs: https://viem.sh/docs/actions/public/getBalance.html\n * - JSON-RPC Methods: [`eth_getBalance`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getbalance)\n *\n * You can convert the balance to ether units with [`formatEther`](https://viem.sh/docs/utilities/formatEther.html).\n *\n * ```ts\n * const balance = await getBalance(client, {\n * address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * blockTag: 'safe'\n * })\n * const balanceAsEther = formatEther(balance)\n * // \"6.942\"\n * ```\n *\n * @param client - Client to use\n * @param parameters - {@link GetBalanceParameters}\n * @returns The balance of the address in wei. {@link GetBalanceReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getBalance } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const balance = await getBalance(client, {\n * address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * })\n * // 10000000000000000000000n (wei)\n */\nexport async function getBalance(client, { address, blockNumber, blockTag = 'latest' }) {\n const blockNumberHex = blockNumber ? numberToHex(blockNumber) : undefined;\n const balance = await client.request({\n method: 'eth_getBalance',\n params: [address, blockNumberHex || blockTag],\n });\n return BigInt(balance);\n}\n//# sourceMappingURL=getBalance.js.map","import { hexToNumber } from '../../utils/encoding/fromHex.js';\nimport { numberToHex } from '../../utils/encoding/toHex.js';\n/**\n * Returns the number of Transactions at a block number, hash, or tag.\n *\n * - Docs: https://viem.sh/docs/actions/public/getBlockTransactionCount.html\n * - JSON-RPC Methods:\n * - Calls [`eth_getBlockTransactionCountByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbynumber) for `blockNumber` & `blockTag`.\n * - Calls [`eth_getBlockTransactionCountByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbyhash) for `blockHash`.\n *\n * @param client - Client to use\n * @param parameters - {@link GetBlockTransactionCountParameters}\n * @returns The block transaction count. {@link GetBlockTransactionCountReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getBlockTransactionCount } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const count = await getBlockTransactionCount(client)\n */\nexport async function getBlockTransactionCount(client, { blockHash, blockNumber, blockTag = 'latest', } = {}) {\n const blockNumberHex = blockNumber !== undefined ? numberToHex(blockNumber) : undefined;\n let count;\n if (blockHash) {\n count = await client.request({\n method: 'eth_getBlockTransactionCountByHash',\n params: [blockHash],\n });\n }\n else {\n count = await client.request({\n method: 'eth_getBlockTransactionCountByNumber',\n params: [blockNumberHex || blockTag],\n });\n }\n return hexToNumber(count);\n}\n//# sourceMappingURL=getBlockTransactionCount.js.map","import { numberToHex } from '../../utils/encoding/toHex.js';\n/**\n * Retrieves the bytecode at an address.\n *\n * - Docs: https://viem.sh/docs/contract/getBytecode.html\n * - JSON-RPC Methods: [`eth_getCode`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getcode)\n *\n * @param client - Client to use\n * @param parameters - {@link GetBytecodeParameters}\n * @returns The contract's bytecode. {@link GetBytecodeReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getBytecode } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const code = await getBytecode(client, {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * })\n */\nexport async function getBytecode(client, { address, blockNumber, blockTag = 'latest' }) {\n const blockNumberHex = blockNumber !== undefined ? numberToHex(blockNumber) : undefined;\n const hex = await client.request({\n method: 'eth_getCode',\n params: [address, blockNumberHex || blockTag],\n });\n if (hex === '0x')\n return undefined;\n return hex;\n}\n//# sourceMappingURL=getBytecode.js.map","export function formatFeeHistory(feeHistory) {\n return {\n baseFeePerGas: feeHistory.baseFeePerGas.map((value) => BigInt(value)),\n gasUsedRatio: feeHistory.gasUsedRatio,\n oldestBlock: BigInt(feeHistory.oldestBlock),\n reward: feeHistory.reward?.map((reward) => reward.map((value) => BigInt(value))),\n };\n}\n//# sourceMappingURL=feeHistory.js.map","import { numberToHex } from '../../utils/encoding/toHex.js';\nimport { formatFeeHistory } from '../../utils/formatters/feeHistory.js';\n/**\n * Returns a collection of historical gas information.\n *\n * - Docs: https://viem.sh/docs/actions/public/getFeeHistory.html\n * - JSON-RPC Methods: [`eth_feeHistory`](https://docs.alchemy.com/reference/eth-feehistory)\n *\n * @param client - Client to use\n * @param parameters - {@link GetFeeHistoryParameters}\n * @returns The gas estimate (in wei). {@link GetFeeHistoryReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getFeeHistory } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const feeHistory = await getFeeHistory(client, {\n * blockCount: 4,\n * rewardPercentiles: [25, 75],\n * })\n */\nexport async function getFeeHistory(client, { blockCount, blockNumber, blockTag = 'latest', rewardPercentiles, }) {\n const blockNumberHex = blockNumber ? numberToHex(blockNumber) : undefined;\n const feeHistory = await client.request({\n method: 'eth_feeHistory',\n params: [\n numberToHex(blockCount),\n blockNumberHex || blockTag,\n rewardPercentiles,\n ],\n });\n return formatFeeHistory(feeHistory);\n}\n//# sourceMappingURL=getFeeHistory.js.map","import { DecodeLogDataMismatch, DecodeLogTopicsMismatch, } from '../../errors/abi.js';\nimport { decodeEventLog } from '../../utils/abi/decodeEventLog.js';\nimport { formatLog } from '../../utils/formatters/log.js';\n/**\n * Returns a list of event logs since the filter was created.\n *\n * - Docs: https://viem.sh/docs/actions/public/getFilterLogs.html\n * - JSON-RPC Methods: [`eth_getFilterLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterlogs)\n *\n * `getFilterLogs` is only compatible with **event filters**.\n *\n * @param client - Client to use\n * @param parameters - {@link GetFilterLogsParameters}\n * @returns A list of event logs. {@link GetFilterLogsReturnType}\n *\n * @example\n * import { createPublicClient, http, parseAbiItem } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { createEventFilter, getFilterLogs } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const filter = await createEventFilter(client, {\n * address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',\n * event: parseAbiItem('event Transfer(address indexed, address indexed, uint256)'),\n * })\n * const logs = await getFilterLogs(client, { filter })\n */\nexport async function getFilterLogs(_client, { filter, }) {\n const strict = filter.strict ?? false;\n const logs = await filter.request({\n method: 'eth_getFilterLogs',\n params: [filter.id],\n });\n return logs\n .map((log) => {\n try {\n const { eventName, args } = 'abi' in filter && filter.abi\n ? decodeEventLog({\n abi: filter.abi,\n data: log.data,\n topics: log.topics,\n strict,\n })\n : { eventName: undefined, args: undefined };\n return formatLog(log, { args, eventName });\n }\n catch (err) {\n let eventName;\n let isUnnamed;\n if (err instanceof DecodeLogDataMismatch ||\n err instanceof DecodeLogTopicsMismatch) {\n // If strict mode is on, and log data/topics do not match event definition, skip.\n if ('strict' in filter && filter.strict)\n return;\n eventName = err.abiItem.name;\n isUnnamed = err.abiItem.inputs?.some((x) => !('name' in x && x.name));\n }\n // Set args to empty if there is an error decoding (e.g. indexed/non-indexed params mismatch).\n return formatLog(log, { args: isUnnamed ? [] : {}, eventName });\n }\n })\n .filter(Boolean);\n}\n//# sourceMappingURL=getFilterLogs.js.map","import { numberToHex } from '../../utils/encoding/toHex.js';\n/**\n * Returns the value from a storage slot at a given address.\n *\n * - Docs: https://viem.sh/docs/contract/getStorageAt.html\n * - JSON-RPC Methods: [`eth_getStorageAt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getstorageat)\n *\n * @param client - Client to use\n * @param parameters - {@link GetStorageAtParameters}\n * @returns The value of the storage slot. {@link GetStorageAtReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getStorageAt } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const code = await getStorageAt(client, {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * slot: toHex(0),\n * })\n */\nexport async function getStorageAt(client, { address, blockNumber, blockTag = 'latest', slot }) {\n const blockNumberHex = blockNumber !== undefined ? numberToHex(blockNumber) : undefined;\n const data = await client.request({\n method: 'eth_getStorageAt',\n params: [address, slot, blockNumberHex || blockTag],\n });\n return data;\n}\n//# sourceMappingURL=getStorageAt.js.map","import { TransactionNotFoundError } from '../../errors/transaction.js';\nimport { numberToHex } from '../../utils/encoding/toHex.js';\nimport { formatTransaction, } from '../../utils/formatters/transaction.js';\n/**\n * Returns information about a [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) given a hash or block identifier.\n *\n * - Docs: https://viem.sh/docs/actions/public/getTransaction.html\n * - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions\n * - JSON-RPC Methods: [`eth_getTransactionByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionByHash)\n *\n * @param client - Client to use\n * @param parameters - {@link GetTransactionParameters}\n * @returns The transaction information. {@link GetTransactionReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getTransaction } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const transaction = await getTransaction(client, {\n * hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',\n * })\n */\nexport async function getTransaction(client, { blockHash, blockNumber, blockTag: blockTag_, hash, index, }) {\n const blockTag = blockTag_ || 'latest';\n const blockNumberHex = blockNumber !== undefined ? numberToHex(blockNumber) : undefined;\n let transaction = null;\n if (hash) {\n transaction = await client.request({\n method: 'eth_getTransactionByHash',\n params: [hash],\n });\n }\n else if (blockHash) {\n transaction = await client.request({\n method: 'eth_getTransactionByBlockHashAndIndex',\n params: [blockHash, numberToHex(index)],\n });\n }\n else if (blockNumberHex || blockTag) {\n transaction = await client.request({\n method: 'eth_getTransactionByBlockNumberAndIndex',\n params: [blockNumberHex || blockTag, numberToHex(index)],\n });\n }\n if (!transaction)\n throw new TransactionNotFoundError({\n blockHash,\n blockNumber,\n blockTag,\n hash,\n index,\n });\n const format = client.chain?.formatters?.transaction?.format || formatTransaction;\n return format(transaction);\n}\n//# sourceMappingURL=getTransaction.js.map","import { getBlockNumber } from './getBlockNumber.js';\nimport { getTransaction } from './getTransaction.js';\n/**\n * Returns the number of blocks passed (confirmations) since the transaction was processed on a block.\n *\n * - Docs: https://viem.sh/docs/actions/public/getTransactionConfirmations.html\n * - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions\n * - JSON-RPC Methods: [`eth_getTransactionConfirmations`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionConfirmations)\n *\n * @param client - Client to use\n * @param parameters - {@link GetTransactionConfirmationsParameters}\n * @returns The number of blocks passed since the transaction was processed. If confirmations is 0, then the Transaction has not been confirmed & processed yet. {@link GetTransactionConfirmationsReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getTransactionConfirmations } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const confirmations = await getTransactionConfirmations(client, {\n * hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',\n * })\n */\nexport async function getTransactionConfirmations(client, { hash, transactionReceipt }) {\n const [blockNumber, transaction] = await Promise.all([\n getBlockNumber(client),\n hash ? getTransaction(client, { hash }) : undefined,\n ]);\n const transactionBlockNumber = transactionReceipt?.blockNumber || transaction?.blockNumber;\n if (!transactionBlockNumber)\n return 0n;\n return blockNumber - transactionBlockNumber + 1n;\n}\n//# sourceMappingURL=getTransactionConfirmations.js.map","import { TransactionReceiptNotFoundError } from '../../errors/transaction.js';\nimport { formatTransactionReceipt, } from '../../utils/formatters/transactionReceipt.js';\n/**\n * Returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms.html#transaction-receipt) given a [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) hash.\n *\n * - Docs: https://viem.sh/docs/actions/public/getTransactionReceipt.html\n * - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions\n * - JSON-RPC Methods: [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionreceipt)\n *\n * @param client - Client to use\n * @param parameters - {@link GetTransactionReceiptParameters}\n * @returns The transaction receipt. {@link GetTransactionReceiptReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getTransactionReceipt } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const transactionReceipt = await getTransactionReceipt(client, {\n * hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',\n * })\n */\nexport async function getTransactionReceipt(client, { hash }) {\n const receipt = await client.request({\n method: 'eth_getTransactionReceipt',\n params: [hash],\n });\n if (!receipt)\n throw new TransactionReceiptNotFoundError({ hash });\n const format = client.chain?.formatters?.transactionReceipt?.format ||\n formatTransactionReceipt;\n return format(receipt);\n}\n//# sourceMappingURL=getTransactionReceipt.js.map","import { multicall3Abi } from '../../constants/abis.js';\nimport { AbiDecodingZeroDataError } from '../../errors/abi.js';\nimport { RawContractError } from '../../errors/contract.js';\nimport { decodeFunctionResult } from '../../utils/abi/decodeFunctionResult.js';\nimport { encodeFunctionData, } from '../../utils/abi/encodeFunctionData.js';\nimport { getChainContractAddress } from '../../utils/chain.js';\nimport { getContractError } from '../../utils/errors/getContractError.js';\nimport { readContract } from './readContract.js';\n/**\n * Similar to [`readContract`](https://viem.sh/docs/contract/readContract.html), but batches up multiple functions on a contract in a single RPC call via the [`multicall3` contract](https://github.com/mds1/multicall).\n *\n * - Docs: https://viem.sh/docs/contract/multicall.html\n *\n * @param client - Client to use\n * @param parameters - {@link MulticallParameters}\n * @returns An array of results with accompanying status. {@link MulticallReturnType}\n *\n * @example\n * import { createPublicClient, http, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { multicall } from 'viem/contract'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const abi = parseAbi([\n * 'function balanceOf(address) view returns (uint256)',\n * 'function totalSupply() view returns (uint256)',\n * ])\n * const results = await multicall(client, {\n * contracts: [\n * {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * abi,\n * functionName: 'balanceOf',\n * args: ['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'],\n * },\n * {\n * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n * abi,\n * functionName: 'totalSupply',\n * },\n * ],\n * })\n * // [{ result: 424122n, status: 'success' }, { result: 1000000n, status: 'success' }]\n */\nexport async function multicall(client, args) {\n const { allowFailure = true, batchSize: batchSize_, blockNumber, blockTag, contracts: contracts_, multicallAddress: multicallAddress_, } = args;\n const batchSize = batchSize_ ??\n ((typeof client.batch?.multicall === 'object' &&\n client.batch.multicall.batchSize) ||\n 1024);\n // Fix type cast from `Narrow` in type definition.\n const contracts = contracts_;\n let multicallAddress = multicallAddress_;\n if (!multicallAddress) {\n if (!client.chain)\n throw new Error('client chain not configured. multicallAddress is required.');\n multicallAddress = getChainContractAddress({\n blockNumber,\n chain: client.chain,\n contract: 'multicall3',\n });\n }\n const chunkedCalls = [[]];\n let currentChunk = 0;\n let currentChunkSize = 0;\n for (let i = 0; i < contracts.length; i++) {\n const { abi, address, args, functionName } = contracts[i];\n try {\n const callData = encodeFunctionData({\n abi,\n args,\n functionName,\n });\n currentChunkSize += callData.length;\n if (batchSize > 0 && currentChunkSize > batchSize) {\n currentChunk++;\n currentChunkSize = (callData.length - 2) / 2;\n chunkedCalls[currentChunk] = [];\n }\n chunkedCalls[currentChunk] = [\n ...chunkedCalls[currentChunk],\n {\n allowFailure: true,\n callData,\n target: address,\n },\n ];\n }\n catch (err) {\n const error = getContractError(err, {\n abi,\n address,\n args,\n docsPath: '/docs/contract/multicall',\n functionName,\n });\n if (!allowFailure)\n throw error;\n chunkedCalls[currentChunk] = [\n ...chunkedCalls[currentChunk],\n {\n allowFailure: true,\n callData: '0x',\n target: address,\n },\n ];\n }\n }\n const results = await Promise.all(chunkedCalls.map((calls) => readContract(client, {\n abi: multicall3Abi,\n address: multicallAddress,\n args: [calls],\n blockNumber,\n blockTag,\n functionName: 'aggregate3',\n })));\n return results.flat().map(({ returnData, success }, i) => {\n const calls = chunkedCalls.flat();\n const { callData } = calls[i];\n const { abi, address, functionName, args } = contracts[i];\n try {\n if (callData === '0x')\n throw new AbiDecodingZeroDataError();\n if (!success)\n throw new RawContractError({ data: returnData });\n const result = decodeFunctionResult({\n abi,\n args,\n data: returnData,\n functionName: functionName,\n });\n return allowFailure ? { result, status: 'success' } : result;\n }\n catch (err) {\n const error = getContractError(err, {\n abi,\n address,\n args,\n docsPath: '/docs/contract/multicall',\n functionName,\n });\n if (!allowFailure)\n throw error;\n return { error, result: undefined, status: 'failure' };\n }\n });\n}\n//# sourceMappingURL=multicall.js.map","export const universalSignatureValidatorByteCode = '0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572';\n//# sourceMappingURL=contracts.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// 100 lines of code in the file are duplicated from noble-hashes (utils).\n// This is OK: `abstract` directory does not use noble-hashes.\n// User may opt-in into using different hashing library. This way, noble-hashes\n// won't be included into their bundle.\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst u8a = (a) => a instanceof Uint8Array;\nconst hexes = Array.from({ length: 256 }, (v, i) => i.toString(16).padStart(2, '0'));\n/**\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nexport function bytesToHex(bytes) {\n if (!u8a(bytes))\n throw new Error('Uint8Array expected');\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\nexport function numberToHexUnpadded(num) {\n const hex = num.toString(16);\n return hex.length & 1 ? `0${hex}` : hex;\n}\nexport function hexToNumber(hex) {\n if (typeof hex !== 'string')\n throw new Error('hex string expected, got ' + typeof hex);\n // Big Endian\n return BigInt(hex === '' ? '0' : `0x${hex}`);\n}\n/**\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new Error('hex string expected, got ' + typeof hex);\n const len = hex.length;\n if (len % 2)\n throw new Error('padded hex string expected, got unpadded hex of length ' + len);\n const array = new Uint8Array(len / 2);\n for (let i = 0; i < array.length; i++) {\n const j = i * 2;\n const hexByte = hex.slice(j, j + 2);\n const byte = Number.parseInt(hexByte, 16);\n if (Number.isNaN(byte) || byte < 0)\n throw new Error('Invalid byte sequence');\n array[i] = byte;\n }\n return array;\n}\n// BE: Big Endian, LE: Little Endian\nexport function bytesToNumberBE(bytes) {\n return hexToNumber(bytesToHex(bytes));\n}\nexport function bytesToNumberLE(bytes) {\n if (!u8a(bytes))\n throw new Error('Uint8Array expected');\n return hexToNumber(bytesToHex(Uint8Array.from(bytes).reverse()));\n}\nexport function numberToBytesBE(n, len) {\n return hexToBytes(n.toString(16).padStart(len * 2, '0'));\n}\nexport function numberToBytesLE(n, len) {\n return numberToBytesBE(n, len).reverse();\n}\n// Unpadded, rarely used\nexport function numberToVarBytesBE(n) {\n return hexToBytes(numberToHexUnpadded(n));\n}\n/**\n * Takes hex string or Uint8Array, converts to Uint8Array.\n * Validates output length.\n * Will throw error for other types.\n * @param title descriptive title for an error e.g. 'private key'\n * @param hex hex string or Uint8Array\n * @param expectedLength optional, will compare to result array's length\n * @returns\n */\nexport function ensureBytes(title, hex, expectedLength) {\n let res;\n if (typeof hex === 'string') {\n try {\n res = hexToBytes(hex);\n }\n catch (e) {\n throw new Error(`${title} must be valid hex string, got \"${hex}\". Cause: ${e}`);\n }\n }\n else if (u8a(hex)) {\n // Uint8Array.from() instead of hash.slice() because node.js Buffer\n // is instance of Uint8Array, and its slice() creates **mutable** copy\n res = Uint8Array.from(hex);\n }\n else {\n throw new Error(`${title} must be hex string or Uint8Array`);\n }\n const len = res.length;\n if (typeof expectedLength === 'number' && len !== expectedLength)\n throw new Error(`${title} expected ${expectedLength} bytes, got ${len}`);\n return res;\n}\n/**\n * Copies several Uint8Arrays into one.\n */\nexport function concatBytes(...arrays) {\n const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0));\n let pad = 0; // walk through each item, ensure they have proper type\n arrays.forEach((a) => {\n if (!u8a(a))\n throw new Error('Uint8Array expected');\n r.set(a, pad);\n pad += a.length;\n });\n return r;\n}\nexport function equalBytes(b1, b2) {\n // We don't care about timing attacks here\n if (b1.length !== b2.length)\n return false;\n for (let i = 0; i < b1.length; i++)\n if (b1[i] !== b2[i])\n return false;\n return true;\n}\n/**\n * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new Error(`utf8ToBytes expected string, got ${typeof str}`);\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n// Bit operations\n/**\n * Calculates amount of bits in a bigint.\n * Same as `n.toString(2).length`\n */\nexport function bitLen(n) {\n let len;\n for (len = 0; n > _0n; n >>= _1n, len += 1)\n ;\n return len;\n}\n/**\n * Gets single bit at position.\n * NOTE: first bit position is 0 (same as arrays)\n * Same as `!!+Array.from(n.toString(2)).reverse()[pos]`\n */\nexport function bitGet(n, pos) {\n return (n >> BigInt(pos)) & _1n;\n}\n/**\n * Sets single bit at position.\n */\nexport const bitSet = (n, pos, value) => {\n return n | ((value ? _1n : _0n) << BigInt(pos));\n};\n/**\n * Calculate mask for N bits. Not using ** operator with bigints because of old engines.\n * Same as BigInt(`0b${Array(i).fill('1').join('')}`)\n */\nexport const bitMask = (n) => (_2n << BigInt(n - 1)) - _1n;\n// DRBG\nconst u8n = (data) => new Uint8Array(data); // creates Uint8Array\nconst u8fr = (arr) => Uint8Array.from(arr); // another shortcut\n/**\n * Minimal HMAC-DRBG from NIST 800-90 for RFC6979 sigs.\n * @returns function that will call DRBG until 2nd arg returns something meaningful\n * @example\n * const drbg = createHmacDRBG(32, 32, hmac);\n * drbg(seed, bytesToKey); // bytesToKey must return Key or undefined\n */\nexport function createHmacDrbg(hashLen, qByteLen, hmacFn) {\n if (typeof hashLen !== 'number' || hashLen < 2)\n throw new Error('hashLen must be a number');\n if (typeof qByteLen !== 'number' || qByteLen < 2)\n throw new Error('qByteLen must be a number');\n if (typeof hmacFn !== 'function')\n throw new Error('hmacFn must be a function');\n // Step B, Step C: set hashLen to 8*ceil(hlen/8)\n let v = u8n(hashLen); // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 sigs.\n let k = u8n(hashLen); // Steps B and C of RFC6979 3.2: set hashLen, in our case always same\n let i = 0; // Iterations counter, will throw when over 1000\n const reset = () => {\n v.fill(1);\n k.fill(0);\n i = 0;\n };\n const h = (...b) => hmacFn(k, v, ...b); // hmac(k)(v, ...values)\n const reseed = (seed = u8n()) => {\n // HMAC-DRBG reseed() function. Steps D-G\n k = h(u8fr([0x00]), seed); // k = hmac(k || v || 0x00 || seed)\n v = h(); // v = hmac(k || v)\n if (seed.length === 0)\n return;\n k = h(u8fr([0x01]), seed); // k = hmac(k || v || 0x01 || seed)\n v = h(); // v = hmac(k || v)\n };\n const gen = () => {\n // HMAC-DRBG generate() function\n if (i++ >= 1000)\n throw new Error('drbg: tried 1000 values');\n let len = 0;\n const out = [];\n while (len < qByteLen) {\n v = h();\n const sl = v.slice();\n out.push(sl);\n len += v.length;\n }\n return concatBytes(...out);\n };\n const genUntil = (seed, pred) => {\n reset();\n reseed(seed); // Steps D-G\n let res = undefined; // Step H: grind until k is in [1..n-1]\n while (!(res = pred(gen())))\n reseed();\n reset();\n return res;\n };\n return genUntil;\n}\n// Validating curves and fields\nconst validatorFns = {\n bigint: (val) => typeof val === 'bigint',\n function: (val) => typeof val === 'function',\n boolean: (val) => typeof val === 'boolean',\n string: (val) => typeof val === 'string',\n isSafeInteger: (val) => Number.isSafeInteger(val),\n array: (val) => Array.isArray(val),\n field: (val, object) => object.Fp.isValid(val),\n hash: (val) => typeof val === 'function' && Number.isSafeInteger(val.outputLen),\n};\n// type Record = { [P in K]: T; }\nexport function validateObject(object, validators, optValidators = {}) {\n const checkField = (fieldName, type, isOptional) => {\n const checkVal = validatorFns[type];\n if (typeof checkVal !== 'function')\n throw new Error(`Invalid validator \"${type}\", expected function`);\n const val = object[fieldName];\n if (isOptional && val === undefined)\n return;\n if (!checkVal(val, object)) {\n throw new Error(`Invalid param ${String(fieldName)}=${val} (${typeof val}), expected ${type}`);\n }\n };\n for (const [fieldName, type] of Object.entries(validators))\n checkField(fieldName, type, false);\n for (const [fieldName, type] of Object.entries(optValidators))\n checkField(fieldName, type, true);\n return object;\n}\n// validate type tests\n// const o: { a: number; b: number; c: number } = { a: 1, b: 5, c: 6 };\n// const z0 = validateObject(o, { a: 'isSafeInteger' }, { c: 'bigint' }); // Ok!\n// // Should fail type-check\n// const z1 = validateObject(o, { a: 'tmp' }, { c: 'zz' });\n// const z2 = validateObject(o, { a: 'isSafeInteger' }, { c: 'zz' });\n// const z3 = validateObject(o, { test: 'boolean', z: 'bug' });\n// const z4 = validateObject(o, { a: 'boolean', z: 'bug' });\n//# sourceMappingURL=utils.js.map","import { isHex, toBytes } from '../../index.js';\nimport { equalBytes } from '@noble/curves/abstract/utils';\nexport function isBytesEqual(a_, b_) {\n const a = isHex(a_) ? toBytes(a_) : a_;\n const b = isHex(b_) ? toBytes(b_) : b_;\n return equalBytes(a, b);\n}\n//# sourceMappingURL=isBytesEqual.js.map","import { universalSignatureValidatorAbi } from '../../constants/abis.js';\nimport { universalSignatureValidatorByteCode } from '../../constants/contracts.js';\nimport { CallExecutionError } from '../../errors/contract.js';\nimport { isBytesEqual } from '../../utils/data/isBytesEqual.js';\nimport { encodeDeployData, isHex, toHex } from '../../utils/index.js';\nimport { call } from './call.js';\n/**\n * Verifies a message hash on chain using ERC-6492.\n *\n * @param client - Client to use.\n * @param parameters - {@link VerifyHashParameters}\n * @returns Whether or not the signature is valid. {@link VerifyHashReturnType}\n */\nexport async function verifyHash(client, { address, hash, signature, ...callRequest }) {\n const signatureHex = isHex(signature) ? signature : toHex(signature);\n try {\n const { data } = await call(client, {\n data: encodeDeployData({\n abi: universalSignatureValidatorAbi,\n args: [address, hash, signatureHex],\n bytecode: universalSignatureValidatorByteCode,\n }),\n ...callRequest,\n });\n return isBytesEqual(data ?? '0x0', '0x1');\n }\n catch (error) {\n if (error instanceof CallExecutionError) {\n // if the execution fails, the signature was not valid and an internal method inside of the validator reverted\n // this can happen for many reasons, for example if signer can not be recovered from the signature\n // or if the signature has no valid format\n return false;\n }\n throw error;\n }\n}\n//# sourceMappingURL=verifyHash.js.map","import { hashMessage } from '../../utils/index.js';\nimport { verifyHash } from './verifyHash.js';\n/**\n * Verify that a message was signed by the provided address.\n *\n * Compatible with Smart Contract Accounts & Externally Owned Accounts via [ERC-6492](https://eips.ethereum.org/EIPS/eip-6492).\n *\n * - Docs {@link https://viem.sh/docs/actions/public/verifyMessage.html}\n *\n * @param client - Client to use.\n * @param parameters - {@link VerifyMessageParameters}\n * @returns Whether or not the signature is valid. {@link VerifyMessageReturnType}\n */\nexport async function verifyMessage(client, { address, message, signature, ...callRequest }) {\n const hash = hashMessage(message);\n return verifyHash(client, {\n address,\n hash,\n signature,\n ...callRequest,\n });\n}\n//# sourceMappingURL=verifyMessage.js.map","import { hashTypedData } from '../../utils/signature/hashTypedData.js';\nimport { verifyHash } from './verifyHash.js';\n/**\n * Verify that typed data was signed by the provided address.\n *\n * - Docs {@link https://viem.sh/docs/actions/public/verifyTypedData.html}\n *\n * @param client - Client to use.\n * @param parameters - {@link VerifyTypedDataParameters}\n * @returns Whether or not the signature is valid. {@link VerifyTypedDataReturnType}\n */\nexport async function verifyTypedData(client, { address, signature, message, primaryType, types, domain, ...callRequest }) {\n const hash = hashTypedData({ message, primaryType, types, domain });\n return verifyHash(client, {\n address,\n hash,\n signature,\n ...callRequest,\n });\n}\n//# sourceMappingURL=verifyTypedData.js.map","import { hexToBigInt } from '../../utils/encoding/fromHex.js';\nimport { observe } from '../../utils/observe.js';\nimport { poll } from '../../utils/poll.js';\nimport { stringify } from '../../utils/stringify.js';\nimport { getBlockNumber, } from './getBlockNumber.js';\n/**\n * Watches and returns incoming block numbers.\n *\n * - Docs: https://viem.sh/docs/actions/public/watchBlockNumber.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/watching-blocks\n * - JSON-RPC Methods:\n * - When `poll: true`, calls [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber) on a polling interval.\n * - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `\"newHeads\"` event.\n *\n * @param client - Client to use\n * @param parameters - {@link WatchBlockNumberParameters}\n * @returns A function that can be invoked to stop watching for new block numbers. {@link WatchBlockNumberReturnType}\n *\n * @example\n * import { createPublicClient, watchBlockNumber, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const unwatch = watchBlockNumber(client, {\n * onBlockNumber: (blockNumber) => console.log(blockNumber),\n * })\n */\nexport function watchBlockNumber(client, { emitOnBegin = false, emitMissed = false, onBlockNumber, onError, poll: poll_, pollingInterval = client.pollingInterval, }) {\n const enablePolling = typeof poll_ !== 'undefined' ? poll_ : client.transport.type !== 'webSocket';\n let prevBlockNumber;\n const pollBlockNumber = () => {\n const observerId = stringify([\n 'watchBlockNumber',\n client.uid,\n emitOnBegin,\n emitMissed,\n pollingInterval,\n ]);\n return observe(observerId, { onBlockNumber, onError }, (emit) => poll(async () => {\n try {\n const blockNumber = await getBlockNumber(client, { cacheTime: 0 });\n if (prevBlockNumber) {\n // If the current block number is the same as the previous,\n // we can skip.\n if (blockNumber === prevBlockNumber)\n return;\n // If we have missed out on some previous blocks, and the\n // `emitMissed` flag is truthy, let's emit those blocks.\n if (blockNumber - prevBlockNumber > 1 && emitMissed) {\n for (let i = prevBlockNumber + 1n; i < blockNumber; i++) {\n emit.onBlockNumber(i, prevBlockNumber);\n prevBlockNumber = i;\n }\n }\n }\n // If the next block number is greater than the previous,\n // it is not in the past, and we can emit the new block number.\n if (!prevBlockNumber || blockNumber > prevBlockNumber) {\n emit.onBlockNumber(blockNumber, prevBlockNumber);\n prevBlockNumber = blockNumber;\n }\n }\n catch (err) {\n emit.onError?.(err);\n }\n }, {\n emitOnBegin,\n interval: pollingInterval,\n }));\n };\n const subscribeBlockNumber = () => {\n let active = true;\n let unsubscribe = () => (active = false);\n (async () => {\n try {\n const { unsubscribe: unsubscribe_ } = await client.transport.subscribe({\n params: ['newHeads'],\n onData(data) {\n if (!active)\n return;\n const blockNumber = hexToBigInt(data.result?.number);\n onBlockNumber(blockNumber, prevBlockNumber);\n prevBlockNumber = blockNumber;\n },\n onError(error) {\n onError?.(error);\n },\n });\n unsubscribe = unsubscribe_;\n if (!active)\n unsubscribe();\n }\n catch (err) {\n onError?.(err);\n }\n })();\n return unsubscribe;\n };\n return enablePolling ? pollBlockNumber() : subscribeBlockNumber();\n}\n//# sourceMappingURL=watchBlockNumber.js.map","import { TransactionNotFoundError, TransactionReceiptNotFoundError, WaitForTransactionReceiptTimeoutError, } from '../../errors/transaction.js';\nimport { observe } from '../../utils/observe.js';\nimport { withRetry } from '../../utils/promise/withRetry.js';\nimport { stringify } from '../../utils/stringify.js';\nimport { getBlock } from './getBlock.js';\nimport { getTransaction, } from './getTransaction.js';\nimport { getTransactionReceipt, } from './getTransactionReceipt.js';\nimport { watchBlockNumber } from './watchBlockNumber.js';\n/**\n * Waits for the [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) to be included on a [Block](https://viem.sh/docs/glossary/terms.html#block) (one confirmation), and then returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms.html#transaction-receipt). If the Transaction reverts, then the action will throw an error.\n *\n * - Docs: https://viem.sh/docs/actions/public/waitForTransactionReceipt.html\n * - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/sending-transactions\n * - JSON-RPC Methods:\n * - Polls [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt) on each block until it has been processed.\n * - If a Transaction has been replaced:\n * - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) and extracts the transactions\n * - Checks if one of the Transactions is a replacement\n * - If so, calls [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt).\n *\n * The `waitForTransactionReceipt` action additionally supports Replacement detection (e.g. sped up Transactions).\n *\n * Transactions can be replaced when a user modifies their transaction in their wallet (to speed up or cancel). Transactions are replaced when they are sent from the same nonce.\n *\n * There are 3 types of Transaction Replacement reasons:\n *\n * - `repriced`: The gas price has been modified (e.g. different `maxFeePerGas`)\n * - `cancelled`: The Transaction has been cancelled (e.g. `value === 0n`)\n * - `replaced`: The Transaction has been replaced (e.g. different `value` or `data`)\n *\n * @param client - Client to use\n * @param parameters - {@link WaitForTransactionReceiptParameters}\n * @returns The transaction receipt. {@link WaitForTransactionReceiptReturnType}\n *\n * @example\n * import { createPublicClient, waitForTransactionReceipt, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const transactionReceipt = await waitForTransactionReceipt(client, {\n * hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',\n * })\n */\nexport async function waitForTransactionReceipt(client, { confirmations = 1, hash, onReplaced, pollingInterval = client.pollingInterval, timeout, }) {\n const observerId = stringify(['waitForTransactionReceipt', client.uid, hash]);\n let transaction;\n let replacedTransaction;\n let receipt;\n let retrying = false;\n return new Promise((resolve, reject) => {\n if (timeout)\n setTimeout(() => reject(new WaitForTransactionReceiptTimeoutError({ hash })), timeout);\n const _unobserve = observe(observerId, { onReplaced, resolve, reject }, (emit) => {\n const _unwatch = watchBlockNumber(client, {\n emitMissed: true,\n emitOnBegin: true,\n poll: true,\n pollingInterval,\n async onBlockNumber(blockNumber_) {\n if (retrying)\n return;\n let blockNumber = blockNumber_;\n const done = (fn) => {\n _unwatch();\n fn();\n _unobserve();\n };\n try {\n // If we already have a valid receipt, let's check if we have enough\n // confirmations. If we do, then we can resolve.\n if (receipt) {\n if (blockNumber - receipt.blockNumber + 1n < confirmations)\n return;\n done(() => emit.resolve(receipt));\n return;\n }\n // Get the transaction to check if it's been replaced.\n // We need to retry as some RPC Providers may be slow to sync\n // up mined transactions.\n if (!transaction) {\n retrying = true;\n await withRetry(async () => {\n transaction = await getTransaction(client, { hash });\n if (transaction.blockNumber)\n blockNumber = transaction.blockNumber;\n }, {\n // exponential backoff\n delay: ({ count }) => ~~(1 << count) * 200,\n retryCount: 6,\n });\n retrying = false;\n }\n // Get the receipt to check if it's been processed.\n receipt = await getTransactionReceipt(client, { hash });\n // Check if we have enough confirmations. If not, continue polling.\n if (confirmations > 0 &&\n blockNumber - receipt.blockNumber + 1n < confirmations)\n return;\n done(() => emit.resolve(receipt));\n }\n catch (err) {\n // If the receipt is not found, the transaction will be pending.\n // We need to check if it has potentially been replaced.\n if (transaction &&\n (err instanceof TransactionNotFoundError ||\n err instanceof TransactionReceiptNotFoundError)) {\n replacedTransaction = transaction;\n // Let's retrieve the transactions from the current block.\n const block = await getBlock(client, {\n blockNumber,\n includeTransactions: true,\n });\n const replacementTransaction = block.transactions.find(({ from, nonce }) => from === replacedTransaction.from &&\n nonce === replacedTransaction.nonce);\n // If we couldn't find a replacement transaction, continue polling.\n if (!replacementTransaction)\n return;\n // If we found a replacement transaction, return it's receipt.\n receipt = await getTransactionReceipt(client, {\n hash: replacementTransaction.hash,\n });\n // Check if we have enough confirmations. If not, continue polling.\n if (blockNumber - receipt.blockNumber + 1n < confirmations)\n return;\n let reason = 'replaced';\n if (replacementTransaction.to === replacedTransaction.to &&\n replacementTransaction.value === replacedTransaction.value) {\n reason = 'repriced';\n }\n else if (replacementTransaction.from === replacementTransaction.to &&\n replacementTransaction.value === 0n) {\n reason = 'cancelled';\n }\n done(() => {\n emit.onReplaced?.({\n reason,\n replacedTransaction: replacedTransaction,\n transaction: replacementTransaction,\n transactionReceipt: receipt,\n });\n emit.resolve(receipt);\n });\n }\n else {\n done(() => emit.reject(err));\n }\n }\n },\n });\n });\n });\n}\n//# sourceMappingURL=waitForTransactionReceipt.js.map","import { formatBlock } from '../../utils/formatters/block.js';\nimport { observe } from '../../utils/observe.js';\nimport { poll } from '../../utils/poll.js';\nimport { stringify } from '../../utils/stringify.js';\nimport { getBlock } from './getBlock.js';\n/**\n * Watches and returns information for incoming blocks.\n *\n * - Docs: https://viem.sh/docs/actions/public/watchBlocks.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/watching-blocks\n * - JSON-RPC Methods:\n * - When `poll: true`, calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getBlockByNumber) on a polling interval.\n * - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `\"newHeads\"` event.\n *\n * @param client - Client to use\n * @param parameters - {@link WatchBlocksParameters}\n * @returns A function that can be invoked to stop watching for new block numbers. {@link WatchBlocksReturnType}\n *\n * @example\n * import { createPublicClient, watchBlocks, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const unwatch = watchBlocks(client, {\n * onBlock: (block) => console.log(block),\n * })\n */\nexport function watchBlocks(client, { blockTag = 'latest', emitMissed = false, emitOnBegin = false, onBlock, onError, includeTransactions: includeTransactions_, poll: poll_, pollingInterval = client.pollingInterval, }) {\n const enablePolling = typeof poll_ !== 'undefined' ? poll_ : client.transport.type !== 'webSocket';\n const includeTransactions = includeTransactions_ ?? false;\n let prevBlock;\n const pollBlocks = () => {\n const observerId = stringify([\n 'watchBlocks',\n client.uid,\n emitMissed,\n emitOnBegin,\n includeTransactions,\n pollingInterval,\n ]);\n return observe(observerId, { onBlock, onError }, (emit) => poll(async () => {\n try {\n const block = await getBlock(client, {\n blockTag,\n includeTransactions,\n });\n if (block.number && prevBlock?.number) {\n // If the current block number is the same as the previous,\n // we can skip.\n if (block.number === prevBlock.number)\n return;\n // If we have missed out on some previous blocks, and the\n // `emitMissed` flag is truthy, let's emit those blocks.\n if (block.number - prevBlock.number > 1 && emitMissed) {\n for (let i = prevBlock?.number + 1n; i < block.number; i++) {\n const block = await getBlock(client, {\n blockNumber: i,\n includeTransactions,\n });\n emit.onBlock(block, prevBlock);\n prevBlock = block;\n }\n }\n }\n if (\n // If no previous block exists, emit.\n !prevBlock?.number ||\n // If the block tag is \"pending\" with no block number, emit.\n (blockTag === 'pending' && !block?.number) ||\n // If the next block number is greater than the previous block number, emit.\n // We don't want to emit blocks in the past.\n (block.number && block.number > prevBlock.number)) {\n emit.onBlock(block, prevBlock);\n prevBlock = block;\n }\n }\n catch (err) {\n emit.onError?.(err);\n }\n }, {\n emitOnBegin,\n interval: pollingInterval,\n }));\n };\n const subscribeBlocks = () => {\n let active = true;\n let unsubscribe = () => (active = false);\n (async () => {\n try {\n const { unsubscribe: unsubscribe_ } = await client.transport.subscribe({\n params: ['newHeads'],\n onData(data) {\n if (!active)\n return;\n const format = client.chain?.formatters?.block?.format || formatBlock;\n const block = format(data.result);\n onBlock(block, prevBlock);\n prevBlock = block;\n },\n onError(error) {\n onError?.(error);\n },\n });\n unsubscribe = unsubscribe_;\n if (!active)\n unsubscribe();\n }\n catch (err) {\n onError?.(err);\n }\n })();\n return unsubscribe;\n };\n return enablePolling ? pollBlocks() : subscribeBlocks();\n}\n//# sourceMappingURL=watchBlocks.js.map","import { observe } from '../../utils/observe.js';\nimport { poll } from '../../utils/poll.js';\nimport { stringify } from '../../utils/stringify.js';\nimport { DecodeLogDataMismatch, DecodeLogTopicsMismatch, } from '../../errors/abi.js';\nimport { InvalidInputRpcError } from '../../errors/rpc.js';\nimport { decodeEventLog, encodeEventTopics, formatLog, } from '../../utils/index.js';\nimport { createEventFilter, } from './createEventFilter.js';\nimport { getBlockNumber } from './getBlockNumber.js';\nimport { getFilterChanges } from './getFilterChanges.js';\nimport { getLogs } from './getLogs.js';\nimport { uninstallFilter } from './uninstallFilter.js';\n/**\n * Watches and returns emitted [Event Logs](https://viem.sh/docs/glossary/terms.html#event-log).\n *\n * - Docs: https://viem.sh/docs/actions/public/watchEvent.html\n * - JSON-RPC Methods:\n * - **RPC Provider supports `eth_newFilter`:**\n * - Calls [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter) to create a filter (called on initialize).\n * - On a polling interval, it will call [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges).\n * - **RPC Provider does not support `eth_newFilter`:**\n * - Calls [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs) for each block between the polling interval.\n *\n * This Action will batch up all the Event Logs found within the [`pollingInterval`](https://viem.sh/docs/actions/public/watchEvent.html#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/actions/public/watchEvent.html#onLogs).\n *\n * `watchEvent` will attempt to create an [Event Filter](https://viem.sh/docs/actions/public/createEventFilter.html) and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. `eth_newFilter`), then `watchEvent` will fall back to using [`getLogs`](https://viem.sh/docs/actions/public/getLogs.html) instead.\n *\n * @param client - Client to use\n * @param parameters - {@link WatchEventParameters}\n * @returns A function that can be invoked to stop watching for new Event Logs. {@link WatchEventReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { watchEvent } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const unwatch = watchEvent(client, {\n * onLogs: (logs) => console.log(logs),\n * })\n */\nexport function watchEvent(client, { address, args, batch = true, event, events, onError, onLogs, poll: poll_, pollingInterval = client.pollingInterval, strict: strict_, }) {\n const enablePolling = typeof poll_ !== 'undefined' ? poll_ : client.transport.type !== 'webSocket';\n const strict = strict_ ?? false;\n const pollEvent = () => {\n const observerId = stringify([\n 'watchEvent',\n address,\n args,\n batch,\n client.uid,\n event,\n pollingInterval,\n ]);\n return observe(observerId, { onLogs, onError }, (emit) => {\n let previousBlockNumber;\n let filter;\n let initialized = false;\n const unwatch = poll(async () => {\n if (!initialized) {\n try {\n filter = (await createEventFilter(client, {\n address,\n args,\n event: event,\n events,\n strict,\n }));\n }\n catch { }\n initialized = true;\n return;\n }\n try {\n let logs;\n if (filter) {\n logs = await getFilterChanges(client, { filter });\n }\n else {\n // If the filter doesn't exist, we will fall back to use `getLogs`.\n // The fall back exists because some RPC Providers do not support filters.\n // Fetch the block number to use for `getLogs`.\n const blockNumber = await getBlockNumber(client);\n // If the block number has changed, we will need to fetch the logs.\n // If the block number doesn't exist, we are yet to reach the first poll interval,\n // so do not emit any logs.\n if (previousBlockNumber && previousBlockNumber !== blockNumber) {\n logs = await getLogs(client, {\n address,\n args,\n event: event,\n events,\n fromBlock: previousBlockNumber + 1n,\n toBlock: blockNumber,\n });\n }\n else {\n logs = [];\n }\n previousBlockNumber = blockNumber;\n }\n if (logs.length === 0)\n return;\n if (batch)\n emit.onLogs(logs);\n else\n logs.forEach((log) => emit.onLogs([log]));\n }\n catch (err) {\n // If a filter has been set and gets uninstalled, providers will throw an InvalidInput error.\n // Reinitalize the filter when this occurs\n if (filter && err instanceof InvalidInputRpcError)\n initialized = false;\n emit.onError?.(err);\n }\n }, {\n emitOnBegin: true,\n interval: pollingInterval,\n });\n return async () => {\n if (filter)\n await uninstallFilter(client, { filter });\n unwatch();\n };\n });\n };\n const subscribeEvent = () => {\n let active = true;\n let unsubscribe = () => (active = false);\n (async () => {\n try {\n const events_ = events ?? (event ? [event] : undefined);\n let topics = [];\n if (events_) {\n topics = [\n events_.flatMap((event) => encodeEventTopics({\n abi: [event],\n eventName: event.name,\n args,\n })),\n ];\n if (event)\n topics = topics[0];\n }\n const { unsubscribe: unsubscribe_ } = await client.transport.subscribe({\n params: ['logs', { address, topics }],\n onData(data) {\n if (!active)\n return;\n const log = data.result;\n try {\n const { eventName, args } = decodeEventLog({\n abi: events_,\n data: log.data,\n topics: log.topics,\n strict,\n });\n const formatted = formatLog(log, {\n args,\n eventName: eventName,\n });\n onLogs([formatted]);\n }\n catch (err) {\n let eventName;\n let isUnnamed;\n if (err instanceof DecodeLogDataMismatch ||\n err instanceof DecodeLogTopicsMismatch) {\n // If strict mode is on, and log data/topics do not match event definition, skip.\n if (strict_)\n return;\n eventName = err.abiItem.name;\n isUnnamed = err.abiItem.inputs?.some((x) => !('name' in x && x.name));\n }\n // Set args to empty if there is an error decoding (e.g. indexed/non-indexed params mismatch).\n const formatted = formatLog(log, {\n args: isUnnamed ? [] : {},\n eventName,\n });\n onLogs([formatted]);\n }\n },\n onError(error) {\n onError?.(error);\n },\n });\n unsubscribe = unsubscribe_;\n if (!active)\n unsubscribe();\n }\n catch (err) {\n onError?.(err);\n }\n })();\n return unsubscribe;\n };\n return enablePolling ? pollEvent() : subscribeEvent();\n}\n//# sourceMappingURL=watchEvent.js.map","import { observe } from '../../utils/observe.js';\nimport { poll } from '../../utils/poll.js';\nimport { stringify } from '../../utils/stringify.js';\nimport { createPendingTransactionFilter } from './createPendingTransactionFilter.js';\nimport { getFilterChanges } from './getFilterChanges.js';\nimport { uninstallFilter } from './uninstallFilter.js';\n/**\n * Watches and returns pending transaction hashes.\n *\n * - Docs: https://viem.sh/docs/actions/public/watchPendingTransactions.html\n * - JSON-RPC Methods:\n * - When `poll: true`\n * - Calls [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter) to initialize the filter.\n * - Calls [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getFilterChanges) on a polling interval.\n * - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `\"newPendingTransactions\"` event.\n *\n * This Action will batch up all the pending transactions found within the [`pollingInterval`](https://viem.sh/docs/actions/public/watchPendingTransactions.html#pollinginterval-optional), and invoke them via [`onTransactions`](https://viem.sh/docs/actions/public/watchPendingTransactions.html#ontransactions).\n *\n * @param client - Client to use\n * @param parameters - {@link WatchPendingTransactionsParameters}\n * @returns A function that can be invoked to stop watching for new pending transaction hashes. {@link WatchPendingTransactionsReturnType}\n *\n * @example\n * import { createPublicClient, http } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { watchPendingTransactions } from 'viem/public'\n *\n * const client = createPublicClient({\n * chain: mainnet,\n * transport: http(),\n * })\n * const unwatch = await watchPendingTransactions(client, {\n * onTransactions: (hashes) => console.log(hashes),\n * })\n */\nexport function watchPendingTransactions(client, { batch = true, onError, onTransactions, poll: poll_, pollingInterval = client.pollingInterval, }) {\n const enablePolling = typeof poll_ !== 'undefined' ? poll_ : client.transport.type !== 'webSocket';\n const pollPendingTransactions = () => {\n const observerId = stringify([\n 'watchPendingTransactions',\n client.uid,\n batch,\n pollingInterval,\n ]);\n return observe(observerId, { onTransactions, onError }, (emit) => {\n let filter;\n const unwatch = poll(async () => {\n try {\n if (!filter) {\n try {\n filter = await createPendingTransactionFilter(client);\n return;\n }\n catch (err) {\n unwatch();\n throw err;\n }\n }\n const hashes = await getFilterChanges(client, { filter });\n if (hashes.length === 0)\n return;\n if (batch)\n emit.onTransactions(hashes);\n else\n hashes.forEach((hash) => emit.onTransactions([hash]));\n }\n catch (err) {\n emit.onError?.(err);\n }\n }, {\n emitOnBegin: true,\n interval: pollingInterval,\n });\n return async () => {\n if (filter)\n await uninstallFilter(client, { filter });\n unwatch();\n };\n });\n };\n const subscribePendingTransactions = () => {\n let active = true;\n let unsubscribe = () => (active = false);\n (async () => {\n try {\n const { unsubscribe: unsubscribe_ } = await client.transport.subscribe({\n params: ['newPendingTransactions'],\n onData(data) {\n if (!active)\n return;\n const transaction = data.result;\n onTransactions([transaction]);\n },\n onError(error) {\n onError?.(error);\n },\n });\n unsubscribe = unsubscribe_;\n if (!active)\n unsubscribe();\n }\n catch (err) {\n onError?.(err);\n }\n })();\n return unsubscribe;\n };\n return enablePolling\n ? pollPendingTransactions()\n : subscribePendingTransactions();\n}\n//# sourceMappingURL=watchPendingTransactions.js.map","import { getEnsAddress, } from '../../actions/ens/getEnsAddress.js';\nimport { getEnsAvatar, } from '../../actions/ens/getEnsAvatar.js';\nimport { getEnsName, } from '../../actions/ens/getEnsName.js';\nimport { getEnsResolver, } from '../../actions/ens/getEnsResolver.js';\nimport { getEnsText, } from '../../actions/ens/getEnsText.js';\nimport { call, } from '../../actions/public/call.js';\nimport { createBlockFilter, } from '../../actions/public/createBlockFilter.js';\nimport { createContractEventFilter, } from '../../actions/public/createContractEventFilter.js';\nimport { createEventFilter, } from '../../actions/public/createEventFilter.js';\nimport { createPendingTransactionFilter, } from '../../actions/public/createPendingTransactionFilter.js';\nimport { estimateContractGas, } from '../../actions/public/estimateContractGas.js';\nimport { estimateGas, } from '../../actions/public/estimateGas.js';\nimport { getBalance, } from '../../actions/public/getBalance.js';\nimport { getBlock, } from '../../actions/public/getBlock.js';\nimport { getBlockNumber, } from '../../actions/public/getBlockNumber.js';\nimport { getBlockTransactionCount, } from '../../actions/public/getBlockTransactionCount.js';\nimport { getBytecode, } from '../../actions/public/getBytecode.js';\nimport { getChainId, } from '../../actions/public/getChainId.js';\nimport { getFeeHistory, } from '../../actions/public/getFeeHistory.js';\nimport { getFilterChanges, } from '../../actions/public/getFilterChanges.js';\nimport { getFilterLogs, } from '../../actions/public/getFilterLogs.js';\nimport { getGasPrice, } from '../../actions/public/getGasPrice.js';\nimport { getLogs, } from '../../actions/public/getLogs.js';\nimport { getStorageAt, } from '../../actions/public/getStorageAt.js';\nimport { getTransaction, } from '../../actions/public/getTransaction.js';\nimport { getTransactionConfirmations, } from '../../actions/public/getTransactionConfirmations.js';\nimport { getTransactionCount, } from '../../actions/public/getTransactionCount.js';\nimport { getTransactionReceipt, } from '../../actions/public/getTransactionReceipt.js';\nimport { multicall, } from '../../actions/public/multicall.js';\nimport { readContract, } from '../../actions/public/readContract.js';\nimport { simulateContract, } from '../../actions/public/simulateContract.js';\nimport { uninstallFilter, } from '../../actions/public/uninstallFilter.js';\nimport { verifyMessage, } from '../../actions/public/verifyMessage.js';\nimport { verifyTypedData, } from '../../actions/public/verifyTypedData.js';\nimport { waitForTransactionReceipt, } from '../../actions/public/waitForTransactionReceipt.js';\nimport { watchBlockNumber, } from '../../actions/public/watchBlockNumber.js';\nimport { watchBlocks, } from '../../actions/public/watchBlocks.js';\nimport { watchContractEvent, } from '../../actions/public/watchContractEvent.js';\nimport { watchEvent, } from '../../actions/public/watchEvent.js';\nimport { watchPendingTransactions, } from '../../actions/public/watchPendingTransactions.js';\nexport function publicActions(client) {\n return {\n call: (args) => call(client, args),\n createBlockFilter: () => createBlockFilter(client),\n createContractEventFilter: (args) => createContractEventFilter(client, args),\n createEventFilter: (args) => createEventFilter(client, args),\n createPendingTransactionFilter: () => createPendingTransactionFilter(client),\n estimateContractGas: (args) => estimateContractGas(client, args),\n estimateGas: (args) => estimateGas(client, args),\n getBalance: (args) => getBalance(client, args),\n getBlock: (args) => getBlock(client, args),\n getBlockNumber: (args) => getBlockNumber(client, args),\n getBlockTransactionCount: (args) => getBlockTransactionCount(client, args),\n getBytecode: (args) => getBytecode(client, args),\n getChainId: () => getChainId(client),\n getEnsAddress: (args) => getEnsAddress(client, args),\n getEnsAvatar: (args) => getEnsAvatar(client, args),\n getEnsName: (args) => getEnsName(client, args),\n getEnsResolver: (args) => getEnsResolver(client, args),\n getEnsText: (args) => getEnsText(client, args),\n getFeeHistory: (args) => getFeeHistory(client, args),\n getFilterChanges: (args) => getFilterChanges(client, args),\n getFilterLogs: (args) => getFilterLogs(client, args),\n getGasPrice: () => getGasPrice(client),\n getLogs: (args) => getLogs(client, args),\n getStorageAt: (args) => getStorageAt(client, args),\n getTransaction: (args) => getTransaction(client, args),\n getTransactionConfirmations: (args) => getTransactionConfirmations(client, args),\n getTransactionCount: (args) => getTransactionCount(client, args),\n getTransactionReceipt: (args) => getTransactionReceipt(client, args),\n multicall: (args) => multicall(client, args),\n readContract: (args) => readContract(client, args),\n simulateContract: (args) => simulateContract(client, args),\n verifyMessage: (args) => verifyMessage(client, args),\n verifyTypedData: (args) => verifyTypedData(client, args),\n uninstallFilter: (args) => uninstallFilter(client, args),\n waitForTransactionReceipt: (args) => waitForTransactionReceipt(client, args),\n watchBlocks: (args) => watchBlocks(client, args),\n watchBlockNumber: (args) => watchBlockNumber(client, args),\n watchContractEvent: (args) => watchContractEvent(client, args),\n watchEvent: (args) => watchEvent(client, args),\n watchPendingTransactions: (args) => watchPendingTransactions(client, args),\n };\n}\n//# sourceMappingURL=public.js.map","import { createClient } from './createClient.js';\nimport { publicActions } from './decorators/public.js';\nexport function createPublicClient(parameters) {\n const { key = 'public', name = 'Public Client' } = parameters;\n const client = createClient({\n ...parameters,\n key,\n name,\n type: 'publicClient',\n });\n return client.extend(publicActions);\n}\n//# sourceMappingURL=createPublicClient.js.map","import { encodeDeployData } from '../../utils/abi/encodeDeployData.js';\nimport { sendTransaction, } from './sendTransaction.js';\n/**\n * Deploys a contract to the network, given bytecode and constructor arguments.\n *\n * - Docs: https://viem.sh/docs/contract/deployContract.html\n * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/deploying-contracts\n *\n * @param client - Client to use\n * @param parameters - {@link DeployContractParameters}\n * @returns The [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) hash. {@link DeployContractReturnType}\n *\n * @example\n * import { createWalletClient, http } from 'viem'\n * import { privateKeyToAccount } from 'viem/accounts'\n * import { mainnet } from 'viem/chains'\n * import { deployContract } from 'viem/contract'\n *\n * const client = createWalletClient({\n * account: privateKeyToAccount('0x…'),\n * chain: mainnet,\n * transport: http(),\n * })\n * const hash = await deployContract(client, {\n * abi: [],\n * account: '0x…,\n * bytecode: '0x608060405260405161083e38038061083e833981016040819052610...',\n * })\n */\nexport function deployContract(walletClient, { abi, args, bytecode, ...request }) {\n const calldata = encodeDeployData({\n abi,\n args,\n bytecode,\n });\n return sendTransaction(walletClient, {\n ...request,\n data: calldata,\n });\n}\n//# sourceMappingURL=deployContract.js.map","import { checksumAddress } from '../../utils/address/getAddress.js';\n/**\n * Returns a list of account addresses owned by the wallet or client.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/getAddresses.html\n * - JSON-RPC Methods: [`eth_accounts`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_accounts)\n *\n * @param client - Client to use\n * @returns List of account addresses owned by the wallet or client. {@link GetAddressesReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getAddresses } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n * const accounts = await getAddresses(client)\n */\nexport async function getAddresses(client) {\n const addresses = await client.request({ method: 'eth_accounts' });\n return addresses.map((address) => checksumAddress(address));\n}\n//# sourceMappingURL=getAddresses.js.map","/**\n * Gets the wallets current permissions.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/getPermissions.html\n * - JSON-RPC Methods: [`wallet_getPermissions`](https://eips.ethereum.org/EIPS/eip-2255)\n *\n * @param client - Client to use\n * @returns The wallet permissions. {@link GetPermissionsReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getPermissions } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n * const permissions = await getPermissions(client)\n */\nexport async function getPermissions(client) {\n const permissions = await client.request({ method: 'wallet_getPermissions' });\n return permissions;\n}\n//# sourceMappingURL=getPermissions.js.map","import { getAddress } from '../../utils/address/getAddress.js';\n/**\n * Requests a list of accounts managed by a wallet.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/requestAddresses.html\n * - JSON-RPC Methods: [`eth_requestAccounts`](https://eips.ethereum.org/EIPS/eip-1102)\n *\n * Sends a request to the wallet, asking for permission to access the user's accounts. After the user accepts the request, it will return a list of accounts (addresses).\n *\n * This API can be useful for dapps that need to access the user's accounts in order to execute transactions or interact with smart contracts.\n *\n * @param client - Client to use\n * @returns List of accounts managed by a wallet {@link RequestAddressesReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { requestAddresses } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n * const accounts = await requestAddresses(client)\n */\nexport async function requestAddresses(client) {\n const addresses = await client.request({ method: 'eth_requestAccounts' });\n return addresses.map((address) => getAddress(address));\n}\n//# sourceMappingURL=requestAddresses.js.map","/**\n * Requests permissions for a wallet.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/requestPermissions.html\n * - JSON-RPC Methods: [`wallet_requestPermissions`](https://eips.ethereum.org/EIPS/eip-2255)\n *\n * @param client - Client to use\n * @param parameters - {@link RequestPermissionsParameters}\n * @returns The wallet permissions. {@link RequestPermissionsReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { requestPermissions } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n * const permissions = await requestPermissions(client, {\n * eth_accounts: {}\n * })\n */\nexport async function requestPermissions(client, permissions) {\n return client.request({\n method: 'wallet_requestPermissions',\n params: [permissions],\n });\n}\n//# sourceMappingURL=requestPermissions.js.map","import { parseAccount } from '../../accounts/utils/parseAccount.js';\nimport { AccountNotFoundError } from '../../errors/account.js';\nimport { stringToHex, toHex } from '../../utils/encoding/toHex.js';\n/**\n * Calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256(\"\\x19Ethereum Signed Message:\\n\" + len(message) + message))`.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/signMessage.html\n * - JSON-RPC Methods:\n * - JSON-RPC Accounts: [`personal_sign`](https://docs.metamask.io/guide/signing-data.html#personal-sign)\n * - Local Accounts: Signs locally. No JSON-RPC request.\n *\n * With the calculated signature, you can:\n * - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage.html) to verify the signature,\n * - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress.html) to recover the signing address from a signature.\n *\n * @param client - Client to use\n * @param parameters - {@link SignMessageParameters}\n * @returns The signed message. {@link SignMessageReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { signMessage } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n * const signature = await signMessage(client, {\n * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * message: 'hello world',\n * })\n *\n * @example\n * // Account Hoisting\n * import { createWalletClient, custom } from 'viem'\n * import { privateKeyToAccount } from 'viem/accounts'\n * import { mainnet } from 'viem/chains'\n * import { signMessage } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * account: privateKeyToAccount('0x…'),\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n * const signature = await signMessage(client, {\n * message: 'hello world',\n * })\n */\nexport async function signMessage(client, { account: account_ = client.account, message, }) {\n if (!account_)\n throw new AccountNotFoundError({\n docsPath: '/docs/actions/wallet/signMessage',\n });\n const account = parseAccount(account_);\n if (account.type === 'local')\n return account.signMessage({ message });\n const message_ = (() => {\n if (typeof message === 'string')\n return stringToHex(message);\n if (message.raw instanceof Uint8Array)\n return toHex(message.raw);\n return message.raw;\n })();\n return client.request({\n method: 'personal_sign',\n params: [message_, account.address],\n });\n}\n//# sourceMappingURL=signMessage.js.map","import { parseAccount } from '../../accounts/utils/parseAccount.js';\nimport { AccountNotFoundError } from '../../errors/account.js';\nimport { isHex } from '../../utils/data/isHex.js';\nimport { stringify } from '../../utils/stringify.js';\nimport { validateTypedData } from '../../utils/typedData.js';\n/**\n * Signs typed data and calculates an Ethereum-specific signature in [https://eips.ethereum.org/EIPS/eip-712](https://eips.ethereum.org/EIPS/eip-712): `sign(keccak256(\"\\x19\\x01\" ‖ domainSeparator ‖ hashStruct(message)))`\n *\n * - Docs: https://viem.sh/docs/actions/wallet/signTypedData.html\n * - JSON-RPC Methods:\n * - JSON-RPC Accounts: [`eth_signTypedData_v4`](https://docs.metamask.io/guide/signing-data.html#signtypeddata-v4)\n * - Local Accounts: Signs locally. No JSON-RPC request.\n *\n * @param client - Client to use\n * @param parameters - {@link SignTypedDataParameters}\n * @returns The signed data. {@link SignTypedDataReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { signTypedData } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n * const signature = await signTypedData(client, {\n * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n * domain: {\n * name: 'Ether Mail',\n * version: '1',\n * chainId: 1,\n * verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',\n * },\n * types: {\n * Person: [\n * { name: 'name', type: 'string' },\n * { name: 'wallet', type: 'address' },\n * ],\n * Mail: [\n * { name: 'from', type: 'Person' },\n * { name: 'to', type: 'Person' },\n * { name: 'contents', type: 'string' },\n * ],\n * },\n * primaryType: 'Mail',\n * message: {\n * from: {\n * name: 'Cow',\n * wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826',\n * },\n * to: {\n * name: 'Bob',\n * wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB',\n * },\n * contents: 'Hello, Bob!',\n * },\n * })\n *\n * @example\n * // Account Hoisting\n * import { createWalletClient, http } from 'viem'\n * import { privateKeyToAccount } from 'viem/accounts'\n * import { mainnet } from 'viem/chains'\n * import { signTypedData } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * account: privateKeyToAccount('0x…'),\n * chain: mainnet,\n * transport: http(),\n * })\n * const signature = await signTypedData(client, {\n * domain: {\n * name: 'Ether Mail',\n * version: '1',\n * chainId: 1,\n * verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',\n * },\n * types: {\n * Person: [\n * { name: 'name', type: 'string' },\n * { name: 'wallet', type: 'address' },\n * ],\n * Mail: [\n * { name: 'from', type: 'Person' },\n * { name: 'to', type: 'Person' },\n * { name: 'contents', type: 'string' },\n * ],\n * },\n * primaryType: 'Mail',\n * message: {\n * from: {\n * name: 'Cow',\n * wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826',\n * },\n * to: {\n * name: 'Bob',\n * wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB',\n * },\n * contents: 'Hello, Bob!',\n * },\n * })\n */\nexport async function signTypedData(client, { account: account_ = client.account, domain, message, primaryType, types: types_, }) {\n if (!account_)\n throw new AccountNotFoundError({\n docsPath: '/docs/actions/wallet/signTypedData',\n });\n const account = parseAccount(account_);\n const types = {\n EIP712Domain: [\n typeof domain?.name === 'string' && { name: 'name', type: 'string' },\n domain?.version && { name: 'version', type: 'string' },\n typeof domain?.chainId === 'number' && {\n name: 'chainId',\n type: 'uint256',\n },\n domain?.verifyingContract && {\n name: 'verifyingContract',\n type: 'address',\n },\n domain?.salt && { name: 'salt', type: 'bytes32' },\n ].filter(Boolean),\n ...types_,\n };\n // Need to do a runtime validation check on addresses, byte ranges, integer ranges, etc\n // as we can't statically check this with TypeScript.\n validateTypedData({\n domain,\n message,\n primaryType,\n types,\n });\n if (account.type === 'local')\n return account.signTypedData({\n domain,\n primaryType,\n types,\n message,\n });\n const typedData = stringify({ domain: domain ?? {}, primaryType, types, message }, (_, value) => (isHex(value) ? value.toLowerCase() : value));\n return client.request({\n method: 'eth_signTypedData_v4',\n params: [account.address, typedData],\n });\n}\n//# sourceMappingURL=signTypedData.js.map","import { numberToHex } from '../../utils/encoding/toHex.js';\n/**\n * Switch the target chain in a wallet.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/switchChain.html\n * - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-3326)\n *\n * @param client - Client to use\n * @param parameters - {@link SwitchChainParameters}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet, optimism } from 'viem/chains'\n * import { switchChain } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n * await switchChain(client, { id: optimism.id })\n */\nexport async function switchChain(client, { id }) {\n await client.request({\n method: 'wallet_switchEthereumChain',\n params: [\n {\n chainId: numberToHex(id),\n },\n ],\n });\n}\n//# sourceMappingURL=switchChain.js.map","/**\n * Adds an EVM chain to the wallet.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/watchAsset.html\n * - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-747)\n *\n * @param client - Client to use\n * @param parameters - {@link WatchAssetParameters}\n * @returns Boolean indicating if the token was successfully added. {@link WatchAssetReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { watchAsset } from 'viem/wallet'\n *\n * const client = createWalletClient({\n * chain: mainnet,\n * transport: custom(window.ethereum),\n * })\n * const success = await watchAsset(client, {\n * type: 'ERC20',\n * options: {\n * address: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',\n * decimals: 18,\n * symbol: 'WETH',\n * },\n * })\n */\nexport async function watchAsset(client, params) {\n const added = await client.request({\n method: 'wallet_watchAsset',\n params,\n });\n return added;\n}\n//# sourceMappingURL=watchAsset.js.map","import { getChainId, } from '../../actions/public/getChainId.js';\nimport { addChain, } from '../../actions/wallet/addChain.js';\nimport { deployContract, } from '../../actions/wallet/deployContract.js';\nimport { getAddresses, } from '../../actions/wallet/getAddresses.js';\nimport { getPermissions, } from '../../actions/wallet/getPermissions.js';\nimport { requestAddresses, } from '../../actions/wallet/requestAddresses.js';\nimport { requestPermissions, } from '../../actions/wallet/requestPermissions.js';\nimport { sendTransaction, } from '../../actions/wallet/sendTransaction.js';\nimport { signMessage, } from '../../actions/wallet/signMessage.js';\nimport { signTypedData, } from '../../actions/wallet/signTypedData.js';\nimport { switchChain, } from '../../actions/wallet/switchChain.js';\nimport { watchAsset, } from '../../actions/wallet/watchAsset.js';\nimport { writeContract, } from '../../actions/wallet/writeContract.js';\nexport function walletActions(client) {\n return {\n addChain: (args) => addChain(client, args),\n deployContract: (args) => deployContract(client, args),\n getAddresses: () => getAddresses(client),\n getChainId: () => getChainId(client),\n getPermissions: () => getPermissions(client),\n requestAddresses: () => requestAddresses(client),\n requestPermissions: (args) => requestPermissions(client, args),\n sendTransaction: (args) => sendTransaction(client, args),\n signMessage: (args) => signMessage(client, args),\n signTypedData: (args) => signTypedData(client, args),\n switchChain: (args) => switchChain(client, args),\n watchAsset: (args) => watchAsset(client, args),\n writeContract: (args) => writeContract(client, args),\n };\n}\n//# sourceMappingURL=wallet.js.map","import { createClient } from './createClient.js';\nimport { walletActions } from './decorators/wallet.js';\nexport function createWalletClient(parameters) {\n const { key = 'wallet', name = 'Wallet Client', transport } = parameters;\n const client = createClient({\n ...parameters,\n key,\n name,\n transport: (opts) => transport({ ...opts, retryCount: 0 }),\n type: 'walletClient',\n });\n return client.extend(walletActions);\n}\n//# sourceMappingURL=createWalletClient.js.map","import { RpcRequestError } from '../../errors/request.js';\nimport { UrlRequiredError } from '../../errors/transport.js';\nimport { getSocket, rpc } from '../../utils/rpc.js';\nimport { createTransport, } from './createTransport.js';\n/**\n * @description Creates a WebSocket transport that connects to a JSON-RPC API.\n */\nexport function webSocket(\n/** URL of the JSON-RPC API. Defaults to the chain's public RPC URL. */\nurl, config = {}) {\n const { key = 'webSocket', name = 'WebSocket JSON-RPC', retryDelay } = config;\n return ({ chain, retryCount: retryCount_, timeout: timeout_ }) => {\n const retryCount = config.retryCount ?? retryCount_;\n const timeout = timeout_ ?? config.timeout ?? 10000;\n const url_ = url || chain?.rpcUrls.default.webSocket?.[0];\n if (!url_)\n throw new UrlRequiredError();\n return createTransport({\n key,\n name,\n async request({ method, params }) {\n const body = { method, params };\n const socket = await getSocket(url_);\n const { error, result } = await rpc.webSocketAsync(socket, {\n body,\n timeout,\n });\n if (error)\n throw new RpcRequestError({\n body,\n error,\n url: url_,\n });\n return result;\n },\n retryCount,\n retryDelay,\n timeout,\n type: 'webSocket',\n }, {\n getSocket() {\n return getSocket(url_);\n },\n async subscribe({ params, onData, onError }) {\n const socket = await getSocket(url_);\n const { result: subscriptionId } = await new Promise((resolve, reject) => rpc.webSocket(socket, {\n body: {\n method: 'eth_subscribe',\n params,\n },\n onResponse(response) {\n if (response.error) {\n reject(response.error);\n onError?.(response.error);\n return;\n }\n if (typeof response.id === 'number') {\n resolve(response);\n return;\n }\n if (response.method !== 'eth_subscription')\n return;\n onData(response.params);\n },\n }));\n return {\n subscriptionId,\n async unsubscribe() {\n return new Promise((resolve) => rpc.webSocket(socket, {\n body: {\n method: 'eth_unsubscribe',\n params: [subscriptionId],\n },\n onResponse: resolve,\n }));\n },\n };\n },\n });\n };\n}\n//# sourceMappingURL=webSocket.js.map","export function number(n) {\n if (!Number.isSafeInteger(n) || n < 0)\n throw new Error(`Wrong positive integer: ${n}`);\n}\nexport function bool(b) {\n if (typeof b !== 'boolean')\n throw new Error(`Expected boolean, not ${b}`);\n}\nexport function bytes(b, ...lengths) {\n if (!(b instanceof Uint8Array))\n throw new Error('Expected Uint8Array');\n if (lengths.length > 0 && !lengths.includes(b.length))\n throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`);\n}\nexport function hash(hash) {\n if (typeof hash !== 'function' || typeof hash.create !== 'function')\n throw new Error('Hash should be wrapped by utils.wrapConstructor');\n number(hash.outputLen);\n number(hash.blockLen);\n}\nexport function exists(instance, checkFinished = true) {\n if (instance.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished)\n throw new Error('Hash#digest() has already been called');\n}\nexport function output(out, instance) {\n bytes(out);\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error(`digestInto() expects output buffer of length at least ${min}`);\n }\n}\nconst assert = {\n number,\n bool,\n bytes,\n hash,\n exists,\n output,\n};\nexport default assert;\n//# sourceMappingURL=_assert.js.map","export const crypto = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined;\n//# sourceMappingURL=crypto.js.map","/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// node.js versions earlier than v19 don't declare it in global scope.\n// For node.js, package.json#exports field mapping rewrites import\n// from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated, we can just drop the import.\nimport { crypto } from '@noble/hashes/crypto';\nconst u8a = (a) => a instanceof Uint8Array;\n// Cast array to different type\nexport const u8 = (arr) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\nexport const u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n// Cast array to view\nexport const createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n// The rotate right (circular right shift) operation for uint32\nexport const rotr = (word, shift) => (word << (32 - shift)) | (word >>> shift);\n// big-endian hardware is rare. Just in case someone still decides to run hashes:\n// early-throw an error because we don't support BE yet.\nexport const isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44;\nif (!isLE)\n throw new Error('Non little-endian hardware is not supported');\nconst hexes = Array.from({ length: 256 }, (v, i) => i.toString(16).padStart(2, '0'));\n/**\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nexport function bytesToHex(bytes) {\n if (!u8a(bytes))\n throw new Error('Uint8Array expected');\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\n/**\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new Error('hex string expected, got ' + typeof hex);\n const len = hex.length;\n if (len % 2)\n throw new Error('padded hex string expected, got unpadded hex of length ' + len);\n const array = new Uint8Array(len / 2);\n for (let i = 0; i < array.length; i++) {\n const j = i * 2;\n const hexByte = hex.slice(j, j + 2);\n const byte = Number.parseInt(hexByte, 16);\n if (Number.isNaN(byte) || byte < 0)\n throw new Error('Invalid byte sequence');\n array[i] = byte;\n }\n return array;\n}\n// There is no setImmediate in browser and setTimeout is slow.\n// call of async fn will return Promise, which will be fullfiled only on\n// next scheduler queue processing step and this is exactly what we need.\nexport const nextTick = async () => { };\n// Returns control to thread each 'tick' ms to avoid blocking\nexport async function asyncLoop(iters, tick, cb) {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await nextTick();\n ts += diff;\n }\n}\n/**\n * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new Error(`utf8ToBytes expected string, got ${typeof str}`);\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n/**\n * Normalizes (non-hex) string or Uint8Array to Uint8Array.\n * Warning: when Uint8Array is passed, it would NOT get copied.\n * Keep in mind for future mutable operations.\n */\nexport function toBytes(data) {\n if (typeof data === 'string')\n data = utf8ToBytes(data);\n if (!u8a(data))\n throw new Error(`expected Uint8Array, got ${typeof data}`);\n return data;\n}\n/**\n * Copies several Uint8Arrays into one.\n */\nexport function concatBytes(...arrays) {\n const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0));\n let pad = 0; // walk through each item, ensure they have proper type\n arrays.forEach((a) => {\n if (!u8a(a))\n throw new Error('Uint8Array expected');\n r.set(a, pad);\n pad += a.length;\n });\n return r;\n}\n// For runtime check if class implements interface\nexport class Hash {\n // Safe version that clones internal state\n clone() {\n return this._cloneInto();\n }\n}\n// Check if object doens't have custom constructor (like Uint8Array/Array)\nconst isPlainObject = (obj) => Object.prototype.toString.call(obj) === '[object Object]' && obj.constructor === Object;\nexport function checkOpts(defaults, opts) {\n if (opts !== undefined && (typeof opts !== 'object' || !isPlainObject(opts)))\n throw new Error('Options should be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged;\n}\nexport function wrapConstructor(hashCons) {\n const hashC = (msg) => hashCons().update(toBytes(msg)).digest();\n const tmp = hashCons();\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = () => hashCons();\n return hashC;\n}\nexport function wrapConstructorWithOpts(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\nexport function wrapXOFConstructorWithOpts(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\n/**\n * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS.\n */\nexport function randomBytes(bytesLength = 32) {\n if (crypto && typeof crypto.getRandomValues === 'function') {\n return crypto.getRandomValues(new Uint8Array(bytesLength));\n }\n throw new Error('crypto.getRandomValues must be defined');\n}\n//# sourceMappingURL=utils.js.map","import assert from './_assert.js';\nimport { Hash, createView, toBytes } from './utils.js';\n// Polyfill for Safari 14\nfunction setBigUint64(view, byteOffset, value, isLE) {\n if (typeof view.setBigUint64 === 'function')\n return view.setBigUint64(byteOffset, value, isLE);\n const _32n = BigInt(32);\n const _u32_max = BigInt(0xffffffff);\n const wh = Number((value >> _32n) & _u32_max);\n const wl = Number(value & _u32_max);\n const h = isLE ? 4 : 0;\n const l = isLE ? 0 : 4;\n view.setUint32(byteOffset + h, wh, isLE);\n view.setUint32(byteOffset + l, wl, isLE);\n}\n// Base SHA2 class (RFC 6234)\nexport class SHA2 extends Hash {\n constructor(blockLen, outputLen, padOffset, isLE) {\n super();\n this.blockLen = blockLen;\n this.outputLen = outputLen;\n this.padOffset = padOffset;\n this.isLE = isLE;\n this.finished = false;\n this.length = 0;\n this.pos = 0;\n this.destroyed = false;\n this.buffer = new Uint8Array(blockLen);\n this.view = createView(this.buffer);\n }\n update(data) {\n assert.exists(this);\n const { view, buffer, blockLen } = this;\n data = toBytes(data);\n const len = data.length;\n for (let pos = 0; pos < len;) {\n const take = Math.min(blockLen - this.pos, len - pos);\n // Fast path: we have at least one block in input, cast it to view and process\n if (take === blockLen) {\n const dataView = createView(data);\n for (; blockLen <= len - pos; pos += blockLen)\n this.process(dataView, pos);\n continue;\n }\n buffer.set(data.subarray(pos, pos + take), this.pos);\n this.pos += take;\n pos += take;\n if (this.pos === blockLen) {\n this.process(view, 0);\n this.pos = 0;\n }\n }\n this.length += data.length;\n this.roundClean();\n return this;\n }\n digestInto(out) {\n assert.exists(this);\n assert.output(out, this);\n this.finished = true;\n // Padding\n // We can avoid allocation of buffer for padding completely if it\n // was previously not allocated here. But it won't change performance.\n const { buffer, view, blockLen, isLE } = this;\n let { pos } = this;\n // append the bit '1' to the message\n buffer[pos++] = 0b10000000;\n this.buffer.subarray(pos).fill(0);\n // we have less than padOffset left in buffer, so we cannot put length in current block, need process it and pad again\n if (this.padOffset > blockLen - pos) {\n this.process(view, 0);\n pos = 0;\n }\n // Pad until full block byte with zeros\n for (let i = pos; i < blockLen; i++)\n buffer[i] = 0;\n // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that\n // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen.\n // So we just write lowest 64 bits of that value.\n setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE);\n this.process(view, 0);\n const oview = createView(out);\n const len = this.outputLen;\n // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT\n if (len % 4)\n throw new Error('_sha2: outputLen should be aligned to 32bit');\n const outLen = len / 4;\n const state = this.get();\n if (outLen > state.length)\n throw new Error('_sha2: outputLen bigger than state');\n for (let i = 0; i < outLen; i++)\n oview.setUint32(4 * i, state[i], isLE);\n }\n digest() {\n const { buffer, outputLen } = this;\n this.digestInto(buffer);\n const res = buffer.slice(0, outputLen);\n this.destroy();\n return res;\n }\n _cloneInto(to) {\n to || (to = new this.constructor());\n to.set(...this.get());\n const { blockLen, buffer, length, finished, destroyed, pos } = this;\n to.length = length;\n to.pos = pos;\n to.finished = finished;\n to.destroyed = destroyed;\n if (length % blockLen)\n to.buffer.set(buffer);\n return to;\n }\n}\n//# sourceMappingURL=_sha2.js.map","import { SHA2 } from './_sha2.js';\nimport { rotr, wrapConstructor } from './utils.js';\n// Choice: a ? b : c\nconst Chi = (a, b, c) => (a & b) ^ (~a & c);\n// Majority function, true if any two inpust is true\nconst Maj = (a, b, c) => (a & b) ^ (a & c) ^ (b & c);\n// Round constants:\n// first 32 bits of the fractional parts of the cube roots of the first 64 primes 2..311)\n// prettier-ignore\nconst SHA256_K = new Uint32Array([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\n// Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19):\n// prettier-ignore\nconst IV = new Uint32Array([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19\n]);\n// Temporary buffer, not used to store anything between runs\n// Named this way because it matches specification.\nconst SHA256_W = new Uint32Array(64);\nclass SHA256 extends SHA2 {\n constructor() {\n super(64, 32, 8, false);\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n this.A = IV[0] | 0;\n this.B = IV[1] | 0;\n this.C = IV[2] | 0;\n this.D = IV[3] | 0;\n this.E = IV[4] | 0;\n this.F = IV[5] | 0;\n this.G = IV[6] | 0;\n this.H = IV[7] | 0;\n }\n get() {\n const { A, B, C, D, E, F, G, H } = this;\n return [A, B, C, D, E, F, G, H];\n }\n // prettier-ignore\n set(A, B, C, D, E, F, G, H) {\n this.A = A | 0;\n this.B = B | 0;\n this.C = C | 0;\n this.D = D | 0;\n this.E = E | 0;\n this.F = F | 0;\n this.G = G | 0;\n this.H = H | 0;\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4)\n SHA256_W[i] = view.getUint32(offset, false);\n for (let i = 16; i < 64; i++) {\n const W15 = SHA256_W[i - 15];\n const W2 = SHA256_W[i - 2];\n const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3);\n const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10);\n SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0;\n }\n // Compression function main loop, 64 rounds\n let { A, B, C, D, E, F, G, H } = this;\n for (let i = 0; i < 64; i++) {\n const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);\n const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);\n const T2 = (sigma0 + Maj(A, B, C)) | 0;\n H = G;\n G = F;\n F = E;\n E = (D + T1) | 0;\n D = C;\n C = B;\n B = A;\n A = (T1 + T2) | 0;\n }\n // Add the compressed chunk to the current hash value\n A = (A + this.A) | 0;\n B = (B + this.B) | 0;\n C = (C + this.C) | 0;\n D = (D + this.D) | 0;\n E = (E + this.E) | 0;\n F = (F + this.F) | 0;\n G = (G + this.G) | 0;\n H = (H + this.H) | 0;\n this.set(A, B, C, D, E, F, G, H);\n }\n roundClean() {\n SHA256_W.fill(0);\n }\n destroy() {\n this.set(0, 0, 0, 0, 0, 0, 0, 0);\n this.buffer.fill(0);\n }\n}\n// Constants from https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf\nclass SHA224 extends SHA256 {\n constructor() {\n super();\n this.A = 0xc1059ed8 | 0;\n this.B = 0x367cd507 | 0;\n this.C = 0x3070dd17 | 0;\n this.D = 0xf70e5939 | 0;\n this.E = 0xffc00b31 | 0;\n this.F = 0x68581511 | 0;\n this.G = 0x64f98fa7 | 0;\n this.H = 0xbefa4fa4 | 0;\n this.outputLen = 28;\n }\n}\n/**\n * SHA2-256 hash function\n * @param message - data that would be hashed\n */\nexport const sha256 = wrapConstructor(() => new SHA256());\nexport const sha224 = wrapConstructor(() => new SHA224());\n//# sourceMappingURL=sha256.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// Utilities for modular arithmetics and finite fields\nimport { bitMask, numberToBytesBE, numberToBytesLE, bytesToNumberBE, bytesToNumberLE, ensureBytes, validateObject, } from './utils.js';\n// prettier-ignore\nconst _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3);\n// prettier-ignore\nconst _4n = BigInt(4), _5n = BigInt(5), _8n = BigInt(8);\n// prettier-ignore\nconst _9n = BigInt(9), _16n = BigInt(16);\n// Calculates a modulo b\nexport function mod(a, b) {\n const result = a % b;\n return result >= _0n ? result : b + result;\n}\n/**\n * Efficiently raise num to power and do modular division.\n * Unsafe in some contexts: uses ladder, so can expose bigint bits.\n * @example\n * pow(2n, 6n, 11n) // 64n % 11n == 9n\n */\n// TODO: use field version && remove\nexport function pow(num, power, modulo) {\n if (modulo <= _0n || power < _0n)\n throw new Error('Expected power/modulo > 0');\n if (modulo === _1n)\n return _0n;\n let res = _1n;\n while (power > _0n) {\n if (power & _1n)\n res = (res * num) % modulo;\n num = (num * num) % modulo;\n power >>= _1n;\n }\n return res;\n}\n// Does x ^ (2 ^ power) mod p. pow2(30, 4) == 30 ^ (2 ^ 4)\nexport function pow2(x, power, modulo) {\n let res = x;\n while (power-- > _0n) {\n res *= res;\n res %= modulo;\n }\n return res;\n}\n// Inverses number over modulo\nexport function invert(number, modulo) {\n if (number === _0n || modulo <= _0n) {\n throw new Error(`invert: expected positive integers, got n=${number} mod=${modulo}`);\n }\n // Euclidean GCD https://brilliant.org/wiki/extended-euclidean-algorithm/\n // Fermat's little theorem \"CT-like\" version inv(n) = n^(m-2) mod m is 30x slower.\n let a = mod(number, modulo);\n let b = modulo;\n // prettier-ignore\n let x = _0n, y = _1n, u = _1n, v = _0n;\n while (a !== _0n) {\n // JIT applies optimization if those two lines follow each other\n const q = b / a;\n const r = b % a;\n const m = x - u * q;\n const n = y - v * q;\n // prettier-ignore\n b = a, a = r, x = u, y = v, u = m, v = n;\n }\n const gcd = b;\n if (gcd !== _1n)\n throw new Error('invert: does not exist');\n return mod(x, modulo);\n}\n// Tonelli-Shanks algorithm\n// Paper 1: https://eprint.iacr.org/2012/685.pdf (page 12)\n// Paper 2: Square Roots from 1; 24, 51, 10 to Dan Shanks\nexport function tonelliShanks(P) {\n // Legendre constant: used to calculate Legendre symbol (a | p),\n // which denotes the value of a^((p-1)/2) (mod p).\n // (a | p) ≡ 1 if a is a square (mod p)\n // (a | p) ≡ -1 if a is not a square (mod p)\n // (a | p) ≡ 0 if a ≡ 0 (mod p)\n const legendreC = (P - _1n) / _2n;\n let Q, S, Z;\n // Step 1: By factoring out powers of 2 from p - 1,\n // find q and s such that p - 1 = q*(2^s) with q odd\n for (Q = P - _1n, S = 0; Q % _2n === _0n; Q /= _2n, S++)\n ;\n // Step 2: Select a non-square z such that (z | p) ≡ -1 and set c ≡ zq\n for (Z = _2n; Z < P && pow(Z, legendreC, P) !== P - _1n; Z++)\n ;\n // Fast-path\n if (S === 1) {\n const p1div4 = (P + _1n) / _4n;\n return function tonelliFast(Fp, n) {\n const root = Fp.pow(n, p1div4);\n if (!Fp.eql(Fp.sqr(root), n))\n throw new Error('Cannot find square root');\n return root;\n };\n }\n // Slow-path\n const Q1div2 = (Q + _1n) / _2n;\n return function tonelliSlow(Fp, n) {\n // Step 0: Check that n is indeed a square: (n | p) should not be ≡ -1\n if (Fp.pow(n, legendreC) === Fp.neg(Fp.ONE))\n throw new Error('Cannot find square root');\n let r = S;\n // TODO: will fail at Fp2/etc\n let g = Fp.pow(Fp.mul(Fp.ONE, Z), Q); // will update both x and b\n let x = Fp.pow(n, Q1div2); // first guess at the square root\n let b = Fp.pow(n, Q); // first guess at the fudge factor\n while (!Fp.eql(b, Fp.ONE)) {\n if (Fp.eql(b, Fp.ZERO))\n return Fp.ZERO; // https://en.wikipedia.org/wiki/Tonelli%E2%80%93Shanks_algorithm (4. If t = 0, return r = 0)\n // Find m such b^(2^m)==1\n let m = 1;\n for (let t2 = Fp.sqr(b); m < r; m++) {\n if (Fp.eql(t2, Fp.ONE))\n break;\n t2 = Fp.sqr(t2); // t2 *= t2\n }\n // NOTE: r-m-1 can be bigger than 32, need to convert to bigint before shift, otherwise there will be overflow\n const ge = Fp.pow(g, _1n << BigInt(r - m - 1)); // ge = 2^(r-m-1)\n g = Fp.sqr(ge); // g = ge * ge\n x = Fp.mul(x, ge); // x *= ge\n b = Fp.mul(b, g); // b *= g\n r = m;\n }\n return x;\n };\n}\nexport function FpSqrt(P) {\n // NOTE: different algorithms can give different roots, it is up to user to decide which one they want.\n // For example there is FpSqrtOdd/FpSqrtEven to choice root based on oddness (used for hash-to-curve).\n // P ≡ 3 (mod 4)\n // √n = n^((P+1)/4)\n if (P % _4n === _3n) {\n // Not all roots possible!\n // const ORDER =\n // 0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaabn;\n // const NUM = 72057594037927816n;\n const p1div4 = (P + _1n) / _4n;\n return function sqrt3mod4(Fp, n) {\n const root = Fp.pow(n, p1div4);\n // Throw if root**2 != n\n if (!Fp.eql(Fp.sqr(root), n))\n throw new Error('Cannot find square root');\n return root;\n };\n }\n // Atkin algorithm for q ≡ 5 (mod 8), https://eprint.iacr.org/2012/685.pdf (page 10)\n if (P % _8n === _5n) {\n const c1 = (P - _5n) / _8n;\n return function sqrt5mod8(Fp, n) {\n const n2 = Fp.mul(n, _2n);\n const v = Fp.pow(n2, c1);\n const nv = Fp.mul(n, v);\n const i = Fp.mul(Fp.mul(nv, _2n), v);\n const root = Fp.mul(nv, Fp.sub(i, Fp.ONE));\n if (!Fp.eql(Fp.sqr(root), n))\n throw new Error('Cannot find square root');\n return root;\n };\n }\n // P ≡ 9 (mod 16)\n if (P % _16n === _9n) {\n // NOTE: tonelli is too slow for bls-Fp2 calculations even on start\n // Means we cannot use sqrt for constants at all!\n //\n // const c1 = Fp.sqrt(Fp.negate(Fp.ONE)); // 1. c1 = sqrt(-1) in F, i.e., (c1^2) == -1 in F\n // const c2 = Fp.sqrt(c1); // 2. c2 = sqrt(c1) in F, i.e., (c2^2) == c1 in F\n // const c3 = Fp.sqrt(Fp.negate(c1)); // 3. c3 = sqrt(-c1) in F, i.e., (c3^2) == -c1 in F\n // const c4 = (P + _7n) / _16n; // 4. c4 = (q + 7) / 16 # Integer arithmetic\n // sqrt = (x) => {\n // let tv1 = Fp.pow(x, c4); // 1. tv1 = x^c4\n // let tv2 = Fp.mul(c1, tv1); // 2. tv2 = c1 * tv1\n // const tv3 = Fp.mul(c2, tv1); // 3. tv3 = c2 * tv1\n // let tv4 = Fp.mul(c3, tv1); // 4. tv4 = c3 * tv1\n // const e1 = Fp.equals(Fp.square(tv2), x); // 5. e1 = (tv2^2) == x\n // const e2 = Fp.equals(Fp.square(tv3), x); // 6. e2 = (tv3^2) == x\n // tv1 = Fp.cmov(tv1, tv2, e1); // 7. tv1 = CMOV(tv1, tv2, e1) # Select tv2 if (tv2^2) == x\n // tv2 = Fp.cmov(tv4, tv3, e2); // 8. tv2 = CMOV(tv4, tv3, e2) # Select tv3 if (tv3^2) == x\n // const e3 = Fp.equals(Fp.square(tv2), x); // 9. e3 = (tv2^2) == x\n // return Fp.cmov(tv1, tv2, e3); // 10. z = CMOV(tv1, tv2, e3) # Select the sqrt from tv1 and tv2\n // }\n }\n // Other cases: Tonelli-Shanks algorithm\n return tonelliShanks(P);\n}\n// Little-endian check for first LE bit (last BE bit);\nexport const isNegativeLE = (num, modulo) => (mod(num, modulo) & _1n) === _1n;\n// prettier-ignore\nconst FIELD_FIELDS = [\n 'create', 'isValid', 'is0', 'neg', 'inv', 'sqrt', 'sqr',\n 'eql', 'add', 'sub', 'mul', 'pow', 'div',\n 'addN', 'subN', 'mulN', 'sqrN'\n];\nexport function validateField(field) {\n const initial = {\n ORDER: 'bigint',\n MASK: 'bigint',\n BYTES: 'isSafeInteger',\n BITS: 'isSafeInteger',\n };\n const opts = FIELD_FIELDS.reduce((map, val) => {\n map[val] = 'function';\n return map;\n }, initial);\n return validateObject(field, opts);\n}\n// Generic field functions\nexport function FpPow(f, num, power) {\n // Should have same speed as pow for bigints\n // TODO: benchmark!\n if (power < _0n)\n throw new Error('Expected power > 0');\n if (power === _0n)\n return f.ONE;\n if (power === _1n)\n return num;\n let p = f.ONE;\n let d = num;\n while (power > _0n) {\n if (power & _1n)\n p = f.mul(p, d);\n d = f.sqr(d);\n power >>= _1n;\n }\n return p;\n}\n// 0 is non-invertible: non-batched version will throw on 0\nexport function FpInvertBatch(f, nums) {\n const tmp = new Array(nums.length);\n // Walk from first to last, multiply them by each other MOD p\n const lastMultiplied = nums.reduce((acc, num, i) => {\n if (f.is0(num))\n return acc;\n tmp[i] = acc;\n return f.mul(acc, num);\n }, f.ONE);\n // Invert last element\n const inverted = f.inv(lastMultiplied);\n // Walk from last to first, multiply them by inverted each other MOD p\n nums.reduceRight((acc, num, i) => {\n if (f.is0(num))\n return acc;\n tmp[i] = f.mul(acc, tmp[i]);\n return f.mul(acc, num);\n }, inverted);\n return tmp;\n}\nexport function FpDiv(f, lhs, rhs) {\n return f.mul(lhs, typeof rhs === 'bigint' ? invert(rhs, f.ORDER) : f.inv(rhs));\n}\n// This function returns True whenever the value x is a square in the field F.\nexport function FpIsSquare(f) {\n const legendreConst = (f.ORDER - _1n) / _2n; // Integer arithmetic\n return (x) => {\n const p = f.pow(x, legendreConst);\n return f.eql(p, f.ZERO) || f.eql(p, f.ONE);\n };\n}\n// CURVE.n lengths\nexport function nLength(n, nBitLength) {\n // Bit size, byte size of CURVE.n\n const _nBitLength = nBitLength !== undefined ? nBitLength : n.toString(2).length;\n const nByteLength = Math.ceil(_nBitLength / 8);\n return { nBitLength: _nBitLength, nByteLength };\n}\n/**\n * Initializes a galois field over prime. Non-primes are not supported for now.\n * Do not init in loop: slow. Very fragile: always run a benchmark on change.\n * Major performance gains:\n * a) non-normalized operations like mulN instead of mul\n * b) `Object.freeze`\n * c) Same object shape: never add or remove keys\n * @param ORDER prime positive bigint\n * @param bitLen how many bits the field consumes\n * @param isLE (def: false) if encoding / decoding should be in little-endian\n * @param redef optional faster redefinitions of sqrt and other methods\n */\nexport function Field(ORDER, bitLen, isLE = false, redef = {}) {\n if (ORDER <= _0n)\n throw new Error(`Expected Fp ORDER > 0, got ${ORDER}`);\n const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, bitLen);\n if (BYTES > 2048)\n throw new Error('Field lengths over 2048 bytes are not supported');\n const sqrtP = FpSqrt(ORDER);\n const f = Object.freeze({\n ORDER,\n BITS,\n BYTES,\n MASK: bitMask(BITS),\n ZERO: _0n,\n ONE: _1n,\n create: (num) => mod(num, ORDER),\n isValid: (num) => {\n if (typeof num !== 'bigint')\n throw new Error(`Invalid field element: expected bigint, got ${typeof num}`);\n return _0n <= num && num < ORDER; // 0 is valid element, but it's not invertible\n },\n is0: (num) => num === _0n,\n isOdd: (num) => (num & _1n) === _1n,\n neg: (num) => mod(-num, ORDER),\n eql: (lhs, rhs) => lhs === rhs,\n sqr: (num) => mod(num * num, ORDER),\n add: (lhs, rhs) => mod(lhs + rhs, ORDER),\n sub: (lhs, rhs) => mod(lhs - rhs, ORDER),\n mul: (lhs, rhs) => mod(lhs * rhs, ORDER),\n pow: (num, power) => FpPow(f, num, power),\n div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER),\n // Same as above, but doesn't normalize\n sqrN: (num) => num * num,\n addN: (lhs, rhs) => lhs + rhs,\n subN: (lhs, rhs) => lhs - rhs,\n mulN: (lhs, rhs) => lhs * rhs,\n inv: (num) => invert(num, ORDER),\n sqrt: redef.sqrt || ((n) => sqrtP(f, n)),\n invertBatch: (lst) => FpInvertBatch(f, lst),\n // TODO: do we really need constant cmov?\n // We don't have const-time bigints anyway, so probably will be not very useful\n cmov: (a, b, c) => (c ? b : a),\n toBytes: (num) => (isLE ? numberToBytesLE(num, BYTES) : numberToBytesBE(num, BYTES)),\n fromBytes: (bytes) => {\n if (bytes.length !== BYTES)\n throw new Error(`Fp.fromBytes: expected ${BYTES}, got ${bytes.length}`);\n return isLE ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes);\n },\n });\n return Object.freeze(f);\n}\nexport function FpSqrtOdd(Fp, elm) {\n if (!Fp.isOdd)\n throw new Error(`Field doesn't have isOdd`);\n const root = Fp.sqrt(elm);\n return Fp.isOdd(root) ? root : Fp.neg(root);\n}\nexport function FpSqrtEven(Fp, elm) {\n if (!Fp.isOdd)\n throw new Error(`Field doesn't have isOdd`);\n const root = Fp.sqrt(elm);\n return Fp.isOdd(root) ? Fp.neg(root) : root;\n}\n/**\n * FIPS 186 B.4.1-compliant \"constant-time\" private key generation utility.\n * Can take (n+8) or more bytes of uniform input e.g. from CSPRNG or KDF\n * and convert them into private scalar, with the modulo bias being negligible.\n * Needs at least 40 bytes of input for 32-byte private key.\n * https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/\n * @param hash hash output from SHA3 or a similar function\n * @param groupOrder size of subgroup - (e.g. curveFn.CURVE.n)\n * @param isLE interpret hash bytes as LE num\n * @returns valid private scalar\n */\nexport function hashToPrivateScalar(hash, groupOrder, isLE = false) {\n hash = ensureBytes('privateHash', hash);\n const hashLen = hash.length;\n const minLen = nLength(groupOrder).nByteLength + 8;\n if (minLen < 24 || hashLen < minLen || hashLen > 1024)\n throw new Error(`hashToPrivateScalar: expected ${minLen}-1024 bytes of input, got ${hashLen}`);\n const num = isLE ? bytesToNumberLE(hash) : bytesToNumberBE(hash);\n return mod(num, groupOrder - _1n) + _1n;\n}\n//# sourceMappingURL=modular.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// Abelian group utilities\nimport { validateField, nLength } from './modular.js';\nimport { validateObject } from './utils.js';\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\n// Elliptic curve multiplication of Point by scalar. Fragile.\n// Scalars should always be less than curve order: this should be checked inside of a curve itself.\n// Creates precomputation tables for fast multiplication:\n// - private scalar is split by fixed size windows of W bits\n// - every window point is collected from window's table & added to accumulator\n// - since windows are different, same point inside tables won't be accessed more than once per calc\n// - each multiplication is 'Math.ceil(CURVE_ORDER / 𝑊) + 1' point additions (fixed for any scalar)\n// - +1 window is neccessary for wNAF\n// - wNAF reduces table size: 2x less memory + 2x faster generation, but 10% slower multiplication\n// TODO: Research returning 2d JS array of windows, instead of a single window. This would allow\n// windows to be in different memory locations\nexport function wNAF(c, bits) {\n const constTimeNegate = (condition, item) => {\n const neg = item.negate();\n return condition ? neg : item;\n };\n const opts = (W) => {\n const windows = Math.ceil(bits / W) + 1; // +1, because\n const windowSize = 2 ** (W - 1); // -1 because we skip zero\n return { windows, windowSize };\n };\n return {\n constTimeNegate,\n // non-const time multiplication ladder\n unsafeLadder(elm, n) {\n let p = c.ZERO;\n let d = elm;\n while (n > _0n) {\n if (n & _1n)\n p = p.add(d);\n d = d.double();\n n >>= _1n;\n }\n return p;\n },\n /**\n * Creates a wNAF precomputation window. Used for caching.\n * Default window size is set by `utils.precompute()` and is equal to 8.\n * Number of precomputed points depends on the curve size:\n * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where:\n * - 𝑊 is the window size\n * - 𝑛 is the bitlength of the curve order.\n * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224.\n * @returns precomputed point tables flattened to a single array\n */\n precomputeWindow(elm, W) {\n const { windows, windowSize } = opts(W);\n const points = [];\n let p = elm;\n let base = p;\n for (let window = 0; window < windows; window++) {\n base = p;\n points.push(base);\n // =1, because we skip zero\n for (let i = 1; i < windowSize; i++) {\n base = base.add(p);\n points.push(base);\n }\n p = base.double();\n }\n return points;\n },\n /**\n * Implements ec multiplication using precomputed tables and w-ary non-adjacent form.\n * @param W window size\n * @param precomputes precomputed tables\n * @param n scalar (we don't check here, but should be less than curve order)\n * @returns real and fake (for const-time) points\n */\n wNAF(W, precomputes, n) {\n // TODO: maybe check that scalar is less than group order? wNAF behavious is undefined otherwise\n // But need to carefully remove other checks before wNAF. ORDER == bits here\n const { windows, windowSize } = opts(W);\n let p = c.ZERO;\n let f = c.BASE;\n const mask = BigInt(2 ** W - 1); // Create mask with W ones: 0b1111 for W=4 etc.\n const maxNumber = 2 ** W;\n const shiftBy = BigInt(W);\n for (let window = 0; window < windows; window++) {\n const offset = window * windowSize;\n // Extract W bits.\n let wbits = Number(n & mask);\n // Shift number by W bits.\n n >>= shiftBy;\n // If the bits are bigger than max size, we'll split those.\n // +224 => 256 - 32\n if (wbits > windowSize) {\n wbits -= maxNumber;\n n += _1n;\n }\n // This code was first written with assumption that 'f' and 'p' will never be infinity point:\n // since each addition is multiplied by 2 ** W, it cannot cancel each other. However,\n // there is negate now: it is possible that negated element from low value\n // would be the same as high element, which will create carry into next window.\n // It's not obvious how this can fail, but still worth investigating later.\n // Check if we're onto Zero point.\n // Add random point inside current window to f.\n const offset1 = offset;\n const offset2 = offset + Math.abs(wbits) - 1; // -1 because we skip zero\n const cond1 = window % 2 !== 0;\n const cond2 = wbits < 0;\n if (wbits === 0) {\n // The most important part for const-time getPublicKey\n f = f.add(constTimeNegate(cond1, precomputes[offset1]));\n }\n else {\n p = p.add(constTimeNegate(cond2, precomputes[offset2]));\n }\n }\n // JIT-compiler should not eliminate f here, since it will later be used in normalizeZ()\n // Even if the variable is still unused, there are some checks which will\n // throw an exception, so compiler needs to prove they won't happen, which is hard.\n // At this point there is a way to F be infinity-point even if p is not,\n // which makes it less const-time: around 1 bigint multiply.\n return { p, f };\n },\n wNAFCached(P, precomputesMap, n, transform) {\n // @ts-ignore\n const W = P._WINDOW_SIZE || 1;\n // Calculate precomputes on a first run, reuse them after\n let comp = precomputesMap.get(P);\n if (!comp) {\n comp = this.precomputeWindow(P, W);\n if (W !== 1) {\n precomputesMap.set(P, transform(comp));\n }\n }\n return this.wNAF(W, comp, n);\n },\n };\n}\nexport function validateBasic(curve) {\n validateField(curve.Fp);\n validateObject(curve, {\n n: 'bigint',\n h: 'bigint',\n Gx: 'field',\n Gy: 'field',\n }, {\n nBitLength: 'isSafeInteger',\n nByteLength: 'isSafeInteger',\n });\n // Set defaults\n return Object.freeze({\n ...nLength(curve.n, curve.nBitLength),\n ...curve,\n ...{ p: curve.Fp.ORDER },\n });\n}\n//# sourceMappingURL=curve.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// Short Weierstrass curve. The formula is: y² = x³ + ax + b\nimport * as mod from './modular.js';\nimport * as ut from './utils.js';\nimport { ensureBytes } from './utils.js';\nimport { wNAF, validateBasic } from './curve.js';\nfunction validatePointOpts(curve) {\n const opts = validateBasic(curve);\n ut.validateObject(opts, {\n a: 'field',\n b: 'field',\n }, {\n allowedPrivateKeyLengths: 'array',\n wrapPrivateKey: 'boolean',\n isTorsionFree: 'function',\n clearCofactor: 'function',\n allowInfinityPoint: 'boolean',\n fromBytes: 'function',\n toBytes: 'function',\n });\n const { endo, Fp, a } = opts;\n if (endo) {\n if (!Fp.eql(a, Fp.ZERO)) {\n throw new Error('Endomorphism can only be defined for Koblitz curves that have a=0');\n }\n if (typeof endo !== 'object' ||\n typeof endo.beta !== 'bigint' ||\n typeof endo.splitScalar !== 'function') {\n throw new Error('Expected endomorphism with beta: bigint and splitScalar: function');\n }\n }\n return Object.freeze({ ...opts });\n}\n// ASN.1 DER encoding utilities\nconst { bytesToNumberBE: b2n, hexToBytes: h2b } = ut;\nexport const DER = {\n // asn.1 DER encoding utils\n Err: class DERErr extends Error {\n constructor(m = '') {\n super(m);\n }\n },\n _parseInt(data) {\n const { Err: E } = DER;\n if (data.length < 2 || data[0] !== 0x02)\n throw new E('Invalid signature integer tag');\n const len = data[1];\n const res = data.subarray(2, len + 2);\n if (!len || res.length !== len)\n throw new E('Invalid signature integer: wrong length');\n // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag,\n // since we always use positive integers here. It must always be empty:\n // - add zero byte if exists\n // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding)\n if (res[0] & 0b10000000)\n throw new E('Invalid signature integer: negative');\n if (res[0] === 0x00 && !(res[1] & 0b10000000))\n throw new E('Invalid signature integer: unnecessary leading zero');\n return { d: b2n(res), l: data.subarray(len + 2) }; // d is data, l is left\n },\n toSig(hex) {\n // parse DER signature\n const { Err: E } = DER;\n const data = typeof hex === 'string' ? h2b(hex) : hex;\n if (!(data instanceof Uint8Array))\n throw new Error('ui8a expected');\n let l = data.length;\n if (l < 2 || data[0] != 0x30)\n throw new E('Invalid signature tag');\n if (data[1] !== l - 2)\n throw new E('Invalid signature: incorrect length');\n const { d: r, l: sBytes } = DER._parseInt(data.subarray(2));\n const { d: s, l: rBytesLeft } = DER._parseInt(sBytes);\n if (rBytesLeft.length)\n throw new E('Invalid signature: left bytes after parsing');\n return { r, s };\n },\n hexFromSig(sig) {\n // Add leading zero if first byte has negative bit enabled. More details in '_parseInt'\n const slice = (s) => (Number.parseInt(s[0], 16) & 0b1000 ? '00' + s : s);\n const h = (num) => {\n const hex = num.toString(16);\n return hex.length & 1 ? `0${hex}` : hex;\n };\n const s = slice(h(sig.s));\n const r = slice(h(sig.r));\n const shl = s.length / 2;\n const rhl = r.length / 2;\n const sl = h(shl);\n const rl = h(rhl);\n return `30${h(rhl + shl + 4)}02${rl}${r}02${sl}${s}`;\n },\n};\n// Be friendly to bad ECMAScript parsers by not using bigint literals\n// prettier-ignore\nconst _0n = BigInt(0), _1n = BigInt(1), _2n = BigInt(2), _3n = BigInt(3), _4n = BigInt(4);\nexport function weierstrassPoints(opts) {\n const CURVE = validatePointOpts(opts);\n const { Fp } = CURVE; // All curves has same field / group length as for now, but they can differ\n const toBytes = CURVE.toBytes ||\n ((c, point, isCompressed) => {\n const a = point.toAffine();\n return ut.concatBytes(Uint8Array.from([0x04]), Fp.toBytes(a.x), Fp.toBytes(a.y));\n });\n const fromBytes = CURVE.fromBytes ||\n ((bytes) => {\n // const head = bytes[0];\n const tail = bytes.subarray(1);\n // if (head !== 0x04) throw new Error('Only non-compressed encoding is supported');\n const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES));\n const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES));\n return { x, y };\n });\n /**\n * y² = x³ + ax + b: Short weierstrass curve formula\n * @returns y²\n */\n function weierstrassEquation(x) {\n const { a, b } = CURVE;\n const x2 = Fp.sqr(x); // x * x\n const x3 = Fp.mul(x2, x); // x2 * x\n return Fp.add(Fp.add(x3, Fp.mul(x, a)), b); // x3 + a * x + b\n }\n // Validate whether the passed curve params are valid.\n // We check if curve equation works for generator point.\n // `assertValidity()` won't work: `isTorsionFree()` is not available at this point in bls12-381.\n // ProjectivePoint class has not been initialized yet.\n if (!Fp.eql(Fp.sqr(CURVE.Gy), weierstrassEquation(CURVE.Gx)))\n throw new Error('bad generator point: equation left != right');\n // Valid group elements reside in range 1..n-1\n function isWithinCurveOrder(num) {\n return typeof num === 'bigint' && _0n < num && num < CURVE.n;\n }\n function assertGE(num) {\n if (!isWithinCurveOrder(num))\n throw new Error('Expected valid bigint: 0 < bigint < curve.n');\n }\n // Validates if priv key is valid and converts it to bigint.\n // Supports options allowedPrivateKeyLengths and wrapPrivateKey.\n function normPrivateKeyToScalar(key) {\n const { allowedPrivateKeyLengths: lengths, nByteLength, wrapPrivateKey, n } = CURVE;\n if (lengths && typeof key !== 'bigint') {\n if (key instanceof Uint8Array)\n key = ut.bytesToHex(key);\n // Normalize to hex string, pad. E.g. P521 would norm 130-132 char hex to 132-char bytes\n if (typeof key !== 'string' || !lengths.includes(key.length))\n throw new Error('Invalid key');\n key = key.padStart(nByteLength * 2, '0');\n }\n let num;\n try {\n num =\n typeof key === 'bigint'\n ? key\n : ut.bytesToNumberBE(ensureBytes('private key', key, nByteLength));\n }\n catch (error) {\n throw new Error(`private key must be ${nByteLength} bytes, hex or bigint, not ${typeof key}`);\n }\n if (wrapPrivateKey)\n num = mod.mod(num, n); // disabled by default, enabled for BLS\n assertGE(num); // num in range [1..N-1]\n return num;\n }\n const pointPrecomputes = new Map();\n function assertPrjPoint(other) {\n if (!(other instanceof Point))\n throw new Error('ProjectivePoint expected');\n }\n /**\n * Projective Point works in 3d / projective (homogeneous) coordinates: (x, y, z) ∋ (x=x/z, y=y/z)\n * Default Point works in 2d / affine coordinates: (x, y)\n * We're doing calculations in projective, because its operations don't require costly inversion.\n */\n class Point {\n constructor(px, py, pz) {\n this.px = px;\n this.py = py;\n this.pz = pz;\n if (px == null || !Fp.isValid(px))\n throw new Error('x required');\n if (py == null || !Fp.isValid(py))\n throw new Error('y required');\n if (pz == null || !Fp.isValid(pz))\n throw new Error('z required');\n }\n // Does not validate if the point is on-curve.\n // Use fromHex instead, or call assertValidity() later.\n static fromAffine(p) {\n const { x, y } = p || {};\n if (!p || !Fp.isValid(x) || !Fp.isValid(y))\n throw new Error('invalid affine point');\n if (p instanceof Point)\n throw new Error('projective point not allowed');\n const is0 = (i) => Fp.eql(i, Fp.ZERO);\n // fromAffine(x:0, y:0) would produce (x:0, y:0, z:1), but we need (x:0, y:1, z:0)\n if (is0(x) && is0(y))\n return Point.ZERO;\n return new Point(x, y, Fp.ONE);\n }\n get x() {\n return this.toAffine().x;\n }\n get y() {\n return this.toAffine().y;\n }\n /**\n * Takes a bunch of Projective Points but executes only one\n * inversion on all of them. Inversion is very slow operation,\n * so this improves performance massively.\n * Optimization: converts a list of projective points to a list of identical points with Z=1.\n */\n static normalizeZ(points) {\n const toInv = Fp.invertBatch(points.map((p) => p.pz));\n return points.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine);\n }\n /**\n * Converts hash string or Uint8Array to Point.\n * @param hex short/long ECDSA hex\n */\n static fromHex(hex) {\n const P = Point.fromAffine(fromBytes(ensureBytes('pointHex', hex)));\n P.assertValidity();\n return P;\n }\n // Multiplies generator point by privateKey.\n static fromPrivateKey(privateKey) {\n return Point.BASE.multiply(normPrivateKeyToScalar(privateKey));\n }\n // \"Private method\", don't use it directly\n _setWindowSize(windowSize) {\n this._WINDOW_SIZE = windowSize;\n pointPrecomputes.delete(this);\n }\n // A point on curve is valid if it conforms to equation.\n assertValidity() {\n // Zero is valid point too!\n if (this.is0()) {\n if (CURVE.allowInfinityPoint)\n return;\n throw new Error('bad point: ZERO');\n }\n // Some 3rd-party test vectors require different wording between here & `fromCompressedHex`\n const { x, y } = this.toAffine();\n // Check if x, y are valid field elements\n if (!Fp.isValid(x) || !Fp.isValid(y))\n throw new Error('bad point: x or y not FE');\n const left = Fp.sqr(y); // y²\n const right = weierstrassEquation(x); // x³ + ax + b\n if (!Fp.eql(left, right))\n throw new Error('bad point: equation left != right');\n if (!this.isTorsionFree())\n throw new Error('bad point: not in prime-order subgroup');\n }\n hasEvenY() {\n const { y } = this.toAffine();\n if (Fp.isOdd)\n return !Fp.isOdd(y);\n throw new Error(\"Field doesn't support isOdd\");\n }\n /**\n * Compare one point to another.\n */\n equals(other) {\n assertPrjPoint(other);\n const { px: X1, py: Y1, pz: Z1 } = this;\n const { px: X2, py: Y2, pz: Z2 } = other;\n const U1 = Fp.eql(Fp.mul(X1, Z2), Fp.mul(X2, Z1));\n const U2 = Fp.eql(Fp.mul(Y1, Z2), Fp.mul(Y2, Z1));\n return U1 && U2;\n }\n /**\n * Flips point to one corresponding to (x, -y) in Affine coordinates.\n */\n negate() {\n return new Point(this.px, Fp.neg(this.py), this.pz);\n }\n // Renes-Costello-Batina exception-free doubling formula.\n // There is 30% faster Jacobian formula, but it is not complete.\n // https://eprint.iacr.org/2015/1060, algorithm 3\n // Cost: 8M + 3S + 3*a + 2*b3 + 15add.\n double() {\n const { a, b } = CURVE;\n const b3 = Fp.mul(b, _3n);\n const { px: X1, py: Y1, pz: Z1 } = this;\n let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore\n let t0 = Fp.mul(X1, X1); // step 1\n let t1 = Fp.mul(Y1, Y1);\n let t2 = Fp.mul(Z1, Z1);\n let t3 = Fp.mul(X1, Y1);\n t3 = Fp.add(t3, t3); // step 5\n Z3 = Fp.mul(X1, Z1);\n Z3 = Fp.add(Z3, Z3);\n X3 = Fp.mul(a, Z3);\n Y3 = Fp.mul(b3, t2);\n Y3 = Fp.add(X3, Y3); // step 10\n X3 = Fp.sub(t1, Y3);\n Y3 = Fp.add(t1, Y3);\n Y3 = Fp.mul(X3, Y3);\n X3 = Fp.mul(t3, X3);\n Z3 = Fp.mul(b3, Z3); // step 15\n t2 = Fp.mul(a, t2);\n t3 = Fp.sub(t0, t2);\n t3 = Fp.mul(a, t3);\n t3 = Fp.add(t3, Z3);\n Z3 = Fp.add(t0, t0); // step 20\n t0 = Fp.add(Z3, t0);\n t0 = Fp.add(t0, t2);\n t0 = Fp.mul(t0, t3);\n Y3 = Fp.add(Y3, t0);\n t2 = Fp.mul(Y1, Z1); // step 25\n t2 = Fp.add(t2, t2);\n t0 = Fp.mul(t2, t3);\n X3 = Fp.sub(X3, t0);\n Z3 = Fp.mul(t2, t1);\n Z3 = Fp.add(Z3, Z3); // step 30\n Z3 = Fp.add(Z3, Z3);\n return new Point(X3, Y3, Z3);\n }\n // Renes-Costello-Batina exception-free addition formula.\n // There is 30% faster Jacobian formula, but it is not complete.\n // https://eprint.iacr.org/2015/1060, algorithm 1\n // Cost: 12M + 0S + 3*a + 3*b3 + 23add.\n add(other) {\n assertPrjPoint(other);\n const { px: X1, py: Y1, pz: Z1 } = this;\n const { px: X2, py: Y2, pz: Z2 } = other;\n let X3 = Fp.ZERO, Y3 = Fp.ZERO, Z3 = Fp.ZERO; // prettier-ignore\n const a = CURVE.a;\n const b3 = Fp.mul(CURVE.b, _3n);\n let t0 = Fp.mul(X1, X2); // step 1\n let t1 = Fp.mul(Y1, Y2);\n let t2 = Fp.mul(Z1, Z2);\n let t3 = Fp.add(X1, Y1);\n let t4 = Fp.add(X2, Y2); // step 5\n t3 = Fp.mul(t3, t4);\n t4 = Fp.add(t0, t1);\n t3 = Fp.sub(t3, t4);\n t4 = Fp.add(X1, Z1);\n let t5 = Fp.add(X2, Z2); // step 10\n t4 = Fp.mul(t4, t5);\n t5 = Fp.add(t0, t2);\n t4 = Fp.sub(t4, t5);\n t5 = Fp.add(Y1, Z1);\n X3 = Fp.add(Y2, Z2); // step 15\n t5 = Fp.mul(t5, X3);\n X3 = Fp.add(t1, t2);\n t5 = Fp.sub(t5, X3);\n Z3 = Fp.mul(a, t4);\n X3 = Fp.mul(b3, t2); // step 20\n Z3 = Fp.add(X3, Z3);\n X3 = Fp.sub(t1, Z3);\n Z3 = Fp.add(t1, Z3);\n Y3 = Fp.mul(X3, Z3);\n t1 = Fp.add(t0, t0); // step 25\n t1 = Fp.add(t1, t0);\n t2 = Fp.mul(a, t2);\n t4 = Fp.mul(b3, t4);\n t1 = Fp.add(t1, t2);\n t2 = Fp.sub(t0, t2); // step 30\n t2 = Fp.mul(a, t2);\n t4 = Fp.add(t4, t2);\n t0 = Fp.mul(t1, t4);\n Y3 = Fp.add(Y3, t0);\n t0 = Fp.mul(t5, t4); // step 35\n X3 = Fp.mul(t3, X3);\n X3 = Fp.sub(X3, t0);\n t0 = Fp.mul(t3, t1);\n Z3 = Fp.mul(t5, Z3);\n Z3 = Fp.add(Z3, t0); // step 40\n return new Point(X3, Y3, Z3);\n }\n subtract(other) {\n return this.add(other.negate());\n }\n is0() {\n return this.equals(Point.ZERO);\n }\n wNAF(n) {\n return wnaf.wNAFCached(this, pointPrecomputes, n, (comp) => {\n const toInv = Fp.invertBatch(comp.map((p) => p.pz));\n return comp.map((p, i) => p.toAffine(toInv[i])).map(Point.fromAffine);\n });\n }\n /**\n * Non-constant-time multiplication. Uses double-and-add algorithm.\n * It's faster, but should only be used when you don't care about\n * an exposed private key e.g. sig verification, which works over *public* keys.\n */\n multiplyUnsafe(n) {\n const I = Point.ZERO;\n if (n === _0n)\n return I;\n assertGE(n); // Will throw on 0\n if (n === _1n)\n return this;\n const { endo } = CURVE;\n if (!endo)\n return wnaf.unsafeLadder(this, n);\n // Apply endomorphism\n let { k1neg, k1, k2neg, k2 } = endo.splitScalar(n);\n let k1p = I;\n let k2p = I;\n let d = this;\n while (k1 > _0n || k2 > _0n) {\n if (k1 & _1n)\n k1p = k1p.add(d);\n if (k2 & _1n)\n k2p = k2p.add(d);\n d = d.double();\n k1 >>= _1n;\n k2 >>= _1n;\n }\n if (k1neg)\n k1p = k1p.negate();\n if (k2neg)\n k2p = k2p.negate();\n k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz);\n return k1p.add(k2p);\n }\n /**\n * Constant time multiplication.\n * Uses wNAF method. Windowed method may be 10% faster,\n * but takes 2x longer to generate and consumes 2x memory.\n * Uses precomputes when available.\n * Uses endomorphism for Koblitz curves.\n * @param scalar by which the point would be multiplied\n * @returns New point\n */\n multiply(scalar) {\n assertGE(scalar);\n let n = scalar;\n let point, fake; // Fake point is used to const-time mult\n const { endo } = CURVE;\n if (endo) {\n const { k1neg, k1, k2neg, k2 } = endo.splitScalar(n);\n let { p: k1p, f: f1p } = this.wNAF(k1);\n let { p: k2p, f: f2p } = this.wNAF(k2);\n k1p = wnaf.constTimeNegate(k1neg, k1p);\n k2p = wnaf.constTimeNegate(k2neg, k2p);\n k2p = new Point(Fp.mul(k2p.px, endo.beta), k2p.py, k2p.pz);\n point = k1p.add(k2p);\n fake = f1p.add(f2p);\n }\n else {\n const { p, f } = this.wNAF(n);\n point = p;\n fake = f;\n }\n // Normalize `z` for both points, but return only real one\n return Point.normalizeZ([point, fake])[0];\n }\n /**\n * Efficiently calculate `aP + bQ`. Unsafe, can expose private key, if used incorrectly.\n * Not using Strauss-Shamir trick: precomputation tables are faster.\n * The trick could be useful if both P and Q are not G (not in our case).\n * @returns non-zero affine point\n */\n multiplyAndAddUnsafe(Q, a, b) {\n const G = Point.BASE; // No Strauss-Shamir trick: we have 10% faster G precomputes\n const mul = (P, a // Select faster multiply() method\n ) => (a === _0n || a === _1n || !P.equals(G) ? P.multiplyUnsafe(a) : P.multiply(a));\n const sum = mul(this, a).add(mul(Q, b));\n return sum.is0() ? undefined : sum;\n }\n // Converts Projective point to affine (x, y) coordinates.\n // Can accept precomputed Z^-1 - for example, from invertBatch.\n // (x, y, z) ∋ (x=x/z, y=y/z)\n toAffine(iz) {\n const { px: x, py: y, pz: z } = this;\n const is0 = this.is0();\n // If invZ was 0, we return zero point. However we still want to execute\n // all operations, so we replace invZ with a random number, 1.\n if (iz == null)\n iz = is0 ? Fp.ONE : Fp.inv(z);\n const ax = Fp.mul(x, iz);\n const ay = Fp.mul(y, iz);\n const zz = Fp.mul(z, iz);\n if (is0)\n return { x: Fp.ZERO, y: Fp.ZERO };\n if (!Fp.eql(zz, Fp.ONE))\n throw new Error('invZ was invalid');\n return { x: ax, y: ay };\n }\n isTorsionFree() {\n const { h: cofactor, isTorsionFree } = CURVE;\n if (cofactor === _1n)\n return true; // No subgroups, always torsion-free\n if (isTorsionFree)\n return isTorsionFree(Point, this);\n throw new Error('isTorsionFree() has not been declared for the elliptic curve');\n }\n clearCofactor() {\n const { h: cofactor, clearCofactor } = CURVE;\n if (cofactor === _1n)\n return this; // Fast-path\n if (clearCofactor)\n return clearCofactor(Point, this);\n return this.multiplyUnsafe(CURVE.h);\n }\n toRawBytes(isCompressed = true) {\n this.assertValidity();\n return toBytes(Point, this, isCompressed);\n }\n toHex(isCompressed = true) {\n return ut.bytesToHex(this.toRawBytes(isCompressed));\n }\n }\n Point.BASE = new Point(CURVE.Gx, CURVE.Gy, Fp.ONE);\n Point.ZERO = new Point(Fp.ZERO, Fp.ONE, Fp.ZERO);\n const _bits = CURVE.nBitLength;\n const wnaf = wNAF(Point, CURVE.endo ? Math.ceil(_bits / 2) : _bits);\n // Validate if generator point is on curve\n return {\n CURVE,\n ProjectivePoint: Point,\n normPrivateKeyToScalar,\n weierstrassEquation,\n isWithinCurveOrder,\n };\n}\nfunction validateOpts(curve) {\n const opts = validateBasic(curve);\n ut.validateObject(opts, {\n hash: 'hash',\n hmac: 'function',\n randomBytes: 'function',\n }, {\n bits2int: 'function',\n bits2int_modN: 'function',\n lowS: 'boolean',\n });\n return Object.freeze({ lowS: true, ...opts });\n}\nexport function weierstrass(curveDef) {\n const CURVE = validateOpts(curveDef);\n const { Fp, n: CURVE_ORDER } = CURVE;\n const compressedLen = Fp.BYTES + 1; // e.g. 33 for 32\n const uncompressedLen = 2 * Fp.BYTES + 1; // e.g. 65 for 32\n function isValidFieldElement(num) {\n return _0n < num && num < Fp.ORDER; // 0 is banned since it's not invertible FE\n }\n function modN(a) {\n return mod.mod(a, CURVE_ORDER);\n }\n function invN(a) {\n return mod.invert(a, CURVE_ORDER);\n }\n const { ProjectivePoint: Point, normPrivateKeyToScalar, weierstrassEquation, isWithinCurveOrder, } = weierstrassPoints({\n ...CURVE,\n toBytes(c, point, isCompressed) {\n const a = point.toAffine();\n const x = Fp.toBytes(a.x);\n const cat = ut.concatBytes;\n if (isCompressed) {\n return cat(Uint8Array.from([point.hasEvenY() ? 0x02 : 0x03]), x);\n }\n else {\n return cat(Uint8Array.from([0x04]), x, Fp.toBytes(a.y));\n }\n },\n fromBytes(bytes) {\n const len = bytes.length;\n const head = bytes[0];\n const tail = bytes.subarray(1);\n // this.assertValidity() is done inside of fromHex\n if (len === compressedLen && (head === 0x02 || head === 0x03)) {\n const x = ut.bytesToNumberBE(tail);\n if (!isValidFieldElement(x))\n throw new Error('Point is not on curve');\n const y2 = weierstrassEquation(x); // y² = x³ + ax + b\n let y = Fp.sqrt(y2); // y = y² ^ (p+1)/4\n const isYOdd = (y & _1n) === _1n;\n // ECDSA\n const isHeadOdd = (head & 1) === 1;\n if (isHeadOdd !== isYOdd)\n y = Fp.neg(y);\n return { x, y };\n }\n else if (len === uncompressedLen && head === 0x04) {\n const x = Fp.fromBytes(tail.subarray(0, Fp.BYTES));\n const y = Fp.fromBytes(tail.subarray(Fp.BYTES, 2 * Fp.BYTES));\n return { x, y };\n }\n else {\n throw new Error(`Point of length ${len} was invalid. Expected ${compressedLen} compressed bytes or ${uncompressedLen} uncompressed bytes`);\n }\n },\n });\n const numToNByteStr = (num) => ut.bytesToHex(ut.numberToBytesBE(num, CURVE.nByteLength));\n function isBiggerThanHalfOrder(number) {\n const HALF = CURVE_ORDER >> _1n;\n return number > HALF;\n }\n function normalizeS(s) {\n return isBiggerThanHalfOrder(s) ? modN(-s) : s;\n }\n // slice bytes num\n const slcNum = (b, from, to) => ut.bytesToNumberBE(b.slice(from, to));\n /**\n * ECDSA signature with its (r, s) properties. Supports DER & compact representations.\n */\n class Signature {\n constructor(r, s, recovery) {\n this.r = r;\n this.s = s;\n this.recovery = recovery;\n this.assertValidity();\n }\n // pair (bytes of r, bytes of s)\n static fromCompact(hex) {\n const l = CURVE.nByteLength;\n hex = ensureBytes('compactSignature', hex, l * 2);\n return new Signature(slcNum(hex, 0, l), slcNum(hex, l, 2 * l));\n }\n // DER encoded ECDSA signature\n // https://bitcoin.stackexchange.com/questions/57644/what-are-the-parts-of-a-bitcoin-transaction-input-script\n static fromDER(hex) {\n const { r, s } = DER.toSig(ensureBytes('DER', hex));\n return new Signature(r, s);\n }\n assertValidity() {\n // can use assertGE here\n if (!isWithinCurveOrder(this.r))\n throw new Error('r must be 0 < r < CURVE.n');\n if (!isWithinCurveOrder(this.s))\n throw new Error('s must be 0 < s < CURVE.n');\n }\n addRecoveryBit(recovery) {\n return new Signature(this.r, this.s, recovery);\n }\n recoverPublicKey(msgHash) {\n const { r, s, recovery: rec } = this;\n const h = bits2int_modN(ensureBytes('msgHash', msgHash)); // Truncate hash\n if (rec == null || ![0, 1, 2, 3].includes(rec))\n throw new Error('recovery id invalid');\n const radj = rec === 2 || rec === 3 ? r + CURVE.n : r;\n if (radj >= Fp.ORDER)\n throw new Error('recovery id 2 or 3 invalid');\n const prefix = (rec & 1) === 0 ? '02' : '03';\n const R = Point.fromHex(prefix + numToNByteStr(radj));\n const ir = invN(radj); // r^-1\n const u1 = modN(-h * ir); // -hr^-1\n const u2 = modN(s * ir); // sr^-1\n const Q = Point.BASE.multiplyAndAddUnsafe(R, u1, u2); // (sr^-1)R-(hr^-1)G = -(hr^-1)G + (sr^-1)\n if (!Q)\n throw new Error('point at infinify'); // unsafe is fine: no priv data leaked\n Q.assertValidity();\n return Q;\n }\n // Signatures should be low-s, to prevent malleability.\n hasHighS() {\n return isBiggerThanHalfOrder(this.s);\n }\n normalizeS() {\n return this.hasHighS() ? new Signature(this.r, modN(-this.s), this.recovery) : this;\n }\n // DER-encoded\n toDERRawBytes() {\n return ut.hexToBytes(this.toDERHex());\n }\n toDERHex() {\n return DER.hexFromSig({ r: this.r, s: this.s });\n }\n // padded bytes of r, then padded bytes of s\n toCompactRawBytes() {\n return ut.hexToBytes(this.toCompactHex());\n }\n toCompactHex() {\n return numToNByteStr(this.r) + numToNByteStr(this.s);\n }\n }\n const utils = {\n isValidPrivateKey(privateKey) {\n try {\n normPrivateKeyToScalar(privateKey);\n return true;\n }\n catch (error) {\n return false;\n }\n },\n normPrivateKeyToScalar: normPrivateKeyToScalar,\n /**\n * Produces cryptographically secure private key from random of size (nBitLength+64)\n * as per FIPS 186 B.4.1 with modulo bias being neglible.\n */\n randomPrivateKey: () => {\n const rand = CURVE.randomBytes(Fp.BYTES + 8);\n const num = mod.hashToPrivateScalar(rand, CURVE_ORDER);\n return ut.numberToBytesBE(num, CURVE.nByteLength);\n },\n /**\n * Creates precompute table for an arbitrary EC point. Makes point \"cached\".\n * Allows to massively speed-up `point.multiply(scalar)`.\n * @returns cached point\n * @example\n * const fast = utils.precompute(8, ProjectivePoint.fromHex(someonesPubKey));\n * fast.multiply(privKey); // much faster ECDH now\n */\n precompute(windowSize = 8, point = Point.BASE) {\n point._setWindowSize(windowSize);\n point.multiply(BigInt(3)); // 3 is arbitrary, just need any number here\n return point;\n },\n };\n /**\n * Computes public key for a private key. Checks for validity of the private key.\n * @param privateKey private key\n * @param isCompressed whether to return compact (default), or full key\n * @returns Public key, full when isCompressed=false; short when isCompressed=true\n */\n function getPublicKey(privateKey, isCompressed = true) {\n return Point.fromPrivateKey(privateKey).toRawBytes(isCompressed);\n }\n /**\n * Quick and dirty check for item being public key. Does not validate hex, or being on-curve.\n */\n function isProbPub(item) {\n const arr = item instanceof Uint8Array;\n const str = typeof item === 'string';\n const len = (arr || str) && item.length;\n if (arr)\n return len === compressedLen || len === uncompressedLen;\n if (str)\n return len === 2 * compressedLen || len === 2 * uncompressedLen;\n if (item instanceof Point)\n return true;\n return false;\n }\n /**\n * ECDH (Elliptic Curve Diffie Hellman).\n * Computes shared public key from private key and public key.\n * Checks: 1) private key validity 2) shared key is on-curve.\n * Does NOT hash the result.\n * @param privateA private key\n * @param publicB different public key\n * @param isCompressed whether to return compact (default), or full key\n * @returns shared public key\n */\n function getSharedSecret(privateA, publicB, isCompressed = true) {\n if (isProbPub(privateA))\n throw new Error('first arg must be private key');\n if (!isProbPub(publicB))\n throw new Error('second arg must be public key');\n const b = Point.fromHex(publicB); // check for being on-curve\n return b.multiply(normPrivateKeyToScalar(privateA)).toRawBytes(isCompressed);\n }\n // RFC6979: ensure ECDSA msg is X bytes and < N. RFC suggests optional truncating via bits2octets.\n // FIPS 186-4 4.6 suggests the leftmost min(nBitLen, outLen) bits, which matches bits2int.\n // bits2int can produce res>N, we can do mod(res, N) since the bitLen is the same.\n // int2octets can't be used; pads small msgs with 0: unacceptatble for trunc as per RFC vectors\n const bits2int = CURVE.bits2int ||\n function (bytes) {\n // For curves with nBitLength % 8 !== 0: bits2octets(bits2octets(m)) !== bits2octets(m)\n // for some cases, since bytes.length * 8 is not actual bitLength.\n const num = ut.bytesToNumberBE(bytes); // check for == u8 done here\n const delta = bytes.length * 8 - CURVE.nBitLength; // truncate to nBitLength leftmost bits\n return delta > 0 ? num >> BigInt(delta) : num;\n };\n const bits2int_modN = CURVE.bits2int_modN ||\n function (bytes) {\n return modN(bits2int(bytes)); // can't use bytesToNumberBE here\n };\n // NOTE: pads output with zero as per spec\n const ORDER_MASK = ut.bitMask(CURVE.nBitLength);\n /**\n * Converts to bytes. Checks if num in `[0..ORDER_MASK-1]` e.g.: `[0..2^256-1]`.\n */\n function int2octets(num) {\n if (typeof num !== 'bigint')\n throw new Error('bigint expected');\n if (!(_0n <= num && num < ORDER_MASK))\n throw new Error(`bigint expected < 2^${CURVE.nBitLength}`);\n // works with order, can have different size than numToField!\n return ut.numberToBytesBE(num, CURVE.nByteLength);\n }\n // Steps A, D of RFC6979 3.2\n // Creates RFC6979 seed; converts msg/privKey to numbers.\n // Used only in sign, not in verify.\n // NOTE: we cannot assume here that msgHash has same amount of bytes as curve order, this will be wrong at least for P521.\n // Also it can be bigger for P224 + SHA256\n function prepSig(msgHash, privateKey, opts = defaultSigOpts) {\n if (['recovered', 'canonical'].some((k) => k in opts))\n throw new Error('sign() legacy options not supported');\n const { hash, randomBytes } = CURVE;\n let { lowS, prehash, extraEntropy: ent } = opts; // generates low-s sigs by default\n if (lowS == null)\n lowS = true; // RFC6979 3.2: we skip step A, because we already provide hash\n msgHash = ensureBytes('msgHash', msgHash);\n if (prehash)\n msgHash = ensureBytes('prehashed msgHash', hash(msgHash));\n // We can't later call bits2octets, since nested bits2int is broken for curves\n // with nBitLength % 8 !== 0. Because of that, we unwrap it here as int2octets call.\n // const bits2octets = (bits) => int2octets(bits2int_modN(bits))\n const h1int = bits2int_modN(msgHash);\n const d = normPrivateKeyToScalar(privateKey); // validate private key, convert to bigint\n const seedArgs = [int2octets(d), int2octets(h1int)];\n // extraEntropy. RFC6979 3.6: additional k' (optional).\n if (ent != null) {\n // K = HMAC_K(V || 0x00 || int2octets(x) || bits2octets(h1) || k')\n const e = ent === true ? randomBytes(Fp.BYTES) : ent; // generate random bytes OR pass as-is\n seedArgs.push(ensureBytes('extraEntropy', e, Fp.BYTES)); // check for being of size BYTES\n }\n const seed = ut.concatBytes(...seedArgs); // Step D of RFC6979 3.2\n const m = h1int; // NOTE: no need to call bits2int second time here, it is inside truncateHash!\n // Converts signature params into point w r/s, checks result for validity.\n function k2sig(kBytes) {\n // RFC 6979 Section 3.2, step 3: k = bits2int(T)\n const k = bits2int(kBytes); // Cannot use fields methods, since it is group element\n if (!isWithinCurveOrder(k))\n return; // Important: all mod() calls here must be done over N\n const ik = invN(k); // k^-1 mod n\n const q = Point.BASE.multiply(k).toAffine(); // q = Gk\n const r = modN(q.x); // r = q.x mod n\n if (r === _0n)\n return;\n // Can use scalar blinding b^-1(bm + bdr) where b ∈ [1,q−1] according to\n // https://tches.iacr.org/index.php/TCHES/article/view/7337/6509. We've decided against it:\n // a) dependency on CSPRNG b) 15% slowdown c) doesn't really help since bigints are not CT\n const s = modN(ik * modN(m + r * d)); // Not using blinding here\n if (s === _0n)\n return;\n let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n); // recovery bit (2 or 3, when q.x > n)\n let normS = s;\n if (lowS && isBiggerThanHalfOrder(s)) {\n normS = normalizeS(s); // if lowS was passed, ensure s is always\n recovery ^= 1; // // in the bottom half of N\n }\n return new Signature(r, normS, recovery); // use normS, not s\n }\n return { seed, k2sig };\n }\n const defaultSigOpts = { lowS: CURVE.lowS, prehash: false };\n const defaultVerOpts = { lowS: CURVE.lowS, prehash: false };\n /**\n * Signs message hash with a private key.\n * ```\n * sign(m, d, k) where\n * (x, y) = G × k\n * r = x mod n\n * s = (m + dr)/k mod n\n * ```\n * @param msgHash NOT message. msg needs to be hashed to `msgHash`, or use `prehash`.\n * @param privKey private key\n * @param opts lowS for non-malleable sigs. extraEntropy for mixing randomness into k. prehash will hash first arg.\n * @returns signature with recovery param\n */\n function sign(msgHash, privKey, opts = defaultSigOpts) {\n const { seed, k2sig } = prepSig(msgHash, privKey, opts); // Steps A, D of RFC6979 3.2.\n const C = CURVE;\n const drbg = ut.createHmacDrbg(C.hash.outputLen, C.nByteLength, C.hmac);\n return drbg(seed, k2sig); // Steps B, C, D, E, F, G\n }\n // Enable precomputes. Slows down first publicKey computation by 20ms.\n Point.BASE._setWindowSize(8);\n // utils.precompute(8, ProjectivePoint.BASE)\n /**\n * Verifies a signature against message hash and public key.\n * Rejects lowS signatures by default: to override,\n * specify option `{lowS: false}`. Implements section 4.1.4 from https://www.secg.org/sec1-v2.pdf:\n *\n * ```\n * verify(r, s, h, P) where\n * U1 = hs^-1 mod n\n * U2 = rs^-1 mod n\n * R = U1⋅G - U2⋅P\n * mod(R.x, n) == r\n * ```\n */\n function verify(signature, msgHash, publicKey, opts = defaultVerOpts) {\n const sg = signature;\n msgHash = ensureBytes('msgHash', msgHash);\n publicKey = ensureBytes('publicKey', publicKey);\n if ('strict' in opts)\n throw new Error('options.strict was renamed to lowS');\n const { lowS, prehash } = opts;\n let _sig = undefined;\n let P;\n try {\n if (typeof sg === 'string' || sg instanceof Uint8Array) {\n // Signature can be represented in 2 ways: compact (2*nByteLength) & DER (variable-length).\n // Since DER can also be 2*nByteLength bytes, we check for it first.\n try {\n _sig = Signature.fromDER(sg);\n }\n catch (derError) {\n if (!(derError instanceof DER.Err))\n throw derError;\n _sig = Signature.fromCompact(sg);\n }\n }\n else if (typeof sg === 'object' && typeof sg.r === 'bigint' && typeof sg.s === 'bigint') {\n const { r, s } = sg;\n _sig = new Signature(r, s);\n }\n else {\n throw new Error('PARSE');\n }\n P = Point.fromHex(publicKey);\n }\n catch (error) {\n if (error.message === 'PARSE')\n throw new Error(`signature must be Signature instance, Uint8Array or hex string`);\n return false;\n }\n if (lowS && _sig.hasHighS())\n return false;\n if (prehash)\n msgHash = CURVE.hash(msgHash);\n const { r, s } = _sig;\n const h = bits2int_modN(msgHash); // Cannot use fields methods, since it is group element\n const is = invN(s); // s^-1\n const u1 = modN(h * is); // u1 = hs^-1 mod n\n const u2 = modN(r * is); // u2 = rs^-1 mod n\n const R = Point.BASE.multiplyAndAddUnsafe(P, u1, u2)?.toAffine(); // R = u1⋅G + u2⋅P\n if (!R)\n return false;\n const v = modN(R.x);\n return v === r;\n }\n return {\n CURVE,\n getPublicKey,\n getSharedSecret,\n sign,\n verify,\n ProjectivePoint: Point,\n Signature,\n utils,\n };\n}\n/**\n * Implementation of the Shallue and van de Woestijne method for any weierstrass curve.\n * TODO: check if there is a way to merge this with uvRatio in Edwards; move to modular.\n * b = True and y = sqrt(u / v) if (u / v) is square in F, and\n * b = False and y = sqrt(Z * (u / v)) otherwise.\n * @param Fp\n * @param Z\n * @returns\n */\nexport function SWUFpSqrtRatio(Fp, Z) {\n // Generic implementation\n const q = Fp.ORDER;\n let l = _0n;\n for (let o = q - _1n; o % _2n === _0n; o /= _2n)\n l += _1n;\n const c1 = l; // 1. c1, the largest integer such that 2^c1 divides q - 1.\n // We need 2n ** c1 and 2n ** (c1-1). We can't use **; but we can use <<.\n // 2n ** c1 == 2n << (c1-1)\n const _2n_pow_c1_1 = _2n << (c1 - _1n - _1n);\n const _2n_pow_c1 = _2n_pow_c1_1 * _2n;\n const c2 = (q - _1n) / _2n_pow_c1; // 2. c2 = (q - 1) / (2^c1) # Integer arithmetic\n const c3 = (c2 - _1n) / _2n; // 3. c3 = (c2 - 1) / 2 # Integer arithmetic\n const c4 = _2n_pow_c1 - _1n; // 4. c4 = 2^c1 - 1 # Integer arithmetic\n const c5 = _2n_pow_c1_1; // 5. c5 = 2^(c1 - 1) # Integer arithmetic\n const c6 = Fp.pow(Z, c2); // 6. c6 = Z^c2\n const c7 = Fp.pow(Z, (c2 + _1n) / _2n); // 7. c7 = Z^((c2 + 1) / 2)\n let sqrtRatio = (u, v) => {\n let tv1 = c6; // 1. tv1 = c6\n let tv2 = Fp.pow(v, c4); // 2. tv2 = v^c4\n let tv3 = Fp.sqr(tv2); // 3. tv3 = tv2^2\n tv3 = Fp.mul(tv3, v); // 4. tv3 = tv3 * v\n let tv5 = Fp.mul(u, tv3); // 5. tv5 = u * tv3\n tv5 = Fp.pow(tv5, c3); // 6. tv5 = tv5^c3\n tv5 = Fp.mul(tv5, tv2); // 7. tv5 = tv5 * tv2\n tv2 = Fp.mul(tv5, v); // 8. tv2 = tv5 * v\n tv3 = Fp.mul(tv5, u); // 9. tv3 = tv5 * u\n let tv4 = Fp.mul(tv3, tv2); // 10. tv4 = tv3 * tv2\n tv5 = Fp.pow(tv4, c5); // 11. tv5 = tv4^c5\n let isQR = Fp.eql(tv5, Fp.ONE); // 12. isQR = tv5 == 1\n tv2 = Fp.mul(tv3, c7); // 13. tv2 = tv3 * c7\n tv5 = Fp.mul(tv4, tv1); // 14. tv5 = tv4 * tv1\n tv3 = Fp.cmov(tv2, tv3, isQR); // 15. tv3 = CMOV(tv2, tv3, isQR)\n tv4 = Fp.cmov(tv5, tv4, isQR); // 16. tv4 = CMOV(tv5, tv4, isQR)\n // 17. for i in (c1, c1 - 1, ..., 2):\n for (let i = c1; i > _1n; i--) {\n let tv5 = i - _2n; // 18. tv5 = i - 2\n tv5 = _2n << (tv5 - _1n); // 19. tv5 = 2^tv5\n let tvv5 = Fp.pow(tv4, tv5); // 20. tv5 = tv4^tv5\n const e1 = Fp.eql(tvv5, Fp.ONE); // 21. e1 = tv5 == 1\n tv2 = Fp.mul(tv3, tv1); // 22. tv2 = tv3 * tv1\n tv1 = Fp.mul(tv1, tv1); // 23. tv1 = tv1 * tv1\n tvv5 = Fp.mul(tv4, tv1); // 24. tv5 = tv4 * tv1\n tv3 = Fp.cmov(tv2, tv3, e1); // 25. tv3 = CMOV(tv2, tv3, e1)\n tv4 = Fp.cmov(tvv5, tv4, e1); // 26. tv4 = CMOV(tv5, tv4, e1)\n }\n return { isValid: isQR, value: tv3 };\n };\n if (Fp.ORDER % _4n === _3n) {\n // sqrt_ratio_3mod4(u, v)\n const c1 = (Fp.ORDER - _3n) / _4n; // 1. c1 = (q - 3) / 4 # Integer arithmetic\n const c2 = Fp.sqrt(Fp.neg(Z)); // 2. c2 = sqrt(-Z)\n sqrtRatio = (u, v) => {\n let tv1 = Fp.sqr(v); // 1. tv1 = v^2\n const tv2 = Fp.mul(u, v); // 2. tv2 = u * v\n tv1 = Fp.mul(tv1, tv2); // 3. tv1 = tv1 * tv2\n let y1 = Fp.pow(tv1, c1); // 4. y1 = tv1^c1\n y1 = Fp.mul(y1, tv2); // 5. y1 = y1 * tv2\n const y2 = Fp.mul(y1, c2); // 6. y2 = y1 * c2\n const tv3 = Fp.mul(Fp.sqr(y1), v); // 7. tv3 = y1^2; 8. tv3 = tv3 * v\n const isQR = Fp.eql(tv3, u); // 9. isQR = tv3 == u\n let y = Fp.cmov(y2, y1, isQR); // 10. y = CMOV(y2, y1, isQR)\n return { isValid: isQR, value: y }; // 11. return (isQR, y) isQR ? y : y*c2\n };\n }\n // No curves uses that\n // if (Fp.ORDER % _8n === _5n) // sqrt_ratio_5mod8\n return sqrtRatio;\n}\n/**\n * From draft-irtf-cfrg-hash-to-curve-16\n */\nexport function mapToCurveSimpleSWU(Fp, opts) {\n mod.validateField(Fp);\n if (!Fp.isValid(opts.A) || !Fp.isValid(opts.B) || !Fp.isValid(opts.Z))\n throw new Error('mapToCurveSimpleSWU: invalid opts');\n const sqrtRatio = SWUFpSqrtRatio(Fp, opts.Z);\n if (!Fp.isOdd)\n throw new Error('Fp.isOdd is not implemented!');\n // Input: u, an element of F.\n // Output: (x, y), a point on E.\n return (u) => {\n // prettier-ignore\n let tv1, tv2, tv3, tv4, tv5, tv6, x, y;\n tv1 = Fp.sqr(u); // 1. tv1 = u^2\n tv1 = Fp.mul(tv1, opts.Z); // 2. tv1 = Z * tv1\n tv2 = Fp.sqr(tv1); // 3. tv2 = tv1^2\n tv2 = Fp.add(tv2, tv1); // 4. tv2 = tv2 + tv1\n tv3 = Fp.add(tv2, Fp.ONE); // 5. tv3 = tv2 + 1\n tv3 = Fp.mul(tv3, opts.B); // 6. tv3 = B * tv3\n tv4 = Fp.cmov(opts.Z, Fp.neg(tv2), !Fp.eql(tv2, Fp.ZERO)); // 7. tv4 = CMOV(Z, -tv2, tv2 != 0)\n tv4 = Fp.mul(tv4, opts.A); // 8. tv4 = A * tv4\n tv2 = Fp.sqr(tv3); // 9. tv2 = tv3^2\n tv6 = Fp.sqr(tv4); // 10. tv6 = tv4^2\n tv5 = Fp.mul(tv6, opts.A); // 11. tv5 = A * tv6\n tv2 = Fp.add(tv2, tv5); // 12. tv2 = tv2 + tv5\n tv2 = Fp.mul(tv2, tv3); // 13. tv2 = tv2 * tv3\n tv6 = Fp.mul(tv6, tv4); // 14. tv6 = tv6 * tv4\n tv5 = Fp.mul(tv6, opts.B); // 15. tv5 = B * tv6\n tv2 = Fp.add(tv2, tv5); // 16. tv2 = tv2 + tv5\n x = Fp.mul(tv1, tv3); // 17. x = tv1 * tv3\n const { isValid, value } = sqrtRatio(tv2, tv6); // 18. (is_gx1_square, y1) = sqrt_ratio(tv2, tv6)\n y = Fp.mul(tv1, u); // 19. y = tv1 * u -> Z * u^3 * y1\n y = Fp.mul(y, value); // 20. y = y * y1\n x = Fp.cmov(x, tv3, isValid); // 21. x = CMOV(x, tv3, is_gx1_square)\n y = Fp.cmov(y, value, isValid); // 22. y = CMOV(y, y1, is_gx1_square)\n const e1 = Fp.isOdd(u) === Fp.isOdd(y); // 23. e1 = sgn0(u) == sgn0(y)\n y = Fp.cmov(Fp.neg(y), y, e1); // 24. y = CMOV(-y, y, e1)\n x = Fp.div(x, tv4); // 25. x = x / tv4\n return { x, y };\n };\n}\n//# sourceMappingURL=weierstrass.js.map","import assert from './_assert.js';\nimport { Hash, toBytes } from './utils.js';\n// HMAC (RFC 2104)\nexport class HMAC extends Hash {\n constructor(hash, _key) {\n super();\n this.finished = false;\n this.destroyed = false;\n assert.hash(hash);\n const key = toBytes(_key);\n this.iHash = hash.create();\n if (typeof this.iHash.update !== 'function')\n throw new Error('Expected instance of class which extends utils.Hash');\n this.blockLen = this.iHash.blockLen;\n this.outputLen = this.iHash.outputLen;\n const blockLen = this.blockLen;\n const pad = new Uint8Array(blockLen);\n // blockLen can be bigger than outputLen\n pad.set(key.length > blockLen ? hash.create().update(key).digest() : key);\n for (let i = 0; i < pad.length; i++)\n pad[i] ^= 0x36;\n this.iHash.update(pad);\n // By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone\n this.oHash = hash.create();\n // Undo internal XOR && apply outer XOR\n for (let i = 0; i < pad.length; i++)\n pad[i] ^= 0x36 ^ 0x5c;\n this.oHash.update(pad);\n pad.fill(0);\n }\n update(buf) {\n assert.exists(this);\n this.iHash.update(buf);\n return this;\n }\n digestInto(out) {\n assert.exists(this);\n assert.bytes(out, this.outputLen);\n this.finished = true;\n this.iHash.digestInto(out);\n this.oHash.update(out);\n this.oHash.digestInto(out);\n this.destroy();\n }\n digest() {\n const out = new Uint8Array(this.oHash.outputLen);\n this.digestInto(out);\n return out;\n }\n _cloneInto(to) {\n // Create new instance without calling constructor since key already in state and we don't know it.\n to || (to = Object.create(Object.getPrototypeOf(this), {}));\n const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this;\n to = to;\n to.finished = finished;\n to.destroyed = destroyed;\n to.blockLen = blockLen;\n to.outputLen = outputLen;\n to.oHash = oHash._cloneInto(to.oHash);\n to.iHash = iHash._cloneInto(to.iHash);\n return to;\n }\n destroy() {\n this.destroyed = true;\n this.oHash.destroy();\n this.iHash.destroy();\n }\n}\n/**\n * HMAC: RFC2104 message authentication code.\n * @param hash - function that would be used e.g. sha256\n * @param key - message key\n * @param message - message data\n */\nexport const hmac = (hash, key, message) => new HMAC(hash, key).update(message).digest();\nhmac.create = (hash, key) => new HMAC(hash, key);\n//# sourceMappingURL=hmac.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nimport { hmac } from '@noble/hashes/hmac';\nimport { concatBytes, randomBytes } from '@noble/hashes/utils';\nimport { weierstrass } from './abstract/weierstrass.js';\n// connects noble-curves to noble-hashes\nexport function getHash(hash) {\n return {\n hash,\n hmac: (key, ...msgs) => hmac(hash, key, concatBytes(...msgs)),\n randomBytes,\n };\n}\nexport function createCurve(curveDef, defHash) {\n const create = (hash) => weierstrass({ ...curveDef, ...getHash(hash) });\n return Object.freeze({ ...create(defHash), create });\n}\n//# sourceMappingURL=_shortw_utils.js.map","/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nimport { sha256 } from '@noble/hashes/sha256';\nimport { randomBytes } from '@noble/hashes/utils';\nimport { Field, mod, pow2 } from './abstract/modular.js';\nimport { mapToCurveSimpleSWU } from './abstract/weierstrass.js';\nimport { bytesToNumberBE, concatBytes, ensureBytes, numberToBytesBE } from './abstract/utils.js';\nimport { createHasher, isogenyMap } from './abstract/hash-to-curve.js';\nimport { createCurve } from './_shortw_utils.js';\nconst secp256k1P = BigInt('0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f');\nconst secp256k1N = BigInt('0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141');\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst divNearest = (a, b) => (a + b / _2n) / b;\n/**\n * √n = n^((p+1)/4) for fields p = 3 mod 4. We unwrap the loop and multiply bit-by-bit.\n * (P+1n/4n).toString(2) would produce bits [223x 1, 0, 22x 1, 4x 0, 11, 00]\n */\nfunction sqrtMod(y) {\n const P = secp256k1P;\n // prettier-ignore\n const _3n = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22);\n // prettier-ignore\n const _23n = BigInt(23), _44n = BigInt(44), _88n = BigInt(88);\n const b2 = (y * y * y) % P; // x^3, 11\n const b3 = (b2 * b2 * y) % P; // x^7\n const b6 = (pow2(b3, _3n, P) * b3) % P;\n const b9 = (pow2(b6, _3n, P) * b3) % P;\n const b11 = (pow2(b9, _2n, P) * b2) % P;\n const b22 = (pow2(b11, _11n, P) * b11) % P;\n const b44 = (pow2(b22, _22n, P) * b22) % P;\n const b88 = (pow2(b44, _44n, P) * b44) % P;\n const b176 = (pow2(b88, _88n, P) * b88) % P;\n const b220 = (pow2(b176, _44n, P) * b44) % P;\n const b223 = (pow2(b220, _3n, P) * b3) % P;\n const t1 = (pow2(b223, _23n, P) * b22) % P;\n const t2 = (pow2(t1, _6n, P) * b2) % P;\n const root = pow2(t2, _2n, P);\n if (!Fp.eql(Fp.sqr(root), y))\n throw new Error('Cannot find square root');\n return root;\n}\nconst Fp = Field(secp256k1P, undefined, undefined, { sqrt: sqrtMod });\nexport const secp256k1 = createCurve({\n a: BigInt(0),\n b: BigInt(7),\n Fp,\n n: secp256k1N,\n // Base point (x, y) aka generator point\n Gx: BigInt('55066263022277343669578718895168534326250603453777594175500187360389116729240'),\n Gy: BigInt('32670510020758816978083085130507043184471273380659243275938904335757337482424'),\n h: BigInt(1),\n lowS: true,\n /**\n * secp256k1 belongs to Koblitz curves: it has efficiently computable endomorphism.\n * Endomorphism uses 2x less RAM, speeds up precomputation by 2x and ECDH / key recovery by 20%.\n * For precomputed wNAF it trades off 1/2 init time & 1/3 ram for 20% perf hit.\n * Explanation: https://gist.github.com/paulmillr/eb670806793e84df628a7c434a873066\n */\n endo: {\n beta: BigInt('0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee'),\n splitScalar: (k) => {\n const n = secp256k1N;\n const a1 = BigInt('0x3086d221a7d46bcde86c90e49284eb15');\n const b1 = -_1n * BigInt('0xe4437ed6010e88286f547fa90abfe4c3');\n const a2 = BigInt('0x114ca50f7a8e2f3f657c1108d9d44cfd8');\n const b2 = a1;\n const POW_2_128 = BigInt('0x100000000000000000000000000000000'); // (2n**128n).toString(16)\n const c1 = divNearest(b2 * k, n);\n const c2 = divNearest(-b1 * k, n);\n let k1 = mod(k - c1 * a1 - c2 * a2, n);\n let k2 = mod(-c1 * b1 - c2 * b2, n);\n const k1neg = k1 > POW_2_128;\n const k2neg = k2 > POW_2_128;\n if (k1neg)\n k1 = n - k1;\n if (k2neg)\n k2 = n - k2;\n if (k1 > POW_2_128 || k2 > POW_2_128) {\n throw new Error('splitScalar: Endomorphism failed, k=' + k);\n }\n return { k1neg, k1, k2neg, k2 };\n },\n },\n}, sha256);\n// Schnorr signatures are superior to ECDSA from above. Below is Schnorr-specific BIP0340 code.\n// https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki\nconst _0n = BigInt(0);\nconst fe = (x) => typeof x === 'bigint' && _0n < x && x < secp256k1P;\nconst ge = (x) => typeof x === 'bigint' && _0n < x && x < secp256k1N;\n/** An object mapping tags to their tagged hash prefix of [SHA256(tag) | SHA256(tag)] */\nconst TAGGED_HASH_PREFIXES = {};\nfunction taggedHash(tag, ...messages) {\n let tagP = TAGGED_HASH_PREFIXES[tag];\n if (tagP === undefined) {\n const tagH = sha256(Uint8Array.from(tag, (c) => c.charCodeAt(0)));\n tagP = concatBytes(tagH, tagH);\n TAGGED_HASH_PREFIXES[tag] = tagP;\n }\n return sha256(concatBytes(tagP, ...messages));\n}\n// ECDSA compact points are 33-byte. Schnorr is 32: we strip first byte 0x02 or 0x03\nconst pointToBytes = (point) => point.toRawBytes(true).slice(1);\nconst numTo32b = (n) => numberToBytesBE(n, 32);\nconst modP = (x) => mod(x, secp256k1P);\nconst modN = (x) => mod(x, secp256k1N);\nconst Point = secp256k1.ProjectivePoint;\nconst GmulAdd = (Q, a, b) => Point.BASE.multiplyAndAddUnsafe(Q, a, b);\n// Calculate point, scalar and bytes\nfunction schnorrGetExtPubKey(priv) {\n let d_ = secp256k1.utils.normPrivateKeyToScalar(priv); // same method executed in fromPrivateKey\n let p = Point.fromPrivateKey(d_); // P = d'⋅G; 0 < d' < n check is done inside\n const scalar = p.hasEvenY() ? d_ : modN(-d_);\n return { scalar: scalar, bytes: pointToBytes(p) };\n}\n/**\n * lift_x from BIP340. Convert 32-byte x coordinate to elliptic curve point.\n * @returns valid point checked for being on-curve\n */\nfunction lift_x(x) {\n if (!fe(x))\n throw new Error('bad x: need 0 < x < p'); // Fail if x ≥ p.\n const xx = modP(x * x);\n const c = modP(xx * x + BigInt(7)); // Let c = x³ + 7 mod p.\n let y = sqrtMod(c); // Let y = c^(p+1)/4 mod p.\n if (y % _2n !== _0n)\n y = modP(-y); // Return the unique point P such that x(P) = x and\n const p = new Point(x, y, _1n); // y(P) = y if y mod 2 = 0 or y(P) = p-y otherwise.\n p.assertValidity();\n return p;\n}\n/**\n * Create tagged hash, convert it to bigint, reduce modulo-n.\n */\nfunction challenge(...args) {\n return modN(bytesToNumberBE(taggedHash('BIP0340/challenge', ...args)));\n}\n/**\n * Schnorr public key is just `x` coordinate of Point as per BIP340.\n */\nfunction schnorrGetPublicKey(privateKey) {\n return schnorrGetExtPubKey(privateKey).bytes; // d'=int(sk). Fail if d'=0 or d'≥n. Ret bytes(d'⋅G)\n}\n/**\n * Creates Schnorr signature as per BIP340. Verifies itself before returning anything.\n * auxRand is optional and is not the sole source of k generation: bad CSPRNG won't be dangerous.\n */\nfunction schnorrSign(message, privateKey, auxRand = randomBytes(32)) {\n const m = ensureBytes('message', message);\n const { bytes: px, scalar: d } = schnorrGetExtPubKey(privateKey); // checks for isWithinCurveOrder\n const a = ensureBytes('auxRand', auxRand, 32); // Auxiliary random data a: a 32-byte array\n const t = numTo32b(d ^ bytesToNumberBE(taggedHash('BIP0340/aux', a))); // Let t be the byte-wise xor of bytes(d) and hash/aux(a)\n const rand = taggedHash('BIP0340/nonce', t, px, m); // Let rand = hash/nonce(t || bytes(P) || m)\n const k_ = modN(bytesToNumberBE(rand)); // Let k' = int(rand) mod n\n if (k_ === _0n)\n throw new Error('sign failed: k is zero'); // Fail if k' = 0.\n const { bytes: rx, scalar: k } = schnorrGetExtPubKey(k_); // Let R = k'⋅G.\n const e = challenge(rx, px, m); // Let e = int(hash/challenge(bytes(R) || bytes(P) || m)) mod n.\n const sig = new Uint8Array(64); // Let sig = bytes(R) || bytes((k + ed) mod n).\n sig.set(rx, 0);\n sig.set(numTo32b(modN(k + e * d)), 32);\n // If Verify(bytes(P), m, sig) (see below) returns failure, abort\n if (!schnorrVerify(sig, m, px))\n throw new Error('sign: Invalid signature produced');\n return sig;\n}\n/**\n * Verifies Schnorr signature.\n * Will swallow errors & return false except for initial type validation of arguments.\n */\nfunction schnorrVerify(signature, message, publicKey) {\n const sig = ensureBytes('signature', signature, 64);\n const m = ensureBytes('message', message);\n const pub = ensureBytes('publicKey', publicKey, 32);\n try {\n const P = lift_x(bytesToNumberBE(pub)); // P = lift_x(int(pk)); fail if that fails\n const r = bytesToNumberBE(sig.subarray(0, 32)); // Let r = int(sig[0:32]); fail if r ≥ p.\n if (!fe(r))\n return false;\n const s = bytesToNumberBE(sig.subarray(32, 64)); // Let s = int(sig[32:64]); fail if s ≥ n.\n if (!ge(s))\n return false;\n const e = challenge(numTo32b(r), pointToBytes(P), m); // int(challenge(bytes(r)||bytes(P)||m))%n\n const R = GmulAdd(P, s, modN(-e)); // R = s⋅G - e⋅P\n if (!R || !R.hasEvenY() || R.toAffine().x !== r)\n return false; // -eP == (n-e)P\n return true; // Fail if is_infinite(R) / not has_even_y(R) / x(R) ≠ r.\n }\n catch (error) {\n return false;\n }\n}\nexport const schnorr = /* @__PURE__ */ (() => ({\n getPublicKey: schnorrGetPublicKey,\n sign: schnorrSign,\n verify: schnorrVerify,\n utils: {\n randomPrivateKey: secp256k1.utils.randomPrivateKey,\n lift_x,\n pointToBytes,\n numberToBytesBE,\n bytesToNumberBE,\n taggedHash,\n mod,\n },\n}))();\nconst isoMap = /* @__PURE__ */ (() => isogenyMap(Fp, [\n // xNum\n [\n '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7',\n '0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581',\n '0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262',\n '0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c',\n ],\n // xDen\n [\n '0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b',\n '0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14',\n '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1\n ],\n // yNum\n [\n '0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c',\n '0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3',\n '0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931',\n '0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84',\n ],\n // yDen\n [\n '0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b',\n '0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573',\n '0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f',\n '0x0000000000000000000000000000000000000000000000000000000000000001', // LAST 1\n ],\n].map((i) => i.map((j) => BigInt(j)))))();\nconst mapSWU = /* @__PURE__ */ (() => mapToCurveSimpleSWU(Fp, {\n A: BigInt('0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533'),\n B: BigInt('1771'),\n Z: Fp.create(BigInt('-11')),\n}))();\nconst htf = /* @__PURE__ */ (() => createHasher(secp256k1.ProjectivePoint, (scalars) => {\n const { x, y } = mapSWU(Fp.create(scalars[0]));\n return isoMap(x, y);\n}, {\n DST: 'secp256k1_XMD:SHA-256_SSWU_RO_',\n encodeDST: 'secp256k1_XMD:SHA-256_SSWU_NU_',\n p: Fp.ORDER,\n m: 1,\n k: 128,\n expand: 'xmd',\n hash: sha256,\n}))();\nexport const hashToCurve = /* @__PURE__ */ (() => htf.hashToCurve)();\nexport const encodeToCurve = /* @__PURE__ */ (() => htf.encodeToCurve)();\n//# sourceMappingURL=secp256k1.js.map","import { secp256k1 } from '@noble/curves/secp256k1';\nimport { hexToBigInt } from '../../utils/encoding/fromHex.js';\nimport { toHex } from '../../utils/encoding/toHex.js';\n/**\n * @description Converts a signature into hex format.\n *\n * @param signature The signature to convert.\n * @returns The signature in hex format.\n *\n * @example\n * signatureToHex({\n * r: '0x6e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf',\n * s: '0x4a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db8',\n * v: 28n\n * })\n * // \"0x6e100a352ec6ad1b70802290e18aeed190704973570f3b8ed42cb9808e2ea6bf4a90a229a244495b41890987806fcbd2d5d23fc0dbe5f5256c2613c039d76db81c\"\n */\nexport function signatureToHex({ r, s, v }) {\n return `0x${new secp256k1.Signature(hexToBigInt(r), hexToBigInt(s)).toCompactHex()}${toHex(v).slice(2)}`;\n}\n//# sourceMappingURL=signatureToHex.js.map","function t(r,e){throw new Error(e??`Unexpected value: ${r}`)}function o(...r){return r.reduce((e,n)=>n>e?n:e)}function u(...r){return r.reduce((e,n)=>ne?1:0}function*f(r,e){for(let n=0;nr(...e,...n)}function P(r){return r!==void 0}function g(r){return r!==null}function b(r){return new Promise(e=>setTimeout(()=>e(),r))}function T(){return new Promise(r=>{requestIdleCallback(()=>r())})}export{t as assertExhaustive,o as bigIntMax,u as bigIntMin,m as bigIntSort,f as chunk,d as curry,P as isDefined,g as isNotNull,b as wait,T as waitForIdle};\n//# sourceMappingURL=utils.js.map","var r=class extends Error{name=\"MUDError\"};export{r as a};\n//# sourceMappingURL=chunk-UPQEB2HW.js.map","import{isDynamicAbiType as C}from\"@latticexyz/schema-type\";function ne(e){let t=[],s=[];for(let i of e)C(i)?s.push(i):t.push(i);return{staticFields:t,dynamicFields:s}}import{hexToString as K,sliceHex as N}from\"viem\";import{assertExhaustive as R}from\"@latticexyz/common/utils\";import{arrayAbiTypeToStaticAbiType as W,staticAbiTypeToByteLength as _}from\"@latticexyz/schema-type\";import{getAddress as V,hexToBigInt as j,hexToBool as z}from\"viem\";import{assertExhaustive as O}from\"@latticexyz/common/utils\";import{staticAbiTypeToByteLength as U,staticAbiTypeToDefaultValue as M}from\"@latticexyz/schema-type\";import{MUDError as u}from\"@latticexyz/common/errors\";import{staticAbiTypeToByteLength as L}from\"@latticexyz/schema-type\";var d=class extends u{name=\"InvalidHexValueError\";constructor(t){super(`Hex value \"${t}\" is an odd length (${t.length-2}). It must be an even length.`)}},f=class extends u{name=\"InvalidHexLengthForSchemaError\";constructor(t){super(`Hex value \"${t}\" has length of ${t.length-2}, but expected length of 64 for a schema.`)}},x=class extends u{name=\"InvalidHexLengthForPackedCounterError\";constructor(t){super(`Hex value \"${t}\" has length of ${t.length-2}, but expected length of 64 for a packed counter.`)}},g=class extends u{name=\"InvalidHexLengthForStaticFieldError\";constructor(t,s){super(`Hex value \"${s}\" has length of ${s.length-2}, but expected length of ${L[t]*2} for ${t} type.`)}},S=class extends u{name=\"InvalidHexLengthForArrayFieldError\";constructor(t,s){super(`Hex value \"${s}\" has length of ${s.length-2}, but expected a multiple of ${L[t]*2} for ${t}[] type.`)}},A=class extends u{name=\"SchemaStaticLengthMismatchError\";constructor(t,s,i){super(`Schema \"${t}\" static data length (${s}) did not match the summed length of all static fields (${i}). Is \\`staticAbiTypeToByteLength\\` up to date with Solidity schema types?`)}},v=class extends u{name=\"PackedCounterLengthMismatchError\";constructor(t,s,i){super(`PackedCounter \"${t}\" total bytes length (${s}) did not match the summed length of all field byte lengths (${i}).`)}};function p(e,t){if(t.length>3&&t.length%2!==0)throw new d(t);if((t.length-2)/2!==U[e])throw new g(e,t);switch(e){case\"uint8\":case\"uint16\":case\"uint24\":case\"uint32\":case\"uint40\":case\"uint48\":case\"uint56\":case\"uint64\":case\"uint72\":case\"uint80\":case\"uint88\":case\"uint96\":case\"uint104\":case\"uint112\":case\"uint120\":case\"uint128\":case\"uint136\":case\"uint144\":case\"uint152\":case\"uint160\":case\"uint168\":case\"uint176\":case\"uint184\":case\"uint192\":case\"uint200\":case\"uint208\":case\"uint216\":case\"uint224\":case\"uint232\":case\"uint240\":case\"uint248\":case\"uint256\":case\"int8\":case\"int16\":case\"int24\":case\"int32\":case\"int40\":case\"int48\":case\"int56\":case\"int64\":case\"int72\":case\"int80\":case\"int88\":case\"int96\":case\"int104\":case\"int112\":case\"int120\":case\"int128\":case\"int136\":case\"int144\":case\"int152\":case\"int160\":case\"int168\":case\"int176\":case\"int184\":case\"int192\":case\"int200\":case\"int208\":case\"int216\":case\"int224\":case\"int232\":case\"int240\":case\"int248\":case\"int256\":{let i=j(t,{signed:e.startsWith(\"int\")}),a=typeof M[e];if(a===\"number\")return Number(i);if(a===\"bigint\")return i;throw new Error(`Unexpected default value type (${a}) for ABI type (${e})`)}case\"bytes1\":case\"bytes2\":case\"bytes3\":case\"bytes4\":case\"bytes5\":case\"bytes6\":case\"bytes7\":case\"bytes8\":case\"bytes9\":case\"bytes10\":case\"bytes11\":case\"bytes12\":case\"bytes13\":case\"bytes14\":case\"bytes15\":case\"bytes16\":case\"bytes17\":case\"bytes18\":case\"bytes19\":case\"bytes20\":case\"bytes21\":case\"bytes22\":case\"bytes23\":case\"bytes24\":case\"bytes25\":case\"bytes26\":case\"bytes27\":case\"bytes28\":case\"bytes29\":case\"bytes30\":case\"bytes31\":case\"bytes32\":return t;case\"bool\":return z(t);case\"address\":return V(t)}return O(e,`Unsupported static ABI type: ${e}`)}function h(e,t){if(e===\"bytes\")return t;if(e===\"string\")return K(t);if(t.length>3&&t.length%2!==0)throw new d(t);let s=(t.length-2)/2;switch(e){case\"uint8[]\":case\"uint16[]\":case\"uint24[]\":case\"uint32[]\":case\"uint40[]\":case\"uint48[]\":case\"uint56[]\":case\"uint64[]\":case\"uint72[]\":case\"uint80[]\":case\"uint88[]\":case\"uint96[]\":case\"uint104[]\":case\"uint112[]\":case\"uint120[]\":case\"uint128[]\":case\"uint136[]\":case\"uint144[]\":case\"uint152[]\":case\"uint160[]\":case\"uint168[]\":case\"uint176[]\":case\"uint184[]\":case\"uint192[]\":case\"uint200[]\":case\"uint208[]\":case\"uint216[]\":case\"uint224[]\":case\"uint232[]\":case\"uint240[]\":case\"uint248[]\":case\"uint256[]\":case\"int8[]\":case\"int16[]\":case\"int24[]\":case\"int32[]\":case\"int40[]\":case\"int48[]\":case\"int56[]\":case\"int64[]\":case\"int72[]\":case\"int80[]\":case\"int88[]\":case\"int96[]\":case\"int104[]\":case\"int112[]\":case\"int120[]\":case\"int128[]\":case\"int136[]\":case\"int144[]\":case\"int152[]\":case\"int160[]\":case\"int168[]\":case\"int176[]\":case\"int184[]\":case\"int192[]\":case\"int200[]\":case\"int208[]\":case\"int216[]\":case\"int224[]\":case\"int232[]\":case\"int240[]\":case\"int248[]\":case\"int256[]\":case\"bytes1[]\":case\"bytes2[]\":case\"bytes3[]\":case\"bytes4[]\":case\"bytes5[]\":case\"bytes6[]\":case\"bytes7[]\":case\"bytes8[]\":case\"bytes9[]\":case\"bytes10[]\":case\"bytes11[]\":case\"bytes12[]\":case\"bytes13[]\":case\"bytes14[]\":case\"bytes15[]\":case\"bytes16[]\":case\"bytes17[]\":case\"bytes18[]\":case\"bytes19[]\":case\"bytes20[]\":case\"bytes21[]\":case\"bytes22[]\":case\"bytes23[]\":case\"bytes24[]\":case\"bytes25[]\":case\"bytes26[]\":case\"bytes27[]\":case\"bytes28[]\":case\"bytes29[]\":case\"bytes30[]\":case\"bytes31[]\":case\"bytes32[]\":case\"bool[]\":case\"address[]\":{let i=W(e),a=_[i];if(s%a!==0)throw new S(i,t);return new Array(s/a).fill(void 0).map((n,c)=>{let r=N(t,c*a,(c+1)*a);return p(i,r)})}}return R(e,`Unsupported dynamic ABI type: ${e}`)}import{isDynamicAbiType as q}from\"@latticexyz/schema-type\";function ke(e,t){return q(e)?h(e,t):p(e,t)}import{decodeAbiParameters as G}from\"viem\";function ze(e,t){if(e.staticFields.length!==t.length)throw new Error(`key tuple length ${t.length} does not match key schema length ${e.staticFields.length}`);return t.map((s,i)=>G([{type:e.staticFields[i]}],s)[0])}import{staticAbiTypeToByteLength as Q,dynamicAbiTypeToDefaultValue as X}from\"@latticexyz/schema-type\";import{sliceHex as H}from\"viem\";import{sliceHex as $}from\"viem\";function B(e){if(e.length!==66)throw new x(e);let t=p(\"uint56\",$(e,32-7,32)),s=h(\"uint40[]\",$(e,0,32-7)),i=Object.freeze([...s].reverse()),a=BigInt(i.reduce((m,n)=>m+n,0));if(a!==t)throw new v(e,t,a);return{totalByteLength:t,fieldByteLengths:i}}import{staticAbiTypeToByteLength as J}from\"@latticexyz/schema-type\";function P(e){return e.reduce((t,s)=>t+J[s],0)}function ct(e,t){let s=[],i=0;e.staticFields.forEach(n=>{let c=Q[n],r=p(n,H(t,i,i+c));i+=c,s.push(r)});let a=P(e.staticFields),m=i;if(m!==a&&console.warn(\"Decoded static data length does not match schema's expected static data length. Data may get corrupted. Is `getStaticByteLength` outdated?\",{expectedLength:a,actualLength:m,bytesOffset:i}),e.dynamicFields.length>0){let n=B(H(t,i,i+32));i+=32,e.dynamicFields.forEach((r,F)=>{let o=n.fieldByteLengths[F];if(o>0){let y=h(r,H(t,i,i+o));i+=o,s.push(y)}else s.push(X[r])});let c=i-32-m;BigInt(c)!==n.totalByteLength&&console.warn(\"Decoded dynamic data length does not match data layout's expected data length. Data may get corrupted. Did the data layout change?\",{expectedLength:n.totalByteLength,actualLength:c,bytesOffset:i})}return s}import{arrayAbiTypeToStaticAbiType as Y,isArrayAbiType as Z}from\"@latticexyz/schema-type\";import{encodePacked as w}from\"viem\";function l(e,t){if(Z(e)&&Array.isArray(t)){let s=Y(e);return w(t.map(()=>s),t)}return w([e],[t])}import{encodeAbiParameters as ee}from\"viem\";function dt(e,t){return t.map((s,i)=>ee([{type:e.staticFields[i]}],[s]))}function Tt(e,t){let s=t.slice(0,e.staticFields.length),i=t.slice(e.staticFields.length),a=s.map((o,y)=>l(e.staticFields[y],o).replace(/^0x/,\"\")).join(\"\");if(e.dynamicFields.length===0)return`0x${a}`;let m=i.map((o,y)=>l(e.dynamicFields[y],o).replace(/^0x/,\"\")),n=m.map(o=>o.length/2),c=n.reduce((o,y)=>o+BigInt(y),0n),r=m.join(\"\"),F=`${l(\"uint56\",c).replace(/^0x/,\"\")}${n.map(o=>l(\"uint40\",o).replace(/^0x/,\"\")).join(\"\")}`.padEnd(64,\"0\");return`0x${a}${F}${r}`}import{schemaAbiTypes as I,staticAbiTypeToByteLength as te}from\"@latticexyz/schema-type\";import{hexToNumber as T,sliceHex as b}from\"viem\";function D(e){if(e.length!==66)throw new f(e);let t=T(b(e,0,2)),s=T(b(e,2,3)),i=T(b(e,3,4)),a=[],m=[];for(let c=4;c<4+s;c++){let r=T(b(e,c,c+1));a.push(I[r])}for(let c=4+s;c<4+s+i;c++){let r=T(b(e,c,c+1));m.push(I[r])}let n=a.reduce((c,r)=>c+te[r],0);if(n!==t)throw console.warn(`Schema \"${e}\" static data length (${t}) did not match the summed length of all static fields (${n}). Is \\`staticAbiTypeToByteLength\\` up to date with Solidity schema types?`),new A(e,t,n);return{staticFields:a,dynamicFields:m}}import{sliceHex as E}from\"viem\";function Lt(e){let t=D(E(e,0,32));return{keySchema:D(E(e,32,64)),valueSchema:t}}function Bt(e,t){return tk.indexOf(i)),s=e.dynamicFields.map(i=>k.indexOf(i));return`0x${[P(e.staticFields).toString(16).padStart(4,\"0\"),e.staticFields.length.toString(16).padStart(2,\"0\"),e.dynamicFields.length.toString(16).padStart(2,\"0\"),...t.map(i=>i.toString(16).padStart(2,\"0\")),...s.map(i=>i.toString(16).padStart(2,\"0\"))].join(\"\").padEnd(64,\"0\")}`}export{d as InvalidHexLengthError,S as InvalidHexLengthForArrayFieldError,x as InvalidHexLengthForPackedCounterError,f as InvalidHexLengthForSchemaError,g as InvalidHexLengthForStaticFieldError,v as PackedCounterLengthMismatchError,A as SchemaStaticLengthMismatchError,ne as abiTypesToSchema,h as decodeDynamicField,ke as decodeField,ze as decodeKeyTuple,ct as decodeRecord,p as decodeStaticField,l as encodeField,dt as encodeKeyTuple,Tt as encodeRecord,B as hexToPackedCounter,D as hexToSchema,Lt as hexToTableSchema,Bt as schemaIndexToAbiType,kt as schemaToHex,P as staticDataLength};\n//# sourceMappingURL=index.js.map","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","import { secp256k1 } from '@noble/curves/secp256k1';\nimport { toHex } from '../utils/encoding/toHex.js';\n/**\n * @description Generates a random private key.\n *\n * @returns A randomly generated private key.\n */\nexport function generatePrivateKey() {\n return toHex(secp256k1.utils.randomPrivateKey());\n}\n//# sourceMappingURL=generatePrivateKey.js.map","import { InvalidAddressError } from '../errors/address.js';\nimport { isAddress } from '../utils/address/isAddress.js';\n/**\n * @description Creates an Account from a custom signing implementation.\n *\n * @returns A Local Account.\n */\nexport function toAccount(source) {\n if (typeof source === 'string') {\n if (!isAddress(source))\n throw new InvalidAddressError({ address: source });\n return {\n address: source,\n type: 'json-rpc',\n };\n }\n if (!isAddress(source.address))\n throw new InvalidAddressError({ address: source.address });\n return {\n address: source.address,\n signMessage: source.signMessage,\n signTransaction: source.signTransaction,\n signTypedData: source.signTypedData,\n source: 'custom',\n type: 'local',\n };\n}\n//# sourceMappingURL=toAccount.js.map","import { secp256k1 } from '@noble/curves/secp256k1';\nimport { toHex } from '../../utils/encoding/toHex.js';\n/**\n * @description Signs a hash with a given private key.\n *\n * @param hash The hash to sign.\n * @param privateKey The private key to sign with.\n *\n * @returns The signature.\n */\nexport async function sign({ hash, privateKey, }) {\n const { r, s, recovery } = secp256k1.sign(hash.slice(2), privateKey.slice(2));\n return {\n r: toHex(r),\n s: toHex(s),\n v: recovery ? 28n : 27n,\n };\n}\n//# sourceMappingURL=sign.js.map","import { hashMessage } from '../../utils/signature/hashMessage.js';\nimport { signatureToHex } from '../../utils/signature/signatureToHex.js';\nimport { sign } from './sign.js';\n/**\n * @description Calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191):\n * `keccak256(\"\\x19Ethereum Signed Message:\\n\" + len(message) + message))`.\n *\n * @returns The signature.\n */\nexport async function signMessage({ message, privateKey, }) {\n const signature = await sign({ hash: hashMessage(message), privateKey });\n return signatureToHex(signature);\n}\n//# sourceMappingURL=signMessage.js.map","import { keccak256 } from '../../utils/hash/keccak256.js';\nimport { serializeTransaction, } from '../../utils/transaction/serializeTransaction.js';\nimport { sign } from './sign.js';\nexport async function signTransaction({ privateKey, transaction, serializer = serializeTransaction, }) {\n const signature = await sign({\n hash: keccak256(serializer(transaction)),\n privateKey,\n });\n return serializer(transaction, signature);\n}\n//# sourceMappingURL=signTransaction.js.map","import { hashTypedData, } from '../../utils/signature/hashTypedData.js';\nimport { signatureToHex } from '../../utils/signature/signatureToHex.js';\nimport { sign } from './sign.js';\n/**\n * @description Signs typed data and calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191):\n * `keccak256(\"\\x19Ethereum Signed Message:\\n\" + len(message) + message))`.\n *\n * @returns The signature.\n */\nexport async function signTypedData({ privateKey, ...typedData }) {\n const signature = await sign({\n hash: hashTypedData(typedData),\n privateKey,\n });\n return signatureToHex(signature);\n}\n//# sourceMappingURL=signTypedData.js.map","import { secp256k1 } from '@noble/curves/secp256k1';\nimport { toHex } from '../utils/encoding/toHex.js';\nimport { toAccount } from './toAccount.js';\nimport { publicKeyToAddress } from './utils/publicKeyToAddress.js';\nimport { signMessage } from './utils/signMessage.js';\nimport { signTransaction } from './utils/signTransaction.js';\nimport { signTypedData } from './utils/signTypedData.js';\n/**\n * @description Creates an Account from a private key.\n *\n * @returns A Private Key Account.\n */\nexport function privateKeyToAccount(privateKey) {\n const publicKey = toHex(secp256k1.getPublicKey(privateKey.slice(2), false));\n const address = publicKeyToAddress(publicKey);\n const account = toAccount({\n address,\n async signMessage({ message }) {\n return signMessage({ message, privateKey });\n },\n async signTransaction(transaction, { serializer } = {}) {\n return signTransaction({ privateKey, transaction, serializer });\n },\n async signTypedData(typedData) {\n return signTypedData({ ...typedData, privateKey });\n },\n });\n return {\n ...account,\n publicKey,\n source: 'privateKey',\n };\n}\n//# sourceMappingURL=privateKeyToAccount.js.map","function RetryOperation(timeouts, options) {\n // Compatibility for the old (timeouts, retryForever) signature\n if (typeof options === 'boolean') {\n options = { forever: options };\n }\n\n this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));\n this._timeouts = timeouts;\n this._options = options || {};\n this._maxRetryTime = options && options.maxRetryTime || Infinity;\n this._fn = null;\n this._errors = [];\n this._attempts = 1;\n this._operationTimeout = null;\n this._operationTimeoutCb = null;\n this._timeout = null;\n this._operationStart = null;\n this._timer = null;\n\n if (this._options.forever) {\n this._cachedTimeouts = this._timeouts.slice(0);\n }\n}\nmodule.exports = RetryOperation;\n\nRetryOperation.prototype.reset = function() {\n this._attempts = 1;\n this._timeouts = this._originalTimeouts.slice(0);\n}\n\nRetryOperation.prototype.stop = function() {\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n if (this._timer) {\n clearTimeout(this._timer);\n }\n\n this._timeouts = [];\n this._cachedTimeouts = null;\n};\n\nRetryOperation.prototype.retry = function(err) {\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n\n if (!err) {\n return false;\n }\n var currentTime = new Date().getTime();\n if (err && currentTime - this._operationStart >= this._maxRetryTime) {\n this._errors.push(err);\n this._errors.unshift(new Error('RetryOperation timeout occurred'));\n return false;\n }\n\n this._errors.push(err);\n\n var timeout = this._timeouts.shift();\n if (timeout === undefined) {\n if (this._cachedTimeouts) {\n // retry forever, only keep last error\n this._errors.splice(0, this._errors.length - 1);\n timeout = this._cachedTimeouts.slice(-1);\n } else {\n return false;\n }\n }\n\n var self = this;\n this._timer = setTimeout(function() {\n self._attempts++;\n\n if (self._operationTimeoutCb) {\n self._timeout = setTimeout(function() {\n self._operationTimeoutCb(self._attempts);\n }, self._operationTimeout);\n\n if (self._options.unref) {\n self._timeout.unref();\n }\n }\n\n self._fn(self._attempts);\n }, timeout);\n\n if (this._options.unref) {\n this._timer.unref();\n }\n\n return true;\n};\n\nRetryOperation.prototype.attempt = function(fn, timeoutOps) {\n this._fn = fn;\n\n if (timeoutOps) {\n if (timeoutOps.timeout) {\n this._operationTimeout = timeoutOps.timeout;\n }\n if (timeoutOps.cb) {\n this._operationTimeoutCb = timeoutOps.cb;\n }\n }\n\n var self = this;\n if (this._operationTimeoutCb) {\n this._timeout = setTimeout(function() {\n self._operationTimeoutCb();\n }, self._operationTimeout);\n }\n\n this._operationStart = new Date().getTime();\n\n this._fn(this._attempts);\n};\n\nRetryOperation.prototype.try = function(fn) {\n console.log('Using RetryOperation.try() is deprecated');\n this.attempt(fn);\n};\n\nRetryOperation.prototype.start = function(fn) {\n console.log('Using RetryOperation.start() is deprecated');\n this.attempt(fn);\n};\n\nRetryOperation.prototype.start = RetryOperation.prototype.try;\n\nRetryOperation.prototype.errors = function() {\n return this._errors;\n};\n\nRetryOperation.prototype.attempts = function() {\n return this._attempts;\n};\n\nRetryOperation.prototype.mainError = function() {\n if (this._errors.length === 0) {\n return null;\n }\n\n var counts = {};\n var mainError = null;\n var mainErrorCount = 0;\n\n for (var i = 0; i < this._errors.length; i++) {\n var error = this._errors[i];\n var message = error.message;\n var count = (counts[message] || 0) + 1;\n\n counts[message] = count;\n\n if (count >= mainErrorCount) {\n mainError = error;\n mainErrorCount = count;\n }\n }\n\n return mainError;\n};\n","var RetryOperation = require('./retry_operation');\n\nexports.operation = function(options) {\n var timeouts = exports.timeouts(options);\n return new RetryOperation(timeouts, {\n forever: options && (options.forever || options.retries === Infinity),\n unref: options && options.unref,\n maxRetryTime: options && options.maxRetryTime\n });\n};\n\nexports.timeouts = function(options) {\n if (options instanceof Array) {\n return [].concat(options);\n }\n\n var opts = {\n retries: 10,\n factor: 2,\n minTimeout: 1 * 1000,\n maxTimeout: Infinity,\n randomize: false\n };\n for (var key in options) {\n opts[key] = options[key];\n }\n\n if (opts.minTimeout > opts.maxTimeout) {\n throw new Error('minTimeout is greater than maxTimeout');\n }\n\n var timeouts = [];\n for (var i = 0; i < opts.retries; i++) {\n timeouts.push(this.createTimeout(i, opts));\n }\n\n if (options && options.forever && !timeouts.length) {\n timeouts.push(this.createTimeout(i, opts));\n }\n\n // sort the array numerically ascending\n timeouts.sort(function(a,b) {\n return a - b;\n });\n\n return timeouts;\n};\n\nexports.createTimeout = function(attempt, opts) {\n var random = (opts.randomize)\n ? (Math.random() + 1)\n : 1;\n\n var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));\n timeout = Math.min(timeout, opts.maxTimeout);\n\n return timeout;\n};\n\nexports.wrap = function(obj, options, methods) {\n if (options instanceof Array) {\n methods = options;\n options = null;\n }\n\n if (!methods) {\n methods = [];\n for (var key in obj) {\n if (typeof obj[key] === 'function') {\n methods.push(key);\n }\n }\n }\n\n for (var i = 0; i < methods.length; i++) {\n var method = methods[i];\n var original = obj[method];\n\n obj[method] = function retryWrapper(original) {\n var op = exports.operation(options);\n var args = Array.prototype.slice.call(arguments, 1);\n var callback = args.pop();\n\n args.push(function(err) {\n if (op.retry(err)) {\n return;\n }\n if (err) {\n arguments[0] = op.mainError();\n }\n callback.apply(this, arguments);\n });\n\n op.attempt(function() {\n original.apply(obj, args);\n });\n }.bind(obj, original);\n obj[method].options = options;\n }\n};\n","module.exports = require('./lib/retry');","import retry from 'retry';\n\nconst networkErrorMsgs = new Set([\n\t'Failed to fetch', // Chrome\n\t'NetworkError when attempting to fetch resource.', // Firefox\n\t'The Internet connection appears to be offline.', // Safari\n\t'Network request failed', // `cross-fetch`\n\t'fetch failed', // Undici (Node.js)\n]);\n\nexport class AbortError extends Error {\n\tconstructor(message) {\n\t\tsuper();\n\n\t\tif (message instanceof Error) {\n\t\t\tthis.originalError = message;\n\t\t\t({message} = message);\n\t\t} else {\n\t\t\tthis.originalError = new Error(message);\n\t\t\tthis.originalError.stack = this.stack;\n\t\t}\n\n\t\tthis.name = 'AbortError';\n\t\tthis.message = message;\n\t}\n}\n\nconst decorateErrorWithCounts = (error, attemptNumber, options) => {\n\t// Minus 1 from attemptNumber because the first attempt does not count as a retry\n\tconst retriesLeft = options.retries - (attemptNumber - 1);\n\n\terror.attemptNumber = attemptNumber;\n\terror.retriesLeft = retriesLeft;\n\treturn error;\n};\n\nconst isNetworkError = errorMessage => networkErrorMsgs.has(errorMessage);\n\nconst getDOMException = errorMessage => globalThis.DOMException === undefined\n\t? new Error(errorMessage)\n\t: new DOMException(errorMessage);\n\nexport default async function pRetry(input, options) {\n\treturn new Promise((resolve, reject) => {\n\t\toptions = {\n\t\t\tonFailedAttempt() {},\n\t\t\tretries: 10,\n\t\t\t...options,\n\t\t};\n\n\t\tconst operation = retry.operation(options);\n\n\t\toperation.attempt(async attemptNumber => {\n\t\t\ttry {\n\t\t\t\tresolve(await input(attemptNumber));\n\t\t\t} catch (error) {\n\t\t\t\tif (!(error instanceof Error)) {\n\t\t\t\t\treject(new TypeError(`Non-error was thrown: \"${error}\". You should only throw errors.`));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (error instanceof AbortError) {\n\t\t\t\t\toperation.stop();\n\t\t\t\t\treject(error.originalError);\n\t\t\t\t} else if (error instanceof TypeError && !isNetworkError(error.message)) {\n\t\t\t\t\toperation.stop();\n\t\t\t\t\treject(error);\n\t\t\t\t} else {\n\t\t\t\t\tdecorateErrorWithCounts(error, attemptNumber, options);\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait options.onFailedAttempt(error);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!operation.retry(error)) {\n\t\t\t\t\t\treject(operation.mainError());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tif (options.signal && !options.signal.aborted) {\n\t\t\toptions.signal.addEventListener('abort', () => {\n\t\t\t\toperation.stop();\n\t\t\t\tconst reason = options.signal.reason === undefined\n\t\t\t\t\t? getDOMException('The operation was aborted.')\n\t\t\t\t\t: options.signal.reason;\n\t\t\t\treject(reason instanceof Error ? reason : getDOMException(reason));\n\t\t\t}, {\n\t\t\t\tonce: true,\n\t\t\t});\n\t\t}\n\t});\n}\n","import{privateKeyToAccount as W}from\"viem/accounts\";function J(e){return{...W(e)}}import{getContract as M}from\"viem\";import O from\"p-retry\";import{BaseError as k,NonceTooHighError as R,NonceTooLowError as v}from\"viem\";import H from\"debug\";var p=H(\"mud:common\");var x=p.extend(\"createNonceManager\");function b({publicClient:e,address:t,blockTag:r}){let n={current:-1},a=typeof BroadcastChannel<\"u\"?new BroadcastChannel(`mud:createNonceManager:${e.chain?.id}:${t}`):null;a&&a.addEventListener(\"message\",o=>{let T=JSON.parse(o.data);x(\"got nonce from broadcast channel\",T),n.current=T});function c(){return n.current>=0}function d(){if(!c())throw new Error(\"call resetNonce before using nextNonce\");let o=n.current++;return a?.postMessage(JSON.stringify(n.current)),o}async function u(){let o=await e.getTransactionCount({address:t,blockTag:r});n.current=o,a?.postMessage(JSON.stringify(n.current)),x(\"reset nonce to\",n.current)}function C(o){return o instanceof k&&o.walk(T=>T instanceof v||T instanceof R)!=null}return{hasNonce:c,nextNonce:d,resetNonce:u,shouldResetNonce:C}}var m=p.extend(\"createContract\");function E(e){let t=e.length&&Array.isArray(e[0]),r=t?e[0]:[],n=(t?e[1]:e[0])??{};return{args:r,options:n}}function me({abi:e,address:t,publicClient:r,walletClient:n,onWrite:a}){let c=M({abi:e,address:t,publicClient:r,walletClient:n});if(c.write){let d=0,u=b({publicClient:r,address:n.account.address});c.write=new Proxy({},{get(C,o){async function T(s){if(s.gas)return m(\"gas provided, skipping simulate\",o,s),s;m(\"simulating write\",o,s);let{request:l}=await r.simulateContract({...s,account:s.account??n.account});return l}async function w(s){let l=await T(s);return await O(async()=>{u.hasNonce()||await u.resetNonce();let i=u.nextNonce();return m(\"calling write function with nonce\",i,l),await n.writeContract({nonce:i,...l})},{retries:3,onFailedAttempt:async i=>{if(u.shouldResetNonce(i)){m(\"got nonce error, retrying\",i),await u.resetNonce();return}throw i}})}return(...s)=>{let l=`${n.chain.id}:${n.account.address}:${d++}`,{args:i,options:N}=E(s),f={address:t,abi:e,functionName:o,args:i,...N},g=w(f);return a?.({id:l,request:f,result:g}),g}}})}return c}import{generatePrivateKey as S,privateKeyToAccount as A}from\"viem/accounts\";import{isHex as $}from\"viem\";function B(e,t){if(!$(e))throw console.error(\"Private key found in cache is not valid hex\",{privateKey:e,cacheKey:t}),new Error(`Private key found in cache (${t}) is not valid hex`);A(e)}function be(e=\"mud:burnerWallet\"){let t=localStorage.getItem(e);if(t!=null)return B(t,e),t;let r=S();return console.log(\"New burner wallet created:\",A(r)),localStorage.setItem(e,r),r}import{hexToString as h,sliceHex as P}from\"viem\";function ye(e){let t=h(P(e,0,16)).replace(/\\0+$/,\"\"),r=h(P(e,16,32)).replace(/\\0+$/,\"\");return{namespace:t,name:r}}import{stringToHex as y,concatHex as G}from\"viem\";function He(e,t){return G([y(e.substring(0,16),{size:16}),y(t.substring(0,16),{size:16})])}import{keccak256 as q}from\"viem\";var I=p.extend(\"transportObserver\");function Ee(e){return t=>{let r=e(t);return{...r,request:async a=>{if(a.method===\"eth_sendRawTransaction\"&&a.params instanceof Array){let c=a.params.map(d=>q(d));I(\"saw txs\",c)}return r.request(a)}}}}export{J as createBurnerAccount,me as createContract,b as createNonceManager,be as getBurnerPrivateKey,ye as hexToTableId,He as tableIdToHex,Ee as transportObserver};\n//# sourceMappingURL=index.js.map","var I=(t=>(t[t.UINT8=0]=\"UINT8\",t[t.UINT16=1]=\"UINT16\",t[t.UINT24=2]=\"UINT24\",t[t.UINT32=3]=\"UINT32\",t[t.UINT40=4]=\"UINT40\",t[t.UINT48=5]=\"UINT48\",t[t.UINT56=6]=\"UINT56\",t[t.UINT64=7]=\"UINT64\",t[t.UINT72=8]=\"UINT72\",t[t.UINT80=9]=\"UINT80\",t[t.UINT88=10]=\"UINT88\",t[t.UINT96=11]=\"UINT96\",t[t.UINT104=12]=\"UINT104\",t[t.UINT112=13]=\"UINT112\",t[t.UINT120=14]=\"UINT120\",t[t.UINT128=15]=\"UINT128\",t[t.UINT136=16]=\"UINT136\",t[t.UINT144=17]=\"UINT144\",t[t.UINT152=18]=\"UINT152\",t[t.UINT160=19]=\"UINT160\",t[t.UINT168=20]=\"UINT168\",t[t.UINT176=21]=\"UINT176\",t[t.UINT184=22]=\"UINT184\",t[t.UINT192=23]=\"UINT192\",t[t.UINT200=24]=\"UINT200\",t[t.UINT208=25]=\"UINT208\",t[t.UINT216=26]=\"UINT216\",t[t.UINT224=27]=\"UINT224\",t[t.UINT232=28]=\"UINT232\",t[t.UINT240=29]=\"UINT240\",t[t.UINT248=30]=\"UINT248\",t[t.UINT256=31]=\"UINT256\",t[t.INT8=32]=\"INT8\",t[t.INT16=33]=\"INT16\",t[t.INT24=34]=\"INT24\",t[t.INT32=35]=\"INT32\",t[t.INT40=36]=\"INT40\",t[t.INT48=37]=\"INT48\",t[t.INT56=38]=\"INT56\",t[t.INT64=39]=\"INT64\",t[t.INT72=40]=\"INT72\",t[t.INT80=41]=\"INT80\",t[t.INT88=42]=\"INT88\",t[t.INT96=43]=\"INT96\",t[t.INT104=44]=\"INT104\",t[t.INT112=45]=\"INT112\",t[t.INT120=46]=\"INT120\",t[t.INT128=47]=\"INT128\",t[t.INT136=48]=\"INT136\",t[t.INT144=49]=\"INT144\",t[t.INT152=50]=\"INT152\",t[t.INT160=51]=\"INT160\",t[t.INT168=52]=\"INT168\",t[t.INT176=53]=\"INT176\",t[t.INT184=54]=\"INT184\",t[t.INT192=55]=\"INT192\",t[t.INT200=56]=\"INT200\",t[t.INT208=57]=\"INT208\",t[t.INT216=58]=\"INT216\",t[t.INT224=59]=\"INT224\",t[t.INT232=60]=\"INT232\",t[t.INT240=61]=\"INT240\",t[t.INT248=62]=\"INT248\",t[t.INT256=63]=\"INT256\",t[t.BYTES1=64]=\"BYTES1\",t[t.BYTES2=65]=\"BYTES2\",t[t.BYTES3=66]=\"BYTES3\",t[t.BYTES4=67]=\"BYTES4\",t[t.BYTES5=68]=\"BYTES5\",t[t.BYTES6=69]=\"BYTES6\",t[t.BYTES7=70]=\"BYTES7\",t[t.BYTES8=71]=\"BYTES8\",t[t.BYTES9=72]=\"BYTES9\",t[t.BYTES10=73]=\"BYTES10\",t[t.BYTES11=74]=\"BYTES11\",t[t.BYTES12=75]=\"BYTES12\",t[t.BYTES13=76]=\"BYTES13\",t[t.BYTES14=77]=\"BYTES14\",t[t.BYTES15=78]=\"BYTES15\",t[t.BYTES16=79]=\"BYTES16\",t[t.BYTES17=80]=\"BYTES17\",t[t.BYTES18=81]=\"BYTES18\",t[t.BYTES19=82]=\"BYTES19\",t[t.BYTES20=83]=\"BYTES20\",t[t.BYTES21=84]=\"BYTES21\",t[t.BYTES22=85]=\"BYTES22\",t[t.BYTES23=86]=\"BYTES23\",t[t.BYTES24=87]=\"BYTES24\",t[t.BYTES25=88]=\"BYTES25\",t[t.BYTES26=89]=\"BYTES26\",t[t.BYTES27=90]=\"BYTES27\",t[t.BYTES28=91]=\"BYTES28\",t[t.BYTES29=92]=\"BYTES29\",t[t.BYTES30=93]=\"BYTES30\",t[t.BYTES31=94]=\"BYTES31\",t[t.BYTES32=95]=\"BYTES32\",t[t.BOOL=96]=\"BOOL\",t[t.ADDRESS=97]=\"ADDRESS\",t[t.UINT8_ARRAY=98]=\"UINT8_ARRAY\",t[t.UINT16_ARRAY=99]=\"UINT16_ARRAY\",t[t.UINT24_ARRAY=100]=\"UINT24_ARRAY\",t[t.UINT32_ARRAY=101]=\"UINT32_ARRAY\",t[t.UINT40_ARRAY=102]=\"UINT40_ARRAY\",t[t.UINT48_ARRAY=103]=\"UINT48_ARRAY\",t[t.UINT56_ARRAY=104]=\"UINT56_ARRAY\",t[t.UINT64_ARRAY=105]=\"UINT64_ARRAY\",t[t.UINT72_ARRAY=106]=\"UINT72_ARRAY\",t[t.UINT80_ARRAY=107]=\"UINT80_ARRAY\",t[t.UINT88_ARRAY=108]=\"UINT88_ARRAY\",t[t.UINT96_ARRAY=109]=\"UINT96_ARRAY\",t[t.UINT104_ARRAY=110]=\"UINT104_ARRAY\",t[t.UINT112_ARRAY=111]=\"UINT112_ARRAY\",t[t.UINT120_ARRAY=112]=\"UINT120_ARRAY\",t[t.UINT128_ARRAY=113]=\"UINT128_ARRAY\",t[t.UINT136_ARRAY=114]=\"UINT136_ARRAY\",t[t.UINT144_ARRAY=115]=\"UINT144_ARRAY\",t[t.UINT152_ARRAY=116]=\"UINT152_ARRAY\",t[t.UINT160_ARRAY=117]=\"UINT160_ARRAY\",t[t.UINT168_ARRAY=118]=\"UINT168_ARRAY\",t[t.UINT176_ARRAY=119]=\"UINT176_ARRAY\",t[t.UINT184_ARRAY=120]=\"UINT184_ARRAY\",t[t.UINT192_ARRAY=121]=\"UINT192_ARRAY\",t[t.UINT200_ARRAY=122]=\"UINT200_ARRAY\",t[t.UINT208_ARRAY=123]=\"UINT208_ARRAY\",t[t.UINT216_ARRAY=124]=\"UINT216_ARRAY\",t[t.UINT224_ARRAY=125]=\"UINT224_ARRAY\",t[t.UINT232_ARRAY=126]=\"UINT232_ARRAY\",t[t.UINT240_ARRAY=127]=\"UINT240_ARRAY\",t[t.UINT248_ARRAY=128]=\"UINT248_ARRAY\",t[t.UINT256_ARRAY=129]=\"UINT256_ARRAY\",t[t.INT8_ARRAY=130]=\"INT8_ARRAY\",t[t.INT16_ARRAY=131]=\"INT16_ARRAY\",t[t.INT24_ARRAY=132]=\"INT24_ARRAY\",t[t.INT32_ARRAY=133]=\"INT32_ARRAY\",t[t.INT40_ARRAY=134]=\"INT40_ARRAY\",t[t.INT48_ARRAY=135]=\"INT48_ARRAY\",t[t.INT56_ARRAY=136]=\"INT56_ARRAY\",t[t.INT64_ARRAY=137]=\"INT64_ARRAY\",t[t.INT72_ARRAY=138]=\"INT72_ARRAY\",t[t.INT80_ARRAY=139]=\"INT80_ARRAY\",t[t.INT88_ARRAY=140]=\"INT88_ARRAY\",t[t.INT96_ARRAY=141]=\"INT96_ARRAY\",t[t.INT104_ARRAY=142]=\"INT104_ARRAY\",t[t.INT112_ARRAY=143]=\"INT112_ARRAY\",t[t.INT120_ARRAY=144]=\"INT120_ARRAY\",t[t.INT128_ARRAY=145]=\"INT128_ARRAY\",t[t.INT136_ARRAY=146]=\"INT136_ARRAY\",t[t.INT144_ARRAY=147]=\"INT144_ARRAY\",t[t.INT152_ARRAY=148]=\"INT152_ARRAY\",t[t.INT160_ARRAY=149]=\"INT160_ARRAY\",t[t.INT168_ARRAY=150]=\"INT168_ARRAY\",t[t.INT176_ARRAY=151]=\"INT176_ARRAY\",t[t.INT184_ARRAY=152]=\"INT184_ARRAY\",t[t.INT192_ARRAY=153]=\"INT192_ARRAY\",t[t.INT200_ARRAY=154]=\"INT200_ARRAY\",t[t.INT208_ARRAY=155]=\"INT208_ARRAY\",t[t.INT216_ARRAY=156]=\"INT216_ARRAY\",t[t.INT224_ARRAY=157]=\"INT224_ARRAY\",t[t.INT232_ARRAY=158]=\"INT232_ARRAY\",t[t.INT240_ARRAY=159]=\"INT240_ARRAY\",t[t.INT248_ARRAY=160]=\"INT248_ARRAY\",t[t.INT256_ARRAY=161]=\"INT256_ARRAY\",t[t.BYTES1_ARRAY=162]=\"BYTES1_ARRAY\",t[t.BYTES2_ARRAY=163]=\"BYTES2_ARRAY\",t[t.BYTES3_ARRAY=164]=\"BYTES3_ARRAY\",t[t.BYTES4_ARRAY=165]=\"BYTES4_ARRAY\",t[t.BYTES5_ARRAY=166]=\"BYTES5_ARRAY\",t[t.BYTES6_ARRAY=167]=\"BYTES6_ARRAY\",t[t.BYTES7_ARRAY=168]=\"BYTES7_ARRAY\",t[t.BYTES8_ARRAY=169]=\"BYTES8_ARRAY\",t[t.BYTES9_ARRAY=170]=\"BYTES9_ARRAY\",t[t.BYTES10_ARRAY=171]=\"BYTES10_ARRAY\",t[t.BYTES11_ARRAY=172]=\"BYTES11_ARRAY\",t[t.BYTES12_ARRAY=173]=\"BYTES12_ARRAY\",t[t.BYTES13_ARRAY=174]=\"BYTES13_ARRAY\",t[t.BYTES14_ARRAY=175]=\"BYTES14_ARRAY\",t[t.BYTES15_ARRAY=176]=\"BYTES15_ARRAY\",t[t.BYTES16_ARRAY=177]=\"BYTES16_ARRAY\",t[t.BYTES17_ARRAY=178]=\"BYTES17_ARRAY\",t[t.BYTES18_ARRAY=179]=\"BYTES18_ARRAY\",t[t.BYTES19_ARRAY=180]=\"BYTES19_ARRAY\",t[t.BYTES20_ARRAY=181]=\"BYTES20_ARRAY\",t[t.BYTES21_ARRAY=182]=\"BYTES21_ARRAY\",t[t.BYTES22_ARRAY=183]=\"BYTES22_ARRAY\",t[t.BYTES23_ARRAY=184]=\"BYTES23_ARRAY\",t[t.BYTES24_ARRAY=185]=\"BYTES24_ARRAY\",t[t.BYTES25_ARRAY=186]=\"BYTES25_ARRAY\",t[t.BYTES26_ARRAY=187]=\"BYTES26_ARRAY\",t[t.BYTES27_ARRAY=188]=\"BYTES27_ARRAY\",t[t.BYTES28_ARRAY=189]=\"BYTES28_ARRAY\",t[t.BYTES29_ARRAY=190]=\"BYTES29_ARRAY\",t[t.BYTES30_ARRAY=191]=\"BYTES30_ARRAY\",t[t.BYTES31_ARRAY=192]=\"BYTES31_ARRAY\",t[t.BYTES32_ARRAY=193]=\"BYTES32_ARRAY\",t[t.BOOL_ARRAY=194]=\"BOOL_ARRAY\",t[t.ADDRESS_ARRAY=195]=\"ADDRESS_ARRAY\",t[t.BYTES=196]=\"BYTES\",t[t.STRING=197]=\"STRING\",t))(I||{});var Y={[0]:\"uint8\",[1]:\"uint16\",[2]:\"uint24\",[3]:\"uint32\",[4]:\"uint40\",[5]:\"uint48\",[6]:\"uint56\",[7]:\"uint64\",[8]:\"uint72\",[9]:\"uint80\",[10]:\"uint88\",[11]:\"uint96\",[12]:\"uint104\",[13]:\"uint112\",[14]:\"uint120\",[15]:\"uint128\",[16]:\"uint136\",[17]:\"uint144\",[18]:\"uint152\",[19]:\"uint160\",[20]:\"uint168\",[21]:\"uint176\",[22]:\"uint184\",[23]:\"uint192\",[24]:\"uint200\",[25]:\"uint208\",[26]:\"uint216\",[27]:\"uint224\",[28]:\"uint232\",[29]:\"uint240\",[30]:\"uint248\",[31]:\"uint256\",[32]:\"int8\",[33]:\"int16\",[34]:\"int24\",[35]:\"int32\",[36]:\"int40\",[37]:\"int48\",[38]:\"int56\",[39]:\"int64\",[40]:\"int72\",[41]:\"int80\",[42]:\"int88\",[43]:\"int96\",[44]:\"int104\",[45]:\"int112\",[46]:\"int120\",[47]:\"int128\",[48]:\"int136\",[49]:\"int144\",[50]:\"int152\",[51]:\"int160\",[52]:\"int168\",[53]:\"int176\",[54]:\"int184\",[55]:\"int192\",[56]:\"int200\",[57]:\"int208\",[58]:\"int216\",[59]:\"int224\",[60]:\"int232\",[61]:\"int240\",[62]:\"int248\",[63]:\"int256\",[64]:\"bytes1\",[65]:\"bytes2\",[66]:\"bytes3\",[67]:\"bytes4\",[68]:\"bytes5\",[69]:\"bytes6\",[70]:\"bytes7\",[71]:\"bytes8\",[72]:\"bytes9\",[73]:\"bytes10\",[74]:\"bytes11\",[75]:\"bytes12\",[76]:\"bytes13\",[77]:\"bytes14\",[78]:\"bytes15\",[79]:\"bytes16\",[80]:\"bytes17\",[81]:\"bytes18\",[82]:\"bytes19\",[83]:\"bytes20\",[84]:\"bytes21\",[85]:\"bytes22\",[86]:\"bytes23\",[87]:\"bytes24\",[88]:\"bytes25\",[89]:\"bytes26\",[90]:\"bytes27\",[91]:\"bytes28\",[92]:\"bytes29\",[93]:\"bytes30\",[94]:\"bytes31\",[95]:\"bytes32\",[96]:\"bool\",[97]:\"address\",[98]:\"uint8[]\",[99]:\"uint16[]\",[100]:\"uint24[]\",[101]:\"uint32[]\",[102]:\"uint40[]\",[103]:\"uint48[]\",[104]:\"uint56[]\",[105]:\"uint64[]\",[106]:\"uint72[]\",[107]:\"uint80[]\",[108]:\"uint88[]\",[109]:\"uint96[]\",[110]:\"uint104[]\",[111]:\"uint112[]\",[112]:\"uint120[]\",[113]:\"uint128[]\",[114]:\"uint136[]\",[115]:\"uint144[]\",[116]:\"uint152[]\",[117]:\"uint160[]\",[118]:\"uint168[]\",[119]:\"uint176[]\",[120]:\"uint184[]\",[121]:\"uint192[]\",[122]:\"uint200[]\",[123]:\"uint208[]\",[124]:\"uint216[]\",[125]:\"uint224[]\",[126]:\"uint232[]\",[127]:\"uint240[]\",[128]:\"uint248[]\",[129]:\"uint256[]\",[130]:\"int8[]\",[131]:\"int16[]\",[132]:\"int24[]\",[133]:\"int32[]\",[134]:\"int40[]\",[135]:\"int48[]\",[136]:\"int56[]\",[137]:\"int64[]\",[138]:\"int72[]\",[139]:\"int80[]\",[140]:\"int88[]\",[141]:\"int96[]\",[142]:\"int104[]\",[143]:\"int112[]\",[144]:\"int120[]\",[145]:\"int128[]\",[146]:\"int136[]\",[147]:\"int144[]\",[148]:\"int152[]\",[149]:\"int160[]\",[150]:\"int168[]\",[151]:\"int176[]\",[152]:\"int184[]\",[153]:\"int192[]\",[154]:\"int200[]\",[155]:\"int208[]\",[156]:\"int216[]\",[157]:\"int224[]\",[158]:\"int232[]\",[159]:\"int240[]\",[160]:\"int248[]\",[161]:\"int256[]\",[162]:\"bytes1[]\",[163]:\"bytes2[]\",[164]:\"bytes3[]\",[165]:\"bytes4[]\",[166]:\"bytes5[]\",[167]:\"bytes6[]\",[168]:\"bytes7[]\",[169]:\"bytes8[]\",[170]:\"bytes9[]\",[171]:\"bytes10[]\",[172]:\"bytes11[]\",[173]:\"bytes12[]\",[174]:\"bytes13[]\",[175]:\"bytes14[]\",[176]:\"bytes15[]\",[177]:\"bytes16[]\",[178]:\"bytes17[]\",[179]:\"bytes18[]\",[180]:\"bytes19[]\",[181]:\"bytes20[]\",[182]:\"bytes21[]\",[183]:\"bytes22[]\",[184]:\"bytes23[]\",[185]:\"bytes24[]\",[186]:\"bytes25[]\",[187]:\"bytes26[]\",[188]:\"bytes27[]\",[189]:\"bytes28[]\",[190]:\"bytes29[]\",[191]:\"bytes30[]\",[192]:\"bytes31[]\",[193]:\"bytes32[]\",[194]:\"bool[]\",[195]:\"address[]\",[196]:\"bytes\",[197]:\"string\"};var s=Object.values(Y);var _=Object.fromEntries(Object.entries(Y).map(([R,A])=>[A,parseInt(R)]));function n(R){let A=R.valueOf();return A<32?A+1:A<64?A+1-32:A<96?A+1-64:R==96?1:R==97?20:0}var U=s.filter(R=>n(_[R])>0);var u={[98]:0,[99]:1,[100]:2,[101]:3,[102]:4,[103]:5,[104]:6,[105]:7,[106]:8,[107]:9,[108]:10,[109]:11,[110]:12,[111]:13,[112]:14,[113]:15,[114]:16,[115]:17,[116]:18,[117]:19,[118]:20,[119]:21,[120]:22,[121]:23,[122]:24,[123]:25,[124]:26,[125]:27,[126]:28,[127]:29,[128]:30,[129]:31,[130]:32,[131]:33,[132]:34,[133]:35,[134]:36,[135]:37,[136]:38,[137]:39,[138]:40,[139]:41,[140]:42,[141]:43,[142]:44,[143]:45,[144]:46,[145]:47,[146]:48,[147]:49,[148]:50,[149]:51,[150]:52,[151]:53,[152]:54,[153]:55,[154]:56,[155]:57,[156]:58,[157]:59,[158]:60,[159]:61,[160]:62,[161]:63,[162]:64,[163]:65,[164]:66,[165]:67,[166]:68,[167]:69,[168]:70,[169]:71,[170]:72,[171]:73,[172]:74,[173]:75,[174]:76,[175]:77,[176]:78,[177]:79,[178]:80,[179]:81,[180]:82,[181]:83,[182]:84,[183]:85,[184]:86,[185]:87,[186]:88,[187]:89,[188]:90,[189]:91,[190]:92,[191]:93,[192]:94,[193]:95,[194]:96,[195]:97};function o(R){if(R.length>28)throw new Error(\"Schema can only have up to 28 fields\");let A=new Uint8Array(32),T=0,N=0,b=!1;for(let i=0;i0){if(b)throw new Error(\"Static fields must come before dynamic fields in the schema\");N++}else b=!0;T+=E,A[i+4]=R[i]}let r=R.length-N;if(r>14)throw new Error(\"Schema can only have up to 14 dynamic fields\");return new DataView(A.buffer).setUint16(0,T),A[2]=N,A[3]=r,A}var B={uint8:0,uint16:0,uint24:0,uint32:0,uint40:0,uint48:0,uint56:0n,uint64:0n,uint72:0n,uint80:0n,uint88:0n,uint96:0n,uint104:0n,uint112:0n,uint120:0n,uint128:0n,uint136:0n,uint144:0n,uint152:0n,uint160:0n,uint168:0n,uint176:0n,uint184:0n,uint192:0n,uint200:0n,uint208:0n,uint216:0n,uint224:0n,uint232:0n,uint240:0n,uint248:0n,uint256:0n,int8:0,int16:0,int24:0,int32:0,int40:0,int48:0,int56:0n,int64:0n,int72:0n,int80:0n,int88:0n,int96:0n,int104:0n,int112:0n,int120:0n,int128:0n,int136:0n,int144:0n,int152:0n,int160:0n,int168:0n,int176:0n,int184:0n,int192:0n,int200:0n,int208:0n,int216:0n,int224:0n,int232:0n,int240:0n,int248:0n,int256:0n,bytes1:\"0x00\",bytes2:\"0x0000\",bytes3:\"0x000000\",bytes4:\"0x00000000\",bytes5:\"0x0000000000\",bytes6:\"0x000000000000\",bytes7:\"0x00000000000000\",bytes8:\"0x0000000000000000\",bytes9:\"0x000000000000000000\",bytes10:\"0x00000000000000000000\",bytes11:\"0x0000000000000000000000\",bytes12:\"0x000000000000000000000000\",bytes13:\"0x00000000000000000000000000\",bytes14:\"0x0000000000000000000000000000\",bytes15:\"0x000000000000000000000000000000\",bytes16:\"0x00000000000000000000000000000000\",bytes17:\"0x0000000000000000000000000000000000\",bytes18:\"0x000000000000000000000000000000000000\",bytes19:\"0x00000000000000000000000000000000000000\",bytes20:\"0x0000000000000000000000000000000000000000\",bytes21:\"0x000000000000000000000000000000000000000000\",bytes22:\"0x00000000000000000000000000000000000000000000\",bytes23:\"0x0000000000000000000000000000000000000000000000\",bytes24:\"0x000000000000000000000000000000000000000000000000\",bytes25:\"0x00000000000000000000000000000000000000000000000000\",bytes26:\"0x0000000000000000000000000000000000000000000000000000\",bytes27:\"0x000000000000000000000000000000000000000000000000000000\",bytes28:\"0x00000000000000000000000000000000000000000000000000000000\",bytes29:\"0x0000000000000000000000000000000000000000000000000000000000\",bytes30:\"0x000000000000000000000000000000000000000000000000000000000000\",bytes31:\"0x00000000000000000000000000000000000000000000000000000000000000\",bytes32:\"0x0000000000000000000000000000000000000000000000000000000000000000\",bool:!1,address:\"0x0000000000000000000000000000000000000000\",\"uint8[]\":[],\"uint16[]\":[],\"uint24[]\":[],\"uint32[]\":[],\"uint40[]\":[],\"uint48[]\":[],\"uint56[]\":[],\"uint64[]\":[],\"uint72[]\":[],\"uint80[]\":[],\"uint88[]\":[],\"uint96[]\":[],\"uint104[]\":[],\"uint112[]\":[],\"uint120[]\":[],\"uint128[]\":[],\"uint136[]\":[],\"uint144[]\":[],\"uint152[]\":[],\"uint160[]\":[],\"uint168[]\":[],\"uint176[]\":[],\"uint184[]\":[],\"uint192[]\":[],\"uint200[]\":[],\"uint208[]\":[],\"uint216[]\":[],\"uint224[]\":[],\"uint232[]\":[],\"uint240[]\":[],\"uint248[]\":[],\"uint256[]\":[],\"int8[]\":[],\"int16[]\":[],\"int24[]\":[],\"int32[]\":[],\"int40[]\":[],\"int48[]\":[],\"int56[]\":[],\"int64[]\":[],\"int72[]\":[],\"int80[]\":[],\"int88[]\":[],\"int96[]\":[],\"int104[]\":[],\"int112[]\":[],\"int120[]\":[],\"int128[]\":[],\"int136[]\":[],\"int144[]\":[],\"int152[]\":[],\"int160[]\":[],\"int168[]\":[],\"int176[]\":[],\"int184[]\":[],\"int192[]\":[],\"int200[]\":[],\"int208[]\":[],\"int216[]\":[],\"int224[]\":[],\"int232[]\":[],\"int240[]\":[],\"int248[]\":[],\"int256[]\":[],\"bytes1[]\":[],\"bytes2[]\":[],\"bytes3[]\":[],\"bytes4[]\":[],\"bytes5[]\":[],\"bytes6[]\":[],\"bytes7[]\":[],\"bytes8[]\":[],\"bytes9[]\":[],\"bytes10[]\":[],\"bytes11[]\":[],\"bytes12[]\":[],\"bytes13[]\":[],\"bytes14[]\":[],\"bytes15[]\":[],\"bytes16[]\":[],\"bytes17[]\":[],\"bytes18[]\":[],\"bytes19[]\":[],\"bytes20[]\":[],\"bytes21[]\":[],\"bytes22[]\":[],\"bytes23[]\":[],\"bytes24[]\":[],\"bytes25[]\":[],\"bytes26[]\":[],\"bytes27[]\":[],\"bytes28[]\":[],\"bytes29[]\":[],\"bytes30[]\":[],\"bytes31[]\":[],\"bytes32[]\":[],\"bool[]\":[],\"address[]\":[],bytes:\"0x\",string:\"\"};function g(R){let A=R.replace(/(\\w+)\\[\\d+\\]/g,\"$1[]\");return B[A]}export{_ as AbiTypeToSchemaType,s as AbiTypes,I as SchemaType,u as SchemaTypeArrayToElement,Y as SchemaTypeToAbiType,U as StaticAbiTypes,o as encodeSchema,g as getAbiTypeDefaultValue,n as getStaticByteLength};\n//# sourceMappingURL=index.js.map","var util;\n(function (util) {\n util.assertEqual = (val) => val;\n function assertIs(_arg) { }\n util.assertIs = assertIs;\n function assertNever(_x) {\n throw new Error();\n }\n util.assertNever = assertNever;\n util.arrayToEnum = (items) => {\n const obj = {};\n for (const item of items) {\n obj[item] = item;\n }\n return obj;\n };\n util.getValidEnumValues = (obj) => {\n const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== \"number\");\n const filtered = {};\n for (const k of validKeys) {\n filtered[k] = obj[k];\n }\n return util.objectValues(filtered);\n };\n util.objectValues = (obj) => {\n return util.objectKeys(obj).map(function (e) {\n return obj[e];\n });\n };\n util.objectKeys = typeof Object.keys === \"function\" // eslint-disable-line ban/ban\n ? (obj) => Object.keys(obj) // eslint-disable-line ban/ban\n : (object) => {\n const keys = [];\n for (const key in object) {\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n keys.push(key);\n }\n }\n return keys;\n };\n util.find = (arr, checker) => {\n for (const item of arr) {\n if (checker(item))\n return item;\n }\n return undefined;\n };\n util.isInteger = typeof Number.isInteger === \"function\"\n ? (val) => Number.isInteger(val) // eslint-disable-line ban/ban\n : (val) => typeof val === \"number\" && isFinite(val) && Math.floor(val) === val;\n function joinValues(array, separator = \" | \") {\n return array\n .map((val) => (typeof val === \"string\" ? `'${val}'` : val))\n .join(separator);\n }\n util.joinValues = joinValues;\n util.jsonStringifyReplacer = (_, value) => {\n if (typeof value === \"bigint\") {\n return value.toString();\n }\n return value;\n };\n})(util || (util = {}));\nvar objectUtil;\n(function (objectUtil) {\n objectUtil.mergeShapes = (first, second) => {\n return {\n ...first,\n ...second, // second overwrites first\n };\n };\n})(objectUtil || (objectUtil = {}));\nconst ZodParsedType = util.arrayToEnum([\n \"string\",\n \"nan\",\n \"number\",\n \"integer\",\n \"float\",\n \"boolean\",\n \"date\",\n \"bigint\",\n \"symbol\",\n \"function\",\n \"undefined\",\n \"null\",\n \"array\",\n \"object\",\n \"unknown\",\n \"promise\",\n \"void\",\n \"never\",\n \"map\",\n \"set\",\n]);\nconst getParsedType = (data) => {\n const t = typeof data;\n switch (t) {\n case \"undefined\":\n return ZodParsedType.undefined;\n case \"string\":\n return ZodParsedType.string;\n case \"number\":\n return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;\n case \"boolean\":\n return ZodParsedType.boolean;\n case \"function\":\n return ZodParsedType.function;\n case \"bigint\":\n return ZodParsedType.bigint;\n case \"symbol\":\n return ZodParsedType.symbol;\n case \"object\":\n if (Array.isArray(data)) {\n return ZodParsedType.array;\n }\n if (data === null) {\n return ZodParsedType.null;\n }\n if (data.then &&\n typeof data.then === \"function\" &&\n data.catch &&\n typeof data.catch === \"function\") {\n return ZodParsedType.promise;\n }\n if (typeof Map !== \"undefined\" && data instanceof Map) {\n return ZodParsedType.map;\n }\n if (typeof Set !== \"undefined\" && data instanceof Set) {\n return ZodParsedType.set;\n }\n if (typeof Date !== \"undefined\" && data instanceof Date) {\n return ZodParsedType.date;\n }\n return ZodParsedType.object;\n default:\n return ZodParsedType.unknown;\n }\n};\n\nconst ZodIssueCode = util.arrayToEnum([\n \"invalid_type\",\n \"invalid_literal\",\n \"custom\",\n \"invalid_union\",\n \"invalid_union_discriminator\",\n \"invalid_enum_value\",\n \"unrecognized_keys\",\n \"invalid_arguments\",\n \"invalid_return_type\",\n \"invalid_date\",\n \"invalid_string\",\n \"too_small\",\n \"too_big\",\n \"invalid_intersection_types\",\n \"not_multiple_of\",\n \"not_finite\",\n]);\nconst quotelessJson = (obj) => {\n const json = JSON.stringify(obj, null, 2);\n return json.replace(/\"([^\"]+)\":/g, \"$1:\");\n};\nclass ZodError extends Error {\n constructor(issues) {\n super();\n this.issues = [];\n this.addIssue = (sub) => {\n this.issues = [...this.issues, sub];\n };\n this.addIssues = (subs = []) => {\n this.issues = [...this.issues, ...subs];\n };\n const actualProto = new.target.prototype;\n if (Object.setPrototypeOf) {\n // eslint-disable-next-line ban/ban\n Object.setPrototypeOf(this, actualProto);\n }\n else {\n this.__proto__ = actualProto;\n }\n this.name = \"ZodError\";\n this.issues = issues;\n }\n get errors() {\n return this.issues;\n }\n format(_mapper) {\n const mapper = _mapper ||\n function (issue) {\n return issue.message;\n };\n const fieldErrors = { _errors: [] };\n const processError = (error) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\") {\n issue.unionErrors.map(processError);\n }\n else if (issue.code === \"invalid_return_type\") {\n processError(issue.returnTypeError);\n }\n else if (issue.code === \"invalid_arguments\") {\n processError(issue.argumentsError);\n }\n else if (issue.path.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < issue.path.length) {\n const el = issue.path[i];\n const terminal = i === issue.path.length - 1;\n if (!terminal) {\n curr[el] = curr[el] || { _errors: [] };\n // if (typeof el === \"string\") {\n // curr[el] = curr[el] || { _errors: [] };\n // } else if (typeof el === \"number\") {\n // const errorArray: any = [];\n // errorArray._errors = [];\n // curr[el] = curr[el] || errorArray;\n // }\n }\n else {\n curr[el] = curr[el] || { _errors: [] };\n curr[el]._errors.push(mapper(issue));\n }\n curr = curr[el];\n i++;\n }\n }\n }\n };\n processError(this);\n return fieldErrors;\n }\n toString() {\n return this.message;\n }\n get message() {\n return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);\n }\n get isEmpty() {\n return this.issues.length === 0;\n }\n flatten(mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of this.issues) {\n if (sub.path.length > 0) {\n fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];\n fieldErrors[sub.path[0]].push(mapper(sub));\n }\n else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n }\n get formErrors() {\n return this.flatten();\n }\n}\nZodError.create = (issues) => {\n const error = new ZodError(issues);\n return error;\n};\n\nconst errorMap = (issue, _ctx) => {\n let message;\n switch (issue.code) {\n case ZodIssueCode.invalid_type:\n if (issue.received === ZodParsedType.undefined) {\n message = \"Required\";\n }\n else {\n message = `Expected ${issue.expected}, received ${issue.received}`;\n }\n break;\n case ZodIssueCode.invalid_literal:\n message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;\n break;\n case ZodIssueCode.unrecognized_keys:\n message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, \", \")}`;\n break;\n case ZodIssueCode.invalid_union:\n message = `Invalid input`;\n break;\n case ZodIssueCode.invalid_union_discriminator:\n message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;\n break;\n case ZodIssueCode.invalid_enum_value:\n message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;\n break;\n case ZodIssueCode.invalid_arguments:\n message = `Invalid function arguments`;\n break;\n case ZodIssueCode.invalid_return_type:\n message = `Invalid function return type`;\n break;\n case ZodIssueCode.invalid_date:\n message = `Invalid date`;\n break;\n case ZodIssueCode.invalid_string:\n if (typeof issue.validation === \"object\") {\n if (\"includes\" in issue.validation) {\n message = `Invalid input: must include \"${issue.validation.includes}\"`;\n if (typeof issue.validation.position === \"number\") {\n message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;\n }\n }\n else if (\"startsWith\" in issue.validation) {\n message = `Invalid input: must start with \"${issue.validation.startsWith}\"`;\n }\n else if (\"endsWith\" in issue.validation) {\n message = `Invalid input: must end with \"${issue.validation.endsWith}\"`;\n }\n else {\n util.assertNever(issue.validation);\n }\n }\n else if (issue.validation !== \"regex\") {\n message = `Invalid ${issue.validation}`;\n }\n else {\n message = \"Invalid\";\n }\n break;\n case ZodIssueCode.too_small:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact\n ? `exactly equal to `\n : issue.inclusive\n ? `greater than or equal to `\n : `greater than `}${issue.minimum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact\n ? `exactly equal to `\n : issue.inclusive\n ? `greater than or equal to `\n : `greater than `}${new Date(Number(issue.minimum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodIssueCode.too_big:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact\n ? `exactly`\n : issue.inclusive\n ? `less than or equal to`\n : `less than`} ${issue.maximum}`;\n else if (issue.type === \"bigint\")\n message = `BigInt must be ${issue.exact\n ? `exactly`\n : issue.inclusive\n ? `less than or equal to`\n : `less than`} ${issue.maximum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact\n ? `exactly`\n : issue.inclusive\n ? `smaller than or equal to`\n : `smaller than`} ${new Date(Number(issue.maximum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodIssueCode.custom:\n message = `Invalid input`;\n break;\n case ZodIssueCode.invalid_intersection_types:\n message = `Intersection results could not be merged`;\n break;\n case ZodIssueCode.not_multiple_of:\n message = `Number must be a multiple of ${issue.multipleOf}`;\n break;\n case ZodIssueCode.not_finite:\n message = \"Number must be finite\";\n break;\n default:\n message = _ctx.defaultError;\n util.assertNever(issue);\n }\n return { message };\n};\n\nlet overrideErrorMap = errorMap;\nfunction setErrorMap(map) {\n overrideErrorMap = map;\n}\nfunction getErrorMap() {\n return overrideErrorMap;\n}\n\nconst makeIssue = (params) => {\n const { data, path, errorMaps, issueData } = params;\n const fullPath = [...path, ...(issueData.path || [])];\n const fullIssue = {\n ...issueData,\n path: fullPath,\n };\n let errorMessage = \"\";\n const maps = errorMaps\n .filter((m) => !!m)\n .slice()\n .reverse();\n for (const map of maps) {\n errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;\n }\n return {\n ...issueData,\n path: fullPath,\n message: issueData.message || errorMessage,\n };\n};\nconst EMPTY_PATH = [];\nfunction addIssueToContext(ctx, issueData) {\n const issue = makeIssue({\n issueData: issueData,\n data: ctx.data,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap,\n ctx.schemaErrorMap,\n getErrorMap(),\n errorMap, // then global default map\n ].filter((x) => !!x),\n });\n ctx.common.issues.push(issue);\n}\nclass ParseStatus {\n constructor() {\n this.value = \"valid\";\n }\n dirty() {\n if (this.value === \"valid\")\n this.value = \"dirty\";\n }\n abort() {\n if (this.value !== \"aborted\")\n this.value = \"aborted\";\n }\n static mergeArray(status, results) {\n const arrayValue = [];\n for (const s of results) {\n if (s.status === \"aborted\")\n return INVALID;\n if (s.status === \"dirty\")\n status.dirty();\n arrayValue.push(s.value);\n }\n return { status: status.value, value: arrayValue };\n }\n static async mergeObjectAsync(status, pairs) {\n const syncPairs = [];\n for (const pair of pairs) {\n syncPairs.push({\n key: await pair.key,\n value: await pair.value,\n });\n }\n return ParseStatus.mergeObjectSync(status, syncPairs);\n }\n static mergeObjectSync(status, pairs) {\n const finalObject = {};\n for (const pair of pairs) {\n const { key, value } = pair;\n if (key.status === \"aborted\")\n return INVALID;\n if (value.status === \"aborted\")\n return INVALID;\n if (key.status === \"dirty\")\n status.dirty();\n if (value.status === \"dirty\")\n status.dirty();\n if (key.value !== \"__proto__\" &&\n (typeof value.value !== \"undefined\" || pair.alwaysSet)) {\n finalObject[key.value] = value.value;\n }\n }\n return { status: status.value, value: finalObject };\n }\n}\nconst INVALID = Object.freeze({\n status: \"aborted\",\n});\nconst DIRTY = (value) => ({ status: \"dirty\", value });\nconst OK = (value) => ({ status: \"valid\", value });\nconst isAborted = (x) => x.status === \"aborted\";\nconst isDirty = (x) => x.status === \"dirty\";\nconst isValid = (x) => x.status === \"valid\";\nconst isAsync = (x) => typeof Promise !== \"undefined\" && x instanceof Promise;\n\nvar errorUtil;\n(function (errorUtil) {\n errorUtil.errToObj = (message) => typeof message === \"string\" ? { message } : message || {};\n errorUtil.toString = (message) => typeof message === \"string\" ? message : message === null || message === void 0 ? void 0 : message.message;\n})(errorUtil || (errorUtil = {}));\n\nclass ParseInputLazyPath {\n constructor(parent, value, path, key) {\n this._cachedPath = [];\n this.parent = parent;\n this.data = value;\n this._path = path;\n this._key = key;\n }\n get path() {\n if (!this._cachedPath.length) {\n if (this._key instanceof Array) {\n this._cachedPath.push(...this._path, ...this._key);\n }\n else {\n this._cachedPath.push(...this._path, this._key);\n }\n }\n return this._cachedPath;\n }\n}\nconst handleResult = (ctx, result) => {\n if (isValid(result)) {\n return { success: true, data: result.value };\n }\n else {\n if (!ctx.common.issues.length) {\n throw new Error(\"Validation failed but no issues detected.\");\n }\n return {\n success: false,\n get error() {\n if (this._error)\n return this._error;\n const error = new ZodError(ctx.common.issues);\n this._error = error;\n return this._error;\n },\n };\n }\n};\nfunction processCreateParams(params) {\n if (!params)\n return {};\n const { errorMap, invalid_type_error, required_error, description } = params;\n if (errorMap && (invalid_type_error || required_error)) {\n throw new Error(`Can't use \"invalid_type_error\" or \"required_error\" in conjunction with custom error map.`);\n }\n if (errorMap)\n return { errorMap: errorMap, description };\n const customMap = (iss, ctx) => {\n if (iss.code !== \"invalid_type\")\n return { message: ctx.defaultError };\n if (typeof ctx.data === \"undefined\") {\n return { message: required_error !== null && required_error !== void 0 ? required_error : ctx.defaultError };\n }\n return { message: invalid_type_error !== null && invalid_type_error !== void 0 ? invalid_type_error : ctx.defaultError };\n };\n return { errorMap: customMap, description };\n}\nclass ZodType {\n constructor(def) {\n /** Alias of safeParseAsync */\n this.spa = this.safeParseAsync;\n this._def = def;\n this.parse = this.parse.bind(this);\n this.safeParse = this.safeParse.bind(this);\n this.parseAsync = this.parseAsync.bind(this);\n this.safeParseAsync = this.safeParseAsync.bind(this);\n this.spa = this.spa.bind(this);\n this.refine = this.refine.bind(this);\n this.refinement = this.refinement.bind(this);\n this.superRefine = this.superRefine.bind(this);\n this.optional = this.optional.bind(this);\n this.nullable = this.nullable.bind(this);\n this.nullish = this.nullish.bind(this);\n this.array = this.array.bind(this);\n this.promise = this.promise.bind(this);\n this.or = this.or.bind(this);\n this.and = this.and.bind(this);\n this.transform = this.transform.bind(this);\n this.brand = this.brand.bind(this);\n this.default = this.default.bind(this);\n this.catch = this.catch.bind(this);\n this.describe = this.describe.bind(this);\n this.pipe = this.pipe.bind(this);\n this.readonly = this.readonly.bind(this);\n this.isNullable = this.isNullable.bind(this);\n this.isOptional = this.isOptional.bind(this);\n }\n get description() {\n return this._def.description;\n }\n _getType(input) {\n return getParsedType(input.data);\n }\n _getOrReturnCtx(input, ctx) {\n return (ctx || {\n common: input.parent.common,\n data: input.data,\n parsedType: getParsedType(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent,\n });\n }\n _processInputParams(input) {\n return {\n status: new ParseStatus(),\n ctx: {\n common: input.parent.common,\n data: input.data,\n parsedType: getParsedType(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent,\n },\n };\n }\n _parseSync(input) {\n const result = this._parse(input);\n if (isAsync(result)) {\n throw new Error(\"Synchronous parse encountered promise.\");\n }\n return result;\n }\n _parseAsync(input) {\n const result = this._parse(input);\n return Promise.resolve(result);\n }\n parse(data, params) {\n const result = this.safeParse(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n safeParse(data, params) {\n var _a;\n const ctx = {\n common: {\n issues: [],\n async: (_a = params === null || params === void 0 ? void 0 : params.async) !== null && _a !== void 0 ? _a : false,\n contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,\n },\n path: (params === null || params === void 0 ? void 0 : params.path) || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n const result = this._parseSync({ data, path: ctx.path, parent: ctx });\n return handleResult(ctx, result);\n }\n async parseAsync(data, params) {\n const result = await this.safeParseAsync(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n async safeParseAsync(data, params) {\n const ctx = {\n common: {\n issues: [],\n contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,\n async: true,\n },\n path: (params === null || params === void 0 ? void 0 : params.path) || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });\n const result = await (isAsync(maybeAsyncResult)\n ? maybeAsyncResult\n : Promise.resolve(maybeAsyncResult));\n return handleResult(ctx, result);\n }\n refine(check, message) {\n const getIssueProperties = (val) => {\n if (typeof message === \"string\" || typeof message === \"undefined\") {\n return { message };\n }\n else if (typeof message === \"function\") {\n return message(val);\n }\n else {\n return message;\n }\n };\n return this._refinement((val, ctx) => {\n const result = check(val);\n const setError = () => ctx.addIssue({\n code: ZodIssueCode.custom,\n ...getIssueProperties(val),\n });\n if (typeof Promise !== \"undefined\" && result instanceof Promise) {\n return result.then((data) => {\n if (!data) {\n setError();\n return false;\n }\n else {\n return true;\n }\n });\n }\n if (!result) {\n setError();\n return false;\n }\n else {\n return true;\n }\n });\n }\n refinement(check, refinementData) {\n return this._refinement((val, ctx) => {\n if (!check(val)) {\n ctx.addIssue(typeof refinementData === \"function\"\n ? refinementData(val, ctx)\n : refinementData);\n return false;\n }\n else {\n return true;\n }\n });\n }\n _refinement(refinement) {\n return new ZodEffects({\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"refinement\", refinement },\n });\n }\n superRefine(refinement) {\n return this._refinement(refinement);\n }\n optional() {\n return ZodOptional.create(this, this._def);\n }\n nullable() {\n return ZodNullable.create(this, this._def);\n }\n nullish() {\n return this.nullable().optional();\n }\n array() {\n return ZodArray.create(this, this._def);\n }\n promise() {\n return ZodPromise.create(this, this._def);\n }\n or(option) {\n return ZodUnion.create([this, option], this._def);\n }\n and(incoming) {\n return ZodIntersection.create(this, incoming, this._def);\n }\n transform(transform) {\n return new ZodEffects({\n ...processCreateParams(this._def),\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"transform\", transform },\n });\n }\n default(def) {\n const defaultValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodDefault({\n ...processCreateParams(this._def),\n innerType: this,\n defaultValue: defaultValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodDefault,\n });\n }\n brand() {\n return new ZodBranded({\n typeName: ZodFirstPartyTypeKind.ZodBranded,\n type: this,\n ...processCreateParams(this._def),\n });\n }\n catch(def) {\n const catchValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodCatch({\n ...processCreateParams(this._def),\n innerType: this,\n catchValue: catchValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodCatch,\n });\n }\n describe(description) {\n const This = this.constructor;\n return new This({\n ...this._def,\n description,\n });\n }\n pipe(target) {\n return ZodPipeline.create(this, target);\n }\n readonly() {\n return ZodReadonly.create(this);\n }\n isOptional() {\n return this.safeParse(undefined).success;\n }\n isNullable() {\n return this.safeParse(null).success;\n }\n}\nconst cuidRegex = /^c[^\\s-]{8,}$/i;\nconst cuid2Regex = /^[a-z][a-z0-9]*$/;\nconst ulidRegex = /[0-9A-HJKMNP-TV-Z]{26}/;\n// const uuidRegex =\n// /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;\nconst uuidRegex = /^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$/i;\n// from https://stackoverflow.com/a/46181/1550155\n// old version: too slow, didn't support unicode\n// const emailRegex = /^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))$/i;\n//old email regex\n// const emailRegex = /^(([^<>()[\\].,;:\\s@\"]+(\\.[^<>()[\\].,;:\\s@\"]+)*)|(\".+\"))@((?!-)([^<>()[\\].,;:\\s@\"]+\\.)+[^<>()[\\].,;:\\s@\"]{1,})[^-<>()[\\].,;:\\s@\"]$/i;\n// eslint-disable-next-line\n// const emailRegex =\n// /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\])|(\\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\\.[A-Za-z]{2,})+))$/;\n// const emailRegex =\n// /^[a-zA-Z0-9\\.\\!\\#\\$\\%\\&\\'\\*\\+\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~\\-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n// const emailRegex =\n// /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$/i;\nconst emailRegex = /^([A-Z0-9_+-]+\\.?)*[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\\-]*\\.)+[A-Z]{2,}$/i;\n// const emailRegex =\n// /^[a-z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-z0-9-]+(?:\\.[a-z0-9\\-]+)*$/i;\n// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression\nconst emojiRegex = /^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$/u;\nconst ipv4Regex = /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/;\nconst ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;\n// Adapted from https://stackoverflow.com/a/3143231\nconst datetimeRegex = (args) => {\n if (args.precision) {\n if (args.offset) {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}\\\\.\\\\d{${args.precision}}(([+-]\\\\d{2}(:?\\\\d{2})?)|Z)$`);\n }\n else {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}\\\\.\\\\d{${args.precision}}Z$`);\n }\n }\n else if (args.precision === 0) {\n if (args.offset) {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}(([+-]\\\\d{2}(:?\\\\d{2})?)|Z)$`);\n }\n else {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}Z$`);\n }\n }\n else {\n if (args.offset) {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}(\\\\.\\\\d+)?(([+-]\\\\d{2}(:?\\\\d{2})?)|Z)$`);\n }\n else {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}(\\\\.\\\\d+)?Z$`);\n }\n }\n};\nfunction isValidIP(ip, version) {\n if ((version === \"v4\" || !version) && ipv4Regex.test(ip)) {\n return true;\n }\n if ((version === \"v6\" || !version) && ipv6Regex.test(ip)) {\n return true;\n }\n return false;\n}\nclass ZodString extends ZodType {\n constructor() {\n super(...arguments);\n this._regex = (regex, validation, message) => this.refinement((data) => regex.test(data), {\n validation,\n code: ZodIssueCode.invalid_string,\n ...errorUtil.errToObj(message),\n });\n /**\n * @deprecated Use z.string().min(1) instead.\n * @see {@link ZodString.min}\n */\n this.nonempty = (message) => this.min(1, errorUtil.errToObj(message));\n this.trim = () => new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"trim\" }],\n });\n this.toLowerCase = () => new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toLowerCase\" }],\n });\n this.toUpperCase = () => new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toUpperCase\" }],\n });\n }\n _parse(input) {\n if (this._def.coerce) {\n input.data = String(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.string) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.string,\n received: ctx.parsedType,\n }\n //\n );\n return INVALID;\n }\n const status = new ParseStatus();\n let ctx = undefined;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.length < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n if (input.data.length > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"length\") {\n const tooBig = input.data.length > check.value;\n const tooSmall = input.data.length < check.value;\n if (tooBig || tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n if (tooBig) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n }\n else if (tooSmall) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n }\n status.dirty();\n }\n }\n else if (check.kind === \"email\") {\n if (!emailRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"email\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"emoji\") {\n if (!emojiRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"emoji\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"uuid\") {\n if (!uuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"uuid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cuid\") {\n if (!cuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cuid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cuid2\") {\n if (!cuid2Regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cuid2\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"ulid\") {\n if (!ulidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"ulid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"url\") {\n try {\n new URL(input.data);\n }\n catch (_a) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"url\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"regex\") {\n check.regex.lastIndex = 0;\n const testResult = check.regex.test(input.data);\n if (!testResult) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"regex\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"trim\") {\n input.data = input.data.trim();\n }\n else if (check.kind === \"includes\") {\n if (!input.data.includes(check.value, check.position)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { includes: check.value, position: check.position },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"toLowerCase\") {\n input.data = input.data.toLowerCase();\n }\n else if (check.kind === \"toUpperCase\") {\n input.data = input.data.toUpperCase();\n }\n else if (check.kind === \"startsWith\") {\n if (!input.data.startsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { startsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"endsWith\") {\n if (!input.data.endsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { endsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"datetime\") {\n const regex = datetimeRegex(check);\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"datetime\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"ip\") {\n if (!isValidIP(input.data, check.version)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"ip\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n _addCheck(check) {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n email(message) {\n return this._addCheck({ kind: \"email\", ...errorUtil.errToObj(message) });\n }\n url(message) {\n return this._addCheck({ kind: \"url\", ...errorUtil.errToObj(message) });\n }\n emoji(message) {\n return this._addCheck({ kind: \"emoji\", ...errorUtil.errToObj(message) });\n }\n uuid(message) {\n return this._addCheck({ kind: \"uuid\", ...errorUtil.errToObj(message) });\n }\n cuid(message) {\n return this._addCheck({ kind: \"cuid\", ...errorUtil.errToObj(message) });\n }\n cuid2(message) {\n return this._addCheck({ kind: \"cuid2\", ...errorUtil.errToObj(message) });\n }\n ulid(message) {\n return this._addCheck({ kind: \"ulid\", ...errorUtil.errToObj(message) });\n }\n ip(options) {\n return this._addCheck({ kind: \"ip\", ...errorUtil.errToObj(options) });\n }\n datetime(options) {\n var _a;\n if (typeof options === \"string\") {\n return this._addCheck({\n kind: \"datetime\",\n precision: null,\n offset: false,\n message: options,\n });\n }\n return this._addCheck({\n kind: \"datetime\",\n precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === \"undefined\" ? null : options === null || options === void 0 ? void 0 : options.precision,\n offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,\n ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),\n });\n }\n regex(regex, message) {\n return this._addCheck({\n kind: \"regex\",\n regex: regex,\n ...errorUtil.errToObj(message),\n });\n }\n includes(value, options) {\n return this._addCheck({\n kind: \"includes\",\n value: value,\n position: options === null || options === void 0 ? void 0 : options.position,\n ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),\n });\n }\n startsWith(value, message) {\n return this._addCheck({\n kind: \"startsWith\",\n value: value,\n ...errorUtil.errToObj(message),\n });\n }\n endsWith(value, message) {\n return this._addCheck({\n kind: \"endsWith\",\n value: value,\n ...errorUtil.errToObj(message),\n });\n }\n min(minLength, message) {\n return this._addCheck({\n kind: \"min\",\n value: minLength,\n ...errorUtil.errToObj(message),\n });\n }\n max(maxLength, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxLength,\n ...errorUtil.errToObj(message),\n });\n }\n length(len, message) {\n return this._addCheck({\n kind: \"length\",\n value: len,\n ...errorUtil.errToObj(message),\n });\n }\n get isDatetime() {\n return !!this._def.checks.find((ch) => ch.kind === \"datetime\");\n }\n get isEmail() {\n return !!this._def.checks.find((ch) => ch.kind === \"email\");\n }\n get isURL() {\n return !!this._def.checks.find((ch) => ch.kind === \"url\");\n }\n get isEmoji() {\n return !!this._def.checks.find((ch) => ch.kind === \"emoji\");\n }\n get isUUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"uuid\");\n }\n get isCUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid\");\n }\n get isCUID2() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid2\");\n }\n get isULID() {\n return !!this._def.checks.find((ch) => ch.kind === \"ulid\");\n }\n get isIP() {\n return !!this._def.checks.find((ch) => ch.kind === \"ip\");\n }\n get minLength() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxLength() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n}\nZodString.create = (params) => {\n var _a;\n return new ZodString({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodString,\n coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,\n ...processCreateParams(params),\n });\n};\n// https://stackoverflow.com/questions/3966484/why-does-modulus-operator-return-fractional-number-in-javascript/31711034#31711034\nfunction floatSafeRemainder(val, step) {\n const valDecCount = (val.toString().split(\".\")[1] || \"\").length;\n const stepDecCount = (step.toString().split(\".\")[1] || \"\").length;\n const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;\n const valInt = parseInt(val.toFixed(decCount).replace(\".\", \"\"));\n const stepInt = parseInt(step.toFixed(decCount).replace(\".\", \"\"));\n return (valInt % stepInt) / Math.pow(10, decCount);\n}\nclass ZodNumber extends ZodType {\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n this.step = this.multipleOf;\n }\n _parse(input) {\n if (this._def.coerce) {\n input.data = Number(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.number) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.number,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n let ctx = undefined;\n const status = new ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"int\") {\n if (!util.isInteger(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: \"integer\",\n received: \"float\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"min\") {\n const tooSmall = check.inclusive\n ? input.data < check.value\n : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n const tooBig = check.inclusive\n ? input.data > check.value\n : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"multipleOf\") {\n if (floatSafeRemainder(input.data, check.value) !== 0) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"finite\") {\n if (!Number.isFinite(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_finite,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new ZodNumber({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil.toString(message),\n },\n ],\n });\n }\n _addCheck(check) {\n return new ZodNumber({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n int(message) {\n return this._addCheck({\n kind: \"int\",\n message: errorUtil.toString(message),\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value: value,\n message: errorUtil.toString(message),\n });\n }\n finite(message) {\n return this._addCheck({\n kind: \"finite\",\n message: errorUtil.toString(message),\n });\n }\n safe(message) {\n return this._addCheck({\n kind: \"min\",\n inclusive: true,\n value: Number.MIN_SAFE_INTEGER,\n message: errorUtil.toString(message),\n })._addCheck({\n kind: \"max\",\n inclusive: true,\n value: Number.MAX_SAFE_INTEGER,\n message: errorUtil.toString(message),\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n get isInt() {\n return !!this._def.checks.find((ch) => ch.kind === \"int\" ||\n (ch.kind === \"multipleOf\" && util.isInteger(ch.value)));\n }\n get isFinite() {\n let max = null, min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"finite\" ||\n ch.kind === \"int\" ||\n ch.kind === \"multipleOf\") {\n return true;\n }\n else if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n else if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return Number.isFinite(min) && Number.isFinite(max);\n }\n}\nZodNumber.create = (params) => {\n return new ZodNumber({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodNumber,\n coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,\n ...processCreateParams(params),\n });\n};\nclass ZodBigInt extends ZodType {\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n }\n _parse(input) {\n if (this._def.coerce) {\n input.data = BigInt(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.bigint) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.bigint,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n let ctx = undefined;\n const status = new ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n const tooSmall = check.inclusive\n ? input.data < check.value\n : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n type: \"bigint\",\n minimum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n const tooBig = check.inclusive\n ? input.data > check.value\n : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n type: \"bigint\",\n maximum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"multipleOf\") {\n if (input.data % check.value !== BigInt(0)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new ZodBigInt({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil.toString(message),\n },\n ],\n });\n }\n _addCheck(check) {\n return new ZodBigInt({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value,\n message: errorUtil.toString(message),\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n}\nZodBigInt.create = (params) => {\n var _a;\n return new ZodBigInt({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodBigInt,\n coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,\n ...processCreateParams(params),\n });\n};\nclass ZodBoolean extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = Boolean(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.boolean) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.boolean,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodBoolean.create = (params) => {\n return new ZodBoolean({\n typeName: ZodFirstPartyTypeKind.ZodBoolean,\n coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,\n ...processCreateParams(params),\n });\n};\nclass ZodDate extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = new Date(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.date) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.date,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (isNaN(input.data.getTime())) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_date,\n });\n return INVALID;\n }\n const status = new ParseStatus();\n let ctx = undefined;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.getTime() < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n message: check.message,\n inclusive: true,\n exact: false,\n minimum: check.value,\n type: \"date\",\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n if (input.data.getTime() > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n message: check.message,\n inclusive: true,\n exact: false,\n maximum: check.value,\n type: \"date\",\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return {\n status: status.value,\n value: new Date(input.data.getTime()),\n };\n }\n _addCheck(check) {\n return new ZodDate({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n min(minDate, message) {\n return this._addCheck({\n kind: \"min\",\n value: minDate.getTime(),\n message: errorUtil.toString(message),\n });\n }\n max(maxDate, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxDate.getTime(),\n message: errorUtil.toString(message),\n });\n }\n get minDate() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min != null ? new Date(min) : null;\n }\n get maxDate() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max != null ? new Date(max) : null;\n }\n}\nZodDate.create = (params) => {\n return new ZodDate({\n checks: [],\n coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,\n typeName: ZodFirstPartyTypeKind.ZodDate,\n ...processCreateParams(params),\n });\n};\nclass ZodSymbol extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.symbol) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.symbol,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodSymbol.create = (params) => {\n return new ZodSymbol({\n typeName: ZodFirstPartyTypeKind.ZodSymbol,\n ...processCreateParams(params),\n });\n};\nclass ZodUndefined extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.undefined,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodUndefined.create = (params) => {\n return new ZodUndefined({\n typeName: ZodFirstPartyTypeKind.ZodUndefined,\n ...processCreateParams(params),\n });\n};\nclass ZodNull extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.null) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.null,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodNull.create = (params) => {\n return new ZodNull({\n typeName: ZodFirstPartyTypeKind.ZodNull,\n ...processCreateParams(params),\n });\n};\nclass ZodAny extends ZodType {\n constructor() {\n super(...arguments);\n // to prevent instances of other classes from extending ZodAny. this causes issues with catchall in ZodObject.\n this._any = true;\n }\n _parse(input) {\n return OK(input.data);\n }\n}\nZodAny.create = (params) => {\n return new ZodAny({\n typeName: ZodFirstPartyTypeKind.ZodAny,\n ...processCreateParams(params),\n });\n};\nclass ZodUnknown extends ZodType {\n constructor() {\n super(...arguments);\n // required\n this._unknown = true;\n }\n _parse(input) {\n return OK(input.data);\n }\n}\nZodUnknown.create = (params) => {\n return new ZodUnknown({\n typeName: ZodFirstPartyTypeKind.ZodUnknown,\n ...processCreateParams(params),\n });\n};\nclass ZodNever extends ZodType {\n _parse(input) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.never,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n}\nZodNever.create = (params) => {\n return new ZodNever({\n typeName: ZodFirstPartyTypeKind.ZodNever,\n ...processCreateParams(params),\n });\n};\nclass ZodVoid extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.void,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodVoid.create = (params) => {\n return new ZodVoid({\n typeName: ZodFirstPartyTypeKind.ZodVoid,\n ...processCreateParams(params),\n });\n};\nclass ZodArray extends ZodType {\n _parse(input) {\n const { ctx, status } = this._processInputParams(input);\n const def = this._def;\n if (ctx.parsedType !== ZodParsedType.array) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.array,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (def.exactLength !== null) {\n const tooBig = ctx.data.length > def.exactLength.value;\n const tooSmall = ctx.data.length < def.exactLength.value;\n if (tooBig || tooSmall) {\n addIssueToContext(ctx, {\n code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small,\n minimum: (tooSmall ? def.exactLength.value : undefined),\n maximum: (tooBig ? def.exactLength.value : undefined),\n type: \"array\",\n inclusive: true,\n exact: true,\n message: def.exactLength.message,\n });\n status.dirty();\n }\n }\n if (def.minLength !== null) {\n if (ctx.data.length < def.minLength.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: def.minLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.minLength.message,\n });\n status.dirty();\n }\n }\n if (def.maxLength !== null) {\n if (ctx.data.length > def.maxLength.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: def.maxLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.maxLength.message,\n });\n status.dirty();\n }\n }\n if (ctx.common.async) {\n return Promise.all([...ctx.data].map((item, i) => {\n return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n })).then((result) => {\n return ParseStatus.mergeArray(status, result);\n });\n }\n const result = [...ctx.data].map((item, i) => {\n return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n });\n return ParseStatus.mergeArray(status, result);\n }\n get element() {\n return this._def.type;\n }\n min(minLength, message) {\n return new ZodArray({\n ...this._def,\n minLength: { value: minLength, message: errorUtil.toString(message) },\n });\n }\n max(maxLength, message) {\n return new ZodArray({\n ...this._def,\n maxLength: { value: maxLength, message: errorUtil.toString(message) },\n });\n }\n length(len, message) {\n return new ZodArray({\n ...this._def,\n exactLength: { value: len, message: errorUtil.toString(message) },\n });\n }\n nonempty(message) {\n return this.min(1, message);\n }\n}\nZodArray.create = (schema, params) => {\n return new ZodArray({\n type: schema,\n minLength: null,\n maxLength: null,\n exactLength: null,\n typeName: ZodFirstPartyTypeKind.ZodArray,\n ...processCreateParams(params),\n });\n};\nfunction deepPartialify(schema) {\n if (schema instanceof ZodObject) {\n const newShape = {};\n for (const key in schema.shape) {\n const fieldSchema = schema.shape[key];\n newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));\n }\n return new ZodObject({\n ...schema._def,\n shape: () => newShape,\n });\n }\n else if (schema instanceof ZodArray) {\n return new ZodArray({\n ...schema._def,\n type: deepPartialify(schema.element),\n });\n }\n else if (schema instanceof ZodOptional) {\n return ZodOptional.create(deepPartialify(schema.unwrap()));\n }\n else if (schema instanceof ZodNullable) {\n return ZodNullable.create(deepPartialify(schema.unwrap()));\n }\n else if (schema instanceof ZodTuple) {\n return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));\n }\n else {\n return schema;\n }\n}\nclass ZodObject extends ZodType {\n constructor() {\n super(...arguments);\n this._cached = null;\n /**\n * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.\n * If you want to pass through unknown properties, use `.passthrough()` instead.\n */\n this.nonstrict = this.passthrough;\n // extend<\n // Augmentation extends ZodRawShape,\n // NewOutput extends util.flatten<{\n // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation\n // ? Augmentation[k][\"_output\"]\n // : k extends keyof Output\n // ? Output[k]\n // : never;\n // }>,\n // NewInput extends util.flatten<{\n // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation\n // ? Augmentation[k][\"_input\"]\n // : k extends keyof Input\n // ? Input[k]\n // : never;\n // }>\n // >(\n // augmentation: Augmentation\n // ): ZodObject<\n // extendShape,\n // UnknownKeys,\n // Catchall,\n // NewOutput,\n // NewInput\n // > {\n // return new ZodObject({\n // ...this._def,\n // shape: () => ({\n // ...this._def.shape(),\n // ...augmentation,\n // }),\n // }) as any;\n // }\n /**\n * @deprecated Use `.extend` instead\n * */\n this.augment = this.extend;\n }\n _getCached() {\n if (this._cached !== null)\n return this._cached;\n const shape = this._def.shape();\n const keys = util.objectKeys(shape);\n return (this._cached = { shape, keys });\n }\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.object) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const { status, ctx } = this._processInputParams(input);\n const { shape, keys: shapeKeys } = this._getCached();\n const extraKeys = [];\n if (!(this._def.catchall instanceof ZodNever &&\n this._def.unknownKeys === \"strip\")) {\n for (const key in ctx.data) {\n if (!shapeKeys.includes(key)) {\n extraKeys.push(key);\n }\n }\n }\n const pairs = [];\n for (const key of shapeKeys) {\n const keyValidator = shape[key];\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),\n alwaysSet: key in ctx.data,\n });\n }\n if (this._def.catchall instanceof ZodNever) {\n const unknownKeys = this._def.unknownKeys;\n if (unknownKeys === \"passthrough\") {\n for (const key of extraKeys) {\n pairs.push({\n key: { status: \"valid\", value: key },\n value: { status: \"valid\", value: ctx.data[key] },\n });\n }\n }\n else if (unknownKeys === \"strict\") {\n if (extraKeys.length > 0) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.unrecognized_keys,\n keys: extraKeys,\n });\n status.dirty();\n }\n }\n else if (unknownKeys === \"strip\") ;\n else {\n throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);\n }\n }\n else {\n // run catchall validation\n const catchall = this._def.catchall;\n for (const key of extraKeys) {\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key) //, ctx.child(key), value, getParsedType(value)\n ),\n alwaysSet: key in ctx.data,\n });\n }\n }\n if (ctx.common.async) {\n return Promise.resolve()\n .then(async () => {\n const syncPairs = [];\n for (const pair of pairs) {\n const key = await pair.key;\n syncPairs.push({\n key,\n value: await pair.value,\n alwaysSet: pair.alwaysSet,\n });\n }\n return syncPairs;\n })\n .then((syncPairs) => {\n return ParseStatus.mergeObjectSync(status, syncPairs);\n });\n }\n else {\n return ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get shape() {\n return this._def.shape();\n }\n strict(message) {\n errorUtil.errToObj;\n return new ZodObject({\n ...this._def,\n unknownKeys: \"strict\",\n ...(message !== undefined\n ? {\n errorMap: (issue, ctx) => {\n var _a, _b, _c, _d;\n const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;\n if (issue.code === \"unrecognized_keys\")\n return {\n message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError,\n };\n return {\n message: defaultError,\n };\n },\n }\n : {}),\n });\n }\n strip() {\n return new ZodObject({\n ...this._def,\n unknownKeys: \"strip\",\n });\n }\n passthrough() {\n return new ZodObject({\n ...this._def,\n unknownKeys: \"passthrough\",\n });\n }\n // const AugmentFactory =\n // (def: Def) =>\n // (\n // augmentation: Augmentation\n // ): ZodObject<\n // extendShape, Augmentation>,\n // Def[\"unknownKeys\"],\n // Def[\"catchall\"]\n // > => {\n // return new ZodObject({\n // ...def,\n // shape: () => ({\n // ...def.shape(),\n // ...augmentation,\n // }),\n // }) as any;\n // };\n extend(augmentation) {\n return new ZodObject({\n ...this._def,\n shape: () => ({\n ...this._def.shape(),\n ...augmentation,\n }),\n });\n }\n /**\n * Prior to zod@1.0.12 there was a bug in the\n * inferred type of merged objects. Please\n * upgrade if you are experiencing issues.\n */\n merge(merging) {\n const merged = new ZodObject({\n unknownKeys: merging._def.unknownKeys,\n catchall: merging._def.catchall,\n shape: () => ({\n ...this._def.shape(),\n ...merging._def.shape(),\n }),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n });\n return merged;\n }\n // merge<\n // Incoming extends AnyZodObject,\n // Augmentation extends Incoming[\"shape\"],\n // NewOutput extends {\n // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation\n // ? Augmentation[k][\"_output\"]\n // : k extends keyof Output\n // ? Output[k]\n // : never;\n // },\n // NewInput extends {\n // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation\n // ? Augmentation[k][\"_input\"]\n // : k extends keyof Input\n // ? Input[k]\n // : never;\n // }\n // >(\n // merging: Incoming\n // ): ZodObject<\n // extendShape>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"],\n // NewOutput,\n // NewInput\n // > {\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n setKey(key, schema) {\n return this.augment({ [key]: schema });\n }\n // merge(\n // merging: Incoming\n // ): //ZodObject = (merging) => {\n // ZodObject<\n // extendShape>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"]\n // > {\n // // const mergedShape = objectUtil.mergeShapes(\n // // this._def.shape(),\n // // merging._def.shape()\n // // );\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n catchall(index) {\n return new ZodObject({\n ...this._def,\n catchall: index,\n });\n }\n pick(mask) {\n const shape = {};\n util.objectKeys(mask).forEach((key) => {\n if (mask[key] && this.shape[key]) {\n shape[key] = this.shape[key];\n }\n });\n return new ZodObject({\n ...this._def,\n shape: () => shape,\n });\n }\n omit(mask) {\n const shape = {};\n util.objectKeys(this.shape).forEach((key) => {\n if (!mask[key]) {\n shape[key] = this.shape[key];\n }\n });\n return new ZodObject({\n ...this._def,\n shape: () => shape,\n });\n }\n /**\n * @deprecated\n */\n deepPartial() {\n return deepPartialify(this);\n }\n partial(mask) {\n const newShape = {};\n util.objectKeys(this.shape).forEach((key) => {\n const fieldSchema = this.shape[key];\n if (mask && !mask[key]) {\n newShape[key] = fieldSchema;\n }\n else {\n newShape[key] = fieldSchema.optional();\n }\n });\n return new ZodObject({\n ...this._def,\n shape: () => newShape,\n });\n }\n required(mask) {\n const newShape = {};\n util.objectKeys(this.shape).forEach((key) => {\n if (mask && !mask[key]) {\n newShape[key] = this.shape[key];\n }\n else {\n const fieldSchema = this.shape[key];\n let newField = fieldSchema;\n while (newField instanceof ZodOptional) {\n newField = newField._def.innerType;\n }\n newShape[key] = newField;\n }\n });\n return new ZodObject({\n ...this._def,\n shape: () => newShape,\n });\n }\n keyof() {\n return createZodEnum(util.objectKeys(this.shape));\n }\n}\nZodObject.create = (shape, params) => {\n return new ZodObject({\n shape: () => shape,\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nZodObject.strictCreate = (shape, params) => {\n return new ZodObject({\n shape: () => shape,\n unknownKeys: \"strict\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nZodObject.lazycreate = (shape, params) => {\n return new ZodObject({\n shape,\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nclass ZodUnion extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const options = this._def.options;\n function handleResults(results) {\n // return first issue-free validation if it exists\n for (const result of results) {\n if (result.result.status === \"valid\") {\n return result.result;\n }\n }\n for (const result of results) {\n if (result.result.status === \"dirty\") {\n // add issues from dirty option\n ctx.common.issues.push(...result.ctx.common.issues);\n return result.result;\n }\n }\n // return invalid\n const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues));\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union,\n unionErrors,\n });\n return INVALID;\n }\n if (ctx.common.async) {\n return Promise.all(options.map(async (option) => {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n parent: null,\n };\n return {\n result: await option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx,\n }),\n ctx: childCtx,\n };\n })).then(handleResults);\n }\n else {\n let dirty = undefined;\n const issues = [];\n for (const option of options) {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n parent: null,\n };\n const result = option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx,\n });\n if (result.status === \"valid\") {\n return result;\n }\n else if (result.status === \"dirty\" && !dirty) {\n dirty = { result, ctx: childCtx };\n }\n if (childCtx.common.issues.length) {\n issues.push(childCtx.common.issues);\n }\n }\n if (dirty) {\n ctx.common.issues.push(...dirty.ctx.common.issues);\n return dirty.result;\n }\n const unionErrors = issues.map((issues) => new ZodError(issues));\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union,\n unionErrors,\n });\n return INVALID;\n }\n }\n get options() {\n return this._def.options;\n }\n}\nZodUnion.create = (types, params) => {\n return new ZodUnion({\n options: types,\n typeName: ZodFirstPartyTypeKind.ZodUnion,\n ...processCreateParams(params),\n });\n};\n/////////////////////////////////////////////////////\n/////////////////////////////////////////////////////\n////////// //////////\n////////// ZodDiscriminatedUnion //////////\n////////// //////////\n/////////////////////////////////////////////////////\n/////////////////////////////////////////////////////\nconst getDiscriminator = (type) => {\n if (type instanceof ZodLazy) {\n return getDiscriminator(type.schema);\n }\n else if (type instanceof ZodEffects) {\n return getDiscriminator(type.innerType());\n }\n else if (type instanceof ZodLiteral) {\n return [type.value];\n }\n else if (type instanceof ZodEnum) {\n return type.options;\n }\n else if (type instanceof ZodNativeEnum) {\n // eslint-disable-next-line ban/ban\n return Object.keys(type.enum);\n }\n else if (type instanceof ZodDefault) {\n return getDiscriminator(type._def.innerType);\n }\n else if (type instanceof ZodUndefined) {\n return [undefined];\n }\n else if (type instanceof ZodNull) {\n return [null];\n }\n else {\n return null;\n }\n};\nclass ZodDiscriminatedUnion extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.object) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const discriminator = this.discriminator;\n const discriminatorValue = ctx.data[discriminator];\n const option = this.optionsMap.get(discriminatorValue);\n if (!option) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union_discriminator,\n options: Array.from(this.optionsMap.keys()),\n path: [discriminator],\n });\n return INVALID;\n }\n if (ctx.common.async) {\n return option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n }\n else {\n return option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n get discriminator() {\n return this._def.discriminator;\n }\n get options() {\n return this._def.options;\n }\n get optionsMap() {\n return this._def.optionsMap;\n }\n /**\n * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.\n * However, it only allows a union of objects, all of which need to share a discriminator property. This property must\n * have a different value for each object in the union.\n * @param discriminator the name of the discriminator property\n * @param types an array of object schemas\n * @param params\n */\n static create(discriminator, options, params) {\n // Get all the valid discriminator values\n const optionsMap = new Map();\n // try {\n for (const type of options) {\n const discriminatorValues = getDiscriminator(type.shape[discriminator]);\n if (!discriminatorValues) {\n throw new Error(`A discriminator value for key \\`${discriminator}\\` could not be extracted from all schema options`);\n }\n for (const value of discriminatorValues) {\n if (optionsMap.has(value)) {\n throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);\n }\n optionsMap.set(value, type);\n }\n }\n return new ZodDiscriminatedUnion({\n typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,\n discriminator,\n options,\n optionsMap,\n ...processCreateParams(params),\n });\n }\n}\nfunction mergeValues(a, b) {\n const aType = getParsedType(a);\n const bType = getParsedType(b);\n if (a === b) {\n return { valid: true, data: a };\n }\n else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {\n const bKeys = util.objectKeys(b);\n const sharedKeys = util\n .objectKeys(a)\n .filter((key) => bKeys.indexOf(key) !== -1);\n const newObj = { ...a, ...b };\n for (const key of sharedKeys) {\n const sharedValue = mergeValues(a[key], b[key]);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newObj[key] = sharedValue.data;\n }\n return { valid: true, data: newObj };\n }\n else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {\n if (a.length !== b.length) {\n return { valid: false };\n }\n const newArray = [];\n for (let index = 0; index < a.length; index++) {\n const itemA = a[index];\n const itemB = b[index];\n const sharedValue = mergeValues(itemA, itemB);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newArray.push(sharedValue.data);\n }\n return { valid: true, data: newArray };\n }\n else if (aType === ZodParsedType.date &&\n bType === ZodParsedType.date &&\n +a === +b) {\n return { valid: true, data: a };\n }\n else {\n return { valid: false };\n }\n}\nclass ZodIntersection extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const handleParsed = (parsedLeft, parsedRight) => {\n if (isAborted(parsedLeft) || isAborted(parsedRight)) {\n return INVALID;\n }\n const merged = mergeValues(parsedLeft.value, parsedRight.value);\n if (!merged.valid) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_intersection_types,\n });\n return INVALID;\n }\n if (isDirty(parsedLeft) || isDirty(parsedRight)) {\n status.dirty();\n }\n return { status: status.value, value: merged.data };\n };\n if (ctx.common.async) {\n return Promise.all([\n this._def.left._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n this._def.right._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n ]).then(([left, right]) => handleParsed(left, right));\n }\n else {\n return handleParsed(this._def.left._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }), this._def.right._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }));\n }\n }\n}\nZodIntersection.create = (left, right, params) => {\n return new ZodIntersection({\n left: left,\n right: right,\n typeName: ZodFirstPartyTypeKind.ZodIntersection,\n ...processCreateParams(params),\n });\n};\nclass ZodTuple extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.array) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.array,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (ctx.data.length < this._def.items.length) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\",\n });\n return INVALID;\n }\n const rest = this._def.rest;\n if (!rest && ctx.data.length > this._def.items.length) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\",\n });\n status.dirty();\n }\n const items = [...ctx.data]\n .map((item, itemIndex) => {\n const schema = this._def.items[itemIndex] || this._def.rest;\n if (!schema)\n return null;\n return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));\n })\n .filter((x) => !!x); // filter nulls\n if (ctx.common.async) {\n return Promise.all(items).then((results) => {\n return ParseStatus.mergeArray(status, results);\n });\n }\n else {\n return ParseStatus.mergeArray(status, items);\n }\n }\n get items() {\n return this._def.items;\n }\n rest(rest) {\n return new ZodTuple({\n ...this._def,\n rest,\n });\n }\n}\nZodTuple.create = (schemas, params) => {\n if (!Array.isArray(schemas)) {\n throw new Error(\"You must pass an array of schemas to z.tuple([ ... ])\");\n }\n return new ZodTuple({\n items: schemas,\n typeName: ZodFirstPartyTypeKind.ZodTuple,\n rest: null,\n ...processCreateParams(params),\n });\n};\nclass ZodRecord extends ZodType {\n get keySchema() {\n return this._def.keyType;\n }\n get valueSchema() {\n return this._def.valueType;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.object) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const pairs = [];\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n for (const key in ctx.data) {\n pairs.push({\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),\n value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),\n });\n }\n if (ctx.common.async) {\n return ParseStatus.mergeObjectAsync(status, pairs);\n }\n else {\n return ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get element() {\n return this._def.valueType;\n }\n static create(first, second, third) {\n if (second instanceof ZodType) {\n return new ZodRecord({\n keyType: first,\n valueType: second,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(third),\n });\n }\n return new ZodRecord({\n keyType: ZodString.create(),\n valueType: first,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(second),\n });\n }\n}\nclass ZodMap extends ZodType {\n get keySchema() {\n return this._def.keyType;\n }\n get valueSchema() {\n return this._def.valueType;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.map) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.map,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n const pairs = [...ctx.data.entries()].map(([key, value], index) => {\n return {\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, \"key\"])),\n value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, \"value\"])),\n };\n });\n if (ctx.common.async) {\n const finalMap = new Map();\n return Promise.resolve().then(async () => {\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n });\n }\n else {\n const finalMap = new Map();\n for (const pair of pairs) {\n const key = pair.key;\n const value = pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n }\n }\n}\nZodMap.create = (keyType, valueType, params) => {\n return new ZodMap({\n valueType,\n keyType,\n typeName: ZodFirstPartyTypeKind.ZodMap,\n ...processCreateParams(params),\n });\n};\nclass ZodSet extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.set) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.set,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const def = this._def;\n if (def.minSize !== null) {\n if (ctx.data.size < def.minSize.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: def.minSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.minSize.message,\n });\n status.dirty();\n }\n }\n if (def.maxSize !== null) {\n if (ctx.data.size > def.maxSize.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: def.maxSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.maxSize.message,\n });\n status.dirty();\n }\n }\n const valueType = this._def.valueType;\n function finalizeSet(elements) {\n const parsedSet = new Set();\n for (const element of elements) {\n if (element.status === \"aborted\")\n return INVALID;\n if (element.status === \"dirty\")\n status.dirty();\n parsedSet.add(element.value);\n }\n return { status: status.value, value: parsedSet };\n }\n const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));\n if (ctx.common.async) {\n return Promise.all(elements).then((elements) => finalizeSet(elements));\n }\n else {\n return finalizeSet(elements);\n }\n }\n min(minSize, message) {\n return new ZodSet({\n ...this._def,\n minSize: { value: minSize, message: errorUtil.toString(message) },\n });\n }\n max(maxSize, message) {\n return new ZodSet({\n ...this._def,\n maxSize: { value: maxSize, message: errorUtil.toString(message) },\n });\n }\n size(size, message) {\n return this.min(size, message).max(size, message);\n }\n nonempty(message) {\n return this.min(1, message);\n }\n}\nZodSet.create = (valueType, params) => {\n return new ZodSet({\n valueType,\n minSize: null,\n maxSize: null,\n typeName: ZodFirstPartyTypeKind.ZodSet,\n ...processCreateParams(params),\n });\n};\nclass ZodFunction extends ZodType {\n constructor() {\n super(...arguments);\n this.validate = this.implement;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.function) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.function,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n function makeArgsIssue(args, error) {\n return makeIssue({\n data: args,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap,\n ctx.schemaErrorMap,\n getErrorMap(),\n errorMap,\n ].filter((x) => !!x),\n issueData: {\n code: ZodIssueCode.invalid_arguments,\n argumentsError: error,\n },\n });\n }\n function makeReturnsIssue(returns, error) {\n return makeIssue({\n data: returns,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap,\n ctx.schemaErrorMap,\n getErrorMap(),\n errorMap,\n ].filter((x) => !!x),\n issueData: {\n code: ZodIssueCode.invalid_return_type,\n returnTypeError: error,\n },\n });\n }\n const params = { errorMap: ctx.common.contextualErrorMap };\n const fn = ctx.data;\n if (this._def.returns instanceof ZodPromise) {\n // Would love a way to avoid disabling this rule, but we need\n // an alias (using an arrow function was what caused 2651).\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const me = this;\n return OK(async function (...args) {\n const error = new ZodError([]);\n const parsedArgs = await me._def.args\n .parseAsync(args, params)\n .catch((e) => {\n error.addIssue(makeArgsIssue(args, e));\n throw error;\n });\n const result = await Reflect.apply(fn, this, parsedArgs);\n const parsedReturns = await me._def.returns._def.type\n .parseAsync(result, params)\n .catch((e) => {\n error.addIssue(makeReturnsIssue(result, e));\n throw error;\n });\n return parsedReturns;\n });\n }\n else {\n // Would love a way to avoid disabling this rule, but we need\n // an alias (using an arrow function was what caused 2651).\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const me = this;\n return OK(function (...args) {\n const parsedArgs = me._def.args.safeParse(args, params);\n if (!parsedArgs.success) {\n throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);\n }\n const result = Reflect.apply(fn, this, parsedArgs.data);\n const parsedReturns = me._def.returns.safeParse(result, params);\n if (!parsedReturns.success) {\n throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);\n }\n return parsedReturns.data;\n });\n }\n }\n parameters() {\n return this._def.args;\n }\n returnType() {\n return this._def.returns;\n }\n args(...items) {\n return new ZodFunction({\n ...this._def,\n args: ZodTuple.create(items).rest(ZodUnknown.create()),\n });\n }\n returns(returnType) {\n return new ZodFunction({\n ...this._def,\n returns: returnType,\n });\n }\n implement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n strictImplement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n static create(args, returns, params) {\n return new ZodFunction({\n args: (args\n ? args\n : ZodTuple.create([]).rest(ZodUnknown.create())),\n returns: returns || ZodUnknown.create(),\n typeName: ZodFirstPartyTypeKind.ZodFunction,\n ...processCreateParams(params),\n });\n }\n}\nclass ZodLazy extends ZodType {\n get schema() {\n return this._def.getter();\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const lazySchema = this._def.getter();\n return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });\n }\n}\nZodLazy.create = (getter, params) => {\n return new ZodLazy({\n getter: getter,\n typeName: ZodFirstPartyTypeKind.ZodLazy,\n ...processCreateParams(params),\n });\n};\nclass ZodLiteral extends ZodType {\n _parse(input) {\n if (input.data !== this._def.value) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_literal,\n expected: this._def.value,\n });\n return INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n get value() {\n return this._def.value;\n }\n}\nZodLiteral.create = (value, params) => {\n return new ZodLiteral({\n value: value,\n typeName: ZodFirstPartyTypeKind.ZodLiteral,\n ...processCreateParams(params),\n });\n};\nfunction createZodEnum(values, params) {\n return new ZodEnum({\n values,\n typeName: ZodFirstPartyTypeKind.ZodEnum,\n ...processCreateParams(params),\n });\n}\nclass ZodEnum extends ZodType {\n _parse(input) {\n if (typeof input.data !== \"string\") {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n addIssueToContext(ctx, {\n expected: util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodIssueCode.invalid_type,\n });\n return INVALID;\n }\n if (this._def.values.indexOf(input.data) === -1) {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_enum_value,\n options: expectedValues,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n get options() {\n return this._def.values;\n }\n get enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Values() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n extract(values) {\n return ZodEnum.create(values);\n }\n exclude(values) {\n return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)));\n }\n}\nZodEnum.create = createZodEnum;\nclass ZodNativeEnum extends ZodType {\n _parse(input) {\n const nativeEnumValues = util.getValidEnumValues(this._def.values);\n const ctx = this._getOrReturnCtx(input);\n if (ctx.parsedType !== ZodParsedType.string &&\n ctx.parsedType !== ZodParsedType.number) {\n const expectedValues = util.objectValues(nativeEnumValues);\n addIssueToContext(ctx, {\n expected: util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodIssueCode.invalid_type,\n });\n return INVALID;\n }\n if (nativeEnumValues.indexOf(input.data) === -1) {\n const expectedValues = util.objectValues(nativeEnumValues);\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_enum_value,\n options: expectedValues,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n get enum() {\n return this._def.values;\n }\n}\nZodNativeEnum.create = (values, params) => {\n return new ZodNativeEnum({\n values: values,\n typeName: ZodFirstPartyTypeKind.ZodNativeEnum,\n ...processCreateParams(params),\n });\n};\nclass ZodPromise extends ZodType {\n unwrap() {\n return this._def.type;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.promise &&\n ctx.common.async === false) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.promise,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const promisified = ctx.parsedType === ZodParsedType.promise\n ? ctx.data\n : Promise.resolve(ctx.data);\n return OK(promisified.then((data) => {\n return this._def.type.parseAsync(data, {\n path: ctx.path,\n errorMap: ctx.common.contextualErrorMap,\n });\n }));\n }\n}\nZodPromise.create = (schema, params) => {\n return new ZodPromise({\n type: schema,\n typeName: ZodFirstPartyTypeKind.ZodPromise,\n ...processCreateParams(params),\n });\n};\nclass ZodEffects extends ZodType {\n innerType() {\n return this._def.schema;\n }\n sourceType() {\n return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects\n ? this._def.schema.sourceType()\n : this._def.schema;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const effect = this._def.effect || null;\n const checkCtx = {\n addIssue: (arg) => {\n addIssueToContext(ctx, arg);\n if (arg.fatal) {\n status.abort();\n }\n else {\n status.dirty();\n }\n },\n get path() {\n return ctx.path;\n },\n };\n checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);\n if (effect.type === \"preprocess\") {\n const processed = effect.transform(ctx.data, checkCtx);\n if (ctx.common.issues.length) {\n return {\n status: \"dirty\",\n value: ctx.data,\n };\n }\n if (ctx.common.async) {\n return Promise.resolve(processed).then((processed) => {\n return this._def.schema._parseAsync({\n data: processed,\n path: ctx.path,\n parent: ctx,\n });\n });\n }\n else {\n return this._def.schema._parseSync({\n data: processed,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n if (effect.type === \"refinement\") {\n const executeRefinement = (acc\n // effect: RefinementEffect\n ) => {\n const result = effect.refinement(acc, checkCtx);\n if (ctx.common.async) {\n return Promise.resolve(result);\n }\n if (result instanceof Promise) {\n throw new Error(\"Async refinement encountered during synchronous parse operation. Use .parseAsync instead.\");\n }\n return acc;\n };\n if (ctx.common.async === false) {\n const inner = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inner.status === \"aborted\")\n return INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n // return value is ignored\n executeRefinement(inner.value);\n return { status: status.value, value: inner.value };\n }\n else {\n return this._def.schema\n ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })\n .then((inner) => {\n if (inner.status === \"aborted\")\n return INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n return executeRefinement(inner.value).then(() => {\n return { status: status.value, value: inner.value };\n });\n });\n }\n }\n if (effect.type === \"transform\") {\n if (ctx.common.async === false) {\n const base = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (!isValid(base))\n return base;\n const result = effect.transform(base.value, checkCtx);\n if (result instanceof Promise) {\n throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);\n }\n return { status: status.value, value: result };\n }\n else {\n return this._def.schema\n ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })\n .then((base) => {\n if (!isValid(base))\n return base;\n return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status.value, value: result }));\n });\n }\n }\n util.assertNever(effect);\n }\n}\nZodEffects.create = (schema, effect, params) => {\n return new ZodEffects({\n schema,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect,\n ...processCreateParams(params),\n });\n};\nZodEffects.createWithPreprocess = (preprocess, schema, params) => {\n return new ZodEffects({\n schema,\n effect: { type: \"preprocess\", transform: preprocess },\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n ...processCreateParams(params),\n });\n};\nclass ZodOptional extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === ZodParsedType.undefined) {\n return OK(undefined);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nZodOptional.create = (type, params) => {\n return new ZodOptional({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodOptional,\n ...processCreateParams(params),\n });\n};\nclass ZodNullable extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === ZodParsedType.null) {\n return OK(null);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nZodNullable.create = (type, params) => {\n return new ZodNullable({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodNullable,\n ...processCreateParams(params),\n });\n};\nclass ZodDefault extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n let data = ctx.data;\n if (ctx.parsedType === ZodParsedType.undefined) {\n data = this._def.defaultValue();\n }\n return this._def.innerType._parse({\n data,\n path: ctx.path,\n parent: ctx,\n });\n }\n removeDefault() {\n return this._def.innerType;\n }\n}\nZodDefault.create = (type, params) => {\n return new ZodDefault({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodDefault,\n defaultValue: typeof params.default === \"function\"\n ? params.default\n : () => params.default,\n ...processCreateParams(params),\n });\n};\nclass ZodCatch extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n // newCtx is used to not collect issues from inner types in ctx\n const newCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n };\n const result = this._def.innerType._parse({\n data: newCtx.data,\n path: newCtx.path,\n parent: {\n ...newCtx,\n },\n });\n if (isAsync(result)) {\n return result.then((result) => {\n return {\n status: \"valid\",\n value: result.status === \"valid\"\n ? result.value\n : this._def.catchValue({\n get error() {\n return new ZodError(newCtx.common.issues);\n },\n input: newCtx.data,\n }),\n };\n });\n }\n else {\n return {\n status: \"valid\",\n value: result.status === \"valid\"\n ? result.value\n : this._def.catchValue({\n get error() {\n return new ZodError(newCtx.common.issues);\n },\n input: newCtx.data,\n }),\n };\n }\n }\n removeCatch() {\n return this._def.innerType;\n }\n}\nZodCatch.create = (type, params) => {\n return new ZodCatch({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodCatch,\n catchValue: typeof params.catch === \"function\" ? params.catch : () => params.catch,\n ...processCreateParams(params),\n });\n};\nclass ZodNaN extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.nan) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.nan,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n}\nZodNaN.create = (params) => {\n return new ZodNaN({\n typeName: ZodFirstPartyTypeKind.ZodNaN,\n ...processCreateParams(params),\n });\n};\nconst BRAND = Symbol(\"zod_brand\");\nclass ZodBranded extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const data = ctx.data;\n return this._def.type._parse({\n data,\n path: ctx.path,\n parent: ctx,\n });\n }\n unwrap() {\n return this._def.type;\n }\n}\nclass ZodPipeline extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.common.async) {\n const handleAsync = async () => {\n const inResult = await this._def.in._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inResult.status === \"aborted\")\n return INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return DIRTY(inResult.value);\n }\n else {\n return this._def.out._parseAsync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx,\n });\n }\n };\n return handleAsync();\n }\n else {\n const inResult = this._def.in._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inResult.status === \"aborted\")\n return INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return {\n status: \"dirty\",\n value: inResult.value,\n };\n }\n else {\n return this._def.out._parseSync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n }\n static create(a, b) {\n return new ZodPipeline({\n in: a,\n out: b,\n typeName: ZodFirstPartyTypeKind.ZodPipeline,\n });\n }\n}\nclass ZodReadonly extends ZodType {\n _parse(input) {\n const result = this._def.innerType._parse(input);\n if (isValid(result)) {\n result.value = Object.freeze(result.value);\n }\n return result;\n }\n}\nZodReadonly.create = (type, params) => {\n return new ZodReadonly({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodReadonly,\n ...processCreateParams(params),\n });\n};\nconst custom = (check, params = {}, \n/*\n * @deprecated\n *\n * Pass `fatal` into the params object instead:\n *\n * ```ts\n * z.string().custom((val) => val.length > 5, { fatal: false })\n * ```\n *\n */\nfatal) => {\n if (check)\n return ZodAny.create().superRefine((data, ctx) => {\n var _a, _b;\n if (!check(data)) {\n const p = typeof params === \"function\"\n ? params(data)\n : typeof params === \"string\"\n ? { message: params }\n : params;\n const _fatal = (_b = (_a = p.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;\n const p2 = typeof p === \"string\" ? { message: p } : p;\n ctx.addIssue({ code: \"custom\", ...p2, fatal: _fatal });\n }\n });\n return ZodAny.create();\n};\nconst late = {\n object: ZodObject.lazycreate,\n};\nvar ZodFirstPartyTypeKind;\n(function (ZodFirstPartyTypeKind) {\n ZodFirstPartyTypeKind[\"ZodString\"] = \"ZodString\";\n ZodFirstPartyTypeKind[\"ZodNumber\"] = \"ZodNumber\";\n ZodFirstPartyTypeKind[\"ZodNaN\"] = \"ZodNaN\";\n ZodFirstPartyTypeKind[\"ZodBigInt\"] = \"ZodBigInt\";\n ZodFirstPartyTypeKind[\"ZodBoolean\"] = \"ZodBoolean\";\n ZodFirstPartyTypeKind[\"ZodDate\"] = \"ZodDate\";\n ZodFirstPartyTypeKind[\"ZodSymbol\"] = \"ZodSymbol\";\n ZodFirstPartyTypeKind[\"ZodUndefined\"] = \"ZodUndefined\";\n ZodFirstPartyTypeKind[\"ZodNull\"] = \"ZodNull\";\n ZodFirstPartyTypeKind[\"ZodAny\"] = \"ZodAny\";\n ZodFirstPartyTypeKind[\"ZodUnknown\"] = \"ZodUnknown\";\n ZodFirstPartyTypeKind[\"ZodNever\"] = \"ZodNever\";\n ZodFirstPartyTypeKind[\"ZodVoid\"] = \"ZodVoid\";\n ZodFirstPartyTypeKind[\"ZodArray\"] = \"ZodArray\";\n ZodFirstPartyTypeKind[\"ZodObject\"] = \"ZodObject\";\n ZodFirstPartyTypeKind[\"ZodUnion\"] = \"ZodUnion\";\n ZodFirstPartyTypeKind[\"ZodDiscriminatedUnion\"] = \"ZodDiscriminatedUnion\";\n ZodFirstPartyTypeKind[\"ZodIntersection\"] = \"ZodIntersection\";\n ZodFirstPartyTypeKind[\"ZodTuple\"] = \"ZodTuple\";\n ZodFirstPartyTypeKind[\"ZodRecord\"] = \"ZodRecord\";\n ZodFirstPartyTypeKind[\"ZodMap\"] = \"ZodMap\";\n ZodFirstPartyTypeKind[\"ZodSet\"] = \"ZodSet\";\n ZodFirstPartyTypeKind[\"ZodFunction\"] = \"ZodFunction\";\n ZodFirstPartyTypeKind[\"ZodLazy\"] = \"ZodLazy\";\n ZodFirstPartyTypeKind[\"ZodLiteral\"] = \"ZodLiteral\";\n ZodFirstPartyTypeKind[\"ZodEnum\"] = \"ZodEnum\";\n ZodFirstPartyTypeKind[\"ZodEffects\"] = \"ZodEffects\";\n ZodFirstPartyTypeKind[\"ZodNativeEnum\"] = \"ZodNativeEnum\";\n ZodFirstPartyTypeKind[\"ZodOptional\"] = \"ZodOptional\";\n ZodFirstPartyTypeKind[\"ZodNullable\"] = \"ZodNullable\";\n ZodFirstPartyTypeKind[\"ZodDefault\"] = \"ZodDefault\";\n ZodFirstPartyTypeKind[\"ZodCatch\"] = \"ZodCatch\";\n ZodFirstPartyTypeKind[\"ZodPromise\"] = \"ZodPromise\";\n ZodFirstPartyTypeKind[\"ZodBranded\"] = \"ZodBranded\";\n ZodFirstPartyTypeKind[\"ZodPipeline\"] = \"ZodPipeline\";\n ZodFirstPartyTypeKind[\"ZodReadonly\"] = \"ZodReadonly\";\n})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));\nconst instanceOfType = (\n// const instanceOfType = any>(\ncls, params = {\n message: `Input not instance of ${cls.name}`,\n}) => custom((data) => data instanceof cls, params);\nconst stringType = ZodString.create;\nconst numberType = ZodNumber.create;\nconst nanType = ZodNaN.create;\nconst bigIntType = ZodBigInt.create;\nconst booleanType = ZodBoolean.create;\nconst dateType = ZodDate.create;\nconst symbolType = ZodSymbol.create;\nconst undefinedType = ZodUndefined.create;\nconst nullType = ZodNull.create;\nconst anyType = ZodAny.create;\nconst unknownType = ZodUnknown.create;\nconst neverType = ZodNever.create;\nconst voidType = ZodVoid.create;\nconst arrayType = ZodArray.create;\nconst objectType = ZodObject.create;\nconst strictObjectType = ZodObject.strictCreate;\nconst unionType = ZodUnion.create;\nconst discriminatedUnionType = ZodDiscriminatedUnion.create;\nconst intersectionType = ZodIntersection.create;\nconst tupleType = ZodTuple.create;\nconst recordType = ZodRecord.create;\nconst mapType = ZodMap.create;\nconst setType = ZodSet.create;\nconst functionType = ZodFunction.create;\nconst lazyType = ZodLazy.create;\nconst literalType = ZodLiteral.create;\nconst enumType = ZodEnum.create;\nconst nativeEnumType = ZodNativeEnum.create;\nconst promiseType = ZodPromise.create;\nconst effectsType = ZodEffects.create;\nconst optionalType = ZodOptional.create;\nconst nullableType = ZodNullable.create;\nconst preprocessType = ZodEffects.createWithPreprocess;\nconst pipelineType = ZodPipeline.create;\nconst ostring = () => stringType().optional();\nconst onumber = () => numberType().optional();\nconst oboolean = () => booleanType().optional();\nconst coerce = {\n string: ((arg) => ZodString.create({ ...arg, coerce: true })),\n number: ((arg) => ZodNumber.create({ ...arg, coerce: true })),\n boolean: ((arg) => ZodBoolean.create({\n ...arg,\n coerce: true,\n })),\n bigint: ((arg) => ZodBigInt.create({ ...arg, coerce: true })),\n date: ((arg) => ZodDate.create({ ...arg, coerce: true })),\n};\nconst NEVER = INVALID;\n\nvar z = /*#__PURE__*/Object.freeze({\n __proto__: null,\n defaultErrorMap: errorMap,\n setErrorMap: setErrorMap,\n getErrorMap: getErrorMap,\n makeIssue: makeIssue,\n EMPTY_PATH: EMPTY_PATH,\n addIssueToContext: addIssueToContext,\n ParseStatus: ParseStatus,\n INVALID: INVALID,\n DIRTY: DIRTY,\n OK: OK,\n isAborted: isAborted,\n isDirty: isDirty,\n isValid: isValid,\n isAsync: isAsync,\n get util () { return util; },\n get objectUtil () { return objectUtil; },\n ZodParsedType: ZodParsedType,\n getParsedType: getParsedType,\n ZodType: ZodType,\n ZodString: ZodString,\n ZodNumber: ZodNumber,\n ZodBigInt: ZodBigInt,\n ZodBoolean: ZodBoolean,\n ZodDate: ZodDate,\n ZodSymbol: ZodSymbol,\n ZodUndefined: ZodUndefined,\n ZodNull: ZodNull,\n ZodAny: ZodAny,\n ZodUnknown: ZodUnknown,\n ZodNever: ZodNever,\n ZodVoid: ZodVoid,\n ZodArray: ZodArray,\n ZodObject: ZodObject,\n ZodUnion: ZodUnion,\n ZodDiscriminatedUnion: ZodDiscriminatedUnion,\n ZodIntersection: ZodIntersection,\n ZodTuple: ZodTuple,\n ZodRecord: ZodRecord,\n ZodMap: ZodMap,\n ZodSet: ZodSet,\n ZodFunction: ZodFunction,\n ZodLazy: ZodLazy,\n ZodLiteral: ZodLiteral,\n ZodEnum: ZodEnum,\n ZodNativeEnum: ZodNativeEnum,\n ZodPromise: ZodPromise,\n ZodEffects: ZodEffects,\n ZodTransformer: ZodEffects,\n ZodOptional: ZodOptional,\n ZodNullable: ZodNullable,\n ZodDefault: ZodDefault,\n ZodCatch: ZodCatch,\n ZodNaN: ZodNaN,\n BRAND: BRAND,\n ZodBranded: ZodBranded,\n ZodPipeline: ZodPipeline,\n ZodReadonly: ZodReadonly,\n custom: custom,\n Schema: ZodType,\n ZodSchema: ZodType,\n late: late,\n get ZodFirstPartyTypeKind () { return ZodFirstPartyTypeKind; },\n coerce: coerce,\n any: anyType,\n array: arrayType,\n bigint: bigIntType,\n boolean: booleanType,\n date: dateType,\n discriminatedUnion: discriminatedUnionType,\n effect: effectsType,\n 'enum': enumType,\n 'function': functionType,\n 'instanceof': instanceOfType,\n intersection: intersectionType,\n lazy: lazyType,\n literal: literalType,\n map: mapType,\n nan: nanType,\n nativeEnum: nativeEnumType,\n never: neverType,\n 'null': nullType,\n nullable: nullableType,\n number: numberType,\n object: objectType,\n oboolean: oboolean,\n onumber: onumber,\n optional: optionalType,\n ostring: ostring,\n pipeline: pipelineType,\n preprocess: preprocessType,\n promise: promiseType,\n record: recordType,\n set: setType,\n strictObject: strictObjectType,\n string: stringType,\n symbol: symbolType,\n transformer: effectsType,\n tuple: tupleType,\n 'undefined': undefinedType,\n union: unionType,\n unknown: unknownType,\n 'void': voidType,\n NEVER: NEVER,\n ZodIssueCode: ZodIssueCode,\n quotelessJson: quotelessJson,\n ZodError: ZodError\n});\n\nexport { BRAND, DIRTY, EMPTY_PATH, INVALID, NEVER, OK, ParseStatus, ZodType as Schema, ZodAny, ZodArray, ZodBigInt, ZodBoolean, ZodBranded, ZodCatch, ZodDate, ZodDefault, ZodDiscriminatedUnion, ZodEffects, ZodEnum, ZodError, ZodFirstPartyTypeKind, ZodFunction, ZodIntersection, ZodIssueCode, ZodLazy, ZodLiteral, ZodMap, ZodNaN, ZodNativeEnum, ZodNever, ZodNull, ZodNullable, ZodNumber, ZodObject, ZodOptional, ZodParsedType, ZodPipeline, ZodPromise, ZodReadonly, ZodRecord, ZodType as ZodSchema, ZodSet, ZodString, ZodSymbol, ZodEffects as ZodTransformer, ZodTuple, ZodType, ZodUndefined, ZodUnion, ZodUnknown, ZodVoid, addIssueToContext, anyType as any, arrayType as array, bigIntType as bigint, booleanType as boolean, coerce, custom, dateType as date, z as default, errorMap as defaultErrorMap, discriminatedUnionType as discriminatedUnion, effectsType as effect, enumType as enum, functionType as function, getErrorMap, getParsedType, instanceOfType as instanceof, intersectionType as intersection, isAborted, isAsync, isDirty, isValid, late, lazyType as lazy, literalType as literal, makeIssue, mapType as map, nanType as nan, nativeEnumType as nativeEnum, neverType as never, nullType as null, nullableType as nullable, numberType as number, objectType as object, objectUtil, oboolean, onumber, optionalType as optional, ostring, pipelineType as pipeline, preprocessType as preprocess, promiseType as promise, quotelessJson, recordType as record, setType as set, setErrorMap, strictObjectType as strictObject, stringType as string, symbolType as symbol, effectsType as transformer, tupleType as tuple, undefinedType as undefined, unionType as union, unknownType as unknown, util, voidType as void, z };\n","const ANSI_BACKGROUND_OFFSET = 10;\n\nconst wrapAnsi16 = (offset = 0) => code => `\\u001B[${code + offset}m`;\n\nconst wrapAnsi256 = (offset = 0) => code => `\\u001B[${38 + offset};5;${code}m`;\n\nconst wrapAnsi16m = (offset = 0) => (red, green, blue) => `\\u001B[${38 + offset};2;${red};${green};${blue}m`;\n\nconst styles = {\n\tmodifier: {\n\t\treset: [0, 0],\n\t\t// 21 isn't widely supported and 22 does the same thing\n\t\tbold: [1, 22],\n\t\tdim: [2, 22],\n\t\titalic: [3, 23],\n\t\tunderline: [4, 24],\n\t\toverline: [53, 55],\n\t\tinverse: [7, 27],\n\t\thidden: [8, 28],\n\t\tstrikethrough: [9, 29],\n\t},\n\tcolor: {\n\t\tblack: [30, 39],\n\t\tred: [31, 39],\n\t\tgreen: [32, 39],\n\t\tyellow: [33, 39],\n\t\tblue: [34, 39],\n\t\tmagenta: [35, 39],\n\t\tcyan: [36, 39],\n\t\twhite: [37, 39],\n\n\t\t// Bright color\n\t\tblackBright: [90, 39],\n\t\tgray: [90, 39], // Alias of `blackBright`\n\t\tgrey: [90, 39], // Alias of `blackBright`\n\t\tredBright: [91, 39],\n\t\tgreenBright: [92, 39],\n\t\tyellowBright: [93, 39],\n\t\tblueBright: [94, 39],\n\t\tmagentaBright: [95, 39],\n\t\tcyanBright: [96, 39],\n\t\twhiteBright: [97, 39],\n\t},\n\tbgColor: {\n\t\tbgBlack: [40, 49],\n\t\tbgRed: [41, 49],\n\t\tbgGreen: [42, 49],\n\t\tbgYellow: [43, 49],\n\t\tbgBlue: [44, 49],\n\t\tbgMagenta: [45, 49],\n\t\tbgCyan: [46, 49],\n\t\tbgWhite: [47, 49],\n\n\t\t// Bright color\n\t\tbgBlackBright: [100, 49],\n\t\tbgGray: [100, 49], // Alias of `bgBlackBright`\n\t\tbgGrey: [100, 49], // Alias of `bgBlackBright`\n\t\tbgRedBright: [101, 49],\n\t\tbgGreenBright: [102, 49],\n\t\tbgYellowBright: [103, 49],\n\t\tbgBlueBright: [104, 49],\n\t\tbgMagentaBright: [105, 49],\n\t\tbgCyanBright: [106, 49],\n\t\tbgWhiteBright: [107, 49],\n\t},\n};\n\nexport const modifierNames = Object.keys(styles.modifier);\nexport const foregroundColorNames = Object.keys(styles.color);\nexport const backgroundColorNames = Object.keys(styles.bgColor);\nexport const colorNames = [...foregroundColorNames, ...backgroundColorNames];\n\nfunction assembleStyles() {\n\tconst codes = new Map();\n\n\tfor (const [groupName, group] of Object.entries(styles)) {\n\t\tfor (const [styleName, style] of Object.entries(group)) {\n\t\t\tstyles[styleName] = {\n\t\t\t\topen: `\\u001B[${style[0]}m`,\n\t\t\t\tclose: `\\u001B[${style[1]}m`,\n\t\t\t};\n\n\t\t\tgroup[styleName] = styles[styleName];\n\n\t\t\tcodes.set(style[0], style[1]);\n\t\t}\n\n\t\tObject.defineProperty(styles, groupName, {\n\t\t\tvalue: group,\n\t\t\tenumerable: false,\n\t\t});\n\t}\n\n\tObject.defineProperty(styles, 'codes', {\n\t\tvalue: codes,\n\t\tenumerable: false,\n\t});\n\n\tstyles.color.close = '\\u001B[39m';\n\tstyles.bgColor.close = '\\u001B[49m';\n\n\tstyles.color.ansi = wrapAnsi16();\n\tstyles.color.ansi256 = wrapAnsi256();\n\tstyles.color.ansi16m = wrapAnsi16m();\n\tstyles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);\n\n\t// From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js\n\tObject.defineProperties(styles, {\n\t\trgbToAnsi256: {\n\t\t\tvalue(red, green, blue) {\n\t\t\t\t// We use the extended greyscale palette here, with the exception of\n\t\t\t\t// black and white. normal palette only has 4 greyscale shades.\n\t\t\t\tif (red === green && green === blue) {\n\t\t\t\t\tif (red < 8) {\n\t\t\t\t\t\treturn 16;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (red > 248) {\n\t\t\t\t\t\treturn 231;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn Math.round(((red - 8) / 247) * 24) + 232;\n\t\t\t\t}\n\n\t\t\t\treturn 16\n\t\t\t\t\t+ (36 * Math.round(red / 255 * 5))\n\t\t\t\t\t+ (6 * Math.round(green / 255 * 5))\n\t\t\t\t\t+ Math.round(blue / 255 * 5);\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToRgb: {\n\t\t\tvalue(hex) {\n\t\t\t\tconst matches = /[a-f\\d]{6}|[a-f\\d]{3}/i.exec(hex.toString(16));\n\t\t\t\tif (!matches) {\n\t\t\t\t\treturn [0, 0, 0];\n\t\t\t\t}\n\n\t\t\t\tlet [colorString] = matches;\n\n\t\t\t\tif (colorString.length === 3) {\n\t\t\t\t\tcolorString = [...colorString].map(character => character + character).join('');\n\t\t\t\t}\n\n\t\t\t\tconst integer = Number.parseInt(colorString, 16);\n\n\t\t\t\treturn [\n\t\t\t\t\t/* eslint-disable no-bitwise */\n\t\t\t\t\t(integer >> 16) & 0xFF,\n\t\t\t\t\t(integer >> 8) & 0xFF,\n\t\t\t\t\tinteger & 0xFF,\n\t\t\t\t\t/* eslint-enable no-bitwise */\n\t\t\t\t];\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi256: {\n\t\t\tvalue: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t\tansi256ToAnsi: {\n\t\t\tvalue(code) {\n\t\t\t\tif (code < 8) {\n\t\t\t\t\treturn 30 + code;\n\t\t\t\t}\n\n\t\t\t\tif (code < 16) {\n\t\t\t\t\treturn 90 + (code - 8);\n\t\t\t\t}\n\n\t\t\t\tlet red;\n\t\t\t\tlet green;\n\t\t\t\tlet blue;\n\n\t\t\t\tif (code >= 232) {\n\t\t\t\t\tred = (((code - 232) * 10) + 8) / 255;\n\t\t\t\t\tgreen = red;\n\t\t\t\t\tblue = red;\n\t\t\t\t} else {\n\t\t\t\t\tcode -= 16;\n\n\t\t\t\t\tconst remainder = code % 36;\n\n\t\t\t\t\tred = Math.floor(code / 36) / 5;\n\t\t\t\t\tgreen = Math.floor(remainder / 6) / 5;\n\t\t\t\t\tblue = (remainder % 6) / 5;\n\t\t\t\t}\n\n\t\t\t\tconst value = Math.max(red, green, blue) * 2;\n\n\t\t\t\tif (value === 0) {\n\t\t\t\t\treturn 30;\n\t\t\t\t}\n\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tlet result = 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));\n\n\t\t\t\tif (value === 2) {\n\t\t\t\t\tresult += 60;\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\trgbToAnsi: {\n\t\t\tvalue: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi: {\n\t\t\tvalue: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t});\n\n\treturn styles;\n}\n\nconst ansiStyles = assembleStyles();\n\nexport default ansiStyles;\n","/* eslint-env browser */\n\nconst level = (() => {\n\tif (navigator.userAgentData) {\n\t\tconst brand = navigator.userAgentData.brands.find(({brand}) => brand === 'Chromium');\n\t\tif (brand && brand.version > 93) {\n\t\t\treturn 3;\n\t\t}\n\t}\n\n\tif (/\\b(Chrome|Chromium)\\//.test(navigator.userAgent)) {\n\t\treturn 1;\n\t}\n\n\treturn 0;\n})();\n\nconst colorSupport = level !== 0 && {\n\tlevel,\n\thasBasic: true,\n\thas256: level >= 2,\n\thas16m: level >= 3,\n};\n\nconst supportsColor = {\n\tstdout: colorSupport,\n\tstderr: colorSupport,\n};\n\nexport default supportsColor;\n","// TODO: When targeting Node.js 16, use `String.prototype.replaceAll`.\nexport function stringReplaceAll(string, substring, replacer) {\n\tlet index = string.indexOf(substring);\n\tif (index === -1) {\n\t\treturn string;\n\t}\n\n\tconst substringLength = substring.length;\n\tlet endIndex = 0;\n\tlet returnValue = '';\n\tdo {\n\t\treturnValue += string.slice(endIndex, index) + substring + replacer;\n\t\tendIndex = index + substringLength;\n\t\tindex = string.indexOf(substring, endIndex);\n\t} while (index !== -1);\n\n\treturnValue += string.slice(endIndex);\n\treturn returnValue;\n}\n\nexport function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {\n\tlet endIndex = 0;\n\tlet returnValue = '';\n\tdo {\n\t\tconst gotCR = string[index - 1] === '\\r';\n\t\treturnValue += string.slice(endIndex, (gotCR ? index - 1 : index)) + prefix + (gotCR ? '\\r\\n' : '\\n') + postfix;\n\t\tendIndex = index + 1;\n\t\tindex = string.indexOf('\\n', endIndex);\n\t} while (index !== -1);\n\n\treturnValue += string.slice(endIndex);\n\treturn returnValue;\n}\n","import ansiStyles from '#ansi-styles';\nimport supportsColor from '#supports-color';\nimport { // eslint-disable-line import/order\n\tstringReplaceAll,\n\tstringEncaseCRLFWithFirstIndex,\n} from './utilities.js';\n\nconst {stdout: stdoutColor, stderr: stderrColor} = supportsColor;\n\nconst GENERATOR = Symbol('GENERATOR');\nconst STYLER = Symbol('STYLER');\nconst IS_EMPTY = Symbol('IS_EMPTY');\n\n// `supportsColor.level` → `ansiStyles.color[name]` mapping\nconst levelMapping = [\n\t'ansi',\n\t'ansi',\n\t'ansi256',\n\t'ansi16m',\n];\n\nconst styles = Object.create(null);\n\nconst applyOptions = (object, options = {}) => {\n\tif (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {\n\t\tthrow new Error('The `level` option should be an integer from 0 to 3');\n\t}\n\n\t// Detect level if not set manually\n\tconst colorLevel = stdoutColor ? stdoutColor.level : 0;\n\tobject.level = options.level === undefined ? colorLevel : options.level;\n};\n\nexport class Chalk {\n\tconstructor(options) {\n\t\t// eslint-disable-next-line no-constructor-return\n\t\treturn chalkFactory(options);\n\t}\n}\n\nconst chalkFactory = options => {\n\tconst chalk = (...strings) => strings.join(' ');\n\tapplyOptions(chalk, options);\n\n\tObject.setPrototypeOf(chalk, createChalk.prototype);\n\n\treturn chalk;\n};\n\nfunction createChalk(options) {\n\treturn chalkFactory(options);\n}\n\nObject.setPrototypeOf(createChalk.prototype, Function.prototype);\n\nfor (const [styleName, style] of Object.entries(ansiStyles)) {\n\tstyles[styleName] = {\n\t\tget() {\n\t\t\tconst builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);\n\t\t\tObject.defineProperty(this, styleName, {value: builder});\n\t\t\treturn builder;\n\t\t},\n\t};\n}\n\nstyles.visible = {\n\tget() {\n\t\tconst builder = createBuilder(this, this[STYLER], true);\n\t\tObject.defineProperty(this, 'visible', {value: builder});\n\t\treturn builder;\n\t},\n};\n\nconst getModelAnsi = (model, level, type, ...arguments_) => {\n\tif (model === 'rgb') {\n\t\tif (level === 'ansi16m') {\n\t\t\treturn ansiStyles[type].ansi16m(...arguments_);\n\t\t}\n\n\t\tif (level === 'ansi256') {\n\t\t\treturn ansiStyles[type].ansi256(ansiStyles.rgbToAnsi256(...arguments_));\n\t\t}\n\n\t\treturn ansiStyles[type].ansi(ansiStyles.rgbToAnsi(...arguments_));\n\t}\n\n\tif (model === 'hex') {\n\t\treturn getModelAnsi('rgb', level, type, ...ansiStyles.hexToRgb(...arguments_));\n\t}\n\n\treturn ansiStyles[type][model](...arguments_);\n};\n\nconst usedModels = ['rgb', 'hex', 'ansi256'];\n\nfor (const model of usedModels) {\n\tstyles[model] = {\n\t\tget() {\n\t\t\tconst {level} = this;\n\t\t\treturn function (...arguments_) {\n\t\t\t\tconst styler = createStyler(getModelAnsi(model, levelMapping[level], 'color', ...arguments_), ansiStyles.color.close, this[STYLER]);\n\t\t\t\treturn createBuilder(this, styler, this[IS_EMPTY]);\n\t\t\t};\n\t\t},\n\t};\n\n\tconst bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);\n\tstyles[bgModel] = {\n\t\tget() {\n\t\t\tconst {level} = this;\n\t\t\treturn function (...arguments_) {\n\t\t\t\tconst styler = createStyler(getModelAnsi(model, levelMapping[level], 'bgColor', ...arguments_), ansiStyles.bgColor.close, this[STYLER]);\n\t\t\t\treturn createBuilder(this, styler, this[IS_EMPTY]);\n\t\t\t};\n\t\t},\n\t};\n}\n\nconst proto = Object.defineProperties(() => {}, {\n\t...styles,\n\tlevel: {\n\t\tenumerable: true,\n\t\tget() {\n\t\t\treturn this[GENERATOR].level;\n\t\t},\n\t\tset(level) {\n\t\t\tthis[GENERATOR].level = level;\n\t\t},\n\t},\n});\n\nconst createStyler = (open, close, parent) => {\n\tlet openAll;\n\tlet closeAll;\n\tif (parent === undefined) {\n\t\topenAll = open;\n\t\tcloseAll = close;\n\t} else {\n\t\topenAll = parent.openAll + open;\n\t\tcloseAll = close + parent.closeAll;\n\t}\n\n\treturn {\n\t\topen,\n\t\tclose,\n\t\topenAll,\n\t\tcloseAll,\n\t\tparent,\n\t};\n};\n\nconst createBuilder = (self, _styler, _isEmpty) => {\n\t// Single argument is hot path, implicit coercion is faster than anything\n\t// eslint-disable-next-line no-implicit-coercion\n\tconst builder = (...arguments_) => applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' '));\n\n\t// We alter the prototype because we must return a function, but there is\n\t// no way to create a function with a different prototype\n\tObject.setPrototypeOf(builder, proto);\n\n\tbuilder[GENERATOR] = self;\n\tbuilder[STYLER] = _styler;\n\tbuilder[IS_EMPTY] = _isEmpty;\n\n\treturn builder;\n};\n\nconst applyStyle = (self, string) => {\n\tif (self.level <= 0 || !string) {\n\t\treturn self[IS_EMPTY] ? '' : string;\n\t}\n\n\tlet styler = self[STYLER];\n\n\tif (styler === undefined) {\n\t\treturn string;\n\t}\n\n\tconst {openAll, closeAll} = styler;\n\tif (string.includes('\\u001B')) {\n\t\twhile (styler !== undefined) {\n\t\t\t// Replace any instances already present with a re-opening code\n\t\t\t// otherwise only the part of the string until said closing code\n\t\t\t// will be colored, and the rest will simply be 'plain'.\n\t\t\tstring = stringReplaceAll(string, styler.close, styler.open);\n\n\t\t\tstyler = styler.parent;\n\t\t}\n\t}\n\n\t// We can move both next actions out of loop, because remaining actions in loop won't have\n\t// any/visible effect on parts we add here. Close the styling before a linebreak and reopen\n\t// after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92\n\tconst lfIndex = string.indexOf('\\n');\n\tif (lfIndex !== -1) {\n\t\tstring = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);\n\t}\n\n\treturn openAll + string + closeAll;\n};\n\nObject.defineProperties(createChalk.prototype, styles);\n\nconst chalk = createChalk();\nexport const chalkStderr = createChalk({level: stderrColor ? stderrColor.level : 0});\n\nexport {\n\tmodifierNames,\n\tforegroundColorNames,\n\tbackgroundColorNames,\n\tcolorNames,\n\n\t// TODO: Remove these aliases in the next major version\n\tmodifierNames as modifiers,\n\tforegroundColorNames as foregroundColors,\n\tbackgroundColorNames as backgroundColors,\n\tcolorNames as colors,\n} from './vendor/ansi-styles/index.js';\n\nexport {\n\tstdoutColor as supportsColor,\n\tstderrColor as supportsColorStderr,\n};\n\nexport default chalk;\n","const identifierRegex = /[$_\\p{ID_Start}][$\\u200c\\u200d\\p{ID_Continue}]*/u;\nexport function joinPath(path) {\n if (path.length === 1) {\n return path[0].toString();\n }\n return path.reduce((acc, item) => {\n if (typeof item === 'number') {\n return acc + '[' + item.toString() + ']';\n }\n if (item.includes('\"')) {\n return acc + '[\"' + escapeQuotes(item) + '\"]';\n }\n if (!identifierRegex.test(item)) {\n return acc + '[\"' + item + '\"]';\n }\n const separator = acc.length === 0 ? '' : '.';\n return acc + separator + item;\n }, '');\n}\nfunction escapeQuotes(str) {\n return str.replace(/\"/g, '\\\\\"');\n}\n","export function isNonEmptyArray(value) {\n return value.length !== 0;\n}\n","import * as zod from 'zod';\nimport { joinPath } from './utils/joinPath';\nimport { isNonEmptyArray } from './utils/NonEmptyArray';\nconst MAX_ISSUES_IN_MESSAGE = 99;\nconst ISSUE_SEPARATOR = '; ';\nconst UNION_SEPARATOR = ', or ';\nconst PREFIX = 'Validation error';\nconst PREFIX_SEPARATOR = ': ';\nexport class ValidationError extends Error {\n details;\n name;\n constructor(message, details = []) {\n super(message);\n this.details = details;\n this.name = 'ZodValidationError';\n }\n toString() {\n return this.message;\n }\n}\nfunction getMessageFromZodIssue(issue, issueSeparator, unionSeparator) {\n if (issue.code === 'invalid_union') {\n return issue.unionErrors\n .reduce((acc, zodError) => {\n const newIssues = zodError.issues\n .map((issue) => getMessageFromZodIssue(issue, issueSeparator, unionSeparator))\n .join(issueSeparator);\n if (!acc.includes(newIssues)) {\n acc.push(newIssues);\n }\n return acc;\n }, [])\n .join(unionSeparator);\n }\n if (isNonEmptyArray(issue.path)) {\n if (issue.path.length === 1) {\n const identifier = issue.path[0];\n if (typeof identifier === 'number') {\n return `${issue.message} at index ${identifier}`;\n }\n }\n return `${issue.message} at \"${joinPath(issue.path)}\"`;\n }\n return issue.message;\n}\nfunction conditionallyPrefixMessage(reason, prefix, prefixSeparator) {\n if (prefix !== null) {\n if (reason.length > 0) {\n return [prefix, reason].join(prefixSeparator);\n }\n return prefix;\n }\n if (reason.length > 0) {\n return reason;\n }\n return PREFIX;\n}\nexport function fromZodIssue(issue, options = {}) {\n const { issueSeparator = ISSUE_SEPARATOR, unionSeparator = UNION_SEPARATOR, prefixSeparator = PREFIX_SEPARATOR, prefix = PREFIX, } = options;\n const reason = getMessageFromZodIssue(issue, issueSeparator, unionSeparator);\n const message = conditionallyPrefixMessage(reason, prefix, prefixSeparator);\n return new ValidationError(message, [issue]);\n}\nexport function fromZodError(zodError, options = {}) {\n const { maxIssuesInMessage = MAX_ISSUES_IN_MESSAGE, issueSeparator = ISSUE_SEPARATOR, unionSeparator = UNION_SEPARATOR, prefixSeparator = PREFIX_SEPARATOR, prefix = PREFIX, } = options;\n const reason = zodError.errors\n .slice(0, maxIssuesInMessage)\n .map((issue) => getMessageFromZodIssue(issue, issueSeparator, unionSeparator))\n .join(issueSeparator);\n const message = conditionallyPrefixMessage(reason, prefix, prefixSeparator);\n return new ValidationError(message, zodError.errors);\n}\nexport const toValidationError = (options = {}) => (err) => {\n if (err instanceof zod.ZodError) {\n return fromZodError(err, options);\n }\n if (err instanceof Error) {\n return err;\n }\n return new Error('Unknown error');\n};\nexport function isValidationError(err) {\n return err instanceof ValidationError;\n}\nexport function isValidationErrorLike(err) {\n return err instanceof Error && err.name === 'ZodValidationError';\n}\nexport const errorMap = (issue, ctx) => {\n const error = fromZodIssue({\n ...issue,\n message: issue.message ?? ctx.defaultError,\n });\n return {\n message: error.message,\n };\n};\n","var a=Object.defineProperty;var m=(r,e,o)=>e in r?a(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o;var x=(r,e,o)=>(m(r,typeof e!=\"symbol\"?e+\"\":e,o),o);import d from\"chalk\";import{z as c,ZodIssueCode as i}from\"zod\";import{fromZodError as p}from\"zod-validation-error\";var t=class extends Error{name=\"MUDContextAlreadyCreatedError\";message=\"MUD context was already created\"},s=class extends Error{name=\"MUDContextNotCreatedError\";message=\"MUD context has not been created\"};function l(r,e){return p(r,{prefix:d.red(e),prefixSeparator:`\n- `,issueSeparator:`\n- `})}var n=class extends Error{name=\"NotInsideProjectError\";message=\"You are not inside a MUD project\"};function U(r,e){return new c.ZodError([{code:i.custom,path:r,message:`Unrecognized system: \"${e}\"`}])}export{x as a,t as b,s as c,l as d,n as e,U as f};\n//# sourceMappingURL=chunk-AXXYPYMM.js.map","import{a as m,b as f,c as p}from\"./chunk-AXXYPYMM.js\";import{z as s}from\"zod\";import{utils as E}from\"ethers\";import{ZodIssueCode as r}from\"zod\";var g=16;function d(e,t){/^\\w+$/.test(e)||t.addIssue({code:r.custom,message:\"Name must contain only alphanumeric & underscore characters\"})}function x(e,t){d(e,t),/^[A-Z]/.test(e)||t.addIssue({code:r.custom,message:\"Name must start with a capital letter\"})}function C(e,t){d(e,t),/^[a-z]/.test(e)||t.addIssue({code:r.custom,message:\"Name must start with a lowercase letter\"})}function h(e,t){e.length===0&&t.addIssue({code:r.custom,message:\"Enum must not be empty\"}),e.length>=256&&t.addIssue({code:r.custom,message:\"Length of enum must be < 256\"});let o=M(e);o.length>0&&t.addIssue({code:r.custom,message:`Enum must not have duplicate names for: ${o.join(\", \")}`})}function c(e,t){return(o,n)=>{if(o===\"\"){e&&n.addIssue({code:r.custom,message:\"Route must not be empty\"});return}o[0]!==\"/\"&&n.addIssue({code:r.custom,message:'Route must start with \"/\"'}),o[o.length-1]===\"/\"&&n.addIssue({code:r.custom,message:'Route must not end with \"/\"'});let a=o.split(\"/\");t&&a.length>2&&n.addIssue({code:r.custom,message:'Route must only have one level (e.g. \"/foo\")'});for(let u=1;ug&&t.addIssue({code:r.custom,message:`Selector must be <= ${g} characters`}),/^\\w*$/.test(e)||t.addIssue({code:r.custom,message:\"Selector must contain only alphanumeric & underscore characters\"})}function z(e){let t=e.match(/^(\\w+)\\[(\\d+)\\]$/);return t?{elementType:t[1],staticLength:Number.parseInt(t[2])}:null}var v=s.string().superRefine(x),$=s.string().superRefine(C),B=s.string().superRefine(d),G=s.array(v).superRefine(h),O=s.string().superRefine(y),V=s.string().superRefine(b),j=s.string().superRefine(R),k=s.string().superRefine(D),P=s.string().superRefine(U);var l=class{static isCreated(){return this._global.__mudCoreContext!==void 0}static createContext(){if(this.isCreated())throw new f;let t=this._global,o=new l;return t.__mudCoreContext=o,o}static getContext(){let o=this._global.__mudCoreContext;if(o===void 0)throw new p;return o}configExtenders=[]},i=l;m(i,\"_global\",typeof global>\"u\"?window.global??{}:global);function Y(e){let t=e,o=i.getContext();for(let n of o.configExtenders)t=n(t);return t}function q(e){i.getContext().configExtenders.push(e)}import{MUDError as I}from\"@latticexyz/common/errors\";var w=(o=>(o[o.TABLE_ID=0]=\"TABLE_ID\",o[o.SYSTEM_ADDRESS=1]=\"SYSTEM_ADDRESS\",o))(w||{});function ee(e){return{type:0,input:e}}function A(e){return typeof e==\"object\"&&e!==null&&\"type\"in e&&\"input\"in e}async function te(e,t){if(!A(e))return e;let o;if(e.type===0){let n=t.tableIds?.[e.input];o=n&&{value:n,type:\"bytes32\"}}if(o===void 0)throw new I(`Could not resolve dynamic resolution: \n${JSON.stringify(e,null,2)}`);return o}export{g as a,d as b,x as c,C as d,h as e,y as f,R as g,b as h,D as i,M as j,U as k,z as l,v as m,$ as n,B as o,G as p,O as q,V as r,j as s,k as t,P as u,i as v,Y as w,q as x,w as y,ee as z,A,te as B};\n//# sourceMappingURL=chunk-4G6ZGMDP.js.map","var l={storeImportPath:\"@latticexyz/store/src/\",userTypesPath:\"Types\",codegenDirectory:\"codegen\"},g={namespace:\"\",enums:{}},m={directory:\"tables\",keySchema:{key:\"bytes32\"},tableIdArgument:!1,storeArgument:!0,ephemeral:!1};import{AbiTypes as D,StaticAbiTypes as z}from\"@latticexyz/schema-type/deprecated\";import{z as t,ZodIssueCode as o}from\"zod\";import{getDuplicates as p,parseStaticArray as R,STORE_SELECTOR_MAX_LENGTH as L,zObjectName as f,zSelector as S,zUserEnum as k,zValueName as b}from\"@latticexyz/config\";var j=f,O=b,v=b,I=f,d=t.string(),_=t.string(),P=t.record(O,_).default(m.keySchema),U=t.record(v,d).refine(e=>Object.keys(e).length>0,\"Table schema may not be empty\"),K=d.transform(e=>U.parse({value:e})),q=U.or(K),h=t.object({directory:t.string().default(m.directory),name:S.optional(),tableIdArgument:t.boolean().default(m.tableIdArgument),storeArgument:t.boolean().default(m.storeArgument),dataStruct:t.boolean().optional(),keySchema:P,schema:q,ephemeral:t.boolean().default(m.ephemeral)}).transform(e=>(Object.keys(e.schema).length===1?e.dataStruct??=!1:e.dataStruct??=!0,e)),B=d.transform(e=>h.parse({schema:{value:e}})),M=h.or(B),$=t.record(j,M).transform(e=>{for(let n of Object.keys(e)){let s=e[n];s.name=n.slice(0,L),e[n]=s}return e}),H=t.object({enums:t.record(I,k).default(g.enums)}),x=t.object({namespace:S.default(g.namespace),storeImportPath:t.string().default(l.storeImportPath),tables:$,userTypesPath:t.string().default(l.userTypesPath),codegenDirectory:t.string().default(l.codegenDirectory)}).merge(H),se=x.superRefine(C),re=x.catchall(t.any()).superRefine(C);function C(e,n){for(let a of Object.values(e.tables)){let c=Object.keys(a.keySchema),N=Object.keys(a.schema),T=p([...c,...N]);T.length>0&&n.addIssue({code:o.custom,message:`Field and key names within one table must be unique: ${T.join(\", \")}`})}let s=Object.keys(e.tables),r=Object.keys(e.enums),i=r,E=[...s,...i],u=p(E);u.length>0&&n.addIssue({code:o.custom,message:`Table library names, enum names must be globally unique: ${u.join(\", \")}`});let A=Object.values(e.tables).map(({name:a})=>a),y=p(A);y.length>0&&n.addIssue({code:o.custom,message:`Table names must be unique: ${y.join(\", \")}`});for(let a of Object.values(e.tables)){for(let c of Object.values(a.keySchema))F(r,c,n);for(let c of Object.values(a.schema))G(i,r,c,n)}}function G(e,n,s,r){if(!D.includes(s)&&!e.includes(s)){let i=R(s);i?V(n,i.elementType,i.staticLength,r):r.addIssue({code:o.custom,message:`${s} is not a valid abi type, and is not defined in userTypes`})}}function F(e,n,s){!z.includes(n)&&!e.includes(n)&&s.addIssue({code:o.custom,message:`${n} is not a static type`})}function V(e,n,s,r){F(e,n,r),s===0?r.addIssue({code:o.custom,message:\"Static array length must not be 0\"}):s>=2**16&&r.addIssue({code:o.custom,message:\"Static array length must be less than 2**16\"})}export{l as a,g as b,m as c,q as d,M as e,$ as f,H as g,se as h,re as i};\n//# sourceMappingURL=chunk-5AKM5HGJ.js.map","import{v as e,w as o,z as r}from\"../chunk-4G6ZGMDP.js\";import\"../chunk-AXXYPYMM.js\";e.isCreated()||e.createContext();export{o as mudCoreConfig,r as resolveTableId};\n//# sourceMappingURL=index.js.map","import{i as e}from\"./chunk-5AKM5HGJ.js\";import\"@latticexyz/config/register\";import{mudCoreConfig as c,resolveTableId as y}from\"@latticexyz/config/register\";import{extendMUDCoreConfig as t,fromZodErrorCustom as n}from\"@latticexyz/config\";import{ZodError as i}from\"zod\";t(r=>{try{return e.parse(r)}catch(o){throw o instanceof i?n(o,\"StoreConfig Validation Error\"):o}});import{mudCoreConfig as m}from\"@latticexyz/config\";function s(r){return m(r)}export{s as a,c as b,y as c};\n//# sourceMappingURL=chunk-6QMWGFYG.js.map","import{a as e}from\"./chunk-6QMWGFYG.js\";import\"./chunk-5AKM5HGJ.js\";var a=e({storeImportPath:\"../../\",namespace:\"mudstore\",enums:{ExampleEnum:[\"None\",\"First\",\"Second\",\"Third\"]},tables:{Hooks:\"address[]\",Callbacks:\"bytes24[]\",Tables:{keySchema:{tableId:\"bytes32\"},schema:{keySchema:\"bytes32\",valueSchema:\"bytes32\",abiEncodedKeyNames:\"bytes\",abiEncodedFieldNames:\"bytes\"}},Mixed:{schema:{u32:\"uint32\",u128:\"uint128\",a32:\"uint32[]\",s:\"string\"}},Vector2:{schema:{x:\"uint32\",y:\"uint32\"}},KeyEncoding:{keySchema:{k1:\"uint256\",k2:\"int32\",k3:\"bytes16\",k4:\"address\",k5:\"bool\",k6:\"ExampleEnum\"},schema:\"bool\"}}});export{a as default};\n//# sourceMappingURL=mud.config.js.map","import{decodeField as R,decodeKeyTuple as F,decodeRecord as S,abiTypesToSchema as C,hexToSchema as N}from\"@latticexyz/protocol-parser\";import{decodeAbiParameters as v,getAddress as m,parseAbiParameters as h}from\"viem\";import E from\"debug\";var g=E(\"mud:store-sync\");import{isDefined as O}from\"@latticexyz/common/utils\";import{hexToTableId as T,tableIdToHex as V}from\"@latticexyz/common\";import x from\"@latticexyz/store/mud.config\";var k=x.tables.Tables,A=V(x.namespace,k.name);function G({registerTables:I,getTables:L,storeOperations:P}){return async o=>{let t=o.logs.map(e=>{if(e.eventName!==\"StoreSetRecord\"||e.args.table!==A)return;let[a,...f]=e.args.key;f.length&&console.warn(\"registerSchema event is expected to have only one key in key tuple, but got multiple\",e);let b=T(a),c=S(C(Object.values(k.schema)),e.args.data),s=Object.fromEntries(Object.keys(k.schema).map((i,d)=>[i,c[d]])),p=N(s.keySchema),l=N(s.valueSchema),r=v(h(\"string[]\"),s.abiEncodedKeyNames)[0],n=v(h(\"string[]\"),s.abiEncodedFieldNames)[0],u=[...l.staticFields,...l.dynamicFields];return{address:e.address,tableId:a,namespace:b.namespace,name:b.name,keySchema:Object.fromEntries(p.staticFields.map((i,d)=>[r[d],i])),valueSchema:Object.fromEntries(u.map((i,d)=>[n[d],i]))}}).filter(O);t.length>0&&await I({blockNumber:o.blockNumber,tables:t});let j=Array.from(new Set(o.logs.map(e=>JSON.stringify({address:m(e.address),tableId:e.args.table,...T(e.args.table)})))).map(e=>JSON.parse(e)),B=Object.fromEntries((await L({blockNumber:o.blockNumber,tables:j})).map(e=>[`${m(e.address)}:${e.tableId}`,e])),y=o.logs.map(e=>{let a=B[`${m(e.address)}:${e.args.table}`];if(!a){g(\"no table found for event, skipping\",T(e.args.table),e);return}let f=Object.keys(a.keySchema),b=F({staticFields:Object.values(a.keySchema),dynamicFields:[]},e.args.key),c=Object.fromEntries(b.map((r,n)=>[f[n],r])),s=Object.values(a.valueSchema),p=C(s),l=Object.keys(a.valueSchema);if(e.eventName===\"StoreSetRecord\"||e.eventName===\"StoreEphemeralRecord\"){let r=S(p,e.args.data),n=Object.fromEntries(l.map((u,i)=>[u,r[i]]));return{log:e,address:m(e.address),namespace:a.namespace,name:a.name,type:\"SetRecord\",key:c,value:n}}if(e.eventName===\"StoreSetField\"){let r=l[e.args.schemaIndex],n=R(s[e.args.schemaIndex],e.args.data);return{log:e,address:m(e.address),namespace:a.namespace,name:a.name,type:\"SetField\",key:c,fieldName:r,fieldValue:n}}if(e.eventName===\"StoreDeleteRecord\")return{log:e,address:m(e.address),namespace:a.namespace,name:a.name,type:\"DeleteRecord\",key:c};g(\"unknown store event or log, skipping\",e)}).filter(O);return await P({blockNumber:o.blockNumber,operations:y}),{blockNumber:o.blockNumber,operations:y}}}var w=(t=>(t.INITIALIZE=\"initialize\",t.SNAPSHOT=\"snapshot\",t.RPC=\"rpc\",t.LIVE=\"live\",t))(w||{});export{g as a,G as b,w as c};\n//# sourceMappingURL=chunk-SNWOSPCV.js.map","/**\n * @internal\n */ function invert(obj) {\n const newObj = Object.create(null);\n for(const key in obj){\n const v = obj[key];\n newObj[v] = key;\n }\n return newObj;\n}\n\n// reference: https://www.jsonrpc.org/specification\n/**\n * JSON-RPC 2.0 Error codes\n *\n * `-32000` to `-32099` are reserved for implementation-defined server-errors.\n * For tRPC we're copying the last digits of HTTP 4XX errors.\n */ const TRPC_ERROR_CODES_BY_KEY = {\n /**\n * Invalid JSON was received by the server.\n * An error occurred on the server while parsing the JSON text.\n */ PARSE_ERROR: -32700,\n /**\n * The JSON sent is not a valid Request object.\n */ BAD_REQUEST: -32600,\n /**\n * Internal JSON-RPC error.\n */ INTERNAL_SERVER_ERROR: -32603,\n // Implementation specific errors\n UNAUTHORIZED: -32001,\n FORBIDDEN: -32003,\n NOT_FOUND: -32004,\n METHOD_NOT_SUPPORTED: -32005,\n TIMEOUT: -32008,\n CONFLICT: -32009,\n PRECONDITION_FAILED: -32012,\n PAYLOAD_TOO_LARGE: -32013,\n UNPROCESSABLE_CONTENT: -32022,\n TOO_MANY_REQUESTS: -32029,\n CLIENT_CLOSED_REQUEST: -32099\n};\nconst TRPC_ERROR_CODES_BY_NUMBER = invert(TRPC_ERROR_CODES_BY_KEY);\n\nexport { TRPC_ERROR_CODES_BY_KEY as T, TRPC_ERROR_CODES_BY_NUMBER as a, invert as i };\n","import { i as invert, T as TRPC_ERROR_CODES_BY_KEY } from './codes-24aa1ce1.mjs';\n\nconst TRPC_ERROR_CODES_BY_NUMBER = invert(TRPC_ERROR_CODES_BY_KEY);\nconst JSONRPC2_TO_HTTP_CODE = {\n PARSE_ERROR: 400,\n BAD_REQUEST: 400,\n NOT_FOUND: 404,\n INTERNAL_SERVER_ERROR: 500,\n UNAUTHORIZED: 401,\n FORBIDDEN: 403,\n TIMEOUT: 408,\n CONFLICT: 409,\n CLIENT_CLOSED_REQUEST: 499,\n PRECONDITION_FAILED: 412,\n PAYLOAD_TOO_LARGE: 413,\n METHOD_NOT_SUPPORTED: 405,\n UNPROCESSABLE_CONTENT: 422,\n TOO_MANY_REQUESTS: 429\n};\nfunction getStatusCodeFromKey(code) {\n return JSONRPC2_TO_HTTP_CODE[code] ?? 500;\n}\nfunction getHTTPStatusCode(json) {\n const arr = Array.isArray(json) ? json : [\n json\n ];\n const httpStatuses = new Set(arr.map((res)=>{\n if ('error' in res) {\n const data = res.error.data;\n if (typeof data.httpStatus === 'number') {\n return data.httpStatus;\n }\n const code = TRPC_ERROR_CODES_BY_NUMBER[res.error.code];\n return getStatusCodeFromKey(code);\n }\n return 200;\n }));\n if (httpStatuses.size !== 1) {\n return 207;\n }\n const httpStatus = httpStatuses.values().next().value;\n return httpStatus;\n}\nfunction getHTTPStatusCodeFromError(error) {\n const { code } = error;\n return getStatusCodeFromKey(code);\n}\n\nconst noop = ()=>{\n// noop\n};\nfunction createInnerProxy(callback, path) {\n const proxy = new Proxy(noop, {\n get (_obj, key) {\n if (typeof key !== 'string' || key === 'then') {\n // special case for if the proxy is accidentally treated\n // like a PromiseLike (like in `Promise.resolve(proxy)`)\n return undefined;\n }\n return createInnerProxy(callback, [\n ...path,\n key\n ]);\n },\n apply (_1, _2, args) {\n const isApply = path[path.length - 1] === 'apply';\n return callback({\n args: isApply ? args.length >= 2 ? args[1] : [] : args,\n path: isApply ? path.slice(0, -1) : path\n });\n }\n });\n return proxy;\n}\n/**\n * Creates a proxy that calls the callback with the path and arguments\n *\n * @internal\n */ const createRecursiveProxy = (callback)=>createInnerProxy(callback, []);\n/**\n * Used in place of `new Proxy` where each handler will map 1 level deep to another value.\n *\n * @internal\n */ const createFlatProxy = (callback)=>{\n return new Proxy(noop, {\n get (_obj, name) {\n if (typeof name !== 'string' || name === 'then') {\n // special case for if the proxy is accidentally treated\n // like a PromiseLike (like in `Promise.resolve(proxy)`)\n return undefined;\n }\n return callback(name);\n }\n });\n};\n\nexport { TRPC_ERROR_CODES_BY_NUMBER as T, createRecursiveProxy as a, getHTTPStatusCode as b, createFlatProxy as c, getHTTPStatusCodeFromError as g };\n","import { T as TRPCError } from './TRPCError-6a1653a4.mjs';\nimport { a as createRecursiveProxy, g as getHTTPStatusCodeFromError } from './index-044a193b.mjs';\nimport { T as TRPC_ERROR_CODES_BY_KEY } from './codes-24aa1ce1.mjs';\n\n/**\n * @public\n */ /**\n * @internal\n */ function getDataTransformer(transformer) {\n if ('input' in transformer) {\n return transformer;\n }\n return {\n input: transformer,\n output: transformer\n };\n}\n/**\n * @internal\n */ const defaultTransformer = {\n _default: true,\n input: {\n serialize: (obj)=>obj,\n deserialize: (obj)=>obj\n },\n output: {\n serialize: (obj)=>obj,\n deserialize: (obj)=>obj\n }\n};\n\nconst defaultFormatter = ({ shape })=>{\n return shape;\n};\n\n/**\n * Create an object without inheriting anything from `Object.prototype`\n * @internal\n */ function omitPrototype(obj) {\n return Object.assign(Object.create(null), obj);\n}\n\nconst procedureTypes = [\n 'query',\n 'mutation',\n 'subscription'\n];\n\nfunction isRouter(procedureOrRouter) {\n return 'router' in procedureOrRouter._def;\n}\nconst emptyRouter = {\n _ctx: null,\n _errorShape: null,\n _meta: null,\n queries: {},\n mutations: {},\n subscriptions: {},\n errorFormatter: defaultFormatter,\n transformer: defaultTransformer\n};\n/**\n * Reserved words that can't be used as router or procedure names\n */ const reservedWords = [\n /**\n * Then is a reserved word because otherwise we can't return a promise that returns a Proxy\n * since JS will think that `.then` is something that exists\n */ 'then'\n];\n/**\n * @internal\n */ function createRouterFactory(config) {\n return function createRouterInner(procedures) {\n const reservedWordsUsed = new Set(Object.keys(procedures).filter((v)=>reservedWords.includes(v)));\n if (reservedWordsUsed.size > 0) {\n throw new Error('Reserved words used in `router({})` call: ' + Array.from(reservedWordsUsed).join(', '));\n }\n const routerProcedures = omitPrototype({});\n function recursiveGetPaths(procedures, path = '') {\n for (const [key, procedureOrRouter] of Object.entries(procedures ?? {})){\n const newPath = `${path}${key}`;\n if (isRouter(procedureOrRouter)) {\n recursiveGetPaths(procedureOrRouter._def.procedures, `${newPath}.`);\n continue;\n }\n if (routerProcedures[newPath]) {\n throw new Error(`Duplicate key: ${newPath}`);\n }\n routerProcedures[newPath] = procedureOrRouter;\n }\n }\n recursiveGetPaths(procedures);\n const _def = {\n _config: config,\n router: true,\n procedures: routerProcedures,\n ...emptyRouter,\n record: procedures,\n queries: Object.entries(routerProcedures).filter((pair)=>pair[1]._def.query).reduce((acc, [key, val])=>({\n ...acc,\n [key]: val\n }), {}),\n mutations: Object.entries(routerProcedures).filter((pair)=>pair[1]._def.mutation).reduce((acc, [key, val])=>({\n ...acc,\n [key]: val\n }), {}),\n subscriptions: Object.entries(routerProcedures).filter((pair)=>pair[1]._def.subscription).reduce((acc, [key, val])=>({\n ...acc,\n [key]: val\n }), {})\n };\n const router = {\n ...procedures,\n _def,\n createCaller (ctx) {\n const proxy = createRecursiveProxy(({ path , args })=>{\n // interop mode\n if (path.length === 1 && procedureTypes.includes(path[0])) {\n return callProcedure({\n procedures: _def.procedures,\n path: args[0],\n rawInput: args[1],\n ctx,\n type: path[0]\n });\n }\n const fullPath = path.join('.');\n const procedure = _def.procedures[fullPath];\n let type = 'query';\n if (procedure._def.mutation) {\n type = 'mutation';\n } else if (procedure._def.subscription) {\n type = 'subscription';\n }\n return procedure({\n path: fullPath,\n rawInput: args[0],\n ctx,\n type\n });\n });\n return proxy;\n },\n getErrorShape (opts) {\n const { path , error } = opts;\n const { code } = opts.error;\n const shape = {\n message: error.message,\n code: TRPC_ERROR_CODES_BY_KEY[code],\n data: {\n code,\n httpStatus: getHTTPStatusCodeFromError(error)\n }\n };\n if (config.isDev && typeof opts.error.stack === 'string') {\n shape.data.stack = opts.error.stack;\n }\n if (typeof path === 'string') {\n shape.data.path = path;\n }\n return this._def._config.errorFormatter({\n ...opts,\n shape\n });\n }\n };\n return router;\n };\n}\n/**\n * @internal\n */ function callProcedure(opts) {\n const { type , path } = opts;\n if (!(path in opts.procedures) || !opts.procedures[path]?._def[type]) {\n throw new TRPCError({\n code: 'NOT_FOUND',\n message: `No \"${type}\"-procedure on path \"${path}\"`\n });\n }\n const procedure = opts.procedures[path];\n return procedure(opts);\n}\n\n/**\n * The default check to see if we're in a server\n */ const isServerDefault = typeof window === 'undefined' || 'Deno' in window || globalThis.process?.env?.NODE_ENV === 'test' || !!globalThis.process?.env?.JEST_WORKER_ID || !!globalThis.process?.env?.VITEST_WORKER_ID;\n\nexport { defaultTransformer as a, callProcedure as b, createRouterFactory as c, defaultFormatter as d, getDataTransformer as g, isServerDefault as i, procedureTypes as p };\n","var DoubleIndexedKV = /** @class */ (function () {\n function DoubleIndexedKV() {\n this.keyToValue = new Map();\n this.valueToKey = new Map();\n }\n DoubleIndexedKV.prototype.set = function (key, value) {\n this.keyToValue.set(key, value);\n this.valueToKey.set(value, key);\n };\n DoubleIndexedKV.prototype.getByKey = function (key) {\n return this.keyToValue.get(key);\n };\n DoubleIndexedKV.prototype.getByValue = function (value) {\n return this.valueToKey.get(value);\n };\n DoubleIndexedKV.prototype.clear = function () {\n this.keyToValue.clear();\n this.valueToKey.clear();\n };\n return DoubleIndexedKV;\n}());\nexport { DoubleIndexedKV };\n//# sourceMappingURL=double-indexed-kv.js.map","import { DoubleIndexedKV } from './double-indexed-kv';\nvar Registry = /** @class */ (function () {\n function Registry(generateIdentifier) {\n this.generateIdentifier = generateIdentifier;\n this.kv = new DoubleIndexedKV();\n }\n Registry.prototype.register = function (value, identifier) {\n if (this.kv.getByValue(value)) {\n return;\n }\n if (!identifier) {\n identifier = this.generateIdentifier(value);\n }\n this.kv.set(identifier, value);\n };\n Registry.prototype.clear = function () {\n this.kv.clear();\n };\n Registry.prototype.getIdentifier = function (value) {\n return this.kv.getByValue(value);\n };\n Registry.prototype.getValue = function (identifier) {\n return this.kv.getByKey(identifier);\n };\n return Registry;\n}());\nexport { Registry };\n//# sourceMappingURL=registry.js.map","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Registry } from './registry';\nvar ClassRegistry = /** @class */ (function (_super) {\n __extends(ClassRegistry, _super);\n function ClassRegistry() {\n var _this = _super.call(this, function (c) { return c.name; }) || this;\n _this.classToAllowedProps = new Map();\n return _this;\n }\n ClassRegistry.prototype.register = function (value, options) {\n if (typeof options === 'object') {\n if (options.allowProps) {\n this.classToAllowedProps.set(value, options.allowProps);\n }\n _super.prototype.register.call(this, value, options.identifier);\n }\n else {\n _super.prototype.register.call(this, value, options);\n }\n };\n ClassRegistry.prototype.getAllowedProps = function (value) {\n return this.classToAllowedProps.get(value);\n };\n return ClassRegistry;\n}(Registry));\nexport { ClassRegistry };\n//# sourceMappingURL=class-registry.js.map","var __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nfunction valuesOfObj(record) {\n if ('values' in Object) {\n // eslint-disable-next-line es5/no-es6-methods\n return Object.values(record);\n }\n var values = [];\n // eslint-disable-next-line no-restricted-syntax\n for (var key in record) {\n if (record.hasOwnProperty(key)) {\n values.push(record[key]);\n }\n }\n return values;\n}\nexport function find(record, predicate) {\n var values = valuesOfObj(record);\n if ('find' in values) {\n // eslint-disable-next-line es5/no-es6-methods\n return values.find(predicate);\n }\n var valuesNotNever = values;\n for (var i = 0; i < valuesNotNever.length; i++) {\n var value = valuesNotNever[i];\n if (predicate(value)) {\n return value;\n }\n }\n return undefined;\n}\nexport function forEach(record, run) {\n Object.entries(record).forEach(function (_a) {\n var _b = __read(_a, 2), key = _b[0], value = _b[1];\n return run(value, key);\n });\n}\nexport function includes(arr, value) {\n return arr.indexOf(value) !== -1;\n}\nexport function findArr(record, predicate) {\n for (var i = 0; i < record.length; i++) {\n var value = record[i];\n if (predicate(value)) {\n return value;\n }\n }\n return undefined;\n}\n//# sourceMappingURL=util.js.map","import { find } from './util';\nvar CustomTransformerRegistry = /** @class */ (function () {\n function CustomTransformerRegistry() {\n this.transfomers = {};\n }\n CustomTransformerRegistry.prototype.register = function (transformer) {\n this.transfomers[transformer.name] = transformer;\n };\n CustomTransformerRegistry.prototype.findApplicable = function (v) {\n return find(this.transfomers, function (transformer) {\n return transformer.isApplicable(v);\n });\n };\n CustomTransformerRegistry.prototype.findByName = function (name) {\n return this.transfomers[name];\n };\n return CustomTransformerRegistry;\n}());\nexport { CustomTransformerRegistry };\n//# sourceMappingURL=custom-transformer-registry.js.map","var getType = function (payload) {\n return Object.prototype.toString.call(payload).slice(8, -1);\n};\nexport var isUndefined = function (payload) {\n return typeof payload === 'undefined';\n};\nexport var isNull = function (payload) { return payload === null; };\nexport var isPlainObject = function (payload) {\n if (typeof payload !== 'object' || payload === null)\n return false;\n if (payload === Object.prototype)\n return false;\n if (Object.getPrototypeOf(payload) === null)\n return true;\n return Object.getPrototypeOf(payload) === Object.prototype;\n};\nexport var isEmptyObject = function (payload) {\n return isPlainObject(payload) && Object.keys(payload).length === 0;\n};\nexport var isArray = function (payload) {\n return Array.isArray(payload);\n};\nexport var isString = function (payload) {\n return typeof payload === 'string';\n};\nexport var isNumber = function (payload) {\n return typeof payload === 'number' && !isNaN(payload);\n};\nexport var isBoolean = function (payload) {\n return typeof payload === 'boolean';\n};\nexport var isRegExp = function (payload) {\n return payload instanceof RegExp;\n};\nexport var isMap = function (payload) {\n return payload instanceof Map;\n};\nexport var isSet = function (payload) {\n return payload instanceof Set;\n};\nexport var isSymbol = function (payload) {\n return getType(payload) === 'Symbol';\n};\nexport var isDate = function (payload) {\n return payload instanceof Date && !isNaN(payload.valueOf());\n};\nexport var isError = function (payload) {\n return payload instanceof Error;\n};\nexport var isNaNValue = function (payload) {\n return typeof payload === 'number' && isNaN(payload);\n};\nexport var isPrimitive = function (payload) {\n return isBoolean(payload) ||\n isNull(payload) ||\n isUndefined(payload) ||\n isNumber(payload) ||\n isString(payload) ||\n isSymbol(payload);\n};\nexport var isBigint = function (payload) {\n return typeof payload === 'bigint';\n};\nexport var isInfinite = function (payload) {\n return payload === Infinity || payload === -Infinity;\n};\nexport var isTypedArray = function (payload) {\n return ArrayBuffer.isView(payload) && !(payload instanceof DataView);\n};\nexport var isURL = function (payload) { return payload instanceof URL; };\n//# sourceMappingURL=is.js.map","export var escapeKey = function (key) { return key.replace(/\\./g, '\\\\.'); };\nexport var stringifyPath = function (path) {\n return path\n .map(String)\n .map(escapeKey)\n .join('.');\n};\nexport var parsePath = function (string) {\n var result = [];\n var segment = '';\n for (var i = 0; i < string.length; i++) {\n var char = string.charAt(i);\n var isEscapedDot = char === '\\\\' && string.charAt(i + 1) === '.';\n if (isEscapedDot) {\n segment += '.';\n i++;\n continue;\n }\n var isEndOfSegment = char === '.';\n if (isEndOfSegment) {\n result.push(segment);\n segment = '';\n continue;\n }\n segment += char;\n }\n var lastSegment = segment;\n result.push(lastSegment);\n return result;\n};\n//# sourceMappingURL=pathstringifier.js.map","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nimport { isBigint, isDate, isInfinite, isMap, isNaNValue, isRegExp, isSet, isUndefined, isSymbol, isArray, isError, isTypedArray, isURL, } from './is';\nimport { findArr } from './util';\nfunction simpleTransformation(isApplicable, annotation, transform, untransform) {\n return {\n isApplicable: isApplicable,\n annotation: annotation,\n transform: transform,\n untransform: untransform\n };\n}\nvar simpleRules = [\n simpleTransformation(isUndefined, 'undefined', function () { return null; }, function () { return undefined; }),\n simpleTransformation(isBigint, 'bigint', function (v) { return v.toString(); }, function (v) {\n if (typeof BigInt !== 'undefined') {\n return BigInt(v);\n }\n console.error('Please add a BigInt polyfill.');\n return v;\n }),\n simpleTransformation(isDate, 'Date', function (v) { return v.toISOString(); }, function (v) { return new Date(v); }),\n simpleTransformation(isError, 'Error', function (v, superJson) {\n var baseError = {\n name: v.name,\n message: v.message\n };\n superJson.allowedErrorProps.forEach(function (prop) {\n baseError[prop] = v[prop];\n });\n return baseError;\n }, function (v, superJson) {\n var e = new Error(v.message);\n e.name = v.name;\n e.stack = v.stack;\n superJson.allowedErrorProps.forEach(function (prop) {\n e[prop] = v[prop];\n });\n return e;\n }),\n simpleTransformation(isRegExp, 'regexp', function (v) { return '' + v; }, function (regex) {\n var body = regex.slice(1, regex.lastIndexOf('/'));\n var flags = regex.slice(regex.lastIndexOf('/') + 1);\n return new RegExp(body, flags);\n }),\n simpleTransformation(isSet, 'set', \n // (sets only exist in es6+)\n // eslint-disable-next-line es5/no-es6-methods\n function (v) { return __spreadArray([], __read(v.values())); }, function (v) { return new Set(v); }),\n simpleTransformation(isMap, 'map', function (v) { return __spreadArray([], __read(v.entries())); }, function (v) { return new Map(v); }),\n simpleTransformation(function (v) { return isNaNValue(v) || isInfinite(v); }, 'number', function (v) {\n if (isNaNValue(v)) {\n return 'NaN';\n }\n if (v > 0) {\n return 'Infinity';\n }\n else {\n return '-Infinity';\n }\n }, Number),\n simpleTransformation(function (v) { return v === 0 && 1 / v === -Infinity; }, 'number', function () {\n return '-0';\n }, Number),\n simpleTransformation(isURL, 'URL', function (v) { return v.toString(); }, function (v) { return new URL(v); }),\n];\nfunction compositeTransformation(isApplicable, annotation, transform, untransform) {\n return {\n isApplicable: isApplicable,\n annotation: annotation,\n transform: transform,\n untransform: untransform\n };\n}\nvar symbolRule = compositeTransformation(function (s, superJson) {\n if (isSymbol(s)) {\n var isRegistered = !!superJson.symbolRegistry.getIdentifier(s);\n return isRegistered;\n }\n return false;\n}, function (s, superJson) {\n var identifier = superJson.symbolRegistry.getIdentifier(s);\n return ['symbol', identifier];\n}, function (v) { return v.description; }, function (_, a, superJson) {\n var value = superJson.symbolRegistry.getValue(a[1]);\n if (!value) {\n throw new Error('Trying to deserialize unknown symbol');\n }\n return value;\n});\nvar constructorToName = [\n Int8Array,\n Uint8Array,\n Int16Array,\n Uint16Array,\n Int32Array,\n Uint32Array,\n Float32Array,\n Float64Array,\n Uint8ClampedArray,\n].reduce(function (obj, ctor) {\n obj[ctor.name] = ctor;\n return obj;\n}, {});\nvar typedArrayRule = compositeTransformation(isTypedArray, function (v) { return ['typed-array', v.constructor.name]; }, function (v) { return __spreadArray([], __read(v)); }, function (v, a) {\n var ctor = constructorToName[a[1]];\n if (!ctor) {\n throw new Error('Trying to deserialize unknown typed array');\n }\n return new ctor(v);\n});\nexport function isInstanceOfRegisteredClass(potentialClass, superJson) {\n if (potentialClass === null || potentialClass === void 0 ? void 0 : potentialClass.constructor) {\n var isRegistered = !!superJson.classRegistry.getIdentifier(potentialClass.constructor);\n return isRegistered;\n }\n return false;\n}\nvar classRule = compositeTransformation(isInstanceOfRegisteredClass, function (clazz, superJson) {\n var identifier = superJson.classRegistry.getIdentifier(clazz.constructor);\n return ['class', identifier];\n}, function (clazz, superJson) {\n var allowedProps = superJson.classRegistry.getAllowedProps(clazz.constructor);\n if (!allowedProps) {\n return __assign({}, clazz);\n }\n var result = {};\n allowedProps.forEach(function (prop) {\n result[prop] = clazz[prop];\n });\n return result;\n}, function (v, a, superJson) {\n var clazz = superJson.classRegistry.getValue(a[1]);\n if (!clazz) {\n throw new Error('Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564');\n }\n return Object.assign(Object.create(clazz.prototype), v);\n});\nvar customRule = compositeTransformation(function (value, superJson) {\n return !!superJson.customTransformerRegistry.findApplicable(value);\n}, function (value, superJson) {\n var transformer = superJson.customTransformerRegistry.findApplicable(value);\n return ['custom', transformer.name];\n}, function (value, superJson) {\n var transformer = superJson.customTransformerRegistry.findApplicable(value);\n return transformer.serialize(value);\n}, function (v, a, superJson) {\n var transformer = superJson.customTransformerRegistry.findByName(a[1]);\n if (!transformer) {\n throw new Error('Trying to deserialize unknown custom value');\n }\n return transformer.deserialize(v);\n});\nvar compositeRules = [classRule, symbolRule, customRule, typedArrayRule];\nexport var transformValue = function (value, superJson) {\n var applicableCompositeRule = findArr(compositeRules, function (rule) {\n return rule.isApplicable(value, superJson);\n });\n if (applicableCompositeRule) {\n return {\n value: applicableCompositeRule.transform(value, superJson),\n type: applicableCompositeRule.annotation(value, superJson)\n };\n }\n var applicableSimpleRule = findArr(simpleRules, function (rule) {\n return rule.isApplicable(value, superJson);\n });\n if (applicableSimpleRule) {\n return {\n value: applicableSimpleRule.transform(value, superJson),\n type: applicableSimpleRule.annotation\n };\n }\n return undefined;\n};\nvar simpleRulesByAnnotation = {};\nsimpleRules.forEach(function (rule) {\n simpleRulesByAnnotation[rule.annotation] = rule;\n});\nexport var untransformValue = function (json, type, superJson) {\n if (isArray(type)) {\n switch (type[0]) {\n case 'symbol':\n return symbolRule.untransform(json, type, superJson);\n case 'class':\n return classRule.untransform(json, type, superJson);\n case 'custom':\n return customRule.untransform(json, type, superJson);\n case 'typed-array':\n return typedArrayRule.untransform(json, type, superJson);\n default:\n throw new Error('Unknown transformation: ' + type);\n }\n }\n else {\n var transformation = simpleRulesByAnnotation[type];\n if (!transformation) {\n throw new Error('Unknown transformation: ' + type);\n }\n return transformation.untransform(json, superJson);\n }\n};\n//# sourceMappingURL=transformer.js.map","import { isMap, isArray, isPlainObject, isSet } from './is';\nimport { includes } from './util';\nvar getNthKey = function (value, n) {\n var keys = value.keys();\n while (n > 0) {\n keys.next();\n n--;\n }\n return keys.next().value;\n};\nfunction validatePath(path) {\n if (includes(path, '__proto__')) {\n throw new Error('__proto__ is not allowed as a property');\n }\n if (includes(path, 'prototype')) {\n throw new Error('prototype is not allowed as a property');\n }\n if (includes(path, 'constructor')) {\n throw new Error('constructor is not allowed as a property');\n }\n}\nexport var getDeep = function (object, path) {\n validatePath(path);\n for (var i = 0; i < path.length; i++) {\n var key = path[i];\n if (isSet(object)) {\n object = getNthKey(object, +key);\n }\n else if (isMap(object)) {\n var row = +key;\n var type = +path[++i] === 0 ? 'key' : 'value';\n var keyOfRow = getNthKey(object, row);\n switch (type) {\n case 'key':\n object = keyOfRow;\n break;\n case 'value':\n object = object.get(keyOfRow);\n break;\n }\n }\n else {\n object = object[key];\n }\n }\n return object;\n};\nexport var setDeep = function (object, path, mapper) {\n validatePath(path);\n if (path.length === 0) {\n return mapper(object);\n }\n var parent = object;\n for (var i = 0; i < path.length - 1; i++) {\n var key = path[i];\n if (isArray(parent)) {\n var index = +key;\n parent = parent[index];\n }\n else if (isPlainObject(parent)) {\n parent = parent[key];\n }\n else if (isSet(parent)) {\n var row = +key;\n parent = getNthKey(parent, row);\n }\n else if (isMap(parent)) {\n var isEnd = i === path.length - 2;\n if (isEnd) {\n break;\n }\n var row = +key;\n var type = +path[++i] === 0 ? 'key' : 'value';\n var keyOfRow = getNthKey(parent, row);\n switch (type) {\n case 'key':\n parent = keyOfRow;\n break;\n case 'value':\n parent = parent.get(keyOfRow);\n break;\n }\n }\n }\n var lastKey = path[path.length - 1];\n if (isArray(parent)) {\n parent[+lastKey] = mapper(parent[+lastKey]);\n }\n else if (isPlainObject(parent)) {\n parent[lastKey] = mapper(parent[lastKey]);\n }\n if (isSet(parent)) {\n var oldValue = getNthKey(parent, +lastKey);\n var newValue = mapper(oldValue);\n if (oldValue !== newValue) {\n parent[\"delete\"](oldValue);\n parent.add(newValue);\n }\n }\n if (isMap(parent)) {\n var row = +path[path.length - 2];\n var keyToRow = getNthKey(parent, row);\n var type = +lastKey === 0 ? 'key' : 'value';\n switch (type) {\n case 'key': {\n var newKey = mapper(keyToRow);\n parent.set(newKey, parent.get(keyToRow));\n if (newKey !== keyToRow) {\n parent[\"delete\"](keyToRow);\n }\n break;\n }\n case 'value': {\n parent.set(keyToRow, mapper(parent.get(keyToRow)));\n break;\n }\n }\n }\n return object;\n};\n//# sourceMappingURL=accessDeep.js.map","var __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nimport { isArray, isEmptyObject, isMap, isPlainObject, isPrimitive, isSet, } from './is';\nimport { escapeKey, stringifyPath } from './pathstringifier';\nimport { isInstanceOfRegisteredClass, transformValue, untransformValue, } from './transformer';\nimport { includes, forEach } from './util';\nimport { parsePath } from './pathstringifier';\nimport { getDeep, setDeep } from './accessDeep';\nfunction traverse(tree, walker, origin) {\n if (origin === void 0) { origin = []; }\n if (!tree) {\n return;\n }\n if (!isArray(tree)) {\n forEach(tree, function (subtree, key) {\n return traverse(subtree, walker, __spreadArray(__spreadArray([], __read(origin)), __read(parsePath(key))));\n });\n return;\n }\n var _a = __read(tree, 2), nodeValue = _a[0], children = _a[1];\n if (children) {\n forEach(children, function (child, key) {\n traverse(child, walker, __spreadArray(__spreadArray([], __read(origin)), __read(parsePath(key))));\n });\n }\n walker(nodeValue, origin);\n}\nexport function applyValueAnnotations(plain, annotations, superJson) {\n traverse(annotations, function (type, path) {\n plain = setDeep(plain, path, function (v) { return untransformValue(v, type, superJson); });\n });\n return plain;\n}\nexport function applyReferentialEqualityAnnotations(plain, annotations) {\n function apply(identicalPaths, path) {\n var object = getDeep(plain, parsePath(path));\n identicalPaths.map(parsePath).forEach(function (identicalObjectPath) {\n plain = setDeep(plain, identicalObjectPath, function () { return object; });\n });\n }\n if (isArray(annotations)) {\n var _a = __read(annotations, 2), root = _a[0], other = _a[1];\n root.forEach(function (identicalPath) {\n plain = setDeep(plain, parsePath(identicalPath), function () { return plain; });\n });\n if (other) {\n forEach(other, apply);\n }\n }\n else {\n forEach(annotations, apply);\n }\n return plain;\n}\nvar isDeep = function (object, superJson) {\n return isPlainObject(object) ||\n isArray(object) ||\n isMap(object) ||\n isSet(object) ||\n isInstanceOfRegisteredClass(object, superJson);\n};\nfunction addIdentity(object, path, identities) {\n var existingSet = identities.get(object);\n if (existingSet) {\n existingSet.push(path);\n }\n else {\n identities.set(object, [path]);\n }\n}\nexport function generateReferentialEqualityAnnotations(identitites) {\n var result = {};\n var rootEqualityPaths = undefined;\n identitites.forEach(function (paths) {\n if (paths.length <= 1) {\n return;\n }\n var _a = __read(paths\n .map(function (path) { return path.map(String); })\n .sort(function (a, b) { return a.length - b.length; })), shortestPath = _a[0], identicalPaths = _a.slice(1);\n if (shortestPath.length === 0) {\n rootEqualityPaths = identicalPaths.map(stringifyPath);\n }\n else {\n result[stringifyPath(shortestPath)] = identicalPaths.map(stringifyPath);\n }\n });\n if (rootEqualityPaths) {\n if (isEmptyObject(result)) {\n return [rootEqualityPaths];\n }\n else {\n return [rootEqualityPaths, result];\n }\n }\n else {\n return isEmptyObject(result) ? undefined : result;\n }\n}\nexport var walker = function (object, identities, superJson, dedupe, path, objectsInThisPath, seenObjects) {\n var _a;\n if (path === void 0) { path = []; }\n if (objectsInThisPath === void 0) { objectsInThisPath = []; }\n if (seenObjects === void 0) { seenObjects = new Map(); }\n var primitive = isPrimitive(object);\n if (!primitive) {\n addIdentity(object, path, identities);\n var seen = seenObjects.get(object);\n if (seen) {\n // short-circuit result if we've seen this object before\n return dedupe\n ? {\n transformedValue: null\n }\n : seen;\n }\n }\n if (!isDeep(object, superJson)) {\n var transformed_1 = transformValue(object, superJson);\n var result_1 = transformed_1\n ? {\n transformedValue: transformed_1.value,\n annotations: [transformed_1.type]\n }\n : {\n transformedValue: object\n };\n if (!primitive) {\n seenObjects.set(object, result_1);\n }\n return result_1;\n }\n if (includes(objectsInThisPath, object)) {\n // prevent circular references\n return {\n transformedValue: null\n };\n }\n var transformationResult = transformValue(object, superJson);\n var transformed = (_a = transformationResult === null || transformationResult === void 0 ? void 0 : transformationResult.value) !== null && _a !== void 0 ? _a : object;\n var transformedValue = isArray(transformed) ? [] : {};\n var innerAnnotations = {};\n forEach(transformed, function (value, index) {\n var recursiveResult = walker(value, identities, superJson, dedupe, __spreadArray(__spreadArray([], __read(path)), [index]), __spreadArray(__spreadArray([], __read(objectsInThisPath)), [object]), seenObjects);\n transformedValue[index] = recursiveResult.transformedValue;\n if (isArray(recursiveResult.annotations)) {\n innerAnnotations[index] = recursiveResult.annotations;\n }\n else if (isPlainObject(recursiveResult.annotations)) {\n forEach(recursiveResult.annotations, function (tree, key) {\n innerAnnotations[escapeKey(index) + '.' + key] = tree;\n });\n }\n });\n var result = isEmptyObject(innerAnnotations)\n ? {\n transformedValue: transformedValue,\n annotations: !!transformationResult\n ? [transformationResult.type]\n : undefined\n }\n : {\n transformedValue: transformedValue,\n annotations: !!transformationResult\n ? [transformationResult.type, innerAnnotations]\n : innerAnnotations\n };\n if (!primitive) {\n seenObjects.set(object, result);\n }\n return result;\n};\n//# sourceMappingURL=plainer.js.map","function getType(payload) {\n return Object.prototype.toString.call(payload).slice(8, -1);\n}\nfunction isUndefined(payload) {\n return getType(payload) === \"Undefined\";\n}\nfunction isNull(payload) {\n return getType(payload) === \"Null\";\n}\nfunction isPlainObject(payload) {\n if (getType(payload) !== \"Object\")\n return false;\n const prototype = Object.getPrototypeOf(payload);\n return !!prototype && prototype.constructor === Object && prototype === Object.prototype;\n}\nfunction isObject(payload) {\n return isPlainObject(payload);\n}\nfunction isEmptyObject(payload) {\n return isPlainObject(payload) && Object.keys(payload).length === 0;\n}\nfunction isFullObject(payload) {\n return isPlainObject(payload) && Object.keys(payload).length > 0;\n}\nfunction isAnyObject(payload) {\n return getType(payload) === \"Object\";\n}\nfunction isObjectLike(payload) {\n return isAnyObject(payload);\n}\nfunction isFunction(payload) {\n return typeof payload === \"function\";\n}\nfunction isArray(payload) {\n return getType(payload) === \"Array\";\n}\nfunction isFullArray(payload) {\n return isArray(payload) && payload.length > 0;\n}\nfunction isEmptyArray(payload) {\n return isArray(payload) && payload.length === 0;\n}\nfunction isString(payload) {\n return getType(payload) === \"String\";\n}\nfunction isFullString(payload) {\n return isString(payload) && payload !== \"\";\n}\nfunction isEmptyString(payload) {\n return payload === \"\";\n}\nfunction isNumber(payload) {\n return getType(payload) === \"Number\" && !isNaN(payload);\n}\nfunction isPositiveNumber(payload) {\n return isNumber(payload) && payload > 0;\n}\nfunction isNegativeNumber(payload) {\n return isNumber(payload) && payload < 0;\n}\nfunction isBoolean(payload) {\n return getType(payload) === \"Boolean\";\n}\nfunction isRegExp(payload) {\n return getType(payload) === \"RegExp\";\n}\nfunction isMap(payload) {\n return getType(payload) === \"Map\";\n}\nfunction isWeakMap(payload) {\n return getType(payload) === \"WeakMap\";\n}\nfunction isSet(payload) {\n return getType(payload) === \"Set\";\n}\nfunction isWeakSet(payload) {\n return getType(payload) === \"WeakSet\";\n}\nfunction isSymbol(payload) {\n return getType(payload) === \"Symbol\";\n}\nfunction isDate(payload) {\n return getType(payload) === \"Date\" && !isNaN(payload);\n}\nfunction isBlob(payload) {\n return getType(payload) === \"Blob\";\n}\nfunction isFile(payload) {\n return getType(payload) === \"File\";\n}\nfunction isPromise(payload) {\n return getType(payload) === \"Promise\";\n}\nfunction isError(payload) {\n return getType(payload) === \"Error\";\n}\nfunction isNaNValue(payload) {\n return getType(payload) === \"Number\" && isNaN(payload);\n}\nfunction isPrimitive(payload) {\n return isBoolean(payload) || isNull(payload) || isUndefined(payload) || isNumber(payload) || isString(payload) || isSymbol(payload);\n}\nconst isNullOrUndefined = isOneOf(isNull, isUndefined);\nfunction isOneOf(a, b, c, d, e) {\n return (value) => a(value) || b(value) || !!c && c(value) || !!d && d(value) || !!e && e(value);\n}\nfunction isType(payload, type) {\n if (!(type instanceof Function)) {\n throw new TypeError(\"Type must be a function\");\n }\n if (!Object.prototype.hasOwnProperty.call(type, \"prototype\")) {\n throw new TypeError(\"Type is not a class\");\n }\n const name = type.name;\n return getType(payload) === name || Boolean(payload && payload.constructor === type);\n}\nfunction isInstanceOf(value, classOrClassName) {\n if (typeof classOrClassName === \"function\") {\n for (let p = value; p; p = Object.getPrototypeOf(p)) {\n if (isType(p, classOrClassName)) {\n return true;\n }\n }\n return false;\n } else {\n for (let p = value; p; p = Object.getPrototypeOf(p)) {\n if (getType(p) === classOrClassName) {\n return true;\n }\n }\n return false;\n }\n}\n\nexport { getType, isAnyObject, isArray, isBlob, isBoolean, isDate, isEmptyArray, isEmptyObject, isEmptyString, isError, isFile, isFullArray, isFullObject, isFullString, isFunction, isInstanceOf, isMap, isNaNValue, isNegativeNumber, isNull, isNullOrUndefined, isNumber, isObject, isObjectLike, isOneOf, isPlainObject, isPositiveNumber, isPrimitive, isPromise, isRegExp, isSet, isString, isSymbol, isType, isUndefined, isWeakMap, isWeakSet };\n","import { isArray, isPlainObject } from 'is-what';\n\nfunction assignProp(carry, key, newVal, originalObject, includeNonenumerable) {\n const propType = {}.propertyIsEnumerable.call(originalObject, key) ? \"enumerable\" : \"nonenumerable\";\n if (propType === \"enumerable\")\n carry[key] = newVal;\n if (includeNonenumerable && propType === \"nonenumerable\") {\n Object.defineProperty(carry, key, {\n value: newVal,\n enumerable: false,\n writable: true,\n configurable: true\n });\n }\n}\nfunction copy(target, options = {}) {\n if (isArray(target)) {\n return target.map((item) => copy(item, options));\n }\n if (!isPlainObject(target)) {\n return target;\n }\n const props = Object.getOwnPropertyNames(target);\n const symbols = Object.getOwnPropertySymbols(target);\n return [...props, ...symbols].reduce((carry, key) => {\n if (isArray(options.props) && !options.props.includes(key)) {\n return carry;\n }\n const val = target[key];\n const newVal = copy(val, options);\n assignProp(carry, key, newVal, target, options.nonenumerable);\n return carry;\n }, {});\n}\n\nexport { copy };\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nimport { ClassRegistry } from './class-registry';\nimport { Registry } from './registry';\nimport { CustomTransformerRegistry, } from './custom-transformer-registry';\nimport { applyReferentialEqualityAnnotations, applyValueAnnotations, generateReferentialEqualityAnnotations, walker, } from './plainer';\nimport { copy } from 'copy-anything';\nvar SuperJSON = /** @class */ (function () {\n /**\n * @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.\n */\n function SuperJSON(_a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.dedupe, dedupe = _c === void 0 ? false : _c;\n this.classRegistry = new ClassRegistry();\n this.symbolRegistry = new Registry(function (s) { var _a; return (_a = s.description) !== null && _a !== void 0 ? _a : ''; });\n this.customTransformerRegistry = new CustomTransformerRegistry();\n this.allowedErrorProps = [];\n this.dedupe = dedupe;\n }\n SuperJSON.prototype.serialize = function (object) {\n var identities = new Map();\n var output = walker(object, identities, this, this.dedupe);\n var res = {\n json: output.transformedValue\n };\n if (output.annotations) {\n res.meta = __assign(__assign({}, res.meta), { values: output.annotations });\n }\n var equalityAnnotations = generateReferentialEqualityAnnotations(identities);\n if (equalityAnnotations) {\n res.meta = __assign(__assign({}, res.meta), { referentialEqualities: equalityAnnotations });\n }\n return res;\n };\n SuperJSON.prototype.deserialize = function (payload) {\n var json = payload.json, meta = payload.meta;\n var result = copy(json);\n if (meta === null || meta === void 0 ? void 0 : meta.values) {\n result = applyValueAnnotations(result, meta.values, this);\n }\n if (meta === null || meta === void 0 ? void 0 : meta.referentialEqualities) {\n result = applyReferentialEqualityAnnotations(result, meta.referentialEqualities);\n }\n return result;\n };\n SuperJSON.prototype.stringify = function (object) {\n return JSON.stringify(this.serialize(object));\n };\n SuperJSON.prototype.parse = function (string) {\n return this.deserialize(JSON.parse(string));\n };\n SuperJSON.prototype.registerClass = function (v, options) {\n this.classRegistry.register(v, options);\n };\n SuperJSON.prototype.registerSymbol = function (v, identifier) {\n this.symbolRegistry.register(v, identifier);\n };\n SuperJSON.prototype.registerCustom = function (transformer, name) {\n this.customTransformerRegistry.register(__assign({ name: name }, transformer));\n };\n SuperJSON.prototype.allowErrorProps = function () {\n var _a;\n var props = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n props[_i] = arguments[_i];\n }\n (_a = this.allowedErrorProps).push.apply(_a, __spreadArray([], __read(props)));\n };\n SuperJSON.defaultInstance = new SuperJSON();\n SuperJSON.serialize = SuperJSON.defaultInstance.serialize.bind(SuperJSON.defaultInstance);\n SuperJSON.deserialize = SuperJSON.defaultInstance.deserialize.bind(SuperJSON.defaultInstance);\n SuperJSON.stringify = SuperJSON.defaultInstance.stringify.bind(SuperJSON.defaultInstance);\n SuperJSON.parse = SuperJSON.defaultInstance.parse.bind(SuperJSON.defaultInstance);\n SuperJSON.registerClass = SuperJSON.defaultInstance.registerClass.bind(SuperJSON.defaultInstance);\n SuperJSON.registerSymbol = SuperJSON.defaultInstance.registerSymbol.bind(SuperJSON.defaultInstance);\n SuperJSON.registerCustom = SuperJSON.defaultInstance.registerCustom.bind(SuperJSON.defaultInstance);\n SuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(SuperJSON.defaultInstance);\n return SuperJSON;\n}());\nexport default SuperJSON;\nexport { SuperJSON };\nexport var serialize = SuperJSON.serialize;\nexport var deserialize = SuperJSON.deserialize;\nexport var stringify = SuperJSON.stringify;\nexport var parse = SuperJSON.parse;\nexport var registerClass = SuperJSON.registerClass;\nexport var registerCustom = SuperJSON.registerCustom;\nexport var registerSymbol = SuperJSON.registerSymbol;\nexport var allowErrorProps = SuperJSON.allowErrorProps;\n//# sourceMappingURL=index.js.map","function identity(x) {\n return x;\n}\n\n/** @internal */ function pipeFromArray(fns) {\n if (fns.length === 0) {\n return identity;\n }\n if (fns.length === 1) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return fns[0];\n }\n return function piped(input) {\n return fns.reduce((prev, fn)=>fn(prev), input);\n };\n}\n\nfunction isObservable(x) {\n return typeof x === 'object' && x !== null && 'subscribe' in x;\n}\nfunction observable(subscribe) {\n const self = {\n subscribe (observer) {\n let teardownRef = null;\n let isDone = false;\n let unsubscribed = false;\n let teardownImmediately = false;\n function unsubscribe() {\n if (teardownRef === null) {\n teardownImmediately = true;\n return;\n }\n if (unsubscribed) {\n return;\n }\n unsubscribed = true;\n if (typeof teardownRef === 'function') {\n teardownRef();\n } else if (teardownRef) {\n teardownRef.unsubscribe();\n }\n }\n teardownRef = subscribe({\n next (value) {\n if (isDone) {\n return;\n }\n observer.next?.(value);\n },\n error (err) {\n if (isDone) {\n return;\n }\n isDone = true;\n observer.error?.(err);\n unsubscribe();\n },\n complete () {\n if (isDone) {\n return;\n }\n isDone = true;\n observer.complete?.();\n unsubscribe();\n }\n });\n if (teardownImmediately) {\n unsubscribe();\n }\n return {\n unsubscribe\n };\n },\n pipe (...operations) {\n return pipeFromArray(operations)(self);\n }\n };\n return self;\n}\n\nexport { isObservable as i, observable as o };\n","export { i as isObservable, o as observable } from '../observable-ade1bad8.mjs';\n\nfunction share(_opts) {\n return (originalObserver)=>{\n let refCount = 0;\n let subscription = null;\n const observers = [];\n function startIfNeeded() {\n if (subscription) {\n return;\n }\n subscription = originalObserver.subscribe({\n next (value) {\n for (const observer of observers){\n observer.next?.(value);\n }\n },\n error (error) {\n for (const observer of observers){\n observer.error?.(error);\n }\n },\n complete () {\n for (const observer of observers){\n observer.complete?.();\n }\n }\n });\n }\n function resetIfNeeded() {\n // \"resetOnRefCountZero\"\n if (refCount === 0 && subscription) {\n const _sub = subscription;\n subscription = null;\n _sub.unsubscribe();\n }\n }\n return {\n subscribe (observer) {\n refCount++;\n observers.push(observer);\n startIfNeeded();\n return {\n unsubscribe () {\n refCount--;\n resetIfNeeded();\n const index = observers.findIndex((v)=>v === observer);\n if (index > -1) {\n observers.splice(index, 1);\n }\n }\n };\n }\n };\n };\n}\n\nfunction map(project) {\n return (originalObserver)=>{\n return {\n subscribe (observer) {\n let index = 0;\n const subscription = originalObserver.subscribe({\n next (value) {\n observer.next?.(project(value, index++));\n },\n error (error) {\n observer.error?.(error);\n },\n complete () {\n observer.complete?.();\n }\n });\n return subscription;\n }\n };\n };\n}\n\nfunction tap(observer) {\n return (originalObserver)=>{\n return {\n subscribe (observer2) {\n return originalObserver.subscribe({\n next (v) {\n observer.next?.(v);\n observer2.next?.(v);\n },\n error (v) {\n observer.error?.(v);\n observer2.error?.(v);\n },\n complete () {\n observer.complete?.();\n observer2.complete?.();\n }\n });\n }\n };\n };\n}\n\nclass ObservableAbortError extends Error {\n constructor(message){\n super(message);\n this.name = 'ObservableAbortError';\n Object.setPrototypeOf(this, ObservableAbortError.prototype);\n }\n}\n/** @internal */ function observableToPromise(observable) {\n let abort;\n const promise = new Promise((resolve, reject)=>{\n let isDone = false;\n function onDone() {\n if (isDone) {\n return;\n }\n isDone = true;\n reject(new ObservableAbortError('This operation was aborted.'));\n obs$.unsubscribe();\n }\n const obs$ = observable.subscribe({\n next (data) {\n isDone = true;\n resolve(data);\n onDone();\n },\n error (data) {\n isDone = true;\n reject(data);\n onDone();\n },\n complete () {\n isDone = true;\n onDone();\n }\n });\n abort = onDone;\n });\n return {\n promise,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n abort: abort\n };\n}\n\nexport { map, observableToPromise, share, tap };\n","import { observable } from '@trpc/server/observable';\n\n/** @internal */ function createChain(opts) {\n return observable((observer)=>{\n function execute(index = 0, op = opts.op) {\n const next = opts.links[index];\n if (!next) {\n throw new Error('No more links to execute - did you forget to add an ending link?');\n }\n const subscription = next({\n op,\n next (nextOp) {\n const nextObserver = execute(index + 1, nextOp);\n return nextObserver;\n }\n });\n return subscription;\n }\n const obs$ = execute();\n return obs$.subscribe(observer);\n });\n}\n\nfunction asArray(value) {\n return Array.isArray(value) ? value : [\n value\n ];\n}\nfunction splitLink(opts) {\n return (runtime)=>{\n const yes = asArray(opts.true).map((link)=>link(runtime));\n const no = asArray(opts.false).map((link)=>link(runtime));\n return (props)=>{\n return observable((observer)=>{\n const links = opts.condition(props.op) ? yes : no;\n return createChain({\n op: props.op,\n links\n }).subscribe(observer);\n });\n };\n };\n}\n\nexport { createChain as c, splitLink as s };\n","function isTRPCClientError(cause) {\n return cause instanceof TRPCClientError || /**\n * @deprecated\n * Delete in next major\n */ cause.name === 'TRPCClientError';\n}\nclass TRPCClientError extends Error {\n static from(cause, opts = {}) {\n if (!(cause instanceof Error)) {\n return new TRPCClientError(cause.error.message ?? '', {\n ...opts,\n cause: undefined,\n result: cause\n });\n }\n if (isTRPCClientError(cause)) {\n if (opts.meta) {\n // Decorate with meta error data\n cause.meta = {\n ...cause.meta,\n ...opts.meta\n };\n }\n return cause;\n }\n return new TRPCClientError(cause.message, {\n ...opts,\n cause,\n result: null\n });\n }\n constructor(message, opts){\n const cause = opts?.cause;\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore https://github.com/tc39/proposal-error-cause\n super(message, {\n cause\n });\n this.meta = opts?.meta;\n this.cause = cause;\n this.shape = opts?.result?.error;\n this.data = opts?.result?.error.data;\n this.name = 'TRPCClientError';\n Object.setPrototypeOf(this, TRPCClientError.prototype);\n }\n}\n\nexport { TRPCClientError as T };\n","import { T as TRPCClientError } from './TRPCClientError-fef6cf44.mjs';\n\nconst isFunction = (fn)=>typeof fn === 'function';\nfunction getFetch(customFetchImpl) {\n if (customFetchImpl) {\n return customFetchImpl;\n }\n if (typeof window !== 'undefined' && isFunction(window.fetch)) {\n return window.fetch;\n }\n if (typeof globalThis !== 'undefined' && isFunction(globalThis.fetch)) {\n return globalThis.fetch;\n }\n throw new Error('No fetch implementation found');\n}\n\nfunction getAbortController(customAbortControllerImpl) {\n if (customAbortControllerImpl) {\n return customAbortControllerImpl;\n }\n if (typeof window !== 'undefined' && window.AbortController) {\n return window.AbortController;\n }\n if (typeof globalThis !== 'undefined' && globalThis.AbortController) {\n return globalThis.AbortController;\n }\n return null;\n}\n\nfunction resolveHTTPLinkOptions(opts) {\n return {\n url: opts.url,\n fetch: opts.fetch,\n AbortController: getAbortController(opts.AbortController)\n };\n}\n// https://github.com/trpc/trpc/pull/669\nfunction arrayToDict(array) {\n const dict = {};\n for(let index = 0; index < array.length; index++){\n const element = array[index];\n dict[index] = element;\n }\n return dict;\n}\nconst METHOD = {\n query: 'GET',\n mutation: 'POST'\n};\nfunction getInput(opts) {\n return 'input' in opts ? opts.runtime.transformer.serialize(opts.input) : arrayToDict(opts.inputs.map((_input)=>opts.runtime.transformer.serialize(_input)));\n}\nconst getUrl = (opts)=>{\n let url = opts.url + '/' + opts.path;\n const queryParts = [];\n if ('inputs' in opts) {\n queryParts.push('batch=1');\n }\n if (opts.type === 'query') {\n const input = getInput(opts);\n if (input !== undefined) {\n queryParts.push(`input=${encodeURIComponent(JSON.stringify(input))}`);\n }\n }\n if (queryParts.length) {\n url += '?' + queryParts.join('&');\n }\n return url;\n};\nconst getBody = (opts)=>{\n if (opts.type === 'query') {\n return undefined;\n }\n const input = getInput(opts);\n return input !== undefined ? JSON.stringify(input) : undefined;\n};\nconst jsonHttpRequester = (opts)=>{\n return httpRequest({\n ...opts,\n contentTypeHeader: 'application/json',\n getUrl,\n getBody\n });\n};\nasync function fetchHTTPResponse(opts, ac) {\n const url = opts.getUrl(opts);\n const body = opts.getBody(opts);\n const { type } = opts;\n const resolvedHeaders = await opts.headers();\n /* istanbul ignore if -- @preserve */ if (type === 'subscription') {\n throw new Error('Subscriptions should use wsLink');\n }\n const headers = {\n ...opts.contentTypeHeader ? {\n 'content-type': opts.contentTypeHeader\n } : {},\n ...opts.batchModeHeader ? {\n 'trpc-batch-mode': opts.batchModeHeader\n } : {},\n ...resolvedHeaders\n };\n return getFetch(opts.fetch)(url, {\n method: METHOD[type],\n signal: ac?.signal,\n body: body,\n headers\n });\n}\nfunction httpRequest(opts) {\n const ac = opts.AbortController ? new opts.AbortController() : null;\n const meta = {};\n const promise = new Promise((resolve, reject)=>{\n fetchHTTPResponse(opts, ac).then((_res)=>{\n meta.response = _res;\n return _res.json();\n }).then((json)=>{\n meta.responseJSON = json;\n resolve({\n json: json,\n meta\n });\n }).catch((err)=>{\n reject(TRPCClientError.from(err, {\n meta\n }));\n });\n });\n const cancel = ()=>{\n ac?.abort();\n };\n return {\n promise,\n cancel\n };\n}\n\nexport { getBody as a, getFetch as b, fetchHTTPResponse as f, getUrl as g, httpRequest as h, jsonHttpRequester as j, resolveHTTPLinkOptions as r };\n","function isObject(value) {\n // check that value is object\n return !!value && !Array.isArray(value) && typeof value === 'object';\n}\n\n// FIXME:\n// - the generics here are probably unnecessary\n// - the RPC-spec could probably be simplified to combine HTTP + WS\n/** @internal */ function transformResultInner(response, runtime) {\n if ('error' in response) {\n const error = runtime.transformer.deserialize(response.error);\n return {\n ok: false,\n error: {\n ...response,\n error\n }\n };\n }\n const result = {\n ...response.result,\n ...(!response.result.type || response.result.type === 'data') && {\n type: 'data',\n data: runtime.transformer.deserialize(response.result.data)\n }\n };\n return {\n ok: true,\n result\n };\n}\nclass TransformResultError extends Error {\n constructor(){\n super('Unable to transform response from server');\n }\n}\n/**\n * Transforms and validates that the result is a valid TRPCResponse\n * @internal\n */ function transformResult(response, runtime) {\n let result;\n try {\n // Use the data transformers on the JSON-response\n result = transformResultInner(response, runtime);\n } catch (err) {\n throw new TransformResultError();\n }\n // check that output of the transformers is a valid TRPCResponse\n if (!result.ok && (!isObject(result.error.error) || typeof result.error.error.code !== 'number')) {\n throw new TransformResultError();\n }\n if (result.ok && !isObject(result.result)) {\n throw new TransformResultError();\n }\n return result;\n}\n\nexport { transformResult as t };\n","import { observable } from '@trpc/server/observable';\nimport { t as transformResult } from './transformResult-7ab522e6.mjs';\nimport { T as TRPCClientError } from './TRPCClientError-fef6cf44.mjs';\nimport { r as resolveHTTPLinkOptions, g as getUrl, j as jsonHttpRequester } from './httpUtils-1efcb902.mjs';\n\n/* eslint-disable @typescript-eslint/no-non-null-assertion */ /**\n * A function that should never be called unless we messed something up.\n */ const throwFatalError = ()=>{\n throw new Error('Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new');\n};\n/**\n * Dataloader that's very inspired by https://github.com/graphql/dataloader\n * Less configuration, no caching, and allows you to cancel requests\n * When cancelling a single fetch the whole batch will be cancelled only when _all_ items are cancelled\n */ function dataLoader(batchLoader) {\n let pendingItems = null;\n let dispatchTimer = null;\n const destroyTimerAndPendingItems = ()=>{\n clearTimeout(dispatchTimer);\n dispatchTimer = null;\n pendingItems = null;\n };\n /**\n * Iterate through the items and split them into groups based on the `batchLoader`'s validate function\n */ function groupItems(items) {\n const groupedItems = [\n []\n ];\n let index = 0;\n while(true){\n const item = items[index];\n if (!item) {\n break;\n }\n const lastGroup = groupedItems[groupedItems.length - 1];\n if (item.aborted) {\n // Item was aborted before it was dispatched\n item.reject?.(new Error('Aborted'));\n index++;\n continue;\n }\n const isValid = batchLoader.validate(lastGroup.concat(item).map((it)=>it.key));\n if (isValid) {\n lastGroup.push(item);\n index++;\n continue;\n }\n if (lastGroup.length === 0) {\n item.reject?.(new Error('Input is too big for a single dispatch'));\n index++;\n continue;\n }\n // Create new group, next iteration will try to add the item to that\n groupedItems.push([]);\n }\n return groupedItems;\n }\n function dispatch() {\n const groupedItems = groupItems(pendingItems);\n destroyTimerAndPendingItems();\n // Create batches for each group of items\n for (const items of groupedItems){\n if (!items.length) {\n continue;\n }\n const batch = {\n items,\n cancel: throwFatalError\n };\n for (const item of items){\n item.batch = batch;\n }\n const unitResolver = (index, value)=>{\n const item = batch.items[index];\n item.resolve?.(value);\n item.batch = null;\n item.reject = null;\n item.resolve = null;\n };\n const { promise , cancel } = batchLoader.fetch(batch.items.map((_item)=>_item.key), unitResolver);\n batch.cancel = cancel;\n promise.then((result)=>{\n for(let i = 0; i < result.length; i++){\n const value = result[i];\n unitResolver(i, value);\n }\n for (const item of batch.items){\n item.reject?.(new Error('Missing result'));\n item.batch = null;\n }\n }).catch((cause)=>{\n for (const item of batch.items){\n item.reject?.(cause);\n item.batch = null;\n }\n });\n }\n }\n function load(key) {\n const item = {\n aborted: false,\n key,\n batch: null,\n resolve: throwFatalError,\n reject: throwFatalError\n };\n const promise = new Promise((resolve, reject)=>{\n item.reject = reject;\n item.resolve = resolve;\n if (!pendingItems) {\n pendingItems = [];\n }\n pendingItems.push(item);\n });\n if (!dispatchTimer) {\n dispatchTimer = setTimeout(dispatch);\n }\n const cancel = ()=>{\n item.aborted = true;\n if (item.batch?.items.every((item)=>item.aborted)) {\n // All items in the batch have been cancelled\n item.batch.cancel();\n item.batch = null;\n }\n };\n return {\n promise,\n cancel\n };\n }\n return {\n load\n };\n}\n\n/**\n * @internal\n */ function createHTTPBatchLink(requester) {\n return function httpBatchLink(opts) {\n const resolvedOpts = resolveHTTPLinkOptions(opts);\n const maxURLLength = opts.maxURLLength ?? Infinity;\n // initialized config\n return (runtime)=>{\n const batchLoader = (type)=>{\n const validate = (batchOps)=>{\n if (maxURLLength === Infinity) {\n // escape hatch for quick calcs\n return true;\n }\n const path = batchOps.map((op)=>op.path).join(',');\n const inputs = batchOps.map((op)=>op.input);\n const url = getUrl({\n ...resolvedOpts,\n runtime,\n type,\n path,\n inputs\n });\n return url.length <= maxURLLength;\n };\n const fetch = requester({\n ...resolvedOpts,\n runtime,\n type,\n opts\n });\n return {\n validate,\n fetch\n };\n };\n const query = dataLoader(batchLoader('query'));\n const mutation = dataLoader(batchLoader('mutation'));\n const subscription = dataLoader(batchLoader('subscription'));\n const loaders = {\n query,\n subscription,\n mutation\n };\n return ({ op })=>{\n return observable((observer)=>{\n const loader = loaders[op.type];\n const { promise , cancel } = loader.load(op);\n let _res = undefined;\n promise.then((res)=>{\n _res = res;\n const transformed = transformResult(res.json, runtime);\n if (!transformed.ok) {\n observer.error(TRPCClientError.from(transformed.error, {\n meta: res.meta\n }));\n return;\n }\n observer.next({\n context: res.meta,\n result: transformed.result\n });\n observer.complete();\n }).catch((err)=>{\n observer.error(TRPCClientError.from(err, {\n meta: _res?.meta\n }));\n });\n return ()=>{\n cancel();\n };\n });\n };\n };\n };\n}\n\nconst batchRequester = (requesterOpts)=>{\n return (batchOps)=>{\n const path = batchOps.map((op)=>op.path).join(',');\n const inputs = batchOps.map((op)=>op.input);\n const { promise , cancel } = jsonHttpRequester({\n ...requesterOpts,\n path,\n inputs,\n headers () {\n if (!requesterOpts.opts.headers) {\n return {};\n }\n if (typeof requesterOpts.opts.headers === 'function') {\n return requesterOpts.opts.headers({\n opList: batchOps\n });\n }\n return requesterOpts.opts.headers;\n }\n });\n return {\n promise: promise.then((res)=>{\n const resJSON = Array.isArray(res.json) ? res.json : batchOps.map(()=>res.json);\n const result = resJSON.map((item)=>({\n meta: res.meta,\n json: item\n }));\n return result;\n }),\n cancel\n };\n };\n};\nconst httpBatchLink = createHTTPBatchLink(batchRequester);\n\nexport { createHTTPBatchLink as c, httpBatchLink as h };\n","import { share, observableToPromise } from '@trpc/server/observable';\nimport { c as createChain } from './splitLink-4c75f7be.mjs';\nexport { s as splitLink } from './splitLink-4c75f7be.mjs';\nimport { T as TRPCClientError } from './TRPCClientError-fef6cf44.mjs';\nexport { T as TRPCClientError } from './TRPCClientError-fef6cf44.mjs';\nimport { createFlatProxy, createRecursiveProxy } from '@trpc/server/shared';\nimport { f as fetchHTTPResponse, g as getUrl, a as getBody$1, h as httpRequest } from './httpUtils-1efcb902.mjs';\nexport { b as getFetch } from './httpUtils-1efcb902.mjs';\nimport { c as createHTTPBatchLink } from './httpBatchLink-fbd7b43c.mjs';\nexport { h as httpBatchLink } from './httpBatchLink-fbd7b43c.mjs';\nimport { httpLinkFactory } from './links/httpLink.mjs';\nexport { httpLink, httpLinkFactory } from './links/httpLink.mjs';\nexport { loggerLink } from './links/loggerLink.mjs';\nexport { createWSClient, wsLink } from './links/wsLink.mjs';\nimport './transformResult-7ab522e6.mjs';\n\nclass TRPCUntypedClient {\n $request({ type , input , path , context ={} }) {\n const chain$ = createChain({\n links: this.links,\n op: {\n id: ++this.requestId,\n type,\n path,\n input,\n context\n }\n });\n return chain$.pipe(share());\n }\n requestAsPromise(opts) {\n const req$ = this.$request(opts);\n const { promise , abort } = observableToPromise(req$);\n const abortablePromise = new Promise((resolve, reject)=>{\n opts.signal?.addEventListener('abort', abort);\n promise.then((envelope)=>{\n resolve(envelope.result.data);\n }).catch((err)=>{\n reject(TRPCClientError.from(err));\n });\n });\n return abortablePromise;\n }\n query(path, input, opts) {\n return this.requestAsPromise({\n type: 'query',\n path,\n input,\n context: opts?.context,\n signal: opts?.signal\n });\n }\n mutation(path, input, opts) {\n return this.requestAsPromise({\n type: 'mutation',\n path,\n input,\n context: opts?.context,\n signal: opts?.signal\n });\n }\n subscription(path, input, opts) {\n const observable$ = this.$request({\n type: 'subscription',\n path,\n input,\n context: opts?.context\n });\n return observable$.subscribe({\n next (envelope) {\n if (envelope.result.type === 'started') {\n opts.onStarted?.();\n } else if (envelope.result.type === 'stopped') {\n opts.onStopped?.();\n } else {\n opts.onData?.(envelope.result.data);\n }\n },\n error (err) {\n opts.onError?.(err);\n },\n complete () {\n opts.onComplete?.();\n }\n });\n }\n constructor(opts){\n this.requestId = 0;\n const combinedTransformer = (()=>{\n const transformer = opts.transformer;\n if (!transformer) {\n return {\n input: {\n serialize: (data)=>data,\n deserialize: (data)=>data\n },\n output: {\n serialize: (data)=>data,\n deserialize: (data)=>data\n }\n };\n }\n if ('input' in transformer) {\n return opts.transformer;\n }\n return {\n input: transformer,\n output: transformer\n };\n })();\n this.runtime = {\n transformer: {\n serialize: (data)=>combinedTransformer.input.serialize(data),\n deserialize: (data)=>combinedTransformer.output.deserialize(data)\n },\n combinedTransformer\n };\n // Initialize the links\n this.links = opts.links.map((link)=>link(this.runtime));\n }\n}\n\nfunction createTRPCUntypedClient(opts) {\n return new TRPCUntypedClient(opts);\n}\n\n/**\n * @deprecated use `createTRPCProxyClient` instead\n */ function createTRPCClient(opts) {\n const client = new TRPCUntypedClient(opts);\n return client;\n}\n\nconst clientCallTypeMap = {\n query: 'query',\n mutate: 'mutation',\n subscribe: 'subscription'\n};\n/** @internal */ const clientCallTypeToProcedureType = (clientCallType)=>{\n return clientCallTypeMap[clientCallType];\n};\n/**\n * @deprecated use `createTRPCProxyClient` instead\n * @internal\n */ function createTRPCClientProxy(client) {\n return createFlatProxy((key)=>{\n if (client.hasOwnProperty(key)) {\n return client[key];\n }\n if (key === '__untypedClient') {\n return client;\n }\n return createRecursiveProxy(({ path , args })=>{\n const pathCopy = [\n key,\n ...path\n ];\n const procedureType = clientCallTypeToProcedureType(pathCopy.pop());\n const fullPath = pathCopy.join('.');\n return client[procedureType](fullPath, ...args);\n });\n });\n}\nfunction createTRPCProxyClient(opts) {\n const client = new TRPCUntypedClient(opts);\n const proxy = createTRPCClientProxy(client);\n return proxy;\n}\n/**\n * Get an untyped client from a proxy client\n * @internal\n */ function getUntypedClient(client) {\n return client.__untypedClient;\n}\n\nfunction getTextDecoder(customTextDecoder) {\n if (customTextDecoder) {\n return customTextDecoder;\n }\n if (typeof window !== 'undefined' && window.TextDecoder) {\n return new window.TextDecoder();\n }\n if (typeof globalThis !== 'undefined' && globalThis.TextDecoder) {\n return new globalThis.TextDecoder();\n }\n throw new Error('No TextDecoder implementation found');\n}\n\n// Stream parsing adapted from https://www.loginradius.com/blog/engineering/guest-post/http-streaming-with-nodejs-and-fetch-api/\n/**\n * @internal\n * @description Take a stream of bytes and call `onLine` with\n * a JSON object for each line in the stream. Expected stream\n * format is:\n * ```json\n * {\"1\": {...}\n * ,\"0\": {...}\n * }\n * ```\n */ async function parseJSONStream(opts) {\n const parse = opts.parse ?? JSON.parse;\n const onLine = (line)=>{\n if (opts.signal?.aborted) return;\n if (!line || line === '}') {\n return;\n }\n /**\n * At this point, `line` can be one of two things:\n * - The first line of the stream `{\"2\":{...}`\n * - A line in the middle of the stream `,\"2\":{...}`\n */ const indexOfColon = line.indexOf(':');\n const indexAsStr = line.substring(2, indexOfColon - 1);\n const text = line.substring(indexOfColon + 1);\n opts.onSingle(Number(indexAsStr), parse(text));\n };\n await readLines(opts.readableStream, onLine, opts.textDecoder);\n}\n/**\n * Handle transforming a stream of bytes into lines of text.\n * To avoid using AsyncIterators / AsyncGenerators,\n * we use a callback for each line.\n *\n * @param readableStream can be a NodeJS stream or a WebAPI stream\n * @param onLine will be called for every line ('\\n' delimited) in the stream\n */ async function readLines(readableStream, onLine, textDecoder) {\n let partOfLine = '';\n const onChunk = (chunk)=>{\n const chunkText = textDecoder.decode(chunk);\n const chunkLines = chunkText.split('\\n');\n if (chunkLines.length === 1) {\n partOfLine += chunkLines[0];\n } else if (chunkLines.length > 1) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- length checked on line above\n onLine(partOfLine + chunkLines[0]);\n for(let i = 1; i < chunkLines.length - 1; i++){\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- length checked on line above\n onLine(chunkLines[i]);\n }\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- length doesn't change, so is necessarily > 1\n partOfLine = chunkLines[chunkLines.length - 1];\n }\n };\n // we handle 2 different types of streams, this if where we figure out which one we have\n if ('getReader' in readableStream) {\n await readStandardChunks(readableStream, onChunk);\n } else {\n await readNodeChunks(readableStream, onChunk);\n }\n onLine(partOfLine);\n}\n/**\n * Handle NodeJS stream\n */ function readNodeChunks(stream, onChunk) {\n return new Promise((resolve)=>{\n stream.on('data', onChunk);\n stream.on('end', resolve);\n });\n}\n/**\n * Handle WebAPI stream\n */ async function readStandardChunks(stream, onChunk) {\n const reader = stream.getReader();\n let readResult = await reader.read();\n while(!readResult.done){\n onChunk(readResult.value);\n readResult = await reader.read();\n }\n}\nconst streamingJsonHttpRequester = (opts, onSingle)=>{\n const ac = opts.AbortController ? new opts.AbortController() : null;\n const responsePromise = fetchHTTPResponse({\n ...opts,\n contentTypeHeader: 'application/json',\n batchModeHeader: 'stream',\n getUrl,\n getBody: getBody$1\n }, ac);\n const cancel = ()=>ac?.abort();\n const promise = responsePromise.then(async (res)=>{\n if (!res.body) throw new Error('Received response without body');\n const meta = {\n response: res\n };\n return parseJSONStream({\n readableStream: res.body,\n onSingle,\n parse: (string)=>({\n json: JSON.parse(string),\n meta\n }),\n signal: ac?.signal,\n textDecoder: opts.textDecoder\n });\n });\n return {\n cancel,\n promise\n };\n};\n\nconst streamRequester = (requesterOpts)=>{\n const textDecoder = getTextDecoder(requesterOpts.opts.textDecoder);\n return (batchOps, unitResolver)=>{\n const path = batchOps.map((op)=>op.path).join(',');\n const inputs = batchOps.map((op)=>op.input);\n const { cancel , promise } = streamingJsonHttpRequester({\n ...requesterOpts,\n textDecoder,\n path,\n inputs,\n headers () {\n if (!requesterOpts.opts.headers) {\n return {};\n }\n if (typeof requesterOpts.opts.headers === 'function') {\n return requesterOpts.opts.headers({\n opList: batchOps\n });\n }\n return requesterOpts.opts.headers;\n }\n }, (index, res)=>{\n unitResolver(index, res);\n });\n return {\n /**\n * return an empty array because the batchLoader expects an array of results\n * but we've already called the `unitResolver` for each of them, there's\n * nothing left to do here.\n */ promise: promise.then(()=>[]),\n cancel\n };\n };\n};\nconst unstable_httpBatchStreamLink = createHTTPBatchLink(streamRequester);\n\nconst getBody = (opts)=>{\n if (!('input' in opts)) {\n return undefined;\n }\n if (!(opts.input instanceof FormData)) {\n throw new Error('Input is not FormData');\n }\n return opts.input;\n};\nconst formDataRequester = (opts)=>{\n if (opts.type !== 'mutation') {\n // TODO(?) handle formdata queries\n throw new Error('We only handle mutations with formdata');\n }\n return httpRequest({\n ...opts,\n getUrl () {\n return `${opts.url}/${opts.path}`;\n },\n getBody\n });\n};\nconst experimental_formDataLink = httpLinkFactory({\n requester: formDataRequester\n});\n\nexport { clientCallTypeToProcedureType, createTRPCClient, createTRPCClientProxy, createTRPCProxyClient, createTRPCUntypedClient, experimental_formDataLink, getUntypedClient, unstable_httpBatchStreamLink };\n","import{z as e}from\"zod\";import{isHex as i}from\"viem\";import{initTRPC as a}from\"@trpc/server\";import u from\"superjson\";function A(){let r=a.context().create({transformer:u});return r.router({findAll:r.procedure.input(e.object({chainId:e.number(),address:e.string().refine(i).optional()})).query(async t=>{let{storageAdapter:o}=t.ctx,{chainId:p,address:n}=t.input;return o.findAll(p,n)})})}import{createTRPCProxyClient as m,httpBatchLink as s}from\"@trpc/client\";import f from\"superjson\";function P({url:r}){return m({transformer:f,links:[s({url:r})]})}export{A as a,P as b};\n//# sourceMappingURL=chunk-A2BQSIM3.js.map","import{a as o,b as r,c as s,d as b,e as n,f as y,g as a,h as p,i}from\"../chunk-5AKM5HGJ.js\";var e=[\"event StoreDeleteRecord(bytes32 table, bytes32[] key)\",\"event StoreSetField(bytes32 table, bytes32[] key, uint8 schemaIndex, bytes data)\",\"event StoreSetRecord(bytes32 table, bytes32[] key, bytes data)\",\"event StoreEphemeralRecord(bytes32 table, bytes32[] key, bytes data)\"];import{parseAbi as t}from\"abitype\";var f=t(e);export{r as DEFAULTS,o as PATH_DEFAULTS,s as TABLE_DEFAULTS,e as storeEvents,f as storeEventsAbi,a as zEnumsConfig,i as zPluginStoreConfig,b as zSchemaConfig,p as zStoreConfig,n as zTableConfig,y as zTablesConfig};\n//# sourceMappingURL=index.js.map","import{EMPTY as p,concatMap as B,from as d,pipe as f,tap as m}from\"rxjs\";import{bigIntMin as b,wait as k}from\"@latticexyz/common/utils\";import g from\"debug\";var u=g(\"mud:block-events-stream\");async function*a({maxBlockRange:c=1000n,maxRetryCount:i=3,publicClient:l,...t}){let e=t.fromBlock,r=b(c,t.toBlock-e),n=0;for(;e<=t.toBlock;)try{let o=e+r,s=await l.getLogs({...t,fromBlock:e,toBlock:o,strict:!0});yield{fromBlock:e,toBlock:o,logs:s},e=o+1n,r=b(c,t.toBlock-e)}catch(o){if(!(o instanceof Error))throw o;if(o.message.includes(\"rate limit exceeded\")&&n{e??=o,r=n}),B(()=>e>r?p:d(a({publicClient:c,address:i,events:l,fromBlock:e,toBlock:r,maxBlockRange:t})).pipe(m(({toBlock:n})=>{e=n+1n}))))}import{Observable as T}from\"rxjs\";function O({publicClient:c,blockTag:i}){return new T(function(t){return c.watchBlocks({blockTag:i,emitOnBegin:!0,onBlock:e=>t.next(e),onError:e=>t.error(e)})})}import{bigIntSort as x,isDefined as y}from\"@latticexyz/common/utils\";function M(c,i){let l=Array.from(new Set(c.map(r=>r.blockNumber)));l.sort(x);let t=l.map(r=>{let n=c.filter(o=>o.blockNumber===r);if(n.length&&(n.sort((o,s)=>o.logIndexs.logIndex?1:0),!!n.length))return{blockNumber:r,logs:n}}).filter(y),e=l.length>0?l[l.length-1]:null;return i!=null&&(e==null||i>e)&&t.push({blockNumber:i,logs:[]}),t}export{P as blockRangeToLogs,O as createBlockStream,a as fetchLogs,M as groupLogsByBlockNumber};\n//# sourceMappingURL=index.js.map","import{a as O,b as R}from\"./chunk-SNWOSPCV.js\";import{b as x}from\"./chunk-A2BQSIM3.js\";import{schemaAbiTypeToDefaultValue as $}from\"@latticexyz/schema-type\";function U(l){return Object.fromEntries(Object.entries(l).map(([n,p])=>[n,$[p]]))}import{storeEventsAbi as E}from\"@latticexyz/store\";import{WaitForTransactionReceiptTimeoutError as I}from\"viem\";import{createBlockStream as M,blockRangeToLogs as W,groupLogsByBlockNumber as D}from\"@latticexyz/block-logs-stream\";import{filter as v,map as b,tap as g,mergeMap as j,from as K,concat as q,concatMap as w,share as H,firstValueFrom as z,defer as G,of as J,catchError as Q,shareReplay as u,combineLatest as X}from\"rxjs\";import Y from\"p-retry\";import{chunk as Z}from\"@latticexyz/common/utils\";var r=O.extend(\"createStoreSync\");async function be({storageAdapter:l,onProgress:n,address:p,publicClient:s,startBlock:h=0n,maxBlockRange:A,initialState:k,indexerUrl:S}){let T=G(async()=>{if(k)return k;if(!S)return;r(\"fetching initial state from indexer\",S),n?.({step:\"snapshot\",percentage:0,latestBlockNumber:0n,lastBlockNumberProcessed:0n,message:\"Fetching snapshot from indexer\"});let e=x({url:S}),t=s.chain?.id??await s.getChainId(),o=await e.findAll.query({chainId:t,address:p});return n?.({step:\"snapshot\",percentage:100,latestBlockNumber:0n,lastBlockNumberProcessed:0n,message:\"Fetched snapshot from indexer\"}),o}).pipe(Q(e=>(r(\"error fetching initial state from indexer\",e),n?.({step:\"snapshot\",percentage:100,latestBlockNumber:0n,lastBlockNumberProcessed:h,message:\"Failed to fetch snapshot from indexer\"}),J(void 0))),u(1)),F=T.pipe(b(e=>e?.blockNumber??h),g(e=>r(\"starting sync from block\",e))),L=T.pipe(v(e=>e!=null&&e.blockNumber!=null&&e.tables.length>0),w(async({blockNumber:e,tables:t})=>{r(\"hydrating from initial state to block\",e),n?.({step:\"snapshot\",percentage:0,latestBlockNumber:0n,lastBlockNumberProcessed:e,message:\"Hydrating from snapshot\"}),await l.registerTables({blockNumber:e,tables:t});let o=t.flatMap(c=>c.records.map(m=>({type:\"SetRecord\",address:c.address,namespace:c.namespace,name:c.name,key:m.key,value:m.value}))),d=Math.max(100,Math.floor(o.length/50)),P=Array.from(Z(o,d));for(let[c,m]of P.entries())await l.storeOperations({blockNumber:e,operations:m}),n?.({step:\"snapshot\",percentage:(c+m.length)/P.length,latestBlockNumber:0n,lastBlockNumberProcessed:e,message:\"Hydrating from snapshot\"});return n?.({step:\"snapshot\",percentage:100,latestBlockNumber:0n,lastBlockNumberProcessed:e,message:\"Hydrated from snapshot\"}),{blockNumber:e,operations:o}}),u(1)),y=M({publicClient:s,blockTag:\"latest\"}).pipe(u(1)),B=y.pipe(b(e=>e.number),g(e=>{r(\"latest block number\",e)}),u(1)),f=null,a=null,N=X([F,B]).pipe(b(([e,t])=>({startBlock:e,endBlock:t})),g(e=>{f=e.startBlock,a=e.endBlock}),W({publicClient:s,address:p,events:E,maxBlockRange:A}),j(({toBlock:e,logs:t})=>K(D(t,e))),H()),i=null,C=q(L,N.pipe(w(R(l)),g(({blockNumber:e,operations:t})=>{if(r(\"stored\",t.length,\"operations for block\",e),i=e,f!=null&&a!=null)if(e(r(\"waiting for tx receipt\",e,\"attempt\",o),s.waitForTransactionReceipt({hash:e,timeout:s.pollingInterval*2*o})),{retries:3,onFailedAttempt:o=>{if(o instanceof I){r(\"timed out waiting for tx receipt, trying again\",e);return}throw o}});return r(\"got tx receipt\",e,t),(i==null||io>=t.blockNumber)))),r(\"tx block was processed\",e,t.blockNumber),{receipt:t}}return{latestBlock$:y,latestBlockNumber$:B,blockLogs$:N,blockStorageOperations$:C,waitForTransaction:V}}export{U as a,be as b};\n//# sourceMappingURL=chunk-IH5UMM4B.js.map","var d={registerFunctionSelector:!0,openAccess:!0,accessList:[]},o={worldContractName:void 0,worldInterfaceName:\"IWorld\",systems:{},excludeSystems:[],postDeployScript:\"PostDeploy\",deploysDirectory:\"./deploys\",worldsFile:\"./worlds.json\",worldgenDirectory:\"world\",worldImportPath:\"@latticexyz/world/src/\",modules:[]};import{getDuplicates as g,STORE_SELECTOR_MAX_LENGTH as w,UnrecognizedSystemErrorFactory as f}from\"@latticexyz/config\";import{MUDError as D}from\"@latticexyz/common/errors\";function R(r,s){let n=s?.filter(t=>t.endsWith(\"System\")&&t!==\"System\"&&!t.match(/^I[A-Z]/))??[],c=Object.keys(r.systems);if(s){for(let t of c)if(!s.includes(t)||t===\"World\")throw f([\"systems\",t],t)}let l=[...new Set([...n,...c])].filter(t=>!r.excludeSystems.includes(t)).reduce((t,u)=>({...t,[u]:b(u,r.systems[u],s)}),{}),i=Object.values(r.tables).map(({name:t})=>t),a=Object.values(l).map(({name:t})=>t),m=g([...i,...a]);if(m.length>0)throw new D(`Table and system names must be unique: ${m.join(\", \")}`);return{systems:l}}function b(r,s,n){let c=s?.name??r.slice(0,w),p=s?.registerFunctionSelectors??!0,l=s?.openAccess??!0,i=[],a=[],m=s&&!s.openAccess?s.accessList:[];for(let t of m)if(t.startsWith(\"0x\"))i.push(t);else{if(n&&!n.includes(t))throw f([\"systems\",r,\"accessList\"],t);a.push(t)}return{name:c,registerFunctionSelectors:p,openAccess:l,accessListAddresses:i,accessListSystems:a}}import{z as e}from\"zod\";import{DynamicResolutionType as A,zEthereumAddress as L,zObjectName as S,zSelector as C}from\"@latticexyz/config\";var y=S,h=S,z=e.array(y.or(L)).default(d.accessList),v=e.intersection(e.object({name:C.optional(),registerFunctionSelectors:e.boolean().default(d.registerFunctionSelector)}),e.discriminatedUnion(\"openAccess\",[e.object({openAccess:e.literal(!0).default(d.openAccess)}),e.object({openAccess:e.literal(!1),accessList:z})])),x=e.object({value:e.union([e.string(),e.number(),e.instanceof(Uint8Array)]),type:e.string()}),E=e.object({type:e.nativeEnum(A),input:e.string()}),N=e.object({name:h,root:e.boolean().default(!1),args:e.array(e.union([x,E])).default([])}),T=e.object({worldContractName:e.string().optional(),worldInterfaceName:e.string().default(o.worldInterfaceName),systems:e.record(y,v).default(o.systems),excludeSystems:e.array(y).default(o.excludeSystems),postDeployScript:e.string().default(o.postDeployScript),deploysDirectory:e.string().default(o.deploysDirectory),worldsFile:e.string().default(o.worldsFile),worldgenDirectory:e.string().default(o.worldgenDirectory),worldImportPath:e.string().default(o.worldImportPath),modules:e.array(N).default(o.modules)}),M=T.catchall(e.any());export{d as a,o as b,R as c,b as d,T as e,M as f};\n//# sourceMappingURL=chunk-JOQBBVRS.js.map","import{f as e}from\"./chunk-JOQBBVRS.js\";import\"@latticexyz/store/register\";import{mudConfig as c,mudCoreConfig as C,resolveTableId as g}from\"@latticexyz/store/register\";import{extendMUDCoreConfig as t,fromZodErrorCustom as i}from\"@latticexyz/config\";import{ZodError as s}from\"zod\";t(r=>{try{return e.parse(r)}catch(o){throw o instanceof s?i(o,\"WorldConfig Validation Error\"):o}});import\"@latticexyz/store/register\";export{c as a,C as b,g as c};\n//# sourceMappingURL=chunk-24XAL2ND.js.map","import{a as e}from\"./chunk-24XAL2ND.js\";import\"./chunk-OWSPJIEF.js\";import\"./chunk-JOQBBVRS.js\";var t=e({worldImportPath:\"../\",worldgenDirectory:\"interfaces\",worldInterfaceName:\"IBaseWorld\",codegenDirectory:\"\",tables:{NamespaceOwner:{keySchema:{namespace:\"bytes16\"},schema:{owner:\"address\"}},ResourceAccess:{keySchema:{resourceSelector:\"bytes32\",caller:\"address\"},schema:{access:\"bool\"}},InstalledModules:{keySchema:{moduleName:\"bytes16\",argumentsHash:\"bytes32\"},schema:{moduleAddress:\"address\"},dataStruct:!0},Systems:{directory:\"modules/core/tables\",keySchema:{resourceSelector:\"bytes32\"},schema:{system:\"address\",publicAccess:\"bool\"},dataStruct:!1},SystemRegistry:{directory:\"modules/core/tables\",keySchema:{system:\"address\"},schema:{resourceSelector:\"bytes32\"}},SystemHooks:{directory:\"modules/core/tables\",keySchema:{resourceSelector:\"bytes32\"},schema:\"address[]\"},ResourceType:{directory:\"modules/core/tables\",keySchema:{resourceSelector:\"bytes32\"},schema:{resourceType:\"Resource\"}},FunctionSelectors:{directory:\"modules/core/tables\",keySchema:{functionSelector:\"bytes4\"},schema:{resourceSelector:\"bytes32\",systemFunctionSelector:\"bytes4\"},dataStruct:!1},KeysWithValue:{directory:\"modules/keyswithvalue/tables\",keySchema:{valueHash:\"bytes32\"},schema:{keysWithValue:\"bytes32[]\"},tableIdArgument:!0},KeysInTable:{directory:\"modules/keysintable/tables\",keySchema:{sourceTable:\"bytes32\"},schema:{keys0:\"bytes32[]\",keys1:\"bytes32[]\",keys2:\"bytes32[]\",keys3:\"bytes32[]\",keys4:\"bytes32[]\"}},UsedKeysIndex:{directory:\"modules/keysintable/tables\",keySchema:{sourceTable:\"bytes32\",keysHash:\"bytes32\"},schema:{has:\"bool\",index:\"uint40\"},dataStruct:!1},UniqueEntity:{directory:\"modules/uniqueentity/tables\",keySchema:{},schema:\"uint256\",tableIdArgument:!0,storeArgument:!0},Bool:{directory:\"../test/tables\",keySchema:{},schema:{value:\"bool\"},tableIdArgument:!0},AddressArray:{directory:\"../test/tables\",schema:\"address[]\",tableIdArgument:!0}},enums:{Resource:[\"NONE\",\"NAMESPACE\",\"TABLE\",\"SYSTEM\"]},excludeSystems:[\"UniqueEntitySystem\",\"StoreRegistrationSystem\",\"EphemeralRecordSystem\"]});export{t as default};\n//# sourceMappingURL=mud.config.js.map","import{a as l,b as d}from\"../chunk-IH5UMM4B.js\";import{a as B}from\"../chunk-SNWOSPCV.js\";import\"../chunk-A2BQSIM3.js\";import{decodeAbiParameters as W}from\"viem\";import{sliceHex as w,size as V,isHex as M}from\"viem\";function T(e){if(!M(e))throw new Error(`entity ${e} is not a hex string`);let i=V(e);if(i%32!==0)throw new Error(`entity length ${i} is not a multiple of 32 bytes`);return new Array(i/32).fill(0).map((r,n)=>w(e,n*32,(n+1)*32))}function ot(e,i){let r=T(i);if(r.length!==Object.keys(e).length)throw new Error(`entity key tuple length ${r.length} does not match key schema length ${Object.keys(e).length}`);return Object.fromEntries(Object.entries(e).map(([n,a],o)=>[n,W([{type:a}],r[o])[0]]))}import{encodeAbiParameters as L}from\"viem\";import{concatHex as D}from\"viem\";function c(e){return D(e)}function u(e,i){if(Object.keys(e).length!==Object.keys(i).length)throw new Error(`key length ${Object.keys(i).length} does not match key schema length ${Object.keys(e).length}`);return c(Object.entries(e).map(([r,n])=>L([{type:n}],[i[r]])))}function ut(e){return e.metadata?.componentName!=null&&e.metadata?.tableName!=null&&e.metadata?.keySchema!=null&&e.metadata?.valueSchema!=null}var g=B.extend(\"recs\");import{getComponentValue as h,removeComponent as z,setComponent as x,updateComponent as F}from\"@latticexyz/recs\";import{isDefined as _}from\"@latticexyz/common/utils\";import{stringToHex as C}from\"viem\";function b(e){return u({address:\"address\",namespace:\"bytes16\",name:\"bytes16\"},{address:e.address,namespace:C(e.namespace,{size:16}),name:C(e.name,{size:16})})}import{tableIdToHex as q}from\"@latticexyz/common\";function R({components:e}){let i=Object.fromEntries(Object.entries(e).map(([r,n])=>[n.id,n]));return{async registerTables({tables:r}){for(let n of r)x(e.RegisteredTables,b(n),{table:n})},async getTables({tables:r}){return r.map(n=>h(e.RegisteredTables,b(n))?.table).filter(_)},async storeOperations({operations:r}){for(let n of r){let a=h(e.RegisteredTables,b({address:n.address,namespace:n.namespace,name:n.name}))?.table;if(!a){g(`skipping update for unknown table: ${n.namespace}:${n.name} at ${n.address}`);continue}let o=q(n.namespace,n.name),m=i[o];if(!m){g(`skipping update for unknown component: ${o}. Available components: ${Object.keys(e)}`);continue}let s=u(a.keySchema,n.key);n.type===\"SetRecord\"?(g(\"setting component\",o,s,n.value),x(m,s,n.value)):n.type===\"SetField\"?(g(\"updating component\",o,s,{[n.fieldName]:n.fieldValue}),F(m,s,{[n.fieldName]:n.fieldValue},l(a.valueSchema))):n.type===\"DeleteRecord\"&&(g(\"deleting component\",o,s),z(m,s))}}}}var f=c([]);import{getComponentValue as Q,setComponent as U}from\"@latticexyz/recs\";import{defineComponent as E,Type as y}from\"@latticexyz/recs\";function N(e){return{RegisteredTables:E(e,{table:y.T},{metadata:{componentName:\"RegisteredTables\"}}),SyncProgress:E(e,{step:y.String,message:y.String,percentage:y.Number,latestBlockNumber:y.BigInt,lastBlockNumberProcessed:y.BigInt},{metadata:{componentName:\"SyncProgress\"}})}}import X from\"@latticexyz/store/mud.config\";import Y from\"@latticexyz/world/mud.config\";import{tableIdToHex as G}from\"@latticexyz/common\";import{defineComponent as J}from\"@latticexyz/recs\";import{Type as t}from\"@latticexyz/recs\";var O={uint8:t.Number,uint16:t.Number,uint24:t.Number,uint32:t.Number,uint40:t.Number,uint48:t.Number,uint56:t.BigInt,uint64:t.BigInt,uint72:t.BigInt,uint80:t.BigInt,uint88:t.BigInt,uint96:t.BigInt,uint104:t.BigInt,uint112:t.BigInt,uint120:t.BigInt,uint128:t.BigInt,uint136:t.BigInt,uint144:t.BigInt,uint152:t.BigInt,uint160:t.BigInt,uint168:t.BigInt,uint176:t.BigInt,uint184:t.BigInt,uint192:t.BigInt,uint200:t.BigInt,uint208:t.BigInt,uint216:t.BigInt,uint224:t.BigInt,uint232:t.BigInt,uint240:t.BigInt,uint248:t.BigInt,uint256:t.BigInt,int8:t.Number,int16:t.Number,int24:t.Number,int32:t.Number,int40:t.Number,int48:t.Number,int56:t.BigInt,int64:t.BigInt,int72:t.BigInt,int80:t.BigInt,int88:t.BigInt,int96:t.BigInt,int104:t.BigInt,int112:t.BigInt,int120:t.BigInt,int128:t.BigInt,int136:t.BigInt,int144:t.BigInt,int152:t.BigInt,int160:t.BigInt,int168:t.BigInt,int176:t.BigInt,int184:t.BigInt,int192:t.BigInt,int200:t.BigInt,int208:t.BigInt,int216:t.BigInt,int224:t.BigInt,int232:t.BigInt,int240:t.BigInt,int248:t.BigInt,int256:t.BigInt,bytes1:t.String,bytes2:t.String,bytes3:t.String,bytes4:t.String,bytes5:t.String,bytes6:t.String,bytes7:t.String,bytes8:t.String,bytes9:t.String,bytes10:t.String,bytes11:t.String,bytes12:t.String,bytes13:t.String,bytes14:t.String,bytes15:t.String,bytes16:t.String,bytes17:t.String,bytes18:t.String,bytes19:t.String,bytes20:t.String,bytes21:t.String,bytes22:t.String,bytes23:t.String,bytes24:t.String,bytes25:t.String,bytes26:t.String,bytes27:t.String,bytes28:t.String,bytes29:t.String,bytes30:t.String,bytes31:t.String,bytes32:t.String,bool:t.Boolean,address:t.String,\"uint8[]\":t.NumberArray,\"uint16[]\":t.NumberArray,\"uint24[]\":t.NumberArray,\"uint32[]\":t.NumberArray,\"uint40[]\":t.NumberArray,\"uint48[]\":t.NumberArray,\"uint56[]\":t.BigIntArray,\"uint64[]\":t.BigIntArray,\"uint72[]\":t.BigIntArray,\"uint80[]\":t.BigIntArray,\"uint88[]\":t.BigIntArray,\"uint96[]\":t.BigIntArray,\"uint104[]\":t.BigIntArray,\"uint112[]\":t.BigIntArray,\"uint120[]\":t.BigIntArray,\"uint128[]\":t.BigIntArray,\"uint136[]\":t.BigIntArray,\"uint144[]\":t.BigIntArray,\"uint152[]\":t.BigIntArray,\"uint160[]\":t.BigIntArray,\"uint168[]\":t.BigIntArray,\"uint176[]\":t.BigIntArray,\"uint184[]\":t.BigIntArray,\"uint192[]\":t.BigIntArray,\"uint200[]\":t.BigIntArray,\"uint208[]\":t.BigIntArray,\"uint216[]\":t.BigIntArray,\"uint224[]\":t.BigIntArray,\"uint232[]\":t.BigIntArray,\"uint240[]\":t.BigIntArray,\"uint248[]\":t.BigIntArray,\"uint256[]\":t.BigIntArray,\"int8[]\":t.NumberArray,\"int16[]\":t.NumberArray,\"int24[]\":t.NumberArray,\"int32[]\":t.NumberArray,\"int40[]\":t.NumberArray,\"int48[]\":t.NumberArray,\"int56[]\":t.BigIntArray,\"int64[]\":t.BigIntArray,\"int72[]\":t.BigIntArray,\"int80[]\":t.BigIntArray,\"int88[]\":t.BigIntArray,\"int96[]\":t.BigIntArray,\"int104[]\":t.BigIntArray,\"int112[]\":t.BigIntArray,\"int120[]\":t.BigIntArray,\"int128[]\":t.BigIntArray,\"int136[]\":t.BigIntArray,\"int144[]\":t.BigIntArray,\"int152[]\":t.BigIntArray,\"int160[]\":t.BigIntArray,\"int168[]\":t.BigIntArray,\"int176[]\":t.BigIntArray,\"int184[]\":t.BigIntArray,\"int192[]\":t.BigIntArray,\"int200[]\":t.BigIntArray,\"int208[]\":t.BigIntArray,\"int216[]\":t.BigIntArray,\"int224[]\":t.BigIntArray,\"int232[]\":t.BigIntArray,\"int240[]\":t.BigIntArray,\"int248[]\":t.BigIntArray,\"int256[]\":t.BigIntArray,\"bytes1[]\":t.StringArray,\"bytes2[]\":t.StringArray,\"bytes3[]\":t.StringArray,\"bytes4[]\":t.StringArray,\"bytes5[]\":t.StringArray,\"bytes6[]\":t.StringArray,\"bytes7[]\":t.StringArray,\"bytes8[]\":t.StringArray,\"bytes9[]\":t.StringArray,\"bytes10[]\":t.StringArray,\"bytes11[]\":t.StringArray,\"bytes12[]\":t.StringArray,\"bytes13[]\":t.StringArray,\"bytes14[]\":t.StringArray,\"bytes15[]\":t.StringArray,\"bytes16[]\":t.StringArray,\"bytes17[]\":t.StringArray,\"bytes18[]\":t.StringArray,\"bytes19[]\":t.StringArray,\"bytes20[]\":t.StringArray,\"bytes21[]\":t.StringArray,\"bytes22[]\":t.StringArray,\"bytes23[]\":t.StringArray,\"bytes24[]\":t.StringArray,\"bytes25[]\":t.StringArray,\"bytes26[]\":t.StringArray,\"bytes27[]\":t.StringArray,\"bytes28[]\":t.StringArray,\"bytes29[]\":t.StringArray,\"bytes30[]\":t.StringArray,\"bytes31[]\":t.StringArray,\"bytes32[]\":t.StringArray,\"bool[]\":t.T,\"address[]\":t.StringArray,bytes:t.String,string:t.String};function S(e,i){return Object.fromEntries(Object.entries(i.tables).map(([r,n])=>[r,J(e,Object.fromEntries(Object.entries(n.schema).map(([a,o])=>[a,O[o]])),{id:G(i.namespace,r),metadata:{componentName:r,tableName:`${i.namespace}:${r}`,keySchema:n.keySchema,valueSchema:n.schema}})]))}async function ae({world:e,config:i,address:r,publicClient:n,startBlock:a,maxBlockRange:o,initialState:m,indexerUrl:s,startSync:k=!0}){let p={...S(e,i),...S(e,X),...S(e,Y),...N(e)};e.registerEntity({id:f});let A=await d({storageAdapter:R({components:p,config:i}),config:i,address:r,publicClient:n,startBlock:a,maxBlockRange:o,indexerUrl:s,initialState:m,onProgress:({step:H,percentage:P,latestBlockNumber:v,lastBlockNumberProcessed:$,message:K})=>{Q(p.SyncProgress,f)?.step!==\"live\"&&U(p.SyncProgress,f,{step:H,percentage:P,latestBlockNumber:v,lastBlockNumberProcessed:$,message:K})}}),j=k?A.blockStorageOperations$.subscribe():null,I=()=>{j?.unsubscribe()};return e.registerDisposer(I),{...A,components:p,stopSync:I}}export{ot as decodeEntity,u as encodeEntity,T as entityToHexKeyTuple,c as hexKeyTupleToEntity,ut as isStoreComponent,R as recsStorage,f as singletonEntity,ae as syncToRecs};\n//# sourceMappingURL=index.js.map","import { getComponentValue,getComponentValueStrict, Has, Not } from \"@latticexyz/recs\";\nimport { ClientComponents } from \"./createClientComponents\";\nimport { SetupNetworkResult } from \"./setupNetwork\";\nimport { singletonEntity } from \"@latticexyz/store-sync/recs\";\n\n\nexport type SystemCalls = ReturnType;\n\nexport function createSystemCalls(\n { worldContract, waitForTransaction }: SetupNetworkResult,\n { Counter,GameState,Game,IsPlayer,Player,AssetsList }: ClientComponents\n) {\n const increment = async () => {\n const tx = await worldContract.write.increment();\n await waitForTransaction(tx);\n return getComponentValue(Counter, singletonEntity);\n };\n const joinGame = async () => {\n const tx = await worldContract.write.joinGame();\n await waitForTransaction(tx);\n return getComponentValue(IsPlayer, singletonEntity);\n };\n const askStart = async () => {\n const tx = await worldContract.write.askStart();\n await waitForTransaction(tx);\n return getComponentValue(GameState, singletonEntity);\n };\n\n const move = async (x:number,y:number) => {\n // const tx = await worldSend(\"move\", [x, y]);\n const tx = await worldContract.write.move([x,y]);\n return await waitForTransaction(tx);\n };\n\n const pickAsset = async (assetType:number) => {\n const tx = await worldContract.write.pickAsset([assetType]);\n await waitForTransaction(tx);\n return getComponentValue(AssetsList, singletonEntity);\n };\n\n const pickFund = async (cardId:number) => {\n const tx = await worldContract.write.pickFund([cardId]);\n await waitForTransaction(tx);\n };\n\n const trade = async (targetPlayer:string,assetType:number,money:number) => {\n const tx = await worldContract.write.trade([targetPlayer,assetType,money]);\n return await waitForTransaction(tx);\n };\n\n const acceptTrade = async () => {\n const tx = await worldContract.write.acceptTrade();\n return await waitForTransaction(tx);\n };\n\n const rejectTrade = async () => {\n const tx = await worldContract.write.rejectTrade();\n return await waitForTransaction(tx);\n };\n\n const finishGame = async () => {\n const tx = await worldContract.write.finishGame();\n return await waitForTransaction(tx);\n };\n\n const pickCoin = async () => {\n const tx = await worldContract.write.pickCoin();\n return await waitForTransaction(tx);\n };\n\n const findPartner = async () => {\n const tx = await worldContract.write.findPartner();\n return await waitForTransaction(tx);\n };\n\n const pay = async () => {\n const tx = await worldContract.write.pay();\n return await waitForTransaction(tx);\n };\n const restartGame = async () => {\n const tx = await worldContract.write.restartGame();\n return await waitForTransaction(tx);\n };\n const checkDebt = async () => {\n const tx = await worldContract.write.checkDebt();\n return await waitForTransaction(tx);\n };\n\n return {\n increment,\n joinGame,\n askStart,\n move,\n pickAsset,\n pickFund,\n trade,\n acceptTrade,\n rejectTrade,\n finishGame,\n pickCoin,\n findPartner,\n pay,\n restartGame,\n checkDebt\n };\n}\n","/**\n * @license\n * Copyright 2009 The Closure Library Authors\n * Copyright 2020 Daniel Wirtz / The long.js Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// WebAssembly optimizations to do native i64 multiplication and divide\nvar wasm = null;\ntry {\n wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([\n 0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11\n ])), {}).exports;\n} catch (e) {\n // no wasm support :(\n}\n\n/**\n * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.\n * See the from* functions below for more convenient ways of constructing Longs.\n * @exports Long\n * @class A Long class for representing a 64 bit two's-complement integer value.\n * @param {number} low The low (signed) 32 bits of the long\n * @param {number} high The high (signed) 32 bits of the long\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @constructor\n */\nfunction Long(low, high, unsigned) {\n\n /**\n * The low 32 bits as a signed value.\n * @type {number}\n */\n this.low = low | 0;\n\n /**\n * The high 32 bits as a signed value.\n * @type {number}\n */\n this.high = high | 0;\n\n /**\n * Whether unsigned or not.\n * @type {boolean}\n */\n this.unsigned = !!unsigned;\n}\n\n// The internal representation of a long is the two given signed, 32-bit values.\n// We use 32-bit pieces because these are the size of integers on which\n// Javascript performs bit-operations. For operations like addition and\n// multiplication, we split each number into 16 bit pieces, which can easily be\n// multiplied within Javascript's floating-point representation without overflow\n// or change in sign.\n//\n// In the algorithms below, we frequently reduce the negative case to the\n// positive case by negating the input(s) and then post-processing the result.\n// Note that we must ALWAYS check specially whether those values are MIN_VALUE\n// (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as\n// a positive number, it overflows back into a negative). Not handling this\n// case would often result in infinite recursion.\n//\n// Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from*\n// methods on which they depend.\n\n/**\n * An indicator used to reliably determine if an object is a Long or not.\n * @type {boolean}\n * @const\n * @private\n */\nLong.prototype.__isLong__;\n\nObject.defineProperty(Long.prototype, \"__isLong__\", { value: true });\n\n/**\n * @function\n * @param {*} obj Object\n * @returns {boolean}\n * @inner\n */\nfunction isLong(obj) {\n return (obj && obj[\"__isLong__\"]) === true;\n}\n\n/**\n * @function\n * @param {*} value number\n * @returns {number}\n * @inner\n */\nfunction ctz32(value) {\n var c = Math.clz32(value & -value);\n return value ? 31 - c : c;\n}\n\n/**\n * Tests if the specified object is a Long.\n * @function\n * @param {*} obj Object\n * @returns {boolean}\n */\nLong.isLong = isLong;\n\n/**\n * A cache of the Long representations of small integer values.\n * @type {!Object}\n * @inner\n */\nvar INT_CACHE = {};\n\n/**\n * A cache of the Long representations of small unsigned integer values.\n * @type {!Object}\n * @inner\n */\nvar UINT_CACHE = {};\n\n/**\n * @param {number} value\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nfunction fromInt(value, unsigned) {\n var obj, cachedObj, cache;\n if (unsigned) {\n value >>>= 0;\n if (cache = (0 <= value && value < 256)) {\n cachedObj = UINT_CACHE[value];\n if (cachedObj)\n return cachedObj;\n }\n obj = fromBits(value, 0, true);\n if (cache)\n UINT_CACHE[value] = obj;\n return obj;\n } else {\n value |= 0;\n if (cache = (-128 <= value && value < 128)) {\n cachedObj = INT_CACHE[value];\n if (cachedObj)\n return cachedObj;\n }\n obj = fromBits(value, value < 0 ? -1 : 0, false);\n if (cache)\n INT_CACHE[value] = obj;\n return obj;\n }\n}\n\n/**\n * Returns a Long representing the given 32 bit integer value.\n * @function\n * @param {number} value The 32 bit integer in question\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\nLong.fromInt = fromInt;\n\n/**\n * @param {number} value\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nfunction fromNumber(value, unsigned) {\n if (isNaN(value))\n return unsigned ? UZERO : ZERO;\n if (unsigned) {\n if (value < 0)\n return UZERO;\n if (value >= TWO_PWR_64_DBL)\n return MAX_UNSIGNED_VALUE;\n } else {\n if (value <= -TWO_PWR_63_DBL)\n return MIN_VALUE;\n if (value + 1 >= TWO_PWR_63_DBL)\n return MAX_VALUE;\n }\n if (value < 0)\n return fromNumber(-value, unsigned).neg();\n return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned);\n}\n\n/**\n * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.\n * @function\n * @param {number} value The number in question\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\nLong.fromNumber = fromNumber;\n\n/**\n * @param {number} lowBits\n * @param {number} highBits\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nfunction fromBits(lowBits, highBits, unsigned) {\n return new Long(lowBits, highBits, unsigned);\n}\n\n/**\n * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is\n * assumed to use 32 bits.\n * @function\n * @param {number} lowBits The low 32 bits\n * @param {number} highBits The high 32 bits\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\nLong.fromBits = fromBits;\n\n/**\n * @function\n * @param {number} base\n * @param {number} exponent\n * @returns {number}\n * @inner\n */\nvar pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4)\n\n/**\n * @param {string} str\n * @param {(boolean|number)=} unsigned\n * @param {number=} radix\n * @returns {!Long}\n * @inner\n */\nfunction fromString(str, unsigned, radix) {\n if (str.length === 0)\n throw Error('empty string');\n if (typeof unsigned === 'number') {\n // For goog.math.long compatibility\n radix = unsigned;\n unsigned = false;\n } else {\n unsigned = !!unsigned;\n }\n if (str === \"NaN\" || str === \"Infinity\" || str === \"+Infinity\" || str === \"-Infinity\")\n return unsigned ? UZERO : ZERO;\n radix = radix || 10;\n if (radix < 2 || 36 < radix)\n throw RangeError('radix');\n\n var p;\n if ((p = str.indexOf('-')) > 0)\n throw Error('interior hyphen');\n else if (p === 0) {\n return fromString(str.substring(1), unsigned, radix).neg();\n }\n\n // Do several (8) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n var radixToPower = fromNumber(pow_dbl(radix, 8));\n\n var result = ZERO;\n for (var i = 0; i < str.length; i += 8) {\n var size = Math.min(8, str.length - i),\n value = parseInt(str.substring(i, i + size), radix);\n if (size < 8) {\n var power = fromNumber(pow_dbl(radix, size));\n result = result.mul(power).add(fromNumber(value));\n } else {\n result = result.mul(radixToPower);\n result = result.add(fromNumber(value));\n }\n }\n result.unsigned = unsigned;\n return result;\n}\n\n/**\n * Returns a Long representation of the given string, written using the specified radix.\n * @function\n * @param {string} str The textual representation of the Long\n * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed\n * @param {number=} radix The radix in which the text is written (2-36), defaults to 10\n * @returns {!Long} The corresponding Long value\n */\nLong.fromString = fromString;\n\n/**\n * @function\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nfunction fromValue(val, unsigned) {\n if (typeof val === 'number')\n return fromNumber(val, unsigned);\n if (typeof val === 'string')\n return fromString(val, unsigned);\n // Throws for non-objects, converts non-instanceof Long:\n return fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned);\n}\n\n/**\n * Converts the specified value to a Long using the appropriate from* function for its type.\n * @function\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long}\n */\nLong.fromValue = fromValue;\n\n// NOTE: the compiler should inline these constant values below and then remove these variables, so there should be\n// no runtime penalty for these.\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_16_DBL = 1 << 16;\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_24_DBL = 1 << 24;\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;\n\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;\n\n/**\n * @type {!Long}\n * @const\n * @inner\n */\nvar TWO_PWR_24 = fromInt(TWO_PWR_24_DBL);\n\n/**\n * @type {!Long}\n * @inner\n */\nvar ZERO = fromInt(0);\n\n/**\n * Signed zero.\n * @type {!Long}\n */\nLong.ZERO = ZERO;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar UZERO = fromInt(0, true);\n\n/**\n * Unsigned zero.\n * @type {!Long}\n */\nLong.UZERO = UZERO;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar ONE = fromInt(1);\n\n/**\n * Signed one.\n * @type {!Long}\n */\nLong.ONE = ONE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar UONE = fromInt(1, true);\n\n/**\n * Unsigned one.\n * @type {!Long}\n */\nLong.UONE = UONE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar NEG_ONE = fromInt(-1);\n\n/**\n * Signed negative one.\n * @type {!Long}\n */\nLong.NEG_ONE = NEG_ONE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar MAX_VALUE = fromBits(0xFFFFFFFF | 0, 0x7FFFFFFF | 0, false);\n\n/**\n * Maximum signed value.\n * @type {!Long}\n */\nLong.MAX_VALUE = MAX_VALUE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF | 0, 0xFFFFFFFF | 0, true);\n\n/**\n * Maximum unsigned value.\n * @type {!Long}\n */\nLong.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE;\n\n/**\n * @type {!Long}\n * @inner\n */\nvar MIN_VALUE = fromBits(0, 0x80000000 | 0, false);\n\n/**\n * Minimum signed value.\n * @type {!Long}\n */\nLong.MIN_VALUE = MIN_VALUE;\n\n/**\n * @alias Long.prototype\n * @inner\n */\nvar LongPrototype = Long.prototype;\n\n/**\n * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.\n * @this {!Long}\n * @returns {number}\n */\nLongPrototype.toInt = function toInt() {\n return this.unsigned ? this.low >>> 0 : this.low;\n};\n\n/**\n * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).\n * @this {!Long}\n * @returns {number}\n */\nLongPrototype.toNumber = function toNumber() {\n if (this.unsigned)\n return ((this.high >>> 0) * TWO_PWR_32_DBL) + (this.low >>> 0);\n return this.high * TWO_PWR_32_DBL + (this.low >>> 0);\n};\n\n/**\n * Converts the Long to a string written in the specified radix.\n * @this {!Long}\n * @param {number=} radix Radix (2-36), defaults to 10\n * @returns {string}\n * @override\n * @throws {RangeError} If `radix` is out of range\n */\nLongPrototype.toString = function toString(radix) {\n radix = radix || 10;\n if (radix < 2 || 36 < radix)\n throw RangeError('radix');\n if (this.isZero())\n return '0';\n if (this.isNegative()) { // Unsigned Longs are never negative\n if (this.eq(MIN_VALUE)) {\n // We need to change the Long value before it can be negated, so we remove\n // the bottom-most digit in this base and then recurse to do the rest.\n var radixLong = fromNumber(radix),\n div = this.div(radixLong),\n rem1 = div.mul(radixLong).sub(this);\n return div.toString(radix) + rem1.toInt().toString(radix);\n } else\n return '-' + this.neg().toString(radix);\n }\n\n // Do several (6) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned),\n rem = this;\n var result = '';\n while (true) {\n var remDiv = rem.div(radixToPower),\n intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0,\n digits = intval.toString(radix);\n rem = remDiv;\n if (rem.isZero())\n return digits + result;\n else {\n while (digits.length < 6)\n digits = '0' + digits;\n result = '' + digits + result;\n }\n }\n};\n\n/**\n * Gets the high 32 bits as a signed integer.\n * @this {!Long}\n * @returns {number} Signed high bits\n */\nLongPrototype.getHighBits = function getHighBits() {\n return this.high;\n};\n\n/**\n * Gets the high 32 bits as an unsigned integer.\n * @this {!Long}\n * @returns {number} Unsigned high bits\n */\nLongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() {\n return this.high >>> 0;\n};\n\n/**\n * Gets the low 32 bits as a signed integer.\n * @this {!Long}\n * @returns {number} Signed low bits\n */\nLongPrototype.getLowBits = function getLowBits() {\n return this.low;\n};\n\n/**\n * Gets the low 32 bits as an unsigned integer.\n * @this {!Long}\n * @returns {number} Unsigned low bits\n */\nLongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() {\n return this.low >>> 0;\n};\n\n/**\n * Gets the number of bits needed to represent the absolute value of this Long.\n * @this {!Long}\n * @returns {number}\n */\nLongPrototype.getNumBitsAbs = function getNumBitsAbs() {\n if (this.isNegative()) // Unsigned Longs are never negative\n return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs();\n var val = this.high != 0 ? this.high : this.low;\n for (var bit = 31; bit > 0; bit--)\n if ((val & (1 << bit)) != 0)\n break;\n return this.high != 0 ? bit + 33 : bit + 1;\n};\n\n/**\n * Tests if this Long's value equals zero.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isZero = function isZero() {\n return this.high === 0 && this.low === 0;\n};\n\n/**\n * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}.\n * @returns {boolean}\n */\nLongPrototype.eqz = LongPrototype.isZero;\n\n/**\n * Tests if this Long's value is negative.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isNegative = function isNegative() {\n return !this.unsigned && this.high < 0;\n};\n\n/**\n * Tests if this Long's value is positive or zero.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isPositive = function isPositive() {\n return this.unsigned || this.high >= 0;\n};\n\n/**\n * Tests if this Long's value is odd.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isOdd = function isOdd() {\n return (this.low & 1) === 1;\n};\n\n/**\n * Tests if this Long's value is even.\n * @this {!Long}\n * @returns {boolean}\n */\nLongPrototype.isEven = function isEven() {\n return (this.low & 1) === 0;\n};\n\n/**\n * Tests if this Long's value equals the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.equals = function equals(other) {\n if (!isLong(other))\n other = fromValue(other);\n if (this.unsigned !== other.unsigned && (this.high >>> 31) === 1 && (other.high >>> 31) === 1)\n return false;\n return this.high === other.high && this.low === other.low;\n};\n\n/**\n * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.eq = LongPrototype.equals;\n\n/**\n * Tests if this Long's value differs from the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.notEquals = function notEquals(other) {\n return !this.eq(/* validates */ other);\n};\n\n/**\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.neq = LongPrototype.notEquals;\n\n/**\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.ne = LongPrototype.notEquals;\n\n/**\n * Tests if this Long's value is less than the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.lessThan = function lessThan(other) {\n return this.comp(/* validates */ other) < 0;\n};\n\n/**\n * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.lt = LongPrototype.lessThan;\n\n/**\n * Tests if this Long's value is less than or equal the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.lessThanOrEqual = function lessThanOrEqual(other) {\n return this.comp(/* validates */ other) <= 0;\n};\n\n/**\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.lte = LongPrototype.lessThanOrEqual;\n\n/**\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.le = LongPrototype.lessThanOrEqual;\n\n/**\n * Tests if this Long's value is greater than the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.greaterThan = function greaterThan(other) {\n return this.comp(/* validates */ other) > 0;\n};\n\n/**\n * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.gt = LongPrototype.greaterThan;\n\n/**\n * Tests if this Long's value is greater than or equal the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.greaterThanOrEqual = function greaterThanOrEqual(other) {\n return this.comp(/* validates */ other) >= 0;\n};\n\n/**\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.gte = LongPrototype.greaterThanOrEqual;\n\n/**\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nLongPrototype.ge = LongPrototype.greaterThanOrEqual;\n\n/**\n * Compares this Long's value with the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\n * if the given one is greater\n */\nLongPrototype.compare = function compare(other) {\n if (!isLong(other))\n other = fromValue(other);\n if (this.eq(other))\n return 0;\n var thisNeg = this.isNegative(),\n otherNeg = other.isNegative();\n if (thisNeg && !otherNeg)\n return -1;\n if (!thisNeg && otherNeg)\n return 1;\n // At this point the sign bits are the same\n if (!this.unsigned)\n return this.sub(other).isNegative() ? -1 : 1;\n // Both are positive if at least one is unsigned\n return (other.high >>> 0) > (this.high >>> 0) || (other.high === this.high && (other.low >>> 0) > (this.low >>> 0)) ? -1 : 1;\n};\n\n/**\n * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\n * if the given one is greater\n */\nLongPrototype.comp = LongPrototype.compare;\n\n/**\n * Negates this Long's value.\n * @this {!Long}\n * @returns {!Long} Negated Long\n */\nLongPrototype.negate = function negate() {\n if (!this.unsigned && this.eq(MIN_VALUE))\n return MIN_VALUE;\n return this.not().add(ONE);\n};\n\n/**\n * Negates this Long's value. This is an alias of {@link Long#negate}.\n * @function\n * @returns {!Long} Negated Long\n */\nLongPrototype.neg = LongPrototype.negate;\n\n/**\n * Returns the sum of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|string} addend Addend\n * @returns {!Long} Sum\n */\nLongPrototype.add = function add(addend) {\n if (!isLong(addend))\n addend = fromValue(addend);\n\n // Divide each number into 4 chunks of 16 bits, and then sum the chunks.\n\n var a48 = this.high >>> 16;\n var a32 = this.high & 0xFFFF;\n var a16 = this.low >>> 16;\n var a00 = this.low & 0xFFFF;\n\n var b48 = addend.high >>> 16;\n var b32 = addend.high & 0xFFFF;\n var b16 = addend.low >>> 16;\n var b00 = addend.low & 0xFFFF;\n\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n c00 += a00 + b00;\n c16 += c00 >>> 16;\n c00 &= 0xFFFF;\n c16 += a16 + b16;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c32 += a32 + b32;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c48 += a48 + b48;\n c48 &= 0xFFFF;\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\n};\n\n/**\n * Returns the difference of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|string} subtrahend Subtrahend\n * @returns {!Long} Difference\n */\nLongPrototype.subtract = function subtract(subtrahend) {\n if (!isLong(subtrahend))\n subtrahend = fromValue(subtrahend);\n return this.add(subtrahend.neg());\n};\n\n/**\n * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}.\n * @function\n * @param {!Long|number|string} subtrahend Subtrahend\n * @returns {!Long} Difference\n */\nLongPrototype.sub = LongPrototype.subtract;\n\n/**\n * Returns the product of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|string} multiplier Multiplier\n * @returns {!Long} Product\n */\nLongPrototype.multiply = function multiply(multiplier) {\n if (this.isZero())\n return this;\n if (!isLong(multiplier))\n multiplier = fromValue(multiplier);\n\n // use wasm support if present\n if (wasm) {\n var low = wasm[\"mul\"](this.low,\n this.high,\n multiplier.low,\n multiplier.high);\n return fromBits(low, wasm[\"get_high\"](), this.unsigned);\n }\n\n if (multiplier.isZero())\n return this.unsigned ? UZERO : ZERO;\n if (this.eq(MIN_VALUE))\n return multiplier.isOdd() ? MIN_VALUE : ZERO;\n if (multiplier.eq(MIN_VALUE))\n return this.isOdd() ? MIN_VALUE : ZERO;\n\n if (this.isNegative()) {\n if (multiplier.isNegative())\n return this.neg().mul(multiplier.neg());\n else\n return this.neg().mul(multiplier).neg();\n } else if (multiplier.isNegative())\n return this.mul(multiplier.neg()).neg();\n\n // If both longs are small, use float multiplication\n if (this.lt(TWO_PWR_24) && multiplier.lt(TWO_PWR_24))\n return fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned);\n\n // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.\n // We can skip products that would overflow.\n\n var a48 = this.high >>> 16;\n var a32 = this.high & 0xFFFF;\n var a16 = this.low >>> 16;\n var a00 = this.low & 0xFFFF;\n\n var b48 = multiplier.high >>> 16;\n var b32 = multiplier.high & 0xFFFF;\n var b16 = multiplier.low >>> 16;\n var b00 = multiplier.low & 0xFFFF;\n\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n c00 += a00 * b00;\n c16 += c00 >>> 16;\n c00 &= 0xFFFF;\n c16 += a16 * b00;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c16 += a00 * b16;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c32 += a32 * b00;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c32 += a16 * b16;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c32 += a00 * b32;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;\n c48 &= 0xFFFF;\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned);\n};\n\n/**\n * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}.\n * @function\n * @param {!Long|number|string} multiplier Multiplier\n * @returns {!Long} Product\n */\nLongPrototype.mul = LongPrototype.multiply;\n\n/**\n * Returns this Long divided by the specified. The result is signed if this Long is signed or\n * unsigned if this Long is unsigned.\n * @this {!Long}\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Quotient\n */\nLongPrototype.divide = function divide(divisor) {\n if (!isLong(divisor))\n divisor = fromValue(divisor);\n if (divisor.isZero())\n throw Error('division by zero');\n\n // use wasm support if present\n if (wasm) {\n // guard against signed division overflow: the largest\n // negative number / -1 would be 1 larger than the largest\n // positive number, due to two's complement.\n if (!this.unsigned &&\n this.high === -0x80000000 &&\n divisor.low === -1 && divisor.high === -1) {\n // be consistent with non-wasm code path\n return this;\n }\n var low = (this.unsigned ? wasm[\"div_u\"] : wasm[\"div_s\"])(\n this.low,\n this.high,\n divisor.low,\n divisor.high\n );\n return fromBits(low, wasm[\"get_high\"](), this.unsigned);\n }\n\n if (this.isZero())\n return this.unsigned ? UZERO : ZERO;\n var approx, rem, res;\n if (!this.unsigned) {\n // This section is only relevant for signed longs and is derived from the\n // closure library as a whole.\n if (this.eq(MIN_VALUE)) {\n if (divisor.eq(ONE) || divisor.eq(NEG_ONE))\n return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE\n else if (divisor.eq(MIN_VALUE))\n return ONE;\n else {\n // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.\n var halfThis = this.shr(1);\n approx = halfThis.div(divisor).shl(1);\n if (approx.eq(ZERO)) {\n return divisor.isNegative() ? ONE : NEG_ONE;\n } else {\n rem = this.sub(divisor.mul(approx));\n res = approx.add(rem.div(divisor));\n return res;\n }\n }\n } else if (divisor.eq(MIN_VALUE))\n return this.unsigned ? UZERO : ZERO;\n if (this.isNegative()) {\n if (divisor.isNegative())\n return this.neg().div(divisor.neg());\n return this.neg().div(divisor).neg();\n } else if (divisor.isNegative())\n return this.div(divisor.neg()).neg();\n res = ZERO;\n } else {\n // The algorithm below has not been made for unsigned longs. It's therefore\n // required to take special care of the MSB prior to running it.\n if (!divisor.unsigned)\n divisor = divisor.toUnsigned();\n if (divisor.gt(this))\n return UZERO;\n if (divisor.gt(this.shru(1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true\n return UONE;\n res = UZERO;\n }\n\n // Repeat the following until the remainder is less than other: find a\n // floating-point that approximates remainder / other *from below*, add this\n // into the result, and subtract it from the remainder. It is critical that\n // the approximate value is less than or equal to the real value so that the\n // remainder never becomes negative.\n rem = this;\n while (rem.gte(divisor)) {\n // Approximate the result of division. This may be a little greater or\n // smaller than the actual value.\n approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber()));\n\n // We will tweak the approximate result by changing it in the 48-th digit or\n // the smallest non-fractional digit, whichever is larger.\n var log2 = Math.ceil(Math.log(approx) / Math.LN2),\n delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48),\n\n // Decrease the approximation until it is smaller than the remainder. Note\n // that if it is too large, the product overflows and is negative.\n approxRes = fromNumber(approx),\n approxRem = approxRes.mul(divisor);\n while (approxRem.isNegative() || approxRem.gt(rem)) {\n approx -= delta;\n approxRes = fromNumber(approx, this.unsigned);\n approxRem = approxRes.mul(divisor);\n }\n\n // We know the answer can't be zero... and actually, zero would cause\n // infinite recursion since we would make no progress.\n if (approxRes.isZero())\n approxRes = ONE;\n\n res = res.add(approxRes);\n rem = rem.sub(approxRem);\n }\n return res;\n};\n\n/**\n * Returns this Long divided by the specified. This is an alias of {@link Long#divide}.\n * @function\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Quotient\n */\nLongPrototype.div = LongPrototype.divide;\n\n/**\n * Returns this Long modulo the specified.\n * @this {!Long}\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Remainder\n */\nLongPrototype.modulo = function modulo(divisor) {\n if (!isLong(divisor))\n divisor = fromValue(divisor);\n\n // use wasm support if present\n if (wasm) {\n var low = (this.unsigned ? wasm[\"rem_u\"] : wasm[\"rem_s\"])(\n this.low,\n this.high,\n divisor.low,\n divisor.high\n );\n return fromBits(low, wasm[\"get_high\"](), this.unsigned);\n }\n\n return this.sub(this.div(divisor).mul(divisor));\n};\n\n/**\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\n * @function\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Remainder\n */\nLongPrototype.mod = LongPrototype.modulo;\n\n/**\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\n * @function\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Remainder\n */\nLongPrototype.rem = LongPrototype.modulo;\n\n/**\n * Returns the bitwise NOT of this Long.\n * @this {!Long}\n * @returns {!Long}\n */\nLongPrototype.not = function not() {\n return fromBits(~this.low, ~this.high, this.unsigned);\n};\n\n/**\n * Returns count leading zeros of this Long.\n * @this {!Long}\n * @returns {!number}\n */\nLongPrototype.countLeadingZeros = function countLeadingZeros() {\n return this.high ? Math.clz32(this.high) : Math.clz32(this.low) + 32;\n};\n\n/**\n * Returns count leading zeros. This is an alias of {@link Long#countLeadingZeros}.\n * @function\n * @param {!Long}\n * @returns {!number}\n */\nLongPrototype.clz = LongPrototype.countLeadingZeros;\n\n/**\n * Returns count trailing zeros of this Long.\n * @this {!Long}\n * @returns {!number}\n */\nLongPrototype.countTrailingZeros = function countTrailingZeros() {\n return this.low ? ctz32(this.low) : ctz32(this.high) + 32;\n};\n\n/**\n * Returns count trailing zeros. This is an alias of {@link Long#countTrailingZeros}.\n * @function\n * @param {!Long}\n * @returns {!number}\n */\nLongPrototype.ctz = LongPrototype.countTrailingZeros;\n\n/**\n * Returns the bitwise AND of this Long and the specified.\n * @this {!Long}\n * @param {!Long|number|string} other Other Long\n * @returns {!Long}\n */\nLongPrototype.and = function and(other) {\n if (!isLong(other))\n other = fromValue(other);\n return fromBits(this.low & other.low, this.high & other.high, this.unsigned);\n};\n\n/**\n * Returns the bitwise OR of this Long and the specified.\n * @this {!Long}\n * @param {!Long|number|string} other Other Long\n * @returns {!Long}\n */\nLongPrototype.or = function or(other) {\n if (!isLong(other))\n other = fromValue(other);\n return fromBits(this.low | other.low, this.high | other.high, this.unsigned);\n};\n\n/**\n * Returns the bitwise XOR of this Long and the given one.\n * @this {!Long}\n * @param {!Long|number|string} other Other Long\n * @returns {!Long}\n */\nLongPrototype.xor = function xor(other) {\n if (!isLong(other))\n other = fromValue(other);\n return fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned);\n};\n\n/**\n * Returns this Long with bits shifted to the left by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shiftLeft = function shiftLeft(numBits) {\n if (isLong(numBits))\n numBits = numBits.toInt();\n if ((numBits &= 63) === 0)\n return this;\n else if (numBits < 32)\n return fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned);\n else\n return fromBits(0, this.low << (numBits - 32), this.unsigned);\n};\n\n/**\n * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shl = LongPrototype.shiftLeft;\n\n/**\n * Returns this Long with bits arithmetically shifted to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shiftRight = function shiftRight(numBits) {\n if (isLong(numBits))\n numBits = numBits.toInt();\n if ((numBits &= 63) === 0)\n return this;\n else if (numBits < 32)\n return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned);\n else\n return fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned);\n};\n\n/**\n * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shr = LongPrototype.shiftRight;\n\n/**\n * Returns this Long with bits logically shifted to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) {\n if (isLong(numBits)) numBits = numBits.toInt();\n if ((numBits &= 63) === 0) return this;\n if (numBits < 32) return fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >>> numBits, this.unsigned);\n if (numBits === 32) return fromBits(this.high, 0, this.unsigned);\n return fromBits(this.high >>> (numBits - 32), 0, this.unsigned);\n};\n\n/**\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shru = LongPrototype.shiftRightUnsigned;\n\n/**\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nLongPrototype.shr_u = LongPrototype.shiftRightUnsigned;\n\n/**\n * Returns this Long with bits rotated to the left by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nLongPrototype.rotateLeft = function rotateLeft(numBits) {\n var b;\n if (isLong(numBits)) numBits = numBits.toInt();\n if ((numBits &= 63) === 0) return this;\n if (numBits === 32) return fromBits(this.high, this.low, this.unsigned);\n if (numBits < 32) {\n b = (32 - numBits);\n return fromBits(((this.low << numBits) | (this.high >>> b)), ((this.high << numBits) | (this.low >>> b)), this.unsigned);\n }\n numBits -= 32;\n b = (32 - numBits);\n return fromBits(((this.high << numBits) | (this.low >>> b)), ((this.low << numBits) | (this.high >>> b)), this.unsigned);\n}\n/**\n * Returns this Long with bits rotated to the left by the given amount. This is an alias of {@link Long#rotateLeft}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nLongPrototype.rotl = LongPrototype.rotateLeft;\n\n/**\n * Returns this Long with bits rotated to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nLongPrototype.rotateRight = function rotateRight(numBits) {\n var b;\n if (isLong(numBits)) numBits = numBits.toInt();\n if ((numBits &= 63) === 0) return this;\n if (numBits === 32) return fromBits(this.high, this.low, this.unsigned);\n if (numBits < 32) {\n b = (32 - numBits);\n return fromBits(((this.high << b) | (this.low >>> numBits)), ((this.low << b) | (this.high >>> numBits)), this.unsigned);\n }\n numBits -= 32;\n b = (32 - numBits);\n return fromBits(((this.low << b) | (this.high >>> numBits)), ((this.high << b) | (this.low >>> numBits)), this.unsigned);\n}\n/**\n * Returns this Long with bits rotated to the right by the given amount. This is an alias of {@link Long#rotateRight}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nLongPrototype.rotr = LongPrototype.rotateRight;\n\n/**\n * Converts this Long to signed.\n * @this {!Long}\n * @returns {!Long} Signed long\n */\nLongPrototype.toSigned = function toSigned() {\n if (!this.unsigned)\n return this;\n return fromBits(this.low, this.high, false);\n};\n\n/**\n * Converts this Long to unsigned.\n * @this {!Long}\n * @returns {!Long} Unsigned long\n */\nLongPrototype.toUnsigned = function toUnsigned() {\n if (this.unsigned)\n return this;\n return fromBits(this.low, this.high, true);\n};\n\n/**\n * Converts this Long to its byte representation.\n * @param {boolean=} le Whether little or big endian, defaults to big endian\n * @this {!Long}\n * @returns {!Array.} Byte representation\n */\nLongPrototype.toBytes = function toBytes(le) {\n return le ? this.toBytesLE() : this.toBytesBE();\n};\n\n/**\n * Converts this Long to its little endian byte representation.\n * @this {!Long}\n * @returns {!Array.} Little endian byte representation\n */\nLongPrototype.toBytesLE = function toBytesLE() {\n var hi = this.high,\n lo = this.low;\n return [\n lo & 0xff,\n lo >>> 8 & 0xff,\n lo >>> 16 & 0xff,\n lo >>> 24,\n hi & 0xff,\n hi >>> 8 & 0xff,\n hi >>> 16 & 0xff,\n hi >>> 24\n ];\n};\n\n/**\n * Converts this Long to its big endian byte representation.\n * @this {!Long}\n * @returns {!Array.} Big endian byte representation\n */\nLongPrototype.toBytesBE = function toBytesBE() {\n var hi = this.high,\n lo = this.low;\n return [\n hi >>> 24,\n hi >>> 16 & 0xff,\n hi >>> 8 & 0xff,\n hi & 0xff,\n lo >>> 24,\n lo >>> 16 & 0xff,\n lo >>> 8 & 0xff,\n lo & 0xff\n ];\n};\n\n/**\n * Creates a Long from its byte representation.\n * @param {!Array.} bytes Byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @param {boolean=} le Whether little or big endian, defaults to big endian\n * @returns {Long} The corresponding Long value\n */\nLong.fromBytes = function fromBytes(bytes, unsigned, le) {\n return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned);\n};\n\n/**\n * Creates a Long from its little endian byte representation.\n * @param {!Array.} bytes Little endian byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {Long} The corresponding Long value\n */\nLong.fromBytesLE = function fromBytesLE(bytes, unsigned) {\n return new Long(\n bytes[0] |\n bytes[1] << 8 |\n bytes[2] << 16 |\n bytes[3] << 24,\n bytes[4] |\n bytes[5] << 8 |\n bytes[6] << 16 |\n bytes[7] << 24,\n unsigned\n );\n};\n\n/**\n * Creates a Long from its big endian byte representation.\n * @param {!Array.} bytes Big endian byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {Long} The corresponding Long value\n */\nLong.fromBytesBE = function fromBytesBE(bytes, unsigned) {\n return new Long(\n bytes[4] << 24 |\n bytes[5] << 16 |\n bytes[6] << 8 |\n bytes[7],\n bytes[0] << 24 |\n bytes[1] << 16 |\n bytes[2] << 8 |\n bytes[3],\n unsigned\n );\n};\n\nexport default Long;\n","\"use strict\";\r\nmodule.exports = asPromise;\r\n\r\n/**\r\n * Callback as used by {@link util.asPromise}.\r\n * @typedef asPromiseCallback\r\n * @type {function}\r\n * @param {Error|null} error Error, if any\r\n * @param {...*} params Additional arguments\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Returns a promise from a node-style callback function.\r\n * @memberof util\r\n * @param {asPromiseCallback} fn Function to call\r\n * @param {*} ctx Function context\r\n * @param {...*} params Function arguments\r\n * @returns {Promise<*>} Promisified function\r\n */\r\nfunction asPromise(fn, ctx/*, varargs */) {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0,\r\n index = 2,\r\n pending = true;\r\n while (index < arguments.length)\r\n params[offset++] = arguments[index++];\r\n return new Promise(function executor(resolve, reject) {\r\n params[offset] = function callback(err/*, varargs */) {\r\n if (pending) {\r\n pending = false;\r\n if (err)\r\n reject(err);\r\n else {\r\n var params = new Array(arguments.length - 1),\r\n offset = 0;\r\n while (offset < params.length)\r\n params[offset++] = arguments[offset];\r\n resolve.apply(null, params);\r\n }\r\n }\r\n };\r\n try {\r\n fn.apply(ctx || null, params);\r\n } catch (err) {\r\n if (pending) {\r\n pending = false;\r\n reject(err);\r\n }\r\n }\r\n });\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal base64 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar base64 = exports;\r\n\r\n/**\r\n * Calculates the byte length of a base64 encoded string.\r\n * @param {string} string Base64 encoded string\r\n * @returns {number} Byte length\r\n */\r\nbase64.length = function length(string) {\r\n var p = string.length;\r\n if (!p)\r\n return 0;\r\n var n = 0;\r\n while (--p % 4 > 1 && string.charAt(p) === \"=\")\r\n ++n;\r\n return Math.ceil(string.length * 3) / 4 - n;\r\n};\r\n\r\n// Base64 encoding table\r\nvar b64 = new Array(64);\r\n\r\n// Base64 decoding table\r\nvar s64 = new Array(123);\r\n\r\n// 65..90, 97..122, 48..57, 43, 47\r\nfor (var i = 0; i < 64;)\r\n s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r\n\r\n/**\r\n * Encodes a buffer to a base64 encoded string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} Base64 encoded string\r\n */\r\nbase64.encode = function encode(buffer, start, end) {\r\n var parts = null,\r\n chunk = [];\r\n var i = 0, // output index\r\n j = 0, // goto index\r\n t; // temporary\r\n while (start < end) {\r\n var b = buffer[start++];\r\n switch (j) {\r\n case 0:\r\n chunk[i++] = b64[b >> 2];\r\n t = (b & 3) << 4;\r\n j = 1;\r\n break;\r\n case 1:\r\n chunk[i++] = b64[t | b >> 4];\r\n t = (b & 15) << 2;\r\n j = 2;\r\n break;\r\n case 2:\r\n chunk[i++] = b64[t | b >> 6];\r\n chunk[i++] = b64[b & 63];\r\n j = 0;\r\n break;\r\n }\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (j) {\r\n chunk[i++] = b64[t];\r\n chunk[i++] = 61;\r\n if (j === 1)\r\n chunk[i++] = 61;\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\nvar invalidEncoding = \"invalid encoding\";\r\n\r\n/**\r\n * Decodes a base64 encoded string to a buffer.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Number of bytes written\r\n * @throws {Error} If encoding is invalid\r\n */\r\nbase64.decode = function decode(string, buffer, offset) {\r\n var start = offset;\r\n var j = 0, // goto index\r\n t; // temporary\r\n for (var i = 0; i < string.length;) {\r\n var c = string.charCodeAt(i++);\r\n if (c === 61 && j > 1)\r\n break;\r\n if ((c = s64[c]) === undefined)\r\n throw Error(invalidEncoding);\r\n switch (j) {\r\n case 0:\r\n t = c;\r\n j = 1;\r\n break;\r\n case 1:\r\n buffer[offset++] = t << 2 | (c & 48) >> 4;\r\n t = c;\r\n j = 2;\r\n break;\r\n case 2:\r\n buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r\n t = c;\r\n j = 3;\r\n break;\r\n case 3:\r\n buffer[offset++] = (t & 3) << 6 | c;\r\n j = 0;\r\n break;\r\n }\r\n }\r\n if (j === 1)\r\n throw Error(invalidEncoding);\r\n return offset - start;\r\n};\r\n\r\n/**\r\n * Tests if the specified string appears to be base64 encoded.\r\n * @param {string} string String to test\r\n * @returns {boolean} `true` if probably base64 encoded, otherwise false\r\n */\r\nbase64.test = function test(string) {\r\n return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\r\n};\r\n","\"use strict\";\r\nmodule.exports = EventEmitter;\r\n\r\n/**\r\n * Constructs a new event emitter instance.\r\n * @classdesc A minimal event emitter.\r\n * @memberof util\r\n * @constructor\r\n */\r\nfunction EventEmitter() {\r\n\r\n /**\r\n * Registered listeners.\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._listeners = {};\r\n}\r\n\r\n/**\r\n * Registers an event listener.\r\n * @param {string} evt Event name\r\n * @param {function} fn Listener\r\n * @param {*} [ctx] Listener context\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.on = function on(evt, fn, ctx) {\r\n (this._listeners[evt] || (this._listeners[evt] = [])).push({\r\n fn : fn,\r\n ctx : ctx || this\r\n });\r\n return this;\r\n};\r\n\r\n/**\r\n * Removes an event listener or any matching listeners if arguments are omitted.\r\n * @param {string} [evt] Event name. Removes all listeners if omitted.\r\n * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.off = function off(evt, fn) {\r\n if (evt === undefined)\r\n this._listeners = {};\r\n else {\r\n if (fn === undefined)\r\n this._listeners[evt] = [];\r\n else {\r\n var listeners = this._listeners[evt];\r\n for (var i = 0; i < listeners.length;)\r\n if (listeners[i].fn === fn)\r\n listeners.splice(i, 1);\r\n else\r\n ++i;\r\n }\r\n }\r\n return this;\r\n};\r\n\r\n/**\r\n * Emits an event by calling its listeners with the specified arguments.\r\n * @param {string} evt Event name\r\n * @param {...*} args Arguments\r\n * @returns {util.EventEmitter} `this`\r\n */\r\nEventEmitter.prototype.emit = function emit(evt) {\r\n var listeners = this._listeners[evt];\r\n if (listeners) {\r\n var args = [],\r\n i = 1;\r\n for (; i < arguments.length;)\r\n args.push(arguments[i++]);\r\n for (i = 0; i < listeners.length;)\r\n listeners[i].fn.apply(listeners[i++].ctx, args);\r\n }\r\n return this;\r\n};\r\n","\"use strict\";\r\n\r\nmodule.exports = factory(factory);\r\n\r\n/**\r\n * Reads / writes floats / doubles from / to buffers.\r\n * @name util.float\r\n * @namespace\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using little endian byte order.\r\n * @name util.float.writeFloatLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 32 bit float to a buffer using big endian byte order.\r\n * @name util.float.writeFloatBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using little endian byte order.\r\n * @name util.float.readFloatLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 32 bit float from a buffer using big endian byte order.\r\n * @name util.float.readFloatBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using little endian byte order.\r\n * @name util.float.writeDoubleLE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Writes a 64 bit double to a buffer using big endian byte order.\r\n * @name util.float.writeDoubleBE\r\n * @function\r\n * @param {number} val Value to write\r\n * @param {Uint8Array} buf Target buffer\r\n * @param {number} pos Target buffer offset\r\n * @returns {undefined}\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using little endian byte order.\r\n * @name util.float.readDoubleLE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n/**\r\n * Reads a 64 bit double from a buffer using big endian byte order.\r\n * @name util.float.readDoubleBE\r\n * @function\r\n * @param {Uint8Array} buf Source buffer\r\n * @param {number} pos Source buffer offset\r\n * @returns {number} Value read\r\n */\r\n\r\n// Factory function for the purpose of node-based testing in modified global environments\r\nfunction factory(exports) {\r\n\r\n // float: typed array\r\n if (typeof Float32Array !== \"undefined\") (function() {\r\n\r\n var f32 = new Float32Array([ -0 ]),\r\n f8b = new Uint8Array(f32.buffer),\r\n le = f8b[3] === 128;\r\n\r\n function writeFloat_f32_cpy(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n }\r\n\r\n function writeFloat_f32_rev(val, buf, pos) {\r\n f32[0] = val;\r\n buf[pos ] = f8b[3];\r\n buf[pos + 1] = f8b[2];\r\n buf[pos + 2] = f8b[1];\r\n buf[pos + 3] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\r\n\r\n function readFloat_f32_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n function readFloat_f32_rev(buf, pos) {\r\n f8b[3] = buf[pos ];\r\n f8b[2] = buf[pos + 1];\r\n f8b[1] = buf[pos + 2];\r\n f8b[0] = buf[pos + 3];\r\n return f32[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\r\n /* istanbul ignore next */\r\n exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\r\n\r\n // float: ieee754\r\n })(); else (function() {\r\n\r\n function writeFloat_ieee754(writeUint, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0)\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\r\n else if (isNaN(val))\r\n writeUint(2143289344, buf, pos);\r\n else if (val > 3.4028234663852886e+38) // +-Infinity\r\n writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\r\n else if (val < 1.1754943508222875e-38) // denormal\r\n writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\r\n else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2),\r\n mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\r\n writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\r\n }\r\n }\r\n\r\n exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\r\n exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\r\n\r\n function readFloat_ieee754(readUint, buf, pos) {\r\n var uint = readUint(buf, pos),\r\n sign = (uint >> 31) * 2 + 1,\r\n exponent = uint >>> 23 & 255,\r\n mantissa = uint & 8388607;\r\n return exponent === 255\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 1.401298464324817e-45 * mantissa\r\n : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\r\n }\r\n\r\n exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\r\n exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\r\n\r\n })();\r\n\r\n // double: typed array\r\n if (typeof Float64Array !== \"undefined\") (function() {\r\n\r\n var f64 = new Float64Array([-0]),\r\n f8b = new Uint8Array(f64.buffer),\r\n le = f8b[7] === 128;\r\n\r\n function writeDouble_f64_cpy(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[0];\r\n buf[pos + 1] = f8b[1];\r\n buf[pos + 2] = f8b[2];\r\n buf[pos + 3] = f8b[3];\r\n buf[pos + 4] = f8b[4];\r\n buf[pos + 5] = f8b[5];\r\n buf[pos + 6] = f8b[6];\r\n buf[pos + 7] = f8b[7];\r\n }\r\n\r\n function writeDouble_f64_rev(val, buf, pos) {\r\n f64[0] = val;\r\n buf[pos ] = f8b[7];\r\n buf[pos + 1] = f8b[6];\r\n buf[pos + 2] = f8b[5];\r\n buf[pos + 3] = f8b[4];\r\n buf[pos + 4] = f8b[3];\r\n buf[pos + 5] = f8b[2];\r\n buf[pos + 6] = f8b[1];\r\n buf[pos + 7] = f8b[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\r\n\r\n function readDouble_f64_cpy(buf, pos) {\r\n f8b[0] = buf[pos ];\r\n f8b[1] = buf[pos + 1];\r\n f8b[2] = buf[pos + 2];\r\n f8b[3] = buf[pos + 3];\r\n f8b[4] = buf[pos + 4];\r\n f8b[5] = buf[pos + 5];\r\n f8b[6] = buf[pos + 6];\r\n f8b[7] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n function readDouble_f64_rev(buf, pos) {\r\n f8b[7] = buf[pos ];\r\n f8b[6] = buf[pos + 1];\r\n f8b[5] = buf[pos + 2];\r\n f8b[4] = buf[pos + 3];\r\n f8b[3] = buf[pos + 4];\r\n f8b[2] = buf[pos + 5];\r\n f8b[1] = buf[pos + 6];\r\n f8b[0] = buf[pos + 7];\r\n return f64[0];\r\n }\r\n\r\n /* istanbul ignore next */\r\n exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\r\n /* istanbul ignore next */\r\n exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\r\n\r\n // double: ieee754\r\n })(); else (function() {\r\n\r\n function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\r\n var sign = val < 0 ? 1 : 0;\r\n if (sign)\r\n val = -val;\r\n if (val === 0) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\r\n } else if (isNaN(val)) {\r\n writeUint(0, buf, pos + off0);\r\n writeUint(2146959360, buf, pos + off1);\r\n } else if (val > 1.7976931348623157e+308) { // +-Infinity\r\n writeUint(0, buf, pos + off0);\r\n writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\r\n } else {\r\n var mantissa;\r\n if (val < 2.2250738585072014e-308) { // denormal\r\n mantissa = val / 5e-324;\r\n writeUint(mantissa >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\r\n } else {\r\n var exponent = Math.floor(Math.log(val) / Math.LN2);\r\n if (exponent === 1024)\r\n exponent = 1023;\r\n mantissa = val * Math.pow(2, -exponent);\r\n writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\r\n writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\r\n }\r\n }\r\n }\r\n\r\n exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\r\n exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\r\n\r\n function readDouble_ieee754(readUint, off0, off1, buf, pos) {\r\n var lo = readUint(buf, pos + off0),\r\n hi = readUint(buf, pos + off1);\r\n var sign = (hi >> 31) * 2 + 1,\r\n exponent = hi >>> 20 & 2047,\r\n mantissa = 4294967296 * (hi & 1048575) + lo;\r\n return exponent === 2047\r\n ? mantissa\r\n ? NaN\r\n : sign * Infinity\r\n : exponent === 0 // denormal\r\n ? sign * 5e-324 * mantissa\r\n : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\r\n }\r\n\r\n exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\r\n exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\r\n\r\n })();\r\n\r\n return exports;\r\n}\r\n\r\n// uint helpers\r\n\r\nfunction writeUintLE(val, buf, pos) {\r\n buf[pos ] = val & 255;\r\n buf[pos + 1] = val >>> 8 & 255;\r\n buf[pos + 2] = val >>> 16 & 255;\r\n buf[pos + 3] = val >>> 24;\r\n}\r\n\r\nfunction writeUintBE(val, buf, pos) {\r\n buf[pos ] = val >>> 24;\r\n buf[pos + 1] = val >>> 16 & 255;\r\n buf[pos + 2] = val >>> 8 & 255;\r\n buf[pos + 3] = val & 255;\r\n}\r\n\r\nfunction readUintLE(buf, pos) {\r\n return (buf[pos ]\r\n | buf[pos + 1] << 8\r\n | buf[pos + 2] << 16\r\n | buf[pos + 3] << 24) >>> 0;\r\n}\r\n\r\nfunction readUintBE(buf, pos) {\r\n return (buf[pos ] << 24\r\n | buf[pos + 1] << 16\r\n | buf[pos + 2] << 8\r\n | buf[pos + 3]) >>> 0;\r\n}\r\n","\"use strict\";\r\nmodule.exports = inquire;\r\n\r\n/**\r\n * Requires a module only if available.\r\n * @memberof util\r\n * @param {string} moduleName Module to require\r\n * @returns {?Object} Required module if available and not empty, otherwise `null`\r\n */\r\nfunction inquire(moduleName) {\r\n try {\r\n var mod = eval(\"quire\".replace(/^/,\"re\"))(moduleName); // eslint-disable-line no-eval\r\n if (mod && (mod.length || Object.keys(mod).length))\r\n return mod;\r\n } catch (e) {} // eslint-disable-line no-empty\r\n return null;\r\n}\r\n","\"use strict\";\r\n\r\n/**\r\n * A minimal UTF8 implementation for number arrays.\r\n * @memberof util\r\n * @namespace\r\n */\r\nvar utf8 = exports;\r\n\r\n/**\r\n * Calculates the UTF8 byte length of a string.\r\n * @param {string} string String\r\n * @returns {number} Byte length\r\n */\r\nutf8.length = function utf8_length(string) {\r\n var len = 0,\r\n c = 0;\r\n for (var i = 0; i < string.length; ++i) {\r\n c = string.charCodeAt(i);\r\n if (c < 128)\r\n len += 1;\r\n else if (c < 2048)\r\n len += 2;\r\n else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r\n ++i;\r\n len += 4;\r\n } else\r\n len += 3;\r\n }\r\n return len;\r\n};\r\n\r\n/**\r\n * Reads UTF8 bytes as a string.\r\n * @param {Uint8Array} buffer Source buffer\r\n * @param {number} start Source start\r\n * @param {number} end Source end\r\n * @returns {string} String read\r\n */\r\nutf8.read = function utf8_read(buffer, start, end) {\r\n var len = end - start;\r\n if (len < 1)\r\n return \"\";\r\n var parts = null,\r\n chunk = [],\r\n i = 0, // char offset\r\n t; // temporary\r\n while (start < end) {\r\n t = buffer[start++];\r\n if (t < 128)\r\n chunk[i++] = t;\r\n else if (t > 191 && t < 224)\r\n chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r\n else if (t > 239 && t < 365) {\r\n t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r\n chunk[i++] = 0xD800 + (t >> 10);\r\n chunk[i++] = 0xDC00 + (t & 1023);\r\n } else\r\n chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r\n if (i > 8191) {\r\n (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r\n i = 0;\r\n }\r\n }\r\n if (parts) {\r\n if (i)\r\n parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r\n return parts.join(\"\");\r\n }\r\n return String.fromCharCode.apply(String, chunk.slice(0, i));\r\n};\r\n\r\n/**\r\n * Writes a string as UTF8 bytes.\r\n * @param {string} string Source string\r\n * @param {Uint8Array} buffer Destination buffer\r\n * @param {number} offset Destination offset\r\n * @returns {number} Bytes written\r\n */\r\nutf8.write = function utf8_write(string, buffer, offset) {\r\n var start = offset,\r\n c1, // character 1\r\n c2; // character 2\r\n for (var i = 0; i < string.length; ++i) {\r\n c1 = string.charCodeAt(i);\r\n if (c1 < 128) {\r\n buffer[offset++] = c1;\r\n } else if (c1 < 2048) {\r\n buffer[offset++] = c1 >> 6 | 192;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r\n c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r\n ++i;\r\n buffer[offset++] = c1 >> 18 | 240;\r\n buffer[offset++] = c1 >> 12 & 63 | 128;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n } else {\r\n buffer[offset++] = c1 >> 12 | 224;\r\n buffer[offset++] = c1 >> 6 & 63 | 128;\r\n buffer[offset++] = c1 & 63 | 128;\r\n }\r\n }\r\n return offset - start;\r\n};\r\n","\"use strict\";\r\nmodule.exports = pool;\r\n\r\n/**\r\n * An allocator as used by {@link util.pool}.\r\n * @typedef PoolAllocator\r\n * @type {function}\r\n * @param {number} size Buffer size\r\n * @returns {Uint8Array} Buffer\r\n */\r\n\r\n/**\r\n * A slicer as used by {@link util.pool}.\r\n * @typedef PoolSlicer\r\n * @type {function}\r\n * @param {number} start Start offset\r\n * @param {number} end End offset\r\n * @returns {Uint8Array} Buffer slice\r\n * @this {Uint8Array}\r\n */\r\n\r\n/**\r\n * A general purpose buffer pool.\r\n * @memberof util\r\n * @function\r\n * @param {PoolAllocator} alloc Allocator\r\n * @param {PoolSlicer} slice Slicer\r\n * @param {number} [size=8192] Slab size\r\n * @returns {PoolAllocator} Pooled allocator\r\n */\r\nfunction pool(alloc, slice, size) {\r\n var SIZE = size || 8192;\r\n var MAX = SIZE >>> 1;\r\n var slab = null;\r\n var offset = SIZE;\r\n return function pool_alloc(size) {\r\n if (size < 1 || size > MAX)\r\n return alloc(size);\r\n if (offset + size > SIZE) {\r\n slab = alloc(SIZE);\r\n offset = 0;\r\n }\r\n var buf = slice.call(slab, offset, offset += size);\r\n if (offset & 7) // align to 32 bit\r\n offset = (offset | 7) + 1;\r\n return buf;\r\n };\r\n}\r\n","\"use strict\";\nmodule.exports = LongBits;\n\nvar util = require(\"../util/minimal\");\n\n/**\n * Constructs new long bits.\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\n * @memberof util\n * @constructor\n * @param {number} lo Low 32 bits, unsigned\n * @param {number} hi High 32 bits, unsigned\n */\nfunction LongBits(lo, hi) {\n\n // note that the casts below are theoretically unnecessary as of today, but older statically\n // generated converter code might still call the ctor with signed 32bits. kept for compat.\n\n /**\n * Low bits.\n * @type {number}\n */\n this.lo = lo >>> 0;\n\n /**\n * High bits.\n * @type {number}\n */\n this.hi = hi >>> 0;\n}\n\n/**\n * Zero bits.\n * @memberof util.LongBits\n * @type {util.LongBits}\n */\nvar zero = LongBits.zero = new LongBits(0, 0);\n\nzero.toNumber = function() { return 0; };\nzero.zzEncode = zero.zzDecode = function() { return this; };\nzero.length = function() { return 1; };\n\n/**\n * Zero hash.\n * @memberof util.LongBits\n * @type {string}\n */\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\n\n/**\n * Constructs new long bits from the specified number.\n * @param {number} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.fromNumber = function fromNumber(value) {\n if (value === 0)\n return zero;\n var sign = value < 0;\n if (sign)\n value = -value;\n var lo = value >>> 0,\n hi = (value - lo) / 4294967296 >>> 0;\n if (sign) {\n hi = ~hi >>> 0;\n lo = ~lo >>> 0;\n if (++lo > 4294967295) {\n lo = 0;\n if (++hi > 4294967295)\n hi = 0;\n }\n }\n return new LongBits(lo, hi);\n};\n\n/**\n * Constructs new long bits from a number, long or string.\n * @param {Long|number|string} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.from = function from(value) {\n if (typeof value === \"number\")\n return LongBits.fromNumber(value);\n if (util.isString(value)) {\n /* istanbul ignore else */\n if (util.Long)\n value = util.Long.fromString(value);\n else\n return LongBits.fromNumber(parseInt(value, 10));\n }\n return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\n};\n\n/**\n * Converts this long bits to a possibly unsafe JavaScript number.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {number} Possibly unsafe number\n */\nLongBits.prototype.toNumber = function toNumber(unsigned) {\n if (!unsigned && this.hi >>> 31) {\n var lo = ~this.lo + 1 >>> 0,\n hi = ~this.hi >>> 0;\n if (!lo)\n hi = hi + 1 >>> 0;\n return -(lo + hi * 4294967296);\n }\n return this.lo + this.hi * 4294967296;\n};\n\n/**\n * Converts this long bits to a long.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long} Long\n */\nLongBits.prototype.toLong = function toLong(unsigned) {\n return util.Long\n ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\n /* istanbul ignore next */\n : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\n};\n\nvar charCodeAt = String.prototype.charCodeAt;\n\n/**\n * Constructs new long bits from the specified 8 characters long hash.\n * @param {string} hash Hash\n * @returns {util.LongBits} Bits\n */\nLongBits.fromHash = function fromHash(hash) {\n if (hash === zeroHash)\n return zero;\n return new LongBits(\n ( charCodeAt.call(hash, 0)\n | charCodeAt.call(hash, 1) << 8\n | charCodeAt.call(hash, 2) << 16\n | charCodeAt.call(hash, 3) << 24) >>> 0\n ,\n ( charCodeAt.call(hash, 4)\n | charCodeAt.call(hash, 5) << 8\n | charCodeAt.call(hash, 6) << 16\n | charCodeAt.call(hash, 7) << 24) >>> 0\n );\n};\n\n/**\n * Converts this long bits to a 8 characters long hash.\n * @returns {string} Hash\n */\nLongBits.prototype.toHash = function toHash() {\n return String.fromCharCode(\n this.lo & 255,\n this.lo >>> 8 & 255,\n this.lo >>> 16 & 255,\n this.lo >>> 24 ,\n this.hi & 255,\n this.hi >>> 8 & 255,\n this.hi >>> 16 & 255,\n this.hi >>> 24\n );\n};\n\n/**\n * Zig-zag encodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzEncode = function zzEncode() {\n var mask = this.hi >> 31;\n this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\n this.lo = ( this.lo << 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Zig-zag decodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzDecode = function zzDecode() {\n var mask = -(this.lo & 1);\n this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\n this.hi = ( this.hi >>> 1 ^ mask) >>> 0;\n return this;\n};\n\n/**\n * Calculates the length of this longbits when encoded as a varint.\n * @returns {number} Length\n */\nLongBits.prototype.length = function length() {\n var part0 = this.lo,\n part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\n part2 = this.hi >>> 24;\n return part2 === 0\n ? part1 === 0\n ? part0 < 16384\n ? part0 < 128 ? 1 : 2\n : part0 < 2097152 ? 3 : 4\n : part1 < 16384\n ? part1 < 128 ? 5 : 6\n : part1 < 2097152 ? 7 : 8\n : part2 < 128 ? 9 : 10;\n};\n","\"use strict\";\nvar util = exports;\n\n// used to return a Promise where callback is omitted\nutil.asPromise = require(\"@protobufjs/aspromise\");\n\n// converts to / from base64 encoded strings\nutil.base64 = require(\"@protobufjs/base64\");\n\n// base class of rpc.Service\nutil.EventEmitter = require(\"@protobufjs/eventemitter\");\n\n// float handling accross browsers\nutil.float = require(\"@protobufjs/float\");\n\n// requires modules optionally and hides the call from bundlers\nutil.inquire = require(\"@protobufjs/inquire\");\n\n// converts to / from utf8 encoded strings\nutil.utf8 = require(\"@protobufjs/utf8\");\n\n// provides a node-like buffer pool in the browser\nutil.pool = require(\"@protobufjs/pool\");\n\n// utility to work with the low and high bits of a 64 bit value\nutil.LongBits = require(\"./longbits\");\n\n/**\n * Whether running within node or not.\n * @memberof util\n * @type {boolean}\n */\nutil.isNode = Boolean(typeof global !== \"undefined\"\n && global\n && global.process\n && global.process.versions\n && global.process.versions.node);\n\n/**\n * Global object reference.\n * @memberof util\n * @type {Object}\n */\nutil.global = util.isNode && global\n || typeof window !== \"undefined\" && window\n || typeof self !== \"undefined\" && self\n || this; // eslint-disable-line no-invalid-this\n\n/**\n * An immuable empty array.\n * @memberof util\n * @type {Array.<*>}\n * @const\n */\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\n\n/**\n * An immutable empty object.\n * @type {Object}\n * @const\n */\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\n\n/**\n * Tests if the specified value is an integer.\n * @function\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is an integer\n */\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\n return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\n};\n\n/**\n * Tests if the specified value is a string.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a string\n */\nutil.isString = function isString(value) {\n return typeof value === \"string\" || value instanceof String;\n};\n\n/**\n * Tests if the specified value is a non-null object.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a non-null object\n */\nutil.isObject = function isObject(value) {\n return value && typeof value === \"object\";\n};\n\n/**\n * Checks if a property on a message is considered to be present.\n * This is an alias of {@link util.isSet}.\n * @function\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isset =\n\n/**\n * Checks if a property on a message is considered to be present.\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isSet = function isSet(obj, prop) {\n var value = obj[prop];\n if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\n return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\n return false;\n};\n\n/**\n * Any compatible Buffer instance.\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\n * @interface Buffer\n * @extends Uint8Array\n */\n\n/**\n * Node's Buffer class if available.\n * @type {Constructor}\n */\nutil.Buffer = (function() {\n try {\n var Buffer = util.inquire(\"buffer\").Buffer;\n // refuse to use non-node buffers if not explicitly assigned (perf reasons):\n return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\n } catch (e) {\n /* istanbul ignore next */\n return null;\n }\n})();\n\n// Internal alias of or polyfull for Buffer.from.\nutil._Buffer_from = null;\n\n// Internal alias of or polyfill for Buffer.allocUnsafe.\nutil._Buffer_allocUnsafe = null;\n\n/**\n * Creates a new buffer of whatever type supported by the environment.\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\n * @returns {Uint8Array|Buffer} Buffer\n */\nutil.newBuffer = function newBuffer(sizeOrArray) {\n /* istanbul ignore next */\n return typeof sizeOrArray === \"number\"\n ? util.Buffer\n ? util._Buffer_allocUnsafe(sizeOrArray)\n : new util.Array(sizeOrArray)\n : util.Buffer\n ? util._Buffer_from(sizeOrArray)\n : typeof Uint8Array === \"undefined\"\n ? sizeOrArray\n : new Uint8Array(sizeOrArray);\n};\n\n/**\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\n * @type {Constructor}\n */\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\n\n/**\n * Any compatible Long instance.\n * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js.\n * @interface Long\n * @property {number} low Low bits\n * @property {number} high High bits\n * @property {boolean} unsigned Whether unsigned or not\n */\n\n/**\n * Long.js's Long class if available.\n * @type {Constructor}\n */\nutil.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\n || /* istanbul ignore next */ util.global.Long\n || util.inquire(\"long\");\n\n/**\n * Regular expression used to verify 2 bit (`bool`) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key2Re = /^true|false|0|1$/;\n\n/**\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\n\n/**\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\n\n/**\n * Converts a number or long to an 8 characters long hash string.\n * @param {Long|number} value Value to convert\n * @returns {string} Hash\n */\nutil.longToHash = function longToHash(value) {\n return value\n ? util.LongBits.from(value).toHash()\n : util.LongBits.zeroHash;\n};\n\n/**\n * Converts an 8 characters long hash string to a long or number.\n * @param {string} hash Hash\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long|number} Original value\n */\nutil.longFromHash = function longFromHash(hash, unsigned) {\n var bits = util.LongBits.fromHash(hash);\n if (util.Long)\n return util.Long.fromBits(bits.lo, bits.hi, unsigned);\n return bits.toNumber(Boolean(unsigned));\n};\n\n/**\n * Merges the properties of the source object into the destination object.\n * @memberof util\n * @param {Object.} dst Destination object\n * @param {Object.} src Source object\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\n * @returns {Object.} Destination object\n */\nfunction merge(dst, src, ifNotSet) { // used by converters\n for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\n if (dst[keys[i]] === undefined || !ifNotSet)\n dst[keys[i]] = src[keys[i]];\n return dst;\n}\n\nutil.merge = merge;\n\n/**\n * Converts the first character of a string to lower case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.lcFirst = function lcFirst(str) {\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\n/**\n * Creates a custom error constructor.\n * @memberof util\n * @param {string} name Error name\n * @returns {Constructor} Custom error constructor\n */\nfunction newError(name) {\n\n function CustomError(message, properties) {\n\n if (!(this instanceof CustomError))\n return new CustomError(message, properties);\n\n // Error.call(this, message);\n // ^ just returns a new error instance because the ctor can be called as a function\n\n Object.defineProperty(this, \"message\", { get: function() { return message; } });\n\n /* istanbul ignore next */\n if (Error.captureStackTrace) // node\n Error.captureStackTrace(this, CustomError);\n else\n Object.defineProperty(this, \"stack\", { value: new Error().stack || \"\" });\n\n if (properties)\n merge(this, properties);\n }\n\n CustomError.prototype = Object.create(Error.prototype, {\n constructor: {\n value: CustomError,\n writable: true,\n enumerable: false,\n configurable: true,\n },\n name: {\n get: function get() { return name; },\n set: undefined,\n enumerable: false,\n // configurable: false would accurately preserve the behavior of\n // the original, but I'm guessing that was not intentional.\n // For an actual error subclass, this property would\n // be configurable.\n configurable: true,\n },\n toString: {\n value: function value() { return this.name + \": \" + this.message; },\n writable: true,\n enumerable: false,\n configurable: true,\n },\n });\n\n return CustomError;\n}\n\nutil.newError = newError;\n\n/**\n * Constructs a new protocol error.\n * @classdesc Error subclass indicating a protocol specifc error.\n * @memberof util\n * @extends Error\n * @template T extends Message\n * @constructor\n * @param {string} message Error message\n * @param {Object.} [properties] Additional properties\n * @example\n * try {\n * MyMessage.decode(someBuffer); // throws if required fields are missing\n * } catch (e) {\n * if (e instanceof ProtocolError && e.instance)\n * console.log(\"decoded so far: \" + JSON.stringify(e.instance));\n * }\n */\nutil.ProtocolError = newError(\"ProtocolError\");\n\n/**\n * So far decoded message instance.\n * @name util.ProtocolError#instance\n * @type {Message}\n */\n\n/**\n * A OneOf getter as returned by {@link util.oneOfGetter}.\n * @typedef OneOfGetter\n * @type {function}\n * @returns {string|undefined} Set field name, if any\n */\n\n/**\n * Builds a getter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfGetter} Unbound getter\n */\nutil.oneOfGetter = function getOneOf(fieldNames) {\n var fieldMap = {};\n for (var i = 0; i < fieldNames.length; ++i)\n fieldMap[fieldNames[i]] = 1;\n\n /**\n * @returns {string|undefined} Set field name, if any\n * @this Object\n * @ignore\n */\n return function() { // eslint-disable-line consistent-return\n for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\n if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\n return keys[i];\n };\n};\n\n/**\n * A OneOf setter as returned by {@link util.oneOfSetter}.\n * @typedef OneOfSetter\n * @type {function}\n * @param {string|undefined} value Field name\n * @returns {undefined}\n */\n\n/**\n * Builds a setter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfSetter} Unbound setter\n */\nutil.oneOfSetter = function setOneOf(fieldNames) {\n\n /**\n * @param {string} name Field name\n * @returns {undefined}\n * @this Object\n * @ignore\n */\n return function(name) {\n for (var i = 0; i < fieldNames.length; ++i)\n if (fieldNames[i] !== name)\n delete this[fieldNames[i]];\n };\n};\n\n/**\n * Default conversion options used for {@link Message#toJSON} implementations.\n *\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\n *\n * - Longs become strings\n * - Enums become string keys\n * - Bytes become base64 encoded strings\n * - (Sub-)Messages become plain objects\n * - Maps become plain objects with all string keys\n * - Repeated fields become arrays\n * - NaN and Infinity for float and double fields become strings\n *\n * @type {IConversionOptions}\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\n */\nutil.toJSONOptions = {\n longs: String,\n enums: String,\n bytes: String,\n json: true\n};\n\n// Sets up buffer utility according to the environment (called in index-minimal)\nutil._configure = function() {\n var Buffer = util.Buffer;\n /* istanbul ignore if */\n if (!Buffer) {\n util._Buffer_from = util._Buffer_allocUnsafe = null;\n return;\n }\n // because node 4.x buffers are incompatible & immutable\n // see: https://github.com/dcodeIO/protobuf.js/pull/665\n util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\n /* istanbul ignore next */\n function Buffer_from(value, encoding) {\n return new Buffer(value, encoding);\n };\n util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\n /* istanbul ignore next */\n function Buffer_allocUnsafe(size) {\n return new Buffer(size);\n };\n};\n","\"use strict\";\nmodule.exports = Writer;\n\nvar util = require(\"./util/minimal\");\n\nvar BufferWriter; // cyclic\n\nvar LongBits = util.LongBits,\n base64 = util.base64,\n utf8 = util.utf8;\n\n/**\n * Constructs a new writer operation instance.\n * @classdesc Scheduled writer operation.\n * @constructor\n * @param {function(*, Uint8Array, number)} fn Function to call\n * @param {number} len Value byte length\n * @param {*} val Value to write\n * @ignore\n */\nfunction Op(fn, len, val) {\n\n /**\n * Function to call.\n * @type {function(Uint8Array, number, *)}\n */\n this.fn = fn;\n\n /**\n * Value byte length.\n * @type {number}\n */\n this.len = len;\n\n /**\n * Next operation.\n * @type {Writer.Op|undefined}\n */\n this.next = undefined;\n\n /**\n * Value to write.\n * @type {*}\n */\n this.val = val; // type varies\n}\n\n/* istanbul ignore next */\nfunction noop() {} // eslint-disable-line no-empty-function\n\n/**\n * Constructs a new writer state instance.\n * @classdesc Copied writer state.\n * @memberof Writer\n * @constructor\n * @param {Writer} writer Writer to copy state from\n * @ignore\n */\nfunction State(writer) {\n\n /**\n * Current head.\n * @type {Writer.Op}\n */\n this.head = writer.head;\n\n /**\n * Current tail.\n * @type {Writer.Op}\n */\n this.tail = writer.tail;\n\n /**\n * Current buffer length.\n * @type {number}\n */\n this.len = writer.len;\n\n /**\n * Next state.\n * @type {State|null}\n */\n this.next = writer.states;\n}\n\n/**\n * Constructs a new writer instance.\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n */\nfunction Writer() {\n\n /**\n * Current length.\n * @type {number}\n */\n this.len = 0;\n\n /**\n * Operations head.\n * @type {Object}\n */\n this.head = new Op(noop, 0, 0);\n\n /**\n * Operations tail\n * @type {Object}\n */\n this.tail = this.head;\n\n /**\n * Linked forked states.\n * @type {Object|null}\n */\n this.states = null;\n\n // When a value is written, the writer calculates its byte length and puts it into a linked\n // list of operations to perform when finish() is called. This both allows us to allocate\n // buffers of the exact required size and reduces the amount of work we have to do compared\n // to first calculating over objects and then encoding over objects. In our case, the encoding\n // part is just a linked list walk calling operations with already prepared values.\n}\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup() {\n return (Writer.create = function create_buffer() {\n return new BufferWriter();\n })();\n }\n /* istanbul ignore next */\n : function create_array() {\n return new Writer();\n };\n};\n\n/**\n * Creates a new writer.\n * @function\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\n */\nWriter.create = create();\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Uint8Array} Buffer\n */\nWriter.alloc = function alloc(size) {\n return new util.Array(size);\n};\n\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\n/* istanbul ignore else */\nif (util.Array !== Array)\n Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\n\n/**\n * Pushes a new operation to the queue.\n * @param {function(Uint8Array, number, *)} fn Function to call\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @returns {Writer} `this`\n * @private\n */\nWriter.prototype._push = function push(fn, len, val) {\n this.tail = this.tail.next = new Op(fn, len, val);\n this.len += len;\n return this;\n};\n\nfunction writeByte(val, buf, pos) {\n buf[pos] = val & 255;\n}\n\nfunction writeVarint32(val, buf, pos) {\n while (val > 127) {\n buf[pos++] = val & 127 | 128;\n val >>>= 7;\n }\n buf[pos] = val;\n}\n\n/**\n * Constructs a new varint writer operation instance.\n * @classdesc Scheduled varint writer operation.\n * @extends Op\n * @constructor\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @ignore\n */\nfunction VarintOp(len, val) {\n this.len = len;\n this.next = undefined;\n this.val = val;\n}\n\nVarintOp.prototype = Object.create(Op.prototype);\nVarintOp.prototype.fn = writeVarint32;\n\n/**\n * Writes an unsigned 32 bit value as a varint.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.uint32 = function write_uint32(value) {\n // here, the call to this.push has been inlined and a varint specific Op subclass is used.\n // uint32 is by far the most frequently used operation and benefits significantly from this.\n this.len += (this.tail = this.tail.next = new VarintOp(\n (value = value >>> 0)\n < 128 ? 1\n : value < 16384 ? 2\n : value < 2097152 ? 3\n : value < 268435456 ? 4\n : 5,\n value)).len;\n return this;\n};\n\n/**\n * Writes a signed 32 bit value as a varint.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.int32 = function write_int32(value) {\n return value < 0\n ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\n : this.uint32(value);\n};\n\n/**\n * Writes a 32 bit value as a varint, zig-zag encoded.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sint32 = function write_sint32(value) {\n return this.uint32((value << 1 ^ value >> 31) >>> 0);\n};\n\nfunction writeVarint64(val, buf, pos) {\n while (val.hi) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\n val.hi >>>= 7;\n }\n while (val.lo > 127) {\n buf[pos++] = val.lo & 127 | 128;\n val.lo = val.lo >>> 7;\n }\n buf[pos++] = val.lo;\n}\n\n/**\n * Writes an unsigned 64 bit value as a varint.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.uint64 = function write_uint64(value) {\n var bits = LongBits.from(value);\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a signed 64 bit value as a varint.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.int64 = Writer.prototype.uint64;\n\n/**\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sint64 = function write_sint64(value) {\n var bits = LongBits.from(value).zzEncode();\n return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a boolish value as a varint.\n * @param {boolean} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bool = function write_bool(value) {\n return this._push(writeByte, 1, value ? 1 : 0);\n};\n\nfunction writeFixed32(val, buf, pos) {\n buf[pos ] = val & 255;\n buf[pos + 1] = val >>> 8 & 255;\n buf[pos + 2] = val >>> 16 & 255;\n buf[pos + 3] = val >>> 24;\n}\n\n/**\n * Writes an unsigned 32 bit value as fixed 32 bits.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.fixed32 = function write_fixed32(value) {\n return this._push(writeFixed32, 4, value >>> 0);\n};\n\n/**\n * Writes a signed 32 bit value as fixed 32 bits.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\n\n/**\n * Writes an unsigned 64 bit value as fixed 64 bits.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.fixed64 = function write_fixed64(value) {\n var bits = LongBits.from(value);\n return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\n};\n\n/**\n * Writes a signed 64 bit value as fixed 64 bits.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\n\n/**\n * Writes a float (32 bit).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.float = function write_float(value) {\n return this._push(util.float.writeFloatLE, 4, value);\n};\n\n/**\n * Writes a double (64 bit float).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.double = function write_double(value) {\n return this._push(util.float.writeDoubleLE, 8, value);\n};\n\nvar writeBytes = util.Array.prototype.set\n ? function writeBytes_set(val, buf, pos) {\n buf.set(val, pos); // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytes_for(val, buf, pos) {\n for (var i = 0; i < val.length; ++i)\n buf[pos + i] = val[i];\n };\n\n/**\n * Writes a sequence of bytes.\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bytes = function write_bytes(value) {\n var len = value.length >>> 0;\n if (!len)\n return this._push(writeByte, 1, 0);\n if (util.isString(value)) {\n var buf = Writer.alloc(len = base64.length(value));\n base64.decode(value, buf, 0);\n value = buf;\n }\n return this.uint32(len)._push(writeBytes, len, value);\n};\n\n/**\n * Writes a string.\n * @param {string} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.string = function write_string(value) {\n var len = utf8.length(value);\n return len\n ? this.uint32(len)._push(utf8.write, len, value)\n : this._push(writeByte, 1, 0);\n};\n\n/**\n * Forks this writer's state by pushing it to a stack.\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\n * @returns {Writer} `this`\n */\nWriter.prototype.fork = function fork() {\n this.states = new State(this);\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n return this;\n};\n\n/**\n * Resets this instance to the last state.\n * @returns {Writer} `this`\n */\nWriter.prototype.reset = function reset() {\n if (this.states) {\n this.head = this.states.head;\n this.tail = this.states.tail;\n this.len = this.states.len;\n this.states = this.states.next;\n } else {\n this.head = this.tail = new Op(noop, 0, 0);\n this.len = 0;\n }\n return this;\n};\n\n/**\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\n * @returns {Writer} `this`\n */\nWriter.prototype.ldelim = function ldelim() {\n var head = this.head,\n tail = this.tail,\n len = this.len;\n this.reset().uint32(len);\n if (len) {\n this.tail.next = head.next; // skip noop\n this.tail = tail;\n this.len += len;\n }\n return this;\n};\n\n/**\n * Finishes the write operation.\n * @returns {Uint8Array} Finished buffer\n */\nWriter.prototype.finish = function finish() {\n var head = this.head.next, // skip noop\n buf = this.constructor.alloc(this.len),\n pos = 0;\n while (head) {\n head.fn(head.val, buf, pos);\n pos += head.len;\n head = head.next;\n }\n // this.head = this.tail = null;\n return buf;\n};\n\nWriter._configure = function(BufferWriter_) {\n BufferWriter = BufferWriter_;\n Writer.create = create();\n BufferWriter._configure();\n};\n","\"use strict\";\nmodule.exports = BufferWriter;\n\n// extends Writer\nvar Writer = require(\"./writer\");\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\n\nvar util = require(\"./util/minimal\");\n\n/**\n * Constructs a new buffer writer instance.\n * @classdesc Wire format writer using node buffers.\n * @extends Writer\n * @constructor\n */\nfunction BufferWriter() {\n Writer.call(this);\n}\n\nBufferWriter._configure = function () {\n /**\n * Allocates a buffer of the specified size.\n * @function\n * @param {number} size Buffer size\n * @returns {Buffer} Buffer\n */\n BufferWriter.alloc = util._Buffer_allocUnsafe;\n\n BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === \"set\"\n ? function writeBytesBuffer_set(val, buf, pos) {\n buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\n // also works for plain array values\n }\n /* istanbul ignore next */\n : function writeBytesBuffer_copy(val, buf, pos) {\n if (val.copy) // Buffer values\n val.copy(buf, pos, 0, val.length);\n else for (var i = 0; i < val.length;) // plain array values\n buf[pos++] = val[i++];\n };\n};\n\n\n/**\n * @override\n */\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\n if (util.isString(value))\n value = util._Buffer_from(value, \"base64\");\n var len = value.length >>> 0;\n this.uint32(len);\n if (len)\n this._push(BufferWriter.writeBytesBuffer, len, value);\n return this;\n};\n\nfunction writeStringBuffer(val, buf, pos) {\n if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\n util.utf8.write(val, buf, pos);\n else if (buf.utf8Write)\n buf.utf8Write(val, pos);\n else\n buf.write(val, pos);\n}\n\n/**\n * @override\n */\nBufferWriter.prototype.string = function write_string_buffer(value) {\n var len = util.Buffer.byteLength(value);\n this.uint32(len);\n if (len)\n this._push(writeStringBuffer, len, value);\n return this;\n};\n\n\n/**\n * Finishes the write operation.\n * @name BufferWriter#finish\n * @function\n * @returns {Buffer} Finished buffer\n */\n\nBufferWriter._configure();\n","\"use strict\";\nmodule.exports = Reader;\n\nvar util = require(\"./util/minimal\");\n\nvar BufferReader; // cyclic\n\nvar LongBits = util.LongBits,\n utf8 = util.utf8;\n\n/* istanbul ignore next */\nfunction indexOutOfRange(reader, writeLength) {\n return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\n}\n\n/**\n * Constructs a new reader instance using the specified buffer.\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n * @param {Uint8Array} buffer Buffer to read from\n */\nfunction Reader(buffer) {\n\n /**\n * Read buffer.\n * @type {Uint8Array}\n */\n this.buf = buffer;\n\n /**\n * Read buffer position.\n * @type {number}\n */\n this.pos = 0;\n\n /**\n * Read buffer length.\n * @type {number}\n */\n this.len = buffer.length;\n}\n\nvar create_array = typeof Uint8Array !== \"undefined\"\n ? function create_typed_array(buffer) {\n if (buffer instanceof Uint8Array || Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n }\n /* istanbul ignore next */\n : function create_array(buffer) {\n if (Array.isArray(buffer))\n return new Reader(buffer);\n throw Error(\"illegal buffer\");\n };\n\nvar create = function create() {\n return util.Buffer\n ? function create_buffer_setup(buffer) {\n return (Reader.create = function create_buffer(buffer) {\n return util.Buffer.isBuffer(buffer)\n ? new BufferReader(buffer)\n /* istanbul ignore next */\n : create_array(buffer);\n })(buffer);\n }\n /* istanbul ignore next */\n : create_array;\n};\n\n/**\n * Creates a new reader using the specified buffer.\n * @function\n * @param {Uint8Array|Buffer} buffer Buffer to read from\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\n * @throws {Error} If `buffer` is not a valid buffer\n */\nReader.create = create();\n\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\n\n/**\n * Reads a varint as an unsigned 32 bit value.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.uint32 = (function read_uint32_setup() {\n var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\n return function read_uint32() {\n value = ( this.buf[this.pos] & 127 ) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 7) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\n value = (value | (this.buf[this.pos] & 15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\n\n /* istanbul ignore if */\n if ((this.pos += 5) > this.len) {\n this.pos = this.len;\n throw indexOutOfRange(this, 10);\n }\n return value;\n };\n})();\n\n/**\n * Reads a varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.int32 = function read_int32() {\n return this.uint32() | 0;\n};\n\n/**\n * Reads a zig-zag encoded varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.sint32 = function read_sint32() {\n var value = this.uint32();\n return value >>> 1 ^ -(value & 1) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readLongVarint() {\n // tends to deopt with local vars for octet etc.\n var bits = new LongBits(0, 0);\n var i = 0;\n if (this.len - this.pos > 4) { // fast route (lo)\n for (; i < 4; ++i) {\n // 1st..4th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 5th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n i = 0;\n } else {\n for (; i < 3; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 1st..3th\n bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n // 4th\n bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\n return bits;\n }\n if (this.len - this.pos > 4) { // fast route (hi)\n for (; i < 5; ++i) {\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n } else {\n for (; i < 5; ++i) {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n // 6th..10th\n bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n if (this.buf[this.pos++] < 128)\n return bits;\n }\n }\n /* istanbul ignore next */\n throw Error(\"invalid varint encoding\");\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads a varint as a signed 64 bit value.\n * @name Reader#int64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as an unsigned 64 bit value.\n * @name Reader#uint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a zig-zag encoded varint as a signed 64 bit value.\n * @name Reader#sint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as a boolean.\n * @returns {boolean} Value read\n */\nReader.prototype.bool = function read_bool() {\n return this.uint32() !== 0;\n};\n\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\n return (buf[end - 4]\n | buf[end - 3] << 8\n | buf[end - 2] << 16\n | buf[end - 1] << 24) >>> 0;\n}\n\n/**\n * Reads fixed 32 bits as an unsigned 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.fixed32 = function read_fixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4);\n};\n\n/**\n * Reads fixed 32 bits as a signed 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.sfixed32 = function read_sfixed32() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n return readFixed32_end(this.buf, this.pos += 4) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readFixed64(/* this: Reader */) {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 8);\n\n return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads fixed 64 bits.\n * @name Reader#fixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads zig-zag encoded fixed 64 bits.\n * @name Reader#sfixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a float (32 bit) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.float = function read_float() {\n\n /* istanbul ignore if */\n if (this.pos + 4 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readFloatLE(this.buf, this.pos);\n this.pos += 4;\n return value;\n};\n\n/**\n * Reads a double (64 bit float) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.double = function read_double() {\n\n /* istanbul ignore if */\n if (this.pos + 8 > this.len)\n throw indexOutOfRange(this, 4);\n\n var value = util.float.readDoubleLE(this.buf, this.pos);\n this.pos += 8;\n return value;\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @returns {Uint8Array} Value read\n */\nReader.prototype.bytes = function read_bytes() {\n var length = this.uint32(),\n start = this.pos,\n end = this.pos + length;\n\n /* istanbul ignore if */\n if (end > this.len)\n throw indexOutOfRange(this, length);\n\n this.pos += length;\n if (Array.isArray(this.buf)) // plain array\n return this.buf.slice(start, end);\n\n if (start === end) { // fix for IE 10/Win8 and others' subarray returning array of size 1\n var nativeBuffer = util.Buffer;\n return nativeBuffer\n ? nativeBuffer.alloc(0)\n : new this.buf.constructor(0);\n }\n return this._slice.call(this.buf, start, end);\n};\n\n/**\n * Reads a string preceeded by its byte length as a varint.\n * @returns {string} Value read\n */\nReader.prototype.string = function read_string() {\n var bytes = this.bytes();\n return utf8.read(bytes, 0, bytes.length);\n};\n\n/**\n * Skips the specified number of bytes if specified, otherwise skips a varint.\n * @param {number} [length] Length if known, otherwise a varint is assumed\n * @returns {Reader} `this`\n */\nReader.prototype.skip = function skip(length) {\n if (typeof length === \"number\") {\n /* istanbul ignore if */\n if (this.pos + length > this.len)\n throw indexOutOfRange(this, length);\n this.pos += length;\n } else {\n do {\n /* istanbul ignore if */\n if (this.pos >= this.len)\n throw indexOutOfRange(this);\n } while (this.buf[this.pos++] & 128);\n }\n return this;\n};\n\n/**\n * Skips the next element of the specified wire type.\n * @param {number} wireType Wire type received\n * @returns {Reader} `this`\n */\nReader.prototype.skipType = function(wireType) {\n switch (wireType) {\n case 0:\n this.skip();\n break;\n case 1:\n this.skip(8);\n break;\n case 2:\n this.skip(this.uint32());\n break;\n case 3:\n while ((wireType = this.uint32() & 7) !== 4) {\n this.skipType(wireType);\n }\n break;\n case 5:\n this.skip(4);\n break;\n\n /* istanbul ignore next */\n default:\n throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\n }\n return this;\n};\n\nReader._configure = function(BufferReader_) {\n BufferReader = BufferReader_;\n Reader.create = create();\n BufferReader._configure();\n\n var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\n util.merge(Reader.prototype, {\n\n int64: function read_int64() {\n return readLongVarint.call(this)[fn](false);\n },\n\n uint64: function read_uint64() {\n return readLongVarint.call(this)[fn](true);\n },\n\n sint64: function read_sint64() {\n return readLongVarint.call(this).zzDecode()[fn](false);\n },\n\n fixed64: function read_fixed64() {\n return readFixed64.call(this)[fn](true);\n },\n\n sfixed64: function read_sfixed64() {\n return readFixed64.call(this)[fn](false);\n }\n\n });\n};\n","\"use strict\";\nmodule.exports = BufferReader;\n\n// extends Reader\nvar Reader = require(\"./reader\");\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\n\nvar util = require(\"./util/minimal\");\n\n/**\n * Constructs a new buffer reader instance.\n * @classdesc Wire format reader using node buffers.\n * @extends Reader\n * @constructor\n * @param {Buffer} buffer Buffer to read from\n */\nfunction BufferReader(buffer) {\n Reader.call(this, buffer);\n\n /**\n * Read buffer.\n * @name BufferReader#buf\n * @type {Buffer}\n */\n}\n\nBufferReader._configure = function () {\n /* istanbul ignore else */\n if (util.Buffer)\n BufferReader.prototype._slice = util.Buffer.prototype.slice;\n};\n\n\n/**\n * @override\n */\nBufferReader.prototype.string = function read_string_buffer() {\n var len = this.uint32(); // modifies pos\n return this.buf.utf8Slice\n ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len))\n : this.buf.toString(\"utf-8\", this.pos, this.pos = Math.min(this.pos + len, this.len));\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @name BufferReader#bytes\n * @function\n * @returns {Buffer} Value read\n */\n\nBufferReader._configure();\n","\"use strict\";\nmodule.exports = Service;\n\nvar util = require(\"../util/minimal\");\n\n// Extends EventEmitter\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\n\n/**\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\n *\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\n * @typedef rpc.ServiceMethodCallback\n * @template TRes extends Message\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {TRes} [response] Response message\n * @returns {undefined}\n */\n\n/**\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\n * @typedef rpc.ServiceMethod\n * @template TReq extends Message\n * @template TRes extends Message\n * @type {function}\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} [callback] Node-style callback called with the error, if any, and the response message\n * @returns {Promise>} Promise if `callback` has been omitted, otherwise `undefined`\n */\n\n/**\n * Constructs a new RPC service instance.\n * @classdesc An RPC service as returned by {@link Service#create}.\n * @exports rpc.Service\n * @extends util.EventEmitter\n * @constructor\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n */\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\n\n if (typeof rpcImpl !== \"function\")\n throw TypeError(\"rpcImpl must be a function\");\n\n util.EventEmitter.call(this);\n\n /**\n * RPC implementation. Becomes `null` once the service is ended.\n * @type {RPCImpl|null}\n */\n this.rpcImpl = rpcImpl;\n\n /**\n * Whether requests are length-delimited.\n * @type {boolean}\n */\n this.requestDelimited = Boolean(requestDelimited);\n\n /**\n * Whether responses are length-delimited.\n * @type {boolean}\n */\n this.responseDelimited = Boolean(responseDelimited);\n}\n\n/**\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\n * @param {Method|rpc.ServiceMethod} method Reflected or static method\n * @param {Constructor} requestCtor Request constructor\n * @param {Constructor} responseCtor Response constructor\n * @param {TReq|Properties} request Request message or plain object\n * @param {rpc.ServiceMethodCallback} callback Service callback\n * @returns {undefined}\n * @template TReq extends Message\n * @template TRes extends Message\n */\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\n\n if (!request)\n throw TypeError(\"request must be specified\");\n\n var self = this;\n if (!callback)\n return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\n\n if (!self.rpcImpl) {\n setTimeout(function() { callback(Error(\"already ended\")); }, 0);\n return undefined;\n }\n\n try {\n return self.rpcImpl(\n method,\n requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\n function rpcCallback(err, response) {\n\n if (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n\n if (response === null) {\n self.end(/* endedByRPC */ true);\n return undefined;\n }\n\n if (!(response instanceof responseCtor)) {\n try {\n response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\n } catch (err) {\n self.emit(\"error\", err, method);\n return callback(err);\n }\n }\n\n self.emit(\"data\", response, method);\n return callback(null, response);\n }\n );\n } catch (err) {\n self.emit(\"error\", err, method);\n setTimeout(function() { callback(err); }, 0);\n return undefined;\n }\n};\n\n/**\n * Ends this service and emits the `end` event.\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\n * @returns {rpc.Service} `this`\n */\nService.prototype.end = function end(endedByRPC) {\n if (this.rpcImpl) {\n if (!endedByRPC) // signal end to rpcImpl\n this.rpcImpl(null, null, null);\n this.rpcImpl = null;\n this.emit(\"end\").off();\n }\n return this;\n};\n","\"use strict\";\n\n/**\n * Streaming RPC helpers.\n * @namespace\n */\nvar rpc = exports;\n\n/**\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\n * @typedef RPCImpl\n * @type {function}\n * @param {Method|rpc.ServiceMethod,Message<{}>>} method Reflected or static method being called\n * @param {Uint8Array} requestData Request data\n * @param {RPCImplCallback} callback Callback function\n * @returns {undefined}\n * @example\n * function rpcImpl(method, requestData, callback) {\n * if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\n * throw Error(\"no such method\");\n * asynchronouslyObtainAResponse(requestData, function(err, responseData) {\n * callback(err, responseData);\n * });\n * }\n */\n\n/**\n * Node-style callback as used by {@link RPCImpl}.\n * @typedef RPCImplCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\n * @returns {undefined}\n */\n\nrpc.Service = require(\"./rpc/service\");\n","\"use strict\";\nmodule.exports = {};\n\n/**\n * Named roots.\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\n * Can also be used manually to make roots available across modules.\n * @name roots\n * @type {Object.}\n * @example\n * // pbjs -r myroot -o compiled.js ...\n *\n * // in another module:\n * require(\"./compiled.js\");\n *\n * // in any subsequent module:\n * var root = protobuf.roots[\"myroot\"];\n */\n","\"use strict\";\nvar protobuf = exports;\n\n/**\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\n * @name build\n * @type {string}\n * @const\n */\nprotobuf.build = \"minimal\";\n\n// Serialization\nprotobuf.Writer = require(\"./writer\");\nprotobuf.BufferWriter = require(\"./writer_buffer\");\nprotobuf.Reader = require(\"./reader\");\nprotobuf.BufferReader = require(\"./reader_buffer\");\n\n// Utility\nprotobuf.util = require(\"./util/minimal\");\nprotobuf.rpc = require(\"./rpc\");\nprotobuf.roots = require(\"./roots\");\nprotobuf.configure = configure;\n\n/* istanbul ignore next */\n/**\n * Reconfigures the library according to the environment.\n * @returns {undefined}\n */\nfunction configure() {\n protobuf.util._configure();\n protobuf.Writer._configure(protobuf.BufferWriter);\n protobuf.Reader._configure(protobuf.BufferReader);\n}\n\n// Set up buffer utility according to the environment\nconfigure();\n","// minimal library entry point.\n\n\"use strict\";\nmodule.exports = require(\"./src/index-minimal\");\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Metadata = void 0;\nexports.Metadata = function Metadata(init) {\n const data = new Map();\n const metadata = {\n set(key, value) {\n key = normalizeKey(key);\n if (Array.isArray(value)) {\n if (value.length === 0) {\n data.delete(key);\n }\n else {\n for (const item of value) {\n validate(key, item);\n }\n data.set(key, key.endsWith('-bin') ? value : [value.join(', ')]);\n }\n }\n else {\n validate(key, value);\n data.set(key, [value]);\n }\n return metadata;\n },\n append(key, value) {\n key = normalizeKey(key);\n validate(key, value);\n let values = data.get(key);\n if (values == null) {\n values = [];\n data.set(key, values);\n }\n values.push(value);\n if (!key.endsWith('-bin')) {\n data.set(key, [values.join(', ')]);\n }\n return metadata;\n },\n delete(key) {\n key = normalizeKey(key);\n data.delete(key);\n },\n get(key) {\n var _a;\n key = normalizeKey(key);\n return (_a = data.get(key)) === null || _a === void 0 ? void 0 : _a[0];\n },\n getAll(key) {\n var _a;\n key = normalizeKey(key);\n return ((_a = data.get(key)) !== null && _a !== void 0 ? _a : []);\n },\n has(key) {\n key = normalizeKey(key);\n return data.has(key);\n },\n [Symbol.iterator]() {\n return data[Symbol.iterator]();\n },\n };\n if (init != null) {\n const entries = isIterable(init) ? init : Object.entries(init);\n for (const [key, value] of entries) {\n metadata.set(key, value);\n }\n }\n return metadata;\n};\nfunction normalizeKey(key) {\n return key.toLowerCase();\n}\nfunction validate(key, value) {\n if (!/^[0-9a-z_.-]+$/.test(key)) {\n throw new Error(`Metadata key '${key}' contains illegal characters`);\n }\n if (key.endsWith('-bin')) {\n if (!(value instanceof Uint8Array)) {\n throw new Error(`Metadata key '${key}' ends with '-bin', thus it must have binary value`);\n }\n }\n else {\n if (typeof value !== 'string') {\n throw new Error(`Metadata key '${key}' doesn't end with '-bin', thus it must have string value`);\n }\n if (!/^[ -~]*$/.test(value)) {\n throw new Error(`Metadata value '${value}' of key '${key}' contains illegal characters`);\n }\n }\n}\nfunction isIterable(value) {\n return Symbol.iterator in value;\n}\n//# sourceMappingURL=Metadata.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Status = void 0;\n/**\n * gRPC status code.\n *\n * See https://grpc.github.io/grpc/core/md_doc_statuscodes.html.\n */\nvar Status;\n(function (Status) {\n /**\n * Not an error; returned on success.\n */\n Status[Status[\"OK\"] = 0] = \"OK\";\n /**\n * The operation was cancelled, typically by the caller.\n */\n Status[Status[\"CANCELLED\"] = 1] = \"CANCELLED\";\n /**\n * Unknown error.\n *\n * For example, this error may be returned when a `Status` value received from\n * another address space belongs to an error space that is not known in this\n * address space.\n *\n * Also errors raised by APIs that do not return enough error information may\n * be converted to this error.\n */\n Status[Status[\"UNKNOWN\"] = 2] = \"UNKNOWN\";\n /**\n * The client specified an invalid argument.\n *\n * Note that this differs from `FAILED_PRECONDITION`. `INVALID_ARGUMENT`\n * indicates arguments that are problematic regardless of the state of the\n * system (e.g., a malformed file name).\n */\n Status[Status[\"INVALID_ARGUMENT\"] = 3] = \"INVALID_ARGUMENT\";\n /**\n * The deadline expired before the operation could complete.\n *\n * For operations that change the state of the system, this error may be\n * returned even if the operation has completed successfully.\n *\n * For example, a successful response from a server could have been delayed\n * long enough for the deadline to expire.\n */\n Status[Status[\"DEADLINE_EXCEEDED\"] = 4] = \"DEADLINE_EXCEEDED\";\n /**\n * Some requested entity (e.g., file or directory) was not found.\n *\n * Note to server developers: if a request is denied for an entire class of\n * users, such as gradual feature rollout or undocumented allowlist,\n * `NOT_FOUND` may be used. If a request is denied for some users within a\n * class of users, such as user-based access control, `PERMISSION_DENIED` must\n * be used.\n */\n Status[Status[\"NOT_FOUND\"] = 5] = \"NOT_FOUND\";\n /**\n * The entity that a client attempted to create (e.g., file or directory)\n * already exists.\n */\n Status[Status[\"ALREADY_EXISTS\"] = 6] = \"ALREADY_EXISTS\";\n /**\n * The caller does not have permission to execute the specified operation.\n *\n * `PERMISSION_DENIED` must not be used for rejections caused by exhausting\n * some resource (use `RESOURCE_EXHAUSTED` instead for those errors).\n * `PERMISSION_DENIED` must not be used if the caller can not be identified\n * (use `UNAUTHENTICATED` instead for those errors).\n *\n * This error code does not imply the request is valid or the requested entity\n * exists or satisfies other pre-conditions.\n */\n Status[Status[\"PERMISSION_DENIED\"] = 7] = \"PERMISSION_DENIED\";\n /**\n * Some resource has been exhausted, perhaps a per-user quota, or perhaps the\n * entire file system is out of space.\n */\n Status[Status[\"RESOURCE_EXHAUSTED\"] = 8] = \"RESOURCE_EXHAUSTED\";\n /**\n * The operation was rejected because the system is not in a state required\n * for the operation's execution.\n *\n * For example, the directory to be deleted is non-empty, an rmdir operation\n * is applied to a non-directory, etc.\n *\n * Service implementors can use the following guidelines to decide between\n * `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`:\n *\n * (a) Use `UNAVAILABLE` if the client can retry just the failing call.\n * (b) Use `ABORTED` if the client should retry at a higher level (e.g.,\n * when a client-specified test-and-set fails, indicating the client\n * should restart a read-modify-write sequence).\n * (c) Use `FAILED_PRECONDITION` if the client should not retry until the\n * system state has been explicitly fixed. E.g., if an \"rmdir\" fails\n * because the directory is non-empty, `FAILED_PRECONDITION` should be\n * returned since the client should not retry unless the files are\n * deleted from the directory.\n */\n Status[Status[\"FAILED_PRECONDITION\"] = 9] = \"FAILED_PRECONDITION\";\n /**\n * The operation was aborted, typically due to a concurrency issue such as a\n * sequencer check failure or transaction abort.\n *\n * See the guidelines above for deciding between `FAILED_PRECONDITION`,\n * `ABORTED`, and `UNAVAILABLE`.\n */\n Status[Status[\"ABORTED\"] = 10] = \"ABORTED\";\n /**\n * The operation was attempted past the valid range.\n *\n * E.g., seeking or reading past end-of-file.\n *\n * Unlike `INVALID_ARGUMENT`, this error indicates a problem that may be fixed\n * if the system state changes. For example, a 32-bit file system will\n * generate `INVALID_ARGUMENT` if asked to read at an offset that is not in\n * the range [0,2^32-1], but it will generate `OUT_OF_RANGE` if asked to read\n * from an offset past the current file size.\n *\n * There is a fair bit of overlap between `FAILED_PRECONDITION` and\n * `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more specific error)\n * when it applies so that callers who are iterating through a space can\n * easily look for an `OUT_OF_RANGE` error to detect when they are done.\n */\n Status[Status[\"OUT_OF_RANGE\"] = 11] = \"OUT_OF_RANGE\";\n /**\n * The operation is not implemented or is not supported/enabled in this\n * service.\n */\n Status[Status[\"UNIMPLEMENTED\"] = 12] = \"UNIMPLEMENTED\";\n /**\n * Internal errors.\n *\n * This means that some invariants expected by the underlying system have been\n * broken. This error code is reserved for serious errors.\n */\n Status[Status[\"INTERNAL\"] = 13] = \"INTERNAL\";\n /**\n * The service is currently unavailable.\n *\n * This is most likely a transient condition, which can be corrected by\n * retrying with a backoff.\n *\n * Note that it is not always safe to retry non-idempotent operations.\n */\n Status[Status[\"UNAVAILABLE\"] = 14] = \"UNAVAILABLE\";\n /**\n * Unrecoverable data loss or corruption.\n */\n Status[Status[\"DATA_LOSS\"] = 15] = \"DATA_LOSS\";\n /**\n * The request does not have valid authentication credentials for the\n * operation.\n */\n Status[Status[\"UNAUTHENTICATED\"] = 16] = \"UNAUTHENTICATED\";\n})(Status = exports.Status || (exports.Status = {}));\n//# sourceMappingURL=Status.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=MethodDescriptor.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=CallOptions.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=ClientMiddleware.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.composeClientMiddleware = void 0;\nfunction composeClientMiddleware(middleware1, middleware2) {\n return (call, options) => {\n return middleware2(Object.assign(Object.assign({}, call), { next: (request, options2) => {\n return middleware1(Object.assign(Object.assign({}, call), { request }), options2);\n } }), options);\n };\n}\nexports.composeClientMiddleware = composeClientMiddleware;\n//# sourceMappingURL=composeClientMiddleware.js.map","\"use strict\";\nexports.__esModule = undefined;\nexports.__esModule = true;\n\n// Misc helpers\n\nvar objectSetPrototypeOfIsDefined = typeof Object.setPrototypeOf === \"function\";\nvar objectGetPrototypeOfIsDefined = typeof Object.getPrototypeOf === \"function\";\nvar objectDefinePropertyIsDefined = typeof Object.defineProperty === \"function\";\nvar objectCreateIsDefined = typeof Object.create === \"function\";\nvar objectHasOwnPropertyIsDefined =\n typeof Object.prototype.hasOwnProperty === \"function\";\n\nvar setPrototypeOf = function setPrototypeOf(target, prototype) {\n if (objectSetPrototypeOfIsDefined) {\n Object.setPrototypeOf(target, prototype);\n } else {\n target.__proto__ = prototype;\n }\n};\nexports.setPrototypeOf = setPrototypeOf;\n\nvar getPrototypeOf = function getPrototypeOf(target) {\n if (objectGetPrototypeOfIsDefined) {\n return Object.getPrototypeOf(target);\n } else {\n return target.__proto__ || target.prototype;\n }\n};\nexports.getPrototypeOf = getPrototypeOf;\n\n// Object.defineProperty exists in IE8, but the implementation is buggy, so we\n// need to test if the call fails, and, if so, set a flag to use the shim, as if\n// the function were not defined. When this error is caught the first time, the\n// function is called again recursively, after the flag is set, so the desired\n// effect is achieved anyway.\nvar ie8ObjectDefinePropertyBug = false;\nvar defineProperty = function defineProperty(target, name, propertyDescriptor) {\n if (objectDefinePropertyIsDefined && !ie8ObjectDefinePropertyBug) {\n try {\n Object.defineProperty(target, name, propertyDescriptor);\n } catch (e) {\n ie8ObjectDefinePropertyBug = true;\n defineProperty(target, name, propertyDescriptor);\n }\n } else {\n target[name] = propertyDescriptor.value;\n }\n};\nexports.defineProperty = defineProperty;\n\nvar hasOwnProperty = function hasOwnProperty(target, name) {\n if (objectHasOwnPropertyIsDefined) {\n return target.hasOwnProperty(target, name);\n } else {\n return target[name] === undefined;\n }\n};\nexports.hasOwnProperty = hasOwnProperty;\n\nvar objectCreate = function objectCreate(prototype, propertyDescriptors) {\n if (objectCreateIsDefined) {\n return Object.create(prototype, propertyDescriptors);\n } else {\n var F = function F() {};\n F.prototype = prototype;\n var result = new F();\n if (typeof propertyDescriptors === \"undefined\") {\n return result;\n }\n if (typeof propertyDescriptors === \"null\") {\n throw new Error(\"PropertyDescriptors must not be null.\");\n }\n if (typeof propertyDescriptors === \"object\") {\n for (var key in propertyDescriptors) {\n if (hasOwnProperty(propertyDescriptors, key)) {\n result[key] = propertyDescriptors[key].value;\n }\n }\n }\n\n return result;\n }\n};\nexports.objectCreate = objectCreate;\n","\"use strict\";\nexports.__esModule = undefined;\nexports.__esModule = true;\n\nvar helpers = require(\"./helpers\");\nvar setPrototypeOf = helpers.setPrototypeOf;\nvar getPrototypeOf = helpers.getPrototypeOf;\nvar defineProperty = helpers.defineProperty;\nvar objectCreate = helpers.objectCreate;\n\n// Small test for IE6-8, which checks if the environment prints errors \"nicely\"\n// If not, a toString() method to be added to the error objects with formatting\n// like in more modern browsers\nvar uglyErrorPrinting = new Error().toString() === \"[object Error]\";\n\n// For compatibility\nvar extendableErrorName = \"\";\n\nfunction ExtendableError(message) {\n // Get the constructor\n var originalConstructor = this.constructor;\n // Get the constructor name from the non-standard name property. If undefined\n // (on old IEs), it uses the string representation of the function to extract\n // the name. This should work in all cases, except for directly instantiated\n // ExtendableError objects, for which the name of the ExtendableError class /\n // function is used\n var constructorName =\n originalConstructor.name ||\n (function () {\n var constructorNameMatch = originalConstructor\n .toString()\n .match(/^function\\s*([^\\s(]+)/);\n return constructorNameMatch === null\n ? extendableErrorName\n ? extendableErrorName\n : \"Error\"\n : constructorNameMatch[1];\n })();\n // If the constructor name is \"Error\", ...\n var constructorNameIsError = constructorName === \"Error\";\n // change it to the name of the ExtendableError class / function\n var name = constructorNameIsError ? extendableErrorName : constructorName;\n\n // Obtain a new Error instance. This also sets the message property already.\n var instance = Error.apply(this, arguments);\n\n // Set the prototype of this to the prototype of instance\n setPrototypeOf(instance, getPrototypeOf(this));\n\n // On old IEs, the instance will not extend our subclasses this way. The fix is to use this from the function call instead.\n if (\n !(instance instanceof originalConstructor) ||\n !(instance instanceof ExtendableError)\n ) {\n var instance = this;\n Error.apply(this, arguments);\n defineProperty(instance, \"message\", {\n configurable: true,\n enumerable: false,\n value: message,\n writable: true,\n });\n }\n\n // define the name property\n defineProperty(instance, \"name\", {\n configurable: true,\n enumerable: false,\n value: name,\n writable: true,\n });\n\n // Use Error.captureStackTrace on V8 to capture the proper stack trace excluding any of our error classes\n if (Error.captureStackTrace) {\n // prettier-ignore\n Error.captureStackTrace(\n instance,\n constructorNameIsError ? ExtendableError : originalConstructor\n );\n }\n // instance.stack can still be undefined, in which case the best solution is to create a new Error object and get it from there\n if (instance.stack === undefined) {\n var err = new Error(message);\n err.name = instance.name;\n instance.stack = err.stack;\n }\n\n // If the environment does not have a proper string representation (IE), provide an alternative toString()\n if (uglyErrorPrinting) {\n defineProperty(instance, \"toString\", {\n configurable: true,\n enumerable: false,\n value: function toString() {\n return (\n (this.name || \"Error\") +\n (typeof this.message === \"undefined\" ? \"\" : \": \" + this.message)\n );\n },\n writable: true,\n });\n }\n\n // We're done!\n return instance;\n}\n\n// Get the name of the ExtendableError function or use the string literal\nextendableErrorName = ExtendableError.name || \"ExtendableError\";\n\n// Set the prototype of ExtendableError to an Error object\nExtendableError.prototype = objectCreate(Error.prototype, {\n constructor: {\n value: Error,\n enumerable: false,\n writable: true,\n configurable: true,\n },\n});\n\n// Export\nexports.ExtendableError = ExtendableError;\nexports[\"default\"] = exports.ExtendableError;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ClientError = void 0;\nconst ts_error_1 = require(\"ts-error\");\nconst Status_1 = require(\"../Status\");\n/**\n * Represents gRPC errors returned from client calls.\n */\nclass ClientError extends ts_error_1.ExtendableError {\n constructor(path, code, details) {\n super(`${path} ${Status_1.Status[code]}: ${details}`);\n this.path = path;\n this.code = code;\n this.details = details;\n this.name = 'ClientError';\n Object.defineProperty(this, '@@nice-grpc', {\n value: true,\n });\n Object.defineProperty(this, '@@nice-grpc:ClientError', {\n value: true,\n });\n }\n static [Symbol.hasInstance](instance) {\n // allow instances of ClientError from different versions of nice-grpc\n // to work with `instanceof ClientError`\n if (this !== ClientError) {\n return this.prototype.isPrototypeOf(instance);\n }\n return (typeof instance === 'object' &&\n instance !== null &&\n (instance.constructor === ClientError ||\n instance['@@nice-grpc:ClientError'] === true ||\n (instance.name === 'ClientError' && instance['@@nice-grpc'] === true)));\n }\n}\nexports.ClientError = ClientError;\n//# sourceMappingURL=ClientError.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=CallContext.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=ServerMiddleware.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.composeServerMiddleware = void 0;\nfunction composeServerMiddleware(middleware1, middleware2) {\n return (call, context) => {\n return middleware1(Object.assign(Object.assign({}, call), { next: (request, context1) => {\n return middleware2(Object.assign(Object.assign({}, call), { request }), context1);\n } }), context);\n };\n}\nexports.composeServerMiddleware = composeServerMiddleware;\n//# sourceMappingURL=composeServerMiddleware.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ServerError = void 0;\nconst ts_error_1 = require(\"ts-error\");\nconst Status_1 = require(\"../Status\");\n/**\n * Service implementations may throw this error to report gRPC errors to\n * clients.\n */\nclass ServerError extends ts_error_1.ExtendableError {\n constructor(code, details) {\n super(`${Status_1.Status[code]}: ${details}`);\n this.code = code;\n this.details = details;\n this.name = 'ServerError';\n Object.defineProperty(this, '@@nice-grpc', {\n value: true,\n });\n Object.defineProperty(this, '@@nice-grpc:ServerError', {\n value: true,\n });\n }\n static [Symbol.hasInstance](instance) {\n // allow instances of ServerError from different versions of nice-grpc\n // to work with `instanceof ServerError`\n if (this !== ServerError) {\n return this.prototype.isPrototypeOf(instance);\n }\n return (typeof instance === 'object' &&\n instance !== null &&\n (instance.constructor === ServerError ||\n instance['@@nice-grpc:ServerError'] === true ||\n (instance.name === 'ServerError' && instance['@@nice-grpc'] === true)));\n }\n}\nexports.ServerError = ServerError;\n//# sourceMappingURL=ServerError.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./Metadata\"), exports);\n__exportStar(require(\"./Status\"), exports);\n__exportStar(require(\"./MethodDescriptor\"), exports);\n__exportStar(require(\"./client/CallOptions\"), exports);\n__exportStar(require(\"./client/ClientMiddleware\"), exports);\n__exportStar(require(\"./client/composeClientMiddleware\"), exports);\n__exportStar(require(\"./client/ClientError\"), exports);\n__exportStar(require(\"./server/CallContext\"), exports);\n__exportStar(require(\"./server/ServerMiddleware\"), exports);\n__exportStar(require(\"./server/composeServerMiddleware\"), exports);\n__exportStar(require(\"./server/ServerError\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isGrpcWebServiceDefinition = exports.fromGrpcWebServiceDefinition = void 0;\nfunction fromGrpcWebServiceDefinition(definition) {\n const result = {};\n for (const [key, value] of Object.entries(definition)) {\n if (key === 'serviceName') {\n continue;\n }\n const method = value;\n result[uncapitalize(key)] = {\n path: `/${definition.serviceName}/${key}`,\n requestStream: method.requestStream,\n responseStream: method.responseStream,\n requestDeserialize: method.requestType.deserializeBinary,\n requestSerialize: (value) => value.serializeBinary(),\n responseDeserialize: method.responseType.deserializeBinary,\n responseSerialize: (value) => value.serializeBinary(),\n options: {},\n };\n }\n return result;\n}\nexports.fromGrpcWebServiceDefinition = fromGrpcWebServiceDefinition;\nfunction isGrpcWebServiceDefinition(definition) {\n return 'prototype' in definition;\n}\nexports.isGrpcWebServiceDefinition = isGrpcWebServiceDefinition;\nfunction uncapitalize(value) {\n if (value.length === 0) {\n return value;\n }\n return value[0].toLowerCase() + value.slice(1);\n}\n//# sourceMappingURL=grpc-web.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isTsProtoServiceDefinition = exports.fromTsProtoServiceDefinition = void 0;\nfunction fromTsProtoServiceDefinition(definition) {\n const result = {};\n for (const [key, method] of Object.entries(definition.methods)) {\n const requestEncode = method.requestType.encode;\n const requestFromPartial = method.requestType.fromPartial;\n const responseEncode = method.responseType.encode;\n const responseFromPartial = method.responseType.fromPartial;\n result[key] = {\n path: `/${definition.fullName}/${method.name}`,\n requestStream: method.requestStream,\n responseStream: method.responseStream,\n requestDeserialize: method.requestType.decode,\n requestSerialize: requestFromPartial != null\n ? value => requestEncode(requestFromPartial(value)).finish()\n : value => requestEncode(value).finish(),\n responseDeserialize: method.responseType.decode,\n responseSerialize: responseFromPartial != null\n ? value => responseEncode(responseFromPartial(value)).finish()\n : value => responseEncode(value).finish(),\n options: method.options,\n };\n }\n return result;\n}\nexports.fromTsProtoServiceDefinition = fromTsProtoServiceDefinition;\nfunction isTsProtoServiceDefinition(definition) {\n return ('name' in definition && 'fullName' in definition && 'methods' in definition);\n}\nexports.isTsProtoServiceDefinition = isTsProtoServiceDefinition;\n//# sourceMappingURL=ts-proto.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toGrpcWebMethodDefinition = exports.normalizeServiceDefinition = void 0;\nconst grpc_web_1 = require(\"./grpc-web\");\nconst ts_proto_1 = require(\"./ts-proto\");\n/** @internal */\nfunction normalizeServiceDefinition(definition) {\n if ((0, grpc_web_1.isGrpcWebServiceDefinition)(definition)) {\n return (0, grpc_web_1.fromGrpcWebServiceDefinition)(definition);\n }\n else if ((0, ts_proto_1.isTsProtoServiceDefinition)(definition)) {\n return (0, ts_proto_1.fromTsProtoServiceDefinition)(definition);\n }\n else {\n return definition;\n }\n}\nexports.normalizeServiceDefinition = normalizeServiceDefinition;\n/** @internal */\nfunction toGrpcWebMethodDefinition(definition) {\n const [, serviceName, methodName] = definition.path.split('/');\n return {\n service: {\n serviceName,\n },\n methodName,\n requestStream: definition.requestStream,\n responseStream: definition.responseStream,\n requestType: class {\n constructor() {\n throw new Error('Unexpected instantiation');\n }\n static deserializeBinary(bytes) {\n return definition.requestDeserialize(bytes);\n }\n },\n responseType: class {\n constructor() {\n throw new Error('Unexpected instantiation');\n }\n static deserializeBinary(bytes) {\n return definition.responseDeserialize(bytes);\n }\n },\n };\n}\nexports.toGrpcWebMethodDefinition = toGrpcWebMethodDefinition;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createChannel = void 0;\nfunction createChannel(address, transport) {\n return { address, transport };\n}\nexports.createChannel = createChannel;\n//# sourceMappingURL=channel.js.map","!function(e,t){if(\"object\"==typeof exports&&\"object\"==typeof module)module.exports=t();else if(\"function\"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)(\"object\"==typeof exports?exports:e)[n]=r[n]}}(this,(function(){return e={418:function(e,t){!function(e,t){for(var r in t)e[r]=t[r]}(t,function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\"a\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\"\",r(r.s=1)}([function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=r(3),o=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t={splitValues:!1});var r,o=this;this.headersMap={},e&&(\"undefined\"!=typeof Headers&&e instanceof Headers?n.getHeaderKeys(e).forEach((function(r){n.getHeaderValues(e,r).forEach((function(e){t.splitValues?o.append(r,n.splitHeaderValue(e)):o.append(r,e)}))})):\"object\"==typeof(r=e)&&\"object\"==typeof r.headersMap&&\"function\"==typeof r.forEach?e.forEach((function(e,t){o.append(e,t)})):\"undefined\"!=typeof Map&&e instanceof Map?e.forEach((function(e,t){o.append(t,e)})):\"string\"==typeof e?this.appendFromString(e):\"object\"==typeof e&&Object.getOwnPropertyNames(e).forEach((function(t){var r=e[t];Array.isArray(r)?r.forEach((function(e){o.append(t,e)})):o.append(t,r)})))}return e.prototype.appendFromString=function(e){for(var t=e.split(\"\\r\\n\"),r=0;r0){var s=n.substring(0,o).trim(),i=n.substring(o+1).trim();this.append(s,i)}}},e.prototype.delete=function(e,t){var r=n.normalizeName(e);if(void 0===t)delete this.headersMap[r];else{var o=this.headersMap[r];if(o){var s=o.indexOf(t);s>=0&&o.splice(s,1),0===o.length&&delete this.headersMap[r]}}},e.prototype.append=function(e,t){var r=this,o=n.normalizeName(e);Array.isArray(this.headersMap[o])||(this.headersMap[o]=[]),Array.isArray(t)?t.forEach((function(e){r.headersMap[o].push(n.normalizeValue(e))})):this.headersMap[o].push(n.normalizeValue(t))},e.prototype.set=function(e,t){var r=n.normalizeName(e);if(Array.isArray(t)){var o=[];t.forEach((function(e){o.push(n.normalizeValue(e))})),this.headersMap[r]=o}else this.headersMap[r]=[n.normalizeValue(t)]},e.prototype.has=function(e,t){var r=this.headersMap[n.normalizeName(e)];if(!Array.isArray(r))return!1;if(void 0!==t){var o=n.normalizeValue(t);return r.indexOf(o)>=0}return!0},e.prototype.get=function(e){var t=this.headersMap[n.normalizeName(e)];return void 0!==t?t.concat():[]},e.prototype.forEach=function(e){var t=this;Object.getOwnPropertyNames(this.headersMap).forEach((function(r){e(r,t.headersMap[r])}),this)},e.prototype.toHeaders=function(){if(\"undefined\"!=typeof Headers){var e=new Headers;return this.forEach((function(t,r){r.forEach((function(r){e.append(t,r)}))})),e}throw new Error(\"Headers class is not defined\")},e}();t.BrowserHeaders=o},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=r(0);t.BrowserHeaders=n.BrowserHeaders},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.iterateHeaders=function(e,t){for(var r=e[Symbol.iterator](),n=r.next();!n.done;)t(n.value[0]),n=r.next()},t.iterateHeadersKeys=function(e,t){for(var r=e.keys(),n=r.next();!n.done;)t(n.value),n=r.next()}},function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=r(2);t.normalizeName=function(e){if(\"string\"!=typeof e&&(e=String(e)),/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(e))throw new TypeError(\"Invalid character in header field name\");return e.toLowerCase()},t.normalizeValue=function(e){return\"string\"!=typeof e&&(e=String(e)),e},t.getHeaderValues=function(e,t){var r=e;if(r instanceof Headers&&r.getAll)return r.getAll(t);var n=r.get(t);return n&&\"string\"==typeof n?[n]:n},t.getHeaderKeys=function(e){var t=e,r={},o=[];return t.keys?n.iterateHeadersKeys(t,(function(e){r[e]||(r[e]=!0,o.push(e))})):t.forEach?t.forEach((function(e,t){r[t]||(r[t]=!0,o.push(t))})):n.iterateHeaders(t,(function(e){var t=e[0];r[t]||(r[t]=!0,o.push(t))})),o},t.splitHeaderValue=function(e){var t=[];return e.split(\", \").forEach((function(e){e.split(\",\").forEach((function(e){t.push(e)}))})),t}}]))},617:function(e,t,r){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.ChunkParser=t.ChunkType=t.encodeASCII=t.decodeASCII=void 0;var n,o=r(65);function s(e){return 9===(t=e)||10===t||13===t||e>=32&&e<=126;var t}function i(e){for(var t=0;t!==e.length;++t)if(!s(e[t]))throw new Error(\"Metadata is not valid (printable) ASCII\");return String.fromCharCode.apply(String,Array.prototype.slice.call(e))}function a(e){return 128==(128&e.getUint8(0))}function u(e){return e.getUint32(1,!1)}function d(e,t,r){return e.byteLength-t>=r}function c(e,t,r){if(e.slice)return e.slice(t,r);var n=e.length;void 0!==r&&(n=r);for(var o=new Uint8Array(n-t),s=0,i=t;i=0?r:s.httpStatusToCode(t);this.props.debug&&i.debug(\"onHeaders.code\",n);var o=e.get(\"grpc-message\")||[];if(this.props.debug&&i.debug(\"onHeaders.gRPCMessage\",o),this.rawOnHeaders(e),n!==s.Code.OK){var a=this.decodeGRPCStatus(o[0]);this.rawOnError(n,a,e)}}},e.prototype.onTransportChunk=function(e){var t=this;if(this.closed)this.props.debug&&i.debug(\"grpc.onChunk received after request was closed - ignoring\");else{var r=[];try{r=this.parser.parse(e)}catch(e){return this.props.debug&&i.debug(\"onChunk.parsing error\",e,e.message),void this.rawOnError(s.Code.Internal,\"parsing error: \"+e.message)}r.forEach((function(e){if(e.chunkType===o.ChunkType.MESSAGE){var r=t.methodDefinition.responseType.deserializeBinary(e.data);t.rawOnMessage(r)}else e.chunkType===o.ChunkType.TRAILERS&&(t.responseHeaders?(t.responseTrailers=new n.Metadata(e.trailers),t.props.debug&&i.debug(\"onChunk.trailers\",t.responseTrailers)):(t.responseHeaders=new n.Metadata(e.trailers),t.rawOnHeaders(t.responseHeaders)))}))}},e.prototype.onTransportEnd=function(){if(this.props.debug&&i.debug(\"grpc.onEnd\"),this.closed)this.props.debug&&i.debug(\"grpc.onEnd received after request was closed - ignoring\");else if(void 0!==this.responseTrailers){var e=c(this.responseTrailers);if(null!==e){var t=this.responseTrailers.get(\"grpc-message\"),r=this.decodeGRPCStatus(t[0]);this.rawOnEnd(e,r,this.responseTrailers)}else this.rawOnError(s.Code.Internal,\"Response closed without grpc-status (Trailers provided)\")}else{if(void 0===this.responseHeaders)return void this.rawOnError(s.Code.Unknown,\"Response closed without headers\");var n=c(this.responseHeaders),o=this.responseHeaders.get(\"grpc-message\");if(this.props.debug&&i.debug(\"grpc.headers only response \",n,o),null===n)return void this.rawOnEnd(s.Code.Unknown,\"Response closed without grpc-status (Headers only)\",this.responseHeaders);var a=this.decodeGRPCStatus(o[0]);this.rawOnEnd(n,a,this.responseHeaders)}},e.prototype.decodeGRPCStatus=function(e){if(!e)return\"\";try{return decodeURIComponent(e)}catch(t){return e}},e.prototype.rawOnEnd=function(e,t,r){var n=this;this.props.debug&&i.debug(\"rawOnEnd\",e,t,r),this.completed||(this.completed=!0,this.onEndCallbacks.forEach((function(o){if(!n.closed)try{o(e,t,r)}catch(e){setTimeout((function(){throw e}),0)}})))},e.prototype.rawOnHeaders=function(e){this.props.debug&&i.debug(\"rawOnHeaders\",e),this.completed||this.onHeadersCallbacks.forEach((function(t){try{t(e)}catch(e){setTimeout((function(){throw e}),0)}}))},e.prototype.rawOnError=function(e,t,r){var o=this;void 0===r&&(r=new n.Metadata),this.props.debug&&i.debug(\"rawOnError\",e,t),this.completed||(this.completed=!0,this.onEndCallbacks.forEach((function(n){if(!o.closed)try{n(e,t,r)}catch(e){setTimeout((function(){throw e}),0)}})))},e.prototype.rawOnMessage=function(e){var t=this;this.props.debug&&i.debug(\"rawOnMessage\",e.toObject()),this.completed||this.closed||this.onMessageCallbacks.forEach((function(r){if(!t.closed)try{r(e)}catch(e){setTimeout((function(){throw e}),0)}}))},e.prototype.onHeaders=function(e){this.onHeadersCallbacks.push(e)},e.prototype.onMessage=function(e){this.onMessageCallbacks.push(e)},e.prototype.onEnd=function(e){this.onEndCallbacks.push(e)},e.prototype.start=function(e){if(this.started)throw new Error(\"Client already started - cannot .start()\");this.started=!0;var t=new n.Metadata(e||{});t.set(\"content-type\",\"application/grpc-web+proto\"),t.set(\"x-grpc-web\",\"1\"),this.transport.start(t)},e.prototype.send=function(e){if(!this.started)throw new Error(\"Client not started - .start() must be called before .send()\");if(this.closed)throw new Error(\"Client already closed - cannot .send()\");if(this.finishedSending)throw new Error(\"Client already finished sending - cannot .send()\");if(!this.methodDefinition.requestStream&&this.sentFirstMessage)throw new Error(\"Message already sent for non-client-streaming method - cannot .send()\");this.sentFirstMessage=!0;var t=u.frameRequest(e);this.transport.sendMessage(t)},e.prototype.finishSend=function(){if(!this.started)throw new Error(\"Client not started - .finishSend() must be called before .close()\");if(this.closed)throw new Error(\"Client already closed - cannot .send()\");if(this.finishedSending)throw new Error(\"Client already finished sending - cannot .finishSend()\");this.finishedSending=!0,this.transport.finishSend()},e.prototype.close=function(){if(!this.started)throw new Error(\"Client not started - .start() must be called before .close()\");if(this.closed)throw new Error(\"Client already closed - cannot .close()\");this.closed=!0,this.props.debug&&i.debug(\"request.abort aborting request\"),this.transport.cancel()},e}();function c(e){var t=e.get(\"grpc-status\")||[];if(t.length>0)try{var r=t[0];return parseInt(r,10)}catch(e){return null}return null}},346:function(e,t){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.debug=void 0,t.debug=function(){for(var e=[],t=0;t=55296&&r<=56319){var n=e.charCodeAt(t+1);n>=56320&&n<=57343&&(r=65536+(r-55296<<10)+(n-56320))}return r}function p(e){for(var t=new Uint8Array(e.length),r=0,n=0;n {\n if (signal.aborted) {\n reject(new AbortError());\n return;\n }\n let removeAbortListener;\n let finished = false;\n function finish() {\n if (!finished) {\n finished = true;\n if (removeAbortListener != null) {\n removeAbortListener();\n }\n }\n }\n const callback = executor(value => {\n resolve(value);\n finish();\n }, reason => {\n reject(reason);\n finish();\n });\n if (!finished) {\n const listener = () => {\n const callbackResult = callback();\n if (callbackResult == null) {\n reject(new AbortError());\n }\n else {\n callbackResult.then(() => {\n reject(new AbortError());\n }, reason => {\n reject(reason);\n });\n }\n finish();\n };\n signal.addEventListener('abort', listener);\n removeAbortListener = () => {\n signal.removeEventListener('abort', listener);\n };\n }\n });\n}\n//# sourceMappingURL=execute.js.map","import { execute } from './execute';\n/**\n * Wrap a promise to reject with `AbortError` once `signal` is aborted.\n *\n * Useful to wrap non-abortable promises.\n * Note that underlying process will NOT be aborted.\n */\nexport function abortable(signal, promise) {\n if (signal.aborted) {\n // prevent unhandled rejection\n const noop = () => { };\n promise.then(noop, noop);\n }\n return execute(signal, (resolve, reject) => {\n promise.then(resolve, reject);\n return () => { };\n });\n}\n//# sourceMappingURL=abortable.js.map","import { execute } from './execute';\n/**\n * Returns a promise that fulfills after delay and rejects with\n * `AbortError` once `signal` is aborted.\n *\n * The delay time is specified as a `Date` object or as an integer denoting\n * milliseconds to wait.\n *\n * Example:\n *\n * // Make requests repeatedly with a delay between consecutive requests\n * while (true) {\n * await makeRequest(signal, params);\n * await delay(signal, 1000);\n * }\n *\n * Example:\n *\n * // Make requests repeatedly with a fixed interval\n * import {addMilliseconds} from 'date-fns';\n *\n * let date = new Date();\n *\n * while (true) {\n * await makeRequest(signal, params);\n *\n * date = addMilliseconds(date, 1000);\n * await delay(signal, date);\n * }\n */\nexport function delay(signal, dueTime) {\n return execute(signal, resolve => {\n const ms = typeof dueTime === 'number' ? dueTime : dueTime.getTime() - Date.now();\n const timer = setTimeout(resolve, ms);\n return () => {\n clearTimeout(timer);\n };\n });\n}\n//# sourceMappingURL=delay.js.map","import { execute } from './execute';\n/**\n * Return a promise that never fulfills and only rejects with `AbortError` once\n * `signal` is aborted.\n */\nexport function forever(signal) {\n return execute(signal, () => () => { });\n}\n//# sourceMappingURL=forever.js.map","import { execute } from './execute';\n/**\n * Returns a promise that fulfills when an event of specific type is emitted\n * from given event target and rejects with `AbortError` once `signal` is\n * aborted.\n *\n * Example:\n *\n * // Create a WebSocket and wait for connection\n * const webSocket = new WebSocket(url);\n *\n * const openEvent = await race(signal, signal => [\n * waitForEvent(signal, webSocket, 'open'),\n * waitForEvent(signal, webSocket, 'close').then(\n * event => {\n * throw new Error(`Failed to connect to ${url}: ${event.reason}`);\n * },\n * ),\n * ]);\n */\nexport function waitForEvent(signal, target, eventName, options) {\n return execute(signal, resolve => {\n let unlisten;\n let finished = false;\n const handler = (...args) => {\n resolve(args.length > 1 ? args : args[0]);\n finished = true;\n if (unlisten != null) {\n unlisten();\n }\n };\n unlisten = listen(target, eventName, handler, options);\n if (finished) {\n unlisten();\n }\n return () => {\n finished = true;\n if (unlisten != null) {\n unlisten();\n }\n };\n });\n}\nfunction listen(target, eventName, handler, options) {\n if (isEventTarget(target)) {\n target.addEventListener(eventName, handler, options);\n return () => target.removeEventListener(eventName, handler, options);\n }\n if (isJQueryStyleEventEmitter(target)) {\n target.on(eventName, handler);\n return () => target.off(eventName, handler);\n }\n if (isNodeStyleEventEmitter(target)) {\n target.addListener(eventName, handler);\n return () => target.removeListener(eventName, handler);\n }\n throw new Error('Invalid event target');\n}\nfunction isNodeStyleEventEmitter(sourceObj) {\n return (isFunction(sourceObj.addListener) && isFunction(sourceObj.removeListener));\n}\nfunction isJQueryStyleEventEmitter(sourceObj) {\n return isFunction(sourceObj.on) && isFunction(sourceObj.off);\n}\nfunction isEventTarget(sourceObj) {\n return (isFunction(sourceObj.addEventListener) &&\n isFunction(sourceObj.removeEventListener));\n}\nconst isFunction = (obj) => typeof obj === 'function';\n//# sourceMappingURL=waitForEvent.js.map","import { AbortError, isAbortError } from './AbortError';\nexport function all(signal, executor) {\n return new Promise((resolve, reject) => {\n if (signal.aborted) {\n reject(new AbortError());\n return;\n }\n const innerAbortController = new AbortController();\n const promises = executor(innerAbortController.signal);\n if (promises.length === 0) {\n resolve([]);\n return;\n }\n const abortListener = () => {\n innerAbortController.abort();\n };\n signal.addEventListener('abort', abortListener);\n let rejection;\n const results = new Array(promises.length);\n let settledCount = 0;\n function settled() {\n settledCount += 1;\n if (settledCount === promises.length) {\n signal.removeEventListener('abort', abortListener);\n if (rejection != null) {\n reject(rejection.reason);\n }\n else {\n resolve(results);\n }\n }\n }\n for (const [i, promise] of promises.entries()) {\n promise.then(value => {\n results[i] = value;\n settled();\n }, reason => {\n innerAbortController.abort();\n if (rejection == null ||\n (!isAbortError(reason) && isAbortError(rejection.reason))) {\n rejection = { reason };\n }\n settled();\n });\n }\n });\n}\n//# sourceMappingURL=all.js.map","import { AbortError, isAbortError } from './AbortError';\n/**\n * Abortable version of `Promise.race`.\n *\n * Creates new inner `AbortSignal` and passes it to `executor`. That signal is\n * aborted when `signal` is aborted or any of the promises returned from\n * `executor` are fulfilled or rejected.\n *\n * Returns a promise that fulfills or rejects when any of the promises returned\n * from `executor` are fulfilled or rejected, and rejects with `AbortError` when\n * `signal` is aborted.\n *\n * The promises returned from `executor` must be abortable, i.e. once\n * `innerSignal` is aborted, they must reject with `AbortError` either\n * immediately, or after doing any async cleanup.\n *\n * Example:\n *\n * const result = await race(signal, signal => [\n * delay(signal, 1000).then(() => ({status: 'timeout'})),\n * makeRequest(signal, params).then(value => ({status: 'success', value})),\n * ]);\n *\n * if (result.status === 'timeout') {\n * // request timed out\n * } else {\n * const response = result.value;\n * }\n */\nexport function race(signal, executor) {\n return new Promise((resolve, reject) => {\n if (signal.aborted) {\n reject(new AbortError());\n return;\n }\n const innerAbortController = new AbortController();\n const promises = executor(innerAbortController.signal);\n const abortListener = () => {\n innerAbortController.abort();\n };\n signal.addEventListener('abort', abortListener);\n let settledCount = 0;\n function settled(result) {\n innerAbortController.abort();\n settledCount += 1;\n if (settledCount === promises.length) {\n signal.removeEventListener('abort', abortListener);\n if (result.status === 'fulfilled') {\n resolve(result.value);\n }\n else {\n reject(result.reason);\n }\n }\n }\n let result;\n for (const promise of promises) {\n promise.then(value => {\n if (result == null) {\n result = { status: 'fulfilled', value };\n }\n settled(result);\n }, reason => {\n if (result == null ||\n (!isAbortError(reason) &&\n (result.status === 'fulfilled' || isAbortError(result.reason)))) {\n result = { status: 'rejected', reason };\n }\n settled(result);\n });\n }\n });\n}\n//# sourceMappingURL=race.js.map","import { delay } from './delay';\nimport { rethrowAbortError } from './AbortError';\n/**\n * Retry function with exponential backoff.\n *\n * The function receives AbortSignal, attempt number starting with 0, and reset\n * function that sets attempt number to -1 so that the next attempt will be\n * made without delay.\n */\nexport async function retry(signal, fn, options = {}) {\n const { baseMs = 1000, maxDelayMs = 30000, onError, maxAttempts = Infinity, } = options;\n let attempt = 0;\n const reset = () => {\n attempt = -1;\n };\n while (true) {\n try {\n return await fn(signal, attempt, reset);\n }\n catch (error) {\n rethrowAbortError(error);\n if (attempt >= maxAttempts) {\n throw error;\n }\n let delayMs;\n if (attempt === -1) {\n delayMs = 0;\n }\n else {\n // https://aws.amazon.com/ru/blogs/architecture/exponential-backoff-and-jitter/\n const backoff = Math.min(maxDelayMs, Math.pow(2, attempt) * baseMs);\n delayMs = Math.round((backoff * (1 + Math.random())) / 2);\n }\n if (onError) {\n onError(error, attempt, delayMs);\n }\n if (delayMs !== 0) {\n await delay(signal, delayMs);\n }\n attempt += 1;\n }\n }\n}\n//# sourceMappingURL=retry.js.map","import { AbortError, catchAbortError, isAbortError } from './AbortError';\n/**\n * Run an abortable function with `fork` and `defer` effects attached to it.\n *\n * `spawn` allows to write Go-style coroutines.\n *\n * Example:\n *\n * // Connect to a database, then start a server, then block until abort.\n * // On abort, gracefully shutdown the server, and once done, disconnect\n * // from the database.\n * spawn(signal, async (signal, {defer}) => {\n * const db = await connectToDb();\n *\n * defer(async () => {\n * await db.close();\n * });\n *\n * const server = await startServer(db);\n *\n * defer(async () => {\n * await server.close();\n * });\n *\n * await forever(signal);\n * });\n *\n * Example:\n *\n * // Connect to a database, then start an infinite polling loop.\n * // On abort, disconnect from the database.\n * spawn(signal, async (signal, {defer}) => {\n * const db = await connectToDb();\n *\n * defer(async () => {\n * await db.close();\n * });\n *\n * while (true) {\n * await poll(signal, db);\n * await delay(signal, 5000);\n * }\n * });\n *\n * Example:\n *\n * // Acquire a lock and execute a function.\n * // Extend the lock while the function is running.\n * // Once the function finishes or the signal is aborted, stop extending\n * // the lock and release it.\n * import Redlock = require('redlock');\n *\n * const lockTtl = 30_000;\n *\n * function withLock(\n * signal: AbortSignal,\n * redlock: Redlock,\n * key: string,\n * fn: (signal: AbortSignal) => Promise,\n * ): Promise {\n * return spawn(signal, async (signal, {fork, defer}) => {\n * const lock = await redlock.lock(key, lockTtl);\n *\n * defer(() => lock.unlock());\n * ​\n * fork(async signal => {\n * while (true) {\n * await delay(signal, lockTtl / 10);\n * await lock.extend(lockTtl);\n * }\n * });\n *\n * return await fn(signal);\n * });\n * }\n *\n * const redlock = new Redlock([redis], {\n * retryCount: -1,\n * });\n *\n * await withLock(signal, redlock, 'the-lock-key', async signal => {\n * // ...\n * });\n */\nexport function spawn(signal, fn) {\n if (signal.aborted) {\n return Promise.reject(new AbortError());\n }\n const deferredFunctions = [];\n /**\n * Aborted when spawned function finishes\n * or one of forked functions throws\n * or parent signal aborted.\n */\n const spawnAbortController = new AbortController();\n const spawnSignal = spawnAbortController.signal;\n const abortSpawn = () => {\n spawnAbortController.abort();\n };\n signal.addEventListener('abort', abortSpawn);\n const removeAbortListener = () => {\n signal.removeEventListener('abort', abortSpawn);\n };\n const tasks = new Set();\n const abortTasks = () => {\n for (const task of tasks) {\n task.abort();\n }\n };\n spawnSignal.addEventListener('abort', abortTasks);\n const removeSpawnAbortListener = () => {\n spawnSignal.removeEventListener('abort', abortTasks);\n };\n let promise = new Promise((resolve, reject) => {\n let result;\n let failure;\n fork(signal => fn(signal, {\n defer(fn) {\n deferredFunctions.push(fn);\n },\n fork,\n }))\n .join()\n .then(value => {\n spawnAbortController.abort();\n result = { value };\n }, error => {\n spawnAbortController.abort();\n if (!isAbortError(error) || failure == null) {\n failure = { error };\n }\n });\n function fork(forkFn) {\n if (spawnSignal.aborted) {\n // return already aborted task\n return {\n abort() { },\n async join() {\n throw new AbortError();\n },\n };\n }\n const taskAbortController = new AbortController();\n const taskSignal = taskAbortController.signal;\n const taskPromise = forkFn(taskSignal);\n const task = {\n abort() {\n taskAbortController.abort();\n },\n join: () => taskPromise,\n };\n tasks.add(task);\n taskPromise\n .catch(catchAbortError)\n .catch(error => {\n failure = { error };\n // error in forked function\n spawnAbortController.abort();\n })\n .finally(() => {\n tasks.delete(task);\n if (tasks.size === 0) {\n if (failure != null) {\n reject(failure.error);\n }\n else {\n resolve(result.value);\n }\n }\n });\n return task;\n }\n });\n promise = promise.finally(() => {\n removeAbortListener();\n removeSpawnAbortListener();\n let deferPromise = Promise.resolve();\n for (let i = deferredFunctions.length - 1; i >= 0; i--) {\n deferPromise = deferPromise.finally(deferredFunctions[i]);\n }\n return deferPromise;\n });\n return promise;\n}\n//# sourceMappingURL=spawn.js.map","import { catchAbortError } from './AbortError';\n/**\n * Invokes an abortable function with implicitly created `AbortSignal`.\n *\n * Returns a function that aborts that signal and waits until passed function\n * finishes.\n *\n * Any error other than `AbortError` thrown from passed function will result in\n * unhandled promise rejection.\n *\n * Example:\n *\n * const stop = run(async signal => {\n * try {\n * while (true) {\n * await delay(signal, 1000);\n * console.log('tick');\n * }\n * } finally {\n * await doCleanup();\n * }\n * });\n *\n * // abort and wait until cleanup is done\n * await stop();\n */\nexport function run(fn) {\n const abortController = new AbortController();\n const promise = fn(abortController.signal).catch(catchAbortError);\n return () => {\n abortController.abort();\n return promise;\n };\n}\n//# sourceMappingURL=run.js.map","import { isAbortError, catchAbortError } from './AbortError';\nimport { delay } from './delay';\nimport { execute } from './execute';\n/**\n * Proactively retry a function with exponential backoff.\n *\n * Also known as hedging.\n *\n * The function will be called multiple times in parallel until it succeeds, in\n * which case all the other calls will be aborted.\n */\nexport function proactiveRetry(signal, fn, options = {}) {\n const { baseMs = 1000, onError, maxAttempts = Infinity } = options;\n return execute(signal, (resolve, reject) => {\n const innerAbortController = new AbortController();\n let attemptsExhausted = false;\n const promises = new Map();\n function handleFulfilled(value) {\n innerAbortController.abort();\n promises.clear();\n resolve(value);\n }\n function handleRejected(err, attempt) {\n promises.delete(attempt);\n if (attemptsExhausted && promises.size === 0) {\n reject(err);\n return;\n }\n if (isAbortError(err)) {\n return;\n }\n if (onError) {\n try {\n onError(err, attempt);\n }\n catch (err) {\n innerAbortController.abort();\n promises.clear();\n reject(err);\n }\n }\n }\n async function makeAttempts(signal) {\n for (let attempt = 0;; attempt++) {\n const promise = fn(signal, attempt);\n promises.set(attempt, promise);\n promise.then(handleFulfilled, err => handleRejected(err, attempt));\n if (attempt + 1 >= maxAttempts) {\n break;\n }\n // https://aws.amazon.com/ru/blogs/architecture/exponential-backoff-and-jitter/\n const backoff = Math.pow(2, attempt) * baseMs;\n const delayMs = Math.round((backoff * (1 + Math.random())) / 2);\n await delay(signal, delayMs);\n }\n attemptsExhausted = true;\n }\n makeAttempts(innerAbortController.signal).catch(catchAbortError);\n return () => {\n innerAbortController.abort();\n };\n });\n}\n//# sourceMappingURL=proactiveRetry.js.map","\"use strict\";\n// borrowed from IxJS\n// https://github.com/ReactiveX/IxJS/blob/v4.5.1/src/asynciterable/asyncsink.ts\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AsyncSink = void 0;\nconst ARRAY_VALUE = 'value';\nconst ARRAY_ERROR = 'error';\nclass AsyncSink {\n constructor() {\n this._ended = false;\n this._values = [];\n this._resolvers = [];\n }\n [Symbol.asyncIterator]() {\n return this;\n }\n write(value) {\n this._push({ type: ARRAY_VALUE, value });\n }\n error(error) {\n this._push({ type: ARRAY_ERROR, error });\n }\n _push(item) {\n if (this._ended) {\n throw new Error('AsyncSink already ended');\n }\n if (this._resolvers.length > 0) {\n const { resolve, reject } = this._resolvers.shift();\n if (item.type === ARRAY_ERROR) {\n reject(item.error);\n }\n else {\n resolve({ done: false, value: item.value });\n }\n }\n else {\n this._values.push(item);\n }\n }\n next() {\n if (this._values.length > 0) {\n const { type, value, error } = this._values.shift();\n if (type === ARRAY_ERROR) {\n return Promise.reject(error);\n }\n else {\n return Promise.resolve({ done: false, value });\n }\n }\n if (this._ended) {\n return Promise.resolve({ done: true });\n }\n return new Promise((resolve, reject) => {\n this._resolvers.push({ resolve, reject });\n });\n }\n end() {\n while (this._resolvers.length > 0) {\n this._resolvers.shift().resolve({ done: true });\n }\n this._ended = true;\n }\n}\nexports.AsyncSink = AsyncSink;\n//# sourceMappingURL=AsyncSink.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isAsyncIterable = void 0;\n/** @internal */\nfunction isAsyncIterable(value) {\n return value != null && Symbol.asyncIterator in value;\n}\nexports.isAsyncIterable = isAsyncIterable;\n//# sourceMappingURL=isAsyncIterable.js.map","//\n// THIS FILE IS AUTOMATICALLY GENERATED! DO NOT EDIT BY HAND!\n//\n;\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n ? module.exports = factory()\n : typeof define === 'function' && define.amd\n ? define(factory) :\n // cf. https://github.com/dankogai/js-base64/issues/119\n (function () {\n // existing version for noConflict()\n var _Base64 = global.Base64;\n var gBase64 = factory();\n gBase64.noConflict = function () {\n global.Base64 = _Base64;\n return gBase64;\n };\n if (global.Meteor) { // Meteor.js\n Base64 = gBase64;\n }\n global.Base64 = gBase64;\n })();\n}((typeof self !== 'undefined' ? self\n : typeof window !== 'undefined' ? window\n : typeof global !== 'undefined' ? global\n : this), function () {\n 'use strict';\n /**\n * base64.ts\n *\n * Licensed under the BSD 3-Clause License.\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * References:\n * http://en.wikipedia.org/wiki/Base64\n *\n * @author Dan Kogai (https://github.com/dankogai)\n */\n var version = '3.7.5';\n /**\n * @deprecated use lowercase `version`.\n */\n var VERSION = version;\n var _hasatob = typeof atob === 'function';\n var _hasbtoa = typeof btoa === 'function';\n var _hasBuffer = typeof Buffer === 'function';\n var _TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined;\n var _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;\n var b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n var b64chs = Array.prototype.slice.call(b64ch);\n var b64tab = (function (a) {\n var tab = {};\n a.forEach(function (c, i) { return tab[c] = i; });\n return tab;\n })(b64chs);\n var b64re = /^(?:[A-Za-z\\d+\\/]{4})*?(?:[A-Za-z\\d+\\/]{2}(?:==)?|[A-Za-z\\d+\\/]{3}=?)?$/;\n var _fromCC = String.fromCharCode.bind(String);\n var _U8Afrom = typeof Uint8Array.from === 'function'\n ? Uint8Array.from.bind(Uint8Array)\n : function (it) { return new Uint8Array(Array.prototype.slice.call(it, 0)); };\n var _mkUriSafe = function (src) { return src\n .replace(/=/g, '').replace(/[+\\/]/g, function (m0) { return m0 == '+' ? '-' : '_'; }); };\n var _tidyB64 = function (s) { return s.replace(/[^A-Za-z0-9\\+\\/]/g, ''); };\n /**\n * polyfill version of `btoa`\n */\n var btoaPolyfill = function (bin) {\n // console.log('polyfilled');\n var u32, c0, c1, c2, asc = '';\n var pad = bin.length % 3;\n for (var i = 0; i < bin.length;) {\n if ((c0 = bin.charCodeAt(i++)) > 255 ||\n (c1 = bin.charCodeAt(i++)) > 255 ||\n (c2 = bin.charCodeAt(i++)) > 255)\n throw new TypeError('invalid character found');\n u32 = (c0 << 16) | (c1 << 8) | c2;\n asc += b64chs[u32 >> 18 & 63]\n + b64chs[u32 >> 12 & 63]\n + b64chs[u32 >> 6 & 63]\n + b64chs[u32 & 63];\n }\n return pad ? asc.slice(0, pad - 3) + \"===\".substring(pad) : asc;\n };\n /**\n * does what `window.btoa` of web browsers do.\n * @param {String} bin binary string\n * @returns {string} Base64-encoded string\n */\n var _btoa = _hasbtoa ? function (bin) { return btoa(bin); }\n : _hasBuffer ? function (bin) { return Buffer.from(bin, 'binary').toString('base64'); }\n : btoaPolyfill;\n var _fromUint8Array = _hasBuffer\n ? function (u8a) { return Buffer.from(u8a).toString('base64'); }\n : function (u8a) {\n // cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326\n var maxargs = 0x1000;\n var strs = [];\n for (var i = 0, l = u8a.length; i < l; i += maxargs) {\n strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));\n }\n return _btoa(strs.join(''));\n };\n /**\n * converts a Uint8Array to a Base64 string.\n * @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5\n * @returns {string} Base64 string\n */\n var fromUint8Array = function (u8a, urlsafe) {\n if (urlsafe === void 0) { urlsafe = false; }\n return urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);\n };\n // This trick is found broken https://github.com/dankogai/js-base64/issues/130\n // const utob = (src: string) => unescape(encodeURIComponent(src));\n // reverting good old fationed regexp\n var cb_utob = function (c) {\n if (c.length < 2) {\n var cc = c.charCodeAt(0);\n return cc < 0x80 ? c\n : cc < 0x800 ? (_fromCC(0xc0 | (cc >>> 6))\n + _fromCC(0x80 | (cc & 0x3f)))\n : (_fromCC(0xe0 | ((cc >>> 12) & 0x0f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n else {\n var cc = 0x10000\n + (c.charCodeAt(0) - 0xD800) * 0x400\n + (c.charCodeAt(1) - 0xDC00);\n return (_fromCC(0xf0 | ((cc >>> 18) & 0x07))\n + _fromCC(0x80 | ((cc >>> 12) & 0x3f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n };\n var re_utob = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFFF]|[^\\x00-\\x7F]/g;\n /**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-8 string\n * @returns {string} UTF-16 string\n */\n var utob = function (u) { return u.replace(re_utob, cb_utob); };\n //\n var _encode = _hasBuffer\n ? function (s) { return Buffer.from(s, 'utf8').toString('base64'); }\n : _TE\n ? function (s) { return _fromUint8Array(_TE.encode(s)); }\n : function (s) { return _btoa(utob(s)); };\n /**\n * converts a UTF-8-encoded string to a Base64 string.\n * @param {boolean} [urlsafe] if `true` make the result URL-safe\n * @returns {string} Base64 string\n */\n var encode = function (src, urlsafe) {\n if (urlsafe === void 0) { urlsafe = false; }\n return urlsafe\n ? _mkUriSafe(_encode(src))\n : _encode(src);\n };\n /**\n * converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5.\n * @returns {string} Base64 string\n */\n var encodeURI = function (src) { return encode(src, true); };\n // This trick is found broken https://github.com/dankogai/js-base64/issues/130\n // const btou = (src: string) => decodeURIComponent(escape(src));\n // reverting good old fationed regexp\n var re_btou = /[\\xC0-\\xDF][\\x80-\\xBF]|[\\xE0-\\xEF][\\x80-\\xBF]{2}|[\\xF0-\\xF7][\\x80-\\xBF]{3}/g;\n var cb_btou = function (cccc) {\n switch (cccc.length) {\n case 4:\n var cp = ((0x07 & cccc.charCodeAt(0)) << 18)\n | ((0x3f & cccc.charCodeAt(1)) << 12)\n | ((0x3f & cccc.charCodeAt(2)) << 6)\n | (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000;\n return (_fromCC((offset >>> 10) + 0xD800)\n + _fromCC((offset & 0x3FF) + 0xDC00));\n case 3:\n return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12)\n | ((0x3f & cccc.charCodeAt(1)) << 6)\n | (0x3f & cccc.charCodeAt(2)));\n default:\n return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6)\n | (0x3f & cccc.charCodeAt(1)));\n }\n };\n /**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-16 string\n * @returns {string} UTF-8 string\n */\n var btou = function (b) { return b.replace(re_btou, cb_btou); };\n /**\n * polyfill version of `atob`\n */\n var atobPolyfill = function (asc) {\n // console.log('polyfilled');\n asc = asc.replace(/\\s+/g, '');\n if (!b64re.test(asc))\n throw new TypeError('malformed base64.');\n asc += '=='.slice(2 - (asc.length & 3));\n var u24, bin = '', r1, r2;\n for (var i = 0; i < asc.length;) {\n u24 = b64tab[asc.charAt(i++)] << 18\n | b64tab[asc.charAt(i++)] << 12\n | (r1 = b64tab[asc.charAt(i++)]) << 6\n | (r2 = b64tab[asc.charAt(i++)]);\n bin += r1 === 64 ? _fromCC(u24 >> 16 & 255)\n : r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255)\n : _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255);\n }\n return bin;\n };\n /**\n * does what `window.atob` of web browsers do.\n * @param {String} asc Base64-encoded string\n * @returns {string} binary string\n */\n var _atob = _hasatob ? function (asc) { return atob(_tidyB64(asc)); }\n : _hasBuffer ? function (asc) { return Buffer.from(asc, 'base64').toString('binary'); }\n : atobPolyfill;\n //\n var _toUint8Array = _hasBuffer\n ? function (a) { return _U8Afrom(Buffer.from(a, 'base64')); }\n : function (a) { return _U8Afrom(_atob(a).split('').map(function (c) { return c.charCodeAt(0); })); };\n /**\n * converts a Base64 string to a Uint8Array.\n */\n var toUint8Array = function (a) { return _toUint8Array(_unURI(a)); };\n //\n var _decode = _hasBuffer\n ? function (a) { return Buffer.from(a, 'base64').toString('utf8'); }\n : _TD\n ? function (a) { return _TD.decode(_toUint8Array(a)); }\n : function (a) { return btou(_atob(a)); };\n var _unURI = function (a) { return _tidyB64(a.replace(/[-_]/g, function (m0) { return m0 == '-' ? '+' : '/'; })); };\n /**\n * converts a Base64 string to a UTF-8 string.\n * @param {String} src Base64 string. Both normal and URL-safe are supported\n * @returns {string} UTF-8 string\n */\n var decode = function (src) { return _decode(_unURI(src)); };\n /**\n * check if a value is a valid Base64 string\n * @param {String} src a value to check\n */\n var isValid = function (src) {\n if (typeof src !== 'string')\n return false;\n var s = src.replace(/\\s+/g, '').replace(/={0,2}$/, '');\n return !/[^\\s0-9a-zA-Z\\+/]/.test(s) || !/[^\\s0-9a-zA-Z\\-_]/.test(s);\n };\n //\n var _noEnum = function (v) {\n return {\n value: v, enumerable: false, writable: true, configurable: true\n };\n };\n /**\n * extend String.prototype with relevant methods\n */\n var extendString = function () {\n var _add = function (name, body) { return Object.defineProperty(String.prototype, name, _noEnum(body)); };\n _add('fromBase64', function () { return decode(this); });\n _add('toBase64', function (urlsafe) { return encode(this, urlsafe); });\n _add('toBase64URI', function () { return encode(this, true); });\n _add('toBase64URL', function () { return encode(this, true); });\n _add('toUint8Array', function () { return toUint8Array(this); });\n };\n /**\n * extend Uint8Array.prototype with relevant methods\n */\n var extendUint8Array = function () {\n var _add = function (name, body) { return Object.defineProperty(Uint8Array.prototype, name, _noEnum(body)); };\n _add('toBase64', function (urlsafe) { return fromUint8Array(this, urlsafe); });\n _add('toBase64URI', function () { return fromUint8Array(this, true); });\n _add('toBase64URL', function () { return fromUint8Array(this, true); });\n };\n /**\n * extend Builtin prototypes with relevant methods\n */\n var extendBuiltins = function () {\n extendString();\n extendUint8Array();\n };\n var gBase64 = {\n version: version,\n VERSION: VERSION,\n atob: _atob,\n atobPolyfill: atobPolyfill,\n btoa: _btoa,\n btoaPolyfill: btoaPolyfill,\n fromBase64: decode,\n toBase64: encode,\n encode: encode,\n encodeURI: encodeURI,\n encodeURL: encodeURI,\n utob: utob,\n btou: btou,\n decode: decode,\n isValid: isValid,\n fromUint8Array: fromUint8Array,\n toUint8Array: toUint8Array,\n extendString: extendString,\n extendUint8Array: extendUint8Array,\n extendBuiltins: extendBuiltins\n };\n //\n // export Base64 to the namespace\n //\n // ES5 is yet to have Object.assign() that may make transpilers unhappy.\n // gBase64.Base64 = Object.assign({}, gBase64);\n gBase64.Base64 = {};\n Object.keys(gBase64).forEach(function (k) { return gBase64.Base64[k] = gBase64[k]; });\n return gBase64;\n}));\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.convertMetadataFromGrpcWeb = exports.convertMetadataToGrpcWeb = void 0;\nconst grpc_web_1 = require(\"@improbable-eng/grpc-web\");\nconst nice_grpc_common_1 = require(\"nice-grpc-common\");\nconst js_base64_1 = require(\"js-base64\");\nfunction convertMetadataToGrpcWeb(metadata) {\n const grpcMetadata = new grpc_web_1.grpc.Metadata();\n for (const [key, values] of metadata) {\n for (const value of values) {\n grpcMetadata.append(key, typeof value === 'string' ? value : js_base64_1.Base64.fromUint8Array(value));\n }\n }\n return grpcMetadata;\n}\nexports.convertMetadataToGrpcWeb = convertMetadataToGrpcWeb;\nfunction convertMetadataFromGrpcWeb(grpcMetadata) {\n const metadata = (0, nice_grpc_common_1.Metadata)();\n for (const [key, values] of Object.entries(grpcMetadata.headersMap)) {\n if (key.endsWith('-bin')) {\n for (const value of values) {\n for (const item of value.split(/,\\s?/)) {\n metadata.append(key, js_base64_1.Base64.toUint8Array(item));\n }\n }\n }\n else {\n metadata.set(key, values);\n }\n }\n return metadata;\n}\nexports.convertMetadataFromGrpcWeb = convertMetadataFromGrpcWeb;\n//# sourceMappingURL=convertMetadata.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createBidiStreamingMethod = void 0;\nconst nice_grpc_common_1 = require(\"nice-grpc-common\");\nconst grpc_web_1 = require(\"@improbable-eng/grpc-web\");\nconst abort_controller_x_1 = require(\"abort-controller-x\");\nconst AsyncSink_1 = require(\"../utils/AsyncSink\");\nconst service_definitions_1 = require(\"../service-definitions\");\nconst isAsyncIterable_1 = require(\"../utils/isAsyncIterable\");\nconst convertMetadata_1 = require(\"../utils/convertMetadata\");\n/** @internal */\nfunction createBidiStreamingMethod(definition, channel, middleware, defaultOptions) {\n const grpcMethodDefinition = (0, service_definitions_1.toGrpcWebMethodDefinition)(definition);\n const methodDescriptor = {\n path: definition.path,\n requestStream: definition.requestStream,\n responseStream: definition.responseStream,\n options: definition.options,\n };\n async function* bidiStreamingMethod(request, options) {\n if (!(0, isAsyncIterable_1.isAsyncIterable)(request)) {\n throw new Error('A middleware passed invalid request to next(): expected a single message for bidirectional streaming method');\n }\n const { metadata = (0, nice_grpc_common_1.Metadata)(), signal = new AbortController().signal, onHeader, onTrailer, } = options;\n const pipeAbortController = new AbortController();\n const sink = new AsyncSink_1.AsyncSink();\n const client = grpc_web_1.grpc.client(grpcMethodDefinition, {\n host: channel.address,\n transport: channel.transport,\n });\n client.onHeaders(headers => {\n onHeader === null || onHeader === void 0 ? void 0 : onHeader((0, convertMetadata_1.convertMetadataFromGrpcWeb)(headers));\n });\n client.onMessage(message => {\n sink.write(message);\n });\n client.onEnd((code, message, trailers) => {\n onTrailer === null || onTrailer === void 0 ? void 0 : onTrailer((0, convertMetadata_1.convertMetadataFromGrpcWeb)(trailers));\n if (code === grpc_web_1.grpc.Code.OK) {\n sink.end();\n }\n else {\n sink.error(new nice_grpc_common_1.ClientError(definition.path, +code, message));\n }\n });\n client.start((0, convertMetadata_1.convertMetadataToGrpcWeb)(metadata));\n let pipeError;\n pipeRequest(pipeAbortController.signal, request, client, definition).then(() => {\n client.finishSend();\n }, err => {\n if (!(0, abort_controller_x_1.isAbortError)(err)) {\n pipeError = err;\n client.close();\n sink.end();\n }\n });\n const abortListener = () => {\n sink.error(new abort_controller_x_1.AbortError());\n pipeAbortController.abort();\n client.close();\n };\n signal.addEventListener('abort', abortListener);\n try {\n yield* sink;\n }\n finally {\n pipeAbortController.abort();\n signal.removeEventListener('abort', abortListener);\n (0, abort_controller_x_1.throwIfAborted)(signal);\n if (pipeError) {\n throw pipeError;\n }\n }\n }\n const method = middleware == null\n ? bidiStreamingMethod\n : (request, options) => middleware({\n method: methodDescriptor,\n requestStream: true,\n request,\n responseStream: true,\n next: bidiStreamingMethod,\n }, options);\n return (request, options) => {\n const iterable = method(request, {\n ...defaultOptions,\n ...options,\n });\n const iterator = iterable[Symbol.asyncIterator]();\n return {\n [Symbol.asyncIterator]() {\n return {\n async next() {\n const result = await iterator.next();\n if (result.done && result.value != null) {\n return await iterator.throw(new Error('A middleware returned a message, but expected to return void for bidirectional streaming method'));\n }\n return result;\n },\n return() {\n return iterator.return();\n },\n throw(err) {\n return iterator.throw(err);\n },\n };\n },\n };\n };\n}\nexports.createBidiStreamingMethod = createBidiStreamingMethod;\nasync function pipeRequest(signal, request, client, definition) {\n for await (const item of request) {\n (0, abort_controller_x_1.throwIfAborted)(signal);\n client.send({\n serializeBinary: () => definition.requestSerialize(item),\n });\n }\n}\n//# sourceMappingURL=createBidiStreamingMethod.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createClientStreamingMethod = void 0;\nconst nice_grpc_common_1 = require(\"nice-grpc-common\");\nconst grpc_web_1 = require(\"@improbable-eng/grpc-web\");\nconst abort_controller_x_1 = require(\"abort-controller-x\");\nconst service_definitions_1 = require(\"../service-definitions\");\nconst isAsyncIterable_1 = require(\"../utils/isAsyncIterable\");\nconst convertMetadata_1 = require(\"../utils/convertMetadata\");\n/** @internal */\nfunction createClientStreamingMethod(definition, channel, middleware, defaultOptions) {\n const grpcMethodDefinition = (0, service_definitions_1.toGrpcWebMethodDefinition)(definition);\n const methodDescriptor = {\n path: definition.path,\n requestStream: definition.requestStream,\n responseStream: definition.responseStream,\n options: definition.options,\n };\n async function* clientStreamingMethod(request, options) {\n if (!(0, isAsyncIterable_1.isAsyncIterable)(request)) {\n throw new Error('A middleware passed invalid request to next(): expected a single message for client streaming method');\n }\n const { metadata = (0, nice_grpc_common_1.Metadata)(), signal = new AbortController().signal, onHeader, onTrailer, } = options;\n return await (0, abort_controller_x_1.execute)(signal, (resolve, reject) => {\n const pipeAbortController = new AbortController();\n let response;\n const client = grpc_web_1.grpc.client(grpcMethodDefinition, {\n host: channel.address,\n transport: channel.transport,\n });\n client.onHeaders(headers => {\n onHeader === null || onHeader === void 0 ? void 0 : onHeader((0, convertMetadata_1.convertMetadataFromGrpcWeb)(headers));\n });\n client.onMessage(message => {\n response = message;\n });\n client.onEnd((code, message, trailers) => {\n onTrailer === null || onTrailer === void 0 ? void 0 : onTrailer((0, convertMetadata_1.convertMetadataFromGrpcWeb)(trailers));\n pipeAbortController.abort();\n if (code === grpc_web_1.grpc.Code.OK) {\n resolve(response);\n }\n else {\n reject(new nice_grpc_common_1.ClientError(definition.path, +code, message));\n }\n });\n client.start((0, convertMetadata_1.convertMetadataToGrpcWeb)(metadata));\n pipeRequest(pipeAbortController.signal, request, client, definition).then(() => {\n client.finishSend();\n }, err => {\n if (!(0, abort_controller_x_1.isAbortError)(err)) {\n reject(err);\n client.close();\n }\n });\n return () => {\n pipeAbortController.abort();\n client.close();\n };\n });\n }\n const method = middleware == null\n ? clientStreamingMethod\n : (request, options) => middleware({\n method: methodDescriptor,\n requestStream: true,\n request,\n responseStream: false,\n next: clientStreamingMethod,\n }, options);\n return async (request, options) => {\n const iterable = method(request, {\n ...defaultOptions,\n ...options,\n });\n const iterator = iterable[Symbol.asyncIterator]();\n let result = await iterator.next();\n while (true) {\n if (!result.done) {\n result = await iterator.throw(new Error('A middleware yielded a message, but expected to only return a message for client streaming method'));\n continue;\n }\n if (result.value == null) {\n result = await iterator.throw(new Error('A middleware returned void, but expected to return a message for client streaming method'));\n continue;\n }\n return result.value;\n }\n };\n}\nexports.createClientStreamingMethod = createClientStreamingMethod;\nasync function pipeRequest(signal, request, client, definition) {\n for await (const item of request) {\n (0, abort_controller_x_1.throwIfAborted)(signal);\n client.send({\n serializeBinary: () => definition.requestSerialize(item),\n });\n }\n}\n//# sourceMappingURL=createClientStreamingMethod.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createServerStreamingMethod = void 0;\nconst grpc_web_1 = require(\"@improbable-eng/grpc-web\");\nconst abort_controller_x_1 = require(\"abort-controller-x\");\nconst AsyncSink_1 = require(\"../utils/AsyncSink\");\nconst nice_grpc_common_1 = require(\"nice-grpc-common\");\nconst service_definitions_1 = require(\"../service-definitions\");\nconst convertMetadata_1 = require(\"../utils/convertMetadata\");\nconst isAsyncIterable_1 = require(\"../utils/isAsyncIterable\");\n/** @internal */\nfunction createServerStreamingMethod(definition, channel, middleware, defaultOptions) {\n const grpcMethodDefinition = (0, service_definitions_1.toGrpcWebMethodDefinition)(definition);\n const methodDescriptor = {\n path: definition.path,\n requestStream: definition.requestStream,\n responseStream: definition.responseStream,\n options: definition.options,\n };\n async function* serverStreamingMethod(request, options) {\n if ((0, isAsyncIterable_1.isAsyncIterable)(request)) {\n throw new Error('A middleware passed invalid request to next(): expected a single message for server streaming method');\n }\n const { metadata = (0, nice_grpc_common_1.Metadata)(), signal = new AbortController().signal, onHeader, onTrailer, } = options;\n const sink = new AsyncSink_1.AsyncSink();\n const client = grpc_web_1.grpc.client(grpcMethodDefinition, {\n host: channel.address,\n transport: channel.transport,\n });\n client.onHeaders(headers => {\n onHeader === null || onHeader === void 0 ? void 0 : onHeader((0, convertMetadata_1.convertMetadataFromGrpcWeb)(headers));\n });\n client.onMessage(message => {\n sink.write(message);\n });\n client.onEnd((code, message, trailers) => {\n onTrailer === null || onTrailer === void 0 ? void 0 : onTrailer((0, convertMetadata_1.convertMetadataFromGrpcWeb)(trailers));\n if (code === grpc_web_1.grpc.Code.OK) {\n sink.end();\n }\n else {\n sink.error(new nice_grpc_common_1.ClientError(definition.path, +code, message));\n }\n });\n client.start((0, convertMetadata_1.convertMetadataToGrpcWeb)(metadata));\n client.send({\n serializeBinary: () => definition.requestSerialize(request),\n });\n client.finishSend();\n const abortListener = () => {\n sink.error(new abort_controller_x_1.AbortError());\n client.close();\n };\n signal.addEventListener('abort', abortListener);\n try {\n yield* sink;\n }\n finally {\n signal.removeEventListener('abort', abortListener);\n (0, abort_controller_x_1.throwIfAborted)(signal);\n }\n }\n const method = middleware == null\n ? serverStreamingMethod\n : (request, options) => middleware({\n method: methodDescriptor,\n requestStream: false,\n request,\n responseStream: true,\n next: serverStreamingMethod,\n }, options);\n return (request, options) => {\n const iterable = method(request, {\n ...defaultOptions,\n ...options,\n });\n const iterator = iterable[Symbol.asyncIterator]();\n return {\n [Symbol.asyncIterator]() {\n return {\n async next() {\n const result = await iterator.next();\n if (result.done && result.value != null) {\n return await iterator.throw(new Error('A middleware returned a message, but expected to return void for server streaming method'));\n }\n return result;\n },\n return() {\n return iterator.return();\n },\n throw(err) {\n return iterator.throw(err);\n },\n };\n },\n };\n };\n}\nexports.createServerStreamingMethod = createServerStreamingMethod;\n//# sourceMappingURL=createServerStreamingMethod.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createUnaryMethod = void 0;\nconst nice_grpc_common_1 = require(\"nice-grpc-common\");\nconst grpc_web_1 = require(\"@improbable-eng/grpc-web\");\nconst abort_controller_x_1 = require(\"abort-controller-x\");\nconst service_definitions_1 = require(\"../service-definitions\");\nconst isAsyncIterable_1 = require(\"../utils/isAsyncIterable\");\nconst convertMetadata_1 = require(\"../utils/convertMetadata\");\n/** @internal */\nfunction createUnaryMethod(definition, channel, middleware, defaultOptions) {\n const grpcMethodDefinition = (0, service_definitions_1.toGrpcWebMethodDefinition)(definition);\n const methodDescriptor = {\n path: definition.path,\n requestStream: definition.requestStream,\n responseStream: definition.responseStream,\n options: definition.options,\n };\n async function* unaryMethod(request, options) {\n if ((0, isAsyncIterable_1.isAsyncIterable)(request)) {\n throw new Error('A middleware passed invalid request to next(): expected a single message for unary method');\n }\n const { metadata = (0, nice_grpc_common_1.Metadata)(), signal = new AbortController().signal, onHeader, onTrailer, } = options;\n return await (0, abort_controller_x_1.execute)(signal, (resolve, reject) => {\n let response;\n const client = grpc_web_1.grpc.client(grpcMethodDefinition, {\n host: channel.address,\n transport: channel.transport,\n });\n client.onHeaders(headers => {\n onHeader === null || onHeader === void 0 ? void 0 : onHeader((0, convertMetadata_1.convertMetadataFromGrpcWeb)(headers));\n });\n client.onMessage(message => {\n response = message;\n });\n client.onEnd((code, message, trailers) => {\n onTrailer === null || onTrailer === void 0 ? void 0 : onTrailer((0, convertMetadata_1.convertMetadataFromGrpcWeb)(trailers));\n if (code === grpc_web_1.grpc.Code.OK) {\n resolve(response);\n }\n else {\n reject(new nice_grpc_common_1.ClientError(definition.path, +code, message));\n }\n });\n client.start((0, convertMetadata_1.convertMetadataToGrpcWeb)(metadata));\n client.send({\n serializeBinary: () => definition.requestSerialize(request),\n });\n client.finishSend();\n return () => {\n client.close();\n };\n });\n }\n const method = middleware == null\n ? unaryMethod\n : (request, options) => middleware({\n method: methodDescriptor,\n requestStream: false,\n request,\n responseStream: false,\n next: unaryMethod,\n }, options);\n return async (request, options) => {\n const iterable = method(request, {\n ...defaultOptions,\n ...options,\n });\n const iterator = iterable[Symbol.asyncIterator]();\n let result = await iterator.next();\n while (true) {\n if (!result.done) {\n result = await iterator.throw(new Error('A middleware yielded a message, but expected to only return a message for unary method'));\n continue;\n }\n if (result.value == null) {\n result = await iterator.throw(new Error('A middleware returned void, but expected to return a message for unary method'));\n continue;\n }\n return result.value;\n }\n };\n}\nexports.createUnaryMethod = createUnaryMethod;\n//# sourceMappingURL=createUnaryMethod.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createClient = exports.createClientFactory = void 0;\nconst nice_grpc_common_1 = require(\"nice-grpc-common\");\nconst service_definitions_1 = require(\"../service-definitions\");\nconst createBidiStreamingMethod_1 = require(\"./createBidiStreamingMethod\");\nconst createClientStreamingMethod_1 = require(\"./createClientStreamingMethod\");\nconst createServerStreamingMethod_1 = require(\"./createServerStreamingMethod\");\nconst createUnaryMethod_1 = require(\"./createUnaryMethod\");\nfunction createClientFactory() {\n return createClientFactoryWithMiddleware();\n}\nexports.createClientFactory = createClientFactory;\nfunction createClient(definition, channel, defaultCallOptions) {\n return createClientFactory().create(definition, channel, defaultCallOptions);\n}\nexports.createClient = createClient;\nfunction createClientFactoryWithMiddleware(middleware) {\n return {\n use(newMiddleware) {\n return createClientFactoryWithMiddleware(middleware == null\n ? newMiddleware\n : (0, nice_grpc_common_1.composeClientMiddleware)(middleware, newMiddleware));\n },\n create(definition, channel, defaultCallOptions = {}) {\n const client = {};\n const methodEntries = Object.entries((0, service_definitions_1.normalizeServiceDefinition)(definition));\n for (const [methodName, methodDefinition] of methodEntries) {\n const defaultOptions = {\n ...defaultCallOptions['*'],\n ...defaultCallOptions[methodName],\n };\n if (!methodDefinition.requestStream) {\n if (!methodDefinition.responseStream) {\n client[methodName] = (0, createUnaryMethod_1.createUnaryMethod)(methodDefinition, channel, middleware, defaultOptions);\n }\n else {\n client[methodName] = (0, createServerStreamingMethod_1.createServerStreamingMethod)(methodDefinition, channel, middleware, defaultOptions);\n }\n }\n else {\n if (!methodDefinition.responseStream) {\n client[methodName] = (0, createClientStreamingMethod_1.createClientStreamingMethod)(methodDefinition, channel, middleware, defaultOptions);\n }\n else {\n client[methodName] = (0, createBidiStreamingMethod_1.createBidiStreamingMethod)(methodDefinition, channel, middleware, defaultOptions);\n }\n }\n }\n return client;\n },\n };\n}\n//# sourceMappingURL=ClientFactory.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=Client.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Status = exports.Metadata = exports.composeClientMiddleware = exports.ClientError = void 0;\nvar nice_grpc_common_1 = require(\"nice-grpc-common\");\nObject.defineProperty(exports, \"ClientError\", { enumerable: true, get: function () { return nice_grpc_common_1.ClientError; } });\nObject.defineProperty(exports, \"composeClientMiddleware\", { enumerable: true, get: function () { return nice_grpc_common_1.composeClientMiddleware; } });\nObject.defineProperty(exports, \"Metadata\", { enumerable: true, get: function () { return nice_grpc_common_1.Metadata; } });\nObject.defineProperty(exports, \"Status\", { enumerable: true, get: function () { return nice_grpc_common_1.Status; } });\n__exportStar(require(\"./service-definitions\"), exports);\n__exportStar(require(\"./client/channel\"), exports);\n__exportStar(require(\"./client/ClientFactory\"), exports);\n__exportStar(require(\"./client/Client\"), exports);\n//# sourceMappingURL=index.js.map","// protobuf/ts/faucet/faucet.ts\nimport Long from \"long\";\nimport _m0 from \"protobufjs/minimal.js\";\nvar protobufPackage = \"faucet\";\nfunction createBaseLinkedTwitterPair() {\n return { username: \"\", address: \"\" };\n}\nvar LinkedTwitterPair = {\n encode(message, writer = _m0.Writer.create()) {\n if (message.username !== \"\") {\n writer.uint32(10).string(message.username);\n }\n if (message.address !== \"\") {\n writer.uint32(18).string(message.address);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseLinkedTwitterPair();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 10) {\n break;\n }\n message.username = reader.string();\n continue;\n case 2:\n if (tag != 18) {\n break;\n }\n message.address = reader.string();\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return LinkedTwitterPair.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseLinkedTwitterPair();\n message.username = object.username ?? \"\";\n message.address = object.address ?? \"\";\n return message;\n }\n};\nfunction createBaseFaucetStore() {\n return { addressToUsername: {}, usernameToAddress: {}, latestDrip: {}, totalDripCount: 0 };\n}\nvar FaucetStore = {\n encode(message, writer = _m0.Writer.create()) {\n Object.entries(message.addressToUsername).forEach(([key, value]) => {\n FaucetStore_AddressToUsernameEntry.encode({ key, value }, writer.uint32(10).fork()).ldelim();\n });\n Object.entries(message.usernameToAddress).forEach(([key, value]) => {\n FaucetStore_UsernameToAddressEntry.encode({ key, value }, writer.uint32(18).fork()).ldelim();\n });\n Object.entries(message.latestDrip).forEach(([key, value]) => {\n FaucetStore_LatestDripEntry.encode({ key, value }, writer.uint32(26).fork()).ldelim();\n });\n if (message.totalDripCount !== 0) {\n writer.uint32(33).double(message.totalDripCount);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseFaucetStore();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 10) {\n break;\n }\n const entry1 = FaucetStore_AddressToUsernameEntry.decode(reader, reader.uint32());\n if (entry1.value !== void 0) {\n message.addressToUsername[entry1.key] = entry1.value;\n }\n continue;\n case 2:\n if (tag != 18) {\n break;\n }\n const entry2 = FaucetStore_UsernameToAddressEntry.decode(reader, reader.uint32());\n if (entry2.value !== void 0) {\n message.usernameToAddress[entry2.key] = entry2.value;\n }\n continue;\n case 3:\n if (tag != 26) {\n break;\n }\n const entry3 = FaucetStore_LatestDripEntry.decode(reader, reader.uint32());\n if (entry3.value !== void 0) {\n message.latestDrip[entry3.key] = entry3.value;\n }\n continue;\n case 4:\n if (tag != 33) {\n break;\n }\n message.totalDripCount = reader.double();\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return FaucetStore.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseFaucetStore();\n message.addressToUsername = Object.entries(object.addressToUsername ?? {}).reduce(\n (acc, [key, value]) => {\n if (value !== void 0) {\n acc[key] = String(value);\n }\n return acc;\n },\n {}\n );\n message.usernameToAddress = Object.entries(object.usernameToAddress ?? {}).reduce(\n (acc, [key, value]) => {\n if (value !== void 0) {\n acc[key] = String(value);\n }\n return acc;\n },\n {}\n );\n message.latestDrip = Object.entries(object.latestDrip ?? {}).reduce(\n (acc, [key, value]) => {\n if (value !== void 0) {\n acc[key] = Number(value);\n }\n return acc;\n },\n {}\n );\n message.totalDripCount = object.totalDripCount ?? 0;\n return message;\n }\n};\nfunction createBaseFaucetStore_AddressToUsernameEntry() {\n return { key: \"\", value: \"\" };\n}\nvar FaucetStore_AddressToUsernameEntry = {\n encode(message, writer = _m0.Writer.create()) {\n if (message.key !== \"\") {\n writer.uint32(10).string(message.key);\n }\n if (message.value !== \"\") {\n writer.uint32(18).string(message.value);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseFaucetStore_AddressToUsernameEntry();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 10) {\n break;\n }\n message.key = reader.string();\n continue;\n case 2:\n if (tag != 18) {\n break;\n }\n message.value = reader.string();\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return FaucetStore_AddressToUsernameEntry.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseFaucetStore_AddressToUsernameEntry();\n message.key = object.key ?? \"\";\n message.value = object.value ?? \"\";\n return message;\n }\n};\nfunction createBaseFaucetStore_UsernameToAddressEntry() {\n return { key: \"\", value: \"\" };\n}\nvar FaucetStore_UsernameToAddressEntry = {\n encode(message, writer = _m0.Writer.create()) {\n if (message.key !== \"\") {\n writer.uint32(10).string(message.key);\n }\n if (message.value !== \"\") {\n writer.uint32(18).string(message.value);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseFaucetStore_UsernameToAddressEntry();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 10) {\n break;\n }\n message.key = reader.string();\n continue;\n case 2:\n if (tag != 18) {\n break;\n }\n message.value = reader.string();\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return FaucetStore_UsernameToAddressEntry.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseFaucetStore_UsernameToAddressEntry();\n message.key = object.key ?? \"\";\n message.value = object.value ?? \"\";\n return message;\n }\n};\nfunction createBaseFaucetStore_LatestDripEntry() {\n return { key: \"\", value: 0 };\n}\nvar FaucetStore_LatestDripEntry = {\n encode(message, writer = _m0.Writer.create()) {\n if (message.key !== \"\") {\n writer.uint32(10).string(message.key);\n }\n if (message.value !== 0) {\n writer.uint32(16).int64(message.value);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseFaucetStore_LatestDripEntry();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 10) {\n break;\n }\n message.key = reader.string();\n continue;\n case 2:\n if (tag != 16) {\n break;\n }\n message.value = longToNumber(reader.int64());\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return FaucetStore_LatestDripEntry.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseFaucetStore_LatestDripEntry();\n message.key = object.key ?? \"\";\n message.value = object.value ?? 0;\n return message;\n }\n};\nfunction createBaseDripRequest() {\n return { username: \"\", address: \"\" };\n}\nvar DripRequest = {\n encode(message, writer = _m0.Writer.create()) {\n if (message.username !== \"\") {\n writer.uint32(10).string(message.username);\n }\n if (message.address !== \"\") {\n writer.uint32(18).string(message.address);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseDripRequest();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 10) {\n break;\n }\n message.username = reader.string();\n continue;\n case 2:\n if (tag != 18) {\n break;\n }\n message.address = reader.string();\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return DripRequest.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseDripRequest();\n message.username = object.username ?? \"\";\n message.address = object.address ?? \"\";\n return message;\n }\n};\nfunction createBaseDripDevRequest() {\n return { address: \"\" };\n}\nvar DripDevRequest = {\n encode(message, writer = _m0.Writer.create()) {\n if (message.address !== \"\") {\n writer.uint32(10).string(message.address);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseDripDevRequest();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 10) {\n break;\n }\n message.address = reader.string();\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return DripDevRequest.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseDripDevRequest();\n message.address = object.address ?? \"\";\n return message;\n }\n};\nfunction createBaseDripResponse() {\n return { dripTxHash: \"\", ecsTxHash: \"\" };\n}\nvar DripResponse = {\n encode(message, writer = _m0.Writer.create()) {\n if (message.dripTxHash !== \"\") {\n writer.uint32(10).string(message.dripTxHash);\n }\n if (message.ecsTxHash !== \"\") {\n writer.uint32(18).string(message.ecsTxHash);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseDripResponse();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 10) {\n break;\n }\n message.dripTxHash = reader.string();\n continue;\n case 2:\n if (tag != 18) {\n break;\n }\n message.ecsTxHash = reader.string();\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return DripResponse.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseDripResponse();\n message.dripTxHash = object.dripTxHash ?? \"\";\n message.ecsTxHash = object.ecsTxHash ?? \"\";\n return message;\n }\n};\nfunction createBaseTimeUntilDripResponse() {\n return { timeUntilDripMinutes: 0, timeUntilDripSeconds: 0 };\n}\nvar TimeUntilDripResponse = {\n encode(message, writer = _m0.Writer.create()) {\n if (message.timeUntilDripMinutes !== 0) {\n writer.uint32(9).double(message.timeUntilDripMinutes);\n }\n if (message.timeUntilDripSeconds !== 0) {\n writer.uint32(17).double(message.timeUntilDripSeconds);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseTimeUntilDripResponse();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 9) {\n break;\n }\n message.timeUntilDripMinutes = reader.double();\n continue;\n case 2:\n if (tag != 17) {\n break;\n }\n message.timeUntilDripSeconds = reader.double();\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return TimeUntilDripResponse.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseTimeUntilDripResponse();\n message.timeUntilDripMinutes = object.timeUntilDripMinutes ?? 0;\n message.timeUntilDripSeconds = object.timeUntilDripSeconds ?? 0;\n return message;\n }\n};\nfunction createBaseGetLinkedTwittersRequest() {\n return {};\n}\nvar GetLinkedTwittersRequest = {\n encode(_, writer = _m0.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseGetLinkedTwittersRequest();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return GetLinkedTwittersRequest.fromPartial(base ?? {});\n },\n fromPartial(_) {\n const message = createBaseGetLinkedTwittersRequest();\n return message;\n }\n};\nfunction createBaseGetLinkedTwittersResponse() {\n return { linkedTwitters: [] };\n}\nvar GetLinkedTwittersResponse = {\n encode(message, writer = _m0.Writer.create()) {\n for (const v of message.linkedTwitters) {\n LinkedTwitterPair.encode(v, writer.uint32(10).fork()).ldelim();\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseGetLinkedTwittersResponse();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 10) {\n break;\n }\n message.linkedTwitters.push(LinkedTwitterPair.decode(reader, reader.uint32()));\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return GetLinkedTwittersResponse.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseGetLinkedTwittersResponse();\n message.linkedTwitters = object.linkedTwitters?.map((e) => LinkedTwitterPair.fromPartial(e)) || [];\n return message;\n }\n};\nfunction createBaseLinkedTwitterForAddressRequest() {\n return { address: \"\" };\n}\nvar LinkedTwitterForAddressRequest = {\n encode(message, writer = _m0.Writer.create()) {\n if (message.address !== \"\") {\n writer.uint32(10).string(message.address);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseLinkedTwitterForAddressRequest();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 10) {\n break;\n }\n message.address = reader.string();\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return LinkedTwitterForAddressRequest.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseLinkedTwitterForAddressRequest();\n message.address = object.address ?? \"\";\n return message;\n }\n};\nfunction createBaseLinkedTwitterForAddressResponse() {\n return { username: \"\" };\n}\nvar LinkedTwitterForAddressResponse = {\n encode(message, writer = _m0.Writer.create()) {\n if (message.username !== \"\") {\n writer.uint32(10).string(message.username);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseLinkedTwitterForAddressResponse();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 10) {\n break;\n }\n message.username = reader.string();\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return LinkedTwitterForAddressResponse.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseLinkedTwitterForAddressResponse();\n message.username = object.username ?? \"\";\n return message;\n }\n};\nfunction createBaseLinkedAddressForTwitterRequest() {\n return { username: \"\" };\n}\nvar LinkedAddressForTwitterRequest = {\n encode(message, writer = _m0.Writer.create()) {\n if (message.username !== \"\") {\n writer.uint32(10).string(message.username);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseLinkedAddressForTwitterRequest();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 10) {\n break;\n }\n message.username = reader.string();\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return LinkedAddressForTwitterRequest.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseLinkedAddressForTwitterRequest();\n message.username = object.username ?? \"\";\n return message;\n }\n};\nfunction createBaseLinkedAddressForTwitterResponse() {\n return { address: \"\" };\n}\nvar LinkedAddressForTwitterResponse = {\n encode(message, writer = _m0.Writer.create()) {\n if (message.address !== \"\") {\n writer.uint32(10).string(message.address);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseLinkedAddressForTwitterResponse();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 10) {\n break;\n }\n message.address = reader.string();\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return LinkedAddressForTwitterResponse.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseLinkedAddressForTwitterResponse();\n message.address = object.address ?? \"\";\n return message;\n }\n};\nfunction createBaseSetLinkedTwitterRequest() {\n return { address: \"\", username: \"\", signature: \"\" };\n}\nvar SetLinkedTwitterRequest = {\n encode(message, writer = _m0.Writer.create()) {\n if (message.address !== \"\") {\n writer.uint32(10).string(message.address);\n }\n if (message.username !== \"\") {\n writer.uint32(18).string(message.username);\n }\n if (message.signature !== \"\") {\n writer.uint32(26).string(message.signature);\n }\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseSetLinkedTwitterRequest();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n case 1:\n if (tag != 10) {\n break;\n }\n message.address = reader.string();\n continue;\n case 2:\n if (tag != 18) {\n break;\n }\n message.username = reader.string();\n continue;\n case 3:\n if (tag != 26) {\n break;\n }\n message.signature = reader.string();\n continue;\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return SetLinkedTwitterRequest.fromPartial(base ?? {});\n },\n fromPartial(object) {\n const message = createBaseSetLinkedTwitterRequest();\n message.address = object.address ?? \"\";\n message.username = object.username ?? \"\";\n message.signature = object.signature ?? \"\";\n return message;\n }\n};\nfunction createBaseSetLinkedTwitterResponse() {\n return {};\n}\nvar SetLinkedTwitterResponse = {\n encode(_, writer = _m0.Writer.create()) {\n return writer;\n },\n decode(input, length) {\n const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);\n let end = length === void 0 ? reader.len : reader.pos + length;\n const message = createBaseSetLinkedTwitterResponse();\n while (reader.pos < end) {\n const tag = reader.uint32();\n switch (tag >>> 3) {\n }\n if ((tag & 7) == 4 || tag == 0) {\n break;\n }\n reader.skipType(tag & 7);\n }\n return message;\n },\n create(base) {\n return SetLinkedTwitterResponse.fromPartial(base ?? {});\n },\n fromPartial(_) {\n const message = createBaseSetLinkedTwitterResponse();\n return message;\n }\n};\nvar FaucetServiceDefinition = {\n name: \"FaucetService\",\n fullName: \"faucet.FaucetService\",\n methods: {\n drip: {\n name: \"Drip\",\n requestType: DripRequest,\n requestStream: false,\n responseType: DripResponse,\n responseStream: false,\n options: {}\n },\n dripDev: {\n name: \"DripDev\",\n requestType: DripDevRequest,\n requestStream: false,\n responseType: DripResponse,\n responseStream: false,\n options: {}\n },\n dripVerifyTweet: {\n name: \"DripVerifyTweet\",\n requestType: DripRequest,\n requestStream: false,\n responseType: DripResponse,\n responseStream: false,\n options: {}\n },\n timeUntilDrip: {\n name: \"TimeUntilDrip\",\n requestType: DripRequest,\n requestStream: false,\n responseType: TimeUntilDripResponse,\n responseStream: false,\n options: {}\n },\n getLinkedTwitters: {\n name: \"GetLinkedTwitters\",\n requestType: GetLinkedTwittersRequest,\n requestStream: false,\n responseType: GetLinkedTwittersResponse,\n responseStream: false,\n options: {}\n },\n getLinkedTwitterForAddress: {\n name: \"GetLinkedTwitterForAddress\",\n requestType: LinkedTwitterForAddressRequest,\n requestStream: false,\n responseType: LinkedTwitterForAddressResponse,\n responseStream: false,\n options: {}\n },\n getLinkedAddressForTwitter: {\n name: \"GetLinkedAddressForTwitter\",\n requestType: LinkedAddressForTwitterRequest,\n requestStream: false,\n responseType: LinkedAddressForTwitterResponse,\n responseStream: false,\n options: {}\n },\n /** Admin utility endpoints for modifying state. Requires a signature with faucet private key. */\n setLinkedTwitter: {\n name: \"SetLinkedTwitter\",\n requestType: SetLinkedTwitterRequest,\n requestStream: false,\n responseType: SetLinkedTwitterResponse,\n responseStream: false,\n options: {}\n }\n }\n};\nvar tsProtoGlobalThis = (() => {\n if (typeof globalThis !== \"undefined\") {\n return globalThis;\n }\n if (typeof self !== \"undefined\") {\n return self;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n throw \"Unable to locate global object\";\n})();\nfunction longToNumber(long) {\n if (long.gt(Number.MAX_SAFE_INTEGER)) {\n throw new tsProtoGlobalThis.Error(\"Value is larger than Number.MAX_SAFE_INTEGER\");\n }\n return long.toNumber();\n}\nif (_m0.util.Long !== Long) {\n _m0.util.Long = Long;\n _m0.configure();\n}\n\n// ts/faucet/createFaucetService.ts\nimport { createChannel, createClient } from \"nice-grpc-web\";\nfunction createFaucetService(url) {\n return createClient(FaucetServiceDefinition, createChannel(url));\n}\nexport {\n DripDevRequest,\n DripRequest,\n DripResponse,\n FaucetServiceDefinition,\n FaucetStore,\n FaucetStore_AddressToUsernameEntry,\n FaucetStore_LatestDripEntry,\n FaucetStore_UsernameToAddressEntry,\n GetLinkedTwittersRequest,\n GetLinkedTwittersResponse,\n LinkedAddressForTwitterRequest,\n LinkedAddressForTwitterResponse,\n LinkedTwitterForAddressRequest,\n LinkedTwitterForAddressResponse,\n LinkedTwitterPair,\n SetLinkedTwitterRequest,\n SetLinkedTwitterResponse,\n TimeUntilDripResponse,\n createFaucetService,\n protobufPackage\n};\n//# sourceMappingURL=faucet.js.map","// src/arbitrum.ts\nvar arbitrum = {\n id: 42161,\n name: \"Arbitrum One\",\n network: \"arbitrum\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n alchemy: {\n http: [\"https://arb-mainnet.g.alchemy.com/v2\"],\n webSocket: [\"wss://arb-mainnet.g.alchemy.com/v2\"]\n },\n infura: {\n http: [\"https://arbitrum-mainnet.infura.io/v3\"],\n webSocket: [\"wss://arbitrum-mainnet.infura.io/ws/v3\"]\n },\n default: {\n http: [\"https://arb1.arbitrum.io/rpc\"]\n },\n public: {\n http: [\"https://arb1.arbitrum.io/rpc\"]\n }\n },\n blockExplorers: {\n etherscan: { name: \"Arbiscan\", url: \"https://arbiscan.io\" },\n default: { name: \"Arbiscan\", url: \"https://arbiscan.io\" }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 7654707\n }\n }\n};\n\n// src/arbitrumGoerli.ts\nvar arbitrumGoerli = {\n id: 421613,\n name: \"Arbitrum Goerli\",\n network: \"arbitrum-goerli\",\n nativeCurrency: {\n name: \"Arbitrum Goerli Ether\",\n symbol: \"ETH\",\n decimals: 18\n },\n rpcUrls: {\n alchemy: {\n http: [\"https://arb-goerli.g.alchemy.com/v2\"],\n webSocket: [\"wss://arb-goerli.g.alchemy.com/v2\"]\n },\n infura: {\n http: [\"https://arbitrum-goerli.infura.io/v3\"],\n webSocket: [\"wss://arbitrum-goerli.infura.io/ws/v3\"]\n },\n default: {\n http: [\"https://goerli-rollup.arbitrum.io/rpc\"]\n },\n public: {\n http: [\"https://goerli-rollup.arbitrum.io/rpc\"]\n }\n },\n blockExplorers: {\n etherscan: { name: \"Arbiscan\", url: \"https://goerli.arbiscan.io/\" },\n default: { name: \"Arbiscan\", url: \"https://goerli.arbiscan.io/\" }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 88114\n }\n },\n testnet: true\n};\n\n// src/arbitrumNova.ts\nvar arbitrumNova = {\n id: 42170,\n name: \"Arbitrum Nova\",\n network: \"arbitrum-nova\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n blast: {\n http: [\"https://arbitrum-nova.public.blastapi.io\"],\n webSocket: [\"wss://arbitrum-nova.public.blastapi.io\"]\n },\n default: {\n http: [\"https://nova.arbitrum.io/rpc\"]\n },\n public: {\n http: [\"https://nova.arbitrum.io/rpc\"]\n }\n },\n blockExplorers: {\n etherscan: { name: \"Arbiscan\", url: \"https://nova.arbiscan.io\" },\n blockScout: {\n name: \"BlockScout\",\n url: \"https://nova-explorer.arbitrum.io/\"\n },\n default: { name: \"Arbiscan\", url: \"https://nova.arbiscan.io\" }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 1746963\n }\n }\n};\n\n// src/aurora.ts\nvar aurora = {\n id: 1313161554,\n name: \"Aurora\",\n network: \"aurora\",\n nativeCurrency: {\n decimals: 18,\n name: \"Ether\",\n symbol: \"ETH\"\n },\n rpcUrls: {\n infura: { http: [\"https://aurora-mainnet.infura.io/v3\"] },\n default: { http: [\"https://mainnet.aurora.dev\"] },\n public: { http: [\"https://mainnet.aurora.dev\"] }\n },\n blockExplorers: {\n etherscan: { name: \"Aurorascan\", url: \"https://aurorascan.dev\" },\n default: { name: \"Aurorascan\", url: \"https://aurorascan.dev\" }\n }\n};\n\n// src/auroraTestnet.ts\nvar auroraTestnet = {\n id: 1313161555,\n name: \"Aurora Testnet\",\n network: \"aurora-testnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"Ether\",\n symbol: \"ETH\"\n },\n rpcUrls: {\n infura: { http: [\"https://aurora-testnet.infura.io/v3\"] },\n default: { http: [\"https://testnet.aurora.dev\"] },\n public: { http: [\"https://testnet.aurora.dev\"] }\n },\n blockExplorers: {\n etherscan: { name: \"Aurorascan\", url: \"https://testnet.aurorascan.dev\" },\n default: { name: \"Aurorascan\", url: \"https://testnet.aurorascan.dev\" }\n },\n testnet: true\n};\n\n// src/avalanche.ts\nvar avalanche = {\n id: 43114,\n name: \"Avalanche\",\n network: \"avalanche\",\n nativeCurrency: {\n decimals: 18,\n name: \"Avalanche\",\n symbol: \"AVAX\"\n },\n rpcUrls: {\n default: { http: [\"https://api.avax.network/ext/bc/C/rpc\"] },\n public: { http: [\"https://api.avax.network/ext/bc/C/rpc\"] }\n },\n blockExplorers: {\n etherscan: { name: \"SnowTrace\", url: \"https://snowtrace.io\" },\n default: { name: \"SnowTrace\", url: \"https://snowtrace.io\" }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 11907934\n }\n }\n};\n\n// src/avalancheFuji.ts\nvar avalancheFuji = {\n id: 43113,\n name: \"Avalanche Fuji\",\n network: \"avalanche-fuji\",\n nativeCurrency: {\n decimals: 18,\n name: \"Avalanche Fuji\",\n symbol: \"AVAX\"\n },\n rpcUrls: {\n default: { http: [\"https://api.avax-test.network/ext/bc/C/rpc\"] },\n public: { http: [\"https://api.avax-test.network/ext/bc/C/rpc\"] }\n },\n blockExplorers: {\n etherscan: { name: \"SnowTrace\", url: \"https://testnet.snowtrace.io\" },\n default: { name: \"SnowTrace\", url: \"https://testnet.snowtrace.io\" }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 7096959\n }\n },\n testnet: true\n};\n\n// src/base.ts\nvar base = {\n id: 8453,\n network: \"base\",\n name: \"Base\",\n nativeCurrency: { name: \"Base\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://developer-access-mainnet.base.org\"]\n },\n public: {\n http: [\"https://developer-access-mainnet.base.org\"]\n }\n },\n blockExplorers: {\n blockscout: {\n name: \"Basescout\",\n url: \"https://base.blockscout.com\"\n },\n default: {\n name: \"Basescan\",\n url: \"https://basescan.org\"\n },\n etherscan: {\n name: \"Basescan\",\n url: \"https://basescan.org\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 5022\n }\n }\n};\n\n// src/baseGoerli.ts\nvar baseGoerli = {\n id: 84531,\n network: \"base-goerli\",\n name: \"Base Goerli\",\n nativeCurrency: { name: \"Base Goerli\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://goerli.base.org\"]\n },\n public: {\n http: [\"https://goerli.base.org\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"Basescan\",\n url: \"https://goerli.basescan.org\"\n },\n default: {\n name: \"Basescan\",\n url: \"https://goerli.basescan.org\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 1376988\n }\n },\n testnet: true\n};\n\n// src/bearNetworkChainMainnet.ts\nvar bearNetworkChainMainnet = {\n id: 641230,\n name: \"Bear Network Chain Mainnet\",\n network: \"BearNetworkChainMainnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"BearNetworkChain\",\n symbol: \"BRNKC\"\n },\n rpcUrls: {\n public: { http: [\"https://brnkc-mainnet.bearnetwork.net\"] },\n default: { http: [\"https://brnkc-mainnet.bearnetwork.net\"] }\n },\n blockExplorers: {\n default: { name: \"BrnkScan\", url: \"https://brnkscan.bearnetwork.net\" }\n }\n};\n\n// src/bearNetworkChainTestnet.ts\nvar bearNetworkChainTestnet = {\n id: 751230,\n name: \"Bear Network Chain Testnet\",\n network: \"BearNetworkChainTestnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"tBRNKC\",\n symbol: \"tBRNKC\"\n },\n rpcUrls: {\n public: { http: [\"https://brnkc-test.bearnetwork.net\"] },\n default: { http: [\"https://brnkc-test.bearnetwork.net\"] }\n },\n blockExplorers: {\n default: {\n name: \"BrnkTestScan\",\n url: \"https://brnktest-scan.bearnetwork.net\"\n }\n },\n testnet: true\n};\n\n// src/boba.ts\nvar boba = {\n id: 288,\n name: \"Boba Network\",\n network: \"boba\",\n nativeCurrency: {\n decimals: 18,\n name: \"Boba\",\n symbol: \"BOBA\"\n },\n rpcUrls: {\n default: { http: [\"https://mainnet.boba.network\"] },\n public: { http: [\"https://mainnet.boba.network\"] }\n },\n blockExplorers: {\n etherscan: { name: \"BOBAScan\", url: \"https://bobascan.com\" },\n default: { name: \"BOBAScan\", url: \"https://bobascan.com\" }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 446859\n }\n }\n};\n\n// src/bronos.ts\nvar bronos = {\n id: 1039,\n name: \"Bronos\",\n network: \"bronos\",\n nativeCurrency: {\n decimals: 18,\n name: \"BRO\",\n symbol: \"BRO\"\n },\n rpcUrls: {\n default: { http: [\"https://evm.bronos.org\"] },\n public: { http: [\"https://evm.bronos.org\"] }\n },\n blockExplorers: {\n default: { name: \"BronoScan\", url: \"https://broscan.bronos.org\" }\n }\n};\n\n// src/bronosTestnet.ts\nvar bronosTestnet = {\n id: 1038,\n name: \"Bronos Testnet\",\n network: \"bronos-testnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"Bronos Coin\",\n symbol: \"tBRO\"\n },\n rpcUrls: {\n default: { http: [\"https://evm-testnet.bronos.org\"] },\n public: { http: [\"https://evm-testnet.bronos.org\"] }\n },\n blockExplorers: {\n default: { name: \"BronoScan\", url: \"https://tbroscan.bronos.org\" }\n },\n testnet: true\n};\n\n// src/bsc.ts\nvar bsc = {\n id: 56,\n name: \"BNB Smart Chain\",\n network: \"bsc\",\n nativeCurrency: {\n decimals: 18,\n name: \"BNB\",\n symbol: \"BNB\"\n },\n rpcUrls: {\n default: { http: [\"https://rpc.ankr.com/bsc\"] },\n public: { http: [\"https://rpc.ankr.com/bsc\"] }\n },\n blockExplorers: {\n etherscan: { name: \"BscScan\", url: \"https://bscscan.com\" },\n default: { name: \"BscScan\", url: \"https://bscscan.com\" }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 15921452\n }\n }\n};\n\n// src/bscTestnet.ts\nvar bscTestnet = {\n id: 97,\n name: \"Binance Smart Chain Testnet\",\n network: \"bsc-testnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"BNB\",\n symbol: \"tBNB\"\n },\n rpcUrls: {\n default: { http: [\"https://data-seed-prebsc-1-s1.binance.org:8545\"] },\n public: { http: [\"https://data-seed-prebsc-1-s1.binance.org:8545\"] }\n },\n blockExplorers: {\n etherscan: { name: \"BscScan\", url: \"https://testnet.bscscan.com\" },\n default: { name: \"BscScan\", url: \"https://testnet.bscscan.com\" }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 17422483\n }\n },\n testnet: true\n};\n\n// src/bxn.ts\nvar bxn = {\n id: 4999,\n name: \"BlackFort Exchange Network\",\n network: \"bxn\",\n nativeCurrency: { name: \"BlackFort Token\", symbol: \"BXN\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://mainnet.blackfort.network/rpc\"]\n },\n public: {\n http: [\"https://mainnet.blackfort.network/rpc\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Blockscout\",\n url: \"https://explorer.blackfort.network\"\n }\n }\n};\n\n// src/bxnTestnet.ts\nvar bxnTestnet = {\n id: 4777,\n name: \"BlackFort Exchange Network Testnet\",\n network: \"bxnTestnet\",\n nativeCurrency: {\n name: \"BlackFort Testnet Token\",\n symbol: \"TBXN\",\n decimals: 18\n },\n rpcUrls: {\n default: {\n http: [\"https://testnet.blackfort.network/rpc\"]\n },\n public: {\n http: [\"https://testnet.blackfort.network/rpc\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Blockscout\",\n url: \"https://testnet-explorer.blackfort.network\"\n }\n }\n};\n\n// src/canto.ts\nvar canto = {\n id: 7700,\n name: \"Canto\",\n network: \"canto\",\n nativeCurrency: {\n decimals: 18,\n name: \"Canto\",\n symbol: \"CANTO\"\n },\n rpcUrls: {\n default: { http: [\"https://canto.gravitychain.io\"] },\n public: { http: [\"https://canto.gravitychain.io\"] }\n },\n blockExplorers: {\n default: {\n name: \"Tuber.Build (Blockscout)\",\n url: \"https://tuber.build\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 2905789\n }\n }\n};\n\n// src/celo.ts\nvar celo = {\n id: 42220,\n name: \"Celo\",\n network: \"celo\",\n nativeCurrency: {\n decimals: 18,\n name: \"CELO\",\n symbol: \"CELO\"\n },\n rpcUrls: {\n default: { http: [\"https://forno.celo.org\"] },\n infura: {\n http: [\"https://celo-mainnet.infura.io/v3\"]\n },\n public: {\n http: [\"https://forno.celo.org\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Celo Explorer\",\n url: \"https://explorer.celo.org/mainnet\"\n },\n etherscan: { name: \"CeloScan\", url: \"https://celoscan.io\" }\n },\n contracts: {\n multicall3: {\n address: \"0xcA11bde05977b3631167028862bE2a173976CA11\",\n blockCreated: 13112599\n }\n },\n testnet: false\n};\n\n// src/celoAlfajores.ts\nvar celoAlfajores = {\n id: 44787,\n name: \"Alfajores\",\n network: \"celo-alfajores\",\n nativeCurrency: {\n decimals: 18,\n name: \"CELO\",\n symbol: \"A-CELO\"\n },\n rpcUrls: {\n default: {\n http: [\"https://alfajores-forno.celo-testnet.org\"]\n },\n infura: {\n http: [\"https://celo-alfajores.infura.io/v3\"]\n },\n public: {\n http: [\"https://alfajores-forno.celo-testnet.org\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Celo Explorer\",\n url: \"https://explorer.celo.org/alfajores\"\n },\n etherscan: { name: \"CeloScan\", url: \"https://alfajores.celoscan.io/\" }\n },\n contracts: {\n multicall3: {\n address: \"0xcA11bde05977b3631167028862bE2a173976CA11\",\n blockCreated: 14569001\n }\n },\n testnet: true\n};\n\n// src/celoCannoli.ts\nvar celoCannoli = {\n id: 17323,\n name: \"Cannoli\",\n network: \"celo-cannoli\",\n nativeCurrency: {\n decimals: 18,\n name: \"CELO\",\n symbol: \"C-CELO\"\n },\n rpcUrls: {\n default: {\n http: [\"https://forno.cannoli.celo-testnet.org\"]\n },\n public: {\n http: [\"https://forno.cannoli.celo-testnet.org\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Celo Explorer\",\n url: \"https://explorer.celo.org/cannoli\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0x5Acb0aa8BF4E8Ff0d882Ee187140713C12BF9718\",\n blockCreated: 87429\n }\n },\n testnet: true\n};\n\n// src/confluxESpace.ts\nvar confluxESpace = {\n id: 1030,\n name: \"Conflux eSpace\",\n network: \"cfx-espace\",\n nativeCurrency: { name: \"Conflux\", symbol: \"CFX\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://evm.confluxrpc.org\"]\n },\n public: {\n http: [\"https://evm.confluxrpc.org\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"ConfluxScan\",\n url: \"https://evm.confluxscan.io\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xEFf0078910f638cd81996cc117bccD3eDf2B072F\",\n blockCreated: 68602935\n }\n }\n};\n\n// src/cronos.ts\nvar cronos = {\n id: 25,\n name: \"Cronos\",\n network: \"cronos\",\n nativeCurrency: {\n decimals: 18,\n name: \"Cronos\",\n symbol: \"CRO\"\n },\n rpcUrls: {\n default: { http: [\"https://node.croswap.com/rpc\"] },\n public: { http: [\"https://node.croswap.com/rpc\"] }\n },\n blockExplorers: {\n default: { name: \"CronosScan\", url: \"https://cronoscan.com\" }\n },\n contracts: {\n multicall3: {\n address: \"0xcA11bde05977b3631167028862bE2a173976CA11\",\n blockCreated: 1963112\n }\n }\n};\n\n// src/cronosTestnet.ts\nvar cronosTestnet = {\n id: 338,\n name: \"Cronos Testnet\",\n network: \"cronos-testnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"CRO\",\n symbol: \"tCRO\"\n },\n rpcUrls: {\n default: { http: [\"https://evm-t3.cronos.org\"] },\n public: { http: [\"https://evm-t3.cronos.org\"] }\n },\n blockExplorers: {\n default: {\n name: \"Cronos Explorer\",\n url: \"https://cronos.org/explorer/testnet3\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xcA11bde05977b3631167028862bE2a173976CA11\",\n blockCreated: 10191251\n }\n },\n testnet: true\n};\n\n// src/crossbell.ts\nvar crossbell = {\n id: 3737,\n network: \"crossbell\",\n name: \"Crossbell\",\n nativeCurrency: {\n decimals: 18,\n name: \"CSB\",\n symbol: \"CSB\"\n },\n rpcUrls: {\n default: {\n http: [\"https://rpc.crossbell.io\"]\n },\n public: {\n http: [\"https://rpc.crossbell.io\"]\n }\n },\n blockExplorers: {\n default: { name: \"CrossScan\", url: \"https://scan.crossbell.io\" }\n },\n contracts: {\n multicall3: {\n address: \"0xBB9759009cDaC82774EfC84D94cD9F7440f75Fcf\",\n blockCreated: 23499787\n }\n }\n};\n\n// src/dfk.ts\nvar dfk = {\n id: 53935,\n name: \"DFK Chain\",\n network: \"dfk\",\n nativeCurrency: {\n decimals: 18,\n name: \"Jewel\",\n symbol: \"JEWEL\"\n },\n rpcUrls: {\n default: {\n http: [\"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc\"]\n },\n public: {\n http: [\"https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"DFKSubnetScan\",\n url: \"https://subnets.avax.network/defi-kingdoms\"\n },\n default: {\n name: \"DFKSubnetScan\",\n url: \"https://subnets.avax.network/defi-kingdoms\"\n }\n }\n};\n\n// src/dogechain.ts\nvar dogechain = {\n id: 2e3,\n name: \"Dogechain\",\n network: \"dogechain\",\n nativeCurrency: {\n decimals: 18,\n name: \"Dogechain\",\n symbol: \"DC\"\n },\n rpcUrls: {\n default: { http: [\"https://rpc.dogechain.dog\"] },\n public: { http: [\"https://rpc.dogechain.dog\"] }\n },\n blockExplorers: {\n etherscan: {\n name: \"DogeChainExplorer\",\n url: \"https://explorer.dogechain.dog\"\n },\n default: {\n name: \"DogeChainExplorer\",\n url: \"https://explorer.dogechain.dog\"\n }\n }\n};\n\n// src/edgeware.ts\nvar edgeware = {\n id: 2021,\n name: \"Edgeware EdgeEVM Mainnet\",\n network: \"edgeware\",\n nativeCurrency: {\n decimals: 18,\n name: \"Edgeware\",\n symbol: \"EDG\"\n },\n rpcUrls: {\n default: { http: [\"https://edgeware-evm.jelliedowl.net\"] },\n public: { http: [\"https://edgeware-evm.jelliedowl.net\"] }\n },\n blockExplorers: {\n etherscan: { name: \"Edgscan by Bharathcoorg\", url: \"https://edgscan.live\" },\n default: { name: \"Edgscan by Bharathcoorg\", url: \"https://edgscan.live\" }\n },\n contracts: {\n multicall3: {\n address: \"0xDDF47eEB4e5FF4AA60e063E0Ec4f7C35B47Ed445\",\n blockCreated: 17126780\n }\n }\n};\n\n// src/edgewareTestnet.ts\nvar edgewareTestnet = {\n id: 2022,\n name: \"Beresheet BereEVM Testnet\",\n network: \"edgewareTestnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"Testnet EDG\",\n symbol: \"tEDG\"\n },\n rpcUrls: {\n default: { http: [\"https://beresheet-evm.jelliedowl.net\"] },\n public: { http: [\"https://beresheet-evm.jelliedowl.net\"] }\n },\n blockExplorers: {\n etherscan: {\n name: \"Edgscan by Bharathcoorg\",\n url: \"https://testnet.edgscan.live\"\n },\n default: {\n name: \"Edgscan by Bharathcoorg\",\n url: \"https://testnet.edgscan.live\"\n }\n }\n};\n\n// src/eos.ts\nvar eos = {\n id: 17777,\n name: \"EOS EVM\",\n network: \"eos\",\n nativeCurrency: {\n decimals: 18,\n name: \"EOS\",\n symbol: \"EOS\"\n },\n rpcUrls: {\n default: { http: [\"https://api.evm.eosnetwork.com\"] },\n public: { http: [\"https://api.evm.eosnetwork.com\"] }\n },\n blockExplorers: {\n etherscan: {\n name: \"EOS EVM Explorer\",\n url: \"https://explorer.evm.eosnetwork.com\"\n },\n default: {\n name: \"EOS EVM Explorer\",\n url: \"https://explorer.evm.eosnetwork.com\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 7943933\n }\n }\n};\n\n// src/eosTestnet.ts\nvar eosTestnet = {\n id: 15557,\n name: \"EOS EVM Testnet\",\n network: \"eos\",\n nativeCurrency: {\n decimals: 18,\n name: \"EOS\",\n symbol: \"EOS\"\n },\n rpcUrls: {\n default: { http: [\"https://api.testnet.evm.eosnetwork.com\"] },\n public: { http: [\"https://api.testnet.evm.eosnetwork.com\"] }\n },\n blockExplorers: {\n etherscan: {\n name: \"EOS EVM Testnet Explorer\",\n url: \"https://explorer.testnet.evm.eosnetwork.com\"\n },\n default: {\n name: \"EOS EVM Testnet Explorer\",\n url: \"https://explorer.testnet.evm.eosnetwork.com\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 9067940\n }\n },\n testnet: true\n};\n\n// src/evmos.ts\nvar evmos = {\n id: 9001,\n name: \"Evmos\",\n network: \"evmos\",\n nativeCurrency: {\n decimals: 18,\n name: \"Evmos\",\n symbol: \"EVMOS\"\n },\n rpcUrls: {\n default: { http: [\"https://eth.bd.evmos.org:8545\"] },\n public: { http: [\"https://eth.bd.evmos.org:8545\"] }\n },\n blockExplorers: {\n default: { name: \"Evmos Block Explorer\", url: \"https://escan.live\" }\n }\n};\n\n// src/evmosTestnet.ts\nvar evmosTestnet = {\n id: 9e3,\n name: \"Evmos Testnet\",\n network: \"evmos-testnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"Evmos\",\n symbol: \"EVMOS\"\n },\n rpcUrls: {\n default: { http: [\"https://eth.bd.evmos.dev:8545\"] },\n public: { http: [\"https://eth.bd.evmos.dev:8545\"] }\n },\n blockExplorers: {\n default: {\n name: \"Evmos Testnet Block Explorer\",\n url: \"https://evm.evmos.dev/\"\n }\n }\n};\n\n// src/ekta.ts\nvar ekta = {\n id: 1994,\n name: \"Ekta\",\n network: \"ekta\",\n nativeCurrency: {\n decimals: 18,\n name: \"EKTA\",\n symbol: \"EKTA\"\n },\n rpcUrls: {\n public: { http: [\"https://main.ekta.io\"] },\n default: { http: [\"https://main.ekta.io\"] }\n },\n blockExplorers: {\n default: { name: \"Ektascan\", url: \"https://ektascan.io\" }\n }\n};\n\n// src/ektaTestnet.ts\nvar ektaTestnet = {\n id: 1004,\n name: \"Ekta Testnet\",\n network: \"ekta-testnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"EKTA\",\n symbol: \"EKTA\"\n },\n rpcUrls: {\n public: { http: [\"https://test.ekta.io:8545\"] },\n default: { http: [\"https://test.ekta.io:8545\"] }\n },\n blockExplorers: {\n default: { name: \"Test Ektascan\", url: \"https://test.ektascan.io\" }\n },\n testnet: true\n};\n\n// src/fantom.ts\nvar fantom = {\n id: 250,\n name: \"Fantom\",\n network: \"fantom\",\n nativeCurrency: {\n decimals: 18,\n name: \"Fantom\",\n symbol: \"FTM\"\n },\n rpcUrls: {\n default: { http: [\"https://rpc.ankr.com/fantom\"] },\n public: { http: [\"https://rpc.ankr.com/fantom\"] }\n },\n blockExplorers: {\n etherscan: { name: \"FTMScan\", url: \"https://ftmscan.com\" },\n default: { name: \"FTMScan\", url: \"https://ftmscan.com\" }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 33001987\n }\n }\n};\n\n// src/fantomTestnet.ts\nvar fantomTestnet = {\n id: 4002,\n name: \"Fantom Testnet\",\n network: \"fantom-testnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"Fantom\",\n symbol: \"FTM\"\n },\n rpcUrls: {\n default: { http: [\"https://rpc.testnet.fantom.network\"] },\n public: { http: [\"https://rpc.testnet.fantom.network\"] }\n },\n blockExplorers: {\n etherscan: { name: \"FTMScan\", url: \"https://testnet.ftmscan.com\" },\n default: { name: \"FTMScan\", url: \"https://testnet.ftmscan.com\" }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 8328688\n }\n }\n};\n\n// src/fibo.ts\nvar fibo = {\n id: 12306,\n name: \"Fibo Chain\",\n network: \"fibochain\",\n nativeCurrency: {\n decimals: 18,\n name: \"fibo\",\n symbol: \"FIBO\"\n },\n rpcUrls: {\n default: { http: [\"https://network.hzroc.art\"] },\n public: { http: [\"https://network.hzroc.art\"] }\n },\n blockExplorers: {\n default: { name: \"FiboScan\", url: \"https://scan.fibochain.org\" }\n }\n};\n\n// src/filecoin.ts\nvar filecoin = {\n id: 314,\n name: \"Filecoin Mainnet\",\n network: \"filecoin-mainnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"filecoin\",\n symbol: \"FIL\"\n },\n rpcUrls: {\n default: { http: [\"https://api.node.glif.io/rpc/v1\"] },\n public: { http: [\"https://api.node.glif.io/rpc/v1\"] }\n },\n blockExplorers: {\n default: { name: \"Filfox\", url: \"https://filfox.info/en\" },\n filscan: { name: \"Filscan\", url: \"https://filscan.io\" },\n filscout: { name: \"Filscout\", url: \"https://filscout.io/en\" },\n glif: { name: \"Glif\", url: \"https://explorer.glif.io\" }\n }\n};\n\n// src/filecoinCalibration.ts\nvar filecoinCalibration = {\n id: 314159,\n name: \"Filecoin Calibration\",\n network: \"filecoin-calibration\",\n nativeCurrency: {\n decimals: 18,\n name: \"testnet filecoin\",\n symbol: \"tFIL\"\n },\n rpcUrls: {\n default: { http: [\"https://api.calibration.node.glif.io/rpc/v1\"] },\n public: { http: [\"https://api.calibration.node.glif.io/rpc/v1\"] }\n },\n blockExplorers: {\n default: { name: \"Filscan\", url: \"https://calibration.filscan.io\" }\n }\n};\n\n// src/filecoinHyperspace.ts\nvar filecoinHyperspace = {\n id: 3141,\n name: \"Filecoin Hyperspace\",\n network: \"filecoin-hyperspace\",\n nativeCurrency: {\n decimals: 18,\n name: \"testnet filecoin\",\n symbol: \"tFIL\"\n },\n rpcUrls: {\n default: { http: [\"https://api.hyperspace.node.glif.io/rpc/v1\"] },\n public: { http: [\"https://api.hyperspace.node.glif.io/rpc/v1\"] }\n },\n blockExplorers: {\n default: { name: \"Filfox\", url: \"https://hyperspace.filfox.info/en\" },\n filscan: { name: \"Filscan\", url: \"https://hyperspace.filscan.io\" }\n }\n};\n\n// src/flare.ts\nvar flare = {\n id: 14,\n name: \"Flare Mainnet\",\n network: \"flare-mainnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"flare\",\n symbol: \"FLR\"\n },\n rpcUrls: {\n default: { http: [\"https://flare-api.flare.network/ext/C/rpc\"] },\n public: { http: [\"https://flare-api.flare.network/ext/C/rpc\"] }\n },\n blockExplorers: {\n default: {\n name: \"Flare Explorer\",\n url: \"https://flare-explorer.flare.network\"\n }\n }\n};\n\n// src/flareTestnet.ts\nvar flareTestnet = {\n id: 114,\n name: \"Coston2\",\n network: \"coston2\",\n nativeCurrency: {\n decimals: 18,\n name: \"coston2flare\",\n symbol: \"C2FLR\"\n },\n rpcUrls: {\n default: { http: [\"https://coston2-api.flare.network/ext/C/rpc\"] },\n public: { http: [\"https://coston2-api.flare.network/ext/C/rpc\"] }\n },\n blockExplorers: {\n default: {\n name: \"Coston2 Explorer\",\n url: \"https://coston2-explorer.flare.network\"\n }\n },\n testnet: true\n};\n\n// src/foundry.ts\nvar foundry = {\n id: 31337,\n name: \"Foundry\",\n network: \"foundry\",\n nativeCurrency: {\n decimals: 18,\n name: \"Ether\",\n symbol: \"ETH\"\n },\n rpcUrls: {\n default: {\n http: [\"http://127.0.0.1:8545\"],\n webSocket: [\"ws://127.0.0.1:8545\"]\n },\n public: {\n http: [\"http://127.0.0.1:8545\"],\n webSocket: [\"ws://127.0.0.1:8545\"]\n }\n }\n};\n\n// src/fuse.ts\nvar fuse = {\n id: 122,\n name: \"Fuse\",\n network: \"fuse\",\n nativeCurrency: { name: \"Fuse\", symbol: \"FUSE\", decimals: 18 },\n rpcUrls: {\n default: { http: [\"https://rpc.fuse.io\"] },\n public: { http: [\"https://fuse-mainnet.chainstacklabs.com\"] }\n },\n blockExplorers: {\n default: { name: \"Fuse Explorer\", url: \"https://explorer.fuse.io\" }\n }\n};\n\n// src/iotex.ts\nvar iotex = {\n id: 4689,\n name: \"IoTeX\",\n network: \"iotex\",\n nativeCurrency: {\n decimals: 18,\n name: \"IoTeX\",\n symbol: \"IOTX\"\n },\n rpcUrls: {\n default: {\n http: [\"https://babel-api.mainnet.iotex.io\"],\n webSocket: [\"wss://babel-api.mainnet.iotex.io\"]\n },\n public: {\n http: [\"https://babel-api.mainnet.iotex.io\"],\n webSocket: [\"wss://babel-api.mainnet.iotex.io\"]\n }\n },\n blockExplorers: {\n default: { name: \"IoTeXScan\", url: \"https://iotexscan.io\" }\n }\n};\n\n// src/iotexTestnet.ts\nvar iotexTestnet = {\n id: 4690,\n name: \"IoTeX Testnet\",\n network: \"iotex-testnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"IoTeX\",\n symbol: \"IOTX\"\n },\n rpcUrls: {\n default: {\n http: [\"https://babel-api.testnet.iotex.io\"],\n webSocket: [\"wss://babel-api.testnet.iotex.io\"]\n },\n public: {\n http: [\"https://babel-api.testnet.iotex.io\"],\n webSocket: [\"wss://babel-api.testnet.iotex.io\"]\n }\n },\n blockExplorers: {\n default: { name: \"IoTeXScan\", url: \"https://testnet.iotexscan.io\" }\n }\n};\n\n// src/goerli.ts\nvar goerli = {\n id: 5,\n network: \"goerli\",\n name: \"Goerli\",\n nativeCurrency: { name: \"Goerli Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n alchemy: {\n http: [\"https://eth-goerli.g.alchemy.com/v2\"],\n webSocket: [\"wss://eth-goerli.g.alchemy.com/v2\"]\n },\n infura: {\n http: [\"https://goerli.infura.io/v3\"],\n webSocket: [\"wss://goerli.infura.io/ws/v3\"]\n },\n default: {\n http: [\"https://rpc.ankr.com/eth_goerli\"]\n },\n public: {\n http: [\"https://rpc.ankr.com/eth_goerli\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"Etherscan\",\n url: \"https://goerli.etherscan.io\"\n },\n default: {\n name: \"Etherscan\",\n url: \"https://goerli.etherscan.io\"\n }\n },\n contracts: {\n ensRegistry: {\n address: \"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e\"\n },\n ensUniversalResolver: {\n address: \"0x56522D00C410a43BFfDF00a9A569489297385790\",\n blockCreated: 8765204\n },\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 6507670\n }\n },\n testnet: true\n};\n\n// src/gnosis.ts\nvar gnosis = {\n id: 100,\n name: \"Gnosis\",\n network: \"gnosis\",\n nativeCurrency: {\n decimals: 18,\n name: \"Gnosis\",\n symbol: \"xDAI\"\n },\n rpcUrls: {\n default: { http: [\"https://rpc.gnosischain.com\"] },\n public: { http: [\"https://rpc.gnosischain.com\"] }\n },\n blockExplorers: {\n etherscan: {\n name: \"Gnosisscan\",\n url: \"https://gnosisscan.io\"\n },\n default: {\n name: \"Gnosis Chain Explorer\",\n url: \"https://blockscout.com/xdai/mainnet\"\n }\n }\n};\n\n// src/gnosisChiado.ts\nvar gnosisChiado = {\n id: 10200,\n name: \"Gnosis Chiado\",\n network: \"chiado\",\n nativeCurrency: {\n decimals: 18,\n name: \"Gnosis\",\n symbol: \"xDAI\"\n },\n rpcUrls: {\n default: { http: [\"https://rpc.chiadochain.net\"] },\n public: { http: [\"https://rpc.chiadochain.net\"] }\n },\n blockExplorers: {\n default: {\n name: \"Blockscout\",\n url: \"https://blockscout.chiadochain.net\"\n }\n }\n};\n\n// src/hardhat.ts\nvar hardhat = {\n id: 31337,\n name: \"Hardhat\",\n network: \"hardhat\",\n nativeCurrency: {\n decimals: 18,\n name: \"Ether\",\n symbol: \"ETH\"\n },\n rpcUrls: {\n default: { http: [\"http://127.0.0.1:8545\"] },\n public: { http: [\"http://127.0.0.1:8545\"] }\n }\n};\n\n// src/harmonyOne.ts\nvar harmonyOne = {\n id: 16666e5,\n name: \"Harmony One\",\n network: \"harmony\",\n nativeCurrency: {\n name: \"Harmony\",\n symbol: \"ONE\",\n decimals: 18\n },\n rpcUrls: {\n public: { http: [\"https://rpc.ankr.com/harmony\"] },\n default: { http: [\"https://rpc.ankr.com/harmony\"] }\n },\n blockExplorers: {\n default: { name: \"Harmony Explorer\", url: \"https://explorer.harmony.one\" }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 24185753\n }\n }\n};\n\n// src/haqqMainnet.ts\nvar haqqMainnet = {\n id: 11235,\n name: \"HAQQ Mainnet\",\n network: \"haqq-mainnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"Islamic Coin\",\n symbol: \"ISLM\"\n },\n rpcUrls: {\n default: {\n http: [\"https://rpc.eth.haqq.network\"]\n },\n public: {\n http: [\"https://rpc.eth.haqq.network\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"HAQQ Explorer\",\n url: \"https://explorer.haqq.network\"\n }\n }\n};\n\n// src/haqqTestedge2.ts\nvar haqqTestedge2 = {\n id: 54211,\n name: \"HAQQ Testedge 2\",\n network: \"haqq-testedge-2\",\n nativeCurrency: {\n decimals: 18,\n name: \"Islamic Coin\",\n symbol: \"ISLMT\"\n },\n rpcUrls: {\n default: {\n http: [\"https://rpc.eth.testedge2.haqq.network\"]\n },\n public: {\n http: [\"https://rpc.eth.testedge2.haqq.network\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"HAQQ Explorer\",\n url: \"https://explorer.testedge2.haqq.network\"\n }\n }\n};\n\n// src/klaytn.ts\nvar klaytn = {\n id: 8217,\n name: \"Klaytn\",\n network: \"klaytn\",\n nativeCurrency: {\n decimals: 18,\n name: \"Klaytn\",\n symbol: \"KLAY\"\n },\n rpcUrls: {\n default: { http: [\"https://cypress.fautor.app/archive\"] },\n public: { http: [\"https://cypress.fautor.app/archive\"] }\n },\n blockExplorers: {\n etherscan: { name: \"KlaytnScope\", url: \"https://scope.klaytn.com\" },\n default: { name: \"KlaytnScope\", url: \"https://scope.klaytn.com\" }\n }\n};\n\n// src/lineaTestnet.ts\nvar lineaTestnet = {\n id: 59140,\n name: \"Linea Goerli Testnet\",\n network: \"linea-testnet\",\n nativeCurrency: { name: \"Linea Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n infura: {\n http: [\"https://consensys-zkevm-goerli-prealpha.infura.io/v3\"],\n webSocket: [\"wss://consensys-zkevm-goerli-prealpha.infura.io/ws/v3\"]\n },\n default: {\n http: [\"https://rpc.goerli.linea.build\"],\n webSocket: [\"wss://rpc.goerli.linea.build\"]\n },\n public: {\n http: [\"https://rpc.goerli.linea.build\"],\n webSocket: [\"wss://rpc.goerli.linea.build\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"BlockScout\",\n url: \"https://explorer.goerli.linea.build\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 498623\n }\n },\n testnet: true\n};\n\n// src/localhost.ts\nvar localhost = {\n id: 1337,\n name: \"Localhost\",\n network: \"localhost\",\n nativeCurrency: {\n decimals: 18,\n name: \"Ether\",\n symbol: \"ETH\"\n },\n rpcUrls: {\n default: { http: [\"http://127.0.0.1:8545\"] },\n public: { http: [\"http://127.0.0.1:8545\"] }\n }\n};\n\n// src/mainnet.ts\nvar mainnet = {\n id: 1,\n network: \"homestead\",\n name: \"Ethereum\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n alchemy: {\n http: [\"https://eth-mainnet.g.alchemy.com/v2\"],\n webSocket: [\"wss://eth-mainnet.g.alchemy.com/v2\"]\n },\n infura: {\n http: [\"https://mainnet.infura.io/v3\"],\n webSocket: [\"wss://mainnet.infura.io/ws/v3\"]\n },\n default: {\n http: [\"https://cloudflare-eth.com\"]\n },\n public: {\n http: [\"https://cloudflare-eth.com\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"Etherscan\",\n url: \"https://etherscan.io\"\n },\n default: {\n name: \"Etherscan\",\n url: \"https://etherscan.io\"\n }\n },\n contracts: {\n ensRegistry: {\n address: \"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e\"\n },\n ensUniversalResolver: {\n address: \"0xc0497E381f536Be9ce14B0dD3817cBcAe57d2F62\",\n blockCreated: 16966585\n },\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 14353601\n }\n }\n};\n\n// src/mantle.ts\nvar mantle = {\n id: 5e3,\n name: \"Mantle\",\n network: \"mantle\",\n nativeCurrency: {\n decimals: 18,\n name: \"MNT\",\n symbol: \"MNT\"\n },\n rpcUrls: {\n default: { http: [\"https://rpc.mantle.xyz\"] },\n public: { http: [\"https://rpc.mantle.xyz\"] }\n },\n blockExplorers: {\n etherscan: {\n name: \"Mantle Testnet Explorer\",\n url: \"https://explorer.mantle.xyz\"\n },\n default: {\n name: \"Mantle Testnet Explorer\",\n url: \"https://explorer.mantle.xyz\"\n }\n }\n};\n\n// src/mantleTestnet.ts\nvar mantleTestnet = {\n id: 5001,\n name: \"Mantle Testnet\",\n network: \"mantle\",\n nativeCurrency: {\n decimals: 18,\n name: \"MNT\",\n symbol: \"MNT\"\n },\n rpcUrls: {\n default: { http: [\"https://rpc.testnet.mantle.xyz\"] },\n public: { http: [\"https://rpc.testnet.mantle.xyz\"] }\n },\n blockExplorers: {\n etherscan: {\n name: \"Mantle Testnet Explorer\",\n url: \"https://explorer.testnet.mantle.xyz\"\n },\n default: {\n name: \"Mantle Testnet Explorer\",\n url: \"https://explorer.testnet.mantle.xyz\"\n }\n },\n testnet: true\n};\n\n// src/metis.ts\nvar metis = {\n id: 1088,\n name: \"Metis\",\n network: \"andromeda\",\n nativeCurrency: {\n decimals: 18,\n name: \"Metis\",\n symbol: \"METIS\"\n },\n rpcUrls: {\n default: { http: [\"https://andromeda.metis.io/?owner=1088\"] },\n public: { http: [\"https://andromeda.metis.io/?owner=1088\"] }\n },\n blockExplorers: {\n default: {\n name: \"Andromeda Explorer\",\n url: \"https://andromeda-explorer.metis.io\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 2338552\n }\n }\n};\n\n// src/metisGoerli.ts\nvar metisGoerli = {\n id: 599,\n name: \"Metis Goerli\",\n network: \"metis-goerli\",\n nativeCurrency: {\n decimals: 18,\n name: \"Metis Goerli\",\n symbol: \"METIS\"\n },\n rpcUrls: {\n default: { http: [\"https://goerli.gateway.metisdevops.link\"] },\n public: { http: [\"https://goerli.gateway.metisdevops.link\"] }\n },\n blockExplorers: {\n default: {\n name: \"Metis Goerli Explorer\",\n url: \"https://goerli.explorer.metisdevops.link\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 1006207\n }\n }\n};\n\n// src/mev.ts\nvar mev = {\n id: 7518,\n network: \"MEVerse\",\n name: \"MEVerse Chain Mainnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"MEVerse\",\n symbol: \"MEV\"\n },\n rpcUrls: {\n default: {\n http: [\"https://rpc.meversemainnet.io\"]\n },\n public: {\n http: [\"https://rpc.meversemainnet.io\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Explorer\",\n url: \"https://www.meversescan.io\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 86881340\n }\n }\n};\n\n// src/mevTestnet.ts\nvar mevTestnet = {\n id: 4759,\n network: \"MEVerse Testnet\",\n name: \"MEVerse Chain Testnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"MEVerse\",\n symbol: \"MEV\"\n },\n rpcUrls: {\n default: {\n http: [\"https://rpc.meversetestnet.io\"]\n },\n public: {\n http: [\"https://rpc.meversetestnet.io\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Explorer\",\n url: \"https://testnet.meversescan.io/\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 64371115\n }\n },\n testnet: true\n};\n\n// src/moonbaseAlpha.ts\nvar moonbaseAlpha = {\n id: 1287,\n name: \"Moonbase Alpha\",\n network: \"moonbase-alpha\",\n nativeCurrency: {\n decimals: 18,\n name: \"DEV\",\n symbol: \"DEV\"\n },\n rpcUrls: {\n default: {\n http: [\"https://rpc.api.moonbase.moonbeam.network\"],\n webSocket: [\"wss://wss.api.moonbase.moonbeam.network\"]\n },\n public: {\n http: [\"https://rpc.api.moonbase.moonbeam.network\"],\n webSocket: [\"wss://wss.api.moonbase.moonbeam.network\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Moonscan\",\n url: \"https://moonbase.moonscan.io\"\n },\n etherscan: {\n name: \"Moonscan\",\n url: \"https://moonbase.moonscan.io\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xcA11bde05977b3631167028862bE2a173976CA11\",\n blockCreated: 1850686\n }\n },\n testnet: true\n};\n\n// src/moonbeam.ts\nvar moonbeam = {\n id: 1284,\n name: \"Moonbeam\",\n network: \"moonbeam\",\n nativeCurrency: {\n decimals: 18,\n name: \"GLMR\",\n symbol: \"GLMR\"\n },\n rpcUrls: {\n public: {\n http: [\"https://moonbeam.public.blastapi.io\"],\n webSocket: [\"wss://moonbeam.public.blastapi.io\"]\n },\n default: {\n http: [\"https://moonbeam.public.blastapi.io\"],\n webSocket: [\"wss://moonbeam.public.blastapi.io\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Moonscan\",\n url: \"https://moonscan.io\"\n },\n etherscan: {\n name: \"Moonscan\",\n url: \"https://moonscan.io\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xcA11bde05977b3631167028862bE2a173976CA11\",\n blockCreated: 609002\n }\n },\n testnet: false\n};\n\n// src/moonriver.ts\nvar moonriver = {\n id: 1285,\n name: \"Moonriver\",\n network: \"moonriver\",\n nativeCurrency: {\n decimals: 18,\n name: \"MOVR\",\n symbol: \"MOVR\"\n },\n rpcUrls: {\n public: {\n http: [\"https://moonriver.public.blastapi.io\"],\n webSocket: [\"wss://moonriver.public.blastapi.io\"]\n },\n default: {\n http: [\"https://moonriver.public.blastapi.io\"],\n webSocket: [\"wss://moonriver.public.blastapi.io\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Moonscan\",\n url: \"https://moonriver.moonscan.io\"\n },\n etherscan: {\n name: \"Moonscan\",\n url: \"https://moonriver.moonscan.io\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xcA11bde05977b3631167028862bE2a173976CA11\",\n blockCreated: 1597904\n }\n },\n testnet: false\n};\n\n// src/neonDevnet.ts\nvar neonDevnet = {\n id: 245022926,\n network: \"neonDevnet\",\n name: \"Neon EVM DevNet\",\n nativeCurrency: { name: \"NEON\", symbol: \"NEON\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://devnet.neonevm.org\"]\n },\n public: {\n http: [\"https://devnet.neonevm.org\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Neonscan\",\n url: \"https://neonscan.org\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 205206112\n }\n },\n testnet: true\n};\n\n// src/nexi.ts\nvar nexi = {\n id: 4242,\n name: \"Nexi\",\n network: \"nexi\",\n nativeCurrency: { name: \"Nexi\", symbol: \"NEXI\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://rpc.chain.nexi.technology\"]\n },\n public: {\n http: [\"https://rpc.chain.nexi.technology\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"NexiScan\",\n url: \"https://www.nexiscan.com\"\n },\n default: {\n name: \"NexiScan\",\n url: \"https://www.nexiscan.com\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0x0277A46Cc69A57eE3A6C8c158bA874832F718B8E\",\n blockCreated: 25770160\n }\n }\n};\n\n// src/nexilix.ts\nvar nexilix = {\n id: 240,\n name: \"Nexilix Smart Chain\",\n network: \"nexilix\",\n nativeCurrency: {\n decimals: 18,\n name: \"Nexilix\",\n symbol: \"NEXILIX\"\n },\n rpcUrls: {\n default: { http: [\"https://rpcurl.pos.nexilix.com\"] },\n public: { http: [\"https://rpcurl.pos.nexilix.com\"] }\n },\n blockExplorers: {\n etherscan: { name: \"NexilixScan\", url: \"https://scan.nexilix.com\" },\n default: { name: \"NexilixScan\", url: \"https://scan.nexilix.com\" }\n },\n contracts: {\n multicall3: {\n address: \"0x58381c8e2BF9d0C2C4259cA14BdA9Afe02831244\",\n blockCreated: 74448\n }\n }\n};\n\n// src/oasys.ts\nvar oasys = {\n id: 248,\n name: \"Oasys\",\n network: \"oasys\",\n nativeCurrency: { name: \"Oasys\", symbol: \"OAS\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://rpc.mainnet.oasys.games\"]\n },\n public: {\n http: [\"https://rpc.mainnet.oasys.games\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"OasysScan\",\n url: \"https://scan.oasys.games\"\n }\n }\n};\n\n// src/okc.ts\nvar okc = {\n id: 66,\n name: \"OKC\",\n network: \"okc\",\n nativeCurrency: {\n decimals: 18,\n name: \"OKT\",\n symbol: \"OKT\"\n },\n rpcUrls: {\n default: { http: [\"https://exchainrpc.okex.org\"] },\n public: { http: [\"https://exchainrpc.okex.org\"] }\n },\n blockExplorers: {\n default: { name: \"oklink\", url: \"https://www.oklink.com/okc\" }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 10364792\n }\n }\n};\n\n// src/optimism.ts\nvar optimism = {\n id: 10,\n name: \"OP Mainnet\",\n network: \"optimism\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n alchemy: {\n http: [\"https://opt-mainnet.g.alchemy.com/v2\"],\n webSocket: [\"wss://opt-mainnet.g.alchemy.com/v2\"]\n },\n infura: {\n http: [\"https://optimism-mainnet.infura.io/v3\"],\n webSocket: [\"wss://optimism-mainnet.infura.io/ws/v3\"]\n },\n default: {\n http: [\"https://mainnet.optimism.io\"]\n },\n public: {\n http: [\"https://mainnet.optimism.io\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"Etherscan\",\n url: \"https://optimistic.etherscan.io\"\n },\n default: {\n name: \"Optimism Explorer\",\n url: \"https://explorer.optimism.io\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 4286263\n }\n }\n};\n\n// src/optimismGoerli.ts\nvar optimismGoerli = {\n id: 420,\n name: \"Optimism Goerli\",\n network: \"optimism-goerli\",\n nativeCurrency: { name: \"Goerli Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n alchemy: {\n http: [\"https://opt-goerli.g.alchemy.com/v2\"],\n webSocket: [\"wss://opt-goerli.g.alchemy.com/v2\"]\n },\n infura: {\n http: [\"https://optimism-goerli.infura.io/v3\"],\n webSocket: [\"wss://optimism-goerli.infura.io/ws/v3\"]\n },\n default: {\n http: [\"https://goerli.optimism.io\"]\n },\n public: {\n http: [\"https://goerli.optimism.io\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"Etherscan\",\n url: \"https://goerli-optimism.etherscan.io\"\n },\n default: {\n name: \"Etherscan\",\n url: \"https://goerli-optimism.etherscan.io\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 49461\n }\n },\n testnet: true\n};\n\n// src/polygon.ts\nvar polygon = {\n id: 137,\n name: \"Polygon\",\n network: \"matic\",\n nativeCurrency: { name: \"MATIC\", symbol: \"MATIC\", decimals: 18 },\n rpcUrls: {\n alchemy: {\n http: [\"https://polygon-mainnet.g.alchemy.com/v2\"],\n webSocket: [\"wss://polygon-mainnet.g.alchemy.com/v2\"]\n },\n infura: {\n http: [\"https://polygon-mainnet.infura.io/v3\"],\n webSocket: [\"wss://polygon-mainnet.infura.io/ws/v3\"]\n },\n default: {\n http: [\"https://polygon-rpc.com\"]\n },\n public: {\n http: [\"https://polygon-rpc.com\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"PolygonScan\",\n url: \"https://polygonscan.com\"\n },\n default: {\n name: \"PolygonScan\",\n url: \"https://polygonscan.com\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 25770160\n }\n }\n};\n\n// src/polygonMumbai.ts\nvar polygonMumbai = {\n id: 80001,\n name: \"Polygon Mumbai\",\n network: \"maticmum\",\n nativeCurrency: { name: \"MATIC\", symbol: \"MATIC\", decimals: 18 },\n rpcUrls: {\n alchemy: {\n http: [\"https://polygon-mumbai.g.alchemy.com/v2\"],\n webSocket: [\"wss://polygon-mumbai.g.alchemy.com/v2\"]\n },\n infura: {\n http: [\"https://polygon-mumbai.infura.io/v3\"],\n webSocket: [\"wss://polygon-mumbai.infura.io/ws/v3\"]\n },\n default: {\n http: [\"https://matic-mumbai.chainstacklabs.com\"]\n },\n public: {\n http: [\"https://matic-mumbai.chainstacklabs.com\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"PolygonScan\",\n url: \"https://mumbai.polygonscan.com\"\n },\n default: {\n name: \"PolygonScan\",\n url: \"https://mumbai.polygonscan.com\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 25770160\n }\n },\n testnet: true\n};\n\n// src/polygonZkEvmTestnet.ts\nvar polygonZkEvmTestnet = {\n id: 1442,\n name: \"Polygon zkEVM Testnet\",\n network: \"polygon-zkevm-testnet\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://rpc.public.zkevm-test.net\"]\n },\n public: {\n http: [\"https://rpc.public.zkevm-test.net\"]\n }\n },\n blockExplorers: {\n blockscout: {\n name: \"Blockscout\",\n url: \"https://explorer.public.zkevm-test.net\"\n },\n default: {\n name: \"PolygonScan\",\n url: \"https://testnet-zkevm.polygonscan.com\"\n }\n },\n testnet: true,\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 525686\n }\n }\n};\n\n// src/polygonZkEvm.ts\nvar polygonZkEvm = {\n id: 1101,\n name: \"Polygon zkEVM\",\n network: \"polygon-zkevm\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://zkevm-rpc.com\"]\n },\n public: {\n http: [\"https://zkevm-rpc.com\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"PolygonScan\",\n url: \"https://zkevm.polygonscan.com\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 57746\n }\n }\n};\n\n// src/pulsechain.ts\nvar pulsechain = {\n id: 369,\n network: \"pulsechain\",\n name: \"PulseChain\",\n nativeCurrency: { name: \"Pulse\", symbol: \"PLS\", decimals: 18 },\n testnet: false,\n rpcUrls: {\n default: {\n http: [\"https://rpc.pulsechain.com\"],\n webSocket: [\"wss://ws.pulsechain.com\"]\n },\n public: {\n http: [\"https://rpc.pulsechain.com\"],\n webSocket: [\"wss://ws.pulsechain.com\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"PulseScan\",\n url: \"https://scan.pulsechain.com\"\n }\n },\n contracts: {\n ensRegistry: {\n address: \"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e\"\n },\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 14353601\n }\n }\n};\n\n// src/pulsechainV4.ts\nvar pulsechainV4 = {\n id: 943,\n network: \"pulsechainV4\",\n name: \"PulseChain V4\",\n testnet: true,\n nativeCurrency: { name: \"V4 Pulse\", symbol: \"v4PLS\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://rpc.v4.testnet.pulsechain.com\"],\n webSocket: [\"wss://ws.v4.testnet.pulsechain.com\"]\n },\n public: {\n http: [\"https://rpc.v4.testnet.pulsechain.com\"],\n webSocket: [\"wss://ws.v4.testnet.pulsechain.com\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"PulseScan\",\n url: \"https://scan.v4.testnet.pulsechain.com\"\n }\n },\n contracts: {\n ensRegistry: {\n address: \"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e\"\n },\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 14353601\n }\n }\n};\n\n// src/scrollTestnet.ts\nvar scrollTestnet = {\n id: 534353,\n name: \"Scroll Testnet\",\n network: \"scroll-testnet\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://alpha-rpc.scroll.io/l2\"],\n webSocket: [\"wss://alpha-rpc.scroll.io/l2/ws\"]\n },\n public: {\n http: [\"https://alpha-rpc.scroll.io/l2\"],\n webSocket: [\"wss://alpha-rpc.scroll.io/l2/ws\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Blockscout\",\n url: \"https://blockscout.scroll.io\"\n }\n },\n testnet: true\n};\n\n// src/sepolia.ts\nvar sepolia = {\n id: 11155111,\n network: \"sepolia\",\n name: \"Sepolia\",\n nativeCurrency: { name: \"Sepolia Ether\", symbol: \"SEP\", decimals: 18 },\n rpcUrls: {\n alchemy: {\n http: [\"https://eth-sepolia.g.alchemy.com/v2\"],\n webSocket: [\"wss://eth-sepolia.g.alchemy.com/v2\"]\n },\n infura: {\n http: [\"https://sepolia.infura.io/v3\"],\n webSocket: [\"wss://sepolia.infura.io/ws/v3\"]\n },\n default: {\n http: [\"https://rpc.sepolia.org\"]\n },\n public: {\n http: [\"https://rpc.sepolia.org\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"Etherscan\",\n url: \"https://sepolia.etherscan.io\"\n },\n default: {\n name: \"Etherscan\",\n url: \"https://sepolia.etherscan.io\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xca11bde05977b3631167028862be2a173976ca11\",\n blockCreated: 6507670\n }\n },\n testnet: true\n};\n\n// src/skale/brawl.ts\nvar skaleBlockBrawlers = {\n id: 391845894,\n name: \"SKALE | Block Brawlers\",\n network: \"skale-brawl\",\n nativeCurrency: { name: \"BRAWL\", symbol: \"BRAWL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://mainnet.skalenodes.com/v1/frayed-decent-antares\"]\n },\n public: {\n http: [\"https://mainnet.skalenodes.com/v1/frayed-decent-antares\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://frayed-decent-antares.explorer.mainnet.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://frayed-decent-antares.explorer.mainnet.skalenodes.com\"\n }\n },\n contracts: {}\n};\n\n// src/skale/calypso.ts\nvar skaleCalypso = {\n id: 1564830818,\n name: \"SKALE | Calypso NFT Hub\",\n network: \"skale-calypso\",\n nativeCurrency: { name: \"sFUEL\", symbol: \"sFUEL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://mainnet.skalenodes.com/v1/honorable-steel-rasalhague\"]\n },\n public: {\n http: [\"https://mainnet.skalenodes.com/v1/honorable-steel-rasalhague\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://honorable-steel-rasalhague.explorer.mainnet.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://honorable-steel-rasalhague.explorer.mainnet.skalenodes.com\"\n }\n },\n contracts: {}\n};\n\n// src/skale/calypsoTestnet.ts\nvar skaleCalypsoTestnet = {\n id: 344106930,\n name: \"SKALE | Calypso NFT Hub Testnet\",\n network: \"skale-calypso-testnet\",\n nativeCurrency: { name: \"sFUEL\", symbol: \"sFUEL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\n \"https://staging-v3.skalenodes.com/v1/staging-utter-unripe-menkar\"\n ]\n },\n public: {\n http: [\n \"https://staging-v3.skalenodes.com/v1/staging-utter-unripe-menkar\"\n ]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://staging-utter-unripe-menkar.explorer.staging-v3.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://staging-utter-unripe-menkar.explorer.staging-v3.skalenodes.com\"\n }\n },\n contracts: {},\n testnet: true\n};\n\n// src/skale/chaosTestnet.ts\nvar skaleChaosTestnet = {\n id: 1351057110,\n name: \"SKALE | Chaos Testnet\",\n network: \"skale-chaos-testnet\",\n nativeCurrency: { name: \"sFUEL\", symbol: \"sFUEL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\n \"https://staging-v3.skalenodes.com/v1/staging-fast-active-bellatrix\"\n ]\n },\n public: {\n http: [\n \"https://staging-v3.skalenodes.com/v1/staging-fast-active-bellatrix\"\n ]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://staging-fast-active-bellatrix.explorer.staging-v3.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://staging-fast-active-bellatrix.explorer.staging-v3.skalenodes.com\"\n }\n },\n contracts: {},\n testnet: true\n};\n\n// src/skale/cryptoBlades.ts\nvar skaleCryptoBlades = {\n id: 1026062157,\n name: \"SKALE | CryptoBlades\",\n network: \"skale-cryptoblades\",\n nativeCurrency: { name: \"sFUEL\", symbol: \"sFUEL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://mainnet.skalenodes.com/v1/affectionate-immediate-pollux\"]\n },\n public: {\n http: [\"https://mainnet.skalenodes.com/v1/affectionate-immediate-pollux\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://affectionate-immediate-pollux.explorer.mainnet.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://affectionate-immediate-pollux.explorer.mainnet.skalenodes.com\"\n }\n },\n contracts: {}\n};\n\n// src/skale/cryptoColosseum.ts\nvar skaleCryptoColosseum = {\n id: 2046399126,\n name: \"SKALE | Crypto Colosseum\",\n network: \"skale-crypto-coloseeum\",\n nativeCurrency: { name: \"sFUEL\", symbol: \"sFUEL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://mainnet.skalenodes.com/v1/haunting-devoted-deneb\"]\n },\n public: {\n http: [\"https://mainnet.skalenodes.com/v1/haunting-devoted-deneb\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://haunting-devoted-deneb.explorer.mainnet.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://haunting-devoted-deneb.explorer.mainnet.skalenodes.com\"\n }\n },\n contracts: {}\n};\n\n// src/skale/europa.ts\nvar skaleEuropa = {\n id: 2046399126,\n name: \"SKALE | Europa Liquidity Hub\",\n network: \"skale-europa\",\n nativeCurrency: { name: \"sFUEL\", symbol: \"sFUEL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://mainnet.skalenodes.com/v1/elated-tan-skat\"]\n },\n public: {\n http: [\"https://mainnet.skalenodes.com/v1/elated-tan-skat\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://elated-tan-skat.explorer.mainnet.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://elated-tan-skat.explorer.mainnet.skalenodes.com\"\n }\n },\n contracts: {}\n};\n\n// src/skale/europaTestnet.ts\nvar skaleEuropaTestnet = {\n id: 476158412,\n name: \"SKALE | Europa Liquidity Hub Testnet\",\n network: \"skale-europa-testnet\",\n nativeCurrency: { name: \"sFUEL\", symbol: \"sFUEL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://staging-v3.skalenodes.com/v1/staging-legal-crazy-castor\"]\n },\n public: {\n http: [\"https://staging-v3.skalenodes.com/v1/staging-legal-crazy-castor\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://staging-legal-crazy-castor.explorer.staging-v3.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://staging-legal-crazy-castor.explorer.staging-v3.skalenodes.com\"\n }\n },\n contracts: {},\n testnet: true\n};\n\n// src/skale/exorde.ts\nvar skaleExorde = {\n id: 2139927552,\n name: \"SKALE | Exorde\",\n network: \"skale-exorde\",\n nativeCurrency: { name: \"sFUEL\", symbol: \"sFUEL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://mainnet.skalenodes.com/v1/light-vast-diphda\"]\n },\n public: {\n http: [\"https://mainnet.skalenodes.com/v1/light-vast-diphda\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://light-vast-diphda.explorer.mainnet.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://light-vast-diphda.explorer.mainnet.skalenodes.com\"\n }\n },\n contracts: {}\n};\n\n// src/skale/humanProtocol.ts\nvar skaleHumanProtocol = {\n id: 1273227453,\n name: \"SKALE | Human Protocol\",\n network: \"skale-human-protocol\",\n nativeCurrency: { name: \"sFUEL\", symbol: \"sFUEL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://mainnet.skalenodes.com/v1/wan-red-ain\"]\n },\n public: {\n http: [\"https://mainnet.skalenodes.com/v1/wan-red-ain\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://wan-red-ain.explorer.mainnet.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://wan-red-ain.explorer.mainnet.skalenodes.com\"\n }\n },\n contracts: {}\n};\n\n// src/skale/nebula.ts\nvar skaleNebula = {\n id: 1482601649,\n name: \"SKALE | Nebula Gaming Hub\",\n network: \"skale-nebula\",\n nativeCurrency: { name: \"sFUEL\", symbol: \"sFUEL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://mainnet.skalenodes.com/v1/green-giddy-denebola\"]\n },\n public: {\n http: [\"https://mainnet.skalenodes.com/v1/green-giddy-denebola\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://green-giddy-denebola.explorer.mainnet.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://green-giddy-denebola.explorer.mainnet.skalenodes.com\"\n }\n },\n contracts: {}\n};\n\n// src/skale/nebulaTestnet.ts\nvar skaleNebulaTestnet = {\n id: 503129905,\n name: \"SKALE | Nebula Gaming Hub Testnet\",\n network: \"skale-nebula-testnet\",\n nativeCurrency: { name: \"sFUEL\", symbol: \"sFUEL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://staging-v3.skalenodes.com/v1/staging-faint-slimy-achird\"]\n },\n public: {\n http: [\"https://staging-v3.skalenodes.com/v1/staging-faint-slimy-achird\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://staging-faint-slimy-achird.explorer.staging-v3.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://staging-faint-slimy-achird.explorer.staging-v3.skalenodes.com\"\n }\n },\n contracts: {},\n testnet: true\n};\n\n// src/skale/razor.ts\nvar skaleRazor = {\n id: 278611351,\n name: \"SKALE | Razor Network\",\n network: \"skale-razor\",\n nativeCurrency: { name: \"sFUEL\", symbol: \"sFUEL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://mainnet.skalenodes.com/v1/turbulent-unique-scheat\"]\n },\n public: {\n http: [\"https://mainnet.skalenodes.com/v1/turbulent-unique-scheat\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://turbulent-unique-scheat.explorer.mainnet.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://turbulent-unique-scheat.explorer.mainnet.skalenodes.com\"\n }\n },\n contracts: {}\n};\n\n// src/skale/titan.ts\nvar skaleTitan = {\n id: 1350216234,\n name: \"SKALE | Titan Community Hub\",\n network: \"skale-titan\",\n nativeCurrency: { name: \"sFUEL\", symbol: \"sFUEL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://mainnet.skalenodes.com/v1/parallel-stormy-spica\"]\n },\n public: {\n http: [\"https://mainnet.skalenodes.com/v1/parallel-stormy-spica\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://parallel-stormy-spica.explorer.mainnet.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://parallel-stormy-spica.explorer.mainnet.skalenodes.com\"\n }\n },\n contracts: {}\n};\n\n// src/skale/titanTestnet.ts\nvar skaleTitanTestnet = {\n id: 1517929550,\n name: \"SKALE | Titan Community Hub Testnet\",\n network: \"skale-titan-testnet\",\n nativeCurrency: { name: \"sFUEL\", symbol: \"sFUEL\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\n \"https://staging-v3.skalenodes.com/v1/staging-aware-chief-gianfar\"\n ]\n },\n public: {\n http: [\n \"https://staging-v3.skalenodes.com/v1/staging-aware-chief-gianfar\"\n ]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"SKALE Explorer\",\n url: \"https://staging-aware-chief-gianfar.explorer.staging-v3.skalenodes.com\"\n },\n default: {\n name: \"SKALE Explorer\",\n url: \"https://staging-aware-chief-gianfar.explorer.staging-v3.skalenodes.com\"\n }\n },\n contracts: {},\n testnet: true\n};\n\n// src/songbird.ts\nvar songbird = {\n id: 19,\n name: \"Songbird Mainnet\",\n network: \"songbird-mainnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"songbird\",\n symbol: \"SGB\"\n },\n rpcUrls: {\n default: { http: [\"https://songbird-api.flare.network/ext/C/rpc\"] },\n public: { http: [\"https://songbird-api.flare.network/ext/C/rpc\"] }\n },\n blockExplorers: {\n default: {\n name: \"Songbird Explorer\",\n url: \"https://songbird-explorer.flare.network\"\n }\n }\n};\n\n// src/songbirdTestnet.ts\nvar songbirdTestnet = {\n id: 16,\n name: \"Coston\",\n network: \"coston\",\n nativeCurrency: {\n decimals: 18,\n name: \"costonflare\",\n symbol: \"CFLR\"\n },\n rpcUrls: {\n default: { http: [\"https://coston-api.flare.network/ext/C/rpc\"] },\n public: { http: [\"https://coston-api.flare.network/ext/C/rpc\"] }\n },\n blockExplorers: {\n default: {\n name: \"Coston Explorer\",\n url: \"https://coston-explorer.flare.network\"\n }\n },\n testnet: true\n};\n\n// src/shardeumSphinx.ts\nvar shardeumSphinx = {\n id: 8082,\n name: \"Shardeum Sphinx\",\n network: \"shmSphinx\",\n nativeCurrency: { name: \"SHARDEUM\", symbol: \"SHM\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://sphinx.shardeum.org\"]\n },\n public: {\n http: [\"https://sphinx.shardeum.org\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Shardeum Explorer\",\n url: \"https://explorer-sphinx.shardeum.org\"\n }\n },\n testnet: true\n};\n\n// src/syscoin.ts\nvar syscoin = {\n id: 57,\n name: \"Syscoin Mainnet\",\n network: \"syscoin\",\n nativeCurrency: {\n decimals: 8,\n name: \"Syscoin\",\n symbol: \"SYS\"\n },\n rpcUrls: {\n default: { http: [\"https://rpc.syscoin.org\"] },\n public: { http: [\"https://rpc.syscoin.org\"] }\n },\n blockExplorers: {\n default: { name: \"SyscoinExplorer\", url: \"https://explorer.syscoin.org\" }\n },\n contracts: {\n multicall3: {\n address: \"0x000562033783B1136159E10d976B519C929cdE8e\",\n blockCreated: 80637\n }\n }\n};\n\n// src/taraxa.ts\nvar taraxa = {\n id: 841,\n name: \"Taraxa Mainnet\",\n network: \"taraxa\",\n nativeCurrency: { name: \"Tara\", symbol: \"TARA\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://rpc.mainnet.taraxa.io\"]\n },\n public: {\n http: [\"https://rpc.mainnet.taraxa.io\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Taraxa Explorer\",\n url: \"https://explorer.mainnet.taraxa.io\"\n }\n }\n};\n\n// src/taikoTestnetSepolia.ts\nvar taikoTestnetSepolia = {\n id: 167005,\n name: \"Taiko (Alpha-3 Testnet)\",\n network: \"taiko-sepolia\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://rpc.test.taiko.xyz\"]\n },\n public: {\n http: [\"https://rpc.test.taiko.xyz\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"blockscout\",\n url: \"https://explorer.test.taiko.xyz\"\n }\n }\n};\n\n// src/taraxaTestnet.ts\nvar taraxaTestnet = {\n id: 842,\n name: \"Taraxa Testnet\",\n network: \"taraxa-testnet\",\n nativeCurrency: { name: \"Tara\", symbol: \"TARA\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://rpc.testnet.taraxa.io\"]\n },\n public: {\n http: [\"https://rpc.testnet.taraxa.io\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"Taraxa Explorer\",\n url: \"https://explorer.testnet.taraxa.io\"\n }\n },\n testnet: true\n};\n\n// src/telos.ts\nvar telos = {\n id: 40,\n name: \"Telos\",\n network: \"telos\",\n nativeCurrency: {\n decimals: 18,\n name: \"Telos\",\n symbol: \"TLOS\"\n },\n rpcUrls: {\n default: { http: [\"https://mainnet.telos.net/evm\"] },\n public: { http: [\"https://mainnet.telos.net/evm\"] }\n },\n blockExplorers: {\n default: {\n name: \"Teloscan\",\n url: \"https://www.teloscan.io/\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xcA11bde05977b3631167028862bE2a173976CA11\",\n blockCreated: 246530709\n }\n }\n};\n\n// src/telosTestnet.ts\nvar telosTestnet = {\n id: 41,\n name: \"Telos\",\n network: \"telosTestnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"Telos\",\n symbol: \"TLOS\"\n },\n rpcUrls: {\n default: { http: [\"https://testnet.telos.net/evm\"] },\n public: { http: [\"https://testnet.telos.net/evm\"] }\n },\n blockExplorers: {\n default: {\n name: \"Teloscan (testnet)\",\n url: \"https://testnet.teloscan.io/\"\n }\n },\n testnet: true\n};\n\n// src/thunderTestnet.ts\nvar thunderTestnet = {\n id: 997,\n name: \"5ireChain Thunder Testnet\",\n network: \"5ireChain\",\n nativeCurrency: { name: \"5ire Token\", symbol: \"5IRE\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://rpc-testnet.5ire.network\"]\n },\n public: {\n http: [\"https://rpc-testnet.5ire.network\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"5ireChain Explorer\",\n url: \"https://explorer.5ire.network\"\n }\n },\n testnet: true\n};\n\n// src/wanchain.ts\nvar wanchain = {\n id: 888,\n name: \"Wanchain\",\n network: \"wanchain\",\n nativeCurrency: { name: \"WANCHAIN\", symbol: \"WAN\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\n \"https://gwan-ssl.wandevs.org:56891\",\n \"https://gwan2-ssl.wandevs.org\"\n ]\n },\n public: {\n http: [\n \"https://gwan-ssl.wandevs.org:56891\",\n \"https://gwan2-ssl.wandevs.org\"\n ]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"WanScan\",\n url: \"https://wanscan.org\"\n },\n default: {\n name: \"WanScan\",\n url: \"https://wanscan.org\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xcDF6A1566e78EB4594c86Fe73Fcdc82429e97fbB\",\n blockCreated: 25312390\n }\n }\n};\n\n// src/wanchainTestnet.ts\nvar wanchainTestnet = {\n id: 999,\n name: \"Wanchain Testnet\",\n network: \"wanchainTestnet\",\n nativeCurrency: { name: \"WANCHAIN\", symbol: \"WANt\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://gwan-ssl.wandevs.org:46891\"]\n },\n public: {\n http: [\"https://gwan-ssl.wandevs.org:46891\"]\n }\n },\n blockExplorers: {\n etherscan: {\n name: \"WanScanTest\",\n url: \"https://wanscan.org\"\n },\n default: {\n name: \"WanScanTest\",\n url: \"https://wanscan.org\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0x11c89bF4496c39FB80535Ffb4c92715839CC5324\",\n blockCreated: 24743448\n }\n },\n testnet: true\n};\n\n// src/xdc.ts\nvar xdc = {\n id: 50,\n name: \"XinFin Network\",\n network: \"xdc\",\n nativeCurrency: {\n decimals: 18,\n name: \"XDC\",\n symbol: \"XDC\"\n },\n rpcUrls: {\n default: { http: [\"https://rpc.xinfin.network\"] },\n public: { http: [\"https://rpc.xinfin.network\"] }\n },\n blockExplorers: {\n xinfin: { name: \"XinFin\", url: \"https://explorer.xinfin.network\" },\n default: { name: \"Blocksscan\", url: \"https://xdc.blocksscan.io\" }\n }\n};\n\n// src/xdcTestnet.ts\nvar xdcTestnet = {\n id: 51,\n name: \"Apothem Network\",\n network: \"xdc-testnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"TXDC\",\n symbol: \"TXDC\"\n },\n rpcUrls: {\n default: { http: [\"https://erpc.apothem.network\"] },\n public: { http: [\"https://erpc.apothem.network\"] }\n },\n blockExplorers: {\n xinfin: { name: \"XinFin\", url: \"https://explorer.apothem.network\" },\n default: { name: \"Blocksscan\", url: \"https://apothem.blocksscan.io\" }\n }\n};\n\n// src/zhejiang.ts\nvar zhejiang = {\n id: 1337803,\n network: \"zhejiang\",\n name: \"Zhejiang\",\n nativeCurrency: { name: \"Zhejiang Ether\", symbol: \"ZhejETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://rpc.zhejiang.ethpandaops.io\"]\n },\n public: {\n http: [\"https://rpc.zhejiang.ethpandaops.io\"]\n }\n },\n blockExplorers: {\n beaconchain: {\n name: \"Etherscan\",\n url: \"https://zhejiang.beaconcha.in\"\n },\n blockscout: {\n name: \"Blockscout\",\n url: \"https://blockscout.com/eth/zhejiang-testnet\"\n },\n default: {\n name: \"Beaconchain\",\n url: \"https://zhejiang.beaconcha.in\"\n }\n },\n testnet: true\n};\n\n// src/zkSync.ts\nvar zkSync = {\n id: 324,\n name: \"zkSync Era\",\n network: \"zksync-era\",\n nativeCurrency: {\n decimals: 18,\n name: \"Ether\",\n symbol: \"ETH\"\n },\n rpcUrls: {\n default: {\n http: [\"https://mainnet.era.zksync.io\"],\n webSocket: [\"wss://mainnet.era.zksync.io/ws\"]\n },\n public: {\n http: [\"https://mainnet.era.zksync.io\"],\n webSocket: [\"wss://mainnet.era.zksync.io/ws\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"zkExplorer\",\n url: \"https://explorer.zksync.io\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xF9cda624FBC7e059355ce98a31693d299FACd963\"\n }\n }\n};\n\n// src/zkSyncTestnet.ts\nvar zkSyncTestnet = {\n id: 280,\n name: \"zkSync Era Testnet\",\n network: \"zksync-era-testnet\",\n nativeCurrency: { name: \"Ether\", symbol: \"ETH\", decimals: 18 },\n rpcUrls: {\n default: {\n http: [\"https://testnet.era.zksync.dev\"],\n webSocket: [\"wss://testnet.era.zksync.dev/ws\"]\n },\n public: {\n http: [\"https://testnet.era.zksync.dev\"],\n webSocket: [\"wss://testnet.era.zksync.dev/ws\"]\n }\n },\n blockExplorers: {\n default: {\n name: \"zkExplorer\",\n url: \"https://goerli.explorer.zksync.io\"\n }\n },\n contracts: {\n multicall3: {\n address: \"0xF9cda624FBC7e059355ce98a31693d299FACd963\"\n }\n },\n testnet: true\n};\n\n// src/zora.ts\nvar zora = {\n id: 7777777,\n name: \"Zora\",\n network: \"zora\",\n nativeCurrency: {\n decimals: 18,\n name: \"Ether\",\n symbol: \"ETH\"\n },\n rpcUrls: {\n default: {\n http: [\"https://rpc.zora.energy\"],\n webSocket: [\"wss://rpc.zora.energy\"]\n },\n public: {\n http: [\"https://rpc.zora.energy\"],\n webSocket: [\"wss://rpc.zora.energy\"]\n }\n },\n blockExplorers: {\n default: { name: \"Explorer\", url: \"https://explorer.zora.energy\" }\n },\n contracts: {\n multicall3: {\n address: \"0xcA11bde05977b3631167028862bE2a173976CA11\",\n blockCreated: 5882\n }\n }\n};\n\n// src/zoraTestnet.ts\nvar zoraTestnet = {\n id: 999,\n name: \"Zora Goerli Testnet\",\n network: \"zora-testnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"Zora Goerli\",\n symbol: \"ETH\"\n },\n rpcUrls: {\n default: {\n http: [\"https://testnet.rpc.zora.energy\"],\n webSocket: [\"wss://testnet.rpc.zora.energy\"]\n },\n public: {\n http: [\"https://testnet.rpc.zora.energy\"],\n webSocket: [\"wss://testnet.rpc.zora.energy\"]\n }\n },\n blockExplorers: {\n default: { name: \"Explorer\", url: \"https://testnet.explorer.zora.energy\" }\n },\n contracts: {\n multicall3: {\n address: \"0xcA11bde05977b3631167028862bE2a173976CA11\",\n blockCreated: 189123\n }\n },\n testnet: true\n};\nexport {\n arbitrum,\n arbitrumGoerli,\n arbitrumNova,\n aurora,\n auroraTestnet,\n avalanche,\n avalancheFuji,\n base,\n baseGoerli,\n bearNetworkChainMainnet,\n bearNetworkChainTestnet,\n boba,\n bronos,\n bronosTestnet,\n bsc,\n bscTestnet,\n bxn,\n bxnTestnet,\n canto,\n celo,\n celoAlfajores,\n celoCannoli,\n confluxESpace,\n cronos,\n cronosTestnet,\n crossbell,\n dfk,\n dogechain,\n edgeware,\n edgewareTestnet,\n ekta,\n ektaTestnet,\n eos,\n eosTestnet,\n evmos,\n evmosTestnet,\n fantom,\n fantomTestnet,\n fibo,\n filecoin,\n filecoinCalibration,\n filecoinHyperspace,\n flare,\n flareTestnet,\n foundry,\n fuse,\n gnosis,\n gnosisChiado,\n goerli,\n haqqMainnet,\n haqqTestedge2,\n hardhat,\n harmonyOne,\n iotex,\n iotexTestnet,\n klaytn,\n lineaTestnet,\n localhost,\n mainnet,\n mantle,\n mantleTestnet,\n metis,\n metisGoerli,\n mev,\n mevTestnet,\n moonbaseAlpha,\n moonbeam,\n moonriver,\n neonDevnet,\n nexi,\n nexilix,\n oasys,\n okc,\n optimism,\n optimismGoerli,\n polygon,\n polygonMumbai,\n polygonZkEvm,\n polygonZkEvmTestnet,\n pulsechain,\n pulsechainV4,\n scrollTestnet,\n sepolia,\n shardeumSphinx,\n skaleBlockBrawlers,\n skaleCalypso,\n skaleCalypsoTestnet,\n skaleChaosTestnet,\n skaleCryptoBlades,\n skaleCryptoColosseum,\n skaleEuropa,\n skaleEuropaTestnet,\n skaleExorde,\n skaleHumanProtocol,\n skaleNebula,\n skaleNebulaTestnet,\n skaleRazor,\n skaleTitan,\n skaleTitanTestnet,\n songbird,\n songbirdTestnet,\n syscoin,\n taikoTestnetSepolia,\n taraxa,\n taraxaTestnet,\n telos,\n telosTestnet,\n thunderTestnet,\n wanchain,\n wanchainTestnet,\n xdc,\n xdcTestnet,\n zhejiang,\n zkSync,\n zkSyncTestnet,\n zora,\n zoraTestnet\n};\n","import * as chains from '@wagmi/chains';\nimport { defineChain } from '../utils/chain.js';\nimport { formattersCelo } from './celo/formatters.js';\nimport { serializersCelo } from './celo/serializers.js';\nimport { feesOptimism } from './optimism/fees.js';\nimport { formattersOptimism } from './optimism/formatters.js';\nexport const arbitrum = /*#__PURE__*/ defineChain(chains.arbitrum);\nexport const arbitrumGoerli = /*#__PURE__*/ defineChain(chains.arbitrumGoerli);\nexport const aurora = /*#__PURE__*/ defineChain(chains.aurora);\nexport const auroraTestnet = /*#__PURE__*/ defineChain(chains.auroraTestnet);\nexport const avalanche = /*#__PURE__*/ defineChain(chains.avalanche);\nexport const avalancheFuji = /*#__PURE__*/ defineChain(chains.avalancheFuji);\nexport const base = /*#__PURE__*/ defineChain(chains.base, {\n fees: feesOptimism,\n formatters: formattersOptimism,\n});\nexport const baseGoerli = /*#__PURE__*/ defineChain(chains.baseGoerli, {\n fees: feesOptimism,\n formatters: formattersOptimism,\n});\nexport const boba = /*#__PURE__*/ defineChain(chains.boba);\nexport const bronos = /*#__PURE__*/ defineChain(chains.bronos);\nexport const bronosTestnet = /*#__PURE__*/ defineChain(chains.bronosTestnet);\nexport const bsc = /*#__PURE__*/ defineChain(chains.bsc);\nexport const bscTestnet = /*#__PURE__*/ defineChain(chains.bscTestnet);\nexport const canto = /*#__PURE__*/ defineChain(chains.canto);\nexport const celo = /*#__PURE__*/ defineChain(chains.celo, {\n formatters: formattersCelo,\n serializers: serializersCelo,\n});\nexport const celoAlfajores = /*#__PURE__*/ defineChain(chains.celoAlfajores, {\n formatters: formattersCelo,\n serializers: serializersCelo,\n});\nexport const celoCannoli = /*#__PURE__*/ defineChain(chains.celoCannoli, {\n formatters: formattersCelo,\n serializers: serializersCelo,\n});\nexport const cronos = /*#__PURE__*/ defineChain(chains.cronos);\nexport const crossbell = /*#__PURE__*/ defineChain(chains.crossbell);\nexport const dfk = /*#__PURE__*/ defineChain(chains.dfk);\nexport const dogechain = /*#__PURE__*/ defineChain(chains.dogechain);\nexport const evmos = /*#__PURE__*/ defineChain(chains.evmos);\nexport const evmosTestnet = /*#__PURE__*/ defineChain(chains.evmosTestnet);\nexport const fantom = /*#__PURE__*/ defineChain(chains.fantom);\nexport const fantomTestnet = /*#__PURE__*/ defineChain(chains.fantomTestnet);\nexport const filecoin = /*#__PURE__*/ defineChain(chains.filecoin);\nexport const filecoinCalibration = /*#__PURE__*/ defineChain(chains.filecoinCalibration);\nexport const filecoinHyperspace = /*#__PURE__*/ defineChain(chains.filecoinHyperspace);\nexport const flare = /*#__PURE__*/ defineChain(chains.flare);\nexport const flareTestnet = /*#__PURE__*/ defineChain(chains.flareTestnet);\nexport const foundry = /*#__PURE__*/ defineChain(chains.foundry);\nexport const iotex = /*#__PURE__*/ defineChain(chains.iotex);\nexport const iotexTestnet = /*#__PURE__*/ defineChain(chains.iotexTestnet);\nexport const goerli = /*#__PURE__*/ defineChain(chains.goerli);\nexport const gnosis = /*#__PURE__*/ defineChain(chains.gnosis);\nexport const gnosisChiado = /*#__PURE__*/ defineChain(chains.gnosisChiado);\nexport const haqqMainnet = /*#__PURE__*/ defineChain(chains.haqqMainnet);\nexport const haqqTestedge2 = /*#__PURE__*/ defineChain(chains.haqqTestedge2);\nexport const hardhat = /*#__PURE__*/ defineChain(chains.hardhat);\nexport const harmonyOne = /*#__PURE__*/ defineChain(chains.harmonyOne);\nexport const klaytn = /*#__PURE__*/ defineChain(chains.klaytn);\nexport const lineaTestnet = /*#__PURE__*/ defineChain(chains.lineaTestnet);\nexport const localhost = /*#__PURE__*/ defineChain(chains.localhost);\nexport const mainnet = /*#__PURE__*/ defineChain(chains.mainnet);\nexport const metis = /*#__PURE__*/ defineChain(chains.metis);\nexport const metisGoerli = /*#__PURE__*/ defineChain(chains.metisGoerli);\nexport const mev = /*#__PURE__*/ defineChain(chains.mev);\nexport const mevTestnet = /*#__PURE__*/ defineChain(chains.mevTestnet);\nexport const moonbaseAlpha = /*#__PURE__*/ defineChain(chains.moonbaseAlpha);\nexport const moonbeam = /*#__PURE__*/ defineChain(chains.moonbeam);\nexport const moonriver = /*#__PURE__*/ defineChain(chains.moonriver);\nexport const nexi = /*#__PURE__*/ defineChain(chains.nexi);\nexport const okc = /*#__PURE__*/ defineChain(chains.okc);\nexport const optimism = /*#__PURE__*/ defineChain(chains.optimism, {\n fees: feesOptimism,\n formatters: formattersOptimism,\n});\nexport const optimismGoerli = /*#__PURE__*/ defineChain(chains.optimismGoerli, {\n fees: feesOptimism,\n formatters: formattersOptimism,\n});\nexport const polygon = /*#__PURE__*/ defineChain(chains.polygon);\nexport const polygonMumbai = /*#__PURE__*/ defineChain(chains.polygonMumbai);\nexport const polygonZkEvm = /*#__PURE__*/ defineChain(chains.polygonZkEvm);\nexport const polygonZkEvmTestnet = /*#__PURE__*/ defineChain(chains.polygonZkEvmTestnet);\nexport const pulsechain = /*#__PURE__*/ defineChain(chains.pulsechain);\nexport const pulsechainV4 = /*#__PURE__*/ defineChain(chains.pulsechainV4);\nexport const scrollTestnet = /*#__PURE__*/ defineChain(chains.scrollTestnet);\nexport const sepolia = /*#__PURE__*/ defineChain(chains.sepolia);\nexport const skaleBlockBrawlers = /*#__PURE__*/ defineChain(chains.skaleBlockBrawlers);\nexport const skaleCalypso = /*#__PURE__*/ defineChain(chains.skaleCalypso);\nexport const skaleCalypsoTestnet = /*#__PURE__*/ defineChain(chains.skaleCalypsoTestnet);\nexport const skaleChaosTestnet = /*#__PURE__*/ defineChain(chains.skaleChaosTestnet);\nexport const skaleCryptoBlades = /*#__PURE__*/ defineChain(chains.skaleCryptoBlades);\nexport const skaleCryptoColosseum = /*#__PURE__*/ defineChain(chains.skaleCryptoColosseum);\nexport const skaleEuropa = /*#__PURE__*/ defineChain(chains.skaleEuropa);\nexport const skaleEuropaTestnet = /*#__PURE__*/ defineChain(chains.skaleEuropaTestnet);\nexport const skaleExorde = /*#__PURE__*/ defineChain(chains.skaleExorde);\nexport const skaleHumanProtocol = /*#__PURE__*/ defineChain(chains.skaleHumanProtocol);\nexport const skaleNebula = /*#__PURE__*/ defineChain(chains.skaleNebula);\nexport const skaleNebulaTestnet = /*#__PURE__*/ defineChain(chains.skaleNebulaTestnet);\nexport const skaleRazor = /*#__PURE__*/ defineChain(chains.skaleRazor);\nexport const skaleTitan = /*#__PURE__*/ defineChain(chains.skaleTitan);\nexport const skaleTitanTestnet = /*#__PURE__*/ defineChain(chains.skaleTitanTestnet);\nexport const songbird = /*#__PURE__*/ defineChain(chains.songbird);\nexport const songbirdTestnet = /*#__PURE__*/ defineChain(chains.songbirdTestnet);\nexport const shardeumSphinx = /*#__PURE__*/ defineChain(chains.shardeumSphinx);\nexport const syscoin = /*#__PURE__*/ defineChain(chains.syscoin);\nexport const taraxa = /*#__PURE__*/ defineChain(chains.taraxa);\nexport const taraxaTestnet = /*#__PURE__*/ defineChain(chains.taraxaTestnet);\nexport const telos = /*#__PURE__*/ defineChain(chains.telos);\nexport const telosTestnet = /*#__PURE__*/ defineChain(chains.telosTestnet);\nexport const thunderTestnet = /*#__PURE__*/ defineChain(chains.thunderTestnet);\nexport const wanchain = /*#__PURE__*/ defineChain(chains.wanchain);\nexport const wanchainTestnet = /*#__PURE__*/ defineChain(chains.wanchainTestnet);\nexport const xdc = /*#__PURE__*/ defineChain(chains.xdc);\nexport const xdcTestnet = /*#__PURE__*/ defineChain(chains.xdcTestnet);\nexport const zhejiang = /*#__PURE__*/ defineChain(chains.zhejiang);\nexport const zkSync = /*#__PURE__*/ defineChain(chains.zkSync);\nexport const zkSyncTestnet = /*#__PURE__*/ defineChain(chains.zkSyncTestnet);\nexport const zora = /*#__PURE__*/ defineChain(chains.zora, {\n fees: feesOptimism,\n formatters: formattersOptimism,\n});\nexport const zoraTestnet = /*#__PURE__*/ defineChain(chains.zoraTestnet, {\n fees: feesOptimism,\n formatters: formattersOptimism,\n});\n//# sourceMappingURL=index.js.map","var t={name:\"Lattice Testnet\",id:4242,network:\"lattice-testnet\",nativeCurrency:{decimals:18,name:\"Ether\",symbol:\"ETH\"},rpcUrls:{default:{http:[\"https://follower.testnet-chain.linfra.xyz\"],webSocket:[\"wss://follower.testnet-chain.linfra.xyz\"]},public:{http:[\"https://follower.testnet-chain.linfra.xyz\"],webSocket:[\"wss://follower.testnet-chain.linfra.xyz\"]}},blockExplorers:{otterscan:{name:\"Otterscan\",url:\"https://explorer.testnet-chain.linfra.xyz\"},default:{name:\"Otterscan\",url:\"https://explorer.testnet-chain.linfra.xyz\"}},faucetUrl:\"https://faucet.testnet-mud-services.linfra.xyz\"};import{foundry as e}from\"viem/chains\";var r={...e,fees:{defaultPriorityFee:0n}};export{t as latticeTestnet,r as mudFoundry};\n//# sourceMappingURL=chains.js.map","import { MUDChain, latticeTestnet, mudFoundry } from \"@latticexyz/common/chains\";\n\n// import type { MUDChain } from \"./types\";\n\nexport const redStone = {\n name: \"Red Stone\",\n id: 17001,\n network: \"red-stone\",\n nativeCurrency: { decimals: 18, name: \"Ether\", symbol: \"ETH\" },\n rpcUrls: {\n default: {\n http: [\"https://rpc.holesky.redstone.xyz\"],\n webSocket: [\"wss://rpc.holesky.redstone.xyz/ws\"],\n },\n public: {\n http: [\"https://rpc.holesky.redstone.xyz\"],\n webSocket: [\"wss://rpc.holesky.redstone.xyz/ws\"],\n },\n },\n blockExplorers: {\n otterscan: {\n name: \"Otterscan\",\n url: \"https://explorer.holesky.redstone.xyz\",\n },\n default: {\n name: \"Otterscan\",\n url: \"https://explorer.holesky.redstone.xyz\",\n },\n },\n faucetUrl: \"https://faucet.testnet-mud-services.linfra.xyz\",\n} as const satisfies MUDChain;\n\n\n// If you are deploying to chains other than anvil or Lattice testnet, add them here\nexport const supportedChains: MUDChain[] = [mudFoundry, latticeTestnet, redStone];","import { getBurnerPrivateKey } from \"@latticexyz/common\";\nimport worldsJson from \"contracts/worlds.json\";\nimport { supportedChains } from \"./supportedChains\";\n\nconst worlds = worldsJson as Partial>;\n\nexport async function getNetworkConfig() {\n const params = new URLSearchParams(window.location.search);\n const chainId = Number(params.get(\"chainId\") || params.get(\"chainid\") || import.meta.env.VITE_CHAIN_ID || 31337);\n const chainIndex = supportedChains.findIndex((c) => c.id === chainId);\n const chain = supportedChains[chainIndex];\n if (!chain) {\n throw new Error(`Chain ${chainId} not found`);\n }\n\n const world = worlds[chain.id.toString()];\n const worldAddress = params.get(\"worldAddress\") || world?.address;\n if (!worldAddress) {\n throw new Error(`No world address found for chain ${chainId}. Did you run \\`mud deploy\\`?`);\n }\n\n const initialBlockNumber = params.has(\"initialBlockNumber\")\n ? Number(params.get(\"initialBlockNumber\"))\n : world?.blockNumber ?? 0n;\n\n return {\n privateKey: getBurnerPrivateKey(),\n chainId,\n chain,\n faucetServiceUrl: params.get(\"faucet\") ?? chain.faucetUrl,\n worldAddress,\n initialBlockNumber,\n };\n}\n","import { createWorld } from \"@latticexyz/recs\";\n\nexport const world = createWorld();\n","/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\n\nimport { Contract, Signer, utils } from \"ethers\";\nimport type { Provider } from \"@ethersproject/providers\";\nimport type { IWorld, IWorldInterface } from \"../IWorld\";\n\nconst _abi = [\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"resource\",\n type: \"string\",\n },\n {\n internalType: \"address\",\n name: \"caller\",\n type: \"address\",\n },\n ],\n name: \"AccessDenied\",\n type: \"error\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"functionSelector\",\n type: \"bytes4\",\n },\n ],\n name: \"FunctionSelectorExists\",\n type: \"error\",\n },\n {\n inputs: [\n {\n internalType: \"bytes4\",\n name: \"functionSelector\",\n type: \"bytes4\",\n },\n ],\n name: \"FunctionSelectorNotFound\",\n type: \"error\",\n },\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"resource\",\n type: \"string\",\n },\n ],\n name: \"InvalidSelector\",\n type: \"error\",\n },\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"module\",\n type: \"string\",\n },\n ],\n name: \"ModuleAlreadyInstalled\",\n type: \"error\",\n },\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"resource\",\n type: \"string\",\n },\n ],\n name: \"ResourceExists\",\n type: \"error\",\n },\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"resource\",\n type: \"string\",\n },\n ],\n name: \"ResourceNotFound\",\n type: \"error\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"length\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"received\",\n type: \"uint256\",\n },\n ],\n name: \"StoreCore_DataIndexOverflow\",\n type: \"error\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"expected\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"received\",\n type: \"uint256\",\n },\n ],\n name: \"StoreCore_InvalidDataLength\",\n type: \"error\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"expected\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"received\",\n type: \"uint256\",\n },\n ],\n name: \"StoreCore_InvalidFieldNamesLength\",\n type: \"error\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"expected\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"received\",\n type: \"uint256\",\n },\n ],\n name: \"StoreCore_InvalidKeyNamesLength\",\n type: \"error\",\n },\n {\n inputs: [],\n name: \"StoreCore_NotDynamicField\",\n type: \"error\",\n },\n {\n inputs: [],\n name: \"StoreCore_NotImplemented\",\n type: \"error\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"tableId\",\n type: \"bytes32\",\n },\n {\n internalType: \"string\",\n name: \"tableIdString\",\n type: \"string\",\n },\n ],\n name: \"StoreCore_TableAlreadyExists\",\n type: \"error\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"tableId\",\n type: \"bytes32\",\n },\n {\n internalType: \"string\",\n name: \"tableIdString\",\n type: \"string\",\n },\n ],\n name: \"StoreCore_TableNotFound\",\n type: \"error\",\n },\n {\n inputs: [\n {\n internalType: \"address\",\n name: \"system\",\n type: \"address\",\n },\n ],\n name: \"SystemExists\",\n type: \"error\",\n },\n {\n anonymous: false,\n inputs: [],\n name: \"HelloWorld\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n indexed: false,\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n ],\n name: \"StoreDeleteRecord\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n indexed: false,\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"StoreEphemeralRecord\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n indexed: false,\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n {\n indexed: false,\n internalType: \"uint8\",\n name: \"schemaIndex\",\n type: \"uint8\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"StoreSetField\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: false,\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n indexed: false,\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n {\n indexed: false,\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n name: \"StoreSetRecord\",\n type: \"event\",\n },\n {\n inputs: [],\n name: \"acceptTrade\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"askStart\",\n outputs: [\n {\n internalType: \"uint32\",\n name: \"\",\n type: \"uint32\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"resourceSelector\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes\",\n name: \"funcSelectorAndArgs\",\n type: \"bytes\",\n },\n ],\n name: \"call\",\n outputs: [\n {\n internalType: \"bytes\",\n name: \"\",\n type: \"bytes\",\n },\n ],\n stateMutability: \"payable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"checkDebt\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"string\",\n name: \"str\",\n type: \"string\",\n },\n {\n internalType: \"uint256\",\n name: \"num\",\n type: \"uint256\",\n },\n ],\n name: \"concatenate\",\n outputs: [\n {\n internalType: \"string\",\n name: \"\",\n type: \"string\",\n },\n ],\n stateMutability: \"pure\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n {\n internalType: \"Schema\",\n name: \"valueSchema\",\n type: \"bytes32\",\n },\n ],\n name: \"deleteRecord\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n {\n internalType: \"Schema\",\n name: \"valueSchema\",\n type: \"bytes32\",\n },\n ],\n name: \"emitEphemeralRecord\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"findPartner\",\n outputs: [\n {\n internalType: \"uint32\",\n name: \"\",\n type: \"uint32\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"finishGame\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n {\n internalType: \"uint8\",\n name: \"schemaIndex\",\n type: \"uint8\",\n },\n {\n internalType: \"Schema\",\n name: \"valueSchema\",\n type: \"bytes32\",\n },\n ],\n name: \"getField\",\n outputs: [\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n {\n internalType: \"uint8\",\n name: \"schemaIndex\",\n type: \"uint8\",\n },\n {\n internalType: \"Schema\",\n name: \"valueSchema\",\n type: \"bytes32\",\n },\n ],\n name: \"getFieldLength\",\n outputs: [\n {\n internalType: \"uint256\",\n name: \"\",\n type: \"uint256\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n {\n internalType: \"uint8\",\n name: \"schemaIndex\",\n type: \"uint8\",\n },\n {\n internalType: \"Schema\",\n name: \"valueSchema\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint256\",\n name: \"start\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"end\",\n type: \"uint256\",\n },\n ],\n name: \"getFieldSlice\",\n outputs: [\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n ],\n name: \"getKeySchema\",\n outputs: [\n {\n internalType: \"Schema\",\n name: \"schema\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n {\n internalType: \"Schema\",\n name: \"valueSchema\",\n type: \"bytes32\",\n },\n ],\n name: \"getRecord\",\n outputs: [\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n ],\n name: \"getValueSchema\",\n outputs: [\n {\n internalType: \"Schema\",\n name: \"schema\",\n type: \"bytes32\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"resourceSelector\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"grantee\",\n type: \"address\",\n },\n ],\n name: \"grantAccess\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"increment\",\n outputs: [\n {\n internalType: \"uint32\",\n name: \"\",\n type: \"uint32\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"contract IModule\",\n name: \"module\",\n type: \"address\",\n },\n {\n internalType: \"bytes\",\n name: \"args\",\n type: \"bytes\",\n },\n ],\n name: \"installModule\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"contract IModule\",\n name: \"module\",\n type: \"address\",\n },\n {\n internalType: \"bytes\",\n name: \"args\",\n type: \"bytes\",\n },\n ],\n name: \"installRootModule\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"joinGame\",\n outputs: [\n {\n internalType: \"uint32\",\n name: \"\",\n type: \"uint32\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint256\",\n name: \"targetX\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"targetY\",\n type: \"uint256\",\n },\n ],\n name: \"move\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"pay\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint8\",\n name: \"assetKind\",\n type: \"uint8\",\n },\n ],\n name: \"pickAsset\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"pickCoin\",\n outputs: [\n {\n internalType: \"uint32\",\n name: \"\",\n type: \"uint32\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"uint8\",\n name: \"cardId\",\n type: \"uint8\",\n },\n ],\n name: \"pickFund\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n {\n internalType: \"uint8\",\n name: \"schemaIndex\",\n type: \"uint8\",\n },\n {\n internalType: \"uint256\",\n name: \"byteLengthToPop\",\n type: \"uint256\",\n },\n {\n internalType: \"Schema\",\n name: \"valueSchema\",\n type: \"bytes32\",\n },\n ],\n name: \"popFromField\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n {\n internalType: \"uint8\",\n name: \"schemaIndex\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes\",\n name: \"dataToPush\",\n type: \"bytes\",\n },\n {\n internalType: \"Schema\",\n name: \"valueSchema\",\n type: \"bytes32\",\n },\n ],\n name: \"pushToField\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"resourceSelector\",\n type: \"bytes32\",\n },\n {\n internalType: \"string\",\n name: \"systemFunctionName\",\n type: \"string\",\n },\n {\n internalType: \"string\",\n name: \"systemFunctionArguments\",\n type: \"string\",\n },\n ],\n name: \"registerFunctionSelector\",\n outputs: [\n {\n internalType: \"bytes4\",\n name: \"worldFunctionSelector\",\n type: \"bytes4\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes16\",\n name: \"namespace\",\n type: \"bytes16\",\n },\n ],\n name: \"registerNamespace\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"resourceSelector\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes4\",\n name: \"worldFunctionSelector\",\n type: \"bytes4\",\n },\n {\n internalType: \"bytes4\",\n name: \"systemFunctionSelector\",\n type: \"bytes4\",\n },\n ],\n name: \"registerRootFunctionSelector\",\n outputs: [\n {\n internalType: \"bytes4\",\n name: \"\",\n type: \"bytes4\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n internalType: \"contract IStoreHook\",\n name: \"hook\",\n type: \"address\",\n },\n ],\n name: \"registerStoreHook\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"resourceSelector\",\n type: \"bytes32\",\n },\n {\n internalType: \"contract System\",\n name: \"system\",\n type: \"address\",\n },\n {\n internalType: \"bool\",\n name: \"publicAccess\",\n type: \"bool\",\n },\n ],\n name: \"registerSystem\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"resourceSelector\",\n type: \"bytes32\",\n },\n {\n internalType: \"contract ISystemHook\",\n name: \"hook\",\n type: \"address\",\n },\n ],\n name: \"registerSystemHook\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n internalType: \"Schema\",\n name: \"keySchema\",\n type: \"bytes32\",\n },\n {\n internalType: \"Schema\",\n name: \"valueSchema\",\n type: \"bytes32\",\n },\n {\n internalType: \"string[]\",\n name: \"keyNames\",\n type: \"string[]\",\n },\n {\n internalType: \"string[]\",\n name: \"fieldNames\",\n type: \"string[]\",\n },\n ],\n name: \"registerTable\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"rejectTrade\",\n outputs: [\n {\n internalType: \"bool\",\n name: \"\",\n type: \"bool\",\n },\n ],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"restartGame\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"resourceSelector\",\n type: \"bytes32\",\n },\n {\n internalType: \"address\",\n name: \"grantee\",\n type: \"address\",\n },\n ],\n name: \"revokeAccess\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n {\n internalType: \"uint8\",\n name: \"schemaIndex\",\n type: \"uint8\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n {\n internalType: \"Schema\",\n name: \"valueSchema\",\n type: \"bytes32\",\n },\n ],\n name: \"setField\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n {\n internalType: \"bytes\",\n name: \"data\",\n type: \"bytes\",\n },\n {\n internalType: \"Schema\",\n name: \"valueSchema\",\n type: \"bytes32\",\n },\n ],\n name: \"setRecord\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"targetPlayer\",\n type: \"bytes32\",\n },\n {\n internalType: \"uint8\",\n name: \"assetKind\",\n type: \"uint8\",\n },\n {\n internalType: \"uint32\",\n name: \"money\",\n type: \"uint32\",\n },\n ],\n name: \"trade\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n {\n internalType: \"bytes32\",\n name: \"table\",\n type: \"bytes32\",\n },\n {\n internalType: \"bytes32[]\",\n name: \"key\",\n type: \"bytes32[]\",\n },\n {\n internalType: \"uint8\",\n name: \"schemaIndex\",\n type: \"uint8\",\n },\n {\n internalType: \"uint256\",\n name: \"startByteIndex\",\n type: \"uint256\",\n },\n {\n internalType: \"bytes\",\n name: \"dataToSet\",\n type: \"bytes\",\n },\n {\n internalType: \"Schema\",\n name: \"valueSchema\",\n type: \"bytes32\",\n },\n ],\n name: \"updateInField\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n] as const;\n\nexport class IWorld__factory {\n static readonly abi = _abi;\n static createInterface(): IWorldInterface {\n return new utils.Interface(_abi) as IWorldInterface;\n }\n static connect(address: string, signerOrProvider: Signer | Provider): IWorld {\n return new Contract(address, _abi, signerOrProvider) as IWorld;\n }\n}\n","import { mudConfig } from \"@latticexyz/world/register\";\nimport { resolveTableId } from \"@latticexyz/store/register\";\n\nexport default mudConfig({\n enums: {\n // GameState: [\"NotInited\", \"InGame\", \"Waiting\"]\n },\n modules: [\n {\n name: \"UniqueEntityModule\",\n root: true,\n args: [],\n },\n {\n name: \"KeysInTableModule\",\n root: true,\n args: [resolveTableId(\"Player\")],\n },\n {\n name: \"KeysWithValueModule\",\n root: true,\n args: [resolveTableId(\"Player\")],\n },\n {\n name: \"KeysInTableModule\",\n root: true,\n args: [resolveTableId(\"MapItem\")],\n },\n {\n name: \"KeysWithValueModule\",\n root: true,\n args: [resolveTableId(\"MapItem\")],\n },\n ],\n tables: {\n Counter: {\n keySchema: {},\n schema: \"uint32\",\n },\n Game:{\n keySchema: {},\n schema:{\n gameId:'uint256',\n startTime:'uint256',\n endTime:'uint256',\n finishTime:'uint256'//可以开始下一局游戏了\n }\n },\n GameState:{\n keySchema: {},\n schema:\"uint32\",\n },\n GameMap: {\n keySchema: {},\n schema: {\n width: \"uint256\",\n height: \"uint256\",\n mapArray:\"bytes\"\n }\n },\n FundCards:{\n keySchema:{},\n schema:{\n allCard:\"uint16[72]\"\n }\n },\n FundPool:{\n keySchema:{},\n schema:{\n placeHolder:\"uint256\",\n array:\"uint16[9]\"\n }\n },\n MapItem:{\n schema:{\n x:'uint256',\n y:'uint256'\n }\n },\n MapItemValue:{\n schema:'uint32'\n },\n IsPlayer:{\n dataStruct:false,\n schema:'bool'\n },\n Player:{\n dataStruct:true,\n schema:{\n gameId:'uint256',\n state:'uint32',\n money:'uint32',\n x:'uint256',\n y:'uint256'\n }\n },\n RaiseColddown:{\n dataStruct:true,\n schema:{\n start:'uint256',\n end:'uint256',\n }\n },\n AssetsList:{\n dataStruct:true,\n schema:{\n gpu:'int8',\n bitcoin:'int8',\n battery:'int8',\n leiter:'int8',\n gold:'int8',\n oil:'int8'\n }\n },\n OwnedCards:{\n schema:{\n array:\"uint256[]\"\n }\n },\n HasDebt:{\n schema:\"bool\"\n },\n Debt:{\n schema:\"uint32\"\n },\n Log:{\n dataStruct:true,\n schema:'uint256',\n },\n //Partner list\n TransactionList:{\n dataStruct:true,\n schema:{\n list:'bytes32[]'\n }\n },\n //trade transaction list\n TradeList:{\n dataStruct:true,\n schema:{\n list:'bytes'\n }\n },\n IsTrading:{\n dataStruct:false,\n schema:'bool'\n },\n PlayerGameResult:{\n dataStruct:true,\n schema:{\n rank:'int32',\n points:'int32',\n gpu:'int8',\n bitcoin:'int8',\n battery:'int8',\n leiter:'int8',\n gold:'int8',\n oil:'int8',\n }\n },\n IsEliminated:{\n schema:\"bool\"\n },\n UnsolicitedTransaction:{\n dataStruct:true,\n schema:{\n asset:'uint8',\n money:'uint32',\n to:'bytes32'\n }\n },\n PassiveTransaction:{\n dataStruct:true,\n schema:{\n asset:'uint8',\n money:'uint32',\n from:'bytes32'\n }\n }\n },\n});\n","import { createPublicClient, fallback, webSocket, http, createWalletClient, Hex, parseEther, ClientConfig } from \"viem\";\nimport { createFaucetService } from \"@latticexyz/services/faucet\";\nimport { encodeEntity, syncToRecs } from \"@latticexyz/store-sync/recs\";\nimport { getNetworkConfig } from \"./getNetworkConfig\";\nimport { world } from \"./world\";\nimport { IWorld__factory } from \"contracts/types/ethers-contracts/factories/IWorld__factory\";\nimport { createBurnerAccount, createContract, transportObserver, ContractWrite } from \"@latticexyz/common\";\nimport { Subject, share } from \"rxjs\";\nimport mudConfig from \"contracts/mud.config\";\n\nexport type SetupNetworkResult = Awaited>;\n\nexport async function setupNetwork() {\n const networkConfig = await getNetworkConfig();\n\n const clientOptions = {\n chain: networkConfig.chain,\n transport: transportObserver(fallback([webSocket(), http()])),\n pollingInterval: 1000,\n } as const satisfies ClientConfig;\n\n const publicClient = createPublicClient(clientOptions);\n\n const burnerAccount = createBurnerAccount(networkConfig.privateKey as Hex);\n const burnerWalletClient = createWalletClient({\n ...clientOptions,\n account: burnerAccount,\n });\n\n const write$ = new Subject();\n const worldContract = createContract({\n address: networkConfig.worldAddress as Hex,\n abi: IWorld__factory.abi,\n publicClient,\n walletClient: burnerWalletClient,\n onWrite: (write) => write$.next(write),\n });\n\n const { components, latestBlock$, blockStorageOperations$, waitForTransaction } = await syncToRecs({\n world,\n config: mudConfig,\n address: networkConfig.worldAddress as Hex,\n publicClient,\n // startSync: false,\n startBlock: BigInt(networkConfig.initialBlockNumber),\n });\n\n \n // Request drip from faucet\n // if (true) {\n // // const address = burnerAccount.address;\n // const faucetUrl = \"https://faucet.testnet-mud-services.linfra.xyz\"\n // const address = \"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266\"\n // console.info(\"[Dev Faucet]: Player address -> \", address);\n\n // const faucet = createFaucetService(faucetUrl);\n\n // const requestDrip = async () => {\n // const balance = await publicClient.getBalance({ address });\n // console.info(`[Dev Faucet]: Player balance -> ${balance}`);\n // const lowBalance = balance < parseEther(\"1\");\n // await faucet.dripDev({ address });\n // if (lowBalance) { \n // console.info(\"[Dev Faucet]: Balance is low, dripping funds to player\");\n // // Double drip\n // await faucet.dripDev({ address });\n // await faucet.dripDev({ address });\n // }\n // };\n\n\n // requestDrip();\n // // Request a drip every 20 seconds\n // setInterval(requestDrip, 20000);\n // }\n // Request drip from faucet\n if (networkConfig.faucetServiceUrl) {\n const address = burnerAccount.address;\n console.info(\"[Dev Faucet]: Player address -> \", address);\n\n const faucet = createFaucetService(networkConfig.faucetServiceUrl);\n\n const requestDrip = async () => {\n const balance = await publicClient.getBalance({ address });\n console.info(`[Dev Faucet]: Player balance -> ${balance}`);\n const lowBalance = balance < parseEther(\"1\");\n if (lowBalance) {\n console.info(\"[Dev Faucet]: Balance is low, dripping funds to player\");\n // Double drip\n await faucet.dripDev({ address });\n await faucet.dripDev({ address });\n }\n };\n\n requestDrip();\n // Request a drip every 20 seconds\n setInterval(requestDrip, 20000);\n }\n\n return {\n world,\n components,\n playerEntity: encodeEntity({ address: \"address\" }, { address: burnerWalletClient.account.address }),\n publicClient,\n walletClient: burnerWalletClient,\n latestBlock$,\n blockStorageOperations$,\n waitForTransaction,\n worldContract,\n write$: write$.asObservable().pipe(share()),\n };\n}\n","import { createClientComponents } from \"./createClientComponents\";\nimport { createSystemCalls } from \"./createSystemCalls\";\nimport { setupNetwork } from \"./setupNetwork\";\n\nexport type SetupResult = Awaited>;\n\nexport async function setup() {\n const network = await setupNetwork();\n const components = createClientComponents(network);\n const systemCalls = createSystemCalls(network, components);\n return {\n network,\n components,\n systemCalls,\n };\n}\n","\nimport { setup } from \"./mud/setup\";\nimport mudConfig from \"contracts/mud.config\";\nimport { runQuery ,getComponentValue,getComponentValueStrict, Has, Not } from \"@latticexyz/recs\";\n\nconst {\n components,\n systemCalls: {checkDebt, restartGame, pay,increment,joinGame,askStart,move,pickAsset,pickFund,trade,acceptTrade,rejectTrade,finishGame,pickCoin,findPartner },\n network,\n} = await setup();\n\nglobalThis.ponzi = {\n counter:0,\n currentPlayer:network.playerEntity,\n gameState:null,\n game:null,\n gameMap:null,\n mapItems:null,\n players:null,\n transactionList:null,\n percentage:0,\n}\n\nglobalThis.env = {\n components:components\n}\n\n// Components expose a stream that triggers when the component is updated.\ncomponents.GameState.update$.subscribe((update) => {\n const [nextValue, prevValue] = update.value;\n console.log(\"GameState updated\", update, { nextValue, prevValue });\n globalThis.ponzi.gameState = nextValue?nextValue.value:null;\n globalThis.ponzi.gamestate_update?.(prevValue?.value, nextValue?.value);\n});\n\n// Update initial sync status in the UI\ncomponents.SyncProgress.update$.subscribe((obj) => {\n console.log(\"onSyncProgressUpdate:\",obj);\n globalThis.ponzi.percentage = obj.value[0].percentage;\n globalThis.ponzi.syncprogress_update?.(globalThis.ponzi.percentage);\n});\n\n// components.Counter.update$.subscribe((update) => {\n// const [nextValue, prevValue] = update.value;\n// console.log(\"Counter updated\", update, { nextValue, prevValue });\n// globalThis.ponzi.counter = nextValue;\n// globalThis.ponzi.counter_update?.(prevValue, nextValue);\n// });\n\ncomponents.Game.update$.subscribe((update) => {\n const [nextValue, prevValue] = update.value;\n console.log(\"Game updated\", update, { nextValue, prevValue });\n globalThis.ponzi.game = nextValue;\n globalThis.ponzi.game_update?.(prevValue, nextValue);\n});\n\ncomponents.Player.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"Player updated\", update, { nextValue, prevValue });\n // globalThis.ponzi.player_update?.(prevValue, nextValue);\n globalThis.ponzi.player_update?.(update);\n});\n\ncomponents.GameMap.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"GameMap updated\", { nextValue, prevValue });\n globalThis.ponzi.gameMap = nextValue\n globalThis.ponzi.gamemap_update?.(prevValue, nextValue);\n});\n\ncomponents.FundPool.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"FundPool updated\", update);\n globalThis.ponzi.fundpool_update?.(update);\n});\n\ncomponents.MapItem.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n // console.log(\"MapItems updated\", { nextValue, prevValue });\n globalThis.ponzi.mapitems_update?.(prevValue, nextValue);\n});\n\ncomponents.IsPlayer.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"IsPlayer updated\", update);\n globalThis.ponzi.isplayer_update?.(update);\n});\n\ncomponents.IsEliminated.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"IsEliminated updated\", update);\n globalThis.ponzi.iseliminated_update?.(update);\n});\n\n// components.IsFinishGame.update$.subscribe((update)=>{\n// const [nextValue, prevValue] = update.value;\n// console.log(\"IsFinishGame updated\", update);\n// globalThis.ponzi.isfinishgame_update?.(update);\n// });\n\ncomponents.OwnedCards.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"OwnedCards updated\", update);\n // globalThis.ponzi.isplayer_update?.(update);\n});\n\ncomponents.TransactionList.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"TransactionList updated\", update);\n\n globalThis.ponzi.transactionList = nextValue\n globalThis.ponzi.transactionlist_update?.(update);\n});\n\ncomponents.Log.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"Log updated\", update);\n});\n\ncomponents.AssetsList.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"AssetsList updated\", update);\n globalThis.ponzi.assetslist_update?.(update);\n});\n\ncomponents.RaiseColddown.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"RaiseColddown updated\", update);\n globalThis.ponzi.raiseColddown_update?.(update);\n});\n\n//Trade\ncomponents.PassiveTransaction.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"PassiveTransaction updated\", update);\n globalThis.ponzi.passivetransaction_update?.(update);\n});\ncomponents.TradeList.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"TradeList updated\", update);\n globalThis.ponzi.tradelist_update?.(update);\n});\ncomponents.PlayerGameResult.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"PlayerGameResult updated\", update);\n globalThis.ponzi.playergameresult_update?.(update);\n});\ncomponents.HasDebt.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"HasDebt updated\", update);\n globalThis.ponzi.hasdebt_update?.(update);\n});\ncomponents.TransactionList.update$.subscribe((update)=>{\n const [nextValue, prevValue] = update.value;\n console.log(\"TransactionList updated\", update);\n globalThis.ponzi.transactionlist_update?.(update);\n});\n\n//get functions\n(window as any).getPlayers = () => {\n return components.Player.values;\n}\n\n(window as any).getIsPlayers = () => {\n return components.IsPlayer.values;\n}\n\n(window as any).getMapItems = ()=>{\n return components.MapItem.values;\n}\n\n(window as any).getAssetsList = ()=>{\n return components.AssetsList.values;\n}\n\n(window as any).getTransactionList = ()=>{\n return components.TransactionList.values;\n}\n\n(window as any).getFundPool = ()=>{\n return components.FundPool.values;\n}\n\n//Query\n(window as any).queryValue = async (component, entity) => {\n const data = getComponentValueStrict(component, entity)\n console.log(\"getValueByComAndEntity:\", data);\n return data;\n};\n\n(window as any).queryPlayingAssetsList = async ()=>{\n const matchingEntities = runQuery([\n Has(components.AssetsList),\n Has(components.Player)\n ])\n\n return matchingEntities;\n}\n\n(window as any).queryResultAssetsList = async ()=>{\n const matchingEntities = runQuery([\n Has(components.AssetsList),\n Not(components.IsEliminated)\n ])\n\n return matchingEntities;\n}\n\n\n// Just for demonstration purposes: we create a global function that can be\n// called to invoke the Increment system contract via the world. (See IncrementSystem.sol.)\n(window as any).increment = async () => {\n let data = await increment();\n console.log(\"new counter value:\", data);\n return data;\n};\n(window as any).joinGame = async () => {\n let data = await joinGame();\n console.log(\"joinGame:\", data);\n return data;\n};\n(window as any).askStart = async () => {\n let data = await askStart();\n console.log(\"askStart:\", data);\n return data;\n};\n(window as any).move = async (x,y) => {\n let data = await move(x,y);\n console.log(\"move:\", data);\n return data;\n};\n(window as any).pickAsset = async (assetKind) => {\n console.log(\"send pickAsset:\", assetKind);\n await pickAsset(assetKind);\n};\n(window as any).pickFund = async (cardId) => {\n console.log(\"send pickFund:\", cardId);\n await pickFund(cardId);\n};\n(window as any).trade = async (targetPlayer:string,assetKind:number,money:number) => {\n console.log(\"send trade:\", targetPlayer, money, assetKind);\n await trade(targetPlayer,assetKind,money);\n};\n(window as any).acceptTrade = async () => {\n let data = await acceptTrade();\n console.log(\"send acceptTrade:\"+data);\n};\n(window as any).rejectTrade = async () => {\n let data = await rejectTrade();\n console.log(\"send rejectTrade:\"+data);\n};\n\n(window as any).finishGame = async () => {\n console.log(\"send finishGame\");\n let data = await finishGame();\n};\n\n(window as any).pickCoin = async () => {\n console.log(\"send pickCoin...\");\n let data = await pickCoin();\n console.log(\"send pickCoin data:\"+data);\n};\n\n(window as any).searchPartner = async () => {\n console.log(\"send searchPartner...\");\n let data = await findPartner();\n // console.log(\"send findPartner data:\"+data);\n};\n(window as any).payDebt = async () => {\n console.log(\"send pay...\");\n let data = await pay();\n};\n(window as any).restartGame = async () => {\n console.log(\"send restartGame...\");\n let data = await restartGame();\n};\n(window as any).checkDebt = async ()=>{\n console.log(\"send checkDebt...\");\n let data = await checkDebt();\n}\n// // start sync manually by subscribing to `blockStorageOperation$`\n// const subcription = network.blockStorageOperation$.subscribe();\n \n// // clean up subscription\n// subscription.unsubscribe();\n\n\n// https://vitejs.dev/guide/env-and-mode.html\nif (true||import.meta.env.DEV) {\n const { mount: mountDevTools } = await import(\"@latticexyz/dev-tools\");\n console.log(\"============================\");\n mountDevTools({\n config: mudConfig,\n publicClient: network.publicClient,\n walletClient: network.walletClient,\n latestBlock$: network.latestBlock$,\n blockStorageOperations$: network.blockStorageOperations$,\n worldAddress: network.worldContract.address,\n worldAbi: network.worldContract.abi,\n write$: network.write$,\n recsWorld: network.world,\n });\n}","import { hexToArray } from \"@latticexyz/utils\";\n\nwindow.mudutils = {};\nwindow.mudutils.hexToArray = function(width, height, mapArray){\n const terrain = Array.from(hexToArray(mapArray)).map((value:number, index) => {\n return value;\n });\n\n const terrainArray = [];\n for (let i = 0; i < terrain.length; i += Number(width)) {\n const row = terrain.slice(i, i + Number(width));\n terrainArray.push(row);\n }\n\n return terrainArray;\n}"],"names":["components","error","_len","args","_key","defineProperty","func","invoked","noop","isFunction","fn","value","t","isObject","isPlainObject","proto","protoConstructor","obj","constructor","object","propName","name","theClass","x","thing","keys","symbols","s","target","prop","res","key","props","i","descriptor","Constructor","protoProps","staticProps","source","subClass","superClass","o","p","self","minLen","n","arr","len","arr2","allowArrayLike","it","input","hint","prim","arg","annotation","decorator","property","prototype","Atom","name_","_proto","listener","onBecomeObservedHandler","onBecomeUnobservedHandler","atom","a","b","v","_","observable","newValue","oldValue","options","adm","_this$options_","actionDescriptor","proxyTrap","_ref","_ref2","safeDescriptors","_annotation$options_","_annotation$options_$","_annotation$options_2","_annotation$options_$2","_annotation$options_3","_annotation$options_4","_adm$proxy_2","_adm$proxy_","flowDescriptor","_this$options_2","bound","_this$options_$enhanc","_this$options_3","_this$options_4","set","flowAnnotation","actionAnnotation","observableAnnotation","_this$options_5","_this$options_6","_options$defaultDecor","arg2","arg3","initialValues","decorators","arg1","opts","actionName","autoAction","ref","canRunAsDerivation","scope","runInfo","err","notifySpy_","startTime_","prevDerivation_","runAsAction","prevAllowStateChanges_","prevAllowStateReads_","allowStateChanges","prev","_Atom","ObservableValue","enhancer","notifySpy","equals","_this","change","handler","fireImmediately","ComputedValue","prevTrackingContext","result","wasSuspended","changed","track","e","firstTime","prevValue","prevU","IDerivationState_","TraceMode","cause","derivation","prevAllowStateReads","prevUntracked","obs","l","f","context","prevTracking","prevObserving","observing","lowestNewObservingDerivationState","i0","dep","_dep","_dep2","action","allowStateReads","global","node","list","d","Reaction","onInvalidate_","errorHandler_","requiresObservable_","prevReaction","message","abortSignal","_this2","dispose","enterBreakPoint","allReactions","iterations","remainingReactions","event","view","_opts$name","_opts","_opts2","_opts2$signal","_opts3","runSync","reaction","reactionRunner","scheduler","isScheduled","run","hook","cb","listenersKey","hookListeners","properties","annotations","descriptors","generator","ctx","runId","gen","rejector","pendingPromise","promise","resolve","reject","stepId","onFulfilled","ret","next","onRejected","_res","yieldedPromise","thisArg","_getAdm$set_","_getAdm$delete_","_getAdm$definePropert","_target$$mobx","_target$$mobx$proxy_","interceptable","interceptors","idx","listenable","listeners","ObservableArrayAdministration","owned_","legacyMode_","newV","oldV","values","newLength","currentLength","newItems","oldLength","delta","index","deleteCount","length","lengthDelta","_this$values_","oldItems","_i","notify","added","removed","owned","proxy","_len2","items","_key2","_len3","_key3","copy","funcName","funcFactory","dehancedValues","callback","element","_this3","accumulator","currentValue","ObservableMap","initialData","enhancer_","entry","newEntry","hasKey","_change","_this3$hasMap_$get","_this4","_this4$hasMap_$get","_keys$next","done","_keys$next2","_iterator","_step","_step$value","other","_this5","_this6","_iterator2","_step2","_this7","replacementMap","orderedData","keysReportChangedCalled","_iterator3","_step3","deleted","_iterator4","_step4","_step4$value","_value","keyExisted","_value2","iter1","iter2","next1","next2","dataStructure","map","ObservableSet","callbackFn","_change2","nextIndex","observableValues","ObservableObjectAdministration","target_","values_","defaultAnnotation_","_this$target_$storedA","outcome","deleteOutcome","cachedDescriptor","_this$pendingKeys_","_this$pendingKeys_$ge","_getDescriptor","_this$pendingKeys_2","_this$pendingKeys_2$g","_options$name","_adm$target_$storedAn","ctor","_StubArray","_Symbol$toStringTag","_Symbol$iterator","LegacyObservableArray","arrays","max","_observable","named","depth","aStack","bStack","type","className","areArrays","aCtor","bCtor","iterator","m","g","__extends","__","__awaiter","_arguments","P","adopt","fulfilled","step","rejected","body","y","verb","op","__read","r","ar","__spreadArray","to","from","pack","q","resume","settle","fulfill","createImpl","_super","instance","ctorFunc","errors","item","Subscription","initialTeardown","e_1","_a","e_2","_b","_parentage","_parentage_1","_parentage_1_1","parent_1","e_1_1","initialFinalizer","_finalizers","_finalizers_1","_finalizers_1_1","finalizer","e_2_1","teardown","parent","empty","timeout","delegate","handle","Subscriber","destination","complete","ConsumerObserver","partialObserver","SafeSubscriber","observerOrNext","context_1","identity","fns","pipeFromArray","Observable","subscribe","operator","subscriber","sink","promiseCtor","Symbol_observable","operations","init","liftedSource","onNext","onComplete","onError","onFinalize","OperatorSubscriber","shouldUnsubscribe","closed_1","Subject","subject","_c","observer","observers","hasError","isStopped","thrownError","AnonymousSubject","ReplaySubject","_bufferSize","_windowTime","_timestampProvider","_buffer","_infiniteTimeWindow","subscription","adjustedBufferSize","now","last","defaultValue","isAsyncIterable","isIterable","Symbol_iterator","readableStream","reader","array","iterable","iterable_1","iterable_1_1","asyncIterable","process","asyncIterable_1","asyncIterable_1_1","parentSubscription","work","delay","repeat","scheduleSubscription","config","hasConfig","project","isArray","getPrototypeOf","first_1","resultSelector","observables","valueTransform","active","remainingFirstValues","_loop_1","hasFirstValue","execute","concurrent","onBeforeNext","expand","innerSubScheduler","additionalFinalizer","buffer","isComplete","checkComplete","outerNext","doInnerSub","innerComplete","innerValue","bufferedValue","ii","concat","observableFactory","sources","predicate","selector","innerSub","syncUnsub","handledResult","count","seen","share","connector","resetOnError","resetOnComplete","_d","resetOnRefCountZero","wrapperSource","connection","resetConnection","refCount","hasCompleted","hasErrored","cancelReset","reset","resetAndUnsubscribe","conn","dest","on","configOrBufferSize","windowTime","bufferSize","tapObserver","isUnsub","module","exports","assert","val","msg","inherits","superCtor","TempCtor","BN","number","base","endian","Buffer","num","left","right","start","j","w","off","parseHex4Bits","string","c","parseHexByte","lowerBound","parseLength","parseBase","str","end","mul","limbLen","limbPow","total","mod","word","pow","move","src","size","inspect","zeros","groupSizes","groupBases","padding","out","carry","groupSize","groupBase","allocate","ArrayType","byteLength","reqLength","postfix","position","shift","hi","toBitArray","bit","wbit","width","bytesNeeded","bitsLeft","cmp","smallMulTo","lo","k","ncarry","rword","maxJ","comb10MulTo","mid","a0","al0","ah0","a1","al1","ah1","a2","al2","ah2","a3","al3","ah3","a4","al4","ah4","a5","al5","ah5","a6","al6","ah6","a7","al7","ah7","a8","al8","ah8","a9","al9","ah9","b0","bl0","bh0","b1","bl1","bh1","b2","bl2","bh2","b3","bl3","bh3","b4","bl4","bh4","b5","bl5","bh5","b6","bl6","bh6","b7","bl7","bh7","b8","bl8","bh8","b9","bl9","bh9","w0","w1","w2","w3","w4","w5","w6","w7","w8","w9","w10","w11","w12","w13","w14","w15","w16","w17","w18","bigMulTo","hncarry","jumboMulTo","isNegNum","bits","carryMask","newCarry","extended","h","mask","maskedWords","mode","bhi","bhiBits","diff","qj","positive","div","dm","half","r2","acc","A","B","C","D","yp","xp","im","jm","x1","x2","negative","Red","primes","MPrime","tmp","rlen","K256","output","outLen","P224","P192","P25519","prime","mod3","one","nOne","lpow","z","inv","windowSize","wnd","current","currentLen","Mont","u","this","version","missing","form","LogLevel","ErrorCode","logLevel","level","code","params","messageDetails","hex","reason","url","fault","condition","expectedCount","kind","censorship","permanent","logger","objects","accum","offset","data","endOffset","_BN","_constructorGuard","constructorGuard","toHex","anyValue","operation","promises","info","param","allowIndexed","originalParam","throwError","newNode","child","sibling","match","format","comp","ParamTypify","allowIndex","anonymous","modifier","comps","state","parens","returns","fragment","sig","checkErrors","path","childPath","localName","dynamic","wordSize","writer","bytes","paddingOffset","Reader","coerceFunc","allowLoose","loose","alignedLength","INPUT_ERROR","FINALIZE_ERROR","WINDOW","root","WEB_WORKER","NODE_JS","COMMON_JS","ARRAY_BUFFER","HEX_CHARS","SHAKE_PADDING","CSHAKE_PADDING","KECCAK_PADDING","PADDING","SHIFT","RC","BITS","SHAKE_BITS","OUTPUT_TYPES","CSHAKE_BYTEPAD","createOutputMethod","outputType","Keccak","createShakeOutputMethod","outputBits","createCshakeOutputMethod","methods","createKmacOutputMethod","createOutputMethods","method","createMethod","createShakeMethod","createCshakeMethod","createKmacMethod","Kmac","algorithms","methodNames","algorithm","methodName","newMethodName","notString","blocks","byteCount","blockCount","strs","paddingBytes","outputBlocks","extraBytes","block","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","b10","b11","b12","b13","b14","b15","b16","b17","b18","b19","b20","b21","b22","b23","b24","b25","b26","b27","b28","b29","b30","b31","b32","b33","b34","b35","b36","b37","b38","b39","b40","b41","b42","b43","b44","b45","b46","b47","b48","b49","keccak256","payload","address","chars","expanded","hashed","checksum","getAddress","isAddress","getContractAddress","transaction","nonce","coder","coders","arrayValues","unique","staticWriter","Writer","dynamicWriter","updateFuncs","dynamicOffset","updateFunc","baseOffset","baseReader","offsetReader","uniqueNames","defaultChild","signed","maxUintValue","bounds","UnicodeNormalizationForm","Utf8ErrorReason","badCodepoint","extraLength","overlongMask","nextChar","pair","codePoints","codePoint","types","component","id","text","wrap","fragments","abi","bucket","signature","eventFragment","nameOrSignatureOrSighash","matching","nameOrSignatureOrTopic","topichash","getSighash","functionFragment","errorArgs","errorName","errorSignature","builtin","topics","encodeTopic","dataTypes","dataValues","topicHash","indexed","nonIndexed","resultIndexed","resultNonIndexed","nonIndexedIndex","indexedIndex","tx","log","hexData","gasPrice","lastBaseFeePerGas","maxFeePerGas","maxPriorityFeePerGas","eventName","blockTag","signedTx","hasEip1559","feeData","results","provider","domain","TransactionTypes","addr","storageKeys","storageKey","resolver","nameOrPromise","paramType","contract","overrides","check","resolved","ro","intrinsic","roValue","leftovers","signerOrProvider","wait","confirmations","receipt","parsed","collapseSimple","txRequest","filter","topic","tag","once","listenerCount","argsCopy","contractInterface","addressOrName","uniqueFilters","eventSignature","filters","uniqueSignatures","signatures","runningEvent","emit","wrappedEmit","fromBlockOrBlockhash","toBlock","logs","E","tr","fe","I","K","H","S","$","ne","te","ee","R","oe","T","O","Y","G","J","V","ue","se","le","ye","de","me","ae","pe","ce","Te","BaseError","shortMessage","details","docsPath","regex","bytesRegex","integerRegex","abiParameter","structs","inputParams","inputs","inputLength","outputs","outputParams","outputLength","abiParameters","parameterCacheKey","isTuple","components_","char","tail","shallowStructs","signaturesLength","propertiesLength","trimmed","resolvedStructs","entries","entriesLength","parameters","ancestors","parseAbiParameter_","abiItem","includeName","strict","getUrl","expectedLength","givenLength","expectedSize","functionName","givenSize","targetSize","hexOrBytes","dir","hex_","paddedBytes","padEnd","min","maxSize","sliceLength","size_","hexToNumber","hexToBytes","hexes","_v","bytesToHex","hexString","value_","maxValue","minValue","suffix","encoder","toBytes","hexByte","byte","def","parts","bool","lengths","hash","exists","checkFinished","lst","Ah","Al","Bh","Bl","Cl","low","Ch","Dl","Dh","El","Eh","isLE","utf8ToBytes","wrapConstructor","hashConstructor","hashC","hashCons","_0n","_1n","_2n","round","rounds","idx1","idx0","B0","B1","Th","Tl","curH","curL","PI","Hash","blockLen","outputLen","enableXOF","pos","take","bufferOut","to_","concatBytes","preparedParams","arrayComponents","staticSize","encoded","staticParams","dynamicParams","dynamicSize","dynamicChild","preparedParam","paramSize","bytesSize","hexValue","partsLength","param_","matches","abiItems","argType","abiParameterType","definition","indexedInputs","args_","client","requestMap","method_","status","transport","fromBlock","getRequest","account","address_","chainId","hexAddress","decodedValues","consumed","decodedChild","hasUnnamedChild","replacer","space","includeFunctionName","decimals","display","integer","fraction","wei","unit","maxLength","chain","gas","prettyArgs","blockHash","blockNumber","identifier","account_","contractAddress","sender","formattedArgs","functionWithParams","decodedData","metaMessages","firstArg","errorWithParams","headers","transactionRequest","transaction_","transactions","blockTag_","includeTransactions_","includeTransactions","blockNumberHex","request","defaultPriorityFee","accessList","rest","balance","currentChainId","fees","formatters","serializers","shouldSplitBatch","exec","getScheduler","flush","getBatchedArgs","setScheduler","batch","response","offchainLookup","offchainLookupSignature","request_","batchSize","multicallAddress_","multicallAddress","schedule","requests","calls","calldata","returnData","success","callRequest","dataSuffix","observerId","callbacks","callbackId","getListeners","unsubscribe","unwatch","cleanup","time","emitOnBegin","initialWaitTime","interval","initialWait","poll","cacheKey","buildCache","cache","cacheTime","maxAge","strict_","argTopics","isUnnamed","nonIndexedInputs","_client","events_","events","onLogs","poll_","pollingInterval","previousBlockNumber","initialized","unsubscribe_","formatted","chainIdHex","serializer","signedRequest","publicClient","walletClient","hasPublicClient","hasWalletClient","hasReadFunction","hasWriteFunction","hasEvent","abiEvent","hasArgs","nativeCurrency","rpcUrls","blockExplorers","publicKey","createClient","extend","extendFn","combined","delay_","retryCount","shouldRetry","attemptRetry","retry","retryDelay","err_","retryAfter","transports_","rank","transports","onResponse","fetch","rankOptions","onTransports","sampleCount","weights","stabilityWeight","latencyWeight","samples","rankTransports_","sample","transport_","maxLatency","latency","scores","latencies","latencyScore","successes","stabilityScore","errorInstance","signal","timeoutId","controller","http","fetchOptions","signal_","url_","urlKey","socket","WebSocket","webSocket","subscriptions","onMessage","isSubscription","onClose","socket_","id_","rpc","retryCount_","timeout_","callType","primaryType","types_","validateData","struct","type_","integerMatch","_type","bytesMatch","bytecode","description","transactionReceipt","domain_","encodedTypes","encodedValues","field","encodedHashType","unsortedDeps","deps","primaryType_","parsedType","typeValuePairs","messageBytes","prefixBytes","serializedAccessList","serializedTransaction","rounded","ether","label","labels","hashFromEncodedLabel","packet","coinType","universalResolverAddress_","universalResolverAddress","functionData","uri","namespace","img","custom","defaultGateway","gatewayUrls","isEncoded","ipfsGateway","arweaveGateway","networkRegexMatch","protocol","subpath","subtarget","isIPNS","isIPFS","replacedUri","parsedUri","resolvedURI","isOnChain","uri_","reference","asset_namespace","tokenID","eip_namespace","chainID","erc_namespace","nft","record","nftUri","resolvedNftUri","encodedJson","decoded","uriTokenId","reverseNode","resolverAddress","feeHistory","reward","rewardPercentiles","slot","transactionBlockNumber","allowFailure","batchSize_","contracts_","contracts","chunkedCalls","currentChunk","currentChunkSize","callData","u8a","title","sum","pad","hashLen","qByteLen","hmacFn","reseed","seed","sl","pred","validators","optValidators","checkField","fieldName","isOptional","checkVal","a_","b_","signatureHex","emitMissed","onBlockNumber","enablePolling","prevBlockNumber","onReplaced","replacedTransaction","retrying","_unobserve","_unwatch","blockNumber_","replacementTransaction","onBlock","prevBlock","onTransactions","hashes","permissions","signMessage","message_","signTypedData","typedData","onData","subscriptionId","bytesLength","byteOffset","_32n","_u32_max","wh","wl","padOffset","dataView","oview","finished","destroyed","F","W15","W2","s0","s1","sigma1","T1","T2","_3n","power","modulo","invert","legendreC","Q","Z","p1div4","Fp","Q1div2","t2","ge","n2","nv","initial","nums","lastMultiplied","inverted","nBitLength","_nBitLength","nByteLength","ORDER","bitLen","redef","BYTES","sqrtP","lhs","rhs","groupOrder","constTimeNegate","neg","W","windows","elm","points","window","precomputes","maxNumber","shiftBy","wbits","offset1","offset2","cond1","cond2","precomputesMap","transform","curve","ut.validateObject","endo","ut","sBytes","rBytesLeft","slice","shl","rhl","rl","CURVE","point","isCompressed","ut.concatBytes","fromBytes","weierstrassEquation","x3","isWithinCurveOrder","assertGE","normPrivateKeyToScalar","wrapPrivateKey","ut.bytesToHex","ut.bytesToNumberBE","mod.mod","pointPrecomputes","assertPrjPoint","Point","px","py","pz","is0","toInv","privateKey","X1","Y1","Z1","X2","Y2","Z2","U1","U2","X3","Y3","Z3","t0","t1","t3","t4","t5","wnaf","k1neg","k1","k2neg","k2","k1p","k2p","scalar","fake","f1p","f2p","iz","ax","ay","zz","cofactor","isTorsionFree","clearCofactor","_bits","curveDef","CURVE_ORDER","compressedLen","uncompressedLen","isValidFieldElement","modN","invN","mod.invert","cat","head","y2","isYOdd","numToNByteStr","ut.numberToBytesBE","isBiggerThanHalfOrder","HALF","normalizeS","slcNum","Signature","recovery","msgHash","rec","bits2int_modN","radj","prefix","ir","u1","u2","ut.hexToBytes","utils","rand","mod.hashToPrivateScalar","getPublicKey","isProbPub","getSharedSecret","privateA","publicB","bits2int","ORDER_MASK","ut.bitMask","int2octets","prepSig","defaultSigOpts","randomBytes","lowS","prehash","ent","h1int","seedArgs","k2sig","kBytes","ik","normS","defaultVerOpts","sign","privKey","ut.createHmacDrbg","verify","sg","_sig","derError","is","buf","oHash","iHash","msgs","defHash","create","_6n","_11n","_22n","_23n","_44n","_88n","b88","b176","b220","b223","POW_2_128","L","U","M","N","X","parse","fmtLong","fmtShort","ms","msAbs","plural","isPlural","setup","env","createDebug","coerce","disable","enable","enabled","require$$0","destroy","selectColor","prevTime","enableOverride","namespacesCache","enabledCache","debug","curr","formatter","delimiter","newDebug","namespaces","split","toNamespace","regexp","formatArgs","save","load","useColors","localstorage","warned","lastC","timeouts","currentTime","timeoutOps","counts","mainError","mainErrorCount","RetryOperation","attempt","random","original","attemptNumber","retriesLeft","errorMessage","AbortError","be","util","assertIs","_arg","assertNever","_x","validKeys","filtered","checker","joinValues","separator","objectUtil","first","second","issues","sub","subs","actualProto","_mapper","mapper","issue","fieldErrors","processError","el","formErrors","_ctx","errorMaps","issueData","fullPath","fullIssue","maps","arrayValue","pairs","syncPairs","finalObject","errorUtil","errorMap","invalid_type_error","required_error","iss","maybeAsyncResult","getIssueProperties","setError","refinementData","refinement","option","incoming","defaultValueFunc","catchValueFunc","This","ip","validation","tooBig","tooSmall","minLength","ch","valDecCount","stepDecCount","decCount","valInt","stepInt","inclusive","minDate","maxDate","schema","newShape","fieldSchema","shape","shapeKeys","extraKeys","keyValidator","unknownKeys","catchall","defaultError","augmentation","merging","newField","handleResults","unionErrors","childCtx","dirty","discriminator","discriminatorValue","optionsMap","discriminatorValues","aType","bType","bKeys","sharedKeys","newObj","sharedValue","newArray","itemA","itemB","handleParsed","parsedLeft","parsedRight","merged","itemIndex","schemas","keyType","valueType","third","finalMap","finalizeSet","elements","parsedSet","minSize","makeArgsIssue","makeReturnsIssue","parsedArgs","parsedReturns","returnType","getter","expectedValues","enumValues","opt","nativeEnumValues","promisified","effect","checkCtx","processed","executeRefinement","inner","preprocess","newCtx","inResult","fatal","_fatal","p2","ZodFirstPartyTypeKind","cls","red","green","blue","styles","codes","groupName","group","styleName","style","colorString","character","remainder","brand","substring","substringLength","endIndex","returnValue","gotCR","supportsColor","colorLevel","chalk","strings","ansiStyles","builder","model","arguments_","styler","bgModel","open","close","openAll","closeAll","_styler","_isEmpty","lfIndex","issueSeparator","unionSeparator","zodError","newIssues","prefixSeparator","maxIssuesInMessage","E.isAddress","_obj","_1","_2","isApply","DoubleIndexedKV","Registry","generateIdentifier","extendStatics","ClassRegistry","valuesNotNever","CustomTransformerRegistry","transformer","getType","segment","isEscapedDot","isEndOfSegment","lastSegment","__assign","il","isApplicable","untransform","superJson","baseError","flags","isRegistered","potentialClass","clazz","allowedProps","applicableCompositeRule","rule","applicableSimpleRule","json","transformation","row","keyOfRow","isEnd","lastKey","keyToRow","newKey","tree","walker","origin","subtree","nodeValue","children","plain","apply","identicalPaths","identicalObjectPath","identicalPath","identities","existingSet","identitites","rootEqualityPaths","paths","shortestPath","dedupe","objectsInThisPath","seenObjects","primitive","transformed_1","result_1","transformationResult","transformed","transformedValue","innerAnnotations","recursiveResult","newVal","originalObject","includeNonenumerable","propType","SuperJSON","equalityAnnotations","meta","teardownRef","isDone","unsubscribed","teardownImmediately","originalObserver","startIfNeeded","resetIfNeeded","_sub","abort","onDone","obs$","nextOp","customFetchImpl","customAbortControllerImpl","dict","_input","queryParts","ac","resolvedHeaders","runtime","batchLoader","pendingItems","dispatchTimer","destroyTimerAndPendingItems","groupItems","groupedItems","lastGroup","dispatch","unitResolver","cancel","_item","requester","resolvedOpts","maxURLLength","validate","batchOps","query","mutation","loaders","loader","requesterOpts","req$","envelope","combinedTransformer","link","clientCallType","pathCopy","procedureType","worldContract","waitForTransaction","Counter","GameState","Game","IsPlayer","Player","AssetsList","getComponentValue","singletonEntity","assetType","cardId","targetPlayer","money","high","unsigned","cachedObj","lowBits","highBits","radix","radixToPower","radixLong","rem1","rem","remDiv","intval","digits","thisNeg","otherNeg","addend","a48","a32","a16","a00","b00","c48","c32","c16","c00","subtrahend","multiplier","divisor","approx","halfThis","log2","approxRes","approxRem","numBits","pending","base64","b64","s64","chunk","invalidEncoding","evt","f32","f8b","writeFloat_f32_cpy","writeFloat_f32_rev","readFloat_f32_cpy","readFloat_f32_rev","writeFloat_ieee754","writeUint","exponent","mantissa","readFloat_ieee754","readUint","uint","f64","writeDouble_f64_cpy","writeDouble_f64_rev","readDouble_f64_cpy","readDouble_f64_rev","writeDouble_ieee754","off0","off1","readDouble_ieee754","utf8","alloc","SIZE","MAX","slab","LongBits","zero","zeroHash","charCodeAt","part0","part1","part2","require$$1","require$$2","require$$3","require$$4","require$$5","require$$6","require$$7","sizeOrArray","merge","dst","ifNotSet","newError","CustomError","fieldNames","fieldMap","encoding","BufferWriter","push","write_uint32","write_int32","write_sint32","write_uint64","write_sint64","write_bool","write_fixed32","write_fixed64","write_float","write_double","writeBytes_set","writeBytes_for","write_bytes","write_string","fork","ldelim","finish","BufferWriter_","write_bytes_buffer","write_string_buffer","BufferReader","writeLength","create_typed_array","create_array","read_uint32_setup","read_int32","read_sint32","read_bool","read_fixed32","read_sfixed32","read_float","read_double","read_bytes","nativeBuffer","read_string","skip","wireType","BufferReader_","read_string_buffer","rpcImpl","requestDelimited","responseDelimited","rpcCall","requestCtor","responseCtor","endedByRPC","protobuf","configure","Metadata","metadata","Status","composeClientMiddleware_1","middleware1","middleware2","call","options2","setPrototypeOf","propertyDescriptor","hasOwnProperty","objectCreate","propertyDescriptors","helpers","uglyErrorPrinting","extendableErrorName","ExtendableError","originalConstructor","constructorName","constructorNameMatch","constructorNameIsError","ClientError_1","ts_error_1","Status_1","composeServerMiddleware_1","context1","ServerError_1","__createBinding","desc","__exportStar","require$$8","require$$9","require$$10","requestEncode","requestFromPartial","responseEncode","responseFromPartial","grpc_web_1","serviceName","executor","removeAbortListener","callbackResult","dueTime","timer","unlisten","sourceObj","innerAbortController","abortListener","rejection","settledCount","settled","baseMs","maxDelayMs","maxAttempts","delayMs","backoff","deferredFunctions","spawnAbortController","spawnSignal","abortSpawn","tasks","abortTasks","task","removeSpawnAbortListener","failure","forkFn","taskAbortController","taskSignal","taskPromise","deferPromise","abortController","attemptsExhausted","handleFulfilled","handleRejected","makeAttempts","AsyncSink_1","isAsyncIterable_1","factory","VERSION","_hasatob","_hasbtoa","_hasBuffer","_TD","_TE","b64ch","b64chs","b64tab","tab","b64re","_fromCC","_U8Afrom","_mkUriSafe","m0","_tidyB64","btoaPolyfill","bin","u32","asc","_btoa","_fromUint8Array","maxargs","fromUint8Array","urlsafe","cb_utob","cc","re_utob","utob","_encode","encode","encodeURI","re_btou","cb_btou","cccc","cp","btou","atobPolyfill","u24","r1","_atob","_toUint8Array","toUint8Array","_unURI","_decode","decode","isValid","_noEnum","extendString","_add","extendUint8Array","extendBuiltins","gBase64","nice_grpc_common_1","grpcMetadata","createBidiStreamingMethod_1","abort_controller_x_1","service_definitions_1","convertMetadata_1","channel","middleware","defaultOptions","grpcMethodDefinition","methodDescriptor","bidiStreamingMethod","onHeader","onTrailer","pipeAbortController","trailers","pipeError","pipeRequest","createClientStreamingMethod_1","clientStreamingMethod","createServerStreamingMethod_1","serverStreamingMethod","createUnaryMethod_1","unaryMethod","defaultCallOptions","newMiddleware","methodEntries","methodDefinition","createChannel","foundry","chains.foundry","mudFoundry","latticeTestnet","chainIndex","world","worldAddress","initialBlockNumber","getBurnerPrivateKey","createWorld","utils.Interface","mudConfig","resolveTableId","networkConfig","clientOptions","transportObserver","burnerAccount","createBurnerAccount","burnerWalletClient","write$","createContract","write","latestBlock$","blockStorageOperations$","syncToRecs","faucet","requestDrip","encodeEntity","network","systemCalls","update","nextValue","entity","getComponentValueStrict","runQuery","Has","Not","assetKind","mountDevTools","height","mapArray","terrain","hexToArray","terrainArray"],"mappings":"uiDAIgB,SAAA,uBAAuB,CAAE,WAAAA,GAAkC,CAClE,MAAA,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pD,GAAIc,GAAKd,KACpD,GAAIqpD,EAAY,MAAMrpD,EAAC,EAAE,KAAKZ,EAAI,EACjC,MAAO,GAIT,MAAO,EACP,CASD,SAASorD,GAAYC,GAAQ,CAC5B,OAAOA,GAAO,SAAU,EACtB,UAAU,EAAGA,GAAO,SAAQ,EAAG,OAAS,CAAC,EACzC,QAAQ,UAAW,GAAG,CACxB,CASD,SAASnB,GAAOzqC,GAAK,CACpB,OAAIA,cAAe,MACXA,GAAI,OAASA,GAAI,QAElBA,EACP,CAMD,SAAS8qC,IAAU,CAClB,QAAQ,KAAK,uIAAuI,CACpJ,CAED,OAAAN,EAAY,OAAOA,EAAY,KAAM,CAAA,EAE9BA,CACR,CAEA,IAAA,OAAiBF,uBC3QjBxqC,EAAA,WAAqB+rC,GACrB/rC,EAAA,KAAegsC,GACfhsC,EAAA,KAAeisC,GACfjsC,EAAA,UAAoBksC,EACpBlsC,EAAkB,QAAAmsC,KAClBnsC,EAAA,SAAmB,IAAM,CACxB,IAAIosC,GAAS,GAEb,MAAO,IAAM,CACPA,KACJA,GAAS,GACT,QAAQ,KAAK,uIAAuI,EAEvJ,CACA,KAMApsC,EAAiB,OAAA,CAChB,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,SACD,EAWA,SAASksC,GAAY,CAIpB,OAAI,OAAO,OAAW,KAAe,OAAO,UAAY,OAAO,QAAQ,OAAS,YAAc,OAAO,QAAQ,QACrG,GAIJ,OAAO,UAAc,KAA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A,CACE,OAAQ,CACN,CACE,aAAc,SACd,KAAM,mBACN,KAAM,QACR,CACF,EACA,KAAM,2BACN,KAAM,OACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,SACd,KAAM,WACN,KAAM,QACR,CACF,EACA,KAAM,kBACN,KAAM,OACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,SACd,KAAM,SACN,KAAM,QACR,CACF,EACA,KAAM,yBACN,KAAM,OACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,SACd,KAAM,WACN,KAAM,QACR,CACF,EACA,KAAM,iBACN,KAAM,OACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,SACd,KAAM,WACN,KAAM,QACR,CACF,EACA,KAAM,mBACN,KAAM,OACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,SACN,KAAM,SACR,EACA,CACE,aAAc,UACd,KAAM,WACN,KAAM,SACR,CACF,EACA,KAAM,8BACN,KAAM,OACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,WACN,KAAM,SACR,EACA,CACE,aAAc,UACd,KAAM,WACN,KAAM,SACR,CACF,EACA,KAAM,8BACN,KAAM,OACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,WACN,KAAM,SACR,EACA,CACE,aAAc,UACd,KAAM,WACN,KAAM,SACR,CACF,EACA,KAAM,oCACN,KAAM,OACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,WACN,KAAM,SACR,EACA,CACE,aAAc,UACd,KAAM,WACN,KAAM,SACR,CACF,EACA,KAAM,kCACN,KAAM,OACR,EACA,CACE,OAAQ,CAAC,EACT,KAAM,4BACN,KAAM,OACR,EACA,CACE,OAAQ,CAAC,EACT,KAAM,2BACN,KAAM,OACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,UACN,KAAM,SACR,EACA,CACE,aAAc,SACd,KAAM,gBACN,KAAM,QACR,CACF,EACA,KAAM,+BACN,KAAM,OACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,UACN,KAAM,SACR,EACA,CACE,aAAc,SACd,KAAM,gBACN,KAAM,QACR,CACF,EACA,KAAM,0BACN,KAAM,OACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,SACN,KAAM,SACR,CACF,EACA,KAAM,eACN,KAAM,OACR,EACA,CACE,UAAW,GACX,OAAQ,CAAC,EACT,KAAM,aACN,KAAM,OACR,EACA,CACE,UAAW,GACX,OAAQ,CACN,CACE,QAAS,GACT,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,QAAS,GACT,aAAc,YACd,KAAM,MACN,KAAM,WACR,CACF,EACA,KAAM,oBACN,KAAM,OACR,EACA,CACE,UAAW,GACX,OAAQ,CACN,CACE,QAAS,GACT,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,QAAS,GACT,aAAc,YACd,KAAM,MACN,KAAM,WACR,EACA,CACE,QAAS,GACT,aAAc,QACd,KAAM,OACN,KAAM,OACR,CACF,EACA,KAAM,uBACN,KAAM,OACR,EACA,CACE,UAAW,GACX,OAAQ,CACN,CACE,QAAS,GACT,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,QAAS,GACT,aAAc,YACd,KAAM,MACN,KAAM,WACR,EACA,CACE,QAAS,GACT,aAAc,QACd,KAAM,cACN,KAAM,OACR,EACA,CACE,QAAS,GACT,aAAc,QACd,KAAM,OACN,KAAM,OACR,CACF,EACA,KAAM,gBACN,KAAM,OACR,EACA,CACE,UAAW,GACX,OAAQ,CACN,CACE,QAAS,GACT,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,QAAS,GACT,aAAc,YACd,KAAM,MACN,KAAM,WACR,EACA,CACE,QAAS,GACT,aAAc,QACd,KAAM,OACN,KAAM,OACR,CACF,EACA,KAAM,iBACN,KAAM,OACR,EACA,CACE,OAAQ,CAAC,EACT,KAAM,cACN,QAAS,CACP,CACE,aAAc,OACd,KAAM,GACN,KAAM,MACR,CACF,EACA,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CAAC,EACT,KAAM,WACN,QAAS,CACP,CACE,aAAc,SACd,KAAM,GACN,KAAM,QACR,CACF,EACA,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,mBACN,KAAM,SACR,EACA,CACE,aAAc,QACd,KAAM,sBACN,KAAM,OACR,CACF,EACA,KAAM,OACN,QAAS,CACP,CACE,aAAc,QACd,KAAM,GACN,KAAM,OACR,CACF,EACA,gBAAiB,UACjB,KAAM,UACR,EACA,CACE,OAAQ,CAAC,EACT,KAAM,YACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,SACd,KAAM,MACN,KAAM,QACR,EACA,CACE,aAAc,UACd,KAAM,MACN,KAAM,SACR,CACF,EACA,KAAM,cACN,QAAS,CACP,CACE,aAAc,SACd,KAAM,GACN,KAAM,QACR,CACF,EACA,gBAAiB,OACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,aAAc,YACd,KAAM,MACN,KAAM,WACR,EACA,CACE,aAAc,SACd,KAAM,cACN,KAAM,SACR,CACF,EACA,KAAM,eACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,aAAc,YACd,KAAM,MACN,KAAM,WACR,EACA,CACE,aAAc,QACd,KAAM,OACN,KAAM,OACR,EACA,CACE,aAAc,SACd,KAAM,cACN,KAAM,SACR,CACF,EACA,KAAM,sBACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CAAC,EACT,KAAM,cACN,QAAS,CACP,CACE,aAAc,SACd,KAAM,GACN,KAAM,QACR,CACF,EACA,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CAAC,EACT,KAAM,aACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,aAAc,YACd,KAAM,MACN,KAAM,WACR,EACA,CACE,aAAc,QACd,KAAM,cACN,KAAM,OACR,EACA,CACE,aAAc,SACd,KAAM,cACN,KAAM,SACR,CACF,EACA,KAAM,WACN,QAAS,CACP,CACE,aAAc,QACd,KAAM,OACN,KAAM,OACR,CACF,EACA,gBAAiB,OACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,aAAc,YACd,KAAM,MACN,KAAM,WACR,EACA,CACE,aAAc,QACd,KAAM,cACN,KAAM,OACR,EACA,CACE,aAAc,SACd,KAAM,cACN,KAAM,SACR,CACF,EACA,KAAM,iBACN,QAAS,CACP,CACE,aAAc,UACd,KAAM,GACN,KAAM,SACR,CACF,EACA,gBAAiB,OACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,aAAc,YACd,KAAM,MACN,KAAM,WACR,EACA,CACE,aAAc,QACd,KAAM,cACN,KAAM,OACR,EACA,CACE,aAAc,SACd,KAAM,cACN,KAAM,SACR,EACA,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,aAAc,UACd,KAAM,MACN,KAAM,SACR,CACF,EACA,KAAM,gBACN,QAAS,CACP,CACE,aAAc,QACd,KAAM,OACN,KAAM,OACR,CACF,EACA,gBAAiB,OACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,CACF,EACA,KAAM,eACN,QAAS,CACP,CACE,aAAc,SACd,KAAM,SACN,KAAM,SACR,CACF,EACA,gBAAiB,OACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,aAAc,YACd,KAAM,MACN,KAAM,WACR,EACA,CACE,aAAc,SACd,KAAM,cACN,KAAM,SACR,CACF,EACA,KAAM,YACN,QAAS,CACP,CACE,aAAc,QACd,KAAM,OACN,KAAM,OACR,CACF,EACA,gBAAiB,OACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,CACF,EACA,KAAM,iBACN,QAAS,CACP,CACE,aAAc,SACd,KAAM,SACN,KAAM,SACR,CACF,EACA,gBAAiB,OACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,mBACN,KAAM,SACR,EACA,CACE,aAAc,UACd,KAAM,UACN,KAAM,SACR,CACF,EACA,KAAM,cACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CAAC,EACT,KAAM,YACN,QAAS,CACP,CACE,aAAc,SACd,KAAM,GACN,KAAM,QACR,CACF,EACA,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,mBACd,KAAM,SACN,KAAM,SACR,EACA,CACE,aAAc,QACd,KAAM,OACN,KAAM,OACR,CACF,EACA,KAAM,gBACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,mBACd,KAAM,SACN,KAAM,SACR,EACA,CACE,aAAc,QACd,KAAM,OACN,KAAM,OACR,CACF,EACA,KAAM,oBACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CAAC,EACT,KAAM,WACN,QAAS,CACP,CACE,aAAc,SACd,KAAM,GACN,KAAM,QACR,CACF,EACA,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,UACN,KAAM,SACR,EACA,CACE,aAAc,UACd,KAAM,UACN,KAAM,SACR,CACF,EACA,KAAM,OACN,QAAS,CACP,CACE,aAAc,OACd,KAAM,GACN,KAAM,MACR,CACF,EACA,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CAAC,EACT,KAAM,MACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,QACd,KAAM,YACN,KAAM,OACR,CACF,EACA,KAAM,YACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CAAC,EACT,KAAM,WACN,QAAS,CACP,CACE,aAAc,SACd,KAAM,GACN,KAAM,QACR,CACF,EACA,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,QACd,KAAM,SACN,KAAM,OACR,CACF,EACA,KAAM,WACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,aAAc,YACd,KAAM,MACN,KAAM,WACR,EACA,CACE,aAAc,QACd,KAAM,cACN,KAAM,OACR,EACA,CACE,aAAc,UACd,KAAM,kBACN,KAAM,SACR,EACA,CACE,aAAc,SACd,KAAM,cACN,KAAM,SACR,CACF,EACA,KAAM,eACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,aAAc,YACd,KAAM,MACN,KAAM,WACR,EACA,CACE,aAAc,QACd,KAAM,cACN,KAAM,OACR,EACA,CACE,aAAc,QACd,KAAM,aACN,KAAM,OACR,EACA,CACE,aAAc,SACd,KAAM,cACN,KAAM,SACR,CACF,EACA,KAAM,cACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,mBACN,KAAM,SACR,EACA,CACE,aAAc,SACd,KAAM,qBACN,KAAM,QACR,EACA,CACE,aAAc,SACd,KAAM,0BACN,KAAM,QACR,CACF,EACA,KAAM,2BACN,QAAS,CACP,CACE,aAAc,SACd,KAAM,wBACN,KAAM,QACR,CACF,EACA,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,YACN,KAAM,SACR,CACF,EACA,KAAM,oBACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,mBACN,KAAM,SACR,EACA,CACE,aAAc,SACd,KAAM,wBACN,KAAM,QACR,EACA,CACE,aAAc,SACd,KAAM,yBACN,KAAM,QACR,CACF,EACA,KAAM,+BACN,QAAS,CACP,CACE,aAAc,SACd,KAAM,GACN,KAAM,QACR,CACF,EACA,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,aAAc,sBACd,KAAM,OACN,KAAM,SACR,CACF,EACA,KAAM,oBACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,mBACN,KAAM,SACR,EACA,CACE,aAAc,kBACd,KAAM,SACN,KAAM,SACR,EACA,CACE,aAAc,OACd,KAAM,eACN,KAAM,MACR,CACF,EACA,KAAM,iBACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,mBACN,KAAM,SACR,EACA,CACE,aAAc,uBACd,KAAM,OACN,KAAM,SACR,CACF,EACA,KAAM,qBACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,aAAc,SACd,KAAM,YACN,KAAM,SACR,EACA,CACE,aAAc,SACd,KAAM,cACN,KAAM,SACR,EACA,CACE,aAAc,WACd,KAAM,WACN,KAAM,UACR,EACA,CACE,aAAc,WACd,KAAM,aACN,KAAM,UACR,CACF,EACA,KAAM,gBACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CAAC,EACT,KAAM,cACN,QAAS,CACP,CACE,aAAc,OACd,KAAM,GACN,KAAM,MACR,CACF,EACA,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CAAC,EACT,KAAM,cACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,mBACN,KAAM,SACR,EACA,CACE,aAAc,UACd,KAAM,UACN,KAAM,SACR,CACF,EACA,KAAM,eACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,aAAc,YACd,KAAM,MACN,KAAM,WACR,EACA,CACE,aAAc,QACd,KAAM,cACN,KAAM,OACR,EACA,CACE,aAAc,QACd,KAAM,OACN,KAAM,OACR,EACA,CACE,aAAc,SACd,KAAM,cACN,KAAM,SACR,CACF,EACA,KAAM,WACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,QACN,KAAM,SACR,EACA,CACE,aAAc,YACd,KAAM,MACN,KAAM,WACR,EACA,CACE,aAAc,QACd,KAAM,OACN,KAAM,OACR,EACA,CACE,aAAc,SACd,KAAM,cACN,KAAM,SACR,CACF,EACA,KAAM,YACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,OAAQ,CACN,CACE,aAAc,UACd,KAAM,eACN,KAAM,SACR,EACA,CACE,aAAc,QACd,KAAM,YACN,KAAM,OACR,EACA,CACE,aAAc,SACd,KAAM,QACN,KAAM,QACR,CACF,EACA,KAAM,QACN,QAAS,CAAC,EACV,gBAAiB,aACjB,KAAM,UACR,EACA,CACE,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M30E,GAAGA,GAAI,OAAOqiB,CAAK,CAAC,EAC9CwyD,GAAa,KAAK/b,EAAG,EAGlB,OAAA+b,EACX","x_google_ignoreList":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443]} \ No newline at end of file diff --git a/packages/client/dist/assets/index-a13e0f4b.js b/packages/client/dist/assets/index-c7ee7ff5.js similarity index 99% rename from packages/client/dist/assets/index-a13e0f4b.js rename to packages/client/dist/assets/index-c7ee7ff5.js index b9ab461..eb4ed87 100644 --- a/packages/client/dist/assets/index-a13e0f4b.js +++ b/packages/client/dist/assets/index-c7ee7ff5.js @@ -1,4 +1,4 @@ -import{u as Py,P as jy,y as Ey,c as My,D as ah,W as Ny,o as zy,t as Cy,V as Ty,F as ih}from"./index-7b9cb951.js";var Iy=Object.create,nd=Object.defineProperty,Ay=Object.getOwnPropertyDescriptor,Ly=Object.getOwnPropertyNames,Fy=Object.getPrototypeOf,Uy=Object.prototype.hasOwnProperty,Z=(e,o)=>()=>(e&&(o=e(e=0)),o),P=(e,o)=>()=>(o||e((o={exports:{}}).exports,o),o.exports),lh=(e,o)=>{for(var a in o)nd(e,a,{get:o[a],enumerable:!0})},Ry=(e,o,a,l)=>{if(o&&typeof o=="object"||typeof o=="function")for(let d of Ly(o))!Uy.call(e,d)&&d!==a&&nd(e,d,{get:()=>o[d],enumerable:!(l=Ay(o,d))||l.enumerable});return e},ke=(e,o,a)=>(a=e!=null?Iy(Fy(e)):{},Ry(o||!e||!e.__esModule?nd(a,"default",{value:e,enumerable:!0}):a,e)),Dy=P(e=>{var o=Symbol.for("react.element"),a=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),m=Symbol.iterator;function g(j){return j===null||typeof j!="object"?null:(j=m&&j[m]||j["@@iterator"],typeof j=="function"?j:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,k={};function O(j,W,Se){this.props=j,this.context=W,this.refs=k,this.updater=Se||w}O.prototype.isReactComponent={},O.prototype.setState=function(j,W){if(typeof j!="object"&&typeof j!="function"&&j!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,j,W,"setState")},O.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function z(){}z.prototype=O.prototype;function M(j,W,Se){this.props=j,this.context=W,this.refs=k,this.updater=Se||w}var N=M.prototype=new z;N.constructor=M,S(N,O.prototype),N.isPureReactComponent=!0;var A=Array.isArray,B=Object.prototype.hasOwnProperty,V={current:null},D={key:!0,ref:!0,__self:!0,__source:!0};function R(j,W,Se){var je,_e={},ze=null,Ae=null;if(W!=null)for(je in W.ref!==void 0&&(Ae=W.ref),W.key!==void 0&&(ze=""+W.key),W)B.call(W,je)&&!D.hasOwnProperty(je)&&(_e[je]=W[je]);var Be=arguments.length-2;if(Be===1)_e.children=Se;else if(1{o.exports=Dy()}),By=P(e=>{var o=sr(),a=Symbol.for("react.element"),l=Symbol.for("react.fragment"),d=Object.prototype.hasOwnProperty,s=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function u(f,p,v){var b,m={},g=null,w=null;v!==void 0&&(g=""+v),p.key!==void 0&&(g=""+p.key),p.ref!==void 0&&(w=p.ref);for(b in p)d.call(p,b)&&!i.hasOwnProperty(b)&&(m[b]=p[b]);if(f&&f.defaultProps)for(b in p=f.defaultProps,p)m[b]===void 0&&(m[b]=p[b]);return{$$typeof:a,type:f,key:g,ref:w,props:m,_owner:s.current}}e.Fragment=l,e.jsx=u,e.jsxs=u}),Ye=P((e,o)=>{o.exports=By()}),$y=P(e=>{function o(H,ce){var ve=H.length;H.push(ce);e:for(;0>>1,W=H[j];if(0>>1;jd(_e,ve))zed(Ae,_e)?(H[j]=Ae,H[ze]=ve,j=ze):(H[j]=_e,H[je]=ve,j=je);else if(zed(Ae,ve))H[j]=Ae,H[ze]=ve,j=ze;else break e}}return ce}function d(H,ce){var ve=H.sortIndex-ce.sortIndex;return ve!==0?ve:H.id-ce.id}typeof performance=="object"&&typeof performance.now=="function"?(s=performance,e.unstable_now=function(){return s.now()}):(i=Date,u=i.now(),e.unstable_now=function(){return i.now()-u});var s,i,u,f=[],p=[],v=1,b=null,m=3,g=!1,w=!1,S=!1,k=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,z=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(H){for(var ce=a(p);ce!==null;){if(ce.callback===null)l(p);else if(ce.startTime<=H)l(p),ce.sortIndex=ce.expirationTime,o(f,ce);else break;ce=a(p)}}function N(H){if(S=!1,M(H),!w)if(a(f)!==null)w=!0,be(A);else{var ce=a(p);ce!==null&&ue(N,ce.startTime-H)}}function A(H,ce){w=!1,S&&(S=!1,O(D),D=-1),g=!0;var ve=m;try{for(M(ce),b=a(f);b!==null&&(!(b.expirationTime>ce)||H&&!ee());){var j=b.callback;if(typeof j=="function"){b.callback=null,m=b.priorityLevel;var W=j(b.expirationTime<=ce);ce=e.unstable_now(),typeof W=="function"?b.callback=W:b===a(f)&&l(f),M(ce)}else l(f);b=a(f)}if(b!==null)var Se=!0;else{var je=a(p);je!==null&&ue(N,je.startTime-ce),Se=!1}return Se}finally{b=null,m=ve,g=!1}}var B=!1,V=null,D=-1,R=5,$=-1;function ee(){return!(e.unstable_now()-$H||125j?(H.sortIndex=ve,o(p,H),a(f)===null&&H===a(p)&&(S?(O(D),D=-1):S=!0,ue(N,ve-j))):(H.sortIndex=W,o(f,H),w||g||(w=!0,be(A))),H},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(H){var ce=m;return function(){var ve=m;m=ce;try{return H.apply(this,arguments)}finally{m=ve}}}}),Vy=P((e,o)=>{o.exports=$y()}),Wy=P(e=>{var o=sr(),a=Vy();function l(r){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+r,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),p=Object.prototype.hasOwnProperty,v=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,b={},m={};function g(r){return p.call(m,r)?!0:p.call(b,r)?!1:v.test(r)?m[r]=!0:(b[r]=!0,!1)}function w(r,t,n,c){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return c?!1:n!==null?!n.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function S(r,t,n,c){if(t===null||typeof t>"u"||w(r,t,n,c))return!0;if(c)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function k(r,t,n,c,h,y,x){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=c,this.attributeNamespace=h,this.mustUseProperty=n,this.propertyName=r,this.type=t,this.sanitizeURL=y,this.removeEmptyString=x}var O={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){O[r]=new k(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var t=r[0];O[t]=new k(t,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){O[r]=new k(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){O[r]=new k(r,2,!1,r,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(r){O[r]=new k(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){O[r]=new k(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){O[r]=new k(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){O[r]=new k(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){O[r]=new k(r,5,!1,r.toLowerCase(),null,!1,!1)});var z=/[\-:]([a-z])/g;function M(r){return r[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(r){var t=r.replace(z,M);O[t]=new k(t,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var t=r.replace(z,M);O[t]=new k(t,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var t=r.replace(z,M);O[t]=new k(t,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){O[r]=new k(r,1,!1,r.toLowerCase(),null,!1,!1)}),O.xlinkHref=new k("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){O[r]=new k(r,1,!1,r.toLowerCase(),null,!0,!0)});function N(r,t,n,c){var h=O.hasOwnProperty(t)?O[t]:null;(h!==null?h.type!==0:c||!(2()=>(e&&(o=e(e=0)),o),P=(e,o)=>()=>(o||e((o={exports:{}}).exports,o),o.exports),lh=(e,o)=>{for(var a in o)nd(e,a,{get:o[a],enumerable:!0})},Ry=(e,o,a,l)=>{if(o&&typeof o=="object"||typeof o=="function")for(let d of Ly(o))!Uy.call(e,d)&&d!==a&&nd(e,d,{get:()=>o[d],enumerable:!(l=Ay(o,d))||l.enumerable});return e},ke=(e,o,a)=>(a=e!=null?Iy(Fy(e)):{},Ry(o||!e||!e.__esModule?nd(a,"default",{value:e,enumerable:!0}):a,e)),Dy=P(e=>{var o=Symbol.for("react.element"),a=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),m=Symbol.iterator;function g(j){return j===null||typeof j!="object"?null:(j=m&&j[m]||j["@@iterator"],typeof j=="function"?j:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,k={};function O(j,W,Se){this.props=j,this.context=W,this.refs=k,this.updater=Se||w}O.prototype.isReactComponent={},O.prototype.setState=function(j,W){if(typeof j!="object"&&typeof j!="function"&&j!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,j,W,"setState")},O.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function z(){}z.prototype=O.prototype;function M(j,W,Se){this.props=j,this.context=W,this.refs=k,this.updater=Se||w}var N=M.prototype=new z;N.constructor=M,S(N,O.prototype),N.isPureReactComponent=!0;var A=Array.isArray,B=Object.prototype.hasOwnProperty,V={current:null},D={key:!0,ref:!0,__self:!0,__source:!0};function R(j,W,Se){var je,_e={},ze=null,Ae=null;if(W!=null)for(je in W.ref!==void 0&&(Ae=W.ref),W.key!==void 0&&(ze=""+W.key),W)B.call(W,je)&&!D.hasOwnProperty(je)&&(_e[je]=W[je]);var Be=arguments.length-2;if(Be===1)_e.children=Se;else if(1{o.exports=Dy()}),By=P(e=>{var o=sr(),a=Symbol.for("react.element"),l=Symbol.for("react.fragment"),d=Object.prototype.hasOwnProperty,s=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function u(f,p,v){var b,m={},g=null,w=null;v!==void 0&&(g=""+v),p.key!==void 0&&(g=""+p.key),p.ref!==void 0&&(w=p.ref);for(b in p)d.call(p,b)&&!i.hasOwnProperty(b)&&(m[b]=p[b]);if(f&&f.defaultProps)for(b in p=f.defaultProps,p)m[b]===void 0&&(m[b]=p[b]);return{$$typeof:a,type:f,key:g,ref:w,props:m,_owner:s.current}}e.Fragment=l,e.jsx=u,e.jsxs=u}),Ye=P((e,o)=>{o.exports=By()}),$y=P(e=>{function o(H,ce){var ve=H.length;H.push(ce);e:for(;0>>1,W=H[j];if(0>>1;jd(_e,ve))zed(Ae,_e)?(H[j]=Ae,H[ze]=ve,j=ze):(H[j]=_e,H[je]=ve,j=je);else if(zed(Ae,ve))H[j]=Ae,H[ze]=ve,j=ze;else break e}}return ce}function d(H,ce){var ve=H.sortIndex-ce.sortIndex;return ve!==0?ve:H.id-ce.id}typeof performance=="object"&&typeof performance.now=="function"?(s=performance,e.unstable_now=function(){return s.now()}):(i=Date,u=i.now(),e.unstable_now=function(){return i.now()-u});var s,i,u,f=[],p=[],v=1,b=null,m=3,g=!1,w=!1,S=!1,k=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,z=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function M(H){for(var ce=a(p);ce!==null;){if(ce.callback===null)l(p);else if(ce.startTime<=H)l(p),ce.sortIndex=ce.expirationTime,o(f,ce);else break;ce=a(p)}}function N(H){if(S=!1,M(H),!w)if(a(f)!==null)w=!0,be(A);else{var ce=a(p);ce!==null&&ue(N,ce.startTime-H)}}function A(H,ce){w=!1,S&&(S=!1,O(D),D=-1),g=!0;var ve=m;try{for(M(ce),b=a(f);b!==null&&(!(b.expirationTime>ce)||H&&!ee());){var j=b.callback;if(typeof j=="function"){b.callback=null,m=b.priorityLevel;var W=j(b.expirationTime<=ce);ce=e.unstable_now(),typeof W=="function"?b.callback=W:b===a(f)&&l(f),M(ce)}else l(f);b=a(f)}if(b!==null)var Se=!0;else{var je=a(p);je!==null&&ue(N,je.startTime-ce),Se=!1}return Se}finally{b=null,m=ve,g=!1}}var B=!1,V=null,D=-1,R=5,$=-1;function ee(){return!(e.unstable_now()-$H||125j?(H.sortIndex=ve,o(p,H),a(f)===null&&H===a(p)&&(S?(O(D),D=-1):S=!0,ue(N,ve-j))):(H.sortIndex=W,o(f,H),w||g||(w=!0,be(A))),H},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(H){var ce=m;return function(){var ve=m;m=ce;try{return H.apply(this,arguments)}finally{m=ve}}}}),Vy=P((e,o)=>{o.exports=$y()}),Wy=P(e=>{var o=sr(),a=Vy();function l(r){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+r,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),p=Object.prototype.hasOwnProperty,v=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,b={},m={};function g(r){return p.call(m,r)?!0:p.call(b,r)?!1:v.test(r)?m[r]=!0:(b[r]=!0,!1)}function w(r,t,n,c){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return c?!1:n!==null?!n.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function S(r,t,n,c){if(t===null||typeof t>"u"||w(r,t,n,c))return!0;if(c)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function k(r,t,n,c,h,y,x){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=c,this.attributeNamespace=h,this.mustUseProperty=n,this.propertyName=r,this.type=t,this.sanitizeURL=y,this.removeEmptyString=x}var O={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){O[r]=new k(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var t=r[0];O[t]=new k(t,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){O[r]=new k(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){O[r]=new k(r,2,!1,r,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(r){O[r]=new k(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){O[r]=new k(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){O[r]=new k(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){O[r]=new k(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){O[r]=new k(r,5,!1,r.toLowerCase(),null,!1,!1)});var z=/[\-:]([a-z])/g;function M(r){return r[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(r){var t=r.replace(z,M);O[t]=new k(t,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var t=r.replace(z,M);O[t]=new k(t,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var t=r.replace(z,M);O[t]=new k(t,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){O[r]=new k(r,1,!1,r.toLowerCase(),null,!1,!1)}),O.xlinkHref=new k("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){O[r]=new k(r,1,!1,r.toLowerCase(),null,!0,!0)});function N(r,t,n,c){var h=O.hasOwnProperty(t)?O[t]:null;(h!==null?h.type!==0:c||!(2_||h[x]!==y[_]){var E=` @@ -175,4 +175,4 @@ react-router-dom/dist/index.js: @noble/hashes/esm/utils.js: (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) */export{_k as mount}; -//# sourceMappingURL=index-a13e0f4b.js.map +//# sourceMappingURL=index-c7ee7ff5.js.map diff --git a/packages/client/dist/assets/index-a13e0f4b.js.map b/packages/client/dist/assets/index-c7ee7ff5.js.map similarity index 99% rename from packages/client/dist/assets/index-a13e0f4b.js.map rename to packages/client/dist/assets/index-c7ee7ff5.js.map index 817eae8..bbbf8e0 100644 --- a/packages/client/dist/assets/index-a13e0f4b.js.map +++ b/packages/client/dist/assets/index-c7ee7ff5.js.map @@ -1 +1 @@ -{"version":3,"file":"index-a13e0f4b.js","sources":["../../../../node_modules/.pnpm/@latticexyz+dev-tools@2.0.0-next.3_@latticexyz+common@2.0.0-next.3_@latticexyz+recs@2.0.0-nex_zujj3pk4g6ejimorxdlq3nkxk4/node_modules/@latticexyz/dev-tools/dist/index.js"],"sourcesContent":["var JG=Object.create;var mR=Object.defineProperty;var ZG=Object.getOwnPropertyDescriptor;var eQ=Object.getOwnPropertyNames;var tQ=Object.getPrototypeOf,rQ=Object.prototype.hasOwnProperty;var se=(e,t)=>()=>(e&&(t=e(e=0)),t);var M=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),mL=(e,t)=>{for(var n in t)mR(e,n,{get:t[n],enumerable:!0})},nQ=(e,t,n,i)=>{if(t&&typeof t==\"object\"||typeof t==\"function\")for(let o of eQ(t))!rQ.call(e,o)&&o!==n&&mR(e,o,{get:()=>t[o],enumerable:!(i=ZG(t,o))||i.enumerable});return e};var be=(e,t,n)=>(n=e!=null?JG(tQ(e)):{},nQ(t||!e||!e.__esModule?mR(n,\"default\",{value:e,enumerable:!0}):n,e));var OL=M(st=>{\"use strict\";var $v=Symbol.for(\"react.element\"),aQ=Symbol.for(\"react.portal\"),iQ=Symbol.for(\"react.fragment\"),oQ=Symbol.for(\"react.strict_mode\"),uQ=Symbol.for(\"react.profiler\"),lQ=Symbol.for(\"react.provider\"),sQ=Symbol.for(\"react.context\"),cQ=Symbol.for(\"react.forward_ref\"),fQ=Symbol.for(\"react.suspense\"),dQ=Symbol.for(\"react.memo\"),pQ=Symbol.for(\"react.lazy\"),yL=Symbol.iterator;function vQ(e){return e===null||typeof e!=\"object\"?null:(e=yL&&e[yL]||e[\"@@iterator\"],typeof e==\"function\"?e:null)}var SL={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_L=Object.assign,wL={};function Rf(e,t,n){this.props=e,this.context=t,this.refs=wL,this.updater=n||SL}Rf.prototype.isReactComponent={};Rf.prototype.setState=function(e,t){if(typeof e!=\"object\"&&typeof e!=\"function\"&&e!=null)throw Error(\"setState(...): takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,e,t,\"setState\")};Rf.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,\"forceUpdate\")};function xL(){}xL.prototype=Rf.prototype;function gR(e,t,n){this.props=e,this.context=t,this.refs=wL,this.updater=n||SL}var bR=gR.prototype=new xL;bR.constructor=gR;_L(bR,Rf.prototype);bR.isPureReactComponent=!0;var gL=Array.isArray,EL=Object.prototype.hasOwnProperty,SR={current:null},CL={key:!0,ref:!0,__self:!0,__source:!0};function RL(e,t,n){var i,o={},l=null,c=null;if(t!=null)for(i in t.ref!==void 0&&(c=t.ref),t.key!==void 0&&(l=\"\"+t.key),t)EL.call(t,i)&&!CL.hasOwnProperty(i)&&(o[i]=t[i]);var p=arguments.length-2;if(p===1)o.children=n;else if(1{\"use strict\";process.env.NODE_ENV!==\"production\"&&function(){\"use strict\";typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<\"u\"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==\"function\"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=\"18.2.0\",t=Symbol.for(\"react.element\"),n=Symbol.for(\"react.portal\"),i=Symbol.for(\"react.fragment\"),o=Symbol.for(\"react.strict_mode\"),l=Symbol.for(\"react.profiler\"),c=Symbol.for(\"react.provider\"),p=Symbol.for(\"react.context\"),v=Symbol.for(\"react.forward_ref\"),m=Symbol.for(\"react.suspense\"),S=Symbol.for(\"react.suspense_list\"),w=Symbol.for(\"react.memo\"),C=Symbol.for(\"react.lazy\"),T=Symbol.for(\"react.offscreen\"),k=Symbol.iterator,N=\"@@iterator\";function I(b){if(b===null||typeof b!=\"object\")return null;var D=k&&b[k]||b[N];return typeof D==\"function\"?D:null}var _={current:null},R={transition:null},A={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},F={current:null},G={},te=null;function re(b){te=b}G.setExtraStackFrame=function(b){te=b},G.getCurrentStack=null,G.getStackAddendum=function(){var b=\"\";te&&(b+=te);var D=G.getCurrentStack;return D&&(b+=D()||\"\"),b};var Se=!1,we=!1,De=!1,dt=!1,rt=!1,Pe={ReactCurrentDispatcher:_,ReactCurrentBatchConfig:R,ReactCurrentOwner:F};Pe.ReactDebugCurrentFrame=G,Pe.ReactCurrentActQueue=A;function ot(b){{for(var D=arguments.length,V=new Array(D>1?D-1:0),K=1;K1?D-1:0),K=1;K1){for(var Pt=Array(xt),Dt=0;Dt1){for(var Ft=Array(Dt),ir=0;ir is not supported and will be removed in a future major release. Did you mean to render instead?\")),D.Provider},set:function(Ce){D.Provider=Ce}},_currentValue:{get:function(){return D._currentValue},set:function(Ce){D._currentValue=Ce}},_currentValue2:{get:function(){return D._currentValue2},set:function(Ce){D._currentValue2=Ce}},_threadCount:{get:function(){return D._threadCount},set:function(Ce){D._threadCount=Ce}},Consumer:{get:function(){return V||(V=!0,Re(\"Rendering is not supported and will be removed in a future major release. Did you mean to render instead?\")),D.Consumer}},displayName:{get:function(){return D.displayName},set:function(Ce){oe||(ot(\"Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.\",Ce),oe=!0)}}}),D.Consumer=Ue}return D._currentRenderer=null,D._currentRenderer2=null,D}var Cr=-1,ua=0,no=1,ao=2;function Ga(b){if(b._status===Cr){var D=b._result,V=D();if(V.then(function(Ue){if(b._status===ua||b._status===Cr){var Ce=b;Ce._status=no,Ce._result=Ue}},function(Ue){if(b._status===ua||b._status===Cr){var Ce=b;Ce._status=ao,Ce._result=Ue}}),b._status===Cr){var K=b;K._status=ua,K._result=V}}if(b._status===no){var oe=b._result;return oe===void 0&&Re(`lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?`,oe),\"default\"in oe||Re(`lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))`,oe),oe.default}else throw b._result}function Vn(b){var D={_status:Cr,_result:b},V={$$typeof:C,_payload:D,_init:Ga};{var K,oe;Object.defineProperties(V,{defaultProps:{configurable:!0,get:function(){return K},set:function(Ue){Re(\"React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it.\"),K=Ue,Object.defineProperty(V,\"defaultProps\",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return oe},set:function(Ue){Re(\"React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it.\"),oe=Ue,Object.defineProperty(V,\"propTypes\",{enumerable:!0})}}})}return V}function vt(b){b!=null&&b.$$typeof===w?Re(\"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).\"):typeof b!=\"function\"?Re(\"forwardRef requires a render function but was given %s.\",b===null?\"null\":typeof b):b.length!==0&&b.length!==2&&Re(\"forwardRef render functions accept exactly two parameters: props and ref. %s\",b.length===1?\"Did you forget to use the ref parameter?\":\"Any additional parameter will be undefined.\"),b!=null&&(b.defaultProps!=null||b.propTypes!=null)&&Re(\"forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?\");var D={$$typeof:v,render:b};{var V;Object.defineProperty(D,\"displayName\",{enumerable:!1,configurable:!0,get:function(){return V},set:function(K){V=K,!b.name&&!b.displayName&&(b.displayName=K)}})}return D}var Zt;Zt=Symbol.for(\"react.module.reference\");function $n(b){return!!(typeof b==\"string\"||typeof b==\"function\"||b===i||b===l||rt||b===o||b===m||b===S||dt||b===T||Se||we||De||typeof b==\"object\"&&b!==null&&(b.$$typeof===C||b.$$typeof===w||b.$$typeof===c||b.$$typeof===p||b.$$typeof===v||b.$$typeof===Zt||b.getModuleId!==void 0))}function P(b,D){$n(b)||Re(\"memo: The first argument must be a component. Instead received: %s\",b===null?\"null\":typeof b);var V={$$typeof:w,type:b,compare:D===void 0?null:D};{var K;Object.defineProperty(V,\"displayName\",{enumerable:!1,configurable:!0,get:function(){return K},set:function(oe){K=oe,!b.name&&!b.displayName&&(b.displayName=oe)}})}return V}function Q(){var b=_.current;return b===null&&Re(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`),b}function le(b){var D=Q();if(b._context!==void 0){var V=b._context;V.Consumer===b?Re(\"Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?\"):V.Provider===b&&Re(\"Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?\")}return D.useContext(b)}function Ne(b){var D=Q();return D.useState(b)}function Ze(b,D,V){var K=Q();return K.useReducer(b,D,V)}function mt(b){var D=Q();return D.useRef(b)}function Xe(b,D){var V=Q();return V.useEffect(b,D)}function Le(b,D){var V=Q();return V.useInsertionEffect(b,D)}function Nr(b,D){var V=Q();return V.useLayoutEffect(b,D)}function $t(b,D){var V=Q();return V.useCallback(b,D)}function Wt(b,D){var V=Q();return V.useMemo(b,D)}function kn(b,D,V){var K=Q();return K.useImperativeHandle(b,D,V)}function io(b,D){{var V=Q();return V.useDebugValue(b,D)}}function wc(){var b=Q();return b.useTransition()}function la(b){var D=Q();return D.useDeferredValue(b)}function ux(){var b=Q();return b.useId()}function Lo(b,D,V){var K=Q();return K.useSyncExternalStore(b,D,V)}var Je=0,ku,ap,ip,op,up,lp,sp;function cp(){}cp.__reactDisabledLog=!0;function Dm(){{if(Je===0){ku=console.log,ap=console.info,ip=console.warn,op=console.error,up=console.group,lp=console.groupCollapsed,sp=console.groupEnd;var b={configurable:!0,enumerable:!0,value:cp,writable:!0};Object.defineProperties(console,{info:b,log:b,warn:b,error:b,group:b,groupCollapsed:b,groupEnd:b})}Je++}}function lx(){{if(Je--,Je===0){var b={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Xt({},b,{value:ku}),info:Xt({},b,{value:ap}),warn:Xt({},b,{value:ip}),error:Xt({},b,{value:op}),group:Xt({},b,{value:up}),groupCollapsed:Xt({},b,{value:lp}),groupEnd:Xt({},b,{value:sp})})}Je<0&&Re(\"disabledDepth fell below zero. This is a bug in React. Please file an issue.\")}}var fp=Pe.ReactCurrentDispatcher,us;function Au(b,D,V){{if(us===void 0)try{throw Error()}catch(oe){var K=oe.stack.trim().match(/\\n( *(at )?)/);us=K&&K[1]||\"\"}return`\n`+us+b}}var Qa=!1,Mu;{var xc=typeof WeakMap==\"function\"?WeakMap:Map;Mu=new xc}function Nm(b,D){if(!b||Qa)return\"\";{var V=Mu.get(b);if(V!==void 0)return V}var K;Qa=!0;var oe=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Ue;Ue=fp.current,fp.current=null,Dm();try{if(D){var Ce=function(){throw Error()};if(Object.defineProperty(Ce.prototype,\"props\",{set:function(){throw Error()}}),typeof Reflect==\"object\"&&Reflect.construct){try{Reflect.construct(Ce,[])}catch(jr){K=jr}Reflect.construct(b,[],Ce)}else{try{Ce.call()}catch(jr){K=jr}b.call(Ce.prototype)}}else{try{throw Error()}catch(jr){K=jr}b()}}catch(jr){if(jr&&K&&typeof jr.stack==\"string\"){for(var $e=jr.stack.split(`\n`),ut=K.stack.split(`\n`),xt=$e.length-1,Pt=ut.length-1;xt>=1&&Pt>=0&&$e[xt]!==ut[Pt];)Pt--;for(;xt>=1&&Pt>=0;xt--,Pt--)if($e[xt]!==ut[Pt]){if(xt!==1||Pt!==1)do if(xt--,Pt--,Pt<0||$e[xt]!==ut[Pt]){var Dt=`\n`+$e[xt].replace(\" at new \",\" at \");return b.displayName&&Dt.includes(\"\")&&(Dt=Dt.replace(\"\",b.displayName)),typeof b==\"function\"&&Mu.set(b,Dt),Dt}while(xt>=1&&Pt>=0);break}}}finally{Qa=!1,fp.current=Ue,lx(),Error.prepareStackTrace=oe}var Ft=b?b.displayName||b.name:\"\",ir=Ft?Au(Ft):\"\";return typeof b==\"function\"&&Mu.set(b,ir),ir}function dp(b,D,V){return Nm(b,!1)}function sx(b){var D=b.prototype;return!!(D&&D.isReactComponent)}function Pu(b,D,V){if(b==null)return\"\";if(typeof b==\"function\")return Nm(b,sx(b));if(typeof b==\"string\")return Au(b);switch(b){case m:return Au(\"Suspense\");case S:return Au(\"SuspenseList\")}if(typeof b==\"object\")switch(b.$$typeof){case v:return dp(b.render);case w:return Pu(b.type,D,V);case C:{var K=b,oe=K._payload,Ue=K._init;try{return Pu(Ue(oe),D,V)}catch{}}}return\"\"}var jm={},Ec=Pe.ReactDebugCurrentFrame;function Cc(b){if(b){var D=b._owner,V=Pu(b.type,b._source,D?D.type:null);Ec.setExtraStackFrame(V)}else Ec.setExtraStackFrame(null)}function Lm(b,D,V,K,oe){{var Ue=Function.call.bind(Kr);for(var Ce in b)if(Ue(b,Ce)){var $e=void 0;try{if(typeof b[Ce]!=\"function\"){var ut=Error((K||\"React class\")+\": \"+V+\" type `\"+Ce+\"` is invalid; it must be a function, usually from the `prop-types` package, but received `\"+typeof b[Ce]+\"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.\");throw ut.name=\"Invariant Violation\",ut}$e=b[Ce](D,Ce,K,V,null,\"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED\")}catch(xt){$e=xt}$e&&!($e instanceof Error)&&(Cc(oe),Re(\"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).\",K||\"React class\",V,Ce,typeof $e),Cc(null)),$e instanceof Error&&!($e.message in jm)&&(jm[$e.message]=!0,Cc(oe),Re(\"Failed %s type: %s\",V,$e.message),Cc(null))}}}function Du(b){if(b){var D=b._owner,V=Pu(b.type,b._source,D?D.type:null);re(V)}else re(null)}var Rc;Rc=!1;function Tt(){if(F.current){var b=ar(F.current.type);if(b)return`\n\nCheck the render method of \\``+b+\"`.\"}return\"\"}function cx(b){if(b!==void 0){var D=b.fileName.replace(/^.*[\\\\\\/]/,\"\"),V=b.lineNumber;return`\n\nCheck your code at `+D+\":\"+V+\".\"}return\"\"}function Um(b){return b!=null?cx(b.__source):\"\"}var Ye={};function Fm(b){var D=Tt();if(!D){var V=typeof b==\"string\"?b:b.displayName||b.name;V&&(D=`\n\nCheck the top-level render call using <`+V+\">.\")}return D}function An(b,D){if(!(!b._store||b._store.validated||b.key!=null)){b._store.validated=!0;var V=Fm(D);if(!Ye[V]){Ye[V]=!0;var K=\"\";b&&b._owner&&b._owner!==F.current&&(K=\" It was passed a child from \"+ar(b._owner.type)+\".\"),Du(b),Re('Each child in a list should have a unique \"key\" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',V,K),Du(null)}}}function Nu(b,D){if(typeof b==\"object\"){if(Qr(b))for(var V=0;V\",oe=\" Did you accidentally export a JSX literal instead of a component?\"):Ce=typeof b,Re(\"React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s\",Ce,oe)}var $e=W.apply(this,arguments);if($e==null)return $e;if(K)for(var ut=2;ut10&&ot(\"Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.\"),K._updatedFibers.clear()}}}var bi=!1,Oc=null;function pp(b){if(Oc===null)try{var D=(\"require\"+Math.random()).slice(0,7),V=$g&&$g[D];Oc=V.call($g,\"timers\").setImmediate}catch{Oc=function(oe){bi===!1&&(bi=!0,typeof MessageChannel>\"u\"&&Re(\"This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning.\"));var Ue=new MessageChannel;Ue.port1.onmessage=oe,Ue.port2.postMessage(void 0)}}return Oc(b)}var Uo=0,vp=!1;function px(b){{var D=Uo;Uo++,A.current===null&&(A.current=[]);var V=A.isBatchingLegacy,K;try{if(A.isBatchingLegacy=!0,K=b(),!V&&A.didScheduleLegacyUpdate){var oe=A.current;oe!==null&&(A.didScheduleLegacyUpdate=!1,kc(oe))}}catch(Ft){throw Tc(D),Ft}finally{A.isBatchingLegacy=V}if(K!==null&&typeof K==\"object\"&&typeof K.then==\"function\"){var Ue=K,Ce=!1,$e={then:function(Ft,ir){Ce=!0,Ue.then(function(jr){Tc(D),Uo===0?hp(jr,Ft,ir):Ft(jr)},function(jr){Tc(D),ir(jr)})}};return!vp&&typeof Promise<\"u\"&&Promise.resolve().then(function(){}).then(function(){Ce||(vp=!0,Re(\"You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);\"))}),$e}else{var ut=K;if(Tc(D),Uo===0){var xt=A.current;xt!==null&&(kc(xt),A.current=null);var Pt={then:function(Ft,ir){A.current===null?(A.current=[],hp(ut,Ft,ir)):Ft(ut)}};return Pt}else{var Dt={then:function(Ft,ir){Ft(ut)}};return Dt}}}}function Tc(b){b!==Uo-1&&Re(\"You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. \"),Uo=b}function hp(b,D,V){{var K=A.current;if(K!==null)try{kc(K),pp(function(){K.length===0?(A.current=null,D(b)):hp(b,D,V)})}catch(oe){V(oe)}else D(b)}}var Lu=!1;function kc(b){if(!Lu){Lu=!0;var D=0;try{for(;D{\"use strict\";process.env.NODE_ENV===\"production\"?wR.exports=OL():wR.exports=TL()});var AL=M(Wg=>{\"use strict\";var bQ=ur(),SQ=Symbol.for(\"react.element\"),_Q=Symbol.for(\"react.fragment\"),wQ=Object.prototype.hasOwnProperty,xQ=bQ.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,EQ={key:!0,ref:!0,__self:!0,__source:!0};function kL(e,t,n){var i,o={},l=null,c=null;n!==void 0&&(l=\"\"+n),t.key!==void 0&&(l=\"\"+t.key),t.ref!==void 0&&(c=t.ref);for(i in t)wQ.call(t,i)&&!EQ.hasOwnProperty(i)&&(o[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps,t)o[i]===void 0&&(o[i]=t[i]);return{$$typeof:SQ,type:e,key:l,ref:c,props:o,_owner:xQ.current}}Wg.Fragment=_Q;Wg.jsx=kL;Wg.jsxs=kL});var ML=M(Yg=>{\"use strict\";process.env.NODE_ENV!==\"production\"&&function(){\"use strict\";var e=ur(),t=Symbol.for(\"react.element\"),n=Symbol.for(\"react.portal\"),i=Symbol.for(\"react.fragment\"),o=Symbol.for(\"react.strict_mode\"),l=Symbol.for(\"react.profiler\"),c=Symbol.for(\"react.provider\"),p=Symbol.for(\"react.context\"),v=Symbol.for(\"react.forward_ref\"),m=Symbol.for(\"react.suspense\"),S=Symbol.for(\"react.suspense_list\"),w=Symbol.for(\"react.memo\"),C=Symbol.for(\"react.lazy\"),T=Symbol.for(\"react.offscreen\"),k=Symbol.iterator,N=\"@@iterator\";function I(P){if(P===null||typeof P!=\"object\")return null;var Q=k&&P[k]||P[N];return typeof Q==\"function\"?Q:null}var _=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function R(P){{for(var Q=arguments.length,le=new Array(Q>1?Q-1:0),Ne=1;Ne=1&&Wt>=0&&Le[$t]!==Nr[Wt];)Wt--;for(;$t>=1&&Wt>=0;$t--,Wt--)if(Le[$t]!==Nr[Wt]){if($t!==1||Wt!==1)do if($t--,Wt--,Wt<0||Le[$t]!==Nr[Wt]){var kn=`\n`+Le[$t].replace(\" at new \",\" at \");return P.displayName&&kn.includes(\"\")&&(kn=kn.replace(\"\",P.displayName)),typeof P==\"function\"&&ia.set(P,kn),kn}while($t>=1&&Wt>=0);break}}}finally{cn=!1,aa.current=mt,Mr(),Error.prepareStackTrace=Ze}var io=P?P.displayName||P.name:\"\",wc=io?Tn(io):\"\";return typeof P==\"function\"&&ia.set(P,wc),wc}function Er(P,Q,le){return Pr(P,!1)}function gr(P){var Q=P.prototype;return!!(Q&&Q.isReactComponent)}function Vt(P,Q,le){if(P==null)return\"\";if(typeof P==\"function\")return Pr(P,gr(P));if(typeof P==\"string\")return Tn(P);switch(P){case m:return Tn(\"Suspense\");case S:return Tn(\"SuspenseList\")}if(typeof P==\"object\")switch(P.$$typeof){case v:return Er(P.render);case w:return Vt(P.type,Q,le);case C:{var Ne=P,Ze=Ne._payload,mt=Ne._init;try{return Vt(mt(Ze),Q,le)}catch{}}}return\"\"}var br=Object.prototype.hasOwnProperty,Jt={},ar=_.ReactDebugCurrentFrame;function Kr(P){if(P){var Q=P._owner,le=Vt(P.type,P._source,Q?Q.type:null);ar.setExtraStackFrame(le)}else ar.setExtraStackFrame(null)}function gi(P,Q,le,Ne,Ze){{var mt=Function.call.bind(br);for(var Xe in P)if(mt(P,Xe)){var Le=void 0;try{if(typeof P[Xe]!=\"function\"){var Nr=Error((Ne||\"React class\")+\": \"+le+\" type `\"+Xe+\"` is invalid; it must be a function, usually from the `prop-types` package, but received `\"+typeof P[Xe]+\"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.\");throw Nr.name=\"Invariant Violation\",Nr}Le=P[Xe](Q,Xe,Ne,le,null,\"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED\")}catch($t){Le=$t}Le&&!(Le instanceof Error)&&(Kr(Ze),R(\"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).\",Ne||\"React class\",le,Xe,typeof Le),Kr(null)),Le instanceof Error&&!(Le.message in Jt)&&(Jt[Le.message]=!0,Kr(Ze),R(\"Failed %s type: %s\",le,Le.message),Kr(null))}}}var eo=Array.isArray;function Xr(P){return eo(P)}function Sr(P){{var Q=typeof Symbol==\"function\"&&Symbol.toStringTag,le=Q&&P[Symbol.toStringTag]||P.constructor.name||\"Object\";return le}}function Hn(P){try{return Dr(P),!1}catch{return!0}}function Dr(P){return\"\"+P}function oa(P){if(Hn(P))return R(\"The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.\",Sr(P)),Dr(P)}var vr=_.ReactCurrentOwner,Bn={key:!0,ref:!0,__self:!0,__source:!0},Ta,W,j;j={};function H(P){if(br.call(P,\"ref\")){var Q=Object.getOwnPropertyDescriptor(P,\"ref\").get;if(Q&&Q.isReactWarning)return!1}return P.ref!==void 0}function Z(P){if(br.call(P,\"key\")){var Q=Object.getOwnPropertyDescriptor(P,\"key\").get;if(Q&&Q.isReactWarning)return!1}return P.key!==void 0}function ie(P,Q){if(typeof P.ref==\"string\"&&vr.current&&Q&&vr.current.stateNode!==Q){var le=Pe(vr.current.type);j[le]||(R('Component \"%s\" contains the string ref \"%s\". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',Pe(vr.current.type),P.ref),j[le]=!0)}}function de(P,Q){{var le=function(){Ta||(Ta=!0,R(\"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)\",Q))};le.isReactWarning=!0,Object.defineProperty(P,\"key\",{get:le,configurable:!0})}}function Ae(P,Q){{var le=function(){W||(W=!0,R(\"%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)\",Q))};le.isReactWarning=!0,Object.defineProperty(P,\"ref\",{get:le,configurable:!0})}}var ye=function(P,Q,le,Ne,Ze,mt,Xe){var Le={$$typeof:t,type:P,key:Q,ref:le,props:Xe,_owner:mt};return Le._store={},Object.defineProperty(Le._store,\"validated\",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Le,\"_self\",{configurable:!1,enumerable:!1,writable:!1,value:Ne}),Object.defineProperty(Le,\"_source\",{configurable:!1,enumerable:!1,writable:!1,value:Ze}),Object.freeze&&(Object.freeze(Le.props),Object.freeze(Le)),Le};function _e(P,Q,le,Ne,Ze){{var mt,Xe={},Le=null,Nr=null;le!==void 0&&(oa(le),Le=\"\"+le),Z(Q)&&(oa(Q.key),Le=\"\"+Q.key),H(Q)&&(Nr=Q.ref,ie(Q,Ze));for(mt in Q)br.call(Q,mt)&&!Bn.hasOwnProperty(mt)&&(Xe[mt]=Q[mt]);if(P&&P.defaultProps){var $t=P.defaultProps;for(mt in $t)Xe[mt]===void 0&&(Xe[mt]=$t[mt])}if(Le||Nr){var Wt=typeof P==\"function\"?P.displayName||P.name||\"Unknown\":P;Le&&de(Xe,Wt),Nr&&Ae(Xe,Wt)}return ye(P,Le,Nr,Ze,Ne,vr.current,Xe)}}var Me=_.ReactCurrentOwner,Ge=_.ReactDebugCurrentFrame;function Qe(P){if(P){var Q=P._owner,le=Vt(P.type,P._source,Q?Q.type:null);Ge.setExtraStackFrame(le)}else Ge.setExtraStackFrame(null)}var We;We=!1;function Ut(P){return typeof P==\"object\"&&P!==null&&P.$$typeof===t}function _r(){{if(Me.current){var P=Pe(Me.current.type);if(P)return`\n\nCheck the render method of \\``+P+\"`.\"}return\"\"}}function ka(P){{if(P!==void 0){var Q=P.fileName.replace(/^.*[\\\\\\/]/,\"\"),le=P.lineNumber;return`\n\nCheck your code at `+Q+\":\"+le+\".\"}return\"\"}}var to={};function ro(P){{var Q=_r();if(!Q){var le=typeof P==\"string\"?P:P.displayName||P.name;le&&(Q=`\n\nCheck the top-level render call using <`+le+\">.\")}return Q}}function Cr(P,Q){{if(!P._store||P._store.validated||P.key!=null)return;P._store.validated=!0;var le=ro(Q);if(to[le])return;to[le]=!0;var Ne=\"\";P&&P._owner&&P._owner!==Me.current&&(Ne=\" It was passed a child from \"+Pe(P._owner.type)+\".\"),Qe(P),R('Each child in a list should have a unique \"key\" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',le,Ne),Qe(null)}}function ua(P,Q){{if(typeof P!=\"object\")return;if(Xr(P))for(var le=0;le\",Le=\" Did you accidentally export a JSX literal instead of a component?\"):$t=typeof P,R(\"React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s\",$t,Le)}var Wt=_e(P,Q,le,Ze,mt);if(Wt==null)return Wt;if(Xe){var kn=Q.children;if(kn!==void 0)if(Ne)if(Xr(kn)){for(var io=0;io{\"use strict\";process.env.NODE_ENV===\"production\"?xR.exports=AL():xR.exports=ML()});var IL=M(qt=>{\"use strict\";function OR(e,t){var n=e.length;e.push(t);e:for(;0>>1,o=e[i];if(0>>1;iGg(p,n))vGg(m,p)?(e[i]=m,e[v]=n,i=v):(e[i]=p,e[c]=n,i=c);else if(vGg(m,n))e[i]=m,e[v]=n,i=v;else break e}}return t}function Gg(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}typeof performance==\"object\"&&typeof performance.now==\"function\"?(PL=performance,qt.unstable_now=function(){return PL.now()}):(ER=Date,DL=ER.now(),qt.unstable_now=function(){return ER.now()-DL});var PL,ER,DL,So=[],ol=[],CQ=1,ai=null,Ln=3,Xg=!1,Fs=!1,Yv=!1,LL=typeof setTimeout==\"function\"?setTimeout:null,UL=typeof clearTimeout==\"function\"?clearTimeout:null,NL=typeof setImmediate<\"u\"?setImmediate:null;typeof navigator<\"u\"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function TR(e){for(var t=Ni(ol);t!==null;){if(t.callback===null)Kg(ol);else if(t.startTime<=e)Kg(ol),t.sortIndex=t.expirationTime,OR(So,t);else break;t=Ni(ol)}}function kR(e){if(Yv=!1,TR(e),!Fs)if(Ni(So)!==null)Fs=!0,MR(AR);else{var t=Ni(ol);t!==null&&PR(kR,t.startTime-e)}}function AR(e,t){Fs=!1,Yv&&(Yv=!1,UL(Gv),Gv=-1),Xg=!0;var n=Ln;try{for(TR(t),ai=Ni(So);ai!==null&&(!(ai.expirationTime>t)||e&&!qL());){var i=ai.callback;if(typeof i==\"function\"){ai.callback=null,Ln=ai.priorityLevel;var o=i(ai.expirationTime<=t);t=qt.unstable_now(),typeof o==\"function\"?ai.callback=o:ai===Ni(So)&&Kg(So),TR(t)}else Kg(So);ai=Ni(So)}if(ai!==null)var l=!0;else{var c=Ni(ol);c!==null&&PR(kR,c.startTime-t),l=!1}return l}finally{ai=null,Ln=n,Xg=!1}}var Jg=!1,Qg=null,Gv=-1,FL=5,zL=-1;function qL(){return!(qt.unstable_now()-zLe||125i?(e.sortIndex=n,OR(ol,e),Ni(So)===null&&e===Ni(ol)&&(Yv?(UL(Gv),Gv=-1):Yv=!0,PR(kR,n-i))):(e.sortIndex=o,OR(So,e),Fs||Xg||(Fs=!0,MR(AR))),e};qt.unstable_shouldYield=qL;qt.unstable_wrapCallback=function(e){var t=Ln;return function(){var n=Ln;Ln=t;try{return e.apply(this,arguments)}finally{Ln=n}}}});var HL=M(jt=>{\"use strict\";process.env.NODE_ENV!==\"production\"&&function(){\"use strict\";typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<\"u\"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==\"function\"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=!1,t=!1,n=5;function i(j,H){var Z=j.length;j.push(H),c(j,H,Z)}function o(j){return j.length===0?null:j[0]}function l(j){if(j.length===0)return null;var H=j[0],Z=j.pop();return Z!==H&&(j[0]=Z,p(j,Z,0)),H}function c(j,H,Z){for(var ie=Z;ie>0;){var de=ie-1>>>1,Ae=j[de];if(v(Ae,H)>0)j[de]=H,j[ie]=Ae,ie=de;else return}}function p(j,H,Z){for(var ie=Z,de=j.length,Ae=de>>>1;ieZ&&(!j||Kr()));){var ie=rt.callback;if(typeof ie==\"function\"){rt.callback=null,Pe=rt.priorityLevel;var de=rt.expirationTime<=Z,Ae=ie(de);Z=jt.unstable_now(),typeof Ae==\"function\"?rt.callback=Ae:rt===o(we)&&l(we),ht(Z)}else l(we);rt=o(we)}if(rt!==null)return!0;var ye=o(De);return ye!==null&&vr(pt,ye.startTime-Z),!1}function Mr(j,H){switch(j){case m:case S:case w:case C:case T:break;default:j=w}var Z=Pe;Pe=j;try{return H()}finally{Pe=Z}}function aa(j){var H;switch(Pe){case m:case S:case w:H=w;break;default:H=Pe;break}var Z=Pe;Pe=H;try{return j()}finally{Pe=Z}}function Oa(j){var H=Pe;return function(){var Z=Pe;Pe=H;try{return j.apply(this,arguments)}finally{Pe=Z}}}function Tn(j,H,Z){var ie=jt.unstable_now(),de;if(typeof Z==\"object\"&&Z!==null){var Ae=Z.delay;typeof Ae==\"number\"&&Ae>0?de=ie+Ae:de=ie}else de=ie;var ye;switch(j){case m:ye=F;break;case S:ye=G;break;case T:ye=Se;break;case C:ye=re;break;case w:default:ye=te;break}var _e=de+ye,Me={id:dt++,callback:H,priorityLevel:j,startTime:de,expirationTime:_e,sortIndex:-1};return de>ie?(Me.sortIndex=de,i(De,Me),o(we)===null&&Me===o(De)&&(Mt?Bn():Mt=!0,vr(pt,de-ie))):(Me.sortIndex=_e,i(we,Me),!Re&&!ot&&(Re=!0,oa(sn))),Me}function cn(){}function ia(){!Re&&!ot&&(Re=!0,oa(sn))}function Qr(){return o(we)}function Pr(j){j.callback=null}function Er(){return Pe}var gr=!1,Vt=null,br=-1,Jt=n,ar=-1;function Kr(){var j=jt.unstable_now()-ar;return!(j125){console.error(\"forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported\");return}j>0?Jt=Math.floor(1e3/j):Jt=n}var Xr=function(){if(Vt!==null){var j=jt.unstable_now();ar=j;var H=!0,Z=!0;try{Z=Vt(H,j)}finally{Z?Sr():(gr=!1,Vt=null)}}else gr=!1},Sr;if(typeof On==\"function\")Sr=function(){On(Xr)};else if(typeof MessageChannel<\"u\"){var Hn=new MessageChannel,Dr=Hn.port2;Hn.port1.onmessage=Xr,Sr=function(){Dr.postMessage(null)}}else Sr=function(){Gr(Xr,0)};function oa(j){Vt=j,gr||(gr=!0,Sr())}function vr(j,H){br=Gr(function(){j(jt.unstable_now())},H)}function Bn(){Bt(br),br=-1}var Ta=gi,W=null;jt.unstable_IdlePriority=T,jt.unstable_ImmediatePriority=m,jt.unstable_LowPriority=C,jt.unstable_NormalPriority=w,jt.unstable_Profiling=W,jt.unstable_UserBlockingPriority=S,jt.unstable_cancelCallback=Pr,jt.unstable_continueExecution=ia,jt.unstable_forceFrameRate=eo,jt.unstable_getCurrentPriorityLevel=Er,jt.unstable_getFirstCallbackNode=Qr,jt.unstable_next=aa,jt.unstable_pauseExecution=cn,jt.unstable_requestPaint=Ta,jt.unstable_runWithPriority=Mr,jt.unstable_scheduleCallback=Tn,jt.unstable_shouldYield=Kr,jt.unstable_wrapCallback=Oa,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<\"u\"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==\"function\"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()});var NR=M((Zye,DR)=>{\"use strict\";process.env.NODE_ENV===\"production\"?DR.exports=IL():DR.exports=HL()});var GF=M(Ba=>{\"use strict\";var Q2=ur(),Ia=NR();function ae(e){for(var t=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+e,n=1;n\"u\"||typeof window.document>\"u\"||typeof window.document.createElement>\"u\"),nO=Object.prototype.hasOwnProperty,RQ=/^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$/,BL={},VL={};function OQ(e){return nO.call(VL,e)?!0:nO.call(BL,e)?!1:RQ.test(e)?VL[e]=!0:(BL[e]=!0,!1)}function TQ(e,t,n,i){if(n!==null&&n.type===0)return!1;switch(typeof t){case\"function\":case\"symbol\":return!0;case\"boolean\":return i?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!==\"data-\"&&e!==\"aria-\");default:return!1}}function kQ(e,t,n,i){if(t===null||typeof t>\"u\"||TQ(e,t,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ra(e,t,n,i,o,l,c){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=l,this.removeEmptyString=c}var xn={};\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\".split(\" \").forEach(function(e){xn[e]=new ra(e,0,!1,e,null,!1,!1)});[[\"acceptCharset\",\"accept-charset\"],[\"className\",\"class\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"]].forEach(function(e){var t=e[0];xn[t]=new ra(t,1,!1,e[1],null,!1,!1)});[\"contentEditable\",\"draggable\",\"spellCheck\",\"value\"].forEach(function(e){xn[e]=new ra(e,2,!1,e.toLowerCase(),null,!1,!1)});[\"autoReverse\",\"externalResourcesRequired\",\"focusable\",\"preserveAlpha\"].forEach(function(e){xn[e]=new ra(e,2,!1,e,null,!1,!1)});\"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope\".split(\" \").forEach(function(e){xn[e]=new ra(e,3,!1,e.toLowerCase(),null,!1,!1)});[\"checked\",\"multiple\",\"muted\",\"selected\"].forEach(function(e){xn[e]=new ra(e,3,!0,e,null,!1,!1)});[\"capture\",\"download\"].forEach(function(e){xn[e]=new ra(e,4,!1,e,null,!1,!1)});[\"cols\",\"rows\",\"size\",\"span\"].forEach(function(e){xn[e]=new ra(e,6,!1,e,null,!1,!1)});[\"rowSpan\",\"start\"].forEach(function(e){xn[e]=new ra(e,5,!1,e.toLowerCase(),null,!1,!1)});var QO=/[\\-:]([a-z])/g;function KO(e){return e[1].toUpperCase()}\"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height\".split(\" \").forEach(function(e){var t=e.replace(QO,KO);xn[t]=new ra(t,1,!1,e,null,!1,!1)});\"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type\".split(\" \").forEach(function(e){var t=e.replace(QO,KO);xn[t]=new ra(t,1,!1,e,\"http://www.w3.org/1999/xlink\",!1,!1)});[\"xml:base\",\"xml:lang\",\"xml:space\"].forEach(function(e){var t=e.replace(QO,KO);xn[t]=new ra(t,1,!1,e,\"http://www.w3.org/XML/1998/namespace\",!1,!1)});[\"tabIndex\",\"crossOrigin\"].forEach(function(e){xn[e]=new ra(e,1,!1,e.toLowerCase(),null,!1,!1)});xn.xlinkHref=new ra(\"xlinkHref\",1,!1,\"xlink:href\",\"http://www.w3.org/1999/xlink\",!0,!1);[\"src\",\"href\",\"action\",\"formAction\"].forEach(function(e){xn[e]=new ra(e,1,!1,e.toLowerCase(),null,!0,!0)});function XO(e,t,n,i){var o=xn.hasOwnProperty(t)?xn[t]:null;(o!==null?o.type!==0:i||!(2p||o[c]!==l[p]){var v=`\n`+o[c].replace(\" at new \",\" at \");return e.displayName&&v.includes(\"\")&&(v=v.replace(\"\",e.displayName)),v}while(1<=c&&0<=p);break}}}finally{LR=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:\"\")?nh(e):\"\"}function AQ(e){switch(e.tag){case 5:return nh(e.type);case 16:return nh(\"Lazy\");case 13:return nh(\"Suspense\");case 19:return nh(\"SuspenseList\");case 0:case 2:case 15:return e=UR(e.type,!1),e;case 11:return e=UR(e.type.render,!1),e;case 1:return e=UR(e.type,!0),e;default:return\"\"}}function uO(e){if(e==null)return null;if(typeof e==\"function\")return e.displayName||e.name||null;if(typeof e==\"string\")return e;switch(e){case Af:return\"Fragment\";case kf:return\"Portal\";case aO:return\"Profiler\";case JO:return\"StrictMode\";case iO:return\"Suspense\";case oO:return\"SuspenseList\"}if(typeof e==\"object\")switch(e.$$typeof){case J2:return(e.displayName||\"Context\")+\".Consumer\";case X2:return(e._context.displayName||\"Context\")+\".Provider\";case ZO:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||\"\",e=e!==\"\"?\"ForwardRef(\"+e+\")\":\"ForwardRef\"),e;case eT:return t=e.displayName||null,t!==null?t:uO(e.type)||\"Memo\";case ll:t=e._payload,e=e._init;try{return uO(e(t))}catch{}}return null}function MQ(e){var t=e.type;switch(e.tag){case 24:return\"Cache\";case 9:return(t.displayName||\"Context\")+\".Consumer\";case 10:return(t._context.displayName||\"Context\")+\".Provider\";case 18:return\"DehydratedFragment\";case 11:return e=t.render,e=e.displayName||e.name||\"\",t.displayName||(e!==\"\"?\"ForwardRef(\"+e+\")\":\"ForwardRef\");case 7:return\"Fragment\";case 5:return t;case 4:return\"Portal\";case 3:return\"Root\";case 6:return\"Text\";case 16:return uO(t);case 8:return t===JO?\"StrictMode\":\"Mode\";case 22:return\"Offscreen\";case 12:return\"Profiler\";case 21:return\"Scope\";case 13:return\"Suspense\";case 19:return\"SuspenseList\";case 25:return\"TracingMarker\";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==\"function\")return t.displayName||t.name||null;if(typeof t==\"string\")return t}return null}function wl(e){switch(typeof e){case\"boolean\":case\"number\":case\"string\":case\"undefined\":return e;case\"object\":return e;default:return\"\"}}function eU(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===\"input\"&&(t===\"checkbox\"||t===\"radio\")}function PQ(e){var t=eU(e)?\"checked\":\"value\",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=\"\"+e[t];if(!e.hasOwnProperty(t)&&typeof n<\"u\"&&typeof n.get==\"function\"&&typeof n.set==\"function\"){var o=n.get,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(c){i=\"\"+c,l.call(this,c)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(c){i=\"\"+c},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function eb(e){e._valueTracker||(e._valueTracker=PQ(e))}function tU(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i=\"\";return e&&(i=eU(e)?e.checked?\"true\":\"false\":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function Tb(e){if(e=e||(typeof document<\"u\"?document:void 0),typeof e>\"u\")return null;try{return e.activeElement||e.body}catch{return e.body}}function lO(e,t){var n=t.checked;return cr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function WL(e,t){var n=t.defaultValue==null?\"\":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;n=wl(t.value!=null?t.value:n),e._wrapperState={initialChecked:i,initialValue:n,controlled:t.type===\"checkbox\"||t.type===\"radio\"?t.checked!=null:t.value!=null}}function rU(e,t){t=t.checked,t!=null&&XO(e,\"checked\",t,!1)}function sO(e,t){rU(e,t);var n=wl(t.value),i=t.type;if(n!=null)i===\"number\"?(n===0&&e.value===\"\"||e.value!=n)&&(e.value=\"\"+n):e.value!==\"\"+n&&(e.value=\"\"+n);else if(i===\"submit\"||i===\"reset\"){e.removeAttribute(\"value\");return}t.hasOwnProperty(\"value\")?cO(e,t.type,n):t.hasOwnProperty(\"defaultValue\")&&cO(e,t.type,wl(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function YL(e,t,n){if(t.hasOwnProperty(\"value\")||t.hasOwnProperty(\"defaultValue\")){var i=t.type;if(!(i!==\"submit\"&&i!==\"reset\"||t.value!==void 0&&t.value!==null))return;t=\"\"+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==\"\"&&(e.name=\"\"),e.defaultChecked=!!e._wrapperState.initialChecked,n!==\"\"&&(e.name=n)}function cO(e,t,n){(t!==\"number\"||Tb(e.ownerDocument)!==e)&&(n==null?e.defaultValue=\"\"+e._wrapperState.initialValue:e.defaultValue!==\"\"+n&&(e.defaultValue=\"\"+n))}var ah=Array.isArray;function If(e,t,n,i){if(e=e.options,t){t={};for(var o=0;o\"+t.valueOf().toString()+\"\",t=tb.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function yh(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var uh={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},DQ=[\"Webkit\",\"ms\",\"Moz\",\"O\"];Object.keys(uh).forEach(function(e){DQ.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),uh[t]=uh[e]})});function oU(e,t,n){return t==null||typeof t==\"boolean\"||t===\"\"?\"\":n||typeof t!=\"number\"||t===0||uh.hasOwnProperty(e)&&uh[e]?(\"\"+t).trim():t+\"px\"}function uU(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var i=n.indexOf(\"--\")===0,o=oU(n,t[n],i);n===\"float\"&&(n=\"cssFloat\"),i?e.setProperty(n,o):e[n]=o}}var NQ=cr({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function pO(e,t){if(t){if(NQ[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ae(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ae(60));if(typeof t.dangerouslySetInnerHTML!=\"object\"||!(\"__html\"in t.dangerouslySetInnerHTML))throw Error(ae(61))}if(t.style!=null&&typeof t.style!=\"object\")throw Error(ae(62))}}function vO(e,t){if(e.indexOf(\"-\")===-1)return typeof t.is==\"string\";switch(e){case\"annotation-xml\":case\"color-profile\":case\"font-face\":case\"font-face-src\":case\"font-face-uri\":case\"font-face-format\":case\"font-face-name\":case\"missing-glyph\":return!1;default:return!0}}var hO=null;function tT(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var mO=null,Hf=null,Bf=null;function KL(e){if(e=jh(e)){if(typeof mO!=\"function\")throw Error(ae(280));var t=e.stateNode;t&&(t=r0(t),mO(e.stateNode,e.type,t))}}function lU(e){Hf?Bf?Bf.push(e):Bf=[e]:Hf=e}function sU(){if(Hf){var e=Hf,t=Bf;if(Bf=Hf=null,KL(e),t)for(e=0;e>>=0,e===0?32:31-($Q(e)/WQ|0)|0}var rb=64,nb=4194304;function ih(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Pb(e,t){var n=e.pendingLanes;if(n===0)return 0;var i=0,o=e.suspendedLanes,l=e.pingedLanes,c=n&268435455;if(c!==0){var p=c&~o;p!==0?i=ih(p):(l&=c,l!==0&&(i=ih(l)))}else c=n&~o,c!==0?i=ih(c):l!==0&&(i=ih(l));if(i===0)return 0;if(t!==0&&t!==i&&!(t&o)&&(o=i&-i,l=t&-t,o>=l||o===16&&(l&4194240)!==0))return t;if(i&4&&(i|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0n;n++)t.push(e);return t}function Dh(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-zi(t),e[t]=n}function KQ(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0=sh),i2=String.fromCharCode(32),o2=!1;function kU(e,t){switch(e){case\"keyup\":return EK.indexOf(t.keyCode)!==-1;case\"keydown\":return t.keyCode!==229;case\"keypress\":case\"mousedown\":case\"focusout\":return!0;default:return!1}}function AU(e){return e=e.detail,typeof e==\"object\"&&\"data\"in e?e.data:null}var Mf=!1;function RK(e,t){switch(e){case\"compositionend\":return AU(t);case\"keypress\":return t.which!==32?null:(o2=!0,i2);case\"textInput\":return e=t.data,e===i2&&o2?null:e;default:return null}}function OK(e,t){if(Mf)return e===\"compositionend\"||!sT&&kU(e,t)?(e=OU(),bb=oT=dl=null,Mf=!1,e):null;switch(e){case\"paste\":return null;case\"keypress\":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=s2(n)}}function NU(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?NU(e,t.parentNode):\"contains\"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function jU(){for(var e=window,t=Tb();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==\"string\"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Tb(e.document)}return t}function cT(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===\"input\"&&(e.type===\"text\"||e.type===\"search\"||e.type===\"tel\"||e.type===\"url\"||e.type===\"password\")||t===\"textarea\"||e.contentEditable===\"true\")}function LK(e){var t=jU(),n=e.focusedElem,i=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&NU(n.ownerDocument.documentElement,n)){if(i!==null&&cT(n)){if(t=i.start,e=i.end,e===void 0&&(e=t),\"selectionStart\"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,l=Math.min(i.start,o);i=i.end===void 0?l:Math.min(i.end,o),!e.extend&&l>i&&(o=i,i=l,l=o),o=c2(n,l);var c=c2(n,i);o&&c&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==c.node||e.focusOffset!==c.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),l>i?(e.addRange(t),e.extend(c.node,c.offset)):(t.setEnd(c.node,c.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==\"function\"&&n.focus(),n=0;n=document.documentMode,Pf=null,wO=null,fh=null,xO=!1;function f2(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;xO||Pf==null||Pf!==Tb(i)||(i=Pf,\"selectionStart\"in i&&cT(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),fh&&xh(fh,i)||(fh=i,i=jb(wO,\"onSelect\"),0jf||(e.current=kO[jf],kO[jf]=null,jf--)}function It(e,t){jf++,kO[jf]=e.current,e.current=t}var xl={},qn=Cl(xl),ga=Cl(!1),Ws=xl;function Gf(e,t){var n=e.type.contextTypes;if(!n)return xl;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var o={},l;for(l in n)o[l]=t[l];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function ba(e){return e=e.childContextTypes,e!=null}function Ub(){Qt(ga),Qt(qn)}function S2(e,t,n){if(qn.current!==xl)throw Error(ae(168));It(qn,t),It(ga,n)}function VU(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=\"function\")return n;i=i.getChildContext();for(var o in i)if(!(o in t))throw Error(ae(108,MQ(e)||\"Unknown\",o));return cr({},n,i)}function Fb(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||xl,Ws=qn.current,It(qn,e),It(ga,ga.current),!0}function _2(e,t,n){var i=e.stateNode;if(!i)throw Error(ae(169));n?(e=VU(e,t,Ws),i.__reactInternalMemoizedMergedChildContext=e,Qt(ga),Qt(qn),It(qn,e)):Qt(ga),It(ga,n)}var lu=null,n0=!1,GR=!1;function $U(e){lu===null?lu=[e]:lu.push(e)}function WK(e){n0=!0,$U(e)}function Rl(){if(!GR&&lu!==null){GR=!0;var e=0,t=kt;try{var n=lu;for(kt=1;e>=c,o-=c,su=1<<32-zi(t)+o|n<Se?(we=re,re=null):we=re.sibling;var De=C(_,re,A[Se],F);if(De===null){re===null&&(re=we);break}e&&re&&De.alternate===null&&t(_,re),R=l(De,R,Se),te===null?G=De:te.sibling=De,te=De,re=we}if(Se===A.length)return n(_,re),tr&&zs(_,Se),G;if(re===null){for(;SeSe?(we=re,re=null):we=re.sibling;var dt=C(_,re,De.value,F);if(dt===null){re===null&&(re=we);break}e&&re&&dt.alternate===null&&t(_,re),R=l(dt,R,Se),te===null?G=dt:te.sibling=dt,te=dt,re=we}if(De.done)return n(_,re),tr&&zs(_,Se),G;if(re===null){for(;!De.done;Se++,De=A.next())De=w(_,De.value,F),De!==null&&(R=l(De,R,Se),te===null?G=De:te.sibling=De,te=De);return tr&&zs(_,Se),G}for(re=i(_,re);!De.done;Se++,De=A.next())De=T(re,_,Se,De.value,F),De!==null&&(e&&De.alternate!==null&&re.delete(De.key===null?Se:De.key),R=l(De,R,Se),te===null?G=De:te.sibling=De,te=De);return e&&re.forEach(function(rt){return t(_,rt)}),tr&&zs(_,Se),G}function I(_,R,A,F){if(typeof A==\"object\"&&A!==null&&A.type===Af&&A.key===null&&(A=A.props.children),typeof A==\"object\"&&A!==null){switch(A.$$typeof){case Zg:e:{for(var G=A.key,te=R;te!==null;){if(te.key===G){if(G=A.type,G===Af){if(te.tag===7){n(_,te.sibling),R=o(te,A.props.children),R.return=_,_=R;break e}}else if(te.elementType===G||typeof G==\"object\"&&G!==null&&G.$$typeof===ll&&T2(G)===te.type){n(_,te.sibling),R=o(te,A.props),R.ref=Zv(_,te,A),R.return=_,_=R;break e}n(_,te);break}else t(_,te);te=te.sibling}A.type===Af?(R=$s(A.props.children,_.mode,F,A.key),R.return=_,_=R):(F=Ob(A.type,A.key,A.props,null,_.mode,F),F.ref=Zv(_,R,A),F.return=_,_=F)}return c(_);case kf:e:{for(te=A.key;R!==null;){if(R.key===te)if(R.tag===4&&R.stateNode.containerInfo===A.containerInfo&&R.stateNode.implementation===A.implementation){n(_,R.sibling),R=o(R,A.children||[]),R.return=_,_=R;break e}else{n(_,R);break}else t(_,R);R=R.sibling}R=rO(A,_.mode,F),R.return=_,_=R}return c(_);case ll:return te=A._init,I(_,R,te(A._payload),F)}if(ah(A))return k(_,R,A,F);if(Qv(A))return N(_,R,A,F);vb(_,A)}return typeof A==\"string\"&&A!==\"\"||typeof A==\"number\"?(A=\"\"+A,R!==null&&R.tag===6?(n(_,R.sibling),R=o(R,A),R.return=_,_=R):(n(_,R),R=tO(A,_.mode,F),R.return=_,_=R),c(_)):n(_,R)}return I}var Kf=ZU(!0),eF=ZU(!1),Lh={},Co=Cl(Lh),Oh=Cl(Lh),Th=Cl(Lh);function Bs(e){if(e===Lh)throw Error(ae(174));return e}function bT(e,t){switch(It(Th,t),It(Oh,e),It(Co,Lh),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:dO(null,\"\");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=dO(t,e)}Qt(Co),It(Co,t)}function Xf(){Qt(Co),Qt(Oh),Qt(Th)}function tF(e){Bs(Th.current);var t=Bs(Co.current),n=dO(t,e.type);t!==n&&(It(Oh,e),It(Co,n))}function ST(e){Oh.current===e&&(Qt(Co),Qt(Oh))}var lr=Cl(0);function Vb(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data===\"$?\"||n.data===\"$!\"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var QR=[];function _T(){for(var e=0;en?n:4,e(!0);var i=KR.transition;KR.transition={};try{e(!1),t()}finally{kt=n,KR.transition=i}}function yF(){return ci().memoizedState}function KK(e,t,n){var i=Sl(e);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},gF(e))bF(t,n);else if(n=QU(e,t,n,i),n!==null){var o=ta();qi(n,e,i,o),SF(n,t,i)}}function XK(e,t,n){var i=Sl(e),o={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(gF(e))bF(t,o);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var c=t.lastRenderedState,p=l(c,n);if(o.hasEagerState=!0,o.eagerState=p,Ii(p,c)){var v=t.interleaved;v===null?(o.next=o,yT(t)):(o.next=v.next,v.next=o),t.interleaved=o;return}}catch{}finally{}n=QU(e,t,o,i),n!==null&&(o=ta(),qi(n,e,i,o),SF(n,t,i))}}function gF(e){var t=e.alternate;return e===sr||t!==null&&t===sr}function bF(e,t){dh=$b=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function SF(e,t,n){if(n&4194240){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,nT(e,n)}}var Wb={readContext:si,useCallback:Un,useContext:Un,useEffect:Un,useImperativeHandle:Un,useInsertionEffect:Un,useLayoutEffect:Un,useMemo:Un,useReducer:Un,useRef:Un,useState:Un,useDebugValue:Un,useDeferredValue:Un,useTransition:Un,useMutableSource:Un,useSyncExternalStore:Un,useId:Un,unstable_isNewReconciler:!1},JK={readContext:si,useCallback:function(e,t){return wo().memoizedState=[e,t===void 0?null:t],e},useContext:si,useEffect:A2,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,xb(4194308,4,dF.bind(null,t,e),n)},useLayoutEffect:function(e,t){return xb(4194308,4,e,t)},useInsertionEffect:function(e,t){return xb(4,2,e,t)},useMemo:function(e,t){var n=wo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var i=wo();return t=n!==void 0?n(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=KK.bind(null,sr,e),[i.memoizedState,e]},useRef:function(e){var t=wo();return e={current:e},t.memoizedState=e},useState:k2,useDebugValue:RT,useDeferredValue:function(e){return wo().memoizedState=e},useTransition:function(){var e=k2(!1),t=e[0];return e=QK.bind(null,e[1]),wo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=sr,o=wo();if(tr){if(n===void 0)throw Error(ae(407));n=n()}else{if(n=t(),an===null)throw Error(ae(349));Gs&30||aF(i,t,n)}o.memoizedState=n;var l={value:n,getSnapshot:t};return o.queue=l,A2(oF.bind(null,i,l,e),[e]),i.flags|=2048,Mh(9,iF.bind(null,i,l,n,t),void 0,null),n},useId:function(){var e=wo(),t=an.identifierPrefix;if(tr){var n=cu,i=su;n=(i&~(1<<32-zi(i)-1)).toString(32)+n,t=\":\"+t+\"R\"+n,n=kh++,0\",e=e.removeChild(e.firstChild)):typeof i.is==\"string\"?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===\"select\"&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[xo]=t,e[Rh]=i,kF(e,t,!1,!1),t.stateNode=e;e:{switch(c=vO(n,i),n){case\"dialog\":Gt(\"cancel\",e),Gt(\"close\",e),o=i;break;case\"iframe\":case\"object\":case\"embed\":Gt(\"load\",e),o=i;break;case\"video\":case\"audio\":for(o=0;oZf&&(t.flags|=128,i=!0,eh(l,!1),t.lanes=4194304)}else{if(!i)if(e=Vb(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),eh(l,!0),l.tail===null&&l.tailMode===\"hidden\"&&!c.alternate&&!tr)return Fn(t),null}else 2*xr()-l.renderingStartTime>Zf&&n!==1073741824&&(t.flags|=128,i=!0,eh(l,!1),t.lanes=4194304);l.isBackwards?(c.sibling=t.child,t.child=c):(n=l.last,n!==null?n.sibling=c:t.child=c,l.last=c)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=xr(),t.sibling=null,n=lr.current,It(lr,i?n&1|2:n&1),t):(Fn(t),null);case 22:case 23:return PT(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Fa&1073741824&&(Fn(t),t.subtreeFlags&6&&(t.flags|=8192)):Fn(t),null;case 24:return null;case 25:return null}throw Error(ae(156,t.tag))}function oX(e,t){switch(dT(t),t.tag){case 1:return ba(t.type)&&Ub(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xf(),Qt(ga),Qt(qn),_T(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ST(t),null;case 13:if(Qt(lr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ae(340));Qf()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Qt(lr),null;case 4:return Xf(),null;case 10:return mT(t.type._context),null;case 22:case 23:return PT(),null;case 24:return null;default:return null}}var mb=!1,zn=!1,uX=typeof WeakSet==\"function\"?WeakSet:Set,Ee=null;function zf(e,t){var n=e.ref;if(n!==null)if(typeof n==\"function\")try{n(null)}catch(i){mr(e,t,i)}else n.current=null}function IO(e,t,n){try{n()}catch(i){mr(e,t,i)}}var z2=!1;function lX(e,t){if(EO=Db,e=jU(),cT(e)){if(\"selectionStart\"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var o=i.anchorOffset,l=i.focusNode;i=i.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var c=0,p=-1,v=-1,m=0,S=0,w=e,C=null;t:for(;;){for(var T;w!==n||o!==0&&w.nodeType!==3||(p=c+o),w!==l||i!==0&&w.nodeType!==3||(v=c+i),w.nodeType===3&&(c+=w.nodeValue.length),(T=w.firstChild)!==null;)C=w,w=T;for(;;){if(w===e)break t;if(C===n&&++m===o&&(p=c),C===l&&++S===i&&(v=c),(T=w.nextSibling)!==null)break;w=C,C=w.parentNode}w=T}n=p===-1||v===-1?null:{start:p,end:v}}else n=null}n=n||{start:0,end:0}}else n=null;for(CO={focusedElem:e,selectionRange:n},Db=!1,Ee=t;Ee!==null;)if(t=Ee,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ee=e;else for(;Ee!==null;){t=Ee;try{var k=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(k!==null){var N=k.memoizedProps,I=k.memoizedState,_=t.stateNode,R=_.getSnapshotBeforeUpdate(t.elementType===t.type?N:Li(t.type,N),I);_.__reactInternalSnapshotBeforeUpdate=R}break;case 3:var A=t.stateNode.containerInfo;A.nodeType===1?A.textContent=\"\":A.nodeType===9&&A.documentElement&&A.removeChild(A.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ae(163))}}catch(F){mr(t,t.return,F)}if(e=t.sibling,e!==null){e.return=t.return,Ee=e;break}Ee=t.return}return k=z2,z2=!1,k}function ph(e,t,n){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var o=i=i.next;do{if((o.tag&e)===e){var l=o.destroy;o.destroy=void 0,l!==void 0&&IO(t,n,l)}o=o.next}while(o!==i)}}function o0(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var i=n.create;n.destroy=i()}n=n.next}while(n!==t)}}function HO(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==\"function\"?t(e):t.current=e}}function PF(e){var t=e.alternate;t!==null&&(e.alternate=null,PF(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[xo],delete t[Rh],delete t[TO],delete t[VK],delete t[$K])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function DF(e){return e.tag===5||e.tag===3||e.tag===4}function q2(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||DF(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function BO(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Lb));else if(i!==4&&(e=e.child,e!==null))for(BO(e,t,n),e=e.sibling;e!==null;)BO(e,t,n),e=e.sibling}function VO(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(VO(e,t,n),e=e.sibling;e!==null;)VO(e,t,n),e=e.sibling}var _n=null,Ui=!1;function ul(e,t,n){for(n=n.child;n!==null;)NF(e,t,n),n=n.sibling}function NF(e,t,n){if(Eo&&typeof Eo.onCommitFiberUnmount==\"function\")try{Eo.onCommitFiberUnmount(Jb,n)}catch{}switch(n.tag){case 5:zn||zf(n,t);case 6:var i=_n,o=Ui;_n=null,ul(e,t,n),_n=i,Ui=o,_n!==null&&(Ui?(e=_n,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):_n.removeChild(n.stateNode));break;case 18:_n!==null&&(Ui?(e=_n,n=n.stateNode,e.nodeType===8?YR(e.parentNode,n):e.nodeType===1&&YR(e,n),_h(e)):YR(_n,n.stateNode));break;case 4:i=_n,o=Ui,_n=n.stateNode.containerInfo,Ui=!0,ul(e,t,n),_n=i,Ui=o;break;case 0:case 11:case 14:case 15:if(!zn&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){o=i=i.next;do{var l=o,c=l.destroy;l=l.tag,c!==void 0&&(l&2||l&4)&&IO(n,t,c),o=o.next}while(o!==i)}ul(e,t,n);break;case 1:if(!zn&&(zf(n,t),i=n.stateNode,typeof i.componentWillUnmount==\"function\"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(p){mr(n,t,p)}ul(e,t,n);break;case 21:ul(e,t,n);break;case 22:n.mode&1?(zn=(i=zn)||n.memoizedState!==null,ul(e,t,n),zn=i):ul(e,t,n);break;default:ul(e,t,n)}}function I2(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new uX),t.forEach(function(i){var o=yX.bind(null,e,i);n.has(i)||(n.add(i),i.then(o,o))})}}function ji(e,t){var n=t.deletions;if(n!==null)for(var i=0;io&&(o=c),i&=~l}if(i=o,i=xr()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*cX(i/1960))-i,10e?16:e,pl===null)var i=!1;else{if(e=pl,pl=null,Qb=0,St&6)throw Error(ae(331));var o=St;for(St|=4,Ee=e.current;Ee!==null;){var l=Ee,c=l.child;if(Ee.flags&16){var p=l.deletions;if(p!==null){for(var v=0;vxr()-AT?Vs(e,0):kT|=n),Sa(e,t)}function HF(e,t){t===0&&(e.mode&1?(t=nb,nb<<=1,!(nb&130023424)&&(nb=4194304)):t=1);var n=ta();e=vu(e,t),e!==null&&(Dh(e,t,n),Sa(e,n))}function mX(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),HF(e,n)}function yX(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(ae(314))}i!==null&&i.delete(t),HF(e,n)}var BF;BF=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ga.current)ya=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ya=!1,aX(e,t,n);ya=!!(e.flags&131072)}else ya=!1,tr&&t.flags&1048576&&WU(t,qb,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;Eb(e,t),e=t.pendingProps;var o=Gf(t,qn.current);$f(t,n),o=xT(null,t,i,e,o,n);var l=ET();return t.flags|=1,typeof o==\"object\"&&o!==null&&typeof o.render==\"function\"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ba(i)?(l=!0,Fb(t)):l=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,gT(t),o.updater=a0,t.stateNode=o,o._reactInternals=t,NO(t,i,e,n),t=UO(null,t,i,!0,l,n)):(t.tag=0,tr&&l&&fT(t),ea(null,t,o,n),t=t.child),t;case 16:i=t.elementType;e:{switch(Eb(e,t),e=t.pendingProps,o=i._init,i=o(i._payload),t.type=i,o=t.tag=bX(i),e=Li(i,e),o){case 0:t=LO(null,t,i,e,n);break e;case 1:t=L2(null,t,i,e,n);break e;case 11:t=N2(null,t,i,e,n);break e;case 14:t=j2(null,t,i,Li(i.type,e),n);break e}throw Error(ae(306,i,\"\"))}return t;case 0:return i=t.type,o=t.pendingProps,o=t.elementType===i?o:Li(i,o),LO(e,t,i,o,n);case 1:return i=t.type,o=t.pendingProps,o=t.elementType===i?o:Li(i,o),L2(e,t,i,o,n);case 3:e:{if(RF(t),e===null)throw Error(ae(387));i=t.pendingProps,l=t.memoizedState,o=l.element,KU(e,t),Bb(t,i,null,n);var c=t.memoizedState;if(i=c.element,l.isDehydrated)if(l={element:i,isDehydrated:!1,cache:c.cache,pendingSuspenseBoundaries:c.pendingSuspenseBoundaries,transitions:c.transitions},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){o=Jf(Error(ae(423)),t),t=U2(e,t,i,n,o);break e}else if(i!==o){o=Jf(Error(ae(424)),t),t=U2(e,t,i,n,o);break e}else for(za=yl(t.stateNode.containerInfo.firstChild),qa=t,tr=!0,Fi=null,n=eF(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Qf(),i===o){t=hu(e,t,n);break e}ea(e,t,i,n)}t=t.child}return t;case 5:return tF(t),e===null&&MO(t),i=t.type,o=t.pendingProps,l=e!==null?e.memoizedProps:null,c=o.children,RO(i,o)?c=null:l!==null&&RO(i,l)&&(t.flags|=32),CF(e,t),ea(e,t,c,n),t.child;case 6:return e===null&&MO(t),null;case 13:return OF(e,t,n);case 4:return bT(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Kf(t,null,i,n):ea(e,t,i,n),t.child;case 11:return i=t.type,o=t.pendingProps,o=t.elementType===i?o:Li(i,o),N2(e,t,i,o,n);case 7:return ea(e,t,t.pendingProps,n),t.child;case 8:return ea(e,t,t.pendingProps.children,n),t.child;case 12:return ea(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(i=t.type._context,o=t.pendingProps,l=t.memoizedProps,c=o.value,It(Ib,i._currentValue),i._currentValue=c,l!==null)if(Ii(l.value,c)){if(l.children===o.children&&!ga.current){t=hu(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var p=l.dependencies;if(p!==null){c=l.child;for(var v=p.firstContext;v!==null;){if(v.context===i){if(l.tag===1){v=fu(-1,n&-n),v.tag=2;var m=l.updateQueue;if(m!==null){m=m.shared;var S=m.pending;S===null?v.next=v:(v.next=S.next,S.next=v),m.pending=v}}l.lanes|=n,v=l.alternate,v!==null&&(v.lanes|=n),PO(l.return,n,t),p.lanes|=n;break}v=v.next}}else if(l.tag===10)c=l.type===t.type?null:l.child;else if(l.tag===18){if(c=l.return,c===null)throw Error(ae(341));c.lanes|=n,p=c.alternate,p!==null&&(p.lanes|=n),PO(c,n,t),c=l.sibling}else c=l.child;if(c!==null)c.return=l;else for(c=l;c!==null;){if(c===t){c=null;break}if(l=c.sibling,l!==null){l.return=c.return,c=l;break}c=c.return}l=c}ea(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,i=t.pendingProps.children,$f(t,n),o=si(o),i=i(o),t.flags|=1,ea(e,t,i,n),t.child;case 14:return i=t.type,o=Li(i,t.pendingProps),o=Li(i.type,o),j2(e,t,i,o,n);case 15:return xF(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,o=t.pendingProps,o=t.elementType===i?o:Li(i,o),Eb(e,t),t.tag=1,ba(i)?(e=!0,Fb(t)):e=!1,$f(t,n),JU(t,i,o),NO(t,i,o,n),UO(null,t,i,!0,e,n);case 19:return TF(e,t,n);case 22:return EF(e,t,n)}throw Error(ae(156,t.tag))};function VF(e,t){return mU(e,t)}function gX(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ui(e,t,n,i){return new gX(e,t,n,i)}function NT(e){return e=e.prototype,!(!e||!e.isReactComponent)}function bX(e){if(typeof e==\"function\")return NT(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ZO)return 11;if(e===eT)return 14}return 2}function _l(e,t){var n=e.alternate;return n===null?(n=ui(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ob(e,t,n,i,o,l){var c=2;if(i=e,typeof e==\"function\")NT(e)&&(c=1);else if(typeof e==\"string\")c=5;else e:switch(e){case Af:return $s(n.children,o,l,t);case JO:c=8,o|=8;break;case aO:return e=ui(12,n,t,o|2),e.elementType=aO,e.lanes=l,e;case iO:return e=ui(13,n,t,o),e.elementType=iO,e.lanes=l,e;case oO:return e=ui(19,n,t,o),e.elementType=oO,e.lanes=l,e;case Z2:return l0(n,o,l,t);default:if(typeof e==\"object\"&&e!==null)switch(e.$$typeof){case X2:c=10;break e;case J2:c=9;break e;case ZO:c=11;break e;case eT:c=14;break e;case ll:c=16,i=null;break e}throw Error(ae(130,e==null?e:typeof e,\"\"))}return t=ui(c,n,t,o),t.elementType=e,t.type=i,t.lanes=l,t}function $s(e,t,n,i){return e=ui(7,e,i,t),e.lanes=n,e}function l0(e,t,n,i){return e=ui(22,e,i,t),e.elementType=Z2,e.lanes=n,e.stateNode={isHidden:!1},e}function tO(e,t,n){return e=ui(6,e,null,t),e.lanes=n,e}function rO(e,t,n){return t=ui(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function SX(e,t,n,i,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zR(0),this.expirationTimes=zR(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zR(0),this.identifierPrefix=i,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function jT(e,t,n,i,o,l,c,p,v){return e=new SX(e,t,n,p,v),t===1?(t=1,l===!0&&(t|=8)):t=0,l=ui(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},gT(l),e}function _X(e,t,n){var i=3{\"use strict\";process.env.NODE_ENV!==\"production\"&&function(){\"use strict\";typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<\"u\"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==\"function\"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=ur(),t=NR(),n=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,i=!1;function o(r){i=r}function l(r){if(!i){for(var a=arguments.length,u=new Array(a>1?a-1:0),s=1;s1?a-1:0),s=1;s2&&(r[0]===\"o\"||r[0]===\"O\")&&(r[1]===\"n\"||r[1]===\"N\")}function _e(r,a,u,s){if(u!==null&&u.type===Hn)return!1;switch(typeof a){case\"function\":case\"symbol\":return!0;case\"boolean\":{if(s)return!1;if(u!==null)return!u.acceptsBooleans;var f=r.toLowerCase().slice(0,5);return f!==\"data-\"&&f!==\"aria-\"}default:return!1}}function Me(r,a,u,s){if(a===null||typeof a>\"u\"||_e(r,a,u,s))return!0;if(s)return!1;if(u!==null)switch(u.type){case vr:return!a;case Bn:return a===!1;case Ta:return isNaN(a);case W:return isNaN(a)||a<1}return!1}function Ge(r){return We.hasOwnProperty(r)?We[r]:null}function Qe(r,a,u,s,f,d,h){this.acceptsBooleans=a===oa||a===vr||a===Bn,this.attributeName=s,this.attributeNamespace=f,this.mustUseProperty=u,this.propertyName=r,this.type=a,this.sanitizeURL=d,this.removeEmptyString=h}var We={},Ut=[\"children\",\"dangerouslySetInnerHTML\",\"defaultValue\",\"defaultChecked\",\"innerHTML\",\"suppressContentEditableWarning\",\"suppressHydrationWarning\",\"style\"];Ut.forEach(function(r){We[r]=new Qe(r,Hn,!1,r,null,!1,!1)}),[[\"acceptCharset\",\"accept-charset\"],[\"className\",\"class\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"]].forEach(function(r){var a=r[0],u=r[1];We[a]=new Qe(a,Dr,!1,u,null,!1,!1)}),[\"contentEditable\",\"draggable\",\"spellCheck\",\"value\"].forEach(function(r){We[r]=new Qe(r,oa,!1,r.toLowerCase(),null,!1,!1)}),[\"autoReverse\",\"externalResourcesRequired\",\"focusable\",\"preserveAlpha\"].forEach(function(r){We[r]=new Qe(r,oa,!1,r,null,!1,!1)}),[\"allowFullScreen\",\"async\",\"autoFocus\",\"autoPlay\",\"controls\",\"default\",\"defer\",\"disabled\",\"disablePictureInPicture\",\"disableRemotePlayback\",\"formNoValidate\",\"hidden\",\"loop\",\"noModule\",\"noValidate\",\"open\",\"playsInline\",\"readOnly\",\"required\",\"reversed\",\"scoped\",\"seamless\",\"itemScope\"].forEach(function(r){We[r]=new Qe(r,vr,!1,r.toLowerCase(),null,!1,!1)}),[\"checked\",\"multiple\",\"muted\",\"selected\"].forEach(function(r){We[r]=new Qe(r,vr,!0,r,null,!1,!1)}),[\"capture\",\"download\"].forEach(function(r){We[r]=new Qe(r,Bn,!1,r,null,!1,!1)}),[\"cols\",\"rows\",\"size\",\"span\"].forEach(function(r){We[r]=new Qe(r,W,!1,r,null,!1,!1)}),[\"rowSpan\",\"start\"].forEach(function(r){We[r]=new Qe(r,Ta,!1,r.toLowerCase(),null,!1,!1)});var _r=/[\\-\\:]([a-z])/g,ka=function(r){return r[1].toUpperCase()};[\"accent-height\",\"alignment-baseline\",\"arabic-form\",\"baseline-shift\",\"cap-height\",\"clip-path\",\"clip-rule\",\"color-interpolation\",\"color-interpolation-filters\",\"color-profile\",\"color-rendering\",\"dominant-baseline\",\"enable-background\",\"fill-opacity\",\"fill-rule\",\"flood-color\",\"flood-opacity\",\"font-family\",\"font-size\",\"font-size-adjust\",\"font-stretch\",\"font-style\",\"font-variant\",\"font-weight\",\"glyph-name\",\"glyph-orientation-horizontal\",\"glyph-orientation-vertical\",\"horiz-adv-x\",\"horiz-origin-x\",\"image-rendering\",\"letter-spacing\",\"lighting-color\",\"marker-end\",\"marker-mid\",\"marker-start\",\"overline-position\",\"overline-thickness\",\"paint-order\",\"panose-1\",\"pointer-events\",\"rendering-intent\",\"shape-rendering\",\"stop-color\",\"stop-opacity\",\"strikethrough-position\",\"strikethrough-thickness\",\"stroke-dasharray\",\"stroke-dashoffset\",\"stroke-linecap\",\"stroke-linejoin\",\"stroke-miterlimit\",\"stroke-opacity\",\"stroke-width\",\"text-anchor\",\"text-decoration\",\"text-rendering\",\"underline-position\",\"underline-thickness\",\"unicode-bidi\",\"unicode-range\",\"units-per-em\",\"v-alphabetic\",\"v-hanging\",\"v-ideographic\",\"v-mathematical\",\"vector-effect\",\"vert-adv-y\",\"vert-origin-x\",\"vert-origin-y\",\"word-spacing\",\"writing-mode\",\"xmlns:xlink\",\"x-height\"].forEach(function(r){var a=r.replace(_r,ka);We[a]=new Qe(a,Dr,!1,r,null,!1,!1)}),[\"xlink:actuate\",\"xlink:arcrole\",\"xlink:role\",\"xlink:show\",\"xlink:title\",\"xlink:type\"].forEach(function(r){var a=r.replace(_r,ka);We[a]=new Qe(a,Dr,!1,r,\"http://www.w3.org/1999/xlink\",!1,!1)}),[\"xml:base\",\"xml:lang\",\"xml:space\"].forEach(function(r){var a=r.replace(_r,ka);We[a]=new Qe(a,Dr,!1,r,\"http://www.w3.org/XML/1998/namespace\",!1,!1)}),[\"tabIndex\",\"crossOrigin\"].forEach(function(r){We[r]=new Qe(r,Dr,!1,r.toLowerCase(),null,!1,!1)});var to=\"xlinkHref\";We[to]=new Qe(\"xlinkHref\",Dr,!1,\"xlink:href\",\"http://www.w3.org/1999/xlink\",!0,!1),[\"src\",\"href\",\"action\",\"formAction\"].forEach(function(r){We[r]=new Qe(r,Dr,!1,r.toLowerCase(),null,!0,!0)});var ro=/^[\\u0000-\\u001F ]*j[\\r\\n\\t]*a[\\r\\n\\t]*v[\\r\\n\\t]*a[\\r\\n\\t]*s[\\r\\n\\t]*c[\\r\\n\\t]*r[\\r\\n\\t]*i[\\r\\n\\t]*p[\\r\\n\\t]*t[\\r\\n\\t]*\\:/i,Cr=!1;function ua(r){!Cr&&ro.test(r)&&(Cr=!0,c(\"A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.\",JSON.stringify(r)))}function no(r,a,u,s){if(s.mustUseProperty){var f=s.propertyName;return r[f]}else{ar(u,a),s.sanitizeURL&&ua(\"\"+u);var d=s.attributeName,h=null;if(s.type===Bn){if(r.hasAttribute(d)){var y=r.getAttribute(d);return y===\"\"?!0:Me(a,u,s,!1)?y:y===\"\"+u?u:y}}else if(r.hasAttribute(d)){if(Me(a,u,s,!1))return r.getAttribute(d);if(s.type===vr)return u;h=r.getAttribute(d)}return Me(a,u,s,!1)?h===null?u:h:h===\"\"+u?u:h}}function ao(r,a,u,s){{if(!Ae(a))return;if(!r.hasAttribute(a))return u===void 0?void 0:null;var f=r.getAttribute(a);return ar(u,a),f===\"\"+u?u:f}}function Ga(r,a,u,s){var f=Ge(a);if(!ye(a,f,s)){if(Me(a,u,f,s)&&(u=null),s||f===null){if(Ae(a)){var d=a;u===null?r.removeAttribute(d):(ar(u,a),r.setAttribute(d,\"\"+u))}return}var h=f.mustUseProperty;if(h){var y=f.propertyName;if(u===null){var g=f.type;r[y]=g===vr?!1:\"\"}else r[y]=u;return}var E=f.attributeName,O=f.attributeNamespace;if(u===null)r.removeAttribute(E);else{var U=f.type,L;U===vr||U===Bn&&u===!0?L=\"\":(ar(u,E),L=\"\"+u,f.sanitizeURL&&ua(L.toString())),O?r.setAttributeNS(O,E,L):r.setAttribute(E,L)}}}var Vn=Symbol.for(\"react.element\"),vt=Symbol.for(\"react.portal\"),Zt=Symbol.for(\"react.fragment\"),$n=Symbol.for(\"react.strict_mode\"),P=Symbol.for(\"react.profiler\"),Q=Symbol.for(\"react.provider\"),le=Symbol.for(\"react.context\"),Ne=Symbol.for(\"react.forward_ref\"),Ze=Symbol.for(\"react.suspense\"),mt=Symbol.for(\"react.suspense_list\"),Xe=Symbol.for(\"react.memo\"),Le=Symbol.for(\"react.lazy\"),Nr=Symbol.for(\"react.scope\"),$t=Symbol.for(\"react.debug_trace_mode\"),Wt=Symbol.for(\"react.offscreen\"),kn=Symbol.for(\"react.legacy_hidden\"),io=Symbol.for(\"react.cache\"),wc=Symbol.for(\"react.tracing_marker\"),la=Symbol.iterator,ux=\"@@iterator\";function Lo(r){if(r===null||typeof r!=\"object\")return null;var a=la&&r[la]||r[ux];return typeof a==\"function\"?a:null}var Je=Object.assign,ku=0,ap,ip,op,up,lp,sp,cp;function Dm(){}Dm.__reactDisabledLog=!0;function lx(){{if(ku===0){ap=console.log,ip=console.info,op=console.warn,up=console.error,lp=console.group,sp=console.groupCollapsed,cp=console.groupEnd;var r={configurable:!0,enumerable:!0,value:Dm,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}ku++}}function fp(){{if(ku--,ku===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Je({},r,{value:ap}),info:Je({},r,{value:ip}),warn:Je({},r,{value:op}),error:Je({},r,{value:up}),group:Je({},r,{value:lp}),groupCollapsed:Je({},r,{value:sp}),groupEnd:Je({},r,{value:cp})})}ku<0&&c(\"disabledDepth fell below zero. This is a bug in React. Please file an issue.\")}}var us=n.ReactCurrentDispatcher,Au;function Qa(r,a,u){{if(Au===void 0)try{throw Error()}catch(f){var s=f.stack.trim().match(/\\n( *(at )?)/);Au=s&&s[1]||\"\"}return`\n`+Au+r}}var Mu=!1,xc;{var Nm=typeof WeakMap==\"function\"?WeakMap:Map;xc=new Nm}function dp(r,a){if(!r||Mu)return\"\";{var u=xc.get(r);if(u!==void 0)return u}var s;Mu=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var d;d=us.current,us.current=null,lx();try{if(a){var h=function(){throw Error()};if(Object.defineProperty(h.prototype,\"props\",{set:function(){throw Error()}}),typeof Reflect==\"object\"&&Reflect.construct){try{Reflect.construct(h,[])}catch(B){s=B}Reflect.construct(r,[],h)}else{try{h.call()}catch(B){s=B}r.call(h.prototype)}}else{try{throw Error()}catch(B){s=B}r()}}catch(B){if(B&&s&&typeof B.stack==\"string\"){for(var y=B.stack.split(`\n`),g=s.stack.split(`\n`),E=y.length-1,O=g.length-1;E>=1&&O>=0&&y[E]!==g[O];)O--;for(;E>=1&&O>=0;E--,O--)if(y[E]!==g[O]){if(E!==1||O!==1)do if(E--,O--,O<0||y[E]!==g[O]){var U=`\n`+y[E].replace(\" at new \",\" at \");return r.displayName&&U.includes(\"\")&&(U=U.replace(\"\",r.displayName)),typeof r==\"function\"&&xc.set(r,U),U}while(E>=1&&O>=0);break}}}finally{Mu=!1,us.current=d,fp(),Error.prepareStackTrace=f}var L=r?r.displayName||r.name:\"\",$=L?Qa(L):\"\";return typeof r==\"function\"&&xc.set(r,$),$}function sx(r,a,u){return dp(r,!0)}function Pu(r,a,u){return dp(r,!1)}function jm(r){var a=r.prototype;return!!(a&&a.isReactComponent)}function Ec(r,a,u){if(r==null)return\"\";if(typeof r==\"function\")return dp(r,jm(r));if(typeof r==\"string\")return Qa(r);switch(r){case Ze:return Qa(\"Suspense\");case mt:return Qa(\"SuspenseList\")}if(typeof r==\"object\")switch(r.$$typeof){case Ne:return Pu(r.render);case Xe:return Ec(r.type,a,u);case Le:{var s=r,f=s._payload,d=s._init;try{return Ec(d(f),a,u)}catch{}}}return\"\"}function Cc(r){var a=r._debugOwner?r._debugOwner.type:null,u=r._debugSource;switch(r.tag){case T:return Qa(r.type);case Se:return Qa(\"Lazy\");case G:return Qa(\"Suspense\");case dt:return Qa(\"SuspenseList\");case v:case S:case re:return Pu(r.type);case A:return Pu(r.type.render);case m:return sx(r.type);default:return\"\"}}function Lm(r){try{var a=\"\",u=r;do a+=Cc(u),u=u.return;while(u);return a}catch(s){return`\nError generating stack: `+s.message+`\n`+s.stack}}function Du(r,a,u){var s=r.displayName;if(s)return s;var f=a.displayName||a.name||\"\";return f!==\"\"?u+\"(\"+f+\")\":u}function Rc(r){return r.displayName||\"Context\"}function Tt(r){if(r==null)return null;if(typeof r.tag==\"number\"&&c(\"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"),typeof r==\"function\")return r.displayName||r.name||null;if(typeof r==\"string\")return r;switch(r){case Zt:return\"Fragment\";case vt:return\"Portal\";case P:return\"Profiler\";case $n:return\"StrictMode\";case Ze:return\"Suspense\";case mt:return\"SuspenseList\"}if(typeof r==\"object\")switch(r.$$typeof){case le:var a=r;return Rc(a)+\".Consumer\";case Q:var u=r;return Rc(u._context)+\".Provider\";case Ne:return Du(r,r.render,\"ForwardRef\");case Xe:var s=r.displayName||null;return s!==null?s:Tt(r.type)||\"Memo\";case Le:{var f=r,d=f._payload,h=f._init;try{return Tt(h(d))}catch{return null}}}return null}function cx(r,a,u){var s=a.displayName||a.name||\"\";return r.displayName||(s!==\"\"?u+\"(\"+s+\")\":u)}function Um(r){return r.displayName||\"Context\"}function Ye(r){var a=r.tag,u=r.type;switch(a){case Re:return\"Cache\";case _:var s=u;return Um(s)+\".Consumer\";case R:var f=u;return Um(f._context)+\".Provider\";case De:return\"DehydratedFragment\";case A:return cx(u,u.render,\"ForwardRef\");case N:return\"Fragment\";case T:return u;case C:return\"Portal\";case w:return\"Root\";case k:return\"Text\";case Se:return Tt(u);case I:return u===$n?\"StrictMode\":\"Mode\";case Pe:return\"Offscreen\";case F:return\"Profiler\";case rt:return\"Scope\";case G:return\"Suspense\";case dt:return\"SuspenseList\";case Mt:return\"TracingMarker\";case m:case v:case we:case S:case te:case re:if(typeof u==\"function\")return u.displayName||u.name||null;if(typeof u==\"string\")return u;break}return null}var Fm=n.ReactDebugCurrentFrame,An=null,Nu=!1;function ju(){{if(An===null)return null;var r=An._debugOwner;if(r!==null&&typeof r<\"u\")return Ye(r)}return null}function fx(){return An===null?\"\":Lm(An)}function Jr(){Fm.getCurrentStack=null,An=null,Nu=!1}function er(r){Fm.getCurrentStack=r===null?null:fx,An=r,Nu=!1}function dx(){return An}function Ka(r){Nu=r}function sa(r){return\"\"+r}function bi(r){switch(typeof r){case\"boolean\":case\"number\":case\"string\":case\"undefined\":return r;case\"object\":return Sr(r),r;default:return\"\"}}var Oc={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0};function pp(r,a){Oc[a.type]||a.onChange||a.onInput||a.readOnly||a.disabled||a.value==null||c(\"You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.\"),a.onChange||a.readOnly||a.disabled||a.checked==null||c(\"You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.\")}function Uo(r){var a=r.type,u=r.nodeName;return u&&u.toLowerCase()===\"input\"&&(a===\"checkbox\"||a===\"radio\")}function vp(r){return r._valueTracker}function px(r){r._valueTracker=null}function Tc(r){var a=\"\";return r&&(Uo(r)?a=r.checked?\"true\":\"false\":a=r.value),a}function hp(r){var a=Uo(r)?\"checked\":\"value\",u=Object.getOwnPropertyDescriptor(r.constructor.prototype,a);Sr(r[a]);var s=\"\"+r[a];if(!(r.hasOwnProperty(a)||typeof u>\"u\"||typeof u.get!=\"function\"||typeof u.set!=\"function\")){var f=u.get,d=u.set;Object.defineProperty(r,a,{configurable:!0,get:function(){return f.call(this)},set:function(y){Sr(y),s=\"\"+y,d.call(this,y)}}),Object.defineProperty(r,a,{enumerable:u.enumerable});var h={getValue:function(){return s},setValue:function(y){Sr(y),s=\"\"+y},stopTracking:function(){px(r),delete r[a]}};return h}}function Lu(r){vp(r)||(r._valueTracker=hp(r))}function kc(r){if(!r)return!1;var a=vp(r);if(!a)return!0;var u=a.getValue(),s=Tc(r);return s!==u?(a.setValue(s),!0):!1}function Ac(r){if(r=r||(typeof document<\"u\"?document:void 0),typeof r>\"u\")return null;try{return r.activeElement||r.body}catch{return r.body}}var zm=!1,qm=!1,Im=!1,b=!1;function D(r){var a=r.type===\"checkbox\"||r.type===\"radio\";return a?r.checked!=null:r.value!=null}function V(r,a){var u=r,s=a.checked,f=Je({},a,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??u._wrapperState.initialChecked});return f}function K(r,a){pp(\"input\",a),a.checked!==void 0&&a.defaultChecked!==void 0&&!qm&&(c(\"%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components\",ju()||\"A component\",a.type),qm=!0),a.value!==void 0&&a.defaultValue!==void 0&&!zm&&(c(\"%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components\",ju()||\"A component\",a.type),zm=!0);var u=r,s=a.defaultValue==null?\"\":a.defaultValue;u._wrapperState={initialChecked:a.checked!=null?a.checked:a.defaultChecked,initialValue:bi(a.value!=null?a.value:s),controlled:D(a)}}function oe(r,a){var u=r,s=a.checked;s!=null&&Ga(u,\"checked\",s,!1)}function Ue(r,a){var u=r;{var s=D(a);!u._wrapperState.controlled&&s&&!b&&(c(\"A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components\"),b=!0),u._wrapperState.controlled&&!s&&!Im&&(c(\"A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components\"),Im=!0)}oe(r,a);var f=bi(a.value),d=a.type;if(f!=null)d===\"number\"?(f===0&&u.value===\"\"||u.value!=f)&&(u.value=sa(f)):u.value!==sa(f)&&(u.value=sa(f));else if(d===\"submit\"||d===\"reset\"){u.removeAttribute(\"value\");return}a.hasOwnProperty(\"value\")?xt(u,a.type,f):a.hasOwnProperty(\"defaultValue\")&&xt(u,a.type,bi(a.defaultValue)),a.checked==null&&a.defaultChecked!=null&&(u.defaultChecked=!!a.defaultChecked)}function Ce(r,a,u){var s=r;if(a.hasOwnProperty(\"value\")||a.hasOwnProperty(\"defaultValue\")){var f=a.type,d=f===\"submit\"||f===\"reset\";if(d&&(a.value===void 0||a.value===null))return;var h=sa(s._wrapperState.initialValue);u||h!==s.value&&(s.value=h),s.defaultValue=h}var y=s.name;y!==\"\"&&(s.name=\"\"),s.defaultChecked=!s.defaultChecked,s.defaultChecked=!!s._wrapperState.initialChecked,y!==\"\"&&(s.name=y)}function $e(r,a){var u=r;Ue(u,a),ut(u,a)}function ut(r,a){var u=a.name;if(a.type===\"radio\"&&u!=null){for(var s=r;s.parentNode;)s=s.parentNode;ar(u,\"name\");for(var f=s.querySelectorAll(\"input[name=\"+JSON.stringify(\"\"+u)+'][type=\"radio\"]'),d=0;d.\")))}):a.dangerouslySetInnerHTML!=null&&(Ft||(Ft=!0,c(\"Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected.\")))),a.selected!=null&&!Pt&&(c(\"Use the `defaultValue` or `value` props on must be a scalar value if `multiple` is false.%s\",u,Hm())}}}}function Fo(r,a,u,s){var f=r.options;if(a){for(var d=u,h={},y=0;y.\");var s=Je({},a,{value:void 0,defaultValue:void 0,children:sa(u._wrapperState.initialValue)});return s}function cM(r,a){var u=r;pp(\"textarea\",a),a.value!==void 0&&a.defaultValue!==void 0&&!sM&&(c(\"%s contains a textarea with both value and defaultValue props. Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://reactjs.org/link/controlled-components\",ju()||\"A component\"),sM=!0);var s=a.value;if(s==null){var f=a.children,d=a.defaultValue;if(f!=null){c(\"Use the `defaultValue` or `value` props instead of setting children on