const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BMWZoFoa.js","./X8_fjRk3.js","./entry.DMvogK5A.css"])))=>i.map(i=>d[i]);
var lt=e=>{throw TypeError(e)};var Re=(e,t,n)=>t.has(e)||lt("Cannot "+n);var u=(e,t,n)=>(Re(e,t,"read from private field"),n?n.call(e):t.get(e)),S=(e,t,n)=>t.has(e)?lt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),w=(e,t,n,r)=>(Re(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),P=(e,t,n)=>(Re(e,t,"access private method"),n);import{bg as pn,bh as ft,bi as B,bj as ke,bk as xe,bl as yn,bm as ht,bn as pt,bo as bn,bp as mn,bq as gn,br as yt,bs as wn,bt as vn,n as Pe,bu as xn,bv as Pn,g as we,bw as bt,aq as $n,bx as mt,by as An,ax as b,bz as z,aG as $,bA as ce,bB as X,bC as $e,bD as Y,bE as En,bF as Sn,bG as Ae,aE as zt,bH as ve,bI as Be,bJ as gt,bK as wt,bL as vt,bM as xt,bN as Pt,bO as $t,bP as At,bQ as Et,bR as ze,aK as _t,bS as q,bT as Cn,bU as On,aQ as et,bV as St,bW as Se,aC as In,bX as tt,bY as Mn,aD as Rn,aH as Tn,bZ as Fn,az as jn,b_ as Dn,ay as kn,b$ as Bn,aA as zn,c0 as _e,b0 as _n,aO as Lt,aP as Ln,aM as Te,c1 as Nn,c2 as Un,c3 as Nt,ak as Gn,c4 as Qn,A as Ut,u as Le,c5 as Hn,c6 as Wn,bd as Zn,be as Vn}from"./X8_fjRk3.js";var M,p,be,C,V,se,Q,k,me,ie,oe,K,J,H,ae,g,he,Ne,Ue,Ge,Qe,He,We,Ze,Gt,Bt,Kn=(Bt=class extends pn{constructor(t,n){super();S(this,g);S(this,M);S(this,p);S(this,be);S(this,C);S(this,V);S(this,se);S(this,Q);S(this,k);S(this,me);S(this,ie);S(this,oe);S(this,K);S(this,J);S(this,H);S(this,ae,new Set);this.options=n,w(this,M,t),w(this,k,null),w(this,Q,ft()),this.options.experimental_prefetchInRender||u(this,Q).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(u(this,p).addObserver(this),Ct(u(this,p),this.options)?P(this,g,he).call(this):this.updateResult(),P(this,g,Qe).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ve(u(this,p),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ve(u(this,p),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,P(this,g,He).call(this),P(this,g,We).call(this),u(this,p).removeObserver(this)}setOptions(t,n){const r=this.options,s=u(this,p);if(this.options=u(this,M).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof B(this.options.enabled,u(this,p))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");P(this,g,Ze).call(this),u(this,p).setOptions(this.options),r._defaulted&&!ke(this.options,r)&&u(this,M).getQueryCache().notify({type:"observerOptionsUpdated",query:u(this,p),observer:this});const o=this.hasListeners();o&&Ot(u(this,p),s,this.options,r)&&P(this,g,he).call(this),this.updateResult(n),o&&(u(this,p)!==s||B(this.options.enabled,u(this,p))!==B(r.enabled,u(this,p))||xe(this.options.staleTime,u(this,p))!==xe(r.staleTime,u(this,p)))&&P(this,g,Ne).call(this);const i=P(this,g,Ue).call(this);o&&(u(this,p)!==s||B(this.options.enabled,u(this,p))!==B(r.enabled,u(this,p))||i!==u(this,H))&&P(this,g,Ge).call(this,i)}getOptimisticResult(t){const n=u(this,M).getQueryCache().build(u(this,M),t),r=this.createResult(n,t);return Yn(this,r)&&(w(this,C,r),w(this,se,this.options),w(this,V,u(this,p).state)),r}getCurrentResult(){return u(this,C)}trackResult(t,n){const r={};return Object.keys(t).forEach(s=>{Object.defineProperty(r,s,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(s),n==null||n(s),t[s])})}),r}trackProp(t){u(this,ae).add(t)}getCurrentQuery(){return u(this,p)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=u(this,M).defaultQueryOptions(t),r=u(this,M).getQueryCache().build(u(this,M),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return P(this,g,he).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),u(this,C)))}createResult(t,n){var te;const r=u(this,p),s=this.options,o=u(this,C),i=u(this,V),a=u(this,se),d=t!==r?t.state:u(this,be),{state:f}=t;let l={...f},y=!1,h;if(n._optimisticResults){const A=this.hasListeners(),_=!A&&Ct(t,n),D=A&&Ot(t,r,n,s);(_||D)&&(l={...l,...gn(f.data,t.options)}),n._optimisticResults==="isRestoring"&&(l.fetchStatus="idle")}let{error:m,errorUpdatedAt:x,status:v}=l;if(n.select&&l.data!==void 0)if(o&&l.data===(i==null?void 0:i.data)&&n.select===u(this,me))h=u(this,ie);else try{w(this,me,n.select),h=n.select(l.data),h=yt(o==null?void 0:o.data,h,n),w(this,ie,h),w(this,k,null)}catch(A){w(this,k,A)}else h=l.data;if(n.placeholderData!==void 0&&h===void 0&&v==="pending"){let A;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))A=o.data;else if(A=typeof n.placeholderData=="function"?n.placeholderData((te=u(this,oe))==null?void 0:te.state.data,u(this,oe)):n.placeholderData,n.select&&A!==void 0)try{A=n.select(A),w(this,k,null)}catch(_){w(this,k,_)}A!==void 0&&(v="success",h=yt(o==null?void 0:o.data,A,n),y=!0)}u(this,k)&&(m=u(this,k),h=u(this,ie),x=Date.now(),v="error");const R=l.fetchStatus==="fetching",E=v==="pending",j=v==="error",N=E&&R,de=h!==void 0,I={status:v,fetchStatus:l.fetchStatus,isPending:E,isSuccess:v==="success",isError:j,isInitialLoading:N,isLoading:N,data:h,dataUpdatedAt:l.dataUpdatedAt,error:m,errorUpdatedAt:x,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:l.dataUpdateCount>0||l.errorUpdateCount>0,isFetchedAfterMount:l.dataUpdateCount>d.dataUpdateCount||l.errorUpdateCount>d.errorUpdateCount,isFetching:R,isRefetching:R&&!E,isLoadingError:j&&!de,isPaused:l.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:j&&de,isStale:nt(t,n),refetch:this.refetch,promise:u(this,Q)};if(this.options.experimental_prefetchInRender){const A=U=>{I.status==="error"?U.reject(I.error):I.data!==void 0&&U.resolve(I.data)},_=()=>{const U=w(this,Q,I.promise=ft());A(U)},D=u(this,Q);switch(D.status){case"pending":t.queryHash===r.queryHash&&A(D);break;case"fulfilled":(I.status==="error"||I.data!==D.value)&&_();break;case"rejected":(I.status!=="error"||I.error!==D.reason)&&_();break}}return I}updateResult(t){const n=u(this,C),r=this.createResult(u(this,p),this.options);if(w(this,V,u(this,p).state),w(this,se,this.options),u(this,V).data!==void 0&&w(this,oe,u(this,p)),ke(r,n))return;w(this,C,r);const s={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!u(this,ae).size)return!0;const c=new Set(a??u(this,ae));return this.options.throwOnError&&c.add("error"),Object.keys(u(this,C)).some(d=>{const f=d;return u(this,C)[f]!==n[f]&&c.has(f)})};(t==null?void 0:t.listeners)!==!1&&o()&&(s.listeners=!0),P(this,g,Gt).call(this,{...s,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&P(this,g,Qe).call(this)}},M=new WeakMap,p=new WeakMap,be=new WeakMap,C=new WeakMap,V=new WeakMap,se=new WeakMap,Q=new WeakMap,k=new WeakMap,me=new WeakMap,ie=new WeakMap,oe=new WeakMap,K=new WeakMap,J=new WeakMap,H=new WeakMap,ae=new WeakMap,g=new WeakSet,he=function(t){P(this,g,Ze).call(this);let n=u(this,p).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(yn)),n},Ne=function(){P(this,g,He).call(this);const t=xe(this.options.staleTime,u(this,p));if(ht||u(this,C).isStale||!pt(t))return;const r=bn(u(this,C).dataUpdatedAt,t)+1;w(this,K,setTimeout(()=>{u(this,C).isStale||this.updateResult()},r))},Ue=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(u(this,p)):this.options.refetchInterval)??!1},Ge=function(t){P(this,g,We).call(this),w(this,H,t),!(ht||B(this.options.enabled,u(this,p))===!1||!pt(u(this,H))||u(this,H)===0)&&w(this,J,setInterval(()=>{(this.options.refetchIntervalInBackground||mn.isFocused())&&P(this,g,he).call(this)},u(this,H)))},Qe=function(){P(this,g,Ne).call(this),P(this,g,Ge).call(this,P(this,g,Ue).call(this))},He=function(){u(this,K)&&(clearTimeout(u(this,K)),w(this,K,void 0))},We=function(){u(this,J)&&(clearInterval(u(this,J)),w(this,J,void 0))},Ze=function(){const t=u(this,M).getQueryCache().build(u(this,M),this.options);if(t===u(this,p))return;const n=u(this,p);w(this,p,t),w(this,be,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Gt=function(t){wn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(u(this,C))}),u(this,M).getQueryCache().notify({query:u(this,p),type:"observerResultsUpdated"})})},Bt);function Jn(e,t){return B(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Ct(e,t){return Jn(e,t)||e.state.data!==void 0&&Ve(e,t,t.refetchOnMount)}function Ve(e,t,n){if(B(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&nt(e,t)}return!1}function Ot(e,t,n,r){return(e!==t||B(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&nt(e,n)}function nt(e,t){return B(t.enabled,e)!==!1&&e.isStaleByTime(xe(t.staleTime,e))}function Yn(e,t){return!ke(e.getCurrentResult(),t)}function Xn(e,t,n){const r=vn(),s=Pe(()=>{const h=xn(t);typeof h.enabled=="function"&&(h.enabled=h.enabled());const m=r.defaultQueryOptions(h);return m._optimisticResults=r.isRestoring.value?"isRestoring":"optimistic",m}),o=new e(r,s.value),i=Pn(o.getCurrentResult());let a=()=>{};we(r.isRestoring,h=>{h||(a(),a=o.subscribe(m=>{bt(i,m)}))},{immediate:!0});const c=()=>{o.setOptions(s.value),bt(i,o.getCurrentResult())};we(s,c),$n(()=>{a()});const d=(...h)=>(c(),i.refetch(...h)),f=()=>new Promise((h,m)=>{let x=()=>{};const v=()=>{if(s.value.enabled!==!1){o.setOptions(s.value);const R=o.getOptimisticResult(s.value);R.isStale?(x(),o.fetchOptimistic(s.value).then(h,E=>{mt(s.value.throwOnError,[E,o.getCurrentQuery()])?m(E):h(o.getCurrentResult())})):(x(),h(R))}};v(),x=we(s,v)});we(()=>i.error,h=>{if(i.isError&&!i.isFetching&&mt(s.value.throwOnError,[h,o.getCurrentQuery()]))throw h});const y=An(i);for(const h in i)typeof i[h]=="function"&&(y[h]=i[h]);return y.suspense=f,y.refetch=d,y}function qn(e,t){return Xn(Kn,e)}function ue(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new lr(e.type);return`${e.name}(${rt(e.inputs,{includeName:t})})`}function rt(e,{includeName:t=!1}={}){return e?e.map(n=>er(n,{includeName:t})).join(t?", ":","):""}function er(e,{includeName:t}){return e.type.startsWith("tuple")?`(${rt(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}class tr extends b{constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
`),{docsPath:t,name:"AbiConstructorNotFoundError"})}}class It extends b{constructor({docsPath:t}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
`),{docsPath:t,name:"AbiConstructorParamsNotFoundError"})}}class nr extends b{constructor({data:t,params:n,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join(`
`),{metaMessages:[`Params: (${rt(n,{includeName:!0})})`,`Data:   ${t} (${r} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t,this.params=n,this.size=r}}class st extends b{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class rr extends b{constructor({expectedLength:t,givenLength:n,type:r}){super([`ABI encoding array length mismatch for type ${r}.`,`Expected length: ${t}`,`Given length: ${n}`].join(`
`),{name:"AbiEncodingArrayLengthMismatchError"})}}class sr extends b{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${z(n)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class ir extends b{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${n}`].join(`
`),{name:"AbiEncodingLengthMismatchError"})}}class Qt extends b{constructor(t,{docsPath:n}){super([`Encoded error signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${t}.`].join(`
`),{docsPath:n,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}}class Ee extends b{constructor(t,{docsPath:n}={}){super([`Function ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
`),{docsPath:n,name:"AbiFunctionNotFoundError"})}}class or extends b{constructor(t,{docsPath:n}){super([`Function "${t}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(`
`),{docsPath:n,name:"AbiFunctionOutputsNotFoundError"})}}class ar extends b{constructor(t,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${ue(t.abiItem)}\`, and`,`\`${n.type}\` in \`${ue(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class cr extends b{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
`),{docsPath:n,name:"InvalidAbiEncodingType"})}}class ur extends b{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
`),{docsPath:n,name:"InvalidAbiDecodingType"})}}class dr extends b{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
`),{name:"InvalidArrayError"})}}class lr extends b{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
`),{name:"InvalidDefinitionTypeError"})}}function Ht(e,t){if(e.length!==t.length)throw new ir({expectedLength:e.length,givenLength:t.length});const n=fr({params:e,values:t}),r=ot(n);return r.length===0?"0x":r}function fr({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(it({param:e[r],value:t[r]}));return n}function it({param:e,value:t}){const n=at(e.type);if(n){const[r,s]=n;return pr(t,{length:r,param:{...e,type:s}})}if(e.type==="tuple")return wr(t,{param:e});if(e.type==="address")return hr(t);if(e.type==="bool")return br(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const r=e.type.startsWith("int");return mr(t,{signed:r})}if(e.type.startsWith("bytes"))return yr(t,{param:e});if(e.type==="string")return gr(t);throw new cr(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function ot(e){let t=0;for(let o=0;o<e.length;o++){const{dynamic:i,encoded:a}=e[o];i?t+=32:t+=z(a)}const n=[],r=[];let s=0;for(let o=0;o<e.length;o++){const{dynamic:i,encoded:a}=e[o];i?(n.push($(t+s,{size:32})),r.push(a),s+=z(a)):n.push(a)}return ce([...n,...r])}function hr(e){if(!X(e))throw new $e({address:e});return{dynamic:!1,encoded:Y(e.toLowerCase())}}function pr(e,{length:t,param:n}){const r=t===null;if(!Array.isArray(e))throw new dr(e);if(!r&&e.length!==t)throw new rr({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let s=!1;const o=[];for(let i=0;i<e.length;i++){const a=it({param:n,value:e[i]});a.dynamic&&(s=!0),o.push(a)}if(r||s){const i=ot(o);if(r){const a=$(o.length,{size:32});return{dynamic:!0,encoded:o.length>0?ce([a,i]):a}}if(s)return{dynamic:!0,encoded:i}}return{dynamic:!1,encoded:ce(o.map(({encoded:i})=>i))}}function yr(e,{param:t}){const[,n]=t.type.split("bytes"),r=z(e);if(!n){let s=e;return r%32!==0&&(s=Y(s,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:ce([Y($(r,{size:32})),s])}}if(r!==Number.parseInt(n))throw new sr({expectedSize:Number.parseInt(n),value:e});return{dynamic:!1,encoded:Y(e,{dir:"right"})}}function br(e){if(typeof e!="boolean")throw new b(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Y(En(e))}}function mr(e,{signed:t}){return{dynamic:!1,encoded:$(e,{size:32,signed:t})}}function gr(e){const t=Sn(e),n=Math.ceil(z(t)/32),r=[];for(let s=0;s<n;s++)r.push(Y(Ae(t,s*32,(s+1)*32),{dir:"right"}));return{dynamic:!0,encoded:ce([Y($(z(t),{size:32})),...r])}}function wr(e,{param:t}){let n=!1;const r=[];for(let s=0;s<t.components.length;s++){const o=t.components[s],i=Array.isArray(e)?s:o.name,a=it({param:o,value:e[i]});r.push(a),a.dynamic&&(n=!0)}return{dynamic:n,encoded:n?ot(r):ce(r.map(({encoded:s})=>s))}}function at(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const Fe="/docs/contract/encodeDeployData";function Wt(e){const{abi:t,args:n,bytecode:r}=e;if(!n||n.length===0)return r;const s=t.find(i=>"type"in i&&i.type==="constructor");if(!s)throw new tr({docsPath:Fe});if(!("inputs"in s))throw new It({docsPath:Fe});if(!s.inputs||s.inputs.length===0)throw new It({docsPath:Fe});const o=Ht(s.inputs,n);return zt([r,o])}function vr(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof b?e.walk(s=>(s==null?void 0:s.code)===ve.code):e;return r instanceof b?new ve({cause:e,message:r.details}):ve.nodeMessage.test(n)?new ve({cause:e,message:e.details}):Be.nodeMessage.test(n)?new Be({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):gt.nodeMessage.test(n)?new gt({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):wt.nodeMessage.test(n)?new wt({cause:e,nonce:t==null?void 0:t.nonce}):vt.nodeMessage.test(n)?new vt({cause:e,nonce:t==null?void 0:t.nonce}):xt.nodeMessage.test(n)?new xt({cause:e,nonce:t==null?void 0:t.nonce}):Pt.nodeMessage.test(n)?new Pt({cause:e}):$t.nodeMessage.test(n)?new $t({cause:e,gas:t==null?void 0:t.gas}):At.nodeMessage.test(n)?new At({cause:e,gas:t==null?void 0:t.gas}):Et.nodeMessage.test(n)?new Et({cause:e}):ze.nodeMessage.test(n)?new ze({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas,maxPriorityFeePerGas:t==null?void 0:t.maxPriorityFeePerGas}):new _t({cause:e})}function xr(e,{format:t}){if(!t)return{};const n={};function r(o){const i=Object.keys(o);for(const a of i)a in e&&(n[a]=e[a]),o[a]&&typeof o[a]=="object"&&!Array.isArray(o[a])&&r(o[a])}const s=t(e||{});return r(s),n}const Pr={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function $r(e){const t={};return typeof e.authorizationList<"u"&&(t.authorizationList=Ar(e.authorizationList)),typeof e.accessList<"u"&&(t.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(t.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?t.blobs=e.blobs.map(n=>q(n)):t.blobs=e.blobs),typeof e.data<"u"&&(t.data=e.data),typeof e.from<"u"&&(t.from=e.from),typeof e.gas<"u"&&(t.gas=$(e.gas)),typeof e.gasPrice<"u"&&(t.gasPrice=$(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(t.maxFeePerBlobGas=$(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(t.maxFeePerGas=$(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(t.maxPriorityFeePerGas=$(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(t.nonce=$(e.nonce)),typeof e.to<"u"&&(t.to=e.to),typeof e.type<"u"&&(t.type=Pr[e.type]),typeof e.value<"u"&&(t.value=$(e.value)),t}function Ar(e){return e.map(t=>({address:t.contractAddress,r:t.r,s:t.s,chainId:$(t.chainId),nonce:$(t.nonce),...typeof t.yParity<"u"?{yParity:$(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:$(t.v)}:{}}))}function Er(e,t,n){const r=e[t.name];if(typeof r=="function")return r;const s=e[n];return typeof s=="function"?s:o=>t(e,o)}function Sr(e){const{account:t,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:s,to:o}=e,i=t?et(t):void 0;if(i&&!X(i.address))throw new $e({address:i.address});if(o&&!X(o))throw new $e({address:o});if(typeof n<"u"&&(typeof r<"u"||typeof s<"u"))throw new Cn;if(r&&r>On)throw new Be({maxFeePerGas:r});if(s&&r&&s>r)throw new ze({maxFeePerGas:r,maxPriorityFeePerGas:s})}class Cr extends b{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}}class Or extends b{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function Mt(e){return e.reduce((t,{slot:n,value:r})=>`${t}        ${n}: ${r}
`,"")}function Ir(e){return e.reduce((t,{address:n,...r})=>{let s=`${t}    ${n}:
`;return r.nonce&&(s+=`      nonce: ${r.nonce}
`),r.balance&&(s+=`      balance: ${r.balance}
`),r.code&&(s+=`      code: ${r.code}
`),r.state&&(s+=`      state:
`,s+=Mt(r.state)),r.stateDiff&&(s+=`      stateDiff:
`,s+=Mt(r.stateDiff)),s},`  State Override:
`).slice(0,-1)}function Rt(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new St({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new St({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function Mr(e){const{balance:t,nonce:n,state:r,stateDiff:s,code:o}=e,i={};if(o!==void 0&&(i.code=o),t!==void 0&&(i.balance=$(t)),n!==void 0&&(i.nonce=$(n)),r!==void 0&&(i.state=Rt(r)),s!==void 0){if(i.state)throw new Or;i.stateDiff=Rt(s)}return i}function Rr(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!X(n,{strict:!1}))throw new $e({address:n});if(t[n])throw new Cr({address:n});t[n]=Mr(r)}return t}const Tt=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}];function Tr(e,t={}){typeof t.size<"u"&&Se(e,{size:t.size});const n=q(e,t);return In(n,t)}function Fr(e,t={}){let n=e;if(typeof t.size<"u"&&(Se(n,{size:t.size}),n=tt(n)),n.length>1||n[0]>1)throw new Mn(n);return!!n[0]}function L(e,t={}){typeof t.size<"u"&&Se(e,{size:t.size});const n=q(e,t);return Rn(n,t)}function jr(e,t={}){let n=e;return typeof t.size<"u"&&(Se(n,{size:t.size}),n=tt(n,{dir:"right"})),new TextDecoder().decode(n)}function Zt(e,t){const n=typeof t=="string"?Tn(t):t,r=Fn(n);if(z(n)===0&&e.length>0)throw new st;if(z(t)&&z(t)<32)throw new nr({data:typeof t=="string"?t:q(t),params:e,size:z(t)});let s=0;const o=[];for(let i=0;i<e.length;++i){const a=e[i];r.setPosition(s);const[c,d]=re(r,a,{staticPosition:0});s+=d,o.push(c)}return o}function re(e,t,{staticPosition:n}){const r=at(t.type);if(r){const[s,o]=r;return kr(e,{...t,type:o},{length:s,staticPosition:n})}if(t.type==="tuple")return Lr(e,t,{staticPosition:n});if(t.type==="address")return Dr(e);if(t.type==="bool")return Br(e);if(t.type.startsWith("bytes"))return zr(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return _r(e,t);if(t.type==="string")return Nr(e,{staticPosition:n});throw new ur(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const Ft=32,Ke=32;function Dr(e){const t=e.readBytes(32);return[jn(q(Dn(t,-20))),32]}function kr(e,t,{length:n,staticPosition:r}){if(!n){const i=L(e.readBytes(Ke)),a=r+i,c=a+Ft;e.setPosition(a);const d=L(e.readBytes(Ft)),f=ye(t);let l=0;const y=[];for(let h=0;h<d;++h){e.setPosition(c+(f?h*32:l));const[m,x]=re(e,t,{staticPosition:c});l+=x,y.push(m)}return e.setPosition(r+32),[y,32]}if(ye(t)){const i=L(e.readBytes(Ke)),a=r+i,c=[];for(let d=0;d<n;++d){e.setPosition(a+d*32);const[f]=re(e,t,{staticPosition:a});c.push(f)}return e.setPosition(r+32),[c,32]}let s=0;const o=[];for(let i=0;i<n;++i){const[a,c]=re(e,t,{staticPosition:r+s});s+=c,o.push(a)}return[o,s]}function Br(e){return[Fr(e.readBytes(32),{size:32}),32]}function zr(e,t,{staticPosition:n}){const[r,s]=t.type.split("bytes");if(!s){const i=L(e.readBytes(32));e.setPosition(n+i);const a=L(e.readBytes(32));if(a===0)return e.setPosition(n+32),["0x",32];const c=e.readBytes(a);return e.setPosition(n+32),[q(c),32]}return[q(e.readBytes(Number.parseInt(s),32)),32]}function _r(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256"),s=e.readBytes(32);return[r>48?Tr(s,{signed:n}):L(s,{signed:n}),32]}function Lr(e,t,{staticPosition:n}){const r=t.components.length===0||t.components.some(({name:i})=>!i),s=r?[]:{};let o=0;if(ye(t)){const i=L(e.readBytes(Ke)),a=n+i;for(let c=0;c<t.components.length;++c){const d=t.components[c];e.setPosition(a+o);const[f,l]=re(e,d,{staticPosition:a});o+=l,s[r?c:d==null?void 0:d.name]=f}return e.setPosition(n+32),[s,32]}for(let i=0;i<t.components.length;++i){const a=t.components[i],[c,d]=re(e,a,{staticPosition:n});s[r?i:a==null?void 0:a.name]=c,o+=d}return[s,o]}function Nr(e,{staticPosition:t}){const n=L(e.readBytes(32)),r=t+n;e.setPosition(r);const s=L(e.readBytes(32));if(s===0)return e.setPosition(t+32),["",32];const o=e.readBytes(s,32),i=jr(tt(o));return e.setPosition(t+32),[i,32]}function ye(e){var r;const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return(r=e.components)==null?void 0:r.some(ye);const n=at(e.type);return!!(n&&ye({...e,type:n[1]}))}const Ur=e=>kn(Bn(e));function Gr(e){return Ur(e)}const Qr="1.0.6";class O extends Error{constructor(t,n={}){var i;const r=n.cause instanceof O?n.cause.details:(i=n.cause)!=null&&i.message?n.cause.message:n.details,s=n.cause instanceof O&&n.cause.docsPath||n.docsPath,o=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: https://abitype.dev${s}`]:[],...r?[`Details: ${r}`]:[],`Version: abitype@${Qr}`].join(`
`);super(o),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=s,this.metaMessages=n.metaMessages,this.shortMessage=t}}function W(e,t){const n=e.exec(t);return n==null?void 0:n.groups}const Vt=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Kt=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Jt=/^\(.+?\).*?$/,jt=/^tuple(?<array>(\[(\d*)\])*)$/;function Je(e){let t=e.type;if(jt.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let s=0;s<n;s++){const o=e.components[s];t+=Je(o),s<n-1&&(t+=", ")}const r=W(jt,e.type);return t+=`)${(r==null?void 0:r.array)??""}`,Je({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function fe(e){let t="";const n=e.length;for(let r=0;r<n;r++){const s=e[r];t+=Je(s),r!==n-1&&(t+=", ")}return t}function Hr(e){return e.type==="function"?`function ${e.name}(${fe(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${e.outputs.length?` returns (${fe(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${fe(e.inputs)})`:e.type==="error"?`error ${e.name}(${fe(e.inputs)})`:e.type==="constructor"?`constructor(${fe(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?"fallback()":"receive() external payable"}const Yt=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function Wr(e){return Yt.test(e)}function Zr(e){return W(Yt,e)}const Xt=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function Vr(e){return Xt.test(e)}function Kr(e){return W(Xt,e)}const qt=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function Jr(e){return qt.test(e)}function Yr(e){return W(qt,e)}const en=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function tn(e){return en.test(e)}function Xr(e){return W(en,e)}const nn=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function qr(e){return nn.test(e)}function es(e){return W(nn,e)}const ts=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function ns(e){return ts.test(e)}const rs=/^receive\(\) external payable$/;function ss(e){return rs.test(e)}const is=new Set(["indexed"]),Ye=new Set(["calldata","memory","storage"]);class os extends O{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class as extends O{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class cs extends O{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class us extends O{constructor({param:t,name:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`"${n}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class ds extends O{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class ls extends O{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class fs extends O{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class pe extends O{constructor({signature:t,type:n}){super(`Invalid ${n} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class hs extends O{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class ps extends O{constructor({signature:t}){super("Invalid struct signature.",{details:t,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class ys extends O{constructor({type:t}){super("Circular reference detected.",{metaMessages:[`Struct "${t}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class bs extends O{constructor({current:t,depth:n}){super("Unbalanced parentheses.",{metaMessages:[`"${t.trim()}" has too many ${n>0?"opening":"closing"} parentheses.`],details:`Depth "${n}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function ms(e,t){return t?`${t}:${e}`:e}const je=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function gs(e,t={}){if(Jr(e)){const n=Yr(e);if(!n)throw new pe({signature:e,type:"function"});const r=F(n.parameters),s=[],o=r.length;for(let a=0;a<o;a++)s.push(Z(r[a],{modifiers:Ye,structs:t,type:"function"}));const i=[];if(n.returns){const a=F(n.returns),c=a.length;for(let d=0;d<c;d++)i.push(Z(a[d],{modifiers:Ye,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:s,outputs:i}}if(Vr(e)){const n=Kr(e);if(!n)throw new pe({signature:e,type:"event"});const r=F(n.parameters),s=[],o=r.length;for(let i=0;i<o;i++)s.push(Z(r[i],{modifiers:is,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:s}}if(Wr(e)){const n=Zr(e);if(!n)throw new pe({signature:e,type:"error"});const r=F(n.parameters),s=[],o=r.length;for(let i=0;i<o;i++)s.push(Z(r[i],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:s}}if(qr(e)){const n=es(e);if(!n)throw new pe({signature:e,type:"constructor"});const r=F(n.parameters),s=[],o=r.length;for(let i=0;i<o;i++)s.push(Z(r[i],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:s}}if(ns(e))return{type:"fallback"};if(ss(e))return{type:"receive",stateMutability:"payable"};throw new hs({signature:e})}const ws=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,vs=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,xs=/^u?int$/;function Z(e,t){var l,y;const n=ms(e,t==null?void 0:t.type);if(je.has(n))return je.get(n);const r=Jt.test(e),s=W(r?vs:ws,e);if(!s)throw new cs({param:e});if(s.name&&$s(s.name))throw new us({param:e,name:s.name});const o=s.name?{name:s.name}:{},i=s.modifier==="indexed"?{indexed:!0}:{},a=(t==null?void 0:t.structs)??{};let c,d={};if(r){c="tuple";const h=F(s.type),m=[],x=h.length;for(let v=0;v<x;v++)m.push(Z(h[v],{structs:a}));d={components:m}}else if(s.type in a)c="tuple",d={components:a[s.type]};else if(xs.test(s.type))c=`${s.type}256`;else if(c=s.type,(t==null?void 0:t.type)!=="struct"&&!rn(c))throw new as({type:c});if(s.modifier){if(!((y=(l=t==null?void 0:t.modifiers)==null?void 0:l.has)!=null&&y.call(l,s.modifier)))throw new ds({param:e,type:t==null?void 0:t.type,modifier:s.modifier});if(Ye.has(s.modifier)&&!As(c,!!s.array))throw new ls({param:e,type:t==null?void 0:t.type,modifier:s.modifier})}const f={type:`${c}${s.array??""}`,...o,...i,...d};return je.set(n,f),f}function F(e,t=[],n="",r=0){const s=e.trim().length;for(let o=0;o<s;o++){const i=e[o],a=e.slice(o+1);switch(i){case",":return r===0?F(a,[...t,n.trim()]):F(a,t,`${n}${i}`,r);case"(":return F(a,t,`${n}${i}`,r+1);case")":return F(a,t,`${n}${i}`,r-1);default:return F(a,t,`${n}${i}`,r)}}if(n==="")return t;if(r!==0)throw new bs({current:n,depth:r});return t.push(n.trim()),t}function rn(e){return e==="address"||e==="bool"||e==="function"||e==="string"||Vt.test(e)||Kt.test(e)}const Ps=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function $s(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||Vt.test(e)||Kt.test(e)||Ps.test(e)}function As(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function Es(e){const t={},n=e.length;for(let i=0;i<n;i++){const a=e[i];if(!tn(a))continue;const c=Xr(a);if(!c)throw new pe({signature:a,type:"struct"});const d=c.properties.split(";"),f=[],l=d.length;for(let y=0;y<l;y++){const m=d[y].trim();if(!m)continue;const x=Z(m,{type:"struct"});f.push(x)}if(!f.length)throw new ps({signature:a});t[c.name]=f}const r={},s=Object.entries(t),o=s.length;for(let i=0;i<o;i++){const[a,c]=s[i];r[a]=sn(c,t)}return r}const Ss=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function sn(e,t,n=new Set){const r=[],s=e.length;for(let o=0;o<s;o++){const i=e[o];if(Jt.test(i.type))r.push(i);else{const c=W(Ss,i.type);if(!(c!=null&&c.type))throw new fs({abiParameter:i});const{array:d,type:f}=c;if(f in t){if(n.has(f))throw new ys({type:f});r.push({...i,type:`tuple${d??""}`,components:sn(t[f]??[],t,new Set([...n,f]))})}else if(rn(f))r.push(i);else throw new os({type:f})}}return r}function on(e){const t=Es(e),n=[],r=e.length;for(let s=0;s<r;s++){const o=e[s];tn(o)||n.push(gs(o,t))}return n}function Cs(e){let t=!0,n="",r=0,s="",o=!1;for(let i=0;i<e.length;i++){const a=e[i];if(["(",")",","].includes(a)&&(t=!0),a==="("&&r++,a===")"&&r--,!!t){if(r===0){if(a===" "&&["event","function",""].includes(s))s="";else if(s+=a,a===")"){o=!0;break}continue}if(a===" "){e[i-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}s+=a,n+=a}}if(!o)throw new b("Unable to normalize signature.");return s}const Os=e=>{const t=typeof e=="string"?e:Hr(e);return Cs(t)};function an(e){return Gr(Os(e))}const Is=an,ct=e=>Ae(an(e),0,4);function ut(e){const{abi:t,args:n=[],name:r}=e,s=zn(r,{strict:!1}),o=t.filter(a=>s?a.type==="function"?ct(a)===r:a.type==="event"?Is(a)===r:!1:"name"in a&&a.name===r);if(o.length===0)return;if(o.length===1)return o[0];let i;for(const a of o){if(!("inputs"in a))continue;if(!n||n.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==n.length)continue;if(n.every((d,f)=>{const l="inputs"in a&&a.inputs[f];return l?Xe(d,l):!1})){if(i&&"inputs"in i&&i.inputs){const d=cn(a.inputs,i.inputs,n);if(d)throw new ar({abiItem:a,type:d[0]},{abiItem:i,type:d[1]})}i=a}}return i||o[0]}function Xe(e,t){const n=typeof e,r=t.type;switch(r){case"address":return X(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((s,o)=>Xe(Object.values(e)[o],s)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(s=>Xe(s,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function cn(e,t,n){for(const r in e){const s=e[r],o=t[r];if(s.type==="tuple"&&o.type==="tuple"&&"components"in s&&"components"in o)return cn(s.components,o.components,n[r]);const i=[s.type,o.type];if(i.includes("address")&&i.includes("bytes20")?!0:i.includes("address")&&i.includes("string")?X(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")?X(n[r],{strict:!1}):!1)return i}}const De="/docs/contract/decodeFunctionResult";function un(e){const{abi:t,args:n,functionName:r,data:s}=e;let o=t[0];if(r){const a=ut({abi:t,args:n,name:r});if(!a)throw new Ee(r,{docsPath:De});o=a}if(o.type!=="function")throw new Ee(void 0,{docsPath:De});if(!o.outputs)throw new or(o.name,{docsPath:De});const i=Zt(o.outputs,s);if(i&&i.length>1)return i;if(i&&i.length===1)return i[0]}const Dt="/docs/contract/encodeFunctionData";function Ms(e){const{abi:t,args:n,functionName:r}=e;let s=t[0];if(r){const o=ut({abi:t,args:n,name:r});if(!o)throw new Ee(r,{docsPath:Dt});s=o}if(s.type!=="function")throw new Ee(void 0,{docsPath:Dt});return{abi:[s],functionName:ct(ue(s))}}function dn(e){const{args:t}=e,{abi:n,functionName:r}=(()=>{var a;return e.abi.length===1&&((a=e.functionName)!=null&&a.startsWith("0x"))?e:Ms(e)})(),s=n[0],o=r,i="inputs"in s&&s.inputs?Ht(s.inputs,t??[]):void 0;return zt([o,i??"0x"])}function Rs({blockNumber:e,chain:t,contract:n}){var s;const r=(s=t==null?void 0:t.contracts)==null?void 0:s[n];if(!r)throw new _e({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new _e({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}const Ts={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},Fs={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},js={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function Ds(e){const{abi:t,data:n}=e,r=Ae(n,0,4);if(r==="0x")throw new st;const o=[...t||[],Fs,js].find(i=>i.type==="error"&&r===ct(ue(i)));if(!o)throw new Qt(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:o,args:"inputs"in o&&o.inputs&&o.inputs.length>0?Zt(o.inputs,Ae(n,4)):void 0,errorName:o.name}}function ln({abiItem:e,args:t,includeFunctionName:n=!0,includeName:r=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map((s,o)=>`${r&&s.name?`${s.name}: `:""}${typeof t[o]=="object"?_n(t[o]):t[o]}`).join(", ")})`}class ks extends b{constructor(t,{account:n,docsPath:r,chain:s,data:o,gas:i,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:d,nonce:f,to:l,value:y,stateOverride:h}){var v;const m=n?et(n):void 0;let x=Lt({from:m==null?void 0:m.address,to:l,value:typeof y<"u"&&`${Ln(y)} ${((v=s==null?void 0:s.nativeCurrency)==null?void 0:v.symbol)||"ETH"}`,data:o,gas:i,gasPrice:typeof a<"u"&&`${Te(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${Te(c)} gwei`,maxPriorityFeePerGas:typeof d<"u"&&`${Te(d)} gwei`,nonce:f});h&&(x+=`
${Ir(h)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",x].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class Bs extends b{constructor(t,{abi:n,args:r,contractAddress:s,docsPath:o,functionName:i,sender:a}){const c=ut({abi:n,args:r,name:i}),d=c?ln({abiItem:c,args:r,includeFunctionName:!1,includeName:!1}):void 0,f=c?ue(c,{includeName:!0}):void 0,l=Lt({address:s&&Nn(s),function:f,args:d&&d!=="()"&&`${[...Array((i==null?void 0:i.length)??0).keys()].map(()=>" ").join("")}${d}`,sender:a});super(t.shortMessage||`An unknown error occurred while executing the contract function "${i}".`,{cause:t,docsPath:o,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],l&&"Contract Call:",l].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=n,this.args=r,this.cause=t,this.contractAddress=s,this.functionName=i,this.sender=a}}class zs extends b{constructor({abi:t,data:n,functionName:r,message:s}){let o,i,a,c;if(n&&n!=="0x")try{i=Ds({abi:t,data:n});const{abiItem:f,errorName:l,args:y}=i;if(l==="Error")c=y[0];else if(l==="Panic"){const[h]=y;c=Ts[h]}else{const h=f?ue(f,{includeName:!0}):void 0,m=f&&y?ln({abiItem:f,args:y,includeFunctionName:!1,includeName:!1}):void 0;a=[h?`Error: ${h}`:"",m&&m!=="()"?`       ${[...Array((l==null?void 0:l.length)??0).keys()].map(()=>" ").join("")}${m}`:""]}}catch(f){o=f}else s&&(c=s);let d;o instanceof Qt&&(d=o.signature,a=[`Unable to decode signature "${d}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${d}.`]),super(c&&c!=="execution reverted"||d?[`The contract function "${r}" reverted with the following ${d?"signature":"reason"}:`,c||d].join(`
`):`The contract function "${r}" reverted.`,{cause:o,metaMessages:a,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=i,this.reason=c,this.signature=d}}class _s extends b{constructor({functionName:t}){super(`The contract function "${t}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",`  - The contract does not have the function "${t}",`,"  - The parameters passed to the contract function may be invalid, or","  - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class Ls extends b{constructor({factory:t}){super(`Deployment for counterfactual contract call failed${t?` for factory "${t}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class fn extends b{constructor({data:t,message:n}){super(n||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t}}const Ns=3;function Us(e,{abi:t,address:n,args:r,docsPath:s,functionName:o,sender:i}){const{code:a,data:c,message:d,shortMessage:f}=e instanceof fn?e:e instanceof b?e.walk(y=>"data"in y)||e.walk():{},l=e instanceof st?new _s({functionName:o}):[Ns,Un.code].includes(a)&&(c||d||f)?new zs({abi:t,data:typeof c=="object"?c.data:c,functionName:o,message:f??d}):e;return new Bs(l,{abi:t,args:r,contractAddress:n,docsPath:s,functionName:o,sender:i})}const Gs="0x82ad56cb",Qs="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",Hs="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe";function Ws(e,{docsPath:t,...n}){const r=(()=>{const s=vr(e,n);return s instanceof _t?e:s})();return new ks(r,{docsPath:t,...n})}async function Zs(e,t){var D,U,Ce,Oe;const{account:n=e.account,batch:r=!!((D=e.batch)!=null&&D.multicall),blockNumber:s,blockTag:o="latest",accessList:i,blobs:a,code:c,data:d,factory:f,factoryData:l,gas:y,gasPrice:h,maxFeePerBlobGas:m,maxFeePerGas:x,maxPriorityFeePerGas:v,nonce:R,to:E,value:j,stateOverride:N,...de}=t,ee=n?et(n):void 0;if(c&&(f||l))throw new b("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(c&&E)throw new b("Cannot provide both `code` & `to` as parameters.");const I=c&&d,te=f&&l&&E&&d,A=I||te,_=I?Js({code:c,data:d}):te?Ys({data:d,factory:f,factoryData:l,to:E}):d;try{Sr(t);const T=(s?$(s):void 0)||o,ne=Rr(N),le=(Oe=(Ce=(U=e.chain)==null?void 0:U.formatters)==null?void 0:Ce.transactionRequest)==null?void 0:Oe.format,G=(le||$r)({...xr(de,{format:le}),from:ee==null?void 0:ee.address,accessList:i,blobs:a,data:_,gas:y,gasPrice:h,maxFeePerBlobGas:m,maxFeePerGas:x,maxPriorityFeePerGas:v,nonce:R,to:A?void 0:E,value:j});if(r&&Vs({request:G})&&!ne)try{return await Ks(e,{...G,blockNumber:s,blockTag:o})}catch(Me){if(!(Me instanceof Nt)&&!(Me instanceof _e))throw Me}const dt=await e.request({method:"eth_call",params:ne?[G,T,ne]:[G,T]});return dt==="0x"?{data:void 0}:{data:dt}}catch(ge){const T=Xs(ge),{offchainLookup:ne,offchainLookupSignature:le}=await Gn(async()=>{const{offchainLookup:Ie,offchainLookupSignature:G}=await import("./BMWZoFoa.js");return{offchainLookup:Ie,offchainLookupSignature:G}},__vite__mapDeps([0,1,2]),import.meta.url);if(e.ccipRead!==!1&&(T==null?void 0:T.slice(0,10))===le&&E)return{data:await ne(e,{data:T,to:E})};throw A&&(T==null?void 0:T.slice(0,10))==="0x101bb98d"?new Ls({factory:f}):Ws(ge,{...t,account:ee,chain:e.chain})}}function Vs({request:e}){const{data:t,to:n,...r}=e;return!(!t||t.startsWith(Gs)||!n||Object.values(r).filter(s=>typeof s<"u").length>0)}async function Ks(e,t){var x;const{batchSize:n=1024,wait:r=0}=typeof((x=e.batch)==null?void 0:x.multicall)=="object"?e.batch.multicall:{},{blockNumber:s,blockTag:o="latest",data:i,multicallAddress:a,to:c}=t;let d=a;if(!d){if(!e.chain)throw new Nt;d=Rs({blockNumber:s,chain:e.chain,contract:"multicall3"})}const l=(s?$(s):void 0)||o,{schedule:y}=Qn({id:`${e.uid}.${l}`,wait:r,shouldSplitBatch(v){return v.reduce((E,{data:j})=>E+(j.length-2),0)>n*2},fn:async v=>{const R=v.map(N=>({allowFailure:!0,callData:N.data,target:N.to})),E=dn({abi:Tt,args:[R],functionName:"aggregate3"}),j=await e.request({method:"eth_call",params:[{data:E,to:d},l]});return un({abi:Tt,args:[R],functionName:"aggregate3",data:j||"0x"})}}),[{returnData:h,success:m}]=await y({data:i,to:c});if(!m)throw new fn({data:h});return h==="0x"?{data:void 0}:{data:h}}function Js(e){const{code:t,data:n}=e;return Wt({abi:on(["constructor(bytes, bytes)"]),bytecode:Qs,args:[t,n]})}function Ys(e){const{data:t,factory:n,factoryData:r,to:s}=e;return Wt({abi:on(["constructor(address, bytes, address, bytes)"]),bytecode:Hs,args:[s,t,n,r]})}function Xs(e){var n;if(!(e instanceof b))return;const t=e.walk();return typeof(t==null?void 0:t.data)=="object"?(n=t.data)==null?void 0:n.data:t.data}async function qs(e,t){const{abi:n,address:r,args:s,functionName:o,...i}=t,a=dn({abi:n,args:s,functionName:o});try{const{data:c}=await Er(e,Zs,"call")({...i,data:a,to:r});return un({abi:n,args:s,functionName:o,data:c||"0x"})}catch(c){throw Us(c,{abi:n,address:r,args:s,docsPath:"/docs/contract/readContract",functionName:o})}}function ei(e,t,n){const r=e[t.name];if(typeof r=="function")return r;const s=e[n];return typeof s=="function"?s:o=>t(e,o)}function ti(e,t){const{chainId:n,...r}=t,s=e.getClient({chainId:n});return ei(s,qs,"readContract")(r)}function qe(e,t){if(t){const n=t(e);if(n===void 0&&Ut(e)||n!==void 0)return n}if(Array.isArray(e))return e.map(n=>qe(n,t));if(typeof e=="object"&&ni(e)){const n=Object.entries(e).map(([r,s])=>[r,qe(s,t)]);return Object.fromEntries(n)}return e}function hn(e){return qe(e,t=>{if(Ut(t))return hn(Le(t))})}function ni(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function ri(e,t){return Hn(e,t)?e:Wn(e,t)}function si(e){return JSON.stringify(e,(t,n)=>ii(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):typeof n=="bigint"?n.toString():n)}function ii(e){if(!kt(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!kt(n)||!n.hasOwnProperty("isPrototypeOf"))}function kt(e){return Object.prototype.toString.call(e)==="[object Object]"}function oi(e){const{_defaulted:t,behavior:n,gcTime:r,initialData:s,initialDataUpdatedAt:o,maxPages:i,meta:a,networkMode:c,queryFn:d,queryHash:f,queryKey:l,queryKeyHashFn:y,retry:h,retryDelay:m,structuralSharing:x,getPreviousPageParam:v,getNextPageParam:R,initialPageParam:E,_optimisticResults:j,enabled:N,notifyOnChangeProps:de,placeholderData:ee,refetchInterval:I,refetchIntervalInBackground:te,refetchOnMount:A,refetchOnReconnect:_,refetchOnWindowFocus:D,retryOnMount:U,select:Ce,staleTime:Oe,suspense:ge,throwOnError:T,config:ne,connector:le,query:Ie,...G}=e;return G}function ai(e,t={}){return{async queryFn({queryKey:n}){const r=t.abi;if(!r)throw new Error("abi is required");const{functionName:s,scopeKey:o,...i}=n[1],a=(()=>{const c=n[1];if(c.address)return{address:c.address};if(c.code)return{code:c.code};throw new Error("address or code is required")})();if(!s)throw new Error("functionName is required");return ti(e,{abi:r,functionName:s,args:i.args,...a,...i})},queryKey:ci(t)}}function ci(e={}){const{abi:t,...n}=e;return["readContract",oi(n)]}function ui(e){const t=Pe(()=>({...Le(e),queryKeyHashFn:si})),n=qn(t);return n.queryKey=Le(t).queryKey,n}function fi(e={}){const t=Pe(()=>hn(e)),n=Zn(t),r=Vn({config:n}),s=Pe(()=>{const{abi:o,address:i,chainId:a=r.value,code:c,functionName:d,query:f={}}=t.value,l=ai(n,{...t.value,chainId:a}),y=!!((i||c)&&o&&d&&(f.enabled??!0));return{...f,...l,enabled:y,structuralSharing:f.structuralSharing??ri}});return ui(s)}const hi=[{type:"function",name:"approve",stateMutability:"payable",inputs:[{name:"_spender",type:"address"},{name:"value",type:"uint256"}],outputs:[]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]}];function pi(e,t=18){if(!e)return 0;const n=10n**BigInt(t),r=BigInt(e),s=r/n,o=r%n,i=`${s}.${o.toString().padStart(t,"0")}`;return parseFloat(i)}export{hi as a,Er as b,Sr as c,$r as d,xr as e,pi as f,vr as g,dn as h,Zs as i,un as j,Us as k,ei as l,oi as m,hn as n,ui as o,Ds as p,Ht as q,Rr as s,fi as u};
