@coti-io/coti-snap 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +173 -0
- package/dist/bundle.js +1 -0
- package/images/default-token.svg +18 -0
- package/images/default.svg +9 -0
- package/images/icon.svg +18 -0
- package/images/logo.svg +10 -0
- package/images/receive.svg +4 -0
- package/images/send.svg +4 -0
- package/package.json +90 -0
- package/snap.manifest.json +34 -0
package/dist/bundle.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{var e={18:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Mnemonic=void 0;const n=r(6468),i=r(8718),s=r(3318);function a(e){return(1<<e)-1<<8-e&255}function o(e){return(1<<e)-1&255}function c(e,t){(0,i.assertNormalize)("NFKD"),null==t&&(t=s.LangEn.wordlist());const r=t.split(e);(0,i.assertArgument)(r.length%3==0&&r.length>=12&&r.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const o=new Uint8Array(Math.ceil(11*r.length/8));let c=0;for(let e=0;e<r.length;e++){let n=t.getWordIndex(r[e].normalize("NFKD"));(0,i.assertArgument)(n>=0,`invalid mnemonic word at index ${e}`,"mnemonic","[ REDACTED ]");for(let e=0;e<11;e++)n&1<<10-e&&(o[c>>3]|=1<<7-c%8),c++}const u=32*r.length/3,l=a(r.length/3),h=(0,i.getBytes)((0,n.sha256)(o.slice(0,u/8)))[0]&l;return(0,i.assertArgument)(h===(o[o.length-1]&l),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),(0,i.hexlify)(o.slice(0,u/8))}function u(e,t){(0,i.assertArgument)(e.length%4==0&&e.length>=16&&e.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),null==t&&(t=s.LangEn.wordlist());const r=[0];let c=11;for(let t=0;t<e.length;t++)c>8?(r[r.length-1]<<=8,r[r.length-1]|=e[t],c-=8):(r[r.length-1]<<=c,r[r.length-1]|=e[t]>>8-c,r.push(e[t]&o(8-c)),c+=3);const u=e.length/4,l=parseInt((0,n.sha256)(e).substring(2,4),16)&a(u);return r[r.length-1]<<=u,r[r.length-1]|=l>>8-u,t.join(r.map(e=>t.getWord(e)))}const l={};class h{phrase;password;wordlist;entropy;constructor(e,t,r,n,a){null==n&&(n=""),null==a&&(a=s.LangEn.wordlist()),(0,i.assertPrivate)(e,l,"Mnemonic"),(0,i.defineProperties)(this,{phrase:r,password:n,wordlist:a,entropy:t})}computeSeed(){const e=(0,i.toUtf8Bytes)("mnemonic"+this.password,"NFKD");return(0,n.pbkdf2)((0,i.toUtf8Bytes)(this.phrase,"NFKD"),e,2048,64,"sha512")}static fromPhrase(e,t,r){const n=c(e,r);return e=u((0,i.getBytes)(n),r),new h(l,n,e,t,r)}static fromEntropy(e,t,r){const n=(0,i.getBytes)(e,"entropy"),s=u(n,r);return new h(l,(0,i.hexlify)(n),s,t,r)}static entropyToPhrase(e,t){return u((0,i.getBytes)(e,"entropy"),t)}static phraseToEntropy(e,t){return c(e,t)}static isValidMnemonic(e,t){try{return c(e,t),!0}catch(e){}return!1}}t.Mnemonic=h},24:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JsonRpcProvider=t.JsonRpcApiPollingProvider=t.JsonRpcApiProvider=t.JsonRpcSigner=void 0;const n=r(333),i=r(6107),s=r(7477),a=r(203),o=r(8718),c=r(3633),u=r(5774),l=r(4391),h=r(5263),d=r(5737),f="bigint,boolean,function,number,string,symbol".split(/,/g);function p(e){if(null==e||f.indexOf(typeof e)>=0)return e;if("function"==typeof e.getAddress)return e;if(Array.isArray(e))return e.map(p);if("object"==typeof e)return Object.keys(e).reduce((t,r)=>(t[r]=e[r],t),{});throw new Error(`should not happen: ${e} (${typeof e})`)}function g(e){return new Promise(t=>{setTimeout(t,e)})}function y(e){return e?e.toLowerCase():e}function m(e){return e&&"number"==typeof e.pollingInterval}const b={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class w extends u.AbstractSigner{address;constructor(e,t){super(e),t=(0,i.getAddress)(t),(0,o.defineProperties)(this,{address:t})}connect(e){(0,o.assert)(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(e){return await this.populateCall(e)}async sendUncheckedTransaction(e){const t=p(e),r=[];if(t.from){const n=t.from;r.push((async()=>{const r=await(0,i.resolveAddress)(n,this.provider);(0,o.assertArgument)(null!=r&&r.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),t.from=r})())}else t.from=this.address;if(null==t.gasLimit&&r.push((async()=>{t.gasLimit=await this.provider.estimateGas({...t,from:this.address})})()),null!=t.to){const e=t.to;r.push((async()=>{t.to=await(0,i.resolveAddress)(e,this.provider)})())}r.length&&await Promise.all(r);const n=this.provider.getRpcTransaction(t);return this.provider.send("eth_sendTransaction",[n])}async sendTransaction(e){const t=await this.provider.getBlockNumber(),r=await this.sendUncheckedTransaction(e);return await new Promise((e,n)=>{const i=[1e3,100];let s=0;const a=async()=>{try{const n=await this.provider.getTransaction(r);if(null!=n)return void e(n.replaceableTransaction(t))}catch(e){if((0,o.isError)(e,"CANCELLED")||(0,o.isError)(e,"BAD_DATA")||(0,o.isError)(e,"NETWORK_ERROR")||(0,o.isError)(e,"UNSUPPORTED_OPERATION"))return null==e.info&&(e.info={}),e.info.sendTransactionHash=r,void n(e);if((0,o.isError)(e,"INVALID_ARGUMENT")&&(s++,null==e.info&&(e.info={}),e.info.sendTransactionHash=r,s>10))return void n(e);this.provider.emit("error",(0,o.makeError)("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:e}))}this.provider._setTimeout(()=>{a()},i.pop()||4e3)};a()})}async signTransaction(e){const t=p(e);if(t.from){const r=await(0,i.resolveAddress)(t.from,this.provider);(0,o.assertArgument)(null!=r&&r.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),t.from=r}else t.from=this.address;const r=this.provider.getRpcTransaction(t);return await this.provider.send("eth_signTransaction",[r])}async signMessage(e){const t="string"==typeof e?(0,o.toUtf8Bytes)(e):e;return await this.provider.send("personal_sign",[(0,o.hexlify)(t),this.address.toLowerCase()])}async signTypedData(e,t,r){const n=p(r),a=await s.TypedDataEncoder.resolveNames(e,t,n,async e=>{const t=await(0,i.resolveAddress)(e);return(0,o.assertArgument)(null!=t,"TypedData does not support null address","value",e),t});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(s.TypedDataEncoder.getPayload(a.domain,t,a.value))])}async unlock(e){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),e,null])}async _legacySignMessage(e){const t="string"==typeof e?(0,o.toUtf8Bytes)(e):e;return await this.provider.send("eth_sign",[this.address.toLowerCase(),(0,o.hexlify)(t)])}}t.JsonRpcSigner=w;class v extends c.AbstractProvider{#e;#t;#r;#n;#i;#s;#a;#o(){if(this.#n)return;const e=1===this._getOption("batchMaxCount")?0:this._getOption("batchStallTime");this.#n=setTimeout(()=>{this.#n=null;const e=this.#r;for(this.#r=[];e.length;){const t=[e.shift()];for(;e.length&&t.length!==this.#e.batchMaxCount;){t.push(e.shift());if(JSON.stringify(t.map(e=>e.payload)).length>this.#e.batchMaxSize){e.unshift(t.pop());break}}(async()=>{const e=1===t.length?t[0].payload:t.map(e=>e.payload);this.emit("debug",{action:"sendRpcPayload",payload:e});try{const r=await this._send(e);this.emit("debug",{action:"receiveRpcResult",result:r});for(const{resolve:e,reject:n,payload:i}of t){if(this.destroyed){n((0,o.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:i.method}));continue}const t=r.filter(e=>e.id===i.id)[0];if(null==t){const e=(0,o.makeError)("missing response for request","BAD_DATA",{value:r,info:{payload:i}});this.emit("error",e),n(e);continue}"error"in t?n(this.getRpcError(i,t)):e(t.result)}}catch(e){this.emit("debug",{action:"receiveRpcError",error:e});for(const{reject:r}of t)r(e)}})()}},e)}constructor(e,t){super(e,t),this.#t=1,this.#e=Object.assign({},b,t||{}),this.#r=[],this.#n=null,this.#s=null,this.#a=null;{let e=null;const t=new Promise(t=>{e=t});this.#i={promise:t,resolve:e}}const r=this._getOption("staticNetwork");"boolean"==typeof r?((0,o.assertArgument)(!r||"any"!==e,"staticNetwork cannot be used on special network 'any'","options",t),r&&null!=e&&(this.#s=l.Network.from(e))):r&&((0,o.assertArgument)(null==e||r.matches(e),"staticNetwork MUST match network object","options",t),this.#s=r)}_getOption(e){return this.#e[e]}get _network(){return(0,o.assert)(this.#s,"network is not available yet","NETWORK_ERROR"),this.#s}async _perform(e){if("call"===e.method||"estimateGas"===e.method){let t=e.transaction;if(t&&null!=t.type&&(0,o.getBigInt)(t.type)&&null==t.maxFeePerGas&&null==t.maxPriorityFeePerGas){const r=await this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&(e=Object.assign({},e,{transaction:Object.assign({},t,{type:void 0})}))}}const t=this.getRpcRequest(e);return null!=t?await this.send(t.method,t.args):super._perform(e)}async _detectNetwork(){const e=this._getOption("staticNetwork");if(e){if(!0!==e)return e;if(this.#s)return this.#s}return this.#a?await this.#a:this.ready?(this.#a=(async()=>{try{const e=l.Network.from((0,o.getBigInt)(await this.send("eth_chainId",[])));return this.#a=null,e}catch(e){throw this.#a=null,e}})(),await this.#a):(this.#a=(async()=>{const e={id:this.#t++,method:"eth_chainId",params:[],jsonrpc:"2.0"};let t;this.emit("debug",{action:"sendRpcPayload",payload:e});try{t=(await this._send(e))[0],this.#a=null}catch(e){throw this.#a=null,this.emit("debug",{action:"receiveRpcError",error:e}),e}if(this.emit("debug",{action:"receiveRpcResult",result:t}),"result"in t)return l.Network.from((0,o.getBigInt)(t.result));throw this.getRpcError(e,t)})(),await this.#a)}_start(){null!=this.#i&&null!=this.#i.resolve&&(this.#i.resolve(),this.#i=null,(async()=>{for(;null==this.#s&&!this.destroyed;)try{this.#s=await this._detectNetwork()}catch(e){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",(0,o.makeError)("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:e}})),await g(1e3)}this.#o()})())}async _waitUntilReady(){if(null!=this.#i)return await this.#i.promise}_getSubscriber(e){return"pending"===e.type?new h.FilterIdPendingSubscriber(this):"event"===e.type?this._getOption("polling")?new d.PollingEventSubscriber(this,e.filter):new h.FilterIdEventSubscriber(this,e.filter):"orphan"===e.type&&"drop-log"===e.filter.orphan?new c.UnmanagedSubscriber("orphan"):super._getSubscriber(e)}get ready(){return null==this.#i}getRpcTransaction(e){const t={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(r=>{if(null==e[r])return;let n=r;"gasLimit"===r&&(n="gas"),t[n]=(0,o.toQuantity)((0,o.getBigInt)(e[r],`tx.${r}`))}),["from","to","data"].forEach(r=>{null!=e[r]&&(t[r]=(0,o.hexlify)(e[r]))}),e.accessList&&(t.accessList=(0,a.accessListify)(e.accessList)),e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes.map(e=>e.toLowerCase())),e.authorizationList&&(t.authorizationList=e.authorizationList.map(e=>{const t=(0,a.authorizationify)(e);return{address:t.address,nonce:(0,o.toQuantity)(t.nonce),chainId:(0,o.toQuantity)(t.chainId),yParity:(0,o.toQuantity)(t.signature.yParity),r:(0,o.toQuantity)(t.signature.r),s:(0,o.toQuantity)(t.signature.s)}})),t}getRpcRequest(e){switch(e.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[y(e.address),e.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[y(e.address),e.blockTag]};case"getCode":return{method:"eth_getCode",args:[y(e.address),e.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[y(e.address),"0x"+e.position.toString(16),e.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[e.signedTransaction]};case"getBlock":if("blockTag"in e)return{method:"eth_getBlockByNumber",args:[e.blockTag,!!e.includeTransactions]};if("blockHash"in e)return{method:"eth_getBlockByHash",args:[e.blockHash,!!e.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[e.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[e.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(e.transaction),e.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(e.transaction)]};case"getLogs":return e.filter&&null!=e.filter.address&&(Array.isArray(e.filter.address)?e.filter.address=e.filter.address.map(y):e.filter.address=y(e.filter.address)),{method:"eth_getLogs",args:[e.filter]}}return null}getRpcError(e,t){const{method:r}=e,{error:i}=t;if("eth_estimateGas"===r&&i.message){const t=i.message;if(!t.match(/revert/i)&&t.match(/insufficient funds/i))return(0,o.makeError)("insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.params[0],info:{payload:e,error:i}});if(t.match(/nonce/i)&&t.match(/too low/i))return(0,o.makeError)("nonce has already been used","NONCE_EXPIRED",{transaction:e.params[0],info:{payload:e,error:i}})}if("eth_call"===r||"eth_estimateGas"===r){const t=E(i),s=n.AbiCoder.getBuiltinCallException("eth_call"===r?"call":"estimateGas",e.params[0],t?t.data:null);return s.info={error:i,payload:e},s}const s=JSON.stringify(function(e){const t=[];return C(e,t),t}(i));if("string"==typeof i.message&&i.message.match(/user denied|ethers-user-denied/i)){const t={eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"};return(0,o.makeError)("user rejected action","ACTION_REJECTED",{action:t[r]||"unknown",reason:"rejected",info:{payload:e,error:i}})}if("eth_sendRawTransaction"===r||"eth_sendTransaction"===r){const t=e.params[0];if(s.match(/insufficient funds|base fee exceeds gas limit/i))return(0,o.makeError)("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:t,info:{error:i}});if(s.match(/nonce/i)&&s.match(/too low/i))return(0,o.makeError)("nonce has already been used","NONCE_EXPIRED",{transaction:t,info:{error:i}});if(s.match(/replacement transaction/i)&&s.match(/underpriced/i))return(0,o.makeError)("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:t,info:{error:i}});if(s.match(/only replay-protected/i))return(0,o.makeError)("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:r,info:{transaction:t,info:{error:i}}})}let a=!!s.match(/the method .* does not exist/i);return a||i&&i.details&&i.details.startsWith("Unauthorized method:")&&(a=!0),a?(0,o.makeError)("unsupported operation","UNSUPPORTED_OPERATION",{operation:e.method,info:{error:i,payload:e}}):(0,o.makeError)("could not coalesce error","UNKNOWN_ERROR",{error:i,payload:e})}send(e,t){if(this.destroyed)return Promise.reject((0,o.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e}));const r=this.#t++,n=new Promise((n,i)=>{this.#r.push({resolve:n,reject:i,payload:{method:e,params:t,id:r,jsonrpc:"2.0"}})});return this.#o(),n}async getSigner(e){null==e&&(e=0);const t=this.send("eth_accounts",[]);if("number"==typeof e){const r=await t;if(e>=r.length)throw new Error("no such account");return new w(this,r[e])}const{accounts:r}=await(0,o.resolveProperties)({network:this.getNetwork(),accounts:t});e=(0,i.getAddress)(e);for(const t of r)if((0,i.getAddress)(t)===e)return new w(this,e);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(e=>new w(this,e))}destroy(){this.#n&&(clearTimeout(this.#n),this.#n=null);for(const{payload:e,reject:t}of this.#r)t((0,o.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e.method}));this.#r=[],super.destroy()}}t.JsonRpcApiProvider=v;class A extends v{#c;constructor(e,t){super(e,t);let r=this._getOption("pollingInterval");null==r&&(r=b.pollingInterval),this.#c=r}_getSubscriber(e){const t=super._getSubscriber(e);return m(t)&&(t.pollingInterval=this.#c),t}get pollingInterval(){return this.#c}set pollingInterval(e){if(!Number.isInteger(e)||e<0)throw new Error("invalid interval");this.#c=e,this._forEachSubscriber(e=>{m(e)&&(e.pollingInterval=this.#c)})}}t.JsonRpcApiPollingProvider=A;function E(e){if(null==e)return null;if("string"==typeof e.message&&e.message.match(/revert/i)&&(0,o.isHexString)(e.data))return{message:e.message,data:e.data};if("object"==typeof e){for(const t in e){const r=E(e[t]);if(r)return r}return null}if("string"==typeof e)try{return E(JSON.parse(e))}catch(e){}return null}function C(e,t){if(null!=e){if("string"==typeof e.message&&t.push(e.message),"object"==typeof e)for(const r in e)C(e[r],t);if("string"==typeof e)try{return C(JSON.parse(e),t)}catch(e){}}}t.JsonRpcProvider=class extends A{#u;constructor(e,t,r){null==e&&(e="http://localhost:8545"),super(t,r),this.#u="string"==typeof e?new o.FetchRequest(e):e.clone()}_getConnection(){return this.#u.clone()}async send(e,t){return await this._start(),await super.send(e,t)}async _send(e){const t=this._getConnection();t.body=JSON.stringify(e),t.setHeader("content-type","application/json");const r=await t.send();r.assertOk();let n=r.bodyJson;return Array.isArray(n)||(n=[n]),n}}},81:(e,t,r)=>{var n=r(4643);r(9679),r(8550),(e.exports=n.hmac=n.hmac||{}).create=function(){var e=null,t=null,r=null,i=null,s={start:function(s,a){if(null!==s)if("string"==typeof s){if(!((s=s.toLowerCase())in n.md.algorithms))throw new Error('Unknown hash algorithm "'+s+'"');t=n.md.algorithms[s].create()}else t=s;if(null===a)a=e;else{if("string"==typeof a)a=n.util.createBuffer(a);else if(n.util.isArray(a)){var o=a;a=n.util.createBuffer();for(var c=0;c<o.length;++c)a.putByte(o[c])}var u=a.length();u>t.blockLength&&(t.start(),t.update(a.bytes()),a=t.digest()),r=n.util.createBuffer(),i=n.util.createBuffer(),u=a.length();for(c=0;c<u;++c){o=a.at(c);r.putByte(54^o),i.putByte(92^o)}if(u<t.blockLength)for(o=t.blockLength-u,c=0;c<o;++c)r.putByte(54),i.putByte(92);e=a,r=r.bytes(),i=i.bytes()}t.start(),t.update(r)},update:function(e){t.update(e)},getMac:function(){var e=t.digest().bytes();return t.start(),t.update(i),t.update(e),t.digest()}};return s.digest=s.getMac,s}},121:(e,t,r)=>{var n,i=r(4643);e.exports=i.jsbn=i.jsbn||{};function s(e,t,r){this.data=[],null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function a(){return new s(null)}function o(e,t,r,n,i,s){for(var a=16383&t,o=t>>14;--s>=0;){var c=16383&this.data[e],u=this.data[e++]>>14,l=o*c+u*a;i=((c=a*c+((16383&l)<<14)+r.data[n]+i)>>28)+(l>>14)+o*u,r.data[n++]=268435455&c}return i}i.jsbn.BigInteger=s,"undefined"==typeof navigator?(s.prototype.am=o,n=28):"Microsoft Internet Explorer"==navigator.appName?(s.prototype.am=function(e,t,r,n,i,s){for(var a=32767&t,o=t>>15;--s>=0;){var c=32767&this.data[e],u=this.data[e++]>>15,l=o*c+u*a;i=((c=a*c+((32767&l)<<15)+r.data[n]+(1073741823&i))>>>30)+(l>>>15)+o*u+(i>>>30),r.data[n++]=1073741823&c}return i},n=30):"Netscape"!=navigator.appName?(s.prototype.am=function(e,t,r,n,i,s){for(;--s>=0;){var a=t*this.data[e++]+r.data[n]+i;i=Math.floor(a/67108864),r.data[n++]=67108863&a}return i},n=26):(s.prototype.am=o,n=28),s.prototype.DB=n,s.prototype.DM=(1<<n)-1,s.prototype.DV=1<<n;s.prototype.FV=Math.pow(2,52),s.prototype.F1=52-n,s.prototype.F2=2*n-52;var c,u,l=new Array;for(c="0".charCodeAt(0),u=0;u<=9;++u)l[c++]=u;for(c="a".charCodeAt(0),u=10;u<36;++u)l[c++]=u;for(c="A".charCodeAt(0),u=10;u<36;++u)l[c++]=u;function h(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function d(e,t){var r=l[e.charCodeAt(t)];return null==r?-1:r}function f(e){var t=a();return t.fromInt(e),t}function p(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function g(e){this.m=e}function y(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function m(e,t){return e&t}function b(e,t){return e|t}function w(e,t){return e^t}function v(e,t){return e&~t}function A(e){if(0==e)return-1;var t=0;return 65535&e||(e>>=16,t+=16),255&e||(e>>=8,t+=8),15&e||(e>>=4,t+=4),3&e||(e>>=2,t+=2),1&e||++t,t}function E(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function C(){}function B(e){return e}function S(e){this.r2=a(),this.q3=a(),s.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}g.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},g.prototype.revert=function(e){return e},g.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},g.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},g.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},y.prototype.convert=function(e){var t=a();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(s.ZERO)>0&&this.m.subTo(t,t),t},y.prototype.revert=function(e){var t=a();return e.copyTo(t),this.reduce(t),t},y.prototype.reduce=function(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e.data[t],n=r*this.mpl+((r*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,n,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},y.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},y.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},s.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s},s.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0},s.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var n=e.length,i=!1,a=0;--n>=0;){var o=8==r?255&e[n]:d(e,n);o<0?"-"==e.charAt(n)&&(i=!0):(i=!1,0==a?this.data[this.t++]=o:a+r>this.DB?(this.data[this.t-1]|=(o&(1<<this.DB-a)-1)<<a,this.data[this.t++]=o>>this.DB-a):this.data[this.t-1]|=o<<a,(a+=r)>=this.DB&&(a-=this.DB))}8==r&&128&e[0]&&(this.s=-1,a>0&&(this.data[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&s.ZERO.subTo(this,this)},s.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t},s.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s},s.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t.data[r-e]=this.data[r];t.t=Math.max(this.t-e,0),t.s=this.s},s.prototype.lShiftTo=function(e,t){var r,n=e%this.DB,i=this.DB-n,s=(1<<i)-1,a=Math.floor(e/this.DB),o=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)t.data[r+a+1]=this.data[r]>>i|o,o=(this.data[r]&s)<<n;for(r=a-1;r>=0;--r)t.data[r]=0;t.data[a]=o,t.t=this.t+a+1,t.s=this.s,t.clamp()},s.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,s=(1<<n)-1;t.data[0]=this.data[r]>>n;for(var a=r+1;a<this.t;++a)t.data[a-r-1]|=(this.data[a]&s)<<i,t.data[a-r]=this.data[a]>>n;n>0&&(t.data[this.t-r-1]|=(this.s&s)<<i),t.t=this.t-r,t.clamp()}},s.prototype.subTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]-e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t.data[r++]=this.DV+n:n>0&&(t.data[r++]=n),t.t=r,t.clamp()},s.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t.data[i]=0;for(i=0;i<n.t;++i)t.data[i+r.t]=r.am(0,n.data[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&s.ZERO.subTo(t,t)},s.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e.data[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t.data[r],e,2*r,0,1);(e.data[r+t.t]+=t.am(r+1,2*t.data[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp()},s.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t)return null!=t&&t.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=a());var o=a(),c=this.s,u=e.s,l=this.DB-p(n.data[n.t-1]);l>0?(n.lShiftTo(l,o),i.lShiftTo(l,r)):(n.copyTo(o),i.copyTo(r));var h=o.t,d=o.data[h-1];if(0!=d){var f=d*(1<<this.F1)+(h>1?o.data[h-2]>>this.F2:0),g=this.FV/f,y=(1<<this.F1)/f,m=1<<this.F2,b=r.t,w=b-h,v=null==t?a():t;for(o.dlShiftTo(w,v),r.compareTo(v)>=0&&(r.data[r.t++]=1,r.subTo(v,r)),s.ONE.dlShiftTo(h,v),v.subTo(o,o);o.t<h;)o.data[o.t++]=0;for(;--w>=0;){var A=r.data[--b]==d?this.DM:Math.floor(r.data[b]*g+(r.data[b-1]+m)*y);if((r.data[b]+=o.am(0,A,r,w,0,h))<A)for(o.dlShiftTo(w,v),r.subTo(v,r);r.data[b]<--A;)r.subTo(v,r)}null!=t&&(r.drShiftTo(h,t),c!=u&&s.ZERO.subTo(t,t)),r.t=h,r.clamp(),l>0&&r.rShiftTo(l,r),c<0&&s.ZERO.subTo(r,r)}}},s.prototype.invDigit=function(){if(this.t<1)return 0;var e=this.data[0];if(!(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},s.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},s.prototype.exp=function(e,t){if(e>4294967295||e<1)return s.ONE;var r=a(),n=a(),i=t.convert(this),o=p(e)-1;for(i.copyTo(r);--o>=0;)if(t.sqrTo(r,n),(e&1<<o)>0)t.mulTo(n,i,r);else{var c=r;r=n,n=c}return t.revert(r)},s.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<<t)-1,i=!1,s="",a=this.t,o=this.DB-a*this.DB%t;if(a-- >0)for(o<this.DB&&(r=this.data[a]>>o)>0&&(i=!0,s=h(r));a>=0;)o<t?(r=(this.data[a]&(1<<o)-1)<<t-o,r|=this.data[--a]>>(o+=this.DB-t)):(r=this.data[a]>>(o-=t)&n,o<=0&&(o+=this.DB,--a)),r>0&&(i=!0),i&&(s+=h(r));return i?s:"0"},s.prototype.negate=function(){var e=a();return s.ZERO.subTo(this,e),e},s.prototype.abs=function(){return this.s<0?this.negate():this},s.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this.data[r]-e.data[r]))return t;return 0},s.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+p(this.data[this.t-1]^this.s&this.DM)},s.prototype.mod=function(e){var t=a();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(s.ZERO)>0&&e.subTo(t,t),t},s.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new g(t):new y(t),this.exp(e,r)},s.ZERO=f(0),s.ONE=f(1),C.prototype.convert=B,C.prototype.revert=B,C.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},C.prototype.sqrTo=function(e,t){e.squareTo(t)},S.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=a();return e.copyTo(t),this.reduce(t),t},S.prototype.revert=function(e){return e},S.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},S.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},S.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var k=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],T=(1<<26)/k[k.length-1];s.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},s.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=f(r),i=a(),s=a(),o="";for(this.divRemTo(n,i,s);i.signum()>0;)o=(r+s.intValue()).toString(e).substr(1)+o,i.divRemTo(n,i,s);return s.intValue().toString(e)+o},s.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,a=0,o=0,c=0;c<e.length;++c){var u=d(e,c);u<0?"-"==e.charAt(c)&&0==this.signum()&&(i=!0):(o=t*o+u,++a>=r&&(this.dMultiply(n),this.dAddOffset(o,0),a=0,o=0))}a>0&&(this.dMultiply(Math.pow(t,a)),this.dAddOffset(o,0)),i&&s.ZERO.subTo(this,this)},s.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(s.ONE.shiftLeft(e-1),b,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(s.ONE.shiftLeft(e-1),this);else{var n=new Array,i=7&e;n.length=1+(e>>3),t.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}},s.prototype.bitwiseTo=function(e,t,r){var n,i,s=Math.min(e.t,this.t);for(n=0;n<s;++n)r.data[n]=t(this.data[n],e.data[n]);if(e.t<this.t){for(i=e.s&this.DM,n=s;n<this.t;++n)r.data[n]=t(this.data[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=s;n<e.t;++n)r.data[n]=t(i,e.data[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},s.prototype.changeBit=function(e,t){var r=s.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r},s.prototype.addTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]+e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t.data[r++]=n:n<-1&&(t.data[r++]=this.DV+n),t.t=r,t.clamp()},s.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},s.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}},s.prototype.multiplyLowerTo=function(e,t,r){var n,i=Math.min(this.t+e.t,t);for(r.s=0,r.t=i;i>0;)r.data[--i]=0;for(n=r.t-this.t;i<n;++i)r.data[i+this.t]=this.am(0,e.data[i],r,i,0,this.t);for(n=Math.min(e.t,t);i<n;++i)this.am(0,e.data[i],r,i,0,t-i);r.clamp()},s.prototype.multiplyUpperTo=function(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r.data[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r.data[this.t+n-t]=this.am(t-n,e.data[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)},s.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this.data[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this.data[n])%e;return r},s.prototype.millerRabin=function(e){var t=this.subtract(s.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var n,i=t.shiftRight(r),a={nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(256*Math.random())}},o=0;o<e;++o){do{n=new s(this.bitLength(),a)}while(n.compareTo(s.ONE)<=0||n.compareTo(t)>=0);var c=n.modPow(i,this);if(0!=c.compareTo(s.ONE)&&0!=c.compareTo(t)){for(var u=1;u++<r&&0!=c.compareTo(t);)if(0==(c=c.modPowInt(2,this)).compareTo(s.ONE))return!1;if(0!=c.compareTo(t))return!1}}return!0},s.prototype.clone=function(){var e=a();return this.copyTo(e),e},s.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this.data[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this.data[0];if(0==this.t)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]},s.prototype.byteValue=function(){return 0==this.t?this.s:this.data[0]<<24>>24},s.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},s.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},s.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,i=0;if(e-- >0)for(n<this.DB&&(r=this.data[e]>>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this.data[e]&(1<<n)-1)<<8-n,r|=this.data[--e]>>(n+=this.DB-8)):(r=this.data[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),128&r&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},s.prototype.equals=function(e){return 0==this.compareTo(e)},s.prototype.min=function(e){return this.compareTo(e)<0?this:e},s.prototype.max=function(e){return this.compareTo(e)>0?this:e},s.prototype.and=function(e){var t=a();return this.bitwiseTo(e,m,t),t},s.prototype.or=function(e){var t=a();return this.bitwiseTo(e,b,t),t},s.prototype.xor=function(e){var t=a();return this.bitwiseTo(e,w,t),t},s.prototype.andNot=function(e){var t=a();return this.bitwiseTo(e,v,t),t},s.prototype.not=function(){for(var e=a(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e},s.prototype.shiftLeft=function(e){var t=a();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},s.prototype.shiftRight=function(e){var t=a();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},s.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this.data[e])return e*this.DB+A(this.data[e]);return this.s<0?this.t*this.DB:-1},s.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=E(this.data[r]^t);return e},s.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:!!(this.data[t]&1<<e%this.DB)},s.prototype.setBit=function(e){return this.changeBit(e,b)},s.prototype.clearBit=function(e){return this.changeBit(e,v)},s.prototype.flipBit=function(e){return this.changeBit(e,w)},s.prototype.add=function(e){var t=a();return this.addTo(e,t),t},s.prototype.subtract=function(e){var t=a();return this.subTo(e,t),t},s.prototype.multiply=function(e){var t=a();return this.multiplyTo(e,t),t},s.prototype.divide=function(e){var t=a();return this.divRemTo(e,t,null),t},s.prototype.remainder=function(e){var t=a();return this.divRemTo(e,null,t),t},s.prototype.divideAndRemainder=function(e){var t=a(),r=a();return this.divRemTo(e,t,r),new Array(t,r)},s.prototype.modPow=function(e,t){var r,n,i=e.bitLength(),s=f(1);if(i<=0)return s;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new g(t):t.isEven()?new S(t):new y(t);var o=new Array,c=3,u=r-1,l=(1<<r)-1;if(o[1]=n.convert(this),r>1){var h=a();for(n.sqrTo(o[1],h);c<=l;)o[c]=a(),n.mulTo(h,o[c-2],o[c]),c+=2}var d,m,b=e.t-1,w=!0,v=a();for(i=p(e.data[b])-1;b>=0;){for(i>=u?d=e.data[b]>>i-u&l:(d=(e.data[b]&(1<<i+1)-1)<<u-i,b>0&&(d|=e.data[b-1]>>this.DB+i-u)),c=r;!(1&d);)d>>=1,--c;if((i-=c)<0&&(i+=this.DB,--b),w)o[d].copyTo(s),w=!1;else{for(;c>1;)n.sqrTo(s,v),n.sqrTo(v,s),c-=2;c>0?n.sqrTo(s,v):(m=s,s=v,v=m),n.mulTo(v,o[d],s)}for(;b>=0&&!(e.data[b]&1<<i);)n.sqrTo(s,v),m=s,s=v,v=m,--i<0&&(i=this.DB-1,--b)}return n.revert(s)},s.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return s.ZERO;for(var r=e.clone(),n=this.clone(),i=f(1),a=f(0),o=f(0),c=f(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?(i.isEven()&&a.isEven()||(i.addTo(this,i),a.subTo(e,a)),i.rShiftTo(1,i)):a.isEven()||a.subTo(e,a),a.rShiftTo(1,a);for(;n.isEven();)n.rShiftTo(1,n),t?(o.isEven()&&c.isEven()||(o.addTo(this,o),c.subTo(e,c)),o.rShiftTo(1,o)):c.isEven()||c.subTo(e,c),c.rShiftTo(1,c);r.compareTo(n)>=0?(r.subTo(n,r),t&&i.subTo(o,i),a.subTo(c,a)):(n.subTo(r,n),t&&o.subTo(i,o),c.subTo(a,c))}return 0!=n.compareTo(s.ONE)?s.ZERO:c.compareTo(e)>=0?c.subtract(e):c.signum()<0?(c.addTo(e,c),c.signum()<0?c.add(e):c):c},s.prototype.pow=function(e){return this.exp(e,new C)},s.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),s=r.getLowestSetBit();if(s<0)return t;for(i<s&&(s=i),s>0&&(t.rShiftTo(s,t),r.rShiftTo(s,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r},s.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=k[k.length-1]){for(t=0;t<k.length;++t)if(r.data[0]==k[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<k.length;){for(var n=k[t],i=t+1;i<k.length&&n<T;)n*=k[i++];for(n=r.modInt(n);t<i;)if(n%k[t++]==0)return!1}return r.millerRabin(e)}},203:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Transaction=t.recoverAddress=t.computeAddress=t.authorizationify=t.accessListify=void 0;var n=r(5193);Object.defineProperty(t,"accessListify",{enumerable:!0,get:function(){return n.accessListify}});var i=r(3490);Object.defineProperty(t,"authorizationify",{enumerable:!0,get:function(){return i.authorizationify}});var s=r(4423);Object.defineProperty(t,"computeAddress",{enumerable:!0,get:function(){return s.computeAddress}}),Object.defineProperty(t,"recoverAddress",{enumerable:!0,get:function(){return s.recoverAddress}});var a=r(991);Object.defineProperty(t,"Transaction",{enumerable:!0,get:function(){return a.Transaction}})},260:(e,t,r)=>{var n=r(4643);r(9679),r(8550);var i=e.exports=n.sha512=n.sha512||{};n.md.sha512=n.md.algorithms.sha512=i;var s=n.sha384=n.sha512.sha384=n.sha512.sha384||{};s.create=function(){return i.create("SHA-384")},n.md.sha384=n.md.algorithms.sha384=s,n.sha512.sha256=n.sha512.sha256||{create:function(){return i.create("SHA-512/256")}},n.md["sha512/256"]=n.md.algorithms["sha512/256"]=n.sha512.sha256,n.sha512.sha224=n.sha512.sha224||{create:function(){return i.create("SHA-512/224")}},n.md["sha512/224"]=n.md.algorithms["sha512/224"]=n.sha512.sha224,i.create=function(e){if(o||(a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),128),c=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],(u={})["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],u["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],u["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],u["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],o=!0),void 0===e&&(e="SHA-512"),!(e in u))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=u[e],r=null,i=n.util.createBuffer(),s=new Array(80),h=0;h<80;++h)s[h]=new Array(2);var d=64;switch(e){case"SHA-384":d=48;break;case"SHA-512/256":d=32;break;case"SHA-512/224":d=28}var f={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:d,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){f.messageLength=0,f.fullMessageLength=f.messageLength128=[];for(var e=f.messageLengthSize/4,s=0;s<e;++s)f.fullMessageLength.push(0);i=n.util.createBuffer(),r=new Array(t.length);for(s=0;s<t.length;++s)r[s]=t[s].slice(0);return f}};return f.start(),f.update=function(e,t){"utf8"===t&&(e=n.util.encodeUtf8(e));var a=e.length;f.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var o=f.fullMessageLength.length-1;o>=0;--o)f.fullMessageLength[o]+=a[1],a[1]=a[0]+(f.fullMessageLength[o]/4294967296>>>0),f.fullMessageLength[o]=f.fullMessageLength[o]>>>0,a[0]=a[1]/4294967296>>>0;return i.putBytes(e),l(r,s,i),(i.read>2048||0===i.length())&&i.compact(),f},f.digest=function(){var t=n.util.createBuffer();t.putBytes(i.bytes());var o,c=f.fullMessageLength[f.fullMessageLength.length-1]+f.messageLengthSize&f.blockLength-1;t.putBytes(a.substr(0,f.blockLength-c));for(var u=8*f.fullMessageLength[0],h=0;h<f.fullMessageLength.length-1;++h)u+=(o=8*f.fullMessageLength[h+1])/4294967296>>>0,t.putInt32(u>>>0),u=o>>>0;t.putInt32(u);var d=new Array(r.length);for(h=0;h<r.length;++h)d[h]=r[h].slice(0);l(d,s,t);var p,g=n.util.createBuffer();p="SHA-512"===e?d.length:"SHA-384"===e?d.length-2:d.length-4;for(h=0;h<p;++h)g.putInt32(d[h][0]),h===p-1&&"SHA-512/224"===e||g.putInt32(d[h][1]);return g},f};var a=null,o=!1,c=null,u=null;function l(e,t,r){for(var n,i,s,a,o,u,l,h,d,f,p,g,y,m,b,w,v,A,E,C,B,S,k,T,I,P,N,x,O,R,U,L,D,F=r.length();F>=128;){for(N=0;N<16;++N)t[N][0]=r.getInt32()>>>0,t[N][1]=r.getInt32()>>>0;for(;N<80;++N)n=(((x=(R=t[N-2])[0])>>>19|(O=R[1])<<13)^(O>>>29|x<<3)^x>>>6)>>>0,i=((x<<13|O>>>19)^(O<<3|x>>>29)^(x<<26|O>>>6))>>>0,s=(((x=(L=t[N-15])[0])>>>1|(O=L[1])<<31)^(x>>>8|O<<24)^x>>>7)>>>0,a=((x<<31|O>>>1)^(x<<24|O>>>8)^(x<<25|O>>>7))>>>0,U=t[N-7],D=t[N-16],O=i+U[1]+a+D[1],t[N][0]=n+U[0]+s+D[0]+(O/4294967296>>>0)>>>0,t[N][1]=O>>>0;for(p=e[0][0],g=e[0][1],y=e[1][0],m=e[1][1],b=e[2][0],w=e[2][1],v=e[3][0],A=e[3][1],E=e[4][0],C=e[4][1],B=e[5][0],S=e[5][1],k=e[6][0],T=e[6][1],I=e[7][0],P=e[7][1],N=0;N<80;++N)l=((E>>>14|C<<18)^(E>>>18|C<<14)^(C>>>9|E<<23))>>>0,h=(k^E&(B^k))>>>0,o=((p>>>28|g<<4)^(g>>>2|p<<30)^(g>>>7|p<<25))>>>0,u=((p<<4|g>>>28)^(g<<30|p>>>2)^(g<<25|p>>>7))>>>0,d=(p&y|b&(p^y))>>>0,f=(g&m|w&(g^m))>>>0,O=P+(((E<<18|C>>>14)^(E<<14|C>>>18)^(C<<23|E>>>9))>>>0)+((T^C&(S^T))>>>0)+c[N][1]+t[N][1],n=I+l+h+c[N][0]+t[N][0]+(O/4294967296>>>0)>>>0,i=O>>>0,s=o+d+((O=u+f)/4294967296>>>0)>>>0,a=O>>>0,I=k,P=T,k=B,T=S,B=E,S=C,E=v+n+((O=A+i)/4294967296>>>0)>>>0,C=O>>>0,v=b,A=w,b=y,w=m,y=p,m=g,p=n+s+((O=i+a)/4294967296>>>0)>>>0,g=O>>>0;O=e[0][1]+g,e[0][0]=e[0][0]+p+(O/4294967296>>>0)>>>0,e[0][1]=O>>>0,O=e[1][1]+m,e[1][0]=e[1][0]+y+(O/4294967296>>>0)>>>0,e[1][1]=O>>>0,O=e[2][1]+w,e[2][0]=e[2][0]+b+(O/4294967296>>>0)>>>0,e[2][1]=O>>>0,O=e[3][1]+A,e[3][0]=e[3][0]+v+(O/4294967296>>>0)>>>0,e[3][1]=O>>>0,O=e[4][1]+C,e[4][0]=e[4][0]+E+(O/4294967296>>>0)>>>0,e[4][1]=O>>>0,O=e[5][1]+S,e[5][0]=e[5][0]+B+(O/4294967296>>>0)>>>0,e[5][1]=O>>>0,O=e[6][1]+T,e[6][0]=e[6][0]+k+(O/4294967296>>>0)>>>0,e[6][1]=O>>>0,O=e[7][1]+P,e[7][0]=e[7][0]+I+(O/4294967296>>>0)>>>0,e[7][1]=O>>>0,F-=128}}},313:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SigningKey=void 0;const n=r(5484),i=r(8718),s=r(1154);class a{#l;constructor(e){(0,i.assertArgument)(32===(0,i.dataLength)(e),"invalid private key","privateKey","[REDACTED]"),this.#l=(0,i.hexlify)(e)}get privateKey(){return this.#l}get publicKey(){return a.computePublicKey(this.#l)}get compressedPublicKey(){return a.computePublicKey(this.#l,!0)}sign(e){(0,i.assertArgument)(32===(0,i.dataLength)(e),"invalid digest length","digest",e);const t=n.secp256k1.sign((0,i.getBytesCopy)(e),(0,i.getBytesCopy)(this.#l),{lowS:!0});return s.Signature.from({r:(0,i.toBeHex)(t.r,32),s:(0,i.toBeHex)(t.s,32),v:t.recovery?28:27})}computeSharedSecret(e){const t=a.computePublicKey(e);return(0,i.hexlify)(n.secp256k1.getSharedSecret((0,i.getBytesCopy)(this.#l),(0,i.getBytes)(t),!1))}static computePublicKey(e,t){let r=(0,i.getBytes)(e,"key");if(32===r.length){const e=n.secp256k1.getPublicKey(r,!!t);return(0,i.hexlify)(e)}if(64===r.length){const e=new Uint8Array(65);e[0]=4,e.set(r,1),r=e}const s=n.secp256k1.ProjectivePoint.fromHex(r);return(0,i.hexlify)(s.toRawBytes(t))}static recoverPublicKey(e,t){(0,i.assertArgument)(32===(0,i.dataLength)(e),"invalid digest length","digest",e);const r=s.Signature.from(t);let a=n.secp256k1.Signature.fromCompact((0,i.getBytesCopy)((0,i.concat)([r.r,r.s])));a=a.addRecoveryBit(r.yParity);const o=a.recoverPublicKey((0,i.getBytesCopy)(e));return(0,i.assertArgument)(null!=o,"invalid signature for digest","signature",t),"0x"+o.toHex(!1)}static addPoints(e,t,r){const i=n.secp256k1.ProjectivePoint.fromHex(a.computePublicKey(e).substring(2)),s=n.secp256k1.ProjectivePoint.fromHex(a.computePublicKey(t).substring(2));return"0x"+i.add(s).toHex(!!r)}}t.SigningKey=a},324:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.showThrottleMessage=void 0;const r=new Set;t.showThrottleMessage=function(e){r.has(e)||(r.add(e),console.log("========= NOTICE ========="),console.log(`Request-Rate Exceeded for ${e} (this message will not be repeated)`),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.org/api-keys/"),console.log("=========================="))}},333:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Typed=t.Result=t.TransactionDescription=t.LogDescription=t.ErrorDescription=t.Interface=t.Indexed=t.checkResultErrors=t.StructFragment=t.ParamType=t.NamedFragment=t.FunctionFragment=t.Fragment=t.FallbackFragment=t.EventFragment=t.ErrorFragment=t.ConstructorFragment=t.encodeBytes32String=t.decodeBytes32String=t.AbiCoder=void 0;var n=r(9895);Object.defineProperty(t,"AbiCoder",{enumerable:!0,get:function(){return n.AbiCoder}});var i=r(3743);Object.defineProperty(t,"decodeBytes32String",{enumerable:!0,get:function(){return i.decodeBytes32String}}),Object.defineProperty(t,"encodeBytes32String",{enumerable:!0,get:function(){return i.encodeBytes32String}});var s=r(3556);Object.defineProperty(t,"ConstructorFragment",{enumerable:!0,get:function(){return s.ConstructorFragment}}),Object.defineProperty(t,"ErrorFragment",{enumerable:!0,get:function(){return s.ErrorFragment}}),Object.defineProperty(t,"EventFragment",{enumerable:!0,get:function(){return s.EventFragment}}),Object.defineProperty(t,"FallbackFragment",{enumerable:!0,get:function(){return s.FallbackFragment}}),Object.defineProperty(t,"Fragment",{enumerable:!0,get:function(){return s.Fragment}}),Object.defineProperty(t,"FunctionFragment",{enumerable:!0,get:function(){return s.FunctionFragment}}),Object.defineProperty(t,"NamedFragment",{enumerable:!0,get:function(){return s.NamedFragment}}),Object.defineProperty(t,"ParamType",{enumerable:!0,get:function(){return s.ParamType}}),Object.defineProperty(t,"StructFragment",{enumerable:!0,get:function(){return s.StructFragment}});var a=r(9854);Object.defineProperty(t,"checkResultErrors",{enumerable:!0,get:function(){return a.checkResultErrors}}),Object.defineProperty(t,"Indexed",{enumerable:!0,get:function(){return a.Indexed}}),Object.defineProperty(t,"Interface",{enumerable:!0,get:function(){return a.Interface}}),Object.defineProperty(t,"ErrorDescription",{enumerable:!0,get:function(){return a.ErrorDescription}}),Object.defineProperty(t,"LogDescription",{enumerable:!0,get:function(){return a.LogDescription}}),Object.defineProperty(t,"TransactionDescription",{enumerable:!0,get:function(){return a.TransactionDescription}}),Object.defineProperty(t,"Result",{enumerable:!0,get:function(){return a.Result}});var o=r(3233);Object.defineProperty(t,"Typed",{enumerable:!0,get:function(){return o.Typed}})},339:(e,t,r)=>{var n=r(4643);r(8550),r(121),r(5417),function(){if(n.prime)e.exports=n.prime;else{var t=e.exports=n.prime=n.prime||{},r=n.jsbn.BigInteger,i=[6,4,2,4,2,4,6,2],s=new r(null);s.fromInt(30);var a=function(e,t){return e|t};t.generateProbablePrime=function(e,t,i){"function"==typeof t&&(i=t,t={});var s=(t=t||{}).algorithm||"PRIMEINC";"string"==typeof s&&(s={name:s}),s.options=s.options||{};var a=t.prng||n.random,c={nextBytes:function(e){for(var t=a.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}};if("PRIMEINC"===s.name)return function(e,t,i,s){if("workers"in i)return function(e,t,i,s){if("undefined"==typeof Worker)return o(e,t,i,s);var a=u(e,t),c=i.workers,l=i.workLoad||100,h=30*l/8,d=i.workerScript||"forge/prime.worker.js";if(-1===c)return n.util.estimateCores(function(e,t){e&&(t=2),c=t-1,f()});function f(){c=Math.max(1,c);for(var n=[],i=0;i<c;++i)n[i]=new Worker(d);for(i=0;i<c;++i)n[i].addEventListener("message",f);var o=!1;function f(i){if(!o){0;var c=i.data;if(c.found){for(var d=0;d<n.length;++d)n[d].terminate();return o=!0,s(null,new r(c.prime,16))}a.bitLength()>e&&(a=u(e,t));var f=a.toString(16);i.target.postMessage({hex:f,workLoad:l}),a.dAddOffset(h,0)}}}f()}(e,t,i,s);return o(e,t,i,s)}(e,c,s.options,i);throw new Error("Invalid prime generation algorithm: "+s.name)}}function o(e,t,r,n){var i=u(e,t),s=function(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}(i.bitLength());"millerRabinTests"in r&&(s=r.millerRabinTests);var a=10;"maxBlockTime"in r&&(a=r.maxBlockTime),c(i,e,t,0,s,a,n)}function c(e,t,r,s,a,o,l){var h=+new Date;do{if(e.bitLength()>t&&(e=u(t,r)),e.isProbablePrime(a))return l(null,e);e.dAddOffset(i[s++%8],0)}while(o<0||+new Date-h<o);n.util.setImmediate(function(){c(e,t,r,s,a,o,l)})}function u(e,t){var n=new r(e,t),i=e-1;return n.testBit(i)||n.bitwiseTo(r.ONE.shiftLeft(i),a,n),n.dAddOffset(31-n.mod(s).byteValue(),0),n}}()},355:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertPrivate=t.assertNormalize=t.assertArgumentCount=t.assertArgument=t.assert=t.makeError=t.isCallException=t.isError=void 0;const n=r(1825),i=r(6441);function s(e,t){if(null==e)return"null";if(null==t&&(t=new Set),"object"==typeof e){if(t.has(e))return"[Circular]";t.add(e)}if(Array.isArray(e))return"[ "+e.map(e=>s(e,t)).join(", ")+" ]";if(e instanceof Uint8Array){const t="0123456789abcdef";let r="0x";for(let n=0;n<e.length;n++)r+=t[e[n]>>4],r+=t[15&e[n]];return r}if("object"==typeof e&&"function"==typeof e.toJSON)return s(e.toJSON(),t);switch(typeof e){case"boolean":case"number":case"symbol":return e.toString();case"bigint":return BigInt(e).toString();case"string":return JSON.stringify(e);case"object":{const r=Object.keys(e);return r.sort(),"{ "+r.map(r=>`${s(r,t)}: ${s(e[r],t)}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function a(e,t){return e&&e.code===t}function o(e,t,r){let a,o=e;{const i=[];if(r){if("message"in r||"code"in r||"name"in r)throw new Error(`value will overwrite populated values: ${s(r)}`);for(const e in r){if("shortMessage"===e)continue;const t=r[e];i.push(e+"="+s(t))}}i.push(`code=${t}`),i.push(`version=${n.version}`),i.length&&(e+=" ("+i.join(", ")+")")}switch(t){case"INVALID_ARGUMENT":a=new TypeError(e);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":a=new RangeError(e);break;default:a=new Error(e)}return(0,i.defineProperties)(a,{code:t}),r&&Object.assign(a,r),null==a.shortMessage&&(0,i.defineProperties)(a,{shortMessage:o}),a}function c(e,t,r,n){if(!e)throw o(t,r,n)}t.isError=a,t.isCallException=function(e){return a(e,"CALL_EXCEPTION")},t.makeError=o,t.assert=c,t.assertArgument=function(e,t,r,n){c(e,t,"INVALID_ARGUMENT",{argument:r,value:n})},t.assertArgumentCount=function(e,t,r){null==r&&(r=""),r&&(r=": "+r),c(e>=t,"missing argument"+r,"MISSING_ARGUMENT",{count:e,expectedCount:t}),c(e<=t,"too many arguments"+r,"UNEXPECTED_ARGUMENT",{count:e,expectedCount:t})};const u=["NFD","NFC","NFKD","NFKC"].reduce((e,t)=>{try{if("test"!=="test".normalize(t))throw new Error("bad");if("NFD"===t){const e=String.fromCharCode(233).normalize("NFD");if(e!==String.fromCharCode(101,769))throw new Error("broken")}e.push(t)}catch(e){}return e},[]);t.assertNormalize=function(e){c(u.indexOf(e)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:e}})},t.assertPrivate=function(e,t,r){if(null==r&&(r=""),e!==t){let e=r,t="new";r&&(e+=".",t+=" "+r),c(!1,`private constructor; use ${e}from* methods`,"UNSUPPORTED_OPERATION",{operation:t})}}},393:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnonymousCoder=void 0;const n=r(1540);class i extends n.Coder{coder;constructor(e){super(e.name,e.type,"_",e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}t.AnonymousCoder=i},486:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pbkdf2Async=t.pbkdf2=void 0;const n=r(9648),i=r(4832),s=r(3654);function a(e,t,r,a){(0,n.hash)(e);const o=(0,s.checkOpts)({dkLen:32,asyncTick:10},a),{c,dkLen:u,asyncTick:l}=o;if((0,n.number)(c),(0,n.number)(u),(0,n.number)(l),c<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const h=(0,s.toBytes)(t),d=(0,s.toBytes)(r),f=new Uint8Array(u),p=i.hmac.create(e,h),g=p._cloneInto().update(d);return{c,dkLen:u,asyncTick:l,DK:f,PRF:p,PRFSalt:g}}function o(e,t,r,n,i){return e.destroy(),t.destroy(),n&&n.destroy(),i.fill(0),r}t.pbkdf2=function(e,t,r,n){const{c:i,dkLen:c,DK:u,PRF:l,PRFSalt:h}=a(e,t,r,n);let d;const f=new Uint8Array(4),p=(0,s.createView)(f),g=new Uint8Array(l.outputLen);for(let e=1,t=0;t<c;e++,t+=l.outputLen){const r=u.subarray(t,t+l.outputLen);p.setInt32(0,e,!1),(d=h._cloneInto(d)).update(f).digestInto(g),r.set(g.subarray(0,r.length));for(let e=1;e<i;e++){l._cloneInto(d).update(g).digestInto(g);for(let e=0;e<r.length;e++)r[e]^=g[e]}}return o(l,h,u,d,g)},t.pbkdf2Async=async function(e,t,r,n){const{c:i,dkLen:c,asyncTick:u,DK:l,PRF:h,PRFSalt:d}=a(e,t,r,n);let f;const p=new Uint8Array(4),g=(0,s.createView)(p),y=new Uint8Array(h.outputLen);for(let e=1,t=0;t<c;e++,t+=h.outputLen){const r=l.subarray(t,t+h.outputLen);g.setInt32(0,e,!1),(f=d._cloneInto(f)).update(p).digestInto(y),r.set(y.subarray(0,r.length)),await(0,s.asyncLoop)(i-1,u,()=>{h._cloneInto(f).update(y).digestInto(y);for(let e=0;e<r.length;e++)r[e]^=y[e]})}return o(h,d,l,f,y)}},532:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionResponse=t.TransactionReceipt=t.Log=t.Block=t.copyRequest=t.FeeData=void 0;const n=r(8718),i=r(203),s=BigInt(0);function a(e){return null==e?null:e}function o(e){return null==e?null:e.toString()}t.FeeData=class{gasPrice;maxFeePerGas;maxPriorityFeePerGas;constructor(e,t,r){(0,n.defineProperties)(this,{gasPrice:a(e),maxFeePerGas:a(t),maxPriorityFeePerGas:a(r)})}toJSON(){const{gasPrice:e,maxFeePerGas:t,maxPriorityFeePerGas:r}=this;return{_type:"FeeData",gasPrice:o(e),maxFeePerGas:o(t),maxPriorityFeePerGas:o(r)}}},t.copyRequest=function(e){const t={};e.to&&(t.to=e.to),e.from&&(t.from=e.from),e.data&&(t.data=(0,n.hexlify)(e.data));const r="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of r)i in e&&null!=e[i]&&(t[i]=(0,n.getBigInt)(e[i],`request.${i}`));const s="type,nonce".split(/,/);for(const r of s)r in e&&null!=e[r]&&(t[r]=(0,n.getNumber)(e[r],`request.${r}`));return e.accessList&&(t.accessList=(0,i.accessListify)(e.accessList)),e.authorizationList&&(t.authorizationList=e.authorizationList.slice()),"blockTag"in e&&(t.blockTag=e.blockTag),"enableCcipRead"in e&&(t.enableCcipRead=!!e.enableCcipRead),"customData"in e&&(t.customData=e.customData),"blobVersionedHashes"in e&&e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes.slice()),"kzg"in e&&(t.kzg=e.kzg),"blobs"in e&&e.blobs&&(t.blobs=e.blobs.map(e=>(0,n.isBytesLike)(e)?(0,n.hexlify)(e):Object.assign({},e))),t};class c{provider;number;hash;timestamp;parentHash;parentBeaconBlockRoot;nonce;difficulty;gasLimit;gasUsed;stateRoot;receiptsRoot;blobGasUsed;excessBlobGas;miner;prevRandao;extraData;baseFeePerGas;#h;constructor(e,t){this.#h=e.transactions.map(e=>"string"!=typeof e?new h(e,t):e),(0,n.defineProperties)(this,{provider:t,hash:a(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:a(e.prevRandao),extraData:e.extraData,baseFeePerGas:a(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return this.#h.map(e=>"string"==typeof e?e:e.hash)}get prefetchedTransactions(){const e=this.#h.slice();return 0===e.length?[]:((0,n.assert)("object"==typeof e[0],"transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:t,extraData:r,gasLimit:n,gasUsed:i,hash:s,miner:a,prevRandao:c,nonce:u,number:l,parentHash:h,parentBeaconBlockRoot:d,stateRoot:f,receiptsRoot:p,timestamp:g,transactions:y}=this;return{_type:"Block",baseFeePerGas:o(e),difficulty:o(t),extraData:r,gasLimit:o(n),gasUsed:o(i),blobGasUsed:o(this.blobGasUsed),excessBlobGas:o(this.excessBlobGas),hash:s,miner:a,prevRandao:c,nonce:u,number:l,parentHash:h,timestamp:g,parentBeaconBlockRoot:d,stateRoot:f,receiptsRoot:p,transactions:y}}[Symbol.iterator](){let e=0;const t=this.transactions;return{next:()=>e<this.length?{value:t[e++],done:!1}:{value:void 0,done:!0}}}get length(){return this.#h.length}get date(){return null==this.timestamp?null:new Date(1e3*this.timestamp)}async getTransaction(e){let t;if("number"==typeof e)t=this.#h[e];else{const r=e.toLowerCase();for(const e of this.#h){if("string"==typeof e){if(e!==r)continue;t=e;break}if(e.hash===r){t=e;break}}}if(null==t)throw new Error("no such tx");return"string"==typeof t?await this.provider.getTransaction(t):t}getPrefetchedTransaction(e){const t=this.prefetchedTransactions;if("number"==typeof e)return t[e];e=e.toLowerCase();for(const r of t)if(r.hash===e)return r;(0,n.assertArgument)(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return{orphan:"drop-block",hash:(e=this).hash,number:e.number};var e}}t.Block=c;class u{provider;transactionHash;blockHash;blockNumber;removed;address;data;topics;index;transactionIndex;constructor(e,t){this.provider=t;const r=Object.freeze(e.topics.slice());(0,n.defineProperties)(this,{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,removed:e.removed,address:e.address,data:e.data,topics:r,index:e.index,transactionIndex:e.transactionIndex})}toJSON(){const{address:e,blockHash:t,blockNumber:r,data:n,index:i,removed:s,topics:a,transactionHash:o,transactionIndex:c}=this;return{_type:"log",address:e,blockHash:t,blockNumber:r,data:n,index:i,removed:s,topics:a,transactionHash:o,transactionIndex:c}}async getBlock(){const e=await this.provider.getBlock(this.blockHash);return(0,n.assert)(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransaction(){const e=await this.provider.getTransaction(this.transactionHash);return(0,n.assert)(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransactionReceipt(){const e=await this.provider.getTransactionReceipt(this.transactionHash);return(0,n.assert)(!!e,"failed to find transaction receipt","UNKNOWN_ERROR",{}),e}removedEvent(){return{orphan:"drop-log",log:{transactionHash:(e=this).transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,address:e.address,data:e.data,topics:Object.freeze(e.topics.slice()),index:e.index}};var e}}t.Log=u;class l{provider;to;from;contractAddress;hash;index;blockHash;blockNumber;logsBloom;gasUsed;blobGasUsed;cumulativeGasUsed;gasPrice;blobGasPrice;type;status;root;#d;constructor(e,t){this.#d=Object.freeze(e.logs.map(e=>new u(e,t)));let r=s;null!=e.effectiveGasPrice?r=e.effectiveGasPrice:null!=e.gasPrice&&(r=e.gasPrice),(0,n.defineProperties)(this,{provider:t,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:r,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return this.#d}toJSON(){const{to:e,from:t,contractAddress:r,hash:n,index:i,blockHash:s,blockNumber:a,logsBloom:c,logs:u,status:l,root:h}=this;return{_type:"TransactionReceipt",blockHash:s,blockNumber:a,contractAddress:r,cumulativeGasUsed:o(this.cumulativeGasUsed),from:t,gasPrice:o(this.gasPrice),blobGasUsed:o(this.blobGasUsed),blobGasPrice:o(this.blobGasPrice),gasUsed:o(this.gasUsed),hash:n,index:i,logs:u,logsBloom:c,root:h,status:l,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e<this.length?{value:this.logs[e++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const e=await this.provider.getBlock(this.blockHash);if(null==e)throw new Error("TODO");return e}async getTransaction(){const e=await this.provider.getTransaction(this.hash);if(null==e)throw new Error("TODO");return e}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return f(this)}reorderedEvent(e){return(0,n.assert)(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),d(this,e)}}t.TransactionReceipt=l;class h{provider;blockNumber;blockHash;index;hash;type;to;from;nonce;gasLimit;gasPrice;maxPriorityFeePerGas;maxFeePerGas;maxFeePerBlobGas;data;value;chainId;signature;accessList;blobVersionedHashes;authorizationList;#f;constructor(e,t){this.provider=t,this.blockNumber=null!=e.blockNumber?e.blockNumber:null,this.blockHash=null!=e.blockHash?e.blockHash:null,this.hash=e.hash,this.index=e.index,this.type=e.type,this.from=e.from,this.to=e.to||null,this.gasLimit=e.gasLimit,this.nonce=e.nonce,this.data=e.data,this.value=e.value,this.gasPrice=e.gasPrice,this.maxPriorityFeePerGas=null!=e.maxPriorityFeePerGas?e.maxPriorityFeePerGas:null,this.maxFeePerGas=null!=e.maxFeePerGas?e.maxFeePerGas:null,this.maxFeePerBlobGas=null!=e.maxFeePerBlobGas?e.maxFeePerBlobGas:null,this.chainId=e.chainId,this.signature=e.signature,this.accessList=null!=e.accessList?e.accessList:null,this.blobVersionedHashes=null!=e.blobVersionedHashes?e.blobVersionedHashes:null,this.authorizationList=null!=e.authorizationList?e.authorizationList:null,this.#f=-1}toJSON(){const{blockNumber:e,blockHash:t,index:r,hash:n,type:i,to:s,from:a,nonce:c,data:u,signature:l,accessList:h,blobVersionedHashes:d}=this;return{_type:"TransactionResponse",accessList:h,blockNumber:e,blockHash:t,blobVersionedHashes:d,chainId:o(this.chainId),data:u,from:a,gasLimit:o(this.gasLimit),gasPrice:o(this.gasPrice),hash:n,maxFeePerGas:o(this.maxFeePerGas),maxPriorityFeePerGas:o(this.maxPriorityFeePerGas),maxFeePerBlobGas:o(this.maxFeePerBlobGas),nonce:c,signature:l,to:s,index:r,type:i,value:o(this.value)}}async getBlock(){let e=this.blockNumber;if(null==e){const t=await this.getTransaction();t&&(e=t.blockNumber)}if(null==e)return null;const t=this.provider.getBlock(e);if(null==t)throw new Error("TODO");return t}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(null==this.blockNumber){const{tx:e,blockNumber:t}=await(0,n.resolveProperties)({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return null==e||null==e.blockNumber?0:t-e.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(e,t){const r=null==e?1:e,i=null==t?0:t;let a=this.#f,o=-1,c=-1===a;const u=async()=>{if(c)return null;const{blockNumber:e,nonce:t}=await(0,n.resolveProperties)({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(t<this.nonce)return void(a=e);if(c)return null;const i=await this.getTransaction();if(!i||null==i.blockNumber)for(-1===o&&(o=a-3,o<this.#f&&(o=this.#f));o<=e;){if(c)return null;const t=await this.provider.getBlock(o,!0);if(null==t)return;for(const e of t)if(e===this.hash)return;for(let i=0;i<t.length;i++){const o=await t.getTransaction(i);if(o.from===this.from&&o.nonce===this.nonce){if(c)return null;const t=await this.provider.getTransactionReceipt(o.hash);if(null==t)return;if(e-t.blockNumber+1<r)return;let i="replaced";o.data===this.data&&o.to===this.to&&o.value===this.value?i="repriced":"0x"===o.data&&o.from===o.to&&o.value===s&&(i="cancelled"),(0,n.assert)(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:"replaced"===i||"cancelled"===i,reason:i,replacement:o.replaceableTransaction(a),hash:o.hash,receipt:t})}}o++}},l=e=>{if(null==e||0!==e.status)return e;(0,n.assert)(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:e.to,from:e.from,data:""},receipt:e})},h=await this.provider.getTransactionReceipt(this.hash);if(0===r)return l(h);if(h){if(1===r||await h.confirmations()>=r)return l(h)}else if(await u(),0===r)return null;const d=new Promise((e,t)=>{const s=[],o=()=>{s.forEach(e=>e())};if(s.push(()=>{c=!0}),i>0){const e=setTimeout(()=>{o(),t((0,n.makeError)("wait for transaction timeout","TIMEOUT"))},i);s.push(()=>{clearTimeout(e)})}const h=async n=>{if(await n.confirmations()>=r){o();try{e(l(n))}catch(e){t(e)}}};if(s.push(()=>{this.provider.off(this.hash,h)}),this.provider.on(this.hash,h),a>=0){const e=async()=>{try{await u()}catch(e){if((0,n.isError)(e,"TRANSACTION_REPLACED"))return o(),void t(e)}c||this.provider.once("block",e)};s.push(()=>{this.provider.off("block",e)}),this.provider.once("block",e)}});return await d}isMined(){return null!=this.blockHash}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}isCancun(){return 3===this.type}removedEvent(){return(0,n.assert)(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),f(this)}reorderedEvent(e){return(0,n.assert)(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),(0,n.assert)(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),d(this,e)}replaceableTransaction(e){(0,n.assertArgument)(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const t=new h(this,this.provider);return t.#f=e,t}}function d(e,t){return{orphan:"reorder-transaction",tx:e,other:t}}function f(e){return{orphan:"drop-transaction",tx:e}}t.TransactionResponse=h},586:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FetchResponse=t.FetchRequest=t.FetchCancelSignal=void 0;const n=r(6662),i=r(5020),s=r(355),a=r(6441),o=r(5775),c=r(7420);let u=(0,c.createGetUrl)();const l=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),h=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let d=!1;async function f(e,t){try{const t=e.match(l);if(!t)throw new Error("invalid data");return new v(200,"OK",{"content-type":t[1]||"text/plain"},t[2]?(0,n.decodeBase64)(t[3]):(r=t[3],(0,o.toUtf8Bytes)(r.replace(/%([0-9a-f][0-9a-f])/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))))}catch(t){return new v(599,"BAD REQUEST (invalid data: URI)",{},null,new w(e))}var r}function p(e){return async function(t,r){try{const r=t.match(h);if(!r)throw new Error("invalid link");return new w(`${e}${r[2]}`)}catch(e){return new v(599,"BAD REQUEST (invalid IPFS URI)",{},null,new w(t))}}}const g={data:f,ipfs:p("https://gateway.ipfs.io/ipfs/")},y=new WeakMap;class m{#p;#g;constructor(e){this.#p=[],this.#g=!1,y.set(e,()=>{if(!this.#g){this.#g=!0;for(const e of this.#p)setTimeout(()=>{e()},0);this.#p=[]}})}addListener(e){(0,s.assert)(!this.#g,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),this.#p.push(e)}get cancelled(){return this.#g}checkSignal(){(0,s.assert)(!this.cancelled,"cancelled","CANCELLED",{})}}function b(e){if(null==e)throw new Error("missing signal; should not happen");return e.checkSignal(),e}t.FetchCancelSignal=m;class w{#y;#m;#b;#w;#v;#A;#E;#C;#B;#S;#k;#T;#I;#P;#N;get url(){return this.#A}set url(e){this.#A=String(e)}get body(){return null==this.#E?null:new Uint8Array(this.#E)}set body(e){if(null==e)this.#E=void 0,this.#C=void 0;else if("string"==typeof e)this.#E=(0,o.toUtf8Bytes)(e),this.#C="text/plain";else if(e instanceof Uint8Array)this.#E=e,this.#C="application/octet-stream";else{if("object"!=typeof e)throw new Error("invalid body");this.#E=(0,o.toUtf8Bytes)(JSON.stringify(e)),this.#C="application/json"}}hasBody(){return null!=this.#E}get method(){return this.#w?this.#w:this.hasBody()?"POST":"GET"}set method(e){null==e&&(e=""),this.#w=String(e).toUpperCase()}get headers(){const e=Object.assign({},this.#b);return this.#B&&(e.authorization=`Basic ${(0,n.encodeBase64)((0,o.toUtf8Bytes)(this.#B))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),null==e["content-type"]&&this.#C&&(e["content-type"]=this.#C),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,t){this.#b[String(e).toLowerCase()]=String(t)}clearHeaders(){this.#b={}}[Symbol.iterator](){const e=this.headers,t=Object.keys(e);let r=0;return{next:()=>{if(r<t.length){const n=t[r++];return{value:[n,e[n]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return this.#B||null}setCredentials(e,t){(0,s.assertArgument)(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),this.#B=`${e}:${t}`}get allowGzip(){return this.#m}set allowGzip(e){this.#m=!!e}get allowInsecureAuthentication(){return!!this.#y}set allowInsecureAuthentication(e){this.#y=!!e}get timeout(){return this.#v}set timeout(e){(0,s.assertArgument)(e>=0,"timeout must be non-zero","timeout",e),this.#v=e}get preflightFunc(){return this.#S||null}set preflightFunc(e){this.#S=e}get processFunc(){return this.#k||null}set processFunc(e){this.#k=e}get retryFunc(){return this.#T||null}set retryFunc(e){this.#T=e}get getUrlFunc(){return this.#N||u}set getUrlFunc(e){this.#N=e}constructor(e){this.#A=String(e),this.#y=!1,this.#m=!0,this.#b={},this.#w="",this.#v=3e5,this.#P={slotInterval:250,maxAttempts:12},this.#N=null}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${this.#E?(0,i.hexlify)(this.#E):"null"}>`}setThrottleParams(e){null!=e.slotInterval&&(this.#P.slotInterval=e.slotInterval),null!=e.maxAttempts&&(this.#P.maxAttempts=e.maxAttempts)}async#x(e,t,r,n,i){if(e>=this.#P.maxAttempts)return i.makeServerError("exceeded maximum retry limit");(0,s.assert)(A()<=t,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:n}),r>0&&await function(e){return new Promise(t=>setTimeout(t,e))}(r);let a=this.clone();const o=(a.url.split(":")[0]||"").toLowerCase();if(o in g){const e=await g[o](a.url,b(n.#I));if(e instanceof v){let t=e;if(this.processFunc){b(n.#I);try{t=await this.processFunc(a,t)}catch(e){null!=e.throttle&&"number"==typeof e.stall||t.makeServerError("error in post-processing function",e).assertOk()}}return t}a=e}this.preflightFunc&&(a=await this.preflightFunc(a));const c=await this.getUrlFunc(a,b(n.#I));let u=new v(c.statusCode,c.statusMessage,c.headers,c.body,n);if(301===u.statusCode||302===u.statusCode){try{const r=u.headers.location||"";return a.redirect(r).#x(e+1,t,0,n,u)}catch(e){}return u}if(429===u.statusCode&&(null==this.retryFunc||await this.retryFunc(a,u,e))){const r=u.headers["retry-after"];let i=this.#P.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return"string"==typeof r&&r.match(/^[1-9][0-9]*$/)&&(i=parseInt(r)),a.clone().#x(e+1,t,i,n,u)}if(this.processFunc){b(n.#I);try{u=await this.processFunc(a,u)}catch(r){null!=r.throttle&&"number"==typeof r.stall||u.makeServerError("error in post-processing function",r).assertOk();let i=this.#P.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return r.stall>=0&&(i=r.stall),a.clone().#x(e+1,t,i,n,u)}}return u}send(){return(0,s.assert)(null==this.#I,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),this.#I=new m(this),this.#x(0,A()+this.timeout,0,this,new v(0,"",{},null,this))}cancel(){(0,s.assert)(null!=this.#I,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=y.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const t=this.url.split(":")[0].toLowerCase(),r=e.split(":")[0].toLowerCase();(0,s.assert)("GET"===this.method&&("https"!==t||"http"!==r)&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const n=new w(e);return n.method="GET",n.allowGzip=this.allowGzip,n.timeout=this.timeout,n.#b=Object.assign({},this.#b),this.#E&&(n.#E=new Uint8Array(this.#E)),n.#C=this.#C,n}clone(){const e=new w(this.url);return e.#w=this.#w,this.#E&&(e.#E=this.#E),e.#C=this.#C,e.#b=Object.assign({},this.#b),e.#B=this.#B,this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),e.#S=this.#S,e.#k=this.#k,e.#T=this.#T,e.#P=Object.assign({},this.#P),e.#N=this.#N,e}static lockConfig(){d=!0}static getGateway(e){return g[e.toLowerCase()]||null}static registerGateway(e,t){if("http"===(e=e.toLowerCase())||"https"===e)throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(d)throw new Error("gateways locked");g[e]=t}static registerGetUrl(e){if(d)throw new Error("gateways locked");u=e}static createGetUrlFunc(e){return(0,c.createGetUrl)(e)}static createDataGateway(){return f}static createIpfsGatewayFunc(e){return p(e)}}t.FetchRequest=w;class v{#O;#R;#b;#E;#U;#L;toString(){return`<FetchResponse status=${this.statusCode} body=${this.#E?(0,i.hexlify)(this.#E):"null"}>`}get statusCode(){return this.#O}get statusMessage(){return this.#R}get headers(){return Object.assign({},this.#b)}get body(){return null==this.#E?null:new Uint8Array(this.#E)}get bodyText(){try{return null==this.#E?"":(0,o.toUtf8String)(this.#E)}catch(e){(0,s.assert)(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch(e){(0,s.assert)(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,t=Object.keys(e);let r=0;return{next:()=>{if(r<t.length){const n=t[r++];return{value:[n,e[n]],done:!1}}return{value:void 0,done:!0}}}}constructor(e,t,r,n,i){this.#O=e,this.#R=t,this.#b=Object.keys(r).reduce((e,t)=>(e[t.toLowerCase()]=String(r[t]),e),{}),this.#E=null==n?null:new Uint8Array(n),this.#U=i||null,this.#L={message:""}}makeServerError(e,t){let r;r=e?`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})`:`CLIENT ESCALATED SERVER ERROR (${e=`${this.statusCode} ${this.statusMessage}`})`;const n=new v(599,r,this.headers,this.body,this.#U||void 0);return n.#L={message:e,error:t},n}throwThrottleError(e,t){null==t?t=-1:(0,s.assertArgument)(Number.isInteger(t)&&t>=0,"invalid stall timeout","stall",t);const r=new Error(e||"throttling requests");throw(0,a.defineProperties)(r,{stall:t,throttle:!0}),r}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return null!=this.#E}get request(){return this.#U}ok(){return""===this.#L.message&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:t}=this.#L;""===e&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let r=null;this.request&&(r=this.request.url);let n=null;try{this.#E&&(n=(0,o.toUtf8String)(this.#E))}catch(e){}(0,s.assert)(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:t,info:{requestUrl:r,responseBody:n,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}}function A(){return(new Date).getTime()}t.FetchResponse=v},597:(e,t,r)=>{var n=r(4643);r(8550),n.cipher=n.cipher||{};var i=e.exports=n.cipher.modes=n.cipher.modes||{};function s(e,t){if("string"==typeof e&&(e=n.util.createBuffer(e)),n.util.isArray(e)&&e.length>4){var r=e;e=n.util.createBuffer();for(var i=0;i<r.length;++i)e.putByte(r[i])}if(e.length()<t)throw new Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!n.util.isArray(e)){var s=[],a=t/4;for(i=0;i<a;++i)s.push(e.getInt32());e=s}return e}function a(e){e[e.length-1]=e[e.length-1]+1&4294967295}function o(e){return[e/4294967296|0,4294967295&e]}i.ecb=function(e){e=e||{},this.name="ECB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.ecb.prototype.start=function(e){},i.ecb.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},i.ecb.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},i.ecb.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},i.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},i.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.cbc.prototype.start=function(e){if(null===e.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=s(e.iv,this.blockSize),this._prev=this._iv.slice(0)}},i.cbc.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=this._prev[n]^e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]);this._prev=this._outBlock},i.cbc.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)},i.cbc.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},i.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},i.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=s(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.cfb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32()^this._outBlock[i],t.putInt32(this._inBlock[i]);else{var s=(this.blockSize-n)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(s>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.cfb.prototype.decrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32(),t.putInt32(this._inBlock[i]^this._outBlock[i]);else{var s=(this.blockSize-n)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(s>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=s(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ofb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===e.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];else{var s=(this.blockSize-n)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(s>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb.prototype.decrypt=i.ofb.prototype.encrypt,i.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=s(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ctr.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]);else{var s=(this.blockSize-n)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(s>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return t.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}a(this._inBlock)},i.ctr.prototype.decrypt=i.ctr.prototype.encrypt,i.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0,this._R=3774873600},i.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t,r=n.util.createBuffer(e.iv);if(this._cipherLength=0,t="additionalData"in e?n.util.createBuffer(e.additionalData):n.util.createBuffer(),this._tagLength="tagLength"in e?e.tagLength:128,this._tag=null,e.decrypt&&(this._tag=n.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var i=r.length();if(12===i)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(o(8*i)))}this._inBlock=this._j0.slice(0),a(this._inBlock),this._partialBytes=0,t=n.util.createBuffer(t),this._aDataLength=o(8*t.length());var s=t.length()%this.blockSize;for(s&&t.fillWithByte(0,this.blockSize-s),this._s=[0,0,0,0];t.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()])},i.gcm.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^=e.getInt32());this._cipherLength+=this.blockSize}else{var s=(this.blockSize-n)%this.blockSize;s>0&&(s=this.blockSize-s),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(s<=0||r){if(r){var o=n%this.blockSize;this._cipherLength+=o,this._partialOutput.truncate(this.blockSize-o)}else this._cipherLength+=this.blockSize;for(i=0;i<this._ints;++i)this._outBlock[i]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),s>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(s-this._partialBytes)),this._partialBytes=s,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),a(this._inBlock)},i.gcm.prototype.decrypt=function(e,t,r){var n=e.length();if(n<this.blockSize&&!(r&&n>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),a(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^this._hashBlock[i]);n<this.blockSize?this._cipherLength+=n%this.blockSize:this._cipherLength+=this.blockSize},i.gcm.prototype.afterFinish=function(e,t){var r=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=n.util.createBuffer();var i=this._aDataLength.concat(o(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,i);var s=[];this.cipher.encrypt(this._j0,s);for(var a=0;a<this._ints;++a)this.tag.putInt32(this._s[a]^s[a]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r},i.gcm.prototype.multiply=function(e,t){for(var r=[0,0,0,0],n=t.slice(0),i=0;i<128;++i){e[i/32|0]&1<<31-i%32&&(r[0]^=n[0],r[1]^=n[1],r[2]^=n[2],r[3]^=n[3]),this.pow(n,n)}return r},i.gcm.prototype.pow=function(e,t){for(var r=1&e[3],n=3;n>0;--n)t[n]=e[n]>>>1|(1&e[n-1])<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)},i.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var n=e[r/8|0]>>>4*(7-r%8)&15,i=this._m[r][n];t[0]^=i[0],t[1]^=i[1],t[2]^=i[2],t[3]^=i[3]}return t},i.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)},i.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,n=4*r,i=16*r,s=new Array(i),a=0;a<i;++a){var o=[0,0,0,0],c=(n-1-a%n)*t;o[a/n|0]=1<<t-1<<c,s[a]=this.generateSubHashTable(this.multiply(o,e),t)}return s},i.gcm.prototype.generateSubHashTable=function(e,t){var r=1<<t,n=r>>>1,i=new Array(r);i[n]=e.slice(0);for(var s=n>>>1;s>0;)this.pow(i[2*s],i[s]=[]),s>>=1;for(s=2;s<n;){for(var a=1;a<s;++a){var o=i[s],c=i[a];i[s+a]=[o[0]^c[0],o[1]^c[1],o[2]^c[2],o[3]^c[3]]}s*=2}for(i[0]=[0,0,0,0],s=n+1;s<r;++s){var u=i[s^n];i[s]=[e[0]^u[0],e[1]^u[1],e[2]^u[2],e[3]^u[3]]}return i}},628:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.verifyAuthorization=t.hashAuthorization=void 0;const n=r(6107),i=r(6468),s=r(203),a=r(8718);function o(e){return(0,a.assertArgument)("string"==typeof e.address,"invalid address for hashAuthorization","auth.address",e),(0,i.keccak256)((0,a.concat)(["0x05",(0,a.encodeRlp)([null!=e.chainId?(0,a.toBeArray)(e.chainId):"0x",(0,n.getAddress)(e.address),null!=e.nonce?(0,a.toBeArray)(e.nonce):"0x"])]))}t.hashAuthorization=o,t.verifyAuthorization=function(e,t){return(0,s.recoverAddress)(o(e),t)}},747:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapToCurveSimpleSWU=t.SWUFpSqrtRatio=t.weierstrass=t.weierstrassPoints=t.DER=void 0;const n=r(1537),i=r(5226),s=r(5226),a=r(8572);const{bytesToNumberBE:o,hexToBytes:c}=i;t.DER={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){const{Err:r}=t.DER;if(e.length<2||2!==e[0])throw new r("Invalid signature integer tag");const n=e[1],i=e.subarray(2,n+2);if(!n||i.length!==n)throw new r("Invalid signature integer: wrong length");if(128&i[0])throw new r("Invalid signature integer: negative");if(0===i[0]&&!(128&i[1]))throw new r("Invalid signature integer: unnecessary leading zero");return{d:o(i),l:e.subarray(n+2)}},toSig(e){const{Err:r}=t.DER,n="string"==typeof e?c(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let i=n.length;if(i<2||48!=n[0])throw new r("Invalid signature tag");if(n[1]!==i-2)throw new r("Invalid signature: incorrect length");const{d:s,l:a}=t.DER._parseInt(n.subarray(2)),{d:o,l:u}=t.DER._parseInt(a);if(u.length)throw new r("Invalid signature: left bytes after parsing");return{r:s,s:o}},hexFromSig(e){const t=e=>8&Number.parseInt(e[0],16)?"00"+e:e,r=e=>{const t=e.toString(16);return 1&t.length?`0${t}`:t},n=t(r(e.s)),i=t(r(e.r)),s=n.length/2,a=i.length/2,o=r(s),c=r(a);return`30${r(a+s+4)}02${c}${i}02${o}${n}`}};const u=BigInt(0),l=BigInt(1),h=BigInt(2),d=BigInt(3),f=BigInt(4);function p(e){const t=function(e){const t=(0,a.validateBasic)(e);i.validateObject(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:n,a:s}=t;if(r){if(!n.eql(s,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:r}=t,o=t.toBytes||((e,t,n)=>{const s=t.toAffine();return i.concatBytes(Uint8Array.from([4]),r.toBytes(s.x),r.toBytes(s.y))}),c=t.fromBytes||(e=>{const t=e.subarray(1);return{x:r.fromBytes(t.subarray(0,r.BYTES)),y:r.fromBytes(t.subarray(r.BYTES,2*r.BYTES))}});function h(e){const{a:n,b:i}=t,s=r.sqr(e),a=r.mul(s,e);return r.add(r.add(a,r.mul(e,n)),i)}if(!r.eql(r.sqr(t.Gy),h(t.Gx)))throw new Error("bad generator point: equation left != right");function f(e){return"bigint"==typeof e&&u<e&&e<t.n}function p(e){if(!f(e))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function g(e){const{allowedPrivateKeyLengths:r,nByteLength:a,wrapPrivateKey:o,n:c}=t;if(r&&"bigint"!=typeof e){if(e instanceof Uint8Array&&(e=i.bytesToHex(e)),"string"!=typeof e||!r.includes(e.length))throw new Error("Invalid key");e=e.padStart(2*a,"0")}let u;try{u="bigint"==typeof e?e:i.bytesToNumberBE((0,s.ensureBytes)("private key",e,a))}catch(t){throw new Error(`private key must be ${a} bytes, hex or bigint, not ${typeof e}`)}return o&&(u=n.mod(u,c)),p(u),u}const y=new Map;function m(e){if(!(e instanceof b))throw new Error("ProjectivePoint expected")}class b{constructor(e,t,n){if(this.px=e,this.py=t,this.pz=n,null==e||!r.isValid(e))throw new Error("x required");if(null==t||!r.isValid(t))throw new Error("y required");if(null==n||!r.isValid(n))throw new Error("z required")}static fromAffine(e){const{x:t,y:n}=e||{};if(!e||!r.isValid(t)||!r.isValid(n))throw new Error("invalid affine point");if(e instanceof b)throw new Error("projective point not allowed");const i=e=>r.eql(e,r.ZERO);return i(t)&&i(n)?b.ZERO:new b(t,n,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const t=r.invertBatch(e.map(e=>e.pz));return e.map((e,r)=>e.toAffine(t[r])).map(b.fromAffine)}static fromHex(e){const t=b.fromAffine(c((0,s.ensureBytes)("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return b.BASE.multiply(g(e))}_setWindowSize(e){this._WINDOW_SIZE=e,y.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:e,y:n}=this.toAffine();if(!r.isValid(e)||!r.isValid(n))throw new Error("bad point: x or y not FE");const i=r.sqr(n),s=h(e);if(!r.eql(i,s))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:e}=this.toAffine();if(r.isOdd)return!r.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){m(e);const{px:t,py:n,pz:i}=this,{px:s,py:a,pz:o}=e,c=r.eql(r.mul(t,o),r.mul(s,i)),u=r.eql(r.mul(n,o),r.mul(a,i));return c&&u}negate(){return new b(this.px,r.neg(this.py),this.pz)}double(){const{a:e,b:n}=t,i=r.mul(n,d),{px:s,py:a,pz:o}=this;let c=r.ZERO,u=r.ZERO,l=r.ZERO,h=r.mul(s,s),f=r.mul(a,a),p=r.mul(o,o),g=r.mul(s,a);return g=r.add(g,g),l=r.mul(s,o),l=r.add(l,l),c=r.mul(e,l),u=r.mul(i,p),u=r.add(c,u),c=r.sub(f,u),u=r.add(f,u),u=r.mul(c,u),c=r.mul(g,c),l=r.mul(i,l),p=r.mul(e,p),g=r.sub(h,p),g=r.mul(e,g),g=r.add(g,l),l=r.add(h,h),h=r.add(l,h),h=r.add(h,p),h=r.mul(h,g),u=r.add(u,h),p=r.mul(a,o),p=r.add(p,p),h=r.mul(p,g),c=r.sub(c,h),l=r.mul(p,f),l=r.add(l,l),l=r.add(l,l),new b(c,u,l)}add(e){m(e);const{px:n,py:i,pz:s}=this,{px:a,py:o,pz:c}=e;let u=r.ZERO,l=r.ZERO,h=r.ZERO;const f=t.a,p=r.mul(t.b,d);let g=r.mul(n,a),y=r.mul(i,o),w=r.mul(s,c),v=r.add(n,i),A=r.add(a,o);v=r.mul(v,A),A=r.add(g,y),v=r.sub(v,A),A=r.add(n,s);let E=r.add(a,c);return A=r.mul(A,E),E=r.add(g,w),A=r.sub(A,E),E=r.add(i,s),u=r.add(o,c),E=r.mul(E,u),u=r.add(y,w),E=r.sub(E,u),h=r.mul(f,A),u=r.mul(p,w),h=r.add(u,h),u=r.sub(y,h),h=r.add(y,h),l=r.mul(u,h),y=r.add(g,g),y=r.add(y,g),w=r.mul(f,w),A=r.mul(p,A),y=r.add(y,w),w=r.sub(g,w),w=r.mul(f,w),A=r.add(A,w),g=r.mul(y,A),l=r.add(l,g),g=r.mul(E,A),u=r.mul(v,u),u=r.sub(u,g),g=r.mul(v,y),h=r.mul(E,h),h=r.add(h,g),new b(u,l,h)}subtract(e){return this.add(e.negate())}is0(){return this.equals(b.ZERO)}wNAF(e){return v.wNAFCached(this,y,e,e=>{const t=r.invertBatch(e.map(e=>e.pz));return e.map((e,r)=>e.toAffine(t[r])).map(b.fromAffine)})}multiplyUnsafe(e){const n=b.ZERO;if(e===u)return n;if(p(e),e===l)return this;const{endo:i}=t;if(!i)return v.unsafeLadder(this,e);let{k1neg:s,k1:a,k2neg:o,k2:c}=i.splitScalar(e),h=n,d=n,f=this;for(;a>u||c>u;)a&l&&(h=h.add(f)),c&l&&(d=d.add(f)),f=f.double(),a>>=l,c>>=l;return s&&(h=h.negate()),o&&(d=d.negate()),d=new b(r.mul(d.px,i.beta),d.py,d.pz),h.add(d)}multiply(e){p(e);let n,i,s=e;const{endo:a}=t;if(a){const{k1neg:e,k1:t,k2neg:o,k2:c}=a.splitScalar(s);let{p:u,f:l}=this.wNAF(t),{p:h,f:d}=this.wNAF(c);u=v.constTimeNegate(e,u),h=v.constTimeNegate(o,h),h=new b(r.mul(h.px,a.beta),h.py,h.pz),n=u.add(h),i=l.add(d)}else{const{p:e,f:t}=this.wNAF(s);n=e,i=t}return b.normalizeZ([n,i])[0]}multiplyAndAddUnsafe(e,t,r){const n=b.BASE,i=(e,t)=>t!==u&&t!==l&&e.equals(n)?e.multiply(t):e.multiplyUnsafe(t),s=i(this,t).add(i(e,r));return s.is0()?void 0:s}toAffine(e){const{px:t,py:n,pz:i}=this,s=this.is0();null==e&&(e=s?r.ONE:r.inv(i));const a=r.mul(t,e),o=r.mul(n,e),c=r.mul(i,e);if(s)return{x:r.ZERO,y:r.ZERO};if(!r.eql(c,r.ONE))throw new Error("invZ was invalid");return{x:a,y:o}}isTorsionFree(){const{h:e,isTorsionFree:r}=t;if(e===l)return!0;if(r)return r(b,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:r}=t;return e===l?this:r?r(b,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return this.assertValidity(),o(b,this,e)}toHex(e=!0){return i.bytesToHex(this.toRawBytes(e))}}b.BASE=new b(t.Gx,t.Gy,r.ONE),b.ZERO=new b(r.ZERO,r.ONE,r.ZERO);const w=t.nBitLength,v=(0,a.wNAF)(b,t.endo?Math.ceil(w/2):w);return{CURVE:t,ProjectivePoint:b,normPrivateKeyToScalar:g,weierstrassEquation:h,isWithinCurveOrder:f}}function g(e,t){const r=e.ORDER;let n=u;for(let e=r-l;e%h===u;e/=h)n+=l;const i=n,s=h<<i-l-l,a=s*h,o=(r-l)/a,c=(o-l)/h,p=a-l,g=s,y=e.pow(t,o),m=e.pow(t,(o+l)/h);let b=(t,r)=>{let n=y,s=e.pow(r,p),a=e.sqr(s);a=e.mul(a,r);let o=e.mul(t,a);o=e.pow(o,c),o=e.mul(o,s),s=e.mul(o,r),a=e.mul(o,t);let u=e.mul(a,s);o=e.pow(u,g);let d=e.eql(o,e.ONE);s=e.mul(a,m),o=e.mul(u,n),a=e.cmov(s,a,d),u=e.cmov(o,u,d);for(let t=i;t>l;t--){let r=t-h;r=h<<r-l;let i=e.pow(u,r);const o=e.eql(i,e.ONE);s=e.mul(a,n),n=e.mul(n,n),i=e.mul(u,n),a=e.cmov(s,a,o),u=e.cmov(i,u,o)}return{isValid:d,value:a}};if(e.ORDER%f===d){const r=(e.ORDER-d)/f,n=e.sqrt(e.neg(t));b=(t,i)=>{let s=e.sqr(i);const a=e.mul(t,i);s=e.mul(s,a);let o=e.pow(s,r);o=e.mul(o,a);const c=e.mul(o,n),u=e.mul(e.sqr(o),i),l=e.eql(u,t);return{isValid:l,value:e.cmov(c,o,l)}}}return b}t.weierstrassPoints=p,t.weierstrass=function(e){const r=function(e){const t=(0,a.validateBasic)(e);return i.validateObject(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:o,n:c}=r,h=o.BYTES+1,d=2*o.BYTES+1;function f(e){return n.mod(e,c)}function g(e){return n.invert(e,c)}const{ProjectivePoint:y,normPrivateKeyToScalar:m,weierstrassEquation:b,isWithinCurveOrder:w}=p({...r,toBytes(e,t,r){const n=t.toAffine(),s=o.toBytes(n.x),a=i.concatBytes;return r?a(Uint8Array.from([t.hasEvenY()?2:3]),s):a(Uint8Array.from([4]),s,o.toBytes(n.y))},fromBytes(e){const t=e.length,r=e[0],n=e.subarray(1);if(t!==h||2!==r&&3!==r){if(t===d&&4===r){return{x:o.fromBytes(n.subarray(0,o.BYTES)),y:o.fromBytes(n.subarray(o.BYTES,2*o.BYTES))}}throw new Error(`Point of length ${t} was invalid. Expected ${h} compressed bytes or ${d} uncompressed bytes`)}{const e=i.bytesToNumberBE(n);if(!(u<(s=e)&&s<o.ORDER))throw new Error("Point is not on curve");const t=b(e);let a=o.sqrt(t);return!(1&~r)!==((a&l)===l)&&(a=o.neg(a)),{x:e,y:a}}var s}}),v=e=>i.bytesToHex(i.numberToBytesBE(e,r.nByteLength));function A(e){return e>c>>l}const E=(e,t,r)=>i.bytesToNumberBE(e.slice(t,r));class C{constructor(e,t,r){this.r=e,this.s=t,this.recovery=r,this.assertValidity()}static fromCompact(e){const t=r.nByteLength;return e=(0,s.ensureBytes)("compactSignature",e,2*t),new C(E(e,0,t),E(e,t,2*t))}static fromDER(e){const{r,s:n}=t.DER.toSig((0,s.ensureBytes)("DER",e));return new C(r,n)}assertValidity(){if(!w(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!w(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new C(this.r,this.s,e)}recoverPublicKey(e){const{r:t,s:n,recovery:i}=this,a=T((0,s.ensureBytes)("msgHash",e));if(null==i||![0,1,2,3].includes(i))throw new Error("recovery id invalid");const c=2===i||3===i?t+r.n:t;if(c>=o.ORDER)throw new Error("recovery id 2 or 3 invalid");const u=1&i?"03":"02",l=y.fromHex(u+v(c)),h=g(c),d=f(-a*h),p=f(n*h),m=y.BASE.multiplyAndAddUnsafe(l,d,p);if(!m)throw new Error("point at infinify");return m.assertValidity(),m}hasHighS(){return A(this.s)}normalizeS(){return this.hasHighS()?new C(this.r,f(-this.s),this.recovery):this}toDERRawBytes(){return i.hexToBytes(this.toDERHex())}toDERHex(){return t.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return i.hexToBytes(this.toCompactHex())}toCompactHex(){return v(this.r)+v(this.s)}}const B={isValidPrivateKey(e){try{return m(e),!0}catch(e){return!1}},normPrivateKeyToScalar:m,randomPrivateKey:()=>{const e=n.getMinHashLength(r.n);return n.mapHashToField(r.randomBytes(e),r.n)},precompute:(e=8,t=y.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};function S(e){const t=e instanceof Uint8Array,r="string"==typeof e,n=(t||r)&&e.length;return t?n===h||n===d:r?n===2*h||n===2*d:e instanceof y}const k=r.bits2int||function(e){const t=i.bytesToNumberBE(e),n=8*e.length-r.nBitLength;return n>0?t>>BigInt(n):t},T=r.bits2int_modN||function(e){return f(k(e))},I=i.bitMask(r.nBitLength);function P(e){if("bigint"!=typeof e)throw new Error("bigint expected");if(!(u<=e&&e<I))throw new Error(`bigint expected < 2^${r.nBitLength}`);return i.numberToBytesBE(e,r.nByteLength)}function N(e,t,n=x){if(["recovered","canonical"].some(e=>e in n))throw new Error("sign() legacy options not supported");const{hash:a,randomBytes:c}=r;let{lowS:h,prehash:d,extraEntropy:p}=n;null==h&&(h=!0),e=(0,s.ensureBytes)("msgHash",e),d&&(e=(0,s.ensureBytes)("prehashed msgHash",a(e)));const b=T(e),v=m(t),E=[P(v),P(b)];if(null!=p){const e=!0===p?c(o.BYTES):p;E.push((0,s.ensureBytes)("extraEntropy",e))}const B=i.concatBytes(...E),S=b;return{seed:B,k2sig:function(e){const t=k(e);if(!w(t))return;const r=g(t),n=y.BASE.multiply(t).toAffine(),i=f(n.x);if(i===u)return;const s=f(r*f(S+i*v));if(s===u)return;let a=(n.x===i?0:2)|Number(n.y&l),o=s;return h&&A(s)&&(o=function(e){return A(e)?f(-e):e}(s),a^=1),new C(i,o,a)}}}const x={lowS:r.lowS,prehash:!1},O={lowS:r.lowS,prehash:!1};return y.BASE._setWindowSize(8),{CURVE:r,getPublicKey:function(e,t=!0){return y.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,r=!0){if(S(e))throw new Error("first arg must be private key");if(!S(t))throw new Error("second arg must be public key");return y.fromHex(t).multiply(m(e)).toRawBytes(r)},sign:function(e,t,n=x){const{seed:s,k2sig:a}=N(e,t,n),o=r;return i.createHmacDrbg(o.hash.outputLen,o.nByteLength,o.hmac)(s,a)},verify:function(e,n,i,a=O){const o=e;if(n=(0,s.ensureBytes)("msgHash",n),i=(0,s.ensureBytes)("publicKey",i),"strict"in a)throw new Error("options.strict was renamed to lowS");const{lowS:c,prehash:u}=a;let l,h;try{if("string"==typeof o||o instanceof Uint8Array)try{l=C.fromDER(o)}catch(e){if(!(e instanceof t.DER.Err))throw e;l=C.fromCompact(o)}else{if("object"!=typeof o||"bigint"!=typeof o.r||"bigint"!=typeof o.s)throw new Error("PARSE");{const{r:e,s:t}=o;l=new C(e,t)}}h=y.fromHex(i)}catch(e){if("PARSE"===e.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(c&&l.hasHighS())return!1;u&&(n=r.hash(n));const{r:d,s:p}=l,m=T(n),b=g(p),w=f(m*b),v=f(d*b),A=y.BASE.multiplyAndAddUnsafe(h,w,v)?.toAffine();return!!A&&f(A.x)===d},ProjectivePoint:y,Signature:C,utils:B}},t.SWUFpSqrtRatio=g,t.mapToCurveSimpleSWU=function(e,t){if(n.validateField(e),!e.isValid(t.A)||!e.isValid(t.B)||!e.isValid(t.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const r=g(e,t.Z);if(!e.isOdd)throw new Error("Fp.isOdd is not implemented!");return n=>{let i,s,a,o,c,u,l,h;i=e.sqr(n),i=e.mul(i,t.Z),s=e.sqr(i),s=e.add(s,i),a=e.add(s,e.ONE),a=e.mul(a,t.B),o=e.cmov(t.Z,e.neg(s),!e.eql(s,e.ZERO)),o=e.mul(o,t.A),s=e.sqr(a),u=e.sqr(o),c=e.mul(u,t.A),s=e.add(s,c),s=e.mul(s,a),u=e.mul(u,o),c=e.mul(u,t.B),s=e.add(s,c),l=e.mul(i,a);const{isValid:d,value:f}=r(s,u);h=e.mul(i,n),h=e.mul(h,f),l=e.cmov(l,a,d),h=e.cmov(h,f,d);const p=e.isOdd(n)===e.isOdd(h);return h=e.cmov(e.neg(h),h,p),l=e.div(l,o),{x:l,y:h}}}},773:(e,t,r)=>{var n=r(3372).Buffer,i=r(4643);r(121),r(5417),r(260),r(8550);var s=r(5628),a=s.publicKeyValidator,o=s.privateKeyValidator;if(void 0===c)var c=i.jsbn.BigInteger;var u=i.util.ByteBuffer,l=void 0===n?Uint8Array:n;i.pki=i.pki||{},e.exports=i.pki.ed25519=i.ed25519=i.ed25519||{};var h=i.ed25519;function d(e){var t=e.message;if(t instanceof Uint8Array||t instanceof l)return t;var r=e.encoding;if(void 0===t){if(!e.md)throw new TypeError('"options.message" or "options.md" not specified.');t=e.md.digest().getBytes(),r="binary"}if("string"==typeof t&&!r)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if("string"==typeof t){if(void 0!==n)return n.from(t,r);t=new u(t,r)}else if(!(t instanceof u))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var i=new l(t.length()),s=0;s<i.length;++s)i[s]=t.at(s);return i}h.constants={},h.constants.PUBLIC_KEY_BYTE_LENGTH=32,h.constants.PRIVATE_KEY_BYTE_LENGTH=64,h.constants.SEED_BYTE_LENGTH=32,h.constants.SIGN_BYTE_LENGTH=64,h.constants.HASH_BYTE_LENGTH=64,h.generateKeyPair=function(e){var t=(e=e||{}).seed;if(void 0===t)t=i.random.getBytesSync(h.constants.SEED_BYTE_LENGTH);else if("string"==typeof t){if(t.length!==h.constants.SEED_BYTE_LENGTH)throw new TypeError('"seed" must be '+h.constants.SEED_BYTE_LENGTH+" bytes in length.")}else if(!(t instanceof Uint8Array))throw new TypeError('"seed" must be a node.js Buffer, Uint8Array, or a binary string.');t=d({message:t,encoding:"binary"});for(var r=new l(h.constants.PUBLIC_KEY_BYTE_LENGTH),n=new l(h.constants.PRIVATE_KEY_BYTE_LENGTH),s=0;s<32;++s)n[s]=t[s];return function(e,t){var r,n=[D(),D(),D(),D()],i=A(t,32);for(i[0]&=248,i[31]&=127,i[31]|=64,O(n,i),k(e,n),r=0;r<32;++r)t[r+32]=e[r]}(r,n),{publicKey:r,privateKey:n}},h.privateKeyFromAsn1=function(e){var t={},r=[];if(!i.asn1.validate(e,o,t,r)){var n=new Error("Invalid Key.");throw n.errors=r,n}var s=i.asn1.derToOid(t.privateKeyOid),a=i.oids.EdDSA25519;if(s!==a)throw new Error('Invalid OID "'+s+'"; OID must be "'+a+'".');var c=t.privateKey;return{privateKeyBytes:d({message:i.asn1.fromDer(c).value,encoding:"binary"})}},h.publicKeyFromAsn1=function(e){var t={},r=[];if(!i.asn1.validate(e,a,t,r)){var n=new Error("Invalid Key.");throw n.errors=r,n}var s=i.asn1.derToOid(t.publicKeyOid),o=i.oids.EdDSA25519;if(s!==o)throw new Error('Invalid OID "'+s+'"; OID must be "'+o+'".');var c=t.ed25519PublicKey;if(c.length!==h.constants.PUBLIC_KEY_BYTE_LENGTH)throw new Error("Key length is invalid.");return d({message:c,encoding:"binary"})},h.publicKeyFromPrivateKey=function(e){var t=d({message:(e=e||{}).privateKey,encoding:"binary"});if(t.length!==h.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+h.constants.PRIVATE_KEY_BYTE_LENGTH);for(var r=new l(h.constants.PUBLIC_KEY_BYTE_LENGTH),n=0;n<r.length;++n)r[n]=t[32+n];return r},h.sign=function(e){var t=d(e=e||{}),r=d({message:e.privateKey,encoding:"binary"});if(r.length===h.constants.SEED_BYTE_LENGTH)r=h.generateKeyPair({seed:r}).privateKey;else if(r.length!==h.constants.PRIVATE_KEY_BYTE_LENGTH)throw new TypeError('"options.privateKey" must have a byte length of '+h.constants.SEED_BYTE_LENGTH+" or "+h.constants.PRIVATE_KEY_BYTE_LENGTH);var n=new l(h.constants.SIGN_BYTE_LENGTH+t.length);!function(e,t,r,n){var i,s,a=new Float64Array(64),o=[D(),D(),D(),D()],c=A(n,32);c[0]&=248,c[31]&=127,c[31]|=64;var u=r+64;for(i=0;i<r;++i)e[64+i]=t[i];for(i=0;i<32;++i)e[32+i]=c[32+i];var l=A(e.subarray(32),r+32);for(C(l),O(o,l),k(e,o),i=32;i<64;++i)e[i]=n[i];var h=A(e,r+64);for(C(h),i=32;i<64;++i)a[i]=0;for(i=0;i<32;++i)a[i]=l[i];for(i=0;i<32;++i)for(s=0;s<32;s++)a[i+s]+=h[i]*c[s];E(e.subarray(32),a)}(n,t,t.length,r);for(var i=new l(h.constants.SIGN_BYTE_LENGTH),s=0;s<i.length;++s)i[s]=n[s];return i},h.verify=function(e){var t=d(e=e||{});if(void 0===e.signature)throw new TypeError('"options.signature" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a binary string.');var r=d({message:e.signature,encoding:"binary"});if(r.length!==h.constants.SIGN_BYTE_LENGTH)throw new TypeError('"options.signature" must have a byte length of '+h.constants.SIGN_BYTE_LENGTH);var n=d({message:e.publicKey,encoding:"binary"});if(n.length!==h.constants.PUBLIC_KEY_BYTE_LENGTH)throw new TypeError('"options.publicKey" must have a byte length of '+h.constants.PUBLIC_KEY_BYTE_LENGTH);var i,s=new l(h.constants.SIGN_BYTE_LENGTH+t.length),a=new l(h.constants.SIGN_BYTE_LENGTH+t.length);for(i=0;i<h.constants.SIGN_BYTE_LENGTH;++i)s[i]=r[i];for(i=0;i<t.length;++i)s[i+h.constants.SIGN_BYTE_LENGTH]=t[i];return function(e,t,r,n){var i,s=new l(32),a=[D(),D(),D(),D()],o=[D(),D(),D(),D()];if(r<64)return-1;if(function(e,t){var r=D(),n=D(),i=D(),s=D(),a=D(),o=D(),c=D();R(e[2],p),function(e,t){var r;for(r=0;r<16;++r)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}(e[1],t),j(i,e[1]),K(s,i,g),M(i,i,e[2]),F(s,e[2],s),j(a,s),j(o,a),K(c,o,a),K(r,c,i),K(r,r,s),function(e,t){var r,n=D();for(r=0;r<16;++r)n[r]=t[r];for(r=250;r>=0;--r)j(n,n),1!==r&&K(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}(r,r),K(r,r,i),K(r,r,s),K(r,r,s),K(e[0],r,s),j(n,e[0]),K(n,n,s),I(n,i)&&K(e[0],e[0],v);if(j(n,e[0]),K(n,n,s),I(n,i))return-1;N(e[0])===t[31]>>7&&M(e[0],f,e[0]);return K(e[3],e[0],e[1]),0}(o,n))return-1;for(i=0;i<r;++i)e[i]=t[i];for(i=0;i<32;++i)e[i+32]=n[i];var c=A(e,r);if(C(c),x(a,o,c),O(o,t.subarray(32)),B(a,o),k(s,a),r-=64,P(t,0,s,0)){for(i=0;i<r;++i)e[i]=0;return-1}for(i=0;i<r;++i)e[i]=t[i+64];return r}(a,s,s.length,n)>=0};var f=D(),p=D([1]),g=D([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),y=D([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),m=D([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),b=D([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),w=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),v=D([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function A(e,t){var r=i.md.sha512.create(),s=new u(e);r.update(s.getBytes(t),"binary");var a=r.digest().getBytes();if(void 0!==n)return n.from(a,"binary");for(var o=new l(h.constants.HASH_BYTE_LENGTH),c=0;c<64;++c)o[c]=a.charCodeAt(c);return o}function E(e,t){var r,n,i,s;for(n=63;n>=32;--n){for(r=0,i=n-32,s=n-12;i<s;++i)t[i]+=r-16*t[n]*w[i-(n-32)],r=t[i]+128>>8,t[i]-=256*r;t[i]+=r,t[n]=0}for(r=0,i=0;i<32;++i)t[i]+=r-(t[31]>>4)*w[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;++i)t[i]-=r*w[i];for(n=0;n<32;++n)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function C(e){for(var t=new Float64Array(64),r=0;r<64;++r)t[r]=e[r],e[r]=0;E(e,t)}function B(e,t){var r=D(),n=D(),i=D(),s=D(),a=D(),o=D(),c=D(),u=D(),l=D();M(r,e[1],e[0]),M(l,t[1],t[0]),K(r,r,l),F(n,e[0],e[1]),F(l,t[0],t[1]),K(n,n,l),K(i,e[3],t[3]),K(i,i,y),K(s,e[2],t[2]),F(s,s,s),M(a,n,r),M(o,s,i),F(c,s,i),F(u,n,r),K(e[0],a,o),K(e[1],u,c),K(e[2],c,o),K(e[3],a,u)}function S(e,t,r){for(var n=0;n<4;++n)L(e[n],t[n],r)}function k(e,t){var r=D(),n=D(),i=D();!function(e,t){var r,n=D();for(r=0;r<16;++r)n[r]=t[r];for(r=253;r>=0;--r)j(n,n),2!==r&&4!==r&&K(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}(i,t[2]),K(r,t[0],i),K(n,t[1],i),T(e,n),e[31]^=N(r)<<7}function T(e,t){var r,n,i,s=D(),a=D();for(r=0;r<16;++r)a[r]=t[r];for(U(a),U(a),U(a),n=0;n<2;++n){for(s[0]=a[0]-65517,r=1;r<15;++r)s[r]=a[r]-65535-(s[r-1]>>16&1),s[r-1]&=65535;s[15]=a[15]-32767-(s[14]>>16&1),i=s[15]>>16&1,s[14]&=65535,L(a,s,1-i)}for(r=0;r<16;r++)e[2*r]=255&a[r],e[2*r+1]=a[r]>>8}function I(e,t){var r=new l(32),n=new l(32);return T(r,e),T(n,t),P(r,0,n,0)}function P(e,t,r,n){return function(e,t,r,n,i){var s,a=0;for(s=0;s<i;++s)a|=e[t+s]^r[n+s];return(1&a-1>>>8)-1}(e,t,r,n,32)}function N(e){var t=new l(32);return T(t,e),1&t[0]}function x(e,t,r){var n,i;for(R(e[0],f),R(e[1],p),R(e[2],p),R(e[3],f),i=255;i>=0;--i)S(e,t,n=r[i/8|0]>>(7&i)&1),B(t,e),B(e,e),S(e,t,n)}function O(e,t){var r=[D(),D(),D(),D()];R(r[0],m),R(r[1],b),R(r[2],p),K(r[3],m,b),x(e,r,t)}function R(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function U(e){var t,r,n=1;for(t=0;t<16;++t)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function L(e,t,r){for(var n,i=~(r-1),s=0;s<16;++s)n=i&(e[s]^t[s]),e[s]^=n,t[s]^=n}function D(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;++t)r[t]=e[t];return r}function F(e,t,r){for(var n=0;n<16;++n)e[n]=t[n]+r[n]}function M(e,t,r){for(var n=0;n<16;++n)e[n]=t[n]-r[n]}function j(e,t){K(e,t,t)}function K(e,t,r){var n,i,s=0,a=0,o=0,c=0,u=0,l=0,h=0,d=0,f=0,p=0,g=0,y=0,m=0,b=0,w=0,v=0,A=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H),h+=38*(T+=n*_),d+=38*(I+=n*G),f+=38*(P+=n*z),p+=38*(N+=n*q),g+=38*(x+=n*Q),y+=38*(O+=n*W),m+=38*(R+=n*J),b+=38*(U+=n*Y),w+=38*(L+=n*Z),s=(n=(s+=38*(A+=n*F))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=(s+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),s+=i-1+37*(i-1),e[0]=s,e[1]=a,e[2]=o,e[3]=c,e[4]=u,e[5]=l,e[6]=h,e[7]=d,e[8]=f,e[9]=p,e[10]=g,e[11]=y,e[12]=m,e[13]=b,e[14]=w,e[15]=v}},832:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keccak256=void 0;const n=r(2001),i=r(8718);let s=!1;const a=function(e){return(0,n.keccak_256)(e)};let o=a;function c(e){const t=(0,i.getBytes)(e,"data");return(0,i.hexlify)(o(t))}t.keccak256=c,c._=a,c.lock=function(){s=!0},c.register=function(e){if(s)throw new TypeError("keccak256 is locked");o=e},Object.freeze(c)},846:(e,t,r)=>{var n=r(4643);r(3739),r(7835),r(2684),r(9679),r(2046),r(4467),r(5206),r(5114),r(2374),r(8550);var i=n.asn1,s=e.exports=n.pki=n.pki||{},a=s.oids,o={};o.CN=a.commonName,o.commonName="CN",o.C=a.countryName,o.countryName="C",o.L=a.localityName,o.localityName="L",o.ST=a.stateOrProvinceName,o.stateOrProvinceName="ST",o.O=a.organizationName,o.organizationName="O",o.OU=a.organizationalUnitName,o.organizationalUnitName="OU",o.E=a.emailAddress,o.emailAddress="E";var c=n.pki.rsa.publicKeyValidator,u={name:"Certificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},c,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},l={name:"rsapss",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},h={name:"CertificationRequestInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},c,{name:"CertificationRequestInfo.attributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0}]}]}]},d={name:"CertificationRequest",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[h,{name:"CertificationRequest.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};function f(e,t){"string"==typeof t&&(t={shortName:t});for(var r,n=null,i=0;null===n&&i<e.attributes.length;++i)r=e.attributes[i],(t.type&&t.type===r.type||t.name&&t.name===r.name||t.shortName&&t.shortName===r.shortName)&&(n=r);return n}s.RDNAttributesAsArray=function(e,t){for(var r,n,s,c=[],u=0;u<e.value.length;++u){r=e.value[u];for(var l=0;l<r.value.length;++l)s={},n=r.value[l],s.type=i.derToOid(n.value[0].value),s.value=n.value[1].value,s.valueTagClass=n.value[1].type,s.type in a&&(s.name=a[s.type],s.name in o&&(s.shortName=o[s.name])),t&&(t.update(s.type),t.update(s.value)),c.push(s)}return c},s.CRIAttributesAsArray=function(e){for(var t=[],r=0;r<e.length;++r)for(var n=e[r],c=i.derToOid(n.value[0].value),u=n.value[1].value,l=0;l<u.length;++l){var h={};if(h.type=c,h.value=u[l].value,h.valueTagClass=u[l].type,h.type in a&&(h.name=a[h.type],h.name in o&&(h.shortName=o[h.name])),h.type===a.extensionRequest){h.extensions=[];for(var d=0;d<h.value.length;++d)h.extensions.push(s.certificateExtensionFromAsn1(h.value[d]))}t.push(h)}return t};var p=function(e,t,r){var n={};if(e!==a["RSASSA-PSS"])return n;r&&(n={hash:{algorithmOid:a.sha1},mgf:{algorithmOid:a.mgf1,hash:{algorithmOid:a.sha1}},saltLength:20});var s={},o=[];if(!i.validate(t,l,s,o)){var c=new Error("Cannot read RSASSA-PSS parameter block.");throw c.errors=o,c}return void 0!==s.hashOid&&(n.hash=n.hash||{},n.hash.algorithmOid=i.derToOid(s.hashOid)),void 0!==s.maskGenOid&&(n.mgf=n.mgf||{},n.mgf.algorithmOid=i.derToOid(s.maskGenOid),n.mgf.hash=n.mgf.hash||{},n.mgf.hash.algorithmOid=i.derToOid(s.maskGenHashOid)),void 0!==s.saltLength&&(n.saltLength=s.saltLength.charCodeAt(0)),n},g=function(e){switch(a[e.signatureOid]){case"sha1WithRSAEncryption":case"sha1WithRSASignature":return n.md.sha1.create();case"md5WithRSAEncryption":return n.md.md5.create();case"sha256WithRSAEncryption":case"RSASSA-PSS":return n.md.sha256.create();case"sha384WithRSAEncryption":return n.md.sha384.create();case"sha512WithRSAEncryption":return n.md.sha512.create();default:var t=new Error("Could not compute "+e.type+" digest. Unknown signature OID.");throw t.signatureOid=e.signatureOid,t}},y=function(e){var t,r=e.certificate;switch(r.signatureOid){case a.sha1WithRSAEncryption:case a.sha1WithRSASignature:break;case a["RSASSA-PSS"]:var i,s,o;if(void 0===(i=a[r.signatureParameters.mgf.hash.algorithmOid])||void 0===n.md[i])throw(o=new Error("Unsupported MGF hash function.")).oid=r.signatureParameters.mgf.hash.algorithmOid,o.name=i,o;if(void 0===(s=a[r.signatureParameters.mgf.algorithmOid])||void 0===n.mgf[s])throw(o=new Error("Unsupported MGF function.")).oid=r.signatureParameters.mgf.algorithmOid,o.name=s,o;if(s=n.mgf[s].create(n.md[i].create()),void 0===(i=a[r.signatureParameters.hash.algorithmOid])||void 0===n.md[i])throw(o=new Error("Unsupported RSASSA-PSS hash function.")).oid=r.signatureParameters.hash.algorithmOid,o.name=i,o;t=n.pss.create(n.md[i].create(),s,r.signatureParameters.saltLength)}return r.publicKey.verify(e.md.digest().getBytes(),e.signature,t)};function m(e){for(var t,r,s=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),a=e.attributes,o=0;o<a.length;++o){var c=(t=a[o]).value,u=i.Type.PRINTABLESTRING;"valueTagClass"in t&&(u=t.valueTagClass)===i.Type.UTF8&&(c=n.util.encodeUtf8(c)),r=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.type).getBytes()),i.create(i.Class.UNIVERSAL,u,!1,c)])]),s.value.push(r)}return s}function b(e){for(var t,r=0;r<e.length;++r){if(void 0===(t=e[r]).name&&(t.type&&t.type in s.oids?t.name=s.oids[t.type]:t.shortName&&t.shortName in o&&(t.name=s.oids[o[t.shortName]])),void 0===t.type){if(!t.name||!(t.name in s.oids))throw(c=new Error("Attribute type not specified.")).attribute=t,c;t.type=s.oids[t.name]}if(void 0===t.shortName&&t.name&&t.name in o&&(t.shortName=o[t.name]),t.type===a.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=i.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var n=0;n<t.extensions.length;++n)t.value.push(s.certificateExtensionToAsn1(w(t.extensions[n])))}var c;if(void 0===t.value)throw(c=new Error("Attribute value not specified.")).attribute=t,c}}function w(e,t){if(t=t||{},void 0===e.name&&e.id&&e.id in s.oids&&(e.name=s.oids[e.id]),void 0===e.id){if(!e.name||!(e.name in s.oids))throw(A=new Error("Extension ID not specified.")).extension=e,A;e.id=s.oids[e.name]}if(void 0!==e.value)return e;if("keyUsage"===e.name){var r=0,o=0,c=0;e.digitalSignature&&(o|=128,r=7),e.nonRepudiation&&(o|=64,r=6),e.keyEncipherment&&(o|=32,r=5),e.dataEncipherment&&(o|=16,r=4),e.keyAgreement&&(o|=8,r=3),e.keyCertSign&&(o|=4,r=2),e.cRLSign&&(o|=2,r=1),e.encipherOnly&&(o|=1,r=0),e.decipherOnly&&(c|=128,r=7);var u=String.fromCharCode(r);0!==c?u+=String.fromCharCode(o)+String.fromCharCode(c):0!==o&&(u+=String.fromCharCode(o)),e.value=i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,u)}else if("basicConstraints"===e.name)e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(i.create(i.Class.UNIVERSAL,i.Type.BOOLEAN,!1,String.fromCharCode(255))),"pathLenConstraint"in e&&e.value.value.push(i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.pathLenConstraint).getBytes()));else if("extKeyUsage"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);var l=e.value.value;for(var h in e)!0===e[h]&&(h in a?l.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a[h]).getBytes())):-1!==h.indexOf(".")&&l.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(h).getBytes())))}else if("nsCertType"===e.name){r=0,o=0;e.client&&(o|=128,r=7),e.server&&(o|=64,r=6),e.email&&(o|=32,r=5),e.objsign&&(o|=16,r=4),e.reserved&&(o|=8,r=3),e.sslCA&&(o|=4,r=2),e.emailCA&&(o|=2,r=1),e.objCA&&(o|=1,r=0);u=String.fromCharCode(r);0!==o&&(u+=String.fromCharCode(o)),e.value=i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,u)}else if("subjectAltName"===e.name||"issuerAltName"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);for(var d=0;d<e.altNames.length;++d){u=(b=e.altNames[d]).value;if(7===b.type&&b.ip){if(null===(u=n.util.bytesFromIP(b.ip)))throw(A=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,A}else 8===b.type&&(u=b.oid?i.oidToDer(i.oidToDer(b.oid)):i.oidToDer(u));e.value.value.push(i.create(i.Class.CONTEXT_SPECIFIC,b.type,!1,u))}}else if("nsComment"===e.name&&t.cert){if(!/^[\x00-\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw new Error('Invalid "nsComment" content.');e.value=i.create(i.Class.UNIVERSAL,i.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&t.cert){var f=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=f.toHex(),e.value=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,f.getBytes())}else if("authorityKeyIdentifier"===e.name&&t.cert){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);l=e.value.value;if(e.keyIdentifier){var p=!0===e.keyIdentifier?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;l.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!1,p))}if(e.authorityCertIssuer){var g=[i.create(i.Class.CONTEXT_SPECIFIC,4,!0,[m(!0===e.authorityCertIssuer?t.cert.issuer:e.authorityCertIssuer)])];l.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,g))}if(e.serialNumber){var y=n.util.hexToBytes(!0===e.serialNumber?t.cert.serialNumber:e.serialNumber);l.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!1,y))}}else if("cRLDistributionPoints"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);l=e.value.value;var b,w=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),v=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(d=0;d<e.altNames.length;++d){u=(b=e.altNames[d]).value;if(7===b.type&&b.ip){if(null===(u=n.util.bytesFromIP(b.ip)))throw(A=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,A}else 8===b.type&&(u=b.oid?i.oidToDer(i.oidToDer(b.oid)):i.oidToDer(u));v.value.push(i.create(i.Class.CONTEXT_SPECIFIC,b.type,!1,u))}w.value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[v])),l.push(w)}var A;if(void 0===e.value)throw(A=new Error("Extension value not specified.")).extension=e,A;return e}function v(e,t){if(e===a["RSASSA-PSS"]){var r=[];return void 0!==t.hash.algorithmOid&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.hash.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])])),void 0!==t.mgf.algorithmOid&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.mgf.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.mgf.hash.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])])])),void 0!==t.saltLength&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.saltLength).getBytes())])),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,r)}return i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")}function A(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===e.attributes.length)return t;for(var r=e.attributes,s=0;s<r.length;++s){var a=r[s],o=a.value,c=i.Type.UTF8;"valueTagClass"in a&&(c=a.valueTagClass),c===i.Type.UTF8&&(o=n.util.encodeUtf8(o));var u=!1;"valueConstructed"in a&&(u=a.valueConstructed);var l=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.type).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,c,u,o)])]);t.value.push(l)}return t}s.certificateFromPem=function(e,t,r){var a=n.pem.decode(e)[0];if("CERTIFICATE"!==a.type&&"X509 CERTIFICATE"!==a.type&&"TRUSTED CERTIFICATE"!==a.type){var o=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw o.headerType=a.type,o}if(a.procType&&"ENCRYPTED"===a.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var c=i.fromDer(a.body,r);return s.certificateFromAsn1(c,t)},s.certificateToPem=function(e,t){var r={type:"CERTIFICATE",body:i.toDer(s.certificateToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},s.publicKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("PUBLIC KEY"!==t.type&&"RSA PUBLIC KEY"!==t.type){var r=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert public key from PEM; PEM is encrypted.");var a=i.fromDer(t.body);return s.publicKeyFromAsn1(a)},s.publicKeyToPem=function(e,t){var r={type:"PUBLIC KEY",body:i.toDer(s.publicKeyToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},s.publicKeyToRSAPublicKeyPem=function(e,t){var r={type:"RSA PUBLIC KEY",body:i.toDer(s.publicKeyToRSAPublicKey(e)).getBytes()};return n.pem.encode(r,{maxline:t})},s.getPublicKeyFingerprint=function(e,t){var r,a=(t=t||{}).md||n.md.sha1.create();switch(t.type||"RSAPublicKey"){case"RSAPublicKey":r=i.toDer(s.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":r=i.toDer(s.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+t.type+'".')}a.start(),a.update(r);var o=a.digest();if("hex"===t.encoding){var c=o.toHex();return t.delimiter?c.match(/.{2}/g).join(t.delimiter):c}if("binary"===t.encoding)return o.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".');return o},s.certificationRequestFromPem=function(e,t,r){var a=n.pem.decode(e)[0];if("CERTIFICATE REQUEST"!==a.type){var o=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw o.headerType=a.type,o}if(a.procType&&"ENCRYPTED"===a.procType.type)throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var c=i.fromDer(a.body,r);return s.certificationRequestFromAsn1(c,t)},s.certificationRequestToPem=function(e,t){var r={type:"CERTIFICATE REQUEST",body:i.toDer(s.certificationRequestToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},s.createCertificate=function(){var e={version:2,serialNumber:"00",signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.validity={},e.validity.notBefore=new Date,e.validity.notAfter=new Date,e.issuer={},e.issuer.getField=function(t){return f(e.issuer,t)},e.issuer.addField=function(t){b([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return f(e.subject,t)},e.subject.addField=function(t){b([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.extensions=[],e.publicKey=null,e.md=null,e.setSubject=function(t,r){b(t),e.subject.attributes=t,delete e.subject.uniqueId,r&&(e.subject.uniqueId=r),e.subject.hash=null},e.setIssuer=function(t,r){b(t),e.issuer.attributes=t,delete e.issuer.uniqueId,r&&(e.issuer.uniqueId=r),e.issuer.hash=null},e.setExtensions=function(t){for(var r=0;r<t.length;++r)w(t[r],{cert:e});e.extensions=t},e.getExtension=function(t){"string"==typeof t&&(t={name:t});for(var r,n=null,i=0;null===n&&i<e.extensions.length;++i)r=e.extensions[i],(t.id&&r.id===t.id||t.name&&r.name===t.name)&&(n=r);return n},e.sign=function(t,r){e.md=r||n.md.sha1.create();var o=a[e.md.algorithm+"WithRSAEncryption"];if(!o){var c=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw c.algorithm=e.md.algorithm,c}e.signatureOid=e.siginfo.algorithmOid=o,e.tbsCertificate=s.getTBSCertificate(e);var u=i.toDer(e.tbsCertificate);e.md.update(u.getBytes()),e.signature=t.sign(e.md)},e.verify=function(t){var r=!1;if(!e.issued(t)){var n=t.issuer,a=e.subject,o=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.");throw o.expectedIssuer=a.attributes,o.actualIssuer=n.attributes,o}var c=t.md;if(null===c){c=g({signatureOid:t.signatureOid,type:"certificate"});var u=t.tbsCertificate||s.getTBSCertificate(t),l=i.toDer(u);c.update(l.getBytes())}return null!==c&&(r=y({certificate:e,md:c,signature:t.signature})),r},e.isIssuer=function(t){var r=!1,n=e.issuer,i=t.subject;if(n.hash&&i.hash)r=n.hash===i.hash;else if(n.attributes.length===i.attributes.length){var s,a;r=!0;for(var o=0;r&&o<n.attributes.length;++o)s=n.attributes[o],a=i.attributes[o],s.type===a.type&&s.value===a.value||(r=!1)}return r},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return s.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=a.subjectKeyIdentifier,r=0;r<e.extensions.length;++r){var i=e.extensions[r];if(i.id===t){var s=e.generateSubjectKeyIdentifier().getBytes();return n.util.hexToBytes(i.subjectKeyIdentifier)===s}}return!1},e},s.certificateFromAsn1=function(e,t){var r={},a=[];if(!i.validate(e,u,r,a)){var o=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.");throw o.errors=a,o}if(i.derToOid(r.publicKeyOid)!==s.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var c=s.createCertificate();c.version=r.certVersion?r.certVersion.charCodeAt(0):0;var l=n.util.createBuffer(r.certSerialNumber);c.serialNumber=l.toHex(),c.signatureOid=n.asn1.derToOid(r.certSignatureOid),c.signatureParameters=p(c.signatureOid,r.certSignatureParams,!0),c.siginfo.algorithmOid=n.asn1.derToOid(r.certinfoSignatureOid),c.siginfo.parameters=p(c.siginfo.algorithmOid,r.certinfoSignatureParams,!1),c.signature=r.certSignature;var h=[];if(void 0!==r.certValidity1UTCTime&&h.push(i.utcTimeToDate(r.certValidity1UTCTime)),void 0!==r.certValidity2GeneralizedTime&&h.push(i.generalizedTimeToDate(r.certValidity2GeneralizedTime)),void 0!==r.certValidity3UTCTime&&h.push(i.utcTimeToDate(r.certValidity3UTCTime)),void 0!==r.certValidity4GeneralizedTime&&h.push(i.generalizedTimeToDate(r.certValidity4GeneralizedTime)),h.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(h.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(c.validity.notBefore=h[0],c.validity.notAfter=h[1],c.tbsCertificate=r.tbsCertificate,t){c.md=g({signatureOid:c.signatureOid,type:"certificate"});var d=i.toDer(c.tbsCertificate);c.md.update(d.getBytes())}var y=n.md.sha1.create(),m=i.toDer(r.certIssuer);y.update(m.getBytes()),c.issuer.getField=function(e){return f(c.issuer,e)},c.issuer.addField=function(e){b([e]),c.issuer.attributes.push(e)},c.issuer.attributes=s.RDNAttributesAsArray(r.certIssuer),r.certIssuerUniqueId&&(c.issuer.uniqueId=r.certIssuerUniqueId),c.issuer.hash=y.digest().toHex();var w=n.md.sha1.create(),v=i.toDer(r.certSubject);return w.update(v.getBytes()),c.subject.getField=function(e){return f(c.subject,e)},c.subject.addField=function(e){b([e]),c.subject.attributes.push(e)},c.subject.attributes=s.RDNAttributesAsArray(r.certSubject),r.certSubjectUniqueId&&(c.subject.uniqueId=r.certSubjectUniqueId),c.subject.hash=w.digest().toHex(),r.certExtensions?c.extensions=s.certificateExtensionsFromAsn1(r.certExtensions):c.extensions=[],c.publicKey=s.publicKeyFromAsn1(r.subjectPublicKeyInfo),c},s.certificateExtensionsFromAsn1=function(e){for(var t=[],r=0;r<e.value.length;++r)for(var n=e.value[r],i=0;i<n.value.length;++i)t.push(s.certificateExtensionFromAsn1(n.value[i]));return t},s.certificateExtensionFromAsn1=function(e){var t={};if(t.id=i.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===i.Type.BOOLEAN?(t.critical=0!==e.value[1].value.charCodeAt(0),t.value=e.value[2].value):t.value=e.value[1].value,t.id in a)if(t.name=a[t.id],"keyUsage"===t.name){var r=0,s=0;(c=i.fromDer(t.value)).value.length>1&&(r=c.value.charCodeAt(1),s=c.value.length>2?c.value.charCodeAt(2):0),t.digitalSignature=!(128&~r),t.nonRepudiation=!(64&~r),t.keyEncipherment=!(32&~r),t.dataEncipherment=!(16&~r),t.keyAgreement=!(8&~r),t.keyCertSign=!(4&~r),t.cRLSign=!(2&~r),t.encipherOnly=!(1&~r),t.decipherOnly=!(128&~s)}else if("basicConstraints"===t.name){(c=i.fromDer(t.value)).value.length>0&&c.value[0].type===i.Type.BOOLEAN?t.cA=0!==c.value[0].value.charCodeAt(0):t.cA=!1;var o=null;c.value.length>0&&c.value[0].type===i.Type.INTEGER?o=c.value[0].value:c.value.length>1&&(o=c.value[1].value),null!==o&&(t.pathLenConstraint=i.derToInteger(o))}else if("extKeyUsage"===t.name)for(var c=i.fromDer(t.value),u=0;u<c.value.length;++u){var l=i.derToOid(c.value[u].value);l in a?t[a[l]]=!0:t[l]=!0}else if("nsCertType"===t.name){r=0;(c=i.fromDer(t.value)).value.length>1&&(r=c.value.charCodeAt(1)),t.client=!(128&~r),t.server=!(64&~r),t.email=!(32&~r),t.objsign=!(16&~r),t.reserved=!(8&~r),t.sslCA=!(4&~r),t.emailCA=!(2&~r),t.objCA=!(1&~r)}else if("subjectAltName"===t.name||"issuerAltName"===t.name){var h;t.altNames=[];c=i.fromDer(t.value);for(var d=0;d<c.value.length;++d){var f={type:(h=c.value[d]).type,value:h.value};switch(t.altNames.push(f),h.type){case 1:case 2:case 6:break;case 7:f.ip=n.util.bytesToIP(h.value);break;case 8:f.oid=i.derToOid(h.value)}}}else if("subjectKeyIdentifier"===t.name){c=i.fromDer(t.value);t.subjectKeyIdentifier=n.util.bytesToHex(c.value)}return t},s.certificationRequestFromAsn1=function(e,t){var r={},a=[];if(!i.validate(e,d,r,a)){var o=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.");throw o.errors=a,o}if(i.derToOid(r.publicKeyOid)!==s.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var c=s.createCertificationRequest();if(c.version=r.csrVersion?r.csrVersion.charCodeAt(0):0,c.signatureOid=n.asn1.derToOid(r.csrSignatureOid),c.signatureParameters=p(c.signatureOid,r.csrSignatureParams,!0),c.siginfo.algorithmOid=n.asn1.derToOid(r.csrSignatureOid),c.siginfo.parameters=p(c.siginfo.algorithmOid,r.csrSignatureParams,!1),c.signature=r.csrSignature,c.certificationRequestInfo=r.certificationRequestInfo,t){c.md=g({signatureOid:c.signatureOid,type:"certification request"});var u=i.toDer(c.certificationRequestInfo);c.md.update(u.getBytes())}var l=n.md.sha1.create();return c.subject.getField=function(e){return f(c.subject,e)},c.subject.addField=function(e){b([e]),c.subject.attributes.push(e)},c.subject.attributes=s.RDNAttributesAsArray(r.certificationRequestInfoSubject,l),c.subject.hash=l.digest().toHex(),c.publicKey=s.publicKeyFromAsn1(r.subjectPublicKeyInfo),c.getAttribute=function(e){return f(c,e)},c.addAttribute=function(e){b([e]),c.attributes.push(e)},c.attributes=s.CRIAttributesAsArray(r.certificationRequestInfoAttributes||[]),c},s.createCertificationRequest=function(){var e={version:0,signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return f(e.subject,t)},e.subject.addField=function(t){b([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return f(e,t)},e.addAttribute=function(t){b([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){b(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){b(t),e.attributes=t},e.sign=function(t,r){e.md=r||n.md.sha1.create();var o=a[e.md.algorithm+"WithRSAEncryption"];if(!o){var c=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw c.algorithm=e.md.algorithm,c}e.signatureOid=e.siginfo.algorithmOid=o,e.certificationRequestInfo=s.getCertificationRequestInfo(e);var u=i.toDer(e.certificationRequestInfo);e.md.update(u.getBytes()),e.signature=t.sign(e.md)},e.verify=function(){var t=!1,r=e.md;if(null===r){r=g({signatureOid:e.signatureOid,type:"certification request"});var n=e.certificationRequestInfo||s.getCertificationRequestInfo(e),a=i.toDer(n);r.update(a.getBytes())}return null!==r&&(t=y({certificate:e,md:r,signature:e.signature})),t},e};var E=new Date("1950-01-01T00:00:00Z"),C=new Date("2050-01-01T00:00:00Z");function B(e){return e>=E&&e<C?i.create(i.Class.UNIVERSAL,i.Type.UTCTIME,!1,i.dateToUtcTime(e)):i.create(i.Class.UNIVERSAL,i.Type.GENERALIZEDTIME,!1,i.dateToGeneralizedTime(e))}s.getTBSCertificate=function(e){var t=B(e.validity.notBefore),r=B(e.validity.notAfter),a=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(e.serialNumber)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.siginfo.algorithmOid).getBytes()),v(e.siginfo.algorithmOid,e.siginfo.parameters)]),m(e.issuer),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,r]),m(e.subject),s.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&a.value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.issuer.uniqueId)])),e.subject.uniqueId&&a.value.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!0,[i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.subject.uniqueId)])),e.extensions.length>0&&a.value.push(s.certificateExtensionsToAsn1(e.extensions)),a},s.getCertificationRequestInfo=function(e){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),m(e.subject),s.publicKeyToAsn1(e.publicKey),A(e)])},s.distinguishedNameToAsn1=function(e){return m(e)},s.certificateToAsn1=function(e){var t=e.tbsCertificate||s.getTBSCertificate(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),v(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},s.certificateExtensionsToAsn1=function(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,3,!0,[]),r=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(r);for(var n=0;n<e.length;++n)r.value.push(s.certificateExtensionToAsn1(e[n]));return t},s.certificateExtensionToAsn1=function(e){var t=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.id).getBytes())),e.critical&&t.value.push(i.create(i.Class.UNIVERSAL,i.Type.BOOLEAN,!1,String.fromCharCode(255)));var r=e.value;return"string"!=typeof e.value&&(r=i.toDer(r).getBytes()),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r)),t},s.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||s.getCertificationRequestInfo(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),v(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},s.createCaStore=function(e){var t={certs:{}};function r(e){return a(e),t.certs[e.hash]||null}function a(e){if(!e.hash){var t=n.md.sha1.create();e.attributes=s.RDNAttributesAsArray(m(e),t),e.hash=t.digest().toHex()}}if(t.getIssuer=function(e){return r(e.issuer)},t.addCertificate=function(e){if("string"==typeof e&&(e=n.pki.certificateFromPem(e)),a(e.subject),!t.hasCertificate(e))if(e.subject.hash in t.certs){var r=t.certs[e.subject.hash];n.util.isArray(r)||(r=[r]),r.push(e),t.certs[e.subject.hash]=r}else t.certs[e.subject.hash]=e},t.hasCertificate=function(e){"string"==typeof e&&(e=n.pki.certificateFromPem(e));var t=r(e.subject);if(!t)return!1;n.util.isArray(t)||(t=[t]);for(var a=i.toDer(s.certificateToAsn1(e)).getBytes(),o=0;o<t.length;++o){if(a===i.toDer(s.certificateToAsn1(t[o])).getBytes())return!0}return!1},t.listAllCertificates=function(){var e=[];for(var r in t.certs)if(t.certs.hasOwnProperty(r)){var i=t.certs[r];if(n.util.isArray(i))for(var s=0;s<i.length;++s)e.push(i[s]);else e.push(i)}return e},t.removeCertificate=function(e){var o;if("string"==typeof e&&(e=n.pki.certificateFromPem(e)),a(e.subject),!t.hasCertificate(e))return null;var c=r(e.subject);if(!n.util.isArray(c))return o=t.certs[e.subject.hash],delete t.certs[e.subject.hash],o;for(var u=i.toDer(s.certificateToAsn1(e)).getBytes(),l=0;l<c.length;++l){u===i.toDer(s.certificateToAsn1(c[l])).getBytes()&&(o=c[l],c.splice(l,1))}return 0===c.length&&delete t.certs[e.subject.hash],o},e)for(var o=0;o<e.length;++o){var c=e[o];t.addCertificate(c)}return t},s.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"},s.verifyCertificateChain=function(e,t,r){"function"==typeof r&&(r={verify:r}),r=r||{};var i=(t=t.slice(0)).slice(0),a=r.validityCheckDate;void 0===a&&(a=new Date);var o=!0,c=null,u=0;do{var l=t.shift(),h=null,d=!1;if(a&&(a<l.validity.notBefore||a>l.validity.notAfter)&&(c={message:"Certificate is not valid yet or has expired.",error:s.certificateError.certificate_expired,notBefore:l.validity.notBefore,notAfter:l.validity.notAfter,now:a}),null===c){if(null===(h=t[0]||e.getIssuer(l))&&l.isIssuer(l)&&(d=!0,h=l),h){var f=h;n.util.isArray(f)||(f=[f]);for(var p=!1;!p&&f.length>0;){h=f.shift();try{p=h.verify(l)}catch(e){}}p||(c={message:"Certificate signature is invalid.",error:s.certificateError.bad_certificate})}null!==c||h&&!d||e.hasCertificate(l)||(c={message:"Certificate is not trusted.",error:s.certificateError.unknown_ca})}if(null===c&&h&&!l.isIssuer(h)&&(c={message:"Certificate issuer is invalid.",error:s.certificateError.bad_certificate}),null===c)for(var g={keyUsage:!0,basicConstraints:!0},y=0;null===c&&y<l.extensions.length;++y){var m=l.extensions[y];m.critical&&!(m.name in g)&&(c={message:"Certificate has an unsupported critical extension.",error:s.certificateError.unsupported_certificate})}if(null===c&&(!o||0===t.length&&(!h||d))){var b=l.getExtension("basicConstraints"),w=l.getExtension("keyUsage");if(null!==w&&(w.keyCertSign&&null!==b||(c={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:s.certificateError.bad_certificate})),null!==c||null===b||b.cA||(c={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:s.certificateError.bad_certificate}),null===c&&null!==w&&"pathLenConstraint"in b)u-1>b.pathLenConstraint&&(c={message:"Certificate basicConstraints pathLenConstraint violated.",error:s.certificateError.bad_certificate})}var v=null===c||c.error,A=r.verify?r.verify(v,u,i):v;if(!0!==A)throw!0===v&&(c={message:"The application rejected the certificate.",error:s.certificateError.bad_certificate}),(A||0===A)&&("object"!=typeof A||n.util.isArray(A)?"string"==typeof A&&(c.error=A):(A.message&&(c.message=A.message),A.error&&(c.error=A.error))),c;c=null,o=!1,++u}while(t.length>0);return!0}},888:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCreate2Address=t.getCreateAddress=void 0;const n=r(6468),i=r(8718),s=r(4103);t.getCreateAddress=function(e){const t=(0,s.getAddress)(e.from);let r=(0,i.getBigInt)(e.nonce,"tx.nonce").toString(16);return r="0"===r?"0x":r.length%2?"0x0"+r:"0x"+r,(0,s.getAddress)((0,i.dataSlice)((0,n.keccak256)((0,i.encodeRlp)([t,r])),12))},t.getCreate2Address=function(e,t,r){const a=(0,s.getAddress)(e),o=(0,i.getBytes)(t,"salt"),c=(0,i.getBytes)(r,"initCodeHash");return(0,i.assertArgument)(32===o.length,"salt must be 32 bytes","salt",t),(0,i.assertArgument)(32===c.length,"initCodeHash must be 32 bytes","initCodeHash",r),(0,s.getAddress)((0,i.dataSlice)((0,n.keccak256)((0,i.concat)(["0xff",a,o,c])),12))}},943:(e,t,r)=>{var n=r(4643);r(9679),r(8550);var i=e.exports=n.sha1=n.sha1||{};n.md.sha1=n.md.algorithms.sha1=i,i.create=function(){a||(s=String.fromCharCode(128),s+=n.util.fillString(String.fromCharCode(0),64),a=!0);var e=null,t=n.util.createBuffer(),r=new Array(80),i={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,s=0;s<r;++s)i.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},i}};return i.start(),i.update=function(s,a){"utf8"===a&&(s=n.util.encodeUtf8(s));var c=s.length;i.messageLength+=c,c=[c/4294967296>>>0,c>>>0];for(var u=i.fullMessageLength.length-1;u>=0;--u)i.fullMessageLength[u]+=c[1],c[1]=c[0]+(i.fullMessageLength[u]/4294967296>>>0),i.fullMessageLength[u]=i.fullMessageLength[u]>>>0,c[0]=c[1]/4294967296>>>0;return t.putBytes(s),o(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var a=n.util.createBuffer();a.putBytes(t.bytes());var c,u=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;a.putBytes(s.substr(0,i.blockLength-u));for(var l=8*i.fullMessageLength[0],h=0;h<i.fullMessageLength.length-1;++h)l+=(c=8*i.fullMessageLength[h+1])/4294967296>>>0,a.putInt32(l>>>0),l=c>>>0;a.putInt32(l);var d={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};o(d,r,a);var f=n.util.createBuffer();return f.putInt32(d.h0),f.putInt32(d.h1),f.putInt32(d.h2),f.putInt32(d.h3),f.putInt32(d.h4),f},i};var s=null,a=!1;function o(e,t,r){for(var n,i,s,a,o,c,u,l=r.length();l>=64;){for(i=e.h0,s=e.h1,a=e.h2,o=e.h3,c=e.h4,u=0;u<16;++u)n=r.getInt32(),t[u]=n,n=(i<<5|i>>>27)+(o^s&(a^o))+c+1518500249+n,c=o,o=a,a=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<20;++u)n=(n=t[u-3]^t[u-8]^t[u-14]^t[u-16])<<1|n>>>31,t[u]=n,n=(i<<5|i>>>27)+(o^s&(a^o))+c+1518500249+n,c=o,o=a,a=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<32;++u)n=(n=t[u-3]^t[u-8]^t[u-14]^t[u-16])<<1|n>>>31,t[u]=n,n=(i<<5|i>>>27)+(s^a^o)+c+1859775393+n,c=o,o=a,a=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<40;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(i<<5|i>>>27)+(s^a^o)+c+1859775393+n,c=o,o=a,a=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<60;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(i<<5|i>>>27)+(s&a|o&(s^a))+c+2400959708+n,c=o,o=a,a=(s<<30|s>>>2)>>>0,s=i,i=n;for(;u<80;++u)n=(n=t[u-6]^t[u-16]^t[u-28]^t[u-32])<<2|n>>>30,t[u]=n,n=(i<<5|i>>>27)+(s^a^o)+c+3395469782+n,c=o,o=a,a=(s<<30|s>>>2)>>>0,s=i,i=n;e.h0=e.h0+i|0,e.h1=e.h1+s|0,e.h2=e.h2+a|0,e.h3=e.h3+o|0,e.h4=e.h4+c|0,l-=64}}},949:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseEther=t.formatEther=t.parseUnits=t.formatUnits=void 0;const n=r(355),i=r(1333),s=r(9009),a=["wei","kwei","mwei","gwei","szabo","finney","ether"];function o(e,t){let r=18;if("string"==typeof t){const e=a.indexOf(t);(0,n.assertArgument)(e>=0,"invalid unit","unit",t),r=3*e}else null!=t&&(r=(0,s.getNumber)(t,"unit"));return i.FixedNumber.fromValue(e,r,{decimals:r,width:512}).toString()}function c(e,t){(0,n.assertArgument)("string"==typeof e,"value must be a string","value",e);let r=18;if("string"==typeof t){const e=a.indexOf(t);(0,n.assertArgument)(e>=0,"invalid unit","unit",t),r=3*e}else null!=t&&(r=(0,s.getNumber)(t,"unit"));return i.FixedNumber.fromString(e,{decimals:r,width:512}).value}t.formatUnits=o,t.parseUnits=c,t.formatEther=function(e){return o(e,18)},t.parseEther=function(e){return c(e,18)}},991:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Transaction=void 0;const n=r(6107),i=r(1038),s=r(6468),a=r(8718),o=r(5193),c=r(3490),u=r(4423),l=BigInt(0),h=BigInt(2),d=BigInt(27),f=BigInt(28),p=BigInt(35),g=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),y=131072;function m(e,t){let r=e.toString(16);for(;r.length<2;)r="0"+r;return r+=(0,s.sha256)(t).substring(4),"0x"+r}function b(e){return"0x"===e?null:(0,n.getAddress)(e)}function w(e,t){try{return(0,o.accessListify)(e)}catch(r){(0,a.assertArgument)(!1,r.message,t,e)}}function v(e,t){try{if(!Array.isArray(e))throw new Error("authorizationList: invalid array");const t=[];for(let r=0;r<e.length;r++){const n=e[r];if(!Array.isArray(n))throw new Error(`authorization[${r}]: invalid array`);if(6!==n.length)throw new Error(`authorization[${r}]: wrong length`);if(!n[1])throw new Error(`authorization[${r}]: null address`);t.push({address:b(n[1]),nonce:E(n[2],"nonce"),chainId:E(n[0],"chainId"),signature:s.Signature.from({yParity:A(n[3],"yParity"),r:(0,a.zeroPadValue)(n[4],32),s:(0,a.zeroPadValue)(n[5],32)})})}return t}catch(r){(0,a.assertArgument)(!1,r.message,t,e)}}function A(e,t){return"0x"===e?0:(0,a.getNumber)(e,t)}function E(e,t){if("0x"===e)return l;const r=(0,a.getBigInt)(e,t);return(0,a.assertArgument)(r<=g,"value exceeds uint size",t,r),r}function C(e,t){const r=(0,a.getBigInt)(e,"value"),n=(0,a.toBeArray)(r);return(0,a.assertArgument)(n.length<=32,"value too large",`tx.${t}`,r),n}function B(e){return(0,o.accessListify)(e).map(e=>[e.address,e.storageKeys])}function S(e,t){(0,a.assertArgument)(Array.isArray(e),`invalid ${t}`,"value",e);for(let t=0;t<e.length;t++)(0,a.assertArgument)((0,a.isHexString)(e[t],32),"invalid ${ param } hash",`value[${t}]`,e[t]);return e}function k(e,t){let r;try{if(r=A(t[0],"yParity"),0!==r&&1!==r)throw new Error("bad yParity")}catch(e){(0,a.assertArgument)(!1,"invalid yParity","yParity",t[0])}const n=(0,a.zeroPadValue)(t[1],32),i=(0,a.zeroPadValue)(t[2],32),o=s.Signature.from({r:n,s:i,yParity:r});e.signature=o}class T{#D;#F;#M;#j;#K;#V;#H;#_;#G;#z;#q;#Q;#W;#J;#Y;#Z;#X;get type(){return this.#D}set type(e){switch(e){case null:this.#D=null;break;case 0:case"legacy":this.#D=0;break;case 1:case"berlin":case"eip-2930":this.#D=1;break;case 2:case"london":case"eip-1559":this.#D=2;break;case 3:case"cancun":case"eip-4844":this.#D=3;break;case 4:case"pectra":case"eip-7702":this.#D=4;break;default:(0,a.assertArgument)(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844";case 4:return"eip-7702"}return null}get to(){const e=this.#F;return null==e&&3===this.type?i.ZeroAddress:e}set to(e){this.#F=null==e?null:(0,n.getAddress)(e)}get nonce(){return this.#j}set nonce(e){this.#j=(0,a.getNumber)(e,"value")}get gasLimit(){return this.#K}set gasLimit(e){this.#K=(0,a.getBigInt)(e)}get gasPrice(){const e=this.#V;return null!=e||0!==this.type&&1!==this.type?e:l}set gasPrice(e){this.#V=null==e?null:(0,a.getBigInt)(e,"gasPrice")}get maxPriorityFeePerGas(){const e=this.#H;return null==e?2===this.type||3===this.type?l:null:e}set maxPriorityFeePerGas(e){this.#H=null==e?null:(0,a.getBigInt)(e,"maxPriorityFeePerGas")}get maxFeePerGas(){const e=this.#_;return null==e?2===this.type||3===this.type?l:null:e}set maxFeePerGas(e){this.#_=null==e?null:(0,a.getBigInt)(e,"maxFeePerGas")}get data(){return this.#M}set data(e){this.#M=(0,a.hexlify)(e)}get value(){return this.#G}set value(e){this.#G=(0,a.getBigInt)(e,"value")}get chainId(){return this.#z}set chainId(e){this.#z=(0,a.getBigInt)(e)}get signature(){return this.#q||null}set signature(e){this.#q=null==e?null:s.Signature.from(e)}get accessList(){const e=this.#Q||null;return null==e?1===this.type||2===this.type||3===this.type?[]:null:e}set accessList(e){this.#Q=null==e?null:(0,o.accessListify)(e)}get authorizationList(){const e=this.#X||null;return null==e&&4===this.type?[]:e}set authorizationList(e){this.#X=null==e?null:e.map(e=>(0,c.authorizationify)(e))}get maxFeePerBlobGas(){const e=this.#W;return null==e&&3===this.type?l:e}set maxFeePerBlobGas(e){this.#W=null==e?null:(0,a.getBigInt)(e,"maxFeePerBlobGas")}get blobVersionedHashes(){let e=this.#J;return null==e&&3===this.type?[]:e}set blobVersionedHashes(e){if(null!=e){(0,a.assertArgument)(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let t=0;t<e.length;t++)(0,a.assertArgument)((0,a.isHexString)(e[t],32),"invalid blobVersionedHash",`value[${t}]`,e[t])}this.#J=e}get blobs(){return null==this.#Z?null:this.#Z.map(e=>Object.assign({},e))}set blobs(e){if(null==e)return void(this.#Z=null);const t=[],r=[];for(let n=0;n<e.length;n++){const i=e[n];if((0,a.isBytesLike)(i)){(0,a.assert)(this.#Y,"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let e=(0,a.getBytes)(i);if((0,a.assertArgument)(e.length<=y,"blob is too large",`blobs[${n}]`,i),e.length!==y){const t=new Uint8Array(y);t.set(e),e=t}const s=this.#Y.blobToKzgCommitment(e),o=(0,a.hexlify)(this.#Y.computeBlobKzgProof(e,s));t.push({data:(0,a.hexlify)(e),commitment:(0,a.hexlify)(s),proof:o}),r.push(m(1,s))}else{const e=(0,a.hexlify)(i.commitment);t.push({data:(0,a.hexlify)(i.data),commitment:e,proof:(0,a.hexlify)(i.proof)}),r.push(m(1,e))}}this.#Z=t,this.#J=r}get kzg(){return this.#Y}set kzg(e){this.#Y=null==e?null:function(e){return{blobToKzgCommitment:t=>{if("computeBlobProof"in e){if("blobToKzgCommitment"in e&&"function"==typeof e.blobToKzgCommitment)return(0,a.getBytes)(e.blobToKzgCommitment((0,a.hexlify)(t)))}else if("blobToKzgCommitment"in e&&"function"==typeof e.blobToKzgCommitment)return(0,a.getBytes)(e.blobToKzgCommitment(t));if("blobToKZGCommitment"in e&&"function"==typeof e.blobToKZGCommitment)return(0,a.getBytes)(e.blobToKZGCommitment((0,a.hexlify)(t)));(0,a.assertArgument)(!1,"unsupported KZG library","kzg",e)},computeBlobKzgProof:(t,r)=>"computeBlobProof"in e&&"function"==typeof e.computeBlobProof?(0,a.getBytes)(e.computeBlobProof((0,a.hexlify)(t),(0,a.hexlify)(r))):"computeBlobKzgProof"in e&&"function"==typeof e.computeBlobKzgProof?e.computeBlobKzgProof(t,r):"computeBlobKZGProof"in e&&"function"==typeof e.computeBlobKZGProof?(0,a.getBytes)(e.computeBlobKZGProof((0,a.hexlify)(t),(0,a.hexlify)(r))):void(0,a.assertArgument)(!1,"unsupported KZG library","kzg",e)}}(e)}constructor(){this.#D=null,this.#F=null,this.#j=0,this.#K=l,this.#V=null,this.#H=null,this.#_=null,this.#M="0x",this.#G=l,this.#z=l,this.#q=null,this.#Q=null,this.#W=null,this.#J=null,this.#Y=null,this.#Z=null,this.#X=null}get hash(){return null==this.signature?null:(0,s.keccak256)(this.#$(!0,!1))}get unsignedHash(){return(0,s.keccak256)(this.unsignedSerialized)}get from(){return null==this.signature?null:(0,u.recoverAddress)(this.unsignedHash,this.signature)}get fromPublicKey(){return null==this.signature?null:s.SigningKey.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return null!=this.signature}#$(e,t){(0,a.assert)(!e||null!=this.signature,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const r=e?this.signature:null;switch(this.inferType()){case 0:return function(e,t){const r=[C(e.nonce,"nonce"),C(e.gasPrice||0,"gasPrice"),C(e.gasLimit,"gasLimit"),e.to||"0x",C(e.value,"value"),e.data];let n=l;if(e.chainId!=l)n=(0,a.getBigInt)(e.chainId,"tx.chainId"),(0,a.assertArgument)(!t||null==t.networkV||t.legacyChainId===n,"tx.chainId/sig.v mismatch","sig",t);else if(e.signature){const t=e.signature.legacyChainId;null!=t&&(n=t)}if(!t)return n!==l&&(r.push((0,a.toBeArray)(n)),r.push("0x"),r.push("0x")),(0,a.encodeRlp)(r);let i=BigInt(27+t.yParity);return n!==l?i=s.Signature.getChainIdV(n,t.v):BigInt(t.v)!==i&&(0,a.assertArgument)(!1,"tx.chainId/sig.v mismatch","sig",t),r.push((0,a.toBeArray)(i)),r.push((0,a.toBeArray)(t.r)),r.push((0,a.toBeArray)(t.s)),(0,a.encodeRlp)(r)}(this,r);case 1:return function(e,t){const r=[C(e.chainId,"chainId"),C(e.nonce,"nonce"),C(e.gasPrice||0,"gasPrice"),C(e.gasLimit,"gasLimit"),e.to||"0x",C(e.value,"value"),e.data,B(e.accessList||[])];return t&&(r.push(C(t.yParity,"recoveryParam")),r.push((0,a.toBeArray)(t.r)),r.push((0,a.toBeArray)(t.s))),(0,a.concat)(["0x01",(0,a.encodeRlp)(r)])}(this,r);case 2:return function(e,t){const r=[C(e.chainId,"chainId"),C(e.nonce,"nonce"),C(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),C(e.maxFeePerGas||0,"maxFeePerGas"),C(e.gasLimit,"gasLimit"),e.to||"0x",C(e.value,"value"),e.data,B(e.accessList||[])];return t&&(r.push(C(t.yParity,"yParity")),r.push((0,a.toBeArray)(t.r)),r.push((0,a.toBeArray)(t.s))),(0,a.concat)(["0x02",(0,a.encodeRlp)(r)])}(this,r);case 3:return function(e,t,r){const n=[C(e.chainId,"chainId"),C(e.nonce,"nonce"),C(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),C(e.maxFeePerGas||0,"maxFeePerGas"),C(e.gasLimit,"gasLimit"),e.to||i.ZeroAddress,C(e.value,"value"),e.data,B(e.accessList||[]),C(e.maxFeePerBlobGas||0,"maxFeePerBlobGas"),S(e.blobVersionedHashes||[],"blobVersionedHashes")];return t&&(n.push(C(t.yParity,"yParity")),n.push((0,a.toBeArray)(t.r)),n.push((0,a.toBeArray)(t.s)),r)?(0,a.concat)(["0x03",(0,a.encodeRlp)([n,r.map(e=>e.data),r.map(e=>e.commitment),r.map(e=>e.proof)])]):(0,a.concat)(["0x03",(0,a.encodeRlp)(n)])}(this,r,t?this.blobs:null);case 4:return function(e,t){const r=[C(e.chainId,"chainId"),C(e.nonce,"nonce"),C(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),C(e.maxFeePerGas||0,"maxFeePerGas"),C(e.gasLimit,"gasLimit"),e.to||"0x",C(e.value,"value"),e.data,B(e.accessList||[]),(n=e.authorizationList||[],n.map(e=>[C(e.chainId,"chainId"),e.address,C(e.nonce,"nonce"),C(e.signature.yParity,"yParity"),(0,a.toBeArray)(e.signature.r),(0,a.toBeArray)(e.signature.s)]))];var n;return t&&(r.push(C(t.yParity,"yParity")),r.push((0,a.toBeArray)(t.r)),r.push((0,a.toBeArray)(t.s))),(0,a.concat)(["0x04",(0,a.encodeRlp)(r)])}(this,r)}(0,a.assert)(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get serialized(){return this.#$(!0,!0)}get unsignedSerialized(){return this.#$(!1,!1)}inferType(){const e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){const e=null!=this.gasPrice,t=null!=this.maxFeePerGas||null!=this.maxPriorityFeePerGas,r=null!=this.accessList,n=null!=this.#W||this.#J;null!=this.maxFeePerGas&&null!=this.maxPriorityFeePerGas&&(0,a.assert)(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),(0,a.assert)(!t||0!==this.type&&1!==this.type,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),(0,a.assert)(0!==this.type||!r,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const i=[];return null!=this.type?i.push(this.type):this.authorizationList&&this.authorizationList.length?i.push(4):t?i.push(2):e?(i.push(1),r||i.push(0)):r?(i.push(1),i.push(2)):(n&&this.to||(i.push(0),i.push(1),i.push(2)),i.push(3)),i.sort(),i}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}isCancun(){return 3===this.type}clone(){return T.from(this)}toJSON(){const e=e=>null==e?null:e.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(null==e)return new T;if("string"==typeof e){const t=(0,a.getBytes)(e);if(t[0]>=127)return T.from(function(e){const t=(0,a.decodeRlp)(e);(0,a.assertArgument)(Array.isArray(t)&&(9===t.length||6===t.length),"invalid field count for legacy transaction","data",e);const r={type:0,nonce:A(t[0],"nonce"),gasPrice:E(t[1],"gasPrice"),gasLimit:E(t[2],"gasLimit"),to:b(t[3]),value:E(t[4],"value"),data:(0,a.hexlify)(t[5]),chainId:l};if(6===t.length)return r;const n=E(t[6],"v"),i=E(t[7],"r"),o=E(t[8],"s");if(i===l&&o===l)r.chainId=n;else{let e=(n-p)/h;e<l&&(e=l),r.chainId=e,(0,a.assertArgument)(e!==l||n===d||n===f,"non-canonical legacy v","v",t[6]),r.signature=s.Signature.from({r:(0,a.zeroPadValue)(t[7],32),s:(0,a.zeroPadValue)(t[8],32),v:n})}return r}(t));switch(t[0]){case 1:return T.from(function(e){const t=(0,a.decodeRlp)((0,a.getBytes)(e).slice(1));(0,a.assertArgument)(Array.isArray(t)&&(8===t.length||11===t.length),"invalid field count for transaction type: 1","data",(0,a.hexlify)(e));const r={type:1,chainId:E(t[0],"chainId"),nonce:A(t[1],"nonce"),gasPrice:E(t[2],"gasPrice"),gasLimit:E(t[3],"gasLimit"),to:b(t[4]),value:E(t[5],"value"),data:(0,a.hexlify)(t[6]),accessList:w(t[7],"accessList")};return 8===t.length||k(r,t.slice(8)),r}(t));case 2:return T.from(function(e){const t=(0,a.decodeRlp)((0,a.getBytes)(e).slice(1));(0,a.assertArgument)(Array.isArray(t)&&(9===t.length||12===t.length),"invalid field count for transaction type: 2","data",(0,a.hexlify)(e));const r={type:2,chainId:E(t[0],"chainId"),nonce:A(t[1],"nonce"),maxPriorityFeePerGas:E(t[2],"maxPriorityFeePerGas"),maxFeePerGas:E(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:E(t[4],"gasLimit"),to:b(t[5]),value:E(t[6],"value"),data:(0,a.hexlify)(t[7]),accessList:w(t[8],"accessList")};return 9===t.length||k(r,t.slice(9)),r}(t));case 3:return T.from(function(e){let t=(0,a.decodeRlp)((0,a.getBytes)(e).slice(1)),r="3",n=null;if(4===t.length&&Array.isArray(t[0])){r="3 (network format)";const e=t[1],i=t[2],s=t[3];(0,a.assertArgument)(Array.isArray(e),"invalid network format: blobs not an array","fields[1]",e),(0,a.assertArgument)(Array.isArray(i),"invalid network format: commitments not an array","fields[2]",i),(0,a.assertArgument)(Array.isArray(s),"invalid network format: proofs not an array","fields[3]",s),(0,a.assertArgument)(e.length===i.length,"invalid network format: blobs/commitments length mismatch","fields",t),(0,a.assertArgument)(e.length===s.length,"invalid network format: blobs/proofs length mismatch","fields",t),n=[];for(let r=0;r<t[1].length;r++)n.push({data:e[r],commitment:i[r],proof:s[r]});t=t[0]}(0,a.assertArgument)(Array.isArray(t)&&(11===t.length||14===t.length),`invalid field count for transaction type: ${r}`,"data",(0,a.hexlify)(e));const i={type:3,chainId:E(t[0],"chainId"),nonce:A(t[1],"nonce"),maxPriorityFeePerGas:E(t[2],"maxPriorityFeePerGas"),maxFeePerGas:E(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:E(t[4],"gasLimit"),to:b(t[5]),value:E(t[6],"value"),data:(0,a.hexlify)(t[7]),accessList:w(t[8],"accessList"),maxFeePerBlobGas:E(t[9],"maxFeePerBlobGas"),blobVersionedHashes:t[10]};n&&(i.blobs=n),(0,a.assertArgument)(null!=i.to,`invalid address for transaction type: ${r}`,"data",e),(0,a.assertArgument)(Array.isArray(i.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",e);for(let t=0;t<i.blobVersionedHashes.length;t++)(0,a.assertArgument)((0,a.isHexString)(i.blobVersionedHashes[t],32),`invalid blobVersionedHash at index ${t}: must be length 32`,"data",e);return 11===t.length||k(i,t.slice(11)),i}(t));case 4:return T.from(function(e){const t=(0,a.decodeRlp)((0,a.getBytes)(e).slice(1));(0,a.assertArgument)(Array.isArray(t)&&(10===t.length||13===t.length),"invalid field count for transaction type: 4","data",(0,a.hexlify)(e));const r={type:4,chainId:E(t[0],"chainId"),nonce:A(t[1],"nonce"),maxPriorityFeePerGas:E(t[2],"maxPriorityFeePerGas"),maxFeePerGas:E(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:E(t[4],"gasLimit"),to:b(t[5]),value:E(t[6],"value"),data:(0,a.hexlify)(t[7]),accessList:w(t[8],"accessList"),authorizationList:v(t[9],"authorizationList")};return 10===t.length||k(r,t.slice(10)),r}(t))}(0,a.assert)(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const t=new T;return null!=e.type&&(t.type=e.type),null!=e.to&&(t.to=e.to),null!=e.nonce&&(t.nonce=e.nonce),null!=e.gasLimit&&(t.gasLimit=e.gasLimit),null!=e.gasPrice&&(t.gasPrice=e.gasPrice),null!=e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas),null!=e.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null!=e.maxFeePerBlobGas&&(t.maxFeePerBlobGas=e.maxFeePerBlobGas),null!=e.data&&(t.data=e.data),null!=e.value&&(t.value=e.value),null!=e.chainId&&(t.chainId=e.chainId),null!=e.signature&&(t.signature=s.Signature.from(e.signature)),null!=e.accessList&&(t.accessList=e.accessList),null!=e.authorizationList&&(t.authorizationList=e.authorizationList),null!=e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes),null!=e.kzg&&(t.kzg=e.kzg),null!=e.blobs&&(t.blobs=e.blobs),null!=e.hash&&((0,a.assertArgument)(t.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),(0,a.assertArgument)(t.hash===e.hash,"hash mismatch","tx",e)),null!=e.from&&((0,a.assertArgument)(t.isSigned(),"unsigned transaction cannot define '.from'","tx",e),(0,a.assertArgument)(t.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),t}}t.Transaction=T},1038:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ZeroAddress=void 0,t.ZeroAddress="0x0000000000000000000000000000000000000000"},1048:(e,t,r)=>{"use strict";const n=r(7991),i=r(9318),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=c,t.IS=50;const a=2147483647;function o(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|g(e,t);let n=o(r);const i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(J(e,Uint8Array)){const t=new Uint8Array(e);return f(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(J(e,ArrayBuffer)||e&&J(e.buffer,ArrayBuffer))return f(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(J(e,SharedArrayBuffer)||e&&J(e.buffer,SharedArrayBuffer)))return f(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const i=function(e){if(c.isBuffer(e)){const t=0|p(e.length),r=o(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||Y(e.length)?o(0):d(e);if("Buffer"===e.type&&Array.isArray(e.data))return d(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return l(e),o(e<0?0:0|p(e))}function d(e){const t=e.length<0?0:0|p(e.length),r=o(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function f(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function p(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function g(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||J(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Q(e).length;default:if(i)return n?-1:q(e).length;t=(""+t).toLowerCase(),i=!0}}function y(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return N(this,t,r);case"utf8":case"utf-8":return k(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return P(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,i){let s,a=1,o=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,o/=2,c/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let n=-1;for(s=r;s<o;s++)if(u(e,s)===u(t,-1===n?0:s-n)){if(-1===n&&(n=s),s-n+1===c)return n*a}else-1!==n&&(s-=s-n),n=-1}else for(r+c>o&&(r=o-c),s=r;s>=0;s--){let r=!0;for(let n=0;n<c;n++)if(u(e,s+n)!==u(t,n)){r=!1;break}if(r)return s}return-1}function v(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const s=t.length;let a;for(n>s/2&&(n=s/2),a=0;a<n;++a){const n=parseInt(t.substr(2*a,2),16);if(Y(n))return a;e[r+a]=n}return a}function A(e,t,r,n){return W(q(t,e.length-r),e,r,n)}function E(e,t,r,n){return W(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function C(e,t,r,n){return W(Q(t),e,r,n)}function B(e,t,r,n){return W(function(e,t){let r,n,i;const s=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,i=r%256,s.push(i),s.push(n);return s}(t,e.length-r),e,r,n)}function S(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function k(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let s=null,a=t>239?4:t>223?3:t>191?2:1;if(i+a<=r){let r,n,o,c;switch(a){case 1:t<128&&(s=t);break;case 2:r=e[i+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(s=c));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(c=(15&t)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(s=c));break;case 4:r=e[i+1],n=e[i+2],o=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&o)&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&o,c>65535&&c<1114112&&(s=c))}}null===s?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=a}return function(e){const t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=T));return r}(n)}c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?o(e):void 0!==t?"string"==typeof r?o(e).fill(t,r):o(e).fill(t):o(e)}(e,t,r)},c.allocUnsafe=function(e){return h(e)},c.allocUnsafeSlow=function(e){return h(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(J(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),J(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=c.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(J(t,Uint8Array))i+t.length>n.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},c.byteLength=g,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)m(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?k(this,0,e):y.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e="";const r=t.IS;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},s&&(c.prototype[s]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,i){if(J(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let s=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const o=Math.min(s,a),u=this.slice(n,i),l=e.slice(t,r);for(let e=0;e<o;++e)if(u[e]!==l[e]){s=u[e],a=l[e];break}return s<a?-1:a<s?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let s=!1;for(;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return A(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return C(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const T=4096;function I(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function P(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function N(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=Z[e[n]];return i}function x(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function O(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,r,n,i,s){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function U(e,t,r,n,i){H(t,n,i,e,r,7);let s=Number(t&BigInt(4294967295));e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function L(e,t,r,n,i){H(t,n,i,e,r,7);let s=Number(t&BigInt(4294967295));e[r+7]=s,s>>=8,e[r+6]=s,s>>=8,e[r+5]=s,s>>=8,e[r+4]=s;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function D(e,t,r,n,i,s){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(e,t,r,n,s){return t=+t,r>>>=0,s||D(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function M(e,t,r,n,s){return t=+t,r>>>=0,s||D(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);let n=this[e],i=1,s=0;for(;++s<t&&(i*=256);)n+=this[e+s]*i;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=X(function(e){_(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))}),c.prototype.readBigUInt64BE=X(function(e){_(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);let n=this[e],i=1,s=0;for(;++s<t&&(i*=256);)n+=this[e+s]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);let n=t,i=1,s=this[e+--n];for(;n>0&&(i*=256);)s+=this[e+--n]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*t)),s},c.prototype.readInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||O(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||O(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=X(function(e){_(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),c.prototype.readBigInt64BE=X(function(e){_(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||O(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||O(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||O(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||O(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){R(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=1,s=0;for(this[t]=255&e;++s<r&&(i*=256);)this[t+s]=e/i&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){R(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=r-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=X(function(e,t=0){return U(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=X(function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}let i=0,s=1,a=0;for(this[t]=255&e;++i<r&&(s*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/s|0)-a&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}let i=r-1,s=1,a=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/s|0)-a&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=X(function(e,t=0){return U(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=X(function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(e,t,r){return F(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return F(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return M(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return M(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const s=c.isBuffer(e)?e:c.from(e,n),a=s.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=s[i%a]}return this};const j={};function K(e,t,r){j[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function V(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function H(e,t,r,n,i,s){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=s>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(s+1)}${n}`:`>= -(2${n} ** ${8*(s+1)-1}${n}) and < 2 ** ${8*(s+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new j.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){_(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||G(t,e.length-(r+1))}(n,i,s)}function _(e,t){if("number"!=typeof e)throw new j.ERR_INVALID_ARG_TYPE(t,"number",e)}function G(e,t,r){if(Math.floor(e)!==e)throw _(e,r),new j.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}K("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),K("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),K("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=V(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=V(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);const z=/[^+/0-9A-Za-z-_]/g;function q(e,t){let r;t=t||1/0;const n=e.length;let i=null;const s=[];for(let a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function Q(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function W(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function J(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const Z=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?$:e}function $(){throw new Error("BigInt not supported")}},1054:(e,t,r)=>{var n=r(4643);r(8550),r(5417),r(943);var i=e.exports=n.pkcs1=n.pkcs1||{};function s(e,t,r){r||(r=n.md.sha1.create());for(var i="",s=Math.ceil(t/r.digestLength),a=0;a<s;++a){var o=String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,255&a);r.start(),r.update(e+o),i+=r.digest().getBytes()}return i.substring(0,t)}i.encode_rsa_oaep=function(e,t,r){var i,a,o,c;"string"==typeof r?(i=r,a=arguments[3]||void 0,o=arguments[4]||void 0):r&&(i=r.label||void 0,a=r.seed||void 0,o=r.md||void 0,r.mgf1&&r.mgf1.md&&(c=r.mgf1.md)),o?o.start():o=n.md.sha1.create(),c||(c=o);var u=Math.ceil(e.n.bitLength()/8),l=u-2*o.digestLength-2;if(t.length>l)throw(y=new Error("RSAES-OAEP input message length is too long.")).length=t.length,y.maxLength=l,y;i||(i=""),o.update(i,"raw");for(var h=o.digest(),d="",f=l-t.length,p=0;p<f;p++)d+="\0";var g=h.getBytes()+d+""+t;if(a){if(a.length!==o.digestLength){var y;throw(y=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.")).seedLength=a.length,y.digestLength=o.digestLength,y}}else a=n.random.getBytes(o.digestLength);var m=s(a,u-o.digestLength-1,c),b=n.util.xorBytes(g,m,g.length),w=s(b,o.digestLength,c);return"\0"+n.util.xorBytes(a,w,a.length)+b},i.decode_rsa_oaep=function(e,t,r){var i,a,o;"string"==typeof r?(i=r,a=arguments[3]||void 0):r&&(i=r.label||void 0,a=r.md||void 0,r.mgf1&&r.mgf1.md&&(o=r.mgf1.md));var c=Math.ceil(e.n.bitLength()/8);if(t.length!==c)throw(m=new Error("RSAES-OAEP encoded message length is invalid.")).length=t.length,m.expectedLength=c,m;if(void 0===a?a=n.md.sha1.create():a.start(),o||(o=a),c<2*a.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");i||(i=""),a.update(i,"raw");for(var u=a.digest().getBytes(),l=t.charAt(0),h=t.substring(1,a.digestLength+1),d=t.substring(1+a.digestLength),f=s(d,a.digestLength,o),p=s(n.util.xorBytes(h,f,h.length),c-a.digestLength-1,o),g=n.util.xorBytes(d,p,d.length),y=g.substring(0,a.digestLength),m="\0"!==l,b=0;b<a.digestLength;++b)m|=u.charAt(b)!==y.charAt(b);for(var w=1,v=a.digestLength,A=a.digestLength;A<g.length;A++){var E=g.charCodeAt(A);m|=E&(w?65534:0),v+=w&=1&E^1}if(m||1!==g.charCodeAt(v))throw new Error("Invalid RSAES-OAEP padding.");return g.substring(v+1)}},1096:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BlockscoutProvider=void 0;const n=r(8718),i=r(4391),s=r(24);class a extends s.JsonRpcProvider{apiKey;constructor(e,t){null==e&&(e="mainnet");const r=i.Network.from(e);null==t&&(t=null);super(a.getRequest(r),r,{staticNetwork:r}),(0,n.defineProperties)(this,{apiKey:t})}_getProvider(e){try{return new a(e,this.apiKey)}catch(e){}return super._getProvider(e)}isCommunityResource(){return null===this.apiKey}getRpcRequest(e){const t=super.getRpcRequest(e);return t&&"eth_estimateGas"===t.method&&1==t.args.length&&(t.args=t.args.slice(),t.args.push("latest")),t}getRpcError(e,t){const r=t?t.error:null;if(r&&-32015===r.code&&!(0,n.isHexString)(r.data||"",!0)){const e={"assert(false)":"01","arithmetic underflow or overflow":"11","division or modulo by zero":"12","out-of-bounds array access; popping on an empty array":"31","out-of-bounds access of an array or bytesN":"32"};let t="";"VM execution error."===r.message?t=e[r.data]||"":e[r.message||""]&&(t=e[r.message||""]),t&&(r.message+=` (reverted: ${r.data})`,r.data="0x4e487b7100000000000000000000000000000000000000000000000000000000000000"+t)}else r&&-32e3===r.code&&"wrong transaction nonce"===r.message&&(r.message+=" (nonce too low)");return super.getRpcError(e,t)}static getRequest(e){const t=new n.FetchRequest(function(e){switch(e){case"mainnet":return"https://eth.blockscout.com/api/eth-rpc";case"sepolia":return"https://eth-sepolia.blockscout.com/api/eth-rpc";case"holesky":return"https://eth-holesky.blockscout.com/api/eth-rpc";case"classic":return"https://etc.blockscout.com/api/eth-rpc";case"arbitrum":return"https://arbitrum.blockscout.com/api/eth-rpc";case"base":return"https://base.blockscout.com/api/eth-rpc";case"base-sepolia":return"https://base-sepolia.blockscout.com/api/eth-rpc";case"matic":return"https://polygon.blockscout.com/api/eth-rpc";case"optimism":return"https://optimism.blockscout.com/api/eth-rpc";case"optimism-sepolia":return"https://optimism-sepolia.blockscout.com/api/eth-rpc";case"xdai":return"https://gnosis.blockscout.com/api/eth-rpc"}(0,n.assertArgument)(!1,"unsupported network","network",e)}(e.name));return t.allowGzip=!0,t}}t.BlockscoutProvider=a},1136:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pkcs7Strip=t.pkcs7Pad=t.OFB=t.ECB=t.CTR=t.CFB=t.CBC=t.ModeOfOperation=t.AES=void 0;var n=r(1527);Object.defineProperty(t,"AES",{enumerable:!0,get:function(){return n.AES}});var i=r(1749);Object.defineProperty(t,"ModeOfOperation",{enumerable:!0,get:function(){return i.ModeOfOperation}});var s=r(1938);Object.defineProperty(t,"CBC",{enumerable:!0,get:function(){return s.CBC}});var a=r(8981);Object.defineProperty(t,"CFB",{enumerable:!0,get:function(){return a.CFB}});var o=r(3959);Object.defineProperty(t,"CTR",{enumerable:!0,get:function(){return o.CTR}});var c=r(2866);Object.defineProperty(t,"ECB",{enumerable:!0,get:function(){return c.ECB}});var u=r(1769);Object.defineProperty(t,"OFB",{enumerable:!0,get:function(){return u.OFB}});var l=r(5321);Object.defineProperty(t,"pkcs7Pad",{enumerable:!0,get:function(){return l.pkcs7Pad}}),Object.defineProperty(t,"pkcs7Strip",{enumerable:!0,get:function(){return l.pkcs7Strip}})},1154:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Signature=void 0;const n=r(2234),i=r(8718),s=BigInt(0),a=BigInt(1),o=BigInt(2),c=BigInt(27),u=BigInt(28),l=BigInt(35),h={};function d(e){return(0,i.zeroPadValue)((0,i.toBeArray)(e),32)}class f{#ee;#te;#re;#ne;get r(){return this.#ee}set r(e){(0,i.assertArgument)(32===(0,i.dataLength)(e),"invalid r","value",e),this.#ee=(0,i.hexlify)(e)}get s(){return(0,i.assertArgument)(parseInt(this.#te.substring(0,3))<8,"non-canonical s; use ._s","s",this.#te),this.#te}set s(e){(0,i.assertArgument)(32===(0,i.dataLength)(e),"invalid s","value",e),this.#te=(0,i.hexlify)(e)}get _s(){return this.#te}isValid(){return parseInt(this.#te.substring(0,3))<8}get v(){return this.#re}set v(e){const t=(0,i.getNumber)(e,"value");(0,i.assertArgument)(27===t||28===t,"invalid v","v",e),this.#re=t}get networkV(){return this.#ne}get legacyChainId(){const e=this.networkV;return null==e?null:f.getChainId(e)}get yParity(){return 27===this.v?0:1}get yParityAndS(){const e=(0,i.getBytes)(this.s);return this.yParity&&(e[0]|=128),(0,i.hexlify)(e)}get compactSerialized(){return(0,i.concat)([this.r,this.yParityAndS])}get serialized(){return(0,i.concat)([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(e,t,r,n){(0,i.assertPrivate)(e,h,"Signature"),this.#ee=t,this.#te=r,this.#re=n,this.#ne=null}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this._s}"${this.isValid()?"":', valid: "false"'}, yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new f(h,this.r,this._s,this.v);return this.networkV&&(e.#ne=this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:null!=e?e.toString():null,r:this.r,s:this._s,v:this.v}}static getChainId(e){const t=(0,i.getBigInt)(e,"v");return t==c||t==u?s:((0,i.assertArgument)(t>=l,"invalid EIP-155 v","v",e),(t-l)/o)}static getChainIdV(e,t){return(0,i.getBigInt)(e)*o+BigInt(35+t-27)}static getNormalizedV(e){const t=(0,i.getBigInt)(e);return t===s||t===c?27:t===a||t===u?28:((0,i.assertArgument)(t>=l,"invalid v","v",e),t&a?27:28)}static from(e){function t(t,r){(0,i.assertArgument)(t,r,"signature",e)}if(null==e)return new f(h,n.ZeroHash,n.ZeroHash,27);if("string"==typeof e){const r=(0,i.getBytes)(e,"signature");if(64===r.length){const e=(0,i.hexlify)(r.slice(0,32)),t=r.slice(32,64),n=128&t[0]?28:27;return t[0]&=127,new f(h,e,(0,i.hexlify)(t),n)}if(65===r.length){const e=(0,i.hexlify)(r.slice(0,32)),t=(0,i.hexlify)(r.slice(32,64)),n=f.getNormalizedV(r[64]);return new f(h,e,t,n)}t(!1,"invalid raw signature length")}if(e instanceof f)return e.clone();const r=e.r;t(null!=r,"missing r");const s=d(r),a=function(e,r){if(null!=e)return d(e);if(null!=r){t((0,i.isHexString)(r,32),"invalid yParityAndS");const e=(0,i.getBytes)(r);return e[0]&=127,(0,i.hexlify)(e)}t(!1,"missing s")}(e.s,e.yParityAndS),{networkV:o,v:c}=function(e,r,n){if(null!=e){const t=(0,i.getBigInt)(e);return{networkV:t>=l?t:void 0,v:f.getNormalizedV(t)}}if(null!=r)return t((0,i.isHexString)(r,32),"invalid yParityAndS"),{v:128&(0,i.getBytes)(r)[0]?28:27};if(null!=n){switch((0,i.getNumber)(n,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}t(!1,"invalid yParity")}t(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),u=new f(h,s,a,c);return o&&(u.#ne=o),t(null==e.yParity||(0,i.getNumber)(e.yParity,"sig.yParity")===u.yParity,"yParity mismatch"),t(null==e.yParityAndS||e.yParityAndS===u.yParityAndS,"yParityAndS mismatch"),u}}t.Signature=f},1197:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;const n=r(7971),i=e=>e instanceof Uint8Array;t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength);t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);if(t.rotr=(e,t)=>e<<32-t|e>>>t,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.isLE)throw new Error("Non little-endian hardware is not supported");const s=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));t.bytesToHex=function(e){if(!i(e))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=s[e[r]];return t},t.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(t/2);for(let t=0;t<r.length;t++){const n=2*t,i=e.slice(n,n+2),s=Number.parseInt(i,16);if(Number.isNaN(s)||s<0)throw new Error("Invalid byte sequence");r[t]=s}return r};function a(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function o(e){if("string"==typeof e&&(e=a(e)),!i(e))throw new Error("expected Uint8Array, got "+typeof e);return e}t.nextTick=async()=>{},t.asyncLoop=async function(e,r,n){let i=Date.now();for(let s=0;s<e;s++){n(s);const e=Date.now()-i;e>=0&&e<r||(await(0,t.nextTick)(),i+=e)}},t.utf8ToBytes=a,t.toBytes=o,t.concatBytes=function(...e){const t=new Uint8Array(e.reduce((e,t)=>e+t.length,0));let r=0;return e.forEach(e=>{if(!i(e))throw new Error("Uint8Array expected");t.set(e,r),r+=e.length}),t};t.Hash=class{clone(){return this._cloneInto()}};const c={}.toString;t.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!==c.call(t))throw new Error("Options should be object or undefined");return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(o(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(o(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.wrapXOFConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(o(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},1264:(e,t,r)=>{var n=r(4643);r(7835),r(4467),r(4117),r(5206),r(3939),r(3574),r(5114),r(2374),r(8550),r(846);var i=n.asn1,s=e.exports=n.pki=n.pki||{};s.pemToDer=function(e){var t=n.pem.decode(e)[0];if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert PEM to DER; PEM is encrypted.");return n.util.createBuffer(t.body)},s.privateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("PRIVATE KEY"!==t.type&&"RSA PRIVATE KEY"!==t.type){var r=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert private key from PEM; PEM is encrypted.");var a=i.fromDer(t.body);return s.privateKeyFromAsn1(a)},s.privateKeyToPem=function(e,t){var r={type:"RSA PRIVATE KEY",body:i.toDer(s.privateKeyToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},s.privateKeyInfoToPem=function(e,t){var r={type:"PRIVATE KEY",body:i.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})}},1333:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FixedNumber=void 0;const n=r(5020),i=r(355),s=r(9009),a=r(6441),o=BigInt(-1),c=BigInt(0),u=BigInt(1),l=BigInt(5),h={};let d="0000";for(;d.length<80;)d+=d;function f(e){let t=d;for(;t.length<e;)t+=t;return BigInt("1"+t.substring(0,e))}function p(e,t,r){const n=BigInt(t.width);if(t.signed){const t=u<<n-u;(0,i.assert)(null==r||e>=-t&&e<t,"overflow","NUMERIC_FAULT",{operation:r,fault:"overflow",value:e}),e=e>c?(0,s.fromTwos)((0,s.mask)(e,n),n):-(0,s.fromTwos)((0,s.mask)(-e,n),n)}else{const t=u<<n;(0,i.assert)(null==r||e>=0&&e<t,"overflow","NUMERIC_FAULT",{operation:r,fault:"overflow",value:e}),e=(e%t+t)%t&t-u}return e}function g(e){"number"==typeof e&&(e=`fixed128x${e}`);let t=!0,r=128,n=18;if("string"==typeof e)if("fixed"===e);else if("ufixed"===e)t=!1;else{const s=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);(0,i.assertArgument)(s,"invalid fixed format","format",e),t="u"!==s[1],r=parseInt(s[2]),n=parseInt(s[3])}else if(e){const s=e,a=(e,t,r)=>null==s[e]?r:((0,i.assertArgument)(typeof s[e]===t,"invalid fixed format ("+e+" not "+t+")","format."+e,s[e]),s[e]);t=a("signed","boolean",t),r=a("width","number",r),n=a("decimals","number",n)}(0,i.assertArgument)(r%8==0,"invalid FixedNumber width (not byte aligned)","format.width",r),(0,i.assertArgument)(n<=80,"invalid FixedNumber decimals (too large)","format.decimals",n);return{signed:t,width:r,decimals:n,name:(t?"":"u")+"fixed"+String(r)+"x"+String(n)}}class y{format;#ie;#se;#ae;_value;constructor(e,t,r){(0,i.assertPrivate)(e,h,"FixedNumber"),this.#se=t,this.#ie=r;const n=function(e,t){let r="";e<c&&(r="-",e*=o);let n=e.toString();if(0===t)return r+n;for(;n.length<=t;)n=d+n;const i=n.length-t;for(n=n.substring(0,i)+"."+n.substring(i);"0"===n[0]&&"."!==n[1];)n=n.substring(1);for(;"0"===n[n.length-1]&&"."!==n[n.length-2];)n=n.substring(0,n.length-1);return r+n}(t,r.decimals);(0,a.defineProperties)(this,{format:r.name,_value:n}),this.#ae=f(r.decimals)}get signed(){return this.#ie.signed}get width(){return this.#ie.width}get decimals(){return this.#ie.decimals}get value(){return this.#se}#oe(e){(0,i.assertArgument)(this.format===e.format,"incompatible format; use fixedNumber.toFormat","other",e)}#ce(e,t){return e=p(e,this.#ie,t),new y(h,e,this.#ie)}#ue(e,t){return this.#oe(e),this.#ce(this.#se+e.#se,t)}addUnsafe(e){return this.#ue(e)}add(e){return this.#ue(e,"add")}#le(e,t){return this.#oe(e),this.#ce(this.#se-e.#se,t)}subUnsafe(e){return this.#le(e)}sub(e){return this.#le(e,"sub")}#he(e,t){return this.#oe(e),this.#ce(this.#se*e.#se/this.#ae,t)}mulUnsafe(e){return this.#he(e)}mul(e){return this.#he(e,"mul")}mulSignal(e){this.#oe(e);const t=this.#se*e.#se;return(0,i.assert)(t%this.#ae===c,"precision lost during signalling mul","NUMERIC_FAULT",{operation:"mulSignal",fault:"underflow",value:this}),this.#ce(t/this.#ae,"mulSignal")}#de(e,t){return(0,i.assert)(e.#se!==c,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),this.#oe(e),this.#ce(this.#se*this.#ae/e.#se,t)}divUnsafe(e){return this.#de(e)}div(e){return this.#de(e,"div")}divSignal(e){(0,i.assert)(e.#se!==c,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),this.#oe(e);const t=this.#se*this.#ae;return(0,i.assert)(t%e.#se===c,"precision lost during signalling div","NUMERIC_FAULT",{operation:"divSignal",fault:"underflow",value:this}),this.#ce(t/e.#se,"divSignal")}cmp(e){let t=this.value,r=e.value;const n=this.decimals-e.decimals;return n>0?r*=f(n):n<0&&(t*=f(-n)),t<r?-1:t>r?1:0}eq(e){return 0===this.cmp(e)}lt(e){return this.cmp(e)<0}lte(e){return this.cmp(e)<=0}gt(e){return this.cmp(e)>0}gte(e){return this.cmp(e)>=0}floor(){let e=this.#se;return this.#se<c&&(e-=this.#ae-u),e=this.#se/this.#ae*this.#ae,this.#ce(e,"floor")}ceiling(){let e=this.#se;return this.#se>c&&(e+=this.#ae-u),e=this.#se/this.#ae*this.#ae,this.#ce(e,"ceiling")}round(e){if(null==e&&(e=0),e>=this.decimals)return this;const t=this.decimals-e,r=l*f(t-1);let n=this.value+r;const i=f(t);return n=n/i*i,p(n,this.#ie,"round"),new y(h,n,this.#ie)}isZero(){return this.#se===c}isNegative(){return this.#se<c}toString(){return this._value}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return y.fromString(this.toString(),e)}static fromValue(e,t,r){const n=null==t?0:(0,s.getNumber)(t),a=g(r);let o=(0,s.getBigInt)(e,"value");const u=n-a.decimals;if(u>0){const t=f(u);(0,i.assert)(o%t===c,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:e}),o/=t}else u<0&&(o*=f(-u));return p(o,a,"fromValue"),new y(h,o,a)}static fromString(e,t){const r=e.match(/^(-?)([0-9]*)\.?([0-9]*)$/);(0,i.assertArgument)(r&&r[2].length+r[3].length>0,"invalid FixedNumber string value","value",e);const n=g(t);let s=r[2]||"0",a=r[3]||"";for(;a.length<n.decimals;)a+=d;(0,i.assert)(a.substring(n.decimals).match(/^0*$/),"too many decimals for format","NUMERIC_FAULT",{operation:"fromString",fault:"underflow",value:e}),a=a.substring(0,n.decimals);const o=BigInt(r[1]+s+a);return p(o,n,"fromString"),new y(h,o,n)}static fromBytes(e,t){let r=(0,s.toBigInt)((0,n.getBytes)(e,"value"));const i=g(t);return i.signed&&(r=(0,s.fromTwos)(r,i.width)),p(r,i,"fromBytes"),new y(h,r,i)}}t.FixedNumber=y},1352:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ripemd160=void 0;const n=r(2808),i=r(8718);let s=!1;const a=function(e){return(0,n.ripemd160)(e)};let o=a;function c(e){const t=(0,i.getBytes)(e,"data");return(0,i.hexlify)(o(t))}t.ripemd160=c,c._=a,c.lock=function(){s=!0},c.register=function(e){if(s)throw new TypeError("ripemd160 is locked");o=e},Object.freeze(c)},1457:(e,t,r)=>{var n=r(4643);r(8550),e.exports=n.cipher=n.cipher||{},n.cipher.algorithms=n.cipher.algorithms||{},n.cipher.createCipher=function(e,t){var r=e;if("string"==typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!1})},n.cipher.createDecipher=function(e,t){var r=e;if("string"==typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!0})},n.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),n.cipher.algorithms[e]=t},n.cipher.getAlgorithm=function(e){return(e=e.toUpperCase())in n.cipher.algorithms?n.cipher.algorithms[e]:null};var i=n.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};i.prototype.start=function(e){e=e||{};var t={};for(var r in e)t[r]=e[r];t.decrypt=this._decrypt,this._finish=!1,this._input=n.util.createBuffer(),this.output=e.output||n.util.createBuffer(),this.mode.start(t)},i.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},i.prototype.finish=function(e){!e||"ECB"!==this.mode.name&&"CBC"!==this.mode.name||(this.mode.pad=function(t){return e(this.blockSize,t,!1)},this.mode.unpad=function(t){return e(this.blockSize,t,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t))&&(this._finish=!0,this.update(),!(this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t))&&!(this.mode.afterFinish&&!this.mode.afterFinish(this.output,t)))}},1503:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encodeRlp=void 0;const n=r(5020);function i(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function s(e){if(Array.isArray(e)){let t=[];if(e.forEach(function(e){t=t.concat(s(e))}),t.length<=55)return t.unshift(192+t.length),t;const r=i(t.length);return r.unshift(247+r.length),r.concat(t)}const t=Array.prototype.slice.call((0,n.getBytes)(e,"object"));if(1===t.length&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const r=i(t.length);return r.unshift(183+r.length),r.concat(t)}const a="0123456789abcdef";t.encodeRlp=function(e){let t="0x";for(const r of s(e))t+=a[r>>4],t+=a[15&r];return t}},1527:function(e,t){"use strict";var r,n,i,s=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},a=this&&this.__classPrivateFieldSet||function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r};Object.defineProperty(t,"__esModule",{value:!0}),t.AES=void 0;const o={16:10,24:12,32:14},c=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],u=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],l=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],h=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],d=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],f=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],p=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],g=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],y=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],m=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],b=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],w=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],v=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],A=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],E=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function C(e){const t=[];for(let r=0;r<e.length;r+=4)t.push(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]);return t}class B{get key(){return s(this,r,"f").slice()}constructor(e){if(r.set(this,void 0),n.set(this,void 0),i.set(this,void 0),!(this instanceof B))throw Error("AES must be instanitated with `new`");a(this,r,new Uint8Array(e),"f");const t=o[this.key.length];if(null==t)throw new TypeError("invalid key size (must be 16, 24 or 32 bytes)");a(this,i,[],"f"),a(this,n,[],"f");for(let e=0;e<=t;e++)s(this,i,"f").push([0,0,0,0]),s(this,n,"f").push([0,0,0,0]);const l=4*(t+1),h=this.key.length/4,d=C(this.key);let f;for(let e=0;e<h;e++)f=e>>2,s(this,i,"f")[f][e%4]=d[e],s(this,n,"f")[t-f][e%4]=d[e];let p,g=0,y=h;for(;y<l;){if(p=d[h-1],d[0]^=u[p>>16&255]<<24^u[p>>8&255]<<16^u[255&p]<<8^u[p>>24&255]^c[g]<<24,g+=1,8!=h)for(let e=1;e<h;e++)d[e]^=d[e-1];else{for(let e=1;e<h/2;e++)d[e]^=d[e-1];p=d[h/2-1],d[h/2]^=u[255&p]^u[p>>8&255]<<8^u[p>>16&255]<<16^u[p>>24&255]<<24;for(let e=h/2+1;e<h;e++)d[e]^=d[e-1]}let e,r,a=0;for(;a<h&&y<l;)e=y>>2,r=y%4,s(this,i,"f")[e][r]=d[a],s(this,n,"f")[t-e][r]=d[a++],y++}for(let e=1;e<t;e++)for(let t=0;t<4;t++)p=s(this,n,"f")[e][t],s(this,n,"f")[e][t]=w[p>>24&255]^v[p>>16&255]^A[p>>8&255]^E[255&p]}encrypt(e){if(16!=e.length)throw new TypeError("invalid plaintext size (must be 16 bytes)");const t=s(this,i,"f").length-1,r=[0,0,0,0];let n=C(e);for(let e=0;e<4;e++)n[e]^=s(this,i,"f")[0][e];for(let e=1;e<t;e++){for(let t=0;t<4;t++)r[t]=h[n[t]>>24&255]^d[n[(t+1)%4]>>16&255]^f[n[(t+2)%4]>>8&255]^p[255&n[(t+3)%4]]^s(this,i,"f")[e][t];n=r.slice()}const a=new Uint8Array(16);let o=0;for(let e=0;e<4;e++)o=s(this,i,"f")[t][e],a[4*e]=255&(u[n[e]>>24&255]^o>>24),a[4*e+1]=255&(u[n[(e+1)%4]>>16&255]^o>>16),a[4*e+2]=255&(u[n[(e+2)%4]>>8&255]^o>>8),a[4*e+3]=255&(u[255&n[(e+3)%4]]^o);return a}decrypt(e){if(16!=e.length)throw new TypeError("invalid ciphertext size (must be 16 bytes)");const t=s(this,n,"f").length-1,r=[0,0,0,0];let i=C(e);for(let e=0;e<4;e++)i[e]^=s(this,n,"f")[0][e];for(let e=1;e<t;e++){for(let t=0;t<4;t++)r[t]=g[i[t]>>24&255]^y[i[(t+3)%4]>>16&255]^m[i[(t+2)%4]>>8&255]^b[255&i[(t+1)%4]]^s(this,n,"f")[e][t];i=r.slice()}const a=new Uint8Array(16);let o=0;for(let e=0;e<4;e++)o=s(this,n,"f")[t][e],a[4*e]=255&(l[i[e]>>24&255]^o>>24),a[4*e+1]=255&(l[i[(e+3)%4]>>16&255]^o>>16),a[4*e+2]=255&(l[i[(e+2)%4]>>8&255]^o>>8),a[4*e+3]=255&(l[255&i[(e+1)%4]]^o);return a}}t.AES=B,r=new WeakMap,n=new WeakMap,i=new WeakMap},1537:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapHashToField=t.getMinHashLength=t.getFieldBytesLength=t.hashToPrivateScalar=t.FpSqrtEven=t.FpSqrtOdd=t.Field=t.nLength=t.FpIsSquare=t.FpDiv=t.FpInvertBatch=t.FpPow=t.validateField=t.isNegativeLE=t.FpSqrt=t.tonelliShanks=t.invert=t.pow2=t.pow=t.mod=void 0;const n=r(5226),i=BigInt(0),s=BigInt(1),a=BigInt(2),o=BigInt(3),c=BigInt(4),u=BigInt(5),l=BigInt(8);BigInt(9),BigInt(16);function h(e,t){const r=e%t;return r>=i?r:t+r}function d(e,t,r){if(r<=i||t<i)throw new Error("Expected power/modulo > 0");if(r===s)return i;let n=s;for(;t>i;)t&s&&(n=n*e%r),e=e*e%r,t>>=s;return n}function f(e,t){if(e===i||t<=i)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=h(e,t),n=t,a=i,o=s,c=s,u=i;for(;r!==i;){const e=n/r,t=n%r,i=a-c*e,s=o-u*e;n=r,r=t,a=c,o=u,c=i,u=s}if(n!==s)throw new Error("invert: does not exist");return h(a,t)}function p(e){const t=(e-s)/a;let r,n,o;for(r=e-s,n=0;r%a===i;r/=a,n++);for(o=a;o<e&&d(o,t,e)!==e-s;o++);if(1===n){const t=(e+s)/c;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}const u=(r+s)/a;return function(e,i){if(e.pow(i,t)===e.neg(e.ONE))throw new Error("Cannot find square root");let a=n,c=e.pow(e.mul(e.ONE,o),r),l=e.pow(i,u),h=e.pow(i,r);for(;!e.eql(h,e.ONE);){if(e.eql(h,e.ZERO))return e.ZERO;let t=1;for(let r=e.sqr(h);t<a&&!e.eql(r,e.ONE);t++)r=e.sqr(r);const r=e.pow(c,s<<BigInt(a-t-1));c=e.sqr(r),l=e.mul(l,r),h=e.mul(h,c),a=t}return l}}function g(e){if(e%c===o){const t=(e+s)/c;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}if(e%l===u){const t=(e-u)/l;return function(e,r){const n=e.mul(r,a),i=e.pow(n,t),s=e.mul(r,i),o=e.mul(e.mul(s,a),i),c=e.mul(s,e.sub(o,e.ONE));if(!e.eql(e.sqr(c),r))throw new Error("Cannot find square root");return c}}return p(e)}t.mod=h,t.pow=d,t.pow2=function(e,t,r){let n=e;for(;t-- >i;)n*=n,n%=r;return n},t.invert=f,t.tonelliShanks=p,t.FpSqrt=g;t.isNegativeLE=(e,t)=>(h(e,t)&s)===s;const y=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function m(e,t,r){if(r<i)throw new Error("Expected power > 0");if(r===i)return e.ONE;if(r===s)return t;let n=e.ONE,a=t;for(;r>i;)r&s&&(n=e.mul(n,a)),a=e.sqr(a),r>>=s;return n}function b(e,t){const r=new Array(t.length),n=t.reduce((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n)),e.ONE),i=e.inv(n);return t.reduceRight((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n)),i),r}function w(e,t){const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function v(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function A(e){const t=v(e);return t+Math.ceil(t/2)}t.validateField=function(e){const t=y.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,n.validateObject)(e,t)},t.FpPow=m,t.FpInvertBatch=b,t.FpDiv=function(e,t,r){return e.mul(t,"bigint"==typeof r?f(r,e.ORDER):e.inv(r))},t.FpIsSquare=function(e){const t=(e.ORDER-s)/a;return r=>{const n=e.pow(r,t);return e.eql(n,e.ZERO)||e.eql(n,e.ONE)}},t.nLength=w,t.Field=function(e,t,r=!1,a={}){if(e<=i)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:o,nByteLength:c}=w(e,t);if(c>2048)throw new Error("Field lengths over 2048 bytes are not supported");const u=g(e),l=Object.freeze({ORDER:e,BITS:o,BYTES:c,MASK:(0,n.bitMask)(o),ZERO:i,ONE:s,create:t=>h(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("Invalid field element: expected bigint, got "+typeof t);return i<=t&&t<e},is0:e=>e===i,isOdd:e=>(e&s)===s,neg:t=>h(-t,e),eql:(e,t)=>e===t,sqr:t=>h(t*t,e),add:(t,r)=>h(t+r,e),sub:(t,r)=>h(t-r,e),mul:(t,r)=>h(t*r,e),pow:(e,t)=>m(l,e,t),div:(t,r)=>h(t*f(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>f(t,e),sqrt:a.sqrt||(e=>u(l,e)),invertBatch:e=>b(l,e),cmov:(e,t,r)=>r?t:e,toBytes:e=>r?(0,n.numberToBytesLE)(e,c):(0,n.numberToBytesBE)(e,c),fromBytes:e=>{if(e.length!==c)throw new Error(`Fp.fromBytes: expected ${c}, got ${e.length}`);return r?(0,n.bytesToNumberLE)(e):(0,n.bytesToNumberBE)(e)}});return Object.freeze(l)},t.FpSqrtOdd=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?r:e.neg(r)},t.FpSqrtEven=function(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");const r=e.sqrt(t);return e.isOdd(r)?e.neg(r):r},t.hashToPrivateScalar=function(e,t,r=!1){const i=(e=(0,n.ensureBytes)("privateHash",e)).length,a=w(t).nByteLength+8;if(a<24||i<a||i>1024)throw new Error(`hashToPrivateScalar: expected ${a}-1024 bytes of input, got ${i}`);return h(r?(0,n.bytesToNumberLE)(e):(0,n.bytesToNumberBE)(e),t-s)+s},t.getFieldBytesLength=v,t.getMinHashLength=A,t.mapHashToField=function(e,t,r=!1){const i=e.length,a=v(t),o=A(t);if(i<16||i<o||i>1024)throw new Error(`expected ${o}-1024 bytes of input, got ${i}`);const c=h(r?(0,n.bytesToNumberBE)(e):(0,n.bytesToNumberLE)(e),t-s)+s;return r?(0,n.numberToBytesLE)(c,a):(0,n.numberToBytesBE)(c,a)}},1540:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Reader=t.Writer=t.Coder=t.checkResultErrors=t.Result=t.WordSize=void 0;const n=r(8718);t.WordSize=32;const i=new Uint8Array(t.WordSize),s=["then"],a={},o=new WeakMap;function c(e){return o.get(e)}function u(e,t){o.set(e,t)}function l(e,t){const r=new Error(`deferred error during ABI decoding triggered accessing ${e}`);throw r.error=t,r}function h(e,t,r){return e.indexOf(null)>=0?t.map((e,t)=>e instanceof d?h(c(e),e,r):e):e.reduce((e,n,i)=>{let s=t.getValue(n);return n in e||(r&&s instanceof d&&(s=h(c(s),s,r)),e[n]=s),e},{})}class d extends Array{#fe;constructor(...e){const t=e[0];let r=e[1],i=(e[2]||[]).slice(),o=!0;t!==a&&(r=e,i=[],o=!1),super(r.length),r.forEach((e,t)=>{this[t]=e});const h=i.reduce((e,t)=>("string"==typeof t&&e.set(t,(e.get(t)||0)+1),e),new Map);if(u(this,Object.freeze(r.map((e,t)=>{const r=i[t];return null!=r&&1===h.get(r)?r:null}))),this.#fe=[],null==this.#fe&&this.#fe,!o)return;Object.freeze(this);const d=new Proxy(this,{get:(e,t,r)=>{if("string"==typeof t){if(t.match(/^[0-9]+$/)){const r=(0,n.getNumber)(t,"%index");if(r<0||r>=this.length)throw new RangeError("out of result range");const i=e[r];return i instanceof Error&&l(`index ${r}`,i),i}if(s.indexOf(t)>=0)return Reflect.get(e,t,r);const i=e[t];if(i instanceof Function)return function(...t){return i.apply(this===r?e:this,t)};if(!(t in e))return e.getValue.apply(this===r?e:this,[t])}return Reflect.get(e,t,r)}});return u(d,c(this)),d}toArray(e){const t=[];return this.forEach((r,n)=>{r instanceof Error&&l(`index ${n}`,r),e&&r instanceof d&&(r=r.toArray(e)),t.push(r)}),t}toObject(e){const t=c(this);return t.reduce((r,i,s)=>((0,n.assert)(null!=i,`value at index ${s} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),h(t,this,e)),{})}slice(e,t){null==e&&(e=0),e<0&&(e+=this.length)<0&&(e=0),null==t&&(t=this.length),t<0&&(t+=this.length)<0&&(t=0),t>this.length&&(t=this.length);const r=c(this),n=[],i=[];for(let s=e;s<t;s++)n.push(this[s]),i.push(r[s]);return new d(a,n,i)}filter(e,t){const r=c(this),n=[],i=[];for(let s=0;s<this.length;s++){const a=this[s];a instanceof Error&&l(`index ${s}`,a),e.call(t,a,s,this)&&(n.push(a),i.push(r[s]))}return new d(a,n,i)}map(e,t){const r=[];for(let n=0;n<this.length;n++){const i=this[n];i instanceof Error&&l(`index ${n}`,i),r.push(e.call(t,i,n,this))}return r}getValue(e){const t=c(this).indexOf(e);if(-1===t)return;const r=this[t];return r instanceof Error&&l(`property ${JSON.stringify(e)}`,r.error),r}static fromItems(e,t){return new d(a,e,t)}}function f(e){let r=(0,n.toBeArray)(e);return(0,n.assert)(r.length<=t.WordSize,"value out-of-bounds","BUFFER_OVERRUN",{buffer:r,length:t.WordSize,offset:r.length}),r.length!==t.WordSize&&(r=(0,n.getBytesCopy)((0,n.concat)([i.slice(r.length%t.WordSize),r]))),r}t.Result=d,t.checkResultErrors=function(e){const t=[],r=function(e,n){if(Array.isArray(n))for(let i in n){const s=e.slice();s.push(i);try{r(s,n[i])}catch(e){t.push({path:s,error:e})}}};return r([],e),t};t.Coder=class{name;type;localName;dynamic;constructor(e,t,r,i){(0,n.defineProperties)(this,{name:e,type:t,localName:r,dynamic:i},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,t){(0,n.assertArgument)(!1,e,this.localName,t)}};t.Writer=class{#M;#pe;constructor(){this.#M=[],this.#pe=0}get data(){return(0,n.concat)(this.#M)}get length(){return this.#pe}#ge(e){return this.#M.push(e),this.#pe+=e.length,e.length}appendWriter(e){return this.#ge((0,n.getBytesCopy)(e.data))}writeBytes(e){let r=(0,n.getBytesCopy)(e);const s=r.length%t.WordSize;return s&&(r=(0,n.getBytesCopy)((0,n.concat)([r,i.slice(s)]))),this.#ge(r)}writeValue(e){return this.#ge(f(e))}writeUpdatableValue(){const e=this.#M.length;return this.#M.push(i),this.#pe+=t.WordSize,t=>{this.#M[e]=f(t)}}};class p{allowLoose;#M;#ye;#me;#be;#we;constructor(e,t,r){(0,n.defineProperties)(this,{allowLoose:!!t}),this.#M=(0,n.getBytesCopy)(e),this.#me=0,this.#be=null,this.#we=null!=r?r:1024,this.#ye=0}get data(){return(0,n.hexlify)(this.#M)}get dataLength(){return this.#M.length}get consumed(){return this.#ye}get bytes(){return new Uint8Array(this.#M)}#ve(e){if(this.#be)return this.#be.#ve(e);this.#me+=e,(0,n.assert)(this.#we<1||this.#me<=this.#we*this.dataLength,`compressed ABI data exceeds inflation ratio of ${this.#we} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:(0,n.getBytesCopy)(this.#M),offset:this.#ye,length:e,info:{bytesRead:this.#me,dataLength:this.dataLength}})}#Ae(e,r,i){let s=Math.ceil(r/t.WordSize)*t.WordSize;return this.#ye+s>this.#M.length&&(this.allowLoose&&i&&this.#ye+r<=this.#M.length?s=r:(0,n.assert)(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:(0,n.getBytesCopy)(this.#M),length:this.#M.length,offset:this.#ye+s})),this.#M.slice(this.#ye,this.#ye+s)}subReader(e){const t=new p(this.#M.slice(this.#ye+e),this.allowLoose,this.#we);return t.#be=this,t}readBytes(e,t){let r=this.#Ae(0,e,!!t);return this.#ve(e),this.#ye+=r.length,r.slice(0,e)}readValue(){return(0,n.toBigInt)(this.readBytes(t.WordSize))}readIndex(){return(0,n.toNumber)(this.readBytes(t.WordSize))}}t.Reader=p},1674:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NonceManager=void 0;const n=r(8718),i=r(5774);class s extends i.AbstractSigner{signer;#Ee;#Ce;constructor(e){super(e.provider),(0,n.defineProperties)(this,{signer:e}),this.#Ee=null,this.#Ce=0}async getAddress(){return this.signer.getAddress()}connect(e){return new s(this.signer.connect(e))}async getNonce(e){if("pending"===e){null==this.#Ee&&(this.#Ee=super.getNonce("pending"));const e=this.#Ce;return await this.#Ee+e}return super.getNonce(e)}increment(){this.#Ce++}reset(){this.#Ce=0,this.#Ee=null}async sendTransaction(e){const t=this.getNonce("pending");return this.increment(),(e=await this.signer.populateTransaction(e)).nonce=await t,await this.signer.sendTransaction(e)}signTransaction(e){return this.signer.signTransaction(e)}signMessage(e){return this.signer.signMessage(e)}signTypedData(e,t,r){return this.signer.signTypedData(e,t,r)}}t.NonceManager=s},1749:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ModeOfOperation=void 0;const n=r(1527);t.ModeOfOperation=class{constructor(e,t,r){if(r&&!(this instanceof r))throw new Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new n.AES(t)},name:{enumerable:!0,value:e}})}}},1769:function(e,t,r){"use strict";var n,i,s,a=this&&this.__classPrivateFieldSet||function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r},o=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.OFB=void 0;const c=r(1749);class u extends c.ModeOfOperation{constructor(e,t){if(super("OFB",e,u),n.set(this,void 0),i.set(this,void 0),s.set(this,void 0),t){if(t.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");a(this,n,new Uint8Array(t),"f")}else a(this,n,new Uint8Array(16),"f");a(this,i,this.iv,"f"),a(this,s,16,"f")}get iv(){return new Uint8Array(o(this,n,"f"))}encrypt(e){var t,r;if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const n=new Uint8Array(e);for(let e=0;e<n.length;e++)16===o(this,s,"f")&&(a(this,i,this.aes.encrypt(o(this,i,"f")),"f"),a(this,s,0,"f")),n[e]^=o(this,i,"f")[(a(this,s,(r=o(this,s,"f"),t=r++,r),"f"),t)];return n}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");return this.encrypt(e)}}t.OFB=u,n=new WeakMap,i=new WeakMap,s=new WeakMap},1780:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.solidityPackedSha256=t.solidityPackedKeccak256=t.solidityPacked=void 0;const n=r(6107),i=r(6468),s=r(8718),a=new RegExp("^bytes([0-9]+)$"),o=new RegExp("^(u?int)([0-9]*)$"),c=new RegExp("^(.*)\\[([0-9]*)\\]$");function u(e,t,r){switch(e){case"address":return r?(0,s.getBytes)((0,s.zeroPadValue)(t,32)):(0,s.getBytes)((0,n.getAddress)(t));case"string":return(0,s.toUtf8Bytes)(t);case"bytes":return(0,s.getBytes)(t);case"bool":return t=t?"0x01":"0x00",r?(0,s.getBytes)((0,s.zeroPadValue)(t,32)):(0,s.getBytes)(t)}let i=e.match(o);if(i){let n="int"===i[1],a=parseInt(i[2]||"256");return(0,s.assertArgument)((!i[2]||i[2]===String(a))&&a%8==0&&0!==a&&a<=256,"invalid number type","type",e),r&&(a=256),n&&(t=(0,s.toTwos)(t,a)),(0,s.getBytes)((0,s.zeroPadValue)((0,s.toBeArray)(t),a/8))}if(i=e.match(a),i){const n=parseInt(i[1]);return(0,s.assertArgument)(String(n)===i[1]&&0!==n&&n<=32,"invalid bytes type","type",e),(0,s.assertArgument)((0,s.dataLength)(t)===n,`invalid value for ${e}`,"value",t),r?(0,s.getBytes)((0,s.zeroPadBytes)(t,32)):t}if(i=e.match(c),i&&Array.isArray(t)){const r=i[1],n=parseInt(i[2]||String(t.length));(0,s.assertArgument)(n===t.length,`invalid array length for ${e}`,"value",t);const a=[];return t.forEach(function(e){a.push(u(r,e,!0))}),(0,s.getBytes)((0,s.concat)(a))}(0,s.assertArgument)(!1,"invalid type","type",e)}function l(e,t){(0,s.assertArgument)(e.length===t.length,"wrong number of values; expected ${ types.length }","values",t);const r=[];return e.forEach(function(e,n){r.push(u(e,t[n]))}),(0,s.hexlify)((0,s.concat)(r))}t.solidityPacked=l,t.solidityPackedKeccak256=function(e,t){return(0,i.keccak256)(l(e,t))},t.solidityPackedSha256=function(e,t){return(0,i.sha256)(l(e,t))}},1825:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version=void 0,t.version="6.15.0"},1828:(e,t,r)=>{e.exports=r(4643),r(3739),r(7885),r(7835),r(1457),r(2684),r(773),r(81),r(8323),r(7390),r(3314),r(6531),r(3939),r(5206),r(1054),r(3574),r(4056),r(1264),r(339),r(7391),r(5114),r(5417),r(6339),r(8622),r(3105),r(8550)},1836:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EnsResolver=t.BasicMulticoinProviderPlugin=t.MulticoinProviderPlugin=void 0;const n=r(6107),i=r(2234),s=r(7675),a=r(7477),o=r(8718);function c(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):(0,o.assertArgument)(!1,"unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}class u{name;constructor(e){(0,o.defineProperties)(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,t){throw new Error("unsupported coin")}async decodeAddress(e,t){throw new Error("unsupported coin")}}t.MulticoinProviderPlugin=u;t.BasicMulticoinProviderPlugin=class extends u{constructor(){super("org.ethers.plugins.provider.BasicMulticoin")}};const l=new RegExp("^(ipfs)://(.*)$","i"),h=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),l,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];class d{provider;address;name;#Be;#Se;constructor(e,t,r){(0,o.defineProperties)(this,{provider:e,address:t,name:r}),this.#Be=null,this.#Se=new s.Contract(t,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e)}async supportsWildcard(){return null==this.#Be&&(this.#Be=(async()=>{try{return await this.#Se.supportsInterface("0x9061b923")}catch(e){if((0,o.isError)(e,"CALL_EXCEPTION"))return!1;throw this.#Be=null,e}})()),await this.#Be}async#ke(e,t){t=(t||[]).slice();const r=this.#Se.interface;t.unshift((0,a.namehash)(this.name));let n=null;await this.supportsWildcard()&&(n=r.getFunction(e),(0,o.assert)(n,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),t=[(0,a.dnsEncode)(this.name,255),r.encodeFunctionData(n,t)],e="resolve(bytes,bytes)"),t.push({enableCcipRead:!0});try{const i=await this.#Se[e](...t);return n?r.decodeFunctionResult(n,i)[0]:i}catch(e){if(!(0,o.isError)(e,"CALL_EXCEPTION"))throw e}return null}async getAddress(e){if(null==e&&(e=60),60===e)try{const e=await this.#ke("addr(bytes32)");return null==e||e===i.ZeroAddress?null:e}catch(e){if((0,o.isError)(e,"CALL_EXCEPTION"))return null;throw e}if(e>=0&&e<2147483648){let t=e+2147483648;const r=await this.#ke("addr(bytes32,uint)",[t]);if((0,o.isHexString)(r,20))return(0,n.getAddress)(r)}let t=null;for(const r of this.provider.plugins)if(r instanceof u&&r.supportsCoinType(e)){t=r;break}if(null==t)return null;const r=await this.#ke("addr(bytes32,uint)",[e]);if(null==r||"0x"===r)return null;const s=await t.decodeAddress(e,r);if(null!=s)return s;(0,o.assert)(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:r}})}async getText(e){const t=await this.#ke("text(bytes32,string)",[e]);return null==t||"0x"===t?null:t}async getContentHash(){const e=await this.#ke("contenthash(bytes32)");if(null==e||"0x"===e)return null;const t=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const e="e3010170"===t[1]?"ipfs":"ipns",r=parseInt(t[4],16);if(t[5].length===2*r)return`${e}://${(0,o.encodeBase58)("0x"+t[2])}`}const r=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&64===r[1].length)return`bzz://${r[1]}`;(0,o.assert)(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const t=await this.getText("avatar");if(null==t)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:t});for(let r=0;r<h.length;r++){const n=t.match(h[r]);if(null==n)continue;const i=n[1].toLowerCase();switch(i){case"https":case"data":return e.push({type:"url",value:t}),{linkage:e,url:t};case"ipfs":{const r=c(t);return e.push({type:"ipfs",value:t}),e.push({type:"url",value:r}),{linkage:e,url:r}}case"erc721":case"erc1155":{const r="erc721"===i?"tokenURI(uint256)":"uri(uint256)";e.push({type:i,value:t});const a=await this.getAddress();if(null==a)return e.push({type:"!owner",value:""}),{url:null,linkage:e};const u=(n[2]||"").split("/");if(2!==u.length)return e.push({type:`!${i}caip`,value:n[2]||""}),{url:null,linkage:e};const h=u[1],d=new s.Contract(u[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if("erc721"===i){const t=await d.ownerOf(h);if(a!==t)return e.push({type:"!owner",value:t}),{url:null,linkage:e};e.push({type:"owner",value:t})}else if("erc1155"===i){const t=await d.balanceOf(a,h);if(!t)return e.push({type:"!balance",value:"0"}),{url:null,linkage:e};e.push({type:"balance",value:t.toString()})}let f=await d[r](h);if(null==f||"0x"===f)return e.push({type:"!metadata-url",value:""}),{url:null,linkage:e};e.push({type:"metadata-url-base",value:f}),"erc1155"===i&&(f=f.replace("{id}",(0,o.toBeHex)(h,32).substring(2)),e.push({type:"metadata-url-expanded",value:f})),f.match(/^ipfs:/i)&&(f=c(f)),e.push({type:"metadata-url",value:f});let p={};const g=await new o.FetchRequest(f).send();g.assertOk();try{p=g.bodyJson}catch(t){try{e.push({type:"!metadata",value:g.bodyText})}catch(t){const r=g.body;return r&&e.push({type:"!metadata",value:(0,o.hexlify)(r)}),{url:null,linkage:e}}return{url:null,linkage:e}}if(!p)return e.push({type:"!metadata",value:""}),{url:null,linkage:e};e.push({type:"metadata",value:JSON.stringify(p)});let y=p.image;if("string"!=typeof y)return e.push({type:"!imageUrl",value:""}),{url:null,linkage:e};if(y.match(/^(https:\/\/|data:)/i));else{if(null==y.match(l))return e.push({type:"!imageUrl-ipfs",value:y}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:y}),y=c(y)}return e.push({type:"url",value:y}),{linkage:e,url:y}}}}}catch(e){}return{linkage:e,url:null}}static async getEnsAddress(e){const t=await e.getNetwork(),r=t.getPlugin("org.ethers.plugins.network.Ens");return(0,o.assert)(r,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:t}}),r.address}static async#Te(e,t){const r=await d.getEnsAddress(e);try{const n=new s.Contract(r,["function resolver(bytes32) view returns (address)"],e),o=await n.resolver((0,a.namehash)(t),{enableCcipRead:!0});return o===i.ZeroAddress?null:o}catch(e){throw e}}static async fromName(e,t){let r=t;for(;;){if(""===r||"."===r)return null;if("eth"!==t&&"eth"===r)return null;const n=await d.#Te(e,r);if(null!=n){const i=new d(e,n,t);return r===t||await i.supportsWildcard()?i:null}r=r.split(".").slice(1).join(".")}}}t.EnsResolver=d},1938:function(e,t,r){"use strict";var n,i,s=this&&this.__classPrivateFieldSet||function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r},a=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.CBC=void 0;const o=r(1749);class c extends o.ModeOfOperation{constructor(e,t){if(super("ECC",e,c),n.set(this,void 0),i.set(this,void 0),t){if(t.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");s(this,n,new Uint8Array(t),"f")}else s(this,n,new Uint8Array(16),"f");s(this,i,this.iv,"f")}get iv(){return new Uint8Array(a(this,n,"f"))}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const t=new Uint8Array(e.length);for(let r=0;r<e.length;r+=16){for(let t=0;t<16;t++)a(this,i,"f")[t]^=e[r+t];s(this,i,this.aes.encrypt(a(this,i,"f")),"f"),t.set(a(this,i,"f"),r)}return t}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");const t=new Uint8Array(e.length);for(let r=0;r<e.length;r+=16){const n=this.aes.decrypt(e.subarray(r,r+16));for(let s=0;s<16;s++)t[r+s]=n[s]^a(this,i,"f")[s],a(this,i,"f")[s]=e[r+s]}return t}}t.CBC=c,n=new WeakMap,i=new WeakMap},2001:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shake256=t.shake128=t.keccak_512=t.keccak_384=t.keccak_256=t.keccak_224=t.sha3_512=t.sha3_384=t.sha3_256=t.sha3_224=t.Keccak=t.keccakP=void 0;const n=r(9071),i=r(8060),s=r(1197),[a,o,c]=[[],[],[]],u=BigInt(0),l=BigInt(1),h=BigInt(2),d=BigInt(7),f=BigInt(256),p=BigInt(113);for(let e=0,t=l,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],a.push(2*(5*n+r)),o.push((e+1)*(e+2)/2%64);let i=u;for(let e=0;e<7;e++)t=(t<<l^(t>>d)*p)%f,t&h&&(i^=l<<(l<<BigInt(e))-l);c.push(i)}const[g,y]=(0,i.split)(c,!0),m=(e,t,r)=>r>32?(0,i.rotlBH)(e,t,r):(0,i.rotlSH)(e,t,r),b=(e,t,r)=>r>32?(0,i.rotlBL)(e,t,r):(0,i.rotlSL)(e,t,r);function w(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,i=(t+2)%10,s=r[i],a=r[i+1],o=m(s,a,1)^r[n],c=b(s,a,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=o,e[t+r+1]^=c}let t=e[2],i=e[3];for(let r=0;r<24;r++){const n=o[r],s=m(t,i,n),c=b(t,i,n),u=a[r];t=e[u],i=e[u+1],e[u]=s,e[u+1]=c}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=g[n],e[1]^=y[n]}r.fill(0)}t.keccakP=w;class v extends s.Hash{constructor(e,t,r,i=!1,a=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=i,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,n.number)(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,s.u32)(this.state)}keccak(){w(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){(0,n.exists)(this);const{blockLen:t,state:r}=this,i=(e=(0,s.toBytes)(e)).length;for(let n=0;n<i;){const s=Math.min(t-this.pos,i-n);for(let t=0;t<s;t++)r[this.pos++]^=e[n++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,128&t&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){(0,n.exists)(this,!1),(0,n.bytes)(e),this.finish();const t=this.state,{blockLen:r}=this;for(let n=0,i=e.length;n<i;){this.posOut>=r&&this.keccak();const s=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+s),n),this.posOut+=s,n+=s}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,n.number)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,n.output)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:s}=this;return e||(e=new v(t,r,n,s,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=s,e.destroyed=this.destroyed,e}}t.Keccak=v;const A=(e,t,r)=>(0,s.wrapConstructor)(()=>new v(t,e,r));t.sha3_224=A(6,144,28),t.sha3_256=A(6,136,32),t.sha3_384=A(6,104,48),t.sha3_512=A(6,72,64),t.keccak_224=A(1,144,28),t.keccak_256=A(1,136,32),t.keccak_384=A(1,104,48),t.keccak_512=A(1,72,64);const E=(e,t,r)=>(0,s.wrapXOFConstructorWithOpts)((n={})=>new v(t,e,void 0===n.dkLen?r:n.dkLen,!0));t.shake128=E(31,168,16),t.shake256=E(31,136,32)},2046:(e,t,r)=>{var n=r(4643);r(6531),e.exports=n.mgf=n.mgf||{},n.mgf.mgf1=n.mgf1},2063:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IpcSocketProvider=void 0;t.IpcSocketProvider=undefined},2089:(e,t,r)=>{var n=r(3372).Buffer,i={};e.exports=i;var s={};i.encode=function(e,t,r){if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!=typeof r)throw new TypeError('"maxline" must be a number.');var n="";if(e instanceof Uint8Array){var i=0,s=t.length,a=t.charAt(0),o=[0];for(i=0;i<e.length;++i){for(var c=0,u=e[i];c<o.length;++c)u+=o[c]<<8,o[c]=u%s,u=u/s|0;for(;u>0;)o.push(u%s),u=u/s|0}for(i=0;0===e[i]&&i<e.length-1;++i)n+=a;for(i=o.length-1;i>=0;--i)n+=t[o[i]]}else n=function(e,t){var r=0,n=t.length,i=t.charAt(0),s=[0];for(r=0;r<e.length();++r){for(var a=0,o=e.at(r);a<s.length;++a)o+=s[a]<<8,s[a]=o%n,o=o/n|0;for(;o>0;)s.push(o%n),o=o/n|0}var c="";for(r=0;0===e.at(r)&&r<e.length()-1;++r)c+=i;for(r=s.length-1;r>=0;--r)c+=t[s[r]];return c}(e,t);if(r){var l=new RegExp(".{1,"+r+"}","g");n=n.match(l).join("\r\n")}return n},i.decode=function(e,t){if("string"!=typeof e)throw new TypeError('"input" must be a string.');if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');var r=s[t];if(!r){r=s[t]=[];for(var i=0;i<t.length;++i)r[t.charCodeAt(i)]=i}e=e.replace(/\s/g,"");var a=t.length,o=t.charAt(0),c=[0];for(i=0;i<e.length;i++){var u=r[e.charCodeAt(i)];if(void 0===u)return;for(var l=0,h=u;l<c.length;++l)h+=c[l]*a,c[l]=255&h,h>>=8;for(;h>0;)c.push(255&h),h>>=8}for(var d=0;e[d]===o&&d<e.length-1;++d)c.push(0);return void 0!==n?n.from(c.reverse()):new Uint8Array(c.reverse())}},2091:(e,t,r)=>{"use strict";t.x2=void 0;const n=r(9648),i=r(486),s=r(7004),a=r(2249),o=r(3654),c=r(9450);function u(e){if("string"!=typeof e)throw new TypeError("Invalid mnemonic type: "+typeof e);return e.normalize("NFKD")}function l(e){const t=u(e),r=t.split(" ");if(![12,15,18,21,24].includes(r.length))throw new Error("Invalid mnemonic");return{nfkd:t,words:r}}function h(e){n.default.bytes(e,16,20,24,28,32)}const d=e=>{const t=8-e.length/4;return new Uint8Array([(0,s.sha256)(e)[0]>>t<<t])};function f(e){if(!Array.isArray(e)||2048!==e.length||"string"!=typeof e[0])throw new Error("Worlist: expected array of 2048 strings");return e.forEach(e=>{if("string"!=typeof e)throw new Error(`Wordlist: non-string element: ${e}`)}),c.utils.chain(c.utils.checksum(1,d),c.utils.radix2(11,!0),c.utils.alphabet(e))}function p(e,t){let r;if("string"==typeof e){const{words:n}=l(e);r=f(t).decode(n)}else r=f(t).decode(Array.from(new Uint16Array(e.buffer)).map(e=>t[e]));return h(r),r}function g(e,t){h(e);const r=f(t).encode(e).map(e=>t.indexOf(e));return new Uint8Array(new Uint16Array(r).buffer)}t.x2=p;const y=e=>u(`mnemonic${e}`);function m(e,t){let r;return r="string"==typeof e?(new TextEncoder).encode(l(e).nfkd):(new TextEncoder).encode(Array.from(new Uint16Array(e.buffer)).map(e=>t[e]).join(" ")),r}},2163:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FallbackProvider=void 0;const n=r(8718),i=r(3633),s=r(4391),a=BigInt("1"),o=BigInt("2");function c(){return(new Date).getTime()}function u(e){return JSON.stringify(e,(e,t)=>"bigint"==typeof t?{type:"bigint",value:t.toString()}:t)}const l={stallTimeout:400,priority:1,weight:1},h={blockNumber:-2,requests:0,lateResponses:0,errorResponses:0,outOfSync:-1,unsupportedEvents:0,rollingDuration:0,score:0,_network:null,_updateNumber:null,_totalTime:0,_lastFatalError:null,_lastFatalErrorTimestamp:0};function d(e){if(null==e)return"null";if(Array.isArray(e))return"["+e.map(d).join(",")+"]";if("object"==typeof e&&"function"==typeof e.toJSON)return d(e.toJSON());switch(typeof e){case"boolean":case"symbol":return e.toString();case"bigint":case"number":return BigInt(e).toString();case"string":return JSON.stringify(e);case"object":{const t=Object.keys(e);return t.sort(),"{"+t.map(t=>`${JSON.stringify(t)}:${d(e[t])}`).join(",")+"}"}}throw console.log("Could not serialize",e),new Error("Hmm...")}function f(e,t){if("error"in t){const e=t.error;let r;return r=(0,n.isError)(e,"CALL_EXCEPTION")?d(Object.assign({},e,{shortMessage:void 0,reason:void 0,info:void 0})):d(e),{tag:r,value:e}}const r=t.result;return{tag:d(r),value:r}}function p(e,t){const r=new Map;for(const{value:e,tag:n,weight:i}of t){const t=r.get(n)||{value:e,weight:0};t.weight+=i,r.set(n,t)}let n=null;for(const t of r.values())t.weight>=e&&(!n||t.weight>n.weight)&&(n=t);if(n)return n.value}function g(e,t){let r=0;const n=new Map;let i=null;const s=[];for(const{value:e,tag:a,weight:o}of t)if(e instanceof Error){const t=n.get(a)||{value:e,weight:0};t.weight+=o,n.set(a,t),(null==i||t.weight>i.weight)&&(i=t)}else s.push(BigInt(e)),r+=o;if(r<e)return i&&i.weight>=e?i.value:void 0;s.sort((e,t)=>e<t?-1:t>e?1:0);const c=Math.floor(s.length/2);return s.length%2?s[c]:(s[c-1]+s[c]+a)/o}function y(e,t){const r=p(e,t);if(void 0!==r)return r;for(const e of t)if(e.value)return e.value}class m extends i.AbstractProvider{quorum;eventQuorum;eventWorkers;#Ie;#Pe;#Ne;constructor(e,t,r){super(t,r),this.#Ie=e.map(e=>e instanceof i.AbstractProvider?Object.assign({provider:e},l,h):Object.assign({},l,e,h)),this.#Pe=-2,this.#Ne=null,r&&null!=r.quorum?this.quorum=r.quorum:this.quorum=Math.ceil(this.#Ie.reduce((e,t)=>e+=t.weight,0)/2),this.eventQuorum=1,this.eventWorkers=1,(0,n.assertArgument)(this.quorum<=this.#Ie.reduce((e,t)=>e+t.weight,0),"quorum exceed provider weight","quorum",this.quorum)}get providerConfigs(){return this.#Ie.map(e=>{const t=Object.assign({},e);for(const e in t)"_"===e[0]&&delete t[e];return t})}async _detectNetwork(){return s.Network.from((0,n.getBigInt)(await this._perform({method:"chainId"})))}async _translatePerform(e,t){switch(t.method){case"broadcastTransaction":return await e.broadcastTransaction(t.signedTransaction);case"call":return await e.call(Object.assign({},t.transaction,{blockTag:t.blockTag}));case"chainId":return(await e.getNetwork()).chainId;case"estimateGas":return await e.estimateGas(t.transaction);case"getBalance":return await e.getBalance(t.address,t.blockTag);case"getBlock":{const r="blockHash"in t?t.blockHash:t.blockTag;return await e.getBlock(r,t.includeTransactions)}case"getBlockNumber":return await e.getBlockNumber();case"getCode":return await e.getCode(t.address,t.blockTag);case"getGasPrice":return(await e.getFeeData()).gasPrice;case"getPriorityFee":return(await e.getFeeData()).maxPriorityFeePerGas;case"getLogs":return await e.getLogs(t.filter);case"getStorage":return await e.getStorage(t.address,t.position,t.blockTag);case"getTransaction":return await e.getTransaction(t.hash);case"getTransactionCount":return await e.getTransactionCount(t.address,t.blockTag);case"getTransactionReceipt":return await e.getTransactionReceipt(t.hash);case"getTransactionResult":return await e.getTransactionResult(t.hash)}}#xe(e){const t=Array.from(e).map(e=>e.config),r=this.#Ie.slice();!function(e){for(let t=e.length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}}(r),r.sort((e,t)=>e.priority-t.priority);for(const e of r)if(!e._lastFatalError&&-1===t.indexOf(e))return e;return null}#Oe(e,t){const r=this.#xe(e);if(null==r)return null;const n={config:r,result:null,didBump:!1,perform:null,staller:null},i=c();return n.perform=(async()=>{try{r.requests++;const e=await this._translatePerform(r.provider,t);n.result={result:e}}catch(e){r.errorResponses++,n.result={error:e}}const e=c()-i;r._totalTime+=e,r.rollingDuration=.95*r.rollingDuration+.05*e,n.perform=null})(),n.staller=(async()=>{var e;await(e=r.stallTimeout,new Promise(t=>{setTimeout(t,e)})),n.staller=null})(),e.add(n),n}async#Re(){let e=this.#Ne;if(!e){const t=[];this.#Ie.forEach(e=>{t.push((async()=>{await async function(e,t){for(;(e.blockNumber<0||e.blockNumber<t)&&(e._updateNumber||(e._updateNumber=(async()=>{try{const t=await e.provider.getBlockNumber();t>e.blockNumber&&(e.blockNumber=t)}catch(t){e.blockNumber=-2,e._lastFatalError=t,e._lastFatalErrorTimestamp=c()}e._updateNumber=null})()),await e._updateNumber,e.outOfSync++,!e._lastFatalError););}(e,0),e._lastFatalError||(e._network=await e.provider.getNetwork())})())}),this.#Ne=e=(async()=>{await Promise.all(t);let e=null;for(const t of this.#Ie){if(t._lastFatalError)continue;const r=t._network;null==e?e=r.chainId:r.chainId!==e&&(0,n.assert)(!1,"cannot mix providers on different networks","UNSUPPORTED_OPERATION",{operation:"new FallbackProvider"})}})()}await e}async#Ue(e,t){const r=[];for(const n of e)if(null!=n.result){const{tag:e,value:i}=f(t.method,n.result);r.push({tag:e,value:i,weight:n.config.weight})}if(!(r.reduce((e,t)=>e+t.weight,0)<this.quorum)){switch(t.method){case"getBlockNumber":{-2===this.#Pe&&(this.#Pe=Math.ceil((0,n.getNumber)(g(this.quorum,this.#Ie.filter(e=>!e._lastFatalError).map(e=>({value:e.blockNumber,tag:(0,n.getNumber)(e.blockNumber).toString(),weight:e.weight}))))));const e=function(e,t){if(1===e)return(0,n.getNumber)(g(e,t),"%internal");const r=new Map,i=(e,t)=>{const n=r.get(e)||{result:e,weight:0};n.weight+=t,r.set(e,n)};for(const{weight:e,value:r}of t){const t=(0,n.getNumber)(r);i(t-1,e),i(t,e),i(t+1,e)}let s,a=0;for(const{weight:t,result:n}of r.values())t>=e&&(t>a||null!=s&&t===a&&n>s)&&(a=t,s=n);return s}(this.quorum,r);if(void 0===e)return;return e>this.#Pe&&(this.#Pe=e),this.#Pe}case"getGasPrice":case"getPriorityFee":case"estimateGas":return g(this.quorum,r);case"getBlock":return"blockTag"in t&&"pending"===t.blockTag?y(this.quorum,r):p(this.quorum,r);case"call":case"chainId":case"getBalance":case"getTransactionCount":case"getCode":case"getStorage":case"getTransaction":case"getTransactionReceipt":case"getLogs":return p(this.quorum,r);case"broadcastTransaction":return y(this.quorum,r)}(0,n.assert)(!1,"unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${u(t.method)})`})}}async#Le(e,t){if(0===e.size)throw new Error("no runners?!");const r=[];let i=0;for(const t of e)t.perform&&r.push(t.perform),t.staller?r.push(t.staller):t.didBump||(t.didBump=!0,i++);const s=await this.#Ue(e,t);if(void 0!==s){if(s instanceof Error)throw s;return s}for(let r=0;r<i;r++)this.#Oe(e,t);return(0,n.assert)(r.length>0,"quorum not met","SERVER_ERROR",{request:"%sub-requests",info:{request:t,results:Array.from(e).map(e=>u(e.result))}}),await Promise.race(r),await this.#Le(e,t)}async _perform(e){if("broadcastTransaction"===e.method){const t=this.#Ie.map(e=>null),r=this.#Ie.map(async({provider:r,weight:n},i)=>{try{const s=await r._perform(e);t[i]=Object.assign(f(e.method,{result:s}),{weight:n})}catch(r){t[i]=Object.assign(f(e.method,{error:r}),{weight:n})}});for(;;){const e=t.filter(e=>null!=e);for(const{value:t}of e)if(!(t instanceof Error))return t;const i=p(this.quorum,t.filter(e=>null!=e));if((0,n.isError)(i,"INSUFFICIENT_FUNDS"))throw i;const s=r.filter((e,r)=>null==t[r]);if(0===s.length)break;await Promise.race(s)}const i=y(this.quorum,t);if((0,n.assert)(void 0!==i,"problem multi-broadcasting","SERVER_ERROR",{request:"%sub-requests",info:{request:e,results:t.map(u)}}),i instanceof Error)throw i;return i}await this.#Re();const t=new Set;let r=0;for(;;){const n=this.#Oe(t,e);if(null==n)break;if(r+=n.config.weight,r>=this.quorum)break}const i=await this.#Le(t,e);for(const e of t)e.perform&&null==e.result&&e.config.lateResponses++;return i}async destroy(){for(const{provider:e}of this.#Ie)e.destroy();super.destroy()}}t.FallbackProvider=m},2234:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessagePrefix=t.EtherSymbol=t.MaxInt256=t.MinInt256=t.MaxUint256=t.WeiPerEther=t.N=t.ZeroHash=t.ZeroAddress=void 0;var n=r(1038);Object.defineProperty(t,"ZeroAddress",{enumerable:!0,get:function(){return n.ZeroAddress}});var i=r(5784);Object.defineProperty(t,"ZeroHash",{enumerable:!0,get:function(){return i.ZeroHash}});var s=r(2936);Object.defineProperty(t,"N",{enumerable:!0,get:function(){return s.N}}),Object.defineProperty(t,"WeiPerEther",{enumerable:!0,get:function(){return s.WeiPerEther}}),Object.defineProperty(t,"MaxUint256",{enumerable:!0,get:function(){return s.MaxUint256}}),Object.defineProperty(t,"MinInt256",{enumerable:!0,get:function(){return s.MinInt256}}),Object.defineProperty(t,"MaxInt256",{enumerable:!0,get:function(){return s.MaxInt256}});var a=r(3348);Object.defineProperty(t,"EtherSymbol",{enumerable:!0,get:function(){return a.EtherSymbol}}),Object.defineProperty(t,"MessagePrefix",{enumerable:!0,get:function(){return a.MessagePrefix}})},2249:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha384=t.sha512_256=t.sha512_224=t.sha512=t.SHA512=void 0;const n=r(3134),i=r(3109),s=r(3654),[a,o]=i.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),c=new Uint32Array(80),u=new Uint32Array(80);class l extends n.SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:s,Dh:a,Dl:o,Eh:c,El:u,Fh:l,Fl:h,Gh:d,Gl:f,Hh:p,Hl:g}=this;return[e,t,r,n,i,s,a,o,c,u,l,h,d,f,p,g]}set(e,t,r,n,i,s,a,o,c,u,l,h,d,f,p,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|s,this.Dh=0|a,this.Dl=0|o,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|h,this.Gh=0|d,this.Gl=0|f,this.Hh=0|p,this.Hl=0|g}process(e,t){for(let r=0;r<16;r++,t+=4)c[r]=e.getUint32(t),u[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|c[e-15],r=0|u[e-15],n=i.default.rotrSH(t,r,1)^i.default.rotrSH(t,r,8)^i.default.shrSH(t,r,7),s=i.default.rotrSL(t,r,1)^i.default.rotrSL(t,r,8)^i.default.shrSL(t,r,7),a=0|c[e-2],o=0|u[e-2],l=i.default.rotrSH(a,o,19)^i.default.rotrBH(a,o,61)^i.default.shrSH(a,o,6),h=i.default.rotrSL(a,o,19)^i.default.rotrBL(a,o,61)^i.default.shrSL(a,o,6),d=i.default.add4L(s,h,u[e-7],u[e-16]),f=i.default.add4H(d,n,l,c[e-7],c[e-16]);c[e]=0|f,u[e]=0|d}let{Ah:r,Al:n,Bh:s,Bl:l,Ch:h,Cl:d,Dh:f,Dl:p,Eh:g,El:y,Fh:m,Fl:b,Gh:w,Gl:v,Hh:A,Hl:E}=this;for(let e=0;e<80;e++){const t=i.default.rotrSH(g,y,14)^i.default.rotrSH(g,y,18)^i.default.rotrBH(g,y,41),C=i.default.rotrSL(g,y,14)^i.default.rotrSL(g,y,18)^i.default.rotrBL(g,y,41),B=g&m^~g&w,S=y&b^~y&v,k=i.default.add5L(E,C,S,o[e],u[e]),T=i.default.add5H(k,A,t,B,a[e],c[e]),I=0|k,P=i.default.rotrSH(r,n,28)^i.default.rotrBH(r,n,34)^i.default.rotrBH(r,n,39),N=i.default.rotrSL(r,n,28)^i.default.rotrBL(r,n,34)^i.default.rotrBL(r,n,39),x=r&s^r&h^s&h,O=n&l^n&d^l&d;A=0|w,E=0|v,w=0|m,v=0|b,m=0|g,b=0|y,({h:g,l:y}=i.default.add(0|f,0|p,0|T,0|I)),f=0|h,p=0|d,h=0|s,d=0|l,s=0|r,l=0|n;const R=i.default.add3L(I,N,O);r=i.default.add3H(R,T,P,x),n=0|R}({h:r,l:n}=i.default.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:s,l}=i.default.add(0|this.Bh,0|this.Bl,0|s,0|l)),({h,l:d}=i.default.add(0|this.Ch,0|this.Cl,0|h,0|d)),({h:f,l:p}=i.default.add(0|this.Dh,0|this.Dl,0|f,0|p)),({h:g,l:y}=i.default.add(0|this.Eh,0|this.El,0|g,0|y)),({h:m,l:b}=i.default.add(0|this.Fh,0|this.Fl,0|m,0|b)),({h:w,l:v}=i.default.add(0|this.Gh,0|this.Gl,0|w,0|v)),({h:A,l:E}=i.default.add(0|this.Hh,0|this.Hl,0|A,0|E)),this.set(r,n,s,l,h,d,f,p,g,y,m,b,w,v,A,E)}roundClean(){c.fill(0),u.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}t.SHA512=l;class h extends l{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}class d extends l{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class f extends l{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}t.sha512=(0,s.wrapConstructor)(()=>new l),t.sha512_224=(0,s.wrapConstructor)(()=>new h),t.sha512_256=(0,s.wrapConstructor)(()=>new d),t.sha384=(0,s.wrapConstructor)(()=>new f)},2325:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encryptKeystoreJson=t.encryptKeystoreJsonSync=t.decryptKeystoreJson=t.decryptKeystoreJsonSync=t.isKeystoreJson=void 0;const n=r(1136),i=r(6107),s=r(6468),a=r(203),o=r(8718),c=r(4753),u=r(1825),l="m/44'/60'/0'/0/0";function h(e,t){const r=(0,o.getBytes)(t),u=(0,c.spelunk)(e,"crypto.ciphertext:data!"),h=(0,o.hexlify)((0,s.keccak256)((0,o.concat)([r.slice(16,32),u]))).substring(2);(0,o.assertArgument)(h===(0,c.spelunk)(e,"crypto.mac:string!").toLowerCase(),"incorrect password","password","[ REDACTED ]");const d=function(e,t,r){if("aes-128-ctr"===(0,c.spelunk)(e,"crypto.cipher:string")){const i=(0,c.spelunk)(e,"crypto.cipherparams.iv:data!"),s=new n.CTR(t,i);return(0,o.hexlify)(s.decrypt(r))}(0,o.assert)(!1,"unsupported cipher","UNSUPPORTED_OPERATION",{operation:"decrypt"})}(e,r.slice(0,16),u),f=(0,a.computeAddress)(d);if(e.address){let t=e.address.toLowerCase();t.startsWith("0x")||(t="0x"+t),(0,o.assertArgument)((0,i.getAddress)(t)===f,"keystore address/privateKey mismatch","address",e.address)}const p={address:f,privateKey:d};if("0.1"===(0,c.spelunk)(e,"x-ethers.version:string")){const t=r.slice(32,64),i=(0,c.spelunk)(e,"x-ethers.mnemonicCiphertext:data!"),s=(0,c.spelunk)(e,"x-ethers.mnemonicCounter:data!"),a=new n.CTR(t,s);p.mnemonic={path:(0,c.spelunk)(e,"x-ethers.path:string")||l,locale:(0,c.spelunk)(e,"x-ethers.locale:string")||"en",entropy:(0,o.hexlify)((0,o.getBytes)(a.decrypt(i)))}}return p}function d(e){const t=(0,c.spelunk)(e,"crypto.kdf:string");if(t&&"string"==typeof t){if("scrypt"===t.toLowerCase()){const r=(0,c.spelunk)(e,"crypto.kdfparams.salt:data!"),n=(0,c.spelunk)(e,"crypto.kdfparams.n:int!"),i=(0,c.spelunk)(e,"crypto.kdfparams.r:int!"),s=(0,c.spelunk)(e,"crypto.kdfparams.p:int!");(0,o.assertArgument)(n>0&&!(n&n-1),"invalid kdf.N","kdf.N",n),(0,o.assertArgument)(i>0&&s>0,"invalid kdf","kdf",t);const a=(0,c.spelunk)(e,"crypto.kdfparams.dklen:int!");return(0,o.assertArgument)(32===a,"invalid kdf.dklen","kdf.dflen",a),{name:"scrypt",salt:r,N:n,r:i,p:s,dkLen:64}}if("pbkdf2"===t.toLowerCase()){const t=(0,c.spelunk)(e,"crypto.kdfparams.salt:data!"),r=(0,c.spelunk)(e,"crypto.kdfparams.prf:string!"),n=r.split("-").pop();(0,o.assertArgument)("sha256"===n||"sha512"===n,"invalid kdf.pdf","kdf.pdf",r);const i=(0,c.spelunk)(e,"crypto.kdfparams.c:int!"),s=(0,c.spelunk)(e,"crypto.kdfparams.dklen:int!");return(0,o.assertArgument)(32===s,"invalid kdf.dklen","kdf.dklen",s),{name:"pbkdf2",salt:t,count:i,dkLen:s,algorithm:n}}}(0,o.assertArgument)(!1,"unsupported key-derivation function","kdf",t)}function f(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function p(e){const t=null!=e.salt?(0,o.getBytes)(e.salt,"options.salt"):(0,s.randomBytes)(32);let r=1<<17,n=8,i=1;return e.scrypt&&(e.scrypt.N&&(r=e.scrypt.N),e.scrypt.r&&(n=e.scrypt.r),e.scrypt.p&&(i=e.scrypt.p)),(0,o.assertArgument)("number"==typeof r&&r>0&&Number.isSafeInteger(r)&&(BigInt(r)&BigInt(r-1))===BigInt(0),"invalid scrypt N parameter","options.N",r),(0,o.assertArgument)("number"==typeof n&&n>0&&Number.isSafeInteger(n),"invalid scrypt r parameter","options.r",n),(0,o.assertArgument)("number"==typeof i&&i>0&&Number.isSafeInteger(i),"invalid scrypt p parameter","options.p",i),{name:"scrypt",dkLen:32,salt:t,N:r,r:n,p:i}}function g(e,t,r,i){const a=(0,o.getBytes)(r.privateKey,"privateKey"),h=null!=i.iv?(0,o.getBytes)(i.iv,"options.iv"):(0,s.randomBytes)(16);(0,o.assertArgument)(16===h.length,"invalid options.iv length","options.iv",i.iv);const d=null!=i.uuid?(0,o.getBytes)(i.uuid,"options.uuid"):(0,s.randomBytes)(16);(0,o.assertArgument)(16===d.length,"invalid options.uuid length","options.uuid",i.iv);const f=e.slice(0,16),p=e.slice(16,32),g=new n.CTR(f,h),y=(0,o.getBytes)(g.encrypt(a)),m=(0,s.keccak256)((0,o.concat)([p,y])),b={address:r.address.substring(2).toLowerCase(),id:(0,o.uuidV4)(d),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,o.hexlify)(h).substring(2)},ciphertext:(0,o.hexlify)(y).substring(2),kdf:"scrypt",kdfparams:{salt:(0,o.hexlify)(t.salt).substring(2),n:t.N,dklen:32,p:t.p,r:t.r},mac:m.substring(2)}};if(r.mnemonic){const t=null!=i.client?i.client:`ethers/${u.version}`,a=r.mnemonic.path||l,h=r.mnemonic.locale||"en",d=e.slice(32,64),f=(0,o.getBytes)(r.mnemonic.entropy,"account.mnemonic.entropy"),p=(0,s.randomBytes)(16),g=new n.CTR(d,p),y=(0,o.getBytes)(g.encrypt(f)),m=new Date,w="UTC--"+(m.getUTCFullYear()+"-"+(0,c.zpad)(m.getUTCMonth()+1,2)+"-"+(0,c.zpad)(m.getUTCDate(),2)+"T"+(0,c.zpad)(m.getUTCHours(),2)+"-"+(0,c.zpad)(m.getUTCMinutes(),2)+"-"+(0,c.zpad)(m.getUTCSeconds(),2)+".0Z")+"--"+b.address;b["x-ethers"]={client:t,gethFilename:w,path:a,locale:h,mnemonicCounter:(0,o.hexlify)(p).substring(2),mnemonicCiphertext:(0,o.hexlify)(y).substring(2),version:"0.1"}}return JSON.stringify(b)}t.isKeystoreJson=function(e){try{const t=JSON.parse(e);if(3===(null!=t.version?parseInt(t.version):0))return!0}catch(e){}return!1},t.decryptKeystoreJsonSync=function(e,t){const r=JSON.parse(e),n=(0,c.getPassword)(t),i=d(r);if("pbkdf2"===i.name){const{salt:e,count:t,dkLen:a,algorithm:o}=i;return h(r,(0,s.pbkdf2)(n,e,t,a,o))}(0,o.assert)("scrypt"===i.name,"cannot be reached","UNKNOWN_ERROR",{params:i});const{salt:a,N:u,r:l,p:f,dkLen:p}=i;return h(r,(0,s.scryptSync)(n,a,u,l,f,p))},t.decryptKeystoreJson=async function(e,t,r){const n=JSON.parse(e),i=(0,c.getPassword)(t),a=d(n);if("pbkdf2"===a.name){r&&(r(0),await f(0));const{salt:e,count:t,dkLen:o,algorithm:c}=a,u=(0,s.pbkdf2)(i,e,t,o,c);return r&&(r(1),await f(0)),h(n,u)}(0,o.assert)("scrypt"===a.name,"cannot be reached","UNKNOWN_ERROR",{params:a});const{salt:u,N:l,r:p,p:g,dkLen:y}=a;return h(n,await(0,s.scrypt)(i,u,l,p,g,y,r))},t.encryptKeystoreJsonSync=function(e,t,r){null==r&&(r={});const n=(0,c.getPassword)(t),i=p(r),a=(0,s.scryptSync)(n,i.salt,i.N,i.r,i.p,64);return g((0,o.getBytes)(a),i,e,r)},t.encryptKeystoreJson=async function(e,t,r){null==r&&(r={});const n=(0,c.getPassword)(t),i=p(r),a=await(0,s.scrypt)(n,i.salt,i.N,i.r,i.p,64,r.progressCallback);return g((0,o.getBytes)(a),i,e,r)}},2353:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__addDisposableResource:()=>U,__assign:()=>s,__asyncDelegator:()=>S,__asyncGenerator:()=>B,__asyncValues:()=>k,__await:()=>C,__awaiter:()=>p,__classPrivateFieldGet:()=>x,__classPrivateFieldIn:()=>R,__classPrivateFieldSet:()=>O,__createBinding:()=>y,__decorate:()=>o,__disposeResources:()=>D,__esDecorate:()=>u,__exportStar:()=>m,__extends:()=>i,__generator:()=>g,__importDefault:()=>N,__importStar:()=>P,__makeTemplateObject:()=>T,__metadata:()=>f,__param:()=>c,__propKey:()=>h,__read:()=>w,__rest:()=>a,__runInitializers:()=>l,__setFunctionName:()=>d,__spread:()=>v,__spreadArray:()=>E,__spreadArrays:()=>A,__values:()=>b,default:()=>F});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var s=function(){return s=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},s.apply(this,arguments)};function a(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function o(e,t,r,n){var i,s=arguments.length,a=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var o=e.length-1;o>=0;o--)(i=e[o])&&(a=(s<3?i(a):s>3?i(t,r,a):i(t,r))||a);return s>3&&a&&Object.defineProperty(t,r,a),a}function c(e,t){return function(r,n){t(r,n,e)}}function u(e,t,r,n,i,s){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var o,c=n.kind,u="getter"===c?"get":"setter"===c?"set":"value",l=!t&&e?n.static?e:e.prototype:null,h=t||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),d=!1,f=r.length-1;f>=0;f--){var p={};for(var g in n)p[g]="access"===g?{}:n[g];for(var g in n.access)p.access[g]=n.access[g];p.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");s.push(a(e||null))};var y=(0,r[f])("accessor"===c?{get:h.get,set:h.set}:h[u],p);if("accessor"===c){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(o=a(y.get))&&(h.get=o),(o=a(y.set))&&(h.set=o),(o=a(y.init))&&i.unshift(o)}else(o=a(y))&&("field"===c?i.unshift(o):h[u]=o)}l&&Object.defineProperty(l,n.name,h),d=!0}function l(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0}function h(e){return"symbol"==typeof e?e:"".concat(e)}function d(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function f(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function p(e,t,r,n){return new(r||(r=Promise))(function(i,s){function a(e){try{c(n.next(e))}catch(e){s(e)}}function o(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,o)}c((n=n.apply(e,t||[])).next())})}function g(e,t){var r,n,i,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=o(0),a.throw=o(1),a.return=o(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(o){return function(c){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,o[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}}var y=Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function m(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||y(t,e,r)}function b(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function w(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return a}function v(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(w(arguments[t]));return e}function A(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var s=arguments[t],a=0,o=s.length;a<o;a++,i++)n[i]=s[a];return n}function E(e,t,r){if(r||2===arguments.length)for(var n,i=0,s=t.length;i<s;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}function C(e){return this instanceof C?(this.v=e,this):new C(e)}function B(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),s=[];return n=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",function(e){return function(t){return Promise.resolve(t).then(e,u)}}),n[Symbol.asyncIterator]=function(){return this},n;function a(e,t){i[e]&&(n[e]=function(t){return new Promise(function(r,n){s.push([e,t,r,n])>1||o(e,t)})},t&&(n[e]=t(n[e])))}function o(e,t){try{(r=i[e](t)).value instanceof C?Promise.resolve(r.value.v).then(c,u):l(s[0][2],r)}catch(e){l(s[0][3],e)}var r}function c(e){o("next",e)}function u(e){o("throw",e)}function l(e,t){e(t),s.shift(),s.length&&o(s[0][0],s[0][1])}}function S(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:C(e[n](t)),done:!1}:i?i(t):t}:i}}function k(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=b(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,i){(function(e,t,r,n){Promise.resolve(n).then(function(t){e({value:t,done:r})},t)})(n,i,(t=e[r](t)).done,t.value)})}}}function T(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var I=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function P(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&y(t,e,r);return I(t,e),t}function N(e){return e&&e.__esModule?e:{default:e}}function x(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function O(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r}function R(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function U(e,t,r){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n,i;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(i=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");i&&(n=function(){try{i.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var L="function"==typeof SuppressedError?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function D(e){function t(t){e.error=e.hasError?new L(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var r,n=0;return function i(){for(;r=e.stack.pop();)try{if(!r.async&&1===n)return n=0,e.stack.push(r),Promise.resolve().then(i);if(r.dispose){var s=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(s).then(i,function(e){return t(e),i()})}else n|=1}catch(e){t(e)}if(1===n)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()}const F={__extends:i,__assign:s,__rest:a,__decorate:o,__param:c,__metadata:f,__awaiter:p,__generator:g,__createBinding:y,__exportStar:m,__values:b,__read:w,__spread:v,__spreadArrays:A,__spreadArray:E,__await:C,__asyncGenerator:B,__asyncDelegator:S,__asyncValues:k,__makeTemplateObject:T,__importStar:P,__importDefault:N,__classPrivateFieldGet:x,__classPrivateFieldSet:O,__classPrivateFieldIn:R,__addDisposableResource:U,__disposeResources:D}},2374:(e,t,r)=>{var n=r(4643);if(r(7835),r(121),r(4467),r(1054),r(339),r(5417),r(8550),void 0===i)var i=n.jsbn.BigInteger;var s=n.util.isNodejs?r(9701):null,a=n.asn1,o=n.util;n.pki=n.pki||{},e.exports=n.pki.rsa=n.rsa=n.rsa||{};var c=n.pki,u=[6,4,2,4,2,4,6,2],l={name:"PrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},h={name:"RSAPrivateKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},d={name:"RSAPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},f=n.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},p={name:"DigestInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:a.Class.UNIVERSAL,type:a.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},g=function(e){var t;if(!(e.algorithm in c.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}t=c.oids[e.algorithm];var n=a.oidToDer(t).getBytes(),i=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[]),s=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[]);s.value.push(a.create(a.Class.UNIVERSAL,a.Type.OID,!1,n)),s.value.push(a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,""));var o=a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(s),i.value.push(o),a.toDer(i).getBytes()},y=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);var s;t.dP||(t.dP=t.d.mod(t.p.subtract(i.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(i.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do{s=new i(n.util.bytesToHex(n.random.getBytes(t.n.bitLength()/8)),16)}while(s.compareTo(t.n)>=0||!s.gcd(t.n).equals(i.ONE));for(var a=(e=e.multiply(s.modPow(t.e,t.n)).mod(t.n)).mod(t.p).modPow(t.dP,t.p),o=e.mod(t.q).modPow(t.dQ,t.q);a.compareTo(o)<0;)a=a.add(t.p);var c=a.subtract(o).multiply(t.qInv).mod(t.p).multiply(t.q).add(o);return c=c.multiply(s.modInverse(t.n)).mod(t.n)};function m(e,t,r){var i=n.util.createBuffer(),s=Math.ceil(t.n.bitLength()/8);if(e.length>s-11){var a=new Error("Message is too long for PKCS#1 v1.5 padding.");throw a.length=e.length,a.max=s-11,a}i.putByte(0),i.putByte(r);var o,c=s-3-e.length;if(0===r||1===r){o=0===r?0:255;for(var u=0;u<c;++u)i.putByte(o)}else for(;c>0;){var l=0,h=n.random.getBytes(c);for(u=0;u<c;++u)0===(o=h.charCodeAt(u))?++l:i.putByte(o);c=l}return i.putByte(0),i.putBytes(e),i}function b(e,t,r,i){var s=Math.ceil(t.n.bitLength()/8),a=n.util.createBuffer(e),o=a.getByte(),c=a.getByte();if(0!==o||r&&0!==c&&1!==c||!r&&2!=c||r&&0===c&&void 0===i)throw new Error("Encryption block is invalid.");var u=0;if(0===c){u=s-3-i;for(var l=0;l<u;++l)if(0!==a.getByte())throw new Error("Encryption block is invalid.")}else if(1===c)for(u=0;a.length()>1;){if(255!==a.getByte()){--a.read;break}++u}else if(2===c)for(u=0;a.length()>1;){if(0===a.getByte()){--a.read;break}++u}if(0!==a.getByte()||u!==s-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}function w(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=n.util.hexToBytes(t);return!(r.length>1)||(0!==r.charCodeAt(0)||128&r.charCodeAt(1))&&(255!==r.charCodeAt(0)||128&~r.charCodeAt(1))?r:r.substr(1)}function v(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function A(e){return n.util.isNodejs&&"function"==typeof s[e]}function E(e){return void 0!==o.globalScope&&"object"==typeof o.globalScope.crypto&&"object"==typeof o.globalScope.crypto.subtle&&"function"==typeof o.globalScope.crypto.subtle[e]}function C(e){return void 0!==o.globalScope&&"object"==typeof o.globalScope.msCrypto&&"object"==typeof o.globalScope.msCrypto.subtle&&"function"==typeof o.globalScope.msCrypto.subtle[e]}function B(e){for(var t=n.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),i=0;i<t.length;++i)r[i]=t.charCodeAt(i);return r}c.rsa.encrypt=function(e,t,r){var s,a=r,o=Math.ceil(t.n.bitLength()/8);!1!==r&&!0!==r?(a=2===r,s=m(e,t,r)):(s=n.util.createBuffer()).putBytes(e);for(var c=new i(s.toHex(),16),u=y(c,t,a).toString(16),l=n.util.createBuffer(),h=o-Math.ceil(u.length/2);h>0;)l.putByte(0),--h;return l.putBytes(n.util.hexToBytes(u)),l.getBytes()},c.rsa.decrypt=function(e,t,r,s){var a=Math.ceil(t.n.bitLength()/8);if(e.length!==a){var o=new Error("Encrypted message length is invalid.");throw o.length=e.length,o.expected=a,o}var c=new i(n.util.createBuffer(e).toHex(),16);if(c.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var u=y(c,t,r).toString(16),l=n.util.createBuffer(),h=a-Math.ceil(u.length/2);h>0;)l.putByte(0),--h;return l.putBytes(n.util.hexToBytes(u)),!1!==s?b(l.getBytes(),t,r):l.getBytes()},c.rsa.createKeyPairGenerationState=function(e,t,r){"string"==typeof e&&(e=parseInt(e,10)),e=e||2048;var s,a=(r=r||{}).prng||n.random,o={nextBytes:function(e){for(var t=a.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}},c=r.algorithm||"PRIMEINC";if("PRIMEINC"!==c)throw new Error("Invalid key generation algorithm: "+c);return(s={algorithm:c,state:0,bits:e,rng:o,eInt:t||65537,e:new i(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(s.eInt),s},c.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new i(null);r.fromInt(30);for(var n,s=0,a=function(e,t){return e|t},o=+new Date,l=0;null===e.keys&&(t<=0||l<t);){if(0===e.state){var h=null===e.p?e.pBits:e.qBits,d=h-1;0===e.pqState?(e.num=new i(h,e.rng),e.num.testBit(d)||e.num.bitwiseTo(i.ONE.shiftLeft(d),a,e.num),e.num.dAddOffset(31-e.num.mod(r).byteValue(),0),s=0,++e.pqState):1===e.pqState?e.num.bitLength()>h?e.pqState=0:e.num.isProbablePrime(v(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(u[s++%8],0):2===e.pqState?e.pqState=0===e.num.subtract(i.ONE).gcd(e.e).compareTo(i.ONE)?3:0:3===e.pqState&&(e.pqState=0,null===e.p?e.p=e.num:e.q=e.num,null!==e.p&&null!==e.q&&++e.state,e.num=null)}else if(1===e.state)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(2===e.state)e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(i.ONE)?++e.state:(e.p=null,e.q=null,e.state=0);else if(4===e.state)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(5===e.state){var f=e.e.modInverse(e.phi);e.keys={privateKey:c.rsa.setPrivateKey(e.n,e.e,f,e.p,e.q,f.mod(e.p1),f.mod(e.q1),e.q.modInverse(e.p)),publicKey:c.rsa.setPublicKey(e.n,e.e)}}l+=(n=+new Date)-o,o=n}return null!==e.keys},c.rsa.generateKeyPair=function(e,t,r,u){if(1===arguments.length?"object"==typeof e?(r=e,e=void 0):"function"==typeof e&&(u=e,e=void 0):2===arguments.length?"number"==typeof e?"function"==typeof t?(u=t,t=void 0):"number"!=typeof t&&(r=t,t=void 0):(r=e,u=t,e=void 0,t=void 0):3===arguments.length&&("number"==typeof t?"function"==typeof r&&(u=r,r=void 0):(u=r,r=t,t=void 0)),r=r||{},void 0===e&&(e=r.bits||2048),void 0===t&&(t=r.e||65537),!n.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(65537===t||3===t))if(u){if(A("generateKeyPair"))return s.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(e,t,r){if(e)return u(e);u(null,{privateKey:c.privateKeyFromPem(r),publicKey:c.publicKeyFromPem(t)})});if(E("generateKey")&&E("exportKey"))return o.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:B(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(e){return o.globalScope.crypto.subtle.exportKey("pkcs8",e.privateKey)}).then(void 0,function(e){u(e)}).then(function(e){if(e){var t=c.privateKeyFromAsn1(a.fromDer(n.util.createBuffer(e)));u(null,{privateKey:t,publicKey:c.setRsaPublicKey(t.n,t.e)})}});if(C("generateKey")&&C("exportKey")){var l=o.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:B(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);return l.oncomplete=function(e){var t=e.target.result,r=o.globalScope.msCrypto.subtle.exportKey("pkcs8",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=c.privateKeyFromAsn1(a.fromDer(n.util.createBuffer(t)));u(null,{privateKey:r,publicKey:c.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){u(e)}},void(l.onerror=function(e){u(e)})}}else if(A("generateKeyPairSync")){var h=s.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:c.privateKeyFromPem(h.privateKey),publicKey:c.publicKeyFromPem(h.publicKey)}}var d=c.rsa.createKeyPairGenerationState(e,t,r);if(!u)return c.rsa.stepKeyPairGenerationState(d,0),d.keys;!function(e,t,r){"function"==typeof t&&(r=t,t={});t=t||{};var s={algorithm:{name:t.algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};"prng"in t&&(s.prng=t.prng);function a(){o(e.pBits,function(t,n){return t?r(t):(e.p=n,null!==e.q?u(t,e.q):void o(e.qBits,u))})}function o(e,t){n.prime.generateProbablePrime(e,s,t)}function u(t,n){if(t)return r(t);if(e.q=n,e.p.compareTo(e.q)<0){var s=e.p;e.p=e.q,e.q=s}if(0!==e.p.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.p=null,void a();if(0!==e.q.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.q=null,void o(e.qBits,u);if(e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),0!==e.phi.gcd(e.e).compareTo(i.ONE))return e.p=e.q=null,void a();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void o(e.qBits,u);var l=e.e.modInverse(e.phi);e.keys={privateKey:c.rsa.setPrivateKey(e.n,e.e,l,e.p,e.q,l.mod(e.p1),l.mod(e.q1),e.q.modInverse(e.p)),publicKey:c.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}a()}(d,r,u)},c.setRsaPublicKey=c.rsa.setPublicKey=function(e,t){var r={n:e,e:t,encrypt:function(e,t,i){if("string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===t)t={encode:function(e,t,r){return m(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return n.pkcs1.encode_rsa_oaep(t,e,i)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(t))t={encode:function(e){return e}};else if("string"==typeof t)throw new Error('Unsupported encryption scheme: "'+t+'".');var s=t.encode(e,r,!0);return c.rsa.encrypt(s,r,!0)},verify:function(e,t,i,s){"string"==typeof i?i=i.toUpperCase():void 0===i&&(i="RSASSA-PKCS1-V1_5"),void 0===s&&(s={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in s||(s._parseAllDigestBytes=!0),"RSASSA-PKCS1-V1_5"===i?i={verify:function(e,t){t=b(t,r,!0);var i=a.fromDer(t,{parseAllBytes:s._parseAllDigestBytes}),o={},c=[];if(!a.validate(i,p,o,c))throw(u=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.")).errors=c,u;var u,l=a.derToOid(o.algorithmIdentifier);if(l!==n.oids.md2&&l!==n.oids.md5&&l!==n.oids.sha1&&l!==n.oids.sha224&&l!==n.oids.sha256&&l!==n.oids.sha384&&l!==n.oids.sha512&&l!==n.oids["sha512-224"]&&l!==n.oids["sha512-256"])throw(u=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.")).oid=l,u;if((l===n.oids.md2||l===n.oids.md5)&&!("parameters"in o))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return e===o.digest}}:"NONE"!==i&&"NULL"!==i&&null!==i||(i={verify:function(e,t){return e===(t=b(t,r,!0))}});var o=c.rsa.decrypt(t,r,!0,!1);return i.verify(e,o,r.n.bitLength())}};return r},c.setRsaPrivateKey=c.rsa.setPrivateKey=function(e,t,r,i,s,a,o,u){var l={n:e,e:t,d:r,p:i,q:s,dP:a,dQ:o,qInv:u,decrypt:function(e,t,r){"string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var i=c.rsa.decrypt(e,l,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:b};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return n.pkcs1.decode_rsa_oaep(t,e,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(t))throw new Error('Unsupported encryption scheme: "'+t+'".');t={decode:function(e){return e}}}return t.decode(i,l,!1)},sign:function(e,t){var r=!1;"string"==typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:g},r=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},r=1);var n=t.encode(e,l.n.bitLength());return c.rsa.encrypt(n,l,r)}};return l},c.wrapRsaPrivateKey=function(e){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(0).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(c.oids.rsaEncryption).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]),a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,a.toDer(e).getBytes())])},c.privateKeyFromAsn1=function(e){var t,r,s,o,u,d,f,p,g={},y=[];if(a.validate(e,l,g,y)&&(e=a.fromDer(n.util.createBuffer(g.privateKey))),g={},y=[],!a.validate(e,h,g,y)){var m=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw m.errors=y,m}return t=n.util.createBuffer(g.privateKeyModulus).toHex(),r=n.util.createBuffer(g.privateKeyPublicExponent).toHex(),s=n.util.createBuffer(g.privateKeyPrivateExponent).toHex(),o=n.util.createBuffer(g.privateKeyPrime1).toHex(),u=n.util.createBuffer(g.privateKeyPrime2).toHex(),d=n.util.createBuffer(g.privateKeyExponent1).toHex(),f=n.util.createBuffer(g.privateKeyExponent2).toHex(),p=n.util.createBuffer(g.privateKeyCoefficient).toHex(),c.setRsaPrivateKey(new i(t,16),new i(r,16),new i(s,16),new i(o,16),new i(u,16),new i(d,16),new i(f,16),new i(p,16))},c.privateKeyToAsn1=c.privateKeyToRSAPrivateKey=function(e){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(0).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(e.n)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(e.e)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(e.d)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(e.p)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(e.q)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(e.dP)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(e.dQ)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(e.qInv))])},c.publicKeyFromAsn1=function(e){var t={},r=[];if(a.validate(e,f,t,r)){var s,o=a.derToOid(t.publicKeyOid);if(o!==c.oids.rsaEncryption)throw(s=new Error("Cannot read public key. Unknown OID.")).oid=o,s;e=t.rsaPublicKey}if(r=[],!a.validate(e,d,t,r))throw(s=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,s;var u=n.util.createBuffer(t.publicKeyModulus).toHex(),l=n.util.createBuffer(t.publicKeyExponent).toHex();return c.setRsaPublicKey(new i(u,16),new i(l,16))},c.publicKeyToAsn1=c.publicKeyToSubjectPublicKeyInfo=function(e){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(c.oids.rsaEncryption).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]),a.create(a.Class.UNIVERSAL,a.Type.BITSTRING,!1,[c.publicKeyToRSAPublicKey(e)])])},c.publicKeyToRSAPublicKey=function(e){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(e.n)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(e.e))])}},2436:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SocketProvider=t.SocketEventSubscriber=t.SocketPendingSubscriber=t.SocketBlockSubscriber=t.SocketSubscriber=void 0;const n=r(3633),i=r(8718),s=r(24);class a{#De;#Fe;get filter(){return JSON.parse(this.#Fe)}#Me;#je;#Ke;constructor(e,t){this.#De=e,this.#Fe=JSON.stringify(t),this.#Me=null,this.#je=null,this.#Ke=null}start(){this.#Me=this.#De.send("eth_subscribe",this.filter).then(e=>(this.#De._register(e,this),e))}stop(){this.#Me.then(e=>{this.#De.destroyed||this.#De.send("eth_unsubscribe",[e])}),this.#Me=null}pause(e){(0,i.assert)(e,"preserve logs while paused not supported by SocketSubscriber yet","UNSUPPORTED_OPERATION",{operation:"pause(false)"}),this.#je=!!e}resume(){this.#je=null}_handleMessage(e){if(null!=this.#Me&&null===this.#je){let t=this.#Ke;t=null==t?this._emit(this.#De,e):t.then(async()=>{await this._emit(this.#De,e)}),this.#Ke=t.then(()=>{this.#Ke===t&&(this.#Ke=null)})}}async _emit(e,t){throw new Error("sub-classes must implemente this; _emit")}}t.SocketSubscriber=a;class o extends a{constructor(e){super(e,["newHeads"])}async _emit(e,t){e.emit("block",parseInt(t.number))}}t.SocketBlockSubscriber=o;class c extends a{constructor(e){super(e,["newPendingTransactions"])}async _emit(e,t){e.emit("pending",t)}}t.SocketPendingSubscriber=c;class u extends a{#Ve;get logFilter(){return JSON.parse(this.#Ve)}constructor(e,t){super(e,["logs",t]),this.#Ve=JSON.stringify(t)}async _emit(e,t){e.emit(this.logFilter,e._wrapLog(t,e._network))}}t.SocketEventSubscriber=u;class l extends s.JsonRpcApiProvider{#He;#_e;#Ge;constructor(e,t){const r=Object.assign({},null!=t?t:{});(0,i.assertArgument)(null==r.batchMaxCount||1===r.batchMaxCount,"sockets-based providers do not support batches","options.batchMaxCount",t),r.batchMaxCount=1,null==r.staticNetwork&&(r.staticNetwork=!0),super(e,r),this.#He=new Map,this.#_e=new Map,this.#Ge=new Map}_getSubscriber(e){switch(e.type){case"close":return new n.UnmanagedSubscriber("close");case"block":return new o(this);case"pending":return new c(this);case"event":return new u(this,e.filter);case"orphan":if("drop-log"===e.filter.orphan)return new n.UnmanagedSubscriber("drop-log")}return super._getSubscriber(e)}_register(e,t){this.#_e.set(e,t);const r=this.#Ge.get(e);if(r){for(const e of r)t._handleMessage(e);this.#Ge.delete(e)}}async _send(e){(0,i.assertArgument)(!Array.isArray(e),"WebSocket does not support batch send","payload",e);const t=new Promise((t,r)=>{this.#He.set(e.id,{payload:e,resolve:t,reject:r})});return await this._waitUntilReady(),await this._write(JSON.stringify(e)),[await t]}async _processMessage(e){const t=JSON.parse(e);if(t&&"object"==typeof t&&"id"in t){const e=this.#He.get(t.id);if(null==e)return void this.emit("error",(0,i.makeError)("received result for unknown id","UNKNOWN_ERROR",{reasonCode:"UNKNOWN_ID",result:t}));this.#He.delete(t.id),e.resolve(t)}else{if(!t||"eth_subscription"!==t.method)return void this.emit("error",(0,i.makeError)("received unexpected message","UNKNOWN_ERROR",{reasonCode:"UNEXPECTED_MESSAGE",result:t}));{const e=t.params.subscription,r=this.#_e.get(e);if(r)r._handleMessage(t.params.result);else{let r=this.#Ge.get(e);null==r&&(r=[],this.#Ge.set(e,r)),r.push(t.params.result)}}}}async _write(e){throw new Error("sub-classes must override this")}}t.SocketProvider=l},2527:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getIndexedAccountPath=t.getAccountPath=t.HDNodeVoidWallet=t.HDNodeWallet=t.defaultPath=void 0;const n=r(6468),i=r(9977),s=r(203),a=r(8718),o=r(3318),c=r(8757),u=r(18),l=r(2325);t.defaultPath="m/44'/60'/0'/0/0";const h=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),d=2147483648,f=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");function p(e,t){let r="";for(;e;)r="0123456789abcdef"[e%16]+r,e=Math.trunc(e/16);for(;r.length<2*t;)r="0"+r;return"0x"+r}function g(e){const t=(0,a.getBytes)(e),r=(0,a.dataSlice)((0,n.sha256)((0,n.sha256)(t)),0,4),i=(0,a.concat)([t,r]);return(0,a.encodeBase58)(i)}const y={};function m(e,t,r,i){const s=new Uint8Array(37);e&d?((0,a.assert)(null!=i,"cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"}),s.set((0,a.getBytes)(i),1)):s.set((0,a.getBytes)(r));for(let t=24;t>=0;t-=8)s[33+(t>>3)]=e>>24-t&255;const o=(0,a.getBytes)((0,n.computeHmac)("sha512",t,s));return{IL:o.slice(0,32),IR:o.slice(32)}}function b(e,t){const r=t.split("/");(0,a.assertArgument)(r.length>0,"invalid path","path",t),"m"===r[0]&&((0,a.assertArgument)(0===e.depth,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${e.depth}`,"path",t),r.shift());let n=e;for(let e=0;e<r.length;e++){const t=r[e];if(t.match(/^[0-9]+'$/)){const r=parseInt(t.substring(0,t.length-1));(0,a.assertArgument)(r<d,"invalid path index",`path[${e}]`,t),n=n.deriveChild(d+r)}else if(t.match(/^[0-9]+$/)){const r=parseInt(t);(0,a.assertArgument)(r<d,"invalid path index",`path[${e}]`,t),n=n.deriveChild(r)}else(0,a.assertArgument)(!1,"invalid path component",`path[${e}]`,t)}return n}class w extends c.BaseWallet{publicKey;fingerprint;parentFingerprint;mnemonic;chainCode;path;index;depth;constructor(e,t,r,i,s,o,c,u,l){super(t,l),(0,a.assertPrivate)(e,y,"HDNodeWallet"),(0,a.defineProperties)(this,{publicKey:t.compressedPublicKey});const h=(0,a.dataSlice)((0,n.ripemd160)((0,n.sha256)(this.publicKey)),0,4);(0,a.defineProperties)(this,{parentFingerprint:r,fingerprint:h,chainCode:i,path:s,index:o,depth:c}),(0,a.defineProperties)(this,{mnemonic:u})}connect(e){return new w(y,this.signingKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.mnemonic,e)}#ze(){const e={address:this.address,privateKey:this.privateKey},t=this.mnemonic;return this.path&&t&&"en"===t.wordlist.locale&&""===t.password&&(e.mnemonic={path:this.path,locale:"en",entropy:t.entropy}),e}async encrypt(e,t){return await(0,l.encryptKeystoreJson)(this.#ze(),e,{progressCallback:t})}encryptSync(e){return(0,l.encryptKeystoreJsonSync)(this.#ze(),e)}get extendedKey(){return(0,a.assert)(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),g((0,a.concat)(["0x0488ADE4",p(this.depth,1),this.parentFingerprint,p(this.index,4),this.chainCode,(0,a.concat)(["0x00",this.privateKey])]))}hasPath(){return null!=this.path}neuter(){return new v(y,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(e){const t=(0,a.getNumber)(e,"index");(0,a.assertArgument)(t<=4294967295,"invalid index","index",t);let r=this.path;r&&(r+="/"+(2147483647&t),t&d&&(r+="'"));const{IR:i,IL:s}=m(t,this.chainCode,this.publicKey,this.privateKey),o=new n.SigningKey((0,a.toBeHex)(((0,a.toBigInt)(s)+BigInt(this.privateKey))%f,32));return new w(y,o,this.fingerprint,(0,a.hexlify)(i),r,t,this.depth+1,this.mnemonic,this.provider)}derivePath(e){return b(this,e)}static#qe(e,t){(0,a.assertArgument)((0,a.isBytesLike)(e),"invalid seed","seed","[REDACTED]");const r=(0,a.getBytes)(e,"seed");(0,a.assertArgument)(r.length>=16&&r.length<=64,"invalid seed","seed","[REDACTED]");const i=(0,a.getBytes)((0,n.computeHmac)("sha512",h,r)),s=new n.SigningKey((0,a.hexlify)(i.slice(0,32)));return new w(y,s,"0x00000000",(0,a.hexlify)(i.slice(32)),"m",0,0,t,null)}static fromExtendedKey(e){const t=(0,a.toBeArray)((0,a.decodeBase58)(e));(0,a.assertArgument)(82===t.length||g(t.slice(0,78))===e,"invalid extended key","extendedKey","[ REDACTED ]");const r=t[4],i=(0,a.hexlify)(t.slice(5,9)),o=parseInt((0,a.hexlify)(t.slice(9,13)).substring(2),16),c=(0,a.hexlify)(t.slice(13,45)),u=t.slice(45,78);switch((0,a.hexlify)(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":{const e=(0,a.hexlify)(u);return new v(y,(0,s.computeAddress)(e),e,i,c,null,o,r,null)}case"0x0488ade4":case"0x04358394 ":if(0!==u[0])break;return new w(y,new n.SigningKey(u.slice(1)),i,c,null,o,r,null,null)}(0,a.assertArgument)(!1,"invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(e,r,i){null==e&&(e=""),null==r&&(r=t.defaultPath),null==i&&(i=o.LangEn.wordlist());const s=u.Mnemonic.fromEntropy((0,n.randomBytes)(16),e,i);return w.#qe(s.computeSeed(),s).derivePath(r)}static fromMnemonic(e,r){return r||(r=t.defaultPath),w.#qe(e.computeSeed(),e).derivePath(r)}static fromPhrase(e,r,n,i){null==r&&(r=""),null==n&&(n=t.defaultPath),null==i&&(i=o.LangEn.wordlist());const s=u.Mnemonic.fromPhrase(e,r,i);return w.#qe(s.computeSeed(),s).derivePath(n)}static fromSeed(e){return w.#qe(e,null)}}t.HDNodeWallet=w;class v extends i.VoidSigner{publicKey;fingerprint;parentFingerprint;chainCode;path;index;depth;constructor(e,t,r,i,s,o,c,u,l){super(t,l),(0,a.assertPrivate)(e,y,"HDNodeVoidWallet"),(0,a.defineProperties)(this,{publicKey:r});const h=(0,a.dataSlice)((0,n.ripemd160)((0,n.sha256)(r)),0,4);(0,a.defineProperties)(this,{publicKey:r,fingerprint:h,parentFingerprint:i,chainCode:s,path:o,index:c,depth:u})}connect(e){return new v(y,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,e)}get extendedKey(){return(0,a.assert)(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),g((0,a.concat)(["0x0488B21E",p(this.depth,1),this.parentFingerprint,p(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return null!=this.path}deriveChild(e){const t=(0,a.getNumber)(e,"index");(0,a.assertArgument)(t<=4294967295,"invalid index","index",t);let r=this.path;r&&(r+="/"+(2147483647&t),t&d&&(r+="'"));const{IR:i,IL:o}=m(t,this.chainCode,this.publicKey,null),c=n.SigningKey.addPoints(o,this.publicKey,!0),u=(0,s.computeAddress)(c);return new v(y,u,c,this.fingerprint,(0,a.hexlify)(i),r,t,this.depth+1,this.provider)}derivePath(e){return b(this,e)}}t.HDNodeVoidWallet=v,t.getAccountPath=function(e){const t=(0,a.getNumber)(e,"index");return(0,a.assertArgument)(t>=0&&t<d,"invalid account index","index",t),`m/44'/60'/${t}'/0/0`},t.getIndexedAccountPath=function(e){const t=(0,a.getNumber)(e,"index");return(0,a.assertArgument)(t>=0&&t<d,"invalid account index","index",t),`m/44'/60'/0'/0/${t}`}},2666:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dnsEncode=t.namehash=t.isValidName=t.ensNormalize=void 0;const n=r(6468),i=r(8718),s=r(5856),a=new Uint8Array(32);function o(e){return(0,i.assertArgument)(0!==e.length,"invalid ENS name; empty component","comp",e),e}function c(e){const t=(0,i.toUtf8Bytes)(u(e)),r=[];if(0===e.length)return r;let n=0;for(let e=0;e<t.length;e++){46===t[e]&&(r.push(o(t.slice(n,e))),n=e+1)}return(0,i.assertArgument)(n<t.length,"invalid ENS name; empty component","name",e),r.push(o(t.slice(n))),r}function u(e){try{if(0===e.length)throw new Error("empty label");return(0,s.ens_normalize)(e)}catch(t){(0,i.assertArgument)(!1,`invalid ENS name (${t.message})`,"name",e)}}a.fill(0),t.ensNormalize=u,t.isValidName=function(e){try{return 0!==c(e).length}catch(e){}return!1},t.namehash=function(e){(0,i.assertArgument)("string"==typeof e,"invalid ENS name; not a string","name",e),(0,i.assertArgument)(e.length,"invalid ENS name (empty label)","name",e);let t=a;const r=c(e);for(;r.length;)t=(0,n.keccak256)((0,i.concat)([t,(0,n.keccak256)(r.pop())]));return(0,i.hexlify)(t)},t.dnsEncode=function(e,t){const r=null!=t?t:63;return(0,i.assertArgument)(r<=255,"DNS encoded label cannot exceed 255","length",r),(0,i.hexlify)((0,i.concat)(c(e).map(t=>{(0,i.assertArgument)(t.length<=r,`label ${JSON.stringify(e)} exceeds ${r} bytes`,"name",e);const n=new Uint8Array(t.length+1);return n.set(t,1),n[0]=n.length-1,n})))+"00"}},2684:(e,t,r)=>{var n=r(4643);function i(e,t){n.cipher.registerAlgorithm(e,function(){return new n.des.Algorithm(e,t)})}r(1457),r(597),r(8550),e.exports=n.des=n.des||{},n.des.startEncrypting=function(e,t,r,n){var i=p({key:e,output:r,decrypt:!1,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createEncryptionCipher=function(e,t){return p({key:e,output:null,decrypt:!1,mode:t})},n.des.startDecrypting=function(e,t,r,n){var i=p({key:e,output:r,decrypt:!0,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createDecryptionCipher=function(e,t){return p({key:e,output:null,decrypt:!0,mode:t})},n.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(e,t){return f(r._keys,e,t,!1)},decrypt:function(e,t){return f(r._keys,e,t,!0)}}}),r._init=!1},n.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=n.util.createBuffer(e.key);if(0===this.name.indexOf("3DES")&&24!==t.length())throw new Error("Invalid Triple-DES key size: "+8*t.length());this._keys=function(e){for(var t,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],i=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],s=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],o=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],c=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],u=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],l=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],h=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],d=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],f=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],p=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],g=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],y=e.length()>8?3:1,m=[],b=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],w=0,v=0;v<y;v++){var A=e.getInt32(),E=e.getInt32();A^=(t=252645135&(A>>>4^E))<<4,A^=t=65535&((E^=t)>>>-16^A),A^=(t=858993459&(A>>>2^(E^=t<<-16)))<<2,A^=t=65535&((E^=t)>>>-16^A),A^=(t=1431655765&(A>>>1^(E^=t<<-16)))<<1,A^=t=16711935&((E^=t)>>>8^A),t=(A^=(t=1431655765&(A>>>1^(E^=t<<8)))<<1)<<8|(E^=t)>>>20&240,A=E<<24|E<<8&16711680|E>>>8&65280|E>>>24&240,E=t;for(var C=0;C<b.length;++C){b[C]?(A=A<<2|A>>>26,E=E<<2|E>>>26):(A=A<<1|A>>>27,E=E<<1|E>>>27),E&=-15;var B=r[(A&=-15)>>>28]|n[A>>>24&15]|i[A>>>20&15]|s[A>>>16&15]|a[A>>>12&15]|o[A>>>8&15]|c[A>>>4&15],S=u[E>>>28]|l[E>>>24&15]|h[E>>>20&15]|d[E>>>16&15]|f[E>>>12&15]|p[E>>>8&15]|g[E>>>4&15];t=65535&(S>>>16^B),m[w++]=B^t,m[w++]=S^t<<16}}return m}(t),this._init=!0}},i("DES-ECB",n.cipher.modes.ecb),i("DES-CBC",n.cipher.modes.cbc),i("DES-CFB",n.cipher.modes.cfb),i("DES-OFB",n.cipher.modes.ofb),i("DES-CTR",n.cipher.modes.ctr),i("3DES-ECB",n.cipher.modes.ecb),i("3DES-CBC",n.cipher.modes.cbc),i("3DES-CFB",n.cipher.modes.cfb),i("3DES-OFB",n.cipher.modes.ofb),i("3DES-CTR",n.cipher.modes.ctr);var s=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],a=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],o=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],c=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],u=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],l=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],h=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],d=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function f(e,t,r,n){var i,f,p=32===e.length?3:9;i=3===p?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var g=t[0],y=t[1];g^=(f=252645135&(g>>>4^y))<<4,g^=(f=65535&(g>>>16^(y^=f)))<<16,g^=f=858993459&((y^=f)>>>2^g),g^=f=16711935&((y^=f<<2)>>>8^g),g=(g^=(f=1431655765&(g>>>1^(y^=f<<8)))<<1)<<1|g>>>31,y=(y^=f)<<1|y>>>31;for(var m=0;m<p;m+=3){for(var b=i[m+1],w=i[m+2],v=i[m];v!=b;v+=w){var A=y^e[v],E=(y>>>4|y<<28)^e[v+1];f=g,g=y,y=f^(a[A>>>24&63]|c[A>>>16&63]|l[A>>>8&63]|d[63&A]|s[E>>>24&63]|o[E>>>16&63]|u[E>>>8&63]|h[63&E])}f=g,g=y,y=f}y=y>>>1|y<<31,y^=f=1431655765&((g=g>>>1|g<<31)>>>1^y),y^=(f=16711935&(y>>>8^(g^=f<<1)))<<8,y^=(f=858993459&(y>>>2^(g^=f)))<<2,y^=f=65535&((g^=f)>>>16^y),y^=f=252645135&((g^=f<<16)>>>4^y),g^=f<<4,r[0]=g,r[1]=y}function p(e){var t,r="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var s=null;r instanceof n.util.ByteBuffer&&(s=r,r={}),(r=r||{}).output=s,r.iv=e,i.call(t,r)},t}},2808:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ripemd160=t.RIPEMD160=void 0;const n=r(5337),i=r(1197),s=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),a=Uint8Array.from({length:16},(e,t)=>t),o=a.map(e=>(9*e+5)%16);let c=[a],u=[o];for(let e=0;e<4;e++)for(let t of[c,u])t.push(t[e].map(e=>s[e]));const l=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>new Uint8Array(e)),h=c.map((e,t)=>e.map(e=>l[t][e])),d=u.map((e,t)=>e.map(e=>l[t][e])),f=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),p=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),g=(e,t)=>e<<t|e>>>32-t;function y(e,t,r,n){return 0===e?t^r^n:1===e?t&r|~t&n:2===e?(t|~r)^n:3===e?t&n|r&~n:t^(r|~n)}const m=new Uint32Array(16);class b extends n.SHA2{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:t,h2:r,h3:n,h4:i}=this;return[e,t,r,n,i]}set(e,t,r,n,i){this.h0=0|e,this.h1=0|t,this.h2=0|r,this.h3=0|n,this.h4=0|i}process(e,t){for(let r=0;r<16;r++,t+=4)m[r]=e.getUint32(t,!0);let r=0|this.h0,n=r,i=0|this.h1,s=i,a=0|this.h2,o=a,l=0|this.h3,b=l,w=0|this.h4,v=w;for(let e=0;e<5;e++){const t=4-e,A=f[e],E=p[e],C=c[e],B=u[e],S=h[e],k=d[e];for(let t=0;t<16;t++){const n=g(r+y(e,i,a,l)+m[C[t]]+A,S[t])+w|0;r=w,w=l,l=0|g(a,10),a=i,i=n}for(let e=0;e<16;e++){const r=g(n+y(t,s,o,b)+m[B[e]]+E,k[e])+v|0;n=v,v=b,b=0|g(o,10),o=s,s=r}}this.set(this.h1+a+b|0,this.h2+l+v|0,this.h3+w+n|0,this.h4+r+s|0,this.h0+i+o|0)}roundClean(){m.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}t.RIPEMD160=b,t.ripemd160=(0,i.wrapConstructor)(()=>new b)},2866:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ECB=void 0;const n=r(1749);class i extends n.ModeOfOperation{constructor(e){super("ECB",e,i)}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const t=new Uint8Array(e.length);for(let r=0;r<e.length;r+=16)t.set(this.aes.encrypt(e.subarray(r,r+16)),r);return t}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");const t=new Uint8Array(e.length);for(let r=0;r<e.length;r+=16)t.set(this.aes.decrypt(e.subarray(r,r+16)),r);return t}}t.ECB=i},2867:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NullCoder=void 0;const n=r(1540),i=new Uint8Array([]);class s extends n.Coder{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes(i)}decode(e){return e.readBytes(0),null}}t.NullCoder=s},2936:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MaxInt256=t.MinInt256=t.MaxUint256=t.WeiPerEther=t.N=void 0,t.N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),t.WeiPerEther=BigInt("1000000000000000000"),t.MaxUint256=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),t.MinInt256=BigInt("0x8000000000000000000000000000000000000000000000000000000000000000")*BigInt(-1),t.MaxInt256=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")},3018:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeOwlA=void 0;const n=r(8718),i=r(9249),s=r(4789);t.decodeOwlA=function(e,t){let r=(0,s.decodeOwl)(e).join(",");return t.split(/,/g).forEach(e=>{const s=e.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);(0,n.assertArgument)(null!==s,"internal error parsing accents","accents",t);let a=0;const o=(0,i.decodeBits)(parseInt(s[3]),s[4]),c=parseInt(s[2]),u=new RegExp(`([${s[1]}])`,"g");r=r.replace(u,(e,t)=>(0===--o[a]&&(t=String.fromCharCode(t.charCodeAt(0),c),a++),t))}),r.split(",")}},3105:(e,t,r)=>{var n=r(4643);r(7835),r(81),r(4412),r(5206),r(1264),r(5417),r(943),r(8550);var i=function(e,t,r,i){var s=n.util.createBuffer(),a=e.length>>1,o=a+(1&e.length),c=e.substr(0,o),u=e.substr(a,o),l=n.util.createBuffer(),h=n.hmac.create();r=t+r;var d=Math.ceil(i/16),f=Math.ceil(i/20);h.start("MD5",c);var p=n.util.createBuffer();l.putBytes(r);for(var g=0;g<d;++g)h.start(null,null),h.update(l.getBytes()),l.putBuffer(h.digest()),h.start(null,null),h.update(l.bytes()+r),p.putBuffer(h.digest());h.start("SHA1",u);var y=n.util.createBuffer();l.clear(),l.putBytes(r);for(g=0;g<f;++g)h.start(null,null),h.update(l.getBytes()),l.putBuffer(h.digest()),h.start(null,null),h.update(l.bytes()+r),y.putBuffer(h.digest());return s.putBytes(n.util.xorBytes(p.getBytes(),y.getBytes(),i)),s},s=function(e,t,r){var i=!1;try{var s=e.deflate(t.fragment.getBytes());t.fragment=n.util.createBuffer(s),t.length=s.length,i=!0}catch(e){}return i},a=function(e,t,r){var i=!1;try{var s=e.inflate(t.fragment.getBytes());t.fragment=n.util.createBuffer(s),t.length=s.length,i=!0}catch(e){}return i},o=function(e,t){var r=0;switch(t){case 1:r=e.getByte();break;case 2:r=e.getInt16();break;case 3:r=e.getInt24();break;case 4:r=e.getInt32()}return n.util.createBuffer(e.getBytes(r))},c=function(e,t,r){e.putInt(r.length(),t<<3),e.putBuffer(r)},u={Versions:{TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,minor:2},TLS_1_2:{major:3,minor:3}}};u.SupportedVersions=[u.Versions.TLS_1_1,u.Versions.TLS_1_0],u.Version=u.SupportedVersions[0],u.MaxFragment=15360,u.ConnectionEnd={server:0,client:1},u.PRFAlgorithm={tls_prf_sha256:0},u.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2},u.CipherType={stream:0,block:1,aead:2},u.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4},u.CompressionMethod={none:0,deflate:1},u.ContentType={change_cipher_spec:20,alert:21,handshake:22,application_data:23,heartbeat:24},u.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20},u.Alert={},u.Alert.Level={warning:1,fatal:2},u.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100},u.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2},u.CipherSuites={},u.getCipherSuite=function(e){var t=null;for(var r in u.CipherSuites){var n=u.CipherSuites[r];if(n.id[0]===e.charCodeAt(0)&&n.id[1]===e.charCodeAt(1)){t=n;break}}return t},u.handleUnexpected=function(e,t){!e.open&&e.entity===u.ConnectionEnd.client||e.error(e,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unexpected_message}})},u.handleHelloRequest=function(e,t,r){!e.handshaking&&e.handshakes>0&&(u.queue(e,u.createAlert(e,{level:u.Alert.Level.warning,description:u.Alert.Description.no_renegotiation})),u.flush(e)),e.process()},u.parseHelloMessage=function(e,t,r){var i=null,s=e.entity===u.ConnectionEnd.client;if(r<38)e.error(e,{message:s?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});else{var a=t.fragment,c=a.length();if(i={version:{major:a.getByte(),minor:a.getByte()},random:n.util.createBuffer(a.getBytes(32)),session_id:o(a,1),extensions:[]},s?(i.cipher_suite=a.getBytes(2),i.compression_method=a.getByte()):(i.cipher_suites=o(a,2),i.compression_methods=o(a,1)),(c=r-(c-a.length()))>0){for(var l=o(a,2);l.length()>0;)i.extensions.push({type:[l.getByte(),l.getByte()],data:o(l,2)});if(!s)for(var h=0;h<i.extensions.length;++h){var d=i.extensions[h];if(0===d.type[0]&&0===d.type[1])for(var f=o(d.data,2);f.length()>0;){if(0!==f.getByte())break;e.session.extensions.server_name.serverNameList.push(o(f,2).getBytes())}}}if(e.session.version&&(i.version.major!==e.session.version.major||i.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}});if(s)e.session.cipherSuite=u.getCipherSuite(i.cipher_suite);else for(var p=n.util.createBuffer(i.cipher_suites.bytes());p.length()>0&&(e.session.cipherSuite=u.getCipherSuite(p.getBytes(2)),null===e.session.cipherSuite););if(null===e.session.cipherSuite)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.handshake_failure},cipherSuite:n.util.bytesToHex(i.cipher_suite)});e.session.compressionMethod=s?i.compression_method:u.CompressionMethod.none}return i},u.createSecurityParameters=function(e,t){var r=e.entity===u.ConnectionEnd.client,n=t.random.bytes(),i=r?e.session.sp.client_random:n,s=r?n:u.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:u.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:i,server_random:s}},u.handleServerHello=function(e,t,r){var n=u.parseHelloMessage(e,t,r);if(!e.fail){if(!(n.version.minor<=e.version.minor))return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}});e.version.minor=n.version.minor,e.session.version=e.version;var i=n.session_id.bytes();i.length>0&&i===e.session.id?(e.expect=p,e.session.resuming=!0,e.session.sp.server_random=n.random.bytes()):(e.expect=l,e.session.resuming=!1,u.createSecurityParameters(e,n)),e.session.id=i,e.process()}},u.handleClientHello=function(e,t,r){var i=u.parseHelloMessage(e,t,r);if(!e.fail){var s=i.session_id.bytes(),a=null;if(e.sessionCache&&(null===(a=e.sessionCache.getSession(s))?s="":(a.version.major!==i.version.major||a.version.minor>i.version.minor)&&(a=null,s="")),0===s.length&&(s=n.random.getBytes(32)),e.session.id=s,e.session.clientHelloVersion=i.version,e.session.sp={},a)e.version=e.session.version=a.version,e.session.sp=a.sp;else{for(var o,c=1;c<u.SupportedVersions.length&&!((o=u.SupportedVersions[c]).minor<=i.version.minor);++c);e.version={major:o.major,minor:o.minor},e.session.version=e.version}null!==a?(e.expect=A,e.session.resuming=!0,e.session.sp.client_random=i.random.bytes()):(e.expect=!1!==e.verifyClient?b:w,e.session.resuming=!1,u.createSecurityParameters(e,i)),e.open=!0,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createServerHello(e)})),e.session.resuming?(u.queue(e,u.createRecord(e,{type:u.ContentType.change_cipher_spec,data:u.createChangeCipherSpec()})),e.state.pending=u.createConnectionState(e),e.state.current.write=e.state.pending.write,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createFinished(e)}))):(u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificate(e)})),e.fail||(u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createServerKeyExchange(e)})),!1!==e.verifyClient&&u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificateRequest(e)})),u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createServerHelloDone(e)})))),u.flush(e),e.process()}},u.handleCertificate=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var i,s,a=t.fragment,c={certificate_list:o(a,3)},l=[];try{for(;c.certificate_list.length()>0;)i=o(c.certificate_list,3),s=n.asn1.fromDer(i),i=n.pki.certificateFromAsn1(s,!0),l.push(i)}catch(t){return e.error(e,{message:"Could not parse certificate list.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.bad_certificate}})}var d=e.entity===u.ConnectionEnd.client;!d&&!0!==e.verifyClient||0!==l.length?0===l.length?e.expect=d?h:w:(d?e.session.serverCertificate=l[0]:e.session.clientCertificate=l[0],u.verifyCertificateChain(e,l)&&(e.expect=d?h:w)):e.error(e,{message:d?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}}),e.process()},u.handleServerKeyExchange=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unsupported_certificate}});e.expect=d,e.process()},u.handleClientKeyExchange=function(e,t,r){if(r<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unsupported_certificate}});var i=t.fragment,s={enc_pre_master_secret:o(i,2).getBytes()},a=null;if(e.getPrivateKey)try{a=e.getPrivateKey(e,e.session.serverCertificate),a=n.pki.privateKeyFromPem(a)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}})}if(null===a)return e.error(e,{message:"No private key set.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}});try{var c=e.session.sp;c.pre_master_secret=a.decrypt(s.enc_pre_master_secret);var l=e.session.clientHelloVersion;if(l.major!==c.pre_master_secret.charCodeAt(0)||l.minor!==c.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch(e){c.pre_master_secret=n.random.getBytes(48)}e.expect=A,null!==e.session.clientCertificate&&(e.expect=v),e.process()},u.handleCertificateRequest=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var n=t.fragment,i={certificate_types:o(n,1),certificate_authorities:o(n,2)};e.session.certificateRequest=i,e.expect=f,e.process()},u.handleCertificateVerify=function(e,t,r){if(r<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var i=t.fragment;i.read-=4;var s=i.bytes();i.read+=4;var a={signature:o(i,2).getBytes()},c=n.util.createBuffer();c.putBuffer(e.session.md5.digest()),c.putBuffer(e.session.sha1.digest()),c=c.getBytes();try{if(!e.session.clientCertificate.publicKey.verify(c,a.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(s),e.session.sha1.update(s)}catch(t){return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.handshake_failure}})}e.expect=A,e.process()},u.handleServerHelloDone=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.record_overflow}});if(null===e.serverCertificate){var i={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.insufficient_security}},s=e.verify(e,i.alert.description,0,[]);if(!0!==s)return(s||0===s)&&("object"!=typeof s||n.util.isArray(s)?"number"==typeof s&&(i.alert.description=s):(s.message&&(i.message=s.message),s.alert&&(i.alert.description=s.alert))),e.error(e,i)}null!==e.session.certificateRequest&&(t=u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificate(e)}),u.queue(e,t)),t=u.createRecord(e,{type:u.ContentType.handshake,data:u.createClientKeyExchange(e)}),u.queue(e,t),e.expect=m;var a=function(e,t){null!==e.session.certificateRequest&&null!==e.session.clientCertificate&&u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createCertificateVerify(e,t)})),u.queue(e,u.createRecord(e,{type:u.ContentType.change_cipher_spec,data:u.createChangeCipherSpec()})),e.state.pending=u.createConnectionState(e),e.state.current.write=e.state.pending.write,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createFinished(e)})),e.expect=p,u.flush(e),e.process()};if(null===e.session.certificateRequest||null===e.session.clientCertificate)return a(e,null);u.getClientSignature(e,a)},u.handleChangeCipherSpec=function(e,t){if(1!==t.fragment.getByte())return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.illegal_parameter}});var r=e.entity===u.ConnectionEnd.client;(e.session.resuming&&r||!e.session.resuming&&!r)&&(e.state.pending=u.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&r||e.session.resuming&&!r)&&(e.state.pending=null),e.expect=r?g:E,e.process()},u.handleFinished=function(e,t,r){var s=t.fragment;s.read-=4;var a=s.bytes();s.read+=4;var o=t.fragment.getBytes();(s=n.util.createBuffer()).putBuffer(e.session.md5.digest()),s.putBuffer(e.session.sha1.digest());var c=e.entity===u.ConnectionEnd.client,l=c?"server finished":"client finished",h=e.session.sp;if((s=i(h.master_secret,l,s.getBytes(),12)).getBytes()!==o)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.decrypt_error}});e.session.md5.update(a),e.session.sha1.update(a),(e.session.resuming&&c||!e.session.resuming&&!c)&&(u.queue(e,u.createRecord(e,{type:u.ContentType.change_cipher_spec,data:u.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,u.queue(e,u.createRecord(e,{type:u.ContentType.handshake,data:u.createFinished(e)}))),e.expect=c?y:C,e.handshaking=!1,++e.handshakes,e.peerCertificate=c?e.session.serverCertificate:e.session.clientCertificate,u.flush(e),e.isConnected=!0,e.connected(e),e.process()},u.handleAlert=function(e,t){var r,n=t.fragment,i={level:n.getByte(),description:n.getByte()};switch(i.description){case u.Alert.Description.close_notify:r="Connection closed.";break;case u.Alert.Description.unexpected_message:r="Unexpected message.";break;case u.Alert.Description.bad_record_mac:r="Bad record MAC.";break;case u.Alert.Description.decryption_failed:r="Decryption failed.";break;case u.Alert.Description.record_overflow:r="Record overflow.";break;case u.Alert.Description.decompression_failure:r="Decompression failed.";break;case u.Alert.Description.handshake_failure:r="Handshake failure.";break;case u.Alert.Description.bad_certificate:r="Bad certificate.";break;case u.Alert.Description.unsupported_certificate:r="Unsupported certificate.";break;case u.Alert.Description.certificate_revoked:r="Certificate revoked.";break;case u.Alert.Description.certificate_expired:r="Certificate expired.";break;case u.Alert.Description.certificate_unknown:r="Certificate unknown.";break;case u.Alert.Description.illegal_parameter:r="Illegal parameter.";break;case u.Alert.Description.unknown_ca:r="Unknown certificate authority.";break;case u.Alert.Description.access_denied:r="Access denied.";break;case u.Alert.Description.decode_error:r="Decode error.";break;case u.Alert.Description.decrypt_error:r="Decrypt error.";break;case u.Alert.Description.export_restriction:r="Export restriction.";break;case u.Alert.Description.protocol_version:r="Unsupported protocol version.";break;case u.Alert.Description.insufficient_security:r="Insufficient security.";break;case u.Alert.Description.internal_error:r="Internal error.";break;case u.Alert.Description.user_canceled:r="User canceled.";break;case u.Alert.Description.no_renegotiation:r="Renegotiation not supported.";break;default:r="Unknown error."}if(i.description===u.Alert.Description.close_notify)return e.close();e.error(e,{message:r,send:!1,origin:e.entity===u.ConnectionEnd.client?"server":"client",alert:i}),e.process()},u.handleHandshake=function(e,t){var r=t.fragment,i=r.getByte(),s=r.getInt24();if(s>r.length())return e.fragmented=t,t.fragment=n.util.createBuffer(),r.read-=4,e.process();e.fragmented=null,r.read-=4;var a=r.bytes(s+4);r.read+=4,i in M[e.entity][e.expect]?(e.entity!==u.ConnectionEnd.server||e.open||e.fail||(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:n.md.md5.create(),sha1:n.md.sha1.create()}),i!==u.HandshakeType.hello_request&&i!==u.HandshakeType.certificate_verify&&i!==u.HandshakeType.finished&&(e.session.md5.update(a),e.session.sha1.update(a)),M[e.entity][e.expect][i](e,t,s)):u.handleUnexpected(e,t)},u.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()},u.handleHeartbeat=function(e,t){var r=t.fragment,i=r.getByte(),s=r.getInt16(),a=r.getBytes(s);if(i===u.HeartbeatMessageType.heartbeat_request){if(e.handshaking||s>a.length)return e.process();u.queue(e,u.createRecord(e,{type:u.ContentType.heartbeat,data:u.createHeartbeat(u.HeartbeatMessageType.heartbeat_response,a)})),u.flush(e)}else if(i===u.HeartbeatMessageType.heartbeat_response){if(a!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,n.util.createBuffer(a))}e.process()};var l=1,h=2,d=3,f=4,p=5,g=6,y=7,m=8,b=1,w=2,v=3,A=4,E=5,C=6,B=u.handleUnexpected,S=u.handleChangeCipherSpec,k=u.handleAlert,T=u.handleHandshake,I=u.handleApplicationData,P=u.handleHeartbeat,N=[];N[u.ConnectionEnd.client]=[[B,k,T,B,P],[B,k,T,B,P],[B,k,T,B,P],[B,k,T,B,P],[B,k,T,B,P],[S,k,B,B,P],[B,k,T,B,P],[B,k,T,I,P],[B,k,T,B,P]],N[u.ConnectionEnd.server]=[[B,k,T,B,P],[B,k,T,B,P],[B,k,T,B,P],[B,k,T,B,P],[S,k,B,B,P],[B,k,T,B,P],[B,k,T,I,P],[B,k,T,B,P]];var x=u.handleHelloRequest,O=u.handleServerHello,R=u.handleCertificate,U=u.handleServerKeyExchange,L=u.handleCertificateRequest,D=u.handleServerHelloDone,F=u.handleFinished,M=[];M[u.ConnectionEnd.client]=[[B,B,O,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B],[x,B,B,B,B,B,B,B,B,B,B,R,U,L,D,B,B,B,B,B,B],[x,B,B,B,B,B,B,B,B,B,B,B,U,L,D,B,B,B,B,B,B],[x,B,B,B,B,B,B,B,B,B,B,B,B,L,D,B,B,B,B,B,B],[x,B,B,B,B,B,B,B,B,B,B,B,B,B,D,B,B,B,B,B,B],[x,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B],[x,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,F],[x,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B],[x,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B]];var j=u.handleClientHello,K=u.handleClientKeyExchange,V=u.handleCertificateVerify;M[u.ConnectionEnd.server]=[[B,j,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B],[B,B,B,B,B,B,B,B,B,B,B,R,B,B,B,B,B,B,B,B,B],[B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,K,B,B,B,B],[B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,V,B,B,B,B,B],[B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B],[B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,F],[B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B],[B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B,B]],u.generateKeys=function(e,t){var r=i,n=t.client_random+t.server_random;e.session.resuming||(t.master_secret=r(t.pre_master_secret,"master secret",n,48).bytes(),t.pre_master_secret=null),n=t.server_random+t.client_random;var s=2*t.mac_key_length+2*t.enc_key_length,a=e.version.major===u.Versions.TLS_1_0.major&&e.version.minor===u.Versions.TLS_1_0.minor;a&&(s+=2*t.fixed_iv_length);var o=r(t.master_secret,"key expansion",n,s),c={client_write_MAC_key:o.getBytes(t.mac_key_length),server_write_MAC_key:o.getBytes(t.mac_key_length),client_write_key:o.getBytes(t.enc_key_length),server_write_key:o.getBytes(t.enc_key_length)};return a&&(c.client_write_IV=o.getBytes(t.fixed_iv_length),c.server_write_IV=o.getBytes(t.fixed_iv_length)),c},u.createConnectionState=function(e){var t=e.entity===u.ConnectionEnd.client,r=function(){var e={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(e){return!0},compressionState:null,compressFunction:function(e){return!0},updateSequenceNumber:function(){4294967295===e.sequenceNumber[1]?(e.sequenceNumber[1]=0,++e.sequenceNumber[0]):++e.sequenceNumber[1]}};return e},n={read:r(),write:r()};if(n.read.update=function(e,t){return n.read.cipherFunction(t,n.read)?n.read.compressFunction(e,t,n.read)||e.error(e,{message:"Could not decompress record.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.decompression_failure}}):e.error(e,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.bad_record_mac}}),!e.fail},n.write.update=function(e,t){return n.write.compressFunction(e,t,n.write)?n.write.cipherFunction(t,n.write)||e.error(e,{message:"Could not encrypt record.",send:!1,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}}):e.error(e,{message:"Could not compress record.",send:!1,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}}),!e.fail},e.session){var i=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(i),i.keys=u.generateKeys(e,i),n.read.macKey=t?i.keys.server_write_MAC_key:i.keys.client_write_MAC_key,n.write.macKey=t?i.keys.client_write_MAC_key:i.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(n,e,i),i.compression_algorithm){case u.CompressionMethod.none:break;case u.CompressionMethod.deflate:n.read.compressFunction=a,n.write.compressFunction=s;break;default:throw new Error("Unsupported compression algorithm.")}}return n},u.createRandom=function(){var e=new Date,t=+e+6e4*e.getTimezoneOffset(),r=n.util.createBuffer();return r.putInt32(t),r.putBytes(n.random.getBytes(28)),r},u.createRecord=function(e,t){return t.data?{type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data}:null},u.createAlert=function(e,t){var r=n.util.createBuffer();return r.putByte(t.level),r.putByte(t.description),u.createRecord(e,{type:u.ContentType.alert,data:r})},u.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=n.util.createBuffer(),r=0;r<e.cipherSuites.length;++r){var i=e.cipherSuites[r];t.putByte(i.id[0]),t.putByte(i.id[1])}var s=t.length(),a=n.util.createBuffer();a.putByte(u.CompressionMethod.none);var o=a.length(),l=n.util.createBuffer();if(e.virtualHost){var h=n.util.createBuffer();h.putByte(0),h.putByte(0);var d=n.util.createBuffer();d.putByte(0),c(d,2,n.util.createBuffer(e.virtualHost));var f=n.util.createBuffer();c(f,2,d),c(h,2,f),l.putBuffer(h)}var p=l.length();p>0&&(p+=2);var g=e.session.id,y=g.length+1+2+4+28+2+s+1+o+p,m=n.util.createBuffer();return m.putByte(u.HandshakeType.client_hello),m.putInt24(y),m.putByte(e.version.major),m.putByte(e.version.minor),m.putBytes(e.session.sp.client_random),c(m,1,n.util.createBuffer(g)),c(m,2,t),c(m,1,a),p>0&&c(m,2,l),m},u.createServerHello=function(e){var t=e.session.id,r=t.length+1+2+4+28+2+1,i=n.util.createBuffer();return i.putByte(u.HandshakeType.server_hello),i.putInt24(r),i.putByte(e.version.major),i.putByte(e.version.minor),i.putBytes(e.session.sp.server_random),c(i,1,n.util.createBuffer(t)),i.putByte(e.session.cipherSuite.id[0]),i.putByte(e.session.cipherSuite.id[1]),i.putByte(e.session.compressionMethod),i},u.createCertificate=function(e){var t,r=e.entity===u.ConnectionEnd.client,i=null;e.getCertificate&&(t=r?e.session.certificateRequest:e.session.extensions.server_name.serverNameList,i=e.getCertificate(e,t));var s=n.util.createBuffer();if(null!==i)try{n.util.isArray(i)||(i=[i]);for(var a=null,o=0;o<i.length;++o){var l=n.pem.decode(i[o])[0];if("CERTIFICATE"!==l.type&&"X509 CERTIFICATE"!==l.type&&"TRUSTED CERTIFICATE"!==l.type){var h=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw h.headerType=l.type,h}if(l.procType&&"ENCRYPTED"===l.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var d=n.util.createBuffer(l.body);null===a&&(a=n.asn1.fromDer(d.bytes(),!1));var f=n.util.createBuffer();c(f,3,d),s.putBuffer(f)}i=n.pki.certificateFromAsn1(a),r?e.session.clientCertificate=i:e.session.serverCertificate=i}catch(t){return e.error(e,{message:"Could not send certificate list.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.bad_certificate}})}var p=3+s.length(),g=n.util.createBuffer();return g.putByte(u.HandshakeType.certificate),g.putInt24(p),c(g,3,s),g},u.createClientKeyExchange=function(e){var t=n.util.createBuffer();t.putByte(e.session.clientHelloVersion.major),t.putByte(e.session.clientHelloVersion.minor),t.putBytes(n.random.getBytes(46));var r=e.session.sp;r.pre_master_secret=t.getBytes();var i=(t=e.session.serverCertificate.publicKey.encrypt(r.pre_master_secret)).length+2,s=n.util.createBuffer();return s.putByte(u.HandshakeType.client_key_exchange),s.putInt24(i),s.putInt16(t.length),s.putBytes(t),s},u.createServerKeyExchange=function(e){var t=n.util.createBuffer();return t},u.getClientSignature=function(e,t){var r=n.util.createBuffer();r.putBuffer(e.session.md5.digest()),r.putBuffer(e.session.sha1.digest()),r=r.getBytes(),e.getSignature=e.getSignature||function(e,t,r){var i=null;if(e.getPrivateKey)try{i=e.getPrivateKey(e,e.session.clientCertificate),i=n.pki.privateKeyFromPem(i)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}})}null===i?e.error(e,{message:"No private key set.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.internal_error}}):t=i.sign(t,null),r(e,t)},e.getSignature(e,r,t)},u.createCertificateVerify=function(e,t){var r=t.length+2,i=n.util.createBuffer();return i.putByte(u.HandshakeType.certificate_verify),i.putInt24(r),i.putInt16(t.length),i.putBytes(t),i},u.createCertificateRequest=function(e){var t=n.util.createBuffer();t.putByte(1);var r=n.util.createBuffer();for(var i in e.caStore.certs){var s=e.caStore.certs[i],a=n.pki.distinguishedNameToAsn1(s.subject),o=n.asn1.toDer(a);r.putInt16(o.length()),r.putBuffer(o)}var l=1+t.length()+2+r.length(),h=n.util.createBuffer();return h.putByte(u.HandshakeType.certificate_request),h.putInt24(l),c(h,1,t),c(h,2,r),h},u.createServerHelloDone=function(e){var t=n.util.createBuffer();return t.putByte(u.HandshakeType.server_hello_done),t.putInt24(0),t},u.createChangeCipherSpec=function(){var e=n.util.createBuffer();return e.putByte(1),e},u.createFinished=function(e){var t=n.util.createBuffer();t.putBuffer(e.session.md5.digest()),t.putBuffer(e.session.sha1.digest());var r=e.entity===u.ConnectionEnd.client,s=e.session.sp,a=r?"client finished":"server finished";t=i(s.master_secret,a,t.getBytes(),12);var o=n.util.createBuffer();return o.putByte(u.HandshakeType.finished),o.putInt24(t.length()),o.putBuffer(t),o},u.createHeartbeat=function(e,t,r){void 0===r&&(r=t.length);var i=n.util.createBuffer();i.putByte(e),i.putInt16(r),i.putBytes(t);var s=i.length(),a=Math.max(16,s-r-3);return i.putBytes(n.random.getBytes(a)),i},u.queue=function(e,t){if(t&&(0!==t.fragment.length()||t.type!==u.ContentType.handshake&&t.type!==u.ContentType.alert&&t.type!==u.ContentType.change_cipher_spec)){if(t.type===u.ContentType.handshake){var r=t.fragment.bytes();e.session.md5.update(r),e.session.sha1.update(r),r=null}var i;if(t.fragment.length()<=u.MaxFragment)i=[t];else{i=[];for(var s=t.fragment.bytes();s.length>u.MaxFragment;)i.push(u.createRecord(e,{type:t.type,data:n.util.createBuffer(s.slice(0,u.MaxFragment))})),s=s.slice(u.MaxFragment);s.length>0&&i.push(u.createRecord(e,{type:t.type,data:n.util.createBuffer(s)}))}for(var a=0;a<i.length&&!e.fail;++a){var o=i[a];e.state.current.write.update(e,o)&&e.records.push(o)}}},u.flush=function(e){for(var t=0;t<e.records.length;++t){var r=e.records[t];e.tlsData.putByte(r.type),e.tlsData.putByte(r.version.major),e.tlsData.putByte(r.version.minor),e.tlsData.putInt16(r.fragment.length()),e.tlsData.putBuffer(e.records[t].fragment)}return e.records=[],e.tlsDataReady(e)};var H=function(e){switch(e){case!0:return!0;case n.pki.certificateError.bad_certificate:return u.Alert.Description.bad_certificate;case n.pki.certificateError.unsupported_certificate:return u.Alert.Description.unsupported_certificate;case n.pki.certificateError.certificate_revoked:return u.Alert.Description.certificate_revoked;case n.pki.certificateError.certificate_expired:return u.Alert.Description.certificate_expired;case n.pki.certificateError.certificate_unknown:return u.Alert.Description.certificate_unknown;case n.pki.certificateError.unknown_ca:return u.Alert.Description.unknown_ca;default:return u.Alert.Description.bad_certificate}};for(var _ in u.verifyCertificateChain=function(e,t){try{var r={};for(var i in e.verifyOptions)r[i]=e.verifyOptions[i];r.verify=function(t,r,i){H(t);var s=e.verify(e,t,r,i);if(!0!==s){if("object"==typeof s&&!n.util.isArray(s)){var a=new Error("The application rejected the certificate.");throw a.send=!0,a.alert={level:u.Alert.Level.fatal,description:u.Alert.Description.bad_certificate},s.message&&(a.message=s.message),s.alert&&(a.alert.description=s.alert),a}s!==t&&(s=function(e){switch(e){case!0:return!0;case u.Alert.Description.bad_certificate:return n.pki.certificateError.bad_certificate;case u.Alert.Description.unsupported_certificate:return n.pki.certificateError.unsupported_certificate;case u.Alert.Description.certificate_revoked:return n.pki.certificateError.certificate_revoked;case u.Alert.Description.certificate_expired:return n.pki.certificateError.certificate_expired;case u.Alert.Description.certificate_unknown:return n.pki.certificateError.certificate_unknown;case u.Alert.Description.unknown_ca:return n.pki.certificateError.unknown_ca;default:return n.pki.certificateError.bad_certificate}}(s))}return s},n.pki.verifyCertificateChain(e.caStore,t,r)}catch(t){var s=t;("object"!=typeof s||n.util.isArray(s))&&(s={send:!0,alert:{level:u.Alert.Level.fatal,description:H(t)}}),"send"in s||(s.send=!0),"alert"in s||(s.alert={level:u.Alert.Level.fatal,description:H(s.error)}),e.error(e,s)}return!e.fail},u.createSessionCache=function(e,t){var r=null;if(e&&e.getSession&&e.setSession&&e.order)r=e;else{for(var i in(r={}).cache=e||{},r.capacity=Math.max(t||100,1),r.order=[],e)r.order.length<=t?r.order.push(i):delete e[i];r.getSession=function(e){var t=null,i=null;if(e?i=n.util.bytesToHex(e):r.order.length>0&&(i=r.order[0]),null!==i&&i in r.cache)for(var s in t=r.cache[i],delete r.cache[i],r.order)if(r.order[s]===i){r.order.splice(s,1);break}return t},r.setSession=function(e,t){if(r.order.length===r.capacity){var i=r.order.shift();delete r.cache[i]}i=n.util.bytesToHex(e);r.order.push(i),r.cache[i]=t}}return r},u.createConnection=function(e){var t=null;t=e.caStore?n.util.isArray(e.caStore)?n.pki.createCaStore(e.caStore):e.caStore:n.pki.createCaStore();var r=e.cipherSuites||null;if(null===r)for(var i in r=[],u.CipherSuites)r.push(u.CipherSuites[i]);var s=e.server?u.ConnectionEnd.server:u.ConnectionEnd.client,a=e.sessionCache?u.createSessionCache(e.sessionCache):null,o={version:{major:u.Version.major,minor:u.Version.minor},entity:s,sessionId:e.sessionId,caStore:t,sessionCache:a,cipherSuites:r,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(e,t,r,n){return t},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:n.util.createBuffer(),tlsData:n.util.createBuffer(),data:n.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(t,r){r.origin=r.origin||(t.entity===u.ConnectionEnd.client?"client":"server"),r.send&&(u.queue(t,u.createAlert(t,r.alert)),u.flush(t));var n=!1!==r.fatal;n&&(t.fail=!0),e.error(t,r),n&&t.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null,reset:function(e){o.version={major:u.Version.major,minor:u.Version.minor},o.record=null,o.session=null,o.peerCertificate=null,o.state={pending:null,current:null},o.expect=(o.entity,u.ConnectionEnd.client,0),o.fragmented=null,o.records=[],o.open=!1,o.handshakes=0,o.handshaking=!1,o.isConnected=!1,o.fail=!(e||void 0===e),o.input.clear(),o.tlsData.clear(),o.data.clear(),o.state.current=u.createConnectionState(o)}};o.reset();return o.handshake=function(e){if(o.entity!==u.ConnectionEnd.client)o.error(o,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(o.handshaking)o.error(o,{message:"Handshake already in progress.",fatal:!1});else{o.fail&&!o.open&&0===o.handshakes&&(o.fail=!1),o.handshaking=!0;var t=null;(e=e||"").length>0&&(o.sessionCache&&(t=o.sessionCache.getSession(e)),null===t&&(e="")),0===e.length&&o.sessionCache&&null!==(t=o.sessionCache.getSession())&&(e=t.id),o.session={id:e,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:n.md.md5.create(),sha1:n.md.sha1.create()},t&&(o.version=t.version,o.session.sp=t.sp),o.session.sp.client_random=u.createRandom().getBytes(),o.open=!0,u.queue(o,u.createRecord(o,{type:u.ContentType.handshake,data:u.createClientHello(o)})),u.flush(o)}},o.process=function(e){var t=0;return e&&o.input.putBytes(e),o.fail||(null!==o.record&&o.record.ready&&o.record.fragment.isEmpty()&&(o.record=null),null===o.record&&(t=function(e){var t=0,r=e.input,i=r.length();if(i<5)t=5-i;else{e.record={type:r.getByte(),version:{major:r.getByte(),minor:r.getByte()},length:r.getInt16(),fragment:n.util.createBuffer(),ready:!1};var s=e.record.version.major===e.version.major;s&&e.session&&e.session.version&&(s=e.record.version.minor===e.version.minor),s||e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.protocol_version}})}return t}(o)),o.fail||null===o.record||o.record.ready||(t=function(e){var t=0,r=e.input,n=r.length();return n<e.record.length?t=e.record.length-n:(e.record.fragment.putBytes(r.getBytes(e.record.length)),r.compact(),e.state.current.read.update(e,e.record)&&(null!==e.fragmented&&(e.fragmented.type===e.record.type?(e.fragmented.fragment.putBuffer(e.record.fragment),e.record=e.fragmented):e.error(e,{message:"Invalid fragmented record.",send:!0,alert:{level:u.Alert.Level.fatal,description:u.Alert.Description.unexpected_message}})),e.record.ready=!0)),t}(o)),!o.fail&&null!==o.record&&o.record.ready&&function(e,t){var r=t.type-u.ContentType.change_cipher_spec,n=N[e.entity][e.expect];r in n?n[r](e,t):u.handleUnexpected(e,t)}(o,o.record)),t},o.prepare=function(e){return u.queue(o,u.createRecord(o,{type:u.ContentType.application_data,data:n.util.createBuffer(e)})),u.flush(o)},o.prepareHeartbeatRequest=function(e,t){return e instanceof n.util.ByteBuffer&&(e=e.bytes()),void 0===t&&(t=e.length),o.expectedHeartbeatPayload=e,u.queue(o,u.createRecord(o,{type:u.ContentType.heartbeat,data:u.createHeartbeat(u.HeartbeatMessageType.heartbeat_request,e,t)})),u.flush(o)},o.close=function(e){if(!o.fail&&o.sessionCache&&o.session){var t={id:o.session.id,version:o.session.version,sp:o.session.sp};t.sp.keys=null,o.sessionCache.setSession(t.id,t)}o.open&&(o.open=!1,o.input.clear(),(o.isConnected||o.handshaking)&&(o.isConnected=o.handshaking=!1,u.queue(o,u.createAlert(o,{level:u.Alert.Level.warning,description:u.Alert.Description.close_notify})),u.flush(o)),o.closed(o)),o.reset(e)},o},e.exports=n.tls=n.tls||{},u)"function"!=typeof u[_]&&(n.tls[_]=u[_]);n.tls.prf_tls1=i,n.tls.hmac_sha1=function(e,t,r){var i=n.hmac.create();i.start("SHA1",e);var s=n.util.createBuffer();return s.putInt32(t[0]),s.putInt32(t[1]),s.putByte(r.type),s.putByte(r.version.major),s.putByte(r.version.minor),s.putInt16(r.length),s.putBytes(r.fragment.bytes()),i.update(s.getBytes()),i.digest().getBytes()},n.tls.createSessionCache=u.createSessionCache,n.tls.createConnection=u.createConnection},3109:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.add5L=t.add5H=t.add4H=t.add4L=t.add3H=t.add3L=t.add=t.rotlBL=t.rotlBH=t.rotlSL=t.rotlSH=t.rotr32L=t.rotr32H=t.rotrBL=t.rotrBH=t.rotrSL=t.rotrSH=t.shrSL=t.shrSH=t.toBig=t.split=t.fromBig=void 0;const r=BigInt(2**32-1),n=BigInt(32);function i(e,t=!1){return t?{h:Number(e&r),l:Number(e>>n&r)}:{h:0|Number(e>>n&r),l:0|Number(e&r)}}function s(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:a,l:o}=i(e[s],t);[r[s],n[s]]=[a,o]}return[r,n]}t.fromBig=i,t.split=s;const a=(e,t)=>BigInt(e>>>0)<<n|BigInt(t>>>0);t.toBig=a;const o=(e,t,r)=>e>>>r;t.shrSH=o;const c=(e,t,r)=>e<<32-r|t>>>r;t.shrSL=c;const u=(e,t,r)=>e>>>r|t<<32-r;t.rotrSH=u;const l=(e,t,r)=>e<<32-r|t>>>r;t.rotrSL=l;const h=(e,t,r)=>e<<64-r|t>>>r-32;t.rotrBH=h;const d=(e,t,r)=>e>>>r-32|t<<64-r;t.rotrBL=d;const f=(e,t)=>t;t.rotr32H=f;const p=(e,t)=>e;t.rotr32L=p;const g=(e,t,r)=>e<<r|t>>>32-r;t.rotlSH=g;const y=(e,t,r)=>t<<r|e>>>32-r;t.rotlSL=y;const m=(e,t,r)=>t<<r-32|e>>>64-r;t.rotlBH=m;const b=(e,t,r)=>e<<r-32|t>>>64-r;function w(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:0|i}}t.rotlBL=b,t.add=w;const v=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);t.add3L=v;const A=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;t.add3H=A;const E=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);t.add4L=E;const C=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;t.add4H=C;const B=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);t.add5L=B;const S=(e,t,r,n,i,s)=>t+r+n+i+s+(e/2**32|0)|0;t.add5H=S;const k={fromBig:i,split:s,toBig:a,shrSH:o,shrSL:c,rotrSH:u,rotrSL:l,rotrBH:h,rotrBL:d,rotr32H:f,rotr32L:p,rotlSH:g,rotlSL:y,rotlBH:m,rotlBL:b,add:w,add3L:v,add3H:A,add4L:E,add4H:C,add5H:S,add5L:B};t.default=k},3134:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;const n=r(9648),i=r(3654);class s extends i.Hash{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,i.createView)(this.buffer)}update(e){(0,n.exists)(this);const{view:t,buffer:r,blockLen:s}=this,a=(e=(0,i.toBytes)(e)).length;for(let n=0;n<a;){const o=Math.min(s-this.pos,a-n);if(o===s){const t=(0,i.createView)(e);for(;s<=a-n;n+=s)this.process(t,n);continue}r.set(e.subarray(n,n+o),this.pos),this.pos+=o,n+=o,this.pos===s&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,n.exists)(this),(0,n.output)(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:s,isLE:a}=this;let{pos:o}=this;t[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(r,0),o=0);for(let e=o;e<s;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),s=BigInt(4294967295),a=Number(r>>i&s),o=Number(r&s),c=n?4:0,u=n?0:4;e.setUint32(t+c,a,n),e.setUint32(t+u,o,n)}(r,s-8,BigInt(8*this.length),a),this.process(r,0);const c=(0,i.createView)(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=u/4,h=this.get();if(l>h.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<l;e++)c.setUint32(4*e,h[e],a)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:s,pos:a}=this;return e.length=n,e.pos=a,e.finished=i,e.destroyed=s,n%t&&e.buffer.set(r),e}}t.SHA2=s},3233:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Typed=void 0;const n=r(8718),i={};function s(e,t){let r=!1;return t<0&&(r=!0,t*=-1),new c(i,`${r?"":"u"}int${t}`,e,{signed:r,width:t})}function a(e,t){return new c(i,`bytes${t||""}`,e,{size:t})}const o=Symbol.for("_ethers_typed");class c{type;value;#e;_typedSymbol;constructor(e,t,r,s){null==s&&(s=null),(0,n.assertPrivate)(i,e,"Typed"),(0,n.defineProperties)(this,{_typedSymbol:o,type:t,value:r}),this.#e=s,this.format()}format(){if("array"===this.type)throw new Error("");if("dynamicArray"===this.type)throw new Error("");return"tuple"===this.type?`tuple(${this.value.map(e=>e.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return"string"===this.type}get tupleName(){if("tuple"!==this.type)throw TypeError("not a tuple");return this.#e}get arrayLength(){if("array"!==this.type)throw TypeError("not an array");return!0===this.#e?-1:!1===this.#e?this.value.length:null}static from(e,t){return new c(i,e,t)}static uint8(e){return s(e,8)}static uint16(e){return s(e,16)}static uint24(e){return s(e,24)}static uint32(e){return s(e,32)}static uint40(e){return s(e,40)}static uint48(e){return s(e,48)}static uint56(e){return s(e,56)}static uint64(e){return s(e,64)}static uint72(e){return s(e,72)}static uint80(e){return s(e,80)}static uint88(e){return s(e,88)}static uint96(e){return s(e,96)}static uint104(e){return s(e,104)}static uint112(e){return s(e,112)}static uint120(e){return s(e,120)}static uint128(e){return s(e,128)}static uint136(e){return s(e,136)}static uint144(e){return s(e,144)}static uint152(e){return s(e,152)}static uint160(e){return s(e,160)}static uint168(e){return s(e,168)}static uint176(e){return s(e,176)}static uint184(e){return s(e,184)}static uint192(e){return s(e,192)}static uint200(e){return s(e,200)}static uint208(e){return s(e,208)}static uint216(e){return s(e,216)}static uint224(e){return s(e,224)}static uint232(e){return s(e,232)}static uint240(e){return s(e,240)}static uint248(e){return s(e,248)}static uint256(e){return s(e,256)}static uint(e){return s(e,256)}static int8(e){return s(e,-8)}static int16(e){return s(e,-16)}static int24(e){return s(e,-24)}static int32(e){return s(e,-32)}static int40(e){return s(e,-40)}static int48(e){return s(e,-48)}static int56(e){return s(e,-56)}static int64(e){return s(e,-64)}static int72(e){return s(e,-72)}static int80(e){return s(e,-80)}static int88(e){return s(e,-88)}static int96(e){return s(e,-96)}static int104(e){return s(e,-104)}static int112(e){return s(e,-112)}static int120(e){return s(e,-120)}static int128(e){return s(e,-128)}static int136(e){return s(e,-136)}static int144(e){return s(e,-144)}static int152(e){return s(e,-152)}static int160(e){return s(e,-160)}static int168(e){return s(e,-168)}static int176(e){return s(e,-176)}static int184(e){return s(e,-184)}static int192(e){return s(e,-192)}static int200(e){return s(e,-200)}static int208(e){return s(e,-208)}static int216(e){return s(e,-216)}static int224(e){return s(e,-224)}static int232(e){return s(e,-232)}static int240(e){return s(e,-240)}static int248(e){return s(e,-248)}static int256(e){return s(e,-256)}static int(e){return s(e,-256)}static bytes1(e){return a(e,1)}static bytes2(e){return a(e,2)}static bytes3(e){return a(e,3)}static bytes4(e){return a(e,4)}static bytes5(e){return a(e,5)}static bytes6(e){return a(e,6)}static bytes7(e){return a(e,7)}static bytes8(e){return a(e,8)}static bytes9(e){return a(e,9)}static bytes10(e){return a(e,10)}static bytes11(e){return a(e,11)}static bytes12(e){return a(e,12)}static bytes13(e){return a(e,13)}static bytes14(e){return a(e,14)}static bytes15(e){return a(e,15)}static bytes16(e){return a(e,16)}static bytes17(e){return a(e,17)}static bytes18(e){return a(e,18)}static bytes19(e){return a(e,19)}static bytes20(e){return a(e,20)}static bytes21(e){return a(e,21)}static bytes22(e){return a(e,22)}static bytes23(e){return a(e,23)}static bytes24(e){return a(e,24)}static bytes25(e){return a(e,25)}static bytes26(e){return a(e,26)}static bytes27(e){return a(e,27)}static bytes28(e){return a(e,28)}static bytes29(e){return a(e,29)}static bytes30(e){return a(e,30)}static bytes31(e){return a(e,31)}static bytes32(e){return a(e,32)}static address(e){return new c(i,"address",e)}static bool(e){return new c(i,"bool",!!e)}static bytes(e){return new c(i,"bytes",e)}static string(e){return new c(i,"string",e)}static array(e,t){throw new Error("not implemented yet")}static tuple(e,t){throw new Error("not implemented yet")}static overrides(e){return new c(i,"overrides",Object.assign({},e))}static isTyped(e){return e&&"object"==typeof e&&"_typedSymbol"in e&&e._typedSymbol===o}static dereference(e,t){if(c.isTyped(e)){if(e.type!==t)throw new Error(`invalid type: expecetd ${t}, got ${e.type}`);return e.value}return e}}t.Typed=c},3313:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContractFactory=void 0;const n=r(333),i=r(6107),s=r(8718),a=r(6829);class o{interface;bytecode;runner;constructor(e,t,r){const i=n.Interface.from(e);t instanceof Uint8Array||("object"==typeof t&&(t=t.object),t.startsWith("0x")||(t="0x"+t)),t=(0,s.hexlify)((0,s.getBytes)(t)),(0,s.defineProperties)(this,{bytecode:t,interface:i,runner:r||null})}attach(e){return new a.BaseContract(e,this.interface,this.runner)}async getDeployTransaction(...e){let t={};const r=this.interface.deploy;if(r.inputs.length+1===e.length&&(t=await(0,a.copyOverrides)(e.pop())),r.inputs.length!==e.length)throw new Error("incorrect number of arguments to constructor");const n=await(0,a.resolveArgs)(this.runner,r.inputs,e),i=(0,s.concat)([this.bytecode,this.interface.encodeDeploy(n)]);return Object.assign({},t,{data:i})}async deploy(...e){const t=await this.getDeployTransaction(...e);(0,s.assert)(this.runner&&"function"==typeof this.runner.sendTransaction,"factory runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const r=await this.runner.sendTransaction(t),n=(0,i.getCreateAddress)(r);return new a.BaseContract(n,this.interface,this.runner,r)}connect(e){return new o(this.interface,this.bytecode,e)}static fromSolidity(e,t){(0,s.assertArgument)(null!=e,"bad compiler output","output",e),"string"==typeof e&&(e=JSON.parse(e));const r=e.abi;let n="";return e.bytecode?n=e.bytecode:e.evm&&e.evm.bytecode&&(n=e.evm.bytecode),new this(r,n,t)}}t.ContractFactory=o},3314:(e,t,r)=>{e.exports=r(9679),r(4412),r(943),r(7585),r(260)},3318:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LangEn=void 0;const n=r(6795);let i=null;class s extends n.WordlistOwl{constructor(){super("en","0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN<aNn RRelyRga(R*lSeS-SketTt!3A^AnAutyCau'ComeEfF%eG(Ha=H(dLie=LowLtN^Nef./TrayTt Twe&Y#d3Cyc!DKeNdOlogyRdR`Tt _{AdeAmeAnketA,EakE[IndOodO[omOu'UeUrUsh_rdAtDyIlMbNeNusOkO,Rd R(gRrowSsTtomUn)XY_{etA(AndA[A=EadEezeI{Id+IefIghtIngIskOccoliOk&OnzeOomO` OwnUsh2Bb!DdyD+tFf$oIldLbLkL!tNd!Nk Rd&Rg R,SS(e[SyTt Y Zz:Bba+B(B!CtusGeKe~LmM aMpNN$N)lNdyNn#NoeNvasNy#Pab!P.$Pta(RRb#RdRgoRpetRryRtSeShS(o/!Su$TT$ogT^Teg%yTt!UghtU'Ut]Ve3Il(gL yM|NsusNturyRe$Rta(_irAlkAmp]An+AosApt Ar+A'AtEapE{Ee'EfErryE,I{&IefIldIm}yOi)Oo'R#-U{!UnkUrn0G?Nnam#Rc!Tiz&TyVil_imApArifyAwAyE<ErkEv I{I|IffImbIn-IpO{OgO'O`OudOwnUbUmpU, Ut^_^A,C#utDeFfeeIlInL!@L%LumnMb(eMeMf%tM-Mm#Mp<yNc tNdu@NfirmNg*[N}@Nsid NtrolNv()OkOlPp PyR$ReRnR*@/Tt#U^UntryUp!Ur'Us(V Yo>_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M<dMi'Ni$Nti,NyP?tP&dPos.P`PutyRi=ScribeS tSignSkSpair/royTailTe@VelopVi)Vo>3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwE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#T2O}OtoRa'Ys-$0AnoCn-Ctu*E)GGe#~LotNkO} Pe/olT^Zza_)A}tA,-A>AyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOg<OtOwUsh0AllArtI!OkeOo`0A{AkeApIffOw0ApCc Ci$CkDaFtL?Ldi LidLut]L=Me#eNgOnRryRtUlUndUpUr)U`0A)A*Ati$AwnEakEci$EedEllEndH eI)Id IkeInIr.L.OilOns%O#OrtOtRayReadR(gY0Ua*UeezeUir*l_b!AdiumAffA+AirsAmpAndArtA>AyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NN<tNnisNtRm/Xt_nkAtEmeEnE%yE*EyIngIsOughtReeRi=RowUmbUnd 0CketDeG LtMb MeNyPRedSsueT!5A,BaccoDayDdl EGe` I!tK&MatoM%rowNeNgueNightOlO`PP-Pp!R^RnadoRtoi'SsT$Uri,W?dW WnY_{AdeAff-Ag-A(Ansf ApAshA=lAyEatEeEndI$IbeI{Igg ImIpOphyOub!U{UeUlyUmpetU,U`Y2BeIt]Mb!NaN}lRkeyRnRt!1El=EntyI)InI,O1PeP-$:5Ly5B*lla0Ab!Awa*C!Cov D DoFairFoldHappyIf%mIqueItIv 'KnownLo{TilUsu$Veil1Da>GradeHoldOnP Set1B<Ge0A+EEdEfulE![U$0Il.y:C<tCuumGueLidL!yL=NNishP%Rious/Ult3H-!L=tNd%Ntu*NueRbRifyRs]RyS'lT <3Ab!Br<tCiousCt%yDeoEw~a+Nta+Ol(Rtu$RusSaS.Su$T$Vid5C$I)IdLc<oLumeTeYa+:GeG#ItLk~LnutNtRfa*RmRri%ShSp/eT VeY3Al`Ap#ArA'lA` BDd(gEk&dIrdLcome/T_!AtEatEelEnE*IpIsp 0DeD`FeLd~NNdowNeNgNkNn Nt ReSdomSeShT}[5LfM<Nd OdOlRdRkRldRryR`_pE{E,!I,I>Ong::Rd3Ar~ow9UUngU`:3BraRo9NeO","0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60")}static wordlist(){return null==i&&(i=new s),i}}t.LangEn=s},3348:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessagePrefix=t.EtherSymbol=void 0,t.EtherSymbol="Ξ",t.MessagePrefix="Ethereum Signed Message:\n"},3372:()=>{},3415:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringCoder=void 0;const n=r(5775),i=r(3233),s=r(5739);class a extends s.DynamicBytesCoder{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,(0,n.toUtf8Bytes)(i.Typed.dereference(t,"string")))}decode(e){return(0,n.toUtf8String)(super.decode(e))}}t.StringCoder=a},3490:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.authorizationify=void 0;const n=r(6107),i=r(6468),s=r(8718);t.authorizationify=function(e){return{address:(0,n.getAddress)(e.address),nonce:(0,s.getBigInt)(null!=e.nonce?e.nonce:0),chainId:(0,s.getBigInt)(null!=e.chainId?e.chainId:0),signature:i.Signature.from(e.signature)}}},3503:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createHasher=t.isogenyMap=t.hash_to_field=t.expand_message_xof=t.expand_message_xmd=void 0;const n=r(1537),i=r(5226);const s=i.bytesToNumberBE;function a(e,t){if(e<0||e>=1<<8*t)throw new Error(`bad I2OSP call: value=${e} length=${t}`);const r=Array.from({length:t}).fill(0);for(let n=t-1;n>=0;n--)r[n]=255&e,e>>>=8;return new Uint8Array(r)}function o(e,t){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e[n]^t[n];return r}function c(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected")}function u(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function l(e,t,r,n){c(e),c(t),u(r),t.length>255&&(t=n((0,i.concatBytes)((0,i.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));const{outputLen:s,blockLen:l}=n,h=Math.ceil(r/s);if(h>255)throw new Error("Invalid xmd length");const d=(0,i.concatBytes)(t,a(t.length,1)),f=a(0,l),p=a(r,2),g=new Array(h),y=n((0,i.concatBytes)(f,e,p,a(0,1),d));g[0]=n((0,i.concatBytes)(y,a(1,1),d));for(let e=1;e<=h;e++){const t=[o(y,g[e-1]),a(e+1,1),d];g[e]=n((0,i.concatBytes)(...t))}return(0,i.concatBytes)(...g).slice(0,r)}function h(e,t,r,n,s){if(c(e),c(t),u(r),t.length>255){const e=Math.ceil(2*n/8);t=s.create({dkLen:e}).update((0,i.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(r>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return s.create({dkLen:r}).update(e).update(a(r,2)).update(t).update(a(t.length,1)).digest()}function d(e,t,r){(0,i.validateObject)(r,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});const{p:a,k:o,m:d,hash:f,expand:p,DST:g}=r;c(e),u(t);const y=function(e){if(e instanceof Uint8Array)return e;if("string"==typeof e)return(0,i.utf8ToBytes)(e);throw new Error("DST must be Uint8Array or string")}(g),m=a.toString(2).length,b=Math.ceil((m+o)/8),w=t*d*b;let v;if("xmd"===p)v=l(e,y,w,f);else if("xof"===p)v=h(e,y,w,o,f);else{if("_internal_pass"!==p)throw new Error('expand must be "xmd" or "xof"');v=e}const A=new Array(t);for(let e=0;e<t;e++){const t=new Array(d);for(let r=0;r<d;r++){const i=b*(r+e*d),o=v.subarray(i,i+b);t[r]=(0,n.mod)(s(o),a)}A[e]=t}return A}t.expand_message_xmd=l,t.expand_message_xof=h,t.hash_to_field=d,t.isogenyMap=function(e,t){const r=t.map(e=>Array.from(e).reverse());return(t,n)=>{const[i,s,a,o]=r.map(r=>r.reduce((r,n)=>e.add(e.mul(r,t),n)));return t=e.div(i,s),n=e.mul(n,e.div(a,o)),{x:t,y:n}}},t.createHasher=function(e,t,r){if("function"!=typeof t)throw new Error("mapToCurve() must be defined");return{hashToCurve(n,i){const s=d(n,2,{...r,DST:r.DST,...i}),a=e.fromAffine(t(s[0])),o=e.fromAffine(t(s[1])),c=a.add(o).clearCofactor();return c.assertValidity(),c},encodeToCurve(n,i){const s=d(n,1,{...r,DST:r.encodeDST,...i}),a=e.fromAffine(t(s[0])).clearCofactor();return a.assertValidity(),a}}}},3556:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StructFragment=t.FunctionFragment=t.FallbackFragment=t.ConstructorFragment=t.EventFragment=t.ErrorFragment=t.NamedFragment=t.Fragment=t.ParamType=void 0;const n=r(8718),i=r(7477);function s(e){const t=new Set;return e.forEach(e=>t.add(e)),Object.freeze(t)}const a=s("external public payable override".split(" ")),o="constant external internal payable private public pure view override",c=s(o.split(" ")),u="constructor error event fallback function receive struct",l=s(u.split(" ")),h="calldata memory storage payable indexed",d=s(h.split(" ")),f=s([u,h,"tuple returns",o].join(" ").split(" ")),p={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},g=new RegExp("^(\\s*)"),y=new RegExp("^([0-9]+)"),m=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),b=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),w=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");class v{#ye;#Qe;get offset(){return this.#ye}get length(){return this.#Qe.length-this.#ye}constructor(e){this.#ye=0,this.#Qe=e.slice()}clone(){return new v(this.#Qe)}reset(){this.#ye=0}#We(e=0,t=0){return new v(this.#Qe.slice(e,t).map(t=>Object.freeze(Object.assign({},t,{match:t.match-e,linkBack:t.linkBack-e,linkNext:t.linkNext-e}))))}popKeyword(e){const t=this.peek();if("KEYWORD"!==t.type||!e.has(t.text))throw new Error(`expected keyword ${t.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const t=this.peek();throw new Error(`expected ${e}; got ${t.type} ${JSON.stringify(t.text)}`)}return this.pop().text}popParen(){const e=this.peek();if("OPEN_PAREN"!==e.type)throw new Error("bad start");const t=this.#We(this.#ye+1,e.match+1);return this.#ye=e.match+1,t}popParams(){const e=this.peek();if("OPEN_PAREN"!==e.type)throw new Error("bad start");const t=[];for(;this.#ye<e.match-1;){const e=this.peek().linkNext;t.push(this.#We(this.#ye+1,e)),this.#ye=e}return this.#ye=e.match+1,t}peek(){if(this.#ye>=this.#Qe.length)throw new Error("out-of-bounds");return this.#Qe[this.#ye]}peekKeyword(e){const t=this.peekType("KEYWORD");return null!=t&&e.has(t)?t:null}peekType(e){if(0===this.length)return null;const t=this.peek();return t.type===e?t.text:null}pop(){const e=this.peek();return this.#ye++,e}toString(){const e=[];for(let t=this.#ye;t<this.#Qe.length;t++){const r=this.#Qe[t];e.push(`${r.type}:${r.text}`)}return`<TokenString ${e.join(" ")}>`}}function A(e){const t=[],r=t=>{const r=a<e.length?JSON.stringify(e[a]):"$EOI";throw new Error(`invalid token ${r} at ${a}: ${t}`)};let i=[],s=[],a=0;for(;a<e.length;){let o=e.substring(a),c=o.match(g);c&&(a+=c[1].length,o=e.substring(a));const u={depth:i.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:a,value:-1};t.push(u);let l=p[o[0]]||"";if(l){if(u.type=l,u.text=o[0],a++,"OPEN_PAREN"===l)i.push(t.length-1),s.push(t.length-1);else if("CLOSE_PAREN"==l)0===i.length&&r("no matching open bracket"),u.match=i.pop(),t[u.match].match=t.length-1,u.depth--,u.linkBack=s.pop(),t[u.linkBack].linkNext=t.length-1;else if("COMMA"===l)u.linkBack=s.pop(),t[u.linkBack].linkNext=t.length-1,s.push(t.length-1);else if("OPEN_BRACKET"===l)u.type="BRACKET";else if("CLOSE_BRACKET"===l){let e=t.pop().text;if(t.length>0&&"NUMBER"===t[t.length-1].type){const r=t.pop().text;e=r+e,t[t.length-1].value=(0,n.getNumber)(r)}if(0===t.length||"BRACKET"!==t[t.length-1].type)throw new Error("missing opening bracket");t[t.length-1].text+=e}}else if(c=o.match(m),c){if(u.text=c[1],a+=u.text.length,f.has(u.text)){u.type="KEYWORD";continue}if(u.text.match(w)){u.type="TYPE";continue}u.type="ID"}else{if(c=o.match(y),!c)throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${a}`);u.text=c[1],u.type="NUMBER",a+=u.text.length}}return new v(t.map(e=>Object.freeze(e)))}function E(e,t){let r=[];for(const n in t.keys())e.has(n)&&r.push(n);if(r.length>1)throw new Error(`conflicting types: ${r.join(", ")}`)}function C(e,t){if(t.peekKeyword(l)){const r=t.pop().text;if(r!==e)throw new Error(`expected ${e}, got ${r}`)}return t.popType("ID")}function B(e,t){const r=new Set;for(;;){const n=e.peekType("KEYWORD");if(null==n||t&&!t.has(n))break;if(e.pop(),r.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);r.add(n)}return Object.freeze(r)}function S(e){let t=B(e,c);return E(t,s("constant payable nonpayable".split(" "))),E(t,s("pure view payable nonpayable".split(" "))),t.has("view")?"view":t.has("pure")?"pure":t.has("payable")?"payable":t.has("nonpayable")?"nonpayable":t.has("constant")?"view":"nonpayable"}function k(e,t){return e.popParams().map(e=>K.from(e,t))}function T(e){if(e.peekType("AT")){if(e.pop(),e.peekType("NUMBER"))return(0,n.getBigInt)(e.pop().text);throw new Error("invalid gas")}return null}function I(e){if(e.length)throw new Error(`unexpected tokens at offset ${e.offset}: ${e.toString()}`)}const P=new RegExp(/^(.*)\[([0-9]*)\]$/);function N(e){const t=e.match(w);if((0,n.assertArgument)(t,"invalid type","type",e),"uint"===e)return"uint256";if("int"===e)return"int256";if(t[2]){const r=parseInt(t[2]);(0,n.assertArgument)(0!==r&&r<=32,"invalid bytes length","type",e)}else if(t[3]){const r=parseInt(t[3]);(0,n.assertArgument)(0!==r&&r<=256&&r%8==0,"invalid numeric width","type",e)}return e}const x={},O=Symbol.for("_ethers_internal"),R="_ParamTypeInternal",U="_ErrorInternal",L="_EventInternal",D="_ConstructorInternal",F="_FallbackInternal",M="_FunctionInternal",j="_StructInternal";class K{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(e,t,r,i,s,a,o,c){if((0,n.assertPrivate)(e,x,"ParamType"),Object.defineProperty(this,O,{value:R}),a&&(a=Object.freeze(a.slice())),"array"===i){if(null==o||null==c)throw new Error("")}else if(null!=o||null!=c)throw new Error("");if("tuple"===i){if(null==a)throw new Error("")}else if(null!=a)throw new Error("");(0,n.defineProperties)(this,{name:t,type:r,baseType:i,indexed:s,components:a,arrayLength:o,arrayChildren:c})}format(e){if(null==e&&(e="sighash"),"json"===e){const t=this.name||"";if(this.isArray()){const e=JSON.parse(this.arrayChildren.format("json"));return e.name=t,e.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(e)}const r={type:"tuple"===this.baseType?"tuple":this.type,name:t};return"boolean"==typeof this.indexed&&(r.indexed=this.indexed),this.isTuple()&&(r.components=this.components.map(t=>JSON.parse(t.format(e)))),JSON.stringify(r)}let t="";return this.isArray()?(t+=this.arrayChildren.format(e),t+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?t+="("+this.components.map(t=>t.format(e)).join("full"===e?", ":",")+")":t+=this.type,"sighash"!==e&&(!0===this.indexed&&(t+=" indexed"),"full"===e&&this.name&&(t+=" "+this.name)),t}isArray(){return"array"===this.baseType}isTuple(){return"tuple"===this.baseType}isIndexable(){return null!=this.indexed}walk(e,t){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(-1!==this.arrayLength&&e.length!==this.arrayLength)throw new Error("array is wrong length");const r=this;return e.map(e=>r.arrayChildren.walk(e,t))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const r=this;return e.map((e,n)=>r.components[n].walk(e,t))}return t(this.type,e)}#Je(e,t,r,n){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(-1!==this.arrayLength&&t.length!==this.arrayLength)throw new Error("array is wrong length");const i=this.arrayChildren,s=t.slice();return s.forEach((t,n)=>{i.#Je(e,t,r,e=>{s[n]=e})}),void n(s)}if(this.isTuple()){const i=this.components;let s;if(Array.isArray(t))s=t.slice();else{if(null==t||"object"!=typeof t)throw new Error("invalid tuple value");s=i.map(e=>{if(!e.name)throw new Error("cannot use object value with unnamed components");if(!(e.name in t))throw new Error(`missing value for component ${e.name}`);return t[e.name]})}if(s.length!==this.components.length)throw new Error("array is wrong length");return s.forEach((t,n)=>{i[n].#Je(e,t,r,e=>{s[n]=e})}),void n(s)}const i=r(this.type,t);i.then?e.push(async function(){n(await i)}()):n(i)}async walkAsync(e,t){const r=[],n=[e];return this.#Je(r,e,t,e=>{n[0]=e}),r.length&&await Promise.all(r),n[0]}static from(e,t){if(K.isParamType(e))return e;if("string"==typeof e)try{return K.from(A(e),t)}catch(t){(0,n.assertArgument)(!1,"invalid param type","obj",e)}else if(e instanceof v){let r="",n="",i=null;B(e,s(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(n="tuple",i=e.popParams().map(e=>K.from(e)),r=`tuple(${i.map(e=>e.format()).join(",")})`):(r=N(e.popType("TYPE")),n=r);let a=null,o=null;for(;e.length&&e.peekType("BRACKET");){const t=e.pop();a=new K(x,"",r,n,null,i,o,a),o=t.value,r+=t.text,n="array",i=null}let c=null;if(B(e,d).has("indexed")){if(!t)throw new Error("");c=!0}const u=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new K(x,u,r,n,c,i,o,a)}const r=e.name;(0,n.assertArgument)(!r||"string"==typeof r&&r.match(b),"invalid name","obj.name",r);let i=e.indexed;null!=i&&((0,n.assertArgument)(t,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let a=e.type,o=a.match(P);if(o){const t=parseInt(o[2]||"-1"),n=K.from({type:o[1],components:e.components});return new K(x,r||"",a,"array",i,null,t,n)}if("tuple"===a||a.startsWith("tuple(")||a.startsWith("(")){const t=null!=e.components?e.components.map(e=>K.from(e)):null;return new K(x,r||"",a,"tuple",i,t,null,null)}return a=N(e.type),new K(x,r||"",a,a,i,null,null,null)}static isParamType(e){return e&&e[O]===R}}t.ParamType=K;class V{type;inputs;constructor(e,t,r){(0,n.assertPrivate)(e,x,"Fragment"),r=Object.freeze(r.slice()),(0,n.defineProperties)(this,{type:t,inputs:r})}static from(e){if("string"==typeof e){try{V.from(JSON.parse(e))}catch(e){}return V.from(A(e))}if(e instanceof v){switch(e.peekKeyword(l)){case"constructor":return q.from(e);case"error":return G.from(e);case"event":return z.from(e);case"fallback":case"receive":return Q.from(e);case"function":return W.from(e);case"struct":return J.from(e)}}else if("object"==typeof e){switch(e.type){case"constructor":return q.from(e);case"error":return G.from(e);case"event":return z.from(e);case"fallback":case"receive":return Q.from(e);case"function":return W.from(e);case"struct":return J.from(e)}(0,n.assert)(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}(0,n.assertArgument)(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return q.isFragment(e)}static isError(e){return G.isFragment(e)}static isEvent(e){return z.isFragment(e)}static isFunction(e){return W.isFragment(e)}static isStruct(e){return J.isFragment(e)}}t.Fragment=V;class H extends V{name;constructor(e,t,r,i){super(e,t,i),(0,n.assertArgument)("string"==typeof r&&r.match(b),"invalid identifier","name",r),i=Object.freeze(i.slice()),(0,n.defineProperties)(this,{name:r})}}function _(e,t){return"("+t.map(t=>t.format(e)).join("full"===e?", ":",")+")"}t.NamedFragment=H;class G extends H{constructor(e,t,r){super(e,"error",t,r),Object.defineProperty(this,O,{value:U})}get selector(){return(0,i.id)(this.format("sighash")).substring(0,10)}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(t=>JSON.parse(t.format(e)))});const t=[];return"sighash"!==e&&t.push("error"),t.push(this.name+_(e,this.inputs)),t.join(" ")}static from(e){if(G.isFragment(e))return e;if("string"==typeof e)return G.from(A(e));if(e instanceof v){const t=C("error",e),r=k(e);return I(e),new G(x,t,r)}return new G(x,e.name,e.inputs?e.inputs.map(K.from):[])}static isFragment(e){return e&&e[O]===U}}t.ErrorFragment=G;class z extends H{anonymous;constructor(e,t,r,i){super(e,"event",t,r),Object.defineProperty(this,O,{value:L}),(0,n.defineProperties)(this,{anonymous:i})}get topicHash(){return(0,i.id)(this.format("sighash"))}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(t=>JSON.parse(t.format(e)))});const t=[];return"sighash"!==e&&t.push("event"),t.push(this.name+_(e,this.inputs)),"sighash"!==e&&this.anonymous&&t.push("anonymous"),t.join(" ")}static getTopicHash(e,t){t=(t||[]).map(e=>K.from(e));return new z(x,e,t,!1).topicHash}static from(e){if(z.isFragment(e))return e;if("string"==typeof e)try{return z.from(A(e))}catch(t){(0,n.assertArgument)(!1,"invalid event fragment","obj",e)}else if(e instanceof v){const t=C("event",e),r=k(e,!0),n=!!B(e,s(["anonymous"])).has("anonymous");return I(e),new z(x,t,r,n)}return new z(x,e.name,e.inputs?e.inputs.map(e=>K.from(e,!0)):[],!!e.anonymous)}static isFragment(e){return e&&e[O]===L}}t.EventFragment=z;class q extends V{payable;gas;constructor(e,t,r,i,s){super(e,t,r),Object.defineProperty(this,O,{value:D}),(0,n.defineProperties)(this,{payable:i,gas:s})}format(e){if((0,n.assert)(null!=e&&"sighash"!==e,"cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),"json"===e)return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map(t=>JSON.parse(t.format(e)))});const t=[`constructor${_(e,this.inputs)}`];return this.payable&&t.push("payable"),null!=this.gas&&t.push(`@${this.gas.toString()}`),t.join(" ")}static from(e){if(q.isFragment(e))return e;if("string"==typeof e)try{return q.from(A(e))}catch(t){(0,n.assertArgument)(!1,"invalid constuctor fragment","obj",e)}else if(e instanceof v){B(e,s(["constructor"]));const t=k(e),r=!!B(e,a).has("payable"),n=T(e);return I(e),new q(x,"constructor",t,r,n)}return new q(x,"constructor",e.inputs?e.inputs.map(K.from):[],!!e.payable,null!=e.gas?e.gas:null)}static isFragment(e){return e&&e[O]===D}}t.ConstructorFragment=q;class Q extends V{payable;constructor(e,t,r){super(e,"fallback",t),Object.defineProperty(this,O,{value:F}),(0,n.defineProperties)(this,{payable:r})}format(e){const t=0===this.inputs.length?"receive":"fallback";if("json"===e){const e=this.payable?"payable":"nonpayable";return JSON.stringify({type:t,stateMutability:e})}return`${t}()${this.payable?" payable":""}`}static from(e){if(Q.isFragment(e))return e;if("string"==typeof e)try{return Q.from(A(e))}catch(t){(0,n.assertArgument)(!1,"invalid fallback fragment","obj",e)}else if(e instanceof v){const t=e.toString(),r=e.peekKeyword(s(["fallback","receive"]));(0,n.assertArgument)(r,"type must be fallback or receive","obj",t);if("receive"===e.popKeyword(s(["fallback","receive"]))){const t=k(e);return(0,n.assertArgument)(0===t.length,"receive cannot have arguments","obj.inputs",t),B(e,s(["payable"])),I(e),new Q(x,[],!0)}let i=k(e);i.length?(0,n.assertArgument)(1===i.length&&"bytes"===i[0].type,"invalid fallback inputs","obj.inputs",i.map(e=>e.format("minimal")).join(", ")):i=[K.from("bytes")];const a=S(e);if((0,n.assertArgument)("nonpayable"===a||"payable"===a,"fallback cannot be constants","obj.stateMutability",a),B(e,s(["returns"])).has("returns")){const t=k(e);(0,n.assertArgument)(1===t.length&&"bytes"===t[0].type,"invalid fallback outputs","obj.outputs",t.map(e=>e.format("minimal")).join(", "))}return I(e),new Q(x,i,"payable"===a)}if("receive"===e.type)return new Q(x,[],!0);if("fallback"===e.type){const t=[K.from("bytes")],r="payable"===e.stateMutability;return new Q(x,t,r)}(0,n.assertArgument)(!1,"invalid fallback description","obj",e)}static isFragment(e){return e&&e[O]===F}}t.FallbackFragment=Q;class W extends H{constant;outputs;stateMutability;payable;gas;constructor(e,t,r,i,s,a){super(e,"function",t,i),Object.defineProperty(this,O,{value:M}),s=Object.freeze(s.slice());const o="view"===r||"pure"===r,c="payable"===r;(0,n.defineProperties)(this,{constant:o,gas:a,outputs:s,payable:c,stateMutability:r})}get selector(){return(0,i.id)(this.format("sighash")).substring(0,10)}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map(t=>JSON.parse(t.format(e))),outputs:this.outputs.map(t=>JSON.parse(t.format(e)))});const t=[];return"sighash"!==e&&t.push("function"),t.push(this.name+_(e,this.inputs)),"sighash"!==e&&("nonpayable"!==this.stateMutability&&t.push(this.stateMutability),this.outputs&&this.outputs.length&&(t.push("returns"),t.push(_(e,this.outputs))),null!=this.gas&&t.push(`@${this.gas.toString()}`)),t.join(" ")}static getSelector(e,t){t=(t||[]).map(e=>K.from(e));return new W(x,e,"view",t,[],null).selector}static from(e){if(W.isFragment(e))return e;if("string"==typeof e)try{return W.from(A(e))}catch(t){(0,n.assertArgument)(!1,"invalid function fragment","obj",e)}else if(e instanceof v){const t=C("function",e),r=k(e),n=S(e);let i=[];B(e,s(["returns"])).has("returns")&&(i=k(e));const a=T(e);return I(e),new W(x,t,n,r,i,a)}let t=e.stateMutability;return null==t&&(t="payable","boolean"==typeof e.constant?(t="view",e.constant||(t="payable","boolean"!=typeof e.payable||e.payable||(t="nonpayable"))):"boolean"!=typeof e.payable||e.payable||(t="nonpayable")),new W(x,e.name,t,e.inputs?e.inputs.map(K.from):[],e.outputs?e.outputs.map(K.from):[],null!=e.gas?e.gas:null)}static isFragment(e){return e&&e[O]===M}}t.FunctionFragment=W;class J extends H{constructor(e,t,r){super(e,"struct",t,r),Object.defineProperty(this,O,{value:j})}format(){throw new Error("@TODO")}static from(e){if("string"==typeof e)try{return J.from(A(e))}catch(t){(0,n.assertArgument)(!1,"invalid struct fragment","obj",e)}else if(e instanceof v){const t=C("struct",e),r=k(e);return I(e),new J(x,t,r)}return new J(x,e.name,e.inputs?e.inputs.map(K.from):[])}static isFragment(e){return e&&e[O]===j}}t.StructFragment=J},3574:(e,t,r)=>{var n=r(4643);r(7835),r(81),r(4467),r(4793),r(4117),r(5417),r(2374),r(943),r(8550),r(846);var i=n.asn1,s=n.pki,a=e.exports=n.pkcs12=n.pkcs12||{},o={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},c={name:"PFX",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},o,{name:"PFX.macData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},u={name:"SafeBag",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},l={name:"Attribute",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,capture:"values"}]},h={name:"CertBag",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:i.Class.UNIVERSAL,type:i.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function d(e,t,r,n){for(var i=[],s=0;s<e.length;s++)for(var a=0;a<e[s].safeBags.length;a++){var o=e[s].safeBags[a];void 0!==n&&o.type!==n||(null!==t?void 0!==o.attributes[t]&&o.attributes[t].indexOf(r)>=0&&i.push(o):i.push(o))}return i}function f(e){if(e.composed||e.constructed){for(var t=n.util.createBuffer(),r=0;r<e.value.length;++r)t.putBytes(e.value[r].value);e.composed=e.constructed=!1,e.value=t.getBytes()}return e}function p(e,t){var r={},a=[];if(!i.validate(e,n.pkcs7.asn1.encryptedDataValidator,r,a))throw(o=new Error("Cannot read EncryptedContentInfo.")).errors=a,o;var o,c=i.derToOid(r.contentType);if(c!==s.oids.data)throw(o=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.")).oid=c,o;c=i.derToOid(r.encAlgorithm);var u=s.pbe.getCipher(c,r.encParameter,t),l=f(r.encryptedContentAsn1),h=n.util.createBuffer(l.value);if(u.update(h),!u.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return u.output.getBytes()}function g(e,t,r){if(!t&&0===e.length)return[];if((e=i.fromDer(e,t)).tagClass!==i.Class.UNIVERSAL||e.type!==i.Type.SEQUENCE||!0!==e.constructed)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var n=[],a=0;a<e.value.length;a++){var o=e.value[a],c={},l=[];if(!i.validate(o,u,c,l))throw(m=new Error("Cannot read SafeBag.")).errors=l,m;var d,f,p={type:i.derToOid(c.bagId),attributes:y(c.bagAttributes)};n.push(p);var g=c.bagValue.value[0];switch(p.type){case s.oids.pkcs8ShroudedKeyBag:if(null===(g=s.decryptPrivateKeyInfo(g,r)))throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case s.oids.keyBag:try{p.key=s.privateKeyFromAsn1(g)}catch(e){p.key=null,p.asn1=g}continue;case s.oids.certBag:d=h,f=function(){if(i.derToOid(c.certId)!==s.oids.x509Certificate){var e=new Error("Unsupported certificate type, only X.509 supported.");throw e.oid=i.derToOid(c.certId),e}var r=i.fromDer(c.cert,t);try{p.cert=s.certificateFromAsn1(r,!0)}catch(e){p.cert=null,p.asn1=r}};break;default:var m;throw(m=new Error("Unsupported PKCS#12 SafeBag type.")).oid=p.type,m}if(void 0!==d&&!i.validate(g,d,c,l))throw(m=new Error("Cannot read PKCS#12 "+d.name)).errors=l,m;f()}return n}function y(e){var t={};if(void 0!==e)for(var r=0;r<e.length;++r){var n={},a=[];if(!i.validate(e[r],l,n,a)){var o=new Error("Cannot read PKCS#12 BagAttribute.");throw o.errors=a,o}var c=i.derToOid(n.oid);if(void 0!==s.oids[c]){t[s.oids[c]]=[];for(var u=0;u<n.values.length;++u)t[s.oids[c]].push(n.values[u].value)}}return t}a.pkcs12FromAsn1=function(e,t,r){"string"==typeof t?(r=t,t=!0):void 0===t&&(t=!0);var u={};if(!i.validate(e,c,u,[]))throw(l=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.")).errors=l,l;var l,h={version:u.version.charCodeAt(0),safeContents:[],getBags:function(e){var t,r={};return"localKeyId"in e?t=e.localKeyId:"localKeyIdHex"in e&&(t=n.util.hexToBytes(e.localKeyIdHex)),void 0===t&&!("friendlyName"in e)&&"bagType"in e&&(r[e.bagType]=d(h.safeContents,null,null,e.bagType)),void 0!==t&&(r.localKeyId=d(h.safeContents,"localKeyId",t,e.bagType)),"friendlyName"in e&&(r.friendlyName=d(h.safeContents,"friendlyName",e.friendlyName,e.bagType)),r},getBagsByFriendlyName:function(e,t){return d(h.safeContents,"friendlyName",e,t)},getBagsByLocalKeyId:function(e,t){return d(h.safeContents,"localKeyId",e,t)}};if(3!==u.version.charCodeAt(0))throw(l=new Error("PKCS#12 PFX of version other than 3 not supported.")).version=u.version.charCodeAt(0),l;if(i.derToOid(u.contentType)!==s.oids.data)throw(l=new Error("Only PKCS#12 PFX in password integrity mode supported.")).oid=i.derToOid(u.contentType),l;var y=u.content.value[0];if(y.tagClass!==i.Class.UNIVERSAL||y.type!==i.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(y=f(y),u.mac){var m=null,b=0,w=i.derToOid(u.macAlgorithm);switch(w){case s.oids.sha1:m=n.md.sha1.create(),b=20;break;case s.oids.sha256:m=n.md.sha256.create(),b=32;break;case s.oids.sha384:m=n.md.sha384.create(),b=48;break;case s.oids.sha512:m=n.md.sha512.create(),b=64;break;case s.oids.md5:m=n.md.md5.create(),b=16}if(null===m)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+w);var v=new n.util.ByteBuffer(u.macSalt),A="macIterations"in u?parseInt(n.util.bytesToHex(u.macIterations),16):1,E=a.generateKey(r,v,3,A,b,m),C=n.hmac.create();if(C.start(m,E),C.update(y.value),C.getMac().getBytes()!==u.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return function(e,t,r,n){if(t=i.fromDer(t,r),t.tagClass!==i.Class.UNIVERSAL||t.type!==i.Type.SEQUENCE||!0!==t.constructed)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var a=0;a<t.value.length;a++){var c=t.value[a],u={},l=[];if(!i.validate(c,o,u,l))throw(m=new Error("Cannot read ContentInfo.")).errors=l,m;var h={encrypted:!1},d=null,y=u.content.value[0];switch(i.derToOid(u.contentType)){case s.oids.data:if(y.tagClass!==i.Class.UNIVERSAL||y.type!==i.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");d=f(y).value;break;case s.oids.encryptedData:d=p(y,n),h.encrypted=!0;break;default:var m;throw(m=new Error("Unsupported PKCS#12 contentType.")).contentType=i.derToOid(u.contentType),m}h.safeBags=g(d,r,n),e.safeContents.push(h)}}(h,y.value,t,r),h},a.toPkcs12Asn1=function(e,t,r,o){(o=o||{}).saltSize=o.saltSize||8,o.count=o.count||2048,o.algorithm=o.algorithm||o.encAlgorithm||"aes128","useMac"in o||(o.useMac=!0),"localKeyId"in o||(o.localKeyId=null),"generateLocalKeyId"in o||(o.generateLocalKeyId=!0);var c,u=o.localKeyId;if(null!==u)u=n.util.hexToBytes(u);else if(o.generateLocalKeyId)if(t){var l=n.util.isArray(t)?t[0]:t;"string"==typeof l&&(l=s.certificateFromPem(l)),(T=n.md.sha1.create()).update(i.toDer(s.certificateToAsn1(l)).getBytes()),u=T.digest().getBytes()}else u=n.random.getBytes(20);var h=[];null!==u&&h.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s.oids.localKeyId).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,u)])])),"friendlyName"in o&&h.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s.oids.friendlyName).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.BMPSTRING,!1,o.friendlyName)])])),h.length>0&&(c=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,h));var d=[],f=[];null!==t&&(f=n.util.isArray(t)?t:[t]);for(var p=[],g=0;g<f.length;++g){"string"==typeof(t=f[g])&&(t=s.certificateFromPem(t));var y=0===g?c:void 0,m=s.certificateToAsn1(t),b=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s.oids.certBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s.oids.x509Certificate).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(m).getBytes())])])]),y]);p.push(b)}if(p.length>0){var w=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,p),v=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(w).getBytes())])]);d.push(v)}var A=null;if(null!==e){var E=s.wrapRsaPrivateKey(s.privateKeyToAsn1(e));A=null===r?i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s.oids.keyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[E]),c]):i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s.oids.pkcs8ShroudedKeyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[s.encryptPrivateKeyInfo(E,r,o)]),c]);var C=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[A]),B=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(C).getBytes())])]);d.push(B)}var S,k=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,d);if(o.useMac){var T=n.md.sha1.create(),I=new n.util.ByteBuffer(n.random.getBytes(o.saltSize)),P=o.count,N=(e=a.generateKey(r,I,3,P,20),n.hmac.create());N.start(T,e),N.update(i.toDer(k).getBytes());var x=N.getMac();S=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s.oids.sha1).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,x.getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,I.getBytes()),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(P).getBytes())])}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(3).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(s.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(k).getBytes())])]),S])},a.generateKey=n.pbe.generatePkcs12Key},3594:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CloudflareProvider=void 0;const n=r(8718),i=r(4391),s=r(24);class a extends s.JsonRpcProvider{constructor(e){null==e&&(e="mainnet");const t=i.Network.from(e);(0,n.assertArgument)("mainnet"===t.name,"unsupported network","network",e),super("https://cloudflare-eth.com/",t,{staticNetwork:t})}}t.CloudflareProvider=a},3600:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createCurve=t.getHash=void 0;const n=r(7073),i=r(1197),s=r(747);function a(e){return{hash:e,hmac:(t,...r)=>(0,n.hmac)(e,t,(0,i.concatBytes)(...r)),randomBytes:i.randomBytes}}t.getHash=a,t.createCurve=function(e,t){const r=t=>(0,s.weierstrass)({...e,...a(t)});return Object.freeze({...r(t),create:r})}},3633:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractProvider=t.UnmanagedSubscriber=void 0;const n=r(6107),i=r(2234),s=r(7675),a=r(7477),o=r(203),c=r(8718),u=r(1836),l=r(4098),h=r(4391),d=r(532),f=r(5737),p=BigInt(2);function g(e){return e&&"function"==typeof e.then}function y(e,t){return e+":"+JSON.stringify(t,(e,t)=>{if(null==t)return"null";if("bigint"==typeof t)return`bigint:${t.toString()}`;if("string"==typeof t)return t.toLowerCase();if("object"==typeof t&&!Array.isArray(t)){const e=Object.keys(t);return e.sort(),e.reduce((e,r)=>(e[r]=t[r],e),{})}return t})}class m{name;constructor(e){(0,c.defineProperties)(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function b(e){return(e=Array.from(new Set(e).values())).sort(),e}async function w(e,t){if(null==e)throw new Error("invalid event");if(Array.isArray(e)&&(e={topics:e}),"string"==typeof e)switch(e){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:e,tag:e}}if((0,c.isHexString)(e,32)){const t=e.toLowerCase();return{type:"transaction",tag:y("tx",{hash:t}),hash:t}}if(e.orphan){const t=e;return{type:"orphan",tag:y("orphan",t),filter:(r=t,JSON.parse(JSON.stringify(r)))}}var r;if(e.address||e.topics){const r=e,i={topics:(r.topics||[]).map(e=>null==e?null:Array.isArray(e)?b(e.map(e=>e.toLowerCase())):e.toLowerCase())};if(r.address){const e=[],s=[],a=r=>{(0,c.isHexString)(r)?e.push(r):s.push((async()=>{e.push(await(0,n.resolveAddress)(r,t))})())};Array.isArray(r.address)?r.address.forEach(a):a(r.address),s.length&&await Promise.all(s),i.address=b(e.map(e=>e.toLowerCase()))}return{filter:i,tag:y("event",i),type:"event"}}(0,c.assertArgument)(!1,"unknown ProviderEvent","event",e)}function v(){return(new Date).getTime()}t.UnmanagedSubscriber=m;const A={cacheTimeout:250,pollingInterval:4e3};function E(e,t){try{const r=C(e,t);if(r)return(0,c.toUtf8String)(r)}catch(e){}return null}function C(e,t){if("0x"===e)return null;try{const r=(0,c.getNumber)((0,c.dataSlice)(e,t,t+32)),n=(0,c.getNumber)((0,c.dataSlice)(e,r,r+32));return(0,c.dataSlice)(e,r+32,r+32+n)}catch(e){}return null}function B(e){const t=(0,c.toBeArray)(e);if(t.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(t,32-t.length),r}function S(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}t.AbstractProvider=class{#_e;#Ye;#Ze;#Xe;#$e;#et;#tt;#rt;#nt;#it;#st;#e;constructor(e,t){if(this.#e=Object.assign({},A,t||{}),"any"===e)this.#et=!0,this.#$e=null;else if(e){const t=h.Network.from(e);this.#et=!1,this.#$e=Promise.resolve(t),setTimeout(()=>{this.emit("network",t,null)},0)}else this.#et=!1,this.#$e=null;this.#rt=-1,this.#tt=new Map,this.#_e=new Map,this.#Ye=new Map,this.#Ze=null,this.#Xe=!1,this.#nt=1,this.#it=new Map,this.#st=!1}get pollingInterval(){return this.#e.pollingInterval}get provider(){return this}get plugins(){return Array.from(this.#Ye.values())}attachPlugin(e){if(this.#Ye.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#Ye.set(e.name,e.connect(this)),this}getPlugin(e){return this.#Ye.get(e)||null}get disableCcipRead(){return this.#st}set disableCcipRead(e){this.#st=!!e}async#at(e){const t=this.#e.cacheTimeout;if(t<0)return await this._perform(e);const r=y(e.method,e);let n=this.#tt.get(r);return n||(n=this._perform(e),this.#tt.set(r,n),setTimeout(()=>{this.#tt.get(r)===n&&this.#tt.delete(r)},t)),await n}async ccipReadFetch(e,t,r){if(this.disableCcipRead||0===r.length||null==e.to)return null;const n=e.to.toLowerCase(),i=t.toLowerCase(),s=[];for(let t=0;t<r.length;t++){const a=r[t],o=a.replace("{sender}",n).replace("{data}",i),u=new c.FetchRequest(o);-1===a.indexOf("{data}")&&(u.body={data:i,sender:n}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:u,index:t,urls:r});let l,h="unknown error";try{l=await u.send()}catch(e){s.push(e.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:u,result:{error:e}});continue}try{const e=l.bodyJson;if(e.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:u,result:e}),e.data;e.message&&(h=e.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:u,result:e})}catch(e){}(0,c.assert)(l.statusCode<400||l.statusCode>=500,`response not found during CCIP fetch: ${h}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:a,errorMessage:h}}),s.push(h)}(0,c.assert)(!1,`error encountered during CCIP fetch: ${s.map(e=>JSON.stringify(e)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:r,errorMessages:s}})}_wrapBlock(e,t){return new d.Block((0,l.formatBlock)(e),this)}_wrapLog(e,t){return new d.Log((0,l.formatLog)(e),this)}_wrapTransactionReceipt(e,t){return new d.TransactionReceipt((0,l.formatTransactionReceipt)(e),this)}_wrapTransactionResponse(e,t){return new d.TransactionResponse((0,l.formatTransactionResponse)(e),this)}_detectNetwork(){(0,c.assert)(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){(0,c.assert)(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=(0,c.getNumber)(await this.#at({method:"getBlockNumber"}),"%response");return this.#rt>=0&&(this.#rt=e),e}_getAddress(e){return(0,n.resolveAddress)(e,this)}_getBlockTag(e){if(null==e)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}return(0,c.isHexString)(e)?(0,c.isHexString)(e,32)?e:(0,c.toQuantity)(e):("bigint"==typeof e&&(e=(0,c.getNumber)(e,"blockTag")),"number"==typeof e?e>=0?(0,c.toQuantity)(e):this.#rt>=0?(0,c.toQuantity)(this.#rt+e):this.getBlockNumber().then(t=>(0,c.toQuantity)(t+e)):void(0,c.assertArgument)(!1,"invalid blockTag","blockTag",e))}_getFilter(e){const t=(e.topics||[]).map(e=>null==e?null:Array.isArray(e)?b(e.map(e=>e.toLowerCase())):e.toLowerCase()),r="blockHash"in e?e.blockHash:void 0,n=(e,n,i)=>{let s;switch(e.length){case 0:break;case 1:s=e[0];break;default:e.sort(),s=e}if(r&&(null!=n||null!=i))throw new Error("invalid filter");const a={};return s&&(a.address=s),t.length&&(a.topics=t),n&&(a.fromBlock=n),i&&(a.toBlock=i),r&&(a.blockHash=r),a};let i,s,a=[];if(e.address)if(Array.isArray(e.address))for(const t of e.address)a.push(this._getAddress(t));else a.push(this._getAddress(e.address));return"fromBlock"in e&&(i=this._getBlockTag(e.fromBlock)),"toBlock"in e&&(s=this._getBlockTag(e.toBlock)),a.filter(e=>"string"!=typeof e).length||null!=i&&"string"!=typeof i||null!=s&&"string"!=typeof s?Promise.all([Promise.all(a),i,s]).then(e=>n(e[0],e[1],e[2])):n(a,i,s)}_getTransactionRequest(e){const t=(0,d.copyRequest)(e),r=[];if(["to","from"].forEach(e=>{if(null==t[e])return;const i=(0,n.resolveAddress)(t[e],this);g(i)?r.push(async function(){t[e]=await i}()):t[e]=i}),null!=t.blockTag){const e=this._getBlockTag(t.blockTag);g(e)?r.push(async function(){t.blockTag=await e}()):t.blockTag=e}return r.length?async function(){return await Promise.all(r),t}():t}async getNetwork(){if(null==this.#$e){const e=(async()=>{try{const e=await this._detectNetwork();return this.emit("network",e,null),e}catch(t){throw this.#$e===e&&(this.#$e=null),t}})();return this.#$e=e,(await e).clone()}const e=this.#$e,[t,r]=await Promise.all([e,this._detectNetwork()]);return t.chainId!==r.chainId&&(this.#et?(this.emit("network",r,t),this.#$e===e&&(this.#$e=Promise.resolve(r))):(0,c.assert)(!1,`network changed: ${t.chainId} => ${r.chainId} `,"NETWORK_ERROR",{event:"changed"})),t.clone()}async getFeeData(){const e=await this.getNetwork(),t=async()=>{const{_block:t,gasPrice:r,priorityFee:n}=await(0,c.resolveProperties)({_block:this.#ot("latest",!1),gasPrice:(async()=>{try{const e=await this.#at({method:"getGasPrice"});return(0,c.getBigInt)(e,"%response")}catch(e){}return null})(),priorityFee:(async()=>{try{const e=await this.#at({method:"getPriorityFee"});return(0,c.getBigInt)(e,"%response")}catch(e){}return null})()});let i=null,s=null;const a=this._wrapBlock(t,e);return a&&a.baseFeePerGas&&(s=null!=n?n:BigInt("1000000000"),i=a.baseFeePerGas*p+s),new d.FeeData(r,i,s)},r=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(r){const e=new c.FetchRequest(r.url),n=await r.processFunc(t,this,e);return new d.FeeData(n.gasPrice,n.maxFeePerGas,n.maxPriorityFeePerGas)}return await t()}async estimateGas(e){let t=this._getTransactionRequest(e);return g(t)&&(t=await t),(0,c.getBigInt)(await this.#at({method:"estimateGas",transaction:t}),"%response")}async#ct(e,t,r){(0,c.assert)(r<10,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:t,enableCcipRead:!0})});const i=(0,d.copyRequest)(e);try{return(0,c.hexlify)(await this._perform({method:"call",transaction:i,blockTag:t}))}catch(e){if(!this.disableCcipRead&&(0,c.isCallException)(e)&&e.data&&r>=0&&"latest"===t&&null!=i.to&&"0x556f1830"===(0,c.dataSlice)(e.data,0,4)){const s=e.data,a=await(0,n.resolveAddress)(i.to,this);let o;try{o=function(e){const t={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};(0,c.assert)((0,c.dataLength)(e)>=160,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const r=(0,c.dataSlice)(e,0,32);(0,c.assert)((0,c.dataSlice)(r,0,12)===(0,c.dataSlice)(I,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),t.sender=(0,c.dataSlice)(r,12);try{const r=[],n=(0,c.getNumber)((0,c.dataSlice)(e,32,64)),i=(0,c.getNumber)((0,c.dataSlice)(e,n,n+32)),s=(0,c.dataSlice)(e,n+32);for(let e=0;e<i;e++){const t=E(s,32*e);if(null==t)throw new Error("abort");r.push(t)}t.urls=r}catch(e){(0,c.assert)(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{const r=C(e,64);if(null==r)throw new Error("abort");t.calldata=r}catch(e){(0,c.assert)(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}(0,c.assert)((0,c.dataSlice)(e,100,128)===(0,c.dataSlice)(I,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),t.selector=(0,c.dataSlice)(e,96,100);try{const r=C(e,128);if(null==r)throw new Error("abort");t.extraData=r}catch(e){(0,c.assert)(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return t.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(e=>t[e]),t}((0,c.dataSlice)(e.data,4))}catch(e){(0,c.assert)(!1,e.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:s}})}(0,c.assert)(o.sender.toLowerCase()===a.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:s,reason:"OffchainLookup",transaction:i,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:o.errorArgs}});const u=await this.ccipReadFetch(i,o.calldata,o.urls);(0,c.assert)(null!=u,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:e.data,errorArgs:o.errorArgs}});const l={to:a,data:(0,c.concat)([o.selector,T([u,o.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:l});try{const e=await this.#ct(l,t,r+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},l),result:e}),e}catch(e){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},l),error:e}),e}}throw e}}async#ut(e){const{value:t}=await(0,c.resolveProperties)({network:this.getNetwork(),value:e});return t}async call(e){const{tx:t,blockTag:r}=await(0,c.resolveProperties)({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await this.#ut(this.#ct(t,r,e.enableCcipRead?0:-1))}async#lt(e,t,r){let n=this._getAddress(t),i=this._getBlockTag(r);return"string"==typeof n&&"string"==typeof i||([n,i]=await Promise.all([n,i])),await this.#ut(this.#at(Object.assign(e,{address:n,blockTag:i})))}async getBalance(e,t){return(0,c.getBigInt)(await this.#lt({method:"getBalance"},e,t),"%response")}async getTransactionCount(e,t){return(0,c.getNumber)(await this.#lt({method:"getTransactionCount"},e,t),"%response")}async getCode(e,t){return(0,c.hexlify)(await this.#lt({method:"getCode"},e,t))}async getStorage(e,t,r){const n=(0,c.getBigInt)(t,"position");return(0,c.hexlify)(await this.#lt({method:"getStorage",position:n},e,r))}async broadcastTransaction(e){const{blockNumber:t,hash:r,network:n}=await(0,c.resolveProperties)({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),i=o.Transaction.from(e);if(i.hash!==r)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(i,n).replaceableTransaction(t)}async#ot(e,t){if((0,c.isHexString)(e,32))return await this.#at({method:"getBlock",blockHash:e,includeTransactions:t});let r=this._getBlockTag(e);return"string"!=typeof r&&(r=await r),await this.#at({method:"getBlock",blockTag:r,includeTransactions:t})}async getBlock(e,t){const{network:r,params:n}=await(0,c.resolveProperties)({network:this.getNetwork(),params:this.#ot(e,!!t)});return null==n?null:this._wrapBlock(n,r)}async getTransaction(e){const{network:t,params:r}=await(0,c.resolveProperties)({network:this.getNetwork(),params:this.#at({method:"getTransaction",hash:e})});return null==r?null:this._wrapTransactionResponse(r,t)}async getTransactionReceipt(e){const{network:t,params:r}=await(0,c.resolveProperties)({network:this.getNetwork(),params:this.#at({method:"getTransactionReceipt",hash:e})});if(null==r)return null;if(null==r.gasPrice&&null==r.effectiveGasPrice){const t=await this.#at({method:"getTransaction",hash:e});if(null==t)throw new Error("report this; could not find tx or effectiveGasPrice");r.effectiveGasPrice=t.gasPrice}return this._wrapTransactionReceipt(r,t)}async getTransactionResult(e){const{result:t}=await(0,c.resolveProperties)({network:this.getNetwork(),result:this.#at({method:"getTransactionResult",hash:e})});return null==t?null:(0,c.hexlify)(t)}async getLogs(e){let t=this._getFilter(e);g(t)&&(t=await t);const{network:r,params:n}=await(0,c.resolveProperties)({network:this.getNetwork(),params:this.#at({method:"getLogs",filter:t})});return n.map(e=>this._wrapLog(e,r))}_getProvider(e){(0,c.assert)(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await u.EnsResolver.fromName(this,e)}async getAvatar(e){const t=await this.getResolver(e);return t?await t.getAvatar():null}async resolveName(e){const t=await this.getResolver(e);return t?await t.getAddress():null}async lookupAddress(e){e=(0,n.getAddress)(e);const t=(0,a.namehash)(e.substring(2).toLowerCase()+".addr.reverse");try{const r=await u.EnsResolver.getEnsAddress(this),n=new s.Contract(r,["function resolver(bytes32) view returns (address)"],this),a=await n.resolver(t);if(null==a||a===i.ZeroAddress)return null;const o=new s.Contract(a,["function name(bytes32) view returns (string)"],this),c=await o.name(t);return await this.resolveName(c)!==e?null:c}catch(e){if((0,c.isError)(e,"BAD_DATA")&&"0x"===e.value)return null;if((0,c.isError)(e,"CALL_EXCEPTION"))return null;throw e}}async waitForTransaction(e,t,r){const n=null!=t?t:1;return 0===n?this.getTransactionReceipt(e):new Promise(async(t,i)=>{let s=null;const a=async r=>{try{const i=await this.getTransactionReceipt(e);if(null!=i&&r-i.blockNumber+1>=n)return t(i),void(s&&(clearTimeout(s),s=null))}catch(e){console.log("EEE",e)}this.once("block",a)};null!=r&&(s=setTimeout(()=>{null!=s&&(s=null,this.off("block",a),i((0,c.makeError)("timeout","TIMEOUT",{reason:"timeout"})))},r)),a(await this.getBlockNumber())})}async waitForBlock(e){(0,c.assert)(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const t=this.#it.get(e);t&&(t.timer&&clearTimeout(t.timer),this.#it.delete(e))}_setTimeout(e,t){null==t&&(t=0);const r=this.#nt++,n=()=>{this.#it.delete(r),e()};if(this.paused)this.#it.set(r,{timer:null,func:n,time:t});else{const e=setTimeout(n,t);this.#it.set(r,{timer:e,func:n,time:v()})}return r}_forEachSubscriber(e){for(const t of this.#_e.values())e(t.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new m(e.type);case"block":{const e=new f.PollingBlockSubscriber(this);return e.pollingInterval=this.pollingInterval,e}case"safe":case"finalized":return new f.PollingBlockTagSubscriber(this,e.type);case"event":return new f.PollingEventSubscriber(this,e.filter);case"transaction":return new f.PollingTransactionSubscriber(this,e.hash);case"orphan":return new f.PollingOrphanSubscriber(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,t){for(const r of this.#_e.values())if(r.subscriber===e){r.started&&r.subscriber.stop(),r.subscriber=t,r.started&&t.start(),null!=this.#Ze&&t.pause(this.#Ze);break}}async#ht(e,t){let r=await w(e,this);return"event"===r.type&&t&&t.length>0&&!0===t[0].removed&&(r=await w({orphan:"drop-log",log:t[0]},this)),this.#_e.get(r.tag)||null}async#dt(e){const t=await w(e,this),r=t.tag;let n=this.#_e.get(r);if(!n){n={subscriber:this._getSubscriber(t),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},this.#_e.set(r,n)}return n}async on(e,t){const r=await this.#dt(e);return r.listeners.push({listener:t,once:!1}),r.started||(r.subscriber.start(),r.started=!0,null!=this.#Ze&&r.subscriber.pause(this.#Ze)),this}async once(e,t){const r=await this.#dt(e);return r.listeners.push({listener:t,once:!0}),r.started||(r.subscriber.start(),r.started=!0,null!=this.#Ze&&r.subscriber.pause(this.#Ze)),this}async emit(e,...t){const r=await this.#ht(e,t);if(!r||0===r.listeners.length)return!1;const n=r.listeners.length;return r.listeners=r.listeners.filter(({listener:r,once:n})=>{const i=new c.EventPayload(this,n?null:r,e);try{r.call(this,...t,i)}catch(e){}return!n}),0===r.listeners.length&&(r.started&&r.subscriber.stop(),this.#_e.delete(r.tag)),n>0}async listenerCount(e){if(e){const t=await this.#ht(e);return t?t.listeners.length:0}let t=0;for(const{listeners:e}of this.#_e.values())t+=e.length;return t}async listeners(e){if(e){const t=await this.#ht(e);return t?t.listeners.map(({listener:e})=>e):[]}let t=[];for(const{listeners:e}of this.#_e.values())t=t.concat(e.map(({listener:e})=>e));return t}async off(e,t){const r=await this.#ht(e);if(!r)return this;if(t){const e=r.listeners.map(({listener:e})=>e).indexOf(t);e>=0&&r.listeners.splice(e,1)}return t&&0!==r.listeners.length||(r.started&&r.subscriber.stop(),this.#_e.delete(r.tag)),this}async removeAllListeners(e){if(e){const{tag:t,started:r,subscriber:n}=await this.#dt(e);r&&n.stop(),this.#_e.delete(t)}else for(const[e,{started:t,subscriber:r}]of this.#_e)t&&r.stop(),this.#_e.delete(e);return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return this.off(e,t)}get destroyed(){return this.#Xe}destroy(){this.removeAllListeners();for(const e of this.#it.keys())this._clearTimeout(e);this.#Xe=!0}get paused(){return null!=this.#Ze}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(this.#rt=-1,null!=this.#Ze){if(this.#Ze==!!e)return;(0,c.assert)(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(t=>t.pause(e)),this.#Ze=!!e;for(const e of this.#it.values())e.timer&&clearTimeout(e.timer),e.time=v()-e.time}resume(){if(null!=this.#Ze){this._forEachSubscriber(e=>e.resume()),this.#Ze=null;for(const e of this.#it.values()){let t=e.time;t<0&&(t=0),e.time=v(),setTimeout(e.func,t)}}}};const k=new Uint8Array([]);function T(e){const t=[];let r=0;for(let n=0;n<e.length;n++)t.push(k),r+=32;for(let n=0;n<e.length;n++){const i=(0,c.getBytes)(e[n]);t[n]=B(r),t.push(B(i.length)),t.push(S(i)),r+=32+32*Math.ceil(i.length/32)}return(0,c.concat)(t)}const I="0x0000000000000000000000000000000000000000000000000000000000000000"},3654:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;const n=r(4610);t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength);function i(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);if(t.rotr=(e,t)=>e<<32-t|e>>>t,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.isLE)throw new Error("Non little-endian hardware is not supported");const s=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));t.bytesToHex=function(e){if(!i(e))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=s[e[r]];return t};const a=48,o=57,c=65,u=70,l=97,h=102;function d(e){return e>=a&&e<=o?e-a:e>=c&&e<=u?e-(c-10):e>=l&&e<=h?e-(l-10):void 0}t.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){const r=d(e.charCodeAt(i)),s=d(e.charCodeAt(i+1));if(void 0===r||void 0===s){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+i)}n[t]=16*r+s}return n};function f(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function p(e){if("string"==typeof e&&(e=f(e)),!i(e))throw new Error("expected Uint8Array, got "+typeof e);return e}t.nextTick=async()=>{},t.asyncLoop=async function(e,r,n){let i=Date.now();for(let s=0;s<e;s++){n(s);const e=Date.now()-i;e>=0&&e<r||(await(0,t.nextTick)(),i+=e)}},t.utf8ToBytes=f,t.toBytes=p,t.concatBytes=function(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];if(!i(n))throw new Error("Uint8Array expected");t+=n.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r};t.Hash=class{clone(){return this._cloneInto()}};const g={}.toString;t.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!==g.call(t))throw new Error("Options should be object or undefined");return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(p(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(p(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.wrapXOFConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(p(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},3739:(e,t,r)=>{var n=r(4643);function i(e,t){n.cipher.registerAlgorithm(e,function(){return new n.aes.Algorithm(e,t)})}r(1457),r(597),r(8550),e.exports=n.aes=n.aes||{},n.aes.startEncrypting=function(e,t,r,n){var i=g({key:e,output:r,decrypt:!1,mode:n});return i.start(t),i},n.aes.createEncryptionCipher=function(e,t){return g({key:e,output:null,decrypt:!1,mode:t})},n.aes.startDecrypting=function(e,t,r,n){var i=g({key:e,output:r,decrypt:!0,mode:n});return i.start(t),i},n.aes.createDecryptionCipher=function(e,t){return g({key:e,output:null,decrypt:!0,mode:t})},n.aes.Algorithm=function(e,t){l||d();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return p(r._w,e,t,!1)},decrypt:function(e,t){return p(r._w,e,t,!0)}}}),r._init=!1},n.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t,r=e.key;if("string"!=typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(n.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){t=r,r=n.util.createBuffer();for(var i=0;i<t.length;++i)r.putByte(t[i])}}else r=n.util.createBuffer(r);if(!n.util.isArray(r)){t=r,r=[];var s=t.length();if(16===s||24===s||32===s){s>>>=2;for(i=0;i<s;++i)r.push(t.getInt32())}}if(!n.util.isArray(r)||4!==r.length&&6!==r.length&&8!==r.length)throw new Error("Invalid key parameter.");var a=this.mode.name,o=-1!==["CFB","OFB","CTR","GCM"].indexOf(a);this._w=f(r,e.decrypt&&!o),this._init=!0}},n.aes._expandKey=function(e,t){return l||d(),f(e,t)},n.aes._updateBlock=p,i("AES-ECB",n.cipher.modes.ecb),i("AES-CBC",n.cipher.modes.cbc),i("AES-CFB",n.cipher.modes.cfb),i("AES-OFB",n.cipher.modes.ofb),i("AES-CTR",n.cipher.modes.ctr),i("AES-GCM",n.cipher.modes.gcm);var s,a,o,c,u,l=!1,h=4;function d(){l=!0,o=[0,1,2,4,8,16,32,64,128,27,54];for(var e=new Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;s=new Array(256),a=new Array(256),c=new Array(4),u=new Array(4);for(t=0;t<4;++t)c[t]=new Array(256),u[t]=new Array(256);var r,n,i,h,d,f,p,g=0,y=0;for(t=0;t<256;++t){h=(h=y^y<<1^y<<2^y<<3^y<<4)>>8^255&h^99,s[g]=h,a[h]=g,f=(d=e[h])<<24^h<<16^h<<8^h^d,p=((r=e[g])^(n=e[r])^(i=e[n]))<<24^(g^i)<<16^(g^n^i)<<8^g^r^i;for(var m=0;m<4;++m)c[m][g]=f,u[m][h]=p,f=f<<24|f>>>8,p=p<<24|p>>>8;0===g?g=y=1:(g=r^e[e[e[r^i]]],y^=e[e[y]])}}function f(e,t){for(var r,n=e.slice(0),i=1,a=n.length,c=h*(a+6+1),l=a;l<c;++l)r=n[l-1],l%a===0?(r=s[r>>>16&255]<<24^s[r>>>8&255]<<16^s[255&r]<<8^s[r>>>24]^o[i]<<24,i++):a>6&&l%a===4&&(r=s[r>>>24]<<24^s[r>>>16&255]<<16^s[r>>>8&255]<<8^s[255&r]),n[l]=n[l-a]^r;if(t){for(var d,f=u[0],p=u[1],g=u[2],y=u[3],m=n.slice(0),b=(l=0,(c=n.length)-h);l<c;l+=h,b-=h)if(0===l||l===c-h)m[l]=n[b],m[l+1]=n[b+3],m[l+2]=n[b+2],m[l+3]=n[b+1];else for(var w=0;w<h;++w)d=n[b+w],m[l+(3&-w)]=f[s[d>>>24]]^p[s[d>>>16&255]]^g[s[d>>>8&255]]^y[s[255&d]];n=m}return n}function p(e,t,r,n){var i,o,l,h,d,f,p,g,y,m,b,w,v=e.length/4-1;n?(i=u[0],o=u[1],l=u[2],h=u[3],d=a):(i=c[0],o=c[1],l=c[2],h=c[3],d=s),f=t[0]^e[0],p=t[n?3:1]^e[1],g=t[2]^e[2],y=t[n?1:3]^e[3];for(var A=3,E=1;E<v;++E)m=i[f>>>24]^o[p>>>16&255]^l[g>>>8&255]^h[255&y]^e[++A],b=i[p>>>24]^o[g>>>16&255]^l[y>>>8&255]^h[255&f]^e[++A],w=i[g>>>24]^o[y>>>16&255]^l[f>>>8&255]^h[255&p]^e[++A],y=i[y>>>24]^o[f>>>16&255]^l[p>>>8&255]^h[255&g]^e[++A],f=m,p=b,g=w;r[0]=d[f>>>24]<<24^d[p>>>16&255]<<16^d[g>>>8&255]<<8^d[255&y]^e[++A],r[n?3:1]=d[p>>>24]<<24^d[g>>>16&255]<<16^d[y>>>8&255]<<8^d[255&f]^e[++A],r[2]=d[g>>>24]<<24^d[y>>>16&255]<<16^d[f>>>8&255]<<8^d[255&p]^e[++A],r[n?1:3]=d[y>>>24]<<24^d[f>>>16&255]<<16^d[p>>>8&255]<<8^d[255&g]^e[++A]}function g(e){var t,r="AES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var s=null;r instanceof n.util.ByteBuffer&&(s=r,r={}),(r=r||{}).output=s,r.iv=e,i.call(t,r)},t}},3743:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeBytes32String=t.encodeBytes32String=void 0;const n=r(8718);t.encodeBytes32String=function(e){const t=(0,n.toUtf8Bytes)(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return(0,n.zeroPadBytes)(t,32)},t.decodeBytes32String=function(e){const t=(0,n.getBytes)(e,"bytes");if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;0===t[r-1];)r--;return(0,n.toUtf8String)(t.slice(0,r))}},3758:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wordlists=t.WordlistOwlA=t.WordlistOwl=t.LangEn=t.Wordlist=void 0;var n=r(5088);Object.defineProperty(t,"Wordlist",{enumerable:!0,get:function(){return n.Wordlist}});var i=r(3318);Object.defineProperty(t,"LangEn",{enumerable:!0,get:function(){return i.LangEn}});var s=r(6795);Object.defineProperty(t,"WordlistOwl",{enumerable:!0,get:function(){return s.WordlistOwl}});var a=r(6532);Object.defineProperty(t,"WordlistOwlA",{enumerable:!0,get:function(){return a.WordlistOwlA}});var o=r(8782);Object.defineProperty(t,"wordlists",{enumerable:!0,get:function(){return o.wordlists}})},3875:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeRlp=void 0;const n=r(5020),i=r(355),s=r(5020);function a(e){let t=e.toString(16);for(;t.length<2;)t="0"+t;return"0x"+t}function o(e,t,r){let n=0;for(let i=0;i<r;i++)n=256*n+e[t+i];return n}function c(e,t,r,n){const s=[];for(;r<t+1+n;){const a=u(e,r);s.push(a.result),r+=a.consumed,(0,i.assert)(r<=t+1+n,"child data too short","BUFFER_OVERRUN",{buffer:e,length:n,offset:t})}return{consumed:1+n,result:s}}function u(e,t){(0,i.assert)(0!==e.length,"data too short","BUFFER_OVERRUN",{buffer:e,length:0,offset:1});const r=t=>{(0,i.assert)(t<=e.length,"data short segment too short","BUFFER_OVERRUN",{buffer:e,length:e.length,offset:t})};if(e[t]>=248){const n=e[t]-247;r(t+1+n);const i=o(e,t+1,n);return r(t+1+n+i),c(e,t,t+1+n,n+i)}if(e[t]>=192){const n=e[t]-192;return r(t+1+n),c(e,t,t+1,n)}if(e[t]>=184){const i=e[t]-183;r(t+1+i);const s=o(e,t+1,i);r(t+1+i+s);return{consumed:1+i+s,result:(0,n.hexlify)(e.slice(t+1+i,t+1+i+s))}}if(e[t]>=128){const i=e[t]-128;r(t+1+i);return{consumed:1+i,result:(0,n.hexlify)(e.slice(t+1,t+1+i))}}return{consumed:1,result:a(e[t])}}t.decodeRlp=function(e){const t=(0,s.getBytes)(e,"data"),r=u(t,0);return(0,i.assertArgument)(r.consumed===t.length,"unexpected junk after rlp payload","data",e),r.result}},3914:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TupleCoder=void 0;const n=r(6441),i=r(3233),s=r(1540),a=r(7505);class o extends s.Coder{coders;constructor(e,t){let r=!1;const i=[];e.forEach(e=>{e.dynamic&&(r=!0),i.push(e.type)});super("tuple","tuple("+i.join(",")+")",t,r),(0,n.defineProperties)(this,{coders:Object.freeze(e.slice())})}defaultValue(){const e=[];this.coders.forEach(t=>{e.push(t.defaultValue())});const t=this.coders.reduce((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e},{});return this.coders.forEach((r,n)=>{let i=r.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[n]))}),Object.freeze(e)}encode(e,t){const r=i.Typed.dereference(t,"tuple");return(0,a.pack)(e,this.coders,r)}decode(e){return(0,a.unpack)(e,this.coders)}}t.TupleCoder=o},3939:(e,t,r)=>{var n=r(3372).Buffer,i=r(4643);r(81),r(9679),r(8550);var s,a=i.pkcs5=i.pkcs5||{};i.util.isNodejs&&!i.options.usePureJavaScript&&(s=r(9701)),e.exports=i.pbkdf2=a.pbkdf2=function(e,t,r,a,o,c){if("function"==typeof o&&(c=o,o=null),i.util.isNodejs&&!i.options.usePureJavaScript&&s.pbkdf2&&(null===o||"object"!=typeof o)&&(s.pbkdf2Sync.length>4||!o||"sha1"===o))return"string"!=typeof o&&(o="sha1"),e=n.from(e,"binary"),t=n.from(t,"binary"),c?4===s.pbkdf2Sync.length?s.pbkdf2(e,t,r,a,function(e,t){if(e)return c(e);c(null,t.toString("binary"))}):s.pbkdf2(e,t,r,a,o,function(e,t){if(e)return c(e);c(null,t.toString("binary"))}):4===s.pbkdf2Sync.length?s.pbkdf2Sync(e,t,r,a).toString("binary"):s.pbkdf2Sync(e,t,r,a,o).toString("binary");if(null==o&&(o="sha1"),"string"==typeof o){if(!(o in i.md.algorithms))throw new Error("Unknown hash algorithm: "+o);o=i.md[o].create()}var u=o.digestLength;if(a>4294967295*u){var l=new Error("Derived key is too long.");if(c)return c(l);throw l}var h=Math.ceil(a/u),d=a-(h-1)*u,f=i.hmac.create();f.start(o,e);var p,g,y,m="";if(!c){for(var b=1;b<=h;++b){f.start(null,null),f.update(t),f.update(i.util.int32ToBytes(b)),p=y=f.digest().getBytes();for(var w=2;w<=r;++w)f.start(null,null),f.update(y),g=f.digest().getBytes(),p=i.util.xorBytes(p,g,u),y=g;m+=b<h?p:p.substr(0,d)}return m}b=1;function v(){if(b>h)return c(null,m);f.start(null,null),f.update(t),f.update(i.util.int32ToBytes(b)),p=y=f.digest().getBytes(),w=2,A()}function A(){if(w<=r)return f.start(null,null),f.update(y),g=f.digest().getBytes(),p=i.util.xorBytes(p,g,u),y=g,++w,i.util.setImmediate(A);m+=b<h?p:p.substr(0,d),++b,v()}v()}},3959:function(e,t,r){"use strict";var n,i,s,a=this&&this.__classPrivateFieldSet||function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r},o=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.CTR=void 0;const c=r(1749);class u extends c.ModeOfOperation{constructor(e,t){super("CTR",e,u),n.set(this,void 0),i.set(this,void 0),s.set(this,void 0),a(this,s,new Uint8Array(16),"f"),o(this,s,"f").fill(0),a(this,n,o(this,s,"f"),"f"),a(this,i,16,"f"),null==t&&(t=1),"number"==typeof t?this.setCounterValue(t):this.setCounterBytes(t)}get counter(){return new Uint8Array(o(this,s,"f"))}setCounterValue(e){if(!Number.isInteger(e)||e<0||e>Number.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let t=15;t>=0;--t)o(this,s,"f")[t]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(16!==e.length)throw new TypeError("invalid counter initial Uint8Array value length");o(this,s,"f").set(e)}increment(){for(let e=15;e>=0;e--){if(255!==o(this,s,"f")[e]){o(this,s,"f")[e]++;break}o(this,s,"f")[e]=0}}encrypt(e){var t,r;const c=new Uint8Array(e);for(let e=0;e<c.length;e++)16===o(this,i,"f")&&(a(this,n,this.aes.encrypt(o(this,s,"f")),"f"),a(this,i,0,"f"),this.increment()),c[e]^=o(this,n,"f")[(a(this,i,(r=o(this,i,"f"),t=r++,r),"f"),t)];return c}decrypt(e){return this.encrypt(e)}}t.CTR=u,n=new WeakMap,i=new WeakMap,s=new WeakMap},3994:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8151),t),i(r(9607),t)},4040:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Wallet=t.Mnemonic=t.encryptKeystoreJsonSync=t.encryptKeystoreJson=t.decryptKeystoreJson=t.decryptKeystoreJsonSync=t.isKeystoreJson=t.decryptCrowdsaleJson=t.isCrowdsaleJson=t.HDNodeVoidWallet=t.HDNodeWallet=t.getIndexedAccountPath=t.getAccountPath=t.defaultPath=t.BaseWallet=void 0;var n=r(8757);Object.defineProperty(t,"BaseWallet",{enumerable:!0,get:function(){return n.BaseWallet}});var i=r(2527);Object.defineProperty(t,"defaultPath",{enumerable:!0,get:function(){return i.defaultPath}}),Object.defineProperty(t,"getAccountPath",{enumerable:!0,get:function(){return i.getAccountPath}}),Object.defineProperty(t,"getIndexedAccountPath",{enumerable:!0,get:function(){return i.getIndexedAccountPath}}),Object.defineProperty(t,"HDNodeWallet",{enumerable:!0,get:function(){return i.HDNodeWallet}}),Object.defineProperty(t,"HDNodeVoidWallet",{enumerable:!0,get:function(){return i.HDNodeVoidWallet}});var s=r(9507);Object.defineProperty(t,"isCrowdsaleJson",{enumerable:!0,get:function(){return s.isCrowdsaleJson}}),Object.defineProperty(t,"decryptCrowdsaleJson",{enumerable:!0,get:function(){return s.decryptCrowdsaleJson}});var a=r(2325);Object.defineProperty(t,"isKeystoreJson",{enumerable:!0,get:function(){return a.isKeystoreJson}}),Object.defineProperty(t,"decryptKeystoreJsonSync",{enumerable:!0,get:function(){return a.decryptKeystoreJsonSync}}),Object.defineProperty(t,"decryptKeystoreJson",{enumerable:!0,get:function(){return a.decryptKeystoreJson}}),Object.defineProperty(t,"encryptKeystoreJson",{enumerable:!0,get:function(){return a.encryptKeystoreJson}}),Object.defineProperty(t,"encryptKeystoreJsonSync",{enumerable:!0,get:function(){return a.encryptKeystoreJsonSync}});var o=r(18);Object.defineProperty(t,"Mnemonic",{enumerable:!0,get:function(){return o.Mnemonic}});var c=r(9027);Object.defineProperty(t,"Wallet",{enumerable:!0,get:function(){return c.Wallet}})},4056:(e,t,r)=>{var n=r(4643);r(3739),r(7835),r(2684),r(4467),r(5206),r(4793),r(5417),r(8550),r(846);var i=n.asn1,s=e.exports=n.pkcs7=n.pkcs7||{};function a(e){var t={},r=[];if(!i.validate(e,s.asn1.recipientInfoValidator,t,r)){var a=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw a.errors=r,a}return{version:t.version.charCodeAt(0),issuer:n.pki.RDNAttributesAsArray(t.issuer),serialNumber:n.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:i.derToOid(t.encAlgorithm),parameter:t.encParameter?t.encParameter.value:void 0,content:t.encKey}}}function o(e){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[n.pki.distinguishedNameToAsn1({attributes:e.issuer}),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(e.serialNumber))]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.encryptedContent.algorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.encryptedContent.content)])}function c(e){for(var t=[],r=0;r<e.length;++r)t.push(o(e[r]));return t}function u(e){var t=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[n.pki.distinguishedNameToAsn1({attributes:e.issuer}),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(e.serialNumber))]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.digestAlgorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureAlgorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var r=i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[]),s=0;s<e.unauthenticatedAttributes.length;++s){var a=e.unauthenticatedAttributes[s];r.values.push(l(a))}t.value.push(r)}return t}function l(e){var t;if(e.type===n.pki.oids.contentType)t=i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.value).getBytes());else if(e.type===n.pki.oids.messageDigest)t=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===n.pki.oids.signingTime){var r=new Date("1950-01-01T00:00:00Z"),s=new Date("2050-01-01T00:00:00Z"),a=e.value;if("string"==typeof a){var o=Date.parse(a);a=isNaN(o)?13===a.length?i.utcTimeToDate(a):i.generalizedTimeToDate(a):new Date(o)}t=a>=r&&a<s?i.create(i.Class.UNIVERSAL,i.Type.UTCTIME,!1,i.dateToUtcTime(a)):i.create(i.Class.UNIVERSAL,i.Type.GENERALIZEDTIME,!1,i.dateToGeneralizedTime(a))}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[t])])}function h(e,t,r){var s={};if(!i.validate(t,r,s,[])){var a=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw a.errors=a,a}if(i.derToOid(s.contentType)!==n.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(s.encryptedContent){var o="";if(n.util.isArray(s.encryptedContent))for(var c=0;c<s.encryptedContent.length;++c){if(s.encryptedContent[c].type!==i.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");o+=s.encryptedContent[c].value}else o=s.encryptedContent;e.encryptedContent={algorithm:i.derToOid(s.encAlgorithm),parameter:n.util.createBuffer(s.encParameter.value),content:n.util.createBuffer(o)}}if(s.content){o="";if(n.util.isArray(s.content))for(c=0;c<s.content.length;++c){if(s.content[c].type!==i.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");o+=s.content[c].value}else o=s.content;e.content=n.util.createBuffer(o)}return e.version=s.version.charCodeAt(0),e.rawCapture=s,s}function d(e){if(void 0===e.encryptedContent.key)throw new Error("Symmetric key not available.");if(void 0===e.content){var t;switch(e.encryptedContent.algorithm){case n.pki.oids["aes128-CBC"]:case n.pki.oids["aes192-CBC"]:case n.pki.oids["aes256-CBC"]:t=n.aes.createDecryptionCipher(e.encryptedContent.key);break;case n.pki.oids.desCBC:case n.pki.oids["des-EDE3-CBC"]:t=n.des.createDecryptionCipher(e.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+e.encryptedContent.algorithm)}if(t.start(e.encryptedContent.parameter),t.update(e.encryptedContent.content),!t.finish())throw new Error("Symmetric decryption failed.");e.content=t.output}}s.messageFromPem=function(e){var t=n.pem.decode(e)[0];if("PKCS7"!==t.type){var r=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var a=i.fromDer(t.body);return s.messageFromAsn1(a)},s.messageToPem=function(e,t){var r={type:"PKCS7",body:i.toDer(e.toAsn1()).getBytes()};return n.pem.encode(r,{maxline:t})},s.messageFromAsn1=function(e){var t={},r=[];if(!i.validate(e,s.asn1.contentInfoValidator,t,r)){var a=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw a.errors=r,a}var o,c=i.derToOid(t.contentType);switch(c){case n.pki.oids.envelopedData:o=s.createEnvelopedData();break;case n.pki.oids.encryptedData:o=s.createEncryptedData();break;case n.pki.oids.signedData:o=s.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+c+" is not (yet) supported.")}return o.fromAsn1(t.content.value[0]),o},s.createSignedData=function(){var e=null;return e={type:n.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(t){if(h(e,t,s.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var r=e.rawCapture.certificates.value,i=0;i<r.length;++i)e.certificates.push(n.pki.certificateFromAsn1(r[i]))},toAsn1:function(){e.contentInfo||e.sign();for(var t=[],r=0;r<e.certificates.length;++r)t.push(n.pki.certificateToAsn1(e.certificates[r]));var s=[],a=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return t.length>0&&a.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,t)),s.length>0&&a.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,s)),a.value[0].value.push(i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.signerInfos)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),a])},addSigner:function(t){var r=t.issuer,i=t.serialNumber;if(t.certificate){var s=t.certificate;"string"==typeof s&&(s=n.pki.certificateFromPem(s)),r=s.issuer.attributes,i=s.serialNumber}var a=t.key;if(!a)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof a&&(a=n.pki.privateKeyFromPem(a));var o=t.digestAlgorithm||n.pki.oids.sha1;switch(o){case n.pki.oids.sha1:case n.pki.oids.sha256:case n.pki.oids.sha384:case n.pki.oids.sha512:case n.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+o)}var c=t.authenticatedAttributes||[];if(c.length>0){for(var u=!1,l=!1,h=0;h<c.length;++h){var d=c[h];if(u||d.type!==n.pki.oids.contentType){if(l||d.type!==n.pki.oids.messageDigest);else if(l=!0,u)break}else if(u=!0,l)break}if(!u||!l)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}e.signers.push({key:a,version:1,issuer:r,serialNumber:i,digestAlgorithm:o,signatureAlgorithm:n.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:c,unauthenticatedAttributes:[]})},sign:function(t){var r;(t=t||{},"object"!=typeof e.content||null===e.contentInfo)&&(e.contentInfo=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.pki.oids.data).getBytes())]),"content"in e&&(e.content instanceof n.util.ByteBuffer?r=e.content.bytes():"string"==typeof e.content&&(r=n.util.encodeUtf8(e.content)),t.detached?e.detachedContent=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r):e.contentInfo.value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r)]))));0!==e.signers.length&&function(t){var r;r=e.detachedContent?e.detachedContent:(r=e.contentInfo.value[1]).value[0];if(!r)throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var s=i.derToOid(e.contentInfo.value[0].value),a=i.toDer(r);for(var o in a.getByte(),i.getBerValueLength(a),a=a.getBytes(),t)t[o].start().update(a);for(var c=new Date,h=0;h<e.signers.length;++h){var d=e.signers[h];if(0===d.authenticatedAttributes.length){if(s!==n.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{d.authenticatedAttributesAsn1=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var f=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[]),p=0;p<d.authenticatedAttributes.length;++p){var g=d.authenticatedAttributes[p];g.type===n.pki.oids.messageDigest?g.value=t[d.digestAlgorithm].digest():g.type===n.pki.oids.signingTime&&(g.value||(g.value=c)),f.value.push(l(g)),d.authenticatedAttributesAsn1.value.push(l(g))}a=i.toDer(f).getBytes(),d.md.start().update(a)}d.signature=d.key.sign(d.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=function(e){for(var t=[],r=0;r<e.length;++r)t.push(u(e[r]));return t}(e.signers)}(function(){for(var t={},r=0;r<e.signers.length;++r){var s=e.signers[r];(a=s.digestAlgorithm)in t||(t[a]=n.md[n.pki.oids[a]].create()),0===s.authenticatedAttributes.length?s.md=t[a]:s.md=n.md[n.pki.oids[a]].create()}for(var a in e.digestAlgorithmIdentifiers=[],t)e.digestAlgorithmIdentifiers.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]));return t}())},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(t){"string"==typeof t&&(t=n.pki.certificateFromPem(t)),e.certificates.push(t)},addCertificateRevokationList:function(e){throw new Error("PKCS#7 CRL support not yet implemented.")}}},s.createEncryptedData=function(){var e=null;return e={type:n.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:n.pki.oids["aes256-CBC"]},fromAsn1:function(t){h(e,t,s.asn1.encryptedDataValidator)},decrypt:function(t){void 0!==t&&(e.encryptedContent.key=t),d(e)}}},s.createEnvelopedData=function(){var e=null;return e={type:n.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:n.pki.oids["aes256-CBC"]},fromAsn1:function(t){var r=h(e,t,s.asn1.envelopedDataValidator);e.recipients=function(e){for(var t=[],r=0;r<e.length;++r)t.push(a(e[r]));return t}(r.recipientInfos.value)},toAsn1:function(){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,c(e.recipients)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,(t=e.encryptedContent,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.pki.oids.data).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.algorithm).getBytes()),t.parameter?i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.parameter.getBytes()):void 0]),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.content.getBytes())])]))])])]);var t},findRecipient:function(t){for(var r=t.issuer.attributes,n=0;n<e.recipients.length;++n){var i=e.recipients[n],s=i.issuer;if(i.serialNumber===t.serialNumber&&s.length===r.length){for(var a=!0,o=0;o<r.length;++o)if(s[o].type!==r[o].type||s[o].value!==r[o].value){a=!1;break}if(a)return i}}return null},decrypt:function(t,r){if(void 0===e.encryptedContent.key&&void 0!==t&&void 0!==r)switch(t.encryptedContent.algorithm){case n.pki.oids.rsaEncryption:case n.pki.oids.desCBC:var i=r.decrypt(t.encryptedContent.content);e.encryptedContent.key=n.util.createBuffer(i);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}d(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:n.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,r){if(void 0===e.encryptedContent.content){var i,s,a;switch(r=r||e.encryptedContent.algorithm,t=t||e.encryptedContent.key,r){case n.pki.oids["aes128-CBC"]:i=16,s=16,a=n.aes.createEncryptionCipher;break;case n.pki.oids["aes192-CBC"]:i=24,s=16,a=n.aes.createEncryptionCipher;break;case n.pki.oids["aes256-CBC"]:i=32,s=16,a=n.aes.createEncryptionCipher;break;case n.pki.oids["des-EDE3-CBC"]:i=24,s=8,a=n.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+r)}if(void 0===t)t=n.util.createBuffer(n.random.getBytes(i));else if(t.length()!=i)throw new Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+i+".");e.encryptedContent.algorithm=r,e.encryptedContent.key=t,e.encryptedContent.parameter=n.util.createBuffer(n.random.getBytes(s));var o=a(t);if(o.start(e.encryptedContent.parameter.copy()),o.update(e.content),!o.finish())throw new Error("Symmetric encryption failed.");e.encryptedContent.content=o.output}for(var c=0;c<e.recipients.length;++c){var u=e.recipients[c];if(void 0===u.encryptedContent.content){if(u.encryptedContent.algorithm!==n.pki.oids.rsaEncryption)throw new Error("Unsupported asymmetric cipher, OID "+u.encryptedContent.algorithm);u.encryptedContent.content=u.encryptedContent.key.encrypt(e.encryptedContent.key.data)}}}}}},4098:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatTransactionResponse=t.formatTransactionReceipt=t.formatReceiptLog=t.formatBlock=t.formatLog=t.formatUint256=t.formatHash=t.formatData=t.formatBoolean=t.object=t.arrayOf=t.allowNull=void 0;const n=r(6107),i=r(6468),s=r(203),a=r(8718),o=BigInt(0);function c(e,t){return function(r){return null==r?t:e(r)}}function u(e,t){return r=>{if(t&&null==r)return null;if(!Array.isArray(r))throw new Error("not an array");return r.map(t=>e(t))}}function l(e,t){return r=>{const n={};for(const i in e){let s=i;if(t&&i in t&&!(s in r))for(const e of t[i])if(e in r){s=e;break}try{const t=e[i](r[s]);void 0!==t&&(n[i]=t)}catch(e){const t=e instanceof Error?e.message:"not-an-error";(0,a.assert)(!1,`invalid value for value.${i} (${t})`,"BAD_DATA",{value:r})}}return n}}function h(e){switch(e){case!0:case"true":return!0;case!1:case"false":return!1}(0,a.assertArgument)(!1,`invalid boolean; ${JSON.stringify(e)}`,"value",e)}function d(e){return(0,a.assertArgument)((0,a.isHexString)(e,!0),"invalid data","value",e),e}function f(e){return(0,a.assertArgument)((0,a.isHexString)(e,32),"invalid hash","value",e),e}t.allowNull=c,t.arrayOf=u,t.object=l,t.formatBoolean=h,t.formatData=d,t.formatHash=f,t.formatUint256=function(e){if(!(0,a.isHexString)(e))throw new Error("invalid uint256");return(0,a.zeroPadValue)(e,32)};const p=l({address:n.getAddress,blockHash:f,blockNumber:a.getNumber,data:d,index:a.getNumber,removed:c(h,!1),topics:u(f),transactionHash:f,transactionIndex:a.getNumber},{index:["logIndex"]});t.formatLog=function(e){return p(e)};const g=l({hash:c(f),parentHash:f,parentBeaconBlockRoot:c(f,null),number:a.getNumber,timestamp:a.getNumber,nonce:c(d),difficulty:a.getBigInt,gasLimit:a.getBigInt,gasUsed:a.getBigInt,stateRoot:c(f,null),receiptsRoot:c(f,null),blobGasUsed:c(a.getBigInt,null),excessBlobGas:c(a.getBigInt,null),miner:c(n.getAddress),prevRandao:c(f,null),extraData:d,baseFeePerGas:c(a.getBigInt)},{prevRandao:["mixHash"]});t.formatBlock=function(e){const t=g(e);return t.transactions=e.transactions.map(e=>"string"==typeof e?e:w(e)),t};const y=l({transactionIndex:a.getNumber,blockNumber:a.getNumber,transactionHash:f,address:n.getAddress,topics:u(f),data:d,index:a.getNumber,blockHash:f},{index:["logIndex"]});function m(e){return y(e)}t.formatReceiptLog=m;const b=l({to:c(n.getAddress,null),from:c(n.getAddress,null),contractAddress:c(n.getAddress,null),index:a.getNumber,root:c(a.hexlify),gasUsed:a.getBigInt,blobGasUsed:c(a.getBigInt,null),logsBloom:c(d),blockHash:f,hash:f,logs:u(m),blockNumber:a.getNumber,cumulativeGasUsed:a.getBigInt,effectiveGasPrice:c(a.getBigInt),blobGasPrice:c(a.getBigInt,null),status:c(a.getNumber),type:c(a.getNumber,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function w(e){e.to&&(0,a.getBigInt)(e.to)===o&&(e.to="0x0000000000000000000000000000000000000000");const t=l({hash:f,index:c(a.getNumber,void 0),type:e=>"0x"===e||null==e?0:(0,a.getNumber)(e),accessList:c(s.accessListify,null),blobVersionedHashes:c(u(f,!0),null),authorizationList:c(u(e=>{let t;if(e.signature)t=e.signature;else{let r=e.yParity;"0x1b"===r?r=0:"0x1c"===r&&(r=1),t=Object.assign({},e,{yParity:r})}return{address:(0,n.getAddress)(e.address),chainId:(0,a.getBigInt)(e.chainId),nonce:(0,a.getBigInt)(e.nonce),signature:i.Signature.from(t)}},!1),null),blockHash:c(f,null),blockNumber:c(a.getNumber,null),transactionIndex:c(a.getNumber,null),from:n.getAddress,gasPrice:c(a.getBigInt),maxPriorityFeePerGas:c(a.getBigInt),maxFeePerGas:c(a.getBigInt),maxFeePerBlobGas:c(a.getBigInt,null),gasLimit:a.getBigInt,to:c(n.getAddress,null),value:a.getBigInt,nonce:a.getNumber,data:d,creates:c(n.getAddress,null),chainId:c(a.getBigInt,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(e);if(null==t.to&&null==t.creates&&(t.creates=(0,n.getCreateAddress)(t)),1!==e.type&&2!==e.type||null!=e.accessList||(t.accessList=[]),e.signature?t.signature=i.Signature.from(e.signature):t.signature=i.Signature.from(e),null==t.chainId){const e=t.signature.legacyChainId;null!=e&&(t.chainId=e)}return t.blockHash&&(0,a.getBigInt)(t.blockHash)===o&&(t.blockHash=null),t}t.formatTransactionReceipt=function(e){return b(e)},t.formatTransactionResponse=w},4103:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getIcapAddress=t.getAddress=void 0;const n=r(6468),i=r(8718),s=BigInt(0),a=BigInt(36);function o(e){const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let e=0;e<40;e++)r[e]=t[e].charCodeAt(0);const s=(0,i.getBytes)((0,n.keccak256)(r));for(let e=0;e<40;e+=2)s[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&s[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const c={};for(let e=0;e<10;e++)c[String(e)]=String(e);for(let e=0;e<26;e++)c[String.fromCharCode(65+e)]=String(10+e);function u(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map(e=>c[e]).join("");for(;t.length>=15;){let e=t.substring(0,15);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}const l=function(){const e={};for(let t=0;t<36;t++){e["0123456789abcdefghijklmnopqrstuvwxyz"[t]]=BigInt(t)}return e}();function h(e){if((0,i.assertArgument)("string"==typeof e,"invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/)){e.startsWith("0x")||(e="0x"+e);const t=o(e);return(0,i.assertArgument)(!e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||t===e,"bad address checksum","address",e),t}if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){(0,i.assertArgument)(e.substring(2,4)===u(e),"bad icap checksum","address",e);let t=function(e){e=e.toLowerCase();let t=s;for(let r=0;r<e.length;r++)t=t*a+l[e[r]];return t}(e.substring(4)).toString(16);for(;t.length<40;)t="0"+t;return o("0x"+t)}(0,i.assertArgument)(!1,"invalid address","address",e)}t.getAddress=h,t.getIcapAddress=function(e){let t=BigInt(h(e)).toString(36).toUpperCase();for(;t.length<30;)t="0"+t;return"XE"+u("XE00"+t)+t}},4117:(e,t,r)=>{var n=r(4643);if(r(3739),r(7835),r(2684),r(9679),r(4467),r(3939),r(5206),r(5417),r(6339),r(2374),r(8550),void 0===i)var i=n.jsbn.BigInteger;var s=n.asn1,a=n.pki=n.pki||{};e.exports=a.pbe=n.pbe=n.pbe||{};var o=a.oids,c={name:"EncryptedPrivateKeyInfo",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},u={name:"PBES2Algorithms",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:s.Class.UNIVERSAL,type:s.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},l={name:"pkcs-12PbeParams",tagClass:s.Class.UNIVERSAL,type:s.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:s.Class.UNIVERSAL,type:s.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:s.Class.UNIVERSAL,type:s.Type.INTEGER,constructed:!1,capture:"iterations"}]};function h(e,t){return e.start().update(t).digest().getBytes()}function d(e){var t;if(e){if(!(t=a.oids[s.derToOid(e)])){var r=new Error("Unsupported PRF OID.");throw r.oid=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}}else t="hmacWithSHA1";return f(t)}function f(e){var t=n.md;switch(e){case"hmacWithSHA224":t=n.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var r=new Error("Unsupported PRF algorithm.");throw r.algorithm=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}a.encryptPrivateKeyInfo=function(e,t,r){(r=r||{}).saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var i,c,u,l=n.random.getBytesSync(r.saltSize),h=r.count,d=s.integerToDer(h);if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){var p,g,y;switch(r.algorithm){case"aes128":i=16,p=16,g=o["aes128-CBC"],y=n.aes.createEncryptionCipher;break;case"aes192":i=24,p=16,g=o["aes192-CBC"],y=n.aes.createEncryptionCipher;break;case"aes256":i=32,p=16,g=o["aes256-CBC"],y=n.aes.createEncryptionCipher;break;case"des":i=8,p=8,g=o.desCBC,y=n.des.createEncryptionCipher;break;default:throw(E=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,E}var m="hmacWith"+r.prfAlgorithm.toUpperCase(),b=f(m),w=n.pkcs5.pbkdf2(t,l,h,i,b),v=n.random.getBytesSync(p);(C=y(w)).start(v),C.update(s.toDer(e)),C.finish(),u=C.output.getBytes();var A=function(e,t,r,i){var o=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,e),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,t.getBytes())]);"hmacWithSHA1"!==i&&o.value.push(s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,n.util.hexToBytes(r.toString(16))),s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(a.oids[i]).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.NULL,!1,"")]));return o}(l,d,i,m);c=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(o.pkcs5PBES2).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(o.pkcs5PBKDF2).getBytes()),A]),s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(g).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,v)])])])}else{var E;if("3des"!==r.algorithm)throw(E=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,E;i=24;var C,B=new n.util.ByteBuffer(l);w=a.pbe.generatePkcs12Key(t,B,1,h,i),v=a.pbe.generatePkcs12Key(t,B,2,h,i);(C=n.des.createEncryptionCipher(w)).start(v),C.update(s.toDer(e)),C.finish(),u=C.output.getBytes(),c=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OID,!1,s.oidToDer(o["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,l),s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,d.getBytes())])])}return s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[c,s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,u)])},a.decryptPrivateKeyInfo=function(e,t){var r=null,i={},o=[];if(!s.validate(e,c,i,o)){var u=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw u.errors=o,u}var l=s.derToOid(i.encryptionOid),h=a.pbe.getCipher(l,i.encryptionParams,t),d=n.util.createBuffer(i.encryptedData);return h.update(d),h.finish()&&(r=s.fromDer(h.output)),r},a.encryptedPrivateKeyToPem=function(e,t){var r={type:"ENCRYPTED PRIVATE KEY",body:s.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})},a.encryptedPrivateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==t.type){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return s.fromDer(t.body)},a.encryptRsaPrivateKey=function(e,t,r){if(!(r=r||{}).legacy){var i=a.wrapRsaPrivateKey(a.privateKeyToAsn1(e));return i=a.encryptPrivateKeyInfo(i,t,r),a.encryptedPrivateKeyToPem(i)}var o,c,u,l;switch(r.algorithm){case"aes128":o="AES-128-CBC",u=16,c=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"aes192":o="AES-192-CBC",u=24,c=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"aes256":o="AES-256-CBC",u=32,c=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"3des":o="DES-EDE3-CBC",u=24,c=n.random.getBytesSync(8),l=n.des.createEncryptionCipher;break;case"des":o="DES-CBC",u=8,c=n.random.getBytesSync(8),l=n.des.createEncryptionCipher;break;default:var h=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw h.algorithm=r.algorithm,h}var d=l(n.pbe.opensslDeriveBytes(t,c.substr(0,8),u));d.start(c),d.update(s.toDer(a.privateKeyToAsn1(e))),d.finish();var f={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:o,parameters:n.util.bytesToHex(c).toUpperCase()},body:d.output.getBytes()};return n.pem.encode(f)},a.decryptRsaPrivateKey=function(e,t){var r=null,i=n.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==i.type&&"PRIVATE KEY"!==i.type&&"RSA PRIVATE KEY"!==i.type)throw(u=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".')).headerType=u,u;if(i.procType&&"ENCRYPTED"===i.procType.type){var o,c;switch(i.dekInfo.algorithm){case"DES-CBC":o=8,c=n.des.createDecryptionCipher;break;case"DES-EDE3-CBC":o=24,c=n.des.createDecryptionCipher;break;case"AES-128-CBC":o=16,c=n.aes.createDecryptionCipher;break;case"AES-192-CBC":o=24,c=n.aes.createDecryptionCipher;break;case"AES-256-CBC":o=32,c=n.aes.createDecryptionCipher;break;case"RC2-40-CBC":o=5,c=function(e){return n.rc2.createDecryptionCipher(e,40)};break;case"RC2-64-CBC":o=8,c=function(e){return n.rc2.createDecryptionCipher(e,64)};break;case"RC2-128-CBC":o=16,c=function(e){return n.rc2.createDecryptionCipher(e,128)};break;default:var u;throw(u=new Error('Could not decrypt private key; unsupported encryption algorithm "'+i.dekInfo.algorithm+'".')).algorithm=i.dekInfo.algorithm,u}var l=n.util.hexToBytes(i.dekInfo.parameters),h=c(n.pbe.opensslDeriveBytes(t,l.substr(0,8),o));if(h.start(l),h.update(n.util.createBuffer(i.body)),!h.finish())return r;r=h.output.getBytes()}else r=i.body;return null!==(r="ENCRYPTED PRIVATE KEY"===i.type?a.decryptPrivateKeyInfo(s.fromDer(r),t):s.fromDer(r))&&(r=a.privateKeyFromAsn1(r)),r},a.pbe.generatePkcs12Key=function(e,t,r,i,s,a){var o,c;if(null==a){if(!("sha1"in n.md))throw new Error('"sha1" hash algorithm unavailable.');a=n.md.sha1.create()}var u=a.digestLength,l=a.blockLength,h=new n.util.ByteBuffer,d=new n.util.ByteBuffer;if(null!=e){for(c=0;c<e.length;c++)d.putInt16(e.charCodeAt(c));d.putInt16(0)}var f=d.length(),p=t.length(),g=new n.util.ByteBuffer;g.fillWithByte(r,l);var y=l*Math.ceil(p/l),m=new n.util.ByteBuffer;for(c=0;c<y;c++)m.putByte(t.at(c%p));var b=l*Math.ceil(f/l),w=new n.util.ByteBuffer;for(c=0;c<b;c++)w.putByte(d.at(c%f));var v=m;v.putBuffer(w);for(var A=Math.ceil(s/u),E=1;E<=A;E++){var C=new n.util.ByteBuffer;C.putBytes(g.bytes()),C.putBytes(v.bytes());for(var B=0;B<i;B++)a.start(),a.update(C.getBytes()),C=a.digest();var S=new n.util.ByteBuffer;for(c=0;c<l;c++)S.putByte(C.at(c%u));var k=Math.ceil(p/l)+Math.ceil(f/l),T=new n.util.ByteBuffer;for(o=0;o<k;o++){var I=new n.util.ByteBuffer(v.getBytes(l)),P=511;for(c=S.length()-1;c>=0;c--)P>>=8,P+=S.at(c)+I.at(c),I.setAt(c,255&P);T.putBuffer(I)}v=T,h.putBuffer(C)}return h.truncate(h.length()-s),h},a.pbe.getCipher=function(e,t,r){switch(e){case a.oids.pkcs5PBES2:return a.pbe.getCipherForPBES2(e,t,r);case a.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case a.oids["pbewithSHAAnd40BitRC2-CBC"]:return a.pbe.getCipherForPKCS12PBE(e,t,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=e,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}},a.pbe.getCipherForPBES2=function(e,t,r){var i,o={},c=[];if(!s.validate(t,u,o,c))throw(i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=c,i;if((e=s.derToOid(o.kdfOid))!==a.oids.pkcs5PBKDF2)throw(i=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=e,i.supportedOids=["pkcs5PBKDF2"],i;if((e=s.derToOid(o.encOid))!==a.oids["aes128-CBC"]&&e!==a.oids["aes192-CBC"]&&e!==a.oids["aes256-CBC"]&&e!==a.oids["des-EDE3-CBC"]&&e!==a.oids.desCBC)throw(i=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=e,i.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],i;var l,h,f=o.kdfSalt,p=n.util.createBuffer(o.kdfIterationCount);switch(p=p.getInt(p.length()<<3),a.oids[e]){case"aes128-CBC":l=16,h=n.aes.createDecryptionCipher;break;case"aes192-CBC":l=24,h=n.aes.createDecryptionCipher;break;case"aes256-CBC":l=32,h=n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":l=24,h=n.des.createDecryptionCipher;break;case"desCBC":l=8,h=n.des.createDecryptionCipher}var g=d(o.prfOid),y=n.pkcs5.pbkdf2(r,f,p,l,g),m=o.encIv,b=h(y);return b.start(m),b},a.pbe.getCipherForPKCS12PBE=function(e,t,r){var i={},o=[];if(!s.validate(t,l,i,o))throw(g=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=o,g;var c,u,h,f=n.util.createBuffer(i.salt),p=n.util.createBuffer(i.iterations);switch(p=p.getInt(p.length()<<3),e){case a.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:c=24,u=8,h=n.des.startDecrypting;break;case a.oids["pbewithSHAAnd40BitRC2-CBC"]:c=5,u=8,h=function(e,t){var r=n.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var g;throw(g=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=e,g}var y=d(i.prfOid),m=a.pbe.generatePkcs12Key(r,f,1,p,c,y);return y.start(),h(m,a.pbe.generatePkcs12Key(r,f,2,p,u,y))},a.pbe.opensslDeriveBytes=function(e,t,r,i){if(null==i){if(!("md5"in n.md))throw new Error('"md5" hash algorithm unavailable.');i=n.md.md5.create()}null===t&&(t="");for(var s=[h(i,e+t)],a=16,o=1;a<r;++o,a+=16)s.push(h(i,s[o-1]+e+t));return s.join("").substr(0,r)}},4315:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uuidV4=void 0;const n=r(5020);t.uuidV4=function(e){const t=(0,n.getBytes)(e,"randomBytes");t[6]=15&t[6]|64,t[8]=63&t[8]|128;const r=(0,n.hexlify)(t);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}},4391:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Network=void 0;const n=r(203),i=r(8718),s=r(6918),a=new Map;class o{#ft;#z;#Ye;constructor(e,t){this.#ft=e,this.#z=(0,i.getBigInt)(t),this.#Ye=new Map}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return this.#ft}set name(e){this.#ft=e}get chainId(){return this.#z}set chainId(e){this.#z=(0,i.getBigInt)(e,"chainId")}matches(e){if(null==e)return!1;if("string"==typeof e){try{return this.chainId===(0,i.getBigInt)(e)}catch(e){}return this.name===e}if("number"==typeof e||"bigint"==typeof e){try{return this.chainId===(0,i.getBigInt)(e)}catch(e){}return!1}if("object"==typeof e){if(null!=e.chainId){try{return this.chainId===(0,i.getBigInt)(e.chainId)}catch(e){}return!1}return null!=e.name&&this.name===e.name}return!1}get plugins(){return Array.from(this.#Ye.values())}attachPlugin(e){if(this.#Ye.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#Ye.set(e.name,e.clone()),this}getPlugin(e){return this.#Ye.get(e)||null}getPlugins(e){return this.plugins.filter(t=>t.name.split("#")[0]===e)}clone(){const e=new o(this.name,this.chainId);return this.plugins.forEach(t=>{e.attachPlugin(t.clone())}),e}computeIntrinsicGas(e){const t=this.getPlugin("org.ethers.plugins.network.GasCost")||new s.GasCostPlugin;let r=t.txBase;if(null==e.to&&(r+=t.txCreate),e.data)for(let n=2;n<e.data.length;n+=2)"00"===e.data.substring(n,n+2)?r+=t.txDataZero:r+=t.txDataNonzero;if(e.accessList){const i=(0,n.accessListify)(e.accessList);for(const e in i)r+=t.txAccessListAddress+t.txAccessListStorageKey*i[e].storageKeys.length}return r}static from(e){if(function(){if(l)return;function e(e,t,r){const n=function(){const n=new o(e,t);return null!=r.ensNetwork&&n.attachPlugin(new s.EnsPlugin(null,r.ensNetwork)),n.attachPlugin(new s.GasCostPlugin),(r.plugins||[]).forEach(e=>{n.attachPlugin(e)}),n};o.register(e,n),o.register(t,n),r.altNames&&r.altNames.forEach(e=>{o.register(e,n)})}l=!0,e("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),e("ropsten",3,{ensNetwork:3}),e("rinkeby",4,{ensNetwork:4}),e("goerli",5,{ensNetwork:5}),e("kovan",42,{ensNetwork:42}),e("sepolia",11155111,{ensNetwork:11155111}),e("holesky",17e3,{ensNetwork:17e3}),e("classic",61,{}),e("classicKotti",6,{}),e("arbitrum",42161,{ensNetwork:1}),e("arbitrum-goerli",421613,{}),e("arbitrum-sepolia",421614,{}),e("base",8453,{ensNetwork:1}),e("base-goerli",84531,{}),e("base-sepolia",84532,{}),e("bnb",56,{ensNetwork:1}),e("bnbt",97,{}),e("linea",59144,{ensNetwork:1}),e("linea-goerli",59140,{}),e("linea-sepolia",59141,{}),e("matic",137,{ensNetwork:1,plugins:[u("https://gasstation.polygon.technology/v2")]}),e("matic-amoy",80002,{}),e("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[u("https://gasstation-testnet.polygon.technology/v2")]}),e("optimism",10,{ensNetwork:1,plugins:[]}),e("optimism-goerli",420,{}),e("optimism-sepolia",11155420,{}),e("xdai",100,{ensNetwork:1})}(),null==e)return o.from("mainnet");if("number"==typeof e&&(e=BigInt(e)),"string"==typeof e||"bigint"==typeof e){const t=a.get(e);if(t)return t();if("bigint"==typeof e)return new o("unknown",e);(0,i.assertArgument)(!1,"unknown network","network",e)}if("function"==typeof e.clone){return e.clone()}if("object"==typeof e){(0,i.assertArgument)("string"==typeof e.name&&"number"==typeof e.chainId,"invalid network object name or chainId","network",e);const t=new o(e.name,e.chainId);return(e.ensAddress||null!=e.ensNetwork)&&t.attachPlugin(new s.EnsPlugin(e.ensAddress,e.ensNetwork)),t}(0,i.assertArgument)(!1,"invalid network","network",e)}static register(e,t){"number"==typeof e&&(e=BigInt(e));const r=a.get(e);r&&(0,i.assertArgument)(!1,`conflicting network for ${JSON.stringify(r.name)}`,"nameOrChainId",e),a.set(e,t)}}function c(e,t){const r=String(e);if(!r.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${e}`);const n=r.split(".");if(1===n.length&&n.push(""),2!==n.length)throw new Error(`invalid gwei value: ${e}`);for(;n[1].length<t;)n[1]+="0";if(n[1].length>9){let e=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||e++,n[1]=e.toString()}return BigInt(n[0]+n[1])}function u(e){return new s.FetchUrlFeeDataNetworkPlugin(e,async(e,t,r)=>{let n;r.setHeader("User-Agent","ethers");try{const[t,i]=await Promise.all([r.send(),e()]);n=t;const s=n.bodyJson.standard;return{gasPrice:i.gasPrice,maxFeePerGas:c(s.maxFee,9),maxPriorityFeePerGas:c(s.maxPriorityFee,9)}}catch(e){(0,i.assert)(!1,`error encountered with polygon gas station (${JSON.stringify(r.url)})`,"SERVER_ERROR",{request:r,response:n,error:e})}})}t.Network=o;let l=!1},4412:(e,t,r)=>{var n=r(4643);r(9679),r(8550);var i=e.exports=n.md5=n.md5||{};n.md.md5=n.md.algorithms.md5=i,i.create=function(){u||function(){s=String.fromCharCode(128),s+=n.util.fillString(String.fromCharCode(0),64),a=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],o=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],c=new Array(64);for(var e=0;e<64;++e)c[e]=Math.floor(4294967296*Math.abs(Math.sin(e+1)));u=!0}();var e=null,t=n.util.createBuffer(),r=new Array(16),i={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,s=0;s<r;++s)i.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},i}};return i.start(),i.update=function(s,a){"utf8"===a&&(s=n.util.encodeUtf8(s));var o=s.length;i.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=o[1],o[1]=o[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(s),l(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var a=n.util.createBuffer();a.putBytes(t.bytes());var o=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;a.putBytes(s.substr(0,i.blockLength-o));for(var c,u=0,h=i.fullMessageLength.length-1;h>=0;--h)u=(c=8*i.fullMessageLength[h]+u)/4294967296>>>0,a.putInt32Le(c>>>0);var d={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};l(d,r,a);var f=n.util.createBuffer();return f.putInt32Le(d.h0),f.putInt32Le(d.h1),f.putInt32Le(d.h2),f.putInt32Le(d.h3),f},i};var s=null,a=null,o=null,c=null,u=!1;function l(e,t,r){for(var n,i,s,u,l,h,d,f=r.length();f>=64;){for(i=e.h0,s=e.h1,u=e.h2,l=e.h3,d=0;d<16;++d)t[d]=r.getInt32Le(),n=i+(l^s&(u^l))+c[d]+t[d],i=l,l=u,u=s,s+=n<<(h=o[d])|n>>>32-h;for(;d<32;++d)n=i+(u^l&(s^u))+c[d]+t[a[d]],i=l,l=u,u=s,s+=n<<(h=o[d])|n>>>32-h;for(;d<48;++d)n=i+(s^u^l)+c[d]+t[a[d]],i=l,l=u,u=s,s+=n<<(h=o[d])|n>>>32-h;for(;d<64;++d)n=i+(u^(s|~l))+c[d]+t[a[d]],i=l,l=u,u=s,s+=n<<(h=o[d])|n>>>32-h;e.h0=e.h0+i|0,e.h1=e.h1+s|0,e.h2=e.h2+u|0,e.h3=e.h3+l|0,f-=64}}},4423:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.recoverAddress=t.computeAddress=void 0;const n=r(6107),i=r(6468);function s(e){let t;return t="string"==typeof e?i.SigningKey.computePublicKey(e,!1):e.publicKey,(0,n.getAddress)((0,i.keccak256)("0x"+t.substring(4)).substring(26))}t.computeAddress=s,t.recoverAddress=function(e,t){return s(i.SigningKey.recoverPublicKey(e,t))}},4467:(e,t,r)=>{var n=r(4643);n.pki=n.pki||{};var i=e.exports=n.pki.oids=n.oids=n.oids||{};function s(e,t){i[e]=t,i[t]=e}function a(e,t){i[e]=t}s("1.2.840.113549.1.1.1","rsaEncryption"),s("1.2.840.113549.1.1.4","md5WithRSAEncryption"),s("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),s("1.2.840.113549.1.1.7","RSAES-OAEP"),s("1.2.840.113549.1.1.8","mgf1"),s("1.2.840.113549.1.1.9","pSpecified"),s("1.2.840.113549.1.1.10","RSASSA-PSS"),s("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),s("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),s("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),s("1.3.101.112","EdDSA25519"),s("1.2.840.10040.4.3","dsa-with-sha1"),s("1.3.14.3.2.7","desCBC"),s("1.3.14.3.2.26","sha1"),s("1.3.14.3.2.29","sha1WithRSASignature"),s("2.16.840.1.101.3.4.2.1","sha256"),s("2.16.840.1.101.3.4.2.2","sha384"),s("2.16.840.1.101.3.4.2.3","sha512"),s("2.16.840.1.101.3.4.2.4","sha224"),s("2.16.840.1.101.3.4.2.5","sha512-224"),s("2.16.840.1.101.3.4.2.6","sha512-256"),s("1.2.840.113549.2.2","md2"),s("1.2.840.113549.2.5","md5"),s("1.2.840.113549.1.7.1","data"),s("1.2.840.113549.1.7.2","signedData"),s("1.2.840.113549.1.7.3","envelopedData"),s("1.2.840.113549.1.7.4","signedAndEnvelopedData"),s("1.2.840.113549.1.7.5","digestedData"),s("1.2.840.113549.1.7.6","encryptedData"),s("1.2.840.113549.1.9.1","emailAddress"),s("1.2.840.113549.1.9.2","unstructuredName"),s("1.2.840.113549.1.9.3","contentType"),s("1.2.840.113549.1.9.4","messageDigest"),s("1.2.840.113549.1.9.5","signingTime"),s("1.2.840.113549.1.9.6","counterSignature"),s("1.2.840.113549.1.9.7","challengePassword"),s("1.2.840.113549.1.9.8","unstructuredAddress"),s("1.2.840.113549.1.9.14","extensionRequest"),s("1.2.840.113549.1.9.20","friendlyName"),s("1.2.840.113549.1.9.21","localKeyId"),s("1.2.840.113549.1.9.22.1","x509Certificate"),s("1.2.840.113549.1.12.10.1.1","keyBag"),s("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),s("1.2.840.113549.1.12.10.1.3","certBag"),s("1.2.840.113549.1.12.10.1.4","crlBag"),s("1.2.840.113549.1.12.10.1.5","secretBag"),s("1.2.840.113549.1.12.10.1.6","safeContentsBag"),s("1.2.840.113549.1.5.13","pkcs5PBES2"),s("1.2.840.113549.1.5.12","pkcs5PBKDF2"),s("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),s("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),s("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),s("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),s("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),s("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),s("1.2.840.113549.2.7","hmacWithSHA1"),s("1.2.840.113549.2.8","hmacWithSHA224"),s("1.2.840.113549.2.9","hmacWithSHA256"),s("1.2.840.113549.2.10","hmacWithSHA384"),s("1.2.840.113549.2.11","hmacWithSHA512"),s("1.2.840.113549.3.7","des-EDE3-CBC"),s("2.16.840.1.101.3.4.1.2","aes128-CBC"),s("2.16.840.1.101.3.4.1.22","aes192-CBC"),s("2.16.840.1.101.3.4.1.42","aes256-CBC"),s("2.5.4.3","commonName"),s("2.5.4.4","surname"),s("2.5.4.5","serialNumber"),s("2.5.4.6","countryName"),s("2.5.4.7","localityName"),s("2.5.4.8","stateOrProvinceName"),s("2.5.4.9","streetAddress"),s("2.5.4.10","organizationName"),s("2.5.4.11","organizationalUnitName"),s("2.5.4.12","title"),s("2.5.4.13","description"),s("2.5.4.15","businessCategory"),s("2.5.4.17","postalCode"),s("2.5.4.42","givenName"),s("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),s("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),s("2.16.840.1.113730.1.1","nsCertType"),s("2.16.840.1.113730.1.13","nsComment"),a("2.5.29.1","authorityKeyIdentifier"),a("2.5.29.2","keyAttributes"),a("2.5.29.3","certificatePolicies"),a("2.5.29.4","keyUsageRestriction"),a("2.5.29.5","policyMapping"),a("2.5.29.6","subtreesConstraint"),a("2.5.29.7","subjectAltName"),a("2.5.29.8","issuerAltName"),a("2.5.29.9","subjectDirectoryAttributes"),a("2.5.29.10","basicConstraints"),a("2.5.29.11","nameConstraints"),a("2.5.29.12","policyConstraints"),a("2.5.29.13","basicConstraints"),s("2.5.29.14","subjectKeyIdentifier"),s("2.5.29.15","keyUsage"),a("2.5.29.16","privateKeyUsagePeriod"),s("2.5.29.17","subjectAltName"),s("2.5.29.18","issuerAltName"),s("2.5.29.19","basicConstraints"),a("2.5.29.20","cRLNumber"),a("2.5.29.21","cRLReason"),a("2.5.29.22","expirationDate"),a("2.5.29.23","instructionCode"),a("2.5.29.24","invalidityDate"),a("2.5.29.25","cRLDistributionPoints"),a("2.5.29.26","issuingDistributionPoint"),a("2.5.29.27","deltaCRLIndicator"),a("2.5.29.28","issuingDistributionPoint"),a("2.5.29.29","certificateIssuer"),a("2.5.29.30","nameConstraints"),s("2.5.29.31","cRLDistributionPoints"),s("2.5.29.32","certificatePolicies"),a("2.5.29.33","policyMappings"),a("2.5.29.34","policyConstraints"),s("2.5.29.35","authorityKeyIdentifier"),a("2.5.29.36","policyConstraints"),s("2.5.29.37","extKeyUsage"),a("2.5.29.46","freshestCRL"),a("2.5.29.54","inhibitAnyPolicy"),s("1.3.6.1.4.1.11129.2.4.2","timestampList"),s("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),s("1.3.6.1.5.5.7.3.1","serverAuth"),s("1.3.6.1.5.5.7.3.2","clientAuth"),s("1.3.6.1.5.5.7.3.3","codeSigning"),s("1.3.6.1.5.5.7.3.4","emailProtection"),s("1.3.6.1.5.5.7.3.8","timeStamping")},4610:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},4643:e=>{e.exports={options:{usePureJavaScript:!1}}},4720:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddressCoder=void 0;const n=r(6107),i=r(9009),s=r(3233),a=r(1540);class o extends a.Coder{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){let r=s.Typed.dereference(t,"string");try{r=(0,n.getAddress)(r)}catch(e){return this._throwError(e.message,t)}return e.writeValue(r)}decode(e){return(0,n.getAddress)((0,i.toBeHex)(e.readValue(),20))}}t.AddressCoder=o},4753:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.spelunk=t.getPassword=t.zpad=t.looseArrayify=void 0;const n=r(8718);function i(e){return"string"!=typeof e||e.startsWith("0x")||(e="0x"+e),(0,n.getBytesCopy)(e)}t.looseArrayify=i,t.zpad=function(e,t){for(e=String(e);e.length<t;)e="0"+e;return e},t.getPassword=function(e){return"string"==typeof e?(0,n.toUtf8Bytes)(e,"NFKC"):(0,n.getBytesCopy)(e)},t.spelunk=function(e,t){const r=t.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);(0,n.assertArgument)(null!=r,"invalid path","path",t);const s=r[1],a=r[3],o="!"===r[4];let c=e;for(const e of s.toLowerCase().split(".")){if(Array.isArray(c)){if(!e.match(/^[0-9]+$/))break;c=c[parseInt(e)]}else if("object"==typeof c){let t=null;for(const r in c)if(r.toLowerCase()===e){t=c[r];break}c=t}else c=null;if(null==c)break}if((0,n.assertArgument)(!o||null!=c,"missing required value","path",s),a&&null!=c){if("int"===a){if("string"==typeof c&&c.match(/^-?[0-9]+$/))return parseInt(c);if(Number.isSafeInteger(c))return c}if("number"===a&&"string"==typeof c&&c.match(/^-?[0-9.]*$/))return parseFloat(c);if("data"===a&&"string"==typeof c)return i(c);if("array"===a&&Array.isArray(c))return c;if(a===typeof c)return c;(0,n.assertArgument)(!1,`wrong type found for ${a} `,"path",s)}return c}},4789:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeOwl=t.decode=void 0;const n=r(8718),i=" !#$%&'()*+,-./<=>?@[]^_`{|}~",s=/^[a-z]*$/i;function a(e,t){let r=97;return e.reduce((e,n)=>(n===t?r++:n.match(s)?e.push(String.fromCharCode(r)+n):(r=97,e.push(n)),e),[])}function o(e,t){for(let r=28;r>=0;r--)e=e.split(i[r]).join(t.substring(2*r,2*r+2));const r=[],n=e.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(e,t,n,i)=>{if(n)for(let e=parseInt(n);e>=0;e--)r.push(";");else r.push(t.toLowerCase());return""});if(n)throw new Error(`leftovers: ${JSON.stringify(n)}`);return a(a(r,";"),":")}t.decode=o,t.decodeOwl=function(e){return(0,n.assertArgument)("0"===e[0],"unsupported auwl data","data",e),o(e.substring(59),e.substring(1,59))}},4793:(e,t,r)=>{var n=r(4643);r(7835),r(8550);var i=n.asn1,s=e.exports=n.pkcs7asn1=n.pkcs7asn1||{};n.pkcs7=n.pkcs7||{},n.pkcs7.asn1=s;var a={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};s.contentInfoValidator=a;var o={name:"EncryptedContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};s.envelopedDataValidator={name:"EnvelopedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(o)},s.encryptedDataValidator={name:"EncryptedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"}].concat(o)};var c={name:"SignerInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};s.signedDataValidator={name:"SignedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},a,{name:"SignedData.Certificates",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,capture:"signerInfos",optional:!0,value:[c]}]},s.recipientInfoValidator={name:"RecipientInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},4832:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hmac=t.HMAC=void 0;const n=r(9648),i=r(3654);class s extends i.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,(0,n.hash)(e);const r=(0,i.toBytes)(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,a=new Uint8Array(s);a.set(r.length>s?e.create().update(r).digest():r);for(let e=0;e<a.length;e++)a[e]^=54;this.iHash.update(a),this.oHash=e.create();for(let e=0;e<a.length;e++)a[e]^=106;this.oHash.update(a),a.fill(0)}update(e){return(0,n.exists)(this),this.iHash.update(e),this}digestInto(e){(0,n.exists)(this),(0,n.bytes)(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:s,outputLen:a}=this;return e.finished=n,e.destroyed=i,e.blockLen=s,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}t.HMAC=s;t.hmac=(e,t,r)=>new s(e,t).update(r).digest(),t.hmac.create=(e,t)=>new s(e,t)},4935:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NumberCoder=void 0;const n=r(8718),i=r(3233),s=r(1540),a=BigInt(0),o=BigInt(1),c=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class u extends s.Coder{size;signed;constructor(e,t,r){const i=(t?"int":"uint")+8*e;super(i,i,r,!1),(0,n.defineProperties)(this,{size:e,signed:t},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(e,t){let r=(0,n.getBigInt)(i.Typed.dereference(t,this.type)),u=(0,n.mask)(c,8*s.WordSize);if(this.signed){let e=(0,n.mask)(u,8*this.size-1);(r>e||r<-(e+o))&&this._throwError("value out-of-bounds",t),r=(0,n.toTwos)(r,8*s.WordSize)}else(r<a||r>(0,n.mask)(u,8*this.size))&&this._throwError("value out-of-bounds",t);return e.writeValue(r)}decode(e){let t=(0,n.mask)(e.readValue(),8*this.size);return this.signed&&(t=(0,n.fromTwos)(t,8*this.size)),t}}t.NumberCoder=u},5020:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.zeroPadBytes=t.zeroPadValue=t.stripZerosLeft=t.dataSlice=t.dataLength=t.concat=t.hexlify=t.isBytesLike=t.isHexString=t.getBytesCopy=t.getBytes=void 0;const n=r(355);function i(e,t,r){if(e instanceof Uint8Array)return r?new Uint8Array(e):e;if("string"==typeof e&&e.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const t=new Uint8Array((e.length-2)/2);let r=2;for(let n=0;n<t.length;n++)t[n]=parseInt(e.substring(r,r+2),16),r+=2;return t}(0,n.assertArgument)(!1,"invalid BytesLike value",t||"value",e)}function s(e,t){return i(e,t,!1)}function a(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(("number"!=typeof t||e.length===2+2*t)&&(!0!==t||e.length%2==0))}t.getBytes=s,t.getBytesCopy=function(e,t){return i(e,t,!0)},t.isHexString=a,t.isBytesLike=function(e){return a(e,!0)||e instanceof Uint8Array};const o="0123456789abcdef";function c(e){const t=s(e);let r="0x";for(let e=0;e<t.length;e++){const n=t[e];r+=o[(240&n)>>4]+o[15&n]}return r}function u(e,t,r){const i=s(e);(0,n.assert)(t>=i.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(i),length:t,offset:t+1});const a=new Uint8Array(t);return a.fill(0),r?a.set(i,t-i.length):a.set(i,0),c(a)}t.hexlify=c,t.concat=function(e){return"0x"+e.map(e=>c(e).substring(2)).join("")},t.dataLength=function(e){return a(e,!0)?(e.length-2)/2:s(e).length},t.dataSlice=function(e,t,r){const i=s(e);return null!=r&&r>i.length&&(0,n.assert)(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:i,length:i.length,offset:r}),c(i.slice(null==t?0:t,null==r?i.length:r))},t.stripZerosLeft=function(e){let t=c(e).substring(2);for(;t.startsWith("00");)t=t.substring(2);return"0x"+t},t.zeroPadValue=function(e,t){return u(e,t,!0)},t.zeroPadBytes=function(e,t){return u(e,t,!1)}},5088:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Wordlist=void 0;const n=r(8718);t.Wordlist=class{locale;constructor(e){(0,n.defineProperties)(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(" ")}}},5114:(e,t,r)=>{var n=r(4643);r(5417),r(8550),(e.exports=n.pss=n.pss||{}).create=function(e){3===arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t,r=e.md,i=e.mgf,s=r.digestLength,a=e.salt||null;if("string"==typeof a&&(a=n.util.createBuffer(a)),"saltLength"in e)t=e.saltLength;else{if(null===a)throw new Error("Salt length not specified or specific salt not given.");t=a.length()}if(null!==a&&a.length()!==t)throw new Error("Given salt length does not match length of given salt.");var o=e.prng||n.random,c={encode:function(e,c){var u,l,h=c-1,d=Math.ceil(h/8),f=e.digest().getBytes();if(d<s+t+2)throw new Error("Message is too long to encrypt.");l=null===a?o.getBytesSync(t):a.bytes();var p=new n.util.ByteBuffer;p.fillWithByte(0,8),p.putBytes(f),p.putBytes(l),r.start(),r.update(p.getBytes());var g=r.digest().getBytes(),y=new n.util.ByteBuffer;y.fillWithByte(0,d-t-s-2),y.putByte(1),y.putBytes(l);var m=y.getBytes(),b=d-s-1,w=i.generate(g,b),v="";for(u=0;u<b;u++)v+=String.fromCharCode(m.charCodeAt(u)^w.charCodeAt(u));var A=65280>>8*d-h&255;return(v=String.fromCharCode(v.charCodeAt(0)&~A)+v.substr(1))+g+String.fromCharCode(188)},verify:function(e,a,o){var c,u=o-1,l=Math.ceil(u/8);if(a=a.substr(-l),l<s+t+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(188!==a.charCodeAt(l-1))throw new Error("Encoded message does not end in 0xBC.");var h=l-s-1,d=a.substr(0,h),f=a.substr(h,s),p=65280>>8*l-u&255;if(0!==(d.charCodeAt(0)&p))throw new Error("Bits beyond keysize not zero as expected.");var g=i.generate(f,h),y="";for(c=0;c<h;c++)y+=String.fromCharCode(d.charCodeAt(c)^g.charCodeAt(c));y=String.fromCharCode(y.charCodeAt(0)&~p)+y.substr(1);var m=l-s-t-2;for(c=0;c<m;c++)if(0!==y.charCodeAt(c))throw new Error("Leftmost octets not zero as expected");if(1!==y.charCodeAt(m))throw new Error("Inconsistent PSS signature, 0x01 marker not found");var b=y.substr(-t),w=new n.util.ByteBuffer;return w.fillWithByte(0,8),w.putBytes(e),w.putBytes(b),r.start(),r.update(w.getBytes()),f===r.digest().getBytes()}};return c}},5144:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDefaultProvider=void 0;const n=r(8718),i=r(7627),s=r(9542),a=r(6862),o=r(3594),c=r(6896),u=r(7166),l=r(6450),h=r(2163),d=r(24),f=r(4391),p=r(7658);const g="goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" ");t.getDefaultProvider=function(e,t){null==t&&(t={});const r=e=>"-"!==t[e]&&("string"==typeof t.exclusive?e===t.exclusive:!Array.isArray(t.exclusive)||-1!==t.exclusive.indexOf(e));if("string"==typeof e&&e.match(/^https?:/))return new d.JsonRpcProvider(e);if("string"==typeof e&&e.match(/^wss?:/)||(y=e)&&"function"==typeof y.send&&"function"==typeof y.close)return new p.WebSocketProvider(e);var y;let m=null;try{m=f.Network.from(e)}catch(e){}const b=[];if(r("publicPolygon")&&m&&("matic"===m.name?b.push(new d.JsonRpcProvider("https://polygon-rpc.com/",m,{staticNetwork:m})):"matic-amoy"===m.name&&b.push(new d.JsonRpcProvider("https://rpc-amoy.polygon.technology/",m,{staticNetwork:m}))),r("alchemy"))try{b.push(new s.AlchemyProvider(e,t.alchemy))}catch(e){}if(r("ankr")&&null!=t.ankr)try{b.push(new i.AnkrProvider(e,t.ankr))}catch(e){}if(r("chainstack"))try{b.push(new a.ChainstackProvider(e,t.chainstack))}catch(e){}if(r("cloudflare"))try{b.push(new o.CloudflareProvider(e))}catch(e){}if(r("etherscan"))try{b.push(new c.EtherscanProvider(e,t.etherscan))}catch(e){}if(r("infura"))try{let r,n=t.infura;"object"==typeof n&&(r=n.projectSecret,n=n.projectId),b.push(new u.InfuraProvider(e,n,r))}catch(e){}if(r("quicknode"))try{let r=t.quicknode;b.push(new l.QuickNodeProvider(e,r))}catch(e){}if((0,n.assert)(b.length,"unsupported default network","UNSUPPORTED_OPERATION",{operation:"getDefaultProvider"}),1===b.length)return b[0];let w=Math.floor(b.length/2);return w>2&&(w=2),m&&-1!==g.indexOf(m.name)&&(w=1),t&&t.quorum&&(w=t.quorum),new h.FallbackProvider(b,void 0,{quorum:w})}},5193:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.accessListify=void 0;const n=r(6107),i=r(8718);function s(e,t){return{address:(0,n.getAddress)(e),storageKeys:t.map((e,t)=>((0,i.assertArgument)((0,i.isHexString)(e,32),"invalid slot",`storageKeys[${t}]`,e),e.toLowerCase()))}}t.accessListify=function(e){if(Array.isArray(e))return e.map((t,r)=>Array.isArray(t)?((0,i.assertArgument)(2===t.length,"invalid slot set",`value[${r}]`,t),s(t[0],t[1])):((0,i.assertArgument)(null!=t&&"object"==typeof t,"invalid address-slot set","value",e),s(t.address,t.storageKeys)));(0,i.assertArgument)(null!=e&&"object"==typeof e,"invalid access list","value",e);const t=Object.keys(e).map(t=>{const r=e[t].reduce((e,t)=>(e[t]=!0,e),{});return s(t,Object.keys(r).sort())});return t.sort((e,t)=>e.address.localeCompare(t.address)),t}},5202:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.pbkdf2Sync=t.createHmac=t.createHash=void 0;const n=r(7073),i=r(5299),s=r(8289),a=r(6660),o=r(8718);const c=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw new Error("unable to locate global object")}(),u=c.crypto||c.msCrypto;t.createHash=function(e){switch(e){case"sha256":return s.sha256.create();case"sha512":return a.sha512.create()}(0,o.assertArgument)(!1,"invalid hashing algorithm name","algorithm",e)},t.createHmac=function(e,t){const r={sha256:s.sha256,sha512:a.sha512}[e];return(0,o.assertArgument)(null!=r,"invalid hmac algorithm","algorithm",e),n.hmac.create(r,t)},t.pbkdf2Sync=function(e,t,r,n,c){const u={sha256:s.sha256,sha512:a.sha512}[c];return(0,o.assertArgument)(null!=u,"invalid pbkdf2 algorithm","algorithm",c),(0,i.pbkdf2)(u,e,t,{c:r,dkLen:n})},t.randomBytes=function(e){(0,o.assert)(null!=u,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),(0,o.assertArgument)(Number.isInteger(e)&&e>0&&e<=1024,"invalid length","length",e);const t=new Uint8Array(e);return u.getRandomValues(t),t}},5206:(e,t,r)=>{var n=r(4643);r(8550);var i=e.exports=n.pem=n.pem||{};function s(e){for(var t=e.name+": ",r=[],n=function(e,t){return" "+t},i=0;i<e.values.length;++i)r.push(e.values[i].replace(/^(\S+\r\n)/,n));t+=r.join(",")+"\r\n";var s=0,a=-1;for(i=0;i<t.length;++i,++s)if(s>65&&-1!==a){var o=t[a];","===o?(++a,t=t.substr(0,a)+"\r\n "+t.substr(a)):t=t.substr(0,a)+"\r\n"+o+t.substr(a+1),s=i-a-1,a=-1,++i}else" "!==t[i]&&"\t"!==t[i]&&","!==t[i]||(a=i);return t}function a(e){return e.replace(/^\s+/,"")}i.encode=function(e,t){t=t||{};var r,i="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(i+=s(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(i+=s(r={name:"Content-Domain",values:[e.contentDomain]})),e.dekInfo&&(r={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&r.values.push(e.dekInfo.parameters),i+=s(r)),e.headers)for(var a=0;a<e.headers.length;++a)i+=s(e.headers[a]);return e.procType&&(i+="\r\n"),i+=n.util.encode64(e.body,t.maxline||64)+"\r\n",i+="-----END "+e.type+"-----\r\n"},i.decode=function(e){for(var t,r=[],i=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,s=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,o=/\r?\n/;t=i.exec(e);){var c=t[1];"NEW CERTIFICATE REQUEST"===c&&(c="CERTIFICATE REQUEST");var u={type:c,procType:null,contentDomain:null,dekInfo:null,headers:[],body:n.util.decode64(t[3])};if(r.push(u),t[2]){for(var l=t[2].split(o),h=0;t&&h<l.length;){for(var d=l[h].replace(/\s+$/,""),f=h+1;f<l.length;++f){var p=l[f];if(!/\s/.test(p[0]))break;d+=p,h=f}if(t=d.match(s)){for(var g={name:t[1],values:[]},y=t[2].split(","),m=0;m<y.length;++m)g.values.push(a(y[m]));if(u.procType)if(u.contentDomain||"Content-Domain"!==g.name)if(u.dekInfo||"DEK-Info"!==g.name)u.headers.push(g);else{if(0===g.values.length)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');u.dekInfo={algorithm:y[0],parameters:y[1]||null}}else u.contentDomain=y[0]||"";else{if("Proc-Type"!==g.name)throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==g.values.length)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');u.procType={version:y[0],type:y[1]}}}++h}if("ENCRYPTED"===u.procType&&!u.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(0===r.length)throw new Error("Invalid PEM formatted message.");return r}},5218:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha512=t.sha256=void 0;const n=r(5202),i=r(8718),s=function(e){return(0,n.createHash)("sha256").update(e).digest()},a=function(e){return(0,n.createHash)("sha512").update(e).digest()};let o=s,c=a,u=!1,l=!1;function h(e){const t=(0,i.getBytes)(e,"data");return(0,i.hexlify)(o(t))}function d(e){const t=(0,i.getBytes)(e,"data");return(0,i.hexlify)(c(t))}t.sha256=h,h._=s,h.lock=function(){u=!0},h.register=function(e){if(u)throw new Error("sha256 is locked");o=e},Object.freeze(h),t.sha512=d,d._=a,d.lock=function(){l=!0},d.register=function(e){if(l)throw new Error("sha512 is locked");c=e},Object.freeze(h)},5221:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserProvider=void 0;const n=r(8718),i=r(24);class s extends i.JsonRpcApiPollingProvider{#U;#pt;constructor(e,t,r){const i=Object.assign({},null!=r?r:{},{batchMaxCount:1});(0,n.assertArgument)(e&&e.request,"invalid EIP-1193 provider","ethereum",e),super(t,i),this.#pt=null,r&&r.providerInfo&&(this.#pt=r.providerInfo),this.#U=async(t,r)=>{const n={method:t,params:r};this.emit("debug",{action:"sendEip1193Request",payload:n});try{const t=await e.request(n);return this.emit("debug",{action:"receiveEip1193Result",result:t}),t}catch(e){const t=new Error(e.message);throw t.code=e.code,t.data=e.data,t.payload=n,this.emit("debug",{action:"receiveEip1193Error",error:t}),t}}}get providerInfo(){return this.#pt}async send(e,t){return await this._start(),await super.send(e,t)}async _send(e){(0,n.assertArgument)(!Array.isArray(e),"EIP-1193 does not support batch request","payload",e);try{const t=await this.#U(e.method,e.params||[]);return[{id:e.id,result:t}]}catch(t){return[{id:e.id,error:{code:t.code,data:t.data,message:t.message}}]}}getRpcError(e,t){switch((t=JSON.parse(JSON.stringify(t))).error.code||-1){case 4001:t.error.message=`ethers-user-denied: ${t.error.message}`;break;case 4200:t.error.message=`ethers-unsupported: ${t.error.message}`}return super.getRpcError(e,t)}async hasSigner(e){null==e&&(e=0);const t=await this.send("eth_accounts",[]);return"number"==typeof e?t.length>e:(e=e.toLowerCase(),0!==t.filter(t=>t.toLowerCase()===e).length)}async getSigner(e){if(null==e&&(e=0),!await this.hasSigner(e))try{await this.#U("eth_requestAccounts",[])}catch(e){const t=e.payload;throw this.getRpcError(t,{id:t.id,error:e})}return await super.getSigner(e)}static async discover(e){if(null==e&&(e={}),e.provider)return new s(e.provider);const t=e.window?e.window:"undefined"!=typeof window?window:null;if(null==t)return null;const r=e.anyProvider;if(r&&t.ethereum)return new s(t.ethereum);if(!("addEventListener"in t&&"dispatchEvent"in t&&"removeEventListener"in t))return null;const i=e.timeout?e.timeout:300;return 0===i?null:await new Promise((a,o)=>{let c=[];const u=e=>{c.push(e.detail),r&&l()},l=()=>{if(clearTimeout(h),c.length)if(e&&e.filter){const t=e.filter(c.map(e=>Object.assign({},e.info)));if(null==t)a(null);else if(t instanceof s)a(t);else{let e=null;if(t.uuid){e=c.filter(e=>t.uuid===e.info.uuid)[0]}if(e){const{provider:t,info:r}=e;a(new s(t,void 0,{providerInfo:r}))}else o((0,n.makeError)("filter returned unknown info","UNSUPPORTED_OPERATION",{value:t}))}}else{const{provider:e,info:t}=c[0];a(new s(e,void 0,{providerInfo:t}))}else a(null);t.removeEventListener("eip6963:announceProvider",u)},h=setTimeout(()=>{l()},i);t.addEventListener("eip6963:announceProvider",u),t.dispatchEvent(new Event("eip6963:requestProvider"))})}}t.BrowserProvider=s},5226:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateObject=t.createHmacDrbg=t.bitMask=t.bitSet=t.bitGet=t.bitLen=t.utf8ToBytes=t.equalBytes=t.concatBytes=t.ensureBytes=t.numberToVarBytesBE=t.numberToBytesLE=t.numberToBytesBE=t.bytesToNumberLE=t.bytesToNumberBE=t.hexToBytes=t.hexToNumber=t.numberToHexUnpadded=t.bytesToHex=void 0;const r=BigInt(0),n=BigInt(1),i=BigInt(2),s=e=>e instanceof Uint8Array,a=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function o(e){if(!s(e))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=a[e[r]];return t}function c(e){const t=e.toString(16);return 1&t.length?`0${t}`:t}function u(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return BigInt(""===e?"0":`0x${e}`)}function l(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(t/2);for(let t=0;t<r.length;t++){const n=2*t,i=e.slice(n,n+2),s=Number.parseInt(i,16);if(Number.isNaN(s)||s<0)throw new Error("Invalid byte sequence");r[t]=s}return r}function h(e,t){return l(e.toString(16).padStart(2*t,"0"))}function d(...e){const t=new Uint8Array(e.reduce((e,t)=>e+t.length,0));let r=0;return e.forEach(e=>{if(!s(e))throw new Error("Uint8Array expected");t.set(e,r),r+=e.length}),t}t.bytesToHex=o,t.numberToHexUnpadded=c,t.hexToNumber=u,t.hexToBytes=l,t.bytesToNumberBE=function(e){return u(o(e))},t.bytesToNumberLE=function(e){if(!s(e))throw new Error("Uint8Array expected");return u(o(Uint8Array.from(e).reverse()))},t.numberToBytesBE=h,t.numberToBytesLE=function(e,t){return h(e,t).reverse()},t.numberToVarBytesBE=function(e){return l(c(e))},t.ensureBytes=function(e,t,r){let n;if("string"==typeof t)try{n=l(t)}catch(r){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${r}`)}else{if(!s(t))throw new Error(`${e} must be hex string or Uint8Array`);n=Uint8Array.from(t)}const i=n.length;if("number"==typeof r&&i!==r)throw new Error(`${e} expected ${r} bytes, got ${i}`);return n},t.concatBytes=d,t.equalBytes=function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0},t.utf8ToBytes=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))},t.bitLen=function(e){let t;for(t=0;e>r;e>>=n,t+=1);return t},t.bitGet=function(e,t){return e>>BigInt(t)&n};t.bitSet=(e,t,i)=>e|(i?n:r)<<BigInt(t);t.bitMask=e=>(i<<BigInt(e-1))-n;const f=e=>new Uint8Array(e),p=e=>Uint8Array.from(e);t.createHmacDrbg=function(e,t,r){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");let n=f(e),i=f(e),s=0;const a=()=>{n.fill(1),i.fill(0),s=0},o=(...e)=>r(i,n,...e),c=(e=f())=>{i=o(p([0]),e),n=o(),0!==e.length&&(i=o(p([1]),e),n=o())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const r=[];for(;e<t;){n=o();const t=n.slice();r.push(t),e+=n.length}return d(...r)};return(e,t)=>{let r;for(a(),c(e);!(r=t(u()));)c();return a(),r}};const g={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};t.validateObject=function(e,t,r={}){const n=(t,r,n)=>{const i=g[r];if("function"!=typeof i)throw new Error(`Invalid validator "${r}", expected function`);const s=e[t];if(!(n&&void 0===s||i(s,e)))throw new Error(`Invalid param ${String(t)}=${s} (${typeof s}), expected ${r}`)};for(const[e,r]of Object.entries(t))n(e,r,!1);for(const[e,t]of Object.entries(r))n(e,t,!0);return e}},5263:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FilterIdPendingSubscriber=t.FilterIdEventSubscriber=t.FilterIdSubscriber=void 0;const n=r(8718),i=r(5737);class s{#De;#gt;#yt;#mt;#s;#bt;constructor(e){this.#De=e,this.#gt=null,this.#yt=this.#wt.bind(this),this.#mt=!1,this.#s=null,this.#bt=!1}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,t){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}async#wt(e){try{null==this.#gt&&(this.#gt=this._subscribe(this.#De));let e=null;try{e=await this.#gt}catch(e){if(!(0,n.isError)(e,"UNSUPPORTED_OPERATION")||"eth_newFilter"!==e.operation)throw e}if(null==e)return this.#gt=null,void this.#De._recoverSubscriber(this,this._recover(this.#De));const t=await this.#De.getNetwork();if(this.#s||(this.#s=t),this.#s.chainId!==t.chainId)throw new Error("chaid changed");if(this.#bt)return;const r=await this.#De.send("eth_getFilterChanges",[e]);await this._emitResults(this.#De,r)}catch(e){console.log("@TODO",e)}this.#De.once("block",this.#yt)}#vt(){const e=this.#gt;e&&(this.#gt=null,e.then(e=>{this.#De.destroyed||this.#De.send("eth_uninstallFilter",[e])}))}start(){this.#mt||(this.#mt=!0,this.#wt(-2))}stop(){this.#mt&&(this.#mt=!1,this.#bt=!0,this.#vt(),this.#De.off("block",this.#yt))}pause(e){e&&this.#vt(),this.#De.off("block",this.#yt)}resume(){this.start()}}t.FilterIdSubscriber=s;t.FilterIdEventSubscriber=class extends s{#At;constructor(e,t){var r;super(e),this.#At=(r=t,JSON.parse(JSON.stringify(r)))}_recover(e){return new i.PollingEventSubscriber(e,this.#At)}async _subscribe(e){return await e.send("eth_newFilter",[this.#At])}async _emitResults(e,t){for(const r of t)e.emit(this.#At,e._wrapLog(r,e._network))}};t.FilterIdPendingSubscriber=class extends s{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,t){for(const r of t)e.emit("pending",r)}}},5299:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pbkdf2Async=t.pbkdf2=void 0;const n=r(9071),i=r(7073),s=r(1197);function a(e,t,r,a){(0,n.hash)(e);const o=(0,s.checkOpts)({dkLen:32,asyncTick:10},a),{c,dkLen:u,asyncTick:l}=o;if((0,n.number)(c),(0,n.number)(u),(0,n.number)(l),c<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const h=(0,s.toBytes)(t),d=(0,s.toBytes)(r),f=new Uint8Array(u),p=i.hmac.create(e,h),g=p._cloneInto().update(d);return{c,dkLen:u,asyncTick:l,DK:f,PRF:p,PRFSalt:g}}function o(e,t,r,n,i){return e.destroy(),t.destroy(),n&&n.destroy(),i.fill(0),r}t.pbkdf2=function(e,t,r,n){const{c:i,dkLen:c,DK:u,PRF:l,PRFSalt:h}=a(e,t,r,n);let d;const f=new Uint8Array(4),p=(0,s.createView)(f),g=new Uint8Array(l.outputLen);for(let e=1,t=0;t<c;e++,t+=l.outputLen){const r=u.subarray(t,t+l.outputLen);p.setInt32(0,e,!1),(d=h._cloneInto(d)).update(f).digestInto(g),r.set(g.subarray(0,r.length));for(let e=1;e<i;e++){l._cloneInto(d).update(g).digestInto(g);for(let e=0;e<r.length;e++)r[e]^=g[e]}}return o(l,h,u,d,g)},t.pbkdf2Async=async function(e,t,r,n){const{c:i,dkLen:c,asyncTick:u,DK:l,PRF:h,PRFSalt:d}=a(e,t,r,n);let f;const p=new Uint8Array(4),g=(0,s.createView)(p),y=new Uint8Array(h.outputLen);for(let e=1,t=0;t<c;e++,t+=h.outputLen){const r=l.subarray(t,t+h.outputLen);g.setInt32(0,e,!1),(f=d._cloneInto(f)).update(p).digestInto(y),r.set(y.subarray(0,r.length)),await(0,s.asyncLoop)(i-1,u,()=>{h._cloneInto(f).update(y).digestInto(y);for(let e=0;e<r.length;e++)r[e]^=y[e]})}return o(h,d,l,f,y)}},5321:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pkcs7Strip=t.pkcs7Pad=void 0,t.pkcs7Pad=function(e){const t=16-e.length%16,r=new Uint8Array(e.length+t);r.set(e);for(let n=e.length;n<r.length;n++)r[n]=t;return r},t.pkcs7Strip=function(e){if(e.length<16)throw new TypeError("PKCS#7 invalid length");const t=e[e.length-1];if(t>16)throw new TypeError("PKCS#7 padding byte out of range");const r=e.length-t;for(let n=0;n<t;n++)if(e[r+n]!==t)throw new TypeError("PKCS#7 invalid padding byte");return new Uint8Array(e.subarray(0,r))}},5337:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;const n=r(9071),i=r(1197);class s extends i.Hash{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,i.createView)(this.buffer)}update(e){(0,n.exists)(this);const{view:t,buffer:r,blockLen:s}=this,a=(e=(0,i.toBytes)(e)).length;for(let n=0;n<a;){const o=Math.min(s-this.pos,a-n);if(o===s){const t=(0,i.createView)(e);for(;s<=a-n;n+=s)this.process(t,n);continue}r.set(e.subarray(n,n+o),this.pos),this.pos+=o,n+=o,this.pos===s&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,n.exists)(this),(0,n.output)(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:s,isLE:a}=this;let{pos:o}=this;t[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(r,0),o=0);for(let e=o;e<s;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),s=BigInt(4294967295),a=Number(r>>i&s),o=Number(r&s),c=n?4:0,u=n?0:4;e.setUint32(t+c,a,n),e.setUint32(t+u,o,n)}(r,s-8,BigInt(8*this.length),a),this.process(r,0);const c=(0,i.createView)(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=u/4,h=this.get();if(l>h.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<l;e++)c.setUint32(4*e,h[e],a)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:s,pos:a}=this;return e.length=n,e.pos=a,e.finished=i,e.destroyed=s,n%t&&e.buffer.set(r),e}}t.SHA2=s},5417:(e,t,r)=>{var n=r(4643);r(3739),r(7585),r(7391),r(8550),n.random&&n.random.getBytes?e.exports=n.random:function(t){var r={},i=new Array(4),s=n.util.createBuffer();function a(){var e=n.prng.create(r);return e.getBytes=function(t,r){return e.generate(t,r)},e.getBytesSync=function(t){return e.generate(t)},e}r.formatKey=function(e){var t=n.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),n.aes._expandKey(e,!1)},r.formatSeed=function(e){var t=n.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),e},r.cipher=function(e,t){return n.aes._updateBlock(e,t,i,!1),s.putInt32(i[0]),s.putInt32(i[1]),s.putInt32(i[2]),s.putInt32(i[3]),s.getBytes()},r.increment=function(e){return++e[3],e},r.md=n.md.sha256;var o=a(),c=null,u=n.util.globalScope,l=u.crypto||u.msCrypto;if(l&&l.getRandomValues&&(c=function(e){return l.getRandomValues(e)}),n.options.usePureJavaScript||!n.util.isNodejs&&!c){if("undefined"==typeof window||window.document,o.collectInt(+new Date,32),"undefined"!=typeof navigator){var h="";for(var d in navigator)try{"string"==typeof navigator[d]&&(h+=navigator[d])}catch(e){}o.collect(h),h=null}t&&(t().mousemove(function(e){o.collectInt(e.clientX,16),o.collectInt(e.clientY,16)}),t().keypress(function(e){o.collectInt(e.charCode,8)}))}if(n.random)for(var d in o)n.random[d]=o[d];else n.random=o;n.random.createInstance=a,e.exports=n.random}("undefined"!=typeof jQuery?jQuery:null)},5484:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encodeToCurve=t.hashToCurve=t.schnorr=t.secp256k1=void 0;const n=r(8289),i=r(1197),s=r(1537),a=r(747),o=r(5226),c=r(3503),u=r(3600),l=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),h=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),d=BigInt(1),f=BigInt(2),p=(e,t)=>(e+t/f)/t;function g(e){const t=l,r=BigInt(3),n=BigInt(6),i=BigInt(11),a=BigInt(22),o=BigInt(23),c=BigInt(44),u=BigInt(88),h=e*e*e%t,d=h*h*e%t,p=(0,s.pow2)(d,r,t)*d%t,g=(0,s.pow2)(p,r,t)*d%t,m=(0,s.pow2)(g,f,t)*h%t,b=(0,s.pow2)(m,i,t)*m%t,w=(0,s.pow2)(b,a,t)*b%t,v=(0,s.pow2)(w,c,t)*w%t,A=(0,s.pow2)(v,u,t)*v%t,E=(0,s.pow2)(A,c,t)*w%t,C=(0,s.pow2)(E,r,t)*d%t,B=(0,s.pow2)(C,o,t)*b%t,S=(0,s.pow2)(B,n,t)*h%t,k=(0,s.pow2)(S,f,t);if(!y.eql(y.sqr(k),e))throw new Error("Cannot find square root");return k}const y=(0,s.Field)(l,void 0,void 0,{sqrt:g});t.secp256k1=(0,u.createCurve)({a:BigInt(0),b:BigInt(7),Fp:y,n:h,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=h,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-d*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=r,o=BigInt("0x100000000000000000000000000000000"),c=p(a*e,t),u=p(-n*e,t);let l=(0,s.mod)(e-c*r-u*i,t),f=(0,s.mod)(-c*n-u*a,t);const g=l>o,y=f>o;if(g&&(l=t-l),y&&(f=t-f),l>o||f>o)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:g,k1:l,k2neg:y,k2:f}}}},n.sha256);const m=BigInt(0),b=e=>"bigint"==typeof e&&m<e&&e<l,w={};function v(e,...t){let r=w[e];if(void 0===r){const t=(0,n.sha256)(Uint8Array.from(e,e=>e.charCodeAt(0)));r=(0,o.concatBytes)(t,t),w[e]=r}return(0,n.sha256)((0,o.concatBytes)(r,...t))}const A=e=>e.toRawBytes(!0).slice(1),E=e=>(0,o.numberToBytesBE)(e,32),C=e=>(0,s.mod)(e,l),B=e=>(0,s.mod)(e,h),S=t.secp256k1.ProjectivePoint;function k(e){let r=t.secp256k1.utils.normPrivateKeyToScalar(e),n=S.fromPrivateKey(r);return{scalar:n.hasEvenY()?r:B(-r),bytes:A(n)}}function T(e){if(!b(e))throw new Error("bad x: need 0 < x < p");const t=C(e*e);let r=g(C(t*e+BigInt(7)));r%f!==m&&(r=C(-r));const n=new S(e,r,d);return n.assertValidity(),n}function I(...e){return B((0,o.bytesToNumberBE)(v("BIP0340/challenge",...e)))}function P(e){return k(e).bytes}function N(e,t,r=(0,i.randomBytes)(32)){const n=(0,o.ensureBytes)("message",e),{bytes:s,scalar:a}=k(t),c=(0,o.ensureBytes)("auxRand",r,32),u=E(a^(0,o.bytesToNumberBE)(v("BIP0340/aux",c))),l=v("BIP0340/nonce",u,s,n),h=B((0,o.bytesToNumberBE)(l));if(h===m)throw new Error("sign failed: k is zero");const{bytes:d,scalar:f}=k(h),p=I(d,s,n),g=new Uint8Array(64);if(g.set(d,0),g.set(E(B(f+p*a)),32),!x(g,n,s))throw new Error("sign: Invalid signature produced");return g}function x(e,t,r){const n=(0,o.ensureBytes)("signature",e,64),i=(0,o.ensureBytes)("message",t),s=(0,o.ensureBytes)("publicKey",r,32);try{const e=T((0,o.bytesToNumberBE)(s)),t=(0,o.bytesToNumberBE)(n.subarray(0,32));if(!b(t))return!1;const r=(0,o.bytesToNumberBE)(n.subarray(32,64));if(!("bigint"==typeof(l=r)&&m<l&&l<h))return!1;const d=I(E(t),A(e),i),f=(a=e,c=r,u=B(-d),S.BASE.multiplyAndAddUnsafe(a,c,u));return!(!f||!f.hasEvenY()||f.toAffine().x!==t)}catch(e){return!1}var a,c,u,l}t.schnorr={getPublicKey:P,sign:N,verify:x,utils:{randomPrivateKey:t.secp256k1.utils.randomPrivateKey,lift_x:T,pointToBytes:A,numberToBytesBE:o.numberToBytesBE,bytesToNumberBE:o.bytesToNumberBE,taggedHash:v,mod:s.mod}};const O=(0,c.isogenyMap)(y,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(e=>e.map(e=>BigInt(e)))),R=(0,a.mapToCurveSimpleSWU)(y,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:y.create(BigInt("-11"))}),U=(0,c.createHasher)(t.secp256k1.ProjectivePoint,e=>{const{x:t,y:r}=R(y.create(e[0]));return O(t,r)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:y.ORDER,m:1,k:128,expand:"xmd",hash:n.sha256});t.hashToCurve=U.hashToCurve,t.encodeToCurve=U.encodeToCurve},5519:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContractEventPayload=t.ContractUnknownEventPayload=t.ContractTransactionResponse=t.ContractTransactionReceipt=t.UndecodedEventLog=t.EventLog=void 0;const n=r(532),i=r(8718);class s extends n.Log{interface;fragment;args;constructor(e,t,r){super(e,e.provider);const n=t.decodeEventLog(r,e.data,e.topics);(0,i.defineProperties)(this,{args:n,fragment:r,interface:t})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}t.EventLog=s;class a extends n.Log{error;constructor(e,t){super(e,e.provider),(0,i.defineProperties)(this,{error:t})}}t.UndecodedEventLog=a;class o extends n.TransactionReceipt{#Et;constructor(e,t,r){super(r,t),this.#Et=e}get logs(){return super.logs.map(e=>{const t=e.topics.length?this.#Et.getEvent(e.topics[0]):null;if(t)try{return new s(e,this.#Et,t)}catch(t){return new a(e,t)}return e})}}t.ContractTransactionReceipt=o;class c extends n.TransactionResponse{#Et;constructor(e,t,r){super(r,t),this.#Et=e}async wait(e,t){const r=await super.wait(e,t);return null==r?null:new o(this.#Et,this.provider,r)}}t.ContractTransactionResponse=c;class u extends i.EventPayload{log;constructor(e,t,r,n){super(e,t,r),(0,i.defineProperties)(this,{log:n})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}t.ContractUnknownEventPayload=u;t.ContractEventPayload=class extends u{constructor(e,t,r,n,a){super(e,t,r,new s(a,e.interface,n));const o=e.interface.decodeEventLog(n,this.log.data,this.log.topics);(0,i.defineProperties)(this,{args:o,fragment:n})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}},5523:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PocketProvider=void 0;const n=r(8718),i=r(324),s=r(4391),a=r(24),o="62e1ad51b37b8e00394bda3b";class c extends a.JsonRpcProvider{applicationId;applicationSecret;constructor(e,t,r){null==e&&(e="mainnet");const i=s.Network.from(e);null==t&&(t=o),null==r&&(r=null);const a={staticNetwork:i};super(c.getRequest(i,t,r),i,a),(0,n.defineProperties)(this,{applicationId:t,applicationSecret:r})}_getProvider(e){try{return new c(e,this.applicationId,this.applicationSecret)}catch(e){}return super._getProvider(e)}static getRequest(e,t,r){null==t&&(t=o);const s=new n.FetchRequest(`https://${function(e){switch(e){case"mainnet":return"eth-mainnet.gateway.pokt.network";case"goerli":return"eth-goerli.gateway.pokt.network";case"matic":return"poly-mainnet.gateway.pokt.network";case"matic-mumbai":return"polygon-mumbai-rpc.gateway.pokt.network"}(0,n.assertArgument)(!1,"unsupported network","network",e)}(e.name)}/v1/lb/${t}`);return s.allowGzip=!0,r&&s.setCredentials("",r),t===o&&(s.retryFunc=async(e,t,r)=>((0,i.showThrottleMessage)("PocketProvider"),!0)),s}isCommunityResource(){return this.applicationId===o}}t.PocketProvider=c},5568:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.id=void 0;const n=r(6468),i=r(8718);t.id=function(e){return(0,n.keccak256)((0,i.toUtf8Bytes)(e))}},5587:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pbkdf2=void 0;const n=r(5202),i=r(8718);let s=!1;const a=function(e,t,r,i,s){return(0,n.pbkdf2Sync)(e,t,r,i,s)};let o=a;function c(e,t,r,n,s){const a=(0,i.getBytes)(e,"password"),c=(0,i.getBytes)(t,"salt");return(0,i.hexlify)(o(a,c,r,n,s))}t.pbkdf2=c,c._=a,c.lock=function(){s=!0},c.register=function(e){if(s)throw new Error("pbkdf2 is locked");o=e},Object.freeze(c)},5628:(e,t,r)=>{var n=r(4643);r(7835);var i=n.asn1;t.privateKeyValidator={name:"PrivateKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},t.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,composed:!0,captureBitStringValue:"ed25519PublicKey"}]}},5722:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveAddress=t.isAddress=t.isAddressable=void 0;const n=r(8718),i=r(4103);function s(e){return e&&"function"==typeof e.getAddress}async function a(e,t){const r=await t;return null!=r&&"0x0000000000000000000000000000000000000000"!==r||((0,n.assert)("string"!=typeof e,"unconfigured name","UNCONFIGURED_NAME",{value:e}),(0,n.assertArgument)(!1,"invalid AddressLike value; did not resolve to a value address","target",e)),(0,i.getAddress)(r)}t.isAddressable=s,t.isAddress=function(e){try{return(0,i.getAddress)(e),!0}catch(e){}return!1},t.resolveAddress=function(e,t){return"string"==typeof e?e.match(/^0x[0-9a-f]{40}$/i)?(0,i.getAddress)(e):((0,n.assert)(null!=t,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),a(e,t.resolveName(e))):s(e)?a(e,e.getAddress()):e&&"function"==typeof e.then?a(e,e):void(0,n.assertArgument)(!1,"unsupported addressable value","target",e)}},5737:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PollingEventSubscriber=t.PollingTransactionSubscriber=t.PollingOrphanSubscriber=t.PollingBlockTagSubscriber=t.OnBlockSubscriber=t.PollingBlockSubscriber=t.getPollingSubscriber=void 0;const n=r(8718);function i(e){return JSON.parse(JSON.stringify(e))}t.getPollingSubscriber=function(e,t){return"block"===t?new s(e):(0,n.isHexString)(t,32)?new o(e,t):void(0,n.assert)(!1,"unsupported polling event","UNSUPPORTED_OPERATION",{operation:"getPollingSubscriber",info:{event:t}})};class s{#De;#yt;#Ct;#Bt;constructor(e){this.#De=e,this.#yt=null,this.#Ct=4e3,this.#Bt=-2}get pollingInterval(){return this.#Ct}set pollingInterval(e){this.#Ct=e}async#wt(){try{const e=await this.#De.getBlockNumber();if(-2===this.#Bt)return void(this.#Bt=e);if(e!==this.#Bt){for(let t=this.#Bt+1;t<=e;t++){if(null==this.#yt)return;await this.#De.emit("block",t)}this.#Bt=e}}catch(e){}null!=this.#yt&&(this.#yt=this.#De._setTimeout(this.#wt.bind(this),this.#Ct))}start(){this.#yt||(this.#yt=this.#De._setTimeout(this.#wt.bind(this),this.#Ct),this.#wt())}stop(){this.#yt&&(this.#De._clearTimeout(this.#yt),this.#yt=null)}pause(e){this.stop(),e&&(this.#Bt=-2)}resume(){this.start()}}t.PollingBlockSubscriber=s;class a{#De;#wt;#mt;constructor(e){this.#De=e,this.#mt=!1,this.#wt=e=>{this._poll(e,this.#De)}}async _poll(e,t){throw new Error("sub-classes must override this")}start(){this.#mt||(this.#mt=!0,this.#wt(-2),this.#De.on("block",this.#wt))}stop(){this.#mt&&(this.#mt=!1,this.#De.off("block",this.#wt))}pause(e){this.stop()}resume(){this.start()}}t.OnBlockSubscriber=a;t.PollingBlockTagSubscriber=class extends a{#St;#kt;constructor(e,t){super(e),this.#St=t,this.#kt=-2}pause(e){e&&(this.#kt=-2),super.pause(e)}async _poll(e,t){const r=await t.getBlock(this.#St);null!=r&&(-2===this.#kt?this.#kt=r.number:r.number>this.#kt&&(t.emit(this.#St,r.number),this.#kt=r.number))}};t.PollingOrphanSubscriber=class extends a{#Fe;constructor(e,t){super(e),this.#Fe=i(t)}async _poll(e,t){throw new Error("@TODO")}};class o extends a{#Tt;constructor(e,t){super(e),this.#Tt=t}async _poll(e,t){const r=await t.getTransactionReceipt(this.#Tt);r&&t.emit(this.#Tt,r)}}t.PollingTransactionSubscriber=o;t.PollingEventSubscriber=class{#De;#Fe;#yt;#mt;#Bt;constructor(e,t){this.#De=e,this.#Fe=i(t),this.#yt=this.#wt.bind(this),this.#mt=!1,this.#Bt=-2}async#wt(e){if(-2===this.#Bt)return;const t=i(this.#Fe);t.fromBlock=this.#Bt+1,t.toBlock=e;const r=await this.#De.getLogs(t);if(0!==r.length)for(const e of r)this.#De.emit(this.#Fe,e),this.#Bt=e.blockNumber;else this.#Bt<e-60&&(this.#Bt=e-60)}start(){this.#mt||(this.#mt=!0,-2===this.#Bt&&this.#De.getBlockNumber().then(e=>{this.#Bt=e}),this.#De.on("block",this.#yt))}stop(){this.#mt&&(this.#mt=!1,this.#De.off("block",this.#yt))}pause(e){this.stop(),e&&(this.#Bt=-2)}resume(){this.start()}}},5739:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BytesCoder=t.DynamicBytesCoder=void 0;const n=r(8718),i=r(1540);class s extends i.Coder{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=(0,n.getBytesCopy)(t);let r=e.writeValue(t.length);return r+=e.writeBytes(t),r}decode(e){return e.readBytes(e.readIndex(),!0)}}t.DynamicBytesCoder=s;t.BytesCoder=class extends s{constructor(e){super("bytes",e)}decode(e){return(0,n.hexlify)(super.decode(e))}}},5774:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VoidSigner=t.AbstractSigner=void 0;const n=r(6107),i=r(203),s=r(8718),a=r(532);function o(e,t){if(e.provider)return e.provider;(0,s.assert)(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:t})}async function c(e,t){let r=(0,a.copyRequest)(t);if(null!=r.to&&(r.to=(0,n.resolveAddress)(r.to,e)),null!=r.from){const t=r.from;r.from=Promise.all([e.getAddress(),(0,n.resolveAddress)(t,e)]).then(([e,t])=>((0,s.assertArgument)(e.toLowerCase()===t.toLowerCase(),"transaction from mismatch","tx.from",t),e))}else r.from=e.getAddress();return await(0,s.resolveProperties)(r)}class u{provider;constructor(e){(0,s.defineProperties)(this,{provider:e||null})}async getNonce(e){return o(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await c(this,e)}async populateTransaction(e){const t=o(this,"populateTransaction"),r=await c(this,e);null==r.nonce&&(r.nonce=await this.getNonce("pending")),null==r.gasLimit&&(r.gasLimit=await this.estimateGas(r));const n=await this.provider.getNetwork();if(null!=r.chainId){const t=(0,s.getBigInt)(r.chainId);(0,s.assertArgument)(t===n.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else r.chainId=n.chainId;const i=null!=r.maxFeePerGas||null!=r.maxPriorityFeePerGas;if(null==r.gasPrice||2!==r.type&&!i?0!==r.type&&1!==r.type||!i||(0,s.assertArgument)(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e):(0,s.assertArgument)(!1,"eip-1559 transaction do not support gasPrice","tx",e),2!==r.type&&null!=r.type||null==r.maxFeePerGas||null==r.maxPriorityFeePerGas)if(0===r.type||1===r.type){const e=await t.getFeeData();(0,s.assert)(null!=e.gasPrice,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),null==r.gasPrice&&(r.gasPrice=e.gasPrice)}else{const e=await t.getFeeData();if(null==r.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(r.authorizationList&&r.authorizationList.length?r.type=4:r.type=2,null!=r.gasPrice){const e=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=e,r.maxPriorityFeePerGas=e}else null==r.maxFeePerGas&&(r.maxFeePerGas=e.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?((0,s.assert)(!i,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),null==r.gasPrice&&(r.gasPrice=e.gasPrice),r.type=0):(0,s.assert)(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else 2!==r.type&&3!==r.type&&4!==r.type||(null==r.maxFeePerGas&&(r.maxFeePerGas=e.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else r.type=2;return await(0,s.resolveProperties)(r)}async populateAuthorization(e){const t=Object.assign({},e);return null==t.chainId&&(t.chainId=(await o(this,"getNetwork").getNetwork()).chainId),null==t.nonce&&(t.nonce=await this.getNonce()),t}async estimateGas(e){return o(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return o(this,"call").call(await this.populateCall(e))}async resolveName(e){const t=o(this,"resolveName");return await t.resolveName(e)}async sendTransaction(e){const t=o(this,"sendTransaction"),r=await this.populateTransaction(e);delete r.from;const n=i.Transaction.from(r);return await t.broadcastTransaction(await this.signTransaction(n))}authorize(e){(0,s.assert)(!1,"authorization not implemented for this signer","UNSUPPORTED_OPERATION",{operation:"authorize"})}}t.AbstractSigner=u;class l extends u{address;constructor(e,t){super(t),(0,s.defineProperties)(this,{address:e})}async getAddress(){return this.address}connect(e){return new l(this.address,e)}#It(e,t){(0,s.assert)(!1,`VoidSigner cannot sign ${e}`,"UNSUPPORTED_OPERATION",{operation:t})}async signTransaction(e){this.#It("transactions","signTransaction")}async signMessage(e){this.#It("messages","signMessage")}async signTypedData(e,t,r){this.#It("typed-data","signTypedData")}}t.VoidSigner=l},5775:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toUtf8CodePoints=t.toUtf8String=t.toUtf8Bytes=t.Utf8ErrorFuncs=void 0;const n=r(5020),i=r(355);function s(e,t,r,n,i){if("BAD_PREFIX"===e||"UNEXPECTED_CONTINUE"===e){let e=0;for(let n=t+1;n<r.length&&r[n]>>6==2;n++)e++;return e}return"OVERRUN"===e?r.length-t-1:0}function a(e,r){null==r&&(r=t.Utf8ErrorFuncs.error);const i=(0,n.getBytes)(e,"bytes"),s=[];let a=0;for(;a<i.length;){const e=i[a++];if(!(e>>7)){s.push(e);continue}let t=null,n=null;if(192==(224&e))t=1,n=127;else if(224==(240&e))t=2,n=2047;else{if(240!=(248&e)){a+=r(128==(192&e)?"UNEXPECTED_CONTINUE":"BAD_PREFIX",a-1,i,s);continue}t=3,n=65535}if(a-1+t>=i.length){a+=r("OVERRUN",a-1,i,s);continue}let o=e&(1<<8-t-1)-1;for(let e=0;e<t;e++){let e=i[a];if(128!=(192&e)){a+=r("MISSING_CONTINUE",a,i,s),o=null;break}o=o<<6|63&e,a++}null!==o&&(o>1114111?a+=r("OUT_OF_RANGE",a-1-t,i,s,o):o>=55296&&o<=57343?a+=r("UTF16_SURROGATE",a-1-t,i,s,o):o<=n?a+=r("OVERLONG",a-1-t,i,s,o):s.push(o))}return s}function o(e,t){(0,i.assertArgument)("string"==typeof e,"invalid string value","str",e),null!=t&&((0,i.assertNormalize)(t),e=e.normalize(t));let r=[];for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<128)r.push(n);else if(n<2048)r.push(n>>6|192),r.push(63&n|128);else if(55296==(64512&n)){t++;const s=e.charCodeAt(t);(0,i.assertArgument)(t<e.length&&56320==(64512&s),"invalid surrogate pair","str",e);const a=65536+((1023&n)<<10)+(1023&s);r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return new Uint8Array(r)}t.Utf8ErrorFuncs=Object.freeze({error:function(e,t,r,n,s){(0,i.assertArgument)(!1,`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:s,replace:function(e,t,r,n,a){return"OVERLONG"===e?((0,i.assertArgument)("number"==typeof a,"invalid bad code point for replacement","badCodepoint",a),n.push(a),0):(n.push(65533),s(e,t,r))}}),t.toUtf8Bytes=o,t.toUtf8String=function(e,t){return a(e,t).map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e)))).join("")},t.toUtf8CodePoints=function(e,t){return a(o(e,t))}},5784:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ZeroHash=void 0,t.ZeroHash="0x0000000000000000000000000000000000000000000000000000000000000000"},5856:(e,t)=>{"use strict";const r=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]);function n(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),i=1,s=[0,1];for(let e=1;e<n;e++)s.push(i+=r());let a=r(),o=t;t+=a;let c=0,u=0;function l(){return 0==c&&(u=u<<8|e[t++],c=8),u>>--c&1}const h=2**31,d=h>>>1,f=d>>1,p=h-1;let g=0;for(let e=0;e<31;e++)g=g<<1|l();let y=[],m=0,b=h;for(;;){let e=Math.floor(((g-m+1)*i-1)/b),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e<s[n]?r=n:t=n}if(0==t)break;y.push(t);let a=m+Math.floor(b*s[t]/i),o=m+Math.floor(b*s[t+1]/i)-1;for(;0==((a^o)&d);)g=g<<1&p|l(),a=a<<1&p,o=o<<1&p|1;for(;a&~o&f;)g=g&d|g<<1&p>>>1|l(),a=a<<1^d,o=(o^d)<<1|d|1;m=a,b=1+o-a}let w=n-4;return y.map(t=>{switch(t-w){case 3:return w+65792+(e[o++]<<16|e[o++]<<8|e[o++]);case 2:return w+256+(e[o++]<<8|e[o++]);case 1:return w+e[o++];default:return t-1}})}(function(e){let t=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((e,r)=>t[e.charCodeAt(0)]=r);let r=e.length,n=new Uint8Array(6*r>>3);for(let i=0,s=0,a=0,o=0;i<r;i++)o=o<<6|t[e.charCodeAt(i)],a+=6,a>=8&&(n[s++]=o>>(a-=8));return n}(e)))}function i(e){return 1&e?~e>>1:e>>1}function s(e,t){let r=Array(e);for(let n=0,s=0;n<e;n++)r[n]=s+=i(t());return r}function a(e,t=0){let r=[];for(;;){let n=e(),i=e();if(!i)break;t+=n;for(let e=0;e<i;e++)r.push(t+e);t+=i+1}return r}function o(e){return u(()=>{let t=a(e);if(t.length)return t})}function c(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(h(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(d(r,e))}return t.flat()}function u(e){let t=[];for(;;){let r=e(t.length);if(!r)break;t.push(r)}return t}function l(e,t,r){let n=Array(e).fill().map(()=>[]);for(let i=0;i<t;i++)s(e,r).forEach((e,t)=>n[t].push(e));return n}function h(e,t){let r=1+t(),n=t(),i=u(t);return l(i.length,1+e,t).flatMap((e,t)=>{let[s,...a]=e;return Array(i[t]).fill().map((e,t)=>{let i=t*n;return[s+t*r,a.map(e=>e+i)]})})}function d(e,t){return l(1+t(),1+e,t).map(e=>[e[0],e.slice(1)])}function f(e){return`{${function(e){return e.toString(16).toUpperCase().padStart(2,"0")}(e)}}`}function p(e){let t=[];for(let r=0,n=e.length;r<n;){let n=e.codePointAt(r);r+=n<65536?1:2,t.push(n)}return t}function g(e){let t=e.length;if(t<4096)return String.fromCodePoint(...e);let r=[];for(let n=0;n<t;)r.push(String.fromCodePoint(...e.slice(n,n+=4096)));return r.join("")}function y(e,t){let r=e.length,n=r-t.length;for(let i=0;0==n&&i<r;i++)n=e[i]-t[i];return n}const m=44032,b=4352,w=4449,v=4519,A=28,E=588;function C(e){return e>>24&255}function B(e){return 16777215&e}let S,k,T,I;function P(e){return e>=m&&e<55204}function N(e,t){if(e>=b&&e<4371&&t>=w&&t<4470)return m+(e-b)*E+(t-w)*A;if(P(e)&&t>v&&t<4547&&(e-m)%A==0)return e+(t-v);{let r=I.get(e);return r&&(r=r.get(t),r)?r:-1}}function x(e){S||function(){let e=n("AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30ZGQ/NlZwIpS3dDO0m4y6hgFoj9SqDBe1L9DzdC01RaA9ZC2UJ4zpjgU4DIQENIosK3Q05CG0Q8wrJaw3l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zOVPwpUC01nhxZuY/63E7g");S=new Map(o(e).flatMap((e,t)=>e.map(e=>[e,t+1<<24]))),k=new Set(a(e)),T=new Map,I=new Map;for(let[t,r]of c(e)){if(!k.has(t)&&2==r.length){let[e,n]=r,i=I.get(e);i||(i=new Map,I.set(e,i)),i.set(n,t)}T.set(t,r.reverse())}}();let t=[],r=[],i=!1;function s(e){let r=S.get(e);r&&(i=!0,e|=r),t.push(e)}for(let n of e)for(;;){if(n<128)t.push(n);else if(P(n)){let e=n-m,t=e%E/A|0,r=e%A;s(b+(e/E|0)),s(w+t),r>0&&s(v+r)}else{let e=T.get(n);e?r.push(...e):s(n)}if(!r.length)break;n=r.pop()}if(i&&t.length>1){let e=C(t[0]);for(let r=1;r<t.length;r++){let n=C(t[r]);if(0==n||e<=n){e=n;continue}let i=r-1;for(;;){let r=t[i+1];if(t[i+1]=t[i],t[i]=r,!i)break;if(e=C(t[--i]),e<=n)break}e=C(t[r])}}return t}function O(e){return x(e).map(B)}function R(e){return function(e){let t=[],r=[],n=-1,i=0;for(let s of e){let e=C(s),a=B(s);if(-1==n)0==e?n=a:t.push(a);else if(i>0&&i>=e)0==e?(t.push(n,...r),r.length=0,n=a):r.push(a),i=e;else{let s=N(n,a);s>=0?n=s:0==i&&0==e?(t.push(n),n=a):(r.push(a),i=e)}}return n>=0&&t.push(n,...r),t}(x(e))}const U=".",L=e=>Array.from(e);function D(e,t){return e.P.has(t)||e.Q.has(t)}class F extends Array{get is_emoji(){return!0}}let M,j,K,V,H,_,G,z,q,Q,W,J;function Y(){if(M)return;let e=n("AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9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JjYYoE7xMfWV2HN2iyIqLI");const t=()=>a(e),r=()=>new Set(t()),i=(e,t)=>t.forEach(t=>e.add(t));M=new Map(c(e)),j=r(),K=t(),V=new Set(t().map(e=>K[e])),K=new Set(K),H=r(),_=r();let s=o(e),l=e();const h=()=>{let e=new Set;return t().forEach(t=>i(e,s[t])),i(e,t()),e};G=u(t=>{let r=u(e).map(e=>e+96);if(r.length){let n=t>=l;return r[0]-=32,r=g(r),n&&(r=`Restricted[${r}]`),{N:r,P:h(),Q:h(),M:!e(),R:n}}}),z=r(),q=new Map;let d=t().concat(L(z)).sort((e,t)=>e-t);d.forEach((t,r)=>{let n=e(),i=d[r]=n?d[r-n]:{V:[],M:new Map};i.V.push(t),z.has(t)||q.set(t,i)});for(let{V:e,M:t}of new Set(q.values())){let r=[];for(let t of e){let e=G.filter(e=>D(e,t)),n=r.find(({G:t})=>e.some(e=>t.has(e)));n||(n={G:new Set,V:[]},r.push(n)),n.V.push(t),i(n.G,e)}let n=r.flatMap(e=>L(e.G));for(let{G:e,V:i}of r){let r=new Set(n.filter(t=>!e.has(t)));for(let e of i)t.set(e,r)}}Q=new Set;let f=new Set;const p=e=>Q.has(e)?f.add(e):Q.add(e);for(let e of G){for(let t of e.P)p(t);for(let t of e.Q)p(t)}for(let e of Q)q.has(e)||f.has(e)||q.set(e,1);i(Q,O(Q)),W=function(e){let t=[],r=a(e);return function e({S:r,B:n},i,s){if(!(4&r&&s===i[i.length-1])){2&r&&(s=i[i.length-1]),1&r&&t.push(i);for(let t of n)for(let r of t.Q)e(t,[...i,r],s)}}(function t(n){return{S:e(),B:u(()=>{let n=a(e).map(e=>r[e]);if(n.length)return t(n)}),Q:n}}([]),[]),t}(e).map(e=>F.from(e)).sort(y),J=new Map;for(let e of W){let t=[J];for(let r of e){let e=t.map(e=>{let t=e.get(r);return t||(t=new Map,e.set(r,t)),t});65039===r?t.push(...e):t=e}for(let r of t)r.V=e}}function Z(e){return(te(e)?"":`${X($([e]))} `)+f(e)}function X(e){return`"${e}"`}function $(e,t=1/0,r=f){let n=[];ee(e[0])&&n.push("◌"),e.length>t&&(t>>=1,e=[...e.slice(0,t),8230,...e.slice(-t)]);let i=0,s=e.length;for(let t=0;t<s;t++){let s=e[t];te(s)&&(n.push(g(e.slice(i,t))),n.push(r(s)),i=t+1)}return n.push(g(e.slice(i,s))),n.join("")}function ee(e){return Y(),K.has(e)}function te(e){return Y(),H.has(e)}function re(e,t,r){let n=0;for(;;){let i=e.indexOf(t,n);if(i<0)break;e[i]=r,n=i+1}}function ne(e,t,n){if(!e)return[];Y();let i=0;return e.split(U).map(e=>{let s=p(e),a={input:s,offset:i};i+=s.length+1;try{let e,i=a.tokens=ce(s,t,n),o=i.length;if(!o)throw new Error("empty label");let c=a.output=i.flat();if(function(e){for(let t=e.lastIndexOf(95);t>0;)if(95!==e[--t])throw new Error("underscore allowed only at start")}(c),!(a.emoji=o>1||i[0].is_emoji)&&c.every(e=>e<128))!function(e){if(e.length>=4&&45==e[2]&&45==e[3])throw new Error(`invalid label extension: "${g(e.slice(0,4))}"`)}(c),e="ASCII";else{let t=i.flatMap(e=>e.is_emoji?[]:e);if(t.length){if(K.has(c[0]))throw oe("leading combining mark");for(let e=1;e<o;e++){let t=i[e];if(!t.is_emoji&&K.has(t[0]))throw oe(`emoji + combining mark: "${g(i[e-1])} + ${$([t[0]])}"`)}!function(e){let t=e[0],n=r.get(t);if(n)throw oe(`leading ${n}`);let i=e.length,s=-1;for(let a=1;a<i;a++){t=e[a];let i=r.get(t);if(i){if(s==a)throw oe(`${n} + ${i}`);s=a+1,n=i}}if(s==i)throw oe(`trailing ${n}`)}(c);let n=L(new Set(t)),[s]=function(e){let t=G;for(let r of e){let e=t.filter(e=>D(e,r));if(!e.length)throw G.some(e=>D(e,r))?ae(t[0],r):se(r);if(t=e,1==e.length)break}return t}(n);!function(e,t){for(let r of t)if(!D(e,r))throw ae(e,r);if(e.M){let e=O(t);for(let t=1,r=e.length;t<r;t++)if(V.has(e[t])){let n=t+1;for(let i;n<r&&V.has(i=e[n]);n++)for(let r=t;r<n;r++)if(e[r]==i)throw new Error(`duplicate non-spacing marks: ${Z(i)}`);if(n-t>4)throw new Error(`excessive non-spacing marks: ${X($(e.slice(t-1,n)))} (${n-t}/4)`);t=n}}}(s,t),function(e,t){let r,n=[];for(let e of t){let t=q.get(e);if(1===t)return;if(t){let n=t.M.get(e);if(r=r?r.filter(e=>n.has(e)):L(n),!r.length)return}else n.push(e)}if(r)for(let t of r)if(n.every(e=>D(t,e)))throw new Error(`whole-script confusable: ${e.N}/${t.N}`)}(s,n),e=s.N}else e="Emoji"}a.type=e}catch(e){a.error=e}return a})}function ie(e){return e.map(({input:t,error:r,output:n})=>{if(r){let n=r.message;throw new Error(1==e.length?n:`Invalid label ${X($(t,63))}: ${n}`)}return g(n)}).join(U)}function se(e){return new Error(`disallowed character: ${Z(e)}`)}function ae(e,t){let r=Z(t),n=G.find(e=>e.P.has(t));return n&&(r=`${n.N} ${r}`),new Error(`illegal mixture: ${e.N} + ${r}`)}function oe(e){return new Error(`illegal placement: ${e}`)}function ce(e,t,r){let n=[],i=[];for(e=e.slice().reverse();e.length;){let s=le(e);if(s)i.length&&(n.push(t(i)),i=[]),n.push(r(s));else{let t=e.pop();if(Q.has(t))i.push(t);else{let e=M.get(t);if(e)i.push(...e);else if(!j.has(t))throw se(t)}}}return i.length&&n.push(t(i)),n}function ue(e){return e.filter(e=>65039!=e)}function le(e,t){let r,n=J,i=e.length;for(;i&&(n=n.get(e[--i]),n);){let{V:s}=n;s&&(r=s,t&&t.push(...e.slice(i).reverse()),e.length=i)}return r}const he="valid",de="mapped",fe="ignored";function pe(e){return e==he||e==de}function ge(e){return e.some(e=>_.has(e))}function ye(e){for(let t=0;t<e.length;t++)if(e[t].type==he){let r=t+1;for(;r<e.length&&e[r].type==he;)r++;e.splice(t,r-t,{type:he,cps:e.slice(t,r).flatMap(e=>e.cps)})}return e}t.ens_beautify=function(e){let t=ne(e,R,e=>e);for(let{type:e,output:r,error:n}of t){if(n)break;"Greek"!==e&&re(r,958,926)}return ie(t)},t.ens_emoji=function(){return Y(),W.map(e=>e.slice())},t.ens_normalize=function(e){return ie(ne(e,R,ue))},t.ens_normalize_fragment=function(e,t){Y();let r=t?O:R;return e.split(U).map(e=>g(ce(p(e),r,ue).flat())).join(U)},t.ens_split=function(e,t){return ne(e,R,t?e=>e.slice():ue)},t.ens_tokenize=function e(t,{nf:r=!0}={}){Y();let n=p(t).reverse(),i=[],s=[];for(;n.length;){let e=le(n,i);if(e)s.push({type:"emoji",emoji:e.slice(),input:i,cps:ue(e)}),i=[];else{let e=n.pop();if(46==e)s.push({type:"stop",cp:e});else if(Q.has(e))s.push({type:he,cps:[e]});else if(j.has(e))s.push({type:fe,cp:e});else{let t=M.get(e);t?s.push({type:de,cp:e,cps:t.slice()}):s.push({type:"disallowed",cp:e})}}}if(r)for(let t=0,r=-1;t<s.length;t++){let n=s[t];if(pe(n.type))if(ge(n.cps)){let n=t+1;for(let e=n;e<s.length;e++){let{type:t,cps:r}=s[e];if(pe(t)){if(!ge(r))break;n=e+1}else if(t!==fe)break}r<0&&(r=t);let i=s.slice(r,n),a=i.flatMap(e=>pe(e.type)?e.cps:[]),o=R(a);y(o,a)?(s.splice(r,n-r,{type:"nfc",input:a,cps:o,tokens0:ye(i),tokens:e(g(o),{nf:!1})}),t=r):t=n-1,r=-1}else r=t;else n.type!==fe&&(r=-1)}return ye(s)},t.is_combining_mark=ee,t.nfc=R,t.nfd=O,t.safe_str_from_cps=$,t.should_escape=te},5916:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FixedBytesCoder=void 0;const n=r(8718),i=r(3233),s=r(1540);class a extends s.Coder{size;constructor(e,t){let r="bytes"+String(e);super(r,r,t,!1),(0,n.defineProperties)(this,{size:e},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(e,t){let r=(0,n.getBytesCopy)(i.Typed.dereference(t,this.type));return r.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(r)}decode(e){return(0,n.hexlify)(e.readBytes(this.size))}}t.FixedBytesCoder=a},6107:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveAddress=t.isAddress=t.isAddressable=t.getCreate2Address=t.getCreateAddress=t.getIcapAddress=t.getAddress=void 0;var n=r(4103);Object.defineProperty(t,"getAddress",{enumerable:!0,get:function(){return n.getAddress}}),Object.defineProperty(t,"getIcapAddress",{enumerable:!0,get:function(){return n.getIcapAddress}});var i=r(888);Object.defineProperty(t,"getCreateAddress",{enumerable:!0,get:function(){return i.getCreateAddress}}),Object.defineProperty(t,"getCreate2Address",{enumerable:!0,get:function(){return i.getCreate2Address}});var s=r(5722);Object.defineProperty(t,"isAddressable",{enumerable:!0,get:function(){return s.isAddressable}}),Object.defineProperty(t,"isAddress",{enumerable:!0,get:function(){return s.isAddress}}),Object.defineProperty(t,"resolveAddress",{enumerable:!0,get:function(){return s.resolveAddress}})},6339:(e,t,r)=>{var n=r(4643);r(8550);var i=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],s=[1,2,3,5],a=function(e,t){return e<<t&65535|(65535&e)>>16-t},o=function(e,t){return(65535&e)>>t|e<<16-t&65535};e.exports=n.rc2=n.rc2||{},n.rc2.expandKey=function(e,t){"string"==typeof e&&(e=n.util.createBuffer(e)),t=t||128;var r,s=e,a=e.length(),o=t,c=Math.ceil(o/8),u=255>>(7&o);for(r=a;r<128;r++)s.putByte(i[s.at(r-1)+s.at(r-a)&255]);for(s.setAt(128-c,i[s.at(128-c)&u]),r=127-c;r>=0;r--)s.setAt(r,i[s.at(r+1)^s.at(r+c)]);return s};var c=function(e,t,r){var i,c,u,l,h=!1,d=null,f=null,p=null,g=[];for(e=n.rc2.expandKey(e,t),u=0;u<64;u++)g.push(e.getInt16Le());r?(i=function(e){for(u=0;u<4;u++)e[u]+=g[l]+(e[(u+3)%4]&e[(u+2)%4])+(~e[(u+3)%4]&e[(u+1)%4]),e[u]=a(e[u],s[u]),l++},c=function(e){for(u=0;u<4;u++)e[u]+=g[63&e[(u+3)%4]]}):(i=function(e){for(u=3;u>=0;u--)e[u]=o(e[u],s[u]),e[u]-=g[l]+(e[(u+3)%4]&e[(u+2)%4])+(~e[(u+3)%4]&e[(u+1)%4]),l--},c=function(e){for(u=3;u>=0;u--)e[u]-=g[63&e[(u+3)%4]]});var y=function(e){var t=[];for(u=0;u<4;u++){var n=d.getInt16Le();null!==p&&(r?n^=p.getInt16Le():p.putInt16Le(n)),t.push(65535&n)}l=r?0:63;for(var i=0;i<e.length;i++)for(var s=0;s<e[i][0];s++)e[i][1](t);for(u=0;u<4;u++)null!==p&&(r?p.putInt16Le(t[u]):t[u]^=p.getInt16Le()),f.putInt16Le(t[u])},m=null;return m={start:function(e,t){e&&"string"==typeof e&&(e=n.util.createBuffer(e)),h=!1,d=n.util.createBuffer(),f=t||new n.util.createBuffer,p=e,m.output=f},update:function(e){for(h||d.putBuffer(e);d.length()>=8;)y([[5,i],[1,c],[6,i],[1,c],[5,i]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,d,!r);else{var n=8===d.length()?8:8-d.length();d.fillWithByte(n,n)}if(t&&(h=!0,m.update()),!r&&(t=0===d.length()))if(e)t=e(8,f,!r);else{var i=f.length(),s=f.at(i-1);s>i?t=!1:f.truncate(s)}return t}}};n.rc2.startEncrypting=function(e,t,r){var i=n.rc2.createEncryptionCipher(e,128);return i.start(t,r),i},n.rc2.createEncryptionCipher=function(e,t){return c(e,t,!0)},n.rc2.startDecrypting=function(e,t,r){var i=n.rc2.createDecryptionCipher(e,128);return i.start(t,r),i},n.rc2.createDecryptionCipher=function(e,t){return c(e,t,!1)}},6441:(e,t)=>{"use strict";function r(e,t,r){const n=t.split("|").map(e=>e.trim());for(let r=0;r<n.length;r++)switch(t){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof e===t)return}const i=new Error(`invalid value for type ${t}`);throw i.code="INVALID_ARGUMENT",i.argument=`value.${r}`,i.value=e,i}Object.defineProperty(t,"__esModule",{value:!0}),t.defineProperties=t.resolveProperties=void 0,t.resolveProperties=async function(e){const t=Object.keys(e);return(await Promise.all(t.map(t=>Promise.resolve(e[t])))).reduce((e,r,n)=>(e[t[n]]=r,e),{})},t.defineProperties=function(e,t,n){for(let i in t){let s=t[i];const a=n?n[i]:null;a&&r(s,a,i),Object.defineProperty(e,i,{enumerable:!0,value:s,writable:!1})}}},6450:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuickNodeProvider=void 0;const n=r(8718),i=r(324),s=r(4391),a=r(24),o="919b412a057b5e9c9b6dce193c5a60242d6efadb";class c extends a.JsonRpcProvider{token;constructor(e,t){null==e&&(e="mainnet");const r=s.Network.from(e);null==t&&(t=o);super(c.getRequest(r,t),r,{staticNetwork:r}),(0,n.defineProperties)(this,{token:t})}_getProvider(e){try{return new c(e,this.token)}catch(e){}return super._getProvider(e)}isCommunityResource(){return this.token===o}static getRequest(e,t){null==t&&(t=o);const r=new n.FetchRequest(`https://${function(e){switch(e){case"mainnet":return"ethers.quiknode.pro";case"goerli":return"ethers.ethereum-goerli.quiknode.pro";case"sepolia":return"ethers.ethereum-sepolia.quiknode.pro";case"holesky":return"ethers.ethereum-holesky.quiknode.pro";case"arbitrum":return"ethers.arbitrum-mainnet.quiknode.pro";case"arbitrum-goerli":return"ethers.arbitrum-goerli.quiknode.pro";case"arbitrum-sepolia":return"ethers.arbitrum-sepolia.quiknode.pro";case"base":return"ethers.base-mainnet.quiknode.pro";case"base-goerli":return"ethers.base-goerli.quiknode.pro";case"base-spolia":return"ethers.base-sepolia.quiknode.pro";case"bnb":return"ethers.bsc.quiknode.pro";case"bnbt":return"ethers.bsc-testnet.quiknode.pro";case"matic":return"ethers.matic.quiknode.pro";case"matic-mumbai":return"ethers.matic-testnet.quiknode.pro";case"optimism":return"ethers.optimism.quiknode.pro";case"optimism-goerli":return"ethers.optimism-goerli.quiknode.pro";case"optimism-sepolia":return"ethers.optimism-sepolia.quiknode.pro";case"xdai":return"ethers.xdai.quiknode.pro"}(0,n.assertArgument)(!1,"unsupported network","network",e)}(e.name)}/${t}`);return r.allowGzip=!0,t===o&&(r.retryFunc=async(e,t,r)=>((0,i.showThrottleMessage)("QuickNodeProvider"),!0)),r}}t.QuickNodeProvider=c},6468:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lock=t.Signature=t.SigningKey=t.scryptSync=t.scrypt=t.pbkdf2=t.sha512=t.sha256=t.ripemd160=t.keccak256=t.randomBytes=t.computeHmac=void 0;const n=r(6609);Object.defineProperty(t,"computeHmac",{enumerable:!0,get:function(){return n.computeHmac}});const i=r(832);Object.defineProperty(t,"keccak256",{enumerable:!0,get:function(){return i.keccak256}});const s=r(1352);Object.defineProperty(t,"ripemd160",{enumerable:!0,get:function(){return s.ripemd160}});const a=r(5587);Object.defineProperty(t,"pbkdf2",{enumerable:!0,get:function(){return a.pbkdf2}});const o=r(7065);Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return o.randomBytes}});const c=r(8990);Object.defineProperty(t,"scrypt",{enumerable:!0,get:function(){return c.scrypt}}),Object.defineProperty(t,"scryptSync",{enumerable:!0,get:function(){return c.scryptSync}});const u=r(5218);Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return u.sha256}}),Object.defineProperty(t,"sha512",{enumerable:!0,get:function(){return u.sha512}});var l=r(313);Object.defineProperty(t,"SigningKey",{enumerable:!0,get:function(){return l.SigningKey}});var h=r(1154);Object.defineProperty(t,"Signature",{enumerable:!0,get:function(){return h.Signature}}),t.lock=function(){n.computeHmac.lock(),i.keccak256.lock(),a.pbkdf2.lock(),o.randomBytes.lock(),s.ripemd160.lock(),c.scrypt.lock(),c.scryptSync.lock(),u.sha256.lock(),u.sha512.lock(),o.randomBytes.lock()}},6531:(e,t,r)=>{var n=r(4643);r(8550),n.mgf=n.mgf||{},(e.exports=n.mgf.mgf1=n.mgf1=n.mgf1||{}).create=function(e){return{generate:function(t,r){for(var i=new n.util.ByteBuffer,s=Math.ceil(r/e.digestLength),a=0;a<s;a++){var o=new n.util.ByteBuffer;o.putInt32(a),e.start(),e.update(t+o.getBytes()),i.putBuffer(e.digest())}return i.truncate(i.length()-r),i.getBytes()}}}},6532:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WordlistOwlA=void 0;const n=r(6795),i=r(3018);class s extends n.WordlistOwl{#Pt;constructor(e,t,r,n){super(e,t,n),this.#Pt=r}get _accent(){return this.#Pt}_decodeWords(){return(0,i.decodeOwlA)(this._data,this._accent)}}t.WordlistOwlA=s},6566:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.verifyMessage=t.hashMessage=void 0;const n=r(6468),i=r(2234),s=r(203),a=r(8718);function o(e){return"string"==typeof e&&(e=(0,a.toUtf8Bytes)(e)),(0,n.keccak256)((0,a.concat)([(0,a.toUtf8Bytes)(i.MessagePrefix),(0,a.toUtf8Bytes)(String(e.length)),e]))}t.hashMessage=o,t.verifyMessage=function(e,t){const r=o(e);return(0,s.recoverAddress)(r,t)}},6609:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.computeHmac=void 0;const n=r(5202),i=r(8718);let s=!1;const a=function(e,t,r){return(0,n.createHmac)(e,t).update(r).digest()};let o=a;function c(e,t,r){const n=(0,i.getBytes)(t,"key"),s=(0,i.getBytes)(r,"data");return(0,i.hexlify)(o(e,n,s))}t.computeHmac=c,c._=a,c.lock=function(){s=!0},c.register=function(e){if(s)throw new Error("computeHmac is locked");o=e},Object.freeze(c)},6660:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha384=t.sha512_256=t.sha512_224=t.sha512=t.SHA512=void 0;const n=r(5337),i=r(8060),s=r(1197),[a,o]=i.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),c=new Uint32Array(80),u=new Uint32Array(80);class l extends n.SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:s,Dh:a,Dl:o,Eh:c,El:u,Fh:l,Fl:h,Gh:d,Gl:f,Hh:p,Hl:g}=this;return[e,t,r,n,i,s,a,o,c,u,l,h,d,f,p,g]}set(e,t,r,n,i,s,a,o,c,u,l,h,d,f,p,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|s,this.Dh=0|a,this.Dl=0|o,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|h,this.Gh=0|d,this.Gl=0|f,this.Hh=0|p,this.Hl=0|g}process(e,t){for(let r=0;r<16;r++,t+=4)c[r]=e.getUint32(t),u[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|c[e-15],r=0|u[e-15],n=i.default.rotrSH(t,r,1)^i.default.rotrSH(t,r,8)^i.default.shrSH(t,r,7),s=i.default.rotrSL(t,r,1)^i.default.rotrSL(t,r,8)^i.default.shrSL(t,r,7),a=0|c[e-2],o=0|u[e-2],l=i.default.rotrSH(a,o,19)^i.default.rotrBH(a,o,61)^i.default.shrSH(a,o,6),h=i.default.rotrSL(a,o,19)^i.default.rotrBL(a,o,61)^i.default.shrSL(a,o,6),d=i.default.add4L(s,h,u[e-7],u[e-16]),f=i.default.add4H(d,n,l,c[e-7],c[e-16]);c[e]=0|f,u[e]=0|d}let{Ah:r,Al:n,Bh:s,Bl:l,Ch:h,Cl:d,Dh:f,Dl:p,Eh:g,El:y,Fh:m,Fl:b,Gh:w,Gl:v,Hh:A,Hl:E}=this;for(let e=0;e<80;e++){const t=i.default.rotrSH(g,y,14)^i.default.rotrSH(g,y,18)^i.default.rotrBH(g,y,41),C=i.default.rotrSL(g,y,14)^i.default.rotrSL(g,y,18)^i.default.rotrBL(g,y,41),B=g&m^~g&w,S=y&b^~y&v,k=i.default.add5L(E,C,S,o[e],u[e]),T=i.default.add5H(k,A,t,B,a[e],c[e]),I=0|k,P=i.default.rotrSH(r,n,28)^i.default.rotrBH(r,n,34)^i.default.rotrBH(r,n,39),N=i.default.rotrSL(r,n,28)^i.default.rotrBL(r,n,34)^i.default.rotrBL(r,n,39),x=r&s^r&h^s&h,O=n&l^n&d^l&d;A=0|w,E=0|v,w=0|m,v=0|b,m=0|g,b=0|y,({h:g,l:y}=i.default.add(0|f,0|p,0|T,0|I)),f=0|h,p=0|d,h=0|s,d=0|l,s=0|r,l=0|n;const R=i.default.add3L(I,N,O);r=i.default.add3H(R,T,P,x),n=0|R}({h:r,l:n}=i.default.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:s,l}=i.default.add(0|this.Bh,0|this.Bl,0|s,0|l)),({h,l:d}=i.default.add(0|this.Ch,0|this.Cl,0|h,0|d)),({h:f,l:p}=i.default.add(0|this.Dh,0|this.Dl,0|f,0|p)),({h:g,l:y}=i.default.add(0|this.Eh,0|this.El,0|g,0|y)),({h:m,l:b}=i.default.add(0|this.Fh,0|this.Fl,0|m,0|b)),({h:w,l:v}=i.default.add(0|this.Gh,0|this.Gl,0|w,0|v)),({h:A,l:E}=i.default.add(0|this.Hh,0|this.Hl,0|A,0|E)),this.set(r,n,s,l,h,d,f,p,g,y,m,b,w,v,A,E)}roundClean(){c.fill(0),u.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}t.SHA512=l;class h extends l{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}}class d extends l{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class f extends l{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}t.sha512=(0,s.wrapConstructor)(()=>new l),t.sha512_224=(0,s.wrapConstructor)(()=>new h),t.sha512_256=(0,s.wrapConstructor)(()=>new d),t.sha384=(0,s.wrapConstructor)(()=>new f)},6662:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encodeBase64=t.decodeBase64=void 0;const n=r(5020);t.decodeBase64=function(e){e=atob(e);const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return(0,n.getBytes)(t)},t.encodeBase64=function(e){const t=(0,n.getBytes)(e);let r="";for(let e=0;e<t.length;e++)r+=String.fromCharCode(t[e]);return btoa(r)}},6795:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WordlistOwl=void 0;const n=r(7477),i=r(8718),s=r(4789),a=r(5088);class o extends a.Wordlist{#M;#Nt;constructor(e,t,r){super(e),this.#M=t,this.#Nt=r,this.#xt=null}get _data(){return this.#M}_decodeWords(){return(0,s.decodeOwl)(this.#M)}#xt;#Ot(){if(null==this.#xt){const e=this._decodeWords();if((0,n.id)(e.join("\n")+"\n")!==this.#Nt)throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);this.#xt=e}return this.#xt}getWord(e){const t=this.#Ot();return(0,i.assertArgument)(e>=0&&e<t.length,`invalid word index: ${e}`,"index",e),t[e]}getWordIndex(e){return this.#Ot().indexOf(e)}}t.WordlistOwl=o},6829:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Contract=t.BaseContract=t.resolveArgs=t.copyOverrides=void 0;const n=r(333),i=r(6107),s=r(532),a=r(8718),o=r(5519),c=BigInt(0);function u(e){return e&&"function"==typeof e.call}function l(e){return e&&"function"==typeof e.estimateGas}function h(e){return e&&"function"==typeof e.resolveName}function d(e){return e&&"function"==typeof e.sendTransaction}function f(e){if(null!=e){if(h(e))return e;if(e.provider)return e.provider}}class p{#Fe;fragment;constructor(e,t,r){if((0,a.defineProperties)(this,{fragment:t}),t.inputs.length<r.length)throw new Error("too many arguments");const n=g(e.runner,"resolveName"),s=h(n)?n:null;this.#Fe=async function(){const n=await Promise.all(t.inputs.map((e,t)=>null==r[t]?null:e.walkAsync(r[t],(e,t)=>"address"===e?Array.isArray(t)?Promise.all(t.map(e=>(0,i.resolveAddress)(e,s))):(0,i.resolveAddress)(t,s):t)));return e.interface.encodeFilterTopics(t,n)}()}getTopicFilter(){return this.#Fe}}function g(e,t){return null==e?null:"function"==typeof e[t]?e:e.provider&&"function"==typeof e.provider[t]?e.provider:null}function y(e){return null==e?null:e.provider||null}async function m(e,t){const r=n.Typed.dereference(e,"overrides");(0,a.assertArgument)("object"==typeof r,"invalid overrides parameter","overrides",e);const i=(0,s.copyRequest)(r);return(0,a.assertArgument)(null==i.to||(t||[]).indexOf("to")>=0,"cannot override to","overrides.to",i.to),(0,a.assertArgument)(null==i.data||(t||[]).indexOf("data")>=0,"cannot override data","overrides.data",i.data),i.from&&(i.from=i.from),i}async function b(e,t,r){const s=g(e,"resolveName"),a=h(s)?s:null;return await Promise.all(t.map((e,t)=>e.walkAsync(r[t],(e,t)=>(t=n.Typed.dereference(t,e),"address"===e?(0,i.resolveAddress)(t,a):t))))}function w(e){const t=async function(t){const r=await m(t,["data"]);r.to=await e.getAddress(),r.from&&(r.from=await(0,i.resolveAddress)(r.from,f(e.runner)));const n=e.interface,s=(0,a.getBigInt)(r.value||c,"overrides.value")===c,o="0x"===(r.data||"0x");!n.fallback||n.fallback.payable||!n.receive||o||s||(0,a.assertArgument)(!1,"cannot send data to receive or send value to non-payable fallback","overrides",t),(0,a.assertArgument)(n.fallback||o,"cannot send data to receive-only contract","overrides.data",r.data);const u=n.receive||n.fallback&&n.fallback.payable;return(0,a.assertArgument)(u||s,"cannot send value to non-payable fallback","overrides.value",r.value),(0,a.assertArgument)(n.fallback||o,"cannot send data to receive-only contract","overrides.data",r.data),r},r=async function(r){const n=e.runner;(0,a.assert)(d(n),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const i=await n.sendTransaction(await t(r)),s=y(e.runner);return new o.ContractTransactionResponse(e.interface,s,i)},n=async e=>await r(e);return(0,a.defineProperties)(n,{_contract:e,estimateGas:async function(r){const n=g(e.runner,"estimateGas");return(0,a.assert)(l(n),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await n.estimateGas(await t(r))},populateTransaction:t,send:r,staticCall:async function(r){const n=g(e.runner,"call");(0,a.assert)(u(n),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const i=await t(r);try{return await n.call(i)}catch(t){if((0,a.isCallException)(t)&&t.data)throw e.interface.makeError(t.data,i);throw t}}}),n}t.copyOverrides=m,t.resolveArgs=b;const v=Symbol.for("_ethersInternal_contract"),A=new WeakMap;function E(e){return A.get(e[v])}async function C(e,t){let r,n=null;if(Array.isArray(t)){const n=function(t){if((0,a.isHexString)(t,32))return t;const r=e.interface.getEvent(t);return(0,a.assertArgument)(r,"unknown fragment","name",t),r.topicHash};r=t.map(e=>null==e?null:Array.isArray(e)?e.map(n):n(e))}else"*"===t?r=[null]:"string"==typeof t?(0,a.isHexString)(t,32)?r=[t]:(n=e.interface.getEvent(t),(0,a.assertArgument)(n,"unknown fragment","event",t),r=[n.topicHash]):(i=t)&&"object"==typeof i&&"getTopicFilter"in i&&"function"==typeof i.getTopicFilter&&i.fragment?r=await t.getTopicFilter():"fragment"in t?(n=t.fragment,r=[n.topicHash]):(0,a.assertArgument)(!1,"unknown event name","event",t);var i;r=r.map(e=>{if(null==e)return null;if(Array.isArray(e)){const t=Array.from(new Set(e.map(e=>e.toLowerCase())).values());return 1===t.length?t[0]:(t.sort(),t)}return e.toLowerCase()});return{fragment:n,tag:r.map(e=>null==e?"null":Array.isArray(e)?e.join("|"):e).join("&"),topics:r}}async function B(e,t){const{subs:r}=E(e);return r.get((await C(e,t)).tag)||null}async function S(e,t,r){const n=y(e.runner);(0,a.assert)(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:t});const{fragment:i,tag:s,topics:c}=await C(e,r),{addr:u,subs:l}=E(e);let h=l.get(s);if(!h){const t={address:u||e,topics:c},a=t=>{let n=i;if(null==n)try{n=e.interface.getEvent(t.topics[0])}catch(e){}if(n){const s=n,a=i?e.interface.decodeEventLog(i,t.data,t.topics):[];T(e,r,a,n=>new o.ContractEventPayload(e,n,r,s,t))}else T(e,r,[],n=>new o.ContractUnknownEventPayload(e,n,r,t))};let d=[];h={tag:s,listeners:[],start:()=>{d.length||d.push(n.on(t,a))},stop:async()=>{if(0==d.length)return;let e=d;d=[],await Promise.all(e),n.off(t,a)}},l.set(s,h)}return h}let k=Promise.resolve();async function T(e,t,r,n){try{await k}catch(e){}const i=async function(e,t,r,n){await k;const i=await B(e,t);if(!i)return!1;const s=i.listeners.length;return i.listeners=i.listeners.filter(({listener:t,once:i})=>{const s=Array.from(r);n&&s.push(n(i?null:t));try{t.call(e,...s)}catch(e){}return!i}),0===i.listeners.length&&(i.stop(),E(e).subs.delete(i.tag)),s>0}(e,t,r,n);return k=i,await i}const I=["then"];class P{target;interface;runner;filters;[v];fallback;constructor(e,t,r,s){(0,a.assertArgument)("string"==typeof e||(0,i.isAddressable)(e),"invalid value for Contract target","target",e),null==r&&(r=null);const c=n.Interface.from(t);let u;(0,a.defineProperties)(this,{target:e,runner:r,interface:c}),Object.defineProperty(this,v,{value:{}});let l=null,d=null;if(s){const e=y(r);d=new o.ContractTransactionResponse(this.interface,e,s)}let f=new Map;if("string"==typeof e)if((0,a.isHexString)(e))l=e,u=Promise.resolve(e);else{const t=g(r,"resolveName");if(!h(t))throw(0,a.makeError)("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});u=t.resolveName(e).then(t=>{if(null==t)throw(0,a.makeError)("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return E(this).addr=t,t})}else u=e.getAddress().then(e=>{if(null==e)throw new Error("TODO");return E(this).addr=e,e});var p,m;p=this,m={addrPromise:u,addr:l,deployTx:d,subs:f},A.set(p[v],m);const b=new Proxy({},{get:(e,t,r)=>{if("symbol"==typeof t||I.indexOf(t)>=0)return Reflect.get(e,t,r);try{return this.getEvent(t)}catch(e){if(!(0,a.isError)(e,"INVALID_ARGUMENT")||"key"!==e.argument)throw e}},has:(e,t)=>I.indexOf(t)>=0?Reflect.has(e,t):Reflect.has(e,t)||this.interface.hasEvent(String(t))});return(0,a.defineProperties)(this,{filters:b}),(0,a.defineProperties)(this,{fallback:c.receive||c.fallback?w(this):null}),new Proxy(this,{get:(e,t,r)=>{if("symbol"==typeof t||t in e||I.indexOf(t)>=0)return Reflect.get(e,t,r);try{return e.getFunction(t)}catch(e){if(!(0,a.isError)(e,"INVALID_ARGUMENT")||"key"!==e.argument)throw e}},has:(e,t)=>"symbol"==typeof t||t in e||I.indexOf(t)>=0?Reflect.has(e,t):e.interface.hasFunction(t)})}connect(e){return new P(this.target,this.interface,e)}attach(e){return new P(e,this.interface,this.runner)}async getAddress(){return await E(this).addrPromise}async getDeployedCode(){const e=y(this.runner);(0,a.assert)(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const t=await e.getCode(await this.getAddress());return"0x"===t?null:t}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(null!=await this.getDeployedCode())return this;const t=y(this.runner);return(0,a.assert)(null!=t,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((e,r)=>{const n=async()=>{try{if(null!=await this.getDeployedCode())return e(this);t.once("block",n)}catch(e){r(e)}};n()})}deploymentTransaction(){return E(this).deployTx}getFunction(e){"string"!=typeof e&&(e=e.format());const t=function(e,t){const r=function(...r){const n=e.interface.getFunction(t,r);return(0,a.assert)(n,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:r}}),n},n=async function(...t){const n=r(...t);let s={};if(n.inputs.length+1===t.length&&(s=await m(t.pop()),s.from&&(s.from=await(0,i.resolveAddress)(s.from,f(e.runner)))),n.inputs.length!==t.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const o=await b(e.runner,n.inputs,t);return Object.assign({},s,await(0,a.resolveProperties)({to:e.getAddress(),data:e.interface.encodeFunctionData(n,o)}))},s=async function(...e){const t=await h(...e);return 1===t.length?t[0]:t},c=async function(...t){const r=e.runner;(0,a.assert)(d(r),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const i=await r.sendTransaction(await n(...t)),s=y(e.runner);return new o.ContractTransactionResponse(e.interface,s,i)},h=async function(...t){const i=g(e.runner,"call");(0,a.assert)(u(i),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const s=await n(...t);let o="0x";try{o=await i.call(s)}catch(t){if((0,a.isCallException)(t)&&t.data)throw e.interface.makeError(t.data,s);throw t}const c=r(...t);return e.interface.decodeFunctionResult(c,o)},p=async(...e)=>r(...e).constant?await s(...e):await c(...e);return(0,a.defineProperties)(p,{name:e.interface.getFunctionName(t),_contract:e,_key:t,getFragment:r,estimateGas:async function(...t){const r=g(e.runner,"estimateGas");return(0,a.assert)(l(r),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await r.estimateGas(await n(...t))},populateTransaction:n,send:c,staticCall:s,staticCallResult:h}),Object.defineProperty(p,"fragment",{configurable:!1,enumerable:!0,get:()=>{const r=e.interface.getFunction(t);return(0,a.assert)(r,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),r}}),p}(this,e);return t}getEvent(e){return"string"!=typeof e&&(e=e.format()),function(e,t){const r=function(...r){const n=e.interface.getEvent(t,r);return(0,a.assert)(n,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:r}}),n},n=function(...t){return new p(e,r(...t),t)};return(0,a.defineProperties)(n,{name:e.interface.getEventName(t),_contract:e,_key:t,getFragment:r}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{const r=e.interface.getEvent(t);return(0,a.assert)(r,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),r}}),n}(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,t,r){null==t&&(t=0),null==r&&(r="latest");const{addr:n,addrPromise:i}=E(this),c=n||await i,{fragment:u,topics:l}=await C(this,e),h={address:c,topics:l,fromBlock:t,toBlock:r},d=y(this.runner);return(0,a.assert)(d,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await d.getLogs(h)).map(e=>{let t=u;if(null==t)try{t=this.interface.getEvent(e.topics[0])}catch(e){}if(t)try{return new o.EventLog(e,this.interface,t)}catch(t){return new o.UndecodedEventLog(e,t)}return new s.Log(e,d)})}async on(e,t){const r=await S(this,"on",e);return r.listeners.push({listener:t,once:!1}),r.start(),this}async once(e,t){const r=await S(this,"once",e);return r.listeners.push({listener:t,once:!0}),r.start(),this}async emit(e,...t){return await T(this,e,t,null)}async listenerCount(e){if(e){const t=await B(this,e);return t?t.listeners.length:0}const{subs:t}=E(this);let r=0;for(const{listeners:e}of t.values())r+=e.length;return r}async listeners(e){if(e){const t=await B(this,e);return t?t.listeners.map(({listener:e})=>e):[]}const{subs:t}=E(this);let r=[];for(const{listeners:e}of t.values())r=r.concat(e.map(({listener:e})=>e));return r}async off(e,t){const r=await B(this,e);if(!r)return this;if(t){const e=r.listeners.map(({listener:e})=>e).indexOf(t);e>=0&&r.listeners.splice(e,1)}return null!=t&&0!==r.listeners.length||(r.stop(),E(this).subs.delete(r.tag)),this}async removeAllListeners(e){if(e){const t=await B(this,e);if(!t)return this;t.stop(),E(this).subs.delete(t.tag)}else{const{subs:e}=E(this);for(const{tag:t,stop:r}of e.values())r(),e.delete(t)}return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return await this.off(e,t)}static buildClass(e){return class extends P{constructor(t,r=null){super(t,e,r)}}}static from(e,t,r){null==r&&(r=null);return new this(e,t,r)}}t.BaseContract=P;class N extends(function(){return P}()){}t.Contract=N},6862:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChainstackProvider=void 0;const n=r(8718),i=r(324),s=r(4391),a=r(24);function o(e){switch(e){case"mainnet":return"39f1d67cedf8b7831010a665328c9197";case"arbitrum":return"0550c209db33c3abf4cc927e1e18cea1";case"bnb":return"98b5a77e531614387366f6fc5da097f8";case"matic":return"cd9d4d70377471aa7c142ec4a4205249"}(0,n.assertArgument)(!1,"unsupported network","network",e)}class c extends a.JsonRpcProvider{apiKey;constructor(e,t){null==e&&(e="mainnet");const r=s.Network.from(e);null==t&&(t=o(r.name));super(c.getRequest(r,t),r,{staticNetwork:r}),(0,n.defineProperties)(this,{apiKey:t})}_getProvider(e){try{return new c(e,this.apiKey)}catch(e){}return super._getProvider(e)}isCommunityResource(){return this.apiKey===o(this._network.name)}static getRequest(e,t){null==t&&(t=o(e.name));const r=new n.FetchRequest(`https://${function(e){switch(e){case"mainnet":return"ethereum-mainnet.core.chainstack.com";case"arbitrum":return"arbitrum-mainnet.core.chainstack.com";case"bnb":return"bsc-mainnet.core.chainstack.com";case"matic":return"polygon-mainnet.core.chainstack.com"}(0,n.assertArgument)(!1,"unsupported network","network",e)}(e.name)}/${t}`);return r.allowGzip=!0,t===o(e.name)&&(r.retryFunc=async(e,t,r)=>((0,i.showThrottleMessage)("ChainstackProvider"),!0)),r}}t.ChainstackProvider=c},6876:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeBase58=t.encodeBase58=void 0;const n=r(5020),i=r(355),s=r(9009),a="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";let o=null;function c(e){if(null==o){o={};for(let e=0;e<58;e++)o[a[e]]=BigInt(e)}const t=o[e];return(0,i.assertArgument)(null!=t,"invalid base58 value","letter",e),t}const u=BigInt(0),l=BigInt(58);t.encodeBase58=function(e){const t=(0,n.getBytes)(e);let r=(0,s.toBigInt)(t),i="";for(;r;)i=a[Number(r%l)]+i,r/=l;for(let e=0;e<t.length&&!t[e];e++)i=a[0]+i;return i},t.decodeBase58=function(e){let t=u;for(let r=0;r<e.length;r++)t*=l,t+=c(e[r]);return t}},6896:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EtherscanProvider=t.EtherscanPlugin=void 0;const n=r(333),i=r(7675),s=r(203),a=r(8718),o=r(3633),c=r(4391),u=r(6918),l=r(324);const h="org.ethers.plugins.provider.Etherscan";class d extends u.NetworkPlugin{baseUrl;constructor(e){super(h),(0,a.defineProperties)(this,{baseUrl:e})}clone(){return new d(this.baseUrl)}}t.EtherscanPlugin=d;const f=["enableCcipRead"];let p=1;class g extends o.AbstractProvider{network;apiKey;#Rt;constructor(e,t){const r=null!=t?t:null;super();const n=c.Network.from(e);this.#Rt=n.getPlugin(h),(0,a.defineProperties)(this,{apiKey:r,network:n})}getBaseUrl(){if(this.#Rt)return this.#Rt.baseUrl;switch(this.network.name){case"mainnet":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"holesky":return"https://api-holesky.etherscan.io";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"base":return"https://api.basescan.org";case"base-sepolia":return"https://api-sepolia.basescan.org";case"bnb":return"https://api.bscscan.com";case"bnbt":return"https://api-testnet.bscscan.com";case"matic":return"https://api.polygonscan.com";case"matic-amoy":return"https://api-amoy.polygonscan.com";case"matic-mumbai":return"https://api-testnet.polygonscan.com";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}(0,a.assertArgument)(!1,"unsupported network","network",this.network)}getUrl(e,t){let r=Object.keys(t).reduce((e,r)=>{const n=t[r];return null!=n&&(e+=`&${r}=${n}`),e},"");return this.apiKey&&(r+=`&apikey=${this.apiKey}`),`https://api.etherscan.io/v2/api?chainid=${this.network.chainId}&module=${e}${r}`}getPostUrl(){return`https://api.etherscan.io/v2/api?chainid=${this.network.chainId}`}getPostData(e,t){return t.module=e,t.apikey=this.apiKey,t.chainid=this.network.chainId,t}async detectNetwork(){return this.network}async fetch(e,t,r){const n=p++,i=r?this.getPostUrl():this.getUrl(e,t),s=r?this.getPostData(e,t):null;this.emit("debug",{action:"sendRequest",id:n,url:i,payload:s});const o=new a.FetchRequest(i);o.setThrottleParams({slotInterval:1e3}),o.retryFunc=(e,t,r)=>(this.isCommunityResource()&&(0,l.showThrottleMessage)("Etherscan"),Promise.resolve(!0)),o.processFunc=async(t,r)=>{const i=r.hasBody()?JSON.parse((0,a.toUtf8String)(r.body)):{},s=("string"==typeof i.result?i.result:"").toLowerCase().indexOf("rate limit")>=0;return"proxy"===e?i&&0==i.status&&"NOTOK"==i.message&&s&&(this.emit("debug",{action:"receiveError",id:n,reason:"proxy-NOTOK",error:i}),r.throwThrottleError(i.result,2e3)):s&&(this.emit("debug",{action:"receiveError",id:n,reason:"null result",error:i.result}),r.throwThrottleError(i.result,2e3)),r},s&&(o.setHeader("content-type","application/x-www-form-urlencoded; charset=UTF-8"),o.body=Object.keys(s).map(e=>`${e}=${s[e]}`).join("&"));const c=await o.send();try{c.assertOk()}catch(e){this.emit("debug",{action:"receiveError",id:n,error:e,reason:"assertOk"}),(0,a.assert)(!1,"response error","SERVER_ERROR",{request:o,response:c})}c.hasBody()||(this.emit("debug",{action:"receiveError",id:n,error:"missing body",reason:"null body"}),(0,a.assert)(!1,"missing response","SERVER_ERROR",{request:o,response:c}));const u=JSON.parse((0,a.toUtf8String)(c.body));return"proxy"===e?("2.0"!=u.jsonrpc&&(this.emit("debug",{action:"receiveError",id:n,result:u,reason:"invalid JSON-RPC"}),(0,a.assert)(!1,"invalid JSON-RPC response (missing jsonrpc='2.0')","SERVER_ERROR",{request:o,response:c,info:{result:u}})),u.error&&(this.emit("debug",{action:"receiveError",id:n,result:u,reason:"JSON-RPC error"}),(0,a.assert)(!1,"error response","SERVER_ERROR",{request:o,response:c,info:{result:u}})),this.emit("debug",{action:"receiveRequest",id:n,result:u}),u.result):0!=u.status||"No records found"!==u.message&&"No transactions found"!==u.message?((1!=u.status||"string"==typeof u.message&&!u.message.match(/^OK/))&&(this.emit("debug",{action:"receiveError",id:n,result:u}),(0,a.assert)(!1,"error response","SERVER_ERROR",{request:o,response:c,info:{result:u}})),this.emit("debug",{action:"receiveRequest",id:n,result:u}),u.result):(this.emit("debug",{action:"receiveRequest",id:n,result:u}),u.result)}_getTransactionPostData(e){const t={};for(let r in e){if(f.indexOf(r)>=0)continue;if(null==e[r])continue;let n=e[r];if(("type"!==r||0!==n)&&("blockTag"!==r||"latest"!==n)){if({type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r])n=(0,a.toQuantity)(n);else if("accessList"===r)n="["+(0,s.accessListify)(n).map(e=>`{address:"${e.address}",storageKeys:["${e.storageKeys.join('","')}"]}`).join(",")+"]";else if("blobVersionedHashes"===r){if(0===n.length)continue;(0,a.assert)(!1,"Etherscan API does not support blobVersionedHashes","UNSUPPORTED_OPERATION",{operation:"_getTransactionPostData",info:{transaction:e}})}else n=(0,a.hexlify)(n);t[r]=n}}return t}_checkError(e,t,r){let i="";if((0,a.isError)(t,"SERVER_ERROR")){try{i=t.info.result.error.message}catch(e){}if(!i)try{i=t.info.message}catch(e){}}if("estimateGas"===e.method&&!i.match(/revert/i)&&i.match(/insufficient funds/i)&&(0,a.assert)(!1,"insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.transaction}),("call"===e.method||"estimateGas"===e.method)&&i.match(/execution reverted/i)){let r="";try{r=t.info.result.error.data}catch(t){}const i=n.AbiCoder.getBuiltinCallException(e.method,e.transaction,r);throw i.info={request:e,error:t},i}if(i&&"broadcastTransaction"===e.method){const t=s.Transaction.from(e.signedTransaction);i.match(/replacement/i)&&i.match(/underpriced/i)&&(0,a.assert)(!1,"replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:t}),i.match(/insufficient funds/)&&(0,a.assert)(!1,"insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:t}),i.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&(0,a.assert)(!1,"nonce has already been used","NONCE_EXPIRED",{transaction:t})}throw t}async _detectNetwork(){return this.network}async _perform(e){switch(e.method){case"chainId":return this.network.chainId;case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getPriorityFee":if("mainnet"===this.network.name)return"1000000000";if("optimism"===this.network.name)return"1000000";throw new Error("fallback onto the AbstractProvider default");case"getBalance":return this.fetch("account",{action:"balance",address:e.address,tag:e.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:e.address,tag:e.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:e.address,tag:e.blockTag});case"getStorage":return this.fetch("proxy",{action:"eth_getStorageAt",address:e.address,position:e.position,tag:e.blockTag});case"broadcastTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:e.signedTransaction},!0).catch(t=>this._checkError(e,t,e.signedTransaction));case"getBlock":if("blockTag"in e)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:e.blockTag,boolean:e.includeTransactions?"true":"false"});(0,a.assert)(!1,"getBlock by blockHash not supported by Etherscan","UNSUPPORTED_OPERATION",{operation:"getBlock(blockHash)"});case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:e.hash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:e.hash});case"call":{if("latest"!==e.blockTag)throw new Error("EtherscanProvider does not support blockTag for call");const t=this._getTransactionPostData(e.transaction);t.module="proxy",t.action="eth_call";try{return await this.fetch("proxy",t,!0)}catch(t){return this._checkError(e,t,e.transaction)}}case"estimateGas":{const t=this._getTransactionPostData(e.transaction);t.module="proxy",t.action="eth_estimateGas";try{return await this.fetch("proxy",t,!0)}catch(t){return this._checkError(e,t,e.transaction)}}}return super._perform(e)}async getNetwork(){return this.network}async getEtherPrice(){return"mainnet"!==this.network.name?0:parseFloat((await this.fetch("stats",{action:"ethprice"})).ethusd)}async getContract(e){let t=this._getAddress(e);var r;(r=t)&&"function"==typeof r.then&&(t=await t);try{const e=await this.fetch("contract",{action:"getabi",address:t}),r=JSON.parse(e);return new i.Contract(t,r,this)}catch(e){return null}}isCommunityResource(){return null==this.apiKey}}t.EtherscanProvider=g},6918:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FetchUrlFeeDataNetworkPlugin=t.FeeDataNetworkPlugin=t.EnsPlugin=t.GasCostPlugin=t.NetworkPlugin=void 0;const n=r(6441),i=r(8718);class s{name;constructor(e){(0,n.defineProperties)(this,{name:e})}clone(){return new s(this.name)}}t.NetworkPlugin=s;class a extends s{effectiveBlock;txBase;txCreate;txDataZero;txDataNonzero;txAccessListStorageKey;txAccessListAddress;constructor(e,t){null==e&&(e=0),super(`org.ethers.network.plugins.GasCost#${e||0}`);const r={effectiveBlock:e};function s(e,n){let s=(t||{})[e];null==s&&(s=n),(0,i.assertArgument)("number"==typeof s,`invalud value for ${e}`,"costs",t),r[e]=s}s("txBase",21e3),s("txCreate",32e3),s("txDataZero",4),s("txDataNonzero",16),s("txAccessListStorageKey",1900),s("txAccessListAddress",2400),(0,n.defineProperties)(this,r)}clone(){return new a(this.effectiveBlock,this)}}t.GasCostPlugin=a;class o extends s{address;targetNetwork;constructor(e,t){super("org.ethers.plugins.network.Ens"),(0,n.defineProperties)(this,{address:e||"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",targetNetwork:null==t?1:t})}clone(){return new o(this.address,this.targetNetwork)}}t.EnsPlugin=o;class c extends s{#Ut;get feeDataFunc(){return this.#Ut}constructor(e){super("org.ethers.plugins.network.FeeData"),this.#Ut=e}async getFeeData(e){return await this.#Ut(e)}clone(){return new c(this.#Ut)}}t.FeeDataNetworkPlugin=c;t.FetchUrlFeeDataNetworkPlugin=class extends s{#A;#Lt;get url(){return this.#A}get processFunc(){return this.#Lt}constructor(e,t){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"),this.#A=e,this.#Lt=t}clone(){return this}}},6925:(e,t)=>{"use strict";t.p=void 0,t.p="abandon\nability\nable\nabout\nabove\nabsent\nabsorb\nabstract\nabsurd\nabuse\naccess\naccident\naccount\naccuse\nachieve\nacid\nacoustic\nacquire\nacross\nact\naction\nactor\nactress\nactual\nadapt\nadd\naddict\naddress\nadjust\nadmit\nadult\nadvance\nadvice\naerobic\naffair\nafford\nafraid\nagain\nage\nagent\nagree\nahead\naim\nair\nairport\naisle\nalarm\nalbum\nalcohol\nalert\nalien\nall\nalley\nallow\nalmost\nalone\nalpha\nalready\nalso\nalter\nalways\namateur\namazing\namong\namount\namused\nanalyst\nanchor\nancient\nanger\nangle\nangry\nanimal\nankle\nannounce\nannual\nanother\nanswer\nantenna\nantique\nanxiety\nany\napart\napology\nappear\napple\napprove\napril\narch\narctic\narea\narena\nargue\narm\narmed\narmor\narmy\naround\narrange\narrest\narrive\narrow\nart\nartefact\nartist\nartwork\nask\naspect\nassault\nasset\nassist\nassume\nasthma\nathlete\natom\nattack\nattend\nattitude\nattract\nauction\naudit\naugust\naunt\nauthor\nauto\nautumn\naverage\navocado\navoid\nawake\naware\naway\nawesome\nawful\nawkward\naxis\nbaby\nbachelor\nbacon\nbadge\nbag\nbalance\nbalcony\nball\nbamboo\nbanana\nbanner\nbar\nbarely\nbargain\nbarrel\nbase\nbasic\nbasket\nbattle\nbeach\nbean\nbeauty\nbecause\nbecome\nbeef\nbefore\nbegin\nbehave\nbehind\nbelieve\nbelow\nbelt\nbench\nbenefit\nbest\nbetray\nbetter\nbetween\nbeyond\nbicycle\nbid\nbike\nbind\nbiology\nbird\nbirth\nbitter\nblack\nblade\nblame\nblanket\nblast\nbleak\nbless\nblind\nblood\nblossom\nblouse\nblue\nblur\nblush\nboard\nboat\nbody\nboil\nbomb\nbone\nbonus\nbook\nboost\nborder\nboring\nborrow\nboss\nbottom\nbounce\nbox\nboy\nbracket\nbrain\nbrand\nbrass\nbrave\nbread\nbreeze\nbrick\nbridge\nbrief\nbright\nbring\nbrisk\nbroccoli\nbroken\nbronze\nbroom\nbrother\nbrown\nbrush\nbubble\nbuddy\nbudget\nbuffalo\nbuild\nbulb\nbulk\nbullet\nbundle\nbunker\nburden\nburger\nburst\nbus\nbusiness\nbusy\nbutter\nbuyer\nbuzz\ncabbage\ncabin\ncable\ncactus\ncage\ncake\ncall\ncalm\ncamera\ncamp\ncan\ncanal\ncancel\ncandy\ncannon\ncanoe\ncanvas\ncanyon\ncapable\ncapital\ncaptain\ncar\ncarbon\ncard\ncargo\ncarpet\ncarry\ncart\ncase\ncash\ncasino\ncastle\ncasual\ncat\ncatalog\ncatch\ncategory\ncattle\ncaught\ncause\ncaution\ncave\nceiling\ncelery\ncement\ncensus\ncentury\ncereal\ncertain\nchair\nchalk\nchampion\nchange\nchaos\nchapter\ncharge\nchase\nchat\ncheap\ncheck\ncheese\nchef\ncherry\nchest\nchicken\nchief\nchild\nchimney\nchoice\nchoose\nchronic\nchuckle\nchunk\nchurn\ncigar\ncinnamon\ncircle\ncitizen\ncity\ncivil\nclaim\nclap\nclarify\nclaw\nclay\nclean\nclerk\nclever\nclick\nclient\ncliff\nclimb\nclinic\nclip\nclock\nclog\nclose\ncloth\ncloud\nclown\nclub\nclump\ncluster\nclutch\ncoach\ncoast\ncoconut\ncode\ncoffee\ncoil\ncoin\ncollect\ncolor\ncolumn\ncombine\ncome\ncomfort\ncomic\ncommon\ncompany\nconcert\nconduct\nconfirm\ncongress\nconnect\nconsider\ncontrol\nconvince\ncook\ncool\ncopper\ncopy\ncoral\ncore\ncorn\ncorrect\ncost\ncotton\ncouch\ncountry\ncouple\ncourse\ncousin\ncover\ncoyote\ncrack\ncradle\ncraft\ncram\ncrane\ncrash\ncrater\ncrawl\ncrazy\ncream\ncredit\ncreek\ncrew\ncricket\ncrime\ncrisp\ncritic\ncrop\ncross\ncrouch\ncrowd\ncrucial\ncruel\ncruise\ncrumble\ncrunch\ncrush\ncry\ncrystal\ncube\nculture\ncup\ncupboard\ncurious\ncurrent\ncurtain\ncurve\ncushion\ncustom\ncute\ncycle\ndad\ndamage\ndamp\ndance\ndanger\ndaring\ndash\ndaughter\ndawn\nday\ndeal\ndebate\ndebris\ndecade\ndecember\ndecide\ndecline\ndecorate\ndecrease\ndeer\ndefense\ndefine\ndefy\ndegree\ndelay\ndeliver\ndemand\ndemise\ndenial\ndentist\ndeny\ndepart\ndepend\ndeposit\ndepth\ndeputy\nderive\ndescribe\ndesert\ndesign\ndesk\ndespair\ndestroy\ndetail\ndetect\ndevelop\ndevice\ndevote\ndiagram\ndial\ndiamond\ndiary\ndice\ndiesel\ndiet\ndiffer\ndigital\ndignity\ndilemma\ndinner\ndinosaur\ndirect\ndirt\ndisagree\ndiscover\ndisease\ndish\ndismiss\ndisorder\ndisplay\ndistance\ndivert\ndivide\ndivorce\ndizzy\ndoctor\ndocument\ndog\ndoll\ndolphin\ndomain\ndonate\ndonkey\ndonor\ndoor\ndose\ndouble\ndove\ndraft\ndragon\ndrama\ndrastic\ndraw\ndream\ndress\ndrift\ndrill\ndrink\ndrip\ndrive\ndrop\ndrum\ndry\nduck\ndumb\ndune\nduring\ndust\ndutch\nduty\ndwarf\ndynamic\neager\neagle\nearly\nearn\nearth\neasily\neast\neasy\necho\necology\neconomy\nedge\nedit\neducate\neffort\negg\neight\neither\nelbow\nelder\nelectric\nelegant\nelement\nelephant\nelevator\nelite\nelse\nembark\nembody\nembrace\nemerge\nemotion\nemploy\nempower\nempty\nenable\nenact\nend\nendless\nendorse\nenemy\nenergy\nenforce\nengage\nengine\nenhance\nenjoy\nenlist\nenough\nenrich\nenroll\nensure\nenter\nentire\nentry\nenvelope\nepisode\nequal\nequip\nera\nerase\nerode\nerosion\nerror\nerupt\nescape\nessay\nessence\nestate\neternal\nethics\nevidence\nevil\nevoke\nevolve\nexact\nexample\nexcess\nexchange\nexcite\nexclude\nexcuse\nexecute\nexercise\nexhaust\nexhibit\nexile\nexist\nexit\nexotic\nexpand\nexpect\nexpire\nexplain\nexpose\nexpress\nextend\nextra\neye\neyebrow\nfabric\nface\nfaculty\nfade\nfaint\nfaith\nfall\nfalse\nfame\nfamily\nfamous\nfan\nfancy\nfantasy\nfarm\nfashion\nfat\nfatal\nfather\nfatigue\nfault\nfavorite\nfeature\nfebruary\nfederal\nfee\nfeed\nfeel\nfemale\nfence\nfestival\nfetch\nfever\nfew\nfiber\nfiction\nfield\nfigure\nfile\nfilm\nfilter\nfinal\nfind\nfine\nfinger\nfinish\nfire\nfirm\nfirst\nfiscal\nfish\nfit\nfitness\nfix\nflag\nflame\nflash\nflat\nflavor\nflee\nflight\nflip\nfloat\nflock\nfloor\nflower\nfluid\nflush\nfly\nfoam\nfocus\nfog\nfoil\nfold\nfollow\nfood\nfoot\nforce\nforest\nforget\nfork\nfortune\nforum\nforward\nfossil\nfoster\nfound\nfox\nfragile\nframe\nfrequent\nfresh\nfriend\nfringe\nfrog\nfront\nfrost\nfrown\nfrozen\nfruit\nfuel\nfun\nfunny\nfurnace\nfury\nfuture\ngadget\ngain\ngalaxy\ngallery\ngame\ngap\ngarage\ngarbage\ngarden\ngarlic\ngarment\ngas\ngasp\ngate\ngather\ngauge\ngaze\ngeneral\ngenius\ngenre\ngentle\ngenuine\ngesture\nghost\ngiant\ngift\ngiggle\nginger\ngiraffe\ngirl\ngive\nglad\nglance\nglare\nglass\nglide\nglimpse\nglobe\ngloom\nglory\nglove\nglow\nglue\ngoat\ngoddess\ngold\ngood\ngoose\ngorilla\ngospel\ngossip\ngovern\ngown\ngrab\ngrace\ngrain\ngrant\ngrape\ngrass\ngravity\ngreat\ngreen\ngrid\ngrief\ngrit\ngrocery\ngroup\ngrow\ngrunt\nguard\nguess\nguide\nguilt\nguitar\ngun\ngym\nhabit\nhair\nhalf\nhammer\nhamster\nhand\nhappy\nharbor\nhard\nharsh\nharvest\nhat\nhave\nhawk\nhazard\nhead\nhealth\nheart\nheavy\nhedgehog\nheight\nhello\nhelmet\nhelp\nhen\nhero\nhidden\nhigh\nhill\nhint\nhip\nhire\nhistory\nhobby\nhockey\nhold\nhole\nholiday\nhollow\nhome\nhoney\nhood\nhope\nhorn\nhorror\nhorse\nhospital\nhost\nhotel\nhour\nhover\nhub\nhuge\nhuman\nhumble\nhumor\nhundred\nhungry\nhunt\nhurdle\nhurry\nhurt\nhusband\nhybrid\nice\nicon\nidea\nidentify\nidle\nignore\nill\nillegal\nillness\nimage\nimitate\nimmense\nimmune\nimpact\nimpose\nimprove\nimpulse\ninch\ninclude\nincome\nincrease\nindex\nindicate\nindoor\nindustry\ninfant\ninflict\ninform\ninhale\ninherit\ninitial\ninject\ninjury\ninmate\ninner\ninnocent\ninput\ninquiry\ninsane\ninsect\ninside\ninspire\ninstall\nintact\ninterest\ninto\ninvest\ninvite\ninvolve\niron\nisland\nisolate\nissue\nitem\nivory\njacket\njaguar\njar\njazz\njealous\njeans\njelly\njewel\njob\njoin\njoke\njourney\njoy\njudge\njuice\njump\njungle\njunior\njunk\njust\nkangaroo\nkeen\nkeep\nketchup\nkey\nkick\nkid\nkidney\nkind\nkingdom\nkiss\nkit\nkitchen\nkite\nkitten\nkiwi\nknee\nknife\nknock\nknow\nlab\nlabel\nlabor\nladder\nlady\nlake\nlamp\nlanguage\nlaptop\nlarge\nlater\nlatin\nlaugh\nlaundry\nlava\nlaw\nlawn\nlawsuit\nlayer\nlazy\nleader\nleaf\nlearn\nleave\nlecture\nleft\nleg\nlegal\nlegend\nleisure\nlemon\nlend\nlength\nlens\nleopard\nlesson\nletter\nlevel\nliar\nliberty\nlibrary\nlicense\nlife\nlift\nlight\nlike\nlimb\nlimit\nlink\nlion\nliquid\nlist\nlittle\nlive\nlizard\nload\nloan\nlobster\nlocal\nlock\nlogic\nlonely\nlong\nloop\nlottery\nloud\nlounge\nlove\nloyal\nlucky\nluggage\nlumber\nlunar\nlunch\nluxury\nlyrics\nmachine\nmad\nmagic\nmagnet\nmaid\nmail\nmain\nmajor\nmake\nmammal\nman\nmanage\nmandate\nmango\nmansion\nmanual\nmaple\nmarble\nmarch\nmargin\nmarine\nmarket\nmarriage\nmask\nmass\nmaster\nmatch\nmaterial\nmath\nmatrix\nmatter\nmaximum\nmaze\nmeadow\nmean\nmeasure\nmeat\nmechanic\nmedal\nmedia\nmelody\nmelt\nmember\nmemory\nmention\nmenu\nmercy\nmerge\nmerit\nmerry\nmesh\nmessage\nmetal\nmethod\nmiddle\nmidnight\nmilk\nmillion\nmimic\nmind\nminimum\nminor\nminute\nmiracle\nmirror\nmisery\nmiss\nmistake\nmix\nmixed\nmixture\nmobile\nmodel\nmodify\nmom\nmoment\nmonitor\nmonkey\nmonster\nmonth\nmoon\nmoral\nmore\nmorning\nmosquito\nmother\nmotion\nmotor\nmountain\nmouse\nmove\nmovie\nmuch\nmuffin\nmule\nmultiply\nmuscle\nmuseum\nmushroom\nmusic\nmust\nmutual\nmyself\nmystery\nmyth\nnaive\nname\nnapkin\nnarrow\nnasty\nnation\nnature\nnear\nneck\nneed\nnegative\nneglect\nneither\nnephew\nnerve\nnest\nnet\nnetwork\nneutral\nnever\nnews\nnext\nnice\nnight\nnoble\nnoise\nnominee\nnoodle\nnormal\nnorth\nnose\nnotable\nnote\nnothing\nnotice\nnovel\nnow\nnuclear\nnumber\nnurse\nnut\noak\nobey\nobject\noblige\nobscure\nobserve\nobtain\nobvious\noccur\nocean\noctober\nodor\noff\noffer\noffice\noften\noil\nokay\nold\nolive\nolympic\nomit\nonce\none\nonion\nonline\nonly\nopen\nopera\nopinion\noppose\noption\norange\norbit\norchard\norder\nordinary\norgan\norient\noriginal\norphan\nostrich\nother\noutdoor\nouter\noutput\noutside\noval\noven\nover\nown\nowner\noxygen\noyster\nozone\npact\npaddle\npage\npair\npalace\npalm\npanda\npanel\npanic\npanther\npaper\nparade\nparent\npark\nparrot\nparty\npass\npatch\npath\npatient\npatrol\npattern\npause\npave\npayment\npeace\npeanut\npear\npeasant\npelican\npen\npenalty\npencil\npeople\npepper\nperfect\npermit\nperson\npet\nphone\nphoto\nphrase\nphysical\npiano\npicnic\npicture\npiece\npig\npigeon\npill\npilot\npink\npioneer\npipe\npistol\npitch\npizza\nplace\nplanet\nplastic\nplate\nplay\nplease\npledge\npluck\nplug\nplunge\npoem\npoet\npoint\npolar\npole\npolice\npond\npony\npool\npopular\nportion\nposition\npossible\npost\npotato\npottery\npoverty\npowder\npower\npractice\npraise\npredict\nprefer\nprepare\npresent\npretty\nprevent\nprice\npride\nprimary\nprint\npriority\nprison\nprivate\nprize\nproblem\nprocess\nproduce\nprofit\nprogram\nproject\npromote\nproof\nproperty\nprosper\nprotect\nproud\nprovide\npublic\npudding\npull\npulp\npulse\npumpkin\npunch\npupil\npuppy\npurchase\npurity\npurpose\npurse\npush\nput\npuzzle\npyramid\nquality\nquantum\nquarter\nquestion\nquick\nquit\nquiz\nquote\nrabbit\nraccoon\nrace\nrack\nradar\nradio\nrail\nrain\nraise\nrally\nramp\nranch\nrandom\nrange\nrapid\nrare\nrate\nrather\nraven\nraw\nrazor\nready\nreal\nreason\nrebel\nrebuild\nrecall\nreceive\nrecipe\nrecord\nrecycle\nreduce\nreflect\nreform\nrefuse\nregion\nregret\nregular\nreject\nrelax\nrelease\nrelief\nrely\nremain\nremember\nremind\nremove\nrender\nrenew\nrent\nreopen\nrepair\nrepeat\nreplace\nreport\nrequire\nrescue\nresemble\nresist\nresource\nresponse\nresult\nretire\nretreat\nreturn\nreunion\nreveal\nreview\nreward\nrhythm\nrib\nribbon\nrice\nrich\nride\nridge\nrifle\nright\nrigid\nring\nriot\nripple\nrisk\nritual\nrival\nriver\nroad\nroast\nrobot\nrobust\nrocket\nromance\nroof\nrookie\nroom\nrose\nrotate\nrough\nround\nroute\nroyal\nrubber\nrude\nrug\nrule\nrun\nrunway\nrural\nsad\nsaddle\nsadness\nsafe\nsail\nsalad\nsalmon\nsalon\nsalt\nsalute\nsame\nsample\nsand\nsatisfy\nsatoshi\nsauce\nsausage\nsave\nsay\nscale\nscan\nscare\nscatter\nscene\nscheme\nschool\nscience\nscissors\nscorpion\nscout\nscrap\nscreen\nscript\nscrub\nsea\nsearch\nseason\nseat\nsecond\nsecret\nsection\nsecurity\nseed\nseek\nsegment\nselect\nsell\nseminar\nsenior\nsense\nsentence\nseries\nservice\nsession\nsettle\nsetup\nseven\nshadow\nshaft\nshallow\nshare\nshed\nshell\nsheriff\nshield\nshift\nshine\nship\nshiver\nshock\nshoe\nshoot\nshop\nshort\nshoulder\nshove\nshrimp\nshrug\nshuffle\nshy\nsibling\nsick\nside\nsiege\nsight\nsign\nsilent\nsilk\nsilly\nsilver\nsimilar\nsimple\nsince\nsing\nsiren\nsister\nsituate\nsix\nsize\nskate\nsketch\nski\nskill\nskin\nskirt\nskull\nslab\nslam\nsleep\nslender\nslice\nslide\nslight\nslim\nslogan\nslot\nslow\nslush\nsmall\nsmart\nsmile\nsmoke\nsmooth\nsnack\nsnake\nsnap\nsniff\nsnow\nsoap\nsoccer\nsocial\nsock\nsoda\nsoft\nsolar\nsoldier\nsolid\nsolution\nsolve\nsomeone\nsong\nsoon\nsorry\nsort\nsoul\nsound\nsoup\nsource\nsouth\nspace\nspare\nspatial\nspawn\nspeak\nspecial\nspeed\nspell\nspend\nsphere\nspice\nspider\nspike\nspin\nspirit\nsplit\nspoil\nsponsor\nspoon\nsport\nspot\nspray\nspread\nspring\nspy\nsquare\nsqueeze\nsquirrel\nstable\nstadium\nstaff\nstage\nstairs\nstamp\nstand\nstart\nstate\nstay\nsteak\nsteel\nstem\nstep\nstereo\nstick\nstill\nsting\nstock\nstomach\nstone\nstool\nstory\nstove\nstrategy\nstreet\nstrike\nstrong\nstruggle\nstudent\nstuff\nstumble\nstyle\nsubject\nsubmit\nsubway\nsuccess\nsuch\nsudden\nsuffer\nsugar\nsuggest\nsuit\nsummer\nsun\nsunny\nsunset\nsuper\nsupply\nsupreme\nsure\nsurface\nsurge\nsurprise\nsurround\nsurvey\nsuspect\nsustain\nswallow\nswamp\nswap\nswarm\nswear\nsweet\nswift\nswim\nswing\nswitch\nsword\nsymbol\nsymptom\nsyrup\nsystem\ntable\ntackle\ntag\ntail\ntalent\ntalk\ntank\ntape\ntarget\ntask\ntaste\ntattoo\ntaxi\nteach\nteam\ntell\nten\ntenant\ntennis\ntent\nterm\ntest\ntext\nthank\nthat\ntheme\nthen\ntheory\nthere\nthey\nthing\nthis\nthought\nthree\nthrive\nthrow\nthumb\nthunder\nticket\ntide\ntiger\ntilt\ntimber\ntime\ntiny\ntip\ntired\ntissue\ntitle\ntoast\ntobacco\ntoday\ntoddler\ntoe\ntogether\ntoilet\ntoken\ntomato\ntomorrow\ntone\ntongue\ntonight\ntool\ntooth\ntop\ntopic\ntopple\ntorch\ntornado\ntortoise\ntoss\ntotal\ntourist\ntoward\ntower\ntown\ntoy\ntrack\ntrade\ntraffic\ntragic\ntrain\ntransfer\ntrap\ntrash\ntravel\ntray\ntreat\ntree\ntrend\ntrial\ntribe\ntrick\ntrigger\ntrim\ntrip\ntrophy\ntrouble\ntruck\ntrue\ntruly\ntrumpet\ntrust\ntruth\ntry\ntube\ntuition\ntumble\ntuna\ntunnel\nturkey\nturn\nturtle\ntwelve\ntwenty\ntwice\ntwin\ntwist\ntwo\ntype\ntypical\nugly\numbrella\nunable\nunaware\nuncle\nuncover\nunder\nundo\nunfair\nunfold\nunhappy\nuniform\nunique\nunit\nuniverse\nunknown\nunlock\nuntil\nunusual\nunveil\nupdate\nupgrade\nuphold\nupon\nupper\nupset\nurban\nurge\nusage\nuse\nused\nuseful\nuseless\nusual\nutility\nvacant\nvacuum\nvague\nvalid\nvalley\nvalve\nvan\nvanish\nvapor\nvarious\nvast\nvault\nvehicle\nvelvet\nvendor\nventure\nvenue\nverb\nverify\nversion\nvery\nvessel\nveteran\nviable\nvibrant\nvicious\nvictory\nvideo\nview\nvillage\nvintage\nviolin\nvirtual\nvirus\nvisa\nvisit\nvisual\nvital\nvivid\nvocal\nvoice\nvoid\nvolcano\nvolume\nvote\nvoyage\nwage\nwagon\nwait\nwalk\nwall\nwalnut\nwant\nwarfare\nwarm\nwarrior\nwash\nwasp\nwaste\nwater\nwave\nway\nwealth\nweapon\nwear\nweasel\nweather\nweb\nwedding\nweekend\nweird\nwelcome\nwest\nwet\nwhale\nwhat\nwheat\nwheel\nwhen\nwhere\nwhip\nwhisper\nwide\nwidth\nwife\nwild\nwill\nwin\nwindow\nwine\nwing\nwink\nwinner\nwinter\nwire\nwisdom\nwise\nwish\nwitness\nwolf\nwoman\nwonder\nwood\nwool\nword\nwork\nworld\nworry\nworth\nwrap\nwreck\nwrestle\nwrist\nwrite\nwrong\nyard\nyear\nyellow\nyou\nyoung\nyouth\nzebra\nzero\nzone\nzoo".split("\n")},7004:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha224=t.sha256=void 0;const n=r(3134),i=r(3654),s=(e,t,r)=>e&t^~e&r,a=(e,t,r)=>e&t^e&r^t&r,o=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]),c=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),u=new Uint32Array(64);class l extends n.SHA2{constructor(){super(64,32,8,!1),this.A=0|c[0],this.B=0|c[1],this.C=0|c[2],this.D=0|c[3],this.E=0|c[4],this.F=0|c[5],this.G=0|c[6],this.H=0|c[7]}get(){const{A:e,B:t,C:r,D:n,E:i,F:s,G:a,H:o}=this;return[e,t,r,n,i,s,a,o]}set(e,t,r,n,i,s,a,o){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|s,this.G=0|a,this.H=0|o}process(e,t){for(let r=0;r<16;r++,t+=4)u[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=u[e-15],r=u[e-2],n=(0,i.rotr)(t,7)^(0,i.rotr)(t,18)^t>>>3,s=(0,i.rotr)(r,17)^(0,i.rotr)(r,19)^r>>>10;u[e]=s+u[e-7]+n+u[e-16]|0}let{A:r,B:n,C:c,D:l,E:h,F:d,G:f,H:p}=this;for(let e=0;e<64;e++){const t=p+((0,i.rotr)(h,6)^(0,i.rotr)(h,11)^(0,i.rotr)(h,25))+s(h,d,f)+o[e]+u[e]|0,g=((0,i.rotr)(r,2)^(0,i.rotr)(r,13)^(0,i.rotr)(r,22))+a(r,n,c)|0;p=f,f=d,d=h,h=l+t|0,l=c,c=n,n=r,r=t+g|0}r=r+this.A|0,n=n+this.B|0,c=c+this.C|0,l=l+this.D|0,h=h+this.E|0,d=d+this.F|0,f=f+this.G|0,p=p+this.H|0,this.set(r,n,c,l,h,d,f,p)}roundClean(){u.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class h extends l{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}}t.sha256=(0,i.wrapConstructor)(()=>new l),t.sha224=(0,i.wrapConstructor)(()=>new h)},7065:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=void 0;const n=r(5202);let i=!1;const s=function(e){return new Uint8Array((0,n.randomBytes)(e))};let a=s;function o(e){return a(e)}t.randomBytes=o,o._=s,o.lock=function(){i=!0},o.register=function(e){if(i)throw new Error("randomBytes is locked");a=e},Object.freeze(o)},7073:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hmac=t.HMAC=void 0;const n=r(9071),i=r(1197);class s extends i.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,(0,n.hash)(e);const r=(0,i.toBytes)(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,a=new Uint8Array(s);a.set(r.length>s?e.create().update(r).digest():r);for(let e=0;e<a.length;e++)a[e]^=54;this.iHash.update(a),this.oHash=e.create();for(let e=0;e<a.length;e++)a[e]^=106;this.oHash.update(a),a.fill(0)}update(e){return(0,n.exists)(this),this.iHash.update(e),this}digestInto(e){(0,n.exists)(this),(0,n.bytes)(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:s,outputLen:a}=this;return e.finished=n,e.destroyed=i,e.blockLen=s,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}t.HMAC=s;t.hmac=(e,t,r)=>new s(e,t).update(r).digest(),t.hmac.create=(e,t)=>new s(e,t)},7149:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventPayload=void 0;const n=r(6441);t.EventPayload=class{filter;emitter;#Dt;constructor(e,t,r){this.#Dt=t,(0,n.defineProperties)(this,{emitter:e,filter:r})}async removeListener(){null!=this.#Dt&&await this.emitter.off(this.filter,this.#Dt)}}},7166:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InfuraProvider=t.InfuraWebSocketProvider=void 0;const n=r(8718),i=r(324),s=r(4391),a=r(24),o=r(7658),c="84842078b09946638c03157f83405213";class u extends o.WebSocketProvider{projectId;projectSecret;constructor(e,t){const r=new l(e,t),i=r._getConnection();(0,n.assert)(!i.credentials,"INFURA WebSocket project secrets unsupported","UNSUPPORTED_OPERATION",{operation:"InfuraProvider.getWebSocketProvider()"});super(i.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/"),r._network),(0,n.defineProperties)(this,{projectId:r.projectId,projectSecret:r.projectSecret})}isCommunityResource(){return this.projectId===c}}t.InfuraWebSocketProvider=u;class l extends a.JsonRpcProvider{projectId;projectSecret;constructor(e,t,r){null==e&&(e="mainnet");const i=s.Network.from(e);null==t&&(t=c),null==r&&(r=null);super(l.getRequest(i,t,r),i,{staticNetwork:i}),(0,n.defineProperties)(this,{projectId:t,projectSecret:r})}_getProvider(e){try{return new l(e,this.projectId,this.projectSecret)}catch(e){}return super._getProvider(e)}isCommunityResource(){return this.projectId===c}static getWebSocketProvider(e,t){return new u(e,t)}static getRequest(e,t,r){null==t&&(t=c),null==r&&(r=null);const s=new n.FetchRequest(`https://${function(e){switch(e){case"mainnet":return"mainnet.infura.io";case"goerli":return"goerli.infura.io";case"sepolia":return"sepolia.infura.io";case"arbitrum":return"arbitrum-mainnet.infura.io";case"arbitrum-goerli":return"arbitrum-goerli.infura.io";case"arbitrum-sepolia":return"arbitrum-sepolia.infura.io";case"base":return"base-mainnet.infura.io";case"base-goerlia":case"base-goerli":return"base-goerli.infura.io";case"base-sepolia":return"base-sepolia.infura.io";case"bnb":return"bsc-mainnet.infura.io";case"bnbt":return"bsc-testnet.infura.io";case"linea":return"linea-mainnet.infura.io";case"linea-goerli":return"linea-goerli.infura.io";case"linea-sepolia":return"linea-sepolia.infura.io";case"matic":return"polygon-mainnet.infura.io";case"matic-amoy":return"polygon-amoy.infura.io";case"matic-mumbai":return"polygon-mumbai.infura.io";case"optimism":return"optimism-mainnet.infura.io";case"optimism-goerli":return"optimism-goerli.infura.io";case"optimism-sepolia":return"optimism-sepolia.infura.io"}(0,n.assertArgument)(!1,"unsupported network","network",e)}(e.name)}/v3/${t}`);return s.allowGzip=!0,r&&s.setCredentials("",r),t===c&&(s.retryFunc=async(e,t,r)=>((0,i.showThrottleMessage)("InfuraProvider"),!0)),s}}t.InfuraProvider=l},7390:(e,t,r)=>{var n=r(4643);r(8550),e.exports=n.log=n.log||{},n.log.levels=["none","error","warning","info","debug","verbose","max"];var i={},s=[],a=null;n.log.LEVEL_LOCKED=2,n.log.NO_LEVEL_CHECK=4,n.log.INTERPOLATE=8;for(var o=0;o<n.log.levels.length;++o){var c=n.log.levels[o];i[c]={index:o,name:c.toUpperCase()}}n.log.logMessage=function(e){for(var t=i[e.level].index,r=0;r<s.length;++r){var a=s[r];if(a.flags&n.log.NO_LEVEL_CHECK)a.f(e);else t<=i[a.level].index&&a.f(a,e)}},n.log.prepareStandard=function(e){"standard"in e||(e.standard=i[e.level].name+" ["+e.category+"] "+e.message)},n.log.prepareFull=function(e){if(!("full"in e)){var t=[e.message];t=t.concat([]||0),e.full=n.util.format.apply(this,t)}},n.log.prepareStandardFull=function(e){"standardFull"in e||(n.log.prepareStandard(e),e.standardFull=e.standard)};var u=["error","warning","info","debug","verbose"];for(o=0;o<u.length;++o)(function(e){n.log[e]=function(t,r){var i=Array.prototype.slice.call(arguments).slice(2),s={timestamp:new Date,level:e,category:t,message:r,arguments:i};n.log.logMessage(s)}})(u[o]);if(n.log.makeLogger=function(e){var t={flags:0,f:e};return n.log.setLevel(t,"none"),t},n.log.setLevel=function(e,t){var r=!1;if(e&&!(e.flags&n.log.LEVEL_LOCKED))for(var i=0;i<n.log.levels.length;++i){if(t==n.log.levels[i]){e.level=t,r=!0;break}}return r},n.log.lock=function(e,t){void 0===t||t?e.flags|=n.log.LEVEL_LOCKED:e.flags&=~n.log.LEVEL_LOCKED},n.log.addLogger=function(e){s.push(e)},"undefined"!=typeof console&&"log"in console){var l;if(console.error&&console.warn&&console.info&&console.debug){var h={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},d=function(e,t){n.log.prepareStandard(t);var r=h[t.level],i=[t.standard];i=i.concat(t.arguments.slice()),r.apply(console,i)};l=n.log.makeLogger(d)}else{d=function(e,t){n.log.prepareStandardFull(t),console.log(t.standardFull)};l=n.log.makeLogger(d)}n.log.setLevel(l,"debug"),n.log.addLogger(l),a=l}else console={log:function(){}};if(null!==a&&"undefined"!=typeof window&&window.location){var f=new URL(window.location.href).searchParams;if(f.has("console.level")&&n.log.setLevel(a,f.get("console.level").slice(-1)[0]),f.has("console.lock"))"true"==f.get("console.lock").slice(-1)[0]&&n.log.lock(a)}n.log.consoleLogger=a},7391:(e,t,r)=>{var n=r(4643);r(8550);var i=null;!n.util.isNodejs||n.options.usePureJavaScript||process.versions["node-webkit"]||(i=r(9701)),(e.exports=n.prng=n.prng||{}).create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=e.md,s=new Array(32),a=0;a<32;++a)s[a]=r.create();function o(){if(t.pools[0].messageLength>=32)return c();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),c()}function c(){t.reseeds=4294967295===t.reseeds?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var r=1,n=0;n<32;++n)t.reseeds%r===0&&(e.update(t.pools[n].digest().getBytes()),t.pools[n].start()),r<<=1;t.keyBytes=e.digest().getBytes(),e.start(),e.update(t.keyBytes);var i=e.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(i),t.generated=0}function u(e){var t=null,r=n.util.globalScope,i=r.crypto||r.msCrypto;i&&i.getRandomValues&&(t=function(e){return i.getRandomValues(e)});var s=n.util.createBuffer();if(t)for(;s.length()<e;){var a=Math.max(1,Math.min(e-s.length(),65536)/4),o=new Uint32Array(Math.floor(a));try{t(o);for(var c=0;c<o.length;++c)s.putInt32(o[c])}catch(e){if(!("undefined"!=typeof QuotaExceededError&&e instanceof QuotaExceededError))throw e}}if(s.length()<e)for(var u,l,h,d=Math.floor(65536*Math.random());s.length()<e;){l=16807*(65535&d),l+=(32767&(u=16807*(d>>16)))<<16,d=4294967295&(l=(2147483647&(l+=u>>15))+(l>>31));for(c=0;c<3;++c)h=d>>>(c<<3),h^=Math.floor(256*Math.random()),s.putByte(255&h)}return s.getBytes(e)}return t.pools=s,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var i=t.plugin.cipher,s=t.plugin.increment,a=t.plugin.formatKey,o=t.plugin.formatSeed,u=n.util.createBuffer();t.key=null,function l(h){if(h)return r(h);if(u.length()>=e)return r(null,u.getBytes(e));t.generated>1048575&&(t.key=null);if(null===t.key)return n.util.nextTick(function(){!function(e){if(t.pools[0].messageLength>=32)return c(),e();var r=32-t.pools[0].messageLength<<5;t.seedFile(r,function(r,n){if(r)return e(r);t.collect(n),c(),e()})}(l)});var d=i(t.key,t.seed);t.generated+=d.length,u.putBytes(d),t.key=a(i(t.key,s(t.seed))),t.seed=o(i(t.key,t.seed)),n.util.setImmediate(l)}()},t.generateSync=function(e){var r=t.plugin.cipher,i=t.plugin.increment,s=t.plugin.formatKey,a=t.plugin.formatSeed;t.key=null;for(var c=n.util.createBuffer();c.length()<e;){t.generated>1048575&&(t.key=null),null===t.key&&o();var u=r(t.key,t.seed);t.generated+=u.length,c.putBytes(u),t.key=s(r(t.key,i(t.seed))),t.seed=a(r(t.key,t.seed))}return c.getBytes(e)},i?(t.seedFile=function(e,t){i.randomBytes(e,function(e,r){if(e)return t(e);t(null,r.toString())})},t.seedFileSync=function(e){return i.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,u(e))}catch(e){t(e)}},t.seedFileSync=u),t.collect=function(e){for(var r=e.length,n=0;n<r;++n)t.pools[t.pool].update(e.substr(n,1)),t.pool=31===t.pool?0:t.pool+1},t.collectInt=function(e,r){for(var n="",i=0;i<r;i+=8)n+=String.fromCharCode(e>>i&255);t.collect(n)},t.registerWorker=function(e){if(e===self)t.seedFile=function(e,t){self.addEventListener("message",function e(r){var n=r.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",e),t(n.forge.prng.err,n.forge.prng.bytes))}),self.postMessage({forge:{prng:{needed:e}}})};else{e.addEventListener("message",function(r){var n=r.data;n.forge&&n.forge.prng&&t.seedFile(n.forge.prng.needed,function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})})})}},t}},7412:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanCoder=void 0;const n=r(3233),i=r(1540);class s extends i.Coder{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){const r=n.Typed.dereference(t,"bool");return e.writeValue(r?1:0)}decode(e){return!!e.readValue()}}t.BooleanCoder=s},7420:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUrl=t.createGetUrl=void 0;const n=r(355);function i(e){return async function(t,r){(0,n.assert)(null==r||!r.cancelled,"request cancelled before sending","CANCELLED");const i=t.url.split(":")[0].toLowerCase();(0,n.assert)("http"===i||"https"===i,`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),(0,n.assert)("https"===i||!t.credentials||t.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let s=null;const a=new AbortController,o=setTimeout(()=>{s=(0,n.makeError)("request timeout","TIMEOUT"),a.abort()},t.timeout);r&&r.addListener(()=>{s=(0,n.makeError)("request cancelled","CANCELLED"),a.abort()});const c=Object.assign({},e,{method:t.method,headers:new Headers(Array.from(t)),body:t.body||void 0,signal:a.signal});let u;try{u=await fetch(t.url,c)}catch(e){if(clearTimeout(o),s)throw s;throw e}clearTimeout(o);const l={};u.headers.forEach((e,t)=>{l[t.toLowerCase()]=e});const h=await u.arrayBuffer(),d=null==h?null:new Uint8Array(h);return{statusCode:u.status,statusMessage:u.statusText,headers:l,body:d}}}t.createGetUrl=i;const s=i({});t.getUrl=async function(e,t){return s(e,t)}},7477:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.verifyTypedData=t.TypedDataEncoder=t.solidityPackedSha256=t.solidityPackedKeccak256=t.solidityPacked=t.verifyMessage=t.hashMessage=t.dnsEncode=t.namehash=t.isValidName=t.ensNormalize=t.id=t.verifyAuthorization=t.hashAuthorization=void 0;var n=r(628);Object.defineProperty(t,"hashAuthorization",{enumerable:!0,get:function(){return n.hashAuthorization}}),Object.defineProperty(t,"verifyAuthorization",{enumerable:!0,get:function(){return n.verifyAuthorization}});var i=r(5568);Object.defineProperty(t,"id",{enumerable:!0,get:function(){return i.id}});var s=r(2666);Object.defineProperty(t,"ensNormalize",{enumerable:!0,get:function(){return s.ensNormalize}}),Object.defineProperty(t,"isValidName",{enumerable:!0,get:function(){return s.isValidName}}),Object.defineProperty(t,"namehash",{enumerable:!0,get:function(){return s.namehash}}),Object.defineProperty(t,"dnsEncode",{enumerable:!0,get:function(){return s.dnsEncode}});var a=r(6566);Object.defineProperty(t,"hashMessage",{enumerable:!0,get:function(){return a.hashMessage}}),Object.defineProperty(t,"verifyMessage",{enumerable:!0,get:function(){return a.verifyMessage}});var o=r(1780);Object.defineProperty(t,"solidityPacked",{enumerable:!0,get:function(){return o.solidityPacked}}),Object.defineProperty(t,"solidityPackedKeccak256",{enumerable:!0,get:function(){return o.solidityPackedKeccak256}}),Object.defineProperty(t,"solidityPackedSha256",{enumerable:!0,get:function(){return o.solidityPackedSha256}});var c=r(7970);Object.defineProperty(t,"TypedDataEncoder",{enumerable:!0,get:function(){return c.TypedDataEncoder}}),Object.defineProperty(t,"verifyTypedData",{enumerable:!0,get:function(){return c.verifyTypedData}})},7505:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayCoder=t.unpack=t.pack=void 0;const n=r(8718),i=r(3233),s=r(1540),a=r(393);function o(e,t,r){let i=[];if(Array.isArray(r))i=r;else if(r&&"object"==typeof r){let e={};i=t.map(t=>{const i=t.localName;return(0,n.assert)(i,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:t},value:r}),(0,n.assert)(!e[i],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:t},value:r}),e[i]=!0,r[i]})}else(0,n.assertArgument)(!1,"invalid tuple value","tuple",r);(0,n.assertArgument)(t.length===i.length,"types/value length mismatch","tuple",r);let a=new s.Writer,o=new s.Writer,c=[];t.forEach((e,t)=>{let r=i[t];if(e.dynamic){let t=o.length;e.encode(o,r);let n=a.writeUpdatableValue();c.push(e=>{n(e+t)})}else e.encode(a,r)}),c.forEach(e=>{e(a.length)});let u=e.appendWriter(a);return u+=e.appendWriter(o),u}function c(e,t){let r=[],i=[],a=e.subReader(0);return t.forEach(t=>{let s=null;if(t.dynamic){let r=e.readIndex(),i=a.subReader(r);try{s=t.decode(i)}catch(e){if((0,n.isError)(e,"BUFFER_OVERRUN"))throw e;s=e,s.baseType=t.name,s.name=t.localName,s.type=t.type}}else try{s=t.decode(e)}catch(e){if((0,n.isError)(e,"BUFFER_OVERRUN"))throw e;s=e,s.baseType=t.name,s.name=t.localName,s.type=t.type}if(null==s)throw new Error("investigate");r.push(s),i.push(t.localName||null)}),s.Result.fromItems(r,i)}t.pack=o,t.unpack=c;class u extends s.Coder{coder;length;constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),(0,n.defineProperties)(this,{coder:e,length:t})}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let r=0;r<this.length;r++)t.push(e);return t}encode(e,t){const r=i.Typed.dereference(t,"array");Array.isArray(r)||this._throwError("expected array value",r);let s=this.length;-1===s&&(s=r.length,e.writeValue(r.length)),(0,n.assertArgumentCount)(r.length,s,"coder array"+(this.localName?" "+this.localName:""));let a=[];for(let e=0;e<r.length;e++)a.push(this.coder);return o(e,a,r)}decode(e){let t=this.length;-1===t&&(t=e.readIndex(),(0,n.assert)(t*s.WordSize<=e.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:e.bytes,offset:t*s.WordSize,length:e.dataLength}));let r=[];for(let e=0;e<t;e++)r.push(new a.AnonymousCoder(this.coder));return c(e,r)}}t.ArrayCoder=u},7585:(e,t,r)=>{var n=r(4643);r(9679),r(8550);var i=e.exports=n.sha256=n.sha256||{};n.md.sha256=n.md.algorithms.sha256=i,i.create=function(){a||(s=String.fromCharCode(128),s+=n.util.fillString(String.fromCharCode(0),64),o=[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],a=!0);var e=null,t=n.util.createBuffer(),r=new Array(64),i={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,s=0;s<r;++s)i.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},i}};return i.start(),i.update=function(s,a){"utf8"===a&&(s=n.util.encodeUtf8(s));var o=s.length;i.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var u=i.fullMessageLength.length-1;u>=0;--u)i.fullMessageLength[u]+=o[1],o[1]=o[0]+(i.fullMessageLength[u]/4294967296>>>0),i.fullMessageLength[u]=i.fullMessageLength[u]>>>0,o[0]=o[1]/4294967296>>>0;return t.putBytes(s),c(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var a=n.util.createBuffer();a.putBytes(t.bytes());var o,u=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;a.putBytes(s.substr(0,i.blockLength-u));for(var l=8*i.fullMessageLength[0],h=0;h<i.fullMessageLength.length-1;++h)l+=(o=8*i.fullMessageLength[h+1])/4294967296>>>0,a.putInt32(l>>>0),l=o>>>0;a.putInt32(l);var d={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};c(d,r,a);var f=n.util.createBuffer();return f.putInt32(d.h0),f.putInt32(d.h1),f.putInt32(d.h2),f.putInt32(d.h3),f.putInt32(d.h4),f.putInt32(d.h5),f.putInt32(d.h6),f.putInt32(d.h7),f},i};var s=null,a=!1,o=null;function c(e,t,r){for(var n,i,s,a,c,u,l,h,d,f,p,g,y,m=r.length();m>=64;){for(c=0;c<16;++c)t[c]=r.getInt32();for(;c<64;++c)n=((n=t[c-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=((i=t[c-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[c]=n+t[c-7]+i+t[c-16]|0;for(u=e.h0,l=e.h1,h=e.h2,d=e.h3,f=e.h4,p=e.h5,g=e.h6,y=e.h7,c=0;c<64;++c)s=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),a=u&l|h&(u^l),n=y+((f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(g^f&(p^g))+o[c]+t[c],y=g,g=p,p=f,f=d+n>>>0,d=h,h=l,l=u,u=n+(i=s+a)>>>0;e.h0=e.h0+u|0,e.h1=e.h1+l|0,e.h2=e.h2+h|0,e.h3=e.h3+d|0,e.h4=e.h4+f|0,e.h5=e.h5+p|0,e.h6=e.h6+g|0,e.h7=e.h7+y|0,m-=64}}},7627:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnkrProvider=void 0;const n=r(8718),i=r(324),s=r(4391),a=r(24),o="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";class c extends a.JsonRpcProvider{apiKey;constructor(e,t){null==e&&(e="mainnet");const r=s.Network.from(e);null==t&&(t=o);const i={polling:!0,staticNetwork:r};super(c.getRequest(r,t),r,i),(0,n.defineProperties)(this,{apiKey:t})}_getProvider(e){try{return new c(e,this.apiKey)}catch(e){}return super._getProvider(e)}static getRequest(e,t){null==t&&(t=o);const r=new n.FetchRequest(`https://${function(e){switch(e){case"mainnet":return"rpc.ankr.com/eth";case"goerli":return"rpc.ankr.com/eth_goerli";case"sepolia":return"rpc.ankr.com/eth_sepolia";case"arbitrum":return"rpc.ankr.com/arbitrum";case"base":return"rpc.ankr.com/base";case"base-goerli":return"rpc.ankr.com/base_goerli";case"base-sepolia":return"rpc.ankr.com/base_sepolia";case"bnb":return"rpc.ankr.com/bsc";case"bnbt":return"rpc.ankr.com/bsc_testnet_chapel";case"matic":return"rpc.ankr.com/polygon";case"matic-mumbai":return"rpc.ankr.com/polygon_mumbai";case"optimism":return"rpc.ankr.com/optimism";case"optimism-goerli":return"rpc.ankr.com/optimism_testnet";case"optimism-sepolia":return"rpc.ankr.com/optimism_sepolia"}(0,n.assertArgument)(!1,"unsupported network","network",e)}(e.name)}/${t}`);return r.allowGzip=!0,t===o&&(r.retryFunc=async(e,t,r)=>((0,i.showThrottleMessage)("AnkrProvider"),!0)),r}getRpcError(e,t){return"eth_sendRawTransaction"===e.method&&t&&t.error&&"INTERNAL_ERROR: could not replace existing tx"===t.error.message&&(t.error.message="replacement transaction underpriced"),super.getRpcError(e,t)}isCommunityResource(){return this.apiKey===o}}t.AnkrProvider=c},7658:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebSocketProvider=void 0;const n=r(8890),i=r(2436);class s extends i.SocketProvider{#u;#Ft;get websocket(){if(null==this.#Ft)throw new Error("websocket closed");return this.#Ft}constructor(e,t,r){super(t,r),"string"==typeof e?(this.#u=()=>new n.WebSocket(e),this.#Ft=this.#u()):"function"==typeof e?(this.#u=e,this.#Ft=e()):(this.#u=null,this.#Ft=e),this.websocket.onopen=async()=>{try{await this._start(),this.resume()}catch(e){console.log("failed to start WebsocketProvider",e)}},this.websocket.onmessage=e=>{this._processMessage(e.data)}}async _write(e){this.websocket.send(e)}async destroy(){null!=this.#Ft&&(this.#Ft.close(),this.#Ft=null),super.destroy()}}t.WebSocketProvider=s},7675:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UndecodedEventLog=t.EventLog=t.ContractTransactionResponse=t.ContractTransactionReceipt=t.ContractUnknownEventPayload=t.ContractEventPayload=t.ContractFactory=t.Contract=t.BaseContract=void 0;var n=r(6829);Object.defineProperty(t,"BaseContract",{enumerable:!0,get:function(){return n.BaseContract}}),Object.defineProperty(t,"Contract",{enumerable:!0,get:function(){return n.Contract}});var i=r(3313);Object.defineProperty(t,"ContractFactory",{enumerable:!0,get:function(){return i.ContractFactory}});var s=r(5519);Object.defineProperty(t,"ContractEventPayload",{enumerable:!0,get:function(){return s.ContractEventPayload}}),Object.defineProperty(t,"ContractUnknownEventPayload",{enumerable:!0,get:function(){return s.ContractUnknownEventPayload}}),Object.defineProperty(t,"ContractTransactionReceipt",{enumerable:!0,get:function(){return s.ContractTransactionReceipt}}),Object.defineProperty(t,"ContractTransactionResponse",{enumerable:!0,get:function(){return s.ContractTransactionResponse}}),Object.defineProperty(t,"EventLog",{enumerable:!0,get:function(){return s.EventLog}}),Object.defineProperty(t,"UndecodedEventLog",{enumerable:!0,get:function(){return s.UndecodedEventLog}})},7835:(e,t,r)=>{var n=r(4643);r(8550),r(4467);var i=e.exports=n.asn1=n.asn1||{};function s(e,t,r){if(r>t){var n=new Error("Too few bytes to parse DER.");throw n.available=e.length(),n.remaining=t,n.requested=r,n}}i.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},i.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},i.create=function(e,t,r,s,a){if(n.util.isArray(s)){for(var o=[],c=0;c<s.length;++c)void 0!==s[c]&&o.push(s[c]);s=o}var u={tagClass:e,type:t,constructed:r,composed:r||n.util.isArray(s),value:s};return a&&"bitStringContents"in a&&(u.bitStringContents=a.bitStringContents,u.original=i.copy(u)),u},i.copy=function(e,t){var r;if(n.util.isArray(e)){r=[];for(var s=0;s<e.length;++s)r.push(i.copy(e[s],t));return r}return"string"==typeof e?e:(r={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:i.copy(e.value,t)},t&&!t.excludeBitStringContents&&(r.bitStringContents=e.bitStringContents),r)},i.equals=function(e,t,r){if(n.util.isArray(e)){if(!n.util.isArray(t))return!1;if(e.length!==t.length)return!1;for(var s=0;s<e.length;++s)if(!i.equals(e[s],t[s]))return!1;return!0}if(typeof e!=typeof t)return!1;if("string"==typeof e)return e===t;var a=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&i.equals(e.value,t.value);return r&&r.includeBitStringContents&&(a=a&&e.bitStringContents===t.bitStringContents),a},i.getBerValueLength=function(e){var t=e.getByte();if(128!==t)return 128&t?e.getInt((127&t)<<3):t};function a(e,t,r,n){var o;s(e,t,2);var c=e.getByte();t--;var u=192&c,l=31&c;o=e.length();var h,d,f=function(e,t){var r=e.getByte();if(t--,128!==r){var n;if(128&r){var i=127&r;s(e,t,i),n=e.getInt(i<<3)}else n=r;if(n<0)throw new Error("Negative length: "+n);return n}}(e,t);if(t-=o-e.length(),void 0!==f&&f>t){if(n.strict){var p=new Error("Too few bytes to read ASN.1 value.");throw p.available=e.length(),p.remaining=t,p.requested=f,p}f=t}var g=!(32&~c);if(g)if(h=[],void 0===f)for(;;){if(s(e,t,2),e.bytes(2)===String.fromCharCode(0,0)){e.getBytes(2),t-=2;break}o=e.length(),h.push(a(e,t,r+1,n)),t-=o-e.length()}else for(;f>0;)o=e.length(),h.push(a(e,f,r+1,n)),t-=o-e.length(),f-=o-e.length();if(void 0===h&&u===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&(d=e.bytes(f)),void 0===h&&n.decodeBitStrings&&u===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&f>1){var y=e.read,m=t,b=0;if(l===i.Type.BITSTRING&&(s(e,t,1),b=e.getByte(),t--),0===b)try{o=e.length();var w=a(e,t,r+1,{strict:!0,decodeBitStrings:!0}),v=o-e.length();t-=v,l==i.Type.BITSTRING&&v++;var A=w.tagClass;v!==f||A!==i.Class.UNIVERSAL&&A!==i.Class.CONTEXT_SPECIFIC||(h=[w])}catch(e){}void 0===h&&(e.read=y,t=m)}if(void 0===h){if(void 0===f){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");f=t}if(l===i.Type.BMPSTRING)for(h="";f>0;f-=2)s(e,t,2),h+=String.fromCharCode(e.getInt16()),t-=2;else h=e.getBytes(f),t-=f}var E=void 0===d?null:{bitStringContents:d};return i.create(u,l,g,h,E)}i.fromDer=function(e,t){void 0===t&&(t={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),"boolean"==typeof t&&(t={strict:t,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"parseAllBytes"in t||(t.parseAllBytes=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),"string"==typeof e&&(e=n.util.createBuffer(e));var r=e.length(),i=a(e,e.length(),0,t);if(t.parseAllBytes&&0!==e.length()){var s=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw s.byteCount=r,s.remaining=e.length(),s}return i},i.toDer=function(e){var t=n.util.createBuffer(),r=e.tagClass|e.type,s=n.util.createBuffer(),a=!1;if("bitStringContents"in e&&(a=!0,e.original&&(a=i.equals(e,e.original))),a)s.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:s.putByte(0);for(var o=0;o<e.value.length;++o)void 0!==e.value[o]&&s.putBuffer(i.toDer(e.value[o]))}else if(e.type===i.Type.BMPSTRING)for(o=0;o<e.value.length;++o)s.putInt16(e.value.charCodeAt(o));else!(e.type===i.Type.INTEGER&&e.value.length>1)||(0!==e.value.charCodeAt(0)||128&e.value.charCodeAt(1))&&(255!==e.value.charCodeAt(0)||128&~e.value.charCodeAt(1))?s.putBytes(e.value):s.putBytes(e.value.substr(1));if(t.putByte(r),s.length()<=127)t.putByte(127&s.length());else{var c=s.length(),u="";do{u+=String.fromCharCode(255&c),c>>>=8}while(c>0);t.putByte(128|u.length);for(o=u.length-1;o>=0;--o)t.putByte(u.charCodeAt(o))}return t.putBuffer(s),t},i.oidToDer=function(e){var t,r,i,s,a=e.split("."),o=n.util.createBuffer();o.putByte(40*parseInt(a[0],10)+parseInt(a[1],10));for(var c=2;c<a.length;++c){t=!0,r=[],i=parseInt(a[c],10);do{s=127&i,i>>>=7,t||(s|=128),r.push(s),t=!1}while(i>0);for(var u=r.length-1;u>=0;--u)o.putByte(r[u])}return o},i.derToOid=function(e){var t;"string"==typeof e&&(e=n.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var i=0;e.length()>0;)i<<=7,128&(r=e.getByte())?i+=127&r:(t+="."+(i+r),i=0);return t},i.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(e.substr(2,2),10)-1,i=parseInt(e.substr(4,2),10),s=parseInt(e.substr(6,2),10),a=parseInt(e.substr(8,2),10),o=0;if(e.length>11){var c=e.charAt(10),u=10;"+"!==c&&"-"!==c&&(o=parseInt(e.substr(10,2),10),u+=2)}if(t.setUTCFullYear(r,n,i),t.setUTCHours(s,a,o,0),u&&("+"===(c=e.charAt(u))||"-"===c)){var l=60*parseInt(e.substr(u+1,2),10)+parseInt(e.substr(u+4,2),10);l*=6e4,"+"===c?t.setTime(+t-l):t.setTime(+t+l)}return t},i.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),n=parseInt(e.substr(4,2),10)-1,i=parseInt(e.substr(6,2),10),s=parseInt(e.substr(8,2),10),a=parseInt(e.substr(10,2),10),o=parseInt(e.substr(12,2),10),c=0,u=0,l=!1;"Z"===e.charAt(e.length-1)&&(l=!0);var h=e.length-5,d=e.charAt(h);"+"!==d&&"-"!==d||(u=60*parseInt(e.substr(h+1,2),10)+parseInt(e.substr(h+4,2),10),u*=6e4,"+"===d&&(u*=-1),l=!0);return"."===e.charAt(14)&&(c=1e3*parseFloat(e.substr(14),10)),l?(t.setUTCFullYear(r,n,i),t.setUTCHours(s,a,o,c),t.setTime(+t+u)):(t.setFullYear(r,n,i),t.setHours(s,a,o,c)),t},i.dateToUtcTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push((""+e.getUTCFullYear()).substr(2)),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+="Z"},i.dateToGeneralizedTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push(""+e.getUTCFullYear()),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+="Z"},i.integerToDer=function(e){var t=n.util.createBuffer();if(e>=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=e,r},i.derToInteger=function(e){"string"==typeof e&&(e=n.util.createBuffer(e));var t=8*e.length();if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},i.validate=function(e,t,r,s){var a=!1;if(e.tagClass!==t.tagClass&&void 0!==t.tagClass||e.type!==t.type&&void 0!==t.type)s&&(e.tagClass!==t.tagClass&&s.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&s.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));else if(e.constructed===t.constructed||void 0===t.constructed){if(a=!0,t.value&&n.util.isArray(t.value))for(var o=0,c=0;a&&c<t.value.length;++c)a=t.value[c].optional||!1,e.value[o]&&((a=i.validate(e.value[o],t.value[c],r,s))?++o:t.value[c].optional&&(a=!0)),!a&&s&&s.push("["+t.name+'] Tag class "'+t.tagClass+'", type "'+t.type+'" expected value length "'+t.value.length+'", got "'+e.value.length+'"');if(a&&r)if(t.capture&&(r[t.capture]=e.value),t.captureAsn1&&(r[t.captureAsn1]=e),t.captureBitStringContents&&"bitStringContents"in e&&(r[t.captureBitStringContents]=e.bitStringContents),t.captureBitStringValue&&"bitStringContents"in e)if(e.bitStringContents.length<2)r[t.captureBitStringValue]="";else{if(0!==e.bitStringContents.charCodeAt(0))throw new Error("captureBitStringValue only supported for zero unused bits");r[t.captureBitStringValue]=e.bitStringContents.slice(1)}}else s&&s.push("["+t.name+'] Expected constructed "'+t.constructed+'", got "'+e.constructed+'"');return a};var o=/[^\\u0000-\\u00ff]/;i.prettyPrint=function(e,t,r){var s="";r=r||2,(t=t||0)>0&&(s+="\n");for(var a="",c=0;c<t*r;++c)a+=" ";switch(s+=a+"Tag: ",e.tagClass){case i.Class.UNIVERSAL:s+="Universal:";break;case i.Class.APPLICATION:s+="Application:";break;case i.Class.CONTEXT_SPECIFIC:s+="Context-Specific:";break;case i.Class.PRIVATE:s+="Private:"}if(e.tagClass===i.Class.UNIVERSAL)switch(s+=e.type,e.type){case i.Type.NONE:s+=" (None)";break;case i.Type.BOOLEAN:s+=" (Boolean)";break;case i.Type.INTEGER:s+=" (Integer)";break;case i.Type.BITSTRING:s+=" (Bit string)";break;case i.Type.OCTETSTRING:s+=" (Octet string)";break;case i.Type.NULL:s+=" (Null)";break;case i.Type.OID:s+=" (Object Identifier)";break;case i.Type.ODESC:s+=" (Object Descriptor)";break;case i.Type.EXTERNAL:s+=" (External or Instance of)";break;case i.Type.REAL:s+=" (Real)";break;case i.Type.ENUMERATED:s+=" (Enumerated)";break;case i.Type.EMBEDDED:s+=" (Embedded PDV)";break;case i.Type.UTF8:s+=" (UTF8)";break;case i.Type.ROID:s+=" (Relative Object Identifier)";break;case i.Type.SEQUENCE:s+=" (Sequence)";break;case i.Type.SET:s+=" (Set)";break;case i.Type.PRINTABLESTRING:s+=" (Printable String)";break;case i.Type.IA5String:s+=" (IA5String (ASCII))";break;case i.Type.UTCTIME:s+=" (UTC time)";break;case i.Type.GENERALIZEDTIME:s+=" (Generalized time)";break;case i.Type.BMPSTRING:s+=" (BMP String)"}else s+=e.type;if(s+="\n",s+=a+"Constructed: "+e.constructed+"\n",e.composed){var u=0,l="";for(c=0;c<e.value.length;++c)void 0!==e.value[c]&&(u+=1,l+=i.prettyPrint(e.value[c],t+1,r),c+1<e.value.length&&(l+=","));s+=a+"Sub values: "+u+l}else{if(s+=a+"Value: ",e.type===i.Type.OID){var h=i.derToOid(e.value);s+=h,n.pki&&n.pki.oids&&h in n.pki.oids&&(s+=" ("+n.pki.oids[h]+") ")}if(e.type===i.Type.INTEGER)try{s+=i.derToInteger(e.value)}catch(t){s+="0x"+n.util.bytesToHex(e.value)}else if(e.type===i.Type.BITSTRING){if(e.value.length>1?s+="0x"+n.util.bytesToHex(e.value.slice(1)):s+="(none)",e.value.length>0){var d=e.value.charCodeAt(0);1==d?s+=" (1 unused bit shown)":d>1&&(s+=" ("+d+" unused bits shown)")}}else if(e.type===i.Type.OCTETSTRING)o.test(e.value)||(s+="("+e.value+") "),s+="0x"+n.util.bytesToHex(e.value);else if(e.type===i.Type.UTF8)try{s+=n.util.decodeUtf8(e.value)}catch(t){if("URI malformed"!==t.message)throw t;s+="0x"+n.util.bytesToHex(e.value)+" (malformed UTF8)"}else e.type===i.Type.PRINTABLESTRING||e.type===i.Type.IA5String?s+=e.value:o.test(e.value)?s+="0x"+n.util.bytesToHex(e.value):0===e.value.length?s+="[null]":s+=e.value}return s}},7885:(e,t,r)=>{var n=r(4643);r(3739),r(3105);var i=e.exports=n.tls;function s(e,t,r){var s=t.entity===n.tls.ConnectionEnd.client;e.read.cipherState={init:!1,cipher:n.cipher.createDecipher("AES-CBC",s?r.keys.server_write_key:r.keys.client_write_key),iv:s?r.keys.server_write_IV:r.keys.client_write_IV},e.write.cipherState={init:!1,cipher:n.cipher.createCipher("AES-CBC",s?r.keys.client_write_key:r.keys.server_write_key),iv:s?r.keys.client_write_IV:r.keys.server_write_IV},e.read.cipherFunction=u,e.write.cipherFunction=a,e.read.macLength=e.write.macLength=r.mac_length,e.read.macFunction=e.write.macFunction=i.hmac_sha1}function a(e,t){var r,s=!1,a=t.macFunction(t.macKey,t.sequenceNumber,e);e.fragment.putBytes(a),t.updateSequenceNumber(),r=e.version.minor===i.Versions.TLS_1_0.minor?t.cipherState.init?null:t.cipherState.iv:n.random.getBytesSync(16),t.cipherState.init=!0;var c=t.cipherState.cipher;return c.start({iv:r}),e.version.minor>=i.Versions.TLS_1_1.minor&&c.output.putBytes(r),c.update(e.fragment),c.finish(o)&&(e.fragment=c.output,e.length=e.fragment.length(),s=!0),s}function o(e,t,r){if(!r){var n=e-t.length()%e;t.fillWithByte(n-1,n)}return!0}function c(e,t,r){var n=!0;if(r){for(var i=t.length(),s=t.last(),a=i-1-s;a<i-1;++a)n=n&&t.at(a)==s;n&&t.truncate(s+1)}return n}function u(e,t){var r,s=!1;r=e.version.minor===i.Versions.TLS_1_0.minor?t.cipherState.init?null:t.cipherState.iv:e.fragment.getBytes(16),t.cipherState.init=!0;var a=t.cipherState.cipher;a.start({iv:r}),a.update(e.fragment),s=a.finish(c);var o=t.macLength,u=n.random.getBytesSync(o),l=a.output.length();l>=o?(e.fragment=a.output.getBytes(l-o),u=a.output.getBytes(o)):e.fragment=a.output.getBytes(),e.fragment=n.util.createBuffer(e.fragment),e.length=e.fragment.length();var h=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),s=function(e,t,r){var i=n.hmac.create();return i.start("SHA1",e),i.update(t),t=i.digest().getBytes(),i.start(null,null),i.update(r),r=i.digest().getBytes(),t===r}(t.macKey,u,h)&&s,s}i.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=i.BulkCipherAlgorithm.aes,e.cipher_type=i.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=i.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:s},i.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=i.BulkCipherAlgorithm.aes,e.cipher_type=i.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=i.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:s}},7970:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.verifyTypedData=t.TypedDataEncoder=void 0;const n=r(6107),i=r(6468),s=r(203),a=r(8718),o=r(5568),c=new Uint8Array(32);c.fill(0);const u=BigInt(-1),l=BigInt(0),h=BigInt(1),d=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const f=(0,a.toBeHex)(h,32),p=(0,a.toBeHex)(l,32),g={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},y=["name","version","chainId","verifyingContract","salt"];function m(e){return function(t){return(0,a.assertArgument)("string"==typeof t,`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const b={name:m("name"),version:m("version"),chainId:function(e){const t=(0,a.getBigInt)(e,"domain.chainId");return(0,a.assertArgument)(t>=0,"invalid chain ID","domain.chainId",e),Number.isSafeInteger(t)?Number(t):(0,a.toQuantity)(t)},verifyingContract:function(e){try{return(0,n.getAddress)(e).toLowerCase()}catch(e){}(0,a.assertArgument)(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){const t=(0,a.getBytes)(e,"domain.salt");return(0,a.assertArgument)(32===t.length,'invalid domain value "salt"',"domain.salt",e),(0,a.hexlify)(t)}};function w(e){{const t=e.match(/^(u?)int(\d+)$/);if(t){const r=""===t[1],n=parseInt(t[2]);(0,a.assertArgument)(n%8==0&&0!==n&&n<=256&&t[2]===String(n),"invalid numeric width","type",e);const i=(0,a.mask)(d,r?n-1:n),s=r?(i+h)*u:l;return function(t){const n=(0,a.getBigInt)(t,"value");return(0,a.assertArgument)(n>=s&&n<=i,`value out-of-bounds for ${e}`,"value",n),(0,a.toBeHex)(r?(0,a.toTwos)(n,256):n,32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(0,a.assertArgument)(0!==r&&r<=32&&t[1]===String(r),"invalid bytes width","type",e),function(t){const n=(0,a.getBytes)(t);return(0,a.assertArgument)(n.length===r,`invalid length for ${e}`,"value",t),function(e){const t=(0,a.getBytes)(e),r=t.length%32;return r?(0,a.concat)([t,c.slice(r)]):(0,a.hexlify)(t)}(t)}}}switch(e){case"address":return function(e){return(0,a.zeroPadValue)((0,n.getAddress)(e),32)};case"bool":return function(e){return e?f:p};case"bytes":return function(e){return(0,i.keccak256)(e)};case"string":return function(e){return(0,o.id)(e)}}return null}function v(e,t){return`${e}(${t.map(({name:e,type:t})=>t+" "+e).join(",")})`}function A(e){const t=e.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return t?{base:t[1],index:t[2]+t[4],array:{base:t[1],prefix:t[1]+t[2],count:t[5]?parseInt(t[5]):-1}}:{base:e}}class E{primaryType;#Mt;get types(){return JSON.parse(this.#Mt)}#jt;#Kt;constructor(e){this.#jt=new Map,this.#Kt=new Map;const t=new Map,r=new Map,n=new Map,i={};Object.keys(e).forEach(s=>{i[s]=e[s].map(({name:t,type:r})=>{let{base:n,index:i}=A(r);return"int"!==n||e.int||(n="int256"),"uint"!==n||e.uint||(n="uint256"),{name:t,type:n+(i||"")}}),t.set(s,new Set),r.set(s,[]),n.set(s,new Set)}),this.#Mt=JSON.stringify(i);for(const n in i){const s=new Set;for(const o of i[n]){(0,a.assertArgument)(!s.has(o.name),`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(n)}`,"types",e),s.add(o.name);const i=A(o.type).base;(0,a.assertArgument)(i!==n,`circular type reference to ${JSON.stringify(i)}`,"types",e);w(i)||((0,a.assertArgument)(r.has(i),`unknown type ${JSON.stringify(i)}`,"types",e),r.get(i).push(n),t.get(n).add(i))}}const s=Array.from(r.keys()).filter(e=>0===r.get(e).length);(0,a.assertArgument)(0!==s.length,"missing primary type","types",e),(0,a.assertArgument)(1===s.length,`ambiguous primary types or unused types: ${s.map(e=>JSON.stringify(e)).join(", ")}`,"types",e),(0,a.defineProperties)(this,{primaryType:s[0]}),function i(s,o){(0,a.assertArgument)(!o.has(s),`circular type reference to ${JSON.stringify(s)}`,"types",e),o.add(s);for(const e of t.get(s))if(r.has(e)){i(e,o);for(const t of o)n.get(t).add(e)}o.delete(s)}(this.primaryType,new Set);for(const[e,t]of n){const r=Array.from(t);r.sort(),this.#jt.set(e,v(e,i[e])+r.map(e=>v(e,i[e])).join(""))}}getEncoder(e){let t=this.#Kt.get(e);return t||(t=this.#Vt(e),this.#Kt.set(e,t)),t}#Vt(e){{const t=w(e);if(t)return t}const t=A(e).array;if(t){const e=t.prefix,r=this.getEncoder(e);return n=>{(0,a.assertArgument)(-1===t.count||t.count===n.length,`array length mismatch; expected length ${t.count}`,"value",n);let s=n.map(r);return this.#jt.has(e)&&(s=s.map(i.keccak256)),(0,i.keccak256)((0,a.concat)(s))}}const r=this.types[e];if(r){const t=(0,o.id)(this.#jt.get(e));return e=>{const n=r.map(({name:t,type:r})=>{const n=this.getEncoder(r)(e[t]);return this.#jt.has(r)?(0,i.keccak256)(n):n});return n.unshift(t),(0,a.concat)(n)}}(0,a.assertArgument)(!1,`unknown type: ${e}`,"type",e)}encodeType(e){const t=this.#jt.get(e);return(0,a.assertArgument)(t,`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return(0,i.keccak256)(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if(w(e))return r(e,t);const n=A(e).array;if(n)return(0,a.assertArgument)(-1===n.count||n.count===t.length,`array length mismatch; expected length ${n.count}`,"value",t),t.map(e=>this._visit(n.prefix,e,r));const i=this.types[e];if(i)return i.reduce((e,{name:n,type:i})=>(e[n]=this._visit(i,t[n],r),e),{});(0,a.assertArgument)(!1,`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new E(e)}static getPrimaryType(e){return E.from(e).primaryType}static hashStruct(e,t,r){return E.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){if(null==e[r])continue;const n=g[r];(0,a.assertArgument)(n,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort((e,t)=>y.indexOf(e.name)-y.indexOf(t.name)),E.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return(0,a.concat)(["0x1901",E.hashDomain(e),E.from(t).hash(r)])}static hash(e,t,r){return(0,i.keccak256)(E.encode(e,t,r))}static async resolveNames(e,t,r,n){e=Object.assign({},e);for(const t in e)null==e[t]&&delete e[t];const i={};e.verifyingContract&&!(0,a.isHexString)(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const s=E.from(t);s.visit(r,(e,t)=>("address"!==e||(0,a.isHexString)(t,20)||(i[t]="0x"),t));for(const e in i)i[e]=await n(e);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),{domain:e,value:r=s.visit(r,(e,t)=>"address"===e&&i[t]?i[t]:t)}}static getPayload(e,t,r){E.hashDomain(e);const n={},i=[];y.forEach(t=>{const r=e[t];null!=r&&(n[t]=b[t](r),i.push({name:t,type:g[t]}))});const s=E.from(t);t=s.types;const o=Object.assign({},t);return(0,a.assertArgument)(null==o.EIP712Domain,"types must not contain EIP712Domain type","types.EIP712Domain",t),o.EIP712Domain=i,s.encode(r),{types:o,domain:n,primaryType:s.primaryType,message:s.visit(r,(e,t)=>{if(e.match(/^bytes(\d*)/))return(0,a.hexlify)((0,a.getBytes)(t));if(e.match(/^u?int/))return(0,a.getBigInt)(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return(0,a.assertArgument)("string"==typeof t,"invalid string","value",t),t}(0,a.assertArgument)(!1,"unsupported type","type",e)})}}}t.TypedDataEncoder=E,t.verifyTypedData=function(e,t,r,n){return(0,s.recoverAddress)(E.hash(e,t,r),n)}},7971:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},7991:(e,t)=>{"use strict";t.byteLength=function(e){var t=o(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,s=o(e),a=s[0],c=s[1],u=new i(function(e,t,r){return 3*(t+r)/4-r}(0,a,c)),l=0,h=c>0?a-4:a;for(r=0;r<h;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===c&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[l++]=255&t);1===c&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,s=[],a=16383,o=0,c=n-i;o<c;o+=a)s.push(u(e,o,o+a>c?c:o+a));1===i?(t=e[n-1],s.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],s.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return s.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=s[a],n[s.charCodeAt(a)]=a;function o(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function u(e,t,r){for(var n,i=[],s=t;s<r;s+=3)n=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),i.push(c(n));return i.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8060:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.add5L=t.add5H=t.add4H=t.add4L=t.add3H=t.add3L=t.add=t.rotlBL=t.rotlBH=t.rotlSL=t.rotlSH=t.rotr32L=t.rotr32H=t.rotrBL=t.rotrBH=t.rotrSL=t.rotrSH=t.shrSL=t.shrSH=t.toBig=t.split=t.fromBig=void 0;const r=BigInt(2**32-1),n=BigInt(32);function i(e,t=!1){return t?{h:Number(e&r),l:Number(e>>n&r)}:{h:0|Number(e>>n&r),l:0|Number(e&r)}}function s(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:a,l:o}=i(e[s],t);[r[s],n[s]]=[a,o]}return[r,n]}t.fromBig=i,t.split=s;const a=(e,t)=>BigInt(e>>>0)<<n|BigInt(t>>>0);t.toBig=a;const o=(e,t,r)=>e>>>r;t.shrSH=o;const c=(e,t,r)=>e<<32-r|t>>>r;t.shrSL=c;const u=(e,t,r)=>e>>>r|t<<32-r;t.rotrSH=u;const l=(e,t,r)=>e<<32-r|t>>>r;t.rotrSL=l;const h=(e,t,r)=>e<<64-r|t>>>r-32;t.rotrBH=h;const d=(e,t,r)=>e>>>r-32|t<<64-r;t.rotrBL=d;const f=(e,t)=>t;t.rotr32H=f;const p=(e,t)=>e;t.rotr32L=p;const g=(e,t,r)=>e<<r|t>>>32-r;t.rotlSH=g;const y=(e,t,r)=>t<<r|e>>>32-r;t.rotlSL=y;const m=(e,t,r)=>t<<r-32|e>>>64-r;t.rotlBH=m;const b=(e,t,r)=>e<<r-32|t>>>64-r;function w(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:0|i}}t.rotlBL=b,t.add=w;const v=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);t.add3L=v;const A=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;t.add3H=A;const E=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);t.add4L=E;const C=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;t.add4H=C;const B=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);t.add5L=B;const S=(e,t,r,n,i,s)=>t+r+n+i+s+(e/2**32|0)|0;t.add5H=S;const k={fromBig:i,split:s,toBig:a,shrSH:o,shrSL:c,rotrSH:u,rotrSL:l,rotrBH:h,rotrBL:d,rotr32H:f,rotr32L:p,rotlSH:g,rotlSL:y,rotlBH:m,rotlBL:b,add:w,add3L:v,add3H:A,add4L:E,add4H:C,add5H:S,add5L:B};t.default=k},8151:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.encryptNumber=t.decodeUint=t.encodeUint=t.encodeKey=t.encodeString=t.generateRandomAesKeySizeNumber=t.decryptString=t.decryptUint=t.buildStringInputText=t.buildInputText=t.signInputText=t.sign=t.recoverUserKey=t.decryptRSA=t.generateRSAKeyPair=t.decrypt=t.encrypt=void 0;const i=n(r(1828)),s=r(9900),a=16;function o(e,t){if(t.length>a)throw new RangeError("Plaintext size must be 128 bits or smaller.");const r=i.default.random.getBytesSync(a),n=b(r,e),s=new Uint8Array([...new Uint8Array(a-t.length),...t]),o=new Uint8Array(a);for(let e=0;e<a;e++)o[e]=n[e]^s[e];return{ciphertext:o,r:p(r)}}function c(e,t,r){if(r.length!==a)throw new RangeError("Ciphertext size must be 128 bits.");if(t.length!=a)throw new RangeError("Random size must be 128 bits.");const n=b(t,e),i=new Uint8Array(a);for(let e=0;e<n.length;e++)i[e]=n[e]^r[e];return i}function u(e,t){const r=i.default.pki.privateKeyToPem(i.default.pki.privateKeyFromAsn1(i.default.asn1.fromDer(i.default.util.createBuffer(e)))),n=p(i.default.pki.privateKeyFromPem(r).decrypt(i.default.util.hexToBytes(t),"RSA-OAEP",{md:i.default.md.sha256.create()})),s=[];for(let e=0;e<n.length;e++)s.push(n[e].toString(16).padStart(2,"0"));return s.join("")}function l(e,t){const r=new s.SigningKey(t).sign(e);return new Uint8Array([...(0,s.getBytes)(r.r),...(0,s.getBytes)(r.s),...(0,s.getBytes)("0x0"+(r.v-27))])}function h(e,t,r,n){return l((0,s.solidityPackedKeccak256)(["address","address","bytes4","uint256"],[e.wallet.address,t,r,n]),e.wallet.privateKey)}function d(e,t,r,n){if(e>=BigInt(2)**BigInt(64))throw new RangeError("Plaintext size must be 64 bits or smaller.");const i=y(e),s=g(t.userKey),{ciphertext:a,r:c}=o(s,i),u=m(new Uint8Array([...a,...c]));return{ciphertext:u,signature:h(t,r,n,u)}}function f(e,t){let r=new Uint8Array;for(;e>0;){const t=new Uint8Array([Number(e&BigInt(255))]);r=new Uint8Array([...t,...r]),e>>=BigInt(8)}r=new Uint8Array([...new Uint8Array(32-r.length),...r]);const n=r.subarray(0,a),i=r.subarray(a);return m(c(g(t),i,n))}function p(e){return new Uint8Array([...e.split("").map(e=>parseInt(e.codePointAt(0)?.toString(16),16))])}function g(e){const t=new Uint8Array(16);for(let r=0;r<32;r+=2)t[r/2]=parseInt(e.slice(r,r+2),16);return t}function y(e){const t=new Uint8Array(a);for(let r=15;r>=0;r--)t[r]=Number(e&BigInt(255)),e>>=BigInt(8);return t}function m(e){const t=[];let r="";for(let n=0;n<e.length;n++)r=e[n].toString(16).padStart(2,"0"),t.push(r);return BigInt("0x"+t.join(""))}function b(e,t){if(t.length!=a)throw new RangeError("Key size must be 128 bits.");const r=i.default.cipher.createCipher("AES-ECB",i.default.util.createBuffer(t));r.start(),r.update(i.default.util.createBuffer(e)),r.finish();return p(r.output.data).slice(0,a)}t.encrypt=o,t.decrypt=c,t.generateRSAKeyPair=function(){const e=i.default.pki.rsa.generateKeyPair({bits:2048}),t=i.default.asn1.toDer(i.default.pki.privateKeyToAsn1(e.privateKey)).data,r=i.default.asn1.toDer(i.default.pki.publicKeyToAsn1(e.publicKey)).data;return{privateKey:p(t),publicKey:p(r)}},t.decryptRSA=u,t.recoverUserKey=function(e,t,r){const n=u(e,t),i=u(e,r),s=g(n),o=g(i),c=new Uint8Array(a);for(let e=0;e<a;e++)c[e]=s[e]^o[e];const l=[];let h="";for(let e=0;e<c.length;e++)h=c[e].toString(16).padStart(2,"0"),l.push(h);return l.join("")},t.sign=l,t.signInputText=h,t.buildInputText=d,t.buildStringInputText=function(e,t,r,n){let i=(new TextEncoder).encode(e);const s={ciphertext:{value:new Array},signature:new Array};for(let e=0;e<i.length;e+=8){const a=Math.min(e+8,i.length),o=d(m(new Uint8Array([...i.slice(e,a),...new Uint8Array(8-(a-e))])),t,r,n);s.ciphertext.value.push(o.ciphertext),s.signature.push(o.signature)}return s},t.decryptUint=f,t.decryptString=function(e,t){let r=new Uint8Array;for(let n=0;n<e.value.length;n++){const i=f(BigInt(e.value[n]),t);r=new Uint8Array([...r,...y(i)])}return(new TextDecoder).decode(r).replace(/\0/g,"")},t.generateRandomAesKeySizeNumber=function(){return i.default.random.getBytesSync(a)},t.encodeString=p,t.encodeKey=g,t.encodeUint=y,t.decodeUint=m,t.encryptNumber=b},8289:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha224=t.sha256=void 0;const n=r(5337),i=r(1197),s=(e,t,r)=>e&t^~e&r,a=(e,t,r)=>e&t^e&r^t&r,o=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]),c=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),u=new Uint32Array(64);class l extends n.SHA2{constructor(){super(64,32,8,!1),this.A=0|c[0],this.B=0|c[1],this.C=0|c[2],this.D=0|c[3],this.E=0|c[4],this.F=0|c[5],this.G=0|c[6],this.H=0|c[7]}get(){const{A:e,B:t,C:r,D:n,E:i,F:s,G:a,H:o}=this;return[e,t,r,n,i,s,a,o]}set(e,t,r,n,i,s,a,o){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|s,this.G=0|a,this.H=0|o}process(e,t){for(let r=0;r<16;r++,t+=4)u[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=u[e-15],r=u[e-2],n=(0,i.rotr)(t,7)^(0,i.rotr)(t,18)^t>>>3,s=(0,i.rotr)(r,17)^(0,i.rotr)(r,19)^r>>>10;u[e]=s+u[e-7]+n+u[e-16]|0}let{A:r,B:n,C:c,D:l,E:h,F:d,G:f,H:p}=this;for(let e=0;e<64;e++){const t=p+((0,i.rotr)(h,6)^(0,i.rotr)(h,11)^(0,i.rotr)(h,25))+s(h,d,f)+o[e]+u[e]|0,g=((0,i.rotr)(r,2)^(0,i.rotr)(r,13)^(0,i.rotr)(r,22))+a(r,n,c)|0;p=f,f=d,d=h,h=l+t|0,l=c,c=n,n=r,r=t+g|0}r=r+this.A|0,n=n+this.B|0,c=c+this.C|0,l=l+this.D|0,h=h+this.E|0,d=d+this.F|0,f=f+this.G|0,p=p+this.H|0,this.set(r,n,c,l,h,d,f,p)}roundClean(){u.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class h extends l{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}}t.sha256=(0,i.wrapConstructor)(()=>new l),t.sha224=(0,i.wrapConstructor)(()=>new h)},8323:(e,t,r)=>{var n=r(4643);r(8550),r(5417),r(121),e.exports=n.kem=n.kem||{};var i=n.jsbn.BigInteger;function s(e,t,r,i){e.generate=function(e,s){for(var a=new n.util.ByteBuffer,o=Math.ceil(s/i)+r,c=new n.util.ByteBuffer,u=r;u<o;++u){c.putInt32(u),t.start(),t.update(e+c.getBytes());var l=t.digest();a.putBytes(l.getBytes(i))}return a.truncate(a.length()-s),a.getBytes()}}n.kem.rsa={},n.kem.rsa.create=function(e,t){var r=(t=t||{}).prng||n.random,s={encrypt:function(t,s){var a,o=Math.ceil(t.n.bitLength()/8);do{a=new i(n.util.bytesToHex(r.getBytesSync(o)),16).mod(t.n)}while(a.compareTo(i.ONE)<=0);var c=o-(a=n.util.hexToBytes(a.toString(16))).length;return c>0&&(a=n.util.fillString(String.fromCharCode(0),c)+a),{encapsulation:t.encrypt(a,"NONE"),key:e.generate(a,s)}},decrypt:function(t,r,n){var i=t.decrypt(r,"NONE");return e.generate(i,n)}};return s},n.kem.kdf1=function(e,t){s(this,e,0,t||e.digestLength)},n.kem.kdf2=function(e,t){s(this,e,1,t||e.digestLength)}},8353:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scryptAsync=t.scrypt=void 0;const n=r(9071),i=r(8289),s=r(5299),a=r(1197),o=(e,t)=>e<<t|e>>>32-t;function c(e,t,r,n,i,s){let a=e[t++]^r[n++],c=e[t++]^r[n++],u=e[t++]^r[n++],l=e[t++]^r[n++],h=e[t++]^r[n++],d=e[t++]^r[n++],f=e[t++]^r[n++],p=e[t++]^r[n++],g=e[t++]^r[n++],y=e[t++]^r[n++],m=e[t++]^r[n++],b=e[t++]^r[n++],w=e[t++]^r[n++],v=e[t++]^r[n++],A=e[t++]^r[n++],E=e[t++]^r[n++],C=a,B=c,S=u,k=l,T=h,I=d,P=f,N=p,x=g,O=y,R=m,U=b,L=w,D=v,F=A,M=E;for(let e=0;e<8;e+=2)T^=o(C+L|0,7),x^=o(T+C|0,9),L^=o(x+T|0,13),C^=o(L+x|0,18),O^=o(I+B|0,7),D^=o(O+I|0,9),B^=o(D+O|0,13),I^=o(B+D|0,18),F^=o(R+P|0,7),S^=o(F+R|0,9),P^=o(S+F|0,13),R^=o(P+S|0,18),k^=o(M+U|0,7),N^=o(k+M|0,9),U^=o(N+k|0,13),M^=o(U+N|0,18),B^=o(C+k|0,7),S^=o(B+C|0,9),k^=o(S+B|0,13),C^=o(k+S|0,18),P^=o(I+T|0,7),N^=o(P+I|0,9),T^=o(N+P|0,13),I^=o(T+N|0,18),U^=o(R+O|0,7),x^=o(U+R|0,9),O^=o(x+U|0,13),R^=o(O+x|0,18),L^=o(M+F|0,7),D^=o(L+M|0,9),F^=o(D+L|0,13),M^=o(F+D|0,18);i[s++]=a+C|0,i[s++]=c+B|0,i[s++]=u+S|0,i[s++]=l+k|0,i[s++]=h+T|0,i[s++]=d+I|0,i[s++]=f+P|0,i[s++]=p+N|0,i[s++]=g+x|0,i[s++]=y+O|0,i[s++]=m+R|0,i[s++]=b+U|0,i[s++]=w+L|0,i[s++]=v+D|0,i[s++]=A+F|0,i[s++]=E+M|0}function u(e,t,r,n,i){let s=n+0,a=n+16*i;for(let n=0;n<16;n++)r[a+n]=e[t+16*(2*i-1)+n];for(let n=0;n<i;n++,s+=16,t+=16)c(r,a,e,t,r,s),n>0&&(a+=16),c(r,s,e,t+=16,r,a)}function l(e,t,r){const o=(0,a.checkOpts)({dkLen:32,asyncTick:10,maxmem:1073742848},r),{N:c,r:u,p:l,dkLen:h,asyncTick:d,maxmem:f,onProgress:p}=o;if((0,n.number)(c),(0,n.number)(u),(0,n.number)(l),(0,n.number)(h),(0,n.number)(d),(0,n.number)(f),void 0!==p&&"function"!=typeof p)throw new Error("progressCb should be function");const g=128*u,y=g/4;if(c<=1||c&c-1||c>=2**(g/8)||c>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(l<0||l>137438953440/g)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(h<0||h>137438953440)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const m=g*(c+l);if(m>f)throw new Error(`Scrypt: parameters too large, ${m} (128 * r * (N + p)) > ${f} (maxmem)`);const b=(0,s.pbkdf2)(i.sha256,e,t,{c:1,dkLen:g*l}),w=(0,a.u32)(b),v=(0,a.u32)(new Uint8Array(g*c)),A=(0,a.u32)(new Uint8Array(g));let E=()=>{};if(p){const e=2*c*l,t=Math.max(Math.floor(e/1e4),1);let r=0;E=()=>{r++,!p||r%t&&r!==e||p(r/e)}}return{N:c,r:u,p:l,dkLen:h,blockSize32:y,V:v,B32:w,B:b,tmp:A,blockMixCb:E,asyncTick:d}}function h(e,t,r,n,a){const o=(0,s.pbkdf2)(i.sha256,e,r,{c:1,dkLen:t});return r.fill(0),n.fill(0),a.fill(0),o}t.scrypt=function(e,t,r){const{N:n,r:i,p:s,dkLen:a,blockSize32:o,V:c,B32:d,B:f,tmp:p,blockMixCb:g}=l(e,t,r);for(let e=0;e<s;e++){const t=o*e;for(let e=0;e<o;e++)c[e]=d[t+e];for(let e=0,t=0;e<n-1;e++)u(c,t,c,t+=o,i),g();u(c,(n-1)*o,d,t,i),g();for(let e=0;e<n;e++){const e=d[t+o-16]%n;for(let r=0;r<o;r++)p[r]=d[t+r]^c[e*o+r];u(p,0,d,t,i),g()}}return h(e,a,f,c,p)},t.scryptAsync=async function(e,t,r){const{N:n,r:i,p:s,dkLen:o,blockSize32:c,V:d,B32:f,B:p,tmp:g,blockMixCb:y,asyncTick:m}=l(e,t,r);for(let e=0;e<s;e++){const t=c*e;for(let e=0;e<c;e++)d[e]=f[t+e];let r=0;await(0,a.asyncLoop)(n-1,m,()=>{u(d,r,d,r+=c,i),y()}),u(d,(n-1)*c,f,t,i),y(),await(0,a.asyncLoop)(n,m,()=>{const e=f[t+c-16]%n;for(let r=0;r<c;r++)g[r]=f[t+r]^d[e*c+r];u(g,0,f,t,i),y()})}return h(e,o,p,d,g)}},8550:(e,t,r)=>{var n=r(3372).Buffer,i=r(4643),s=r(2089),a=e.exports=i.util=i.util||{};function o(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function c(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(a.isArrayBuffer(e)||a.isArrayBufferView(e))if(void 0!==n&&e instanceof n)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(e){for(var r=0;r<t.length;++r)this.putByte(t[r])}}else(e instanceof c||"object"==typeof e&&"string"==typeof e.data&&"number"==typeof e.read)&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}!function(){if("undefined"!=typeof process&&process.nextTick&&!process.browser)return a.nextTick=process.nextTick,void("function"==typeof setImmediate?a.setImmediate=setImmediate:a.setImmediate=a.nextTick);if("function"==typeof setImmediate)return a.setImmediate=function(){return setImmediate.apply(void 0,arguments)},void(a.nextTick=function(e){return setImmediate(e)});if(a.setImmediate=function(e){setTimeout(e,0)},"undefined"!=typeof window&&"function"==typeof window.postMessage){var e="forge.setImmediate",t=[];a.setImmediate=function(r){t.push(r),1===t.length&&window.postMessage(e,"*")},window.addEventListener("message",function(r){if(r.source===window&&r.data===e){r.stopPropagation();var n=t.slice();t.length=0,n.forEach(function(e){e()})}},!0)}if("undefined"!=typeof MutationObserver){var r=Date.now(),n=!0,i=document.createElement("div");t=[];new MutationObserver(function(){var e=t.slice();t.length=0,e.forEach(function(e){e()})}).observe(i,{attributes:!0});var s=a.setImmediate;a.setImmediate=function(e){Date.now()-r>15?(r=Date.now(),s(e)):(t.push(e),1===t.length&&i.setAttribute("a",n=!n))}}a.nextTick=a.setImmediate}(),a.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,a.globalScope=a.isNodejs?r.g:"undefined"==typeof self?window:self,a.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},a.isArrayBufferView=function(e){return e&&a.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},a.ByteBuffer=c,a.ByteStringBuffer=c;a.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},a.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},a.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},a.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},a.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},a.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},a.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(a.encodeUtf8(e))},a.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},a.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},a.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},a.ByteStringBuffer.prototype.putInt=function(e,t){o(t);var r="";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},a.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},a.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())},a.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},a.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e},a.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e},a.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e},a.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e},a.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e},a.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e},a.ByteStringBuffer.prototype.getInt=function(e){o(e);var t=0;do{t=(t<<8)+this.data.charCodeAt(this.read++),e-=8}while(e>0);return t},a.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},a.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},a.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},a.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},a.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},a.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},a.ByteStringBuffer.prototype.copy=function(){var e=a.createBuffer(this.data);return e.read=this.read,e},a.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},a.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},a.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},a.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var r=this.data.charCodeAt(t);r<16&&(e+="0"),e+=r.toString(16)}return e},a.ByteStringBuffer.prototype.toString=function(){return a.decodeUtf8(this.bytes())},a.DataBuffer=function(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var r=a.isArrayBuffer(e),n=a.isArrayBufferView(e);if(r||n)return this.data=r?new DataView(e):new DataView(e.buffer,e.byteOffset,e.byteLength),void(this.write="writeOffset"in t?t.writeOffset:this.data.byteLength);this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!=e&&this.putBytes(e),"writeOffset"in t&&(this.write=t.writeOffset)},a.DataBuffer.prototype.length=function(){return this.write-this.read},a.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},a.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this},a.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},a.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r<t;++r)this.data.setUint8(e);return this},a.DataBuffer.prototype.putBytes=function(e,t){if(a.isArrayBufferView(e)){var r=(n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)).byteLength-n.byteOffset;return this.accommodate(r),new Uint8Array(this.data.buffer,this.write).set(n),this.write+=r,this}if(a.isArrayBuffer(e)){var n=new Uint8Array(e);return this.accommodate(n.byteLength),new Uint8Array(this.data.buffer).set(n,this.write),this.write+=n.byteLength,this}if(e instanceof a.DataBuffer||"object"==typeof e&&"number"==typeof e.read&&"number"==typeof e.write&&a.isArrayBufferView(e.data)){n=new Uint8Array(e.data.byteLength,e.read,e.length());return this.accommodate(n.byteLength),new Uint8Array(e.data.byteLength,this.write).set(n),this.write+=n.byteLength,this}if(e instanceof a.ByteStringBuffer&&(e=e.data,t="binary"),t=t||"binary","string"==typeof e){var i;if("hex"===t)return this.accommodate(Math.ceil(e.length/2)),i=new Uint8Array(this.data.buffer,this.write),this.write+=a.binary.hex.decode(e,i,this.write),this;if("base64"===t)return this.accommodate(3*Math.ceil(e.length/4)),i=new Uint8Array(this.data.buffer,this.write),this.write+=a.binary.base64.decode(e,i,this.write),this;if("utf8"===t&&(e=a.encodeUtf8(e),t="binary"),"binary"===t||"raw"===t)return this.accommodate(e.length),i=new Uint8Array(this.data.buffer,this.write),this.write+=a.binary.raw.decode(i),this;if("utf16"===t)return this.accommodate(2*e.length),i=new Uint16Array(this.data.buffer,this.write),this.write+=a.text.utf16.encode(i),this;throw new Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)},a.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this},a.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")},a.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this},a.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},a.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},a.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},a.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},a.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},a.DataBuffer.prototype.putInt=function(e,t){o(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},a.DataBuffer.prototype.putSignedInt=function(e,t){return o(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)},a.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},a.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e},a.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e},a.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e},a.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e},a.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e},a.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e},a.DataBuffer.prototype.getInt=function(e){o(e);var t=0;do{t=(t<<8)+this.data.getInt8(this.read++),e-=8}while(e>0);return t},a.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},a.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},a.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},a.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},a.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},a.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},a.DataBuffer.prototype.copy=function(){return new a.DataBuffer(this)},a.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},a.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},a.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},a.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var r=this.data.getUint8(t);r<16&&(e+="0"),e+=r.toString(16)}return e},a.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if("binary"===(e=e||"utf8")||"raw"===e)return a.binary.raw.encode(t);if("hex"===e)return a.binary.hex.encode(t);if("base64"===e)return a.binary.base64.encode(t);if("utf8"===e)return a.text.utf8.decode(t);if("utf16"===e)return a.text.utf16.decode(t);throw new Error("Invalid encoding: "+e)},a.createBuffer=function(e,t){return t=t||"raw",void 0!==e&&"utf8"===t&&(e=a.encodeUtf8(e)),new a.ByteBuffer(e)},a.fillString=function(e,t){for(var r="";t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},a.xorBytes=function(e,t,r){for(var n="",i="",s="",a=0,o=0;r>0;--r,++a)i=e.charCodeAt(a)^t.charCodeAt(a),o>=10&&(n+=s,s="",o=0),s+=String.fromCharCode(i),++o;return n+=s},a.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r<e.length;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t},a.bytesToHex=function(e){return a.createBuffer(e).toHex()},a.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,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,-1,-1,-1,-1,-1,-1,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],h="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";a.encode64=function(e,t){for(var r,n,i,s="",a="",o=0;o<e.length;)r=e.charCodeAt(o++),n=e.charCodeAt(o++),i=e.charCodeAt(o++),s+=u.charAt(r>>2),s+=u.charAt((3&r)<<4|n>>4),isNaN(n)?s+="==":(s+=u.charAt((15&n)<<2|i>>6),s+=isNaN(i)?"=":u.charAt(63&i)),t&&s.length>t&&(a+=s.substr(0,t)+"\r\n",s=s.substr(t));return a+=s},a.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,n,i,s="",a=0;a<e.length;)t=l[e.charCodeAt(a++)-43],r=l[e.charCodeAt(a++)-43],n=l[e.charCodeAt(a++)-43],i=l[e.charCodeAt(a++)-43],s+=String.fromCharCode(t<<2|r>>4),64!==n&&(s+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(s+=String.fromCharCode((3&n)<<6|i)));return s},a.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},a.decodeUtf8=function(e){return decodeURIComponent(escape(e))},a.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:s.encode,decode:s.decode}},a.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},a.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,s=0;s<e.length;++s)n[i++]=e.charCodeAt(s);return t?i-r:n},a.binary.hex.encode=a.bytesToHex,a.binary.hex.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(Math.ceil(e.length/2)));var i=0,s=r=r||0;for(1&e.length&&(i=1,n[s++]=parseInt(e[0],16));i<e.length;i+=2)n[s++]=parseInt(e.substr(i,2),16);return t?s-r:n},a.binary.base64.encode=function(e,t){for(var r,n,i,s="",a="",o=0;o<e.byteLength;)r=e[o++],n=e[o++],i=e[o++],s+=u.charAt(r>>2),s+=u.charAt((3&r)<<4|n>>4),isNaN(n)?s+="==":(s+=u.charAt((15&n)<<2|i>>6),s+=isNaN(i)?"=":u.charAt(63&i)),t&&s.length>t&&(a+=s.substr(0,t)+"\r\n",s=s.substr(t));return a+=s},a.binary.base64.decode=function(e,t,r){var n,i,s,a,o=t;o||(o=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var c=0,u=r=r||0;c<e.length;)n=l[e.charCodeAt(c++)-43],i=l[e.charCodeAt(c++)-43],s=l[e.charCodeAt(c++)-43],a=l[e.charCodeAt(c++)-43],o[u++]=n<<2|i>>4,64!==s&&(o[u++]=(15&i)<<4|s>>2,64!==a&&(o[u++]=(3&s)<<6|a));return t?u-r:o.subarray(0,u)},a.binary.base58.encode=function(e,t){return a.binary.baseN.encode(e,h,t)},a.binary.base58.decode=function(e,t){return a.binary.baseN.decode(e,h,t)},a.text={utf8:{},utf16:{}},a.text.utf8.encode=function(e,t,r){e=a.encodeUtf8(e);var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,s=0;s<e.length;++s)n[i++]=e.charCodeAt(s);return t?i-r:n},a.text.utf8.decode=function(e){return a.decodeUtf8(String.fromCharCode.apply(null,e))},a.text.utf16.encode=function(e,t,r){var n=t;n||(n=new Uint8Array(2*e.length));for(var i=new Uint16Array(n.buffer),s=r=r||0,a=r,o=0;o<e.length;++o)i[a++]=e.charCodeAt(o),s+=2;return t?s-r:n},a.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))},a.deflate=function(e,t,r){if(t=a.decode64(e.deflate(a.encode64(t)).rval),r){var n=2;32&t.charCodeAt(1)&&(n=6),t=t.substring(n,t.length-4)}return t},a.inflate=function(e,t,r){var n=e.inflate(a.encode64(t)).rval;return null===n?null:a.decode64(n)};var d=function(e,t,r){if(!e)throw new Error("WebStorage not available.");var n;if(null===r?n=e.removeItem(t):(r=a.encode64(JSON.stringify(r)),n=e.setItem(t,r)),void 0!==n&&!0!==n.rval){var i=new Error(n.error.message);throw i.id=n.error.id,i.name=n.error.name,i}},f=function(e,t){if(!e)throw new Error("WebStorage not available.");var r=e.getItem(t);if(e.init)if(null===r.rval){if(r.error){var n=new Error(r.error.message);throw n.id=r.error.id,n.name=r.error.name,n}r=null}else r=r.rval;return null!==r&&(r=JSON.parse(a.decode64(r))),r},p=function(e,t,r,n){var i=f(e,t);null===i&&(i={}),i[r]=n,d(e,t,i)},g=function(e,t,r){var n=f(e,t);return null!==n&&(n=r in n?n[r]:null),n},y=function(e,t,r){var n=f(e,t);if(null!==n&&r in n){delete n[r];var i=!0;for(var s in n){i=!1;break}i&&(n=null),d(e,t,n)}},m=function(e,t){d(e,t,null)},b=function(e,t,r){var n,i=null;void 0===r&&(r=["web","flash"]);var s=!1,a=null;for(var o in r){n=r[o];try{if("flash"===n||"both"===n){if(null===t[0])throw new Error("Flash local storage not available.");i=e.apply(this,t),s="flash"===n}"web"!==n&&"both"!==n||(t[0]=localStorage,i=e.apply(this,t),s=!0)}catch(e){a=e}if(s)break}if(!s)throw a;return i};a.setItem=function(e,t,r,n,i){b(p,arguments,i)},a.getItem=function(e,t,r,n){return b(g,arguments,n)},a.removeItem=function(e,t,r,n){b(y,arguments,n)},a.clearItems=function(e,t,r){b(m,arguments,r)},a.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},a.format=function(e){for(var t,r,n=/%./g,i=0,s=[],a=0;t=n.exec(e);){(r=e.substring(a,n.lastIndex-2)).length>0&&s.push(r),a=n.lastIndex;var o=t[0][1];switch(o){case"s":case"o":i<arguments.length?s.push(arguments[1+i++]):s.push("<?>");break;case"%":s.push("%");break;default:s.push("<%"+o+"?>")}}return s.push(e.substring(a)),s.join("")},a.formatNumber=function(e,t,r,n){var i=e,s=isNaN(t=Math.abs(t))?2:t,a=void 0===r?",":r,o=void 0===n?".":n,c=i<0?"-":"",u=parseInt(i=Math.abs(+i||0).toFixed(s),10)+"",l=u.length>3?u.length%3:0;return c+(l?u.substr(0,l)+o:"")+u.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+o)+(s?a+Math.abs(i-u).toFixed(s).slice(2):"")},a.formatSize=function(e){return e=e>=1073741824?a.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?a.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?a.formatNumber(e/1024,0)+" KiB":a.formatNumber(e,0)+" bytes"},a.bytesFromIP=function(e){return-1!==e.indexOf(".")?a.bytesFromIPv4(e):-1!==e.indexOf(":")?a.bytesFromIPv6(e):null},a.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=a.createBuffer(),r=0;r<e.length;++r){var n=parseInt(e[r],10);if(isNaN(n))return null;t.putByte(n)}return t.getBytes()},a.bytesFromIPv6=function(e){for(var t=0,r=2*(8-(e=e.split(":").filter(function(e){return 0===e.length&&++t,!0})).length+t),n=a.createBuffer(),i=0;i<8;++i)if(e[i]&&0!==e[i].length){var s=a.hexToBytes(e[i]);s.length<2&&n.putByte(0),n.putBytes(s)}else n.fillWithByte(0,r),r=0;return n.getBytes()},a.bytesToIP=function(e){return 4===e.length?a.bytesToIPv4(e):16===e.length?a.bytesToIPv6(e):null},a.bytesToIPv4=function(e){if(4!==e.length)return null;for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t.join(".")},a.bytesToIPv6=function(e){if(16!==e.length)return null;for(var t=[],r=[],n=0,i=0;i<e.length;i+=2){for(var s=a.bytesToHex(e[i]+e[i+1]);"0"===s[0]&&"0"!==s;)s=s.substr(1);if("0"===s){var o=r[r.length-1],c=t.length;o&&c===o.end+1?(o.end=c,o.end-o.start>r[n].end-r[n].start&&(n=r.length-1)):r.push({start:c,end:c})}t.push(s)}if(r.length>0){var u=r[n];u.end-u.start>0&&(t.splice(u.start,u.end-u.start+1,""),0===u.start&&t.unshift(""),7===u.end&&t.push(""))}return t.join(":")},a.estimateCores=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},"cores"in a&&!e.update)return t(null,a.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return a.cores=navigator.hardwareConcurrency,t(null,a.cores);if("undefined"==typeof Worker)return a.cores=1,t(null,a.cores);if("undefined"==typeof Blob)return a.cores=2,t(null,a.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(e){for(var t=Date.now(),r=t+4;Date.now()<r;);self.postMessage({st:t,et:r})})}.toString(),")()"],{type:"application/javascript"}));!function e(n,i,s){if(0===i){var o=Math.floor(n.reduce(function(e,t){return e+t},0)/n.length);return a.cores=Math.max(1,o),URL.revokeObjectURL(r),t(null,a.cores)}!function(e,t){for(var n=[],i=[],s=0;s<e;++s){var a=new Worker(r);a.addEventListener("message",function(r){if(i.push(r.data),i.length===e){for(var s=0;s<e;++s)n[s].terminate();t(null,i)}}),n.push(a)}for(s=0;s<e;++s)n[s].postMessage(s)}(s,function(t,r){n.push(function(e,t){for(var r=[],n=0;n<e;++n)for(var i=t[n],s=r[n]=[],a=0;a<e;++a)if(n!==a){var o=t[a];(i.st>o.st&&i.st<o.et||o.st>i.st&&o.st<i.et)&&s.push(a)}return r.reduce(function(e,t){return Math.max(e,t.length)},0)}(s,r)),e(n,i-1,s)})}([],5,16)}},8572:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateBasic=t.wNAF=void 0;const n=r(1537),i=r(5226),s=BigInt(0),a=BigInt(1);t.wNAF=function(e,t){const r=(e,t)=>{const r=t.negate();return e?r:t},n=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:r,unsafeLadder(t,r){let n=e.ZERO,i=t;for(;r>s;)r&a&&(n=n.add(i)),i=i.double(),r>>=a;return n},precomputeWindow(e,t){const{windows:r,windowSize:i}=n(t),s=[];let a=e,o=a;for(let e=0;e<r;e++){o=a,s.push(o);for(let e=1;e<i;e++)o=o.add(a),s.push(o);a=o.double()}return s},wNAF(t,i,s){const{windows:o,windowSize:c}=n(t);let u=e.ZERO,l=e.BASE;const h=BigInt(2**t-1),d=2**t,f=BigInt(t);for(let e=0;e<o;e++){const t=e*c;let n=Number(s&h);s>>=f,n>c&&(n-=d,s+=a);const o=t,p=t+Math.abs(n)-1,g=e%2!=0,y=n<0;0===n?l=l.add(r(g,i[o])):u=u.add(r(y,i[p]))}return{p:u,f:l}},wNAFCached(e,t,r,n){const i=e._WINDOW_SIZE||1;let s=t.get(e);return s||(s=this.precomputeWindow(e,i),1!==i&&t.set(e,n(s))),this.wNAF(i,s,r)}}},t.validateBasic=function(e){return(0,n.validateField)(e.Fp),(0,i.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,n.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}},8622:(e,t,r)=>{var n=r(4643);r(3739),r(81),r(4412),r(943),r(8550);var i=e.exports=n.ssh=n.ssh||{};function s(e,t){var r=t.toString(16);r[0]>="8"&&(r="00"+r);var i=n.util.hexToBytes(r);e.putInt32(i.length),e.putBytes(i)}function a(e,t){e.putInt32(t.length),e.putString(t)}function o(){for(var e=n.md.sha1.create(),t=arguments.length,r=0;r<t;++r)e.update(arguments[r]);return e.digest()}i.privateKeyToPutty=function(e,t,r){var i="ssh-rsa",c=""===(t=t||"")?"none":"aes256-cbc",u="PuTTY-User-Key-File-2: "+i+"\r\n";u+="Encryption: "+c+"\r\n",u+="Comment: "+(r=r||"")+"\r\n";var l=n.util.createBuffer();a(l,i),s(l,e.e),s(l,e.n);var h=n.util.encode64(l.bytes(),64),d=Math.floor(h.length/66)+1;u+="Public-Lines: "+d+"\r\n",u+=h;var f,p=n.util.createBuffer();if(s(p,e.d),s(p,e.p),s(p,e.q),s(p,e.qInv),t){var g=p.length()+16-1;g-=g%16;var y=o(p.bytes());y.truncate(y.length()-g+p.length()),p.putBuffer(y);var m=n.util.createBuffer();m.putBuffer(o("\0\0\0\0",t)),m.putBuffer(o("\0\0\0",t));var b=n.aes.createEncryptionCipher(m.truncate(8),"CBC");b.start(n.util.createBuffer().fillWithByte(0,16)),b.update(p.copy()),b.finish();var w=b.output;w.truncate(16),f=n.util.encode64(w.bytes(),64)}else f=n.util.encode64(p.bytes(),64);u+="\r\nPrivate-Lines: "+(d=Math.floor(f.length/66)+1)+"\r\n",u+=f;var v=o("putty-private-key-file-mac-key",t),A=n.util.createBuffer();a(A,i),a(A,c),a(A,r),A.putInt32(l.length()),A.putBuffer(l),A.putInt32(p.length()),A.putBuffer(p);var E=n.hmac.create();return E.start("sha1",v),E.update(A.bytes()),u+="\r\nPrivate-MAC: "+E.digest().toHex()+"\r\n"},i.publicKeyToOpenSSH=function(e,t){var r="ssh-rsa";t=t||"";var i=n.util.createBuffer();return a(i,r),s(i,e.e),s(i,e.n),r+" "+n.util.encode64(i.bytes())+" "+t},i.privateKeyToOpenSSH=function(e,t){return t?n.pki.encryptRsaPrivateKey(e,t,{legacy:!0,algorithm:"aes128"}):n.pki.privateKeyToPem(e)},i.getPublicKeyFingerprint=function(e,t){var r=(t=t||{}).md||n.md.md5.create(),i=n.util.createBuffer();a(i,"ssh-rsa"),s(i,e.e),s(i,e.n),r.start(),r.update(i.getBytes());var o=r.digest();if("hex"===t.encoding){var c=o.toHex();return t.delimiter?c.match(/.{2}/g).join(t.delimiter):c}if("binary"===t.encoding)return o.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".');return o}},8718:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toUtf8String=t.toUtf8CodePoints=t.toUtf8Bytes=t.parseUnits=t.formatUnits=t.parseEther=t.formatEther=t.encodeRlp=t.decodeRlp=t.defineProperties=t.resolveProperties=t.toQuantity=t.toBeArray=t.toBeHex=t.toNumber=t.toBigInt=t.getUint=t.getNumber=t.getBigInt=t.mask=t.toTwos=t.fromTwos=t.FixedNumber=t.FetchCancelSignal=t.FetchResponse=t.FetchRequest=t.EventPayload=t.makeError=t.assertNormalize=t.assertPrivate=t.assertArgumentCount=t.assertArgument=t.assert=t.isError=t.isCallException=t.zeroPadBytes=t.zeroPadValue=t.stripZerosLeft=t.dataSlice=t.dataLength=t.concat=t.hexlify=t.isBytesLike=t.isHexString=t.getBytesCopy=t.getBytes=t.encodeBase64=t.decodeBase64=t.encodeBase58=t.decodeBase58=void 0,t.uuidV4=t.Utf8ErrorFuncs=void 0;var n=r(6876);Object.defineProperty(t,"decodeBase58",{enumerable:!0,get:function(){return n.decodeBase58}}),Object.defineProperty(t,"encodeBase58",{enumerable:!0,get:function(){return n.encodeBase58}});var i=r(6662);Object.defineProperty(t,"decodeBase64",{enumerable:!0,get:function(){return i.decodeBase64}}),Object.defineProperty(t,"encodeBase64",{enumerable:!0,get:function(){return i.encodeBase64}});var s=r(5020);Object.defineProperty(t,"getBytes",{enumerable:!0,get:function(){return s.getBytes}}),Object.defineProperty(t,"getBytesCopy",{enumerable:!0,get:function(){return s.getBytesCopy}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return s.isHexString}}),Object.defineProperty(t,"isBytesLike",{enumerable:!0,get:function(){return s.isBytesLike}}),Object.defineProperty(t,"hexlify",{enumerable:!0,get:function(){return s.hexlify}}),Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return s.concat}}),Object.defineProperty(t,"dataLength",{enumerable:!0,get:function(){return s.dataLength}}),Object.defineProperty(t,"dataSlice",{enumerable:!0,get:function(){return s.dataSlice}}),Object.defineProperty(t,"stripZerosLeft",{enumerable:!0,get:function(){return s.stripZerosLeft}}),Object.defineProperty(t,"zeroPadValue",{enumerable:!0,get:function(){return s.zeroPadValue}}),Object.defineProperty(t,"zeroPadBytes",{enumerable:!0,get:function(){return s.zeroPadBytes}});var a=r(355);Object.defineProperty(t,"isCallException",{enumerable:!0,get:function(){return a.isCallException}}),Object.defineProperty(t,"isError",{enumerable:!0,get:function(){return a.isError}}),Object.defineProperty(t,"assert",{enumerable:!0,get:function(){return a.assert}}),Object.defineProperty(t,"assertArgument",{enumerable:!0,get:function(){return a.assertArgument}}),Object.defineProperty(t,"assertArgumentCount",{enumerable:!0,get:function(){return a.assertArgumentCount}}),Object.defineProperty(t,"assertPrivate",{enumerable:!0,get:function(){return a.assertPrivate}}),Object.defineProperty(t,"assertNormalize",{enumerable:!0,get:function(){return a.assertNormalize}}),Object.defineProperty(t,"makeError",{enumerable:!0,get:function(){return a.makeError}});var o=r(7149);Object.defineProperty(t,"EventPayload",{enumerable:!0,get:function(){return o.EventPayload}});var c=r(586);Object.defineProperty(t,"FetchRequest",{enumerable:!0,get:function(){return c.FetchRequest}}),Object.defineProperty(t,"FetchResponse",{enumerable:!0,get:function(){return c.FetchResponse}}),Object.defineProperty(t,"FetchCancelSignal",{enumerable:!0,get:function(){return c.FetchCancelSignal}});var u=r(1333);Object.defineProperty(t,"FixedNumber",{enumerable:!0,get:function(){return u.FixedNumber}});var l=r(9009);Object.defineProperty(t,"fromTwos",{enumerable:!0,get:function(){return l.fromTwos}}),Object.defineProperty(t,"toTwos",{enumerable:!0,get:function(){return l.toTwos}}),Object.defineProperty(t,"mask",{enumerable:!0,get:function(){return l.mask}}),Object.defineProperty(t,"getBigInt",{enumerable:!0,get:function(){return l.getBigInt}}),Object.defineProperty(t,"getNumber",{enumerable:!0,get:function(){return l.getNumber}}),Object.defineProperty(t,"getUint",{enumerable:!0,get:function(){return l.getUint}}),Object.defineProperty(t,"toBigInt",{enumerable:!0,get:function(){return l.toBigInt}}),Object.defineProperty(t,"toNumber",{enumerable:!0,get:function(){return l.toNumber}}),Object.defineProperty(t,"toBeHex",{enumerable:!0,get:function(){return l.toBeHex}}),Object.defineProperty(t,"toBeArray",{enumerable:!0,get:function(){return l.toBeArray}}),Object.defineProperty(t,"toQuantity",{enumerable:!0,get:function(){return l.toQuantity}});var h=r(6441);Object.defineProperty(t,"resolveProperties",{enumerable:!0,get:function(){return h.resolveProperties}}),Object.defineProperty(t,"defineProperties",{enumerable:!0,get:function(){return h.defineProperties}});var d=r(3875);Object.defineProperty(t,"decodeRlp",{enumerable:!0,get:function(){return d.decodeRlp}});var f=r(1503);Object.defineProperty(t,"encodeRlp",{enumerable:!0,get:function(){return f.encodeRlp}});var p=r(949);Object.defineProperty(t,"formatEther",{enumerable:!0,get:function(){return p.formatEther}}),Object.defineProperty(t,"parseEther",{enumerable:!0,get:function(){return p.parseEther}}),Object.defineProperty(t,"formatUnits",{enumerable:!0,get:function(){return p.formatUnits}}),Object.defineProperty(t,"parseUnits",{enumerable:!0,get:function(){return p.parseUnits}});var g=r(5775);Object.defineProperty(t,"toUtf8Bytes",{enumerable:!0,get:function(){return g.toUtf8Bytes}}),Object.defineProperty(t,"toUtf8CodePoints",{enumerable:!0,get:function(){return g.toUtf8CodePoints}}),Object.defineProperty(t,"toUtf8String",{enumerable:!0,get:function(){return g.toUtf8String}}),Object.defineProperty(t,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return g.Utf8ErrorFuncs}});var y=r(4315);Object.defineProperty(t,"uuidV4",{enumerable:!0,get:function(){return y.uuidV4}})},8757:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseWallet=void 0;const n=r(6107),i=r(7477),s=r(9977),a=r(203),o=r(8718);class c extends s.AbstractSigner{address;#Ht;constructor(e,t){super(t),(0,o.assertArgument)(e&&"function"==typeof e.sign,"invalid private key","privateKey","[ REDACTED ]"),this.#Ht=e;const r=(0,a.computeAddress)(this.signingKey.publicKey);(0,o.defineProperties)(this,{address:r})}get signingKey(){return this.#Ht}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(e){return new c(this.#Ht,e)}async signTransaction(e){e=(0,s.copyRequest)(e);const{to:t,from:r}=await(0,o.resolveProperties)({to:e.to?(0,n.resolveAddress)(e.to,this):void 0,from:e.from?(0,n.resolveAddress)(e.from,this):void 0});null!=t&&(e.to=t),null!=r&&(e.from=r),null!=e.from&&((0,o.assertArgument)((0,n.getAddress)(e.from)===this.address,"transaction from address mismatch","tx.from",e.from),delete e.from);const i=a.Transaction.from(e);return i.signature=this.signingKey.sign(i.unsignedHash),i.serialized}async signMessage(e){return this.signMessageSync(e)}signMessageSync(e){return this.signingKey.sign((0,i.hashMessage)(e)).serialized}authorizeSync(e){(0,o.assertArgument)("string"==typeof e.address,"invalid address for authorizeSync","auth.address",e);const t=this.signingKey.sign((0,i.hashAuthorization)(e));return Object.assign({},{address:(0,n.getAddress)(e.address),nonce:(0,o.getBigInt)(e.nonce||0),chainId:(0,o.getBigInt)(e.chainId||0)},{signature:t})}async authorize(e){return e=Object.assign({},e,{address:await(0,n.resolveAddress)(e.address,this)}),this.authorizeSync(await this.populateAuthorization(e))}async signTypedData(e,t,r){const n=await i.TypedDataEncoder.resolveNames(e,t,r,async e=>{(0,o.assert)(null!=this.provider,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:e}});const t=await this.provider.resolveName(e);return(0,o.assert)(null!=t,"unconfigured ENS name","UNCONFIGURED_NAME",{value:e}),t});return this.signingKey.sign(i.TypedDataEncoder.hash(n.domain,t,n.value)).serialized}}t.BaseWallet=c},8782:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wordlists=void 0;const n=r(3318);t.wordlists={en:n.LangEn.wordlist()}},8890:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebSocket=void 0;const n=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw new Error("unable to locate global object")}().WebSocket;t.WebSocket=n},8981:function(e,t,r){"use strict";var n,i,s,a,o=this&&this.__classPrivateFieldSet||function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r},c=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.CFB=void 0;const u=r(1749);class l extends u.ModeOfOperation{constructor(e,t,r=8){if(super("CFB",e,l),n.add(this),i.set(this,void 0),s.set(this,void 0),!Number.isInteger(r)||r%8)throw new TypeError("invalid segmentSize");if(Object.defineProperties(this,{segmentSize:{enumerable:!0,value:r}}),t){if(t.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");o(this,i,new Uint8Array(t),"f")}else o(this,i,new Uint8Array(16),"f");o(this,s,this.iv,"f")}get iv(){return new Uint8Array(c(this,i,"f"))}encrypt(e){if(8*e.length%this.segmentSize)throw new TypeError("invalid plaintext size (must be multiple of segmentSize bytes)");const t=this.segmentSize/8,r=new Uint8Array(e);for(let e=0;e<r.length;e+=t){const i=this.aes.encrypt(c(this,s,"f"));for(let n=0;n<t;n++)r[e+n]^=i[n];c(this,n,"m",a).call(this,r.subarray(e))}return r}decrypt(e){if(8*e.length%this.segmentSize)throw new TypeError("invalid ciphertext size (must be multiple of segmentSize bytes)");const t=this.segmentSize/8,r=new Uint8Array(e);for(let i=0;i<r.length;i+=t){const o=this.aes.encrypt(c(this,s,"f"));for(let e=0;e<t;e++)r[i+e]^=o[e];c(this,n,"m",a).call(this,e.subarray(i))}return r}}t.CFB=l,i=new WeakMap,s=new WeakMap,n=new WeakSet,a=function(e){const t=this.segmentSize/8;c(this,s,"f").set(c(this,s,"f").subarray(t)),c(this,s,"f").set(e.subarray(0,t),16-t)}},8990:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scryptSync=t.scrypt=void 0;const n=r(8353),i=r(8718);let s=!1,a=!1;const o=async function(e,t,r,i,s,a,o){return await(0,n.scryptAsync)(e,t,{N:r,r:i,p:s,dkLen:a,onProgress:o})},c=function(e,t,r,i,s,a){return(0,n.scrypt)(e,t,{N:r,r:i,p:s,dkLen:a})};let u=o,l=c;async function h(e,t,r,n,s,a,o){const c=(0,i.getBytes)(e,"passwd"),l=(0,i.getBytes)(t,"salt");return(0,i.hexlify)(await u(c,l,r,n,s,a,o))}function d(e,t,r,n,s,a){const o=(0,i.getBytes)(e,"passwd"),c=(0,i.getBytes)(t,"salt");return(0,i.hexlify)(l(o,c,r,n,s,a))}t.scrypt=h,h._=o,h.lock=function(){a=!0},h.register=function(e){if(a)throw new Error("scrypt is locked");u=e},Object.freeze(h),t.scryptSync=d,d._=c,d.lock=function(){s=!0},d.register=function(e){if(s)throw new Error("scryptSync is locked");l=e},Object.freeze(d)},9009:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toQuantity=t.toBeArray=t.toBeHex=t.toNumber=t.getNumber=t.toBigInt=t.getUint=t.getBigInt=t.mask=t.toTwos=t.fromTwos=void 0;const n=r(5020),i=r(355),s=BigInt(0),a=BigInt(1),o=9007199254740991;function c(e,t){switch(typeof e){case"bigint":return e;case"number":return(0,i.assertArgument)(Number.isInteger(e),"underflow",t||"value",e),(0,i.assertArgument)(e>=-o&&e<=o,"overflow",t||"value",e),BigInt(e);case"string":try{if(""===e)throw new Error("empty string");return"-"===e[0]&&"-"!==e[1]?-BigInt(e.substring(1)):BigInt(e)}catch(r){(0,i.assertArgument)(!1,`invalid BigNumberish string: ${r.message}`,t||"value",e)}}(0,i.assertArgument)(!1,"invalid BigNumberish value",t||"value",e)}function u(e,t){const r=c(e,t);return(0,i.assert)(r>=s,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:e}),r}t.fromTwos=function(e,t){const r=u(e,"value"),n=BigInt(d(t,"width"));if((0,i.assert)(r>>n===s,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:e}),r>>n-a){return-((~r&(a<<n)-a)+a)}return r},t.toTwos=function(e,t){let r=c(e,"value");const n=BigInt(d(t,"width")),o=a<<n-a;if(r<s){r=-r,(0,i.assert)(r<=o,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:e});return(~r&(a<<n)-a)+a}return(0,i.assert)(r<o,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:e}),r},t.mask=function(e,t){const r=u(e,"value"),n=BigInt(d(t,"bits"));return r&(a<<n)-a},t.getBigInt=c,t.getUint=u;const l="0123456789abcdef";function h(e){if(e instanceof Uint8Array){let t="0x0";for(const r of e)t+=l[r>>4],t+=l[15&r];return BigInt(t)}return c(e)}function d(e,t){switch(typeof e){case"bigint":return(0,i.assertArgument)(e>=-o&&e<=o,"overflow",t||"value",e),Number(e);case"number":return(0,i.assertArgument)(Number.isInteger(e),"underflow",t||"value",e),(0,i.assertArgument)(e>=-o&&e<=o,"overflow",t||"value",e),e;case"string":try{if(""===e)throw new Error("empty string");return d(BigInt(e),t)}catch(r){(0,i.assertArgument)(!1,`invalid numeric string: ${r.message}`,t||"value",e)}}(0,i.assertArgument)(!1,"invalid numeric value",t||"value",e)}function f(e){const t=u(e,"value");if(t===s)return new Uint8Array([]);let r=t.toString(16);r.length%2&&(r="0"+r);const n=new Uint8Array(r.length/2);for(let e=0;e<n.length;e++){const t=2*e;n[e]=parseInt(r.substring(t,t+2),16)}return n}t.toBigInt=h,t.getNumber=d,t.toNumber=function(e){return d(h(e))},t.toBeHex=function(e,t){let r=u(e,"value").toString(16);if(null==t)r.length%2&&(r="0"+r);else{const n=d(t,"width");for((0,i.assert)(2*n>=r.length,`value exceeds width (${n} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:e});r.length<2*n;)r="0"+r}return"0x"+r},t.toBeArray=f,t.toQuantity=function(e){let t=(0,n.hexlify)((0,n.isBytesLike)(e)?e:f(e)).substring(2);for(;t.startsWith("0");)t=t.substring(1);return""===t&&(t="0"),"0x"+t}},9027:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Wallet=void 0;const n=r(6468),i=r(8718),s=r(8757),a=r(2527),o=r(9507),c=r(2325),u=r(18);function l(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}class h extends s.BaseWallet{constructor(e,t){"string"!=typeof e||e.startsWith("0x")||(e="0x"+e),super("string"==typeof e?new n.SigningKey(e):e,t)}connect(e){return new h(this.signingKey,e)}async encrypt(e,t){const r={address:this.address,privateKey:this.privateKey};return await(0,c.encryptKeystoreJson)(r,e,{progressCallback:t})}encryptSync(e){const t={address:this.address,privateKey:this.privateKey};return(0,c.encryptKeystoreJsonSync)(t,e)}static#_t(e){if((0,i.assertArgument)(e,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in e&&e.mnemonic&&"en"===e.mnemonic.locale){const t=u.Mnemonic.fromEntropy(e.mnemonic.entropy),r=a.HDNodeWallet.fromMnemonic(t,e.mnemonic.path);if(r.address===e.address&&r.privateKey===e.privateKey)return r;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const t=new h(e.privateKey);return(0,i.assertArgument)(t.address===e.address,"address/privateKey mismatch","json","[ REDACTED ]"),t}static async fromEncryptedJson(e,t,r){let n=null;return(0,c.isKeystoreJson)(e)?n=await(0,c.decryptKeystoreJson)(e,t,r):(0,o.isCrowdsaleJson)(e)&&(r&&(r(0),await l(0)),n=(0,o.decryptCrowdsaleJson)(e,t),r&&(r(1),await l(0))),h.#_t(n)}static fromEncryptedJsonSync(e,t){let r=null;return(0,c.isKeystoreJson)(e)?r=(0,c.decryptKeystoreJsonSync)(e,t):(0,o.isCrowdsaleJson)(e)?r=(0,o.decryptCrowdsaleJson)(e,t):(0,i.assertArgument)(!1,"invalid JSON wallet","json","[ REDACTED ]"),h.#_t(r)}static createRandom(e){const t=a.HDNodeWallet.createRandom();return e?t.connect(e):t}static fromPhrase(e,t){const r=a.HDNodeWallet.fromPhrase(e);return t?r.connect(t):r}}t.Wallet=h},9071:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function n(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)}function i(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function s(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function a(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function o(e,t){i(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}Object.defineProperty(t,"__esModule",{value:!0}),t.output=t.exists=t.hash=t.bytes=t.bool=t.number=void 0,t.number=r,t.bool=n,t.bytes=i,t.hash=s,t.exists=a,t.output=o;const c={number:r,bool:n,bytes:i,hash:s,exists:a,output:o};t.default=c},9249:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeBits=void 0;t.decodeBits=function(e,t){const r=(1<<e)-1,n=[];let i=0,s=0,a=0;for(let o=0;o<t.length;o++)for(i=i<<6|")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".indexOf(t[o]),s+=6;s>=e;){const t=i>>s-e;i&=(1<<s-e)-1,s-=e,0===t?a+=r:(n.push(t+a),a=0)}return n}},9318:(e,t)=>{t.read=function(e,t,r,n,i){var s,a,o=8*i-n-1,c=(1<<o)-1,u=c>>1,l=-7,h=r?i-1:0,d=r?-1:1,f=e[t+h];for(h+=d,s=f&(1<<-l)-1,f>>=-l,l+=o;l>0;s=256*s+e[t+h],h+=d,l-=8);for(a=s&(1<<-l)-1,s>>=-l,l+=n;l>0;a=256*a+e[t+h],h+=d,l-=8);if(0===s)s=1-u;else{if(s===c)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),s-=u}return(f?-1:1)*a*Math.pow(2,s-n)},t.write=function(e,t,r,n,i,s){var a,o,c,u=8*s-i-1,l=(1<<u)-1,h=l>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:s-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+h>=1?d/c:d*Math.pow(2,1-h))*c>=2&&(a++,c/=2),a+h>=l?(o=0,a=l):a+h>=1?(o=(t*c-1)*Math.pow(2,i),a+=h):(o=t*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;e[r+f]=255&o,f+=p,o/=256,i-=8);for(a=a<<i|o,u+=i;u>0;e[r+f]=255&a,f+=p,a/=256,u-=8);e[r+f-p]|=128*g}},9450:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}function n(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function i(...e){const t=e=>e,r=(e,t)=>r=>e(t(r));return{encode:e.map(e=>e.encode).reduceRight(r,t),decode:e.map(e=>e.decode).reduce(r,t)}}function s(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("alphabet.encode input should be an array of numbers");return t.map(t=>{if(r(t),t<0||t>=e.length)throw new Error(`Digit index outside alphabet: ${t} (alphabet: ${e.length})`);return e[t]})},decode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("alphabet.decode input should be array of strings");return t.map(t=>{if("string"!=typeof t)throw new Error(`alphabet.decode: not string element=${t}`);const r=e.indexOf(t);if(-1===r)throw new Error(`Unknown letter: "${t}". Allowed: ${e}`);return r})}}}function a(e=""){if("string"!=typeof e)throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("join.encode input should be array of strings");for(let e of t)if("string"!=typeof e)throw new Error(`join.encode: non-string input=${e}`);return t.join(e)},decode:t=>{if("string"!=typeof t)throw new Error("join.decode input should be string");return t.split(e)}}}function o(e,t="="){if(r(e),"string"!=typeof t)throw new Error("padding chr should be string");return{encode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let e of r)if("string"!=typeof e)throw new Error(`padding.encode: non-string input=${e}`);for(;r.length*e%8;)r.push(t);return r},decode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let e of r)if("string"!=typeof e)throw new Error(`padding.decode: non-string input=${e}`);let n=r.length;if(n*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;n>0&&r[n-1]===t;n--)if(!((n-1)*e%8))throw new Error("Invalid padding: string has too much padding");return r.slice(0,n)}}}function c(e){if("function"!=typeof e)throw new Error("normalize fn should be function");return{encode:e=>e,decode:t=>e(t)}}function u(e,t,n){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let i=0;const s=[],a=Array.from(e);for(a.forEach(e=>{if(r(e),e<0||e>=t)throw new Error(`Wrong integer: ${e}`)});;){let e=0,r=!0;for(let s=i;s<a.length;s++){const o=a[s],c=t*e+o;if(!Number.isSafeInteger(c)||t*e/t!==e||c-o!==t*e)throw new Error("convertRadix: carry overflow");e=c%n;const u=Math.floor(c/n);if(a[s]=u,!Number.isSafeInteger(u)||u*n+e!==c)throw new Error("convertRadix: carry overflow");r&&(u?r=!1:i=s)}if(s.push(e),r)break}for(let t=0;t<e.length-1&&0===e[t];t++)s.push(0);return s.reverse()}Object.defineProperty(t,"__esModule",{value:!0}),t.bytes=t.stringToBytes=t.str=t.bytesToString=t.hex=t.utf8=t.bech32m=t.bech32=t.base58check=t.createBase58check=t.base58xmr=t.base58xrp=t.base58flickr=t.base58=t.base64urlnopad=t.base64url=t.base64nopad=t.base64=t.base32crockford=t.base32hexnopad=t.base32hex=t.base32nopad=t.base32=t.base16=t.utils=void 0,t.assertNumber=r;const l=(e,t)=>t?l(t,e%t):e,h=(e,t)=>e+(t-l(e,t));function d(e,t,n,i){if(!Array.isArray(e))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(h(t,n)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${h(t,n)}`);let s=0,a=0;const o=2**n-1,c=[];for(const i of e){if(r(i),i>=2**t)throw new Error(`convertRadix2: invalid data word=${i} from=${t}`);if(s=s<<t|i,a+t>32)throw new Error(`convertRadix2: carry overflow pos=${a} from=${t}`);for(a+=t;a>=n;a-=n)c.push((s>>a-n&o)>>>0);s&=2**a-1}if(s=s<<n-a&o,!i&&a>=t)throw new Error("Excess padding");if(!i&&s)throw new Error(`Non-zero padding: ${s}`);return i&&a>0&&c.push(s>>>0),c}function f(e){return r(e),{encode:t=>{if(!n(t))throw new Error("radix.encode input should be Uint8Array");return u(Array.from(t),256,e)},decode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(u(t,e,256))}}}function p(e,t=!1){if(r(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(h(8,e)>32||h(e,8)>32)throw new Error("radix2: carry overflow");return{encode:r=>{if(!n(r))throw new Error("radix2.encode input should be Uint8Array");return d(Array.from(r),8,e,!t)},decode:r=>{if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("radix2.decode input should be array of numbers");return Uint8Array.from(d(r,e,8,t))}}}function g(e){if("function"!=typeof e)throw new Error("unsafeWrapper fn should be function");return function(...t){try{return e.apply(null,t)}catch(e){}}}function y(e,t){if(r(e),"function"!=typeof t)throw new Error("checksum fn should be function");return{encode(r){if(!n(r))throw new Error("checksum.encode: input should be Uint8Array");const i=t(r).slice(0,e),s=new Uint8Array(r.length+e);return s.set(r),s.set(i,r.length),s},decode(r){if(!n(r))throw new Error("checksum.decode: input should be Uint8Array");const i=r.slice(0,-e),s=t(i).slice(0,e),a=r.slice(-e);for(let t=0;t<e;t++)if(s[t]!==a[t])throw new Error("Invalid checksum");return i}}}t.utils={alphabet:s,chain:i,checksum:y,convertRadix:u,convertRadix2:d,radix:f,radix2:p,join:a,padding:o},t.base16=i(p(4),s("0123456789ABCDEF"),a("")),t.base32=i(p(5),s("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),o(5),a("")),t.base32nopad=i(p(5),s("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),a("")),t.base32hex=i(p(5),s("0123456789ABCDEFGHIJKLMNOPQRSTUV"),o(5),a("")),t.base32hexnopad=i(p(5),s("0123456789ABCDEFGHIJKLMNOPQRSTUV"),a("")),t.base32crockford=i(p(5),s("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),a(""),c(e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),t.base64=i(p(6),s("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),o(6),a("")),t.base64nopad=i(p(6),s("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),a("")),t.base64url=i(p(6),s("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),o(6),a("")),t.base64urlnopad=i(p(6),s("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),a(""));const m=e=>i(f(58),s(e),a(""));t.base58=m("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),t.base58flickr=m("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),t.base58xrp=m("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const b=[0,2,3,5,6,7,9,10,11];t.base58xmr={encode(e){let r="";for(let n=0;n<e.length;n+=8){const i=e.subarray(n,n+8);r+=t.base58.encode(i).padStart(b[i.length],"1")}return r},decode(e){let r=[];for(let n=0;n<e.length;n+=11){const i=e.slice(n,n+11),s=b.indexOf(i.length),a=t.base58.decode(i);for(let e=0;e<a.length-s;e++)if(0!==a[e])throw new Error("base58xmr: wrong padding");r=r.concat(Array.from(a.slice(a.length-s)))}return Uint8Array.from(r)}};t.createBase58check=e=>i(y(4,t=>e(e(t))),t.base58),t.base58check=t.createBase58check;const w=i(s("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),a("")),v=[996825010,642813549,513874426,1027748829,705979059];function A(e){const t=e>>25;let r=(33554431&e)<<5;for(let e=0;e<v.length;e++)1==(t>>e&1)&&(r^=v[e]);return r}function E(e,t,r=1){const n=e.length;let i=1;for(let t=0;t<n;t++){const r=e.charCodeAt(t);if(r<33||r>126)throw new Error(`Invalid prefix (${e})`);i=A(i)^r>>5}i=A(i);for(let t=0;t<n;t++)i=A(i)^31&e.charCodeAt(t);for(let e of t)i=A(i)^e;for(let e=0;e<6;e++)i=A(i);return i^=r,w.encode(d([i%2**30],30,5,!1))}function C(e){const t="bech32"===e?1:734539939,r=p(5),n=r.decode,i=r.encode,s=g(n);function a(e,r,n=90){if("string"!=typeof e)throw new Error("bech32.encode prefix should be string, not "+typeof e);if(r instanceof Uint8Array&&(r=Array.from(r)),!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("bech32.encode words should be array of numbers, not "+typeof r);if(0===e.length)throw new TypeError(`Invalid prefix length ${e.length}`);const i=e.length+7+r.length;if(!1!==n&&i>n)throw new TypeError(`Length ${i} exceeds limit ${n}`);const s=e.toLowerCase(),a=E(s,r,t);return`${s}1${w.encode(r)}${a}`}function o(e,r=90){if("string"!=typeof e)throw new Error("bech32.decode input should be string, not "+typeof e);if(e.length<8||!1!==r&&e.length>r)throw new TypeError(`Wrong string length: ${e.length} (${e}). Expected (8..${r})`);const n=e.toLowerCase();if(e!==n&&e!==e.toUpperCase())throw new Error("String must be lowercase or uppercase");const i=n.lastIndexOf("1");if(0===i||-1===i)throw new Error('Letter "1" must be present between prefix and data only');const s=n.slice(0,i),a=n.slice(i+1);if(a.length<6)throw new Error("Data must be at least 6 characters long");const o=w.decode(a).slice(0,-6),c=E(s,o,t);if(!a.endsWith(c))throw new Error(`Invalid checksum in ${e}: expected "${c}"`);return{prefix:s,words:o}}return{encode:a,decode:o,encodeFromBytes:function(e,t){return a(e,i(t))},decodeToBytes:function(e){const{prefix:t,words:r}=o(e,!1);return{prefix:t,words:r,bytes:n(r)}},decodeUnsafe:g(o),fromWords:n,fromWordsUnsafe:s,toWords:i}}t.bech32=C("bech32"),t.bech32m=C("bech32m"),t.utf8={encode:e=>(new TextDecoder).decode(e),decode:e=>(new TextEncoder).encode(e)},t.hex=i(p(4),s("0123456789abcdef"),a(""),c(e=>{if("string"!=typeof e||e.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()}));const B={utf8:t.utf8,hex:t.hex,base16:t.base16,base32:t.base32,base64:t.base64,base64url:t.base64url,base58:t.base58,base58xmr:t.base58xmr},S="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr";t.bytesToString=(e,t)=>{if("string"!=typeof e||!B.hasOwnProperty(e))throw new TypeError(S);if(!n(t))throw new TypeError("bytesToString() expects Uint8Array");return B[e].encode(t)},t.str=t.bytesToString;t.stringToBytes=(e,t)=>{if(!B.hasOwnProperty(e))throw new TypeError(S);if("string"!=typeof t)throw new TypeError("stringToBytes() expects string");return B[e].decode(t)},t.bytes=t.stringToBytes},9507:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decryptCrowdsaleJson=t.isCrowdsaleJson=void 0;const n=r(1136),i=r(6107),s=r(6468),a=r(7477),o=r(8718),c=r(4753);t.isCrowdsaleJson=function(e){try{if(JSON.parse(e).encseed)return!0}catch(e){}return!1},t.decryptCrowdsaleJson=function(e,t){const r=JSON.parse(e),u=(0,c.getPassword)(t),l=(0,i.getAddress)((0,c.spelunk)(r,"ethaddr:string!")),h=(0,c.looseArrayify)((0,c.spelunk)(r,"encseed:string!"));(0,o.assertArgument)(h&&h.length%16==0,"invalid encseed","json",e);const d=(0,o.getBytes)((0,s.pbkdf2)(u,u,2e3,32,"sha256")).slice(0,16),f=h.slice(0,16),p=h.slice(16),g=new n.CBC(d,f),y=(0,n.pkcs7Strip)((0,o.getBytes)(g.decrypt(p)));let m="";for(let e=0;e<y.length;e++)m+=String.fromCharCode(y[e]);return{address:l,privateKey:(0,a.id)(m)}}},9523:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ripemd160=t.keccak256=t.randomBytes=t.computeHmac=t.UndecodedEventLog=t.EventLog=t.ContractUnknownEventPayload=t.ContractTransactionResponse=t.ContractTransactionReceipt=t.ContractEventPayload=t.ContractFactory=t.Contract=t.BaseContract=t.MessagePrefix=t.EtherSymbol=t.ZeroHash=t.N=t.MaxInt256=t.MinInt256=t.MaxUint256=t.WeiPerEther=t.ZeroAddress=t.resolveAddress=t.isAddress=t.isAddressable=t.getCreate2Address=t.getCreateAddress=t.getIcapAddress=t.getAddress=t.Typed=t.TransactionDescription=t.Result=t.LogDescription=t.Interface=t.Indexed=t.ErrorDescription=t.checkResultErrors=t.StructFragment=t.ParamType=t.NamedFragment=t.FunctionFragment=t.FallbackFragment=t.Fragment=t.EventFragment=t.ErrorFragment=t.ConstructorFragment=t.AbiCoder=t.encodeBytes32String=t.decodeBytes32String=t.version=void 0,t.WebSocketProvider=t.SocketProvider=t.IpcSocketProvider=t.QuickNodeProvider=t.PocketProvider=t.InfuraWebSocketProvider=t.InfuraProvider=t.EtherscanProvider=t.CloudflareProvider=t.ChainstackProvider=t.BlockscoutProvider=t.AnkrProvider=t.AlchemyProvider=t.BrowserProvider=t.JsonRpcSigner=t.JsonRpcProvider=t.JsonRpcApiProvider=t.FallbackProvider=t.AbstractProvider=t.VoidSigner=t.NonceManager=t.AbstractSigner=t.TransactionResponse=t.TransactionReceipt=t.Log=t.FeeData=t.Block=t.getDefaultProvider=t.verifyTypedData=t.TypedDataEncoder=t.solidityPackedSha256=t.solidityPackedKeccak256=t.solidityPacked=t.verifyMessage=t.hashMessage=t.verifyAuthorization=t.hashAuthorization=t.dnsEncode=t.namehash=t.isValidName=t.ensNormalize=t.id=t.SigningKey=t.Signature=t.lock=t.scryptSync=t.scrypt=t.pbkdf2=t.sha512=t.sha256=void 0,t.FetchCancelSignal=t.FetchResponse=t.FetchRequest=t.EventPayload=t.isError=t.isCallException=t.makeError=t.assertPrivate=t.assertNormalize=t.assertArgumentCount=t.assertArgument=t.assert=t.resolveProperties=t.defineProperties=t.zeroPadValue=t.zeroPadBytes=t.stripZerosLeft=t.isBytesLike=t.isHexString=t.hexlify=t.getBytesCopy=t.getBytes=t.dataSlice=t.dataLength=t.concat=t.encodeBase64=t.decodeBase64=t.encodeBase58=t.decodeBase58=t.Transaction=t.recoverAddress=t.computeAddress=t.authorizationify=t.accessListify=t.showThrottleMessage=t.copyRequest=t.UnmanagedSubscriber=t.SocketSubscriber=t.SocketPendingSubscriber=t.SocketEventSubscriber=t.SocketBlockSubscriber=t.MulticoinProviderPlugin=t.NetworkPlugin=t.GasCostPlugin=t.FetchUrlFeeDataNetworkPlugin=t.FeeDataNetworkPlugin=t.EtherscanPlugin=t.EnsPlugin=t.Network=t.EnsResolver=void 0,t.wordlists=t.WordlistOwlA=t.WordlistOwl=t.LangEn=t.Wordlist=t.encryptKeystoreJsonSync=t.encryptKeystoreJson=t.decryptKeystoreJson=t.decryptKeystoreJsonSync=t.decryptCrowdsaleJson=t.isKeystoreJson=t.isCrowdsaleJson=t.getIndexedAccountPath=t.getAccountPath=t.defaultPath=t.Wallet=t.HDNodeVoidWallet=t.HDNodeWallet=t.BaseWallet=t.Mnemonic=t.uuidV4=t.encodeRlp=t.decodeRlp=t.Utf8ErrorFuncs=t.toUtf8String=t.toUtf8CodePoints=t.toUtf8Bytes=t.parseUnits=t.formatUnits=t.parseEther=t.formatEther=t.mask=t.toTwos=t.fromTwos=t.toQuantity=t.toNumber=t.toBeHex=t.toBigInt=t.toBeArray=t.getUint=t.getNumber=t.getBigInt=t.FixedNumber=void 0;var n=r(1825);Object.defineProperty(t,"version",{enumerable:!0,get:function(){return n.version}});var i=r(333);Object.defineProperty(t,"decodeBytes32String",{enumerable:!0,get:function(){return i.decodeBytes32String}}),Object.defineProperty(t,"encodeBytes32String",{enumerable:!0,get:function(){return i.encodeBytes32String}}),Object.defineProperty(t,"AbiCoder",{enumerable:!0,get:function(){return i.AbiCoder}}),Object.defineProperty(t,"ConstructorFragment",{enumerable:!0,get:function(){return i.ConstructorFragment}}),Object.defineProperty(t,"ErrorFragment",{enumerable:!0,get:function(){return i.ErrorFragment}}),Object.defineProperty(t,"EventFragment",{enumerable:!0,get:function(){return i.EventFragment}}),Object.defineProperty(t,"Fragment",{enumerable:!0,get:function(){return i.Fragment}}),Object.defineProperty(t,"FallbackFragment",{enumerable:!0,get:function(){return i.FallbackFragment}}),Object.defineProperty(t,"FunctionFragment",{enumerable:!0,get:function(){return i.FunctionFragment}}),Object.defineProperty(t,"NamedFragment",{enumerable:!0,get:function(){return i.NamedFragment}}),Object.defineProperty(t,"ParamType",{enumerable:!0,get:function(){return i.ParamType}}),Object.defineProperty(t,"StructFragment",{enumerable:!0,get:function(){return i.StructFragment}}),Object.defineProperty(t,"checkResultErrors",{enumerable:!0,get:function(){return i.checkResultErrors}}),Object.defineProperty(t,"ErrorDescription",{enumerable:!0,get:function(){return i.ErrorDescription}}),Object.defineProperty(t,"Indexed",{enumerable:!0,get:function(){return i.Indexed}}),Object.defineProperty(t,"Interface",{enumerable:!0,get:function(){return i.Interface}}),Object.defineProperty(t,"LogDescription",{enumerable:!0,get:function(){return i.LogDescription}}),Object.defineProperty(t,"Result",{enumerable:!0,get:function(){return i.Result}}),Object.defineProperty(t,"TransactionDescription",{enumerable:!0,get:function(){return i.TransactionDescription}}),Object.defineProperty(t,"Typed",{enumerable:!0,get:function(){return i.Typed}});var s=r(6107);Object.defineProperty(t,"getAddress",{enumerable:!0,get:function(){return s.getAddress}}),Object.defineProperty(t,"getIcapAddress",{enumerable:!0,get:function(){return s.getIcapAddress}}),Object.defineProperty(t,"getCreateAddress",{enumerable:!0,get:function(){return s.getCreateAddress}}),Object.defineProperty(t,"getCreate2Address",{enumerable:!0,get:function(){return s.getCreate2Address}}),Object.defineProperty(t,"isAddressable",{enumerable:!0,get:function(){return s.isAddressable}}),Object.defineProperty(t,"isAddress",{enumerable:!0,get:function(){return s.isAddress}}),Object.defineProperty(t,"resolveAddress",{enumerable:!0,get:function(){return s.resolveAddress}});var a=r(2234);Object.defineProperty(t,"ZeroAddress",{enumerable:!0,get:function(){return a.ZeroAddress}}),Object.defineProperty(t,"WeiPerEther",{enumerable:!0,get:function(){return a.WeiPerEther}}),Object.defineProperty(t,"MaxUint256",{enumerable:!0,get:function(){return a.MaxUint256}}),Object.defineProperty(t,"MinInt256",{enumerable:!0,get:function(){return a.MinInt256}}),Object.defineProperty(t,"MaxInt256",{enumerable:!0,get:function(){return a.MaxInt256}}),Object.defineProperty(t,"N",{enumerable:!0,get:function(){return a.N}}),Object.defineProperty(t,"ZeroHash",{enumerable:!0,get:function(){return a.ZeroHash}}),Object.defineProperty(t,"EtherSymbol",{enumerable:!0,get:function(){return a.EtherSymbol}}),Object.defineProperty(t,"MessagePrefix",{enumerable:!0,get:function(){return a.MessagePrefix}});var o=r(7675);Object.defineProperty(t,"BaseContract",{enumerable:!0,get:function(){return o.BaseContract}}),Object.defineProperty(t,"Contract",{enumerable:!0,get:function(){return o.Contract}}),Object.defineProperty(t,"ContractFactory",{enumerable:!0,get:function(){return o.ContractFactory}}),Object.defineProperty(t,"ContractEventPayload",{enumerable:!0,get:function(){return o.ContractEventPayload}}),Object.defineProperty(t,"ContractTransactionReceipt",{enumerable:!0,get:function(){return o.ContractTransactionReceipt}}),Object.defineProperty(t,"ContractTransactionResponse",{enumerable:!0,get:function(){return o.ContractTransactionResponse}}),Object.defineProperty(t,"ContractUnknownEventPayload",{enumerable:!0,get:function(){return o.ContractUnknownEventPayload}}),Object.defineProperty(t,"EventLog",{enumerable:!0,get:function(){return o.EventLog}}),Object.defineProperty(t,"UndecodedEventLog",{enumerable:!0,get:function(){return o.UndecodedEventLog}});var c=r(6468);Object.defineProperty(t,"computeHmac",{enumerable:!0,get:function(){return c.computeHmac}}),Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return c.randomBytes}}),Object.defineProperty(t,"keccak256",{enumerable:!0,get:function(){return c.keccak256}}),Object.defineProperty(t,"ripemd160",{enumerable:!0,get:function(){return c.ripemd160}}),Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return c.sha256}}),Object.defineProperty(t,"sha512",{enumerable:!0,get:function(){return c.sha512}}),Object.defineProperty(t,"pbkdf2",{enumerable:!0,get:function(){return c.pbkdf2}}),Object.defineProperty(t,"scrypt",{enumerable:!0,get:function(){return c.scrypt}}),Object.defineProperty(t,"scryptSync",{enumerable:!0,get:function(){return c.scryptSync}}),Object.defineProperty(t,"lock",{enumerable:!0,get:function(){return c.lock}}),Object.defineProperty(t,"Signature",{enumerable:!0,get:function(){return c.Signature}}),Object.defineProperty(t,"SigningKey",{enumerable:!0,get:function(){return c.SigningKey}});var u=r(7477);Object.defineProperty(t,"id",{enumerable:!0,get:function(){return u.id}}),Object.defineProperty(t,"ensNormalize",{enumerable:!0,get:function(){return u.ensNormalize}}),Object.defineProperty(t,"isValidName",{enumerable:!0,get:function(){return u.isValidName}}),Object.defineProperty(t,"namehash",{enumerable:!0,get:function(){return u.namehash}}),Object.defineProperty(t,"dnsEncode",{enumerable:!0,get:function(){return u.dnsEncode}}),Object.defineProperty(t,"hashAuthorization",{enumerable:!0,get:function(){return u.hashAuthorization}}),Object.defineProperty(t,"verifyAuthorization",{enumerable:!0,get:function(){return u.verifyAuthorization}}),Object.defineProperty(t,"hashMessage",{enumerable:!0,get:function(){return u.hashMessage}}),Object.defineProperty(t,"verifyMessage",{enumerable:!0,get:function(){return u.verifyMessage}}),Object.defineProperty(t,"solidityPacked",{enumerable:!0,get:function(){return u.solidityPacked}}),Object.defineProperty(t,"solidityPackedKeccak256",{enumerable:!0,get:function(){return u.solidityPackedKeccak256}}),Object.defineProperty(t,"solidityPackedSha256",{enumerable:!0,get:function(){return u.solidityPackedSha256}}),Object.defineProperty(t,"TypedDataEncoder",{enumerable:!0,get:function(){return u.TypedDataEncoder}}),Object.defineProperty(t,"verifyTypedData",{enumerable:!0,get:function(){return u.verifyTypedData}});var l=r(9977);Object.defineProperty(t,"getDefaultProvider",{enumerable:!0,get:function(){return l.getDefaultProvider}}),Object.defineProperty(t,"Block",{enumerable:!0,get:function(){return l.Block}}),Object.defineProperty(t,"FeeData",{enumerable:!0,get:function(){return l.FeeData}}),Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return l.Log}}),Object.defineProperty(t,"TransactionReceipt",{enumerable:!0,get:function(){return l.TransactionReceipt}}),Object.defineProperty(t,"TransactionResponse",{enumerable:!0,get:function(){return l.TransactionResponse}}),Object.defineProperty(t,"AbstractSigner",{enumerable:!0,get:function(){return l.AbstractSigner}}),Object.defineProperty(t,"NonceManager",{enumerable:!0,get:function(){return l.NonceManager}}),Object.defineProperty(t,"VoidSigner",{enumerable:!0,get:function(){return l.VoidSigner}}),Object.defineProperty(t,"AbstractProvider",{enumerable:!0,get:function(){return l.AbstractProvider}}),Object.defineProperty(t,"FallbackProvider",{enumerable:!0,get:function(){return l.FallbackProvider}}),Object.defineProperty(t,"JsonRpcApiProvider",{enumerable:!0,get:function(){return l.JsonRpcApiProvider}}),Object.defineProperty(t,"JsonRpcProvider",{enumerable:!0,get:function(){return l.JsonRpcProvider}}),Object.defineProperty(t,"JsonRpcSigner",{enumerable:!0,get:function(){return l.JsonRpcSigner}}),Object.defineProperty(t,"BrowserProvider",{enumerable:!0,get:function(){return l.BrowserProvider}}),Object.defineProperty(t,"AlchemyProvider",{enumerable:!0,get:function(){return l.AlchemyProvider}}),Object.defineProperty(t,"AnkrProvider",{enumerable:!0,get:function(){return l.AnkrProvider}}),Object.defineProperty(t,"BlockscoutProvider",{enumerable:!0,get:function(){return l.BlockscoutProvider}}),Object.defineProperty(t,"ChainstackProvider",{enumerable:!0,get:function(){return l.ChainstackProvider}}),Object.defineProperty(t,"CloudflareProvider",{enumerable:!0,get:function(){return l.CloudflareProvider}}),Object.defineProperty(t,"EtherscanProvider",{enumerable:!0,get:function(){return l.EtherscanProvider}}),Object.defineProperty(t,"InfuraProvider",{enumerable:!0,get:function(){return l.InfuraProvider}}),Object.defineProperty(t,"InfuraWebSocketProvider",{enumerable:!0,get:function(){return l.InfuraWebSocketProvider}}),Object.defineProperty(t,"PocketProvider",{enumerable:!0,get:function(){return l.PocketProvider}}),Object.defineProperty(t,"QuickNodeProvider",{enumerable:!0,get:function(){return l.QuickNodeProvider}}),Object.defineProperty(t,"IpcSocketProvider",{enumerable:!0,get:function(){return l.IpcSocketProvider}}),Object.defineProperty(t,"SocketProvider",{enumerable:!0,get:function(){return l.SocketProvider}}),Object.defineProperty(t,"WebSocketProvider",{enumerable:!0,get:function(){return l.WebSocketProvider}}),Object.defineProperty(t,"EnsResolver",{enumerable:!0,get:function(){return l.EnsResolver}}),Object.defineProperty(t,"Network",{enumerable:!0,get:function(){return l.Network}}),Object.defineProperty(t,"EnsPlugin",{enumerable:!0,get:function(){return l.EnsPlugin}}),Object.defineProperty(t,"EtherscanPlugin",{enumerable:!0,get:function(){return l.EtherscanPlugin}}),Object.defineProperty(t,"FeeDataNetworkPlugin",{enumerable:!0,get:function(){return l.FeeDataNetworkPlugin}}),Object.defineProperty(t,"FetchUrlFeeDataNetworkPlugin",{enumerable:!0,get:function(){return l.FetchUrlFeeDataNetworkPlugin}}),Object.defineProperty(t,"GasCostPlugin",{enumerable:!0,get:function(){return l.GasCostPlugin}}),Object.defineProperty(t,"NetworkPlugin",{enumerable:!0,get:function(){return l.NetworkPlugin}}),Object.defineProperty(t,"MulticoinProviderPlugin",{enumerable:!0,get:function(){return l.MulticoinProviderPlugin}}),Object.defineProperty(t,"SocketBlockSubscriber",{enumerable:!0,get:function(){return l.SocketBlockSubscriber}}),Object.defineProperty(t,"SocketEventSubscriber",{enumerable:!0,get:function(){return l.SocketEventSubscriber}}),Object.defineProperty(t,"SocketPendingSubscriber",{enumerable:!0,get:function(){return l.SocketPendingSubscriber}}),Object.defineProperty(t,"SocketSubscriber",{enumerable:!0,get:function(){return l.SocketSubscriber}}),Object.defineProperty(t,"UnmanagedSubscriber",{enumerable:!0,get:function(){return l.UnmanagedSubscriber}}),Object.defineProperty(t,"copyRequest",{enumerable:!0,get:function(){return l.copyRequest}}),Object.defineProperty(t,"showThrottleMessage",{enumerable:!0,get:function(){return l.showThrottleMessage}});var h=r(203);Object.defineProperty(t,"accessListify",{enumerable:!0,get:function(){return h.accessListify}}),Object.defineProperty(t,"authorizationify",{enumerable:!0,get:function(){return h.authorizationify}}),Object.defineProperty(t,"computeAddress",{enumerable:!0,get:function(){return h.computeAddress}}),Object.defineProperty(t,"recoverAddress",{enumerable:!0,get:function(){return h.recoverAddress}}),Object.defineProperty(t,"Transaction",{enumerable:!0,get:function(){return h.Transaction}});var d=r(8718);Object.defineProperty(t,"decodeBase58",{enumerable:!0,get:function(){return d.decodeBase58}}),Object.defineProperty(t,"encodeBase58",{enumerable:!0,get:function(){return d.encodeBase58}}),Object.defineProperty(t,"decodeBase64",{enumerable:!0,get:function(){return d.decodeBase64}}),Object.defineProperty(t,"encodeBase64",{enumerable:!0,get:function(){return d.encodeBase64}}),Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return d.concat}}),Object.defineProperty(t,"dataLength",{enumerable:!0,get:function(){return d.dataLength}}),Object.defineProperty(t,"dataSlice",{enumerable:!0,get:function(){return d.dataSlice}}),Object.defineProperty(t,"getBytes",{enumerable:!0,get:function(){return d.getBytes}}),Object.defineProperty(t,"getBytesCopy",{enumerable:!0,get:function(){return d.getBytesCopy}}),Object.defineProperty(t,"hexlify",{enumerable:!0,get:function(){return d.hexlify}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return d.isHexString}}),Object.defineProperty(t,"isBytesLike",{enumerable:!0,get:function(){return d.isBytesLike}}),Object.defineProperty(t,"stripZerosLeft",{enumerable:!0,get:function(){return d.stripZerosLeft}}),Object.defineProperty(t,"zeroPadBytes",{enumerable:!0,get:function(){return d.zeroPadBytes}}),Object.defineProperty(t,"zeroPadValue",{enumerable:!0,get:function(){return d.zeroPadValue}}),Object.defineProperty(t,"defineProperties",{enumerable:!0,get:function(){return d.defineProperties}}),Object.defineProperty(t,"resolveProperties",{enumerable:!0,get:function(){return d.resolveProperties}}),Object.defineProperty(t,"assert",{enumerable:!0,get:function(){return d.assert}}),Object.defineProperty(t,"assertArgument",{enumerable:!0,get:function(){return d.assertArgument}}),Object.defineProperty(t,"assertArgumentCount",{enumerable:!0,get:function(){return d.assertArgumentCount}}),Object.defineProperty(t,"assertNormalize",{enumerable:!0,get:function(){return d.assertNormalize}}),Object.defineProperty(t,"assertPrivate",{enumerable:!0,get:function(){return d.assertPrivate}}),Object.defineProperty(t,"makeError",{enumerable:!0,get:function(){return d.makeError}}),Object.defineProperty(t,"isCallException",{enumerable:!0,get:function(){return d.isCallException}}),Object.defineProperty(t,"isError",{enumerable:!0,get:function(){return d.isError}}),Object.defineProperty(t,"EventPayload",{enumerable:!0,get:function(){return d.EventPayload}}),Object.defineProperty(t,"FetchRequest",{enumerable:!0,get:function(){return d.FetchRequest}}),Object.defineProperty(t,"FetchResponse",{enumerable:!0,get:function(){return d.FetchResponse}}),Object.defineProperty(t,"FetchCancelSignal",{enumerable:!0,get:function(){return d.FetchCancelSignal}}),Object.defineProperty(t,"FixedNumber",{enumerable:!0,get:function(){return d.FixedNumber}}),Object.defineProperty(t,"getBigInt",{enumerable:!0,get:function(){return d.getBigInt}}),Object.defineProperty(t,"getNumber",{enumerable:!0,get:function(){return d.getNumber}}),Object.defineProperty(t,"getUint",{enumerable:!0,get:function(){return d.getUint}}),Object.defineProperty(t,"toBeArray",{enumerable:!0,get:function(){return d.toBeArray}}),Object.defineProperty(t,"toBigInt",{enumerable:!0,get:function(){return d.toBigInt}}),Object.defineProperty(t,"toBeHex",{enumerable:!0,get:function(){return d.toBeHex}}),Object.defineProperty(t,"toNumber",{enumerable:!0,get:function(){return d.toNumber}}),Object.defineProperty(t,"toQuantity",{enumerable:!0,get:function(){return d.toQuantity}}),Object.defineProperty(t,"fromTwos",{enumerable:!0,get:function(){return d.fromTwos}}),Object.defineProperty(t,"toTwos",{enumerable:!0,get:function(){return d.toTwos}}),Object.defineProperty(t,"mask",{enumerable:!0,get:function(){return d.mask}}),Object.defineProperty(t,"formatEther",{enumerable:!0,get:function(){return d.formatEther}}),Object.defineProperty(t,"parseEther",{enumerable:!0,get:function(){return d.parseEther}}),Object.defineProperty(t,"formatUnits",{enumerable:!0,get:function(){return d.formatUnits}}),Object.defineProperty(t,"parseUnits",{enumerable:!0,get:function(){return d.parseUnits}}),Object.defineProperty(t,"toUtf8Bytes",{enumerable:!0,get:function(){return d.toUtf8Bytes}}),Object.defineProperty(t,"toUtf8CodePoints",{enumerable:!0,get:function(){return d.toUtf8CodePoints}}),Object.defineProperty(t,"toUtf8String",{enumerable:!0,get:function(){return d.toUtf8String}}),Object.defineProperty(t,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return d.Utf8ErrorFuncs}}),Object.defineProperty(t,"decodeRlp",{enumerable:!0,get:function(){return d.decodeRlp}}),Object.defineProperty(t,"encodeRlp",{enumerable:!0,get:function(){return d.encodeRlp}}),Object.defineProperty(t,"uuidV4",{enumerable:!0,get:function(){return d.uuidV4}});var f=r(4040);Object.defineProperty(t,"Mnemonic",{enumerable:!0,get:function(){return f.Mnemonic}}),Object.defineProperty(t,"BaseWallet",{enumerable:!0,get:function(){return f.BaseWallet}}),Object.defineProperty(t,"HDNodeWallet",{enumerable:!0,get:function(){return f.HDNodeWallet}}),Object.defineProperty(t,"HDNodeVoidWallet",{enumerable:!0,get:function(){return f.HDNodeVoidWallet}}),Object.defineProperty(t,"Wallet",{enumerable:!0,get:function(){return f.Wallet}}),Object.defineProperty(t,"defaultPath",{enumerable:!0,get:function(){return f.defaultPath}}),Object.defineProperty(t,"getAccountPath",{enumerable:!0,get:function(){return f.getAccountPath}}),Object.defineProperty(t,"getIndexedAccountPath",{enumerable:!0,get:function(){return f.getIndexedAccountPath}}),Object.defineProperty(t,"isCrowdsaleJson",{enumerable:!0,get:function(){return f.isCrowdsaleJson}}),Object.defineProperty(t,"isKeystoreJson",{enumerable:!0,get:function(){return f.isKeystoreJson}}),Object.defineProperty(t,"decryptCrowdsaleJson",{enumerable:!0,get:function(){return f.decryptCrowdsaleJson}}),Object.defineProperty(t,"decryptKeystoreJsonSync",{enumerable:!0,get:function(){return f.decryptKeystoreJsonSync}}),Object.defineProperty(t,"decryptKeystoreJson",{enumerable:!0,get:function(){return f.decryptKeystoreJson}}),Object.defineProperty(t,"encryptKeystoreJson",{enumerable:!0,get:function(){return f.encryptKeystoreJson}}),Object.defineProperty(t,"encryptKeystoreJsonSync",{enumerable:!0,get:function(){return f.encryptKeystoreJsonSync}});var p=r(3758);Object.defineProperty(t,"Wordlist",{enumerable:!0,get:function(){return p.Wordlist}}),Object.defineProperty(t,"LangEn",{enumerable:!0,get:function(){return p.LangEn}}),Object.defineProperty(t,"WordlistOwl",{enumerable:!0,get:function(){return p.WordlistOwl}}),Object.defineProperty(t,"WordlistOwlA",{enumerable:!0,get:function(){return p.WordlistOwlA}}),Object.defineProperty(t,"wordlists",{enumerable:!0,get:function(){return p.wordlists}})},9542:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AlchemyProvider=void 0;const n=r(8718),i=r(324),s=r(4391),a=r(24),o="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class c extends a.JsonRpcProvider{apiKey;constructor(e,t){null==e&&(e="mainnet");const r=s.Network.from(e);null==t&&(t=o);super(c.getRequest(r,t),r,{staticNetwork:r}),(0,n.defineProperties)(this,{apiKey:t})}_getProvider(e){try{return new c(e,this.apiKey)}catch(e){}return super._getProvider(e)}async _perform(e){if("getTransactionResult"===e.method){const{trace:t,tx:r}=await(0,n.resolveProperties)({trace:this.send("trace_transaction",[e.hash]),tx:this.getTransaction(e.hash)});if(null==t||null==r)return null;let i,s=!1;try{i=t[0].result.output,s="Reverted"===t[0].error}catch(e){}if(i)return(0,n.assert)(!s,"an error occurred during transaction executions","CALL_EXCEPTION",{action:"getTransactionResult",data:i,reason:null,transaction:r,invocation:null,revert:null}),i;(0,n.assert)(!1,"could not parse trace result","BAD_DATA",{value:t})}return await super._perform(e)}isCommunityResource(){return this.apiKey===o}static getRequest(e,t){null==t&&(t=o);const r=new n.FetchRequest(`https://${function(e){switch(e){case"mainnet":return"eth-mainnet.alchemyapi.io";case"goerli":return"eth-goerli.g.alchemy.com";case"sepolia":return"eth-sepolia.g.alchemy.com";case"arbitrum":return"arb-mainnet.g.alchemy.com";case"arbitrum-goerli":return"arb-goerli.g.alchemy.com";case"arbitrum-sepolia":return"arb-sepolia.g.alchemy.com";case"base":return"base-mainnet.g.alchemy.com";case"base-goerli":return"base-goerli.g.alchemy.com";case"base-sepolia":return"base-sepolia.g.alchemy.com";case"matic":return"polygon-mainnet.g.alchemy.com";case"matic-amoy":return"polygon-amoy.g.alchemy.com";case"matic-mumbai":return"polygon-mumbai.g.alchemy.com";case"optimism":return"opt-mainnet.g.alchemy.com";case"optimism-goerli":return"opt-goerli.g.alchemy.com";case"optimism-sepolia":return"opt-sepolia.g.alchemy.com"}(0,n.assertArgument)(!1,"unsupported network","network",e)}(e.name)}/v2/${t}`);return r.allowGzip=!0,t===o&&(r.retryFunc=async(e,t,r)=>((0,i.showThrottleMessage)("alchemy"),!0)),r}}t.AlchemyProvider=c},9607:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9648:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function n(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)}function i(e,...t){if(!((r=e)instanceof Uint8Array||null!=r&&"object"==typeof r&&"Uint8Array"===r.constructor.name))throw new Error("Expected Uint8Array");var r;if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function s(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function a(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function o(e,t){i(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}Object.defineProperty(t,"__esModule",{value:!0}),t.output=t.exists=t.hash=t.bytes=t.bool=t.number=void 0,t.number=r,t.bool=n,t.bytes=i,t.hash=s,t.exists=a,t.output=o;const c={number:r,bool:n,bytes:i,hash:s,exists:a,output:o};t.default=c},9679:(e,t,r)=>{var n=r(4643);e.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}},9701:()=>{},9854:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Interface=t.Indexed=t.ErrorDescription=t.TransactionDescription=t.LogDescription=t.Result=t.checkResultErrors=void 0;const n=r(6468),i=r(7477),s=r(8718),a=r(9895),o=r(1540);Object.defineProperty(t,"checkResultErrors",{enumerable:!0,get:function(){return o.checkResultErrors}}),Object.defineProperty(t,"Result",{enumerable:!0,get:function(){return o.Result}});const c=r(3556),u=r(3233);class l{fragment;name;signature;topic;args;constructor(e,t,r){const n=e.name,i=e.format();(0,s.defineProperties)(this,{fragment:e,name:n,signature:i,topic:t,args:r})}}t.LogDescription=l;class h{fragment;name;args;signature;selector;value;constructor(e,t,r,n){const i=e.name,a=e.format();(0,s.defineProperties)(this,{fragment:e,name:i,args:r,signature:a,selector:t,value:n})}}t.TransactionDescription=h;class d{fragment;name;args;signature;selector;constructor(e,t,r){const n=e.name,i=e.format();(0,s.defineProperties)(this,{fragment:e,name:n,args:r,signature:i,selector:t})}}t.ErrorDescription=d;class f{hash;_isIndexed;static isIndexed(e){return!(!e||!e._isIndexed)}constructor(e){(0,s.defineProperties)(this,{hash:e,_isIndexed:!0})}}t.Indexed=f;const p={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},g={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:e=>`reverted with reason string ${JSON.stringify(e)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:e=>{let t="unknown panic code";return e>=0&&e<=255&&p[e.toString()]&&(t=p[e.toString()]),`reverted with panic code 0x${e.toString(16)} (${t})`}}};class y{fragments;deploy;fallback;receive;#Gt;#zt;#qt;#Qt;constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,this.#qt=new Map,this.#Gt=new Map,this.#zt=new Map;const r=[];for(const e of t)try{r.push(c.Fragment.from(e))}catch(t){console.log(`[Warning] Invalid Fragment ${JSON.stringify(e)}:`,t.message)}(0,s.defineProperties)(this,{fragments:Object.freeze(r)});let n=null,i=!1;this.#Qt=this.getAbiCoder(),this.fragments.forEach((e,t)=>{let r;switch(e.type){case"constructor":return this.deploy?void console.log("duplicate definition - constructor"):void(0,s.defineProperties)(this,{deploy:e});case"fallback":return void(0===e.inputs.length?i=!0:((0,s.assertArgument)(!n||e.payable!==n.payable,"conflicting fallback fragments",`fragments[${t}]`,e),n=e,i=n.payable));case"function":r=this.#qt;break;case"event":r=this.#zt;break;case"error":r=this.#Gt;break;default:return}const a=e.format();r.has(a)||r.set(a,e)}),this.deploy||(0,s.defineProperties)(this,{deploy:c.ConstructorFragment.from("constructor()")}),(0,s.defineProperties)(this,{fallback:n,receive:i})}format(e){const t=e?"minimal":"full";return this.fragments.map(e=>e.format(t))}formatJson(){const e=this.fragments.map(e=>e.format("json"));return JSON.stringify(e.map(e=>JSON.parse(e)))}getAbiCoder(){return a.AbiCoder.defaultAbiCoder()}#Wt(e,t,r){if((0,s.isHexString)(e)){const t=e.toLowerCase();for(const e of this.#qt.values())if(t===e.selector)return e;return null}if(-1===e.indexOf("(")){const n=[];for(const[t,r]of this.#qt)t.split("(")[0]===e&&n.push(r);if(t){const e=t.length>0?t[t.length-1]:null;let r=t.length,i=!0;u.Typed.isTyped(e)&&"overrides"===e.type&&(i=!1,r--);for(let e=n.length-1;e>=0;e--){const t=n[e].inputs.length;t===r||i&&t===r-1||n.splice(e,1)}for(let e=n.length-1;e>=0;e--){const r=n[e].inputs;for(let i=0;i<t.length;i++)if(u.Typed.isTyped(t[i])){if(i>=r.length){if("overrides"===t[i].type)continue;n.splice(e,1);break}if(t[i].type!==r[i].baseType){n.splice(e,1);break}}}}if(1===n.length&&t&&t.length!==n[0].inputs.length){const e=t[t.length-1];(null==e||Array.isArray(e)||"object"!=typeof e)&&n.splice(0,1)}if(0===n.length)return null;if(n.length>1&&r){const t=n.map(e=>JSON.stringify(e.format())).join(", ");(0,s.assertArgument)(!1,`ambiguous function description (i.e. matches ${t})`,"key",e)}return n[0]}const n=this.#qt.get(c.FunctionFragment.from(e).format());return n||null}getFunctionName(e){const t=this.#Wt(e,null,!1);return(0,s.assertArgument)(t,"no matching function","key",e),t.name}hasFunction(e){return!!this.#Wt(e,null,!1)}getFunction(e,t){return this.#Wt(e,t||null,!0)}forEachFunction(e){const t=Array.from(this.#qt.keys());t.sort((e,t)=>e.localeCompare(t));for(let r=0;r<t.length;r++){const n=t[r];e(this.#qt.get(n),r)}}#Jt(e,t,r){if((0,s.isHexString)(e)){const t=e.toLowerCase();for(const e of this.#zt.values())if(t===e.topicHash)return e;return null}if(-1===e.indexOf("(")){const n=[];for(const[t,r]of this.#zt)t.split("(")[0]===e&&n.push(r);if(t){for(let e=n.length-1;e>=0;e--)n[e].inputs.length<t.length&&n.splice(e,1);for(let e=n.length-1;e>=0;e--){const r=n[e].inputs;for(let i=0;i<t.length;i++)if(u.Typed.isTyped(t[i])&&t[i].type!==r[i].baseType){n.splice(e,1);break}}}if(0===n.length)return null;if(n.length>1&&r){const t=n.map(e=>JSON.stringify(e.format())).join(", ");(0,s.assertArgument)(!1,`ambiguous event description (i.e. matches ${t})`,"key",e)}return n[0]}const n=this.#zt.get(c.EventFragment.from(e).format());return n||null}getEventName(e){const t=this.#Jt(e,null,!1);return(0,s.assertArgument)(t,"no matching event","key",e),t.name}hasEvent(e){return!!this.#Jt(e,null,!1)}getEvent(e,t){return this.#Jt(e,t||null,!0)}forEachEvent(e){const t=Array.from(this.#zt.keys());t.sort((e,t)=>e.localeCompare(t));for(let r=0;r<t.length;r++){const n=t[r];e(this.#zt.get(n),r)}}getError(e,t){if((0,s.isHexString)(e)){const t=e.toLowerCase();if(g[t])return c.ErrorFragment.from(g[t].signature);for(const e of this.#Gt.values())if(t===e.selector)return e;return null}if(-1===e.indexOf("(")){const t=[];for(const[r,n]of this.#Gt)r.split("(")[0]===e&&t.push(n);if(0===t.length)return"Error"===e?c.ErrorFragment.from("error Error(string)"):"Panic"===e?c.ErrorFragment.from("error Panic(uint256)"):null;if(t.length>1){const r=t.map(e=>JSON.stringify(e.format())).join(", ");(0,s.assertArgument)(!1,`ambiguous error description (i.e. ${r})`,"name",e)}return t[0]}if("Error(string)"===(e=c.ErrorFragment.from(e).format()))return c.ErrorFragment.from("error Error(string)");if("Panic(uint256)"===e)return c.ErrorFragment.from("error Panic(uint256)");const r=this.#Gt.get(e);return r||null}forEachError(e){const t=Array.from(this.#Gt.keys());t.sort((e,t)=>e.localeCompare(t));for(let r=0;r<t.length;r++){const n=t[r];e(this.#Gt.get(n),r)}}_decodeParams(e,t){return this.#Qt.decode(e,t)}_encodeParams(e,t){return this.#Qt.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){if("string"==typeof e){const t=this.getError(e);(0,s.assertArgument)(t,"unknown error","fragment",e),e=t}return(0,s.assertArgument)((0,s.dataSlice)(t,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",t),this._decodeParams(e.inputs,(0,s.dataSlice)(t,4))}encodeErrorResult(e,t){if("string"==typeof e){const t=this.getError(e);(0,s.assertArgument)(t,"unknown error","fragment",e),e=t}return(0,s.concat)([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionData(e,t){if("string"==typeof e){const t=this.getFunction(e);(0,s.assertArgument)(t,"unknown function","fragment",e),e=t}return(0,s.assertArgument)((0,s.dataSlice)(t,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",t),this._decodeParams(e.inputs,(0,s.dataSlice)(t,4))}encodeFunctionData(e,t){if("string"==typeof e){const t=this.getFunction(e);(0,s.assertArgument)(t,"unknown function","fragment",e),e=t}return(0,s.concat)([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionResult(e,t){if("string"==typeof e){const t=this.getFunction(e);(0,s.assertArgument)(t,"unknown function","fragment",e),e=t}let r="invalid length for result data";const n=(0,s.getBytesCopy)(t);if(n.length%32==0)try{return this.#Qt.decode(e.outputs,n)}catch(e){r="could not decode result data"}(0,s.assert)(!1,r,"BAD_DATA",{value:(0,s.hexlify)(n),info:{method:e.name,signature:e.format()}})}makeError(e,t){const r=(0,s.getBytes)(e,"data"),n=a.AbiCoder.getBuiltinCallException("call",t,r);if(n.message.startsWith("execution reverted (unknown custom error)")){const e=(0,s.hexlify)(r.slice(0,4)),t=this.getError(e);if(t)try{const e=this.#Qt.decode(t.inputs,r.slice(4));n.revert={name:t.name,signature:t.format(),args:e},n.reason=n.revert.signature,n.message=`execution reverted: ${n.reason}`}catch(e){n.message="execution reverted (coult not decode custom error)"}}const i=this.parseTransaction(t);return i&&(n.invocation={method:i.name,signature:i.signature,args:i.args}),n}encodeFunctionResult(e,t){if("string"==typeof e){const t=this.getFunction(e);(0,s.assertArgument)(t,"unknown function","fragment",e),e=t}return(0,s.hexlify)(this.#Qt.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){if("string"==typeof e){const t=this.getEvent(e);(0,s.assertArgument)(t,"unknown event","eventFragment",e),e=t}(0,s.assert)(t.length<=e.inputs.length,`too many arguments for ${e.format()}`,"UNEXPECTED_ARGUMENT",{count:t.length,expectedCount:e.inputs.length});const r=[];e.anonymous||r.push(e.topicHash);const a=(e,t)=>"string"===e.type?(0,i.id)(t):"bytes"===e.type?(0,n.keccak256)((0,s.hexlify)(t)):("bool"===e.type&&"boolean"==typeof t?t=t?"0x01":"0x00":e.type.match(/^u?int/)?t=(0,s.toBeHex)(t):e.type.match(/^bytes/)?t=(0,s.zeroPadBytes)(t,32):"address"===e.type&&this.#Qt.encode(["address"],[t]),(0,s.zeroPadValue)((0,s.hexlify)(t),32));for(t.forEach((t,n)=>{const i=e.inputs[n];i.indexed?null==t?r.push(null):"array"===i.baseType||"tuple"===i.baseType?(0,s.assertArgument)(!1,"filtering with tuples or arrays not supported","contract."+i.name,t):Array.isArray(t)?r.push(t.map(e=>a(i,e))):r.push(a(i,t)):(0,s.assertArgument)(null==t,"cannot filter non-indexed parameters; must be null","contract."+i.name,t)});r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){if("string"==typeof e){const t=this.getEvent(e);(0,s.assertArgument)(t,"unknown event","eventFragment",e),e=t}const r=[],a=[],o=[];return e.anonymous||r.push(e.topicHash),(0,s.assertArgument)(t.length===e.inputs.length,"event arguments/values mismatch","values",t),e.inputs.forEach((e,s)=>{const c=t[s];if(e.indexed)if("string"===e.type)r.push((0,i.id)(c));else if("bytes"===e.type)r.push((0,n.keccak256)(c));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(this.#Qt.encode([e.type],[c]))}else a.push(e),o.push(c)}),{data:this.#Qt.encode(a,o),topics:r}}decodeEventLog(e,t,r){if("string"==typeof e){const t=this.getEvent(e);(0,s.assertArgument)(t,"unknown event","eventFragment",e),e=t}if(null!=r&&!e.anonymous){const t=e.topicHash;(0,s.assertArgument)((0,s.isHexString)(r[0],32)&&r[0].toLowerCase()===t,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}const n=[],i=[],a=[];e.inputs.forEach((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(n.push(c.ParamType.from({type:"bytes32",name:e.name})),a.push(!0)):(n.push(e),a.push(!1)):(i.push(e),a.push(!1))});const u=null!=r?this.#Qt.decode(n,(0,s.concat)(r)):null,l=this.#Qt.decode(i,t,!0),h=[],d=[];let p=0,g=0;return e.inputs.forEach((e,t)=>{let r=null;if(e.indexed)if(null==u)r=new f(null);else if(a[t])r=new f(u[g++]);else try{r=u[g++]}catch(e){r=e}else try{r=l[p++]}catch(e){r=e}h.push(r),d.push(e.name||null)}),o.Result.fromItems(h,d)}parseTransaction(e){const t=(0,s.getBytes)(e.data,"tx.data"),r=(0,s.getBigInt)(null!=e.value?e.value:0,"tx.value"),n=this.getFunction((0,s.hexlify)(t.slice(0,4)));if(!n)return null;const i=this.#Qt.decode(n.inputs,t.slice(4));return new h(n,n.selector,i,r)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new l(t,t.topicHash,this.decodeEventLog(t,e.data,e.topics))}parseError(e){const t=(0,s.hexlify)(e),r=this.getError((0,s.dataSlice)(t,0,4));if(!r)return null;const n=this.#Qt.decode(r.inputs,(0,s.dataSlice)(t,4));return new d(r,r.selector,n)}static from(e){return e instanceof y?e:"string"==typeof e?new y(JSON.parse(e)):"function"==typeof e.formatJson?new y(e.formatJson()):"function"==typeof e.format?new y(e.format("json")):new y(e)}}t.Interface=y},9895:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbiCoder=void 0;const n=r(8718),i=r(1540),s=r(4720),a=r(7505),o=r(7412),c=r(5739),u=r(5916),l=r(2867),h=r(4935),d=r(3415),f=r(3914),p=r(3556),g=r(6107),y=r(8718),m=new Map;m.set(0,"GENERIC_PANIC"),m.set(1,"ASSERT_FALSE"),m.set(17,"OVERFLOW"),m.set(18,"DIVIDE_BY_ZERO"),m.set(33,"ENUM_RANGE_ERROR"),m.set(34,"BAD_STORAGE_DATA"),m.set(49,"STACK_UNDERFLOW"),m.set(50,"ARRAY_RANGE_ERROR"),m.set(65,"OUT_OF_MEMORY"),m.set(81,"UNINITIALIZED_FUNCTION_CALL");const b=new RegExp(/^bytes([0-9]*)$/),w=new RegExp(/^(u?int)([0-9]*)$/);let v=null,A=1024;class E{#Yt(e){if(e.isArray())return new a.ArrayCoder(this.#Yt(e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new f.TupleCoder(e.components.map(e=>this.#Yt(e)),e.name);switch(e.baseType){case"address":return new s.AddressCoder(e.name);case"bool":return new o.BooleanCoder(e.name);case"string":return new d.StringCoder(e.name);case"bytes":return new c.BytesCoder(e.name);case"":return new l.NullCoder(e.name)}let t=e.type.match(w);if(t){let r=parseInt(t[2]||"256");return(0,n.assertArgument)(0!==r&&r<=256&&r%8==0,"invalid "+t[1]+" bit length","param",e),new h.NumberCoder(r/8,"int"===t[1],e.name)}if(t=e.type.match(b),t){let r=parseInt(t[1]);return(0,n.assertArgument)(0!==r&&r<=32,"invalid bytes length","param",e),new u.FixedBytesCoder(r,e.name)}(0,n.assertArgument)(!1,"invalid type","type",e.type)}getDefaultValue(e){const t=e.map(e=>this.#Yt(p.ParamType.from(e)));return new f.TupleCoder(t,"_").defaultValue()}encode(e,t){(0,n.assertArgumentCount)(t.length,e.length,"types/values length mismatch");const r=e.map(e=>this.#Yt(p.ParamType.from(e))),s=new f.TupleCoder(r,"_"),a=new i.Writer;return s.encode(a,t),a.data}decode(e,t,r){const n=e.map(e=>this.#Yt(p.ParamType.from(e)));return new f.TupleCoder(n,"_").decode(new i.Reader(t,r,A))}static _setDefaultMaxInflation(e){(0,n.assertArgument)("number"==typeof e&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),A=e}static defaultAbiCoder(){return null==v&&(v=new E),v}static getBuiltinCallException(e,t,r){return function(e,t,r,n){let i="missing revert data",s=null,a=null;if(r){i="execution reverted";const e=(0,y.getBytes)(r);if(r=(0,y.hexlify)(r),0===e.length)i+=" (no data present; likely require(false) occurred",s="require(false)";else if(e.length%32!=4)i+=" (could not decode reason; invalid data length)";else if("0x08c379a0"===(0,y.hexlify)(e.slice(0,4)))try{s=n.decode(["string"],e.slice(4))[0],a={signature:"Error(string)",name:"Error",args:[s]},i+=`: ${JSON.stringify(s)}`}catch(e){i+=" (could not decode reason; invalid string data)"}else if("0x4e487b71"===(0,y.hexlify)(e.slice(0,4)))try{const t=Number(n.decode(["uint256"],e.slice(4))[0]);a={signature:"Panic(uint256)",name:"Panic",args:[t]},s=`Panic due to ${m.get(t)||"UNKNOWN"}(${t})`,i+=`: ${s}`}catch(e){i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const o={to:t.to?(0,g.getAddress)(t.to):null,data:t.data||"0x"};return t.from&&(o.from=(0,g.getAddress)(t.from)),(0,y.makeError)(i,"CALL_EXCEPTION",{action:e,data:r,reason:s,transaction:o,invocation:null,revert:a})}(e,t,r,E.defaultAbiCoder())}}t.AbiCoder=E},9900:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ethers=void 0;const n=r(2353),i=n.__importStar(r(9523));t.ethers=i,n.__exportStar(r(9523),t)},9901:(e,t,r)=>{var n="__lodash_hash_undefined__",i="[object Function]",s="[object GeneratorFunction]",a=/^\[object .+?Constructor\]$/,o="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,c="object"==typeof self&&self&&self.Object===Object&&self,u=o||c||Function("return this")();var l,h=Array.prototype,d=Function.prototype,f=Object.prototype,p=u["__core-js_shared__"],g=(l=/[^.]+$/.exec(p&&p.keys&&p.keys.IE_PROTO||""))?"Symbol(src)_1."+l:"",y=d.toString,m=f.hasOwnProperty,b=f.toString,w=RegExp("^"+y.call(m).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),v=h.splice,A=P(u,"Map"),E=P(Object,"create");function C(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function B(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function S(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function k(e,t){for(var r=e.length;r--;)if(x(e[r][0],t))return r;return-1}function T(e){if(!O(e)||(t=e,g&&g in t))return!1;var t,r=function(e){var t=O(e)?b.call(e):"";return t==i||t==s}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?w:a;return r.test(function(e){if(null!=e){try{return y.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function I(e,t){var r=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?r["string"==typeof t?"string":"hash"]:r.map}function P(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return T(r)?r:void 0}function N(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var a=e.apply(this,n);return r.cache=s.set(i,a),a};return r.cache=new(N.Cache||S),r}function x(e,t){return e===t||e!=e&&t!=t}function O(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}C.prototype.clear=function(){this.__data__=E?E(null):{}},C.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},C.prototype.get=function(e){var t=this.__data__;if(E){var r=t[e];return r===n?void 0:r}return m.call(t,e)?t[e]:void 0},C.prototype.has=function(e){var t=this.__data__;return E?void 0!==t[e]:m.call(t,e)},C.prototype.set=function(e,t){return this.__data__[e]=E&&void 0===t?n:t,this},B.prototype.clear=function(){this.__data__=[]},B.prototype.delete=function(e){var t=this.__data__,r=k(t,e);return!(r<0)&&(r==t.length-1?t.pop():v.call(t,r,1),!0)},B.prototype.get=function(e){var t=this.__data__,r=k(t,e);return r<0?void 0:t[r][1]},B.prototype.has=function(e){return k(this.__data__,e)>-1},B.prototype.set=function(e,t){var r=this.__data__,n=k(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},S.prototype.clear=function(){this.__data__={hash:new C,map:new(A||B),string:new C}},S.prototype.delete=function(e){return I(this,e).delete(e)},S.prototype.get=function(e){return I(this,e).get(e)},S.prototype.has=function(e){return I(this,e).has(e)},S.prototype.set=function(e,t){return I(this,e).set(e,t),this},N.Cache=S,e.exports=N},9977:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SocketEventSubscriber=t.SocketPendingSubscriber=t.SocketBlockSubscriber=t.SocketSubscriber=t.WebSocketProvider=t.SocketProvider=t.IpcSocketProvider=t.QuickNodeProvider=t.PocketProvider=t.InfuraWebSocketProvider=t.InfuraProvider=t.EtherscanPlugin=t.EtherscanProvider=t.ChainstackProvider=t.CloudflareProvider=t.AnkrProvider=t.BlockscoutProvider=t.AlchemyProvider=t.BrowserProvider=t.JsonRpcSigner=t.JsonRpcProvider=t.JsonRpcApiProvider=t.FallbackProvider=t.copyRequest=t.TransactionResponse=t.TransactionReceipt=t.Log=t.FeeData=t.Block=t.FetchUrlFeeDataNetworkPlugin=t.FeeDataNetworkPlugin=t.EnsPlugin=t.GasCostPlugin=t.NetworkPlugin=t.NonceManager=t.Network=t.MulticoinProviderPlugin=t.EnsResolver=t.getDefaultProvider=t.showThrottleMessage=t.VoidSigner=t.AbstractSigner=t.UnmanagedSubscriber=t.AbstractProvider=void 0;var n=r(3633);Object.defineProperty(t,"AbstractProvider",{enumerable:!0,get:function(){return n.AbstractProvider}}),Object.defineProperty(t,"UnmanagedSubscriber",{enumerable:!0,get:function(){return n.UnmanagedSubscriber}});var i=r(5774);Object.defineProperty(t,"AbstractSigner",{enumerable:!0,get:function(){return i.AbstractSigner}}),Object.defineProperty(t,"VoidSigner",{enumerable:!0,get:function(){return i.VoidSigner}});var s=r(324);Object.defineProperty(t,"showThrottleMessage",{enumerable:!0,get:function(){return s.showThrottleMessage}});var a=r(5144);Object.defineProperty(t,"getDefaultProvider",{enumerable:!0,get:function(){return a.getDefaultProvider}});var o=r(1836);Object.defineProperty(t,"EnsResolver",{enumerable:!0,get:function(){return o.EnsResolver}}),Object.defineProperty(t,"MulticoinProviderPlugin",{enumerable:!0,get:function(){return o.MulticoinProviderPlugin}});var c=r(4391);Object.defineProperty(t,"Network",{enumerable:!0,get:function(){return c.Network}});var u=r(1674);Object.defineProperty(t,"NonceManager",{enumerable:!0,get:function(){return u.NonceManager}});var l=r(6918);Object.defineProperty(t,"NetworkPlugin",{enumerable:!0,get:function(){return l.NetworkPlugin}}),Object.defineProperty(t,"GasCostPlugin",{enumerable:!0,get:function(){return l.GasCostPlugin}}),Object.defineProperty(t,"EnsPlugin",{enumerable:!0,get:function(){return l.EnsPlugin}}),Object.defineProperty(t,"FeeDataNetworkPlugin",{enumerable:!0,get:function(){return l.FeeDataNetworkPlugin}}),Object.defineProperty(t,"FetchUrlFeeDataNetworkPlugin",{enumerable:!0,get:function(){return l.FetchUrlFeeDataNetworkPlugin}});var h=r(532);Object.defineProperty(t,"Block",{enumerable:!0,get:function(){return h.Block}}),Object.defineProperty(t,"FeeData",{enumerable:!0,get:function(){return h.FeeData}}),Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return h.Log}}),Object.defineProperty(t,"TransactionReceipt",{enumerable:!0,get:function(){return h.TransactionReceipt}}),Object.defineProperty(t,"TransactionResponse",{enumerable:!0,get:function(){return h.TransactionResponse}}),Object.defineProperty(t,"copyRequest",{enumerable:!0,get:function(){return h.copyRequest}});var d=r(2163);Object.defineProperty(t,"FallbackProvider",{enumerable:!0,get:function(){return d.FallbackProvider}});var f=r(24);Object.defineProperty(t,"JsonRpcApiProvider",{enumerable:!0,get:function(){return f.JsonRpcApiProvider}}),Object.defineProperty(t,"JsonRpcProvider",{enumerable:!0,get:function(){return f.JsonRpcProvider}}),Object.defineProperty(t,"JsonRpcSigner",{enumerable:!0,get:function(){return f.JsonRpcSigner}});var p=r(5221);Object.defineProperty(t,"BrowserProvider",{enumerable:!0,get:function(){return p.BrowserProvider}});var g=r(9542);Object.defineProperty(t,"AlchemyProvider",{enumerable:!0,get:function(){return g.AlchemyProvider}});var y=r(1096);Object.defineProperty(t,"BlockscoutProvider",{enumerable:!0,get:function(){return y.BlockscoutProvider}});var m=r(7627);Object.defineProperty(t,"AnkrProvider",{enumerable:!0,get:function(){return m.AnkrProvider}});var b=r(3594);Object.defineProperty(t,"CloudflareProvider",{enumerable:!0,get:function(){return b.CloudflareProvider}});var w=r(6862);Object.defineProperty(t,"ChainstackProvider",{enumerable:!0,get:function(){return w.ChainstackProvider}});var v=r(6896);Object.defineProperty(t,"EtherscanProvider",{enumerable:!0,get:function(){return v.EtherscanProvider}}),Object.defineProperty(t,"EtherscanPlugin",{enumerable:!0,get:function(){return v.EtherscanPlugin}});var A=r(7166);Object.defineProperty(t,"InfuraProvider",{enumerable:!0,get:function(){return A.InfuraProvider}}),Object.defineProperty(t,"InfuraWebSocketProvider",{enumerable:!0,get:function(){return A.InfuraWebSocketProvider}});var E=r(5523);Object.defineProperty(t,"PocketProvider",{enumerable:!0,get:function(){return E.PocketProvider}});var C=r(6450);Object.defineProperty(t,"QuickNodeProvider",{enumerable:!0,get:function(){return C.QuickNodeProvider}});const B=r(2063);Object.defineProperty(t,"IpcSocketProvider",{enumerable:!0,get:function(){return B.IpcSocketProvider}});var S=r(2436);Object.defineProperty(t,"SocketProvider",{enumerable:!0,get:function(){return S.SocketProvider}});var k=r(7658);Object.defineProperty(t,"WebSocketProvider",{enumerable:!0,get:function(){return k.WebSocketProvider}});var T=r(2436);Object.defineProperty(t,"SocketSubscriber",{enumerable:!0,get:function(){return T.SocketSubscriber}}),Object.defineProperty(t,"SocketBlockSubscriber",{enumerable:!0,get:function(){return T.SocketBlockSubscriber}}),Object.defineProperty(t,"SocketPendingSubscriber",{enumerable:!0,get:function(){return T.SocketPendingSubscriber}}),Object.defineProperty(t,"SocketEventSubscriber",{enumerable:!0,get:function(){return T.SocketEventSubscriber}})}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,r),s.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";r.r(n),r.d(n,{onHomePage:()=>Pb,onInstall:()=>Ib,onRpcRequest:()=>xb,onUpdate:()=>Tb,onUserInput:()=>Nb,returnToHomePage:()=>kb});var e={};r.r(e),r.d(e,{compressPublicKey:()=>Ua,compressedPublicKeyLength:()=>Ma,curve:()=>ka,decompressPublicKey:()=>La,deriveUnhardenedKeys:()=>Na,getPublicKey:()=>Oa,isValidPrivateKey:()=>Pa,masterNodeGenerationSpec:()=>Fa,name:()=>Ta,privateKeyLength:()=>Da,publicAdd:()=>Ra,publicKeyLength:()=>xa,secret:()=>Ia});var t={};r.r(t),r.d(t,{bytesToNumberLE:()=>qa,compressPublicKey:()=>Ya,compressedPublicKeyLength:()=>eo,curve:()=>ja,decompressPublicKey:()=>Za,deriveUnhardenedKeys:()=>Ga,getPublicKey:()=>Wa,isValidPrivateKey:()=>_a,masterNodeGenerationSpec:()=>$a,multiplyWithBase:()=>Qa,name:()=>Ka,privateKeyLength:()=>Xa,publicAdd:()=>Ja,publicKeyLength:()=>za,secret:()=>Va});var i={};r.r(i),r.d(i,{deriveChildKey:()=>Mo,privateKeyToEthAddress:()=>Do,publicKeyToEthAddress:()=>Fo});var s={};r.r(s),r.d(s,{bip39MnemonicToMultipath:()=>Go,createBip39KeyFromSeed:()=>Wo,deriveChildKey:()=>Qo,entropyToCip3MasterNode:()=>Jo,getDerivationPathWithSeed:()=>qo,mnemonicToSeed:()=>_o,multipathToBip39Mnemonic:()=>zo});var a={};r.r(a),r.d(a,{add:()=>rc,bigIntToBytes:()=>Xo,bytesToBigInt:()=>Zo,deriveChainCode:()=>uc,deriveChildKey:()=>dc,derivePrivateKey:()=>ac,derivePublicKey:()=>hc,getKeyExtension:()=>nc,mod2Pow256:()=>tc,padEnd32Bytes:()=>$o,toReversed:()=>Yo,trunc28Mul8:()=>ec});var o={};r.r(o),r.d(o,{deriveChildKey:()=>fc});var c={};r.r(c),r.d(c,{compressPublicKey:()=>nu,compressedPublicKeyLength:()=>ou,curve:()=>Jc,decompressPublicKey:()=>iu,deriveUnhardenedKeys:()=>Xc,getPublicKey:()=>tu,isValidPrivateKey:()=>eu,masterNodeGenerationSpec:()=>au,name:()=>Yc,privateKeyLength:()=>su,publicAdd:()=>ru,publicKeyLength:()=>$c,secret:()=>Zc});var u={};function l(e,t,r){if("string"==typeof e)throw new Error(`An HTML element ("${String(e)}") was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.`);if(!e)throw new Error("A JSX fragment was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.");return e({...t,key:r})}function h(e,t,r){return l(e,t,r)}r.r(u),r.d(u,{OG:()=>Dg,My:()=>Tg,Ph:()=>Ng,lX:()=>xg,Id:()=>Lg,fg:()=>jg,qj:()=>Ug,aT:()=>Pg,lq:()=>Og,z:()=>Rg,Q5:()=>Vg});var d=r(3994);class f extends TypeError{constructor(e,t){let r;const{message:n,explanation:i,...s}=e,{path:a}=e,o=0===a.length?n:`At path: ${a.join(".")} -- ${n}`;super(i??o),null!=i&&(this.cause=o),Object.assign(this,s),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...t()])}}function p(e){return"object"==typeof e&&null!==e}function g(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function y(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:i,branch:s}=t,{type:a}=r,{refinement:o,message:c=`Expected a value of type \`${a}\`${o?` with refinement \`${o}\``:""}, but received: \`${g(n)}\``}=e;return{value:n,type:a,refinement:o,key:i[i.length-1],path:i,branch:s,...e,message:c}}function*m(e,t,r,n){(function(e){return p(e)&&"function"==typeof e[Symbol.iterator]})(e)||(e=[e]);for(const i of e){const e=y(i,t,r,n);e&&(yield e)}}function*b(e,t,r={}){const{path:n=[],branch:i=[e],coerce:s=!1,mask:a=!1}=r,o={path:n,branch:i};if(s&&(e=t.coercer(e,o),a&&"type"!==t.type&&p(t.schema)&&p(e)&&!Array.isArray(e)))for(const r in e)void 0===t.schema[r]&&delete e[r];let c="valid";for(const n of t.validator(e,o))n.explanation=r.message,c="not_valid",yield[n,void 0];for(let[u,l,h]of t.entries(e,o)){const t=b(l,h,{path:void 0===u?n:[...n,u],branch:void 0===u?i:[...i,l],coerce:s,mask:a,message:r.message});for(const r of t)r[0]?(c=null===r[0].refinement||void 0===r[0].refinement?"not_valid":"not_refined",yield[r[0],void 0]):s&&(l=r[1],void 0===u?e=l:e instanceof Map?e.set(u,l):e instanceof Set?e.add(l):p(e)&&(void 0!==l||u in e)&&(e[u]=l))}if("not_valid"!==c)for(const n of t.refiner(e,o))n.explanation=r.message,c="not_refined",yield[n,void 0];"valid"===c&&(yield[void 0,e])}class w{constructor(e){const{type:t,schema:r,validator:n,refiner:i,coercer:s=e=>e,entries:a=function*(){}}=e;this.type=t,this.schema=r,this.entries=a,this.coercer=s,this.validator=n?(e,t)=>m(n(e,t),t,this,e):()=>[],this.refiner=i?(e,t)=>m(i(e,t),t,this,e):()=>[]}assert(e,t){return function(e,t,r){const n=E(e,t,{message:r});if(n[0])throw n[0]}(e,this,t)}create(e,t){return function(e,t,r){const n=E(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}(e,this,t)}is(e){return function(e,t){const r=E(e,t);return!r[0]}(e,this)}mask(e,t){return function(e,t,r){const n=E(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}(e,this,t)}validate(e,t={}){return E(e,this,t)}}const v="EXACT_OPTIONAL";class A extends w{constructor(e){super({...e,type:`exact optional ${e.type}`}),this.brand=v}static isExactOptional(e){return p(e)&&"brand"in e&&e.brand===v}}function E(e,t,r={}){const n=b(e,t,r),i=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(n);if(i[0]){return[new f(i[0],function*(){for(const e of n)e[0]&&(yield e[0])}),void 0]}return[void 0,i[1]]}function C(...e){const t="type"===e[0]?.type,r=e.map(({schema:e})=>e),n=Object.assign({},...r);return t?function(e){const t=Object.keys(e);return new w({type:"type",schema:e,*entries(r){if(p(r))for(const n of t)yield[n,r[n],e[n]]},validator:e=>p(e)||`Expected an object, but received: ${g(e)}`,coercer:e=>p(e)?{...e}:e})}(n):I(n)}function B(e,t){return new w({type:e,schema:null,validator:t})}function S(){return B("boolean",e=>"boolean"==typeof e)}function k(){return B("never",()=>!1)}function T(e){return new w({...e,validator:(t,r)=>null===t||e.validator(t,r),refiner:(t,r)=>null===t||e.refiner(t,r)})}function I(e){const t=e?Object.keys(e):[],r=k();return new w({type:"object",schema:e??null,*entries(n){if(e&&p(n)){const i=new Set(Object.keys(n));for(const r of t){i.delete(r);const t=e[r];A.isExactOptional(t)&&!Object.prototype.hasOwnProperty.call(n,r)||(yield[r,n[r],e[r]])}for(const e of i)yield[e,n[e],r]}},validator:e=>p(e)||`Expected an object, but received: ${g(e)}`,coercer:e=>p(e)?{...e}:e})}function P(e){return new w({...e,validator:(t,r)=>void 0===t||e.validator(t,r),refiner:(t,r)=>void 0===t||e.refiner(t,r)})}function N(){return B("string",e=>"string"==typeof e||`Expected a string, but received: ${g(e)}`)}function x(e){const t=e.map(e=>e.type).join(" | ");return new w({type:"union",schema:null,coercer(t){for(const r of e){const[e,n]=r.validate(t,{coerce:!0});if(!e)return n}return t},validator(r,n){const i=[];for(const t of e){const[...e]=b(r,t,n),[s]=e;if(!s?.[0])return[];for(const[t]of e)t&&i.push(t)}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${g(r)}`,...i]}})}function O(e,t){return B(e,e=>"string"==typeof e&&t.test(e))}const R=/^(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})$/u,U=/^[-a-z0-9]{3,8}$/u,L=/^[-_a-zA-Z0-9]{1,32}$/u,D=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})):(?<accountAddress>[-.%a-zA-Z0-9]{1,128})$/u,F=/^[-.%a-zA-Z0-9]{1,128}$/u,M=/^[-a-z0-9]{3,8}$/u,j=/^[-.%a-zA-Z0-9]{1,128}$/u,K=/^[-.%a-zA-Z0-9]{1,78}$/u,V=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})$/u,H=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})\/(?<tokenId>[-.%a-zA-Z0-9]{1,78})$/u,_=(O("CaipChainId",R),O("CaipNamespace",U),O("CaipReference",L),O("CaipAccountId",D),O("CaipAccountAddress",F),O("CaipAssetNamespace",M),O("CaipAssetReference",j),O("CaipTokenId",K),O("CaipAssetType",V));O("CaipAssetId",H),O("CaipAssetTypeOrId",/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})(\/(?<tokenId>[-.%a-zA-Z0-9]{1,78}))?$/u);var G;function z(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)}!function(e){e.Bip122="bip122",e.Solana="solana",e.Eip155="eip155",e.Wallet="wallet"}(G=G||(G={}));const q=(e,t)=>Object.hasOwnProperty.call(e,t);var Q;!function(e){e[e.Null=4]="Null",e[e.Comma=1]="Comma",e[e.Wrapper=1]="Wrapper",e[e.True=4]="True",e[e.False=5]="False",e[e.Quote=1]="Quote",e[e.Colon=1]="Colon",e[e.Date=24]="Date"}(Q=Q||(Q={}));function W(e){return B(JSON.stringify(e),function(e){const t=g(e),r=typeof e;return new w({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?e:null,validator:r=>r===e||`Expected the literal \`${t}\`, but received: ${g(r)}`})}(e).validator)}var J;!function(e){e.ButtonClickEvent="ButtonClickEvent",e.FormSubmitEvent="FormSubmitEvent",e.InputChangeEvent="InputChangeEvent",e.FileUploadEvent="FileUploadEvent"}(J||(J={}));const Y=I({type:N(),name:P(N())}),Z=C(Y,I({type:W(J.ButtonClickEvent),name:P(N())})),X=I({name:N(),size:B("number",e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${g(e)}`),contentType:N(),contents:N()}),$=I({asset:_,name:N(),symbol:N()});var ee,te;!function(e){const t=e.map(e=>"union"===e.type&&Array.isArray(e.schema)?e.schema:e).flat(1/0),r=t.map(({schema:e})=>e.type.type),n=t.reduce((e,t)=>(e[JSON.parse(t.schema.type.type)]=t,e),{});new w({type:"union",schema:t,*entries(e,t){if(!z(e)||!q(e,"type")||"string"!=typeof e.type)return;const{type:r}=e,i=n[r];if(i)for(const r of i.entries(e,t))yield r},coercer(e,t){if(!z(e)||!q(e,"type")||"string"!=typeof e.type)return e;const{type:r}=e,i=n[r];return i?i.coercer(e,t):e},*refiner(e,t){const r=n[e.type];yield*r.refiner(e,t)},validator(e,t){if(!z(e)||!q(e,"type")||"string"!=typeof e.type)return`Expected type to be one of: ${r.join(", ")}, but received: undefined`;const{type:i}=e,s=n[i];return s?s.validator(e,t):`Expected type to be one of: ${r.join(", ")}, but received: "${i}"`}})}([Z,C(Y,I({type:W(J.FormSubmitEvent),value:(ee=N(),te=T(x([N(),X,S(),$])),new w({type:"record",schema:null,*entries(e){if(p(e))for(const t in e){const r=e[t];yield[t,t,ee],yield[t,r,te]}},validator:e=>p(e)||`Expected an object, but received: ${g(e)}`})),name:N()})),C(Y,I({type:W(J.InputChangeEvent),name:N(),value:x([N(),S(),$])})),C(Y,I({type:W(J.FileUploadEvent),name:N(),file:T(X)}))]);function re(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}function ne(e){return t=>{const{key:r=null,...n}=t;return{type:e,props:re(n),key:r}}}const ie=ne("Box"),se=ne("Heading"),ae=ne("Text"),oe=ne("Section"),ce=ne("Button"),ue=({tokenAddress:e})=>l(ie,{direction:"vertical",alignment:"center",children:l(oe,{children:h(ie,{direction:"vertical",alignment:"center",children:[l(se,{size:"md",children:"Hide token?"}),l(ae,{children:"You can add this token back in the future by going to “Import token” in your accounts menu."}),h(ie,{direction:"horizontal",alignment:"space-around",children:[l(ce,{variant:"destructive",name:`token-details-${e}`,children:"Cancel"}),l(ce,{name:`hide-token-confirmed-${e}`,children:"Confirm"})]})]})})}),le=ne("Banner"),he=ne("Link"),de=ne("Divider");var fe;!function(e){e.AddSquare="add-square",e.Add="add",e.Arrow2Down="arrow-2-down",e.Arrow2Left="arrow-2-left",e.Arrow2Right="arrow-2-right",e.Arrow2Up="arrow-2-up",e.Arrow2UpRight="arrow-2-up-right",e.ArrowDoubleLeft="arrow-double-left",e.ArrowDoubleRight="arrow-double-right",e.ArrowDown="arrow-down",e.ArrowLeft="arrow-left",e.ArrowRight="arrow-right",e.ArrowUp="arrow-up",e.BankToken="bank-token",e.Bank="bank",e.Book="book",e.Bookmark="bookmark",e.Bridge="bridge",e.Calculator="calculator",e.CardPos="card-pos",e.CardToken="card-token",e.Card="card",e.Category="category",e.Chart="chart",e.CheckBold="check-bold",e.Check="check",e.Clock="clock",e.Close="close",e.CodeCircle="code-circle",e.Coin="coin",e.Confirmation="confirmation",e.Connect="connect",e.CopySuccess="copy-success",e.Copy="copy",e.Customize="customize",e.Danger="danger",e.Dark="dark",e.Data="data",e.Diagram="diagram",e.DocumentCode="document-code",e.DragDrop="drag-drop",e.DraggingAnimation="dragging-animation",e.PinningAnimation="pinning-animation",e.Edit="edit",e.Eraser="eraser",e.Ethereum="ethereum",e.Expand="expand",e.Explore="explore",e.Export="export",e.EyeSlash="eye-slash",e.Eye="eye",e.Filter="filter",e.Flag="flag",e.FlashSlash="flash-slash",e.Flash="flash",e.FullCircle="full-circle",e.Gas="gas",e.GlobalSearch="global-search",e.Global="global",e.Graph="graph",e.Hardware="hardware",e.Heart="heart",e.Hierarchy="hierarchy",e.Home="home",e.Import="import",e.Info="info",e.Key="key",e.Light="light",e.Link="link",e.Loading="loading",e.LockCircle="lock-circle",e.LockSlash="lock-slash",e.Lock="lock",e.Login="login",e.Logout="logout",e.Menu="menu",e.MessageQuestion="message-question",e.Messages="messages",e.MinusBold="minus-bold",e.MinusSquare="minus-square",e.Minus="minus",e.Mobile="mobile",e.Money="money",e.Monitor="monitor",e.MoreHorizontal="more-horizontal",e.MoreVertical="more-vertical",e.NotificationCircle="notification-circle",e.Notification="notification",e.PasswordCheck="password-check",e.People="people",e.Pin="pin",e.ProgrammingArrows="programming-arrows",e.Custody="custody",e.Question="question",e.Received="received",e.Refresh="refresh",e.Save="save",e.ScanBarcode="scan-barcode",e.ScanFocus="scan-focus",e.Scan="scan",e.Scroll="scroll",e.Search="search",e.SecurityCard="security-card",e.SecurityCross="security-cross",e.SecurityKey="security-key",e.SecuritySearch="security-search",e.SecuritySlash="security-slash",e.SecurityTick="security-tick",e.SecurityTime="security-time",e.SecurityUser="security-user",e.Security="security",e.Send1="send-1",e.Send2="send-2",e.Setting="setting",e.Slash="slash",e.SnapsMobile="snaps-mobile",e.SnapsPlus="snaps-plus",e.Snaps="snaps",e.Speedometer="speedometer",e.Star="star",e.Stake="stake",e.Student="student",e.SwapHorizontal="swap-horizontal",e.SwapVertical="swap-vertical",e.Tag="tag",e.Tilde="tilde",e.Timer="timer",e.Trash="trash",e.TrendDown="trend-down",e.TrendUp="trend-up",e.UserCircleAdd="user-circle-add",e.UserCircleLink="user-circle-link",e.UserCircleRemove="user-circle-remove",e.UserCircle="user-circle",e.User="user",e.WalletCard="wallet-card",e.WalletMoney="wallet-money",e.Wallet="wallet",e.Warning="warning",e.Twitter="twitter",e.QrCode="qr-code",e.UserCheck="user-check",e.Unpin="unpin",e.Ban="ban",e.Bold="bold",e.CircleX="circle-x",e.Download="download",e.FileIcon="file",e.Flask="flask",e.Plug="plug",e.Share="share",e.Square="square",e.Tint="tint",e.Upload="upload",e.Usb="usb",e.Wifi="wifi",e.PlusMinus="plus-minus"}(fe||(fe={}));const pe=ne("Icon");function ge(e,t,r){const n=t.split("|").map(e=>e.trim());for(let r=0;r<n.length;r++)switch(t){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof e===t)return}const i=new Error(`invalid value for type ${t}`);throw i.code="INVALID_ARGUMENT",i.argument=`value.${r}`,i.value=e,i}async function ye(e){const t=Object.keys(e);return(await Promise.all(t.map(t=>Promise.resolve(e[t])))).reduce((e,r,n)=>(e[t[n]]=r,e),{})}function me(e,t,r){for(let n in t){let i=t[n];const s=r?r[n]:null;s&&ge(i,s,n),Object.defineProperty(e,n,{enumerable:!0,value:i,writable:!1})}}function be(e,t){if(null==e)return"null";if(null==t&&(t=new Set),"object"==typeof e){if(t.has(e))return"[Circular]";t.add(e)}if(Array.isArray(e))return"[ "+e.map(e=>be(e,t)).join(", ")+" ]";if(e instanceof Uint8Array){const t="0123456789abcdef";let r="0x";for(let n=0;n<e.length;n++)r+=t[e[n]>>4],r+=t[15&e[n]];return r}if("object"==typeof e&&"function"==typeof e.toJSON)return be(e.toJSON(),t);switch(typeof e){case"boolean":case"number":case"symbol":return e.toString();case"bigint":return BigInt(e).toString();case"string":return JSON.stringify(e);case"object":{const r=Object.keys(e);return r.sort(),"{ "+r.map(r=>`${be(r,t)}: ${be(e[r],t)}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function we(e,t){return e&&e.code===t}function ve(e){return we(e,"CALL_EXCEPTION")}function Ae(e,t,r){let n,i=e;{const n=[];if(r){if("message"in r||"code"in r||"name"in r)throw new Error(`value will overwrite populated values: ${be(r)}`);for(const e in r){if("shortMessage"===e)continue;const t=r[e];n.push(e+"="+be(t))}}n.push(`code=${t}`),n.push("version=6.15.0"),n.length&&(e+=" ("+n.join(", ")+")")}switch(t){case"INVALID_ARGUMENT":n=new TypeError(e);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":n=new RangeError(e);break;default:n=new Error(e)}return me(n,{code:t}),r&&Object.assign(n,r),null==n.shortMessage&&me(n,{shortMessage:i}),n}function Ee(e,t,r,n){if(!e)throw Ae(t,r,n)}function Ce(e,t,r,n){Ee(e,t,"INVALID_ARGUMENT",{argument:r,value:n})}function Be(e,t,r){null==r&&(r=""),r&&(r=": "+r),Ee(e>=t,"missing argument"+r,"MISSING_ARGUMENT",{count:e,expectedCount:t}),Ee(e<=t,"too many arguments"+r,"UNEXPECTED_ARGUMENT",{count:e,expectedCount:t})}const Se=["NFD","NFC","NFKD","NFKC"].reduce((e,t)=>{try{if("test"!=="test".normalize(t))throw new Error("bad");if("NFD"===t){const e=String.fromCharCode(233).normalize("NFD");if(e!==String.fromCharCode(101,769))throw new Error("broken")}e.push(t)}catch(e){}return e},[]);function ke(e,t,r){if(null==r&&(r=""),e!==t){let e=r,t="new";r&&(e+=".",t+=" "+r),Ee(!1,`private constructor; use ${e}from* methods`,"UNSUPPORTED_OPERATION",{operation:t})}}function Te(e,t,r){if(e instanceof Uint8Array)return r?new Uint8Array(e):e;if("string"==typeof e&&e.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const t=new Uint8Array((e.length-2)/2);let r=2;for(let n=0;n<t.length;n++)t[n]=parseInt(e.substring(r,r+2),16),r+=2;return t}Ce(!1,"invalid BytesLike value",t||"value",e)}function Ie(e,t){return Te(e,t,!1)}function Pe(e,t){return Te(e,t,!0)}function Ne(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(("number"!=typeof t||e.length===2+2*t)&&(!0!==t||e.length%2==0))}function xe(e){return Ne(e,!0)||e instanceof Uint8Array}const Oe="0123456789abcdef";function Re(e){const t=Ie(e);let r="0x";for(let e=0;e<t.length;e++){const n=t[e];r+=Oe[(240&n)>>4]+Oe[15&n]}return r}function Ue(e){return"0x"+e.map(e=>Re(e).substring(2)).join("")}function Le(e){return Ne(e,!0)?(e.length-2)/2:Ie(e).length}function De(e,t,r){const n=Ie(e);return null!=r&&r>n.length&&Ee(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:r}),Re(n.slice(null==t?0:t,null==r?n.length:r))}function Fe(e,t,r){const n=Ie(e);Ee(t>=n.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(n),length:t,offset:t+1});const i=new Uint8Array(t);return i.fill(0),r?i.set(n,t-n.length):i.set(n,0),Re(i)}function Me(e,t){return Fe(e,t,!0)}const je=BigInt(0),Ke=BigInt(1),Ve=9007199254740991;function He(e,t){const r=qe(e,"value"),n=BigInt(Je(t,"width"));if(Ee(r>>n===je,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:e}),r>>n-Ke){return-((~r&(Ke<<n)-Ke)+Ke)}return r}function _e(e,t){let r=ze(e,"value");const n=BigInt(Je(t,"width")),i=Ke<<n-Ke;if(r<je){r=-r,Ee(r<=i,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:e});return(~r&(Ke<<n)-Ke)+Ke}return Ee(r<i,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:e}),r}function Ge(e,t){const r=qe(e,"value"),n=BigInt(Je(t,"bits"));return r&(Ke<<n)-Ke}function ze(e,t){switch(typeof e){case"bigint":return e;case"number":return Ce(Number.isInteger(e),"underflow",t||"value",e),Ce(e>=-Ve&&e<=Ve,"overflow",t||"value",e),BigInt(e);case"string":try{if(""===e)throw new Error("empty string");return"-"===e[0]&&"-"!==e[1]?-BigInt(e.substring(1)):BigInt(e)}catch(r){Ce(!1,`invalid BigNumberish string: ${r.message}`,t||"value",e)}}Ce(!1,"invalid BigNumberish value",t||"value",e)}function qe(e,t){const r=ze(e,t);return Ee(r>=je,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:e}),r}const Qe="0123456789abcdef";function We(e){if(e instanceof Uint8Array){let t="0x0";for(const r of e)t+=Qe[r>>4],t+=Qe[15&r];return BigInt(t)}return ze(e)}function Je(e,t){switch(typeof e){case"bigint":return Ce(e>=-Ve&&e<=Ve,"overflow",t||"value",e),Number(e);case"number":return Ce(Number.isInteger(e),"underflow",t||"value",e),Ce(e>=-Ve&&e<=Ve,"overflow",t||"value",e),e;case"string":try{if(""===e)throw new Error("empty string");return Je(BigInt(e),t)}catch(r){Ce(!1,`invalid numeric string: ${r.message}`,t||"value",e)}}Ce(!1,"invalid numeric value",t||"value",e)}function Ye(e,t){let r=qe(e,"value").toString(16);if(null==t)r.length%2&&(r="0"+r);else{const n=Je(t,"width");for(Ee(2*n>=r.length,`value exceeds width (${n} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:e});r.length<2*n;)r="0"+r}return"0x"+r}function Ze(e){const t=qe(e,"value");if(t===je)return new Uint8Array([]);let r=t.toString(16);r.length%2&&(r="0"+r);const n=new Uint8Array(r.length/2);for(let e=0;e<n.length;e++){const t=2*e;n[e]=parseInt(r.substring(t,t+2),16)}return n}function Xe(e){let t=Re(xe(e)?e:Ze(e)).substring(2);for(;t.startsWith("0");)t=t.substring(1);return""===t&&(t="0"),"0x"+t}const $e=BigInt(-1),et=BigInt(0),tt=BigInt(1),rt=BigInt(5),nt={};let it="0000";for(;it.length<80;)it+=it;function st(e){let t=it;for(;t.length<e;)t+=t;return BigInt("1"+t.substring(0,e))}function at(e,t,r){const n=BigInt(t.width);if(t.signed){const t=tt<<n-tt;Ee(null==r||e>=-t&&e<t,"overflow","NUMERIC_FAULT",{operation:r,fault:"overflow",value:e}),e=e>et?He(Ge(e,n),n):-He(Ge(-e,n),n)}else{const t=tt<<n;Ee(null==r||e>=0&&e<t,"overflow","NUMERIC_FAULT",{operation:r,fault:"overflow",value:e}),e=(e%t+t)%t&t-tt}return e}function ot(e){"number"==typeof e&&(e=`fixed128x${e}`);let t=!0,r=128,n=18;if("string"==typeof e)if("fixed"===e);else if("ufixed"===e)t=!1;else{const i=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);Ce(i,"invalid fixed format","format",e),t="u"!==i[1],r=parseInt(i[2]),n=parseInt(i[3])}else if(e){const i=e,s=(e,t,r)=>null==i[e]?r:(Ce(typeof i[e]===t,"invalid fixed format ("+e+" not "+t+")","format."+e,i[e]),i[e]);t=s("signed","boolean",t),r=s("width","number",r),n=s("decimals","number",n)}Ce(r%8==0,"invalid FixedNumber width (not byte aligned)","format.width",r),Ce(n<=80,"invalid FixedNumber decimals (too large)","format.decimals",n);return{signed:t,width:r,decimals:n,name:(t?"":"u")+"fixed"+String(r)+"x"+String(n)}}class ct{format;#ie;#se;#ae;_value;constructor(e,t,r){ke(e,nt,"FixedNumber"),this.#se=t,this.#ie=r;const n=function(e,t){let r="";e<et&&(r="-",e*=$e);let n=e.toString();if(0===t)return r+n;for(;n.length<=t;)n=it+n;const i=n.length-t;for(n=n.substring(0,i)+"."+n.substring(i);"0"===n[0]&&"."!==n[1];)n=n.substring(1);for(;"0"===n[n.length-1]&&"."!==n[n.length-2];)n=n.substring(0,n.length-1);return r+n}(t,r.decimals);me(this,{format:r.name,_value:n}),this.#ae=st(r.decimals)}get signed(){return this.#ie.signed}get width(){return this.#ie.width}get decimals(){return this.#ie.decimals}get value(){return this.#se}#oe(e){Ce(this.format===e.format,"incompatible format; use fixedNumber.toFormat","other",e)}#ce(e,t){return e=at(e,this.#ie,t),new ct(nt,e,this.#ie)}#ue(e,t){return this.#oe(e),this.#ce(this.#se+e.#se,t)}addUnsafe(e){return this.#ue(e)}add(e){return this.#ue(e,"add")}#le(e,t){return this.#oe(e),this.#ce(this.#se-e.#se,t)}subUnsafe(e){return this.#le(e)}sub(e){return this.#le(e,"sub")}#he(e,t){return this.#oe(e),this.#ce(this.#se*e.#se/this.#ae,t)}mulUnsafe(e){return this.#he(e)}mul(e){return this.#he(e,"mul")}mulSignal(e){this.#oe(e);const t=this.#se*e.#se;return Ee(t%this.#ae===et,"precision lost during signalling mul","NUMERIC_FAULT",{operation:"mulSignal",fault:"underflow",value:this}),this.#ce(t/this.#ae,"mulSignal")}#de(e,t){return Ee(e.#se!==et,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),this.#oe(e),this.#ce(this.#se*this.#ae/e.#se,t)}divUnsafe(e){return this.#de(e)}div(e){return this.#de(e,"div")}divSignal(e){Ee(e.#se!==et,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),this.#oe(e);const t=this.#se*this.#ae;return Ee(t%e.#se===et,"precision lost during signalling div","NUMERIC_FAULT",{operation:"divSignal",fault:"underflow",value:this}),this.#ce(t/e.#se,"divSignal")}cmp(e){let t=this.value,r=e.value;const n=this.decimals-e.decimals;return n>0?r*=st(n):n<0&&(t*=st(-n)),t<r?-1:t>r?1:0}eq(e){return 0===this.cmp(e)}lt(e){return this.cmp(e)<0}lte(e){return this.cmp(e)<=0}gt(e){return this.cmp(e)>0}gte(e){return this.cmp(e)>=0}floor(){let e=this.#se;return this.#se<et&&(e-=this.#ae-tt),e=this.#se/this.#ae*this.#ae,this.#ce(e,"floor")}ceiling(){let e=this.#se;return this.#se>et&&(e+=this.#ae-tt),e=this.#se/this.#ae*this.#ae,this.#ce(e,"ceiling")}round(e){if(null==e&&(e=0),e>=this.decimals)return this;const t=this.decimals-e,r=rt*st(t-1);let n=this.value+r;const i=st(t);return n=n/i*i,at(n,this.#ie,"round"),new ct(nt,n,this.#ie)}isZero(){return this.#se===et}isNegative(){return this.#se<et}toString(){return this._value}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return ct.fromString(this.toString(),e)}static fromValue(e,t,r){const n=null==t?0:Je(t),i=ot(r);let s=ze(e,"value");const a=n-i.decimals;if(a>0){const t=st(a);Ee(s%t===et,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:e}),s/=t}else a<0&&(s*=st(-a));return at(s,i,"fromValue"),new ct(nt,s,i)}static fromString(e,t){const r=e.match(/^(-?)([0-9]*)\.?([0-9]*)$/);Ce(r&&r[2].length+r[3].length>0,"invalid FixedNumber string value","value",e);const n=ot(t);let i=r[2]||"0",s=r[3]||"";for(;s.length<n.decimals;)s+=it;Ee(s.substring(n.decimals).match(/^0*$/),"too many decimals for format","NUMERIC_FAULT",{operation:"fromString",fault:"underflow",value:e}),s=s.substring(0,n.decimals);const a=BigInt(r[1]+i+s);return at(a,n,"fromString"),new ct(nt,a,n)}static fromBytes(e,t){let r=We(Ie(e,"value"));const n=ot(t);return n.signed&&(r=He(r,n.width)),at(r,n,"fromBytes"),new ct(nt,r,n)}}const ut=["wei","kwei","mwei","gwei","szabo","finney","ether"];function lt(e){return function(e,t){let r=18;if("string"==typeof t){const e=ut.indexOf(t);Ce(e>=0,"invalid unit","unit",t),r=3*e}else null!=t&&(r=Je(t,"unit"));return ct.fromValue(e,r,{decimals:r,width:512}).toString()}(e,18)}const ht="https://snap.coti.io/delete";var dt;!function(e){e.ERC20="erc20",e.NFT="nft",e.UNKNOWN="unknown"}(dt||(dt={}));const ft=ne("Image"),pt=({token:e})=>e.type===dt.NFT?h(ie,{alignment:"space-between",direction:"horizontal",children:[l(ie,{alignment:"center",direction:"horizontal",children:l(ie,{direction:"vertical",alignment:"center",children:l(ae,{children:e.name})})}),l(ie,{direction:"vertical",alignment:"center",children:l(ce,{name:`token-details-${e.address}-${e.tokenId}`,children:"View NFT"})})]}):h(ie,{alignment:"space-between",direction:"horizontal",children:[h(ie,{alignment:"center",direction:"horizontal",children:[l(ie,{alignment:"center",direction:"vertical",children:l(ft,{src:'<svg width="34" height="34" viewBox="0 0 34 34" fill="none" xmlns="http://www.w3.org/2000/svg">\n<rect width="34" height="34" rx="16" fill="#D9D9D9"/>\n<path d="M6.51236 15.4799C6.16793 15.475 6 15.6172 6 15.9702C6 15.9702 6 23.1175 6 24.1213C6 24.4652 6.17528 24.6116 6.50868 24.6153C10.4525 24.6558 15.2114 21.1655 19.2067 18.4253L19.2135 9C15.2776 11.6966 10.36 15.5356 6.51236 15.4799Z" fill="url(#paint0_linear_820_1946)"/>\n<path d="M27.1594 19.1718C27.5038 19.1767 27.6717 19.0345 27.6717 18.6815C27.6717 18.6815 27.6717 11.5342 27.6717 10.5303C27.6717 10.1865 27.4965 10.04 27.1631 10.0364C23.2192 9.99591 18.4603 13.4862 14.465 16.2263L14.4583 25.6541C18.3953 22.9532 23.3112 19.1136 27.1594 19.1718Z" fill="url(#paint1_linear_820_1946)"/>\n<path d="M19.2068 18.4278L19.2104 13.0431C17.5765 14.058 15.9665 15.1937 14.4644 16.2239L14.4607 21.6086C16.0946 20.5943 17.7028 19.458 19.2068 18.4278Z" fill="#464646"/>\n<defs>\n<linearGradient id="paint0_linear_820_1946" x1="13.8224" y1="23.4601" x2="10.6454" y2="10.5717" gradientUnits="userSpaceOnUse">\n<stop offset="0.1" stop-color="#464646"/>\n<stop offset="0.499" stop-color="#727272"/>\n<stop offset="0.8" stop-color="#969696"/>\n</linearGradient>\n<linearGradient id="paint1_linear_820_1946" x1="21.065" y1="10.036" x2="21.065" y2="25.6541" gradientUnits="userSpaceOnUse">\n<stop offset="0.1" stop-color="#464646"/>\n<stop offset="0.499" stop-color="#727272"/>\n<stop offset="0.8" stop-color="#969696"/>\n</linearGradient>\n</defs>\n</svg>\n'})}),l(ie,{direction:"vertical",alignment:"center",children:l(ae,{children:e.symbol})})]}),h(ie,{alignment:"center",direction:"horizontal",children:[l(ie,{direction:"vertical",alignment:"center",children:h(ae,{children:[e.balance?e.balance:"(encrypted)"," ",e.symbol]})}),l(ie,{direction:"vertical",alignment:"center",children:l(ce,{name:`token-details-${e.address}`,children:l(pe,{name:"arrow-right"})})})]})]}),gt=({balance:e,tokenBalances:t,AESKey:r,tokenView:n})=>{const i=lt(e).slice(0,lt(e).indexOf(".")+4);return h(ie,{children:[!r&&l(ie,{direction:"horizontal",alignment:"center",children:l(le,{title:"",severity:"info",children:l(ae,{children:"To view your balances, you must first register your account. Click on the button below to get started"})})}),l(oe,{children:h(ie,{alignment:"center",direction:"vertical",children:[l(ie,{alignment:"center",direction:"horizontal",children:h(se,{size:"lg",children:[i," COTI"]})}),l(ie,{direction:"horizontal",alignment:"start",children:l(ae,{children:" "})}),!r&&h(ie,{direction:"vertical",alignment:"center",children:[l(ie,{direction:"horizontal",alignment:"center",children:l(he,{href:ht,children:"Onboard account"})}),l(ie,{direction:"horizontal",alignment:"space-around",children:l(ae,{color:"muted",alignment:"center",size:"sm",children:"Add your AES Key to view your tokens and NFTs"})})]}),h(ie,{direction:"horizontal",alignment:"start",children:[l(ae,{children:" "}),l(ae,{children:" "})]}),h(ie,{direction:"vertical",children:[h(ie,{alignment:"space-around",direction:"horizontal",children:[n===dt.ERC20?l(se,{children:"Tokens"}):l(ce,{name:"view-tokens-erc20",children:"Tokens"}),n===dt.NFT?l(se,{children:"NFT"}):l(ce,{name:"view-tokens-nft",children:"NFT"})]}),l(de,{}),h(ie,{direction:"horizontal",alignment:"start",children:[l(ae,{children:" "}),l(ae,{children:" "})]}),h(ie,{alignment:"space-between",direction:"horizontal",children:[l(se,{size:"sm",children:n===dt.ERC20?"Tokens":"NFT"}),l(ce,{name:n===dt.ERC20?"import-erc20":"import-erc721",children:"+ Import"})]}),l(ie,{direction:"horizontal",alignment:"start",children:l(ae,{children:" "})}),t.filter(e=>e.type===n).length?t.filter(e=>e.type===n).map(e=>l(pt,{token:e},e.address)):l(ae,{children:n===dt.ERC20?"No tokens imported. Use the import button on the right...":"No NFTs imported. Use the import button on the right..."})]})]})}),l(ie,{direction:"horizontal",alignment:"start",children:h(ce,{name:"settings-button",children:[l(pe,{name:"setting",size:"md",color:"primary"}),"Settings"]})})]})},yt=ne("Container"),mt=ne("Form"),bt=ne("Field"),wt=ne("Input"),vt=ne("Footer"),At=({symbol:e,name:t,decimals:r,errorInForm:n=!1})=>h(yt,{children:[h(mt,{name:"erc20-form-to-fill",children:[l(se,{size:"lg",children:"Import new token"}),l(bt,{label:"Token address",error:n?"Token address is required and should be unique from already added":void 0,children:l(wt,{type:"text",name:"erc20-address",placeholder:"0x123..."})}),l(bt,{label:"Token symbol",error:n?"Token address is required":void 0,children:l(wt,{type:"text",name:"erc20-symbol",placeholder:"MYTKN",value:e??""})}),l(bt,{label:"Token name",error:n?"Token name is required":void 0,children:l(wt,{type:"text",name:"erc20-name",placeholder:"My token",value:t??""})}),l(bt,{label:"Token decimals",error:n?"Token decimals is required":void 0,children:l(wt,{type:"text",name:"erc20-decimals",placeholder:"6",value:r??""})})]}),h(vt,{children:[l(ce,{name:"token-cancel",children:"Cancel"}),l(ce,{name:"token-erc20-submit",children:"Submit"})]})]}),Et=({errorInForm:e=!1})=>h(yt,{children:[h(mt,{name:"erc721-form-to-fill",children:[l(se,{size:"lg",children:"Import new NFT"}),l(bt,{label:"Token Address",error:e?"Token address is required":void 0,children:l(wt,{name:"erc721-address",placeholder:"0x123..."})}),l(bt,{label:"Token ID",error:e?"Token ID is required and should be unique for the address above":void 0,children:l(wt,{name:"erc721-id",placeholder:"Token ID"})})]}),h(vt,{children:[l(ce,{name:"token-cancel",children:"Cancel"}),l(ce,{name:"erc721-submit",children:"Submit"})]})]}),Ct=()=>h(oe,{alignment:"center",children:[l(ie,{alignment:"center",direction:"vertical",children:l(ie,{alignment:"center",direction:"horizontal",children:l(se,{children:"Go to dapp to view your AES Key or delete it."})})}),l(ie,{alignment:"center",direction:"horizontal",children:l(he,{href:ht,children:"Go to dapp"})})]}),Bt=ne("Bold"),St=ne("Copyable"),kt=({token:e})=>e.type===dt.NFT?h(oe,{children:[h(ie,{direction:"vertical",alignment:"center",children:[l(se,{size:"lg",children:"My NFT"}),l(ft,{src:e.image||'<svg width="335" height="335" viewBox="0 0 335 335" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n<rect width="335" height="335" rx="8" fill="url(#pattern0_762_2288)"/>\n<defs>\n<pattern id="pattern0_762_2288" patternContentUnits="objectBoundingBox" width="1" height="1">\n<use xlink:href="#image0_762_2288" transform="scale(0.00416667)"/>\n</pattern>\n<image id="image0_762_2288" width="240" height="240" preserveAspectRatio="none" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPAAAADwCAIAAACxN37FAAAgAElEQVR4AeydBXgcyZn3e7pnJHspyVLuLrl8gYPkki932Q0t2BbLlmVZFlhmBtlisJjRsiyTzCQ2g2wxjZgZLWamEfNovuetmmmNpWlntZHO2f3Gz/9pt2p6qmuqf/3vt96u6SGIf9kiWf+sTixLTPW8rfJlNf6f1SV3wttq/L9sWV7n/3/Yfqbju+oHkmnHy2Vlpep5W/uVtn+5PY+3X26/MQHN+onGssRUz9sqX1bjWT/ReFvtZNqvtP1MPYPLmfqHYHphpcrJn26VqOXWL7ES8qdbl1vPcrdfqf2uVD3S9uOeZOoHgviphlTSHvj+9MBKfRLWv26VKOInWyRK4sZvKJRYCfGTLUxvWe7nYqxH2n50ZP/R+p/x+DK9wHSAl1u+UvWvVD3S9uOefFv9s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+UpaAVZqJfBFGy2+xy14Cr00JYHhBq132EnhtSgAjCtvsspfAa1MCdqDt7fm1KgEM57fZZS+B16YE7EDb2/NrVQIYUdRul70EXpsSwOjFYrvsJfDalABGL+mwKkIgtiqrkT8i0GoihEBs65Djxv+ipWPPP6qR0y4HW+nbgbbens3txFbBmSMc2Tlu/COHm//9vNL5vM5rvvAjO7byYyscs/XDkXTN/9qKbyvcfOCRnZOK/0VL58hlmv+1lU9b4eYDj+zYim8r/Mjh5n9PKv7nlY75Qo7s2LTQR+LZ/7WXwJeiBDBc2GFVRGmnVVmN/BGBVhMhSjttHXLc+F+0dOz5RzVy2uVgK33M1g/2cHsJfBlLAKOXddllL4HXpgQwRnm3Vdm6QquRPyLwuOkcN76tU39e6Xxe5z2pcviy5N9WPv9/pf+AIMYqmvcAAAAASUVORK5CYII="/>\n</defs>\n</svg>\n',alt:`NFT ${e.name}`})]}),l(ce,{name:"token-cancel",children:"See in..."})]}):h(ie,{direction:"vertical",alignment:"space-between",children:[h(ie,{direction:"vertical",alignment:"start",children:[h(ie,{direction:"horizontal",children:[l(ce,{name:"token-cancel",children:l(pe,{name:"arrow-left"})}),l(ae,{children:l(Bt,{children:e.symbol})})]}),l(ie,{direction:"horizontal",alignment:"start",children:l(ae,{children:" "})}),l(ie,{direction:"horizontal",alignment:"start",children:l(se,{size:"md",children:"Your balance"})}),h(ie,{direction:"horizontal",alignment:"space-between",children:[l(ie,{alignment:"space-between",direction:"horizontal",children:h(ie,{alignment:"center",direction:"horizontal",children:[l(ie,{alignment:"center",direction:"vertical",children:l(ft,{src:'<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n<rect width="36" height="36" rx="18" fill="white"/>\n<rect x="7.4483" y="7.44824" width="21.1034" height="21.1034" fill="url(#pattern0_762_3706)"/>\n<defs>\n<pattern id="pattern0_762_3706" patternContentUnits="objectBoundingBox" width="1" height="1">\n<use xlink:href="#image0_762_3706" transform="scale(0.025)"/>\n</pattern>\n<image id="image0_762_3706" width="40" height="40" preserveAspectRatio="none" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAK9klEQVRYCe2YCVAUVxrHR5PKbrkx2SQYYTiG6emZ4RYcxIiiBJMVVBhQRjxiNN4aReVQNApjvBXUgMYbERHDiCjXDMM5IMgpAyiOgHfwwIxHZXdrd7W7/7vdw+XKVsUcVaktu+pXr6e7X7/ffO97b94bHu/18ToC/78R6MdTKN74nX49ZX8ej8fyU49+PJ7qDZ6iEx5X/6fWfcXn2EY6D/fy2oVeRY1DuY/Klxo1Sf2mMl0mJoP+PJVJzrbkprmttlHlUN4G18qOkdztbnH04yLVq+4741TvS4I0o4QBmZ+945sUahHwjW/n7X69HvsFp2zjnRFyLX083u38o1uysh/gXvoD5aq968m9meu+npx830/9ziD/9Cm2UzJVhCKznZx8jiaDM2iHzzWwliddcVAo3/oFRt1Vu6MxSNX8tq365h6nUiPtojMyrsWPKfeip3A90xlBZcmbbK0P52UOFizUrBPNzr0pnpkN8dRMhpx6FqKQsww5NeOZdEYWLOWpBp638o/drfysk15R45+5OpIsuNPkVvUUZNEDikVc9BBO+UaMzHo8in3/u1E57w2Yd3qtxaLsB8IFakjn5zGO8zW03Rfq55LPs2nJzByGLcUzsiAMyWjh+cX/4Wd58dik7sw1/sHsAcL0S5ucCu79y7HoPiwzDM9JbTvDItLeg2PuPfjk/Og5YGG6/4ehOTfIyGJIVpQw0sVayn5RHm0/TwO7uXmQzlFzSObk0uLZubCbq2kh/dSvLNjPJAYucR3TLn/snGlodC+8D1FGGyVQGSiHrJtwyrqDoZoHkOV2wDm59dngKG0jEZ7/XBRWCDI0n5IszacdlhXB4csC2C3SQrJAC/G8PA5ynoZ2XFYGYl7+qwgq+/O8lW/yeCYx4vh1G/K4IdFRdZVyTDeAVBkoIs3A2Ke3wSPre3hmtMPz1C2I46oxYHEapKuK4BBRSDuEF9NOK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CWakEs1VDmC87Q4sh8WIVmUYOXpB9x3VzhOj3n6Y0QzRNM0TyiJ+U/gl/uXdq/4AEVfOEJxmnaK/wy77pxbf4csS7Zgf6pZvzPsozWs9Sw/CyXsZqZC6vPs2ExK4smFudTVvOzaPESDQRLsvHuotNFg8JzR7N1/bPvmU0ufnonSPcIgaWP6KAyIyUvN8K3pP2fPto2pZ+6zbQqNq3AX8yrrsZ/SskKmk8922E5PQv8aeeeWUw9R1lMz6DNp5+FYE4OLGZkPCcXqvPfn63yNa0RTXnjpb4/KKD68Z2JtR2YUNvxLKC2A/K6h02+FbdGsO0qleivBF5lA9+3Lic4OdNoGZIFc0UmY6nIBF9xhjFXpF83n3Z23+CZ54b3TJz/GWXsiOPxeEEGfDC+/smtCQ0PMLHhHhOov33wk4I6bg7jRiW3AO67zVe76q18kz8pL9YqMDubLz93WCA/FyGUn/YyC8gc2OtFvf5rMUVwbGH7B4rmf9yXNz58MqGuTcE9q1T2V6h69r+96v9Wp2xjXIO9c4g7V9Q8NA9p+PFIUPUPErb1XzdqL30fdoLs2iCxXcj9jdFb6uUaSvT37tyQs/n20gO/iwvs9NFrc/W7cHot8ToCv2IE/g1Q3qN3gTezEgAAAABJRU5ErkJggg=="/>\n</defs>\n</svg>\n',alt:"Token logo"})}),l(ie,{direction:"vertical",alignment:"center",children:l(ae,{children:e.name})})]})}),l(ie,{direction:"vertical",alignment:"end",children:h(ae,{children:[e.balance," ",e.symbol]})})]}),l(ie,{direction:"horizontal",alignment:"start",children:l(ae,{children:" "})}),l(ie,{direction:"horizontal",alignment:"start",children:l(se,{size:"md",children:"Token details"})}),h(ie,{direction:"horizontal",alignment:"space-between",children:[l(ae,{children:"Contract address"}),l(St,{value:e.address})]}),e.uri?h(ie,{direction:"horizontal",alignment:"space-between",children:[l(ae,{children:"Token URI"}),l(he,{href:e.uri,children:"Open"})]}):null,e.tokenId?h(ie,{direction:"horizontal",alignment:"space-between",children:[l(ae,{children:"Token ID"}),l(ae,{children:e.tokenId})]}):null,e.image?l(ie,{direction:"horizontal",alignment:"space-between",children:l(ft,{src:e.image,alt:`${e.name} image`})}):null,e.decimals?h(ie,{direction:"horizontal",alignment:"space-between",children:[l(ae,{children:"Token decimals"}),l(ae,{children:e.decimals})]}):null]}),l(ce,{variant:"destructive",name:`confirm-hide-token-${e.address}`,children:"Hide token"})]}),Tt=()=>h(ie,{direction:"vertical",alignment:"center",children:[l(ie,{direction:"horizontal",alignment:"center",children:l(se,{size:"lg",children:"⚠️"})}),l(ie,{direction:"horizontal",alignment:"center",children:l(se,{size:"sm",children:"Wrong chain"})}),l(ie,{direction:"horizontal",alignment:"center",children:l(ae,{color:"warning",alignment:"center",children:"Please switch to COTI Testnet chain to view your tokens."})})]});var It=r(1048).hp;function Pt(e,t){return r=e,Boolean("string"==typeof r?.prototype?.constructor?.name)?new e({message:t}):e({message:t});var r}class Nt extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}function xt(e,t="Assertion failed.",r=Nt){if(!e){if(t instanceof Error)throw t;throw Pt(r,t)}}function Ot(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}const Rt=32,Ut=4294967295,Lt="bip32:44'",Dt=/^\d+$/u,Ft=/^bip32:\d+'?$/u,Mt=/^slip10:\d+'?$/u,jt=/^cip3:\d+'?$/u,Kt=/^bip39:([a-z]+){1}( [a-z]+){11,23}$/u,Vt=2147483648;function Ht(e,t){return _t(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function _t(e,t,r){return new w({...e,*refiner(n,i){yield*e.refiner(n,i);const s=m(r(n,i),i,e,n);for(const e of s)yield{...e,refinement:t}}})}const Gt=BigInt(2**32-1),zt=BigInt(32);function qt(e,t=!1){return t?{h:Number(e&Gt),l:Number(e>>zt&Gt)}:{h:0|Number(e>>zt&Gt),l:0|Number(e&Gt)}}function Qt(e,t=!1){const r=e.length;let n=new Uint32Array(r),i=new Uint32Array(r);for(let s=0;s<r;s++){const{h:r,l:a}=qt(e[s],t);[n[s],i[s]]=[r,a]}return[n,i]}const Wt=(e,t,r)=>e>>>r,Jt=(e,t,r)=>e<<32-r|t>>>r,Yt=(e,t,r)=>e>>>r|t<<32-r,Zt=(e,t,r)=>e<<32-r|t>>>r,Xt=(e,t,r)=>e<<64-r|t>>>r-32,$t=(e,t,r)=>e>>>r-32|t<<64-r,er=(e,t,r)=>e<<r|t>>>32-r,tr=(e,t,r)=>t<<r|e>>>32-r,rr=(e,t,r)=>t<<r-32|e>>>64-r,nr=(e,t,r)=>e<<r-32|t>>>64-r;function ir(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:0|i}}const sr=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),ar=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,or=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),cr=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0,ur=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0),lr=(e,t,r,n,i,s)=>t+r+n+i+s+(e/2**32|0)|0,hr="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function dr(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function fr(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function pr(e,...t){if(!dr(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function gr(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.createHasher");fr(e.outputLen),fr(e.blockLen)}function yr(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function mr(e,t){pr(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function br(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function wr(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function vr(e,t){return e<<32-t|e>>>t}function Ar(e,t){return e<<t|e>>>32-t>>>0}const Er=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];function Cr(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const Br=Er?e=>e:function(e){for(let t=0;t<e.length;t++)e[t]=Cr(e[t]);return e},Sr="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,kr=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Tr(e){if(pr(e),Sr)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=kr[e[r]];return t}const Ir=48,Pr=57,Nr=65,xr=70,Or=97,Rr=102;function Ur(e){return e>=Ir&&e<=Pr?e-Ir:e>=Nr&&e<=xr?e-(Nr-10):e>=Or&&e<=Rr?e-(Or-10):void 0}function Lr(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);if(Sr)return Uint8Array.fromHex(e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){const r=Ur(e.charCodeAt(i)),s=Ur(e.charCodeAt(i+1));if(void 0===r||void 0===s){const t=e[i]+e[i+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+i)}n[t]=16*r+s}return n}const Dr=async()=>{};async function Fr(e,t,r){let n=Date.now();for(let i=0;i<e;i++){r(i);const e=Date.now()-n;e>=0&&e<t||(await Dr(),n+=e)}}function Mr(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}function jr(e){return"string"==typeof e&&(e=Mr(e)),pr(e),e}function Kr(e){return"string"==typeof e&&(e=Mr(e)),pr(e),e}function Vr(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];pr(n),t+=n.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r}class Hr{}function _r(e){const t=t=>e().update(jr(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Gr(e=32){if(hr&&"function"==typeof hr.getRandomValues)return hr.getRandomValues(new Uint8Array(e));if(hr&&"function"==typeof hr.randomBytes)return Uint8Array.from(hr.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}const zr=BigInt(0),qr=BigInt(1),Qr=BigInt(2),Wr=BigInt(7),Jr=BigInt(256),Yr=BigInt(113),Zr=[],Xr=[],$r=[];for(let e=0,t=qr,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],Zr.push(2*(5*n+r)),Xr.push((e+1)*(e+2)/2%64);let i=zr;for(let e=0;e<7;e++)t=(t<<qr^(t>>Wr)*Yr)%Jr,t&Qr&&(i^=qr<<(qr<<BigInt(e))-qr);$r.push(i)}const en=Qt($r,!0),tn=en[0],rn=en[1],nn=(e,t,r)=>r>32?rr(e,t,r):er(e,t,r),sn=(e,t,r)=>r>32?nr(e,t,r):tr(e,t,r);class an extends Hr{constructor(e,t,r,n=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=i,fr(r),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");var s;this.state=new Uint8Array(200),this.state32=(s=this.state,new Uint32Array(s.buffer,s.byteOffset,Math.floor(s.byteLength/4)))}clone(){return this._cloneInto()}keccak(){Br(this.state32),function(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,i=(t+2)%10,s=r[i],a=r[i+1],o=nn(s,a,1)^r[n],c=sn(s,a,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=o,e[t+r+1]^=c}let t=e[2],i=e[3];for(let r=0;r<24;r++){const n=Xr[r],s=nn(t,i,n),a=sn(t,i,n),o=Zr[r];t=e[o],i=e[o+1],e[o]=s,e[o+1]=a}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=tn[n],e[1]^=rn[n]}br(r)}(this.state32,this.rounds),Br(this.state32),this.posOut=0,this.pos=0}update(e){yr(this),pr(e=jr(e));const{blockLen:t,state:r}=this,n=e.length;for(let i=0;i<n;){const s=Math.min(t-this.pos,n-i);for(let t=0;t<s;t++)r[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,128&t&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){yr(this,!1),pr(e),this.finish();const t=this.state,{blockLen:r}=this;for(let n=0,i=e.length;n<i;){this.posOut>=r&&this.keccak();const s=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+s),n),this.posOut+=s,n+=s}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return fr(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(mr(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,br(this.state)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:s}=this;return e||(e=new an(t,r,n,s,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=s,e.destroyed=this.destroyed,e}}const on=(e,t,r)=>_r(()=>new an(t,e,r)),cn=on(1,136,32);var un=r(9901);const ln=/^(?:0x)?[0-9a-f]+$/iu,hn=/^0x[0-9a-f]+$/iu,dn=/^0x[0-9a-f]{40}$/u,fn=/^0x[0-9a-fA-F]{40}$/u,pn=(Ht(N(),ln),Ht(N(),hn),Ht(N(),dn),Ht(N(),fn),e=>"string"==typeof e);function gn(e){return pn(e)&&fn.test(e)}function yn(e){xt(function(e){return pn(e)&&ln.test(e)}(e),"Value must be a hexadecimal string.")}const mn=un(function(e){xt(gn(e),"Invalid hex address.");const t=vn(e).toLowerCase(),r=cn(t),{length:n}=t,i=new Array(n);for(let e=0;e<n;e++){const n=1&e,s=r[e>>1],a=0===n?s>>4:15&s;i[e]=a>=8?t[e].toUpperCase():t[e]}return`0x${i.join("")}`});const bn=un(function(e){return!!gn(e)&&mn(e)===e});un(function(e){return pn(t=e)&&dn.test(t)||bn(e);var t});function wn(e){return e.startsWith("0x")?e:e.startsWith("0X")?`0x${e.substring(2)}`:`0x${e}`}function vn(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}var An=r(1048).hp;const En=48,Cn=58,Bn=87;const Sn=function(){const e=[];return()=>{if(0===e.length)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}();function kn(e){return e instanceof Uint8Array}function Tn(e){xt(kn(e),"Value must be a Uint8Array.")}function In(e){if(Tn(e),0===e.length)return"0x";const t=Sn(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return wn(r.join(""))}function Pn(e){Tn(e);const t=In(e);return BigInt(t)}function Nn(e){if("0x"===e?.toLowerCase?.())return new Uint8Array;yn(e);const t=vn(e).toLowerCase(),r=t.length%2==0?t:`0${t}`,n=new Uint8Array(r.length/2);for(let e=0;e<n.length;e++){const t=r.charCodeAt(2*e),i=r.charCodeAt(2*e+1),s=t-(t<Cn?En:Bn),a=i-(i<Cn?En:Bn);n[e]=16*s+a}return n}function xn(e){return xt("string"==typeof e,"Value must be a string."),(new TextEncoder).encode(e)}function On(e){if("bigint"==typeof e)return function(e){return xt("bigint"==typeof e,"Value must be a bigint."),xt(e>=BigInt(0),"Value must be a non-negative bigint."),Nn(e.toString(16))}(e);if("number"==typeof e)return function(e){return xt("number"==typeof e,"Value must be a number."),xt(e>=0,"Value must be a non-negative number."),xt(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead."),Nn(e.toString(16))}(e);if("string"==typeof e)return e.startsWith("0x")?Nn(e):xn(e);if(kn(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}function Rn(e){const t=new Array(e.length);let r=0;for(let n=0;n<e.length;n++){const i=On(e[n]);t[n]=i,r+=i.length}const n=new Uint8Array(r);for(let e=0,r=0;e<t.length;e++)n.set(t[e],r),r+=t[e].length;return n}function Un(e){if(void 0!==An&&e instanceof An){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Ln(e,t,r){return e&t^~e&r}function Dn(e,t,r){return e&t^e&r^t&r}class Fn extends Hr{constructor(e,t,r,n){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=wr(this.buffer)}update(e){yr(this),pr(e=jr(e));const{view:t,buffer:r,blockLen:n}=this,i=e.length;for(let s=0;s<i;){const a=Math.min(n-this.pos,i-s);if(a===n){const t=wr(e);for(;n<=i-s;s+=n)this.process(t,s);continue}r.set(e.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){yr(this),mr(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:i}=this;let{pos:s}=this;t[s++]=128,br(this.buffer.subarray(s)),this.padOffset>n-s&&(this.process(r,0),s=0);for(let e=s;e<n;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),s=BigInt(4294967295),a=Number(r>>i&s),o=Number(r&s),c=n?4:0,u=n?0:4;e.setUint32(t+c,a,n),e.setUint32(t+u,o,n)}(r,n-8,BigInt(8*this.length),i),this.process(r,0);const a=wr(e),o=this.outputLen;if(o%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=o/4,u=this.get();if(c>u.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)a.setUint32(4*e,u[e],i)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:s,pos:a}=this;return e.destroyed=s,e.finished=i,e.length=n,e.pos=a,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}const Mn=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),jn=(Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]),Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209])),Kn=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Vn=new Uint32Array(64);class Hn extends Fn{constructor(e=32){super(64,e,8,!1),this.A=0|Mn[0],this.B=0|Mn[1],this.C=0|Mn[2],this.D=0|Mn[3],this.E=0|Mn[4],this.F=0|Mn[5],this.G=0|Mn[6],this.H=0|Mn[7]}get(){const{A:e,B:t,C:r,D:n,E:i,F:s,G:a,H:o}=this;return[e,t,r,n,i,s,a,o]}set(e,t,r,n,i,s,a,o){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|s,this.G=0|a,this.H=0|o}process(e,t){for(let r=0;r<16;r++,t+=4)Vn[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=Vn[e-15],r=Vn[e-2],n=vr(t,7)^vr(t,18)^t>>>3,i=vr(r,17)^vr(r,19)^r>>>10;Vn[e]=i+Vn[e-7]+n+Vn[e-16]|0}let{A:r,B:n,C:i,D:s,E:a,F:o,G:c,H:u}=this;for(let e=0;e<64;e++){const t=u+(vr(a,6)^vr(a,11)^vr(a,25))+Ln(a,o,c)+Kn[e]+Vn[e]|0,l=(vr(r,2)^vr(r,13)^vr(r,22))+Dn(r,n,i)|0;u=c,c=o,o=a,a=s+t|0,s=i,i=n,n=r,r=t+l|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,s=s+this.D|0,a=a+this.E|0,o=o+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,n,i,s,a,o,c,u)}roundClean(){br(Vn)}destroy(){this.set(0,0,0,0,0,0,0,0),br(this.buffer)}}const _n=Qt(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),Gn=_n[0],zn=_n[1],qn=new Uint32Array(80),Qn=new Uint32Array(80);class Wn extends Fn{constructor(e=64){super(128,e,16,!1),this.Ah=0|jn[0],this.Al=0|jn[1],this.Bh=0|jn[2],this.Bl=0|jn[3],this.Ch=0|jn[4],this.Cl=0|jn[5],this.Dh=0|jn[6],this.Dl=0|jn[7],this.Eh=0|jn[8],this.El=0|jn[9],this.Fh=0|jn[10],this.Fl=0|jn[11],this.Gh=0|jn[12],this.Gl=0|jn[13],this.Hh=0|jn[14],this.Hl=0|jn[15]}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:s,Dh:a,Dl:o,Eh:c,El:u,Fh:l,Fl:h,Gh:d,Gl:f,Hh:p,Hl:g}=this;return[e,t,r,n,i,s,a,o,c,u,l,h,d,f,p,g]}set(e,t,r,n,i,s,a,o,c,u,l,h,d,f,p,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|s,this.Dh=0|a,this.Dl=0|o,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|h,this.Gh=0|d,this.Gl=0|f,this.Hh=0|p,this.Hl=0|g}process(e,t){for(let r=0;r<16;r++,t+=4)qn[r]=e.getUint32(t),Qn[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|qn[e-15],r=0|Qn[e-15],n=Yt(t,r,1)^Yt(t,r,8)^Wt(t,0,7),i=Zt(t,r,1)^Zt(t,r,8)^Jt(t,r,7),s=0|qn[e-2],a=0|Qn[e-2],o=Yt(s,a,19)^Xt(s,a,61)^Wt(s,0,6),c=Zt(s,a,19)^$t(s,a,61)^Jt(s,a,6),u=or(i,c,Qn[e-7],Qn[e-16]),l=cr(u,n,o,qn[e-7],qn[e-16]);qn[e]=0|l,Qn[e]=0|u}let{Ah:r,Al:n,Bh:i,Bl:s,Ch:a,Cl:o,Dh:c,Dl:u,Eh:l,El:h,Fh:d,Fl:f,Gh:p,Gl:g,Hh:y,Hl:m}=this;for(let e=0;e<80;e++){const t=Yt(l,h,14)^Yt(l,h,18)^Xt(l,h,41),b=Zt(l,h,14)^Zt(l,h,18)^$t(l,h,41),w=l&d^~l&p,v=ur(m,b,h&f^~h&g,zn[e],Qn[e]),A=lr(v,y,t,w,Gn[e],qn[e]),E=0|v,C=Yt(r,n,28)^Xt(r,n,34)^Xt(r,n,39),B=Zt(r,n,28)^$t(r,n,34)^$t(r,n,39),S=r&i^r&a^i&a,k=n&s^n&o^s&o;y=0|p,m=0|g,p=0|d,g=0|f,d=0|l,f=0|h,({h:l,l:h}=ir(0|c,0|u,0|A,0|E)),c=0|a,u=0|o,a=0|i,o=0|s,i=0|r,s=0|n;const T=sr(E,B,k);r=ar(T,A,C,S),n=0|T}({h:r,l:n}=ir(0|this.Ah,0|this.Al,0|r,0|n)),({h:i,l:s}=ir(0|this.Bh,0|this.Bl,0|i,0|s)),({h:a,l:o}=ir(0|this.Ch,0|this.Cl,0|a,0|o)),({h:c,l:u}=ir(0|this.Dh,0|this.Dl,0|c,0|u)),({h:l,l:h}=ir(0|this.Eh,0|this.El,0|l,0|h)),({h:d,l:f}=ir(0|this.Fh,0|this.Fl,0|d,0|f)),({h:p,l:g}=ir(0|this.Gh,0|this.Gl,0|p,0|g)),({h:y,l:m}=ir(0|this.Hh,0|this.Hl,0|y,0|m)),this.set(r,n,i,s,a,o,c,u,l,h,d,f,p,g,y,m)}roundClean(){br(qn,Qn)}destroy(){br(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);const Jn=_r(()=>new Hn),Yn=_r(()=>new Wn);class Zn extends Hr{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,gr(e);const r=jr(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const n=this.blockLen,i=new Uint8Array(n);i.set(r.length>n?e.create().update(r).digest():r);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),br(i)}update(e){return yr(this),this.iHash.update(e),this}digestInto(e){yr(this),pr(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:s,outputLen:a}=this;return e.finished=n,e.destroyed=i,e.blockLen=s,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Xn=(e,t,r)=>new Zn(e,t).update(r).digest();Xn.create=(e,t)=>new Zn(e,t);const $n=BigInt(0),ei=BigInt(1);function ti(e,t){if("boolean"!=typeof t)throw new Error(e+" boolean expected, got "+t)}function ri(e){const t=e.toString(16);return 1&t.length?"0"+t:t}function ni(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return""===e?$n:BigInt("0x"+e)}function ii(e){return ni(Tr(e))}function si(e){return pr(e),ni(Tr(Uint8Array.from(e).reverse()))}function ai(e,t){return Lr(e.toString(16).padStart(2*t,"0"))}function oi(e,t){return ai(e,t).reverse()}function ci(e,t,r){let n;if("string"==typeof t)try{n=Lr(t)}catch(t){throw new Error(e+" must be hex string or Uint8Array, cause: "+t)}else{if(!dr(t))throw new Error(e+" must be hex string or Uint8Array");n=Uint8Array.from(t)}const i=n.length;if("number"==typeof r&&i!==r)throw new Error(e+" of length "+r+" expected, got "+i);return n}const ui=e=>"bigint"==typeof e&&$n<=e;function li(e,t,r,n){if(!function(e,t,r){return ui(e)&&ui(t)&&ui(r)&&t<=e&&e<r}(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}const hi=e=>(ei<<BigInt(e))-ei;function di(e,t,r={}){if(!e||"object"!=typeof e)throw new Error("expected valid options object");function n(t,r,n){const i=e[t];if(n&&void 0===i)return;const s=typeof i;if(s!==r||null===i)throw new Error(`param "${t}" is invalid: expected ${r}, got ${s}`)}Object.entries(t).forEach(([e,t])=>n(e,t,!1)),Object.entries(r).forEach(([e,t])=>n(e,t,!0))}function fi(e){const t=new WeakMap;return(r,...n)=>{const i=t.get(r);if(void 0!==i)return i;const s=e(r,...n);return t.set(r,s),s}}const pi=BigInt(0),gi=BigInt(1),yi=BigInt(2),mi=BigInt(3),bi=BigInt(4),wi=BigInt(5),vi=BigInt(8);function Ai(e,t){const r=e%t;return r>=pi?r:t+r}function Ei(e,t,r){let n=e;for(;t-- >pi;)n*=n,n%=r;return n}function Ci(e,t){if(e===pi)throw new Error("invert: expected non-zero number");if(t<=pi)throw new Error("invert: expected positive modulus, got "+t);let r=Ai(e,t),n=t,i=pi,s=gi,a=gi,o=pi;for(;r!==pi;){const e=n/r,t=n%r,c=i-a*e,u=s-o*e;n=r,r=t,i=a,s=o,a=c,o=u}if(n!==gi)throw new Error("invert: does not exist");return Ai(i,t)}function Bi(e,t){const r=(e.ORDER+gi)/bi,n=e.pow(t,r);if(!e.eql(e.sqr(n),t))throw new Error("Cannot find square root");return n}function Si(e,t){const r=(e.ORDER-wi)/vi,n=e.mul(t,yi),i=e.pow(n,r),s=e.mul(t,i),a=e.mul(e.mul(s,yi),i),o=e.mul(s,e.sub(a,e.ONE));if(!e.eql(e.sqr(o),t))throw new Error("Cannot find square root");return o}function ki(e){return e%bi===mi?Bi:e%vi===wi?Si:function(e){if(e<BigInt(3))throw new Error("sqrt is not defined for small field");let t=e-gi,r=0;for(;t%yi===pi;)t/=yi,r++;let n=yi;const i=Oi(e);for(;1===Ni(i,n);)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(1===r)return Bi;let s=i.pow(n,t);const a=(t+gi)/yi;return function(e,n){if(e.is0(n))return n;if(1!==Ni(e,n))throw new Error("Cannot find square root");let i=r,o=e.mul(e.ONE,s),c=e.pow(n,t),u=e.pow(n,a);for(;!e.eql(c,e.ONE);){if(e.is0(c))return e.ZERO;let t=1,r=e.sqr(c);for(;!e.eql(r,e.ONE);)if(t++,r=e.sqr(r),t===i)throw new Error("Cannot find square root");const n=gi<<BigInt(i-t-1),s=e.pow(o,n);i=t,o=e.sqr(s),c=e.mul(c,o),u=e.mul(u,s)}return u}}(e)}const Ti=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Ii(e,t,r){if(r<pi)throw new Error("invalid exponent, negatives unsupported");if(r===pi)return e.ONE;if(r===gi)return t;let n=e.ONE,i=t;for(;r>pi;)r&gi&&(n=e.mul(n,i)),i=e.sqr(i),r>>=gi;return n}function Pi(e,t,r=!1){const n=new Array(t.length).fill(r?e.ZERO:void 0),i=t.reduce((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r)),e.ONE),s=e.inv(i);return t.reduceRight((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r)),s),n}function Ni(e,t){const r=(e.ORDER-gi)/yi,n=e.pow(t,r),i=e.eql(n,e.ONE),s=e.eql(n,e.ZERO),a=e.eql(n,e.neg(e.ONE));if(!i&&!s&&!a)throw new Error("invalid Legendre symbol result");return i?1:s?0:-1}function xi(e,t){void 0!==t&&fr(t);const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function Oi(e,t,r=!1,n={}){if(e<=pi)throw new Error("invalid field: expected ORDER > 0, got "+e);let i,s;if("object"==typeof t&&null!=t){if(n.sqrt||r)throw new Error("cannot specify opts in two arguments");const e=t;e.BITS&&(i=e.BITS),e.sqrt&&(s=e.sqrt),"boolean"==typeof e.isLE&&(r=e.isLE)}else"number"==typeof t&&(i=t),n.sqrt&&(s=n.sqrt);const{nBitLength:a,nByteLength:o}=xi(e,i);if(o>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let c;const u=Object.freeze({ORDER:e,isLE:r,BITS:a,BYTES:o,MASK:hi(a),ZERO:pi,ONE:gi,create:t=>Ai(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("invalid field element: expected bigint, got "+typeof t);return pi<=t&&t<e},is0:e=>e===pi,isValidNot0:e=>!u.is0(e)&&u.isValid(e),isOdd:e=>(e&gi)===gi,neg:t=>Ai(-t,e),eql:(e,t)=>e===t,sqr:t=>Ai(t*t,e),add:(t,r)=>Ai(t+r,e),sub:(t,r)=>Ai(t-r,e),mul:(t,r)=>Ai(t*r,e),pow:(e,t)=>Ii(u,e,t),div:(t,r)=>Ai(t*Ci(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>Ci(t,e),sqrt:s||(t=>(c||(c=ki(e)),c(u,t))),toBytes:e=>r?oi(e,o):ai(e,o),fromBytes:e=>{if(e.length!==o)throw new Error("Field.fromBytes: expected "+o+" bytes, got "+e.length);return r?si(e):ii(e)},invertBatch:e=>Pi(u,e),cmov:(e,t,r)=>r?t:e});return Object.freeze(u)}function Ri(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function Ui(e){const t=Ri(e);return t+Math.ceil(t/2)}const Li=BigInt(0),Di=BigInt(1);function Fi(e,t){const r=t.negate();return e?r:t}function Mi(e,t,r){const n="pz"===t?e=>e.pz:e=>e.ez,i=Pi(e.Fp,r.map(n));return r.map((e,t)=>e.toAffine(i[t])).map(e.fromAffine)}function ji(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function Ki(e,t){ji(e,t);const r=2**e;return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1),mask:hi(e),maxNumber:r,shiftBy:BigInt(e)}}function Vi(e,t,r){const{windowSize:n,mask:i,maxNumber:s,shiftBy:a}=r;let o=Number(e&i),c=e>>a;o>n&&(o-=s,c+=Di);const u=t*n;return{nextN:c,offset:u+Math.abs(o)-1,isZero:0===o,isNeg:o<0,isNegF:t%2!=0,offsetF:u}}function Hi(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((e,r)=>{if(!(e instanceof t))throw new Error("invalid point at index "+r)})}function _i(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((e,r)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+r)})}const Gi=new WeakMap,zi=new WeakMap;function qi(e){return zi.get(e)||1}function Qi(e){if(e!==Li)throw new Error("invalid wNAF")}function Wi(e,t){return{constTimeNegate:Fi,hasPrecomputes:e=>1!==qi(e),unsafeLadder(t,r,n=e.ZERO){let i=t;for(;r>Li;)r&Di&&(n=n.add(i)),i=i.double(),r>>=Di;return n},precomputeWindow(e,r){const{windows:n,windowSize:i}=Ki(r,t),s=[];let a=e,o=a;for(let e=0;e<n;e++){o=a,s.push(o);for(let e=1;e<i;e++)o=o.add(a),s.push(o);a=o.double()}return s},wNAF(r,n,i){let s=e.ZERO,a=e.BASE;const o=Ki(r,t);for(let e=0;e<o.windows;e++){const{nextN:t,offset:r,isZero:c,isNeg:u,isNegF:l,offsetF:h}=Vi(i,e,o);i=t,c?a=a.add(Fi(l,n[h])):s=s.add(Fi(u,n[r]))}return Qi(i),{p:s,f:a}},wNAFUnsafe(r,n,i,s=e.ZERO){const a=Ki(r,t);for(let e=0;e<a.windows&&i!==Li;e++){const{nextN:t,offset:r,isZero:o,isNeg:c}=Vi(i,e,a);if(i=t,!o){const e=n[r];s=s.add(c?e.negate():e)}}return Qi(i),s},getPrecomputes(e,t,r){let n=Gi.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&("function"==typeof r&&(n=r(n)),Gi.set(t,n))),n},wNAFCached(e,t,r){const n=qi(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)},wNAFCachedUnsafe(e,t,r,n){const i=qi(e);return 1===i?this.unsafeLadder(e,t,n):this.wNAFUnsafe(i,this.getPrecomputes(i,e,r),t,n)},setWindowSize(e,r){ji(r,t),zi.set(e,r),Gi.delete(e)}}}function Ji(e,t,r,n){Hi(r,e),_i(n,t);const i=r.length,s=n.length;if(i!==s)throw new Error("arrays of points and scalars must have equal length");const a=e.ZERO,o=function(e){let t;for(t=0;e>$n;e>>=ei,t+=1);return t}(BigInt(i));let c=1;o>12?c=o-3:o>4?c=o-2:o>0&&(c=2);const u=hi(c),l=new Array(Number(u)+1).fill(a);let h=a;for(let e=Math.floor((t.BITS-1)/c)*c;e>=0;e-=c){l.fill(a);for(let t=0;t<s;t++){const i=n[t],s=Number(i>>BigInt(e)&u);l[s]=l[s].add(r[t])}let t=a;for(let e=l.length-1,r=a;e>0;e--)r=r.add(l[e]),t=t.add(r);if(h=h.add(t),0!==e)for(let e=0;e<c;e++)h=h.double()}return h}function Yi(e,t){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return function(e){const t=Ti.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"});di(e,t)}(t),t}return Oi(e)}function Zi(e,t,r={}){if(!t||"object"!=typeof t)throw new Error(`expected valid ${e} CURVE object`);for(const e of["p","n","h"]){const r=t[e];if(!("bigint"==typeof r&&r>Li))throw new Error(`CURVE.${e} must be positive bigint`)}const n=Yi(t.p,r.Fp),i=Yi(t.n,r.Fn),s=["Gx","Gy","a","weierstrass"===e?"b":"d"];for(const e of s)if(!n.isValid(t[e]))throw new Error(`CURVE.${e} must be valid field element of CURVE.Fp`);return{Fp:n,Fn:i}}function Xi(e){void 0!==e.lowS&&ti("lowS",e.lowS),void 0!==e.prehash&&ti("prehash",e.prehash)}class $i extends Error{constructor(e=""){super(e)}}const es={Err:$i,_tlv:{encode:(e,t)=>{const{Err:r}=es;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&t.length)throw new r("tlv.encode: unpadded data");const n=t.length/2,i=ri(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");const s=n>127?ri(i.length/2|128):"";return ri(e)+s+i+t},decode(e,t){const{Err:r}=es;let n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");const i=t[n++];let s=0;if(!!(128&i)){const e=127&i;if(!e)throw new r("tlv.decode(long): indefinite length not supported");if(e>4)throw new r("tlv.decode(long): byte length is too big");const a=t.subarray(n,n+e);if(a.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===a[0])throw new r("tlv.decode(long): zero leftmost byte");for(const e of a)s=s<<8|e;if(n+=e,s<128)throw new r("tlv.decode(long): not minimal encoding")}else s=i;const a=t.subarray(n,n+s);if(a.length!==s)throw new r("tlv.decode: wrong value length");return{v:a,l:t.subarray(n+s)}}},_int:{encode(e){const{Err:t}=es;if(e<ts)throw new t("integer: negative integers are not allowed");let r=ri(e);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){const{Err:t}=es;if(128&e[0])throw new t("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return ii(e)}},toSig(e){const{Err:t,_int:r,_tlv:n}=es,i=ci("signature",e),{v:s,l:a}=n.decode(48,i);if(a.length)throw new t("invalid signature: left bytes after parsing");const{v:o,l:c}=n.decode(2,s),{v:u,l}=n.decode(2,c);if(l.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(o),s:r.decode(u)}},hexFromSig(e){const{_tlv:t,_int:r}=es,n=t.encode(2,r.encode(e.r))+t.encode(2,r.encode(e.s));return t.encode(48,n)}},ts=BigInt(0),rs=BigInt(1),ns=BigInt(2),is=BigInt(3),ss=BigInt(4);function as(e,t,r){return function(n){const i=e.sqr(n),s=e.mul(i,n);return e.add(e.add(s,e.mul(n,t)),r)}}function os(e,t,r){const{BYTES:n}=e;return function(i){let s;if("bigint"==typeof i)s=i;else{let r=ci("private key",i);if(t){if(!t.includes(2*r.length))throw new Error("invalid private key");const e=new Uint8Array(n);e.set(r,e.length-r.length),r=e}try{s=e.fromBytes(r)}catch(e){throw new Error(`invalid private key: expected ui8a of size ${n}, got ${typeof i}`)}}if(r&&(s=e.create(s)),!e.isValidNot0(s))throw new Error("invalid private key: out of range [1..N-1]");return s}}function cs(e,t={}){const{Fp:r,Fn:n}=Zi("weierstrass",e,t),{h:i,n:s}=e;di(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:a}=t;if(a&&(!r.is0(e.a)||"bigint"!=typeof a.beta||"function"!=typeof a.splitScalar))throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function');function o(){if(!r.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}const c=t.toBytes||function(e,t,n){const{x:i,y:s}=t.toAffine(),a=r.toBytes(i);if(ti("isCompressed",n),n){o();return Vr(us(!r.isOdd(s)),a)}return Vr(Uint8Array.of(4),a,r.toBytes(s))},u=t.fromBytes||function(e){pr(e);const t=r.BYTES,n=t+1,i=2*t+1,s=e.length,a=e[0],c=e.subarray(1);if(s!==n||2!==a&&3!==a){if(s===i&&4===a){const e=r.fromBytes(c.subarray(0*t,1*t)),n=r.fromBytes(c.subarray(1*t,2*t));if(!h(e,n))throw new Error("bad point: is not on curve");return{x:e,y:n}}throw new Error(`bad point: got length ${s}, expected compressed=${n} or uncompressed=${i}`)}{const e=r.fromBytes(c);if(!r.isValid(e))throw new Error("bad point: is not on curve, wrong x");const t=l(e);let n;try{n=r.sqrt(t)}catch(e){const t=e instanceof Error?": "+e.message:"";throw new Error("bad point: is not on curve, sqrt error"+t)}o();return!(1&~a)!==r.isOdd(n)&&(n=r.neg(n)),{x:e,y:n}}},l=as(r,e.a,e.b);function h(e,t){const n=r.sqr(t),i=l(e);return r.eql(n,i)}if(!h(e.Gx,e.Gy))throw new Error("bad curve params: generator point");const d=r.mul(r.pow(e.a,is),ss),f=r.mul(r.sqr(e.b),BigInt(27));if(r.is0(r.add(d,f)))throw new Error("bad curve params: a or b");function p(e,t,n=!1){if(!r.isValid(t)||n&&r.is0(t))throw new Error(`bad point coordinate ${e}`);return t}function g(e){if(!(e instanceof w))throw new Error("ProjectivePoint expected")}const y=fi((e,t)=>{const{px:n,py:i,pz:s}=e;if(r.eql(s,r.ONE))return{x:n,y:i};const a=e.is0();null==t&&(t=a?r.ONE:r.inv(s));const o=r.mul(n,t),c=r.mul(i,t),u=r.mul(s,t);if(a)return{x:r.ZERO,y:r.ZERO};if(!r.eql(u,r.ONE))throw new Error("invZ was invalid");return{x:o,y:c}}),m=fi(e=>{if(e.is0()){if(t.allowInfinityPoint&&!r.is0(e.py))return;throw new Error("bad point: ZERO")}const{x:n,y:i}=e.toAffine();if(!r.isValid(n)||!r.isValid(i))throw new Error("bad point: x or y not field elements");if(!h(n,i))throw new Error("bad point: equation left != right");if(!e.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function b(e,t,n,i,s){return n=new w(r.mul(n.px,e),n.py,n.pz),t=Fi(i,t),n=Fi(s,n),t.add(n)}class w{constructor(e,t,r){this.px=p("x",e),this.py=p("y",t,!0),this.pz=p("z",r),Object.freeze(this)}static fromAffine(e){const{x:t,y:n}=e||{};if(!e||!r.isValid(t)||!r.isValid(n))throw new Error("invalid affine point");if(e instanceof w)throw new Error("projective point not allowed");return r.is0(t)&&r.is0(n)?w.ZERO:new w(t,n,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){return Mi(w,"pz",e)}static fromBytes(e){return pr(e),w.fromHex(e)}static fromHex(e){const t=w.fromAffine(u(ci("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){const r=os(n,t.allowedPrivateKeyLengths,t.wrapPrivateKey);return w.BASE.multiply(r(e))}static msm(e,t){return Ji(w,n,e,t)}precompute(e=8,t=!0){return A.setWindowSize(this,e),t||this.multiply(is),this}_setWindowSize(e){this.precompute(e)}assertValidity(){m(this)}hasEvenY(){const{y:e}=this.toAffine();if(!r.isOdd)throw new Error("Field doesn't support isOdd");return!r.isOdd(e)}equals(e){g(e);const{px:t,py:n,pz:i}=this,{px:s,py:a,pz:o}=e,c=r.eql(r.mul(t,o),r.mul(s,i)),u=r.eql(r.mul(n,o),r.mul(a,i));return c&&u}negate(){return new w(this.px,r.neg(this.py),this.pz)}double(){const{a:t,b:n}=e,i=r.mul(n,is),{px:s,py:a,pz:o}=this;let c=r.ZERO,u=r.ZERO,l=r.ZERO,h=r.mul(s,s),d=r.mul(a,a),f=r.mul(o,o),p=r.mul(s,a);return p=r.add(p,p),l=r.mul(s,o),l=r.add(l,l),c=r.mul(t,l),u=r.mul(i,f),u=r.add(c,u),c=r.sub(d,u),u=r.add(d,u),u=r.mul(c,u),c=r.mul(p,c),l=r.mul(i,l),f=r.mul(t,f),p=r.sub(h,f),p=r.mul(t,p),p=r.add(p,l),l=r.add(h,h),h=r.add(l,h),h=r.add(h,f),h=r.mul(h,p),u=r.add(u,h),f=r.mul(a,o),f=r.add(f,f),h=r.mul(f,p),c=r.sub(c,h),l=r.mul(f,d),l=r.add(l,l),l=r.add(l,l),new w(c,u,l)}add(t){g(t);const{px:n,py:i,pz:s}=this,{px:a,py:o,pz:c}=t;let u=r.ZERO,l=r.ZERO,h=r.ZERO;const d=e.a,f=r.mul(e.b,is);let p=r.mul(n,a),y=r.mul(i,o),m=r.mul(s,c),b=r.add(n,i),v=r.add(a,o);b=r.mul(b,v),v=r.add(p,y),b=r.sub(b,v),v=r.add(n,s);let A=r.add(a,c);return v=r.mul(v,A),A=r.add(p,m),v=r.sub(v,A),A=r.add(i,s),u=r.add(o,c),A=r.mul(A,u),u=r.add(y,m),A=r.sub(A,u),h=r.mul(d,v),u=r.mul(f,m),h=r.add(u,h),u=r.sub(y,h),h=r.add(y,h),l=r.mul(u,h),y=r.add(p,p),y=r.add(y,p),m=r.mul(d,m),v=r.mul(f,v),y=r.add(y,m),m=r.sub(p,m),m=r.mul(d,m),v=r.add(v,m),p=r.mul(y,v),l=r.add(l,p),p=r.mul(A,v),u=r.mul(b,u),u=r.sub(u,p),p=r.mul(b,y),h=r.mul(A,h),h=r.add(h,p),new w(u,l,h)}subtract(e){return this.add(e.negate())}is0(){return this.equals(w.ZERO)}multiply(e){const{endo:r}=t;if(!n.isValidNot0(e))throw new Error("invalid scalar: out of range");let i,s;const a=e=>A.wNAFCached(this,e,w.normalizeZ);if(r){const{k1neg:t,k1:n,k2neg:o,k2:c}=r.splitScalar(e),{p:u,f:l}=a(n),{p:h,f:d}=a(c);s=l.add(d),i=b(r.beta,u,h,t,o)}else{const{p:t,f:r}=a(e);i=t,s=r}return w.normalizeZ([i,s])[0]}multiplyUnsafe(e){const{endo:r}=t,i=this;if(!n.isValid(e))throw new Error("invalid scalar: out of range");if(e===ts||i.is0())return w.ZERO;if(e===rs)return i;if(A.hasPrecomputes(this))return this.multiply(e);if(r){const{k1neg:t,k1:n,k2neg:s,k2:a}=r.splitScalar(e),{p1:o,p2:c}=function(e,t,r,n){let i=t,s=e.ZERO,a=e.ZERO;for(;r>Li||n>Li;)r&Di&&(s=s.add(i)),n&Di&&(a=a.add(i)),i=i.double(),r>>=Di,n>>=Di;return{p1:s,p2:a}}(w,i,n,a);return b(r.beta,o,c,t,s)}return A.wNAFCachedUnsafe(i,e)}multiplyAndAddUnsafe(e,t,r){const n=this.multiplyUnsafe(t).add(e.multiplyUnsafe(r));return n.is0()?void 0:n}toAffine(e){return y(this,e)}isTorsionFree(){const{isTorsionFree:e}=t;return i===rs||(e?e(w,this):A.wNAFCachedUnsafe(this,s).is0())}clearCofactor(){const{clearCofactor:e}=t;return i===rs?this:e?e(w,this):this.multiplyUnsafe(i)}toBytes(e=!0){return ti("isCompressed",e),this.assertValidity(),c(w,this,e)}toRawBytes(e=!0){return this.toBytes(e)}toHex(e=!0){return Tr(this.toBytes(e))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}w.BASE=new w(e.Gx,e.Gy,r.ONE),w.ZERO=new w(r.ZERO,r.ONE,r.ZERO),w.Fp=r,w.Fn=n;const v=n.BITS,A=Wi(w,t.endo?Math.ceil(v/2):v);return w}function us(e){return Uint8Array.of(e?2:3)}function ls(e,t,r={}){di(t,{hash:"function"},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const n=t.randomBytes||Gr,i=t.hmac||((e,...r)=>Xn(t.hash,e,Vr(...r))),{Fp:s,Fn:a}=e,{ORDER:o,BITS:c}=a;function u(e){return e>o>>rs}function l(e,t){if(!a.isValidNot0(t))throw new Error(`invalid signature ${e}: out of range 1..CURVE.n`)}class h{constructor(e,t,r){l("r",e),l("s",t),this.r=e,this.s=t,null!=r&&(this.recovery=r),Object.freeze(this)}static fromCompact(e){const t=a.BYTES,r=ci("compactSignature",e,2*t);return new h(a.fromBytes(r.subarray(0,t)),a.fromBytes(r.subarray(t,2*t)))}static fromDER(e){const{r:t,s:r}=es.toSig(ci("DER",e));return new h(t,r)}assertValidity(){}addRecoveryBit(e){return new h(this.r,this.s,e)}recoverPublicKey(t){const r=s.ORDER,{r:n,s:i,recovery:c}=this;if(null==c||![0,1,2,3].includes(c))throw new Error("recovery id invalid");if(o*ns<r&&c>1)throw new Error("recovery id is ambiguous for h>1 curve");const u=2===c||3===c?n+o:n;if(!s.isValid(u))throw new Error("recovery id 2 or 3 invalid");const l=s.toBytes(u),h=e.fromHex(Vr(us(!(1&c)),l)),d=a.inv(u),f=y(ci("msgHash",t)),p=a.create(-f*d),g=a.create(i*d),m=e.BASE.multiplyUnsafe(p).add(h.multiplyUnsafe(g));if(m.is0())throw new Error("point at infinify");return m.assertValidity(),m}hasHighS(){return u(this.s)}normalizeS(){return this.hasHighS()?new h(this.r,a.neg(this.s),this.recovery):this}toBytes(e){if("compact"===e)return Vr(a.toBytes(this.r),a.toBytes(this.s));if("der"===e)return Lr(es.hexFromSig(this));throw new Error("invalid format")}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return Tr(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return Tr(this.toBytes("compact"))}}const d=os(a,r.allowedPrivateKeyLengths,r.wrapPrivateKey),f={isValidPrivateKey(e){try{return d(e),!0}catch(e){return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const e=o;return function(e,t,r=!1){const n=e.length,i=Ri(t),s=Ui(t);if(n<16||n<s||n>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+n);const a=Ai(r?si(e):ii(e),t-gi)+gi;return r?oi(a,i):ai(a,i)}(n(Ui(e)),e)},precompute:(t=8,r=e.BASE)=>r.precompute(t,!1)};function p(t){if("bigint"==typeof t)return!1;if(t instanceof e)return!0;const n=ci("key",t).length,i=s.BYTES,o=i+1,c=2*i+1;return r.allowedPrivateKeyLengths||a.BYTES===o?void 0:n===o||n===c}const g=t.bits2int||function(e){if(e.length>8192)throw new Error("input is too large");const t=ii(e),r=8*e.length-c;return r>0?t>>BigInt(r):t},y=t.bits2int_modN||function(e){return a.create(g(e))},m=hi(c);function b(e){return li("num < 2^"+c,e,ts,m),a.toBytes(e)}function w(r,i,o=v){if(["recovered","canonical"].some(e=>e in o))throw new Error("sign() legacy options not supported");const{hash:c}=t;let{lowS:l,prehash:f,extraEntropy:p}=o;null==l&&(l=!0),r=ci("msgHash",r),Xi(o),f&&(r=ci("prehashed msgHash",c(r)));const m=y(r),w=d(i),A=[b(w),b(m)];if(null!=p&&!1!==p){const e=!0===p?n(s.BYTES):p;A.push(ci("extraEntropy",e))}const E=Vr(...A),C=m;return{seed:E,k2sig:function(t){const r=g(t);if(!a.isValidNot0(r))return;const n=a.inv(r),i=e.BASE.multiply(r).toAffine(),s=a.create(i.x);if(s===ts)return;const o=a.create(n*a.create(C+s*w));if(o===ts)return;let c=(i.x===s?0:2)|Number(i.y&rs),d=o;return l&&u(o)&&(d=function(e){return u(e)?a.neg(e):e}(o),c^=1),new h(s,d,c)}}}const v={lowS:t.lowS,prehash:!1},A={lowS:t.lowS,prehash:!1};return e.BASE.precompute(8),Object.freeze({getPublicKey:function(t,r=!0){return e.fromPrivateKey(t).toBytes(r)},getSharedSecret:function(t,r,n=!0){if(!0===p(t))throw new Error("first arg must be private key");if(!1===p(r))throw new Error("second arg must be public key");return e.fromHex(r).multiply(d(t)).toBytes(n)},sign:function(e,r,n=v){const{seed:s,k2sig:o}=w(e,r,n),c=function(e,t,r){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");const n=e=>new Uint8Array(e),i=e=>Uint8Array.of(e);let s=n(e),a=n(e),o=0;const c=()=>{s.fill(1),a.fill(0),o=0},u=(...e)=>r(a,s,...e),l=(e=n(0))=>{a=u(i(0),e),s=u(),0!==e.length&&(a=u(i(1),e),s=u())},h=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const r=[];for(;e<t;){s=u();const t=s.slice();r.push(t),e+=s.length}return Vr(...r)};return(e,t)=>{let r;for(c(),l(e);!(r=t(h()));)l();return c(),r}}(t.hash.outputLen,a.BYTES,i);return c(s,o)},verify:function(r,n,i,s=A){const o=r;n=ci("msgHash",n),i=ci("publicKey",i),Xi(s);const{lowS:c,prehash:u,format:l}=s;if("strict"in s)throw new Error("options.strict was renamed to lowS");if(void 0!==l&&!["compact","der","js"].includes(l))throw new Error('format must be "compact", "der" or "js"');const d="string"==typeof o||dr(o),f=!d&&!l&&"object"==typeof o&&null!==o&&"bigint"==typeof o.r&&"bigint"==typeof o.s;if(!d&&!f)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let p,g;try{if(f){if(void 0!==l&&"js"!==l)throw new Error("invalid format");p=new h(o.r,o.s)}if(d){try{"compact"!==l&&(p=h.fromDER(o))}catch(e){if(!(e instanceof es.Err))throw e}p||"der"===l||(p=h.fromCompact(o))}g=e.fromHex(i)}catch(e){return!1}if(!p)return!1;if(c&&p.hasHighS())return!1;u&&(n=t.hash(n));const{r:m,s:b}=p,w=y(n),v=a.inv(b),E=a.create(w*v),C=a.create(m*v),B=e.BASE.multiplyUnsafe(E).add(g.multiplyUnsafe(C));return!B.is0()&&a.create(B.x)===m},utils:f,Point:e,Signature:h})}function hs(e){const t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy};return{CURVE:t,curveOpts:{Fp:e.Fp,Fn:Oi(t.n,e.nBitLength),allowedPrivateKeyLengths:e.allowedPrivateKeyLengths,allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,wrapPrivateKey:e.wrapPrivateKey,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes}}}function ds(e){const{CURVE:t,curveOpts:r,ecdsaOpts:n}=function(e){const{CURVE:t,curveOpts:r}=hs(e);return{CURVE:t,curveOpts:r,ecdsaOpts:{hash:e.hash,hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN}}}(e);return function(e,t){return Object.assign({},t,{ProjectivePoint:t.Point,CURVE:e})}(e,ls(cs(t,r),n,r))}const fs={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},ps=(BigInt(0),BigInt(1)),gs=BigInt(2),ys=(e,t)=>(e+t/gs)/t;function ms(e){const t=fs.p,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),a=BigInt(23),o=BigInt(44),c=BigInt(88),u=e*e*e%t,l=u*u*e%t,h=Ei(l,r,t)*l%t,d=Ei(h,r,t)*l%t,f=Ei(d,gs,t)*u%t,p=Ei(f,i,t)*f%t,g=Ei(p,s,t)*p%t,y=Ei(g,o,t)*g%t,m=Ei(y,c,t)*y%t,b=Ei(m,o,t)*g%t,w=Ei(b,r,t)*l%t,v=Ei(w,a,t)*p%t,A=Ei(v,n,t)*u%t,E=Ei(A,gs,t);if(!bs.eql(bs.sqr(E),e))throw new Error("Cannot find square root");return E}const bs=Oi(fs.p,void 0,void 0,{sqrt:ms}),ws=function(e,t){const r=t=>ds({...e,hash:t});return{...r(t),create:r}}({...fs,Fp:bs,lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=fs.n,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-ps*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,a=BigInt("0x100000000000000000000000000000000"),o=ys(s*e,t),c=ys(-n*e,t);let u=Ai(e-o*r-c*i,t),l=Ai(-o*n-c*s,t);const h=u>a,d=l>a;if(h&&(u=t-u),d&&(l=t-l),u>a||l>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:h,k1:u,k2neg:d,k2:l}}}},Jn);var vs=r(6925);function As(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function Es(e,...t){if(!As(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Cs(e,t){return!!Array.isArray(t)&&(0===t.length||(e?t.every(e=>"string"==typeof e):t.every(e=>Number.isSafeInteger(e))))}function Bs(e){if("function"!=typeof e)throw new Error("function expected");return!0}function Ss(e,t){if("string"!=typeof t)throw new Error(`${e}: string expected`);return!0}function ks(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function Ts(e){if(!Array.isArray(e))throw new Error("array expected")}function Is(e,t){if(!Cs(!0,t))throw new Error(`${e}: array of strings expected`)}function Ps(e,t){if(!Cs(!1,t))throw new Error(`${e}: array of numbers expected`)}function Ns(...e){const t=e=>e,r=(e,t)=>r=>e(t(r));return{encode:e.map(e=>e.encode).reduceRight(r,t),decode:e.map(e=>e.decode).reduce(r,t)}}function xs(e){const t="string"==typeof e?e.split(""):e,r=t.length;Is("alphabet",t);const n=new Map(t.map((e,t)=>[e,t]));return{encode:n=>(Ts(n),n.map(n=>{if(!Number.isSafeInteger(n)||n<0||n>=r)throw new Error(`alphabet.encode: digit index outside alphabet "${n}". Allowed: ${e}`);return t[n]})),decode:t=>(Ts(t),t.map(t=>{Ss("alphabet.decode",t);const r=n.get(t);if(void 0===r)throw new Error(`Unknown letter: "${t}". Allowed: ${e}`);return r}))}}function Os(e=""){return Ss("join",e),{encode:t=>(Is("join.decode",t),t.join(e)),decode:t=>(Ss("join.decode",t),t.split(e))}}function Rs(e,t="="){return ks(e),Ss("padding",t),{encode(r){for(Is("padding.encode",r);r.length*e%8;)r.push(t);return r},decode(r){Is("padding.decode",r);let n=r.length;if(n*e%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;n>0&&r[n-1]===t;n--){if((n-1)*e%8==0)throw new Error("padding: invalid, string has too much padding")}return r.slice(0,n)}}}function Us(e){return Bs(e),{encode:e=>e,decode:t=>e(t)}}function Ls(e,t,r){if(t<2)throw new Error(`convertRadix: invalid from=${t}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: invalid to=${r}, base cannot be less than 2`);if(Ts(e),!e.length)return[];let n=0;const i=[],s=Array.from(e,e=>{if(ks(e),e<0||e>=t)throw new Error(`invalid integer: ${e}`);return e}),a=s.length;for(;;){let e=0,o=!0;for(let i=n;i<a;i++){const a=s[i],c=t*e,u=c+a;if(!Number.isSafeInteger(u)||c/t!==e||u-a!==c)throw new Error("convertRadix: carry overflow");const l=u/r;e=u%r;const h=Math.floor(l);if(s[i]=h,!Number.isSafeInteger(h)||h*r+e!==u)throw new Error("convertRadix: carry overflow");o&&(h?o=!1:n=i)}if(i.push(e),o)break}for(let t=0;t<e.length-1&&0===e[t];t++)i.push(0);return i.reverse()}const Ds=(e,t)=>0===t?e:Ds(t,e%t),Fs=(e,t)=>e+(t-Ds(e,t)),Ms=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function js(e,t,r,n){if(Ts(e),t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(r<=0||r>32)throw new Error(`convertRadix2: wrong to=${r}`);if(Fs(t,r)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${Fs(t,r)}`);let i=0,s=0;const a=Ms[t],o=Ms[r]-1,c=[];for(const n of e){if(ks(n),n>=a)throw new Error(`convertRadix2: invalid data word=${n} from=${t}`);if(i=i<<t|n,s+t>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${t}`);for(s+=t;s>=r;s-=r)c.push((i>>s-r&o)>>>0);const e=Ms[s];if(void 0===e)throw new Error("invalid carry");i&=e-1}if(i=i<<r-s&o,!n&&s>=t)throw new Error("Excess padding");if(!n&&i>0)throw new Error(`Non-zero padding: ${i}`);return n&&s>0&&c.push(i>>>0),c}function Ks(e){ks(e);return{encode:t=>{if(!As(t))throw new Error("radix.encode input should be Uint8Array");return Ls(Array.from(t),256,e)},decode:t=>(Ps("radix.decode",t),Uint8Array.from(Ls(t,e,256)))}}function Vs(e,t=!1){if(ks(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(Fs(8,e)>32||Fs(e,8)>32)throw new Error("radix2: carry overflow");return{encode:r=>{if(!As(r))throw new Error("radix2.encode input should be Uint8Array");return js(Array.from(r),8,e,!t)},decode:r=>(Ps("radix2.decode",r),Uint8Array.from(js(r,e,8,t)))}}function Hs(e){return Bs(e),function(...t){try{return e.apply(null,t)}catch(e){}}}function _s(e,t){return ks(e),Bs(t),{encode(r){if(!As(r))throw new Error("checksum.encode: input should be Uint8Array");const n=t(r).slice(0,e),i=new Uint8Array(r.length+e);return i.set(r),i.set(n,r.length),i},decode(r){if(!As(r))throw new Error("checksum.decode: input should be Uint8Array");const n=r.slice(0,-e),i=r.slice(-e),s=t(n).slice(0,e);for(let t=0;t<e;t++)if(s[t]!==i[t])throw new Error("Invalid checksum");return n}}}const Gs=Ns(Vs(4),xs("0123456789ABCDEF"),Os("")),zs=Ns(Vs(5),xs("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Rs(5),Os("")),qs=(Ns(Vs(5),xs("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Os("")),Ns(Vs(5),xs("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Rs(5),Os("")),Ns(Vs(5),xs("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Os("")),Ns(Vs(5),xs("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),Os(""),Us(e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),"function"==typeof Uint8Array.from([]).toBase64&&"function"==typeof Uint8Array.fromBase64),Qs=(e,t)=>{Ss("base64",e);const r=t?/^[A-Za-z0-9=_-]+$/:/^[A-Za-z0-9=+/]+$/,n=t?"base64url":"base64";if(e.length>0&&!r.test(e))throw new Error("invalid base64");return Uint8Array.fromBase64(e,{alphabet:n,lastChunkHandling:"strict"})},Ws=qs?{encode:e=>(Es(e),e.toBase64()),decode:e=>Qs(e,!1)}:Ns(Vs(6),xs("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Rs(6),Os("")),Js=(Ns(Vs(6),xs("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Os("")),qs?{encode:e=>(Es(e),e.toBase64({alphabet:"base64url"})),decode:e=>Qs(e,!0)}:Ns(Vs(6),xs("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),Rs(6),Os(""))),Ys=(Ns(Vs(6),xs("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),Os("")),e=>Ns(Ks(58),xs(e),Os(""))),Zs=Ys("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),Xs=(Ys("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),Ys("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"),[0,2,3,5,6,7,9,10,11]),$s={encode(e){let t="";for(let r=0;r<e.length;r+=8){const n=e.subarray(r,r+8);t+=Zs.encode(n).padStart(Xs[n.length],"1")}return t},decode(e){let t=[];for(let r=0;r<e.length;r+=11){const n=e.slice(r,r+11),i=Xs.indexOf(n.length),s=Zs.decode(n);for(let e=0;e<s.length-i;e++)if(0!==s[e])throw new Error("base58xmr: wrong padding");t=t.concat(Array.from(s.slice(s.length-i)))}return Uint8Array.from(t)}},ea=e=>Ns(_s(4,t=>e(e(t))),Zs),ta=Ns(xs("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),Os("")),ra=[996825010,642813549,513874426,1027748829,705979059];function na(e){const t=e>>25;let r=(33554431&e)<<5;for(let e=0;e<ra.length;e++)1==(t>>e&1)&&(r^=ra[e]);return r}function ia(e,t,r=1){const n=e.length;let i=1;for(let t=0;t<n;t++){const r=e.charCodeAt(t);if(r<33||r>126)throw new Error(`Invalid prefix (${e})`);i=na(i)^r>>5}i=na(i);for(let t=0;t<n;t++)i=na(i)^31&e.charCodeAt(t);for(let e of t)i=na(i)^e;for(let e=0;e<6;e++)i=na(i);return i^=r,ta.encode(js([i%Ms[30]],30,5,!1))}function sa(e){const t="bech32"===e?1:734539939,r=Vs(5),n=r.decode,i=r.encode,s=Hs(n);function a(e,r,n=90){Ss("bech32.encode prefix",e),As(r)&&(r=Array.from(r)),Ps("bech32.encode",r);const i=e.length;if(0===i)throw new TypeError(`Invalid prefix length ${i}`);const s=i+7+r.length;if(!1!==n&&s>n)throw new TypeError(`Length ${s} exceeds limit ${n}`);const a=e.toLowerCase(),o=ia(a,r,t);return`${a}1${ta.encode(r)}${o}`}function o(e,r=90){Ss("bech32.decode input",e);const n=e.length;if(n<8||!1!==r&&n>r)throw new TypeError(`invalid string length: ${n} (${e}). Expected (8..${r})`);const i=e.toLowerCase();if(e!==i&&e!==e.toUpperCase())throw new Error("String must be lowercase or uppercase");const s=i.lastIndexOf("1");if(0===s||-1===s)throw new Error('Letter "1" must be present between prefix and data only');const a=i.slice(0,s),o=i.slice(s+1);if(o.length<6)throw new Error("Data must be at least 6 characters long");const c=ta.decode(o).slice(0,-6),u=ia(a,c,t);if(!o.endsWith(u))throw new Error(`Invalid checksum in ${e}: expected "${u}"`);return{prefix:a,words:c}}return{encode:a,decode:o,encodeFromBytes:function(e,t){return a(e,i(t))},decodeToBytes:function(e){const{prefix:t,words:r}=o(e,!1);return{prefix:t,words:r,bytes:n(r)}},decodeUnsafe:Hs(o),fromWords:n,fromWordsUnsafe:s,toWords:i}}sa("bech32"),sa("bech32m");const aa={encode:e=>(new TextDecoder).decode(e),decode:e=>(new TextEncoder).encode(e)},oa=("function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex||Ns(Vs(4),xs("0123456789abcdef"),Os(""),Us(e=>{if("string"!=typeof e||e.length%2!=0)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()})),BigInt(0)),ca=BigInt(1),ua=BigInt(2),la=BigInt(8),ha={zip215:!0};function da(e,t){di(t,{hash:"function"},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});const{prehash:r,hash:n}=t,{BASE:i,Fp:s,Fn:a}=e,o=a.ORDER,c=t.randomBytes||Gr,u=t.adjustScalarBytes||(e=>e),l=t.domain||((e,t,r)=>{if(ti("phflag",r),t.length||r)throw new Error("Contexts/pre-hash are not supported");return e});function h(e){return a.create(e)}function d(e){return h(si(e))}function f(e){const{head:t,prefix:r,scalar:a}=function(e){const t=s.BYTES;e=ci("private key",e,t);const r=ci("hashed private key",n(e),2*t),i=u(r.slice(0,t));return{head:i,prefix:r.slice(t,2*t),scalar:d(i)}}(e),o=i.multiply(a),c=o.toBytes();return{head:t,prefix:r,scalar:a,point:o,pointBytes:c}}function p(e=Uint8Array.of(),...t){const i=Vr(...t);return d(n(l(i,ci("context",e),!!r)))}const g=ha;i.precompute(8);return{getPublicKey:function(e){return f(e).pointBytes},sign:function(e,t,n={}){e=ci("message",e),r&&(e=r(e));const{prefix:a,scalar:c,pointBytes:u}=f(t),l=p(n.context,a,e),d=i.multiply(l).toBytes(),g=h(l+p(n.context,d,u,e)*c);li("signature.s",g,oa,o);const y=s.BYTES;return ci("result",Vr(d,oi(g,y)),2*y)},verify:function(t,n,a,o=g){const{context:c,zip215:u}=o,l=s.BYTES;t=ci("signature",t,2*l),n=ci("message",n),a=ci("publicKey",a,l),void 0!==u&&ti("zip215",u),r&&(n=r(n));const h=si(t.slice(l,2*l));let d,f,y;try{d=e.fromHex(a,u),f=e.fromHex(t.slice(0,l),u),y=i.multiplyUnsafe(h)}catch(e){return!1}if(!u&&d.isSmallOrder())return!1;const m=p(c,f.toBytes(),d.toBytes(),n);return f.add(d.multiplyUnsafe(m)).subtract(y).clearCofactor().is0()},utils:{getExtendedPublicKey:f,randomPrivateKey:()=>c(s.BYTES),precompute:(t=8,r=e.BASE)=>r.precompute(t,!1)},Point:e}}function fa(e){const{CURVE:t,curveOpts:r,eddsaOpts:n}=function(e){const t={a:e.a,d:e.d,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy};return{CURVE:t,curveOpts:{Fp:e.Fp,Fn:Oi(t.n,e.nBitLength,!0),uvRatio:e.uvRatio},eddsaOpts:{hash:e.hash,randomBytes:e.randomBytes,adjustScalarBytes:e.adjustScalarBytes,domain:e.domain,prehash:e.prehash,mapToCurve:e.mapToCurve}}}(e),i=function(e,t={}){const{Fp:r,Fn:n}=Zi("edwards",e,t),{h:i,n:s}=e;di(t,{},{uvRatio:"function"});const a=ua<<BigInt(8*n.BYTES)-ca,o=e=>r.create(e),c=t.uvRatio||((e,t)=>{try{return{isValid:!0,value:r.sqrt(r.div(e,t))}}catch(e){return{isValid:!1,value:oa}}});if(!function(e,t,r,n){const i=e.sqr(r),s=e.sqr(n),a=e.add(e.mul(t.a,i),s),o=e.add(e.ONE,e.mul(t.d,e.mul(i,s)));return e.eql(a,o)}(r,e,e.Gx,e.Gy))throw new Error("bad curve params: generator point");function u(e,t,r=!1){return li("coordinate "+e,t,r?ca:oa,a),t}function l(e){if(!(e instanceof f))throw new Error("ExtendedPoint expected")}const h=fi((e,t)=>{const{ex:n,ey:i,ez:s}=e,a=e.is0();null==t&&(t=a?la:r.inv(s));const c=o(n*t),u=o(i*t),l=o(s*t);if(a)return{x:oa,y:ca};if(l!==ca)throw new Error("invZ was invalid");return{x:c,y:u}}),d=fi(t=>{const{a:r,d:n}=e;if(t.is0())throw new Error("bad point: ZERO");const{ex:i,ey:s,ez:a,et:c}=t,u=o(i*i),l=o(s*s),h=o(a*a),d=o(h*h),f=o(u*r);if(o(h*o(f+l))!==o(d+o(n*o(u*l))))throw new Error("bad point: equation left != right (1)");if(o(i*s)!==o(a*c))throw new Error("bad point: equation left != right (2)");return!0});class f{constructor(e,t,r,n){this.ex=u("x",e),this.ey=u("y",t),this.ez=u("z",r,!0),this.et=u("t",n),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(e){if(e instanceof f)throw new Error("extended point not allowed");const{x:t,y:r}=e||{};return u("x",t),u("y",r),new f(t,r,ca,o(t*r))}static normalizeZ(e){return Mi(f,"ez",e)}static msm(e,t){return Ji(f,n,e,t)}_setWindowSize(e){this.precompute(e)}precompute(e=8,t=!0){return p.setWindowSize(this,e),t||this.multiply(ua),this}assertValidity(){d(this)}equals(e){l(e);const{ex:t,ey:r,ez:n}=this,{ex:i,ey:s,ez:a}=e,c=o(t*a),u=o(i*n),h=o(r*a),d=o(s*n);return c===u&&h===d}is0(){return this.equals(f.ZERO)}negate(){return new f(o(-this.ex),this.ey,this.ez,o(-this.et))}double(){const{a:t}=e,{ex:r,ey:n,ez:i}=this,s=o(r*r),a=o(n*n),c=o(ua*o(i*i)),u=o(t*s),l=r+n,h=o(o(l*l)-s-a),d=u+a,p=d-c,g=u-a,y=o(h*p),m=o(d*g),b=o(h*g),w=o(p*d);return new f(y,m,w,b)}add(t){l(t);const{a:r,d:n}=e,{ex:i,ey:s,ez:a,et:c}=this,{ex:u,ey:h,ez:d,et:p}=t,g=o(i*u),y=o(s*h),m=o(c*n*p),b=o(a*d),w=o((i+s)*(u+h)-g-y),v=b-m,A=b+m,E=o(y-r*g),C=o(w*v),B=o(A*E),S=o(w*E),k=o(v*A);return new f(C,B,k,S)}subtract(e){return this.add(e.negate())}multiply(e){const t=e;li("scalar",t,ca,s);const{p:r,f:n}=p.wNAFCached(this,t,f.normalizeZ);return f.normalizeZ([r,n])[0]}multiplyUnsafe(e,t=f.ZERO){const r=e;return li("scalar",r,oa,s),r===oa?f.ZERO:this.is0()||r===ca?this:p.wNAFCachedUnsafe(this,r,f.normalizeZ,t)}isSmallOrder(){return this.multiplyUnsafe(i).is0()}isTorsionFree(){return p.wNAFCachedUnsafe(this,s).is0()}toAffine(e){return h(this,e)}clearCofactor(){return i===ca?this:this.multiplyUnsafe(i)}static fromBytes(e,t=!1){return pr(e),this.fromHex(e,t)}static fromHex(t,n=!1){const{d:i,a:s}=e,u=r.BYTES;t=ci("pointHex",t,u),ti("zip215",n);const l=t.slice(),h=t[u-1];l[u-1]=-129&h;const d=si(l),p=n?a:r.ORDER;li("pointHex.y",d,oa,p);const g=o(d*d),y=o(g-ca),m=o(i*g-s);let{isValid:b,value:w}=c(y,m);if(!b)throw new Error("Point.fromHex: invalid y coordinate");const v=(w&ca)===ca,A=!!(128&h);if(!n&&w===oa&&A)throw new Error("Point.fromHex: x=0 and x_0=1");return A!==v&&(w=o(-w)),f.fromAffine({x:w,y:d})}static fromPrivateScalar(e){return f.BASE.multiply(e)}toBytes(){const{x:e,y:t}=this.toAffine(),n=oi(t,r.BYTES);return n[n.length-1]|=e&ca?128:0,n}toRawBytes(){return this.toBytes()}toHex(){return Tr(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}f.BASE=new f(e.Gx,e.Gy,ca,o(e.Gx*e.Gy)),f.ZERO=new f(oa,ca,ca,oa),f.Fp=r,f.Fn=n;const p=Wi(f,8*n.BYTES);return f}(t,r);return function(e,t){return Object.assign({},t,{ExtendedPoint:t.Point,CURVE:e})}(e,da(i,n))}BigInt(0);const pa=BigInt(1),ga=BigInt(2),ya=(BigInt(3),BigInt(5)),ma=BigInt(8),ba={p:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:ma,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function wa(e){const t=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),s=ba.p,a=e*e%s*e%s,o=Ei(a,ga,s)*a%s,c=Ei(o,pa,s)*e%s,u=Ei(c,ya,s)*c%s,l=Ei(u,t,s)*u%s,h=Ei(l,r,s)*l%s,d=Ei(h,n,s)*h%s,f=Ei(d,i,s)*d%s,p=Ei(f,i,s)*d%s,g=Ei(p,t,s)*u%s;return{pow_p_5_8:Ei(g,ga,s)*e%s,b2:a}}function va(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}const Aa=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function Ea(e,t){const r=ba.p,n=Ai(t*t*t,r),i=Ai(n*n*t,r);let s=Ai(e*n*wa(e*i).pow_p_5_8,r);const a=Ai(t*s*s,r),o=s,c=Ai(s*Aa,r),u=a===e,l=a===Ai(-e,r),h=a===Ai(-e*Aa,r);return u&&(s=o),(l||h)&&(s=c),((e,t)=>(Ai(e,t)&gi)===gi)(s,r)&&(s=Ai(-s,r)),{isValid:u||l,value:s}}const Ca=Oi(ba.p,void 0,!0),Ba={...ba,Fp:Ca,hash:Yn,adjustScalarBytes:va,uvRatio:Ea},Sa=fa(Ba);const ka=Sa.CURVE,Ta="ed25519",Ia=xn("ed25519 seed"),Pa=e=>!0,Na=!1,xa=33,Oa=(()=>{let e=!1;return(t,r)=>{e||(Sa.ExtendedPoint.BASE._setWindowSize(4),e=!0);const n=Sa.getPublicKey(t);return Rn([new Uint8Array([0]),n])}})(),Ra=(e,t)=>{throw new Error("Ed25519 does not support public key derivation.")},Ua=e=>e,La=e=>e,Da=32,Fa="slip10",Ma=33,ja=Sa.CURVE,Ka="ed25519Bip32",Va=xn("");function Ha(e,t){const r=e[t];return xt(void 0!==r,"Private key is too short."),r}const _a=e=>!(7&Ha(e,0))&&(!(128&Ha(e,31))&&!(64&~Ha(e,31))),Ga=!0,za=32,qa=e=>{return yn(t=In(Uint8Array.from(e).reverse())),BigInt(wn(t));var t},Qa=e=>{const t=Ai(qa(e),ja.n);return Sa.ExtendedPoint.BASE.multiply(t).toRawBytes()},Wa=(e,t)=>Qa(e.slice(0,32)),Ja=(e,t)=>Sa.ExtendedPoint.fromHex(vn(In(e))).add(Sa.ExtendedPoint.fromHex(vn(In(t)))).toRawBytes(),Ya=e=>e,Za=e=>e,Xa=64,$a="cip3",eo=32,to={secp256k1:c,ed25519:e,ed25519Bip32:t};function ro(e){return to[e]}function no(e,t,r,n){gr(e);const i=function(e,t){if(void 0!==t&&"[object Object]"!=={}.toString.call(t))throw new Error("options should be object or undefined");return Object.assign(e,t)}({dkLen:32,asyncTick:10},n),{c:s,dkLen:a,asyncTick:o}=i;if(fr(s),fr(a),fr(o),s<1)throw new Error("iterations (c) should be >= 1");const c=Kr(t),u=Kr(r),l=new Uint8Array(a),h=Xn.create(e,c),d=h._cloneInto().update(u);return{c:s,dkLen:a,asyncTick:o,DK:l,PRF:h,PRFSalt:d}}function io(e,t,r,n,i){return e.destroy(),t.destroy(),n&&n.destroy(),br(i),r}const so=Uint32Array.from([1732584193,4023233417,2562383102,271733878,3285377520]);new Uint32Array(80);const ao=Math.pow(2,32);Array.from({length:64},(e,t)=>Math.floor(ao*Math.abs(Math.sin(t+1)))),so.slice(0,4),new Uint32Array(16);const oo=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),co=Uint8Array.from(new Array(16).fill(0).map((e,t)=>t)),uo=co.map(e=>(9*e+5)%16),lo=(()=>{const e=[[co],[uo]];for(let t=0;t<4;t++)for(let r of e)r.push(r[t].map(e=>oo[e]));return e})(),ho=lo[0],fo=lo[1],po=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>Uint8Array.from(e)),go=ho.map((e,t)=>e.map(e=>po[t][e])),yo=fo.map((e,t)=>e.map(e=>po[t][e])),mo=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),bo=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function wo(e,t,r,n){return 0===e?t^r^n:1===e?t&r|~t&n:2===e?(t|~r)^n:3===e?t&n|r&~n:t^(r|~n)}const vo=new Uint32Array(16);class Ao extends Fn{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:t,h2:r,h3:n,h4:i}=this;return[e,t,r,n,i]}set(e,t,r,n,i){this.h0=0|e,this.h1=0|t,this.h2=0|r,this.h3=0|n,this.h4=0|i}process(e,t){for(let r=0;r<16;r++,t+=4)vo[r]=e.getUint32(t,!0);let r=0|this.h0,n=r,i=0|this.h1,s=i,a=0|this.h2,o=a,c=0|this.h3,u=c,l=0|this.h4,h=l;for(let e=0;e<5;e++){const t=4-e,d=mo[e],f=bo[e],p=ho[e],g=fo[e],y=go[e],m=yo[e];for(let t=0;t<16;t++){const n=Ar(r+wo(e,i,a,c)+vo[p[t]]+d,y[t])+l|0;r=l,l=c,c=0|Ar(a,10),a=i,i=n}for(let e=0;e<16;e++){const r=Ar(n+wo(t,s,o,u)+vo[g[e]]+f,m[e])+h|0;n=h,h=u,u=0|Ar(o,10),o=s,s=r}}this.set(this.h1+a+u|0,this.h2+c+h|0,this.h3+l+n|0,this.h4+r+s|0,this.h0+i+o|0)}roundClean(){br(vo)}destroy(){this.destroyed=!0,br(this.buffer),this.set(0,0,0,0,0)}}const Eo=_r(()=>new Ao),Co=Jn,Bo=Yn;async function So(e,t,r={}){if(r.hmacSha512)return await r.hmacSha512(e,t);if(Qc()){const r=await crypto.subtle.importKey("raw",e,{name:"HMAC",hash:"SHA-512"},!1,["sign"]),n=await crypto.subtle.sign("HMAC",r,t);return new Uint8Array(n)}return Xn(Bo,e,t)}async function ko(e,t,r,n,i={}){if(i.pbkdf2Sha512)return await i.pbkdf2Sha512(e,t,r,n);if(Qc()){const i=await crypto.subtle.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]),s=await crypto.subtle.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:{name:"SHA-512"}},i,8*n);return new Uint8Array(s)}return await async function(e,t,r,n){const{c:i,dkLen:s,asyncTick:a,DK:o,PRF:c,PRFSalt:u}=no(e,t,r,n);let l;const h=new Uint8Array(4),d=wr(h),f=new Uint8Array(c.outputLen);for(let e=1,t=0;t<s;e++,t+=c.outputLen){const r=o.subarray(t,t+c.outputLen);d.setInt32(0,e,!1),(l=u._cloneInto(l)).update(h).digestInto(f),r.set(f.subarray(0,r.length)),await Fr(i-1,a,()=>{c._cloneInto(l).update(f).digestInto(f);for(let e=0;e<r.length;e++)r[e]^=f[e]})}return io(c,u,o,l,f)}(Bo,e,t,{c:r,dkLen:n})}function To(e){return Co(e)}const Io=Symbol("Public key guard. Do not export this from the module.");async function Po({path:e,node:t,curve:r,network:n},i,s){Uo(t);const{childIndex:a,isHardened:o}=Lo(e,t,r),c={chainCode:t.chainCodeBytes,childIndex:a,isHardened:o,depth:t.depth,parentFingerprint:t.fingerprint,masterFingerprint:t.masterFingerprint,curve:r,network:n};if(t.privateKeyBytes){const e=await xo({privateKey:t.privateKeyBytes,get publicKey(){return t.compressedPublicKeyBytes},childIndex:a,isHardened:o,curve:r}),n=await Ro({chainCode:t.chainCodeBytes,extension:e},s);return await No({privateKey:t.privateKeyBytes,get publicKey(){return t.publicKeyBytes},entropy:n,...c},i,s)}const u=Oo({parentPublicKey:t.compressedPublicKeyBytes,childIndex:a}),l=await Ro({chainCode:t.chainCodeBytes,extension:u},s);return await No({publicKey:t.compressedPublicKeyBytes,entropy:l,...c},i,s)}async function No(e,t,r){const{privateKey:n,publicKey:i,entropy:s,childIndex:a,isHardened:o,depth:c,parentFingerprint:u,masterFingerprint:l,curve:h,network:d}=e;try{return n?await async function({entropy:e,privateKey:t,depth:r,masterFingerprint:n,parentFingerprint:i,childIndex:s,isHardened:a,curve:o,network:c},u){const l=s+(a?Vt:0),{privateKey:h,chainCode:d}=function({privateKey:e,entropy:t,curve:r}){const n=t.slice(0,32),i=t.slice(32);if("ed25519"===r.name)return{privateKey:n,chainCode:i};const s=function(e,t,r){xt(jc(t,32),"Invalid tweak: Tweak must be a non-zero 32-byte Uint8Array.");const n=Pn(e),i=Pn(t);if(i>=r.curve.n)throw new Error("Invalid tweak: Tweak is larger than the curve order.");const s=Ai(n+i,r.curve.n),a=Nn(s.toString(16).padStart(64,"0"));if(!r.isValidPrivateKey(a))throw new Error("Invalid private key or tweak: The resulting private key is invalid.");return a}(e,n,r);return{privateKey:s,chainCode:i}}({privateKey:t,entropy:e,curve:o});return await Bc.fromExtendedKey({privateKey:h,chainCode:d,depth:r+1,masterFingerprint:n,parentFingerprint:i,index:l,curve:o.name,network:c,guard:Io},u)}({entropy:s,privateKey:n,depth:c,masterFingerprint:l,parentFingerprint:u,childIndex:a,isHardened:o,curve:h,network:d},r):await async function({entropy:e,publicKey:t,depth:r,masterFingerprint:n,parentFingerprint:i,childIndex:s,curve:a,network:o},c){const{publicKey:u,chainCode:l}=function({publicKey:e,entropy:t,curve:r}){const n=t.slice(0,32),i=t.slice(32),s=r.publicAdd(e,n);return{publicKey:s,chainCode:i}}({publicKey:t,entropy:e,curve:a});return await Bc.fromExtendedKey({publicKey:u,chainCode:l,depth:r+1,masterFingerprint:n,parentFingerprint:i,index:s,curve:a.name,network:o},c)}({entropy:s,publicKey:i,depth:c,masterFingerprint:l,parentFingerprint:u,childIndex:a,curve:h,network:d},r)}catch(n){return await No(await t(n,e,r),t,r)}}async function xo({privateKey:e,publicKey:t,childIndex:r,isHardened:n,curve:i}){return n?Rn([new Uint8Array([0]),e,qc(r+Vt)]):(_c(t,i.compressedPublicKeyLength),Oo({parentPublicKey:t,childIndex:r}))}function Oo({parentPublicKey:e,childIndex:t}){return Rn([e,qc(t)])}async function Ro({chainCode:e,extension:t},r){return await So(e,t,r)}function Uo(e){xt(e,"Invalid parameters: Must specify a node to derive from.")}function Lo(e,t,r){!function(e,t,r){xt("string"==typeof e,"Invalid path: Must be a string.");const n=e.endsWith("'");xt(!n||t.privateKey,"Invalid parameters: Cannot derive hardened child keys without a private key."),xt(n||r.deriveUnhardenedKeys,`Invalid path: Cannot derive unhardened child keys with ${r.name}.`)}(e,t,r);const n=e.split("'")[0];xt(n);const i=parseInt(n,10);if(!Dt.test(n)||!Number.isInteger(i)||i<0||i>=Vt)throw new Error(`Invalid path: The index must be a non-negative decimal integer less than ${Vt}.`);return{childIndex:i,isHardened:e.includes("'")}}function Do(e){xt(e instanceof Uint8Array&&jc(e,Rt),"Invalid key: The key must be a 32-byte, non-zero Uint8Array.");return Fo(tu(e,!1))}function Fo(e){return xt(e instanceof Uint8Array&&jc(e,$c),"Invalid key: The key must be a 65-byte, non-zero Uint8Array."),(t=e.slice(1),cn(t)).slice(-20);var t}async function Mo(e,t){return xt("secp256k1"===e.curve.name,"Invalid curve: Only secp256k1 is supported by BIP-32."),Po(e,jo,t)}async function jo(e,t,r){const{childIndex:n,privateKey:i,publicKey:s,isHardened:a,chainCode:o,curve:c}=t;if(Lc(n+1),i){const e=await xo({privateKey:i,publicKey:c.compressPublicKey(s),childIndex:n+1,isHardened:a,curve:c}),u=await Ro({chainCode:o,extension:e},r);return{...t,childIndex:n+1,entropy:u}}const u=Oo({parentPublicKey:s,childIndex:n+1}),l=await Ro({chainCode:o,extension:u});return{...t,childIndex:n+1,entropy:l}}var Ko=r(2091);const Vo=[12,15,18,21,24];function Ho(e){const t=e.split(" ");xt(Vo.includes(t.length),"Invalid mnemonic phrase: The mnemonic phrase must consist of 12, 15, 18, 21, or 24 words."),xt(t.every(e=>vs.p.includes(e)),"Invalid mnemonic phrase: The mnemonic phrase contains an unknown word.")}async function _o(e,t="",r){const n=`mnemonic${t}`.normalize("NFKD");return await ko(function(e,t){if("string"==typeof e)return Ho(e),xn(e.normalize("NFKD"));const r=Array.from(new Uint16Array(e.buffer)).map(e=>t[e]).join(" ");return Ho(r),xn(r)}(e,vs.p),xn(n),2048,64,r)}function Go(e){return`bip39:${e.toLowerCase().trim()}`}function zo(e){return e instanceof Uint8Array?e:(xt(e.startsWith("bip39:"),'Invalid HD path segment: The BIP-39 path must start with "bip39:".'),e.slice(6))}async function qo({path:e,curve:t},r){const[n,...i]=e,s=zo(n),a=ro(t);switch(a.masterNodeGenerationSpec){case"slip10":return[await _o(s,"",r),...i];case"cip3":return[(0,Ko.x2)(s,vs.p),...i];default:return Ot()}}async function Qo({path:e,curve:t,network:r},n){switch(xt(e instanceof Uint8Array,"Invalid path: The path must be a Uint8Array."),t.masterNodeGenerationSpec){case"slip10":return Wo(e,t,r,n);case"cip3":return Jo(e,t,r,n);default:throw new Error("Unsupported master node generation spec.")}}async function Wo(e,t,r,n){xt(e.length>=16&&e.length<=64,"Invalid seed: The seed must be between 16 and 64 bytes long.");const i=await So(t.secret,e,n),s=i.slice(0,Rt),a=i.slice(Rt);xt(t.isValidPrivateKey(s),"Invalid private key: The private key must greater than 0 and less than the curve order.");const o=t.getPublicKey(s,!1),c=Gc(t.compressPublicKey(o),t.compressedPublicKeyLength);return Bc.fromExtendedKey({privateKey:s,publicKey:o,chainCode:a,masterFingerprint:c,network:r,depth:0,parentFingerprint:0,index:0,curve:t.name,guard:Io},n)}async function Jo(e,t,r,n){xt(e.length>=16&&e.length<=64,"Invalid entropy: The entropy must be between 16 and 64 bytes long.");const i=await ko(t.secret,e,4096,96,n);i[0]&=248,i[31]&=31,i[31]|=64;const s=i.slice(0,t.privateKeyLength),a=i.slice(t.privateKeyLength);xt(t.isValidPrivateKey(s),"Invalid private key.");const o=t.getPublicKey(s,!1),c=Gc(t.compressPublicKey(o),t.compressedPublicKeyLength);return Bc.fromExtendedKey({privateKey:s,publicKey:o,chainCode:a,masterFingerprint:c,network:r,depth:0,parentFingerprint:0,index:0,curve:t.name,guard:Io},n)}const Yo=e=>e.slice().reverse(),Zo=e=>{const t=In(Yo(e));return BigInt(t)},Xo=e=>{const t=e.toString(16);return Yo(Nn(t))},$o=e=>Rn([e,new Uint8Array(Math.max(32-e.length,0)).fill(0)]),ec=e=>{const t=Zo(e.slice(0,28))*BigInt(8);return $o(Xo(t))},tc=e=>$o(Xo(Ai(Zo(e),BigInt(2)**BigInt(256)))),rc=(e,t)=>{const r=Zo(e)+Zo(t);return $o(Xo(r)).slice(0,32)},nc=(e,t,r)=>Rn([new Uint8Array([e]),t,qc(r,!0)]),ic=2,sc=0,ac=async({parentNode:e,childIndex:t,isHardened:r},n)=>{const i=r?nc(sc,e.privateKeyBytes,t+Vt):nc(ic,e.publicKeyBytes,t),s=await Ro({chainCode:e.chainCodeBytes,extension:i},n),a=s.subarray(0,32),o=s.subarray(32),c=e.privateKeyBytes.subarray(0,32),u=e.privateKeyBytes.subarray(32);return Rn([rc(ec(a),c),rc(o,u)])},oc=3,cc=1,uc=async({parentNode:e,childIndex:t,isHardened:r},n)=>{const i=r?nc(cc,e.privateKeyBytes,t+Vt):nc(oc,e.publicKeyBytes,t);return(await Ro({chainCode:e.chainCodeBytes,extension:i},n)).subarray(32)},lc=2,hc=async({parentNode:e,childIndex:t,curve:r},n)=>{const i=nc(lc,e.publicKeyBytes,t),s=(await Ro({chainCode:e.chainCodeBytes,extension:i},n)).slice(0,32),a=r.getPublicKey(ec(s));return r.publicAdd(e.publicKeyBytes,a)};async function dc(e,t){const{curve:r,node:n,path:i}=e;Uo(n);const{childIndex:s,isHardened:a}=Lo(i,n,r);if("ed25519Bip32"!==r.name||!n)throw new Error("Unsupported curve: Only ed25519Bip32 is supported by CIP3.");const o=s+(a?Vt:0),{privateKeyBytes:c,chainCodeBytes:u,publicKeyBytes:l,masterFingerprint:h,depth:d,fingerprint:f}=n;if(c){const e={privateKeyBytes:c,chainCodeBytes:u,publicKeyBytes:l},n=await ac({parentNode:e,childIndex:s,isHardened:a},t),i=await uc({parentNode:e,childIndex:s,isHardened:a},t);return Bc.fromExtendedKey({privateKey:In(n),chainCode:In(i),masterFingerprint:h,depth:d+1,parentFingerprint:f,index:o,curve:r.name},t)}xt(!a,"Invalid parameters: Cannot derive hardened child keys without a private key.");const p={chainCodeBytes:u,publicKeyBytes:l},g=await hc({parentNode:p,childIndex:s,isHardened:!1,curve:r},t),y=await uc({parentNode:p,childIndex:s,isHardened:!1},t);return Bc.fromExtendedKey({publicKey:In(g),chainCode:In(y),masterFingerprint:h,depth:d+1,parentFingerprint:f,index:o,curve:r.name},t)}async function fc(e,t){return await Po(e,pc,t)}async function pc(e,t,r){const{curve:n,isHardened:i,childIndex:s,entropy:a,chainCode:o}=t;if("ed25519"===n.name)throw e;const c=i?s+Vt:s,u=await Ro({chainCode:o,extension:Rn([1,a.slice(32,64),qc(c)])},r);return{...t,entropy:u}}const gc={bip32:i,bip39:s,slip10:o,cip3:a};async function yc(e,t){const{path:r,depth:n=r.length}=e,i="node"in e?e.node:void 0,s="network"in e?e.network:i?.network,a="curve"in e?e.curve:i?.curve;if(i&&!(i instanceof Bc)&&!(i instanceof mu)&&!(i instanceof Pc))throw new Error("Invalid arguments: Node must be a SLIP-10 node or a BIP-44 node when provided.");if(!a)throw new Error("Invalid arguments: Must specify either a parent node or curve.");return function(e,t,r){if(0===e.length)throw new Error("Invalid HD path segment: The segment must not be empty.");let n=!1;if(e.forEach((e,t)=>{if(0===t){if(n=e instanceof Uint8Array||Kt.test(e),!(e instanceof Uint8Array||n||Ft.test(e)||Mt.test(e)||jt.test(e)))throw mc()}else if(e instanceof Uint8Array||!Ft.test(e)&&!Mt.test(e)&&!jt.test(e))throw mc()}),0===r&&(!n||1!==e.length))throw new Error(`Invalid HD path segment: The segment must consist of a single BIP-39 node for depths of 0. Received: "${String(e)}".`);if(!t&&!n)throw new Error("Invalid derivation parameters: Must specify parent key if the first node of the path segment is not a BIP-39 node.");if(t&&n)throw new Error("Invalid derivation parameters: May not specify parent key if the path segment starts with a BIP-39 node.");const i=n?e.slice(1):e;if(i.length>0){const e=i[0]?.split(":")[0];xt(e),xt(i.every(t=>t.startsWith(`${e}:`)),"Invalid HD path segment: Cannot mix 'bip32' and 'slip10' path segments.")}}(r,Boolean(i?.privateKey)||Boolean(i?.publicKey),n),await r.reduce(async(e,r,n)=>{const i=await e;if("string"==typeof r){const[e,n]=r.split(":");xt(e),xt(n),xt(function(e){return e in gc}(e),`Unknown derivation type: "${e}".`);const o=gc[e];return await o.deriveChildKey({path:n,node:i,curve:ro(a),network:s},t)}return xt(0===n,mc()),await gc.bip39.deriveChildKey({path:r,node:i,curve:ro(a),network:s},t)},Promise.resolve(i))}function mc(){return new Error("Invalid HD path segment: The path segment is malformed.")}var bc,wc,vc,Ac,Ec=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},Cc=function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r};class Bc{static async fromJSON(e,t){return bc.fromExtendedKey(e,t)}static async fromExtendedKey(e,t){if("string"==typeof e){const r=du(e),{chainCode:n,depth:i,parentFingerprint:s,index:a}=r;if("private"===r.type){const{privateKey:e}=r;return bc.fromExtendedKey({depth:i,parentFingerprint:s,index:a,privateKey:e,chainCode:n,curve:"secp256k1"},t)}const{publicKey:o}=r;return bc.fromExtendedKey({depth:i,parentFingerprint:s,index:a,publicKey:o,chainCode:n,curve:"secp256k1"},t)}const{depth:r,masterFingerprint:n,parentFingerprint:i,index:s,network:a,privateKey:o,publicKey:c,chainCode:u,curve:l,guard:h}=e,d=Vc(u,Rt);zc(l),Sc(r),Lc(s),function(e,t){if(0===t&&0!==e)throw new Error(`Invalid index: The index of the root node must be 0. Received: "${String(e)}".`)}(s,r),function(e){if(void 0===e)return;if("string"!=typeof e)throw new Error("Invalid network: Must be a string if specified.");if(!["mainnet","testnet"].includes(e))throw new Error('Invalid network: Must be either "mainnet" or "testnet" if specified.')}(a),function(e,t){if(!Kc(e))throw new Error(`Invalid parent fingerprint: The fingerprint must be a positive integer. Received: "${String(e)}".`);if(0===t&&0!==e)throw new Error(`Invalid parent fingerprint: The fingerprint of the root node must be 0. Received: "${String(e)}".`);if(t>0&&0===e)throw new Error(`Invalid parent fingerprint: The fingerprint of a child node must not be 0. Received: "${String(e)}".`)}(i,r),function(e,t,r){if(!e)return;if(r>=2&&e===t)throw new Error(`Invalid parent fingerprint: The fingerprint of a child node cannot be equal to the master fingerprint. Received: "${String(t)}".`)}(n,i,r);const f=ro(l);if(o){const e=Hc(o,f.privateKeyLength);xt(f.isValidPrivateKey(e),`Invalid private key: Value is not a valid ${l} private key.`);const u=h===Io&&c?Vc(c,f.publicKeyLength):void 0;return new bc({depth:r,masterFingerprint:n,parentFingerprint:i,index:s,network:a,chainCode:d,privateKey:e,publicKey:u,curve:l},t,Ec(this,bc,"f",wc))}if(c){const e=Vc(c,f.publicKeyLength);return new bc({depth:r,masterFingerprint:n,parentFingerprint:i,index:s,network:a,chainCode:d,publicKey:e,curve:l},t,Ec(this,bc,"f",wc))}throw new Error("Invalid options: Must provide either a private key or a public key.")}static async fromDerivationPath({derivationPath:e,network:t,curve:r},n){if(zc(r),!e)throw new Error("Invalid options: Must provide a derivation path.");if(0===e.length)throw new Error("Invalid derivation path: May not specify an empty derivation path.");const i=await qo({path:e,curve:r},n);return await yc({path:i,depth:e.length-1,network:t,curve:r},n)}static async fromSeed({derivationPath:e,network:t,curve:r},n){if(zc(r),"ed25519Bip32"===r)throw new Error('Invalid curve: The curve "ed25519Bip32" is not supported by the `fromSeed` function.');if(!e)throw new Error("Invalid options: Must provide a derivation path.");if(0===e.length)throw new Error("Invalid derivation path: May not specify an empty derivation path.");return await yc({path:e,depth:e.length-1,network:t,curve:r},n)}constructor({depth:e,masterFingerprint:t,parentFingerprint:r,index:n,network:i="mainnet",chainCode:s,privateKey:a,publicKey:o,curve:c},u={},l){vc.set(this,void 0),Ac.set(this,void 0),xt(l===Ec(bc,bc,"f",wc),"SLIP10Node can only be constructed using `SLIP10Node.fromJSON`, `SLIP10Node.fromExtendedKey`, `SLIP10Node.fromDerivationPath`, or `SLIP10Node.fromSeed`."),xt(void 0!==a||void 0!==o,"SLIP10Node requires either a private key or a public key to be set."),this.depth=e,this.masterFingerprint=t,this.parentFingerprint=r,this.index=n,this.network=i,this.chainCodeBytes=s,this.privateKeyBytes=a,this.curve=c,Cc(this,vc,o,"f"),Cc(this,Ac,u,"f"),Object.freeze(this)}get chainCode(){return In(this.chainCodeBytes)}get privateKey(){if(this.privateKeyBytes)return In(this.privateKeyBytes)}get publicKey(){return In(this.publicKeyBytes)}get publicKeyBytes(){return void 0!==Ec(this,vc,"f")||(xt(this.privateKeyBytes,"Either a private key or public key is required."),Cc(this,vc,ro(this.curve).getPublicKey(this.privateKeyBytes),"f")),Ec(this,vc,"f")}get compressedPublicKeyBytes(){return ro(this.curve).compressPublicKey(this.publicKeyBytes)}get compressedPublicKey(){return In(this.compressedPublicKeyBytes)}get address(){if("secp256k1"!==this.curve)throw new Error("Unable to get address for this node: Only secp256k1 is supported.");return In(Fo(this.publicKeyBytes))}get fingerprint(){return Gc(this.compressedPublicKeyBytes,ro(this.curve).compressedPublicKeyLength)}get extendedKey(){xt("secp256k1"===this.curve,"Unable to get extended key for this node: Only secp256k1 is supported.");const e={depth:this.depth,parentFingerprint:this.parentFingerprint,index:this.index,network:this.network,chainCode:this.chainCodeBytes};return this.privateKeyBytes?fu({...e,type:"private",privateKey:this.privateKeyBytes}):fu({...e,type:"public",publicKey:this.publicKeyBytes})}neuter(){return new bc({depth:this.depth,masterFingerprint:this.masterFingerprint,parentFingerprint:this.parentFingerprint,index:this.index,chainCode:this.chainCodeBytes,publicKey:this.publicKeyBytes,curve:this.curve,network:this.network},Ec(this,Ac,"f"),Ec(bc,bc,"f",wc))}async derive(e){return await async function({path:e,node:t},r){if(0===e.length)throw new Error("Invalid HD tree derivation path: Deriving a path of length 0 is not defined.");const n=t.depth+e.length;return Sc(n),await yc({path:e,node:t,depth:n},r)}({path:e,node:this},Ec(this,Ac,"f"))}toJSON(){return{depth:this.depth,masterFingerprint:this.masterFingerprint,parentFingerprint:this.parentFingerprint,index:this.index,network:this.network,curve:this.curve,privateKey:this.privateKey,publicKey:this.publicKey,chainCode:this.chainCode}}}function Sc(e){if(!Kc(e))throw new Error(`Invalid HD tree path depth: The depth must be a positive integer. Received: "${String(e)}".`)}bc=Bc,vc=new WeakMap,Ac=new WeakMap,wc={value:Symbol("SLIP10Node.constructor")};var kc,Tc=function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r},Ic=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class Pc{static async fromJSON(e,t,r){xc(t),Nc(e.depth);const n=await mu.fromExtendedKey({depth:e.depth,index:e.index,network:e.network,parentFingerprint:e.parentFingerprint,chainCode:Fc(e.chainCode),privateKey:Mc(e.privateKey),publicKey:Fc(e.publicKey)},r);return new Pc(n,t)}static async fromDerivationPath(e,t,r){Nc(e.length-1);const n=await mu.fromDerivationPath({derivationPath:e,network:t},r),i=Wc(e);return new Pc(n,i)}static async fromSeed({derivationPath:e,network:t},r){Nc(e.length-1);const n=await mu.fromSeed({derivationPath:e,network:t},r),i=Wc(e);return new Pc(n,i)}static async fromNode(e,t){if(!(e instanceof mu))throw new Error("Invalid node: Expected an instance of BIP44Node.");return xc(t),Nc(e.depth),Promise.resolve(new Pc(e,t))}constructor(e,t){kc.set(this,void 0),Tc(this,kc,e,"f"),this.coin_type=t,this.path=function(e){return`m / ${Lt} / ${Oc(e)}`}(t),Object.freeze(this)}get depth(){return Ic(this,kc,"f").depth}get privateKeyBytes(){return Ic(this,kc,"f").privateKeyBytes}get publicKeyBytes(){return Ic(this,kc,"f").publicKeyBytes}get chainCodeBytes(){return Ic(this,kc,"f").chainCodeBytes}get privateKey(){return Ic(this,kc,"f").privateKey}get publicKey(){return Ic(this,kc,"f").publicKey}get compressedPublicKey(){return Ic(this,kc,"f").compressedPublicKey}get compressedPublicKeyBytes(){return Ic(this,kc,"f").compressedPublicKeyBytes}get chainCode(){return Ic(this,kc,"f").chainCode}get address(){return Ic(this,kc,"f").address}get masterFingerprint(){return Ic(this,kc,"f").masterFingerprint}get parentFingerprint(){return Ic(this,kc,"f").parentFingerprint}get fingerprint(){return Ic(this,kc,"f").fingerprint}get index(){return Ic(this,kc,"f").index}get network(){return Ic(this,kc,"f").network}get curve(){return Ic(this,kc,"f").curve}get extendedKey(){return Ic(this,kc,"f").extendedKey}async deriveBIP44AddressKey({account:e=0,change:t=0,address_index:r}){return await Ic(this,kc,"f").derive(function({account:e=0,change:t=0,address_index:r}){return[Oc(e),Uc(t),Uc(r)]}({account:e,change:t,address_index:r}))}toJSON(){return{...Ic(this,kc,"f").toJSON(),coin_type:this.coin_type,path:this.path}}}function Nc(e){if(2!==e)throw new Error(`Invalid depth: Coin type nodes must be of depth 2. Received: "${e}"`)}function xc(e){if("number"!=typeof e||!Number.isInteger(e)||e<0)throw new Error("Invalid coin type: The specified coin type must be a non-negative integer number.")}function Oc(e){return Lc(e),`${Rc(e)}'`}function Rc(e){return Lc(e),`bip32:${e}`}function Uc(e){if("number"==typeof e)return Rc(e);if(!e||!Number.isInteger(e.index)||"boolean"!=typeof e.hardened)throw new Error("Invalid BIP-32 index: Must be an object containing the index and whether it is hardened.");return e.hardened?Oc(e.index):Rc(e.index)}function Lc(e){if(!(Kc(t=e)&&t<=Ut))throw new Error("Invalid BIP-32 index: Must be a non-negative integer.");var t}function Dc(e){return e.endsWith("'")}function Fc(e){return e instanceof Uint8Array?e:Nn(e)}function Mc(e){if(void 0!==e)return Fc(e)}function jc(e,t){if(e.length!==t)return!1;for(const t of e)if(0!==t)return!0;return!1}function Kc(e){return"number"==typeof e&&Number.isInteger(e)&&e>=0}function Vc(e,t){if(e instanceof Uint8Array)return _c(e,t),e;if("string"==typeof e){const r=Nn(e);return _c(r,t),r}throw new Error("Invalid value: Expected an instance of Uint8Array or hexadecimal string.")}function Hc(e,t){if(e instanceof Uint8Array)return xt(e.length===t,`Invalid value: Must be a ${t}-byte byte array.`),e;if("string"==typeof e)return Hc(Nn(e),t);throw new Error("Invalid value: Expected an instance of Uint8Array or hexadecimal string.")}function _c(e,t){if(!jc(e,t))throw new Error(`Invalid value: Must be a non-zero ${t}-byte byte array.`)}kc=new WeakMap;const Gc=(e,t)=>{if(!jc(e,t))throw new Error(`Invalid public key: The key must be a ${t}-byte, non-zero byte array.`);var r;return Un((r=To(e),Eo(r))).getUint32(0,!1)};function zc(e){if(!e||"string"!=typeof e)throw new Error("Invalid curve: Must specify a curve.");if(!Object.keys(to).includes(e))throw new Error(`Invalid curve: Only the following curves are supported: ${Object.keys(to).join(", ")}.`)}function qc(e,t=!1){const r=new Uint8Array(4);return Un(r).setUint32(0,e,t),r}function Qc(){return Boolean(globalThis.crypto?.subtle)}function Wc(e){const t=e[2].split(":")[1]?.replace("'","");xt(t,"Invalid derivation path: Coin type is not specified.");const r=Number.parseInt(t,10);return xt(Kc(r),"Invalid derivation path: Coin type is not a valid integer."),r}const Jc=ws.CURVE,Yc="secp256k1",Zc=xn("Bitcoin seed"),Xc=!0,$c=65,eu=e=>ws.utils.isValidPrivateKey(e),tu=(()=>{let e=!1;return(t,r=!1)=>(e||(ws.ProjectivePoint.BASE._setWindowSize(4),e=!0),ws.getPublicKey(t,r))})(),ru=(e,t)=>{xt(jc(t,32),"Invalid tweak: Tweak must be a non-zero 32-byte Uint8Array.");const r=ws.ProjectivePoint.fromHex(e).add(ws.ProjectivePoint.fromPrivateKey(t));return r.assertValidity(),r.toRawBytes(!1)},nu=e=>ws.ProjectivePoint.fromHex(e).toRawBytes(!0),iu=e=>ws.ProjectivePoint.fromHex(e).toRawBytes(!1),su=32,au="slip10",ou=33,cu=76067358,uu=76066276,lu=70617039,hu=70615956;const du=e=>{const t=(e=>{const t=ea(To);try{return t.decode(e)}catch{throw new Error("Invalid extended key: Value is not base58-encoded, or the checksum is invalid.")}})(e);if(78!==t.length)throw new Error(`Invalid extended key: Expected a length of 78, got ${t.length}.`);const r=Un(t),n=r.getUint32(0,!1),{network:i,type:s}=function(e){switch(e){case cu:return{type:"public",network:"mainnet"};case lu:return{type:"public",network:"testnet"};case uu:return{type:"private",network:"mainnet"};case hu:return{type:"private",network:"testnet"};default:throw new Error("Invalid extended key: Expected a public (xpub) or private key (xprv) version.")}}(n),a=r.getUint8(4);bu(a);const o=r.getUint32(5,!1),c=r.getUint32(9,!1),u=t.slice(13,45);if(!jc(u,32))throw new Error("Invalid extended key: Chain code must be a 32-byte non-zero byte array.");const l=t.slice(45,78);if(!jc(l,33))throw new Error("Invalid extended key: Key must be a 33-byte non-zero byte array.");const h=Un(l);if("public"===s){if(2!==h.getUint8(0)&&3!==h.getUint8(0))throw new Error("Invalid extended key: Public key must start with 0x02 or 0x03.");return{type:s,depth:a,parentFingerprint:o,index:c,network:i,chainCode:u,publicKey:iu(l)}}if(0!==h.getUint8(0))throw new Error("Invalid extended key: Private key must start with 0x00.");return{type:s,depth:a,parentFingerprint:o,index:c,network:i,chainCode:u,privateKey:l.slice(1)}},fu=e=>{const{type:t,depth:r,parentFingerprint:n,index:i,network:s,chainCode:a}=e,o=new Uint8Array(78),c=Un(o),u=function(e,t){switch(e){case"mainnet":return"public"===t?cu:uu;case"testnet":return"public"===t?lu:hu;default:return Ot()}}(s,t);if(c.setUint32(0,u,!1),c.setUint8(4,r),c.setUint32(5,n,!1),c.setUint32(9,i,!1),o.set(a,13),"public"===t){const{publicKey:t}=e,r=nu(t);o.set(r,45)}if("private"===t){const{privateKey:t}=e;o.set(t,46)}return l=o,ea(To).encode(l);var l};var pu,gu=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},yu=function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r};class mu{static async fromJSON(e,t){return mu.fromExtendedKey(e,t)}static async fromExtendedKey(e,t){if("string"==typeof e){const r=du(e),{type:n,chainCode:i,depth:s,parentFingerprint:a,index:o,network:c}=r;if("private"===n){const{privateKey:e}=r;return mu.fromExtendedKey({depth:s,parentFingerprint:a,index:o,network:c,privateKey:e,chainCode:i},t)}const{publicKey:u}=r;return mu.fromExtendedKey({depth:s,parentFingerprint:a,index:o,network:c,publicKey:u,chainCode:i},t)}const{privateKey:r,publicKey:n,chainCode:i,depth:s,parentFingerprint:a,index:o,network:c}=e;bu(s);const u=await Bc.fromExtendedKey({privateKey:r,publicKey:n,chainCode:i,depth:s,parentFingerprint:a,index:o,network:c,curve:"secp256k1"},t);return new mu(u)}static async fromDerivationPath({derivationPath:e,network:t},r){bu(e.length-1),wu(e,0);const n=await Bc.fromDerivationPath({derivationPath:e,network:t,curve:"secp256k1"},r);return new mu(n)}static async fromSeed({derivationPath:e,network:t},r){bu(e.length-1),wu(e,0);const n=await Bc.fromSeed({derivationPath:e,network:t,curve:"secp256k1"},r);return new mu(n)}get depth(){return gu(this,pu,"f").depth}get privateKeyBytes(){return gu(this,pu,"f").privateKeyBytes}get publicKeyBytes(){return gu(this,pu,"f").publicKeyBytes}get chainCodeBytes(){return gu(this,pu,"f").chainCodeBytes}get privateKey(){return gu(this,pu,"f").privateKey}get publicKey(){return gu(this,pu,"f").publicKey}get compressedPublicKey(){return gu(this,pu,"f").compressedPublicKey}get compressedPublicKeyBytes(){return gu(this,pu,"f").compressedPublicKeyBytes}get chainCode(){return gu(this,pu,"f").chainCode}get address(){return gu(this,pu,"f").address}get masterFingerprint(){return gu(this,pu,"f").masterFingerprint}get parentFingerprint(){return gu(this,pu,"f").parentFingerprint}get fingerprint(){return gu(this,pu,"f").fingerprint}get index(){return gu(this,pu,"f").index}get network(){return gu(this,pu,"f").network}get extendedKey(){return gu(this,pu,"f").extendedKey}get curve(){return gu(this,pu,"f").curve}constructor(e){pu.set(this,void 0),yu(this,pu,e,"f"),Object.freeze(this)}neuter(){const e=gu(this,pu,"f").neuter();return new mu(e)}async derive(e){if(5===this.depth)throw new Error("Illegal operation: This HD tree node is already a leaf node.");bu(this.depth+e.length),wu(e,this.depth+1);const t=await gu(this,pu,"f").derive(e);return new mu(t)}toJSON(){return{depth:this.depth,masterFingerprint:this.masterFingerprint,parentFingerprint:this.parentFingerprint,index:this.index,network:this.network,privateKey:this.privateKey,publicKey:this.publicKey,chainCode:this.chainCode}}}function bu(e){if(Sc(e),e<0||e>5)throw new Error(`Invalid HD tree path depth: The depth must be a positive integer N such that 0 <= N <= 5. Received: "${e}"`)}function wu(e,t){e.forEach((e,r)=>{const n=t+r;if(0!==n)switch(xt("string"==typeof e),n){case 1:if(e!==Lt)throw new Error(`Invalid derivation path: The "purpose" node (depth 1) must be the string "${Lt}".`);break;case 2:if(!Ft.test(e)||!Dc(e))throw new Error('Invalid derivation path: The "coin_type" node (depth 2) must be a hardened BIP-32 node.');break;case 3:if(!Ft.test(e)||!Dc(e))throw new Error('Invalid derivation path: The "account" node (depth 3) must be a hardened BIP-32 node.');break;case 4:if(!Ft.test(e))throw new Error('Invalid derivation path: The "change" node (depth 4) must be a BIP-32 node.');break;case 5:if(!Ft.test(e))throw new Error('Invalid derivation path: The "address_index" node (depth 5) must be a BIP-32 node.')}else if(!(e instanceof Uint8Array||Kt.test(e)))throw new Error('Invalid derivation path: The "m" / seed node (depth 0) must be a BIP-39 node.')})}pu=new WeakMap;const vu=32,Au=new Uint8Array(vu),Eu=["then"],Cu={},Bu=new WeakMap;function Su(e){return Bu.get(e)}function ku(e,t){Bu.set(e,t)}function Tu(e,t){const r=new Error(`deferred error during ABI decoding triggered accessing ${e}`);throw r.error=t,r}function Iu(e,t,r){return e.indexOf(null)>=0?t.map((e,t)=>e instanceof Pu?Iu(Su(e),e,r):e):e.reduce((e,n,i)=>{let s=t.getValue(n);return n in e||(r&&s instanceof Pu&&(s=Iu(Su(s),s,r)),e[n]=s),e},{})}class Pu extends Array{#fe;constructor(...e){const t=e[0];let r=e[1],n=(e[2]||[]).slice(),i=!0;t!==Cu&&(r=e,n=[],i=!1),super(r.length),r.forEach((e,t)=>{this[t]=e});const s=n.reduce((e,t)=>("string"==typeof t&&e.set(t,(e.get(t)||0)+1),e),new Map);if(ku(this,Object.freeze(r.map((e,t)=>{const r=n[t];return null!=r&&1===s.get(r)?r:null}))),this.#fe=[],null==this.#fe&&this.#fe,!i)return;Object.freeze(this);const a=new Proxy(this,{get:(e,t,r)=>{if("string"==typeof t){if(t.match(/^[0-9]+$/)){const r=Je(t,"%index");if(r<0||r>=this.length)throw new RangeError("out of result range");const n=e[r];return n instanceof Error&&Tu(`index ${r}`,n),n}if(Eu.indexOf(t)>=0)return Reflect.get(e,t,r);const n=e[t];if(n instanceof Function)return function(...t){return n.apply(this===r?e:this,t)};if(!(t in e))return e.getValue.apply(this===r?e:this,[t])}return Reflect.get(e,t,r)}});return ku(a,Su(this)),a}toArray(e){const t=[];return this.forEach((r,n)=>{r instanceof Error&&Tu(`index ${n}`,r),e&&r instanceof Pu&&(r=r.toArray(e)),t.push(r)}),t}toObject(e){const t=Su(this);return t.reduce((r,n,i)=>(Ee(null!=n,`value at index ${i} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),Iu(t,this,e)),{})}slice(e,t){null==e&&(e=0),e<0&&(e+=this.length)<0&&(e=0),null==t&&(t=this.length),t<0&&(t+=this.length)<0&&(t=0),t>this.length&&(t=this.length);const r=Su(this),n=[],i=[];for(let s=e;s<t;s++)n.push(this[s]),i.push(r[s]);return new Pu(Cu,n,i)}filter(e,t){const r=Su(this),n=[],i=[];for(let s=0;s<this.length;s++){const a=this[s];a instanceof Error&&Tu(`index ${s}`,a),e.call(t,a,s,this)&&(n.push(a),i.push(r[s]))}return new Pu(Cu,n,i)}map(e,t){const r=[];for(let n=0;n<this.length;n++){const i=this[n];i instanceof Error&&Tu(`index ${n}`,i),r.push(e.call(t,i,n,this))}return r}getValue(e){const t=Su(this).indexOf(e);if(-1===t)return;const r=this[t];return r instanceof Error&&Tu(`property ${JSON.stringify(e)}`,r.error),r}static fromItems(e,t){return new Pu(Cu,e,t)}}function Nu(e){let t=Ze(e);return Ee(t.length<=vu,"value out-of-bounds","BUFFER_OVERRUN",{buffer:t,length:vu,offset:t.length}),t.length!==vu&&(t=Pe(Ue([Au.slice(t.length%vu),t]))),t}class xu{name;type;localName;dynamic;constructor(e,t,r,n){me(this,{name:e,type:t,localName:r,dynamic:n},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,t){Ce(!1,e,this.localName,t)}}class Ou{#M;#pe;constructor(){this.#M=[],this.#pe=0}get data(){return Ue(this.#M)}get length(){return this.#pe}#ge(e){return this.#M.push(e),this.#pe+=e.length,e.length}appendWriter(e){return this.#ge(Pe(e.data))}writeBytes(e){let t=Pe(e);const r=t.length%vu;return r&&(t=Pe(Ue([t,Au.slice(r)]))),this.#ge(t)}writeValue(e){return this.#ge(Nu(e))}writeUpdatableValue(){const e=this.#M.length;return this.#M.push(Au),this.#pe+=vu,t=>{this.#M[e]=Nu(t)}}}class Ru{allowLoose;#M;#ye;#me;#be;#we;constructor(e,t,r){me(this,{allowLoose:!!t}),this.#M=Pe(e),this.#me=0,this.#be=null,this.#we=null!=r?r:1024,this.#ye=0}get data(){return Re(this.#M)}get dataLength(){return this.#M.length}get consumed(){return this.#ye}get bytes(){return new Uint8Array(this.#M)}#ve(e){if(this.#be)return this.#be.#ve(e);this.#me+=e,Ee(this.#we<1||this.#me<=this.#we*this.dataLength,`compressed ABI data exceeds inflation ratio of ${this.#we} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:Pe(this.#M),offset:this.#ye,length:e,info:{bytesRead:this.#me,dataLength:this.dataLength}})}#Ae(e,t,r){let n=Math.ceil(t/vu)*vu;return this.#ye+n>this.#M.length&&(this.allowLoose&&r&&this.#ye+t<=this.#M.length?n=t:Ee(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Pe(this.#M),length:this.#M.length,offset:this.#ye+n})),this.#M.slice(this.#ye,this.#ye+n)}subReader(e){const t=new Ru(this.#M.slice(this.#ye+e),this.allowLoose,this.#we);return t.#be=this,t}readBytes(e,t){let r=this.#Ae(0,e,!!t);return this.#ve(e),this.#ye+=r.length,r.slice(0,e)}readValue(){return We(this.readBytes(vu))}readIndex(){return Je(We(this.readBytes(vu)))}}function Uu(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function Lu(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function Du(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");Uu(e.outputLen),Uu(e.blockLen)}function Fu(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Mu(e,t){Lu(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}const ju=BigInt(2**32-1),Ku=BigInt(32);function Vu(e,t=!1){return t?{h:Number(e&ju),l:Number(e>>Ku&ju)}:{h:0|Number(e>>Ku&ju),l:0|Number(e&ju)}}function Hu(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:s,l:a}=Vu(e[i],t);[r[i],n[i]]=[s,a]}return[r,n]}const _u=(e,t,r)=>e<<r|t>>>32-r,Gu=(e,t,r)=>t<<r|e>>>32-r,zu=(e,t,r)=>t<<r-32|e>>>64-r,qu=(e,t,r)=>e<<r-32|t>>>64-r;const Qu={fromBig:Vu,split:Hu,toBig:(e,t)=>BigInt(e>>>0)<<Ku|BigInt(t>>>0),shrSH:(e,t,r)=>e>>>r,shrSL:(e,t,r)=>e<<32-r|t>>>r,rotrSH:(e,t,r)=>e>>>r|t<<32-r,rotrSL:(e,t,r)=>e<<32-r|t>>>r,rotrBH:(e,t,r)=>e<<64-r|t>>>r-32,rotrBL:(e,t,r)=>e>>>r-32|t<<64-r,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:_u,rotlSL:Gu,rotlBH:zu,rotlBL:qu,add:function(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:0|i}},add3L:(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H:(e,t,r,n)=>t+r+n+(e/2**32|0)|0,add4L:(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),add4H:(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0,add5H:(e,t,r,n,i,s)=>t+r+n+i+s+(e/2**32|0)|0,add5L:(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0)},Wu="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,Ju=e=>e instanceof Uint8Array,Yu=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Zu=(e,t)=>e<<32-t|e>>>t;if(!(68===new Uint8Array(new Uint32Array([287454020]).buffer)[0]))throw new Error("Non little-endian hardware is not supported");Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Xu(e){if("string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),!Ju(e))throw new Error("expected Uint8Array, got "+typeof e);return e}class $u{clone(){return this._cloneInto()}}function el(e){const t=t=>e().update(Xu(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function tl(e=32){if(Wu&&"function"==typeof Wu.getRandomValues)return Wu.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}const[rl,nl,il]=[[],[],[]],sl=BigInt(0),al=BigInt(1),ol=BigInt(2),cl=BigInt(7),ul=BigInt(256),ll=BigInt(113);for(let e=0,t=al,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],rl.push(2*(5*n+r)),nl.push((e+1)*(e+2)/2%64);let i=sl;for(let e=0;e<7;e++)t=(t<<al^(t>>cl)*ll)%ul,t&ol&&(i^=al<<(al<<BigInt(e))-al);il.push(i)}const[hl,dl]=Hu(il,!0),fl=(e,t,r)=>r>32?zu(e,t,r):_u(e,t,r),pl=(e,t,r)=>r>32?qu(e,t,r):Gu(e,t,r);class gl extends $u{constructor(e,t,r,n=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Uu(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var s;this.state=new Uint8Array(200),this.state32=(s=this.state,new Uint32Array(s.buffer,s.byteOffset,Math.floor(s.byteLength/4)))}keccak(){!function(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,i=(t+2)%10,s=r[i],a=r[i+1],o=fl(s,a,1)^r[n],c=pl(s,a,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=o,e[t+r+1]^=c}let t=e[2],i=e[3];for(let r=0;r<24;r++){const n=nl[r],s=fl(t,i,n),a=pl(t,i,n),o=rl[r];t=e[o],i=e[o+1],e[o]=s,e[o+1]=a}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=hl[n],e[1]^=dl[n]}r.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Fu(this);const{blockLen:t,state:r}=this,n=(e=Xu(e)).length;for(let i=0;i<n;){const s=Math.min(t-this.pos,n-i);for(let t=0;t<s;t++)r[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,128&t&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){Fu(this,!1),Lu(e),this.finish();const t=this.state,{blockLen:r}=this;for(let n=0,i=e.length;n<i;){this.posOut>=r&&this.keccak();const s=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+s),n),this.posOut+=s,n+=s}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Uu(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Mu(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:s}=this;return e||(e=new gl(t,r,n,s,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=s,e.destroyed=this.destroyed,e}}const yl=(e,t,r)=>el(()=>new gl(t,e,r)),ml=yl(1,136,32);let bl=!1;const wl=function(e){return ml(e)};let vl=wl;function Al(e){const t=Ie(e,"data");return Re(vl(t))}Al._=wl,Al.lock=function(){bl=!0},Al.register=function(e){if(bl)throw new TypeError("keccak256 is locked");vl=e},Object.freeze(Al);const El=BigInt(0),Cl=BigInt(36);function Bl(e){const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let e=0;e<40;e++)r[e]=t[e].charCodeAt(0);const n=Ie(Al(r));for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&n[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const Sl={};for(let e=0;e<10;e++)Sl[String(e)]=String(e);for(let e=0;e<26;e++)Sl[String.fromCharCode(65+e)]=String(10+e);function kl(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map(e=>Sl[e]).join("");for(;t.length>=15;){let e=t.substring(0,15);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}const Tl=function(){const e={};for(let t=0;t<36;t++){e["0123456789abcdefghijklmnopqrstuvwxyz"[t]]=BigInt(t)}return e}();function Il(e){if(Ce("string"==typeof e,"invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/)){e.startsWith("0x")||(e="0x"+e);const t=Bl(e);return Ce(!e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||t===e,"bad address checksum","address",e),t}if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){Ce(e.substring(2,4)===kl(e),"bad icap checksum","address",e);let t=function(e){e=e.toLowerCase();let t=El;for(let r=0;r<e.length;r++)t=t*Cl+Tl[e[r]];return t}(e.substring(4)).toString(16);for(;t.length<40;)t="0"+t;return Bl("0x"+t)}Ce(!1,"invalid address","address",e)}const Pl={};function Nl(e,t){let r=!1;return t<0&&(r=!0,t*=-1),new Rl(Pl,`${r?"":"u"}int${t}`,e,{signed:r,width:t})}function xl(e,t){return new Rl(Pl,`bytes${t||""}`,e,{size:t})}const Ol=Symbol.for("_ethers_typed");class Rl{type;value;#e;_typedSymbol;constructor(e,t,r,n){null==n&&(n=null),ke(Pl,e,"Typed"),me(this,{_typedSymbol:Ol,type:t,value:r}),this.#e=n,this.format()}format(){if("array"===this.type)throw new Error("");if("dynamicArray"===this.type)throw new Error("");return"tuple"===this.type?`tuple(${this.value.map(e=>e.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return"string"===this.type}get tupleName(){if("tuple"!==this.type)throw TypeError("not a tuple");return this.#e}get arrayLength(){if("array"!==this.type)throw TypeError("not an array");return!0===this.#e?-1:!1===this.#e?this.value.length:null}static from(e,t){return new Rl(Pl,e,t)}static uint8(e){return Nl(e,8)}static uint16(e){return Nl(e,16)}static uint24(e){return Nl(e,24)}static uint32(e){return Nl(e,32)}static uint40(e){return Nl(e,40)}static uint48(e){return Nl(e,48)}static uint56(e){return Nl(e,56)}static uint64(e){return Nl(e,64)}static uint72(e){return Nl(e,72)}static uint80(e){return Nl(e,80)}static uint88(e){return Nl(e,88)}static uint96(e){return Nl(e,96)}static uint104(e){return Nl(e,104)}static uint112(e){return Nl(e,112)}static uint120(e){return Nl(e,120)}static uint128(e){return Nl(e,128)}static uint136(e){return Nl(e,136)}static uint144(e){return Nl(e,144)}static uint152(e){return Nl(e,152)}static uint160(e){return Nl(e,160)}static uint168(e){return Nl(e,168)}static uint176(e){return Nl(e,176)}static uint184(e){return Nl(e,184)}static uint192(e){return Nl(e,192)}static uint200(e){return Nl(e,200)}static uint208(e){return Nl(e,208)}static uint216(e){return Nl(e,216)}static uint224(e){return Nl(e,224)}static uint232(e){return Nl(e,232)}static uint240(e){return Nl(e,240)}static uint248(e){return Nl(e,248)}static uint256(e){return Nl(e,256)}static uint(e){return Nl(e,256)}static int8(e){return Nl(e,-8)}static int16(e){return Nl(e,-16)}static int24(e){return Nl(e,-24)}static int32(e){return Nl(e,-32)}static int40(e){return Nl(e,-40)}static int48(e){return Nl(e,-48)}static int56(e){return Nl(e,-56)}static int64(e){return Nl(e,-64)}static int72(e){return Nl(e,-72)}static int80(e){return Nl(e,-80)}static int88(e){return Nl(e,-88)}static int96(e){return Nl(e,-96)}static int104(e){return Nl(e,-104)}static int112(e){return Nl(e,-112)}static int120(e){return Nl(e,-120)}static int128(e){return Nl(e,-128)}static int136(e){return Nl(e,-136)}static int144(e){return Nl(e,-144)}static int152(e){return Nl(e,-152)}static int160(e){return Nl(e,-160)}static int168(e){return Nl(e,-168)}static int176(e){return Nl(e,-176)}static int184(e){return Nl(e,-184)}static int192(e){return Nl(e,-192)}static int200(e){return Nl(e,-200)}static int208(e){return Nl(e,-208)}static int216(e){return Nl(e,-216)}static int224(e){return Nl(e,-224)}static int232(e){return Nl(e,-232)}static int240(e){return Nl(e,-240)}static int248(e){return Nl(e,-248)}static int256(e){return Nl(e,-256)}static int(e){return Nl(e,-256)}static bytes1(e){return xl(e,1)}static bytes2(e){return xl(e,2)}static bytes3(e){return xl(e,3)}static bytes4(e){return xl(e,4)}static bytes5(e){return xl(e,5)}static bytes6(e){return xl(e,6)}static bytes7(e){return xl(e,7)}static bytes8(e){return xl(e,8)}static bytes9(e){return xl(e,9)}static bytes10(e){return xl(e,10)}static bytes11(e){return xl(e,11)}static bytes12(e){return xl(e,12)}static bytes13(e){return xl(e,13)}static bytes14(e){return xl(e,14)}static bytes15(e){return xl(e,15)}static bytes16(e){return xl(e,16)}static bytes17(e){return xl(e,17)}static bytes18(e){return xl(e,18)}static bytes19(e){return xl(e,19)}static bytes20(e){return xl(e,20)}static bytes21(e){return xl(e,21)}static bytes22(e){return xl(e,22)}static bytes23(e){return xl(e,23)}static bytes24(e){return xl(e,24)}static bytes25(e){return xl(e,25)}static bytes26(e){return xl(e,26)}static bytes27(e){return xl(e,27)}static bytes28(e){return xl(e,28)}static bytes29(e){return xl(e,29)}static bytes30(e){return xl(e,30)}static bytes31(e){return xl(e,31)}static bytes32(e){return xl(e,32)}static address(e){return new Rl(Pl,"address",e)}static bool(e){return new Rl(Pl,"bool",!!e)}static bytes(e){return new Rl(Pl,"bytes",e)}static string(e){return new Rl(Pl,"string",e)}static array(e,t){throw new Error("not implemented yet")}static tuple(e,t){throw new Error("not implemented yet")}static overrides(e){return new Rl(Pl,"overrides",Object.assign({},e))}static isTyped(e){return e&&"object"==typeof e&&"_typedSymbol"in e&&e._typedSymbol===Ol}static dereference(e,t){if(Rl.isTyped(e)){if(e.type!==t)throw new Error(`invalid type: expecetd ${t}, got ${e.type}`);return e.value}return e}}class Ul extends xu{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){let r=Rl.dereference(t,"string");try{r=Il(r)}catch(e){return this._throwError(e.message,t)}return e.writeValue(r)}decode(e){return Il(Ye(e.readValue(),20))}}class Ll extends xu{coder;constructor(e){super(e.name,e.type,"_",e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}function Dl(e,t,r){let n=[];if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let e={};n=t.map(t=>{const n=t.localName;return Ee(n,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:t},value:r}),Ee(!e[n],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:t},value:r}),e[n]=!0,r[n]})}else Ce(!1,"invalid tuple value","tuple",r);Ce(t.length===n.length,"types/value length mismatch","tuple",r);let i=new Ou,s=new Ou,a=[];t.forEach((e,t)=>{let r=n[t];if(e.dynamic){let t=s.length;e.encode(s,r);let n=i.writeUpdatableValue();a.push(e=>{n(e+t)})}else e.encode(i,r)}),a.forEach(e=>{e(i.length)});let o=e.appendWriter(i);return o+=e.appendWriter(s),o}function Fl(e,t){let r=[],n=[],i=e.subReader(0);return t.forEach(t=>{let s=null;if(t.dynamic){let r=e.readIndex(),n=i.subReader(r);try{s=t.decode(n)}catch(e){if(we(e,"BUFFER_OVERRUN"))throw e;s=e,s.baseType=t.name,s.name=t.localName,s.type=t.type}}else try{s=t.decode(e)}catch(e){if(we(e,"BUFFER_OVERRUN"))throw e;s=e,s.baseType=t.name,s.name=t.localName,s.type=t.type}if(null==s)throw new Error("investigate");r.push(s),n.push(t.localName||null)}),Pu.fromItems(r,n)}class Ml extends xu{coder;length;constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),me(this,{coder:e,length:t})}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let r=0;r<this.length;r++)t.push(e);return t}encode(e,t){const r=Rl.dereference(t,"array");Array.isArray(r)||this._throwError("expected array value",r);let n=this.length;-1===n&&(n=r.length,e.writeValue(r.length)),Be(r.length,n,"coder array"+(this.localName?" "+this.localName:""));let i=[];for(let e=0;e<r.length;e++)i.push(this.coder);return Dl(e,i,r)}decode(e){let t=this.length;-1===t&&(t=e.readIndex(),Ee(t*vu<=e.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:e.bytes,offset:t*vu,length:e.dataLength}));let r=[];for(let e=0;e<t;e++)r.push(new Ll(this.coder));return Fl(e,r)}}class jl extends xu{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){const r=Rl.dereference(t,"bool");return e.writeValue(r?1:0)}decode(e){return!!e.readValue()}}class Kl extends xu{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=Pe(t);let r=e.writeValue(t.length);return r+=e.writeBytes(t),r}decode(e){return e.readBytes(e.readIndex(),!0)}}class Vl extends Kl{constructor(e){super("bytes",e)}decode(e){return Re(super.decode(e))}}class Hl extends xu{size;constructor(e,t){let r="bytes"+String(e);super(r,r,t,!1),me(this,{size:e},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(e,t){let r=Pe(Rl.dereference(t,this.type));return r.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(r)}decode(e){return Re(e.readBytes(this.size))}}const _l=new Uint8Array([]);class Gl extends xu{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes(_l)}decode(e){return e.readBytes(0),null}}const zl=BigInt(0),ql=BigInt(1),Ql=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class Wl extends xu{size;signed;constructor(e,t,r){const n=(t?"int":"uint")+8*e;super(n,n,r,!1),me(this,{size:e,signed:t},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(e,t){let r=ze(Rl.dereference(t,this.type)),n=Ge(Ql,256);if(this.signed){let e=Ge(n,8*this.size-1);(r>e||r<-(e+ql))&&this._throwError("value out-of-bounds",t),r=_e(r,256)}else(r<zl||r>Ge(n,8*this.size))&&this._throwError("value out-of-bounds",t);return e.writeValue(r)}decode(e){let t=Ge(e.readValue(),8*this.size);return this.signed&&(t=He(t,8*this.size)),t}}function Jl(e,t,r,n,i){if("BAD_PREFIX"===e||"UNEXPECTED_CONTINUE"===e){let e=0;for(let n=t+1;n<r.length&&r[n]>>6==2;n++)e++;return e}return"OVERRUN"===e?r.length-t-1:0}const Yl=Object.freeze({error:function(e,t,r,n,i){Ce(!1,`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:Jl,replace:function(e,t,r,n,i){return"OVERLONG"===e?(Ce("number"==typeof i,"invalid bad code point for replacement","badCodepoint",i),n.push(i),0):(n.push(65533),Jl(e,t,r))}});function Zl(e,t){null==t&&(t=Yl.error);const r=Ie(e,"bytes"),n=[];let i=0;for(;i<r.length;){const e=r[i++];if(!(e>>7)){n.push(e);continue}let s=null,a=null;if(192==(224&e))s=1,a=127;else if(224==(240&e))s=2,a=2047;else{if(240!=(248&e)){i+=t(128==(192&e)?"UNEXPECTED_CONTINUE":"BAD_PREFIX",i-1,r,n);continue}s=3,a=65535}if(i-1+s>=r.length){i+=t("OVERRUN",i-1,r,n);continue}let o=e&(1<<8-s-1)-1;for(let e=0;e<s;e++){let e=r[i];if(128!=(192&e)){i+=t("MISSING_CONTINUE",i,r,n),o=null;break}o=o<<6|63&e,i++}null!==o&&(o>1114111?i+=t("OUT_OF_RANGE",i-1-s,r,n,o):o>=55296&&o<=57343?i+=t("UTF16_SURROGATE",i-1-s,r,n,o):o<=a?i+=t("OVERLONG",i-1-s,r,n,o):n.push(o))}return n}function Xl(e,t){Ce("string"==typeof e,"invalid string value","str",e),null!=t&&(!function(e){Ee(Se.indexOf(e)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:e}})}(t),e=e.normalize(t));let r=[];for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<128)r.push(n);else if(n<2048)r.push(n>>6|192),r.push(63&n|128);else if(55296==(64512&n)){t++;const i=e.charCodeAt(t);Ce(t<e.length&&56320==(64512&i),"invalid surrogate pair","str",e);const s=65536+((1023&n)<<10)+(1023&i);r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(63&s|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return new Uint8Array(r)}function $l(e,t){return Zl(e,t).map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e)))).join("")}class eh extends Kl{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,Xl(Rl.dereference(t,"string")))}decode(e){return $l(super.decode(e))}}class th extends xu{coders;constructor(e,t){let r=!1;const n=[];e.forEach(e=>{e.dynamic&&(r=!0),n.push(e.type)});super("tuple","tuple("+n.join(",")+")",t,r),me(this,{coders:Object.freeze(e.slice())})}defaultValue(){const e=[];this.coders.forEach(t=>{e.push(t.defaultValue())});const t=this.coders.reduce((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e},{});return this.coders.forEach((r,n)=>{let i=r.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[n]))}),Object.freeze(e)}encode(e,t){const r=Rl.dereference(t,"tuple");return Dl(e,this.coders,r)}decode(e){return Fl(e,this.coders)}}function rh(e){return Al(Xl(e))}function nh(e){const t=new Set;return e.forEach(e=>t.add(e)),Object.freeze(t)}const ih=nh("external public payable override".split(" ")),sh="constant external internal payable private public pure view override",ah=nh(sh.split(" ")),oh="constructor error event fallback function receive struct",ch=nh(oh.split(" ")),uh="calldata memory storage payable indexed",lh=nh(uh.split(" ")),hh=nh([oh,uh,"tuple returns",sh].join(" ").split(" ")),dh={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},fh=new RegExp("^(\\s*)"),ph=new RegExp("^([0-9]+)"),gh=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),yh=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),mh=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");class bh{#ye;#Qe;get offset(){return this.#ye}get length(){return this.#Qe.length-this.#ye}constructor(e){this.#ye=0,this.#Qe=e.slice()}clone(){return new bh(this.#Qe)}reset(){this.#ye=0}#We(e=0,t=0){return new bh(this.#Qe.slice(e,t).map(t=>Object.freeze(Object.assign({},t,{match:t.match-e,linkBack:t.linkBack-e,linkNext:t.linkNext-e}))))}popKeyword(e){const t=this.peek();if("KEYWORD"!==t.type||!e.has(t.text))throw new Error(`expected keyword ${t.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const t=this.peek();throw new Error(`expected ${e}; got ${t.type} ${JSON.stringify(t.text)}`)}return this.pop().text}popParen(){const e=this.peek();if("OPEN_PAREN"!==e.type)throw new Error("bad start");const t=this.#We(this.#ye+1,e.match+1);return this.#ye=e.match+1,t}popParams(){const e=this.peek();if("OPEN_PAREN"!==e.type)throw new Error("bad start");const t=[];for(;this.#ye<e.match-1;){const e=this.peek().linkNext;t.push(this.#We(this.#ye+1,e)),this.#ye=e}return this.#ye=e.match+1,t}peek(){if(this.#ye>=this.#Qe.length)throw new Error("out-of-bounds");return this.#Qe[this.#ye]}peekKeyword(e){const t=this.peekType("KEYWORD");return null!=t&&e.has(t)?t:null}peekType(e){if(0===this.length)return null;const t=this.peek();return t.type===e?t.text:null}pop(){const e=this.peek();return this.#ye++,e}toString(){const e=[];for(let t=this.#ye;t<this.#Qe.length;t++){const r=this.#Qe[t];e.push(`${r.type}:${r.text}`)}return`<TokenString ${e.join(" ")}>`}}function wh(e){const t=[],r=t=>{const r=s<e.length?JSON.stringify(e[s]):"$EOI";throw new Error(`invalid token ${r} at ${s}: ${t}`)};let n=[],i=[],s=0;for(;s<e.length;){let a=e.substring(s),o=a.match(fh);o&&(s+=o[1].length,a=e.substring(s));const c={depth:n.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:s,value:-1};t.push(c);let u=dh[a[0]]||"";if(u){if(c.type=u,c.text=a[0],s++,"OPEN_PAREN"===u)n.push(t.length-1),i.push(t.length-1);else if("CLOSE_PAREN"==u)0===n.length&&r("no matching open bracket"),c.match=n.pop(),t[c.match].match=t.length-1,c.depth--,c.linkBack=i.pop(),t[c.linkBack].linkNext=t.length-1;else if("COMMA"===u)c.linkBack=i.pop(),t[c.linkBack].linkNext=t.length-1,i.push(t.length-1);else if("OPEN_BRACKET"===u)c.type="BRACKET";else if("CLOSE_BRACKET"===u){let e=t.pop().text;if(t.length>0&&"NUMBER"===t[t.length-1].type){const r=t.pop().text;e=r+e,t[t.length-1].value=Je(r)}if(0===t.length||"BRACKET"!==t[t.length-1].type)throw new Error("missing opening bracket");t[t.length-1].text+=e}}else if(o=a.match(gh),o){if(c.text=o[1],s+=c.text.length,hh.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(mh)){c.type="TYPE";continue}c.type="ID"}else{if(o=a.match(ph),!o)throw new Error(`unexpected token ${JSON.stringify(a[0])} at position ${s}`);c.text=o[1],c.type="NUMBER",s+=c.text.length}}return new bh(t.map(e=>Object.freeze(e)))}function vh(e,t){let r=[];for(const n in t.keys())e.has(n)&&r.push(n);if(r.length>1)throw new Error(`conflicting types: ${r.join(", ")}`)}function Ah(e,t){if(t.peekKeyword(ch)){const r=t.pop().text;if(r!==e)throw new Error(`expected ${e}, got ${r}`)}return t.popType("ID")}function Eh(e,t){const r=new Set;for(;;){const n=e.peekType("KEYWORD");if(null==n||t&&!t.has(n))break;if(e.pop(),r.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);r.add(n)}return Object.freeze(r)}function Ch(e){let t=Eh(e,ah);return vh(t,nh("constant payable nonpayable".split(" "))),vh(t,nh("pure view payable nonpayable".split(" "))),t.has("view")?"view":t.has("pure")?"pure":t.has("payable")?"payable":t.has("nonpayable")?"nonpayable":t.has("constant")?"view":"nonpayable"}function Bh(e,t){return e.popParams().map(e=>Mh.from(e,t))}function Sh(e){if(e.peekType("AT")){if(e.pop(),e.peekType("NUMBER"))return ze(e.pop().text);throw new Error("invalid gas")}return null}function kh(e){if(e.length)throw new Error(`unexpected tokens at offset ${e.offset}: ${e.toString()}`)}const Th=new RegExp(/^(.*)\[([0-9]*)\]$/);function Ih(e){const t=e.match(mh);if(Ce(t,"invalid type","type",e),"uint"===e)return"uint256";if("int"===e)return"int256";if(t[2]){const r=parseInt(t[2]);Ce(0!==r&&r<=32,"invalid bytes length","type",e)}else if(t[3]){const r=parseInt(t[3]);Ce(0!==r&&r<=256&&r%8==0,"invalid numeric width","type",e)}return e}const Ph={},Nh=Symbol.for("_ethers_internal"),xh="_ParamTypeInternal",Oh="_ErrorInternal",Rh="_EventInternal",Uh="_ConstructorInternal",Lh="_FallbackInternal",Dh="_FunctionInternal",Fh="_StructInternal";class Mh{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(e,t,r,n,i,s,a,o){if(ke(e,Ph,"ParamType"),Object.defineProperty(this,Nh,{value:xh}),s&&(s=Object.freeze(s.slice())),"array"===n){if(null==a||null==o)throw new Error("")}else if(null!=a||null!=o)throw new Error("");if("tuple"===n){if(null==s)throw new Error("")}else if(null!=s)throw new Error("");me(this,{name:t,type:r,baseType:n,indexed:i,components:s,arrayLength:a,arrayChildren:o})}format(e){if(null==e&&(e="sighash"),"json"===e){const t=this.name||"";if(this.isArray()){const e=JSON.parse(this.arrayChildren.format("json"));return e.name=t,e.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(e)}const r={type:"tuple"===this.baseType?"tuple":this.type,name:t};return"boolean"==typeof this.indexed&&(r.indexed=this.indexed),this.isTuple()&&(r.components=this.components.map(t=>JSON.parse(t.format(e)))),JSON.stringify(r)}let t="";return this.isArray()?(t+=this.arrayChildren.format(e),t+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?t+="("+this.components.map(t=>t.format(e)).join("full"===e?", ":",")+")":t+=this.type,"sighash"!==e&&(!0===this.indexed&&(t+=" indexed"),"full"===e&&this.name&&(t+=" "+this.name)),t}isArray(){return"array"===this.baseType}isTuple(){return"tuple"===this.baseType}isIndexable(){return null!=this.indexed}walk(e,t){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(-1!==this.arrayLength&&e.length!==this.arrayLength)throw new Error("array is wrong length");const r=this;return e.map(e=>r.arrayChildren.walk(e,t))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const r=this;return e.map((e,n)=>r.components[n].walk(e,t))}return t(this.type,e)}#Je(e,t,r,n){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(-1!==this.arrayLength&&t.length!==this.arrayLength)throw new Error("array is wrong length");const i=this.arrayChildren,s=t.slice();return s.forEach((t,n)=>{i.#Je(e,t,r,e=>{s[n]=e})}),void n(s)}if(this.isTuple()){const i=this.components;let s;if(Array.isArray(t))s=t.slice();else{if(null==t||"object"!=typeof t)throw new Error("invalid tuple value");s=i.map(e=>{if(!e.name)throw new Error("cannot use object value with unnamed components");if(!(e.name in t))throw new Error(`missing value for component ${e.name}`);return t[e.name]})}if(s.length!==this.components.length)throw new Error("array is wrong length");return s.forEach((t,n)=>{i[n].#Je(e,t,r,e=>{s[n]=e})}),void n(s)}const i=r(this.type,t);i.then?e.push(async function(){n(await i)}()):n(i)}async walkAsync(e,t){const r=[],n=[e];return this.#Je(r,e,t,e=>{n[0]=e}),r.length&&await Promise.all(r),n[0]}static from(e,t){if(Mh.isParamType(e))return e;if("string"==typeof e)try{return Mh.from(wh(e),t)}catch(t){Ce(!1,"invalid param type","obj",e)}else if(e instanceof bh){let r="",n="",i=null;Eh(e,nh(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(n="tuple",i=e.popParams().map(e=>Mh.from(e)),r=`tuple(${i.map(e=>e.format()).join(",")})`):(r=Ih(e.popType("TYPE")),n=r);let s=null,a=null;for(;e.length&&e.peekType("BRACKET");){const t=e.pop();s=new Mh(Ph,"",r,n,null,i,a,s),a=t.value,r+=t.text,n="array",i=null}let o=null;if(Eh(e,lh).has("indexed")){if(!t)throw new Error("");o=!0}const c=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new Mh(Ph,c,r,n,o,i,a,s)}const r=e.name;Ce(!r||"string"==typeof r&&r.match(yh),"invalid name","obj.name",r);let n=e.indexed;null!=n&&(Ce(t,"parameter cannot be indexed","obj.indexed",e.indexed),n=!!n);let i=e.type,s=i.match(Th);if(s){const t=parseInt(s[2]||"-1"),a=Mh.from({type:s[1],components:e.components});return new Mh(Ph,r||"",i,"array",n,null,t,a)}if("tuple"===i||i.startsWith("tuple(")||i.startsWith("(")){const t=null!=e.components?e.components.map(e=>Mh.from(e)):null;return new Mh(Ph,r||"",i,"tuple",n,t,null,null)}return i=Ih(e.type),new Mh(Ph,r||"",i,i,n,null,null,null)}static isParamType(e){return e&&e[Nh]===xh}}class jh{type;inputs;constructor(e,t,r){ke(e,Ph,"Fragment"),me(this,{type:t,inputs:r=Object.freeze(r.slice())})}static from(e){if("string"==typeof e){try{jh.from(JSON.parse(e))}catch(e){}return jh.from(wh(e))}if(e instanceof bh){switch(e.peekKeyword(ch)){case"constructor":return Gh.from(e);case"error":return Hh.from(e);case"event":return _h.from(e);case"fallback":case"receive":return zh.from(e);case"function":return qh.from(e);case"struct":return Qh.from(e)}}else if("object"==typeof e){switch(e.type){case"constructor":return Gh.from(e);case"error":return Hh.from(e);case"event":return _h.from(e);case"fallback":case"receive":return zh.from(e);case"function":return qh.from(e);case"struct":return Qh.from(e)}Ee(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}Ce(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return Gh.isFragment(e)}static isError(e){return Hh.isFragment(e)}static isEvent(e){return _h.isFragment(e)}static isFunction(e){return qh.isFragment(e)}static isStruct(e){return Qh.isFragment(e)}}class Kh extends jh{name;constructor(e,t,r,n){super(e,t,n),Ce("string"==typeof r&&r.match(yh),"invalid identifier","name",r),n=Object.freeze(n.slice()),me(this,{name:r})}}function Vh(e,t){return"("+t.map(t=>t.format(e)).join("full"===e?", ":",")+")"}class Hh extends Kh{constructor(e,t,r){super(e,"error",t,r),Object.defineProperty(this,Nh,{value:Oh})}get selector(){return rh(this.format("sighash")).substring(0,10)}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(t=>JSON.parse(t.format(e)))});const t=[];return"sighash"!==e&&t.push("error"),t.push(this.name+Vh(e,this.inputs)),t.join(" ")}static from(e){if(Hh.isFragment(e))return e;if("string"==typeof e)return Hh.from(wh(e));if(e instanceof bh){const t=Ah("error",e),r=Bh(e);return kh(e),new Hh(Ph,t,r)}return new Hh(Ph,e.name,e.inputs?e.inputs.map(Mh.from):[])}static isFragment(e){return e&&e[Nh]===Oh}}class _h extends Kh{anonymous;constructor(e,t,r,n){super(e,"event",t,r),Object.defineProperty(this,Nh,{value:Rh}),me(this,{anonymous:n})}get topicHash(){return rh(this.format("sighash"))}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(t=>JSON.parse(t.format(e)))});const t=[];return"sighash"!==e&&t.push("event"),t.push(this.name+Vh(e,this.inputs)),"sighash"!==e&&this.anonymous&&t.push("anonymous"),t.join(" ")}static getTopicHash(e,t){t=(t||[]).map(e=>Mh.from(e));return new _h(Ph,e,t,!1).topicHash}static from(e){if(_h.isFragment(e))return e;if("string"==typeof e)try{return _h.from(wh(e))}catch(t){Ce(!1,"invalid event fragment","obj",e)}else if(e instanceof bh){const t=Ah("event",e),r=Bh(e,!0),n=!!Eh(e,nh(["anonymous"])).has("anonymous");return kh(e),new _h(Ph,t,r,n)}return new _h(Ph,e.name,e.inputs?e.inputs.map(e=>Mh.from(e,!0)):[],!!e.anonymous)}static isFragment(e){return e&&e[Nh]===Rh}}class Gh extends jh{payable;gas;constructor(e,t,r,n,i){super(e,t,r),Object.defineProperty(this,Nh,{value:Uh}),me(this,{payable:n,gas:i})}format(e){if(Ee(null!=e&&"sighash"!==e,"cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),"json"===e)return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map(t=>JSON.parse(t.format(e)))});const t=[`constructor${Vh(e,this.inputs)}`];return this.payable&&t.push("payable"),null!=this.gas&&t.push(`@${this.gas.toString()}`),t.join(" ")}static from(e){if(Gh.isFragment(e))return e;if("string"==typeof e)try{return Gh.from(wh(e))}catch(t){Ce(!1,"invalid constuctor fragment","obj",e)}else if(e instanceof bh){Eh(e,nh(["constructor"]));const t=Bh(e),r=!!Eh(e,ih).has("payable"),n=Sh(e);return kh(e),new Gh(Ph,"constructor",t,r,n)}return new Gh(Ph,"constructor",e.inputs?e.inputs.map(Mh.from):[],!!e.payable,null!=e.gas?e.gas:null)}static isFragment(e){return e&&e[Nh]===Uh}}class zh extends jh{payable;constructor(e,t,r){super(e,"fallback",t),Object.defineProperty(this,Nh,{value:Lh}),me(this,{payable:r})}format(e){const t=0===this.inputs.length?"receive":"fallback";if("json"===e){const e=this.payable?"payable":"nonpayable";return JSON.stringify({type:t,stateMutability:e})}return`${t}()${this.payable?" payable":""}`}static from(e){if(zh.isFragment(e))return e;if("string"==typeof e)try{return zh.from(wh(e))}catch(t){Ce(!1,"invalid fallback fragment","obj",e)}else if(e instanceof bh){const t=e.toString();Ce(e.peekKeyword(nh(["fallback","receive"])),"type must be fallback or receive","obj",t);if("receive"===e.popKeyword(nh(["fallback","receive"]))){const t=Bh(e);return Ce(0===t.length,"receive cannot have arguments","obj.inputs",t),Eh(e,nh(["payable"])),kh(e),new zh(Ph,[],!0)}let r=Bh(e);r.length?Ce(1===r.length&&"bytes"===r[0].type,"invalid fallback inputs","obj.inputs",r.map(e=>e.format("minimal")).join(", ")):r=[Mh.from("bytes")];const n=Ch(e);if(Ce("nonpayable"===n||"payable"===n,"fallback cannot be constants","obj.stateMutability",n),Eh(e,nh(["returns"])).has("returns")){const t=Bh(e);Ce(1===t.length&&"bytes"===t[0].type,"invalid fallback outputs","obj.outputs",t.map(e=>e.format("minimal")).join(", "))}return kh(e),new zh(Ph,r,"payable"===n)}if("receive"===e.type)return new zh(Ph,[],!0);if("fallback"===e.type){const t=[Mh.from("bytes")],r="payable"===e.stateMutability;return new zh(Ph,t,r)}Ce(!1,"invalid fallback description","obj",e)}static isFragment(e){return e&&e[Nh]===Lh}}class qh extends Kh{constant;outputs;stateMutability;payable;gas;constructor(e,t,r,n,i,s){super(e,"function",t,n),Object.defineProperty(this,Nh,{value:Dh});me(this,{constant:"view"===r||"pure"===r,gas:s,outputs:i=Object.freeze(i.slice()),payable:"payable"===r,stateMutability:r})}get selector(){return rh(this.format("sighash")).substring(0,10)}format(e){if(null==e&&(e="sighash"),"json"===e)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:null!=this.gas?this.gas:void 0,inputs:this.inputs.map(t=>JSON.parse(t.format(e))),outputs:this.outputs.map(t=>JSON.parse(t.format(e)))});const t=[];return"sighash"!==e&&t.push("function"),t.push(this.name+Vh(e,this.inputs)),"sighash"!==e&&("nonpayable"!==this.stateMutability&&t.push(this.stateMutability),this.outputs&&this.outputs.length&&(t.push("returns"),t.push(Vh(e,this.outputs))),null!=this.gas&&t.push(`@${this.gas.toString()}`)),t.join(" ")}static getSelector(e,t){t=(t||[]).map(e=>Mh.from(e));return new qh(Ph,e,"view",t,[],null).selector}static from(e){if(qh.isFragment(e))return e;if("string"==typeof e)try{return qh.from(wh(e))}catch(t){Ce(!1,"invalid function fragment","obj",e)}else if(e instanceof bh){const t=Ah("function",e),r=Bh(e),n=Ch(e);let i=[];Eh(e,nh(["returns"])).has("returns")&&(i=Bh(e));const s=Sh(e);return kh(e),new qh(Ph,t,n,r,i,s)}let t=e.stateMutability;return null==t&&(t="payable","boolean"==typeof e.constant?(t="view",e.constant||(t="payable","boolean"!=typeof e.payable||e.payable||(t="nonpayable"))):"boolean"!=typeof e.payable||e.payable||(t="nonpayable")),new qh(Ph,e.name,t,e.inputs?e.inputs.map(Mh.from):[],e.outputs?e.outputs.map(Mh.from):[],null!=e.gas?e.gas:null)}static isFragment(e){return e&&e[Nh]===Dh}}class Qh extends Kh{constructor(e,t,r){super(e,"struct",t,r),Object.defineProperty(this,Nh,{value:Fh})}format(){throw new Error("@TODO")}static from(e){if("string"==typeof e)try{return Qh.from(wh(e))}catch(t){Ce(!1,"invalid struct fragment","obj",e)}else if(e instanceof bh){const t=Ah("struct",e),r=Bh(e);return kh(e),new Qh(Ph,t,r)}return new Qh(Ph,e.name,e.inputs?e.inputs.map(Mh.from):[])}static isFragment(e){return e&&e[Nh]===Fh}}const Wh=new Map;Wh.set(0,"GENERIC_PANIC"),Wh.set(1,"ASSERT_FALSE"),Wh.set(17,"OVERFLOW"),Wh.set(18,"DIVIDE_BY_ZERO"),Wh.set(33,"ENUM_RANGE_ERROR"),Wh.set(34,"BAD_STORAGE_DATA"),Wh.set(49,"STACK_UNDERFLOW"),Wh.set(50,"ARRAY_RANGE_ERROR"),Wh.set(65,"OUT_OF_MEMORY"),Wh.set(81,"UNINITIALIZED_FUNCTION_CALL");const Jh=new RegExp(/^bytes([0-9]*)$/),Yh=new RegExp(/^(u?int)([0-9]*)$/);let Zh=null,Xh=1024;class $h{#Yt(e){if(e.isArray())return new Ml(this.#Yt(e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new th(e.components.map(e=>this.#Yt(e)),e.name);switch(e.baseType){case"address":return new Ul(e.name);case"bool":return new jl(e.name);case"string":return new eh(e.name);case"bytes":return new Vl(e.name);case"":return new Gl(e.name)}let t=e.type.match(Yh);if(t){let r=parseInt(t[2]||"256");return Ce(0!==r&&r<=256&&r%8==0,"invalid "+t[1]+" bit length","param",e),new Wl(r/8,"int"===t[1],e.name)}if(t=e.type.match(Jh),t){let r=parseInt(t[1]);return Ce(0!==r&&r<=32,"invalid bytes length","param",e),new Hl(r,e.name)}Ce(!1,"invalid type","type",e.type)}getDefaultValue(e){const t=e.map(e=>this.#Yt(Mh.from(e)));return new th(t,"_").defaultValue()}encode(e,t){Be(t.length,e.length,"types/values length mismatch");const r=e.map(e=>this.#Yt(Mh.from(e))),n=new th(r,"_"),i=new Ou;return n.encode(i,t),i.data}decode(e,t,r){const n=e.map(e=>this.#Yt(Mh.from(e)));return new th(n,"_").decode(new Ru(t,r,Xh))}static _setDefaultMaxInflation(e){Ce("number"==typeof e&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),Xh=e}static defaultAbiCoder(){return null==Zh&&(Zh=new $h),Zh}static getBuiltinCallException(e,t,r){return function(e,t,r,n){let i="missing revert data",s=null,a=null;if(r){i="execution reverted";const e=Ie(r);if(r=Re(r),0===e.length)i+=" (no data present; likely require(false) occurred",s="require(false)";else if(e.length%32!=4)i+=" (could not decode reason; invalid data length)";else if("0x08c379a0"===Re(e.slice(0,4)))try{s=n.decode(["string"],e.slice(4))[0],a={signature:"Error(string)",name:"Error",args:[s]},i+=`: ${JSON.stringify(s)}`}catch(e){i+=" (could not decode reason; invalid string data)"}else if("0x4e487b71"===Re(e.slice(0,4)))try{const t=Number(n.decode(["uint256"],e.slice(4))[0]);a={signature:"Panic(uint256)",name:"Panic",args:[t]},s=`Panic due to ${Wh.get(t)||"UNKNOWN"}(${t})`,i+=`: ${s}`}catch(e){i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const o={to:t.to?Il(t.to):null,data:t.data||"0x"};return t.from&&(o.from=Il(t.from)),Ae(i,"CALL_EXCEPTION",{action:e,data:r,reason:s,transaction:o,invocation:null,revert:a})}(e,t,r,$h.defaultAbiCoder())}}function ed(e){return e&&"function"==typeof e.getAddress}async function td(e,t){const r=await t;return null!=r&&"0x0000000000000000000000000000000000000000"!==r||(Ee("string"!=typeof e,"unconfigured name","UNCONFIGURED_NAME",{value:e}),Ce(!1,"invalid AddressLike value; did not resolve to a value address","target",e)),Il(r)}function rd(e,t){return"string"==typeof e?e.match(/^0x[0-9a-f]{40}$/i)?Il(e):(Ee(null!=t,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),td(e,t.resolveName(e))):ed(e)?td(e,e.getAddress()):e&&"function"==typeof e.then?td(e,e):void Ce(!1,"unsupported addressable value","target",e)}const nd=new Uint8Array(32);nd.fill(0);const id=BigInt(-1),sd=BigInt(0),ad=BigInt(1),od=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const cd=Ye(ad,32),ud=Ye(sd,32),ld={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},hd=["name","version","chainId","verifyingContract","salt"];function dd(e){return function(t){return Ce("string"==typeof t,`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const fd={name:dd("name"),version:dd("version"),chainId:function(e){const t=ze(e,"domain.chainId");return Ce(t>=0,"invalid chain ID","domain.chainId",e),Number.isSafeInteger(t)?Number(t):Xe(t)},verifyingContract:function(e){try{return Il(e).toLowerCase()}catch(e){}Ce(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){const t=Ie(e,"domain.salt");return Ce(32===t.length,'invalid domain value "salt"',"domain.salt",e),Re(t)}};function pd(e){{const t=e.match(/^(u?)int(\d+)$/);if(t){const r=""===t[1],n=parseInt(t[2]);Ce(n%8==0&&0!==n&&n<=256&&t[2]===String(n),"invalid numeric width","type",e);const i=Ge(od,r?n-1:n),s=r?(i+ad)*id:sd;return function(t){const n=ze(t,"value");return Ce(n>=s&&n<=i,`value out-of-bounds for ${e}`,"value",n),Ye(r?_e(n,256):n,32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return Ce(0!==r&&r<=32&&t[1]===String(r),"invalid bytes width","type",e),function(t){return Ce(Ie(t).length===r,`invalid length for ${e}`,"value",t),function(e){const t=Ie(e),r=t.length%32;return r?Ue([t,nd.slice(r)]):Re(t)}(t)}}}switch(e){case"address":return function(e){return Me(Il(e),32)};case"bool":return function(e){return e?cd:ud};case"bytes":return function(e){return Al(e)};case"string":return function(e){return rh(e)}}return null}function gd(e,t){return`${e}(${t.map(({name:e,type:t})=>t+" "+e).join(",")})`}function yd(e){const t=e.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return t?{base:t[1],index:t[2]+t[4],array:{base:t[1],prefix:t[1]+t[2],count:t[5]?parseInt(t[5]):-1}}:{base:e}}class md{primaryType;#Mt;get types(){return JSON.parse(this.#Mt)}#jt;#Kt;constructor(e){this.#jt=new Map,this.#Kt=new Map;const t=new Map,r=new Map,n=new Map,i={};Object.keys(e).forEach(s=>{i[s]=e[s].map(({name:t,type:r})=>{let{base:n,index:i}=yd(r);return"int"!==n||e.int||(n="int256"),"uint"!==n||e.uint||(n="uint256"),{name:t,type:n+(i||"")}}),t.set(s,new Set),r.set(s,[]),n.set(s,new Set)}),this.#Mt=JSON.stringify(i);for(const n in i){const s=new Set;for(const a of i[n]){Ce(!s.has(a.name),`duplicate variable name ${JSON.stringify(a.name)} in ${JSON.stringify(n)}`,"types",e),s.add(a.name);const i=yd(a.type).base;Ce(i!==n,`circular type reference to ${JSON.stringify(i)}`,"types",e);pd(i)||(Ce(r.has(i),`unknown type ${JSON.stringify(i)}`,"types",e),r.get(i).push(n),t.get(n).add(i))}}const s=Array.from(r.keys()).filter(e=>0===r.get(e).length);Ce(0!==s.length,"missing primary type","types",e),Ce(1===s.length,`ambiguous primary types or unused types: ${s.map(e=>JSON.stringify(e)).join(", ")}`,"types",e),me(this,{primaryType:s[0]}),function i(s,a){Ce(!a.has(s),`circular type reference to ${JSON.stringify(s)}`,"types",e),a.add(s);for(const e of t.get(s))if(r.has(e)){i(e,a);for(const t of a)n.get(t).add(e)}a.delete(s)}(this.primaryType,new Set);for(const[e,t]of n){const r=Array.from(t);r.sort(),this.#jt.set(e,gd(e,i[e])+r.map(e=>gd(e,i[e])).join(""))}}getEncoder(e){let t=this.#Kt.get(e);return t||(t=this.#Vt(e),this.#Kt.set(e,t)),t}#Vt(e){{const t=pd(e);if(t)return t}const t=yd(e).array;if(t){const e=t.prefix,r=this.getEncoder(e);return n=>{Ce(-1===t.count||t.count===n.length,`array length mismatch; expected length ${t.count}`,"value",n);let i=n.map(r);return this.#jt.has(e)&&(i=i.map(Al)),Al(Ue(i))}}const r=this.types[e];if(r){const t=rh(this.#jt.get(e));return e=>{const n=r.map(({name:t,type:r})=>{const n=this.getEncoder(r)(e[t]);return this.#jt.has(r)?Al(n):n});return n.unshift(t),Ue(n)}}Ce(!1,`unknown type: ${e}`,"type",e)}encodeType(e){const t=this.#jt.get(e);return Ce(t,`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return Al(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if(pd(e))return r(e,t);const n=yd(e).array;if(n)return Ce(-1===n.count||n.count===t.length,`array length mismatch; expected length ${n.count}`,"value",t),t.map(e=>this._visit(n.prefix,e,r));const i=this.types[e];if(i)return i.reduce((e,{name:n,type:i})=>(e[n]=this._visit(i,t[n],r),e),{});Ce(!1,`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new md(e)}static getPrimaryType(e){return md.from(e).primaryType}static hashStruct(e,t,r){return md.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){if(null==e[r])continue;const n=ld[r];Ce(n,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort((e,t)=>hd.indexOf(e.name)-hd.indexOf(t.name)),md.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return Ue(["0x1901",md.hashDomain(e),md.from(t).hash(r)])}static hash(e,t,r){return Al(md.encode(e,t,r))}static async resolveNames(e,t,r,n){e=Object.assign({},e);for(const t in e)null==e[t]&&delete e[t];const i={};e.verifyingContract&&!Ne(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const s=md.from(t);s.visit(r,(e,t)=>("address"!==e||Ne(t,20)||(i[t]="0x"),t));for(const e in i)i[e]=await n(e);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),{domain:e,value:r=s.visit(r,(e,t)=>"address"===e&&i[t]?i[t]:t)}}static getPayload(e,t,r){md.hashDomain(e);const n={},i=[];hd.forEach(t=>{const r=e[t];null!=r&&(n[t]=fd[t](r),i.push({name:t,type:ld[t]}))});const s=md.from(t);t=s.types;const a=Object.assign({},t);return Ce(null==a.EIP712Domain,"types must not contain EIP712Domain type","types.EIP712Domain",t),a.EIP712Domain=i,s.encode(r),{types:a,domain:n,primaryType:s.primaryType,message:s.visit(r,(e,t)=>{if(e.match(/^bytes(\d*)/))return Re(Ie(t));if(e.match(/^u?int/))return ze(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return Ce("string"==typeof t,"invalid string","value",t),t}Ce(!1,"unsupported type","type",e)})}}}function bd(e,t){return{address:Il(e),storageKeys:t.map((e,t)=>(Ce(Ne(e,32),"invalid slot",`storageKeys[${t}]`,e),e.toLowerCase()))}}function wd(e){if(Array.isArray(e))return e.map((t,r)=>Array.isArray(t)?(Ce(2===t.length,"invalid slot set",`value[${r}]`,t),bd(t[0],t[1])):(Ce(null!=t&&"object"==typeof t,"invalid address-slot set","value",e),bd(t.address,t.storageKeys)));Ce(null!=e&&"object"==typeof e,"invalid access list","value",e);const t=Object.keys(e).map(t=>{const r=e[t].reduce((e,t)=>(e[t]=!0,e),{});return bd(t,Object.keys(r).sort())});return t.sort((e,t)=>e.address.localeCompare(t.address)),t}const vd="0x0000000000000000000000000000000000000000000000000000000000000000",Ad=BigInt(0),Ed=BigInt(1),Cd=BigInt(2),Bd=BigInt(27),Sd=BigInt(28),kd=BigInt(35),Td={};function Id(e){return Me(Ze(e),32)}class Pd{#ee;#te;#re;#ne;get r(){return this.#ee}set r(e){Ce(32===Le(e),"invalid r","value",e),this.#ee=Re(e)}get s(){return Ce(parseInt(this.#te.substring(0,3))<8,"non-canonical s; use ._s","s",this.#te),this.#te}set s(e){Ce(32===Le(e),"invalid s","value",e),this.#te=Re(e)}get _s(){return this.#te}isValid(){return parseInt(this.#te.substring(0,3))<8}get v(){return this.#re}set v(e){const t=Je(e,"value");Ce(27===t||28===t,"invalid v","v",e),this.#re=t}get networkV(){return this.#ne}get legacyChainId(){const e=this.networkV;return null==e?null:Pd.getChainId(e)}get yParity(){return 27===this.v?0:1}get yParityAndS(){const e=Ie(this.s);return this.yParity&&(e[0]|=128),Re(e)}get compactSerialized(){return Ue([this.r,this.yParityAndS])}get serialized(){return Ue([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(e,t,r,n){ke(e,Td,"Signature"),this.#ee=t,this.#te=r,this.#re=n,this.#ne=null}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this._s}"${this.isValid()?"":', valid: "false"'}, yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new Pd(Td,this.r,this._s,this.v);return this.networkV&&(e.#ne=this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:null!=e?e.toString():null,r:this.r,s:this._s,v:this.v}}static getChainId(e){const t=ze(e,"v");return t==Bd||t==Sd?Ad:(Ce(t>=kd,"invalid EIP-155 v","v",e),(t-kd)/Cd)}static getChainIdV(e,t){return ze(e)*Cd+BigInt(35+t-27)}static getNormalizedV(e){const t=ze(e);return t===Ad||t===Bd?27:t===Ed||t===Sd?28:(Ce(t>=kd,"invalid v","v",e),t&Ed?27:28)}static from(e){function t(t,r){Ce(t,r,"signature",e)}if(null==e)return new Pd(Td,vd,vd,27);if("string"==typeof e){const r=Ie(e,"signature");if(64===r.length){const e=Re(r.slice(0,32)),t=r.slice(32,64),n=128&t[0]?28:27;return t[0]&=127,new Pd(Td,e,Re(t),n)}if(65===r.length){const e=Re(r.slice(0,32)),t=Re(r.slice(32,64)),n=Pd.getNormalizedV(r[64]);return new Pd(Td,e,t,n)}t(!1,"invalid raw signature length")}if(e instanceof Pd)return e.clone();const r=e.r;t(null!=r,"missing r");const n=Id(r),i=function(e,r){if(null!=e)return Id(e);if(null!=r){t(Ne(r,32),"invalid yParityAndS");const e=Ie(r);return e[0]&=127,Re(e)}t(!1,"missing s")}(e.s,e.yParityAndS),{networkV:s,v:a}=function(e,r,n){if(null!=e){const t=ze(e);return{networkV:t>=kd?t:void 0,v:Pd.getNormalizedV(t)}}if(null!=r)return t(Ne(r,32),"invalid yParityAndS"),{v:128&Ie(r)[0]?28:27};if(null!=n){switch(Je(n,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}t(!1,"invalid yParity")}t(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),o=new Pd(Td,n,i,a);return s&&(o.#ne=s),t(null==e.yParity||Je(e.yParity,"sig.yParity")===o.yParity,"yParity mismatch"),t(null==e.yParityAndS||e.yParityAndS===o.yParityAndS,"yParityAndS mismatch"),o}}function Nd(e){return{address:Il(e.address),nonce:ze(null!=e.nonce?e.nonce:0),chainId:ze(null!=e.chainId?e.chainId:0),signature:Pd.from(e.signature)}}function xd(e){return async function(t,r){Ee(null==r||!r.cancelled,"request cancelled before sending","CANCELLED");const n=t.url.split(":")[0].toLowerCase();Ee("http"===n||"https"===n,`unsupported protocol ${n}`,"UNSUPPORTED_OPERATION",{info:{protocol:n},operation:"request"}),Ee("https"===n||!t.credentials||t.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let i=null;const s=new AbortController,a=setTimeout(()=>{i=Ae("request timeout","TIMEOUT"),s.abort()},t.timeout);r&&r.addListener(()=>{i=Ae("request cancelled","CANCELLED"),s.abort()});const o=Object.assign({},e,{method:t.method,headers:new Headers(Array.from(t)),body:t.body||void 0,signal:s.signal});let c;try{c=await fetch(t.url,o)}catch(e){if(clearTimeout(a),i)throw i;throw e}clearTimeout(a);const u={};c.headers.forEach((e,t)=>{u[t.toLowerCase()]=e});const l=await c.arrayBuffer(),h=null==l?null:new Uint8Array(l);return{statusCode:c.status,statusMessage:c.statusText,headers:u,body:h}}}xd({});let Od=xd();const Rd=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),Ud=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let Ld=!1;async function Dd(e,t){try{const t=e.match(Rd);if(!t)throw new Error("invalid data");return new _d(200,"OK",{"content-type":t[1]||"text/plain"},t[2]?function(e){e=atob(e);const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return Ie(t)}(t[3]):Xl(t[3].replace(/%([0-9a-f][0-9a-f])/gi,(e,t)=>String.fromCharCode(parseInt(t,16)))))}catch(t){return new _d(599,"BAD REQUEST (invalid data: URI)",{},null,new Hd(e))}}function Fd(e){return async function(t,r){try{const r=t.match(Ud);if(!r)throw new Error("invalid link");return new Hd(`${e}${r[2]}`)}catch(e){return new _d(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Hd(t))}}}const Md={data:Dd,ipfs:Fd("https://gateway.ipfs.io/ipfs/")},jd=new WeakMap;class Kd{#p;#g;constructor(e){this.#p=[],this.#g=!1,jd.set(e,()=>{if(!this.#g){this.#g=!0;for(const e of this.#p)setTimeout(()=>{e()},0);this.#p=[]}})}addListener(e){Ee(!this.#g,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),this.#p.push(e)}get cancelled(){return this.#g}checkSignal(){Ee(!this.cancelled,"cancelled","CANCELLED",{})}}function Vd(e){if(null==e)throw new Error("missing signal; should not happen");return e.checkSignal(),e}class Hd{#y;#m;#b;#w;#v;#A;#E;#C;#B;#S;#k;#T;#I;#P;#N;get url(){return this.#A}set url(e){this.#A=String(e)}get body(){return null==this.#E?null:new Uint8Array(this.#E)}set body(e){if(null==e)this.#E=void 0,this.#C=void 0;else if("string"==typeof e)this.#E=Xl(e),this.#C="text/plain";else if(e instanceof Uint8Array)this.#E=e,this.#C="application/octet-stream";else{if("object"!=typeof e)throw new Error("invalid body");this.#E=Xl(JSON.stringify(e)),this.#C="application/json"}}hasBody(){return null!=this.#E}get method(){return this.#w?this.#w:this.hasBody()?"POST":"GET"}set method(e){null==e&&(e=""),this.#w=String(e).toUpperCase()}get headers(){const e=Object.assign({},this.#b);return this.#B&&(e.authorization=`Basic ${function(e){const t=Ie(e);let r="";for(let e=0;e<t.length;e++)r+=String.fromCharCode(t[e]);return btoa(r)}(Xl(this.#B))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),null==e["content-type"]&&this.#C&&(e["content-type"]=this.#C),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,t){this.#b[String(e).toLowerCase()]=String(t)}clearHeaders(){this.#b={}}[Symbol.iterator](){const e=this.headers,t=Object.keys(e);let r=0;return{next:()=>{if(r<t.length){const n=t[r++];return{value:[n,e[n]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return this.#B||null}setCredentials(e,t){Ce(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),this.#B=`${e}:${t}`}get allowGzip(){return this.#m}set allowGzip(e){this.#m=!!e}get allowInsecureAuthentication(){return!!this.#y}set allowInsecureAuthentication(e){this.#y=!!e}get timeout(){return this.#v}set timeout(e){Ce(e>=0,"timeout must be non-zero","timeout",e),this.#v=e}get preflightFunc(){return this.#S||null}set preflightFunc(e){this.#S=e}get processFunc(){return this.#k||null}set processFunc(e){this.#k=e}get retryFunc(){return this.#T||null}set retryFunc(e){this.#T=e}get getUrlFunc(){return this.#N||Od}set getUrlFunc(e){this.#N=e}constructor(e){this.#A=String(e),this.#y=!1,this.#m=!0,this.#b={},this.#w="",this.#v=3e5,this.#P={slotInterval:250,maxAttempts:12},this.#N=null}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${this.#E?Re(this.#E):"null"}>`}setThrottleParams(e){null!=e.slotInterval&&(this.#P.slotInterval=e.slotInterval),null!=e.maxAttempts&&(this.#P.maxAttempts=e.maxAttempts)}async#x(e,t,r,n,i){if(e>=this.#P.maxAttempts)return i.makeServerError("exceeded maximum retry limit");Ee(Gd()<=t,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:n}),r>0&&await function(e){return new Promise(t=>setTimeout(t,e))}(r);let s=this.clone();const a=(s.url.split(":")[0]||"").toLowerCase();if(a in Md){const e=await Md[a](s.url,Vd(n.#I));if(e instanceof _d){let t=e;if(this.processFunc){Vd(n.#I);try{t=await this.processFunc(s,t)}catch(e){null!=e.throttle&&"number"==typeof e.stall||t.makeServerError("error in post-processing function",e).assertOk()}}return t}s=e}this.preflightFunc&&(s=await this.preflightFunc(s));const o=await this.getUrlFunc(s,Vd(n.#I));let c=new _d(o.statusCode,o.statusMessage,o.headers,o.body,n);if(301===c.statusCode||302===c.statusCode){try{const r=c.headers.location||"";return s.redirect(r).#x(e+1,t,0,n,c)}catch(e){}return c}if(429===c.statusCode&&(null==this.retryFunc||await this.retryFunc(s,c,e))){const r=c.headers["retry-after"];let i=this.#P.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return"string"==typeof r&&r.match(/^[1-9][0-9]*$/)&&(i=parseInt(r)),s.clone().#x(e+1,t,i,n,c)}if(this.processFunc){Vd(n.#I);try{c=await this.processFunc(s,c)}catch(r){null!=r.throttle&&"number"==typeof r.stall||c.makeServerError("error in post-processing function",r).assertOk();let i=this.#P.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return r.stall>=0&&(i=r.stall),s.clone().#x(e+1,t,i,n,c)}}return c}send(){return Ee(null==this.#I,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),this.#I=new Kd(this),this.#x(0,Gd()+this.timeout,0,this,new _d(0,"",{},null,this))}cancel(){Ee(null!=this.#I,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=jd.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const t=this.url.split(":")[0].toLowerCase(),r=e.split(":")[0].toLowerCase();Ee("GET"===this.method&&("https"!==t||"http"!==r)&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const n=new Hd(e);return n.method="GET",n.allowGzip=this.allowGzip,n.timeout=this.timeout,n.#b=Object.assign({},this.#b),this.#E&&(n.#E=new Uint8Array(this.#E)),n.#C=this.#C,n}clone(){const e=new Hd(this.url);return e.#w=this.#w,this.#E&&(e.#E=this.#E),e.#C=this.#C,e.#b=Object.assign({},this.#b),e.#B=this.#B,this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),e.#S=this.#S,e.#k=this.#k,e.#T=this.#T,e.#P=Object.assign({},this.#P),e.#N=this.#N,e}static lockConfig(){Ld=!0}static getGateway(e){return Md[e.toLowerCase()]||null}static registerGateway(e,t){if("http"===(e=e.toLowerCase())||"https"===e)throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(Ld)throw new Error("gateways locked");Md[e]=t}static registerGetUrl(e){if(Ld)throw new Error("gateways locked");Od=e}static createGetUrlFunc(e){return xd(e)}static createDataGateway(){return Dd}static createIpfsGatewayFunc(e){return Fd(e)}}class _d{#O;#R;#b;#E;#U;#L;toString(){return`<FetchResponse status=${this.statusCode} body=${this.#E?Re(this.#E):"null"}>`}get statusCode(){return this.#O}get statusMessage(){return this.#R}get headers(){return Object.assign({},this.#b)}get body(){return null==this.#E?null:new Uint8Array(this.#E)}get bodyText(){try{return null==this.#E?"":$l(this.#E)}catch(e){Ee(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch(e){Ee(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,t=Object.keys(e);let r=0;return{next:()=>{if(r<t.length){const n=t[r++];return{value:[n,e[n]],done:!1}}return{value:void 0,done:!0}}}}constructor(e,t,r,n,i){this.#O=e,this.#R=t,this.#b=Object.keys(r).reduce((e,t)=>(e[t.toLowerCase()]=String(r[t]),e),{}),this.#E=null==n?null:new Uint8Array(n),this.#U=i||null,this.#L={message:""}}makeServerError(e,t){let r;r=e?`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})`:`CLIENT ESCALATED SERVER ERROR (${e=`${this.statusCode} ${this.statusMessage}`})`;const n=new _d(599,r,this.headers,this.body,this.#U||void 0);return n.#L={message:e,error:t},n}throwThrottleError(e,t){null==t?t=-1:Ce(Number.isInteger(t)&&t>=0,"invalid stall timeout","stall",t);const r=new Error(e||"throttling requests");throw me(r,{stall:t,throttle:!0}),r}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return null!=this.#E}get request(){return this.#U}ok(){return""===this.#L.message&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:t}=this.#L;""===e&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let r=null;this.request&&(r=this.request.url);let n=null;try{this.#E&&(n=$l(this.#E))}catch(e){}Ee(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:t,info:{requestUrl:r,responseBody:n,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}}function Gd(){return(new Date).getTime()}const zd="0x0000000000000000000000000000000000000000";class qd{fragment;name;signature;topic;args;constructor(e,t,r){const n=e.name,i=e.format();me(this,{fragment:e,name:n,signature:i,topic:t,args:r})}}class Qd{fragment;name;args;signature;selector;value;constructor(e,t,r,n){const i=e.name,s=e.format();me(this,{fragment:e,name:i,args:r,signature:s,selector:t,value:n})}}class Wd{fragment;name;args;signature;selector;constructor(e,t,r){const n=e.name,i=e.format();me(this,{fragment:e,name:n,args:r,signature:i,selector:t})}}class Jd{hash;_isIndexed;static isIndexed(e){return!(!e||!e._isIndexed)}constructor(e){me(this,{hash:e,_isIndexed:!0})}}const Yd={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},Zd={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:e=>`reverted with reason string ${JSON.stringify(e)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:e=>{let t="unknown panic code";return e>=0&&e<=255&&Yd[e.toString()]&&(t=Yd[e.toString()]),`reverted with panic code 0x${e.toString(16)} (${t})`}}};class Xd{fragments;deploy;fallback;receive;#Gt;#zt;#qt;#Qt;constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,this.#qt=new Map,this.#Gt=new Map,this.#zt=new Map;const r=[];for(const e of t)try{r.push(jh.from(e))}catch(t){console.log(`[Warning] Invalid Fragment ${JSON.stringify(e)}:`,t.message)}me(this,{fragments:Object.freeze(r)});let n=null,i=!1;this.#Qt=this.getAbiCoder(),this.fragments.forEach((e,t)=>{let r;switch(e.type){case"constructor":return this.deploy?void console.log("duplicate definition - constructor"):void me(this,{deploy:e});case"fallback":return void(0===e.inputs.length?i=!0:(Ce(!n||e.payable!==n.payable,"conflicting fallback fragments",`fragments[${t}]`,e),n=e,i=n.payable));case"function":r=this.#qt;break;case"event":r=this.#zt;break;case"error":r=this.#Gt;break;default:return}const s=e.format();r.has(s)||r.set(s,e)}),this.deploy||me(this,{deploy:Gh.from("constructor()")}),me(this,{fallback:n,receive:i})}format(e){const t=e?"minimal":"full";return this.fragments.map(e=>e.format(t))}formatJson(){const e=this.fragments.map(e=>e.format("json"));return JSON.stringify(e.map(e=>JSON.parse(e)))}getAbiCoder(){return $h.defaultAbiCoder()}#Wt(e,t,r){if(Ne(e)){const t=e.toLowerCase();for(const e of this.#qt.values())if(t===e.selector)return e;return null}if(-1===e.indexOf("(")){const n=[];for(const[t,r]of this.#qt)t.split("(")[0]===e&&n.push(r);if(t){const e=t.length>0?t[t.length-1]:null;let r=t.length,i=!0;Rl.isTyped(e)&&"overrides"===e.type&&(i=!1,r--);for(let e=n.length-1;e>=0;e--){const t=n[e].inputs.length;t===r||i&&t===r-1||n.splice(e,1)}for(let e=n.length-1;e>=0;e--){const r=n[e].inputs;for(let i=0;i<t.length;i++)if(Rl.isTyped(t[i])){if(i>=r.length){if("overrides"===t[i].type)continue;n.splice(e,1);break}if(t[i].type!==r[i].baseType){n.splice(e,1);break}}}}if(1===n.length&&t&&t.length!==n[0].inputs.length){const e=t[t.length-1];(null==e||Array.isArray(e)||"object"!=typeof e)&&n.splice(0,1)}if(0===n.length)return null;if(n.length>1&&r){Ce(!1,`ambiguous function description (i.e. matches ${n.map(e=>JSON.stringify(e.format())).join(", ")})`,"key",e)}return n[0]}const n=this.#qt.get(qh.from(e).format());return n||null}getFunctionName(e){const t=this.#Wt(e,null,!1);return Ce(t,"no matching function","key",e),t.name}hasFunction(e){return!!this.#Wt(e,null,!1)}getFunction(e,t){return this.#Wt(e,t||null,!0)}forEachFunction(e){const t=Array.from(this.#qt.keys());t.sort((e,t)=>e.localeCompare(t));for(let r=0;r<t.length;r++){const n=t[r];e(this.#qt.get(n),r)}}#Jt(e,t,r){if(Ne(e)){const t=e.toLowerCase();for(const e of this.#zt.values())if(t===e.topicHash)return e;return null}if(-1===e.indexOf("(")){const n=[];for(const[t,r]of this.#zt)t.split("(")[0]===e&&n.push(r);if(t){for(let e=n.length-1;e>=0;e--)n[e].inputs.length<t.length&&n.splice(e,1);for(let e=n.length-1;e>=0;e--){const r=n[e].inputs;for(let i=0;i<t.length;i++)if(Rl.isTyped(t[i])&&t[i].type!==r[i].baseType){n.splice(e,1);break}}}if(0===n.length)return null;if(n.length>1&&r){Ce(!1,`ambiguous event description (i.e. matches ${n.map(e=>JSON.stringify(e.format())).join(", ")})`,"key",e)}return n[0]}const n=this.#zt.get(_h.from(e).format());return n||null}getEventName(e){const t=this.#Jt(e,null,!1);return Ce(t,"no matching event","key",e),t.name}hasEvent(e){return!!this.#Jt(e,null,!1)}getEvent(e,t){return this.#Jt(e,t||null,!0)}forEachEvent(e){const t=Array.from(this.#zt.keys());t.sort((e,t)=>e.localeCompare(t));for(let r=0;r<t.length;r++){const n=t[r];e(this.#zt.get(n),r)}}getError(e,t){if(Ne(e)){const t=e.toLowerCase();if(Zd[t])return Hh.from(Zd[t].signature);for(const e of this.#Gt.values())if(t===e.selector)return e;return null}if(-1===e.indexOf("(")){const t=[];for(const[r,n]of this.#Gt)r.split("(")[0]===e&&t.push(n);if(0===t.length)return"Error"===e?Hh.from("error Error(string)"):"Panic"===e?Hh.from("error Panic(uint256)"):null;if(t.length>1){Ce(!1,`ambiguous error description (i.e. ${t.map(e=>JSON.stringify(e.format())).join(", ")})`,"name",e)}return t[0]}if("Error(string)"===(e=Hh.from(e).format()))return Hh.from("error Error(string)");if("Panic(uint256)"===e)return Hh.from("error Panic(uint256)");const r=this.#Gt.get(e);return r||null}forEachError(e){const t=Array.from(this.#Gt.keys());t.sort((e,t)=>e.localeCompare(t));for(let r=0;r<t.length;r++){const n=t[r];e(this.#Gt.get(n),r)}}_decodeParams(e,t){return this.#Qt.decode(e,t)}_encodeParams(e,t){return this.#Qt.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){if("string"==typeof e){const t=this.getError(e);Ce(t,"unknown error","fragment",e),e=t}return Ce(De(t,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",t),this._decodeParams(e.inputs,De(t,4))}encodeErrorResult(e,t){if("string"==typeof e){const t=this.getError(e);Ce(t,"unknown error","fragment",e),e=t}return Ue([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionData(e,t){if("string"==typeof e){const t=this.getFunction(e);Ce(t,"unknown function","fragment",e),e=t}return Ce(De(t,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",t),this._decodeParams(e.inputs,De(t,4))}encodeFunctionData(e,t){if("string"==typeof e){const t=this.getFunction(e);Ce(t,"unknown function","fragment",e),e=t}return Ue([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionResult(e,t){if("string"==typeof e){const t=this.getFunction(e);Ce(t,"unknown function","fragment",e),e=t}let r="invalid length for result data";const n=Pe(t);if(n.length%32==0)try{return this.#Qt.decode(e.outputs,n)}catch(e){r="could not decode result data"}Ee(!1,r,"BAD_DATA",{value:Re(n),info:{method:e.name,signature:e.format()}})}makeError(e,t){const r=Ie(e,"data"),n=$h.getBuiltinCallException("call",t,r);if(n.message.startsWith("execution reverted (unknown custom error)")){const e=Re(r.slice(0,4)),t=this.getError(e);if(t)try{const e=this.#Qt.decode(t.inputs,r.slice(4));n.revert={name:t.name,signature:t.format(),args:e},n.reason=n.revert.signature,n.message=`execution reverted: ${n.reason}`}catch(e){n.message="execution reverted (coult not decode custom error)"}}const i=this.parseTransaction(t);return i&&(n.invocation={method:i.name,signature:i.signature,args:i.args}),n}encodeFunctionResult(e,t){if("string"==typeof e){const t=this.getFunction(e);Ce(t,"unknown function","fragment",e),e=t}return Re(this.#Qt.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){if("string"==typeof e){const t=this.getEvent(e);Ce(t,"unknown event","eventFragment",e),e=t}Ee(t.length<=e.inputs.length,`too many arguments for ${e.format()}`,"UNEXPECTED_ARGUMENT",{count:t.length,expectedCount:e.inputs.length});const r=[];e.anonymous||r.push(e.topicHash);const n=(e,t)=>"string"===e.type?rh(t):"bytes"===e.type?Al(Re(t)):("bool"===e.type&&"boolean"==typeof t?t=t?"0x01":"0x00":e.type.match(/^u?int/)?t=Ye(t):e.type.match(/^bytes/)?t=Fe(t,32,!1):"address"===e.type&&this.#Qt.encode(["address"],[t]),Me(Re(t),32));for(t.forEach((t,i)=>{const s=e.inputs[i];s.indexed?null==t?r.push(null):"array"===s.baseType||"tuple"===s.baseType?Ce(!1,"filtering with tuples or arrays not supported","contract."+s.name,t):Array.isArray(t)?r.push(t.map(e=>n(s,e))):r.push(n(s,t)):Ce(null==t,"cannot filter non-indexed parameters; must be null","contract."+s.name,t)});r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){if("string"==typeof e){const t=this.getEvent(e);Ce(t,"unknown event","eventFragment",e),e=t}const r=[],n=[],i=[];return e.anonymous||r.push(e.topicHash),Ce(t.length===e.inputs.length,"event arguments/values mismatch","values",t),e.inputs.forEach((e,s)=>{const a=t[s];if(e.indexed)if("string"===e.type)r.push(rh(a));else if("bytes"===e.type)r.push(Al(a));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(this.#Qt.encode([e.type],[a]))}else n.push(e),i.push(a)}),{data:this.#Qt.encode(n,i),topics:r}}decodeEventLog(e,t,r){if("string"==typeof e){const t=this.getEvent(e);Ce(t,"unknown event","eventFragment",e),e=t}if(null!=r&&!e.anonymous){const t=e.topicHash;Ce(Ne(r[0],32)&&r[0].toLowerCase()===t,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}const n=[],i=[],s=[];e.inputs.forEach((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(n.push(Mh.from({type:"bytes32",name:e.name})),s.push(!0)):(n.push(e),s.push(!1)):(i.push(e),s.push(!1))});const a=null!=r?this.#Qt.decode(n,Ue(r)):null,o=this.#Qt.decode(i,t,!0),c=[],u=[];let l=0,h=0;return e.inputs.forEach((e,t)=>{let r=null;if(e.indexed)if(null==a)r=new Jd(null);else if(s[t])r=new Jd(a[h++]);else try{r=a[h++]}catch(e){r=e}else try{r=o[l++]}catch(e){r=e}c.push(r),u.push(e.name||null)}),Pu.fromItems(c,u)}parseTransaction(e){const t=Ie(e.data,"tx.data"),r=ze(null!=e.value?e.value:0,"tx.value"),n=this.getFunction(Re(t.slice(0,4)));if(!n)return null;const i=this.#Qt.decode(n.inputs,t.slice(4));return new Qd(n,n.selector,i,r)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new qd(t,t.topicHash,this.decodeEventLog(t,e.data,e.topics))}parseError(e){const t=Re(e),r=this.getError(De(t,0,4));if(!r)return null;const n=this.#Qt.decode(r.inputs,De(t,4));return new Wd(r,r.selector,n)}static from(e){return e instanceof Xd?e:"string"==typeof e?new Xd(JSON.parse(e)):"function"==typeof e.formatJson?new Xd(e.formatJson()):"function"==typeof e.format?new Xd(e.format("json")):new Xd(e)}}const $d=BigInt(0);function ef(e){return null==e?null:e}function tf(e){return null==e?null:e.toString()}class rf{gasPrice;maxFeePerGas;maxPriorityFeePerGas;constructor(e,t,r){me(this,{gasPrice:ef(e),maxFeePerGas:ef(t),maxPriorityFeePerGas:ef(r)})}toJSON(){const{gasPrice:e,maxFeePerGas:t,maxPriorityFeePerGas:r}=this;return{_type:"FeeData",gasPrice:tf(e),maxFeePerGas:tf(t),maxPriorityFeePerGas:tf(r)}}}function nf(e){const t={};e.to&&(t.to=e.to),e.from&&(t.from=e.from),e.data&&(t.data=Re(e.data));const r="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const n of r)n in e&&null!=e[n]&&(t[n]=ze(e[n],`request.${n}`));const n="type,nonce".split(/,/);for(const r of n)r in e&&null!=e[r]&&(t[r]=Je(e[r],`request.${r}`));return e.accessList&&(t.accessList=wd(e.accessList)),e.authorizationList&&(t.authorizationList=e.authorizationList.slice()),"blockTag"in e&&(t.blockTag=e.blockTag),"enableCcipRead"in e&&(t.enableCcipRead=!!e.enableCcipRead),"customData"in e&&(t.customData=e.customData),"blobVersionedHashes"in e&&e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes.slice()),"kzg"in e&&(t.kzg=e.kzg),"blobs"in e&&e.blobs&&(t.blobs=e.blobs.map(e=>xe(e)?Re(e):Object.assign({},e))),t}class sf{provider;number;hash;timestamp;parentHash;parentBeaconBlockRoot;nonce;difficulty;gasLimit;gasUsed;stateRoot;receiptsRoot;blobGasUsed;excessBlobGas;miner;prevRandao;extraData;baseFeePerGas;#h;constructor(e,t){this.#h=e.transactions.map(e=>"string"!=typeof e?new cf(e,t):e),me(this,{provider:t,hash:ef(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:ef(e.prevRandao),extraData:e.extraData,baseFeePerGas:ef(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return this.#h.map(e=>"string"==typeof e?e:e.hash)}get prefetchedTransactions(){const e=this.#h.slice();return 0===e.length?[]:(Ee("object"==typeof e[0],"transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:t,extraData:r,gasLimit:n,gasUsed:i,hash:s,miner:a,prevRandao:o,nonce:c,number:u,parentHash:l,parentBeaconBlockRoot:h,stateRoot:d,receiptsRoot:f,timestamp:p,transactions:g}=this;return{_type:"Block",baseFeePerGas:tf(e),difficulty:tf(t),extraData:r,gasLimit:tf(n),gasUsed:tf(i),blobGasUsed:tf(this.blobGasUsed),excessBlobGas:tf(this.excessBlobGas),hash:s,miner:a,prevRandao:o,nonce:c,number:u,parentHash:l,timestamp:p,parentBeaconBlockRoot:h,stateRoot:d,receiptsRoot:f,transactions:g}}[Symbol.iterator](){let e=0;const t=this.transactions;return{next:()=>e<this.length?{value:t[e++],done:!1}:{value:void 0,done:!0}}}get length(){return this.#h.length}get date(){return null==this.timestamp?null:new Date(1e3*this.timestamp)}async getTransaction(e){let t;if("number"==typeof e)t=this.#h[e];else{const r=e.toLowerCase();for(const e of this.#h){if("string"==typeof e){if(e!==r)continue;t=e;break}if(e.hash===r){t=e;break}}}if(null==t)throw new Error("no such tx");return"string"==typeof t?await this.provider.getTransaction(t):t}getPrefetchedTransaction(e){const t=this.prefetchedTransactions;if("number"==typeof e)return t[e];e=e.toLowerCase();for(const r of t)if(r.hash===e)return r;Ce(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return{orphan:"drop-block",hash:(e=this).hash,number:e.number};var e}}class af{provider;transactionHash;blockHash;blockNumber;removed;address;data;topics;index;transactionIndex;constructor(e,t){this.provider=t;const r=Object.freeze(e.topics.slice());me(this,{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,removed:e.removed,address:e.address,data:e.data,topics:r,index:e.index,transactionIndex:e.transactionIndex})}toJSON(){const{address:e,blockHash:t,blockNumber:r,data:n,index:i,removed:s,topics:a,transactionHash:o,transactionIndex:c}=this;return{_type:"log",address:e,blockHash:t,blockNumber:r,data:n,index:i,removed:s,topics:a,transactionHash:o,transactionIndex:c}}async getBlock(){const e=await this.provider.getBlock(this.blockHash);return Ee(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransaction(){const e=await this.provider.getTransaction(this.transactionHash);return Ee(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransactionReceipt(){const e=await this.provider.getTransactionReceipt(this.transactionHash);return Ee(!!e,"failed to find transaction receipt","UNKNOWN_ERROR",{}),e}removedEvent(){return{orphan:"drop-log",log:{transactionHash:(e=this).transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,address:e.address,data:e.data,topics:Object.freeze(e.topics.slice()),index:e.index}};var e}}class of{provider;to;from;contractAddress;hash;index;blockHash;blockNumber;logsBloom;gasUsed;blobGasUsed;cumulativeGasUsed;gasPrice;blobGasPrice;type;status;root;#d;constructor(e,t){this.#d=Object.freeze(e.logs.map(e=>new af(e,t)));let r=$d;null!=e.effectiveGasPrice?r=e.effectiveGasPrice:null!=e.gasPrice&&(r=e.gasPrice),me(this,{provider:t,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:r,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return this.#d}toJSON(){const{to:e,from:t,contractAddress:r,hash:n,index:i,blockHash:s,blockNumber:a,logsBloom:o,logs:c,status:u,root:l}=this;return{_type:"TransactionReceipt",blockHash:s,blockNumber:a,contractAddress:r,cumulativeGasUsed:tf(this.cumulativeGasUsed),from:t,gasPrice:tf(this.gasPrice),blobGasUsed:tf(this.blobGasUsed),blobGasPrice:tf(this.blobGasPrice),gasUsed:tf(this.gasUsed),hash:n,index:i,logs:c,logsBloom:o,root:l,status:u,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e<this.length?{value:this.logs[e++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const e=await this.provider.getBlock(this.blockHash);if(null==e)throw new Error("TODO");return e}async getTransaction(){const e=await this.provider.getTransaction(this.hash);if(null==e)throw new Error("TODO");return e}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return lf(this)}reorderedEvent(e){return Ee(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),uf(this,e)}}class cf{provider;blockNumber;blockHash;index;hash;type;to;from;nonce;gasLimit;gasPrice;maxPriorityFeePerGas;maxFeePerGas;maxFeePerBlobGas;data;value;chainId;signature;accessList;blobVersionedHashes;authorizationList;#f;constructor(e,t){this.provider=t,this.blockNumber=null!=e.blockNumber?e.blockNumber:null,this.blockHash=null!=e.blockHash?e.blockHash:null,this.hash=e.hash,this.index=e.index,this.type=e.type,this.from=e.from,this.to=e.to||null,this.gasLimit=e.gasLimit,this.nonce=e.nonce,this.data=e.data,this.value=e.value,this.gasPrice=e.gasPrice,this.maxPriorityFeePerGas=null!=e.maxPriorityFeePerGas?e.maxPriorityFeePerGas:null,this.maxFeePerGas=null!=e.maxFeePerGas?e.maxFeePerGas:null,this.maxFeePerBlobGas=null!=e.maxFeePerBlobGas?e.maxFeePerBlobGas:null,this.chainId=e.chainId,this.signature=e.signature,this.accessList=null!=e.accessList?e.accessList:null,this.blobVersionedHashes=null!=e.blobVersionedHashes?e.blobVersionedHashes:null,this.authorizationList=null!=e.authorizationList?e.authorizationList:null,this.#f=-1}toJSON(){const{blockNumber:e,blockHash:t,index:r,hash:n,type:i,to:s,from:a,nonce:o,data:c,signature:u,accessList:l,blobVersionedHashes:h}=this;return{_type:"TransactionResponse",accessList:l,blockNumber:e,blockHash:t,blobVersionedHashes:h,chainId:tf(this.chainId),data:c,from:a,gasLimit:tf(this.gasLimit),gasPrice:tf(this.gasPrice),hash:n,maxFeePerGas:tf(this.maxFeePerGas),maxPriorityFeePerGas:tf(this.maxPriorityFeePerGas),maxFeePerBlobGas:tf(this.maxFeePerBlobGas),nonce:o,signature:u,to:s,index:r,type:i,value:tf(this.value)}}async getBlock(){let e=this.blockNumber;if(null==e){const t=await this.getTransaction();t&&(e=t.blockNumber)}if(null==e)return null;const t=this.provider.getBlock(e);if(null==t)throw new Error("TODO");return t}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(null==this.blockNumber){const{tx:e,blockNumber:t}=await ye({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return null==e||null==e.blockNumber?0:t-e.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(e,t){const r=null==e?1:e,n=null==t?0:t;let i=this.#f,s=-1,a=-1===i;const o=async()=>{if(a)return null;const{blockNumber:e,nonce:t}=await ye({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(t<this.nonce)return void(i=e);if(a)return null;const n=await this.getTransaction();if(!n||null==n.blockNumber)for(-1===s&&(s=i-3,s<this.#f&&(s=this.#f));s<=e;){if(a)return null;const t=await this.provider.getBlock(s,!0);if(null==t)return;for(const e of t)if(e===this.hash)return;for(let n=0;n<t.length;n++){const s=await t.getTransaction(n);if(s.from===this.from&&s.nonce===this.nonce){if(a)return null;const t=await this.provider.getTransactionReceipt(s.hash);if(null==t)return;if(e-t.blockNumber+1<r)return;let n="replaced";s.data===this.data&&s.to===this.to&&s.value===this.value?n="repriced":"0x"===s.data&&s.from===s.to&&s.value===$d&&(n="cancelled"),Ee(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:"replaced"===n||"cancelled"===n,reason:n,replacement:s.replaceableTransaction(i),hash:s.hash,receipt:t})}}s++}},c=e=>{if(null==e||0!==e.status)return e;Ee(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:e.to,from:e.from,data:""},receipt:e})},u=await this.provider.getTransactionReceipt(this.hash);if(0===r)return c(u);if(u){if(1===r||await u.confirmations()>=r)return c(u)}else if(await o(),0===r)return null;const l=new Promise((e,t)=>{const s=[],u=()=>{s.forEach(e=>e())};if(s.push(()=>{a=!0}),n>0){const e=setTimeout(()=>{u(),t(Ae("wait for transaction timeout","TIMEOUT"))},n);s.push(()=>{clearTimeout(e)})}const l=async n=>{if(await n.confirmations()>=r){u();try{e(c(n))}catch(e){t(e)}}};if(s.push(()=>{this.provider.off(this.hash,l)}),this.provider.on(this.hash,l),i>=0){const e=async()=>{try{await o()}catch(e){if(we(e,"TRANSACTION_REPLACED"))return u(),void t(e)}a||this.provider.once("block",e)};s.push(()=>{this.provider.off("block",e)}),this.provider.once("block",e)}});return await l}isMined(){return null!=this.blockHash}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}isCancun(){return 3===this.type}removedEvent(){return Ee(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),lf(this)}reorderedEvent(e){return Ee(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Ee(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),uf(this,e)}replaceableTransaction(e){Ce(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const t=new cf(this,this.provider);return t.#f=e,t}}function uf(e,t){return{orphan:"reorder-transaction",tx:e,other:t}}function lf(e){return{orphan:"drop-transaction",tx:e}}class hf{filter;emitter;#Dt;constructor(e,t,r){this.#Dt=t,me(this,{emitter:e,filter:r})}async removeListener(){null!=this.#Dt&&await this.emitter.off(this.filter,this.#Dt)}}class df extends af{interface;fragment;args;constructor(e,t,r){super(e,e.provider);me(this,{args:t.decodeEventLog(r,e.data,e.topics),fragment:r,interface:t})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class ff extends af{error;constructor(e,t){super(e,e.provider),me(this,{error:t})}}class pf extends of{#Et;constructor(e,t,r){super(r,t),this.#Et=e}get logs(){return super.logs.map(e=>{const t=e.topics.length?this.#Et.getEvent(e.topics[0]):null;if(t)try{return new df(e,this.#Et,t)}catch(t){return new ff(e,t)}return e})}}class gf extends cf{#Et;constructor(e,t,r){super(r,t),this.#Et=e}async wait(e,t){const r=await super.wait(e,t);return null==r?null:new pf(this.#Et,this.provider,r)}}class yf extends hf{log;constructor(e,t,r,n){super(e,t,r),me(this,{log:n})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class mf extends yf{constructor(e,t,r,n,i){super(e,t,r,new df(i,e.interface,n));me(this,{args:e.interface.decodeEventLog(n,this.log.data,this.log.topics),fragment:n})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const bf=BigInt(0);function wf(e){return e&&"function"==typeof e.call}function vf(e){return e&&"function"==typeof e.estimateGas}function Af(e){return e&&"function"==typeof e.resolveName}function Ef(e){return e&&"function"==typeof e.sendTransaction}function Cf(e){if(null!=e){if(Af(e))return e;if(e.provider)return e.provider}}class Bf{#Fe;fragment;constructor(e,t,r){if(me(this,{fragment:t}),t.inputs.length<r.length)throw new Error("too many arguments");const n=Sf(e.runner,"resolveName"),i=Af(n)?n:null;this.#Fe=async function(){const n=await Promise.all(t.inputs.map((e,t)=>null==r[t]?null:e.walkAsync(r[t],(e,t)=>"address"===e?Array.isArray(t)?Promise.all(t.map(e=>rd(e,i))):rd(t,i):t)));return e.interface.encodeFilterTopics(t,n)}()}getTopicFilter(){return this.#Fe}}function Sf(e,t){return null==e?null:"function"==typeof e[t]?e:e.provider&&"function"==typeof e.provider[t]?e.provider:null}function kf(e){return null==e?null:e.provider||null}async function Tf(e,t){const r=Rl.dereference(e,"overrides");Ce("object"==typeof r,"invalid overrides parameter","overrides",e);const n=nf(r);return Ce(null==n.to||(t||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),Ce(null==n.data||(t||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}function If(e){const t=async function(t){const r=await Tf(t,["data"]);r.to=await e.getAddress(),r.from&&(r.from=await rd(r.from,Cf(e.runner)));const n=e.interface,i=ze(r.value||bf,"overrides.value")===bf,s="0x"===(r.data||"0x");!n.fallback||n.fallback.payable||!n.receive||s||i||Ce(!1,"cannot send data to receive or send value to non-payable fallback","overrides",t),Ce(n.fallback||s,"cannot send data to receive-only contract","overrides.data",r.data);return Ce(n.receive||n.fallback&&n.fallback.payable||i,"cannot send value to non-payable fallback","overrides.value",r.value),Ce(n.fallback||s,"cannot send data to receive-only contract","overrides.data",r.data),r},r=async function(r){const n=e.runner;Ee(Ef(n),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const i=await n.sendTransaction(await t(r)),s=kf(e.runner);return new gf(e.interface,s,i)},n=async e=>await r(e);return me(n,{_contract:e,estimateGas:async function(r){const n=Sf(e.runner,"estimateGas");return Ee(vf(n),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await n.estimateGas(await t(r))},populateTransaction:t,send:r,staticCall:async function(r){const n=Sf(e.runner,"call");Ee(wf(n),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const i=await t(r);try{return await n.call(i)}catch(t){if(ve(t)&&t.data)throw e.interface.makeError(t.data,i);throw t}}}),n}function Pf(e,t){const r=function(...r){const n=e.interface.getFunction(t,r);return Ee(n,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:r}}),n},n=async function(...t){const n=r(...t);let i={};if(n.inputs.length+1===t.length&&(i=await Tf(t.pop()),i.from&&(i.from=await rd(i.from,Cf(e.runner)))),n.inputs.length!==t.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const s=await async function(e,t,r){const n=Sf(e,"resolveName"),i=Af(n)?n:null;return await Promise.all(t.map((e,t)=>e.walkAsync(r[t],(e,t)=>(t=Rl.dereference(t,e),"address"===e?rd(t,i):t))))}(e.runner,n.inputs,t);return Object.assign({},i,await ye({to:e.getAddress(),data:e.interface.encodeFunctionData(n,s)}))},i=async function(...e){const t=await a(...e);return 1===t.length?t[0]:t},s=async function(...t){const r=e.runner;Ee(Ef(r),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const i=await r.sendTransaction(await n(...t)),s=kf(e.runner);return new gf(e.interface,s,i)},a=async function(...t){const i=Sf(e.runner,"call");Ee(wf(i),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const s=await n(...t);let a="0x";try{a=await i.call(s)}catch(t){if(ve(t)&&t.data)throw e.interface.makeError(t.data,s);throw t}const o=r(...t);return e.interface.decodeFunctionResult(o,a)},o=async(...e)=>r(...e).constant?await i(...e):await s(...e);return me(o,{name:e.interface.getFunctionName(t),_contract:e,_key:t,getFragment:r,estimateGas:async function(...t){const r=Sf(e.runner,"estimateGas");return Ee(vf(r),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await r.estimateGas(await n(...t))},populateTransaction:n,send:s,staticCall:i,staticCallResult:a}),Object.defineProperty(o,"fragment",{configurable:!1,enumerable:!0,get:()=>{const r=e.interface.getFunction(t);return Ee(r,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),r}}),o}const Nf=Symbol.for("_ethersInternal_contract"),xf=new WeakMap;function Of(e){return xf.get(e[Nf])}async function Rf(e,t){let r,n=null;if(Array.isArray(t)){const n=function(t){if(Ne(t,32))return t;const r=e.interface.getEvent(t);return Ce(r,"unknown fragment","name",t),r.topicHash};r=t.map(e=>null==e?null:Array.isArray(e)?e.map(n):n(e))}else"*"===t?r=[null]:"string"==typeof t?Ne(t,32)?r=[t]:(n=e.interface.getEvent(t),Ce(n,"unknown fragment","event",t),r=[n.topicHash]):(i=t)&&"object"==typeof i&&"getTopicFilter"in i&&"function"==typeof i.getTopicFilter&&i.fragment?r=await t.getTopicFilter():"fragment"in t?(n=t.fragment,r=[n.topicHash]):Ce(!1,"unknown event name","event",t);var i;r=r.map(e=>{if(null==e)return null;if(Array.isArray(e)){const t=Array.from(new Set(e.map(e=>e.toLowerCase())).values());return 1===t.length?t[0]:(t.sort(),t)}return e.toLowerCase()});return{fragment:n,tag:r.map(e=>null==e?"null":Array.isArray(e)?e.join("|"):e).join("&"),topics:r}}async function Uf(e,t){const{subs:r}=Of(e);return r.get((await Rf(e,t)).tag)||null}async function Lf(e,t,r){const n=kf(e.runner);Ee(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:t});const{fragment:i,tag:s,topics:a}=await Rf(e,r),{addr:o,subs:c}=Of(e);let u=c.get(s);if(!u){const t={address:o||e,topics:a},l=t=>{let n=i;if(null==n)try{n=e.interface.getEvent(t.topics[0])}catch(e){}if(n){const s=n,a=i?e.interface.decodeEventLog(i,t.data,t.topics):[];Ff(e,r,a,n=>new mf(e,n,r,s,t))}else Ff(e,r,[],n=>new yf(e,n,r,t))};let h=[];u={tag:s,listeners:[],start:()=>{h.length||h.push(n.on(t,l))},stop:async()=>{if(0==h.length)return;let e=h;h=[],await Promise.all(e),n.off(t,l)}},c.set(s,u)}return u}let Df=Promise.resolve();async function Ff(e,t,r,n){try{await Df}catch(e){}const i=async function(e,t,r,n){await Df;const i=await Uf(e,t);if(!i)return!1;const s=i.listeners.length;return i.listeners=i.listeners.filter(({listener:t,once:i})=>{const s=Array.from(r);n&&s.push(n(i?null:t));try{t.call(e,...s)}catch(e){}return!i}),0===i.listeners.length&&(i.stop(),Of(e).subs.delete(i.tag)),s>0}(e,t,r,n);return Df=i,await i}const Mf=["then"];class jf{target;interface;runner;filters;[Nf];fallback;constructor(e,t,r,n){Ce("string"==typeof e||ed(e),"invalid value for Contract target","target",e),null==r&&(r=null);const i=Xd.from(t);let s;me(this,{target:e,runner:r,interface:i}),Object.defineProperty(this,Nf,{value:{}});let a=null,o=null;if(n){const e=kf(r);o=new gf(this.interface,e,n)}let c=new Map;if("string"==typeof e)if(Ne(e))a=e,s=Promise.resolve(e);else{const t=Sf(r,"resolveName");if(!Af(t))throw Ae("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});s=t.resolveName(e).then(t=>{if(null==t)throw Ae("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return Of(this).addr=t,t})}else s=e.getAddress().then(e=>{if(null==e)throw new Error("TODO");return Of(this).addr=e,e});var u,l;u=this,l={addrPromise:s,addr:a,deployTx:o,subs:c},xf.set(u[Nf],l);const h=new Proxy({},{get:(e,t,r)=>{if("symbol"==typeof t||Mf.indexOf(t)>=0)return Reflect.get(e,t,r);try{return this.getEvent(t)}catch(e){if(!we(e,"INVALID_ARGUMENT")||"key"!==e.argument)throw e}},has:(e,t)=>Mf.indexOf(t)>=0?Reflect.has(e,t):Reflect.has(e,t)||this.interface.hasEvent(String(t))});return me(this,{filters:h}),me(this,{fallback:i.receive||i.fallback?If(this):null}),new Proxy(this,{get:(e,t,r)=>{if("symbol"==typeof t||t in e||Mf.indexOf(t)>=0)return Reflect.get(e,t,r);try{return e.getFunction(t)}catch(e){if(!we(e,"INVALID_ARGUMENT")||"key"!==e.argument)throw e}},has:(e,t)=>"symbol"==typeof t||t in e||Mf.indexOf(t)>=0?Reflect.has(e,t):e.interface.hasFunction(t)})}connect(e){return new jf(this.target,this.interface,e)}attach(e){return new jf(e,this.interface,this.runner)}async getAddress(){return await Of(this).addrPromise}async getDeployedCode(){const e=kf(this.runner);Ee(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const t=await e.getCode(await this.getAddress());return"0x"===t?null:t}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(null!=await this.getDeployedCode())return this;const t=kf(this.runner);return Ee(null!=t,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((e,r)=>{const n=async()=>{try{if(null!=await this.getDeployedCode())return e(this);t.once("block",n)}catch(e){r(e)}};n()})}deploymentTransaction(){return Of(this).deployTx}getFunction(e){"string"!=typeof e&&(e=e.format());return Pf(this,e)}getEvent(e){return"string"!=typeof e&&(e=e.format()),function(e,t){const r=function(...r){const n=e.interface.getEvent(t,r);return Ee(n,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t,args:r}}),n},n=function(...t){return new Bf(e,r(...t),t)};return me(n,{name:e.interface.getEventName(t),_contract:e,_key:t,getFragment:r}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{const r=e.interface.getEvent(t);return Ee(r,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:t}}),r}}),n}(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,t,r){null==t&&(t=0),null==r&&(r="latest");const{addr:n,addrPromise:i}=Of(this),s=n||await i,{fragment:a,topics:o}=await Rf(this,e),c={address:s,topics:o,fromBlock:t,toBlock:r},u=kf(this.runner);return Ee(u,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await u.getLogs(c)).map(e=>{let t=a;if(null==t)try{t=this.interface.getEvent(e.topics[0])}catch(e){}if(t)try{return new df(e,this.interface,t)}catch(t){return new ff(e,t)}return new af(e,u)})}async on(e,t){const r=await Lf(this,"on",e);return r.listeners.push({listener:t,once:!1}),r.start(),this}async once(e,t){const r=await Lf(this,"once",e);return r.listeners.push({listener:t,once:!0}),r.start(),this}async emit(e,...t){return await Ff(this,e,t,null)}async listenerCount(e){if(e){const t=await Uf(this,e);return t?t.listeners.length:0}const{subs:t}=Of(this);let r=0;for(const{listeners:e}of t.values())r+=e.length;return r}async listeners(e){if(e){const t=await Uf(this,e);return t?t.listeners.map(({listener:e})=>e):[]}const{subs:t}=Of(this);let r=[];for(const{listeners:e}of t.values())r=r.concat(e.map(({listener:e})=>e));return r}async off(e,t){const r=await Uf(this,e);if(!r)return this;if(t){const e=r.listeners.map(({listener:e})=>e).indexOf(t);e>=0&&r.listeners.splice(e,1)}return null!=t&&0!==r.listeners.length||(r.stop(),Of(this).subs.delete(r.tag)),this}async removeAllListeners(e){if(e){const t=await Uf(this,e);if(!t)return this;t.stop(),Of(this).subs.delete(t.tag)}else{const{subs:e}=Of(this);for(const{tag:t,stop:r}of e.values())r(),e.delete(t)}return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return await this.off(e,t)}static buildClass(e){return class extends jf{constructor(t,r=null){super(t,e,r)}}}static from(e,t,r){null==r&&(r=null);return new this(e,t,r)}}class Kf extends(function(){return jf}()){}const Vf=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]);function Hf(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),i=1,s=[0,1];for(let e=1;e<n;e++)s.push(i+=r());let a=r(),o=t;t+=a;let c=0,u=0;function l(){return 0==c&&(u=u<<8|e[t++],c=8),u>>--c&1}const h=2**31,d=h>>>1,f=d>>1,p=h-1;let g=0;for(let e=0;e<31;e++)g=g<<1|l();let y=[],m=0,b=h;for(;;){let e=Math.floor(((g-m+1)*i-1)/b),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e<s[n]?r=n:t=n}if(0==t)break;y.push(t);let a=m+Math.floor(b*s[t]/i),o=m+Math.floor(b*s[t+1]/i)-1;for(;0==((a^o)&d);)g=g<<1&p|l(),a=a<<1&p,o=o<<1&p|1;for(;a&~o&f;)g=g&d|g<<1&p>>>1|l(),a=a<<1^d,o=(o^d)<<1|d|1;m=a,b=1+o-a}let w=n-4;return y.map(t=>{switch(t-w){case 3:return w+65792+(e[o++]<<16|e[o++]<<8|e[o++]);case 2:return w+256+(e[o++]<<8|e[o++]);case 1:return w+e[o++];default:return t-1}})}(function(e){let t=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((e,r)=>t[e.charCodeAt(0)]=r);let r=e.length,n=new Uint8Array(6*r>>3);for(let i=0,s=0,a=0,o=0;i<r;i++)o=o<<6|t[e.charCodeAt(i)],a+=6,a>=8&&(n[s++]=o>>(a-=8));return n}(e)))}function _f(e){return 1&e?~e>>1:e>>1}function Gf(e,t){let r=Array(e);for(let n=0,i=0;n<e;n++)r[n]=i+=_f(t());return r}function zf(e,t=0){let r=[];for(;;){let n=e(),i=e();if(!i)break;t+=n;for(let e=0;e<i;e++)r.push(t+e);t+=i+1}return r}function qf(e){return Wf(()=>{let t=zf(e);if(t.length)return t})}function Qf(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(Yf(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(Zf(r,e))}return t.flat()}function Wf(e){let t=[];for(;;){let r=e(t.length);if(!r)break;t.push(r)}return t}function Jf(e,t,r){let n=Array(e).fill().map(()=>[]);for(let i=0;i<t;i++)Gf(e,r).forEach((e,t)=>n[t].push(e));return n}function Yf(e,t){let r=1+t(),n=t(),i=Wf(t);return Jf(i.length,1+e,t).flatMap((e,t)=>{let[s,...a]=e;return Array(i[t]).fill().map((e,t)=>{let i=t*n;return[s+t*r,a.map(e=>e+i)]})})}function Zf(e,t){return Jf(1+t(),1+e,t).map(e=>[e[0],e.slice(1)])}function Xf(e){return`{${function(e){return e.toString(16).toUpperCase().padStart(2,"0")}(e)}}`}function $f(e){let t=[];for(let r=0,n=e.length;r<n;){let n=e.codePointAt(r);r+=n<65536?1:2,t.push(n)}return t}function ep(e){let t=e.length;if(t<4096)return String.fromCodePoint(...e);let r=[];for(let n=0;n<t;)r.push(String.fromCodePoint(...e.slice(n,n+=4096)));return r.join("")}function tp(e,t){let r=e.length,n=r-t.length;for(let i=0;0==n&&i<r;i++)n=e[i]-t[i];return n}const rp=44032,np=4352,ip=4449,sp=4519,ap=28,op=588;function cp(e){return e>>24&255}function up(e){return 16777215&e}let lp,hp,dp,fp;function pp(e){return e>=rp&&e<55204}function gp(e,t){if(e>=np&&e<4371&&t>=ip&&t<4470)return rp+(e-np)*op+(t-ip)*ap;if(pp(e)&&t>sp&&t<4547&&(e-rp)%ap==0)return e+(t-sp);{let r=fp.get(e);return r&&(r=r.get(t),r)?r:-1}}function yp(e){lp||function(){let e=Hf("AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAA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zm7qFBe7s+quuJs6ETYmnpgS3LwSZxPIltgBDXz8M1k/W2ySNv2f9/NPhxLGK2D21dkHeSGmenRT3Yqcdl0m/h3OYr8V+lXNYGf8aCCpd4bWjE4QIPj7vUKN4Nrfs7ML6Y2OyS830JCnofg/k7lpFpt4SqZc5HGg1HCOrHvOdC8bP6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g");lp=new Map(qf(e).flatMap((e,t)=>e.map(e=>[e,t+1<<24]))),hp=new Set(zf(e)),dp=new Map,fp=new Map;for(let[t,r]of Qf(e)){if(!hp.has(t)&&2==r.length){let[e,n]=r,i=fp.get(e);i||(i=new Map,fp.set(e,i)),i.set(n,t)}dp.set(t,r.reverse())}}();let t=[],r=[],n=!1;function i(e){let r=lp.get(e);r&&(n=!0,e|=r),t.push(e)}for(let n of e)for(;;){if(n<128)t.push(n);else if(pp(n)){let e=n-rp,t=e%op/ap|0,r=e%ap;i(np+(e/op|0)),i(ip+t),r>0&&i(sp+r)}else{let e=dp.get(n);e?r.push(...e):i(n)}if(!r.length)break;n=r.pop()}if(n&&t.length>1){let e=cp(t[0]);for(let r=1;r<t.length;r++){let n=cp(t[r]);if(0==n||e<=n){e=n;continue}let i=r-1;for(;;){let r=t[i+1];if(t[i+1]=t[i],t[i]=r,!i)break;if(e=cp(t[--i]),e<=n)break}e=cp(t[r])}}return t}function mp(e){return yp(e).map(up)}function bp(e){return function(e){let t=[],r=[],n=-1,i=0;for(let s of e){let e=cp(s),a=up(s);if(-1==n)0==e?n=a:t.push(a);else if(i>0&&i>=e)0==e?(t.push(n,...r),r.length=0,n=a):r.push(a),i=e;else{let s=gp(n,a);s>=0?n=s:0==i&&0==e?(t.push(n),n=a):(r.push(a),i=e)}}return n>=0&&t.push(n,...r),t}(yp(e))}const wp=".",vp=e=>Array.from(e);function Ap(e,t){return e.P.has(t)||e.Q.has(t)}class Ep extends Array{get is_emoji(){return!0}}let Cp,Bp,Sp,kp,Tp,Ip,Pp,Np,xp,Op,Rp,Up;function Lp(){if(Cp)return;let e=Hf("AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC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MotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI");const t=()=>zf(e),r=()=>new Set(t()),n=(e,t)=>t.forEach(t=>e.add(t));Cp=new Map(Qf(e)),Bp=r(),Sp=t(),kp=new Set(t().map(e=>Sp[e])),Sp=new Set(Sp),Tp=r(),Ip=r();let i=qf(e),s=e();const a=()=>{let e=new Set;return t().forEach(t=>n(e,i[t])),n(e,t()),e};Pp=Wf(t=>{let r=Wf(e).map(e=>e+96);if(r.length){let n=t>=s;return r[0]-=32,r=ep(r),n&&(r=`Restricted[${r}]`),{N:r,P:a(),Q:a(),M:!e(),R:n}}}),Np=r(),xp=new Map;let o=t().concat(vp(Np)).sort((e,t)=>e-t);o.forEach((t,r)=>{let n=e(),i=o[r]=n?o[r-n]:{V:[],M:new Map};i.V.push(t),Np.has(t)||xp.set(t,i)});for(let{V:e,M:t}of new Set(xp.values())){let r=[];for(let t of e){let e=Pp.filter(e=>Ap(e,t)),i=r.find(({G:t})=>e.some(e=>t.has(e)));i||(i={G:new Set,V:[]},r.push(i)),i.V.push(t),n(i.G,e)}let i=r.flatMap(e=>vp(e.G));for(let{G:e,V:n}of r){let r=new Set(i.filter(t=>!e.has(t)));for(let e of n)t.set(e,r)}}Op=new Set;let c=new Set;const u=e=>Op.has(e)?c.add(e):Op.add(e);for(let e of Pp){for(let t of e.P)u(t);for(let t of e.Q)u(t)}for(let e of Op)xp.has(e)||c.has(e)||xp.set(e,1);n(Op,mp(Op)),Rp=function(e){let t=[],r=zf(e);return function e({S:r,B:n},i,s){if(!(4&r&&s===i[i.length-1])){2&r&&(s=i[i.length-1]),1&r&&t.push(i);for(let t of n)for(let r of t.Q)e(t,[...i,r],s)}}(function t(n){return{S:e(),B:Wf(()=>{let n=zf(e).map(e=>r[e]);if(n.length)return t(n)}),Q:n}}([]),[]),t}(e).map(e=>Ep.from(e)).sort(tp),Up=new Map;for(let e of Rp){let t=[Up];for(let r of e){let e=t.map(e=>{let t=e.get(r);return t||(t=new Map,e.set(r,t)),t});65039===r?t.push(...e):t=e}for(let r of t)r.V=e}}function Dp(e){return(jp(e)?"":`${Fp(Mp([e]))} `)+Xf(e)}function Fp(e){return`"${e}"`}function Mp(e,t=1/0,r=Xf){let n=[];var i;i=e[0],Lp(),Sp.has(i)&&n.push("◌"),e.length>t&&(t>>=1,e=[...e.slice(0,t),8230,...e.slice(-t)]);let s=0,a=e.length;for(let t=0;t<a;t++){let i=e[t];jp(i)&&(n.push(ep(e.slice(s,t))),n.push(r(i)),s=t+1)}return n.push(ep(e.slice(s,a))),n.join("")}function jp(e){return Lp(),Tp.has(e)}function Kp(e,t,r){if(!e)return[];Lp();let n=0;return e.split(wp).map(e=>{let i=$f(e),s={input:i,offset:n};n+=i.length+1;try{let e,n=s.tokens=zp(i,t,r),a=n.length;if(!a)throw new Error("empty label");let o=s.output=n.flat();if(function(e){for(let t=e.lastIndexOf(95);t>0;)if(95!==e[--t])throw new Error("underscore allowed only at start")}(o),!(s.emoji=a>1||n[0].is_emoji)&&o.every(e=>e<128))!function(e){if(e.length>=4&&45==e[2]&&45==e[3])throw new Error(`invalid label extension: "${ep(e.slice(0,4))}"`)}(o),e="ASCII";else{let t=n.flatMap(e=>e.is_emoji?[]:e);if(t.length){if(Sp.has(o[0]))throw Gp("leading combining mark");for(let e=1;e<a;e++){let t=n[e];if(!t.is_emoji&&Sp.has(t[0]))throw Gp(`emoji + combining mark: "${ep(n[e-1])} + ${Mp([t[0]])}"`)}!function(e){let t=e[0],r=Vf.get(t);if(r)throw Gp(`leading ${r}`);let n=e.length,i=-1;for(let s=1;s<n;s++){t=e[s];let n=Vf.get(t);if(n){if(i==s)throw Gp(`${r} + ${n}`);i=s+1,r=n}}if(i==n)throw Gp(`trailing ${r}`)}(o);let r=vp(new Set(t)),[i]=function(e){let t=Pp;for(let r of e){let e=t.filter(e=>Ap(e,r));if(!e.length)throw Pp.some(e=>Ap(e,r))?_p(t[0],r):Hp(r);if(t=e,1==e.length)break}return t}(r);!function(e,t){for(let r of t)if(!Ap(e,r))throw _p(e,r);if(e.M){let e=mp(t);for(let t=1,r=e.length;t<r;t++)if(kp.has(e[t])){let n=t+1;for(let i;n<r&&kp.has(i=e[n]);n++)for(let r=t;r<n;r++)if(e[r]==i)throw new Error(`duplicate non-spacing marks: ${Dp(i)}`);if(n-t>4)throw new Error(`excessive non-spacing marks: ${Fp(Mp(e.slice(t-1,n)))} (${n-t}/4)`);t=n}}}(i,t),function(e,t){let r,n=[];for(let e of t){let t=xp.get(e);if(1===t)return;if(t){let n=t.M.get(e);if(r=r?r.filter(e=>n.has(e)):vp(n),!r.length)return}else n.push(e)}if(r)for(let t of r)if(n.every(e=>Ap(t,e)))throw new Error(`whole-script confusable: ${e.N}/${t.N}`)}(i,r),e=i.N}else e="Emoji"}s.type=e}catch(e){s.error=e}return s})}function Vp(e){return e.map(({input:t,error:r,output:n})=>{if(r){let n=r.message;throw new Error(1==e.length?n:`Invalid label ${Fp(Mp(t,63))}: ${n}`)}return ep(n)}).join(wp)}function Hp(e){return new Error(`disallowed character: ${Dp(e)}`)}function _p(e,t){let r=Dp(t),n=Pp.find(e=>e.P.has(t));return n&&(r=`${n.N} ${r}`),new Error(`illegal mixture: ${e.N} + ${r}`)}function Gp(e){return new Error(`illegal placement: ${e}`)}function zp(e,t,r){let n=[],i=[];for(e=e.slice().reverse();e.length;){let s=Qp(e);if(s)i.length&&(n.push(t(i)),i=[]),n.push(r(s));else{let t=e.pop();if(Op.has(t))i.push(t);else{let e=Cp.get(t);if(e)i.push(...e);else if(!Bp.has(t))throw Hp(t)}}}return i.length&&n.push(t(i)),n}function qp(e){return e.filter(e=>65039!=e)}function Qp(e,t){let r,n=Up,i=e.length;for(;i&&(n=n.get(e[--i]),n);){let{V:s}=n;s&&(r=s,t&&t.push(...e.slice(i).reverse()),e.length=i)}return r}const Wp=new Uint8Array(32);function Jp(e){return Ce(0!==e.length,"invalid ENS name; empty component","comp",e),e}function Yp(e){const t=Xl(function(e){try{if(0===e.length)throw new Error("empty label");return function(e){return Vp(Kp(e,bp,qp))}(e)}catch(t){Ce(!1,`invalid ENS name (${t.message})`,"name",e)}}(e)),r=[];if(0===e.length)return r;let n=0;for(let e=0;e<t.length;e++){46===t[e]&&(r.push(Jp(t.slice(n,e))),n=e+1)}return Ce(n<t.length,"invalid ENS name; empty component","name",e),r.push(Jp(t.slice(n))),r}function Zp(e){Ce("string"==typeof e,"invalid ENS name; not a string","name",e),Ce(e.length,"invalid ENS name (empty label)","name",e);let t=Wp;const r=Yp(e);for(;r.length;)t=Al(Ue([t,Al(r.pop())]));return Re(t)}function Xp(e,t){const r=null!=t?t:63;return Ce(r<=255,"DNS encoded label cannot exceed 255","length",r),Re(Ue(Yp(e).map(t=>{Ce(t.length<=r,`label ${JSON.stringify(e)} exceeds ${r} bytes`,"name",e);const n=new Uint8Array(t.length+1);return n.set(t,1),n[0]=n.length-1,n})))+"00"}Wp.fill(0);class $p extends $u{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Yu(this.buffer)}update(e){Fu(this);const{view:t,buffer:r,blockLen:n}=this,i=(e=Xu(e)).length;for(let s=0;s<i;){const a=Math.min(n-this.pos,i-s);if(a===n){const t=Yu(e);for(;n<=i-s;s+=n)this.process(t,s);continue}r.set(e.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Fu(this),Mu(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:i}=this;let{pos:s}=this;t[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>n-s&&(this.process(r,0),s=0);for(let e=s;e<n;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),s=BigInt(4294967295),a=Number(r>>i&s),o=Number(r&s),c=n?4:0,u=n?0:4;e.setUint32(t+c,a,n),e.setUint32(t+u,o,n)}(r,n-8,BigInt(8*this.length),i),this.process(r,0);const a=Yu(e),o=this.outputLen;if(o%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=o/4,u=this.get();if(c>u.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)a.setUint32(4*e,u[e],i)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:s,pos:a}=this;return e.length=n,e.pos=a,e.finished=i,e.destroyed=s,n%t&&e.buffer.set(r),e}}const eg=(e,t,r)=>e&t^~e&r,tg=(e,t,r)=>e&t^e&r^t&r,rg=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]),ng=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ig=new Uint32Array(64);class sg extends $p{constructor(){super(64,32,8,!1),this.A=0|ng[0],this.B=0|ng[1],this.C=0|ng[2],this.D=0|ng[3],this.E=0|ng[4],this.F=0|ng[5],this.G=0|ng[6],this.H=0|ng[7]}get(){const{A:e,B:t,C:r,D:n,E:i,F:s,G:a,H:o}=this;return[e,t,r,n,i,s,a,o]}set(e,t,r,n,i,s,a,o){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|s,this.G=0|a,this.H=0|o}process(e,t){for(let r=0;r<16;r++,t+=4)ig[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=ig[e-15],r=ig[e-2],n=Zu(t,7)^Zu(t,18)^t>>>3,i=Zu(r,17)^Zu(r,19)^r>>>10;ig[e]=i+ig[e-7]+n+ig[e-16]|0}let{A:r,B:n,C:i,D:s,E:a,F:o,G:c,H:u}=this;for(let e=0;e<64;e++){const t=u+(Zu(a,6)^Zu(a,11)^Zu(a,25))+eg(a,o,c)+rg[e]+ig[e]|0,l=(Zu(r,2)^Zu(r,13)^Zu(r,22))+tg(r,n,i)|0;u=c,c=o,o=a,a=s+t|0,s=i,i=n,n=r,r=t+l|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,s=s+this.D|0,a=a+this.E|0,o=o+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,n,i,s,a,o,c,u)}roundClean(){ig.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const ag=el(()=>new sg),[og,cg]=Qu.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),ug=new Uint32Array(80),lg=new Uint32Array(80);class hg extends $p{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:s,Dh:a,Dl:o,Eh:c,El:u,Fh:l,Fl:h,Gh:d,Gl:f,Hh:p,Hl:g}=this;return[e,t,r,n,i,s,a,o,c,u,l,h,d,f,p,g]}set(e,t,r,n,i,s,a,o,c,u,l,h,d,f,p,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|s,this.Dh=0|a,this.Dl=0|o,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|h,this.Gh=0|d,this.Gl=0|f,this.Hh=0|p,this.Hl=0|g}process(e,t){for(let r=0;r<16;r++,t+=4)ug[r]=e.getUint32(t),lg[r]=e.getU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add(0|this.Ch,0|this.Cl,0|a,0|o)),({h:c,l:u}=Qu.add(0|this.Dh,0|this.Dl,0|c,0|u)),({h:l,l:h}=Qu.add(0|this.Eh,0|this.El,0|l,0|h)),({h:d,l:f}=Qu.add(0|this.Fh,0|this.Fl,0|d,0|f)),({h:p,l:g}=Qu.add(0|this.Gh,0|this.Gl,0|p,0|g)),({h:y,l:m}=Qu.add(0|this.Hh,0|this.Hl,0|y,0|m)),this.set(r,n,i,s,a,o,c,u,l,h,d,f,p,g,y,m)}roundClean(){ug.fill(0),lg.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const dg=el(()=>new hg);const fg=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}();fg.crypto||fg.msCrypto;function pg(e){switch(e){case"sha256":return ag.create();case"sha512":return dg.create()}Ce(!1,"invalid hashing algorithm name","algorithm",e)}const gg=function(e){return pg("sha256").update(e).digest()},yg=function(e){return pg("sha512").update(e).digest()};let mg=gg,bg=yg,wg=!1,vg=!1;function Ag(e){const t=Ie(e,"data");return Re(mg(t))}function Eg(e){const t=Ie(e,"data");return Re(bg(t))}Ag._=gg,Ag.lock=function(){wg=!0},Ag.register=function(e){if(wg)throw new Error("sha256 is locked");mg=e},Object.freeze(Ag),Eg._=yg,Eg.lock=function(){vg=!0},Eg.register=function(e){if(vg)throw new Error("sha512 is locked");bg=e},Object.freeze(Ag);BigInt(0);const Cg=BigInt(1),Bg=BigInt(2),Sg=e=>e instanceof Uint8Array,kg=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Tg(e){if(!Sg(e))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=kg[e[r]];return t}function Ig(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return BigInt(""===e?"0":`0x${e}`)}function Pg(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(t/2);for(let t=0;t<r.length;t++){const n=2*t,i=e.slice(n,n+2),s=Number.parseInt(i,16);if(Number.isNaN(s)||s<0)throw new Error("Invalid byte sequence");r[t]=s}return r}function Ng(e){return Ig(Tg(e))}function xg(e){if(!Sg(e))throw new Error("Uint8Array expected");return Ig(Tg(Uint8Array.from(e).reverse()))}function Og(e,t){return Pg(e.toString(16).padStart(2*t,"0"))}function Rg(e,t){return Og(e,t).reverse()}function Ug(e,t,r){let n;if("string"==typeof t)try{n=Pg(t)}catch(r){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${r}`)}else{if(!Sg(t))throw new Error(`${e} must be hex string or Uint8Array`);n=Uint8Array.from(t)}const i=n.length;if("number"==typeof r&&i!==r)throw new Error(`${e} expected ${r} bytes, got ${i}`);return n}function Lg(...e){const t=new Uint8Array(e.reduce((e,t)=>e+t.length,0));let r=0;return e.forEach(e=>{if(!Sg(e))throw new Error("Uint8Array expected");t.set(e,r),r+=e.length}),t}const Dg=e=>(Bg<<BigInt(e-1))-Cg,Fg=e=>new Uint8Array(e),Mg=e=>Uint8Array.from(e);function jg(e,t,r){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");let n=Fg(e),i=Fg(e),s=0;const a=()=>{n.fill(1),i.fill(0),s=0},o=(...e)=>r(i,n,...e),c=(e=Fg())=>{i=o(Mg([0]),e),n=o(),0!==e.length&&(i=o(Mg([1]),e),n=o())},u=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const r=[];for(;e<t;){n=o();const t=n.slice();r.push(t),e+=n.length}return Lg(...r)};return(e,t)=>{let r;for(a(),c(e);!(r=t(u()));)c();return a(),r}}const Kg={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function Vg(e,t,r={}){const n=(t,r,n)=>{const i=Kg[r];if("function"!=typeof i)throw new Error(`Invalid validator "${r}", expected function`);const s=e[t];if(!(n&&void 0===s||i(s,e)))throw new Error(`Invalid param ${String(t)}=${s} (${typeof s}), expected ${r}`)};for(const[e,r]of Object.entries(t))n(e,r,!1);for(const[e,t]of Object.entries(r))n(e,t,!0);return e}const Hg=BigInt(0),_g=BigInt(1),Gg=BigInt(2),zg=BigInt(3),qg=BigInt(4),Qg=BigInt(5),Wg=BigInt(8);BigInt(9),BigInt(16);function Jg(e,t){const r=e%t;return r>=Hg?r:t+r}function Yg(e,t,r){if(r<=Hg||t<Hg)throw new Error("Expected power/modulo > 0");if(r===_g)return Hg;let n=_g;for(;t>Hg;)t&_g&&(n=n*e%r),e=e*e%r,t>>=_g;return n}function Zg(e,t,r){let n=e;for(;t-- >Hg;)n*=n,n%=r;return n}function Xg(e,t){if(e===Hg||t<=Hg)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=Jg(e,t),n=t,i=Hg,s=_g,a=_g,o=Hg;for(;r!==Hg;){const e=n/r,t=n%r,c=i-a*e,u=s-o*e;n=r,r=t,i=a,s=o,a=c,o=u}if(n!==_g)throw new Error("invert: does not exist");return Jg(i,t)}function $g(e){if(e%qg===zg){const t=(e+_g)/qg;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}if(e%Wg===Qg){const t=(e-Qg)/Wg;return function(e,r){const n=e.mul(r,Gg),i=e.pow(n,t),s=e.mul(r,i),a=e.mul(e.mul(s,Gg),i),o=e.mul(s,e.sub(a,e.ONE));if(!e.eql(e.sqr(o),r))throw new Error("Cannot find square root");return o}}return function(e){const t=(e-_g)/Gg;let r,n,i;for(r=e-_g,n=0;r%Gg===Hg;r/=Gg,n++);for(i=Gg;i<e&&Yg(i,t,e)!==e-_g;i++);if(1===n){const t=(e+_g)/qg;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}const s=(r+_g)/Gg;return function(e,a){if(e.pow(a,t)===e.neg(e.ONE))throw new Error("Cannot find square root");let o=n,c=e.pow(e.mul(e.ONE,i),r),u=e.pow(a,s),l=e.pow(a,r);for(;!e.eql(l,e.ONE);){if(e.eql(l,e.ZERO))return e.ZERO;let t=1;for(let r=e.sqr(l);t<o&&!e.eql(r,e.ONE);t++)r=e.sqr(r);const r=e.pow(c,_g<<BigInt(o-t-1));c=e.sqr(r),u=e.mul(u,r),l=e.mul(l,c),o=t}return u}}(e)}const ey=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function ty(e,t){const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function ry(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function ny(e){const t=ry(e);return t+Math.ceil(t/2)}class iy extends $u{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,Du(e);const r=Xu(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const n=this.blockLen,i=new Uint8Array(n);i.set(r.length>n?e.create().update(r).digest():r);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),i.fill(0)}update(e){return Fu(this),this.iHash.update(e),this}digestInto(e){Fu(this),Lu(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:s,outputLen:a}=this;return e.finished=n,e.destroyed=i,e.blockLen=s,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const sy=(e,t,r)=>new iy(e,t).update(r).digest();sy.create=(e,t)=>new iy(e,t);const ay=BigInt(0),oy=BigInt(1);function cy(e){return function(e){const t=ey.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});Vg(e,t)}(e.Fp),Vg(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...ty(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const{Ph:uy,aT:ly}=u,hy={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){const{Err:t}=hy;if(e.length<2||2!==e[0])throw new t("Invalid signature integer tag");const r=e[1],n=e.subarray(2,r+2);if(!r||n.length!==r)throw new t("Invalid signature integer: wrong length");if(128&n[0])throw new t("Invalid signature integer: negative");if(0===n[0]&&!(128&n[1]))throw new t("Invalid signature integer: unnecessary leading zero");return{d:uy(n),l:e.subarray(r+2)}},toSig(e){const{Err:t}=hy,r="string"==typeof e?ly(e):e;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||48!=r[0])throw new t("Invalid signature tag");if(r[1]!==n-2)throw new t("Invalid signature: incorrect length");const{d:i,l:s}=hy._parseInt(r.subarray(2)),{d:a,l:o}=hy._parseInt(s);if(o.length)throw new t("Invalid signature: left bytes after parsing");return{r:i,s:a}},hexFromSig(e){const t=e=>8&Number.parseInt(e[0],16)?"00"+e:e,r=e=>{const t=e.toString(16);return 1&t.length?`0${t}`:t},n=t(r(e.s)),i=t(r(e.r)),s=n.length/2,a=i.length/2,o=r(s),c=r(a);return`30${r(a+s+4)}02${c}${i}02${o}${n}`}},dy=BigInt(0),fy=BigInt(1),py=(BigInt(2),BigInt(3));BigInt(4);function gy(e){const t=function(e){const t=cy(e);Vg(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:n,a:i}=t;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:r}=t,n=t.toBytes||((e,t,n)=>{const i=t.toAffine();return Lg(Uint8Array.from([4]),r.toBytes(i.x),r.toBytes(i.y))}),i=t.fromBytes||(e=>{const t=e.subarray(1);return{x:r.fromBytes(t.subarray(0,r.BYTES)),y:r.fromBytes(t.subarray(r.BYTES,2*r.BYTES))}});function s(e){const{a:n,b:i}=t,s=r.sqr(e),a=r.mul(s,e);return r.add(r.add(a,r.mul(e,n)),i)}if(!r.eql(r.sqr(t.Gy),s(t.Gx)))throw new Error("bad generator point: equation left != right");function a(e){return"bigint"==typeof e&&dy<e&&e<t.n}function o(e){if(!a(e))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(e){const{allowedPrivateKeyLengths:r,nByteLength:n,wrapPrivateKey:i,n:s}=t;if(r&&"bigint"!=typeof e){if(e instanceof Uint8Array&&(e=Tg(e)),"string"!=typeof e||!r.includes(e.length))throw new Error("Invalid key");e=e.padStart(2*n,"0")}let a;try{a="bigint"==typeof e?e:Ng(Ug("private key",e,n))}catch(t){throw new Error(`private key must be ${n} bytes, hex or bigint, not ${typeof e}`)}return i&&(a=Jg(a,s)),o(a),a}const u=new Map;function l(e){if(!(e instanceof h))throw new Error("ProjectivePoint expected")}class h{constructor(e,t,n){if(this.px=e,this.py=t,this.pz=n,null==e||!r.isValid(e))throw new Error("x required");if(null==t||!r.isValid(t))throw new Error("y required");if(null==n||!r.isValid(n))throw new Error("z required")}static fromAffine(e){const{x:t,y:n}=e||{};if(!e||!r.isValid(t)||!r.isValid(n))throw new Error("invalid affine point");if(e instanceof h)throw new Error("projective point not allowed");const i=e=>r.eql(e,r.ZERO);return i(t)&&i(n)?h.ZERO:new h(t,n,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const t=r.invertBatch(e.map(e=>e.pz));return e.map((e,r)=>e.toAffine(t[r])).map(h.fromAffine)}static fromHex(e){const t=h.fromAffine(i(Ug("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return h.BASE.multiply(c(e))}_setWindowSize(e){this._WINDOW_SIZE=e,u.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:e,y:n}=this.toAffine();if(!r.isValid(e)||!r.isValid(n))throw new Error("bad point: x or y not FE");const i=r.sqr(n),a=s(e);if(!r.eql(i,a))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:e}=this.toAffine();if(r.isOdd)return!r.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){l(e);const{px:t,py:n,pz:i}=this,{px:s,py:a,pz:o}=e,c=r.eql(r.mul(t,o),r.mul(s,i)),u=r.eql(r.mul(n,o),r.mul(a,i));return c&&u}negate(){return new h(this.px,r.neg(this.py),this.pz)}double(){const{a:e,b:n}=t,i=r.mul(n,py),{px:s,py:a,pz:o}=this;let c=r.ZERO,u=r.ZERO,l=r.ZERO,d=r.mul(s,s),f=r.mul(a,a),p=r.mul(o,o),g=r.mul(s,a);return g=r.add(g,g),l=r.mul(s,o),l=r.add(l,l),c=r.mul(e,l),u=r.mul(i,p),u=r.add(c,u),c=r.sub(f,u),u=r.add(f,u),u=r.mul(c,u),c=r.mul(g,c),l=r.mul(i,l),p=r.mul(e,p),g=r.sub(d,p),g=r.mul(e,g),g=r.add(g,l),l=r.add(d,d),d=r.add(l,d),d=r.add(d,p),d=r.mul(d,g),u=r.add(u,d),p=r.mul(a,o),p=r.add(p,p),d=r.mul(p,g),c=r.sub(c,d),l=r.mul(p,f),l=r.add(l,l),l=r.add(l,l),new h(c,u,l)}add(e){l(e);const{px:n,py:i,pz:s}=this,{px:a,py:o,pz:c}=e;let u=r.ZERO,d=r.ZERO,f=r.ZERO;const p=t.a,g=r.mul(t.b,py);let y=r.mul(n,a),m=r.mul(i,o),b=r.mul(s,c),w=r.add(n,i),v=r.add(a,o);w=r.mul(w,v),v=r.add(y,m),w=r.sub(w,v),v=r.add(n,s);let A=r.add(a,c);return v=r.mul(v,A),A=r.add(y,b),v=r.sub(v,A),A=r.add(i,s),u=r.add(o,c),A=r.mul(A,u),u=r.add(m,b),A=r.sub(A,u),f=r.mul(p,v),u=r.mul(g,b),f=r.add(u,f),u=r.sub(m,f),f=r.add(m,f),d=r.mul(u,f),m=r.add(y,y),m=r.add(m,y),b=r.mul(p,b),v=r.mul(g,v),m=r.add(m,b),b=r.sub(y,b),b=r.mul(p,b),v=r.add(v,b),y=r.mul(m,v),d=r.add(d,y),y=r.mul(A,v),u=r.mul(w,u),u=r.sub(u,y),y=r.mul(w,m),f=r.mul(A,f),f=r.add(f,y),new h(u,d,f)}subtract(e){return this.add(e.negate())}is0(){return this.equals(h.ZERO)}wNAF(e){return f.wNAFCached(this,u,e,e=>{const t=r.invertBatch(e.map(e=>e.pz));return e.map((e,r)=>e.toAffine(t[r])).map(h.fromAffine)})}multiplyUnsafe(e){const n=h.ZERO;if(e===dy)return n;if(o(e),e===fy)return this;const{endo:i}=t;if(!i)return f.unsafeLadder(this,e);let{k1neg:s,k1:a,k2neg:c,k2:u}=i.splitScalar(e),l=n,d=n,p=this;for(;a>dy||u>dy;)a&fy&&(l=l.add(p)),u&fy&&(d=d.add(p)),p=p.double(),a>>=fy,u>>=fy;return s&&(l=l.negate()),c&&(d=d.negate()),d=new h(r.mul(d.px,i.beta),d.py,d.pz),l.add(d)}multiply(e){o(e);let n,i,s=e;const{endo:a}=t;if(a){const{k1neg:e,k1:t,k2neg:o,k2:c}=a.splitScalar(s);let{p:u,f:l}=this.wNAF(t),{p:d,f:p}=this.wNAF(c);u=f.constTimeNegate(e,u),d=f.constTimeNegate(o,d),d=new h(r.mul(d.px,a.beta),d.py,d.pz),n=u.add(d),i=l.add(p)}else{const{p:e,f:t}=this.wNAF(s);n=e,i=t}return h.normalizeZ([n,i])[0]}multiplyAndAddUnsafe(e,t,r){const n=h.BASE,i=(e,t)=>t!==dy&&t!==fy&&e.equals(n)?e.multiply(t):e.multiplyUnsafe(t),s=i(this,t).add(i(e,r));return s.is0()?void 0:s}toAffine(e){const{px:t,py:n,pz:i}=this,s=this.is0();null==e&&(e=s?r.ONE:r.inv(i));const a=r.mul(t,e),o=r.mul(n,e),c=r.mul(i,e);if(s)return{x:r.ZERO,y:r.ZERO};if(!r.eql(c,r.ONE))throw new Error("invZ was invalid");return{x:a,y:o}}isTorsionFree(){const{h:e,isTorsionFree:r}=t;if(e===fy)return!0;if(r)return r(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:r}=t;return e===fy?this:r?r(h,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return this.assertValidity(),n(h,this,e)}toHex(e=!0){return Tg(this.toRawBytes(e))}}h.BASE=new h(t.Gx,t.Gy,r.ONE),h.ZERO=new h(r.ZERO,r.ONE,r.ZERO);const d=t.nBitLength,f=function(e,t){const r=(e,t)=>{const r=t.negate();return e?r:t},n=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:r,unsafeLadder(t,r){let n=e.ZERO,i=t;for(;r>ay;)r&oy&&(n=n.add(i)),i=i.double(),r>>=oy;return n},precomputeWindow(e,t){const{windows:r,windowSize:i}=n(t),s=[];let a=e,o=a;for(let e=0;e<r;e++){o=a,s.push(o);for(let e=1;e<i;e++)o=o.add(a),s.push(o);a=o.double()}return s},wNAF(t,i,s){const{windows:a,windowSize:o}=n(t);let c=e.ZERO,u=e.BASE;const l=BigInt(2**t-1),h=2**t,d=BigInt(t);for(let e=0;e<a;e++){const t=e*o;let n=Number(s&l);s>>=d,n>o&&(n-=h,s+=oy);const a=t,f=t+Math.abs(n)-1,p=e%2!=0,g=n<0;0===n?u=u.add(r(p,i[a])):c=c.add(r(g,i[f]))}return{p:c,f:u}},wNAFCached(e,t,r,n){const i=e._WINDOW_SIZE||1;let s=t.get(e);return s||(s=this.precomputeWindow(e,i),1!==i&&t.set(e,n(s))),this.wNAF(i,s,r)}}}(h,t.endo?Math.ceil(d/2):d);return{CURVE:t,ProjectivePoint:h,normPrivateKeyToScalar:c,weierstrassEquation:s,isWithinCurveOrder:a}}function yy(e){const t=function(e){const t=cy(e);return Vg(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:r,n}=t,i=r.BYTES+1,s=2*r.BYTES+1;function a(e){return Jg(e,n)}function o(e){return Xg(e,n)}const{ProjectivePoint:c,normPrivateKeyToScalar:u,weierstrassEquation:l,isWithinCurveOrder:h}=gy({...t,toBytes(e,t,n){const i=t.toAffine(),s=r.toBytes(i.x),a=Lg;return n?a(Uint8Array.from([t.hasEvenY()?2:3]),s):a(Uint8Array.from([4]),s,r.toBytes(i.y))},fromBytes(e){const t=e.length,n=e[0],a=e.subarray(1);if(t!==i||2!==n&&3!==n){if(t===s&&4===n){return{x:r.fromBytes(a.subarray(0,r.BYTES)),y:r.fromBytes(a.subarray(r.BYTES,2*r.BYTES))}}throw new Error(`Point of length ${t} was invalid. Expected ${i} compressed bytes or ${s} uncompressed bytes`)}{const e=Ng(a);if(!function(e){return dy<e&&e<r.ORDER}(e))throw new Error("Point is not on curve");const t=l(e);let i=r.sqrt(t);return!(1&~n)!==((i&fy)===fy)&&(i=r.neg(i)),{x:e,y:i}}}}),d=e=>Tg(Og(e,t.nByteLength));function f(e){return e>n>>fy}const p=(e,t,r)=>Ng(e.slice(t,r));class g{constructor(e,t,r){this.r=e,this.s=t,this.recovery=r,this.assertValidity()}static fromCompact(e){const r=t.nByteLength;return e=Ug("compactSignature",e,2*r),new g(p(e,0,r),p(e,r,2*r))}static fromDER(e){const{r:t,s:r}=hy.toSig(Ug("DER",e));return new g(t,r)}assertValidity(){if(!h(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!h(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new g(this.r,this.s,e)}recoverPublicKey(e){const{r:n,s:i,recovery:s}=this,u=w(Ug("msgHash",e));if(null==s||![0,1,2,3].includes(s))throw new Error("recovery id invalid");const l=2===s||3===s?n+t.n:n;if(l>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const h=1&s?"03":"02",f=c.fromHex(h+d(l)),p=o(l),g=a(-u*p),y=a(i*p),m=c.BASE.multiplyAndAddUnsafe(f,g,y);if(!m)throw new Error("point at infinify");return m.assertValidity(),m}hasHighS(){return f(this.s)}normalizeS(){return this.hasHighS()?new g(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Pg(this.toDERHex())}toDERHex(){return hy.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Pg(this.toCompactHex())}toCompactHex(){return d(this.r)+d(this.s)}}const y={isValidPrivateKey(e){try{return u(e),!0}catch(e){return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const e=ny(t.n);return function(e,t,r=!1){const n=e.length,i=ry(t),s=ny(t);if(n<16||n<s||n>1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);const a=Jg(r?Ng(e):xg(e),t-_g)+_g;return r?Rg(a,i):Og(a,i)}(t.randomBytes(e),t.n)},precompute:(e=8,t=c.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};function m(e){const t=e instanceof Uint8Array,r="string"==typeof e,n=(t||r)&&e.length;return t?n===i||n===s:r?n===2*i||n===2*s:e instanceof c}const b=t.bits2int||function(e){const r=Ng(e),n=8*e.length-t.nBitLength;return n>0?r>>BigInt(n):r},w=t.bits2int_modN||function(e){return a(b(e))},v=Dg(t.nBitLength);function A(e){if("bigint"!=typeof e)throw new Error("bigint expected");if(!(dy<=e&&e<v))throw new Error(`bigint expected < 2^${t.nBitLength}`);return Og(e,t.nByteLength)}function E(e,n,i=C){if(["recovered","canonical"].some(e=>e in i))throw new Error("sign() legacy options not supported");const{hash:s,randomBytes:l}=t;let{lowS:d,prehash:p,extraEntropy:y}=i;null==d&&(d=!0),e=Ug("msgHash",e),p&&(e=Ug("prehashed msgHash",s(e)));const m=w(e),v=u(n),E=[A(v),A(m)];if(null!=y){const e=!0===y?l(r.BYTES):y;E.push(Ug("extraEntropy",e))}const B=Lg(...E),S=m;return{seed:B,k2sig:function(e){const t=b(e);if(!h(t))return;const r=o(t),n=c.BASE.multiply(t).toAffine(),i=a(n.x);if(i===dy)return;const s=a(r*a(S+i*v));if(s===dy)return;let u=(n.x===i?0:2)|Number(n.y&fy),l=s;return d&&f(s)&&(l=function(e){return f(e)?a(-e):e}(s),u^=1),new g(i,l,u)}}}const C={lowS:t.lowS,prehash:!1},B={lowS:t.lowS,prehash:!1};return c.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function(e,t=!0){return c.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,r=!0){if(m(e))throw new Error("first arg must be private key");if(!m(t))throw new Error("second arg must be public key");return c.fromHex(t).multiply(u(e)).toRawBytes(r)},sign:function(e,r,n=C){const{seed:i,k2sig:s}=E(e,r,n),a=t;return jg(a.hash.outputLen,a.nByteLength,a.hmac)(i,s)},verify:function(e,r,n,i=B){const s=e;if(r=Ug("msgHash",r),n=Ug("publicKey",n),"strict"in i)throw new Error("options.strict was renamed to lowS");const{lowS:u,prehash:l}=i;let h,d;try{if("string"==typeof s||s instanceof Uint8Array)try{h=g.fromDER(s)}catch(e){if(!(e instanceof hy.Err))throw e;h=g.fromCompact(s)}else{if("object"!=typeof s||"bigint"!=typeof s.r||"bigint"!=typeof s.s)throw new Error("PARSE");{const{r:e,s:t}=s;h=new g(e,t)}}d=c.fromHex(n)}catch(e){if("PARSE"===e.message)throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(u&&h.hasHighS())return!1;l&&(r=t.hash(r));const{r:f,s:p}=h,y=w(r),m=o(p),b=a(y*m),v=a(f*m),A=c.BASE.multiplyAndAddUnsafe(d,b,v)?.toAffine();return!!A&&a(A.x)===f},ProjectivePoint:c,Signature:g,utils:y}}function my(e){return{hash:e,hmac:(t,...r)=>sy(e,t,function(...e){const t=new Uint8Array(e.reduce((e,t)=>e+t.length,0));let r=0;return e.forEach(e=>{if(!Ju(e))throw new Error("Uint8Array expected");t.set(e,r),r+=e.length}),t}(...r)),randomBytes:tl}}const by=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),wy=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),vy=BigInt(1),Ay=BigInt(2),Ey=(e,t)=>(e+t/Ay)/t;function Cy(e){const t=by,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),a=BigInt(23),o=BigInt(44),c=BigInt(88),u=e*e*e%t,l=u*u*e%t,h=Zg(l,r,t)*l%t,d=Zg(h,r,t)*l%t,f=Zg(d,Ay,t)*u%t,p=Zg(f,i,t)*f%t,g=Zg(p,s,t)*p%t,y=Zg(g,o,t)*g%t,m=Zg(y,c,t)*y%t,b=Zg(m,o,t)*g%t,w=Zg(b,r,t)*l%t,v=Zg(w,a,t)*p%t,A=Zg(v,n,t)*u%t,E=Zg(A,Ay,t);if(!By.eql(By.sqr(E),e))throw new Error("Cannot find square root");return E}const By=function(e,t,r=!1,n={}){if(e<=Hg)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:i,nByteLength:s}=ty(e,t);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=$g(e),o=Object.freeze({ORDER:e,BITS:i,BYTES:s,MASK:Dg(i),ZERO:Hg,ONE:_g,create:t=>Jg(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("Invalid field element: expected bigint, got "+typeof t);return Hg<=t&&t<e},is0:e=>e===Hg,isOdd:e=>(e&_g)===_g,neg:t=>Jg(-t,e),eql:(e,t)=>e===t,sqr:t=>Jg(t*t,e),add:(t,r)=>Jg(t+r,e),sub:(t,r)=>Jg(t-r,e),mul:(t,r)=>Jg(t*r,e),pow:(e,t)=>function(e,t,r){if(r<Hg)throw new Error("Expected power > 0");if(r===Hg)return e.ONE;if(r===_g)return t;let n=e.ONE,i=t;for(;r>Hg;)r&_g&&(n=e.mul(n,i)),i=e.sqr(i),r>>=_g;return n}(o,e,t),div:(t,r)=>Jg(t*Xg(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>Xg(t,e),sqrt:n.sqrt||(e=>a(o,e)),invertBatch:e=>function(e,t){const r=new Array(t.length),n=t.reduce((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n)),e.ONE),i=e.inv(n);return t.reduceRight((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n)),i),r}(o,e),cmov:(e,t,r)=>r?t:e,toBytes:e=>r?Rg(e,s):Og(e,s),fromBytes:e=>{if(e.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${e.length}`);return r?xg(e):Ng(e)}});return Object.freeze(o)}(by,void 0,void 0,{sqrt:Cy}),Sy=function(e,t){const r=t=>yy({...e,...my(t)});return Object.freeze({...r(t),create:r})}({a:BigInt(0),b:BigInt(7),Fp:By,n:wy,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=wy,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-vy*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,a=BigInt("0x100000000000000000000000000000000"),o=Ey(s*e,t),c=Ey(-n*e,t);let u=Jg(e-o*r-c*i,t),l=Jg(-o*n-c*s,t);const h=u>a,d=l>a;if(h&&(u=t-u),d&&(l=t-l),u>a||l>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:h,k1:u,k2neg:d,k2:l}}}},ag);BigInt(0);Sy.ProjectivePoint;class ky{#l;constructor(e){Ce(32===Le(e),"invalid private key","privateKey","[REDACTED]"),this.#l=Re(e)}get privateKey(){return this.#l}get publicKey(){return ky.computePublicKey(this.#l)}get compressedPublicKey(){return ky.computePublicKey(this.#l,!0)}sign(e){Ce(32===Le(e),"invalid digest length","digest",e);const t=Sy.sign(Pe(e),Pe(this.#l),{lowS:!0});return Pd.from({r:Ye(t.r,32),s:Ye(t.s,32),v:t.recovery?28:27})}computeSharedSecret(e){const t=ky.computePublicKey(e);return Re(Sy.getSharedSecret(Pe(this.#l),Ie(t),!1))}static computePublicKey(e,t){let r=Ie(e,"key");if(32===r.length){return Re(Sy.getPublicKey(r,!!t))}if(64===r.length){const e=new Uint8Array(65);e[0]=4,e.set(r,1),r=e}return Re(Sy.ProjectivePoint.fromHex(r).toRawBytes(t))}static recoverPublicKey(e,t){Ce(32===Le(e),"invalid digest length","digest",e);const r=Pd.from(t);let n=Sy.Signature.fromCompact(Pe(Ue([r.r,r.s])));n=n.addRecoveryBit(r.yParity);const i=n.recoverPublicKey(Pe(e));return Ce(null!=i,"invalid signature for digest","signature",t),"0x"+i.toHex(!1)}static addPoints(e,t,r){const n=Sy.ProjectivePoint.fromHex(ky.computePublicKey(e).substring(2)),i=Sy.ProjectivePoint.fromHex(ky.computePublicKey(t).substring(2));return"0x"+n.add(i).toHex(!!r)}}function Ty(e){let t=e.toString(16);for(;t.length<2;)t="0"+t;return"0x"+t}function Iy(e,t,r){let n=0;for(let i=0;i<r;i++)n=256*n+e[t+i];return n}function Py(e,t,r,n){const i=[];for(;r<t+1+n;){const s=Ny(e,r);i.push(s.result),Ee((r+=s.consumed)<=t+1+n,"child data too short","BUFFER_OVERRUN",{buffer:e,length:n,offset:t})}return{consumed:1+n,result:i}}function Ny(e,t){Ee(0!==e.length,"data too short","BUFFER_OVERRUN",{buffer:e,length:0,offset:1});const r=t=>{Ee(t<=e.length,"data short segment too short","BUFFER_OVERRUN",{buffer:e,length:e.length,offset:t})};if(e[t]>=248){const n=e[t]-247;r(t+1+n);const i=Iy(e,t+1,n);return r(t+1+n+i),Py(e,t,t+1+n,n+i)}if(e[t]>=192){const n=e[t]-192;return r(t+1+n),Py(e,t,t+1,n)}if(e[t]>=184){const n=e[t]-183;r(t+1+n);const i=Iy(e,t+1,n);r(t+1+n+i);return{consumed:1+n+i,result:Re(e.slice(t+1+n,t+1+n+i))}}if(e[t]>=128){const n=e[t]-128;r(t+1+n);return{consumed:1+n,result:Re(e.slice(t+1,t+1+n))}}return{consumed:1,result:Ty(e[t])}}function xy(e){const t=Ie(e,"data"),r=Ny(t,0);return Ce(r.consumed===t.length,"unexpected junk after rlp payload","data",e),r.result}function Oy(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function Ry(e){if(Array.isArray(e)){let t=[];if(e.forEach(function(e){t=t.concat(Ry(e))}),t.length<=55)return t.unshift(192+t.length),t;const r=Oy(t.length);return r.unshift(247+r.length),r.concat(t)}const t=Array.prototype.slice.call(Ie(e,"object"));if(1===t.length&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const r=Oy(t.length);return r.unshift(183+r.length),r.concat(t)}const Uy="0123456789abcdef";function Ly(e){let t="0x";for(const r of Ry(e))t+=Uy[r>>4],t+=Uy[15&r];return t}function Dy(e,t){return function(e){let t;return t="string"==typeof e?ky.computePublicKey(e,!1):e.publicKey,Il(Al("0x"+t.substring(4)).substring(26))}(ky.recoverPublicKey(e,t))}const Fy=BigInt(0),My=BigInt(2),jy=BigInt(27),Ky=BigInt(28),Vy=BigInt(35),Hy=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),_y=131072;function Gy(e,t){let r=e.toString(16);for(;r.length<2;)r="0"+r;return r+=Ag(t).substring(4),"0x"+r}function zy(e){return"0x"===e?null:Il(e)}function qy(e,t){try{return wd(e)}catch(r){Ce(!1,r.message,t,e)}}function Qy(e,t){try{if(!Array.isArray(e))throw new Error("authorizationList: invalid array");const t=[];for(let r=0;r<e.length;r++){const n=e[r];if(!Array.isArray(n))throw new Error(`authorization[${r}]: invalid array`);if(6!==n.length)throw new Error(`authorization[${r}]: wrong length`);if(!n[1])throw new Error(`authorization[${r}]: null address`);t.push({address:zy(n[1]),nonce:Jy(n[2],"nonce"),chainId:Jy(n[0],"chainId"),signature:Pd.from({yParity:Wy(n[3],"yParity"),r:Me(n[4],32),s:Me(n[5],32)})})}return t}catch(r){Ce(!1,r.message,t,e)}}function Wy(e,t){return"0x"===e?0:Je(e,t)}function Jy(e,t){if("0x"===e)return Fy;const r=ze(e,t);return Ce(r<=Hy,"value exceeds uint size",t,r),r}function Yy(e,t){const r=ze(e,"value"),n=Ze(r);return Ce(n.length<=32,"value too large",`tx.${t}`,r),n}function Zy(e){return wd(e).map(e=>[e.address,e.storageKeys])}function Xy(e,t){Ce(Array.isArray(e),`invalid ${t}`,"value",e);for(let t=0;t<e.length;t++)Ce(Ne(e[t],32),"invalid ${ param } hash",`value[${t}]`,e[t]);return e}function $y(e,t){let r;try{if(r=Wy(t[0],"yParity"),0!==r&&1!==r)throw new Error("bad yParity")}catch(e){Ce(!1,"invalid yParity","yParity",t[0])}const n=Me(t[1],32),i=Me(t[2],32),s=Pd.from({r:n,s:i,yParity:r});e.signature=s}class em{#D;#F;#M;#j;#K;#V;#H;#_;#G;#z;#q;#Q;#W;#J;#Y;#Z;#X;get type(){return this.#D}set type(e){switch(e){case null:this.#D=null;break;case 0:case"legacy":this.#D=0;break;case 1:case"berlin":case"eip-2930":this.#D=1;break;case 2:case"london":case"eip-1559":this.#D=2;break;case 3:case"cancun":case"eip-4844":this.#D=3;break;case 4:case"pectra":case"eip-7702":this.#D=4;break;default:Ce(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844";case 4:return"eip-7702"}return null}get to(){const e=this.#F;return null==e&&3===this.type?zd:e}set to(e){this.#F=null==e?null:Il(e)}get nonce(){return this.#j}set nonce(e){this.#j=Je(e,"value")}get gasLimit(){return this.#K}set gasLimit(e){this.#K=ze(e)}get gasPrice(){const e=this.#V;return null!=e||0!==this.type&&1!==this.type?e:Fy}set gasPrice(e){this.#V=null==e?null:ze(e,"gasPrice")}get maxPriorityFeePerGas(){const e=this.#H;return null==e?2===this.type||3===this.type?Fy:null:e}set maxPriorityFeePerGas(e){this.#H=null==e?null:ze(e,"maxPriorityFeePerGas")}get maxFeePerGas(){const e=this.#_;return null==e?2===this.type||3===this.type?Fy:null:e}set maxFeePerGas(e){this.#_=null==e?null:ze(e,"maxFeePerGas")}get data(){return this.#M}set data(e){this.#M=Re(e)}get value(){return this.#G}set value(e){this.#G=ze(e,"value")}get chainId(){return this.#z}set chainId(e){this.#z=ze(e)}get signature(){return this.#q||null}set signature(e){this.#q=null==e?null:Pd.from(e)}get accessList(){const e=this.#Q||null;return null==e?1===this.type||2===this.type||3===this.type?[]:null:e}set accessList(e){this.#Q=null==e?null:wd(e)}get authorizationList(){const e=this.#X||null;return null==e&&4===this.type?[]:e}set authorizationList(e){this.#X=null==e?null:e.map(e=>Nd(e))}get maxFeePerBlobGas(){const e=this.#W;return null==e&&3===this.type?Fy:e}set maxFeePerBlobGas(e){this.#W=null==e?null:ze(e,"maxFeePerBlobGas")}get blobVersionedHashes(){let e=this.#J;return null==e&&3===this.type?[]:e}set blobVersionedHashes(e){if(null!=e){Ce(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let t=0;t<e.length;t++)Ce(Ne(e[t],32),"invalid blobVersionedHash",`value[${t}]`,e[t])}this.#J=e}get blobs(){return null==this.#Z?null:this.#Z.map(e=>Object.assign({},e))}set blobs(e){if(null==e)return void(this.#Z=null);const t=[],r=[];for(let n=0;n<e.length;n++){const i=e[n];if(xe(i)){Ee(this.#Y,"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let e=Ie(i);if(Ce(e.length<=_y,"blob is too large",`blobs[${n}]`,i),e.length!==_y){const t=new Uint8Array(_y);t.set(e),e=t}const s=this.#Y.blobToKzgCommitment(e),a=Re(this.#Y.computeBlobKzgProof(e,s));t.push({data:Re(e),commitment:Re(s),proof:a}),r.push(Gy(1,s))}else{const e=Re(i.commitment);t.push({data:Re(i.data),commitment:e,proof:Re(i.proof)}),r.push(Gy(1,e))}}this.#Z=t,this.#J=r}get kzg(){return this.#Y}set kzg(e){this.#Y=null==e?null:function(e){return{blobToKzgCommitment:t=>{if("computeBlobProof"in e){if("blobToKzgCommitment"in e&&"function"==typeof e.blobToKzgCommitment)return Ie(e.blobToKzgCommitment(Re(t)))}else if("blobToKzgCommitment"in e&&"function"==typeof e.blobToKzgCommitment)return Ie(e.blobToKzgCommitment(t));if("blobToKZGCommitment"in e&&"function"==typeof e.blobToKZGCommitment)return Ie(e.blobToKZGCommitment(Re(t)));Ce(!1,"unsupported KZG library","kzg",e)},computeBlobKzgProof:(t,r)=>"computeBlobProof"in e&&"function"==typeof e.computeBlobProof?Ie(e.computeBlobProof(Re(t),Re(r))):"computeBlobKzgProof"in e&&"function"==typeof e.computeBlobKzgProof?e.computeBlobKzgProof(t,r):"computeBlobKZGProof"in e&&"function"==typeof e.computeBlobKZGProof?Ie(e.computeBlobKZGProof(Re(t),Re(r))):void Ce(!1,"unsupported KZG library","kzg",e)}}(e)}constructor(){this.#D=null,this.#F=null,this.#j=0,this.#K=Fy,this.#V=null,this.#H=null,this.#_=null,this.#M="0x",this.#G=Fy,this.#z=Fy,this.#q=null,this.#Q=null,this.#W=null,this.#J=null,this.#Y=null,this.#Z=null,this.#X=null}get hash(){return null==this.signature?null:Al(this.#$(!0,!1))}get unsignedHash(){return Al(this.unsignedSerialized)}get from(){return null==this.signature?null:Dy(this.unsignedHash,this.signature)}get fromPublicKey(){return null==this.signature?null:ky.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return null!=this.signature}#$(e,t){Ee(!e||null!=this.signature,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const r=e?this.signature:null;switch(this.inferType()){case 0:return function(e,t){const r=[Yy(e.nonce,"nonce"),Yy(e.gasPrice||0,"gasPrice"),Yy(e.gasLimit,"gasLimit"),e.to||"0x",Yy(e.value,"value"),e.data];let n=Fy;if(e.chainId!=Fy)n=ze(e.chainId,"tx.chainId"),Ce(!t||null==t.networkV||t.legacyChainId===n,"tx.chainId/sig.v mismatch","sig",t);else if(e.signature){const t=e.signature.legacyChainId;null!=t&&(n=t)}if(!t)return n!==Fy&&(r.push(Ze(n)),r.push("0x"),r.push("0x")),Ly(r);let i=BigInt(27+t.yParity);return n!==Fy?i=Pd.getChainIdV(n,t.v):BigInt(t.v)!==i&&Ce(!1,"tx.chainId/sig.v mismatch","sig",t),r.push(Ze(i)),r.push(Ze(t.r)),r.push(Ze(t.s)),Ly(r)}(this,r);case 1:return function(e,t){const r=[Yy(e.chainId,"chainId"),Yy(e.nonce,"nonce"),Yy(e.gasPrice||0,"gasPrice"),Yy(e.gasLimit,"gasLimit"),e.to||"0x",Yy(e.value,"value"),e.data,Zy(e.accessList||[])];return t&&(r.push(Yy(t.yParity,"recoveryParam")),r.push(Ze(t.r)),r.push(Ze(t.s))),Ue(["0x01",Ly(r)])}(this,r);case 2:return function(e,t){const r=[Yy(e.chainId,"chainId"),Yy(e.nonce,"nonce"),Yy(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Yy(e.maxFeePerGas||0,"maxFeePerGas"),Yy(e.gasLimit,"gasLimit"),e.to||"0x",Yy(e.value,"value"),e.data,Zy(e.accessList||[])];return t&&(r.push(Yy(t.yParity,"yParity")),r.push(Ze(t.r)),r.push(Ze(t.s))),Ue(["0x02",Ly(r)])}(this,r);case 3:return function(e,t,r){const n=[Yy(e.chainId,"chainId"),Yy(e.nonce,"nonce"),Yy(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Yy(e.maxFeePerGas||0,"maxFeePerGas"),Yy(e.gasLimit,"gasLimit"),e.to||zd,Yy(e.value,"value"),e.data,Zy(e.accessList||[]),Yy(e.maxFeePerBlobGas||0,"maxFeePerBlobGas"),Xy(e.blobVersionedHashes||[],"blobVersionedHashes")];return t&&(n.push(Yy(t.yParity,"yParity")),n.push(Ze(t.r)),n.push(Ze(t.s)),r)?Ue(["0x03",Ly([n,r.map(e=>e.data),r.map(e=>e.commitment),r.map(e=>e.proof)])]):Ue(["0x03",Ly(n)])}(this,r,t?this.blobs:null);case 4:return function(e,t){const r=[Yy(e.chainId,"chainId"),Yy(e.nonce,"nonce"),Yy(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Yy(e.maxFeePerGas||0,"maxFeePerGas"),Yy(e.gasLimit,"gasLimit"),e.to||"0x",Yy(e.value,"value"),e.data,Zy(e.accessList||[]),(n=e.authorizationList||[],n.map(e=>[Yy(e.chainId,"chainId"),e.address,Yy(e.nonce,"nonce"),Yy(e.signature.yParity,"yParity"),Ze(e.signature.r),Ze(e.signature.s)]))];var n;return t&&(r.push(Yy(t.yParity,"yParity")),r.push(Ze(t.r)),r.push(Ze(t.s))),Ue(["0x04",Ly(r)])}(this,r)}Ee(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get serialized(){return this.#$(!0,!0)}get unsignedSerialized(){return this.#$(!1,!1)}inferType(){const e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){const e=null!=this.gasPrice,t=null!=this.maxFeePerGas||null!=this.maxPriorityFeePerGas,r=null!=this.accessList,n=null!=this.#W||this.#J;null!=this.maxFeePerGas&&null!=this.maxPriorityFeePerGas&&Ee(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),Ee(!t||0!==this.type&&1!==this.type,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),Ee(0!==this.type||!r,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const i=[];return null!=this.type?i.push(this.type):this.authorizationList&&this.authorizationList.length?i.push(4):t?i.push(2):e?(i.push(1),r||i.push(0)):r?(i.push(1),i.push(2)):(n&&this.to||(i.push(0),i.push(1),i.push(2)),i.push(3)),i.sort(),i}isLegacy(){return 0===this.type}isBerlin(){return 1===this.type}isLondon(){return 2===this.type}isCancun(){return 3===this.type}clone(){return em.from(this)}toJSON(){const e=e=>null==e?null:e.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(null==e)return new em;if("string"==typeof e){const t=Ie(e);if(t[0]>=127)return em.from(function(e){const t=xy(e);Ce(Array.isArray(t)&&(9===t.length||6===t.length),"invalid field count for legacy transaction","data",e);const r={type:0,nonce:Wy(t[0],"nonce"),gasPrice:Jy(t[1],"gasPrice"),gasLimit:Jy(t[2],"gasLimit"),to:zy(t[3]),value:Jy(t[4],"value"),data:Re(t[5]),chainId:Fy};if(6===t.length)return r;const n=Jy(t[6],"v"),i=Jy(t[7],"r"),s=Jy(t[8],"s");if(i===Fy&&s===Fy)r.chainId=n;else{let e=(n-Vy)/My;e<Fy&&(e=Fy),r.chainId=e,Ce(e!==Fy||n===jy||n===Ky,"non-canonical legacy v","v",t[6]),r.signature=Pd.from({r:Me(t[7],32),s:Me(t[8],32),v:n})}return r}(t));switch(t[0]){case 1:return em.from(function(e){const t=xy(Ie(e).slice(1));Ce(Array.isArray(t)&&(8===t.length||11===t.length),"invalid field count for transaction type: 1","data",Re(e));const r={type:1,chainId:Jy(t[0],"chainId"),nonce:Wy(t[1],"nonce"),gasPrice:Jy(t[2],"gasPrice"),gasLimit:Jy(t[3],"gasLimit"),to:zy(t[4]),value:Jy(t[5],"value"),data:Re(t[6]),accessList:qy(t[7],"accessList")};return 8===t.length||$y(r,t.slice(8)),r}(t));case 2:return em.from(function(e){const t=xy(Ie(e).slice(1));Ce(Array.isArray(t)&&(9===t.length||12===t.length),"invalid field count for transaction type: 2","data",Re(e));const r={type:2,chainId:Jy(t[0],"chainId"),nonce:Wy(t[1],"nonce"),maxPriorityFeePerGas:Jy(t[2],"maxPriorityFeePerGas"),maxFeePerGas:Jy(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:Jy(t[4],"gasLimit"),to:zy(t[5]),value:Jy(t[6],"value"),data:Re(t[7]),accessList:qy(t[8],"accessList")};return 9===t.length||$y(r,t.slice(9)),r}(t));case 3:return em.from(function(e){let t=xy(Ie(e).slice(1)),r="3",n=null;if(4===t.length&&Array.isArray(t[0])){r="3 (network format)";const e=t[1],i=t[2],s=t[3];Ce(Array.isArray(e),"invalid network format: blobs not an array","fields[1]",e),Ce(Array.isArray(i),"invalid network format: commitments not an array","fields[2]",i),Ce(Array.isArray(s),"invalid network format: proofs not an array","fields[3]",s),Ce(e.length===i.length,"invalid network format: blobs/commitments length mismatch","fields",t),Ce(e.length===s.length,"invalid network format: blobs/proofs length mismatch","fields",t),n=[];for(let r=0;r<t[1].length;r++)n.push({data:e[r],commitment:i[r],proof:s[r]});t=t[0]}Ce(Array.isArray(t)&&(11===t.length||14===t.length),`invalid field count for transaction type: ${r}`,"data",Re(e));const i={type:3,chainId:Jy(t[0],"chainId"),nonce:Wy(t[1],"nonce"),maxPriorityFeePerGas:Jy(t[2],"maxPriorityFeePerGas"),maxFeePerGas:Jy(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:Jy(t[4],"gasLimit"),to:zy(t[5]),value:Jy(t[6],"value"),data:Re(t[7]),accessList:qy(t[8],"accessList"),maxFeePerBlobGas:Jy(t[9],"maxFeePerBlobGas"),blobVersionedHashes:t[10]};n&&(i.blobs=n),Ce(null!=i.to,`invalid address for transaction type: ${r}`,"data",e),Ce(Array.isArray(i.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",e);for(let t=0;t<i.blobVersionedHashes.length;t++)Ce(Ne(i.blobVersionedHashes[t],32),`invalid blobVersionedHash at index ${t}: must be length 32`,"data",e);return 11===t.length||$y(i,t.slice(11)),i}(t));case 4:return em.from(function(e){const t=xy(Ie(e).slice(1));Ce(Array.isArray(t)&&(10===t.length||13===t.length),"invalid field count for transaction type: 4","data",Re(e));const r={type:4,chainId:Jy(t[0],"chainId"),nonce:Wy(t[1],"nonce"),maxPriorityFeePerGas:Jy(t[2],"maxPriorityFeePerGas"),maxFeePerGas:Jy(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:Jy(t[4],"gasLimit"),to:zy(t[5]),value:Jy(t[6],"value"),data:Re(t[7]),accessList:qy(t[8],"accessList"),authorizationList:Qy(t[9],"authorizationList")};return 10===t.length||$y(r,t.slice(10)),r}(t))}Ee(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const t=new em;return null!=e.type&&(t.type=e.type),null!=e.to&&(t.to=e.to),null!=e.nonce&&(t.nonce=e.nonce),null!=e.gasLimit&&(t.gasLimit=e.gasLimit),null!=e.gasPrice&&(t.gasPrice=e.gasPrice),null!=e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas),null!=e.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null!=e.maxFeePerBlobGas&&(t.maxFeePerBlobGas=e.maxFeePerBlobGas),null!=e.data&&(t.data=e.data),null!=e.value&&(t.value=e.value),null!=e.chainId&&(t.chainId=e.chainId),null!=e.signature&&(t.signature=Pd.from(e.signature)),null!=e.accessList&&(t.accessList=e.accessList),null!=e.authorizationList&&(t.authorizationList=e.authorizationList),null!=e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes),null!=e.kzg&&(t.kzg=e.kzg),null!=e.blobs&&(t.blobs=e.blobs),null!=e.hash&&(Ce(t.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),Ce(t.hash===e.hash,"hash mismatch","tx",e)),null!=e.from&&(Ce(t.isSigned(),"unsigned transaction cannot define '.from'","tx",e),Ce(t.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),t}}const tm="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";BigInt(0);const rm=BigInt(58);function nm(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):Ce(!1,"unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}class im{name;constructor(e){me(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,t){throw new Error("unsupported coin")}async decodeAddress(e,t){throw new Error("unsupported coin")}}const sm=new RegExp("^(ipfs)://(.*)$","i"),am=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),sm,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];class om{provider;address;name;#Be;#Se;constructor(e,t,r){me(this,{provider:e,address:t,name:r}),this.#Be=null,this.#Se=new Kf(t,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e)}async supportsWildcard(){return null==this.#Be&&(this.#Be=(async()=>{try{return await this.#Se.supportsInterface("0x9061b923")}catch(e){if(we(e,"CALL_EXCEPTION"))return!1;throw this.#Be=null,e}})()),await this.#Be}async#ke(e,t){t=(t||[]).slice();const r=this.#Se.interface;t.unshift(Zp(this.name));let n=null;await this.supportsWildcard()&&(n=r.getFunction(e),Ee(n,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),t=[Xp(this.name,255),r.encodeFunctionData(n,t)],e="resolve(bytes,bytes)"),t.push({enableCcipRead:!0});try{const i=await this.#Se[e](...t);return n?r.decodeFunctionResult(n,i)[0]:i}catch(e){if(!we(e,"CALL_EXCEPTION"))throw e}return null}async getAddress(e){if(null==e&&(e=60),60===e)try{const e=await this.#ke("addr(bytes32)");return null==e||e===zd?null:e}catch(e){if(we(e,"CALL_EXCEPTION"))return null;throw e}if(e>=0&&e<2147483648){let t=e+2147483648;const r=await this.#ke("addr(bytes32,uint)",[t]);if(Ne(r,20))return Il(r)}let t=null;for(const r of this.provider.plugins)if(r instanceof im&&r.supportsCoinType(e)){t=r;break}if(null==t)return null;const r=await this.#ke("addr(bytes32,uint)",[e]);if(null==r||"0x"===r)return null;const n=await t.decodeAddress(e,r);if(null!=n)return n;Ee(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:r}})}async getText(e){const t=await this.#ke("text(bytes32,string)",[e]);return null==t||"0x"===t?null:t}async getContentHash(){const e=await this.#ke("contenthash(bytes32)");if(null==e||"0x"===e)return null;const t=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const e="e3010170"===t[1]?"ipfs":"ipns",r=parseInt(t[4],16);if(t[5].length===2*r)return`${e}://${function(e){const t=Ie(e);let r=We(t),n="";for(;r;)n=tm[Number(r%rm)]+n,r/=rm;for(let e=0;e<t.length&&!t[e];e++)n=tm[0]+n;return n}("0x"+t[2])}`}const r=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&64===r[1].length)return`bzz://${r[1]}`;Ee(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const t=await this.getText("avatar");if(null==t)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:t});for(let r=0;r<am.length;r++){const n=t.match(am[r]);if(null==n)continue;const i=n[1].toLowerCase();switch(i){case"https":case"data":return e.push({type:"url",value:t}),{linkage:e,url:t};case"ipfs":{const r=nm(t);return e.push({type:"ipfs",value:t}),e.push({type:"url",value:r}),{linkage:e,url:r}}case"erc721":case"erc1155":{const r="erc721"===i?"tokenURI(uint256)":"uri(uint256)";e.push({type:i,value:t});const s=await this.getAddress();if(null==s)return e.push({type:"!owner",value:""}),{url:null,linkage:e};const a=(n[2]||"").split("/");if(2!==a.length)return e.push({type:`!${i}caip`,value:n[2]||""}),{url:null,linkage:e};const o=a[1],c=new Kf(a[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if("erc721"===i){const t=await c.ownerOf(o);if(s!==t)return e.push({type:"!owner",value:t}),{url:null,linkage:e};e.push({type:"owner",value:t})}else if("erc1155"===i){const t=await c.balanceOf(s,o);if(!t)return e.push({type:"!balance",value:"0"}),{url:null,linkage:e};e.push({type:"balance",value:t.toString()})}let u=await c[r](o);if(null==u||"0x"===u)return e.push({type:"!metadata-url",value:""}),{url:null,linkage:e};e.push({type:"metadata-url-base",value:u}),"erc1155"===i&&(u=u.replace("{id}",Ye(o,32).substring(2)),e.push({type:"metadata-url-expanded",value:u})),u.match(/^ipfs:/i)&&(u=nm(u)),e.push({type:"metadata-url",value:u});let l={};const h=await new Hd(u).send();h.assertOk();try{l=h.bodyJson}catch(t){try{e.push({type:"!metadata",value:h.bodyText})}catch(t){const r=h.body;return r&&e.push({type:"!metadata",value:Re(r)}),{url:null,linkage:e}}return{url:null,linkage:e}}if(!l)return e.push({type:"!metadata",value:""}),{url:null,linkage:e};e.push({type:"metadata",value:JSON.stringify(l)});let d=l.image;if("string"!=typeof d)return e.push({type:"!imageUrl",value:""}),{url:null,linkage:e};if(d.match(/^(https:\/\/|data:)/i));else{if(null==d.match(sm))return e.push({type:"!imageUrl-ipfs",value:d}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:d}),d=nm(d)}return e.push({type:"url",value:d}),{linkage:e,url:d}}}}}catch(e){}return{linkage:e,url:null}}static async getEnsAddress(e){const t=await e.getNetwork(),r=t.getPlugin("org.ethers.plugins.network.Ens");return Ee(r,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:t}}),r.address}static async#Te(e,t){const r=await om.getEnsAddress(e);try{const n=new Kf(r,["function resolver(bytes32) view returns (address)"],e),i=await n.resolver(Zp(t),{enableCcipRead:!0});return i===zd?null:i}catch(e){throw e}}static async fromName(e,t){let r=t;for(;;){if(""===r||"."===r)return null;if("eth"!==t&&"eth"===r)return null;const n=await om.#Te(e,r);if(null!=n){const i=new om(e,n,t);return r===t||await i.supportsWildcard()?i:null}r=r.split(".").slice(1).join(".")}}}const cm=BigInt(0);function um(e,t){return function(r){return null==r?t:e(r)}}function lm(e,t){return r=>{if(t&&null==r)return null;if(!Array.isArray(r))throw new Error("not an array");return r.map(t=>e(t))}}function hm(e,t){return r=>{const n={};for(const i in e){let s=i;if(t&&i in t&&!(s in r))for(const e of t[i])if(e in r){s=e;break}try{const t=e[i](r[s]);void 0!==t&&(n[i]=t)}catch(e){Ee(!1,`invalid value for value.${i} (${e instanceof Error?e.message:"not-an-error"})`,"BAD_DATA",{value:r})}}return n}}function dm(e){return Ce(Ne(e,!0),"invalid data","value",e),e}function fm(e){return Ce(Ne(e,32),"invalid hash","value",e),e}const pm=hm({address:Il,blockHash:fm,blockNumber:Je,data:dm,index:Je,removed:um(function(e){switch(e){case!0:case"true":return!0;case!1:case"false":return!1}Ce(!1,`invalid boolean; ${JSON.stringify(e)}`,"value",e)},!1),topics:lm(fm),transactionHash:fm,transactionIndex:Je},{index:["logIndex"]});const gm=hm({hash:um(fm),parentHash:fm,parentBeaconBlockRoot:um(fm,null),number:Je,timestamp:Je,nonce:um(dm),difficulty:ze,gasLimit:ze,gasUsed:ze,stateRoot:um(fm,null),receiptsRoot:um(fm,null),blobGasUsed:um(ze,null),excessBlobGas:um(ze,null),miner:um(Il),prevRandao:um(fm,null),extraData:dm,baseFeePerGas:um(ze)},{prevRandao:["mixHash"]});const ym=hm({transactionIndex:Je,blockNumber:Je,transactionHash:fm,address:Il,topics:lm(fm),data:dm,index:Je,blockHash:fm},{index:["logIndex"]});const mm=hm({to:um(Il,null),from:um(Il,null),contractAddress:um(Il,null),index:Je,root:um(Re),gasUsed:ze,blobGasUsed:um(ze,null),logsBloom:um(dm),blockHash:fm,hash:fm,logs:lm(function(e){return ym(e)}),blockNumber:Je,cumulativeGasUsed:ze,effectiveGasPrice:um(ze),blobGasPrice:um(ze,null),status:um(Je),type:um(Je,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function bm(e){e.to&&ze(e.to)===cm&&(e.to="0x0000000000000000000000000000000000000000");const t=hm({hash:fm,index:um(Je,void 0),type:e=>"0x"===e||null==e?0:Je(e),accessList:um(wd,null),blobVersionedHashes:um(lm(fm,!0),null),authorizationList:um(lm(e=>{let t;if(e.signature)t=e.signature;else{let r=e.yParity;"0x1b"===r?r=0:"0x1c"===r&&(r=1),t=Object.assign({},e,{yParity:r})}return{address:Il(e.address),chainId:ze(e.chainId),nonce:ze(e.nonce),signature:Pd.from(t)}},!1),null),blockHash:um(fm,null),blockNumber:um(Je,null),transactionIndex:um(Je,null),from:Il,gasPrice:um(ze),maxPriorityFeePerGas:um(ze),maxFeePerGas:um(ze),maxFeePerBlobGas:um(ze,null),gasLimit:ze,to:um(Il,null),value:ze,nonce:Je,data:dm,creates:um(Il,null),chainId:um(ze,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(e);if(null==t.to&&null==t.creates&&(t.creates=function(e){const t=Il(e.from);let r=ze(e.nonce,"tx.nonce").toString(16);return r="0"===r?"0x":r.length%2?"0x0"+r:"0x"+r,Il(De(Al(Ly([t,r])),12))}(t)),1!==e.type&&2!==e.type||null!=e.accessList||(t.accessList=[]),e.signature?t.signature=Pd.from(e.signature):t.signature=Pd.from(e),null==t.chainId){const e=t.signature.legacyChainId;null!=e&&(t.chainId=e)}return t.blockHash&&ze(t.blockHash)===cm&&(t.blockHash=null),t}class wm{name;constructor(e){me(this,{name:e})}clone(){return new wm(this.name)}}class vm extends wm{effectiveBlock;txBase;txCreate;txDataZero;txDataNonzero;txAccessListStorageKey;txAccessListAddress;constructor(e,t){null==e&&(e=0),super(`org.ethers.network.plugins.GasCost#${e||0}`);const r={effectiveBlock:e};function n(e,n){let i=(t||{})[e];null==i&&(i=n),Ce("number"==typeof i,`invalud value for ${e}`,"costs",t),r[e]=i}n("txBase",21e3),n("txCreate",32e3),n("txDataZero",4),n("txDataNonzero",16),n("txAccessListStorageKey",1900),n("txAccessListAddress",2400),me(this,r)}clone(){return new vm(this.effectiveBlock,this)}}class Am extends wm{address;targetNetwork;constructor(e,t){super("org.ethers.plugins.network.Ens"),me(this,{address:e||"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",targetNetwork:null==t?1:t})}clone(){return new Am(this.address,this.targetNetwork)}}class Em extends wm{#A;#Lt;get url(){return this.#A}get processFunc(){return this.#Lt}constructor(e,t){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"),this.#A=e,this.#Lt=t}clone(){return this}}const Cm=new Map;class Bm{#ft;#z;#Ye;constructor(e,t){this.#ft=e,this.#z=ze(t),this.#Ye=new Map}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return this.#ft}set name(e){this.#ft=e}get chainId(){return this.#z}set chainId(e){this.#z=ze(e,"chainId")}matches(e){if(null==e)return!1;if("string"==typeof e){try{return this.chainId===ze(e)}catch(e){}return this.name===e}if("number"==typeof e||"bigint"==typeof e){try{return this.chainId===ze(e)}catch(e){}return!1}if("object"==typeof e){if(null!=e.chainId){try{return this.chainId===ze(e.chainId)}catch(e){}return!1}return null!=e.name&&this.name===e.name}return!1}get plugins(){return Array.from(this.#Ye.values())}attachPlugin(e){if(this.#Ye.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#Ye.set(e.name,e.clone()),this}getPlugin(e){return this.#Ye.get(e)||null}getPlugins(e){return this.plugins.filter(t=>t.name.split("#")[0]===e)}clone(){const e=new Bm(this.name,this.chainId);return this.plugins.forEach(t=>{e.attachPlugin(t.clone())}),e}computeIntrinsicGas(e){const t=this.getPlugin("org.ethers.plugins.network.GasCost")||new vm;let r=t.txBase;if(null==e.to&&(r+=t.txCreate),e.data)for(let n=2;n<e.data.length;n+=2)"00"===e.data.substring(n,n+2)?r+=t.txDataZero:r+=t.txDataNonzero;if(e.accessList){const n=wd(e.accessList);for(const e in n)r+=t.txAccessListAddress+t.txAccessListStorageKey*n[e].storageKeys.length}return r}static from(e){if(function(){if(Tm)return;function e(e,t,r){const n=function(){const n=new Bm(e,t);return null!=r.ensNetwork&&n.attachPlugin(new Am(null,r.ensNetwork)),n.attachPlugin(new vm),(r.plugins||[]).forEach(e=>{n.attachPlugin(e)}),n};Bm.register(e,n),Bm.register(t,n),r.altNames&&r.altNames.forEach(e=>{Bm.register(e,n)})}Tm=!0,e("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),e("ropsten",3,{ensNetwork:3}),e("rinkeby",4,{ensNetwork:4}),e("goerli",5,{ensNetwork:5}),e("kovan",42,{ensNetwork:42}),e("sepolia",11155111,{ensNetwork:11155111}),e("holesky",17e3,{ensNetwork:17e3}),e("classic",61,{}),e("classicKotti",6,{}),e("arbitrum",42161,{ensNetwork:1}),e("arbitrum-goerli",421613,{}),e("arbitrum-sepolia",421614,{}),e("base",8453,{ensNetwork:1}),e("base-goerli",84531,{}),e("base-sepolia",84532,{}),e("bnb",56,{ensNetwork:1}),e("bnbt",97,{}),e("linea",59144,{ensNetwork:1}),e("linea-goerli",59140,{}),e("linea-sepolia",59141,{}),e("matic",137,{ensNetwork:1,plugins:[km("https://gasstation.polygon.technology/v2")]}),e("matic-amoy",80002,{}),e("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[km("https://gasstation-testnet.polygon.technology/v2")]}),e("optimism",10,{ensNetwork:1,plugins:[]}),e("optimism-goerli",420,{}),e("optimism-sepolia",11155420,{}),e("xdai",100,{ensNetwork:1})}(),null==e)return Bm.from("mainnet");if("number"==typeof e&&(e=BigInt(e)),"string"==typeof e||"bigint"==typeof e){const t=Cm.get(e);if(t)return t();if("bigint"==typeof e)return new Bm("unknown",e);Ce(!1,"unknown network","network",e)}if("function"==typeof e.clone){return e.clone()}if("object"==typeof e){Ce("string"==typeof e.name&&"number"==typeof e.chainId,"invalid network object name or chainId","network",e);const t=new Bm(e.name,e.chainId);return(e.ensAddress||null!=e.ensNetwork)&&t.attachPlugin(new Am(e.ensAddress,e.ensNetwork)),t}Ce(!1,"invalid network","network",e)}static register(e,t){"number"==typeof e&&(e=BigInt(e));const r=Cm.get(e);r&&Ce(!1,`conflicting network for ${JSON.stringify(r.name)}`,"nameOrChainId",e),Cm.set(e,t)}}function Sm(e,t){const r=String(e);if(!r.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${e}`);const n=r.split(".");if(1===n.length&&n.push(""),2!==n.length)throw new Error(`invalid gwei value: ${e}`);for(;n[1].length<t;)n[1]+="0";if(n[1].length>9){let e=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||e++,n[1]=e.toString()}return BigInt(n[0]+n[1])}function km(e){return new Em(e,async(e,t,r)=>{let n;r.setHeader("User-Agent","ethers");try{const[t,i]=await Promise.all([r.send(),e()]);n=t;const s=n.bodyJson.standard;return{gasPrice:i.gasPrice,maxFeePerGas:Sm(s.maxFee,9),maxPriorityFeePerGas:Sm(s.maxPriorityFee,9)}}catch(e){Ee(!1,`error encountered with polygon gas station (${JSON.stringify(r.url)})`,"SERVER_ERROR",{request:r,response:n,error:e})}})}let Tm=!1;function Im(e){return JSON.parse(JSON.stringify(e))}class Pm{#De;#yt;#Ct;#Bt;constructor(e){this.#De=e,this.#yt=null,this.#Ct=4e3,this.#Bt=-2}get pollingInterval(){return this.#Ct}set pollingInterval(e){this.#Ct=e}async#wt(){try{const e=await this.#De.getBlockNumber();if(-2===this.#Bt)return void(this.#Bt=e);if(e!==this.#Bt){for(let t=this.#Bt+1;t<=e;t++){if(null==this.#yt)return;await this.#De.emit("block",t)}this.#Bt=e}}catch(e){}null!=this.#yt&&(this.#yt=this.#De._setTimeout(this.#wt.bind(this),this.#Ct))}start(){this.#yt||(this.#yt=this.#De._setTimeout(this.#wt.bind(this),this.#Ct),this.#wt())}stop(){this.#yt&&(this.#De._clearTimeout(this.#yt),this.#yt=null)}pause(e){this.stop(),e&&(this.#Bt=-2)}resume(){this.start()}}class Nm{#De;#wt;#mt;constructor(e){this.#De=e,this.#mt=!1,this.#wt=e=>{this._poll(e,this.#De)}}async _poll(e,t){throw new Error("sub-classes must override this")}start(){this.#mt||(this.#mt=!0,this.#wt(-2),this.#De.on("block",this.#wt))}stop(){this.#mt&&(this.#mt=!1,this.#De.off("block",this.#wt))}pause(e){this.stop()}resume(){this.start()}}class xm extends Nm{#St;#kt;constructor(e,t){super(e),this.#St=t,this.#kt=-2}pause(e){e&&(this.#kt=-2),super.pause(e)}async _poll(e,t){const r=await t.getBlock(this.#St);null!=r&&(-2===this.#kt?this.#kt=r.number:r.number>this.#kt&&(t.emit(this.#St,r.number),this.#kt=r.number))}}class Om extends Nm{#Fe;constructor(e,t){super(e),this.#Fe=Im(t)}async _poll(e,t){throw new Error("@TODO")}}class Rm extends Nm{#Tt;constructor(e,t){super(e),this.#Tt=t}async _poll(e,t){const r=await t.getTransactionReceipt(this.#Tt);r&&t.emit(this.#Tt,r)}}class Um{#De;#Fe;#yt;#mt;#Bt;constructor(e,t){this.#De=e,this.#Fe=Im(t),this.#yt=this.#wt.bind(this),this.#mt=!1,this.#Bt=-2}async#wt(e){if(-2===this.#Bt)return;const t=Im(this.#Fe);t.fromBlock=this.#Bt+1,t.toBlock=e;const r=await this.#De.getLogs(t);if(0!==r.length)for(const e of r)this.#De.emit(this.#Fe,e),this.#Bt=e.blockNumber;else this.#Bt<e-60&&(this.#Bt=e-60)}start(){this.#mt||(this.#mt=!0,-2===this.#Bt&&this.#De.getBlockNumber().then(e=>{this.#Bt=e}),this.#De.on("block",this.#yt))}stop(){this.#mt&&(this.#mt=!1,this.#De.off("block",this.#yt))}pause(e){this.stop(),e&&(this.#Bt=-2)}resume(){this.start()}}const Lm=BigInt(2);function Dm(e){return e&&"function"==typeof e.then}function Fm(e,t){return e+":"+JSON.stringify(t,(e,t)=>{if(null==t)return"null";if("bigint"==typeof t)return`bigint:${t.toString()}`;if("string"==typeof t)return t.toLowerCase();if("object"==typeof t&&!Array.isArray(t)){const e=Object.keys(t);return e.sort(),e.reduce((e,r)=>(e[r]=t[r],e),{})}return t})}class Mm{name;constructor(e){me(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function jm(e){return(e=Array.from(new Set(e).values())).sort(),e}async function Km(e,t){if(null==e)throw new Error("invalid event");if(Array.isArray(e)&&(e={topics:e}),"string"==typeof e)switch(e){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:e,tag:e}}if(Ne(e,32)){const t=e.toLowerCase();return{type:"transaction",tag:Fm("tx",{hash:t}),hash:t}}if(e.orphan){const t=e;return{type:"orphan",tag:Fm("orphan",t),filter:(r=t,JSON.parse(JSON.stringify(r)))}}var r;if(e.address||e.topics){const r=e,n={topics:(r.topics||[]).map(e=>null==e?null:Array.isArray(e)?jm(e.map(e=>e.toLowerCase())):e.toLowerCase())};if(r.address){const e=[],i=[],s=r=>{Ne(r)?e.push(r):i.push((async()=>{e.push(await rd(r,t))})())};Array.isArray(r.address)?r.address.forEach(s):s(r.address),i.length&&await Promise.all(i),n.address=jm(e.map(e=>e.toLowerCase()))}return{filter:n,tag:Fm("event",n),type:"event"}}Ce(!1,"unknown ProviderEvent","event",e)}function Vm(){return(new Date).getTime()}const Hm={cacheTimeout:250,pollingInterval:4e3};class _m{#_e;#Ye;#Ze;#Xe;#$e;#et;#tt;#rt;#nt;#it;#st;#e;constructor(e,t){if(this.#e=Object.assign({},Hm,t||{}),"any"===e)this.#et=!0,this.#$e=null;else if(e){const t=Bm.from(e);this.#et=!1,this.#$e=Promise.resolve(t),setTimeout(()=>{this.emit("network",t,null)},0)}else this.#et=!1,this.#$e=null;this.#rt=-1,this.#tt=new Map,this.#_e=new Map,this.#Ye=new Map,this.#Ze=null,this.#Xe=!1,this.#nt=1,this.#it=new Map,this.#st=!1}get pollingInterval(){return this.#e.pollingInterval}get provider(){return this}get plugins(){return Array.from(this.#Ye.values())}attachPlugin(e){if(this.#Ye.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#Ye.set(e.name,e.connect(this)),this}getPlugin(e){return this.#Ye.get(e)||null}get disableCcipRead(){return this.#st}set disableCcipRead(e){this.#st=!!e}async#at(e){const t=this.#e.cacheTimeout;if(t<0)return await this._perform(e);const r=Fm(e.method,e);let n=this.#tt.get(r);return n||(n=this._perform(e),this.#tt.set(r,n),setTimeout(()=>{this.#tt.get(r)===n&&this.#tt.delete(r)},t)),await n}async ccipReadFetch(e,t,r){if(this.disableCcipRead||0===r.length||null==e.to)return null;const n=e.to.toLowerCase(),i=t.toLowerCase(),s=[];for(let t=0;t<r.length;t++){const a=r[t],o=a.replace("{sender}",n).replace("{data}",i),c=new Hd(o);-1===a.indexOf("{data}")&&(c.body={data:i,sender:n}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:c,index:t,urls:r});let u,l="unknown error";try{u=await c.send()}catch(e){s.push(e.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:c,result:{error:e}});continue}try{const e=u.bodyJson;if(e.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:c,result:e}),e.data;e.message&&(l=e.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:c,result:e})}catch(e){}Ee(u.statusCode<400||u.statusCode>=500,`response not found during CCIP fetch: ${l}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:a,errorMessage:l}}),s.push(l)}Ee(!1,`error encountered during CCIP fetch: ${s.map(e=>JSON.stringify(e)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:r,errorMessages:s}})}_wrapBlock(e,t){return new sf(function(e){const t=gm(e);return t.transactions=e.transactions.map(e=>"string"==typeof e?e:bm(e)),t}(e),this)}_wrapLog(e,t){return new af(function(e){return pm(e)}(e),this)}_wrapTransactionReceipt(e,t){return new of(function(e){return mm(e)}(e),this)}_wrapTransactionResponse(e,t){return new cf(bm(e),this)}_detectNetwork(){Ee(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){Ee(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=Je(await this.#at({method:"getBlockNumber"}),"%response");return this.#rt>=0&&(this.#rt=e),e}_getAddress(e){return rd(e,this)}_getBlockTag(e){if(null==e)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}return Ne(e)?Ne(e,32)?e:Xe(e):("bigint"==typeof e&&(e=Je(e,"blockTag")),"number"==typeof e?e>=0?Xe(e):this.#rt>=0?Xe(this.#rt+e):this.getBlockNumber().then(t=>Xe(t+e)):void Ce(!1,"invalid blockTag","blockTag",e))}_getFilter(e){const t=(e.topics||[]).map(e=>null==e?null:Array.isArray(e)?jm(e.map(e=>e.toLowerCase())):e.toLowerCase()),r="blockHash"in e?e.blockHash:void 0,n=(e,n,i)=>{let s;switch(e.length){case 0:break;case 1:s=e[0];break;default:e.sort(),s=e}if(r&&(null!=n||null!=i))throw new Error("invalid filter");const a={};return s&&(a.address=s),t.length&&(a.topics=t),n&&(a.fromBlock=n),i&&(a.toBlock=i),r&&(a.blockHash=r),a};let i,s,a=[];if(e.address)if(Array.isArray(e.address))for(const t of e.address)a.push(this._getAddress(t));else a.push(this._getAddress(e.address));return"fromBlock"in e&&(i=this._getBlockTag(e.fromBlock)),"toBlock"in e&&(s=this._getBlockTag(e.toBlock)),a.filter(e=>"string"!=typeof e).length||null!=i&&"string"!=typeof i||null!=s&&"string"!=typeof s?Promise.all([Promise.all(a),i,s]).then(e=>n(e[0],e[1],e[2])):n(a,i,s)}_getTransactionRequest(e){const t=nf(e),r=[];if(["to","from"].forEach(e=>{if(null==t[e])return;const n=rd(t[e],this);Dm(n)?r.push(async function(){t[e]=await n}()):t[e]=n}),null!=t.blockTag){const e=this._getBlockTag(t.blockTag);Dm(e)?r.push(async function(){t.blockTag=await e}()):t.blockTag=e}return r.length?async function(){return await Promise.all(r),t}():t}async getNetwork(){if(null==this.#$e){const e=(async()=>{try{const e=await this._detectNetwork();return this.emit("network",e,null),e}catch(t){throw this.#$e===e&&(this.#$e=null),t}})();return this.#$e=e,(await e).clone()}const e=this.#$e,[t,r]=await Promise.all([e,this._detectNetwork()]);return t.chainId!==r.chainId&&(this.#et?(this.emit("network",r,t),this.#$e===e&&(this.#$e=Promise.resolve(r))):Ee(!1,`network changed: ${t.chainId} => ${r.chainId} `,"NETWORK_ERROR",{event:"changed"})),t.clone()}async getFeeData(){const e=await this.getNetwork(),t=async()=>{const{_block:t,gasPrice:r,priorityFee:n}=await ye({_block:this.#ot("latest",!1),gasPrice:(async()=>{try{return ze(await this.#at({method:"getGasPrice"}),"%response")}catch(e){}return null})(),priorityFee:(async()=>{try{return ze(await this.#at({method:"getPriorityFee"}),"%response")}catch(e){}return null})()});let i=null,s=null;const a=this._wrapBlock(t,e);return a&&a.baseFeePerGas&&(s=null!=n?n:BigInt("1000000000"),i=a.baseFeePerGas*Lm+s),new rf(r,i,s)},r=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(r){const e=new Hd(r.url),n=await r.processFunc(t,this,e);return new rf(n.gasPrice,n.maxFeePerGas,n.maxPriorityFeePerGas)}return await t()}async estimateGas(e){let t=this._getTransactionRequest(e);return Dm(t)&&(t=await t),ze(await this.#at({method:"estimateGas",transaction:t}),"%response")}async#ct(e,t,r){Ee(r<10,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:t,enableCcipRead:!0})});const n=nf(e);try{return Re(await this._perform({method:"call",transaction:n,blockTag:t}))}catch(e){if(!this.disableCcipRead&&ve(e)&&e.data&&r>=0&&"latest"===t&&null!=n.to&&"0x556f1830"===De(e.data,0,4)){const i=e.data,s=await rd(n.to,this);let a;try{a=function(e){const t={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};Ee(Le(e)>=160,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const r=De(e,0,32);Ee(De(r,0,12)===De(Ym,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),t.sender=De(r,12);try{const r=[],n=Je(De(e,32,64)),i=Je(De(e,n,n+32)),s=De(e,n+32);for(let e=0;e<i;e++){const t=Gm(s,32*e);if(null==t)throw new Error("abort");r.push(t)}t.urls=r}catch(e){Ee(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{const r=zm(e,64);if(null==r)throw new Error("abort");t.calldata=r}catch(e){Ee(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}Ee(De(e,100,128)===De(Ym,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),t.selector=De(e,96,100);try{const r=zm(e,128);if(null==r)throw new Error("abort");t.extraData=r}catch(e){Ee(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return t.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(e=>t[e]),t}(De(e.data,4))}catch(e){Ee(!1,e.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:n,info:{data:i}})}Ee(a.sender.toLowerCase()===s.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:i,reason:"OffchainLookup",transaction:n,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:a.errorArgs}});const o=await this.ccipReadFetch(n,a.calldata,a.urls);Ee(null!=o,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:n,info:{data:e.data,errorArgs:a.errorArgs}});const c={to:s,data:Ue([a.selector,Jm([o,a.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:c});try{const e=await this.#ct(c,t,r+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},c),result:e}),e}catch(e){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},c),error:e}),e}}throw e}}async#ut(e){const{value:t}=await ye({network:this.getNetwork(),value:e});return t}async call(e){const{tx:t,blockTag:r}=await ye({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await this.#ut(this.#ct(t,r,e.enableCcipRead?0:-1))}async#lt(e,t,r){let n=this._getAddress(t),i=this._getBlockTag(r);return"string"==typeof n&&"string"==typeof i||([n,i]=await Promise.all([n,i])),await this.#ut(this.#at(Object.assign(e,{address:n,blockTag:i})))}async getBalance(e,t){return ze(await this.#lt({method:"getBalance"},e,t),"%response")}async getTransactionCount(e,t){return Je(await this.#lt({method:"getTransactionCount"},e,t),"%response")}async getCode(e,t){return Re(await this.#lt({method:"getCode"},e,t))}async getStorage(e,t,r){const n=ze(t,"position");return Re(await this.#lt({method:"getStorage",position:n},e,r))}async broadcastTransaction(e){const{blockNumber:t,hash:r,network:n}=await ye({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),i=em.from(e);if(i.hash!==r)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(i,n).replaceableTransaction(t)}async#ot(e,t){if(Ne(e,32))return await this.#at({method:"getBlock",blockHash:e,includeTransactions:t});let r=this._getBlockTag(e);return"string"!=typeof r&&(r=await r),await this.#at({method:"getBlock",blockTag:r,includeTransactions:t})}async getBlock(e,t){const{network:r,params:n}=await ye({network:this.getNetwork(),params:this.#ot(e,!!t)});return null==n?null:this._wrapBlock(n,r)}async getTransaction(e){const{network:t,params:r}=await ye({network:this.getNetwork(),params:this.#at({method:"getTransaction",hash:e})});return null==r?null:this._wrapTransactionResponse(r,t)}async getTransactionReceipt(e){const{network:t,params:r}=await ye({network:this.getNetwork(),params:this.#at({method:"getTransactionReceipt",hash:e})});if(null==r)return null;if(null==r.gasPrice&&null==r.effectiveGasPrice){const t=await this.#at({method:"getTransaction",hash:e});if(null==t)throw new Error("report this; could not find tx or effectiveGasPrice");r.effectiveGasPrice=t.gasPrice}return this._wrapTransactionReceipt(r,t)}async getTransactionResult(e){const{result:t}=await ye({network:this.getNetwork(),result:this.#at({method:"getTransactionResult",hash:e})});return null==t?null:Re(t)}async getLogs(e){let t=this._getFilter(e);Dm(t)&&(t=await t);const{network:r,params:n}=await ye({network:this.getNetwork(),params:this.#at({method:"getLogs",filter:t})});return n.map(e=>this._wrapLog(e,r))}_getProvider(e){Ee(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await om.fromName(this,e)}async getAvatar(e){const t=await this.getResolver(e);return t?await t.getAvatar():null}async resolveName(e){const t=await this.getResolver(e);return t?await t.getAddress():null}async lookupAddress(e){const t=Zp((e=Il(e)).substring(2).toLowerCase()+".addr.reverse");try{const r=await om.getEnsAddress(this),n=new Kf(r,["function resolver(bytes32) view returns (address)"],this),i=await n.resolver(t);if(null==i||i===zd)return null;const s=new Kf(i,["function name(bytes32) view returns (string)"],this),a=await s.name(t);return await this.resolveName(a)!==e?null:a}catch(e){if(we(e,"BAD_DATA")&&"0x"===e.value)return null;if(we(e,"CALL_EXCEPTION"))return null;throw e}}async waitForTransaction(e,t,r){const n=null!=t?t:1;return 0===n?this.getTransactionReceipt(e):new Promise(async(t,i)=>{let s=null;const a=async r=>{try{const i=await this.getTransactionReceipt(e);if(null!=i&&r-i.blockNumber+1>=n)return t(i),void(s&&(clearTimeout(s),s=null))}catch(e){console.log("EEE",e)}this.once("block",a)};null!=r&&(s=setTimeout(()=>{null!=s&&(s=null,this.off("block",a),i(Ae("timeout","TIMEOUT",{reason:"timeout"})))},r)),a(await this.getBlockNumber())})}async waitForBlock(e){Ee(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const t=this.#it.get(e);t&&(t.timer&&clearTimeout(t.timer),this.#it.delete(e))}_setTimeout(e,t){null==t&&(t=0);const r=this.#nt++,n=()=>{this.#it.delete(r),e()};if(this.paused)this.#it.set(r,{timer:null,func:n,time:t});else{const e=setTimeout(n,t);this.#it.set(r,{timer:e,func:n,time:Vm()})}return r}_forEachSubscriber(e){for(const t of this.#_e.values())e(t.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new Mm(e.type);case"block":{const e=new Pm(this);return e.pollingInterval=this.pollingInterval,e}case"safe":case"finalized":return new xm(this,e.type);case"event":return new Um(this,e.filter);case"transaction":return new Rm(this,e.hash);case"orphan":return new Om(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,t){for(const r of this.#_e.values())if(r.subscriber===e){r.started&&r.subscriber.stop(),r.subscriber=t,r.started&&t.start(),null!=this.#Ze&&t.pause(this.#Ze);break}}async#ht(e,t){let r=await Km(e,this);return"event"===r.type&&t&&t.length>0&&!0===t[0].removed&&(r=await Km({orphan:"drop-log",log:t[0]},this)),this.#_e.get(r.tag)||null}async#dt(e){const t=await Km(e,this),r=t.tag;let n=this.#_e.get(r);if(!n){n={subscriber:this._getSubscriber(t),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},this.#_e.set(r,n)}return n}async on(e,t){const r=await this.#dt(e);return r.listeners.push({listener:t,once:!1}),r.started||(r.subscriber.start(),r.started=!0,null!=this.#Ze&&r.subscriber.pause(this.#Ze)),this}async once(e,t){const r=await this.#dt(e);return r.listeners.push({listener:t,once:!0}),r.started||(r.subscriber.start(),r.started=!0,null!=this.#Ze&&r.subscriber.pause(this.#Ze)),this}async emit(e,...t){const r=await this.#ht(e,t);if(!r||0===r.listeners.length)return!1;const n=r.listeners.length;return r.listeners=r.listeners.filter(({listener:r,once:n})=>{const i=new hf(this,n?null:r,e);try{r.call(this,...t,i)}catch(e){}return!n}),0===r.listeners.length&&(r.started&&r.subscriber.stop(),this.#_e.delete(r.tag)),n>0}async listenerCount(e){if(e){const t=await this.#ht(e);return t?t.listeners.length:0}let t=0;for(const{listeners:e}of this.#_e.values())t+=e.length;return t}async listeners(e){if(e){const t=await this.#ht(e);return t?t.listeners.map(({listener:e})=>e):[]}let t=[];for(const{listeners:e}of this.#_e.values())t=t.concat(e.map(({listener:e})=>e));return t}async off(e,t){const r=await this.#ht(e);if(!r)return this;if(t){const e=r.listeners.map(({listener:e})=>e).indexOf(t);e>=0&&r.listeners.splice(e,1)}return t&&0!==r.listeners.length||(r.started&&r.subscriber.stop(),this.#_e.delete(r.tag)),this}async removeAllListeners(e){if(e){const{tag:t,started:r,subscriber:n}=await this.#dt(e);r&&n.stop(),this.#_e.delete(t)}else for(const[e,{started:t,subscriber:r}]of this.#_e)t&&r.stop(),this.#_e.delete(e);return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return this.off(e,t)}get destroyed(){return this.#Xe}destroy(){this.removeAllListeners();for(const e of this.#it.keys())this._clearTimeout(e);this.#Xe=!0}get paused(){return null!=this.#Ze}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(this.#rt=-1,null!=this.#Ze){if(this.#Ze==!!e)return;Ee(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(t=>t.pause(e)),this.#Ze=!!e;for(const e of this.#it.values())e.timer&&clearTimeout(e.timer),e.time=Vm()-e.time}resume(){if(null!=this.#Ze){this._forEachSubscriber(e=>e.resume()),this.#Ze=null;for(const e of this.#it.values()){let t=e.time;t<0&&(t=0),e.time=Vm(),setTimeout(e.func,t)}}}}function Gm(e,t){try{const r=zm(e,t);if(r)return $l(r)}catch(e){}return null}function zm(e,t){if("0x"===e)return null;try{const r=Je(De(e,t,t+32)),n=Je(De(e,r,r+32));return De(e,r+32,r+32+n)}catch(e){}return null}function qm(e){const t=Ze(e);if(t.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(t,32-t.length),r}function Qm(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}const Wm=new Uint8Array([]);function Jm(e){const t=[];let r=0;for(let n=0;n<e.length;n++)t.push(Wm),r+=32;for(let n=0;n<e.length;n++){const i=Ie(e[n]);t[n]=qm(r),t.push(qm(i.length)),t.push(Qm(i)),r+=32+32*Math.ceil(i.length/32)}return Ue(t)}const Ym="0x0000000000000000000000000000000000000000000000000000000000000000";function Zm(e,t){if(e.provider)return e.provider;Ee(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:t})}async function Xm(e,t){let r=nf(t);if(null!=r.to&&(r.to=rd(r.to,e)),null!=r.from){const t=r.from;r.from=Promise.all([e.getAddress(),rd(t,e)]).then(([e,t])=>(Ce(e.toLowerCase()===t.toLowerCase(),"transaction from mismatch","tx.from",t),e))}else r.from=e.getAddress();return await ye(r)}class $m{provider;constructor(e){me(this,{provider:e||null})}async getNonce(e){return Zm(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await Xm(this,e)}async populateTransaction(e){const t=Zm(this,"populateTransaction"),r=await Xm(this,e);null==r.nonce&&(r.nonce=await this.getNonce("pending")),null==r.gasLimit&&(r.gasLimit=await this.estimateGas(r));const n=await this.provider.getNetwork();if(null!=r.chainId){Ce(ze(r.chainId)===n.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else r.chainId=n.chainId;const i=null!=r.maxFeePerGas||null!=r.maxPriorityFeePerGas;if(null==r.gasPrice||2!==r.type&&!i?0!==r.type&&1!==r.type||!i||Ce(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e):Ce(!1,"eip-1559 transaction do not support gasPrice","tx",e),2!==r.type&&null!=r.type||null==r.maxFeePerGas||null==r.maxPriorityFeePerGas)if(0===r.type||1===r.type){const e=await t.getFeeData();Ee(null!=e.gasPrice,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),null==r.gasPrice&&(r.gasPrice=e.gasPrice)}else{const e=await t.getFeeData();if(null==r.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(r.authorizationList&&r.authorizationList.length?r.type=4:r.type=2,null!=r.gasPrice){const e=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=e,r.maxPriorityFeePerGas=e}else null==r.maxFeePerGas&&(r.maxFeePerGas=e.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?(Ee(!i,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),null==r.gasPrice&&(r.gasPrice=e.gasPrice),r.type=0):Ee(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else 2!==r.type&&3!==r.type&&4!==r.type||(null==r.maxFeePerGas&&(r.maxFeePerGas=e.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else r.type=2;return await ye(r)}async populateAuthorization(e){const t=Object.assign({},e);return null==t.chainId&&(t.chainId=(await Zm(this,"getNetwork").getNetwork()).chainId),null==t.nonce&&(t.nonce=await this.getNonce()),t}async estimateGas(e){return Zm(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Zm(this,"call").call(await this.populateCall(e))}async resolveName(e){const t=Zm(this,"resolveName");return await t.resolveName(e)}async sendTransaction(e){const t=Zm(this,"sendTransaction"),r=await this.populateTransaction(e);delete r.from;const n=em.from(r);return await t.broadcastTransaction(await this.signTransaction(n))}authorize(e){Ee(!1,"authorization not implemented for this signer","UNSUPPORTED_OPERATION",{operation:"authorize"})}}class eb{#De;#gt;#yt;#mt;#s;#bt;constructor(e){this.#De=e,this.#gt=null,this.#yt=this.#wt.bind(this),this.#mt=!1,this.#s=null,this.#bt=!1}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,t){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}async#wt(e){try{null==this.#gt&&(this.#gt=this._subscribe(this.#De));let e=null;try{e=await this.#gt}catch(e){if(!we(e,"UNSUPPORTED_OPERATION")||"eth_newFilter"!==e.operation)throw e}if(null==e)return this.#gt=null,void this.#De._recoverSubscriber(this,this._recover(this.#De));const t=await this.#De.getNetwork();if(this.#s||(this.#s=t),this.#s.chainId!==t.chainId)throw new Error("chaid changed");if(this.#bt)return;const r=await this.#De.send("eth_getFilterChanges",[e]);await this._emitResults(this.#De,r)}catch(e){console.log("@TODO",e)}this.#De.once("block",this.#yt)}#vt(){const e=this.#gt;e&&(this.#gt=null,e.then(e=>{this.#De.destroyed||this.#De.send("eth_uninstallFilter",[e])}))}start(){this.#mt||(this.#mt=!0,this.#wt(-2))}stop(){this.#mt&&(this.#mt=!1,this.#bt=!0,this.#vt(),this.#De.off("block",this.#yt))}pause(e){e&&this.#vt(),this.#De.off("block",this.#yt)}resume(){this.start()}}class tb extends eb{#At;constructor(e,t){var r;super(e),this.#At=(r=t,JSON.parse(JSON.stringify(r)))}_recover(e){return new Um(e,this.#At)}async _subscribe(e){return await e.send("eth_newFilter",[this.#At])}async _emitResults(e,t){for(const r of t)e.emit(this.#At,e._wrapLog(r,e._network))}}class rb extends eb{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,t){for(const r of t)e.emit("pending",r)}}const nb="bigint,boolean,function,number,string,symbol".split(/,/g);function ib(e){if(null==e||nb.indexOf(typeof e)>=0)return e;if("function"==typeof e.getAddress)return e;if(Array.isArray(e))return e.map(ib);if("object"==typeof e)return Object.keys(e).reduce((t,r)=>(t[r]=e[r],t),{});throw new Error(`should not happen: ${e} (${typeof e})`)}function sb(e){return new Promise(t=>{setTimeout(t,e)})}function ab(e){return e?e.toLowerCase():e}function ob(e){return e&&"number"==typeof e.pollingInterval}const cb={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class ub extends $m{address;constructor(e,t){super(e),me(this,{address:t=Il(t)})}connect(e){Ee(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(e){return await this.populateCall(e)}async sendUncheckedTransaction(e){const t=ib(e),r=[];if(t.from){const n=t.from;r.push((async()=>{const r=await rd(n,this.provider);Ce(null!=r&&r.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),t.from=r})())}else t.from=this.address;if(null==t.gasLimit&&r.push((async()=>{t.gasLimit=await this.provider.estimateGas({...t,from:this.address})})()),null!=t.to){const e=t.to;r.push((async()=>{t.to=await rd(e,this.provider)})())}r.length&&await Promise.all(r);const n=this.provider.getRpcTransaction(t);return this.provider.send("eth_sendTransaction",[n])}async sendTransaction(e){const t=await this.provider.getBlockNumber(),r=await this.sendUncheckedTransaction(e);return await new Promise((e,n)=>{const i=[1e3,100];let s=0;const a=async()=>{try{const n=await this.provider.getTransaction(r);if(null!=n)return void e(n.replaceableTransaction(t))}catch(e){if(we(e,"CANCELLED")||we(e,"BAD_DATA")||we(e,"NETWORK_ERROR")||we(e,"UNSUPPORTED_OPERATION"))return null==e.info&&(e.info={}),e.info.sendTransactionHash=r,void n(e);if(we(e,"INVALID_ARGUMENT")&&(s++,null==e.info&&(e.info={}),e.info.sendTransactionHash=r,s>10))return void n(e);this.provider.emit("error",Ae("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:e}))}this.provider._setTimeout(()=>{a()},i.pop()||4e3)};a()})}async signTransaction(e){const t=ib(e);if(t.from){const r=await rd(t.from,this.provider);Ce(null!=r&&r.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),t.from=r}else t.from=this.address;const r=this.provider.getRpcTransaction(t);return await this.provider.send("eth_signTransaction",[r])}async signMessage(e){const t="string"==typeof e?Xl(e):e;return await this.provider.send("personal_sign",[Re(t),this.address.toLowerCase()])}async signTypedData(e,t,r){const n=ib(r),i=await md.resolveNames(e,t,n,async e=>{const t=await rd(e);return Ce(null!=t,"TypedData does not support null address","value",e),t});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(md.getPayload(i.domain,t,i.value))])}async unlock(e){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),e,null])}async _legacySignMessage(e){const t="string"==typeof e?Xl(e):e;return await this.provider.send("eth_sign",[this.address.toLowerCase(),Re(t)])}}class lb extends _m{#e;#t;#r;#n;#i;#s;#a;#o(){if(this.#n)return;const e=1===this._getOption("batchMaxCount")?0:this._getOption("batchStallTime");this.#n=setTimeout(()=>{this.#n=null;const e=this.#r;for(this.#r=[];e.length;){const t=[e.shift()];for(;e.length&&t.length!==this.#e.batchMaxCount;){t.push(e.shift());if(JSON.stringify(t.map(e=>e.payload)).length>this.#e.batchMaxSize){e.unshift(t.pop());break}}(async()=>{const e=1===t.length?t[0].payload:t.map(e=>e.payload);this.emit("debug",{action:"sendRpcPayload",payload:e});try{const r=await this._send(e);this.emit("debug",{action:"receiveRpcResult",result:r});for(const{resolve:e,reject:n,payload:i}of t){if(this.destroyed){n(Ae("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:i.method}));continue}const t=r.filter(e=>e.id===i.id)[0];if(null==t){const e=Ae("missing response for request","BAD_DATA",{value:r,info:{payload:i}});this.emit("error",e),n(e);continue}"error"in t?n(this.getRpcError(i,t)):e(t.result)}}catch(e){this.emit("debug",{action:"receiveRpcError",error:e});for(const{reject:r}of t)r(e)}})()}},e)}constructor(e,t){super(e,t),this.#t=1,this.#e=Object.assign({},cb,t||{}),this.#r=[],this.#n=null,this.#s=null,this.#a=null;{let e=null;const t=new Promise(t=>{e=t});this.#i={promise:t,resolve:e}}const r=this._getOption("staticNetwork");"boolean"==typeof r?(Ce(!r||"any"!==e,"staticNetwork cannot be used on special network 'any'","options",t),r&&null!=e&&(this.#s=Bm.from(e))):r&&(Ce(null==e||r.matches(e),"staticNetwork MUST match network object","options",t),this.#s=r)}_getOption(e){return this.#e[e]}get _network(){return Ee(this.#s,"network is not available yet","NETWORK_ERROR"),this.#s}async _perform(e){if("call"===e.method||"estimateGas"===e.method){let t=e.transaction;if(t&&null!=t.type&&ze(t.type)&&null==t.maxFeePerGas&&null==t.maxPriorityFeePerGas){const r=await this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&(e=Object.assign({},e,{transaction:Object.assign({},t,{type:void 0})}))}}const t=this.getRpcRequest(e);return null!=t?await this.send(t.method,t.args):super._perform(e)}async _detectNetwork(){const e=this._getOption("staticNetwork");if(e){if(!0!==e)return e;if(this.#s)return this.#s}return this.#a?await this.#a:this.ready?(this.#a=(async()=>{try{const e=Bm.from(ze(await this.send("eth_chainId",[])));return this.#a=null,e}catch(e){throw this.#a=null,e}})(),await this.#a):(this.#a=(async()=>{const e={id:this.#t++,method:"eth_chainId",params:[],jsonrpc:"2.0"};let t;this.emit("debug",{action:"sendRpcPayload",payload:e});try{t=(await this._send(e))[0],this.#a=null}catch(e){throw this.#a=null,this.emit("debug",{action:"receiveRpcError",error:e}),e}if(this.emit("debug",{action:"receiveRpcResult",result:t}),"result"in t)return Bm.from(ze(t.result));throw this.getRpcError(e,t)})(),await this.#a)}_start(){null!=this.#i&&null!=this.#i.resolve&&(this.#i.resolve(),this.#i=null,(async()=>{for(;null==this.#s&&!this.destroyed;)try{this.#s=await this._detectNetwork()}catch(e){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",Ae("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:e}})),await sb(1e3)}this.#o()})())}async _waitUntilReady(){if(null!=this.#i)return await this.#i.promise}_getSubscriber(e){return"pending"===e.type?new rb(this):"event"===e.type?this._getOption("polling")?new Um(this,e.filter):new tb(this,e.filter):"orphan"===e.type&&"drop-log"===e.filter.orphan?new Mm("orphan"):super._getSubscriber(e)}get ready(){return null==this.#i}getRpcTransaction(e){const t={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(r=>{if(null==e[r])return;let n=r;"gasLimit"===r&&(n="gas"),t[n]=Xe(ze(e[r],`tx.${r}`))}),["from","to","data"].forEach(r=>{null!=e[r]&&(t[r]=Re(e[r]))}),e.accessList&&(t.accessList=wd(e.accessList)),e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes.map(e=>e.toLowerCase())),e.authorizationList&&(t.authorizationList=e.authorizationList.map(e=>{const t=Nd(e);return{address:t.address,nonce:Xe(t.nonce),chainId:Xe(t.chainId),yParity:Xe(t.signature.yParity),r:Xe(t.signature.r),s:Xe(t.signature.s)}})),t}getRpcRequest(e){switch(e.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[ab(e.address),e.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[ab(e.address),e.blockTag]};case"getCode":return{method:"eth_getCode",args:[ab(e.address),e.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[ab(e.address),"0x"+e.position.toString(16),e.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[e.signedTransaction]};case"getBlock":if("blockTag"in e)return{method:"eth_getBlockByNumber",args:[e.blockTag,!!e.includeTransactions]};if("blockHash"in e)return{method:"eth_getBlockByHash",args:[e.blockHash,!!e.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[e.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[e.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(e.transaction),e.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(e.transaction)]};case"getLogs":return e.filter&&null!=e.filter.address&&(Array.isArray(e.filter.address)?e.filter.address=e.filter.address.map(ab):e.filter.address=ab(e.filter.address)),{method:"eth_getLogs",args:[e.filter]}}return null}getRpcError(e,t){const{method:r}=e,{error:n}=t;if("eth_estimateGas"===r&&n.message){const t=n.message;if(!t.match(/revert/i)&&t.match(/insufficient funds/i))return Ae("insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.params[0],info:{payload:e,error:n}});if(t.match(/nonce/i)&&t.match(/too low/i))return Ae("nonce has already been used","NONCE_EXPIRED",{transaction:e.params[0],info:{payload:e,error:n}})}if("eth_call"===r||"eth_estimateGas"===r){const t=db(n),i=$h.getBuiltinCallException("eth_call"===r?"call":"estimateGas",e.params[0],t?t.data:null);return i.info={error:n,payload:e},i}const i=JSON.stringify(function(e){const t=[];return fb(e,t),t}(n));if("string"==typeof n.message&&n.message.match(/user denied|ethers-user-denied/i)){return Ae("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[r]||"unknown",reason:"rejected",info:{payload:e,error:n}})}if("eth_sendRawTransaction"===r||"eth_sendTransaction"===r){const t=e.params[0];if(i.match(/insufficient funds|base fee exceeds gas limit/i))return Ae("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:t,info:{error:n}});if(i.match(/nonce/i)&&i.match(/too low/i))return Ae("nonce has already been used","NONCE_EXPIRED",{transaction:t,info:{error:n}});if(i.match(/replacement transaction/i)&&i.match(/underpriced/i))return Ae("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:t,info:{error:n}});if(i.match(/only replay-protected/i))return Ae("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:r,info:{transaction:t,info:{error:n}}})}let s=!!i.match(/the method .* does not exist/i);return s||n&&n.details&&n.details.startsWith("Unauthorized method:")&&(s=!0),s?Ae("unsupported operation","UNSUPPORTED_OPERATION",{operation:e.method,info:{error:n,payload:e}}):Ae("could not coalesce error","UNKNOWN_ERROR",{error:n,payload:e})}send(e,t){if(this.destroyed)return Promise.reject(Ae("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e}));const r=this.#t++,n=new Promise((n,i)=>{this.#r.push({resolve:n,reject:i,payload:{method:e,params:t,id:r,jsonrpc:"2.0"}})});return this.#o(),n}async getSigner(e){null==e&&(e=0);const t=this.send("eth_accounts",[]);if("number"==typeof e){const r=await t;if(e>=r.length)throw new Error("no such account");return new ub(this,r[e])}const{accounts:r}=await ye({network:this.getNetwork(),accounts:t});e=Il(e);for(const t of r)if(Il(t)===e)return new ub(this,e);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(e=>new ub(this,e))}destroy(){this.#n&&(clearTimeout(this.#n),this.#n=null);for(const{payload:e,reject:t}of this.#r)t(Ae("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e.method}));this.#r=[],super.destroy()}}class hb extends lb{#c;constructor(e,t){super(e,t);let r=this._getOption("pollingInterval");null==r&&(r=cb.pollingInterval),this.#c=r}_getSubscriber(e){const t=super._getSubscriber(e);return ob(t)&&(t.pollingInterval=this.#c),t}get pollingInterval(){return this.#c}set pollingInterval(e){if(!Number.isInteger(e)||e<0)throw new Error("invalid interval");this.#c=e,this._forEachSubscriber(e=>{ob(e)&&(e.pollingInterval=this.#c)})}}function db(e){if(null==e)return null;if("string"==typeof e.message&&e.message.match(/revert/i)&&Ne(e.data))return{message:e.message,data:e.data};if("object"==typeof e){for(const t in e){const r=db(e[t]);if(r)return r}return null}if("string"==typeof e)try{return db(JSON.parse(e))}catch(e){}return null}function fb(e,t){if(null!=e){if("string"==typeof e.message&&t.push(e.message),"object"==typeof e)for(const r in e)fb(e[r],t);if("string"==typeof e)try{return fb(JSON.parse(e),t)}catch(e){}}}class pb extends hb{#U;#pt;constructor(e,t,r){const n=Object.assign({},null!=r?r:{},{batchMaxCount:1});Ce(e&&e.request,"invalid EIP-1193 provider","ethereum",e),super(t,n),this.#pt=null,r&&r.providerInfo&&(this.#pt=r.providerInfo),this.#U=async(t,r)=>{const n={method:t,params:r};this.emit("debug",{action:"sendEip1193Request",payload:n});try{const t=await e.request(n);return this.emit("debug",{action:"receiveEip1193Result",result:t}),t}catch(e){const t=new Error(e.message);throw t.code=e.code,t.data=e.data,t.payload=n,this.emit("debug",{action:"receiveEip1193Error",error:t}),t}}}get providerInfo(){return this.#pt}async send(e,t){return await this._start(),await super.send(e,t)}async _send(e){Ce(!Array.isArray(e),"EIP-1193 does not support batch request","payload",e);try{const t=await this.#U(e.method,e.params||[]);return[{id:e.id,result:t}]}catch(t){return[{id:e.id,error:{code:t.code,data:t.data,message:t.message}}]}}getRpcError(e,t){switch((t=JSON.parse(JSON.stringify(t))).error.code||-1){case 4001:t.error.message=`ethers-user-denied: ${t.error.message}`;break;case 4200:t.error.message=`ethers-unsupported: ${t.error.message}`}return super.getRpcError(e,t)}async hasSigner(e){null==e&&(e=0);const t=await this.send("eth_accounts",[]);return"number"==typeof e?t.length>e:(e=e.toLowerCase(),0!==t.filter(t=>t.toLowerCase()===e).length)}async getSigner(e){if(null==e&&(e=0),!await this.hasSigner(e))try{await this.#U("eth_requestAccounts",[])}catch(e){const t=e.payload;throw this.getRpcError(t,{id:t.id,error:e})}return await super.getSigner(e)}static async discover(e){if(null==e&&(e={}),e.provider)return new pb(e.provider);const t=e.window?e.window:"undefined"!=typeof window?window:null;if(null==t)return null;const r=e.anyProvider;if(r&&t.ethereum)return new pb(t.ethereum);if(!("addEventListener"in t&&"dispatchEvent"in t&&"removeEventListener"in t))return null;const n=e.timeout?e.timeout:300;return 0===n?null:await new Promise((i,s)=>{let a=[];const o=e=>{a.push(e.detail),r&&c()},c=()=>{if(clearTimeout(u),a.length)if(e&&e.filter){const t=e.filter(a.map(e=>Object.assign({},e.info)));if(null==t)i(null);else if(t instanceof pb)i(t);else{let e=null;if(t.uuid){e=a.filter(e=>t.uuid===e.info.uuid)[0]}if(e){const{provider:t,info:r}=e;i(new pb(t,void 0,{providerInfo:r}))}else s(Ae("filter returned unknown info","UNSUPPORTED_OPERATION",{value:t}))}}else{const{provider:e,info:t}=a[0];i(new pb(e,void 0,{providerInfo:t}))}else i(null);t.removeEventListener("eip6963:announceProvider",o)},u=setTimeout(()=>{c()},n);t.addEventListener("eip6963:announceProvider",o),t.dispatchEvent(new Event("eip6963:requestProvider"))})}}async function gb(){return await snap.request({method:"snap_manageState",params:{operation:"get"}})}const yb=async()=>{var e;const t=await bb(),r=await gb()||{},{chainId:n,address:i}=t;return r&&(null===(e=r[n])||void 0===e?void 0:e[i])||{}},mb=async e=>{const t=await bb(),r=await gb()||{},{chainId:n,address:i}=t,s={...r,[n]:{...r[n],[i]:e}};await async function(e){await snap.request({method:"snap_manageState",params:{operation:"update",newState:e}})}(s)},bb=async()=>{const e=new pb(ethereum),t=await e.getNetwork(),r=await e.getSigner(),n=await r.getAddress();return{chainId:t.chainId.toString(),address:n}},wb=JSON.parse('[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"}]'),vb=JSON.parse('[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC20InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC20InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC20InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"}],"name":"ERC20InvalidSpender","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"ctUint64","name":"ownerValue","type":"uint256"},{"indexed":false,"internalType":"ctUint64","name":"spenderValue","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"ctUint64","name":"senderValue","type":"uint256"},{"indexed":false,"internalType":"ctUint64","name":"receiverValue","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"accountEncryptionAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bool","name":"isSpender","type":"bool"}],"name":"allowance","outputs":[{"internalType":"gtUint64","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"components":[{"internalType":"ctUint64","name":"ciphertext","type":"uint256"},{"internalType":"ctUint64","name":"ownerCiphertext","type":"uint256"},{"internalType":"ctUint64","name":"spenderCiphertext","type":"uint256"}],"internalType":"struct IPrivateERC20.Allowance","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"gtUint64","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"components":[{"internalType":"ctUint64","name":"ciphertext","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct itUint64","name":"value","type":"tuple"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"ctUint64","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"balanceOf","outputs":[{"internalType":"gtUint64","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint64","name":"amount","type":"uint64"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint64","name":"amount","type":"uint64"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bool","name":"isSpender","type":"bool"}],"name":"reencryptAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"offBoardAddress","type":"address"}],"name":"setAccountEncryptionAddress","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"components":[{"internalType":"ctUint64","name":"ciphertext","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct itUint64","name":"value","type":"tuple"}],"name":"transfer","outputs":[{"internalType":"gtBool","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"gtUint64","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"gtBool","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"components":[{"internalType":"ctUint64","name":"ciphertext","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct itUint64","name":"value","type":"tuple"}],"name":"transferFrom","outputs":[{"internalType":"gtBool","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"gtUint64","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"gtBool","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]'),Ab=JSON.parse('[{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721AlreadyMintedToken","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721IncorrectOwner","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721InsufficientApproval","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC721InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"ERC721InvalidOperator","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721InvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC721InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC721InvalidSender","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721NonexistentToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isMinted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"}]'),Eb=JSON.parse('[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721IncorrectOwner","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721InsufficientApproval","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC721InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"ERC721InvalidOperator","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721InvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC721InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC721InvalidSender","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721NonexistentToken","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721URIStorageNonMintedToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_toTokenId","type":"uint256"}],"name":"BatchMetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"MetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"components":[{"components":[{"internalType":"ctUint64[]","name":"value","type":"uint256[]"}],"internalType":"struct ctString","name":"ciphertext","type":"tuple"},{"internalType":"bytes[]","name":"signature","type":"bytes[]"}],"internalType":"struct itString","name":"itTokenURI","type":"tuple"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"components":[{"internalType":"ctUint64[]","name":"value","type":"uint256[]"}],"internalType":"struct ctString","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"}]'),Cb=["function supportsInterface(bytes4 interfaceId) external view returns (bool)"];const Bb=async()=>{const e=await yb(),t=e.tokenBalances||[],r=new pb(ethereum),n=await r.getSigner(),i=await n.getAddress(),s=await r.getBalance(i),a=await Promise.all(t.map(async t=>{if(t.type===dt.ERC20){var r;const s=new Kf(t.address,wb,n).connect(n);let a=s.balanceOf?await s.balanceOf(i):null;return t.confidential&&e.AESKey&&a?a=((e,t)=>{try{return(0,d.decryptUint)(e,t)}catch(e){return console.error(e),null}})(a,e.AESKey):t.confidential&&!e.AESKey&&(a=null),{...t,balance:(null===(r=a)||void 0===r?void 0:r.toString())||null}}if(t.type===dt.NFT){var s;const r=new Kf(t.address,Eb,n).connect(n),a=r.balanceOf?await r.balanceOf(i):null;let o=t.uri??null;return t.confidential&&t.tokenId&&e.AESKey&&(o=await(async(e,t,r)=>{try{const n=new pb(ethereum),i=new Kf(e,Eb,n),s=await i.tokenURI(BigInt(t)),a=(0,d.decryptString)(s,r);return a.startsWith("https://")?a:null}catch(e){return console.error(e),null}})(t.address,t.tokenId,e.AESKey)),{...t,balance:(null===(s=a)||void 0===s?void 0:s.toString())||null,uri:o}}return{...t,balance:null}}));return await mb({...e,balance:s.toString(),tokenBalances:a}),{balance:s,tokenBalances:a}},Sb=async(e,t,r,n,i)=>{const s=await yb(),a=s.tokenBalances,{type:o,confidential:c}=await async function(e){const t=new pb(ethereum),r=new Kf(e,Cb,t);let n=!1,i=!1;if(r.supportsInterface){try{n=await r.supportsInterface("0x80ac58cd")}catch(e){console.error(`Error checking for ERC-721 support: ${e}`)}if(!n)try{i=await r.supportsInterface("0xd9b67a26")}catch(e){console.error(`Error checking for ERC-1155 support: ${e}`)}}if(n||i)try{const r=new Kf(e,Eb,t);return await r.tokenURI(BigInt(0))?{type:dt.NFT,confidential:!0}:{type:dt.NFT,confidential:!1}}catch(e){return{type:dt.NFT,confidential:!1}}const s=new Kf(e,wb,t);try{await s.decimals(),await s.symbol(),await s.totalSupply(),await s.balanceOf(zd);try{const r=new Kf(e,vb,t);return await r.accountEncryptionAddress(e),{type:dt.ERC20,confidential:!0}}catch(e){console.error(`Error checking for ConfidentialERC20 support: ${e}`)}return{type:dt.ERC20,confidential:!1}}catch(e){console.error(`Error checking for standard ERC-20 support: ${e}`)}return{type:dt.UNKNOWN,confidential:!1}}(e);o!==dt.UNKNOWN?o!==dt.NFT||i?(a.push({address:e,name:t,symbol:r,balance:null,type:o,confidential:c,decimals:n,tokenId:i||null}),await mb({...s,tokenBalances:a})):console.error(`Token ${t} (${r}) at address ${e} is an NFT but no tokenId was provided`):console.error(`Token ${t} (${r}) at address ${e} with ${n} decimals is unknown`)},kb=async e=>{const{balance:t,tokenBalances:r,tokenView:n,AESKey:i}=await yb();await snap.request({method:"snap_updateInterface",params:{id:e,ui:l(gt,{balance:BigInt(t??0),tokenBalances:r,tokenView:n??dt.ERC20,AESKey:i})}})},Tb=async()=>{await snap.request({method:"snap_manageState",params:{operation:"clear"}})},Ib=async()=>{await ethereum.request({method:"eth_requestAccounts"});!(await yb()).balance&&await mb({balance:"0",tokenBalances:[],AESKey:null,tokenView:dt.ERC20})},Pb=async()=>{if(!await(async()=>{const e=new pb(ethereum);return"7082400"===(await e.getNetwork()).chainId.toString()})())return{content:l(Tt,{})};const{balance:e,tokenBalances:t}=await Bb(),r=await yb();return await mb({...r,tokenView:dt.ERC20}),{content:l(gt,{balance:e,tokenBalances:t,tokenView:dt.ERC20,AESKey:r.AESKey})}},Nb=async({id:e,event:t})=>{if(t.type===J.ButtonClickEvent){var r,n,i;if(null===(r=t.name)||void 0===r?void 0:r.startsWith("token-details-")){const r=t.name.slice(14),n=r.split("-")[0],i=r.split("-")[1],s=(await yb()).tokenBalances.find(e=>i?e.address===n&&e.tokenId===i:e.address===n);if(s){if(s.uri){const e=await(async e=>{try{const t=await fetch(e);if(!t.ok)throw new Error(`Failed to fetch image: ${t.statusText}`);const r=await t.json();if(!r.image)throw new Error("No image found in metadata");const n=await fetch(r.image),i=await n.blob(),s=await i.arrayBuffer(),a=It.from(s).toString("base64");return`\n <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 200 200">\n <image href="data:${i.type};base64,${a}" width="200" height="200"/>\n </svg>\n `}catch(e){return console.error(`Failed to fetch image: ${e}`),null}})(s.uri);s.image=e}await snap.request({method:"snap_updateInterface",params:{id:e,ui:l(kt,{token:s})}})}return}if(null===(n=t.name)||void 0===n?void 0:n.startsWith("confirm-hide-token-")){const r=t.name.slice(19),n=(await yb()).tokenBalances.find(e=>e.address===r);return void(n&&await snap.request({method:"snap_updateInterface",params:{id:e,ui:l(ue,{tokenAddress:n.address})}}))}if(null===(i=t.name)||void 0===i?void 0:i.startsWith("hide-token-confirmed-")){const r=t.name.slice(21);return r&&await(async e=>{const t=await yb(),r=t.tokenBalances.filter(t=>t.address!==e);await mb({...t,tokenBalances:r})})(r),await Bb(),void await kb(e)}switch(t.name){case"import-erc721":return void await snap.request({method:"snap_updateInterface",params:{id:e,ui:l(Et,{})}});case"import-erc20":return void await snap.request({method:"snap_updateInterface",params:{id:e,ui:l(At,{})}});case"view-tokens-nft":const t=await yb();return await mb({...t,tokenView:dt.NFT}),await Bb(),void await kb(e);case"view-tokens-erc20":const r=await yb();return await mb({...r,tokenView:dt.ERC20}),await Bb(),void await kb(e);case"settings-button":try{await snap.request({method:"snap_updateInterface",params:{id:e,ui:l(Ct,{})}})}catch(e){console.error(e)}return;case"token-cancel":return void await kb(e);case"erc721-submit":const n=(await snap.request({method:"snap_getInterfaceState",params:{id:e}}))["erc721-form-to-fill"];try{if(!n||!n["erc721-address"]||42!==n["erc721-address"].toString().length||!n["erc721-id"])throw new Error("Invalid form state");const t=n["erc721-address"],r=n["erc721-id"],i=await(async(e,t)=>!((await yb()).tokenBalances||[]).some(r=>r.address===e&&r.tokenId===t))(t,r);if(!i)throw new Error("Token already exists");const s=await(async e=>{try{const t=new pb(ethereum),r=new Kf(e,Ab,t),[n,i]=await Promise.all([r.symbol(),r.name()]);return{symbol:n,name:i}}catch(e){return console.error(e),null}})(t);t&&r&&s&&await Sb(t,s.name??t,s.symbol??((e,t=6)=>e.length<=2*t?e:`${e.slice(0,t)}...${e.slice(-t)}`)(t),"",r),await Bb(),await kb(e)}catch(t){console.error(t),await snap.request({method:"snap_updateInterface",params:{id:e,ui:l(Et,{errorInForm:!0})}})}return;case"token-erc20-submit":const i=(await snap.request({method:"snap_getInterfaceState",params:{id:e}}))["erc20-form-to-fill"];try{if(!(i&&i["erc20-address"]&&42===i["erc20-address"].toString().length&&i["erc20-decimals"]&&i["erc20-name"]&&i["erc20-symbol"]))throw new Error("Invalid form state");const t=i["erc20-address"],r=await(async e=>!((await yb()).tokenBalances||[]).some(t=>t.address===e))(t);if(!r)throw new Error("Token already exists");const n=i["erc20-name"],s=i["erc20-decimals"],a=i["erc20-symbol"];await Sb(t,n,a,s),await Bb(),await kb(e)}catch(t){await snap.request({method:"snap_updateInterface",params:{id:e,ui:l(At,{errorInForm:!0})}})}}}else if(t.type===J.InputChangeEvent&&"erc20-address"===t.name){const r=await(async e=>{try{const t=new pb(ethereum),r=new Kf(e,wb,t),[n,i,s]=await Promise.all([r.decimals(),r.symbol(),r.name()]);return{decimals:n.toString(),symbol:i,name:s}}catch(e){return console.error(e),null}})(t.value);r?await snap.request({method:"snap_updateInterface",params:{id:e,ui:l(At,{symbol:r.symbol,name:r.name,decimals:r.decimals})}}):console.error("Failed to fetch token details")}},xb=async({origin:e,request:t})=>{const r=await yb();switch(t.method){case"encrypt":if(!t.params)return null;const{value:e}=t.params;if(!e)return null;if(!r.AESKey)return await snap.request({method:"snap_dialog",params:{type:"alert",content:h(ie,{children:[l(se,{children:"Warning"}),l(ae,{children:"Cannot encrypt value. AES key not found."})]})}}),null;return await snap.request({method:"snap_dialog",params:{type:"confirmation",content:h(ie,{children:[l(se,{children:"Would you like to encrypt this value?"}),h(ae,{children:['Value to encrypt: "',String(e),'"']})]})}})?JSON.stringify((0,d.encrypt)((0,d.encodeKey)(r.AESKey),(0,d.encodeString)(e))):null;case"decrypt":if(!t.params)return null;const{value:n}=t.params;if(!n)return null;const{ciphertext:i,r:s}=JSON.parse(n);if(!r.AESKey)return await snap.request({method:"snap_dialog",params:{type:"alert",content:h(ie,{children:[l(se,{children:"Warning"}),l(ae,{children:"Cannot decrypt value. AES key not found."})]})}}),null;return await snap.request({method:"snap_dialog",params:{type:"confirmation",content:h(ie,{children:[l(se,{children:"Would you like to decrypt this value?"}),h(ae,{children:['Value to decrypt: "',n,'"']})]})}})?JSON.stringify((0,d.decrypt)((0,d.encodeKey)(r.AESKey),new Uint8Array([...Object.values(s)]),new Uint8Array([...Object.values(i)]))):null;case"has-aes-key":return!!r.AESKey;case"get-aes-key":if(!r.AESKey)return await snap.request({method:"snap_dialog",params:{type:"alert",content:h(ie,{children:[l(se,{children:"Warning"}),l(ae,{children:"AES key not found."})]})}}),null;if(r.AESKey){if(await snap.request({method:"snap_dialog",params:{type:"confirmation",content:h(ie,{children:[l(se,{children:"Reveal AES Key"}),l(ae,{children:"Approve to reveal AES Key"})]})}}))return r.AESKey}return null;case"delete-aes-key":if(!r.AESKey)return await snap.request({method:"snap_dialog",params:{type:"alert",content:h(ie,{children:[l(se,{children:"Warning"}),l(ae,{children:"AES key not found."})]})}}),null;return await snap.request({method:"snap_dialog",params:{type:"confirmation",content:h(ie,{children:[l(se,{children:"Delete AES Key"}),l(ae,{children:"Approve to delete the AES Key"})]})}})?(await mb({...r,AESKey:null}),!0):null;case"set-aes-key":const{newUserAesKey:a}=t.params;return a?r.AESKey?null:(await mb({...r,AESKey:a}),!0):(await snap.request({method:"snap_dialog",params:{type:"alert",content:h(ie,{children:[l(se,{children:"Error"}),l(ae,{children:"New AES key not provided."})]})}}),null);case"connect-to-wallet":return await ethereum.request({method:"eth_requestAccounts"}),!0;case"get-permissions":return await ethereum.request({method:"wallet_getPermissions",params:[]})??[];default:throw new Error("Method not found.")}}})(),module.exports=n})();
|