"use strict";(self.webpackChunkfrog=self.webpackChunkfrog||[]).push([[7334],{7040:(t,e,n)=>{n.d(e,{t:()=>u});var r=n(95640),s=n(27033),i=n(36212),a=n(65735),o=n(30031);function u(t){const e=(0,o.b)(t.from);let n=(0,s.Ab)(t.nonce,"tx.nonce").toString(16);return n="0"===n?"0x":n.length%2?"0x0"+n:"0x"+n,(0,o.b)((0,i.ZG)((0,r.S)((0,a.R)([e,n])),12))}},19353:(t,e,n)=>{n.d(e,{V:()=>c});var r=n(57339),s=n(88081);const i={};function a(t,e){let n=!1;return e<0&&(n=!0,e*=-1),new c(i,`${n?"":"u"}int${e}`,t,{signed:n,width:e})}function o(t,e){return new c(i,`bytes${e||""}`,t,{size:e})}const u=Symbol.for("_ethers_typed");class c{type;value;#t;_typedSymbol;constructor(t,e,n,a){null==a&&(a=null),(0,r.gk)(i,t,"Typed"),(0,s.n)(this,{_typedSymbol:u,type:e,value:n}),this.#t=a,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((t=>t.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.#t}get arrayLength(){if("array"!==this.type)throw TypeError("not an array");return!0===this.#t?-1:!1===this.#t?this.value.length:null}static from(t,e){return new c(i,t,e)}static uint8(t){return a(t,8)}static uint16(t){return a(t,16)}static uint24(t){return a(t,24)}static uint32(t){return a(t,32)}static uint40(t){return a(t,40)}static uint48(t){return a(t,48)}static uint56(t){return a(t,56)}static uint64(t){return a(t,64)}static uint72(t){return a(t,72)}static uint80(t){return a(t,80)}static uint88(t){return a(t,88)}static uint96(t){return a(t,96)}static uint104(t){return a(t,104)}static uint112(t){return a(t,112)}static uint120(t){return a(t,120)}static uint128(t){return a(t,128)}static uint136(t){return a(t,136)}static uint144(t){return a(t,144)}static uint152(t){return a(t,152)}static uint160(t){return a(t,160)}static uint168(t){return a(t,168)}static uint176(t){return a(t,176)}static uint184(t){return a(t,184)}static uint192(t){return a(t,192)}static uint200(t){return a(t,200)}static uint208(t){return a(t,208)}static uint216(t){return a(t,216)}static uint224(t){return a(t,224)}static uint232(t){return a(t,232)}static uint240(t){return a(t,240)}static uint248(t){return a(t,248)}static uint256(t){return a(t,256)}static uint(t){return a(t,256)}static int8(t){return a(t,-8)}static int16(t){return a(t,-16)}static int24(t){return a(t,-24)}static int32(t){return a(t,-32)}static int40(t){return a(t,-40)}static int48(t){return a(t,-48)}static int56(t){return a(t,-56)}static int64(t){return a(t,-64)}static int72(t){return a(t,-72)}static int80(t){return a(t,-80)}static int88(t){return a(t,-88)}static int96(t){return a(t,-96)}static int104(t){return a(t,-104)}static int112(t){return a(t,-112)}static int120(t){return a(t,-120)}static int128(t){return a(t,-128)}static int136(t){return a(t,-136)}static int144(t){return a(t,-144)}static int152(t){return a(t,-152)}static int160(t){return a(t,-160)}static int168(t){return a(t,-168)}static int176(t){return a(t,-176)}static int184(t){return a(t,-184)}static int192(t){return a(t,-192)}static int200(t){return a(t,-200)}static int208(t){return a(t,-208)}static int216(t){return a(t,-216)}static int224(t){return a(t,-224)}static int232(t){return a(t,-232)}static int240(t){return a(t,-240)}static int248(t){return a(t,-248)}static int256(t){return a(t,-256)}static int(t){return a(t,-256)}static bytes1(t){return o(t,1)}static bytes2(t){return o(t,2)}static bytes3(t){return o(t,3)}static bytes4(t){return o(t,4)}static bytes5(t){return o(t,5)}static bytes6(t){return o(t,6)}static bytes7(t){return o(t,7)}static bytes8(t){return o(t,8)}static bytes9(t){return o(t,9)}static bytes10(t){return o(t,10)}static bytes11(t){return o(t,11)}static bytes12(t){return o(t,12)}static bytes13(t){return o(t,13)}static bytes14(t){return o(t,14)}static bytes15(t){return o(t,15)}static bytes16(t){return o(t,16)}static bytes17(t){return o(t,17)}static bytes18(t){return o(t,18)}static bytes19(t){return o(t,19)}static bytes20(t){return o(t,20)}static bytes21(t){return o(t,21)}static bytes22(t){return o(t,22)}static bytes23(t){return o(t,23)}static bytes24(t){return o(t,24)}static bytes25(t){return o(t,25)}static bytes26(t){return o(t,26)}static bytes27(t){return o(t,27)}static bytes28(t){return o(t,28)}static bytes29(t){return o(t,29)}static bytes30(t){return o(t,30)}static bytes31(t){return o(t,31)}static bytes32(t){return o(t,32)}static address(t){return new c(i,"address",t)}static bool(t){return new c(i,"bool",!!t)}static bytes(t){return new c(i,"bytes",t)}static string(t){return new c(i,"string",t)}static array(t,e){throw new Error("not implemented yet")}static tuple(t,e){throw new Error("not implemented yet")}static overrides(t){return new c(i,"overrides",Object.assign({},t))}static isTyped(t){return t&&"object"==typeof t&&"_typedSymbol"in t&&t._typedSymbol===u}static dereference(t,e){if(c.isTyped(t)){if(t.type!==e)throw new Error(`invalid type: expecetd ${e}, got ${t.type}`);return t.value}return t}}},21228:(t,e,n)=>{n.d(e,{AU:()=>w,Q7:()=>y,Ue:()=>b,Yx:()=>o,mP:()=>v});var r=n(27033),s=n(57339),i=n(36212),a=n(88081);const o=32,u=new Uint8Array(o),c=["then"],l={},h=new WeakMap;function f(t){return h.get(t)}function p(t,e){h.set(t,e)}function d(t,e){const n=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw n.error=e,n}function g(t,e,n){return t.indexOf(null)>=0?e.map(((t,e)=>t instanceof y?g(f(t),t,n):t)):t.reduce(((t,r,s)=>{let i=e.getValue(r);return r in t||(n&&i instanceof y&&(i=g(f(i),i,n)),t[r]=i),t}),{})}class y extends Array{#e;constructor(...t){const e=t[0];let n=t[1],s=(t[2]||[]).slice(),i=!0;e!==l&&(n=t,s=[],i=!1),super(n.length),n.forEach(((t,e)=>{this[e]=t}));const a=s.reduce(((t,e)=>("string"==typeof e&&t.set(e,(t.get(e)||0)+1),t)),new Map);if(p(this,Object.freeze(n.map(((t,e)=>{const n=s[e];return null!=n&&1===a.get(n)?n:null})))),this.#e=[],null==this.#e&&this.#e,!i)return;Object.freeze(this);const o=new Proxy(this,{get:(t,e,n)=>{if("string"==typeof e){if(e.match(/^[0-9]+$/)){const n=(0,r.WZ)(e,"%index");if(n<0||n>=this.length)throw new RangeError("out of result range");const s=t[n];return s instanceof Error&&d(`index ${n}`,s),s}if(c.indexOf(e)>=0)return Reflect.get(t,e,n);const s=t[e];if(s instanceof Function)return function(...e){return s.apply(this===n?t:this,e)};if(!(e in t))return t.getValue.apply(this===n?t:this,[e])}return Reflect.get(t,e,n)}});return p(o,f(this)),o}toArray(t){const e=[];return this.forEach(((n,r)=>{n instanceof Error&&d(`index ${r}`,n),t&&n instanceof y&&(n=n.toArray(t)),e.push(n)})),e}toObject(t){const e=f(this);return e.reduce(((n,r,i)=>((0,s.vA)(null!=r,`value at index ${i} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),g(e,this,t))),{})}slice(t,e){null==t&&(t=0),t<0&&(t+=this.length)<0&&(t=0),null==e&&(e=this.length),e<0&&(e+=this.length)<0&&(e=0),e>this.length&&(e=this.length);const n=f(this),r=[],s=[];for(let i=t;i{this.#n[t]=m(e)}}}class v{allowLoose;#n;#i;#a;#o;#u;constructor(t,e,n){(0,a.n)(this,{allowLoose:!!e}),this.#n=(0,i.Lm)(t),this.#a=0,this.#o=null,this.#u=null!=n?n:1024,this.#i=0}get data(){return(0,i.c$)(this.#n)}get dataLength(){return this.#n.length}get consumed(){return this.#i}get bytes(){return new Uint8Array(this.#n)}#c(t){if(this.#o)return this.#o.#c(t);this.#a+=t,(0,s.vA)(this.#u<1||this.#a<=this.#u*this.dataLength,`compressed ABI data exceeds inflation ratio of ${this.#u} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:(0,i.Lm)(this.#n),offset:this.#i,length:t,info:{bytesRead:this.#a,dataLength:this.dataLength}})}#l(t,e,n){let r=Math.ceil(e/o)*o;return this.#i+r>this.#n.length&&(this.allowLoose&&n&&this.#i+e<=this.#n.length?r=e:(0,s.vA)(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:(0,i.Lm)(this.#n),length:this.#n.length,offset:this.#i+r})),this.#n.slice(this.#i,this.#i+r)}subReader(t){const e=new v(this.#n.slice(this.#i+t),this.allowLoose,this.#u);return e.#o=this,e}readBytes(t,e){let n=this.#l(0,t,!!e);return this.#c(t),this.#i+=n.length,n.slice(0,t)}readValue(){return(0,r.Dg)(this.readBytes(o))}readIndex(){return(0,r.Ro)(this.readBytes(o))}}},30031:(t,e,n)=>{n.d(e,{b:()=>p});var r=n(95640),s=n(36212),i=n(57339);const a=BigInt(0),o=BigInt(36);function u(t){const e=(t=t.toLowerCase()).substring(2).split(""),n=new Uint8Array(40);for(let t=0;t<40;t++)n[t]=e[t].charCodeAt(0);const i=(0,s.q5)((0,r.S)(n));for(let t=0;t<40;t+=2)i[t>>1]>>4>=8&&(e[t]=e[t].toUpperCase()),(15&i[t>>1])>=8&&(e[t+1]=e[t+1].toUpperCase());return"0x"+e.join("")}const c={};for(let t=0;t<10;t++)c[String(t)]=String(t);for(let t=0;t<26;t++)c[String.fromCharCode(65+t)]=String(10+t);const l=15;function h(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map((t=>c[t])).join("");for(;e.length>=l;){let t=e.substring(0,l);e=parseInt(t,10)%97+e.substring(t.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}const f=function(){const t={};for(let e=0;e<36;e++){t["0123456789abcdefghijklmnopqrstuvwxyz"[e]]=BigInt(e)}return t}();function p(t){if((0,i.MR)("string"==typeof t,"invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/)){t.startsWith("0x")||(t="0x"+t);const e=u(t);return(0,i.MR)(!t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===t,"bad address checksum","address",t),e}if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){(0,i.MR)(t.substring(2,4)===h(t),"bad icap checksum","address",t);let e=function(t){t=t.toLowerCase();let e=a;for(let n=0;n{n.d(e,{y:()=>j});var r=n(57339),s=n(21228),i=n(30031),a=n(27033),o=n(19353);class u extends s.Ue{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,e){let n=o.V.dereference(e,"string");try{n=(0,i.b)(n)}catch(t){return this._throwError(t.message,e)}return t.writeValue(n)}decode(t){return(0,i.b)((0,a.up)(t.readValue(),20))}}var c=n(88081);class l extends s.Ue{coder;constructor(t){super(t.name,t.type,"_",t.dynamic),this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,e){return this.coder.encode(t,e)}decode(t){return this.coder.decode(t)}}function h(t,e,n){let i=[];if(Array.isArray(n))i=n;else if(n&&"object"==typeof n){let t={};i=e.map((e=>{const s=e.localName;return(0,r.vA)(s,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:e},value:n}),(0,r.vA)(!t[s],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:e},value:n}),t[s]=!0,n[s]}))}else(0,r.MR)(!1,"invalid tuple value","tuple",n);(0,r.MR)(e.length===i.length,"types/value length mismatch","tuple",n);let a=new s.AU,o=new s.AU,u=[];e.forEach(((t,e)=>{let n=i[e];if(t.dynamic){let e=o.length;t.encode(o,n);let r=a.writeUpdatableValue();u.push((t=>{r(t+e)}))}else t.encode(a,n)})),u.forEach((t=>{t(a.length)}));let c=t.appendWriter(a);return c+=t.appendWriter(o),c}function f(t,e){let n=[],i=[],a=t.subReader(0);return e.forEach((e=>{let s=null;if(e.dynamic){let n=t.readIndex(),i=a.subReader(n);try{s=e.decode(i)}catch(t){if((0,r.bJ)(t,"BUFFER_OVERRUN"))throw t;s=t,s.baseType=e.name,s.name=e.localName,s.type=e.type}}else try{s=e.decode(t)}catch(t){if((0,r.bJ)(t,"BUFFER_OVERRUN"))throw t;s=t,s.baseType=e.name,s.name=e.localName,s.type=e.type}if(null==s)throw new Error("investigate");n.push(s),i.push(e.localName||null)})),s.Q7.fromItems(n,i)}class p extends s.Ue{coder;length;constructor(t,e,n){super("array",t.type+"["+(e>=0?e:"")+"]",n,-1===e||t.dynamic),(0,c.n)(this,{coder:t,length:e})}defaultValue(){const t=this.coder.defaultValue(),e=[];for(let n=0;nt||n<-(t+x))&&this._throwError("value out-of-bounds",e),n=(0,a.JJ)(n,8*s.Yx)}else(n(0,a.dK)(r,8*this.size))&&this._throwError("value out-of-bounds",e);return t.writeValue(n)}decode(t){let e=(0,a.dK)(t.readValue(),8*this.size);return this.signed&&(e=(0,a.ST)(e,8*this.size)),e}}var A=n(87303);class O extends y{constructor(t){super("string",t)}defaultValue(){return""}encode(t,e){return super.encode(t,(0,A.YW)(o.V.dereference(e,"string")))}decode(t){return(0,A._v)(super.decode(t))}}class N extends s.Ue{coders;constructor(t,e){let n=!1;const r=[];t.forEach((t=>{t.dynamic&&(n=!0),r.push(t.type)}));super("tuple","tuple("+r.join(",")+")",e,n),(0,c.n)(this,{coders:Object.freeze(t.slice())})}defaultValue(){const t=[];this.coders.forEach((e=>{t.push(e.defaultValue())}));const e=this.coders.reduce(((t,e)=>{const n=e.localName;return n&&(t[n]||(t[n]=0),t[n]++),t}),{});return this.coders.forEach(((n,r)=>{let s=n.localName;s&&1===e[s]&&("length"===s&&(s="_length"),null==t[s]&&(t[s]=t[r]))})),Object.freeze(t)}encode(t,e){const n=o.V.dereference(e,"tuple");return h(t,this.coders,n)}decode(t){return f(t,this.coders)}}var M=n(76124);const T=new Map;T.set(0,"GENERIC_PANIC"),T.set(1,"ASSERT_FALSE"),T.set(17,"OVERFLOW"),T.set(18,"DIVIDE_BY_ZERO"),T.set(33,"ENUM_RANGE_ERROR"),T.set(34,"BAD_STORAGE_DATA"),T.set(49,"STACK_UNDERFLOW"),T.set(50,"ARRAY_RANGE_ERROR"),T.set(65,"OUT_OF_MEMORY"),T.set(81,"UNINITIALIZED_FUNCTION_CALL");const $=new RegExp(/^bytes([0-9]*)$/),_=new RegExp(/^(u?int)([0-9]*)$/);let S=null,C=1024;class j{#h(t){if(t.isArray())return new p(this.#h(t.arrayChildren),t.arrayLength,t.name);if(t.isTuple())return new N(t.components.map((t=>this.#h(t))),t.name);switch(t.baseType){case"address":return new u(t.name);case"bool":return new d(t.name);case"string":return new O(t.name);case"bytes":return new m(t.name);case"":return new v(t.name)}let e=t.type.match(_);if(e){let n=parseInt(e[2]||"256");return(0,r.MR)(0!==n&&n<=256&&n%8==0,"invalid "+e[1]+" bit length","param",t),new k(n/8,"int"===e[1],t.name)}if(e=t.type.match($),e){let n=parseInt(e[1]);return(0,r.MR)(0!==n&&n<=32,"invalid bytes length","param",t),new b(n,t.name)}(0,r.MR)(!1,"invalid type","type",t.type)}getDefaultValue(t){const e=t.map((t=>this.#h(M.aX.from(t))));return new N(e,"_").defaultValue()}encode(t,e){(0,r.dd)(e.length,t.length,"types/values length mismatch");const n=t.map((t=>this.#h(M.aX.from(t)))),i=new N(n,"_"),a=new s.AU;return i.encode(a,e),a.data}decode(t,e,n){const r=t.map((t=>this.#h(M.aX.from(t))));return new N(r,"_").decode(new s.mP(e,n,C))}static _setDefaultMaxInflation(t){(0,r.MR)("number"==typeof t&&Number.isInteger(t),"invalid defaultMaxInflation factor","value",t),C=t}static defaultAbiCoder(){return null==S&&(S=new j),S}static getBuiltinCallException(t,e,n){return function(t,e,n,s){let a="missing revert data",o=null,u=null;if(n){a="execution reverted";const t=(0,g.q5)(n);if(n=(0,g.c$)(n),0===t.length)a+=" (no data present; likely require(false) occurred",o="require(false)";else if(t.length%32!=4)a+=" (could not decode reason; invalid data length)";else if("0x08c379a0"===(0,g.c$)(t.slice(0,4)))try{o=s.decode(["string"],t.slice(4))[0],u={signature:"Error(string)",name:"Error",args:[o]},a+=`: ${JSON.stringify(o)}`}catch(t){a+=" (could not decode reason; invalid string data)"}else if("0x4e487b71"===(0,g.c$)(t.slice(0,4)))try{const e=Number(s.decode(["uint256"],t.slice(4))[0]);u={signature:"Panic(uint256)",name:"Panic",args:[e]},o=`Panic due to ${T.get(e)||"UNKNOWN"}(${e})`,a+=`: ${o}`}catch(t){a+=" (could not decode panic code)"}else a+=" (unknown custom error)"}const c={to:e.to?(0,i.b)(e.to):null,data:e.data||"0x"};return e.from&&(c.from=(0,i.b)(e.from)),(0,r.xz)(a,"CALL_EXCEPTION",{action:t,data:n,reason:o,transaction:c,invocation:null,revert:u})}(t,e,n,j.defaultAbiCoder())}}},41442:(t,e,n)=>{n.d(e,{$C:()=>i,tG:()=>o});var r=n(57339),s=n(30031);function i(t){return t&&"function"==typeof t.getAddress}async function a(t,e){const n=await e;return null!=n&&"0x0000000000000000000000000000000000000000"!==n||((0,r.vA)("string"!=typeof t,"unconfigured name","UNCONFIGURED_NAME",{value:t}),(0,r.MR)(!1,"invalid AddressLike value; did not resolve to a value address","target",t)),(0,s.b)(n)}function o(t,e){return"string"==typeof t?t.match(/^0x[0-9a-f]{40}$/i)?(0,s.b)(t):((0,r.vA)(null!=e,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),a(t,e.resolveName(t))):i(t)?a(t,t.getAddress()):t&&"function"==typeof t.then?a(t,t):void(0,r.MR)(!1,"unsupported addressable value","target",t)}},69049:t=>{t.exports=function(t){for(var e=[],n=t.length,r=0;r=55296&&s<=56319&&n>r+1){var i=t.charCodeAt(r+1);i>=56320&&i<=57343&&(s=1024*(s-55296)+i-56320+65536,r+=1)}s<128?e.push(s):s<2048?(e.push(s>>6|192),e.push(63&s|128)):s<55296||s>=57344&&s<65536?(e.push(s>>12|224),e.push(s>>6&63|128),e.push(63&s|128)):s>=65536&&s<=1114111?(e.push(s>>18|240),e.push(s>>12&63|128),e.push(s>>6&63|128),e.push(63&s|128)):e.push(239,191,189)}return new Uint8Array(e).buffer}},73622:(t,e,n)=>{n.d(e,{KA:()=>w});var r=n(95640),s=n(38264),i=n(88081),a=n(57339),o=n(36212),u=n(27033),c=n(35273),l=n(21228),h=n(76124),f=n(19353);class p{fragment;name;signature;topic;args;constructor(t,e,n){const r=t.name,s=t.format();(0,i.n)(this,{fragment:t,name:r,signature:s,topic:e,args:n})}}class d{fragment;name;args;signature;selector;value;constructor(t,e,n,r){const s=t.name,a=t.format();(0,i.n)(this,{fragment:t,name:s,args:n,signature:a,selector:e,value:r})}}class g{fragment;name;args;signature;selector;constructor(t,e,n){const r=t.name,s=t.format();(0,i.n)(this,{fragment:t,name:r,args:n,signature:s,selector:e})}}class y{hash;_isIndexed;static isIndexed(t){return!(!t||!t._isIndexed)}constructor(t){(0,i.n)(this,{hash:t,_isIndexed:!0})}}const m={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},b={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:t=>`reverted with reason string ${JSON.stringify(t)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:t=>{let e="unknown panic code";return t>=0&&t<=255&&m[t.toString()]&&(e=m[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};class w{fragments;deploy;fallback;receive;#f;#p;#d;#g;constructor(t){let e=[];e="string"==typeof t?JSON.parse(t):t,this.#d=new Map,this.#f=new Map,this.#p=new Map;const n=[];for(const t of e)try{n.push(h.FK.from(t))}catch(t){}(0,i.n)(this,{fragments:Object.freeze(n)});let r=null,s=!1;this.#g=this.getAbiCoder(),this.fragments.forEach(((t,e)=>{let n;switch(t.type){case"constructor":if(this.deploy)return;return void(0,i.n)(this,{deploy:t});case"fallback":return void(0===t.inputs.length?s=!0:((0,a.MR)(!r||t.payable!==r.payable,"conflicting fallback fragments",`fragments[${e}]`,t),r=t,s=r.payable));case"function":n=this.#d;break;case"event":n=this.#p;break;case"error":n=this.#f;break;default:return}const o=t.format();n.has(o)||n.set(o,t)})),this.deploy||(0,i.n)(this,{deploy:h.Pw.from("constructor()")}),(0,i.n)(this,{fallback:r,receive:s})}format(t){const e=t?"minimal":"full";return this.fragments.map((t=>t.format(e)))}formatJson(){const t=this.fragments.map((t=>t.format("json")));return JSON.stringify(t.map((t=>JSON.parse(t))))}getAbiCoder(){return c.y.defaultAbiCoder()}#y(t,e,n){if((0,o.Lo)(t)){const e=t.toLowerCase();for(const t of this.#d.values())if(e===t.selector)return t;return null}if(-1===t.indexOf("(")){const r=[];for(const[e,n]of this.#d)e.split("(")[0]===t&&r.push(n);if(e){const t=e.length>0?e[e.length-1]:null;let n=e.length,s=!0;f.V.isTyped(t)&&"overrides"===t.type&&(s=!1,n--);for(let t=r.length-1;t>=0;t--){const e=r[t].inputs.length;e===n||s&&e===n-1||r.splice(t,1)}for(let t=r.length-1;t>=0;t--){const n=r[t].inputs;for(let s=0;s=n.length){if("overrides"===e[s].type)continue;r.splice(t,1);break}if(e[s].type!==n[s].baseType){r.splice(t,1);break}}}}if(1===r.length&&e&&e.length!==r[0].inputs.length){const t=e[e.length-1];(null==t||Array.isArray(t)||"object"!=typeof t)&&r.splice(0,1)}if(0===r.length)return null;if(r.length>1&&n){const e=r.map((t=>JSON.stringify(t.format()))).join(", ");(0,a.MR)(!1,`ambiguous function description (i.e. matches ${e})`,"key",t)}return r[0]}const r=this.#d.get(h.hc.from(t).format());return r||null}getFunctionName(t){const e=this.#y(t,null,!1);return(0,a.MR)(e,"no matching function","key",t),e.name}hasFunction(t){return!!this.#y(t,null,!1)}getFunction(t,e){return this.#y(t,e||null,!0)}forEachFunction(t){const e=Array.from(this.#d.keys());e.sort(((t,e)=>t.localeCompare(e)));for(let n=0;n=0;t--)r[t].inputs.length=0;t--){const n=r[t].inputs;for(let s=0;s1&&n){const e=r.map((t=>JSON.stringify(t.format()))).join(", ");(0,a.MR)(!1,`ambiguous event description (i.e. matches ${e})`,"key",t)}return r[0]}const r=this.#p.get(h.Zp.from(t).format());return r||null}getEventName(t){const e=this.#m(t,null,!1);return(0,a.MR)(e,"no matching event","key",t),e.name}hasEvent(t){return!!this.#m(t,null,!1)}getEvent(t,e){return this.#m(t,e||null,!0)}forEachEvent(t){const e=Array.from(this.#p.keys());e.sort(((t,e)=>t.localeCompare(e)));for(let n=0;n1){const n=e.map((t=>JSON.stringify(t.format()))).join(", ");(0,a.MR)(!1,`ambiguous error description (i.e. ${n})`,"name",t)}return e[0]}if("Error(string)"===(t=h.bp.from(t).format()))return h.bp.from("error Error(string)");if("Panic(uint256)"===t)return h.bp.from("error Panic(uint256)");const n=this.#f.get(t);return n||null}forEachError(t){const e=Array.from(this.#f.keys());e.sort(((t,e)=>t.localeCompare(e)));for(let n=0;n"string"===t.type?(0,s.id)(e):"bytes"===t.type?(0,r.S)((0,o.c$)(e)):("bool"===t.type&&"boolean"==typeof e?e=e?"0x01":"0x00":t.type.match(/^u?int/)?e=(0,u.up)(e):t.type.match(/^bytes/)?e=(0,o.X_)(e,32):"address"===t.type&&this.#g.encode(["address"],[e]),(0,o.nx)((0,o.c$)(e),32));for(e.forEach(((e,r)=>{const s=t.inputs[r];s.indexed?null==e?n.push(null):"array"===s.baseType||"tuple"===s.baseType?(0,a.MR)(!1,"filtering with tuples or arrays not supported","contract."+s.name,e):Array.isArray(e)?n.push(e.map((t=>i(s,t)))):n.push(i(s,e)):(0,a.MR)(null==e,"cannot filter non-indexed parameters; must be null","contract."+s.name,e)}));n.length&&null===n[n.length-1];)n.pop();return n}encodeEventLog(t,e){if("string"==typeof t){const e=this.getEvent(t);(0,a.MR)(e,"unknown event","eventFragment",t),t=e}const n=[],i=[],o=[];return t.anonymous||n.push(t.topicHash),(0,a.MR)(e.length===t.inputs.length,"event arguments/values mismatch","values",e),t.inputs.forEach(((t,a)=>{const u=e[a];if(t.indexed)if("string"===t.type)n.push((0,s.id)(u));else if("bytes"===t.type)n.push((0,r.S)(u));else{if("tuple"===t.baseType||"array"===t.baseType)throw new Error("not implemented");n.push(this.#g.encode([t.type],[u]))}else i.push(t),o.push(u)})),{data:this.#g.encode(i,o),topics:n}}decodeEventLog(t,e,n){if("string"==typeof t){const e=this.getEvent(t);(0,a.MR)(e,"unknown event","eventFragment",t),t=e}if(null!=n&&!t.anonymous){const e=t.topicHash;(0,a.MR)((0,o.Lo)(n[0],32)&&n[0].toLowerCase()===e,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}const r=[],s=[],i=[];t.inputs.forEach(((t,e)=>{t.indexed?"string"===t.type||"bytes"===t.type||"tuple"===t.baseType||"array"===t.baseType?(r.push(h.aX.from({type:"bytes32",name:t.name})),i.push(!0)):(r.push(t),i.push(!1)):(s.push(t),i.push(!1))}));const u=null!=n?this.#g.decode(r,(0,o.xW)(n)):null,c=this.#g.decode(s,e,!0),f=[],p=[];let d=0,g=0;return t.inputs.forEach(((t,e)=>{let n=null;if(t.indexed)if(null==u)n=new y(null);else if(i[e])n=new y(u[g++]);else try{n=u[g++]}catch(t){n=t}else try{n=c[d++]}catch(t){n=t}f.push(n),p.push(t.name||null)})),l.Q7.fromItems(f,p)}parseTransaction(t){const e=(0,o.q5)(t.data,"tx.data"),n=(0,u.Ab)(null!=t.value?t.value:0,"tx.value"),r=this.getFunction((0,o.c$)(e.slice(0,4)));if(!r)return null;const s=this.#g.decode(r.inputs,e.slice(4));return new d(r,r.selector,s,n)}parseCallResult(t){throw new Error("@TODO")}parseLog(t){const e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new p(e,e.topicHash,this.decodeEventLog(e,t.data,t.topics))}parseError(t){const e=(0,o.c$)(t),n=this.getError((0,o.ZG)(e,0,4));if(!n)return null;const r=this.#g.decode(n.inputs,(0,o.ZG)(e,4));return new g(n,n.selector,r)}static from(t){return t instanceof w?t:"string"==typeof t?new w(JSON.parse(t)):"function"==typeof t.formatJson?new w(t.formatJson()):"function"==typeof t.format?new w(t.format("json")):new w(t)}}},76124:(t,e,n)=>{n.d(e,{FK:()=>D,Pw:()=>G,Zp:()=>Z,aX:()=>z,bp:()=>W,hc:()=>X});var r=n(27033),s=n(57339),i=n(88081),a=n(38264);function o(t){const e=new Set;return t.forEach((t=>e.add(t))),Object.freeze(e)}const u=o("external public payable override".split(" ")),c="constant external internal payable private public pure view override",l=o(c.split(" ")),h="constructor error event fallback function receive struct",f=o(h.split(" ")),p="calldata memory storage payable indexed",d=o(p.split(" ")),g=o([h,p,"tuple returns",c].join(" ").split(" ")),y={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},m=new RegExp("^(\\s*)"),b=new RegExp("^([0-9]+)"),w=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),v=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),E=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");class x{#i;#b;get offset(){return this.#i}get length(){return this.#b.length-this.#i}constructor(t){this.#i=0,this.#b=t.slice()}clone(){return new x(this.#b)}reset(){this.#i=0}#w(t=0,e=0){return new x(this.#b.slice(t,e).map((e=>Object.freeze(Object.assign({},e,{match:e.match-t,linkBack:e.linkBack-t,linkNext:e.linkNext-t})))))}popKeyword(t){const e=this.peek();if("KEYWORD"!==e.type||!t.has(e.text))throw new Error(`expected keyword ${e.text}`);return this.pop().text}popType(t){if(this.peek().type!==t){const e=this.peek();throw new Error(`expected ${t}; got ${e.type} ${JSON.stringify(e.text)}`)}return this.pop().text}popParen(){const t=this.peek();if("OPEN_PAREN"!==t.type)throw new Error("bad start");const e=this.#w(this.#i+1,t.match+1);return this.#i=t.match+1,e}popParams(){const t=this.peek();if("OPEN_PAREN"!==t.type)throw new Error("bad start");const e=[];for(;this.#i=this.#b.length)throw new Error("out-of-bounds");return this.#b[this.#i]}peekKeyword(t){const e=this.peekType("KEYWORD");return null!=e&&t.has(e)?e:null}peekType(t){if(0===this.length)return null;const e=this.peek();return e.type===t?e.text:null}pop(){const t=this.peek();return this.#i++,t}toString(){const t=[];for(let e=this.#i;e`}}function R(t){const e=[],n=e=>{const n=a0&&"NUMBER"===e[e.length-1].type){const n=e.pop().text;t=n+t,e[e.length-1].value=(0,r.WZ)(n)}if(0===e.length||"BRACKET"!==e[e.length-1].type)throw new Error("missing opening bracket");e[e.length-1].text+=t}}else if(u=o.match(w),u){if(c.text=u[1],a+=c.text.length,g.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(E)){c.type="TYPE";continue}c.type="ID"}else{if(u=o.match(b),!u)throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${a}`);c.text=u[1],c.type="NUMBER",a+=c.text.length}}return new x(e.map((t=>Object.freeze(t))))}function k(t,e){let n=[];for(const r in e.keys())t.has(r)&&n.push(r);if(n.length>1)throw new Error(`conflicting types: ${n.join(", ")}`)}function A(t,e){if(e.peekKeyword(f)){const n=e.pop().text;if(n!==t)throw new Error(`expected ${t}, got ${n}`)}return e.popType("ID")}function O(t,e){const n=new Set;for(;;){const r=t.peekType("KEYWORD");if(null==r||e&&!e.has(r))break;if(t.pop(),n.has(r))throw new Error(`duplicate keywords: ${JSON.stringify(r)}`);n.add(r)}return Object.freeze(n)}function N(t){let e=O(t,l);return k(e,o("constant payable nonpayable".split(" "))),k(e,o("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function M(t,e){return t.popParams().map((t=>z.from(t,e)))}function T(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return(0,r.Ab)(t.pop().text);throw new Error("invalid gas")}return null}function $(t){if(t.length)throw new Error(`unexpected tokens at offset ${t.offset}: ${t.toString()}`)}const _=new RegExp(/^(.*)\[([0-9]*)\]$/);function S(t){const e=t.match(E);if((0,s.MR)(e,"invalid type","type",t),"uint"===t)return"uint256";if("int"===t)return"int256";if(e[2]){const n=parseInt(e[2]);(0,s.MR)(0!==n&&n<=32,"invalid bytes length","type",t)}else if(e[3]){const n=parseInt(e[3]);(0,s.MR)(0!==n&&n<=256&&n%8==0,"invalid numeric width","type",t)}return t}const C={},j=Symbol.for("_ethers_internal"),P="_ParamTypeInternal",I="_ErrorInternal",F="_EventInternal",L="_ConstructorInternal",U="_FallbackInternal",V="_FunctionInternal",B="_StructInternal";class z{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(t,e,n,r,a,o,u,c){if((0,s.gk)(t,C,"ParamType"),Object.defineProperty(this,j,{value:P}),o&&(o=Object.freeze(o.slice())),"array"===r){if(null==u||null==c)throw new Error("")}else if(null!=u||null!=c)throw new Error("");if("tuple"===r){if(null==o)throw new Error("")}else if(null!=o)throw new Error("");(0,i.n)(this,{name:e,type:n,baseType:r,indexed:a,components:o,arrayLength:u,arrayChildren:c})}format(t){if(null==t&&(t="sighash"),"json"===t){const e=this.name||"";if(this.isArray()){const t=JSON.parse(this.arrayChildren.format("json"));return t.name=e,t.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(t)}const n={type:"tuple"===this.baseType?"tuple":this.type,name:e};return"boolean"==typeof this.indexed&&(n.indexed=this.indexed),this.isTuple()&&(n.components=this.components.map((e=>JSON.parse(e.format(t))))),JSON.stringify(n)}let e="";return this.isArray()?(e+=this.arrayChildren.format(t),e+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?e+="("+this.components.map((e=>e.format(t))).join("full"===t?", ":",")+")":e+=this.type,"sighash"!==t&&(!0===this.indexed&&(e+=" indexed"),"full"===t&&this.name&&(e+=" "+this.name)),e}isArray(){return"array"===this.baseType}isTuple(){return"tuple"===this.baseType}isIndexable(){return null!=this.indexed}walk(t,e){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 n=this;return t.map((t=>n.arrayChildren.walk(t,e)))}if(this.isTuple()){if(!Array.isArray(t))throw new Error("invalid tuple value");if(t.length!==this.components.length)throw new Error("array is wrong length");const n=this;return t.map(((t,r)=>n.components[r].walk(t,e)))}return e(this.type,t)}#v(t,e,n,r){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 s=this.arrayChildren,i=e.slice();return i.forEach(((e,r)=>{s.#v(t,e,n,(t=>{i[r]=t}))})),void r(i)}if(this.isTuple()){const s=this.components;let i;if(Array.isArray(e))i=e.slice();else{if(null==e||"object"!=typeof e)throw new Error("invalid tuple value");i=s.map((t=>{if(!t.name)throw new Error("cannot use object value with unnamed components");if(!(t.name in e))throw new Error(`missing value for component ${t.name}`);return e[t.name]}))}if(i.length!==this.components.length)throw new Error("array is wrong length");return i.forEach(((e,r)=>{s[r].#v(t,e,n,(t=>{i[r]=t}))})),void r(i)}const s=n(this.type,e);s.then?t.push(async function(){r(await s)}()):r(s)}async walkAsync(t,e){const n=[],r=[t];return this.#v(n,t,e,(t=>{r[0]=t})),n.length&&await Promise.all(n),r[0]}static from(t,e){if(z.isParamType(t))return t;if("string"==typeof t)try{return z.from(R(t),e)}catch(e){(0,s.MR)(!1,"invalid param type","obj",t)}else if(t instanceof x){let n="",r="",s=null;O(t,o(["tuple"])).has("tuple")||t.peekType("OPEN_PAREN")?(r="tuple",s=t.popParams().map((t=>z.from(t))),n=`tuple(${s.map((t=>t.format())).join(",")})`):(n=S(t.popType("TYPE")),r=n);let i=null,a=null;for(;t.length&&t.peekType("BRACKET");){const e=t.pop();i=new z(C,"",n,r,null,s,a,i),a=e.value,n+=e.text,r="array",s=null}let u=null;if(O(t,d).has("indexed")){if(!e)throw new Error("");u=!0}const c=t.peekType("ID")?t.pop().text:"";if(t.length)throw new Error("leftover tokens");return new z(C,c,n,r,u,s,a,i)}const n=t.name;(0,s.MR)(!n||"string"==typeof n&&n.match(v),"invalid name","obj.name",n);let r=t.indexed;null!=r&&((0,s.MR)(e,"parameter cannot be indexed","obj.indexed",t.indexed),r=!!r);let i=t.type,a=i.match(_);if(a){const e=parseInt(a[2]||"-1"),s=z.from({type:a[1],components:t.components});return new z(C,n||"",i,"array",r,null,e,s)}if("tuple"===i||i.startsWith("tuple(")||i.startsWith("(")){const e=null!=t.components?t.components.map((t=>z.from(t))):null;return new z(C,n||"",i,"tuple",r,e,null,null)}return i=S(t.type),new z(C,n||"",i,i,r,null,null,null)}static isParamType(t){return t&&t[j]===P}}class D{type;inputs;constructor(t,e,n){(0,s.gk)(t,C,"Fragment"),n=Object.freeze(n.slice()),(0,i.n)(this,{type:e,inputs:n})}static from(t){if("string"==typeof t){try{D.from(JSON.parse(t))}catch(t){}return D.from(R(t))}if(t instanceof x){switch(t.peekKeyword(f)){case"constructor":return G.from(t);case"error":return W.from(t);case"event":return Z.from(t);case"fallback":case"receive":return Y.from(t);case"function":return X.from(t);case"struct":return q.from(t)}}else if("object"==typeof t){switch(t.type){case"constructor":return G.from(t);case"error":return W.from(t);case"event":return Z.from(t);case"fallback":case"receive":return Y.from(t);case"function":return X.from(t);case"struct":return q.from(t)}(0,s.vA)(!1,`unsupported type: ${t.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}(0,s.MR)(!1,"unsupported frgament object","obj",t)}static isConstructor(t){return G.isFragment(t)}static isError(t){return W.isFragment(t)}static isEvent(t){return Z.isFragment(t)}static isFunction(t){return X.isFragment(t)}static isStruct(t){return q.isFragment(t)}}class J extends D{name;constructor(t,e,n,r){super(t,e,r),(0,s.MR)("string"==typeof n&&n.match(v),"invalid identifier","name",n),r=Object.freeze(r.slice()),(0,i.n)(this,{name:n})}}function K(t,e){return"("+e.map((e=>e.format(t))).join("full"===t?", ":",")+")"}class W extends J{constructor(t,e,n){super(t,"error",e,n),Object.defineProperty(this,j,{value:I})}get selector(){return(0,a.id)(this.format("sighash")).substring(0,10)}format(t){if(null==t&&(t="sighash"),"json"===t)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});const e=[];return"sighash"!==t&&e.push("error"),e.push(this.name+K(t,this.inputs)),e.join(" ")}static from(t){if(W.isFragment(t))return t;if("string"==typeof t)return W.from(R(t));if(t instanceof x){const e=A("error",t),n=M(t);return $(t),new W(C,e,n)}return new W(C,t.name,t.inputs?t.inputs.map(z.from):[])}static isFragment(t){return t&&t[j]===I}}class Z extends J{anonymous;constructor(t,e,n,r){super(t,"event",e,n),Object.defineProperty(this,j,{value:F}),(0,i.n)(this,{anonymous:r})}get topicHash(){return(0,a.id)(this.format("sighash"))}format(t){if(null==t&&(t="sighash"),"json"===t)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((e=>JSON.parse(e.format(t))))});const e=[];return"sighash"!==t&&e.push("event"),e.push(this.name+K(t,this.inputs)),"sighash"!==t&&this.anonymous&&e.push("anonymous"),e.join(" ")}static getTopicHash(t,e){e=(e||[]).map((t=>z.from(t)));return new Z(C,t,e,!1).topicHash}static from(t){if(Z.isFragment(t))return t;if("string"==typeof t)try{return Z.from(R(t))}catch(e){(0,s.MR)(!1,"invalid event fragment","obj",t)}else if(t instanceof x){const e=A("event",t),n=M(t,!0),r=!!O(t,o(["anonymous"])).has("anonymous");return $(t),new Z(C,e,n,r)}return new Z(C,t.name,t.inputs?t.inputs.map((t=>z.from(t,!0))):[],!!t.anonymous)}static isFragment(t){return t&&t[j]===F}}class G extends D{payable;gas;constructor(t,e,n,r,s){super(t,e,n),Object.defineProperty(this,j,{value:L}),(0,i.n)(this,{payable:r,gas:s})}format(t){if((0,s.vA)(null!=t&&"sighash"!==t,"cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),"json"===t)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((e=>JSON.parse(e.format(t))))});const e=[`constructor${K(t,this.inputs)}`];return this.payable&&e.push("payable"),null!=this.gas&&e.push(`@${this.gas.toString()}`),e.join(" ")}static from(t){if(G.isFragment(t))return t;if("string"==typeof t)try{return G.from(R(t))}catch(e){(0,s.MR)(!1,"invalid constuctor fragment","obj",t)}else if(t instanceof x){O(t,o(["constructor"]));const e=M(t),n=!!O(t,u).has("payable"),r=T(t);return $(t),new G(C,"constructor",e,n,r)}return new G(C,"constructor",t.inputs?t.inputs.map(z.from):[],!!t.payable,null!=t.gas?t.gas:null)}static isFragment(t){return t&&t[j]===L}}class Y extends D{payable;constructor(t,e,n){super(t,"fallback",e),Object.defineProperty(this,j,{value:U}),(0,i.n)(this,{payable:n})}format(t){const e=0===this.inputs.length?"receive":"fallback";if("json"===t){const t=this.payable?"payable":"nonpayable";return JSON.stringify({type:e,stateMutability:t})}return`${e}()${this.payable?" payable":""}`}static from(t){if(Y.isFragment(t))return t;if("string"==typeof t)try{return Y.from(R(t))}catch(e){(0,s.MR)(!1,"invalid fallback fragment","obj",t)}else if(t instanceof x){const e=t.toString(),n=t.peekKeyword(o(["fallback","receive"]));(0,s.MR)(n,"type must be fallback or receive","obj",e);if("receive"===t.popKeyword(o(["fallback","receive"]))){const e=M(t);return(0,s.MR)(0===e.length,"receive cannot have arguments","obj.inputs",e),O(t,o(["payable"])),$(t),new Y(C,[],!0)}let r=M(t);r.length?(0,s.MR)(1===r.length&&"bytes"===r[0].type,"invalid fallback inputs","obj.inputs",r.map((t=>t.format("minimal"))).join(", ")):r=[z.from("bytes")];const i=N(t);if((0,s.MR)("nonpayable"===i||"payable"===i,"fallback cannot be constants","obj.stateMutability",i),O(t,o(["returns"])).has("returns")){const e=M(t);(0,s.MR)(1===e.length&&"bytes"===e[0].type,"invalid fallback outputs","obj.outputs",e.map((t=>t.format("minimal"))).join(", "))}return $(t),new Y(C,r,"payable"===i)}if("receive"===t.type)return new Y(C,[],!0);if("fallback"===t.type){const e=[z.from("bytes")],n="payable"===t.stateMutability;return new Y(C,e,n)}(0,s.MR)(!1,"invalid fallback description","obj",t)}static isFragment(t){return t&&t[j]===U}}class X extends J{constant;outputs;stateMutability;payable;gas;constructor(t,e,n,r,s,a){super(t,"function",e,r),Object.defineProperty(this,j,{value:V}),s=Object.freeze(s.slice());const o="view"===n||"pure"===n,u="payable"===n;(0,i.n)(this,{constant:o,gas:a,outputs:s,payable:u,stateMutability:n})}get selector(){return(0,a.id)(this.format("sighash")).substring(0,10)}format(t){if(null==t&&(t="sighash"),"json"===t)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((e=>JSON.parse(e.format(t)))),outputs:this.outputs.map((e=>JSON.parse(e.format(t))))});const e=[];return"sighash"!==t&&e.push("function"),e.push(this.name+K(t,this.inputs)),"sighash"!==t&&("nonpayable"!==this.stateMutability&&e.push(this.stateMutability),this.outputs&&this.outputs.length&&(e.push("returns"),e.push(K(t,this.outputs))),null!=this.gas&&e.push(`@${this.gas.toString()}`)),e.join(" ")}static getSelector(t,e){e=(e||[]).map((t=>z.from(t)));return new X(C,t,"view",e,[],null).selector}static from(t){if(X.isFragment(t))return t;if("string"==typeof t)try{return X.from(R(t))}catch(e){(0,s.MR)(!1,"invalid function fragment","obj",t)}else if(t instanceof x){const e=A("function",t),n=M(t),r=N(t);let s=[];O(t,o(["returns"])).has("returns")&&(s=M(t));const i=T(t);return $(t),new X(C,e,r,n,s,i)}let e=t.stateMutability;return null==e&&(e="payable","boolean"==typeof t.constant?(e="view",t.constant||(e="payable","boolean"!=typeof t.payable||t.payable||(e="nonpayable"))):"boolean"!=typeof t.payable||t.payable||(e="nonpayable")),new X(C,t.name,e,t.inputs?t.inputs.map(z.from):[],t.outputs?t.outputs.map(z.from):[],null!=t.gas?t.gas:null)}static isFragment(t){return t&&t[j]===V}}class q extends J{constructor(t,e,n){super(t,"struct",e,n),Object.defineProperty(this,j,{value:B})}format(){throw new Error("@TODO")}static from(t){if("string"==typeof t)try{return q.from(R(t))}catch(e){(0,s.MR)(!1,"invalid struct fragment","obj",t)}else if(t instanceof x){const e=A("struct",t),n=M(t);return $(t),new q(C,e,n)}return new q(C,t.name,t.inputs?t.inputs.map(z.from):[])}static isFragment(t){return t&&t[j]===B}}},99529:(t,e,n)=>{n.d(e,{r:()=>r});const r="6.13.5"}}]);