From c01ff11864ff4feb5be705e095f93e43d7537d2d Mon Sep 17 00:00:00 2001 From: Matej Lubej Date: Wed, 20 Mar 2024 06:14:50 +0100 Subject: [PATCH] Deploy v7: Auto request accounts after switching network --- votee/assets/{index-BLUdc_Kq.js => index-C66UkuQS.js} | 4 ++-- votee/index.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename votee/assets/{index-BLUdc_Kq.js => index-C66UkuQS.js} (61%) diff --git a/votee/assets/index-BLUdc_Kq.js b/votee/assets/index-C66UkuQS.js similarity index 61% rename from votee/assets/index-BLUdc_Kq.js rename to votee/assets/index-C66UkuQS.js index b246510..5ffe3c3 100644 --- a/votee/assets/index-BLUdc_Kq.js +++ b/votee/assets/index-C66UkuQS.js @@ -65,9 +65,9 @@ Error generating stack: `+a.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function jw(){return jw=Object.assign?Object.assign.bind():function(t){for(var e=1;e{let r=t[n];return e.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function sK(t,e){let n=F5(t);return e&&e.forEach((r,i)=>{n.has(i)||e.getAll(i).forEach(a=>{n.append(i,a)})}),n}const lK="6";try{window.__reactRouterVersion=lK}catch{}function cK(t,e){return NQ({basename:e==null?void 0:e.basename,future:jw({},e==null?void 0:e.future,{v7_prependBasename:!0}),history:eQ({window:e==null?void 0:e.window}),hydrationData:(e==null?void 0:e.hydrationData)||uK(),routes:t,mapRouteProperties:oK,window:e==null?void 0:e.window}).initialize()}function uK(){var t;let e=(t=window)==null?void 0:t.__staticRouterHydrationData;return e&&e.errors&&(e=jw({},e,{errors:fK(e.errors)})),e}function fK(t){if(!t)return null;let e=Object.entries(t),n={};for(let[r,i]of e)if(i&&i.__type==="RouteErrorResponse")n[r]=new wP(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let a=window[i.__subType];if(typeof a=="function")try{let o=new a(i.message);o.stack="",n[r]=o}catch{}}if(n[r]==null){let a=new Error(i.message);a.stack="",n[r]=a}}else n[r]=i;return n}const hK=F.createContext({isTransitioning:!1}),dK=F.createContext(new Map),pK="startTransition",uC=zH[pK],gK="flushSync",fC=qV[gK];function yK(t){uC?uC(t):t()}function Mg(t){fC?fC(t):t()}class mK{constructor(){this.status="pending",this.promise=new Promise((e,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function vK(t){let{fallbackElement:e,router:n,future:r}=t,[i,a]=F.useState(n.state),[o,s]=F.useState(),[l,c]=F.useState({isTransitioning:!1}),[u,f]=F.useState(),[h,d]=F.useState(),[g,p]=F.useState(),m=F.useRef(new Map),{v7_startTransition:y}=r||{},v=F.useCallback(T=>{y?yK(T):T()},[y]),x=F.useCallback((T,C)=>{let{deletedFetchers:N,unstable_flushSync:B,unstable_viewTransitionOpts:L}=C;N.forEach(j=>m.current.delete(j)),T.fetchers.forEach((j,Z)=>{j.data!==void 0&&m.current.set(Z,j.data)});let U=n.window==null||typeof n.window.document.startViewTransition!="function";if(!L||U){B?Mg(()=>a(T)):v(()=>a(T));return}if(B){Mg(()=>{h&&(u&&u.resolve(),h.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:L.currentLocation,nextLocation:L.nextLocation})});let j=n.window.document.startViewTransition(()=>{Mg(()=>a(T))});j.finished.finally(()=>{Mg(()=>{f(void 0),d(void 0),s(void 0),c({isTransitioning:!1})})}),Mg(()=>d(j));return}h?(u&&u.resolve(),h.skipTransition(),p({state:T,currentLocation:L.currentLocation,nextLocation:L.nextLocation})):(s(T),c({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}))},[n.window,h,u,m,v]);F.useLayoutEffect(()=>n.subscribe(x),[n,x]),F.useEffect(()=>{l.isTransitioning&&!l.flushSync&&f(new mK)},[l]),F.useEffect(()=>{if(u&&o&&n.window){let T=o,C=u.promise,N=n.window.document.startViewTransition(async()=>{v(()=>a(T)),await C});N.finished.finally(()=>{f(void 0),d(void 0),s(void 0),c({isTransitioning:!1})}),d(N)}},[v,o,u,n.window]),F.useEffect(()=>{u&&o&&i.location.key===o.location.key&&u.resolve()},[u,h,i.location,o]),F.useEffect(()=>{!l.isTransitioning&&g&&(s(g.state),c({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),p(void 0))},[l.isTransitioning,g]),F.useEffect(()=>{},[]);let A=F.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:T=>n.navigate(T),push:(T,C,N)=>n.navigate(T,{state:C,preventScrollReset:N==null?void 0:N.preventScrollReset}),replace:(T,C,N)=>n.navigate(T,{replace:!0,state:C,preventScrollReset:N==null?void 0:N.preventScrollReset})}),[n]),S=n.basename||"/",E=F.useMemo(()=>({router:n,navigator:A,static:!1,basename:S}),[n,A,S]);return F.createElement(F.Fragment,null,F.createElement(M2.Provider,{value:E},F.createElement(V7.Provider,{value:i},F.createElement(dK.Provider,{value:m.current},F.createElement(hK.Provider,{value:l},F.createElement(aK,{basename:S,location:i.location,navigationType:i.historyAction,navigator:A,future:{v7_relativeSplatPath:n.future.v7_relativeSplatPath}},i.initialized||n.future.v7_partialHydration?F.createElement(bK,{routes:n.routes,future:n.future,state:i}):e))))),null)}function bK(t){let{routes:e,future:n,state:r}=t;return KQ(e,void 0,r,n)}var hC;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(hC||(hC={}));var dC;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(dC||(dC={}));function wK(t){let e=F.useRef(F5(t)),n=F.useRef(!1),r=D2(),i=F.useMemo(()=>sK(r.search,n.current?null:e.current),[r.search]),a=W7(),o=F.useCallback((s,l)=>{const c=F5(typeof s=="function"?s(i):s);n.current=!0,a("?"+c,l)},[a,i]);return[i,o]}const xK="_header_1d5it_1",AK="_subHeader_1d5it_13",EK="_inViewPlaceholder_1d5it_20",SK="_headerSticky_1d5it_33",PK="_logo_1d5it_42",Bg={header:xK,subHeader:AK,inViewPlaceholder:EK,headerSticky:SK,logo:PK},q7=F.createContext({}),ig=()=>{const t=F.useContext(q7);if(Object.keys(t).length===0)throw new Error("[useAppState] Component not wrapped within a Provider");return t},OK={large:{width:153,height:50},small:{width:55,height:18}},TK=({className:t})=>{const{state:{isDesktopScreen:e}}=ig(),n=OK[e?"large":"small"];return J.jsxs("svg",{className:t,width:n.width,height:n.height,viewBox:"0 0 153 50",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[J.jsx("path",{d:"M65.882 36L59.031 20.5H63.712L67.804 30.42L71.896 20.5H76.639L69.757 36H65.882ZM90.2073 34.016C88.616 35.566 86.694 36.341 84.4413 36.341C82.1886 36.341 80.2666 35.566 78.6753 34.016C77.084 32.4453 76.2883 30.5233 76.2883 28.25C76.2883 25.9973 77.084 24.0857 78.6753 22.515C80.2666 20.9443 82.1886 20.159 84.4413 20.159C86.694 20.159 88.616 20.9443 90.2073 22.515C91.7986 24.0857 92.5943 25.9973 92.5943 28.25C92.5943 30.5233 91.7986 32.4453 90.2073 34.016ZM84.4413 32.373C85.5366 32.373 86.446 31.9907 87.1693 31.226C87.9133 30.4407 88.2853 29.4487 88.2853 28.25C88.2853 27.0513 87.9133 26.0697 87.1693 25.305C86.446 24.5197 85.5366 24.127 84.4413 24.127C83.3253 24.127 82.3953 24.5197 81.6513 25.305C80.928 26.0697 80.5663 27.0513 80.5663 28.25C80.5663 29.4487 80.928 30.4407 81.6513 31.226C82.3953 31.9907 83.3253 32.373 84.4413 32.373ZM96.3453 36V18.268H90.4863V13.99H106.792V18.268H100.871V36H96.3453ZM108.973 36V13.99H122.675V18.268H113.468V22.794H120.815V27.072H113.468V31.722H122.675V36H108.973ZM125.663 36V13.99H139.365V18.268H130.158V22.794H137.505V27.072H130.158V31.722H139.365V36H125.663Z",fill:"white"}),J.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M40.438 11.9201C37.0276 7.57101 32.0669 4.81953 26.5305 4.81953C15.8563 4.81953 8.06102 14.7604 8.06102 25.5444C8.06102 33.0444 13.0217 38.6805 18.5581 38.6805C19.0896 38.6805 19.5768 38.6361 20.1083 38.5473C16.3878 35.7959 13.9961 30.8254 13.9961 25.5C13.9961 16.9793 19.7539 10.3669 26.5305 10.3669C33.9272 10.3669 39.065 17.7337 39.065 25.5C39.065 31.2692 36.9833 36.9941 33.3957 41.2101C30.251 44.8935 26.1762 47.2456 21.7028 47.9556C21.7028 47.9556 22.0571 48 22.5443 48C34.9459 48 45 37.926 45 25.5C45 20.3965 43.3169 15.6923 40.438 11.9201ZM37.0276 25.5C37.0276 18 32.0669 12.3639 26.5305 12.3639C25.999 12.3639 25.5118 12.4083 24.9803 12.497C28.7008 15.2041 31.0482 20.1302 31.0482 25.5C31.0482 34.0207 25.2904 40.6331 18.5138 40.6331C11.1171 40.6331 5.97933 33.2663 5.97933 25.5C5.97933 19.7308 8.06102 14.0059 11.6486 9.78994C14.7933 6.10651 18.8681 3.75444 23.3415 3.04438C23.3415 3.04438 22.9872 3 22.4557 3C10.0541 3 0 13.074 0 25.5C0 30.6035 1.68307 35.3077 4.56201 39.0799C7.97244 43.429 12.9774 46.1805 18.4695 46.1805C29.2323 46.2249 37.0276 36.284 37.0276 25.5Z",fill:"white"})]})},eD=F.createContext({}),iv=()=>{const t=F.useContext(eD);if(Object.keys(t).length===0)throw new Error("[useWeb3] Component not wrapped within a Provider");return t};var CK={VITE_NETWORK:"23295",VITE_WEB3_GATEWAY:"https://testnet.sapphire.oasis.dev",VITE_PROPOSAL_START_TIME:"1710865800",VITE_CONTRACT_ACL_ALLOWALL:"0x8e29375FE5Db7eBb1b5eF24B7D397bBF0B01De09",VITE_CONTRACT_ACL_NATIVEBALANCE:"0x38FF18441b182ac603aADCA8ADDb257c6F5d103d",VITE_CONTRACT_POLLMANAGER:"0xdAB5845136b3102E63023BB2A2405cb71608605d",VITE_CONTRACT_POLLMANAGER_ACL:"0x8e29375FE5Db7eBb1b5eF24B7D397bBF0B01De09",VITE_PROPOSAL_ID:"0xb7799d0f7a33320ccf32803ce11d4df22f5772aa1ec81aaab6d4abe26fa50e9b",BASE_URL:"/votee",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const zw=new Map([[23294n,{chainId:"0x5afe",chainName:"Oasis Sapphire",iconUrls:["https://votee.oasis.io/rose.png"],nativeCurrency:{name:"ROSE",symbol:"ROSE",decimals:18},rpcUrls:["https://sapphire.oasis.io/","wss://sapphire.oasis.io/ws"],blockExplorerUrls:["https://explorer.oasis.io/mainnet/sapphire"]}],[23295n,{chainId:"0x5aff",chainName:"Oasis Sapphire Testnet",iconUrls:["https://votee.oasis.io/rose.png"],nativeCurrency:{name:"TEST",symbol:"TEST",decimals:18},rpcUrls:["https://testnet.sapphire.oasis.dev/","wss://testnet.sapphire.oasis.dev/ws"],blockExplorerUrls:["https://explorer.oasis.io/testnet/sapphire"]}]]),kK={"Oasis Sapphire":"Sapphire","Oasis Sapphire Testnet":"Sapphire Testnet"},_K=150000n,tD=Object.freeze([{name:"Capybara",description:"A friendly capybara with a rose in its hand, symbolizing the interoperability pioneered by the Oasis Network.",imagePath:"https://fakeimg.pl/182x182"},{name:"Desert Owl",description:"A wise owl with scrolls in its claws, symbolizing the knowledge pioneered by the Oasis Network.",imagePath:"https://fakeimg.pl/182x182"},{name:"Fennec Fox",description:"A nimble fox with sunglasses on its eyes, symbolizing the privacy pioneered by the Oasis Network.",imagePath:"https://fakeimg.pl/182x182"}]),NK="https://metamask.io/",IK="https://oasisprotocol.org/oasis-mascot-voting",{VITE_NETWORK:RK,VITE_PROPOSAL_START_TIME:MK,VITE_WEB3_GATEWAY:pC,VITE_CONTRACT_ACL_ALLOWALL:FPe,VITE_CONTRACT_ACL_NATIVEBALANCE:jPe,VITE_CONTRACT_POLLMANAGER:_6,VITE_CONTRACT_POLLMANAGER_ACL:zPe,VITE_PROPOSAL_ID:Fv}=CK,Hw=BigInt(RK)??0n,N6=Number(MK)??0,BK="_button_1wfen_1",DK="_buttonDisabled_1wfen_26",LK="_buttonSmall_1wfen_31",$K="_buttonMedium_1wfen_39",UK="_buttonSolid_1wfen_47",FK="_buttonPrimary_1wfen_48",jK="_buttonSecondary_1wfen_53",zK="_buttonSuccess_1wfen_58",HK="_buttonOutline_1wfen_65",GK="_buttonText_1wfen_85",VK="_fullWidth_1wfen_107",So={button:BK,buttonDisabled:DK,buttonSmall:LK,buttonMedium:$K,buttonSolid:UK,buttonPrimary:FK,buttonSecondary:jK,buttonSuccess:zK,buttonOutline:HK,buttonText:GK,fullWidth:VK},QK=/^(0x[a-zA-Z0-9]{4})[a-zA-Z0-9]+([a-zA-Z0-9]{4})$/;class Jn{}R(Jn,"truncateAddress",e=>{const n=e.match(QK);if(!n||(n==null?void 0:n.length)<=0)return e;const[,r,i]=n;return`${r}…${i}`}),R(Jn,"getTransactionUrl",(e,n)=>`${e}/tx/${n}`),R(Jn,"getAccountUrl",(e,n)=>`${e}/address/${n}`),R(Jn,"clsx",(...e)=>e.map(n=>n?[n]:[]).flat().join(" ")),R(Jn,"getNetworkFriendlyName",e=>kK[e]??"Unknown network"),R(Jn,"truncate",(e,n=200)=>e.slice(0,n));const KK={small:So.buttonSmall,medium:So.buttonMedium},WK={primary:So.buttonPrimary,secondary:So.buttonSecondary,success:So.buttonSuccess},JK={solid:So.buttonSolid,outline:So.buttonOutline,text:So.buttonText},nl=({className:t,children:e,disabled:n,color:r="primary",size:i="medium",variant:a="solid",fullWidth:o,onClick:s,type:l})=>J.jsx("button",{className:Jn.clsx(t,So.button,n?So.buttonDisabled:void 0,o?So.fullWidth:void 0,WK[r],KK[i],JK[a]),onClick:s,disabled:n,type:l,children:e});class j5 extends Error{constructor(e){super(e)}}var Nl=function(t){t==null&&(t=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,t.constructor==Array?this.init_by_array(t,t.length):this.init_seed(t)};Nl.prototype.init_seed=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(((t&4294901760)>>>16)*1812433253<<16)+(t&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};Nl.prototype.init_by_array=function(t,e){var n,r,i;for(this.init_seed(19650218),n=1,r=0,i=this.N>e?this.N:e;i;i--){var a=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((a&4294901760)>>>16)*1664525<<16)+(a&65535)*1664525)+t[r]+r,this.mt[n]>>>=0,n++,r++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),r>=e&&(r=0)}for(i=this.N-1;i;i--){var a=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((a&4294901760)>>>16)*1566083941<<16)+(a&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};Nl.prototype.random_int=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n>>1^e[t&1];for(;n>>1^e[t&1];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[t&1],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0};Nl.prototype.random_int31=function(){return this.random_int()>>>1};Nl.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};Nl.prototype.random=function(){return this.random_int()*(1/4294967296)};Nl.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};Nl.prototype.random_long=function(){var t=this.random_int()>>>5,e=this.random_int()>>>6;return(t*67108864+e)*(1/9007199254740992)};var YK=Nl;function XK(t,e){var n=document.createElement("div");return n.style.borderRadius="50px",n.style.overflow="hidden",n.style.padding="0px",n.style.margin="0px",n.style.width=""+t+"px",n.style.height=""+t+"px",n.style.display="inline-block",n.style.background=e,{container:n}}var ZK=XK,nD={exports:{}};(function(t){var e=function(){function n(l,c,u,f){typeof c=="object"&&(u=c.depth,f=c.prototype,c.filter,c=c.circular);var h=[],d=[],g=typeof Buffer<"u";typeof c>"u"&&(c=!0),typeof u>"u"&&(u=1/0);function p(m,y){if(m===null)return null;if(y==0)return m;var v,x;if(typeof m!="object")return m;if(n.__isArray(m))v=[];else if(n.__isRegExp(m))v=new RegExp(m.source,s(m)),m.lastIndex&&(v.lastIndex=m.lastIndex);else if(n.__isDate(m))v=new Date(m.getTime());else{if(g&&Buffer.isBuffer(m))return Buffer.allocUnsafe?v=Buffer.allocUnsafe(m.length):v=new Buffer(m.length),m.copy(v),v;typeof f>"u"?(x=Object.getPrototypeOf(m),v=Object.create(x)):(v=Object.create(f),x=f)}if(c){var A=h.indexOf(m);if(A!=-1)return d[A];h.push(m),d.push(v)}for(var S in m){var E;x&&(E=Object.getOwnPropertyDescriptor(x,S)),!(E&&E.set==null)&&(v[S]=p(m[S],y-1))}return v}return p(l,u)}n.clonePrototype=function(c){if(c===null)return null;var u=function(){};return u.prototype=c,new u};function r(l){return Object.prototype.toString.call(l)}n.__objToStr=r;function i(l){return typeof l=="object"&&r(l)==="[object Date]"}n.__isDate=i;function a(l){return typeof l=="object"&&r(l)==="[object Array]"}n.__isArray=a;function o(l){return typeof l=="object"&&r(l)==="[object RegExp]"}n.__isRegExp=o;function s(l){var c="";return l.global&&(c+="g"),l.ignoreCase&&(c+="i"),l.multiline&&(c+="m"),c}return n.__getRegExpFlags=s,n}();t.exports&&(t.exports=e)})(nD);var qK=nD.exports,rD={exports:{}},eW={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Uf=eW,iD={};for(var I6 in Uf)Uf.hasOwnProperty(I6)&&(iD[Uf[I6]]=I6);var qe=rD.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var vi in qe)if(qe.hasOwnProperty(vi)){if(!("channels"in qe[vi]))throw new Error("missing channels property: "+vi);if(!("labels"in qe[vi]))throw new Error("missing channel labels property: "+vi);if(qe[vi].labels.length!==qe[vi].channels)throw new Error("channel and label counts mismatch: "+vi);var tW=qe[vi].channels,nW=qe[vi].labels;delete qe[vi].channels,delete qe[vi].labels,Object.defineProperty(qe[vi],"channels",{value:tW}),Object.defineProperty(qe[vi],"labels",{value:nW})}qe.rgb.hsl=function(t){var e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=a-i,s,l,c;return a===i?s=0:e===a?s=(n-r)/o:n===a?s=2+(r-e)/o:r===a&&(s=4+(e-n)/o),s=Math.min(s*60,360),s<0&&(s+=360),c=(i+a)/2,a===i?l=0:c<=.5?l=o/(a+i):l=o/(2-a-i),[s,l*100,c*100]};qe.rgb.hsv=function(t){var e,n,r,i,a,o=t[0]/255,s=t[1]/255,l=t[2]/255,c=Math.max(o,s,l),u=c-Math.min(o,s,l),f=function(h){return(c-h)/6/u+1/2};return u===0?i=a=0:(a=u/c,e=f(o),n=f(s),r=f(l),o===c?i=r-n:s===c?i=1/3+e-r:l===c&&(i=2/3+n-e),i<0?i+=1:i>1&&(i-=1)),[i*360,a*100,c*100]};qe.rgb.hwb=function(t){var e=t[0],n=t[1],r=t[2],i=qe.rgb.hsl(t)[0],a=1/255*Math.min(e,Math.min(n,r));return r=1-1/255*Math.max(e,Math.max(n,r)),[i,a*100,r*100]};qe.rgb.cmyk=function(t){var e=t[0]/255,n=t[1]/255,r=t[2]/255,i,a,o,s;return s=Math.min(1-e,1-n,1-r),i=(1-e-s)/(1-s)||0,a=(1-n-s)/(1-s)||0,o=(1-r-s)/(1-s)||0,[i*100,a*100,o*100,s*100]};function rW(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2)}qe.rgb.keyword=function(t){var e=iD[t];if(e)return e;var n=1/0,r;for(var i in Uf)if(Uf.hasOwnProperty(i)){var a=Uf[i],o=rW(t,a);o.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92;var i=e*.4124+n*.3576+r*.1805,a=e*.2126+n*.7152+r*.0722,o=e*.0193+n*.1192+r*.9505;return[i*100,a*100,o*100]};qe.rgb.lab=function(t){var e=qe.rgb.xyz(t),n=e[0],r=e[1],i=e[2],a,o,s;return n/=95.047,r/=100,i/=108.883,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,a=116*r-16,o=500*(n-r),s=200*(r-i),[a,o,s]};qe.hsl.rgb=function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100,i,a,o,s,l;if(n===0)return l=r*255,[l,l,l];r<.5?a=r*(1+n):a=r+n-r*n,i=2*r-a,s=[0,0,0];for(var c=0;c<3;c++)o=e+1/3*-(c-1),o<0&&o++,o>1&&o--,6*o<1?l=i+(a-i)*6*o:2*o<1?l=a:3*o<2?l=i+(a-i)*(2/3-o)*6:l=i,s[c]=l*255;return s};qe.hsl.hsv=function(t){var e=t[0],n=t[1]/100,r=t[2]/100,i=n,a=Math.max(r,.01),o,s;return r*=2,n*=r<=1?r:2-r,i*=a<=1?a:2-a,s=(r+n)/2,o=r===0?2*i/(a+i):2*n/(r+n),[e,o*100,s*100]};qe.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,r=t[2]/100,i=Math.floor(e)%6,a=e-Math.floor(e),o=255*r*(1-n),s=255*r*(1-n*a),l=255*r*(1-n*(1-a));switch(r*=255,i){case 0:return[r,l,o];case 1:return[s,r,o];case 2:return[o,r,l];case 3:return[o,s,r];case 4:return[l,o,r];case 5:return[r,o,s]}};qe.hsv.hsl=function(t){var e=t[0],n=t[1]/100,r=t[2]/100,i=Math.max(r,.01),a,o,s;return s=(2-n)*r,a=(2-n)*i,o=n*i,o/=a<=1?a:2-a,o=o||0,s/=2,[e,o*100,s*100]};qe.hwb.rgb=function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100,i=n+r,a,o,s,l;i>1&&(n/=i,r/=i),a=Math.floor(6*e),o=1-r,s=6*e-a,a&1&&(s=1-s),l=n+s*(o-n);var c,u,f;switch(a){default:case 6:case 0:c=o,u=l,f=n;break;case 1:c=l,u=o,f=n;break;case 2:c=n,u=o,f=l;break;case 3:c=n,u=l,f=o;break;case 4:c=l,u=n,f=o;break;case 5:c=o,u=n,f=l;break}return[c*255,u*255,f*255]};qe.cmyk.rgb=function(t){var e=t[0]/100,n=t[1]/100,r=t[2]/100,i=t[3]/100,a,o,s;return a=1-Math.min(1,e*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),s=1-Math.min(1,r*(1-i)+i),[a*255,o*255,s*255]};qe.xyz.rgb=function(t){var e=t[0]/100,n=t[1]/100,r=t[2]/100,i,a,o;return i=e*3.2406+n*-1.5372+r*-.4986,a=e*-.9689+n*1.8758+r*.0415,o=e*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[i*255,a*255,o*255]};qe.xyz.lab=function(t){var e=t[0],n=t[1],r=t[2],i,a,o;return e/=95.047,n/=100,r/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,i=116*n-16,a=500*(e-n),o=200*(n-r),[i,a,o]};qe.lab.xyz=function(t){var e=t[0],n=t[1],r=t[2],i,a,o;a=(e+16)/116,i=n/500+a,o=a-r/200;var s=Math.pow(a,3),l=Math.pow(i,3),c=Math.pow(o,3);return a=s>.008856?s:(a-16/116)/7.787,i=l>.008856?l:(i-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,i*=95.047,a*=100,o*=108.883,[i,a,o]};qe.lab.lch=function(t){var e=t[0],n=t[1],r=t[2],i,a,o;return i=Math.atan2(r,n),a=i*360/2/Math.PI,a<0&&(a+=360),o=Math.sqrt(n*n+r*r),[e,o,a]};qe.lch.lab=function(t){var e=t[0],n=t[1],r=t[2],i,a,o;return o=r/360*2*Math.PI,i=n*Math.cos(o),a=n*Math.sin(o),[e,i,a]};qe.rgb.ansi16=function(t){var e=t[0],n=t[1],r=t[2],i=1 in arguments?arguments[1]:qe.rgb.hsv(t)[2];if(i=Math.round(i/50),i===0)return 30;var a=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return i===2&&(a+=60),a};qe.hsv.ansi16=function(t){return qe.rgb.ansi16(qe.hsv.rgb(t),t[2])};qe.rgb.ansi256=function(t){var e=t[0],n=t[1],r=t[2];if(e===n&&n===r)return e<8?16:e>248?231:Math.round((e-8)/247*24)+232;var i=16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5);return i};qe.ansi16.rgb=function(t){var e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];var n=(~~(t>50)+1)*.5,r=(e&1)*n*255,i=(e>>1&1)*n*255,a=(e>>2&1)*n*255;return[r,i,a]};qe.ansi256.rgb=function(t){if(t>=232){var e=(t-232)*10+8;return[e,e,e]}t-=16;var n,r=Math.floor(t/36)/5*255,i=Math.floor((n=t%36)/6)/5*255,a=n%6/5*255;return[r,i,a]};qe.rgb.hex=function(t){var e=((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255),n=e.toString(16).toUpperCase();return"000000".substring(n.length)+n};qe.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var n=e[0];e[0].length===3&&(n=n.split("").map(function(s){return s+s}).join(""));var r=parseInt(n,16),i=r>>16&255,a=r>>8&255,o=r&255;return[i,a,o]};qe.rgb.hcg=function(t){var e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.max(Math.max(e,n),r),a=Math.min(Math.min(e,n),r),o=i-a,s,l;return o<1?s=a/(1-o):s=0,o<=0?l=0:i===e?l=(n-r)/o%6:i===n?l=2+(r-e)/o:l=4+(e-n)/o+4,l/=6,l%=1,[l*360,o*100,s*100]};qe.hsl.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=1,i=0;return n<.5?r=2*e*n:r=2*e*(1-n),r<1&&(i=(n-.5*r)/(1-r)),[t[0],r*100,i*100]};qe.hsv.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=e*n,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],r*100,i*100]};qe.hcg.rgb=function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100;if(n===0)return[r*255,r*255,r*255];var i=[0,0,0],a=e%1*6,o=a%1,s=1-o,l=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return l=(1-n)*r,[(n*i[0]+l)*255,(n*i[1]+l)*255,(n*i[2]+l)*255]};qe.hcg.hsv=function(t){var e=t[1]/100,n=t[2]/100,r=e+n*(1-e),i=0;return r>0&&(i=e/r),[t[0],i*100,r*100]};qe.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100,r=n*(1-e)+.5*e,i=0;return r>0&&r<.5?i=e/(2*r):r>=.5&&r<1&&(i=e/(2*(1-r))),[t[0],i*100,r*100]};qe.hcg.hwb=function(t){var e=t[1]/100,n=t[2]/100,r=e+n*(1-e);return[t[0],(r-e)*100,(1-r)*100]};qe.hwb.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=1-n,i=r-e,a=0;return i<1&&(a=(r-i)/(1-i)),[t[0],i*100,a*100]};qe.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};qe.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};qe.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};qe.gray.hsl=qe.gray.hsv=function(t){return[0,0,t[0]]};qe.gray.hwb=function(t){return[0,100,t[0]]};qe.gray.cmyk=function(t){return[0,0,0,t[0]]};qe.gray.lab=function(t){return[t[0],0,0]};qe.gray.hex=function(t){var e=Math.round(t[0]/100*255)&255,n=(e<<16)+(e<<8)+e,r=n.toString(16).toUpperCase();return"000000".substring(r.length)+r};qe.rgb.gray=function(t){var e=(t[0]+t[1]+t[2])/3;return[e/255*100]};var aD=rD.exports,Gw=aD;function iW(){for(var t={},e=Object.keys(Gw),n=e.length,r=0;r1&&(n=Array.prototype.slice.call(arguments)),t(n))};return"conversion"in t&&(e.conversion=t.conversion),e}function hW(t){var e=function(n){if(n==null)return n;arguments.length>1&&(n=Array.prototype.slice.call(arguments));var r=t(n);if(typeof r=="object")for(var i=r.length,a=0;an?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb,e=(t[0]*299+t[1]*587+t[2]*114)/1e3;return e<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){return this.values.hsl[2]+=this.values.hsl[2]*t,this.setValues("hsl",this.values.hsl),this},darken:function(t){return this.values.hsl[2]-=this.values.hsl[2]*t,this.setValues("hsl",this.values.hsl),this},saturate:function(t){return this.values.hsl[1]+=this.values.hsl[1]*t,this.setValues("hsl",this.values.hsl),this},desaturate:function(t){return this.values.hsl[1]-=this.values.hsl[1]*t,this.setValues("hsl",this.values.hsl),this},whiten:function(t){return this.values.hwb[1]+=this.values.hwb[1]*t,this.setValues("hwb",this.values.hwb),this},blacken:function(t){return this.values.hwb[2]+=this.values.hwb[2]*t,this.setValues("hwb",this.values.hwb),this},greyscale:function(){var t=this.values.rgb,e=t[0]*.3+t[1]*.59+t[2]*.11;return this.setValues("rgb",[e,e,e]),this},clearer:function(t){return this.setValues("alpha",this.values.alpha-this.values.alpha*t),this},opaquer:function(t){return this.setValues("alpha",this.values.alpha+this.values.alpha*t),this},rotate:function(t){var e=this.values.hsl[0];return e=(e+t)%360,e=e<0?360+e:e,this.values.hsl[0]=e,this.setValues("hsl",this.values.hsl),this},mix:function(t,e){var n=this,r=t,i=e===void 0?.5:e,a=2*i-1,o=n.alpha()-r.alpha(),s=((a*o===-1?a:(a+o)/(1+a*o))+1)/2,l=1-s;return this.rgb(s*n.red()+l*r.red(),s*n.green()+l*r.green(),s*n.blue()+l*r.blue()).alpha(n.alpha()*i+r.alpha()*(1-i))},toJSON:function(){return this.rgb()},clone:function(){var t=new os;return t.values=PW(this.values),t}};os.prototype.getValues=function(t){for(var e={},n=0;n=0&&e<=2}}const jW=({address:t,size:e})=>{const n=F.useRef(null);return F.useEffect(()=>{var r;if(n!=null&&n.current){const i=Cs.jsNumberForAddress(t),a=$W(e,i);(r=n.current)==null||r.replaceChildren(a)}},[e,n,t]),J.jsx("div",{ref:n,style:{width:e,height:e},className:FW.jazzIcon})},zW=F.memo(jW),HW="_connectedAccount_1shrx_1",GW="_connectedAccountDetails_1shrx_14",VW="_connectedAccountAddress_1shrx_25",QW="_network_1shrx_36",jv={connectedAccount:HW,connectedAccountDetails:GW,connectedAccountAddress:VW,network:QW},KW=({className:t,address:e,chainName:n})=>{const{state:{explorerBaseUrl:r}}=iv(),{state:{isDesktopScreen:i}}=ig(),a=r?Jn.getAccountUrl(r,e):void 0,o=Jn.getNetworkFriendlyName(n);return J.jsxs("a",{href:a,className:Jn.clsx(t,jv.connectedAccount),target:"_blank",rel:"nofollow noreferrer",children:[J.jsx(zW,{size:i?30:20,address:e}),i&&J.jsxs("p",{className:jv.connectedAccountDetails,children:[J.jsx("span",{className:jv.network,children:o}),J.jsx("abbr",{title:e,className:jv.connectedAccountAddress,children:Jn.truncateAddress(e)})]})]})},WW="_connectWalletBtn_10gns_1",JW="_connectWalletBtnLabel_10gns_16",YW="_stickyConnectedAccount_10gns_20",Dg={connectWalletBtn:WW,connectWalletBtnLabel:JW,stickyConnectedAccount:YW},XW=t=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},F.createElement("path",{d:"M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"})),mC={small:{width:14,height:14},medium:{width:30,height:30},large:{width:64,height:64},xlarge:{width:100,height:100}},ag=({children:t,size:e="medium",width:n,height:r})=>F.cloneElement(t,{...mC[e]?mC[e]:{},...n?{width:n}:{},...r?{height:r}:{}}),dD=t=>J.jsx(ag,{...t,children:J.jsx(XW,{})}),ZW=({mobileSticky:t})=>{const{state:{isDesktopScreen:e},setAppError:n}=ig(),[r,i]=F.useState(!1),[a,o]=F.useState(!0),[s,l]=F.useState(!1),{state:{isConnected:c,account:u,chainName:f},connectWallet:h,switchNetwork:d,isProviderAvailable:g}=iv();F.useEffect(()=>{(async()=>{i(!0),o(await g()),i(!1)})()},[]);const p=async()=>{i(!0);try{await d(),l(!1)}catch(y){n(y)}finally{i(!1)}},m=async()=>{i(!0);try{await h()}catch(y){y instanceof j5?l(!0):n(y)}finally{i(!1)}};return J.jsxs(J.Fragment,{children:[!c&&!a&&J.jsx("a",{href:NK,target:"_blank",rel:"noopener noreferrer",children:J.jsx(nl,{className:Dg.connectWalletBtn,color:t?"primary":"secondary",disabled:r,children:"Install MetaMask"})}),!c&&a&&s&&J.jsx(nl,{className:Dg.connectWalletBtn,color:t?"primary":"secondary",disabled:r,onClick:p,children:"Switch Network"}),!c&&a&&!s&&J.jsx(nl,{className:Dg.connectWalletBtn,color:t?"primary":"secondary",disabled:r,onClick:m,children:J.jsxs("label",{className:Dg.connectWalletBtnLabel,children:["Connect wallet",J.jsx(dD,{size:e?"medium":"small"})]})}),c&&u&&J.jsx(KW,{className:t?Dg.stickyConnectedAccount:void 0,address:u,chainName:f})]})},qW="_alert_17r1y_1",eJ="_icon_17r1y_20",tJ="_actions_17r1y_25",nJ="_alertError_17r1y_40",rJ="_alertSuccess_17r1y_46",iJ="_alertLoading_17r1y_61",aJ="_rotating_17r1y_1",oJ="_alertInsufficientBalance_17r1y_78",Bu={alert:qW,icon:eJ,actions:tJ,alertError:nJ,alertSuccess:rJ,alertLoading:iJ,rotating:aJ,alertInsufficientBalance:oJ},sJ="_card_12zm2_1",lJ={card:sJ},SP=({children:t,className:e})=>J.jsx("div",{className:Jn.clsx(lJ.card,e),children:t}),cJ=t=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},F.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-8,56a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z"})),uJ=({width:t=124,height:e=124,size:n})=>J.jsx(ag,{width:t,height:e,size:n,children:J.jsx(cJ,{})}),fJ=t=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},F.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"})),pD=t=>J.jsx(ag,{...t,children:J.jsx(fJ,{})}),hJ=t=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},F.createElement("path",{d:"M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm37.25,58.75a8,8,0,0,0,5.66-2.35l22.63-22.62a8,8,0,0,0-11.32-11.32L167.6,77.09a8,8,0,0,0,5.65,13.66ZM224,120H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z"})),dJ=({size:t="large",...e})=>J.jsx(ag,{size:t,...e,children:J.jsx(hJ,{})}),pJ=t=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},F.createElement("path",{d:"M192,116a12,12,0,1,1-12-12A12,12,0,0,1,192,116ZM152,64H112a8,8,0,0,0,0,16h40a8,8,0,0,0,0-16Zm96,48v32a24,24,0,0,1-24,24h-2.36l-16.21,45.38A16,16,0,0,1,190.36,224H177.64a16,16,0,0,1-15.07-10.62L160.65,208h-57.3l-1.92,5.38A16,16,0,0,1,86.36,224H73.64a16,16,0,0,1-15.07-10.62L46,178.22a87.69,87.69,0,0,1-21.44-48.38A16,16,0,0,0,16,144a8,8,0,0,1-16,0,32,32,0,0,1,24.28-31A88.12,88.12,0,0,1,112,32H216a8,8,0,0,1,0,16H194.61a87.93,87.93,0,0,1,30.17,37c.43,1,.85,2,1.25,3A24,24,0,0,1,248,112Zm-16,0a8,8,0,0,0-8-8h-3.66a8,8,0,0,1-7.64-5.6A71.9,71.9,0,0,0,144,48H112A72,72,0,0,0,58.91,168.64a8,8,0,0,1,1.64,2.71L73.64,208H86.36l3.82-10.69A8,8,0,0,1,97.71,192h68.58a8,8,0,0,1,7.53,5.31L177.64,208h12.72l18.11-50.69A8,8,0,0,1,216,152h8a8,8,0,0,0,8-8Z"})),gJ=({size:t="large",...e})=>J.jsx(ag,{size:t,...e,children:J.jsx(pJ,{})}),yJ={error:{header:"Something went wrong",icon:J.jsx(uJ,{})},success:{header:"Vote cast",icon:J.jsx(pD,{size:"xlarge"})},loading:{header:"Casting your vote",icon:J.jsx(dJ,{})},"insufficient-balance":{header:"Insufficient balance",icon:J.jsx(gJ,{})}},mJ={error:Bu.alertError,success:Bu.alertSuccess,loading:Bu.alertLoading,"insufficient-balance":Bu.alertInsufficientBalance},Du=({children:t,className:e,type:n,actions:r,headerText:i})=>{const{header:a,icon:o}=yJ[n];return J.jsx(SP,{className:Jn.clsx(e,mJ[n]),children:J.jsxs("div",{className:Bu.alert,children:[J.jsx("h2",{children:i??a}),J.jsx("p",{children:t}),J.jsx("div",{className:Bu.icon,children:o}),J.jsx("div",{className:Bu.actions,children:r})]})})};var G5=new Map,zv=new WeakMap,vC=0,vJ=void 0;function bJ(t){return t?(zv.has(t)||(vC+=1,zv.set(t,vC.toString())),zv.get(t)):"0"}function wJ(t){return Object.keys(t).sort().filter(e=>t[e]!==void 0).map(e=>`${e}_${e==="root"?bJ(t.root):t[e]}`).toString()}function xJ(t){const e=wJ(t);let n=G5.get(e);if(!n){const r=new Map;let i;const a=new IntersectionObserver(o=>{o.forEach(s=>{var l;const c=s.isIntersecting&&i.some(u=>s.intersectionRatio>=u);t.trackVisibility&&typeof s.isVisible>"u"&&(s.isVisible=c),(l=r.get(s.target))==null||l.forEach(u=>{u(c,s)})})},t);i=a.thresholds||(Array.isArray(t.threshold)?t.threshold:[t.threshold||0]),n={id:e,observer:a,elements:r},G5.set(e,n)}return n}function AJ(t,e,n={},r=vJ){if(typeof window.IntersectionObserver>"u"&&r!==void 0){const l=t.getBoundingClientRect();return e(r,{isIntersecting:r,target:t,intersectionRatio:typeof n.threshold=="number"?n.threshold:0,time:0,boundingClientRect:l,intersectionRect:l,rootBounds:l}),()=>{}}const{id:i,observer:a,elements:o}=xJ(n),s=o.get(t)||[];return o.has(t)||o.set(t,s),s.push(e),a.observe(t),function(){s.splice(s.indexOf(e),1),s.length===0&&(o.delete(t),a.unobserve(t)),o.size===0&&(a.disconnect(),G5.delete(i))}}function EJ({threshold:t,delay:e,trackVisibility:n,rootMargin:r,root:i,triggerOnce:a,skip:o,initialInView:s,fallbackInView:l,onChange:c}={}){var u;const[f,h]=F.useState(null),d=F.useRef(),[g,p]=F.useState({inView:!!s,entry:void 0});d.current=c,F.useEffect(()=>{if(o||!f)return;let x;return x=AJ(f,(A,S)=>{p({inView:A,entry:S}),d.current&&d.current(A,S),S.isIntersecting&&a&&x&&(x(),x=void 0)},{root:i,rootMargin:r,threshold:t,trackVisibility:n,delay:e},l),()=>{x&&x()}},[Array.isArray(t)?t.toString():t,f,i,r,a,o,n,l,e]);const m=(u=g.entry)==null?void 0:u.target,y=F.useRef();!f&&m&&!a&&!o&&y.current!==m&&(y.current=m,p({inView:!!s,entry:void 0}));const v=[h,g.inView,g.entry];return v.ref=v[0],v.inView=v[1],v.entry=v[2],v}const SJ="_layout_xbptv_1",PJ="_main_xbptv_8",bC={layout:SJ,main:PJ},gD=({children:t})=>J.jsx("div",{className:bC.layout,children:J.jsx("main",{className:bC.main,children:t})}),OJ=()=>{const{state:{isInitialLoading:t,appError:e,isMobileScreen:n},clearAppError:r}=ig(),{ref:i,inView:a}=EJ({threshold:1,initialInView:!0});return J.jsxs(J.Fragment,{children:[n&&J.jsx("div",{className:Bg.inViewPlaceholder,ref:i}),J.jsxs(gD,{children:[J.jsxs("header",{className:Jn.clsx(Bg.header,n&&!a?Bg.headerSticky:void 0),children:[J.jsx(TK,{className:Bg.logo}),J.jsx(ZW,{mobileSticky:n&&!a})]}),J.jsx("section",{className:Bg.subHeader,children:J.jsx("h1",{children:"Oasis Mascot"})}),J.jsxs("section",{children:[!t&&e&&J.jsx(Du,{type:"error",actions:J.jsx(nl,{variant:"text",onClick:r,children:"< Go back "}),children:Jn.truncate(e)}),t&&J.jsx(Du,{headerText:"Please wait",type:"loading",actions:J.jsx("span",{children:"Fetching poll..."})}),!t&&!e&&J.jsx(iK,{})]})]})]})},TJ="_cardHeaderText_uydtc_1",CJ="_mascotCards_uydtc_12",kJ="_mascotCardActions_uydtc_19",_J="_cardAction_uydtc_25",NJ="_voteBtnLabel_uydtc_36",IJ="_voteBtnLabelDisabled_uydtc_42",RJ="_cardFooterText_uydtc_48",MJ="_insufficientBalanceAlertActions_uydtc_57",BJ="_cardInfoText_uydtc_67",DJ="_landingPageLink_uydtc_77",LJ="_mascotCardSelectBtn_uydtc_81",$J="_mascotCardSelectedCheckIcon_uydtc_85",UJ="_headerText_uydtc_105",Hi={cardHeaderText:TJ,mascotCards:CJ,mascotCardActions:kJ,cardAction:_J,voteBtnLabel:NJ,voteBtnLabelDisabled:IJ,cardFooterText:RJ,insufficientBalanceAlertActions:MJ,cardInfoText:BJ,landingPageLink:DJ,mascotCardSelectBtn:LJ,mascotCardSelectedCheckIcon:$J,headerText:UJ},FJ="_mascotCard_1bkx9_1",jJ="_mascotCardSelected_1bkx9_10",zJ="_mascotCardVertical_1bkx9_14",HJ="_mascotCardDescription_1bkx9_32",GJ="_mascotCardHorizontal_1bkx9_37",VJ="_mascotCardTitle_1bkx9_52",sd={mascotCard:FJ,mascotCardSelected:jJ,mascotCardVertical:zJ,mascotCardDescription:HJ,mascotCardHorizontal:GJ,mascotCardTitle:VJ},QJ={vertical:sd.mascotCardVertical,horizontal:sd.mascotCardHorizontal},yD=({image:t,title:e,description:n,actions:r,selected:i,orientation:a="vertical"})=>J.jsxs("div",{className:Jn.clsx(sd.mascotCard,i?sd.mascotCardSelected:void 0,QJ[a]),children:[t,J.jsxs("div",{children:[J.jsx("h3",{className:sd.mascotCardTitle,children:e}),J.jsx("p",{className:sd.mascotCardDescription,children:n})]}),r]}),KJ=new Intl.DateTimeFormat("en",{timeStyle:"long",dateStyle:"long"});class ld{static intlDateFormat(e){return KJ.format(e)}static unixFormatToDate(e){return new Date(Number(e)*1e3)}}const WJ=()=>{const{state:{isConnected:t,account:e},vote:n,canVoteOnPoll:r}=iv(),{state:{poll:i,previousVote:a,isMobileScreen:o,isDesktopScreen:s},setPreviousVoteForCurrentWallet:l}=ig(),[c]=wK(),u=c.get("choice")??null,f=Cs.toNullableInt(u),h=Cs.isValidMascotChoiceId(f)?f:null,[d,g]=F.useState(h),[p,m]=F.useState("vote"),[y,v]=F.useState(!1),[x,A]=F.useState("");F.useEffect(()=>{m("vote")},[e]),F.useEffect(()=>{Cs.isValidMascotChoiceId(a)&&g(a)},[a]);const S=F.useMemo(()=>{if((t||d===null)&&!Cs.isValidMascotChoiceId(a))return J.jsxs(J.Fragment,{children:[J.jsx(J.Fragment,{children:"Continue"}),s&&J.jsx(dD,{})]});if(t&&Cs.isValidMascotChoiceId(a))return J.jsx(J.Fragment,{children:"Amend your vote"});if(!t&&d!==null)return J.jsx(J.Fragment,{children:"Wallet not connected"})},[t,s,a,d]),E=U=>{g(U)},T=async()=>{if(d!==null){v(!0);try{if(!await r()){m("insufficient-balance");return}m("loading"),await n(d),l(d),m("success")}catch(U){console.error(U),A(U.message??JSON.stringify(U)),m("error")}finally{v(!1)}}},C=()=>{m("vote")};if((i==null?void 0:i.active)===!1)return J.jsx(Z7,{to:"/results",replace:!0});const N=y||d===null||!t||a===d,B=J.jsxs(J.Fragment,{children:["Select your preferred mascot option. Once you confirm this vote you will not be able to retract it. Read more about the campaign ",J.jsx("a",{className:Hi.landingPageLink,href:IK,target:"_blank",rel:"noopener noreferrer",children:"on our website"}),"."]}),L=J.jsx("p",{className:Hi.cardInfoText,children:"You have already cast your vote. It can be amended below."});return J.jsxs(J.Fragment,{children:[p==="loading"&&J.jsx(Du,{type:"loading",actions:J.jsx("span",{children:"Submitting vote..."}),children:"Your vote is always private, and can be changed until the poll closes."}),p==="error"&&x&&J.jsx(Du,{type:"error",actions:J.jsx(nl,{disabled:y,onClick:C,children:"Try again"}),children:Jn.truncate(x)}),p==="success"&&J.jsx(Du,{type:"success",actions:J.jsxs("span",{children:["Your vote has been successfully submitted.",J.jsx("br",{}),"Thank you for your participation."]})}),p==="insufficient-balance"&&J.jsx(Du,{type:"insufficient-balance",actions:J.jsxs("div",{className:Hi.insufficientBalanceAlertActions,children:[J.jsx(nl,{disabled:y,onClick:T,children:"Try again"}),J.jsx(nl,{variant:"text",disabled:y,onClick:C,children:"< Cancel "})]}),children:"Please note there is a 100 ROSE threshold in order to cast your vote."}),p==="vote"&&J.jsxs(J.Fragment,{children:[o&&J.jsx("p",{className:Hi.headerText,children:B}),J.jsxs(SP,{children:[s&&J.jsx("p",{className:Hi.cardHeaderText,children:B}),J.jsx("div",{className:Hi.mascotCards,children:tD.map(({name:U,description:j,imagePath:Z},G)=>{const H=G===d;return J.jsx(yD,{title:U,description:j,image:J.jsx("img",{alt:U,src:Z}),selected:H,actions:J.jsxs(J.Fragment,{children:[J.jsx("div",{className:Hi.mascotCardActions,children:J.jsxs(nl,{className:Hi.mascotCardSelectBtn,variant:H?"solid":"outline",size:s?"small":"medium",color:H?"success":"secondary",disabled:y,onClick:()=>E(G),fullWidth:o,children:["Select",H?"ed":""]})}),H&&J.jsx("span",{className:Hi.mascotCardSelectedCheckIcon,children:J.jsx(pD,{size:"medium"})})]})},U)})}),J.jsxs("div",{className:Hi.cardAction,children:[(t||d===null)&&Cs.isValidMascotChoiceId(a)&&L,J.jsx(nl,{disabled:N,onClick:T,children:J.jsx("label",{className:Jn.clsx(N?Hi.voteBtnLabelDisabled:Hi.voteBtnLabel),children:S})})]}),J.jsxs("p",{className:Hi.cardFooterText,children:["Please note there is a 100 ROSE threshold in order to cast your vote.",!!(i!=null&&i.params.closeTimestamp)&&J.jsxs(J.Fragment,{children:[s?J.jsx("br",{}):J.jsx(J.Fragment,{children:" "}),J.jsxs("span",{children:["Poll closes on ",ld.intlDateFormat(ld.unixFormatToDate(i.params.closeTimestamp))]})]})]})]})]})]})},JJ="6.11.1";function YJ(t,e,n){const r=e.split("|").map(a=>a.trim());for(let a=0;aPromise.resolve(t[r])))).reduce((r,i,a)=>(r[e[a]]=i,r),{})}function gt(t,e,n){for(let r in e){let i=e[r];const a=n?n[r]:null;a&&YJ(i,a,r),Object.defineProperty(t,r,{enumerable:!0,value:i,writable:!1})}}function cd(t){if(t==null)return"null";if(Array.isArray(t))return"[ "+t.map(cd).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let n="0x";for(let r=0;r>4],n+=e[t[r]&15];return n}if(typeof t=="object"&&typeof t.toJSON=="function")return cd(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":return BigInt(t).toString();case"number":return t.toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{ "+e.map(n=>`${cd(n)}: ${cd(t[n])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Qr(t,e){return t&&t.code===e}function PP(t){return Qr(t,"CALL_EXCEPTION")}function qn(t,e,n){let r=t;{const a=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${cd(n)}`);for(const o in n){if(o==="shortMessage")continue;const s=n[o];a.push(o+"="+cd(s))}}a.push(`code=${e}`),a.push(`version=${JJ}`),a.length&&(t+=" ("+a.join(", ")+")")}let i;switch(e){case"INVALID_ARGUMENT":i=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":i=new RangeError(t);break;default:i=new Error(t)}return gt(i,{code:e}),n&&Object.assign(i,n),i.shortMessage==null&>(i,{shortMessage:r}),i}function ye(t,e,n,r){if(!t)throw qn(e,n,r)}function K(t,e,n,r){ye(t,e,"INVALID_ARGUMENT",{argument:n,value:r})}function mD(t,e,n){n==null&&(n=""),n&&(n=": "+n),ye(t>=e,"missing arguemnt"+n,"MISSING_ARGUMENT",{count:t,expectedCount:e}),ye(t<=e,"too many arguments"+n,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}const XJ=["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");t.push(e)}catch{}return t},[]);function ZJ(t){ye(XJ.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}function L2(t,e,n){if(n==null&&(n=""),t!==e){let r=n,i="new";n&&(r+=".",i+=" "+n),ye(!1,`private constructor; use ${r}from* methods`,"UNSUPPORTED_OPERATION",{operation:i})}}function vD(t,e,n){if(t instanceof Uint8Array)return n?new Uint8Array(t):t;if(typeof t=="string"&&t.match(/^0x([0-9a-f][0-9a-f])*$/i)){const r=new Uint8Array((t.length-2)/2);let i=2;for(let a=0;a>4]+wC[i&15]}return n}function Zn(t){return"0x"+t.map(e=>it(e).substring(2)).join("")}function Td(t){return gn(t,!0)?(t.length-2)/2:Jt(t).length}function Un(t,e,n){const r=Jt(t);return n!=null&&n>r.length&&ye(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n}),it(r.slice(e??0,n??r.length))}function bD(t,e,n){const r=Jt(t);ye(e>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),n?i.set(r,e-r.length):i.set(r,0),it(i)}function nh(t,e){return bD(t,e,!0)}function eY(t,e){return bD(t,e,!1)}const $2=BigInt(0),bo=BigInt(1),ud=9007199254740991;function tY(t,e){const n=U2(t,"value"),r=BigInt(Bt(e,"width"));if(ye(n>>r===$2,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),n>>r-bo){const i=(bo<=-ud&&t<=ud,"overflow",e||"value",t),BigInt(t);case"string":try{if(t==="")throw new Error("empty string");return t[0]==="-"&&t[1]!=="-"?-BigInt(t.substring(1)):BigInt(t)}catch(n){K(!1,`invalid BigNumberish string: ${n.message}`,e||"value",t)}}K(!1,"invalid BigNumberish value",e||"value",t)}function U2(t,e){const n=et(t,e);return ye(n>=$2,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),n}const xC="0123456789abcdef";function OP(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=xC[n>>4],e+=xC[n&15];return BigInt(e)}return et(t)}function Bt(t,e){switch(typeof t){case"bigint":return K(t>=-ud&&t<=ud,"overflow",e||"value",t),Number(t);case"number":return K(Number.isInteger(t),"underflow",e||"value",t),K(t>=-ud&&t<=ud,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return Bt(BigInt(t),e)}catch(n){K(!1,`invalid numeric string: ${n.message}`,e||"value",t)}}K(!1,"invalid numeric value",e||"value",t)}function nY(t){return Bt(OP(t))}function us(t,e){let r=U2(t,"value").toString(16);if(e==null)r.length%2&&(r="0"+r);else{const i=Bt(e,"width");for(ye(i*2>=r.length,`value exceeds width (${i} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});r.length>6===2;o++)a++;return a}return t==="OVERRUN"?n.length-e-1:0}function sY(t,e,n,r,i){return t==="OVERLONG"?(K(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),r.push(i),0):(r.push(65533),AD(t,e,n))}const lY=Object.freeze({error:oY,ignore:AD,replace:sY});function cY(t,e){e==null&&(e=lY.error);const n=Jt(t,"bytes"),r=[];let i=0;for(;i>7)){r.push(a);continue}let o=null,s=null;if((a&224)===192)o=1,s=127;else if((a&240)===224)o=2,s=2047;else if((a&248)===240)o=3,s=65535;else{(a&192)===128?i+=e("UNEXPECTED_CONTINUE",i-1,n,r):i+=e("BAD_PREFIX",i-1,n,r);continue}if(i-1+o>=n.length){i+=e("OVERRUN",i-1,n,r);continue}let l=a&(1<<8-o-1)-1;for(let c=0;c1114111){i+=e("OUT_OF_RANGE",i-1-o,n,r,l);continue}if(l>=55296&&l<=57343){i+=e("UTF16_SURROGATE",i-1-o,n,r,l);continue}if(l<=s){i+=e("OVERLONG",i-1-o,n,r,l);continue}r.push(l)}}return r}function fl(t,e){K(typeof t=="string","invalid string value","str",t),e!=null&&(ZJ(e),t=t.normalize(e));let n=[];for(let r=0;r>6|192),n.push(i&63|128);else if((i&64512)==55296){r++;const a=t.charCodeAt(r);K(r>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(o&63|128)}else n.push(i>>12|224),n.push(i>>6&63|128),n.push(i&63|128)}return new Uint8Array(n)}function uY(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Vw(t,e){return uY(cY(t,e))}function ED(t){async function e(n,r){const i=n.url.split(":")[0].toLowerCase();ye(i==="http"||i==="https",`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),ye(i==="https"||!n.credentials||n.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let a;if(r){const f=new AbortController;a=f.signal,r.addListener(()=>{f.abort()})}const o={method:n.method,headers:new Headers(Array.from(n)),body:n.body||void 0,signal:a},s=await fetch(n.url,o),l={};s.headers.forEach((f,h)=>{l[h.toLowerCase()]=f});const c=await s.arrayBuffer(),u=c==null?null:new Uint8Array(c);return{statusCode:s.status,statusMessage:s.statusText,headers:l,body:u}}return e}const fY=12,hY=250;let SC=ED();const dY=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),pY=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let M6=!1;async function SD(t,e){try{const n=t.match(dY);if(!n)throw new Error("invalid data");return new Cd(200,"OK",{"content-type":n[1]||"text/plain"},n[2]?iY(n[3]):yY(n[3]))}catch{return new Cd(599,"BAD REQUEST (invalid data: URI)",{},null,new rh(t))}}function PD(t){async function e(n,r){try{const i=n.match(pY);if(!i)throw new Error("invalid link");return new rh(`${t}${i[2]}`)}catch{return new Cd(599,"BAD REQUEST (invalid IPFS URI)",{},null,new rh(n))}}return e}const Hv={data:SD,ipfs:PD("https://gateway.ipfs.io/ipfs/")},OD=new WeakMap;var Qu,tc,eM;let gY=(eM=class{constructor(e){M(this,Qu,void 0);M(this,tc,void 0);O(this,Qu,[]),O(this,tc,!1),OD.set(e,()=>{if(!b(this,tc)){O(this,tc,!0);for(const n of b(this,Qu))setTimeout(()=>{n()},0);O(this,Qu,[])}})}addListener(e){ye(!b(this,tc),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),b(this,Qu).push(e)}get cancelled(){return b(this,tc)}checkSignal(){ye(!this.cancelled,"cancelled","CANCELLED",{})}},Qu=new WeakMap,tc=new WeakMap,eM);function Gv(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}var $d,Ud,ao,Ns,Fd,jd,ur,Ji,Is,Ku,Wu,Ju,Lo,Rs,nc,Yu,ty,Zp;let rh=(Zp=class{constructor(e){M(this,Yu);M(this,$d,void 0);M(this,Ud,void 0);M(this,ao,void 0);M(this,Ns,void 0);M(this,Fd,void 0);M(this,jd,void 0);M(this,ur,void 0);M(this,Ji,void 0);M(this,Is,void 0);M(this,Ku,void 0);M(this,Wu,void 0);M(this,Ju,void 0);M(this,Lo,void 0);M(this,Rs,void 0);M(this,nc,void 0);O(this,jd,String(e)),O(this,$d,!1),O(this,Ud,!0),O(this,ao,{}),O(this,Ns,""),O(this,Fd,3e5),O(this,Rs,{slotInterval:hY,maxAttempts:fY}),O(this,nc,null)}get url(){return b(this,jd)}set url(e){O(this,jd,String(e))}get body(){return b(this,ur)==null?null:new Uint8Array(b(this,ur))}set body(e){if(e==null)O(this,ur,void 0),O(this,Ji,void 0);else if(typeof e=="string")O(this,ur,fl(e)),O(this,Ji,"text/plain");else if(e instanceof Uint8Array)O(this,ur,e),O(this,Ji,"application/octet-stream");else if(typeof e=="object")O(this,ur,fl(JSON.stringify(e))),O(this,Ji,"application/json");else throw new Error("invalid body")}hasBody(){return b(this,ur)!=null}get method(){return b(this,Ns)?b(this,Ns):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),O(this,Ns,String(e).toUpperCase())}get headers(){const e=Object.assign({},b(this,ao));return b(this,Is)&&(e.authorization=`Basic ${aY(fl(b(this,Is)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&b(this,Ji)&&(e["content-type"]=b(this,Ji)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,n){b(this,ao)[String(e).toLowerCase()]=String(n)}clearHeaders(){O(this,ao,{})}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r=0,"timeout must be non-zero","timeout",e),O(this,Fd,e)}get preflightFunc(){return b(this,Ku)||null}set preflightFunc(e){O(this,Ku,e)}get processFunc(){return b(this,Wu)||null}set processFunc(e){O(this,Wu,e)}get retryFunc(){return b(this,Ju)||null}set retryFunc(e){O(this,Ju,e)}get getUrlFunc(){return b(this,nc)||SC}set getUrlFunc(e){O(this,nc,e)}toString(){return``}setThrottleParams(e){e.slotInterval!=null&&(b(this,Rs).slotInterval=e.slotInterval),e.maxAttempts!=null&&(b(this,Rs).maxAttempts=e.maxAttempts)}send(){return ye(b(this,Lo)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),O(this,Lo,new gY(this)),ie(this,Yu,ty).call(this,0,PC()+this.timeout,0,this,new Cd(0,"",{},null,this))}cancel(){ye(b(this,Lo)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=OD.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const n=this.url.split(":")[0].toLowerCase(),r=e.split(":")[0].toLowerCase();ye(this.method==="GET"&&(n!=="https"||r!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const i=new Zp(e);return i.method="GET",i.allowGzip=this.allowGzip,i.timeout=this.timeout,O(i,ao,Object.assign({},b(this,ao))),b(this,ur)&&O(i,ur,new Uint8Array(b(this,ur))),O(i,Ji,b(this,Ji)),i}clone(){const e=new Zp(this.url);return O(e,Ns,b(this,Ns)),b(this,ur)&&O(e,ur,b(this,ur)),O(e,Ji,b(this,Ji)),O(e,ao,Object.assign({},b(this,ao))),O(e,Is,b(this,Is)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),O(e,Ku,b(this,Ku)),O(e,Wu,b(this,Wu)),O(e,Ju,b(this,Ju)),O(e,nc,b(this,nc)),e}static lockConfig(){M6=!0}static getGateway(e){return Hv[e.toLowerCase()]||null}static registerGateway(e,n){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(M6)throw new Error("gateways locked");Hv[e]=n}static registerGetUrl(e){if(M6)throw new Error("gateways locked");SC=e}static createGetUrlFunc(e){return ED()}static createDataGateway(){return SD}static createIpfsGatewayFunc(e){return PD(e)}},$d=new WeakMap,Ud=new WeakMap,ao=new WeakMap,Ns=new WeakMap,Fd=new WeakMap,jd=new WeakMap,ur=new WeakMap,Ji=new WeakMap,Is=new WeakMap,Ku=new WeakMap,Wu=new WeakMap,Ju=new WeakMap,Lo=new WeakMap,Rs=new WeakMap,nc=new WeakMap,Yu=new WeakSet,ty=async function(e,n,r,i,a){var u,f,h;if(e>=b(this,Rs).maxAttempts)return a.makeServerError("exceeded maximum retry limit");ye(PC()<=n,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),r>0&&await mY(r);let o=this.clone();const s=(o.url.split(":")[0]||"").toLowerCase();if(s in Hv){const d=await Hv[s](o.url,Gv(b(i,Lo)));if(d instanceof Cd){let g=d;if(this.processFunc){Gv(b(i,Lo));try{g=await this.processFunc(o,g)}catch(p){(p.throttle==null||typeof p.stall!="number")&&g.makeServerError("error in post-processing function",p).assertOk()}}return g}o=d}this.preflightFunc&&(o=await this.preflightFunc(o));const l=await this.getUrlFunc(o,Gv(b(i,Lo)));let c=new Cd(l.statusCode,l.statusMessage,l.headers,l.body,i);if(c.statusCode===301||c.statusCode===302){try{const d=c.headers.location||"";return ie(u=o.redirect(d),Yu,ty).call(u,e+1,n,0,i,c)}catch{}return c}else if(c.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,c,e))){const d=c.headers["retry-after"];let g=b(this,Rs).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof d=="string"&&d.match(/^[1-9][0-9]*$/)&&(g=parseInt(d)),ie(f=o.clone(),Yu,ty).call(f,e+1,n,g,i,c)}if(this.processFunc){Gv(b(i,Lo));try{c=await this.processFunc(o,c)}catch(d){(d.throttle==null||typeof d.stall!="number")&&c.makeServerError("error in post-processing function",d).assertOk();let g=b(this,Rs).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return d.stall>=0&&(g=d.stall),ie(h=o.clone(),Yu,ty).call(h,e+1,n,g,i,c)}}return c},Zp);var um,fm,hm,Yi,zd,Xu,dm;let Cd=(dm=class{constructor(e,n,r,i,a){M(this,um,void 0);M(this,fm,void 0);M(this,hm,void 0);M(this,Yi,void 0);M(this,zd,void 0);M(this,Xu,void 0);O(this,um,e),O(this,fm,n),O(this,hm,Object.keys(r).reduce((o,s)=>(o[s.toLowerCase()]=String(r[s]),o),{})),O(this,Yi,i==null?null:new Uint8Array(i)),O(this,zd,a||null),O(this,Xu,{message:""})}toString(){return``}get statusCode(){return b(this,um)}get statusMessage(){return b(this,fm)}get headers(){return Object.assign({},b(this,hm))}get body(){return b(this,Yi)==null?null:new Uint8Array(b(this,Yi))}get bodyText(){try{return b(this,Yi)==null?"":Vw(b(this,Yi))}catch{ye(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{ye(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r=0,"invalid stall timeout","stall",n);const r=new Error(e||"throttling requests");throw gt(r,{stall:n,throttle:!0}),r}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return b(this,Yi)!=null}get request(){return b(this,zd)}ok(){return b(this,Xu).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:n}=b(this,Xu);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let r=null;this.request&&(r=this.request.url);let i=null;try{b(this,Yi)&&(i=Vw(b(this,Yi)))}catch{}ye(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:n,info:{requestUrl:r,responseBody:i,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}},um=new WeakMap,fm=new WeakMap,hm=new WeakMap,Yi=new WeakMap,zd=new WeakMap,Xu=new WeakMap,dm);function PC(){return new Date().getTime()}function yY(t){return fl(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,n)=>String.fromCharCode(parseInt(n,16))))}function mY(t){return new Promise(e=>setTimeout(e,t))}function vY(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function OC(t,e,n){let r=0;for(let i=0;i{ye(r<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:r})};if(t[e]>=248){const r=t[e]-247;n(e+1+r);const i=OC(t,e+1,r);return n(e+1+r+i),TC(t,e,e+1+r,r+i)}else if(t[e]>=192){const r=t[e]-192;return n(e+1+r),TC(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;n(e+1+r);const i=OC(t,e+1,r);n(e+1+r+i);const a=it(t.slice(e+1+r,e+1+r+i));return{consumed:1+r+i,result:a}}else if(t[e]>=128){const r=t[e]-128;n(e+1+r);const i=it(t.slice(e+1,e+1+r));return{consumed:1+r,result:i}}return{consumed:1,result:vY(t[e])}}function F2(t){const e=Jt(t,"data"),n=TD(e,0);return K(n.consumed===e.length,"unexpected junk after rlp payload","data",t),n.result}function CC(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function CD(t){if(Array.isArray(t)){let r=[];if(t.forEach(function(a){r=r.concat(CD(a))}),r.length<=55)return r.unshift(192+r.length),r;const i=CC(r.length);return i.unshift(247+i.length),i.concat(r)}const e=Array.prototype.slice.call(Jt(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const n=CC(e.length);return n.unshift(183+n.length),n.concat(e)}const kC="0123456789abcdef";function vp(t){let e="0x";for(const n of CD(t))e+=kC[n>>4],e+=kC[n&15];return e}const si=32,V5=new Uint8Array(si),bY=["then"],Vv={};function Lg(t,e){const n=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw n.error=e,n}var rc,Wf;let kD=(Wf=class extends Array{constructor(...n){const r=n[0];let i=n[1],a=(n[2]||[]).slice(),o=!0;r!==Vv&&(i=n,a=[],o=!1);super(i.length);M(this,rc,void 0);i.forEach((l,c)=>{this[c]=l});const s=a.reduce((l,c)=>(typeof c=="string"&&l.set(c,(l.get(c)||0)+1),l),new Map);if(O(this,rc,Object.freeze(i.map((l,c)=>{const u=a[c];return u!=null&&s.get(u)===1?u:null}))),!!o)return Object.freeze(this),new Proxy(this,{get:(l,c,u)=>{if(typeof c=="string"){if(c.match(/^[0-9]+$/)){const h=Bt(c,"%index");if(h<0||h>=this.length)throw new RangeError("out of result range");const d=l[h];return d instanceof Error&&Lg(`index ${h}`,d),d}if(bY.indexOf(c)>=0)return Reflect.get(l,c,u);const f=l[c];if(f instanceof Function)return function(...h){return f.apply(this===u?l:this,h)};if(!(c in l))return l.getValue.apply(this===u?l:this,[c])}return Reflect.get(l,c,u)}})}toArray(){const n=[];return this.forEach((r,i)=>{r instanceof Error&&Lg(`index ${i}`,r),n.push(r)}),n}toObject(){return b(this,rc).reduce((n,r,i)=>(ye(r!=null,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"}),r in n||(n[r]=this.getValue(r)),n),{})}slice(n,r){n==null&&(n=0),n<0&&(n+=this.length,n<0&&(n=0)),r==null&&(r=this.length),r<0&&(r+=this.length,r<0&&(r=0)),r>this.length&&(r=this.length);const i=[],a=[];for(let o=n;o{b(this,Ms)[e]=_C(n)}}},Ms=new WeakMap,Zu=new WeakMap,Hd=new WeakSet,jb=function(e){return b(this,Ms).push(e),O(this,Zu,b(this,Zu)+e.length),e.length},tM);var bi,Xi,qu,ef,ic,pm,K5,a2,_D,gm;let wY=(gm=class{constructor(e,n,r){M(this,pm);M(this,a2);R(this,"allowLoose");M(this,bi,void 0);M(this,Xi,void 0);M(this,qu,void 0);M(this,ef,void 0);M(this,ic,void 0);gt(this,{allowLoose:!!n}),O(this,bi,ai(e)),O(this,qu,0),O(this,ef,null),O(this,ic,r??1024),O(this,Xi,0)}get data(){return it(b(this,bi))}get dataLength(){return b(this,bi).length}get consumed(){return b(this,Xi)}get bytes(){return new Uint8Array(b(this,bi))}subReader(e){const n=new gm(b(this,bi).slice(b(this,Xi)+e),this.allowLoose,b(this,ic));return O(n,ef,this),n}readBytes(e,n){let r=ie(this,a2,_D).call(this,0,e,!!n);return ie(this,pm,K5).call(this,e),O(this,Xi,b(this,Xi)+r.length),r.slice(0,e)}readValue(){return OP(this.readBytes(si))}readIndex(){return nY(this.readBytes(si))}},bi=new WeakMap,Xi=new WeakMap,qu=new WeakMap,ef=new WeakMap,ic=new WeakMap,pm=new WeakSet,K5=function(e){var n;if(b(this,ef))return ie(n=b(this,ef),pm,K5).call(n,e);O(this,qu,b(this,qu)+e),ye(b(this,ic)<1||b(this,qu)<=b(this,ic)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${b(this,ic)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:ai(b(this,bi)),offset:b(this,Xi),length:e,info:{bytesRead:b(this,qu),dataLength:this.dataLength}})},a2=new WeakSet,_D=function(e,n,r){let i=Math.ceil(n/si)*si;return b(this,Xi)+i>b(this,bi).length&&(this.allowLoose&&r&&b(this,Xi)+n<=b(this,bi).length?i=n:ye(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:ai(b(this,bi)),length:b(this,bi).length,offset:b(this,Xi)+i})),b(this,bi).slice(b(this,Xi),b(this,Xi)+i)},gm);function Qw(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function TP(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function xY(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Qw(t.outputLen),Qw(t.blockLen)}function bp(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function ND(t,e){TP(t);const n=e.outputLen;if(t.lengtht instanceof Uint8Array,AY=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),D6=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Mo=(t,e)=>t<<32-e|t>>>e,EY=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!EY)throw new Error("Non little-endian hardware is not supported");function SY(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function j2(t){if(typeof t=="string"&&(t=SY(t)),!ID(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function PY(...t){const e=new Uint8Array(t.reduce((r,i)=>r+i.length,0));let n=0;return t.forEach(r=>{if(!ID(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}let CP=class{clone(){return this._cloneInto()}};function kP(t){const e=r=>t().update(j2(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function OY(t=32){if(B6&&typeof B6.getRandomValues=="function")return B6.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}class RD extends CP{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,xY(e);const r=j2(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,a=new Uint8Array(i);a.set(r.length>i?e.create().update(r).digest():r);for(let o=0;onew RD(t,e).update(n).digest();_P.create=(t,e)=>new RD(t,e);function TY(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),l=r?4:0,c=r?0:4;t.setUint32(e+l,o,r),t.setUint32(e+c,s,r)}class MD extends CP{constructor(e,n,r,i){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=D6(this.buffer)}update(e){bp(this);const{view:n,buffer:r,blockLen:i}=this;e=j2(e);const a=e.length;for(let o=0;oi-o&&(this.process(r,0),o=0);for(let f=o;fu.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;ft&e^~t&n,kY=(t,e,n)=>t&e^t&n^e&n,_Y=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),zl=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Hl=new Uint32Array(64);class NY extends MD{constructor(){super(64,32,8,!1),this.A=zl[0]|0,this.B=zl[1]|0,this.C=zl[2]|0,this.D=zl[3]|0,this.E=zl[4]|0,this.F=zl[5]|0,this.G=zl[6]|0,this.H=zl[7]|0}get(){const{A:e,B:n,C:r,D:i,E:a,F:o,G:s,H:l}=this;return[e,n,r,i,a,o,s,l]}set(e,n,r,i,a,o,s,l){this.A=e|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=a|0,this.F=o|0,this.G=s|0,this.H=l|0}process(e,n){for(let f=0;f<16;f++,n+=4)Hl[f]=e.getUint32(n,!1);for(let f=16;f<64;f++){const h=Hl[f-15],d=Hl[f-2],g=Mo(h,7)^Mo(h,18)^h>>>3,p=Mo(d,17)^Mo(d,19)^d>>>10;Hl[f]=p+Hl[f-7]+g+Hl[f-16]|0}let{A:r,B:i,C:a,D:o,E:s,F:l,G:c,H:u}=this;for(let f=0;f<64;f++){const h=Mo(s,6)^Mo(s,11)^Mo(s,25),d=u+h+CY(s,l,c)+_Y[f]+Hl[f]|0,p=(Mo(r,2)^Mo(r,13)^Mo(r,22))+kY(r,i,a)|0;u=c,c=l,l=s,s=o+d|0,o=a,a=i,i=r,r=d+p|0}r=r+this.A|0,i=i+this.B|0,a=a+this.C|0,o=o+this.D|0,s=s+this.E|0,l=l+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,i,a,o,s,l,c,u)}roundClean(){Hl.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const IY=kP(()=>new NY),Qv=BigInt(2**32-1),W5=BigInt(32);function BD(t,e=!1){return e?{h:Number(t&Qv),l:Number(t>>W5&Qv)}:{h:Number(t>>W5&Qv)|0,l:Number(t&Qv)|0}}function DD(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let i=0;iBigInt(t>>>0)<>>0),MY=(t,e,n)=>t>>>n,BY=(t,e,n)=>t<<32-n|e>>>n,DY=(t,e,n)=>t>>>n|e<<32-n,LY=(t,e,n)=>t<<32-n|e>>>n,$Y=(t,e,n)=>t<<64-n|e>>>n-32,UY=(t,e,n)=>t>>>n-32|e<<64-n,FY=(t,e)=>e,jY=(t,e)=>t,LD=(t,e,n)=>t<>>32-n,$D=(t,e,n)=>e<>>32-n,UD=(t,e,n)=>e<>>64-n,FD=(t,e,n)=>t<>>64-n;function zY(t,e,n,r){const i=(e>>>0)+(r>>>0);return{h:t+n+(i/2**32|0)|0,l:i|0}}const HY=(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),GY=(t,e,n,r)=>e+n+r+(t/2**32|0)|0,VY=(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),QY=(t,e,n,r,i)=>e+n+r+i+(t/2**32|0)|0,KY=(t,e,n,r,i)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0),WY=(t,e,n,r,i,a)=>e+n+r+i+a+(t/2**32|0)|0,Nt={fromBig:BD,split:DD,toBig:RY,shrSH:MY,shrSL:BY,rotrSH:DY,rotrSL:LY,rotrBH:$Y,rotrBL:UY,rotr32H:FY,rotr32L:jY,rotlSH:LD,rotlSL:$D,rotlBH:UD,rotlBL:FD,add:zY,add3L:HY,add3H:GY,add4L:VY,add4H:QY,add5H:WY,add5L:KY},[JY,YY]=Nt.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Gl=new Uint32Array(80),Vl=new Uint32Array(80);class XY extends MD{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:n,Bh:r,Bl:i,Ch:a,Cl:o,Dh:s,Dl:l,Eh:c,El:u,Fh:f,Fl:h,Gh:d,Gl:g,Hh:p,Hl:m}=this;return[e,n,r,i,a,o,s,l,c,u,f,h,d,g,p,m]}set(e,n,r,i,a,o,s,l,c,u,f,h,d,g,p,m){this.Ah=e|0,this.Al=n|0,this.Bh=r|0,this.Bl=i|0,this.Ch=a|0,this.Cl=o|0,this.Dh=s|0,this.Dl=l|0,this.Eh=c|0,this.El=u|0,this.Fh=f|0,this.Fl=h|0,this.Gh=d|0,this.Gl=g|0,this.Hh=p|0,this.Hl=m|0}process(e,n){for(let x=0;x<16;x++,n+=4)Gl[x]=e.getUint32(n),Vl[x]=e.getUint32(n+=4);for(let x=16;x<80;x++){const A=Gl[x-15]|0,S=Vl[x-15]|0,E=Nt.rotrSH(A,S,1)^Nt.rotrSH(A,S,8)^Nt.shrSH(A,S,7),T=Nt.rotrSL(A,S,1)^Nt.rotrSL(A,S,8)^Nt.shrSL(A,S,7),C=Gl[x-2]|0,N=Vl[x-2]|0,B=Nt.rotrSH(C,N,19)^Nt.rotrBH(C,N,61)^Nt.shrSH(C,N,6),L=Nt.rotrSL(C,N,19)^Nt.rotrBL(C,N,61)^Nt.shrSL(C,N,6),U=Nt.add4L(T,L,Vl[x-7],Vl[x-16]),j=Nt.add4H(U,E,B,Gl[x-7],Gl[x-16]);Gl[x]=j|0,Vl[x]=U|0}let{Ah:r,Al:i,Bh:a,Bl:o,Ch:s,Cl:l,Dh:c,Dl:u,Eh:f,El:h,Fh:d,Fl:g,Gh:p,Gl:m,Hh:y,Hl:v}=this;for(let x=0;x<80;x++){const A=Nt.rotrSH(f,h,14)^Nt.rotrSH(f,h,18)^Nt.rotrBH(f,h,41),S=Nt.rotrSL(f,h,14)^Nt.rotrSL(f,h,18)^Nt.rotrBL(f,h,41),E=f&d^~f&p,T=h&g^~h&m,C=Nt.add5L(v,S,T,YY[x],Vl[x]),N=Nt.add5H(C,y,A,E,JY[x],Gl[x]),B=C|0,L=Nt.rotrSH(r,i,28)^Nt.rotrBH(r,i,34)^Nt.rotrBH(r,i,39),U=Nt.rotrSL(r,i,28)^Nt.rotrBL(r,i,34)^Nt.rotrBL(r,i,39),j=r&a^r&s^a&s,Z=i&o^i&l^o&l;y=p|0,v=m|0,p=d|0,m=g|0,d=f|0,g=h|0,{h:f,l:h}=Nt.add(c|0,u|0,N|0,B|0),c=s|0,u=l|0,s=a|0,l=o|0,a=r|0,o=i|0;const G=Nt.add3L(B,U,Z);r=Nt.add3H(G,N,L,j),i=G|0}({h:r,l:i}=Nt.add(this.Ah|0,this.Al|0,r|0,i|0)),{h:a,l:o}=Nt.add(this.Bh|0,this.Bl|0,a|0,o|0),{h:s,l}=Nt.add(this.Ch|0,this.Cl|0,s|0,l|0),{h:c,l:u}=Nt.add(this.Dh|0,this.Dl|0,c|0,u|0),{h:f,l:h}=Nt.add(this.Eh|0,this.El|0,f|0,h|0),{h:d,l:g}=Nt.add(this.Fh|0,this.Fl|0,d|0,g|0),{h:p,l:m}=Nt.add(this.Gh|0,this.Gl|0,p|0,m|0),{h:y,l:v}=Nt.add(this.Hh|0,this.Hl|0,y|0,v|0),this.set(r,i,a,o,s,l,c,u,f,h,d,g,p,m,y,v)}roundClean(){Gl.fill(0),Vl.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class ZY extends XY{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}const qY=kP(()=>new ZY),[jD,zD,HD]=[[],[],[]],eX=BigInt(0),$g=BigInt(1),tX=BigInt(2),nX=BigInt(7),rX=BigInt(256),iX=BigInt(113);for(let t=0,e=$g,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],jD.push(2*(5*r+n)),zD.push((t+1)*(t+2)/2%64);let i=eX;for(let a=0;a<7;a++)e=(e<<$g^(e>>nX)*iX)%rX,e&tX&&(i^=$g<<($g<n>32?UD(t,e,n):LD(t,e,n),IC=(t,e,n)=>n>32?FD(t,e,n):$D(t,e,n);function sX(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let o=0;o<10;o++)n[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const s=(o+8)%10,l=(o+2)%10,c=n[l],u=n[l+1],f=NC(c,u,1)^n[s],h=IC(c,u,1)^n[s+1];for(let d=0;d<50;d+=10)t[o+d]^=f,t[o+d+1]^=h}let i=t[2],a=t[3];for(let o=0;o<24;o++){const s=zD[o],l=NC(i,a,s),c=IC(i,a,s),u=jD[o];i=t[u],a=t[u+1],t[u]=l,t[u+1]=c}for(let o=0;o<50;o+=10){for(let s=0;s<10;s++)n[s]=t[o+s];for(let s=0;s<10;s++)t[o+s]^=~n[(s+2)%10]&n[(s+4)%10]}t[0]^=aX[r],t[1]^=oX[r]}n.fill(0)}class NP extends CP{constructor(e,n,r,i=!1,a=24){if(super(),this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=i,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Qw(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=AY(this.state)}keccak(){sX(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){bp(this);const{blockLen:n,state:r}=this;e=j2(e);const i=e.length;for(let a=0;a=r&&this.keccak();const o=Math.min(r-this.posOut,a-i);e.set(n.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Qw(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(ND(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:n,suffix:r,outputLen:i,rounds:a,enableXOF:o}=this;return e||(e=new NP(n,r,i,o,a)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=a,e.suffix=r,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const lX=(t,e,n)=>kP(()=>new NP(e,t,n)),GD=lX(1,136,256/8);let VD=!1;const QD=function(t){return GD(t)};let KD=QD;function Sn(t){const e=Jt(t,"data");return it(KD(e))}Sn._=QD;Sn.lock=function(){VD=!0};Sn.register=function(t){if(VD)throw new TypeError("keccak256 is locked");KD=t};Object.freeze(Sn);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const WD=BigInt(0),z2=BigInt(1),cX=BigInt(2),H2=t=>t instanceof Uint8Array,uX=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function wp(t){if(!H2(t))throw new Error("Uint8Array expected");let e="";for(let n=0;nr+i.length,0));let n=0;return t.forEach(r=>{if(!H2(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}function hX(t,e){if(t.length!==e.length)return!1;for(let n=0;nWD;t>>=z2,e+=1);return e}function gX(t,e){return t>>BigInt(e)&z2}const yX=(t,e,n)=>t|(n?z2:WD)<(cX<new Uint8Array(t),RC=t=>Uint8Array.from(t);function YD(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=L6(t),i=L6(t),a=0;const o=()=>{r.fill(1),i.fill(0),a=0},s=(...f)=>n(i,r,...f),l=(f=L6())=>{i=s(RC([0]),f),r=s(),f.length!==0&&(i=s(RC([1]),f),r=s())},c=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const h=[];for(;f{o(),l(f);let d;for(;!(d=h(c()));)l();return o(),d}}const mX={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function av(t,e,n={}){const r=(i,a,o)=>{const s=mX[a];if(typeof s!="function")throw new Error(`Invalid validator "${a}", expected function`);const l=t[i];if(!(o&&l===void 0)&&!s(l,t))throw new Error(`Invalid param ${String(i)}=${l} (${typeof l}), expected ${a}`)};for(const[i,a]of Object.entries(e))r(i,a,!1);for(const[i,a]of Object.entries(n))r(i,a,!0);return t}const vX=Object.freeze(Object.defineProperty({__proto__:null,bitGet:gX,bitLen:pX,bitMask:BP,bitSet:yX,bytesToHex:wp,bytesToNumberBE:jf,bytesToNumberLE:RP,concatBytes:s1,createHmacDrbg:YD,ensureBytes:io,equalBytes:hX,hexToBytes:xp,hexToNumber:IP,numberToBytesBE:Ap,numberToBytesLE:MP,numberToHexUnpadded:JD,numberToVarBytesBE:fX,utf8ToBytes:dX,validateObject:av},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const gr=BigInt(0),Yn=BigInt(1),Tu=BigInt(2),bX=BigInt(3),J5=BigInt(4),MC=BigInt(5),BC=BigInt(8);BigInt(9);BigInt(16);function Ti(t,e){const n=t%e;return n>=gr?n:e+n}function wX(t,e,n){if(n<=gr||e 0");if(n===Yn)return gr;let r=Yn;for(;e>gr;)e&Yn&&(r=r*t%n),t=t*t%n,e>>=Yn;return r}function ga(t,e,n){let r=t;for(;e-- >gr;)r*=r,r%=n;return r}function Y5(t,e){if(t===gr||e<=gr)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let n=Ti(t,e),r=e,i=gr,a=Yn;for(;n!==gr;){const s=r/n,l=r%n,c=i-a*s;r=n,n=l,i=a,a=c}if(r!==Yn)throw new Error("invert: does not exist");return Ti(i,e)}function xX(t){const e=(t-Yn)/Tu;let n,r,i;for(n=t-Yn,r=0;n%Tu===gr;n/=Tu,r++);for(i=Tu;i(r[i]="function",r),e);return av(t,n)}function PX(t,e,n){if(n 0");if(n===gr)return t.ONE;if(n===Yn)return e;let r=t.ONE,i=e;for(;n>gr;)n&Yn&&(r=t.mul(r,i)),i=t.sqr(i),n>>=Yn;return r}function OX(t,e){const n=new Array(e.length),r=e.reduce((a,o,s)=>t.is0(o)?a:(n[s]=a,t.mul(a,o)),t.ONE),i=t.inv(r);return e.reduceRight((a,o,s)=>t.is0(o)?a:(n[s]=t.mul(a,n[s]),t.mul(a,o)),i),n}function XD(t,e){const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function TX(t,e,n=!1,r={}){if(t<=gr)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:a}=XD(t,e);if(a>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=AX(t),s=Object.freeze({ORDER:t,BITS:i,BYTES:a,MASK:BP(i),ZERO:gr,ONE:Yn,create:l=>Ti(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return gr<=l&&ll===gr,isOdd:l=>(l&Yn)===Yn,neg:l=>Ti(-l,t),eql:(l,c)=>l===c,sqr:l=>Ti(l*l,t),add:(l,c)=>Ti(l+c,t),sub:(l,c)=>Ti(l-c,t),mul:(l,c)=>Ti(l*c,t),pow:(l,c)=>PX(s,l,c),div:(l,c)=>Ti(l*Y5(c,t),t),sqrN:l=>l*l,addN:(l,c)=>l+c,subN:(l,c)=>l-c,mulN:(l,c)=>l*c,inv:l=>Y5(l,t),sqrt:r.sqrt||(l=>o(s,l)),invertBatch:l=>OX(s,l),cmov:(l,c,u)=>u?c:l,toBytes:l=>n?MP(l,a):Ap(l,a),fromBytes:l=>{if(l.length!==a)throw new Error(`Fp.fromBytes: expected ${a}, got ${l.length}`);return n?RP(l):jf(l)}});return Object.freeze(s)}function ZD(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function qD(t){const e=ZD(t);return e+Math.ceil(e/2)}function CX(t,e,n=!1){const r=t.length,i=ZD(e),a=qD(e);if(r<16||r1024)throw new Error(`expected ${a}-1024 bytes of input, got ${r}`);const o=n?jf(t):RP(t),s=Ti(o,e-Yn)+Yn;return n?MP(s,i):Ap(s,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const kX=BigInt(0),$6=BigInt(1);function _X(t,e){const n=(i,a)=>{const o=a.negate();return i?o:a},r=i=>{const a=Math.ceil(e/i)+1,o=2**(i-1);return{windows:a,windowSize:o}};return{constTimeNegate:n,unsafeLadder(i,a){let o=t.ZERO,s=i;for(;a>kX;)a&$6&&(o=o.add(s)),s=s.double(),a>>=$6;return o},precomputeWindow(i,a){const{windows:o,windowSize:s}=r(a),l=[];let c=i,u=c;for(let f=0;f>=d,m>l&&(m-=h,o+=$6);const y=p,v=p+Math.abs(m)-1,x=g%2!==0,A=m<0;m===0?u=u.add(n(x,a[y])):c=c.add(n(A,a[v]))}return{p:c,f:u}},wNAFCached(i,a,o,s){const l=i._WINDOW_SIZE||1;let c=a.get(i);return c||(c=this.precomputeWindow(i,l),l!==1&&a.set(i,s(c))),this.wNAF(l,c,o)}}}function eL(t){return SX(t.Fp),av(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...XD(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function NX(t){const e=eL(t);av(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:i}=e;if(n){if(!r.eql(i,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:IX,hexToBytes:RX}=vX,Lu={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=Lu;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const n=t[1],r=t.subarray(2,n+2);if(!n||r.length!==n)throw new e("Invalid signature integer: wrong length");if(r[0]&128)throw new e("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:IX(r),l:t.subarray(n+2)}},toSig(t){const{Err:e}=Lu,n=typeof t=="string"?RX(t):t;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new e("Invalid signature tag");if(n[1]!==r-2)throw new e("Invalid signature: incorrect length");const{d:i,l:a}=Lu._parseInt(n.subarray(2)),{d:o,l:s}=Lu._parseInt(a);if(s.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){const e=c=>Number.parseInt(c[0],16)&8?"00"+c:c,n=c=>{const u=c.toString(16);return u.length&1?`0${u}`:u},r=e(n(t.s)),i=e(n(t.r)),a=r.length/2,o=i.length/2,s=n(a),l=n(o);return`30${n(o+a+4)}02${l}${i}02${s}${r}`}},rl=BigInt(0),Na=BigInt(1);BigInt(2);const DC=BigInt(3);BigInt(4);function MX(t){const e=NX(t),{Fp:n}=e,r=e.toBytes||((g,p,m)=>{const y=p.toAffine();return s1(Uint8Array.from([4]),n.toBytes(y.x),n.toBytes(y.y))}),i=e.fromBytes||(g=>{const p=g.subarray(1),m=n.fromBytes(p.subarray(0,n.BYTES)),y=n.fromBytes(p.subarray(n.BYTES,2*n.BYTES));return{x:m,y}});function a(g){const{a:p,b:m}=e,y=n.sqr(g),v=n.mul(y,g);return n.add(n.add(v,n.mul(g,p)),m)}if(!n.eql(n.sqr(e.Gy),a(e.Gx)))throw new Error("bad generator point: equation left != right");function o(g){return typeof g=="bigint"&&rln.eql(x,n.ZERO);return v(m)&&v(y)?f.ZERO:new f(m,y,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(p){const m=n.invertBatch(p.map(y=>y.pz));return p.map((y,v)=>y.toAffine(m[v])).map(f.fromAffine)}static fromHex(p){const m=f.fromAffine(i(io("pointHex",p)));return m.assertValidity(),m}static fromPrivateKey(p){return f.BASE.multiply(l(p))}_setWindowSize(p){this._WINDOW_SIZE=p,c.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:p,y:m}=this.toAffine();if(!n.isValid(p)||!n.isValid(m))throw new Error("bad point: x or y not FE");const y=n.sqr(m),v=a(p);if(!n.eql(y,v))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:p}=this.toAffine();if(n.isOdd)return!n.isOdd(p);throw new Error("Field doesn't support isOdd")}equals(p){u(p);const{px:m,py:y,pz:v}=this,{px:x,py:A,pz:S}=p,E=n.eql(n.mul(m,S),n.mul(x,v)),T=n.eql(n.mul(y,S),n.mul(A,v));return E&&T}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:p,b:m}=e,y=n.mul(m,DC),{px:v,py:x,pz:A}=this;let S=n.ZERO,E=n.ZERO,T=n.ZERO,C=n.mul(v,v),N=n.mul(x,x),B=n.mul(A,A),L=n.mul(v,x);return L=n.add(L,L),T=n.mul(v,A),T=n.add(T,T),S=n.mul(p,T),E=n.mul(y,B),E=n.add(S,E),S=n.sub(N,E),E=n.add(N,E),E=n.mul(S,E),S=n.mul(L,S),T=n.mul(y,T),B=n.mul(p,B),L=n.sub(C,B),L=n.mul(p,L),L=n.add(L,T),T=n.add(C,C),C=n.add(T,C),C=n.add(C,B),C=n.mul(C,L),E=n.add(E,C),B=n.mul(x,A),B=n.add(B,B),C=n.mul(B,L),S=n.sub(S,C),T=n.mul(B,N),T=n.add(T,T),T=n.add(T,T),new f(S,E,T)}add(p){u(p);const{px:m,py:y,pz:v}=this,{px:x,py:A,pz:S}=p;let E=n.ZERO,T=n.ZERO,C=n.ZERO;const N=e.a,B=n.mul(e.b,DC);let L=n.mul(m,x),U=n.mul(y,A),j=n.mul(v,S),Z=n.add(m,y),G=n.add(x,A);Z=n.mul(Z,G),G=n.add(L,U),Z=n.sub(Z,G),G=n.add(m,v);let H=n.add(x,S);return G=n.mul(G,H),H=n.add(L,j),G=n.sub(G,H),H=n.add(y,v),E=n.add(A,S),H=n.mul(H,E),E=n.add(U,j),H=n.sub(H,E),C=n.mul(N,G),E=n.mul(B,j),C=n.add(E,C),E=n.sub(U,C),C=n.add(U,C),T=n.mul(E,C),U=n.add(L,L),U=n.add(U,L),j=n.mul(N,j),G=n.mul(B,G),U=n.add(U,j),j=n.sub(L,j),j=n.mul(N,j),G=n.add(G,j),L=n.mul(U,G),T=n.add(T,L),L=n.mul(H,G),E=n.mul(Z,E),E=n.sub(E,L),L=n.mul(Z,U),C=n.mul(H,C),C=n.add(C,L),new f(E,T,C)}subtract(p){return this.add(p.negate())}is0(){return this.equals(f.ZERO)}wNAF(p){return d.wNAFCached(this,c,p,m=>{const y=n.invertBatch(m.map(v=>v.pz));return m.map((v,x)=>v.toAffine(y[x])).map(f.fromAffine)})}multiplyUnsafe(p){const m=f.ZERO;if(p===rl)return m;if(s(p),p===Na)return this;const{endo:y}=e;if(!y)return d.unsafeLadder(this,p);let{k1neg:v,k1:x,k2neg:A,k2:S}=y.splitScalar(p),E=m,T=m,C=this;for(;x>rl||S>rl;)x&Na&&(E=E.add(C)),S&Na&&(T=T.add(C)),C=C.double(),x>>=Na,S>>=Na;return v&&(E=E.negate()),A&&(T=T.negate()),T=new f(n.mul(T.px,y.beta),T.py,T.pz),E.add(T)}multiply(p){s(p);let m=p,y,v;const{endo:x}=e;if(x){const{k1neg:A,k1:S,k2neg:E,k2:T}=x.splitScalar(m);let{p:C,f:N}=this.wNAF(S),{p:B,f:L}=this.wNAF(T);C=d.constTimeNegate(A,C),B=d.constTimeNegate(E,B),B=new f(n.mul(B.px,x.beta),B.py,B.pz),y=C.add(B),v=N.add(L)}else{const{p:A,f:S}=this.wNAF(m);y=A,v=S}return f.normalizeZ([y,v])[0]}multiplyAndAddUnsafe(p,m,y){const v=f.BASE,x=(S,E)=>E===rl||E===Na||!S.equals(v)?S.multiplyUnsafe(E):S.multiply(E),A=x(this,m).add(x(p,y));return A.is0()?void 0:A}toAffine(p){const{px:m,py:y,pz:v}=this,x=this.is0();p==null&&(p=x?n.ONE:n.inv(v));const A=n.mul(m,p),S=n.mul(y,p),E=n.mul(v,p);if(x)return{x:n.ZERO,y:n.ZERO};if(!n.eql(E,n.ONE))throw new Error("invZ was invalid");return{x:A,y:S}}isTorsionFree(){const{h:p,isTorsionFree:m}=e;if(p===Na)return!0;if(m)return m(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:p,clearCofactor:m}=e;return p===Na?this:m?m(f,this):this.multiplyUnsafe(e.h)}toRawBytes(p=!0){return this.assertValidity(),r(f,this,p)}toHex(p=!0){return wp(this.toRawBytes(p))}}f.BASE=new f(e.Gx,e.Gy,n.ONE),f.ZERO=new f(n.ZERO,n.ONE,n.ZERO);const h=e.nBitLength,d=_X(f,e.endo?Math.ceil(h/2):h);return{CURVE:e,ProjectivePoint:f,normPrivateKeyToScalar:l,weierstrassEquation:a,isWithinCurveOrder:o}}function BX(t){const e=eL(t);return av(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function DX(t){const e=BX(t),{Fp:n,n:r}=e,i=n.BYTES+1,a=2*n.BYTES+1;function o(G){return rlwp(Ap(G,e.nByteLength));function g(G){const H=r>>Na;return G>H}function p(G){return g(G)?s(-G):G}const m=(G,H,re)=>jf(G.slice(H,re));class y{constructor(H,re,V){this.r=H,this.s=re,this.recovery=V,this.assertValidity()}static fromCompact(H){const re=e.nByteLength;return H=io("compactSignature",H,re*2),new y(m(H,0,re),m(H,re,2*re))}static fromDER(H){const{r:re,s:V}=Lu.toSig(io("DER",H));return new y(re,V)}assertValidity(){if(!h(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!h(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(H){return new y(this.r,this.s,H)}recoverPublicKey(H){const{r:re,s:V,recovery:ee}=this,pe=T(io("msgHash",H));if(ee==null||![0,1,2,3].includes(ee))throw new Error("recovery id invalid");const Ae=ee===2||ee===3?re+e.n:re;if(Ae>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const we=ee&1?"03":"02",Ye=c.fromHex(we+d(Ae)),nt=l(Ae),De=s(-pe*nt),st=s(V*nt),Tt=c.BASE.multiplyAndAddUnsafe(Ye,De,st);if(!Tt)throw new Error("point at infinify");return Tt.assertValidity(),Tt}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new y(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return xp(this.toDERHex())}toDERHex(){return Lu.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return xp(this.toCompactHex())}toCompactHex(){return d(this.r)+d(this.s)}}const v={isValidPrivateKey(G){try{return u(G),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const G=qD(e.n);return CX(e.randomBytes(G),e.n)},precompute(G=8,H=c.BASE){return H._setWindowSize(G),H.multiply(BigInt(3)),H}};function x(G,H=!0){return c.fromPrivateKey(G).toRawBytes(H)}function A(G){const H=G instanceof Uint8Array,re=typeof G=="string",V=(H||re)&&G.length;return H?V===i||V===a:re?V===2*i||V===2*a:G instanceof c}function S(G,H,re=!0){if(A(G))throw new Error("first arg must be private key");if(!A(H))throw new Error("second arg must be public key");return c.fromHex(H).multiply(u(G)).toRawBytes(re)}const E=e.bits2int||function(G){const H=jf(G),re=G.length*8-e.nBitLength;return re>0?H>>BigInt(re):H},T=e.bits2int_modN||function(G){return s(E(G))},C=BP(e.nBitLength);function N(G){if(typeof G!="bigint")throw new Error("bigint expected");if(!(rl<=G&&GEe in re))throw new Error("sign() legacy options not supported");const{hash:V,randomBytes:ee}=e;let{lowS:pe,prehash:Ae,extraEntropy:we}=re;pe==null&&(pe=!0),G=io("msgHash",G),Ae&&(G=io("prehashed msgHash",V(G)));const Ye=T(G),nt=u(H),De=[N(nt),N(Ye)];if(we!=null){const Ee=we===!0?ee(n.BYTES):we;De.push(io("extraEntropy",Ee))}const st=s1(...De),Tt=Ye;function ln(Ee){const ne=E(Ee);if(!h(ne))return;const le=l(ne),te=c.BASE.multiply(ne).toAffine(),Ce=s(te.x);if(Ce===rl)return;const Se=s(le*s(Tt+Ce*nt));if(Se===rl)return;let ze=(te.x===Ce?0:2)|Number(te.y&Na),$e=Se;return pe&&g(Se)&&($e=p(Se),ze^=1),new y(Ce,$e,ze)}return{seed:st,k2sig:ln}}const L={lowS:e.lowS,prehash:!1},U={lowS:e.lowS,prehash:!1};function j(G,H,re=L){const{seed:V,k2sig:ee}=B(G,H,re),pe=e;return YD(pe.hash.outputLen,pe.nByteLength,pe.hmac)(V,ee)}c.BASE._setWindowSize(8);function Z(G,H,re,V=U){var te;const ee=G;if(H=io("msgHash",H),re=io("publicKey",re),"strict"in V)throw new Error("options.strict was renamed to lowS");const{lowS:pe,prehash:Ae}=V;let we,Ye;try{if(typeof ee=="string"||ee instanceof Uint8Array)try{we=y.fromDER(ee)}catch(Ce){if(!(Ce instanceof Lu.Err))throw Ce;we=y.fromCompact(ee)}else if(typeof ee=="object"&&typeof ee.r=="bigint"&&typeof ee.s=="bigint"){const{r:Ce,s:Se}=ee;we=new y(Ce,Se)}else throw new Error("PARSE");Ye=c.fromHex(re)}catch(Ce){if(Ce.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(pe&&we.hasHighS())return!1;Ae&&(H=e.hash(H));const{r:nt,s:De}=we,st=T(H),Tt=l(De),ln=s(st*Tt),Ee=s(nt*Tt),ne=(te=c.BASE.multiplyAndAddUnsafe(Ye,ln,Ee))==null?void 0:te.toAffine();return ne?s(ne.x)===nt:!1}return{CURVE:e,getPublicKey:x,getSharedSecret:S,sign:j,verify:Z,ProjectivePoint:c,Signature:y,utils:v}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function LX(t){return{hash:t,hmac:(e,...n)=>_P(t,e,PY(...n)),randomBytes:OY}}function $X(t,e){const n=r=>DX({...t,...LX(r)});return Object.freeze({...n(e),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const tL=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),LC=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),UX=BigInt(1),X5=BigInt(2),$C=(t,e)=>(t+e/X5)/e;function FX(t){const e=tL,n=BigInt(3),r=BigInt(6),i=BigInt(11),a=BigInt(22),o=BigInt(23),s=BigInt(44),l=BigInt(88),c=t*t*t%e,u=c*c*t%e,f=ga(u,n,e)*u%e,h=ga(f,n,e)*u%e,d=ga(h,X5,e)*c%e,g=ga(d,i,e)*d%e,p=ga(g,a,e)*g%e,m=ga(p,s,e)*p%e,y=ga(m,l,e)*m%e,v=ga(y,s,e)*p%e,x=ga(v,n,e)*u%e,A=ga(x,o,e)*g%e,S=ga(A,r,e)*c%e,E=ga(S,X5,e);if(!Z5.eql(Z5.sqr(E),t))throw new Error("Cannot find square root");return E}const Z5=TX(tL,void 0,void 0,{sqrt:FX}),ri=$X({a:BigInt(0),b:BigInt(7),Fp:Z5,n:LC,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=LC,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-UX*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=n,o=BigInt("0x100000000000000000000000000000000"),s=$C(a*t,e),l=$C(-r*t,e);let c=Ti(t-s*n-l*i,e),u=Ti(-s*r-l*a,e);const f=c>o,h=u>o;if(f&&(c=e-c),h&&(u=e-u),c>o||u>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:f,k1:c,k2neg:h,k2:u}}}},IY);BigInt(0);ri.ProjectivePoint;const l1="0x0000000000000000000000000000000000000000",UC="0x0000000000000000000000000000000000000000000000000000000000000000",FC=BigInt(0),jC=BigInt(1),zC=BigInt(2),HC=BigInt(27),GC=BigInt(28),Kv=BigInt(35),Th={};function VC(t){return nh(oi(t),32)}var Gd,Vd,Qd,tf,na;let Al=(na=class{constructor(e,n,r,i){M(this,Gd,void 0);M(this,Vd,void 0);M(this,Qd,void 0);M(this,tf,void 0);L2(e,Th,"Signature"),O(this,Gd,n),O(this,Vd,r),O(this,Qd,i),O(this,tf,null)}get r(){return b(this,Gd)}set r(e){K(Td(e)===32,"invalid r","value",e),O(this,Gd,it(e))}get s(){return b(this,Vd)}set s(e){K(Td(e)===32,"invalid s","value",e);const n=it(e);K(parseInt(n.substring(0,3))<8,"non-canonical s","value",n),O(this,Vd,n)}get v(){return b(this,Qd)}set v(e){const n=Bt(e,"value");K(n===27||n===28,"invalid v","v",e),O(this,Qd,n)}get networkV(){return b(this,tf)}get legacyChainId(){const e=this.networkV;return e==null?null:na.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=Jt(this.s);return this.yParity&&(e[0]|=128),it(e)}get compactSerialized(){return Zn([this.r,this.yParityAndS])}get serialized(){return Zn([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new na(Th,this.r,this.s,this.v);return this.networkV&&O(e,tf,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const n=et(e,"v");return n==HC||n==GC?FC:(K(n>=Kv,"invalid EIP-155 v","v",e),(n-Kv)/zC)}static getChainIdV(e,n){return et(e)*zC+BigInt(35+n-27)}static getNormalizedV(e){const n=et(e);return n===FC||n===HC?27:n===jC||n===GC?28:(K(n>=Kv,"invalid v","v",e),n&jC?27:28)}static from(e){function n(c,u){K(c,u,"signature",e)}if(e==null)return new na(Th,UC,UC,27);if(typeof e=="string"){const c=Jt(e,"signature");if(c.length===64){const u=it(c.slice(0,32)),f=c.slice(32,64),h=f[0]&128?28:27;return f[0]&=127,new na(Th,u,it(f),h)}if(c.length===65){const u=it(c.slice(0,32)),f=c.slice(32,64);n((f[0]&128)===0,"non-canonical s");const h=na.getNormalizedV(c[64]);return new na(Th,u,it(f),h)}n(!1,"invalid raw signature length")}if(e instanceof na)return e.clone();const r=e.r;n(r!=null,"missing r");const i=VC(r),a=function(c,u){if(c!=null)return VC(c);if(u!=null){n(gn(u,32),"invalid yParityAndS");const f=Jt(u);return f[0]&=127,it(f)}n(!1,"missing s")}(e.s,e.yParityAndS);n((Jt(a)[0]&128)==0,"non-canonical s");const{networkV:o,v:s}=function(c,u,f){if(c!=null){const h=et(c);return{networkV:h>=Kv?h:void 0,v:na.getNormalizedV(h)}}if(u!=null)return n(gn(u,32),"invalid yParityAndS"),{v:Jt(u)[0]&128?28:27};if(f!=null){switch(Bt(f,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}n(!1,"invalid yParity")}n(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),l=new na(Th,i,a,s);return o&&O(l,tf,o),n(e.yParity==null||Bt(e.yParity,"sig.yParity")===l.yParity,"yParity mismatch"),n(e.yParityAndS==null||e.yParityAndS===l.yParityAndS,"yParityAndS mismatch"),l}},Gd=new WeakMap,Vd=new WeakMap,Qd=new WeakMap,tf=new WeakMap,na);var Bs,il;let DP=(il=class{constructor(e){M(this,Bs,void 0);K(Td(e)===32,"invalid private key","privateKey","[REDACTED]"),O(this,Bs,it(e))}get privateKey(){return b(this,Bs)}get publicKey(){return il.computePublicKey(b(this,Bs))}get compressedPublicKey(){return il.computePublicKey(b(this,Bs),!0)}sign(e){K(Td(e)===32,"invalid digest length","digest",e);const n=ri.sign(ai(e),ai(b(this,Bs)),{lowS:!0});return Al.from({r:us(n.r,32),s:us(n.s,32),v:n.recovery?28:27})}computeSharedSecret(e){const n=il.computePublicKey(e);return it(ri.getSharedSecret(ai(b(this,Bs)),Jt(n),!1))}static computePublicKey(e,n){let r=Jt(e,"key");if(r.length===32){const a=ri.getPublicKey(r,!!n);return it(a)}if(r.length===64){const a=new Uint8Array(65);a[0]=4,a.set(r,1),r=a}const i=ri.ProjectivePoint.fromHex(r);return it(i.toRawBytes(n))}static recoverPublicKey(e,n){K(Td(e)===32,"invalid digest length","digest",e);const r=Al.from(n);let i=ri.Signature.fromCompact(ai(Zn([r.r,r.s])));i=i.addRecoveryBit(r.yParity);const a=i.recoverPublicKey(ai(e));return K(a!=null,"invalid signautre for digest","signature",n),"0x"+a.toHex(!1)}static addPoints(e,n,r){const i=ri.ProjectivePoint.fromHex(il.computePublicKey(e).substring(2)),a=ri.ProjectivePoint.fromHex(il.computePublicKey(n).substring(2));return"0x"+i.add(a).toHex(!!r)}},Bs=new WeakMap,il);const jX=BigInt(0),zX=BigInt(36);function QC(t){t=t.toLowerCase();const e=t.substring(2).split(""),n=new Uint8Array(40);for(let i=0;i<40;i++)n[i]=e[i].charCodeAt(0);const r=Jt(Sn(n));for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(r[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const LP={};for(let t=0;t<10;t++)LP[String(t)]=String(t);for(let t=0;t<26;t++)LP[String.fromCharCode(65+t)]=String(10+t);const KC=15;function HX(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(r=>LP[r]).join("");for(;e.length>=KC;){let r=e.substring(0,KC);e=parseInt(r,10)%97+e.substring(r.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}const GX=function(){const t={};for(let e=0;e<36;e++){const n="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[n]=BigInt(e)}return t}();function VX(t){t=t.toLowerCase();let e=jX;for(let n=0;ne.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 this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return b(this,nf)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return b(this,nf)===!0?-1:b(this,nf)===!1?this.value.length:null}static from(e,n){return new yo(As,e,n)}static uint8(e){return Ve(e,8)}static uint16(e){return Ve(e,16)}static uint24(e){return Ve(e,24)}static uint32(e){return Ve(e,32)}static uint40(e){return Ve(e,40)}static uint48(e){return Ve(e,48)}static uint56(e){return Ve(e,56)}static uint64(e){return Ve(e,64)}static uint72(e){return Ve(e,72)}static uint80(e){return Ve(e,80)}static uint88(e){return Ve(e,88)}static uint96(e){return Ve(e,96)}static uint104(e){return Ve(e,104)}static uint112(e){return Ve(e,112)}static uint120(e){return Ve(e,120)}static uint128(e){return Ve(e,128)}static uint136(e){return Ve(e,136)}static uint144(e){return Ve(e,144)}static uint152(e){return Ve(e,152)}static uint160(e){return Ve(e,160)}static uint168(e){return Ve(e,168)}static uint176(e){return Ve(e,176)}static uint184(e){return Ve(e,184)}static uint192(e){return Ve(e,192)}static uint200(e){return Ve(e,200)}static uint208(e){return Ve(e,208)}static uint216(e){return Ve(e,216)}static uint224(e){return Ve(e,224)}static uint232(e){return Ve(e,232)}static uint240(e){return Ve(e,240)}static uint248(e){return Ve(e,248)}static uint256(e){return Ve(e,256)}static uint(e){return Ve(e,256)}static int8(e){return Ve(e,-8)}static int16(e){return Ve(e,-16)}static int24(e){return Ve(e,-24)}static int32(e){return Ve(e,-32)}static int40(e){return Ve(e,-40)}static int48(e){return Ve(e,-48)}static int56(e){return Ve(e,-56)}static int64(e){return Ve(e,-64)}static int72(e){return Ve(e,-72)}static int80(e){return Ve(e,-80)}static int88(e){return Ve(e,-88)}static int96(e){return Ve(e,-96)}static int104(e){return Ve(e,-104)}static int112(e){return Ve(e,-112)}static int120(e){return Ve(e,-120)}static int128(e){return Ve(e,-128)}static int136(e){return Ve(e,-136)}static int144(e){return Ve(e,-144)}static int152(e){return Ve(e,-152)}static int160(e){return Ve(e,-160)}static int168(e){return Ve(e,-168)}static int176(e){return Ve(e,-176)}static int184(e){return Ve(e,-184)}static int192(e){return Ve(e,-192)}static int200(e){return Ve(e,-200)}static int208(e){return Ve(e,-208)}static int216(e){return Ve(e,-216)}static int224(e){return Ve(e,-224)}static int232(e){return Ve(e,-232)}static int240(e){return Ve(e,-240)}static int248(e){return Ve(e,-248)}static int256(e){return Ve(e,-256)}static int(e){return Ve(e,-256)}static bytes1(e){return Zt(e,1)}static bytes2(e){return Zt(e,2)}static bytes3(e){return Zt(e,3)}static bytes4(e){return Zt(e,4)}static bytes5(e){return Zt(e,5)}static bytes6(e){return Zt(e,6)}static bytes7(e){return Zt(e,7)}static bytes8(e){return Zt(e,8)}static bytes9(e){return Zt(e,9)}static bytes10(e){return Zt(e,10)}static bytes11(e){return Zt(e,11)}static bytes12(e){return Zt(e,12)}static bytes13(e){return Zt(e,13)}static bytes14(e){return Zt(e,14)}static bytes15(e){return Zt(e,15)}static bytes16(e){return Zt(e,16)}static bytes17(e){return Zt(e,17)}static bytes18(e){return Zt(e,18)}static bytes19(e){return Zt(e,19)}static bytes20(e){return Zt(e,20)}static bytes21(e){return Zt(e,21)}static bytes22(e){return Zt(e,22)}static bytes23(e){return Zt(e,23)}static bytes24(e){return Zt(e,24)}static bytes25(e){return Zt(e,25)}static bytes26(e){return Zt(e,26)}static bytes27(e){return Zt(e,27)}static bytes28(e){return Zt(e,28)}static bytes29(e){return Zt(e,29)}static bytes30(e){return Zt(e,30)}static bytes31(e){return Zt(e,31)}static bytes32(e){return Zt(e,32)}static address(e){return new yo(As,"address",e)}static bool(e){return new yo(As,"bool",!!e)}static bytes(e){return new yo(As,"bytes",e)}static string(e){return new yo(As,"string",e)}static array(e,n){throw new Error("not implemented yet")}static tuple(e,n){throw new Error("not implemented yet")}static overrides(e){return new yo(As,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===WC}static dereference(e,n){if(yo.isTyped(e)){if(e.type!==n)throw new Error(`invalid type: expecetd ${n}, got ${e.type}`);return e.value}return e}},nf=new WeakMap,yo),QX=class extends Il{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,n){let r=Di.dereference(n,"string");try{r=fn(r)}catch(i){return this._throwError(i.message,n)}return e.writeValue(r)}decode(e){return fn(us(e.readValue(),20))}},KX=class extends Il{constructor(n){super(n.name,n.type,"_",n.dynamic);R(this,"coder");this.coder=n}defaultValue(){return this.coder.defaultValue()}encode(n,r){return this.coder.encode(n,r)}decode(n){return this.coder.decode(n)}};function iL(t,e,n){let r=[];if(Array.isArray(n))r=n;else if(n&&typeof n=="object"){let l={};r=e.map(c=>{const u=c.localName;return ye(u,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:c},value:n}),ye(!l[u],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:c},value:n}),l[u]=!0,n[u]})}else K(!1,"invalid tuple value","tuple",n);K(e.length===r.length,"types/value length mismatch","tuple",n);let i=new Q5,a=new Q5,o=[];e.forEach((l,c)=>{let u=r[c];if(l.dynamic){let f=a.length;l.encode(a,u);let h=i.writeUpdatableValue();o.push(d=>{h(d+f)})}else l.encode(i,u)}),o.forEach(l=>{l(i.length)});let s=t.appendWriter(i);return s+=t.appendWriter(a),s}function aL(t,e){let n=[],r=[],i=t.subReader(0);return e.forEach(a=>{let o=null;if(a.dynamic){let s=t.readIndex(),l=i.subReader(s);try{o=a.decode(l)}catch(c){if(Qr(c,"BUFFER_OVERRUN"))throw c;o=c,o.baseType=a.name,o.name=a.localName,o.type=a.type}}else try{o=a.decode(t)}catch(s){if(Qr(s,"BUFFER_OVERRUN"))throw s;o=s,o.baseType=a.name,o.name=a.localName,o.type=a.type}if(o==null)throw new Error("investigate");n.push(o),r.push(a.localName||null)}),kD.fromItems(n,r)}let WX=class extends Il{constructor(n,r,i){const a=n.type+"["+(r>=0?r:"")+"]",o=r===-1||n.dynamic;super("array",a,i,o);R(this,"coder");R(this,"length");gt(this,{coder:n,length:r})}defaultValue(){const n=this.coder.defaultValue(),r=[];for(let i=0;io||i<-(o+tZ))&&this._throwError("value out-of-bounds",r),i=wD(i,8*si)}else(iey(a,this.size*8))&&this._throwError("value out-of-bounds",r);return n.writeValue(i)}decode(n){let r=ey(n.readValue(),this.size*8);return this.signed&&(r=tY(r,this.size*8)),r}},iZ=class extends oL{constructor(e){super("string",e)}defaultValue(){return""}encode(e,n){return super.encode(e,fl(Di.dereference(n,"string")))}decode(e){return Vw(super.decode(e))}},Wv=class extends Il{constructor(n,r){let i=!1;const a=[];n.forEach(s=>{s.dynamic&&(i=!0),a.push(s.type)});const o="tuple("+a.join(",")+")";super("tuple",o,r,i);R(this,"coders");gt(this,{coders:Object.freeze(n.slice())})}defaultValue(){const n=[];this.coders.forEach(i=>{n.push(i.defaultValue())});const r=this.coders.reduce((i,a)=>{const o=a.localName;return o&&(i[o]||(i[o]=0),i[o]++),i},{});return this.coders.forEach((i,a)=>{let o=i.localName;!o||r[o]!==1||(o==="length"&&(o="_length"),n[o]==null&&(n[o]=n[a]))}),Object.freeze(n)}encode(n,r){const i=Di.dereference(r,"tuple");return iL(n,this.coders,i)}decode(n){return aL(n,this.coders)}};function ih(t){return Sn(fl(t))}var aZ="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgE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vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const JC=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),YC=4;function oZ(t){let e=0;function n(){return t[e++]<<8|t[e++]}let r=n(),i=1,a=[0,1];for(let S=1;S>--l&1}const f=31,h=2**f,d=h>>>1,g=d>>1,p=h-1;let m=0;for(let S=0;S1;){let B=E+T>>>1;S>>1|u(),C=C<<1^d,N=(N^d)<<1|d|1;v=C,x=1+N-C}let A=r-4;return y.map(S=>{switch(S-A){case 3:return A+65792+(t[s++]<<16|t[s++]<<8|t[s++]);case 2:return A+256+(t[s++]<<8|t[s++]);case 1:return A+t[s++];default:return S-1}})}function sZ(t){let e=0;return()=>t[e++]}function sL(t){return sZ(oZ(lZ(t)))}function lZ(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,a)=>e[i.charCodeAt(0)]=a);let n=t.length,r=new Uint8Array(6*n>>3);for(let i=0,a=0,o=0,s=0;i=8&&(r[a++]=s>>(o-=8));return r}function cZ(t){return t&1?~t>>1:t>>1}function uZ(t,e){let n=Array(t);for(let r=0,i=0;r{let e=c1(t);if(e.length)return e})}function cL(t){let e=[];for(;;){let n=t();if(n==0)break;e.push(fZ(n,t))}for(;;){let n=t()-1;if(n<0)break;e.push(hZ(n,t))}return e.flat()}function u1(t){let e=[];for(;;){let n=t(e.length);if(!n)break;e.push(n)}return e}function uL(t,e,n){let r=Array(t).fill().map(()=>[]);for(let i=0;ir[o].push(a));return r}function fZ(t,e){let n=1+e(),r=e(),i=u1(e);return uL(i.length,1+t,e).flatMap((o,s)=>{let[l,...c]=o;return Array(i[s]).fill().map((u,f)=>{let h=f*r;return[l+f*n,c.map(d=>d+h)]})})}function hZ(t,e){let n=1+e();return uL(n,1+t,e).map(i=>[i[0],i.slice(1)])}function dZ(t){let e=[],n=c1(t);return i(r([]),[]),e;function r(a){let o=t(),s=u1(()=>{let l=c1(t).map(c=>n[c]);if(l.length)return r(l)});return{S:o,B:s,Q:a}}function i({S:a,B:o},s,l){if(!(a&4&&l===s[s.length-1])){a&2&&(l=s[s.length-1]),a&1&&e.push(s);for(let c of o)for(let u of c.Q)i(c,[...s,u],l)}}}function pZ(t){return t.toString(16).toUpperCase().padStart(2,"0")}function fL(t){return`{${pZ(t)}}`}function gZ(t){let e=[];for(let n=0,r=t.length;n>24&255}function pL(t){return t&16777215}let q5,XC,e3,zb;function EZ(){let t=sL(mZ);q5=new Map(lL(t).flatMap((e,n)=>e.map(r=>[r,n+1<<24]))),XC=new Set(c1(t)),e3=new Map,zb=new Map;for(let[e,n]of cL(t)){if(!XC.has(e)&&n.length==2){let[r,i]=n,a=zb.get(r);a||(a=new Map,zb.set(r,a)),a.set(i,e)}e3.set(e,n.reverse())}}function gL(t){return t>=f1&&t=Kw&&t=Ww&&eJw&&e0&&i(Jw+c)}else{let o=e3.get(a);o?n.push(...o):i(a)}if(!n.length)break;a=n.pop()}if(r&&e.length>1){let a=ny(e[0]);for(let o=1;o0&&i>=o)o==0?(e.push(r,...n),n.length=0,r=s):n.push(s),i=o;else{let l=SZ(r,s);l>=0?r=l:i==0&&o==0?(e.push(r),r=s):(n.push(s),i=o)}}return r>=0&&e.push(r,...n),e}function mL(t){return yL(t).map(pL)}function OZ(t){return PZ(yL(t))}const ZC=45,vL=".",bL=65039,wL=1,Xw=t=>Array.from(t);function h1(t,e){return t.P.has(e)||t.Q.has(e)}let TZ=class extends Array{get is_emoji(){return!0}},t3,xL,$u,n3,AL,kd,F6,Dh,Au,qC,r3;function $P(){if(t3)return;let t=sL(aZ);const e=()=>c1(t),n=()=>new Set(e()),r=(u,f)=>f.forEach(h=>u.add(h));t3=new Map(cL(t)),xL=n(),$u=e(),n3=new Set(e().map(u=>$u[u])),$u=new Set($u),AL=n(),n();let i=lL(t),a=t();const o=()=>{let u=new Set;return e().forEach(f=>r(u,i[f])),r(u,e()),u};kd=u1(u=>{let f=u1(t).map(h=>h+96);if(f.length){let h=u>=a;f[0]-=32,f=Ep(f),h&&(f=`Restricted[${f}]`);let d=o(),g=o(),p=!t();return{N:f,P:d,Q:g,M:p,R:h}}}),F6=n(),Dh=new Map;let s=e().concat(Xw(F6)).sort((u,f)=>u-f);s.forEach((u,f)=>{let h=t(),d=s[f]=h?s[f-h]:{V:[],M:new Map};d.V.push(u),F6.has(u)||Dh.set(u,d)});for(let{V:u,M:f}of new Set(Dh.values())){let h=[];for(let g of u){let p=kd.filter(y=>h1(y,g)),m=h.find(({G:y})=>p.some(v=>y.has(v)));m||(m={G:new Set,V:[]},h.push(m)),m.V.push(g),r(m.G,p)}let d=h.flatMap(g=>Xw(g.G));for(let{G:g,V:p}of h){let m=new Set(d.filter(y=>!g.has(y)));for(let y of p)f.set(y,m)}}Au=new Set;let l=new Set;const c=u=>Au.has(u)?l.add(u):Au.add(u);for(let u of kd){for(let f of u.P)c(f);for(let f of u.Q)c(f)}for(let u of Au)!Dh.has(u)&&!l.has(u)&&Dh.set(u,wL);r(Au,mL(Au)),qC=dZ(t).map(u=>TZ.from(u)).sort(yZ),r3=new Map;for(let u of qC){let f=[r3];for(let h of u){let d=f.map(g=>{let p=g.get(h);return p||(p=new Map,g.set(h,p)),p});h===bL?f.push(...d):f=d}for(let h of f)h.V=u}}function UP(t){return(EL(t)?"":`${FP(G2([t]))} `)+fL(t)}function FP(t){return`"${t}"‎`}function CZ(t){if(t.length>=4&&t[2]==ZC&&t[3]==ZC)throw new Error(`invalid label extension: "${Ep(t.slice(0,4))}"`)}function kZ(t){for(let n=t.lastIndexOf(95);n>0;)if(t[--n]!==95)throw new Error("underscore allowed only at start")}function _Z(t){let e=t[0],n=JC.get(e);if(n)throw Ty(`leading ${n}`);let r=t.length,i=-1;for(let a=1;ae&&(e>>=1,t=[...t.slice(0,e),8230,...t.slice(-e)]);let i=0,a=t.length;for(let o=0;o{let a=gZ(i),o={input:a,offset:r};r+=a.length+1;try{let s=o.tokens=$Z(a,e,n),l=s.length,c;if(!l)throw new Error("empty label");let u=o.output=s.flat();if(kZ(u),!(o.emoji=l>1||s[0].is_emoji)&&u.every(h=>h<128))CZ(u),c="ASCII";else{let h=s.flatMap(d=>d.is_emoji?[]:d);if(!h.length)c="Emoji";else{if($u.has(u[0]))throw Ty("leading combining mark");for(let p=1;po.has(s)):Xw(o),!n.length)return}else r.push(i)}if(n){for(let i of n)if(r.every(a=>h1(i,a)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function BZ(t){let e=kd;for(let n of t){let r=e.filter(i=>h1(i,n));if(!r.length)throw kd.some(i=>h1(i,n))?PL(e[0],n):SL(n);if(e=r,r.length==1)break}return e}function DZ(t){return t.map(({input:e,error:n,output:r})=>{if(n){let i=n.message;throw new Error(t.length==1?i:`Invalid label ${FP(G2(e,63))}: ${i}`)}return Ep(r)}).join(vL)}function SL(t){return new Error(`disallowed character: ${UP(t)}`)}function PL(t,e){let n=UP(e),r=kd.find(i=>i.P.has(e));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${t.N} + ${n}`)}function Ty(t){return new Error(`illegal placement: ${t}`)}function LZ(t,e){for(let n of e)if(!h1(t,n))throw PL(t,n);if(t.M){let n=mL(e);for(let r=1,i=n.length;rYC)throw new Error(`excessive non-spacing marks: ${FP(G2(n.slice(r-1,a)))} (${a-r}/${YC})`);r=a}}}function $Z(t,e,n){let r=[],i=[];for(t=t.slice().reverse();t.length;){let a=FZ(t);if(a)i.length&&(r.push(e(i)),i=[]),r.push(n(a));else{let o=t.pop();if(Au.has(o))i.push(o);else{let s=t3.get(o);if(s)i.push(...s);else if(!xL.has(o))throw SL(o)}}}return i.length&&r.push(e(i)),r}function UZ(t){return t.filter(e=>e!=bL)}function FZ(t,e){let n=r3,r,i=t.length;for(;i&&(n=n.get(t[--i]),!!n);){let{V:a}=n;a&&(r=a,e&&e.push(...t.slice(i).reverse()),t.length=i)}return r}const OL=new Uint8Array(32);OL.fill(0);function ek(t){return K(t.length!==0,"invalid ENS name; empty component","comp",t),t}function TL(t){const e=fl(jZ(t)),n=[];if(t.length===0)return n;let r=0;for(let i=0;i{K(r.length<=n,`label ${JSON.stringify(t)} exceeds ${n} bytes`,"name",t);const i=new Uint8Array(r.length+1);return i.set(r,1),i[0]=i.length-1,i})))+"00"}function j6(t,e){return{address:fn(t),storageKeys:e.map((n,r)=>(K(gn(n,32),"invalid slot",`storageKeys[${r}]`,n),n.toLowerCase()))}}function gh(t){if(Array.isArray(t))return t.map((n,r)=>Array.isArray(n)?(K(n.length===2,"invalid slot set",`value[${r}]`,n),j6(n[0],n[1])):(K(n!=null&&typeof n=="object","invalid address-slot set","value",t),j6(n.address,n.storageKeys)));K(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(n=>{const r=t[n].reduce((i,a)=>(i[a]=!0,i),{});return j6(n,Object.keys(r).sort())});return e.sort((n,r)=>n.address.localeCompare(r.address)),e}function HZ(t){let e;return typeof t=="string"?e=DP.computePublicKey(t,!1):e=t.publicKey,fn(Sn("0x"+e.substring(4)).substring(26))}function GZ(t,e){return HZ(DP.recoverPublicKey(t,e))}const pr=BigInt(0),VZ=BigInt(2),QZ=BigInt(27),KZ=BigInt(28),WZ=BigInt(35),JZ=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function V2(t){return t==="0x"?null:fn(t)}function jP(t,e){try{return gh(t)}catch(n){K(!1,n.message,e,t)}}function ov(t,e){return t==="0x"?0:Bt(t,e)}function Xn(t,e){if(t==="0x")return pr;const n=et(t,e);return K(n<=JZ,"value exceeds uint size",e,n),n}function wn(t,e){const n=et(t,"value"),r=oi(n);return K(r.length<=32,"value too large",`tx.${e}`,n),r}function zP(t){return gh(t).map(e=>[e.address,e.storageKeys])}function YZ(t,e){K(Array.isArray(t),`invalid ${e}`,"value",t);for(let n=0;n=0?2:e.pop()}inferTypes(){const e=this.gasPrice!=null,n=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,r=this.accessList!=null,i=b(this,rf)!=null||b(this,af);this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&ye(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),ye(!n||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),ye(this.type!==0||!r,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const a=[];return this.type!=null?a.push(this.type):n?a.push(2):e?(a.push(1),r||a.push(0)):r?(a.push(1),a.push(2)):(i&&this.to||(a.push(0),a.push(1),a.push(2)),a.push(3)),a.sort(),a}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return mo.from(this)}toJSON(){const e=n=>n==null?null:n.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new mo;if(typeof e=="string"){const r=Jt(e);if(r[0]>=127)return mo.from(XZ(r));switch(r[0]){case 1:return mo.from(qZ(r));case 2:return mo.from(ZZ(r));case 3:return mo.from(eq(r))}ye(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const n=new mo;return e.type!=null&&(n.type=e.type),e.to!=null&&(n.to=e.to),e.nonce!=null&&(n.nonce=e.nonce),e.gasLimit!=null&&(n.gasLimit=e.gasLimit),e.gasPrice!=null&&(n.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(n.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(n.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(n.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(n.data=e.data),e.value!=null&&(n.value=e.value),e.chainId!=null&&(n.chainId=e.chainId),e.signature!=null&&(n.signature=Al.from(e.signature)),e.accessList!=null&&(n.accessList=e.accessList),e.blobVersionedHashes!=null&&(n.blobVersionedHashes=e.blobVersionedHashes),e.hash!=null&&(K(n.isSigned(),"unsigned transaction cannot define hash","tx",e),K(n.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(K(n.isSigned(),"unsigned transaction cannot define from","tx",e),K(n.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),n}},$o=new WeakMap,Kd=new WeakMap,Wd=new WeakMap,Jd=new WeakMap,Yd=new WeakMap,Xd=new WeakMap,Zd=new WeakMap,qd=new WeakMap,e0=new WeakMap,t0=new WeakMap,n0=new WeakMap,r0=new WeakMap,rf=new WeakMap,af=new WeakMap,mo);const kL=new Uint8Array(32);kL.fill(0);const tq=BigInt(-1),_L=BigInt(0),NL=BigInt(1),nq=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function rq(t){const e=Jt(t),n=e.length%32;return n?Zn([e,kL.slice(n)]):it(e)}const iq=us(NL,32),aq=us(_L,32),ak={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},z6=["name","version","chainId","verifyingContract","salt"];function ok(t){return function(e){return K(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const oq={name:ok("name"),version:ok("version"),chainId:function(t){const e=et(t,"domain.chainId");return K(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):fd(e)},verifyingContract:function(t){try{return fn(t).toLowerCase()}catch{}K(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=Jt(t,"domain.salt");return K(e.length===32,'invalid domain value "salt"',"domain.salt",t),it(e)}};function H6(t){{const e=t.match(/^(u?)int(\d+)$/);if(e){const n=e[1]==="",r=parseInt(e[2]);K(r%8===0&&r!==0&&r<=256&&e[2]===String(r),"invalid numeric width","type",t);const i=ey(nq,n?r-1:r),a=n?(i+NL)*tq:_L;return function(o){const s=et(o,"value");return K(s>=a&&s<=i,`value out-of-bounds for ${t}`,"value",s),us(n?wD(s,256):s,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const n=parseInt(e[1]);return K(n!==0&&n<=32&&e[1]===String(n),"invalid bytes width","type",t),function(r){const i=Jt(r);return K(i.length===n,`invalid length for ${t}`,"value",r),rq(r)}}}switch(t){case"address":return function(e){return nh(fn(e),32)};case"bool":return function(e){return e?iq:aq};case"bytes":return function(e){return Sn(e)};case"string":return function(e){return ih(e)}}return null}function sk(t,e){return`${t}(${e.map(({name:n,type:r})=>r+" "+n).join(",")})`}function Jv(t){const e=t.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:t}}var ym,Ds,i0,o2,IL,Pi;let lk=(Pi=class{constructor(e){M(this,o2);R(this,"primaryType");M(this,ym,void 0);M(this,Ds,void 0);M(this,i0,void 0);O(this,Ds,new Map),O(this,i0,new Map);const n=new Map,r=new Map,i=new Map,a={};Object.keys(e).forEach(l=>{a[l]=e[l].map(({name:c,type:u})=>{let{base:f,index:h}=Jv(u);return f==="int"&&!e.int&&(f="int256"),f==="uint"&&!e.uint&&(f="uint256"),{name:c,type:f+(h||"")}}),n.set(l,new Set),r.set(l,[]),i.set(l,new Set)}),O(this,ym,JSON.stringify(a));for(const l in a){const c=new Set;for(const u of a[l]){K(!c.has(u.name),`duplicate variable name ${JSON.stringify(u.name)} in ${JSON.stringify(l)}`,"types",e),c.add(u.name);const f=Jv(u.type).base;K(f!==l,`circular type reference to ${JSON.stringify(f)}`,"types",e),!H6(f)&&(K(r.has(f),`unknown type ${JSON.stringify(f)}`,"types",e),r.get(f).push(l),n.get(l).add(f))}}const o=Array.from(r.keys()).filter(l=>r.get(l).length===0);K(o.length!==0,"missing primary type","types",e),K(o.length===1,`ambiguous primary types or unused types: ${o.map(l=>JSON.stringify(l)).join(", ")}`,"types",e),gt(this,{primaryType:o[0]});function s(l,c){K(!c.has(l),`circular type reference to ${JSON.stringify(l)}`,"types",e),c.add(l);for(const u of n.get(l))if(r.has(u)){s(u,c);for(const f of c)i.get(f).add(u)}c.delete(l)}s(this.primaryType,new Set);for(const[l,c]of i){const u=Array.from(c);u.sort(),b(this,Ds).set(l,sk(l,a[l])+u.map(f=>sk(f,a[f])).join(""))}}get types(){return JSON.parse(b(this,ym))}getEncoder(e){let n=b(this,i0).get(e);return n||(n=ie(this,o2,IL).call(this,e),b(this,i0).set(e,n)),n}encodeType(e){const n=b(this,Ds).get(e);return K(n,`unknown type: ${JSON.stringify(e)}`,"name",e),n}encodeData(e,n){return this.getEncoder(e)(n)}hashStruct(e,n){return Sn(this.encodeData(e,n))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,n,r){if(H6(e))return r(e,n);const i=Jv(e).array;if(i)return K(i.count===-1||i.count===n.length,`array length mismatch; expected length ${i.count}`,"value",n),n.map(o=>this._visit(i.prefix,o,r));const a=this.types[e];if(a)return a.reduce((o,{name:s,type:l})=>(o[s]=this._visit(l,n[s],r),o),{});K(!1,`unknown type: ${e}`,"type",e)}visit(e,n){return this._visit(this.primaryType,e,n)}static from(e){return new Pi(e)}static getPrimaryType(e){return Pi.from(e).primaryType}static hashStruct(e,n,r){return Pi.from(n).hashStruct(e,r)}static hashDomain(e){const n=[];for(const r in e){if(e[r]==null)continue;const i=ak[r];K(i,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),n.push({name:r,type:i})}return n.sort((r,i)=>z6.indexOf(r.name)-z6.indexOf(i.name)),Pi.hashStruct("EIP712Domain",{EIP712Domain:n},e)}static encode(e,n,r){return Zn(["0x1901",Pi.hashDomain(e),Pi.from(n).hash(r)])}static hash(e,n,r){return Sn(Pi.encode(e,n,r))}static async resolveNames(e,n,r,i){e=Object.assign({},e);for(const s in e)e[s]==null&&delete e[s];const a={};e.verifyingContract&&!gn(e.verifyingContract,20)&&(a[e.verifyingContract]="0x");const o=Pi.from(n);o.visit(r,(s,l)=>(s==="address"&&!gn(l,20)&&(a[l]="0x"),l));for(const s in a)a[s]=await i(s);return e.verifyingContract&&a[e.verifyingContract]&&(e.verifyingContract=a[e.verifyingContract]),r=o.visit(r,(s,l)=>s==="address"&&a[l]?a[l]:l),{domain:e,value:r}}static getPayload(e,n,r){Pi.hashDomain(e);const i={},a=[];z6.forEach(l=>{const c=e[l];c!=null&&(i[l]=oq[l](c),a.push({name:l,type:ak[l]}))});const o=Pi.from(n);n=o.types;const s=Object.assign({},n);return K(s.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",n),s.EIP712Domain=a,o.encode(r),{types:s,domain:i,primaryType:o.primaryType,message:o.visit(r,(l,c)=>{if(l.match(/^bytes(\d*)/))return it(Jt(c));if(l.match(/^u?int/))return et(c).toString();switch(l){case"address":return c.toLowerCase();case"bool":return!!c;case"string":return K(typeof c=="string","invalid string","value",c),c}K(!1,"unsupported type","type",l)})}}},ym=new WeakMap,Ds=new WeakMap,i0=new WeakMap,o2=new WeakSet,IL=function(e){{const i=H6(e);if(i)return i}const n=Jv(e).array;if(n){const i=n.prefix,a=this.getEncoder(i);return o=>{K(n.count===-1||n.count===o.length,`array length mismatch; expected length ${n.count}`,"value",o);let s=o.map(a);return b(this,Ds).has(i)&&(s=s.map(Sn)),Sn(Zn(s))}}const r=this.types[e];if(r){const i=ih(b(this,Ds).get(e));return a=>{const o=r.map(({name:s,type:l})=>{const c=this.getEncoder(l)(a[s]);return b(this,Ds).has(l)?Sn(c):c});return o.unshift(i),Zn(o)}}K(!1,`unknown type: ${e}`,"type",e)},Pi);function ci(t){const e=new Set;return t.forEach(n=>e.add(n)),Object.freeze(e)}const sq="external public payable override",lq=ci(sq.split(" ")),RL="constant external internal payable private public pure view override",cq=ci(RL.split(" ")),ML="constructor error event fallback function receive struct",BL=ci(ML.split(" ")),DL="calldata memory storage payable indexed",uq=ci(DL.split(" ")),fq="tuple returns",hq=[ML,DL,fq,RL].join(" "),dq=ci(hq.split(" ")),pq={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},gq=new RegExp("^(\\s*)"),yq=new RegExp("^([0-9]+)"),mq=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),LL=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),$L=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var br,oo,mm,a3,qp;let Rl=(qp=class{constructor(e){M(this,mm);M(this,br,void 0);M(this,oo,void 0);O(this,br,0),O(this,oo,e.slice())}get offset(){return b(this,br)}get length(){return b(this,oo).length-b(this,br)}clone(){return new qp(b(this,oo))}reset(){O(this,br,0)}popKeyword(e){const n=this.peek();if(n.type!=="KEYWORD"||!e.has(n.text))throw new Error(`expected keyword ${n.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const n=this.peek();throw new Error(`expected ${e}; got ${n.type} ${JSON.stringify(n.text)}`)}return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=ie(this,mm,a3).call(this,b(this,br)+1,e.match+1);return O(this,br,e.match+1),n}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=[];for(;b(this,br)=b(this,oo).length)throw new Error("out-of-bounds");return b(this,oo)[b(this,br)]}peekKeyword(e){const n=this.peekType("KEYWORD");return n!=null&&e.has(n)?n:null}peekType(e){if(this.length===0)return null;const n=this.peek();return n.type===e?n.text:null}pop(){const e=this.peek();return vs(this,br)._++,e}toString(){const e=[];for(let n=b(this,br);n`}},br=new WeakMap,oo=new WeakMap,mm=new WeakSet,a3=function(e=0,n=0){return new qp(b(this,oo).slice(e,n).map(r=>Object.freeze(Object.assign({},r,{match:r.match-e,linkBack:r.linkBack-e,linkNext:r.linkNext-e}))))},qp);function ou(t){const e=[],n=o=>{const s=a0&&e[e.length-1].type==="NUMBER"){const f=e.pop().text;u=f+u,e[e.length-1].value=Bt(f)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=u}continue}if(s=o.match(mq),s){if(l.text=s[1],a+=l.text.length,dq.has(l.text)){l.type="KEYWORD";continue}if(l.text.match($L)){l.type="TYPE";continue}l.type="ID";continue}if(s=o.match(yq),s){l.text=s[1],l.type="NUMBER",a+=l.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${a}`)}return new Rl(e.map(o=>Object.freeze(o)))}function ck(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 Q2(t,e){if(e.peekKeyword(BL)){const n=e.pop().text;if(n!==t)throw new Error(`expected ${t}, got ${n}`)}return e.popType("ID")}function El(t,e){const n=new Set;for(;;){const r=t.peekType("KEYWORD");if(r==null||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 UL(t){let e=El(t,cq);return ck(e,ci("constant payable nonpayable".split(" "))),ck(e,ci("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 hl(t,e){return t.popParams().map(n=>gi.from(n,e))}function FL(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return et(t.pop().text);throw new Error("invalid gas")}return null}function ah(t){if(t.length)throw new Error(`unexpected tokens at offset ${t.offset}: ${t.toString()}`)}const vq=new RegExp(/^(.*)\[([0-9]*)\]$/);function uk(t){const e=t.match($L);if(K(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const n=parseInt(e[2]);K(n!==0&&n<=32,"invalid bytes length","type",t)}else if(e[3]){const n=parseInt(e[3]);K(n!==0&&n<=256&&n%8===0,"invalid numeric width","type",t)}return t}const kn={},$i=Symbol.for("_ethers_internal"),fk="_ParamTypeInternal",hk="_ErrorInternal",dk="_EventInternal",pk="_ConstructorInternal",gk="_FallbackInternal",yk="_FunctionInternal",mk="_StructInternal";var a0,Hb,Oi;let gi=(Oi=class{constructor(e,n,r,i,a,o,s,l){M(this,a0);R(this,"name");R(this,"type");R(this,"baseType");R(this,"indexed");R(this,"components");R(this,"arrayLength");R(this,"arrayChildren");if(L2(e,kn,"ParamType"),Object.defineProperty(this,$i,{value:fk}),o&&(o=Object.freeze(o.slice())),i==="array"){if(s==null||l==null)throw new Error("")}else if(s!=null||l!=null)throw new Error("");if(i==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");gt(this,{name:n,type:r,baseType:i,indexed:a,components:o,arrayLength:s,arrayChildren:l})}format(e){if(e==null&&(e="sighash"),e==="json"){const r=this.name||"";if(this.isArray()){const a=JSON.parse(this.arrayChildren.format("json"));return a.name=r,a.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(a)}const i={type:this.baseType==="tuple"?"tuple":this.type,name:r};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(a=>JSON.parse(a.format(e)))),JSON.stringify(i)}let n="";return this.isArray()?(n+=this.arrayChildren.format(e),n+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?n+="("+this.components.map(r=>r.format(e)).join(e==="full"?", ":",")+")":n+=this.type,e!=="sighash"&&(this.indexed===!0&&(n+=" indexed"),e==="full"&&this.name&&(n+=" "+this.name)),n}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,n){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const r=this;return e.map(i=>r.arrayChildren.walk(i,n))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const r=this;return e.map((i,a)=>r.components[a].walk(i,n))}return n(this.type,e)}async walkAsync(e,n){const r=[],i=[e];return ie(this,a0,Hb).call(this,r,e,n,a=>{i[0]=a}),r.length&&await Promise.all(r),i[0]}static from(e,n){if(Oi.isParamType(e))return e;if(typeof e=="string")try{return Oi.from(ou(e),n)}catch{K(!1,"invalid param type","obj",e)}else if(e instanceof Rl){let s="",l="",c=null;El(e,ci(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(l="tuple",c=e.popParams().map(p=>Oi.from(p)),s=`tuple(${c.map(p=>p.format()).join(",")})`):(s=uk(e.popType("TYPE")),l=s);let u=null,f=null;for(;e.length&&e.peekType("BRACKET");){const p=e.pop();u=new Oi(kn,"",s,l,null,c,f,u),f=p.value,s+=p.text,l="array",c=null}let h=null;if(El(e,uq).has("indexed")){if(!n)throw new Error("");h=!0}const g=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new Oi(kn,g,s,l,h,c,f,u)}const r=e.name;K(!r||typeof r=="string"&&r.match(LL),"invalid name","obj.name",r);let i=e.indexed;i!=null&&(K(n,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let a=e.type,o=a.match(vq);if(o){const s=parseInt(o[2]||"-1"),l=Oi.from({type:o[1],components:e.components});return new Oi(kn,r||"",a,"array",i,null,s,l)}if(a==="tuple"||a.startsWith("tuple(")||a.startsWith("(")){const s=e.components!=null?e.components.map(c=>Oi.from(c)):null;return new Oi(kn,r||"",a,"tuple",i,s,null,null)}return a=uk(e.type),new Oi(kn,r||"",a,a,i,null,null,null)}static isParamType(e){return e&&e[$i]===fk}},a0=new WeakSet,Hb=function(e,n,r,i){if(this.isArray()){if(!Array.isArray(n))throw new Error("invalid array value");if(this.arrayLength!==-1&&n.length!==this.arrayLength)throw new Error("array is wrong length");const o=this.arrayChildren,s=n.slice();s.forEach((l,c)=>{var u;ie(u=o,a0,Hb).call(u,e,l,r,f=>{s[c]=f})}),i(s);return}if(this.isTuple()){const o=this.components;let s;if(Array.isArray(n))s=n.slice();else{if(n==null||typeof n!="object")throw new Error("invalid tuple value");s=o.map(l=>{if(!l.name)throw new Error("cannot use object value with unnamed components");if(!(l.name in n))throw new Error(`missing value for component ${l.name}`);return n[l.name]})}if(s.length!==this.components.length)throw new Error("array is wrong length");s.forEach((l,c)=>{var u;ie(u=o[c],a0,Hb).call(u,e,l,r,f=>{s[c]=f})}),i(s);return}const a=r(this.type,n);a.then?e.push(async function(){i(await a)}()):i(a)},Oi),K2=class o3{constructor(e,n,r){R(this,"type");R(this,"inputs");L2(e,kn,"Fragment"),r=Object.freeze(r.slice()),gt(this,{type:n,inputs:r})}static from(e){if(typeof e=="string"){try{o3.from(JSON.parse(e))}catch{}return o3.from(ou(e))}if(e instanceof Rl)switch(e.peekKeyword(BL)){case"constructor":return Vb.from(e);case"error":return ks.from(e);case"event":return Gb.from(e);case"fallback":case"receive":return vk.from(e);case"function":return Qb.from(e);case"struct":return G6.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return Vb.from(e);case"error":return ks.from(e);case"event":return Gb.from(e);case"fallback":case"receive":return vk.from(e);case"function":return Qb.from(e);case"struct":return G6.from(e)}ye(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}K(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return Vb.isFragment(e)}static isError(e){return ks.isFragment(e)}static isEvent(e){return Gb.isFragment(e)}static isFunction(e){return Qb.isFragment(e)}static isStruct(e){return G6.isFragment(e)}},W2=class extends K2{constructor(n,r,i,a){super(n,r,a);R(this,"name");K(typeof i=="string"&&i.match(LL),"invalid identifier","name",i),a=Object.freeze(a.slice()),gt(this,{name:i})}};function d1(t,e){return"("+e.map(n=>n.format(t)).join(t==="full"?", ":",")+")"}let ks=class ry extends W2{constructor(e,n,r){super(e,"error",n,r),Object.defineProperty(this,$i,{value:hk})}get selector(){return ih(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(e)))});const n=[];return e!=="sighash"&&n.push("error"),n.push(this.name+d1(e,this.inputs)),n.join(" ")}static from(e){if(ry.isFragment(e))return e;if(typeof e=="string")return ry.from(ou(e));if(e instanceof Rl){const n=Q2("error",e),r=hl(e);return ah(e),new ry(kn,n,r)}return new ry(kn,e.name,e.inputs?e.inputs.map(gi.from):[])}static isFragment(e){return e&&e[$i]===hk}},Gb=class Lh extends W2{constructor(n,r,i,a){super(n,"event",r,i);R(this,"anonymous");Object.defineProperty(this,$i,{value:dk}),gt(this,{anonymous:a})}get topicHash(){return ih(this.format("sighash"))}format(n){if(n==null&&(n="sighash"),n==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(n)))});const r=[];return n!=="sighash"&&r.push("event"),r.push(this.name+d1(n,this.inputs)),n!=="sighash"&&this.anonymous&&r.push("anonymous"),r.join(" ")}static getTopicHash(n,r){return r=(r||[]).map(a=>gi.from(a)),new Lh(kn,n,r,!1).topicHash}static from(n){if(Lh.isFragment(n))return n;if(typeof n=="string")try{return Lh.from(ou(n))}catch{K(!1,"invalid event fragment","obj",n)}else if(n instanceof Rl){const r=Q2("event",n),i=hl(n,!0),a=!!El(n,ci(["anonymous"])).has("anonymous");return ah(n),new Lh(kn,r,i,a)}return new Lh(kn,n.name,n.inputs?n.inputs.map(r=>gi.from(r,!0)):[],!!n.anonymous)}static isFragment(n){return n&&n[$i]===dk}},Vb=class iy extends K2{constructor(n,r,i,a,o){super(n,r,i);R(this,"payable");R(this,"gas");Object.defineProperty(this,$i,{value:pk}),gt(this,{payable:a,gas:o})}format(n){if(ye(n!=null&&n!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),n==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(n)))});const r=[`constructor${d1(n,this.inputs)}`];return this.payable&&r.push("payable"),this.gas!=null&&r.push(`@${this.gas.toString()}`),r.join(" ")}static from(n){if(iy.isFragment(n))return n;if(typeof n=="string")try{return iy.from(ou(n))}catch{K(!1,"invalid constuctor fragment","obj",n)}else if(n instanceof Rl){El(n,ci(["constructor"]));const r=hl(n),i=!!El(n,lq).has("payable"),a=FL(n);return ah(n),new iy(kn,"constructor",r,i,a)}return new iy(kn,"constructor",n.inputs?n.inputs.map(gi.from):[],!!n.payable,n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[$i]===pk}},vk=class Eu extends K2{constructor(n,r,i){super(n,"fallback",r);R(this,"payable");Object.defineProperty(this,$i,{value:gk}),gt(this,{payable:i})}format(n){const r=this.inputs.length===0?"receive":"fallback";if(n==="json"){const i=this.payable?"payable":"nonpayable";return JSON.stringify({type:r,stateMutability:i})}return`${r}()${this.payable?" payable":""}`}static from(n){if(Eu.isFragment(n))return n;if(typeof n=="string")try{return Eu.from(ou(n))}catch{K(!1,"invalid fallback fragment","obj",n)}else if(n instanceof Rl){const r=n.toString(),i=n.peekKeyword(ci(["fallback","receive"]));if(K(i,"type must be fallback or receive","obj",r),n.popKeyword(ci(["fallback","receive"]))==="receive"){const l=hl(n);return K(l.length===0,"receive cannot have arguments","obj.inputs",l),El(n,ci(["payable"])),ah(n),new Eu(kn,[],!0)}let o=hl(n);o.length?K(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(l=>l.format("minimal")).join(", ")):o=[gi.from("bytes")];const s=UL(n);if(K(s==="nonpayable"||s==="payable","fallback cannot be constants","obj.stateMutability",s),El(n,ci(["returns"])).has("returns")){const l=hl(n);K(l.length===1&&l[0].type==="bytes","invalid fallback outputs","obj.outputs",l.map(c=>c.format("minimal")).join(", "))}return ah(n),new Eu(kn,o,s==="payable")}if(n.type==="receive")return new Eu(kn,[],!0);if(n.type==="fallback"){const r=[gi.from("bytes")],i=n.stateMutability==="payable";return new Eu(kn,r,i)}K(!1,"invalid fallback description","obj",n)}static isFragment(n){return n&&n[$i]===gk}},Qb=class $h extends W2{constructor(n,r,i,a,o,s){super(n,"function",r,a);R(this,"constant");R(this,"outputs");R(this,"stateMutability");R(this,"payable");R(this,"gas");Object.defineProperty(this,$i,{value:yk}),o=Object.freeze(o.slice()),gt(this,{constant:i==="view"||i==="pure",gas:s,outputs:o,payable:i==="payable",stateMutability:i})}get selector(){return ih(this.format("sighash")).substring(0,10)}format(n){if(n==null&&(n="sighash"),n==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(n))),outputs:this.outputs.map(i=>JSON.parse(i.format(n)))});const r=[];return n!=="sighash"&&r.push("function"),r.push(this.name+d1(n,this.inputs)),n!=="sighash"&&(this.stateMutability!=="nonpayable"&&r.push(this.stateMutability),this.outputs&&this.outputs.length&&(r.push("returns"),r.push(d1(n,this.outputs))),this.gas!=null&&r.push(`@${this.gas.toString()}`)),r.join(" ")}static getSelector(n,r){return r=(r||[]).map(a=>gi.from(a)),new $h(kn,n,"view",r,[],null).selector}static from(n){if($h.isFragment(n))return n;if(typeof n=="string")try{return $h.from(ou(n))}catch{K(!1,"invalid function fragment","obj",n)}else if(n instanceof Rl){const i=Q2("function",n),a=hl(n),o=UL(n);let s=[];El(n,ci(["returns"])).has("returns")&&(s=hl(n));const l=FL(n);return ah(n),new $h(kn,i,o,a,s,l)}let r=n.stateMutability;return r==null&&(r="payable",typeof n.constant=="boolean"?(r="view",n.constant||(r="payable",typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable"))):typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable")),new $h(kn,n.name,r,n.inputs?n.inputs.map(gi.from):[],n.outputs?n.outputs.map(gi.from):[],n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[$i]===yk}},G6=class Kb extends W2{constructor(e,n,r){super(e,"struct",n,r),Object.defineProperty(this,$i,{value:mk})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return Kb.from(ou(e))}catch{K(!1,"invalid struct fragment","obj",e)}else if(e instanceof Rl){const n=Q2("struct",e),r=hl(e);return ah(e),new Kb(kn,n,r)}return new Kb(kn,e.name,e.inputs?e.inputs.map(gi.from):[])}static isFragment(e){return e&&e[$i]===mk}};const ko=new Map;ko.set(0,"GENERIC_PANIC");ko.set(1,"ASSERT_FALSE");ko.set(17,"OVERFLOW");ko.set(18,"DIVIDE_BY_ZERO");ko.set(33,"ENUM_RANGE_ERROR");ko.set(34,"BAD_STORAGE_DATA");ko.set(49,"STACK_UNDERFLOW");ko.set(50,"ARRAY_RANGE_ERROR");ko.set(65,"OUT_OF_MEMORY");ko.set(81,"UNINITIALIZED_FUNCTION_CALL");const bq=new RegExp(/^bytes([0-9]*)$/),wq=new RegExp(/^(u?int)([0-9]*)$/);let V6=null,bk=1024;function xq(t,e,n,r){let i="missing revert data",a=null;const o=null;let s=null;if(n){i="execution reverted";const c=Jt(n);if(n=it(n),c.length===0)i+=" (no data present; likely require(false) occurred",a="require(false)";else if(c.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(it(c.slice(0,4))==="0x08c379a0")try{a=r.decode(["string"],c.slice(4))[0],s={signature:"Error(string)",name:"Error",args:[a]},i+=`: ${JSON.stringify(a)}`}catch{i+=" (could not decode reason; invalid string data)"}else if(it(c.slice(0,4))==="0x4e487b71")try{const u=Number(r.decode(["uint256"],c.slice(4))[0]);s={signature:"Panic(uint256)",name:"Panic",args:[u]},a=`Panic due to ${ko.get(u)||"UNKNOWN"}(${u})`,i+=`: ${a}`}catch{i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const l={to:e.to?fn(e.to):null,data:e.data||"0x"};return e.from&&(l.from=fn(e.from)),qn(i,"CALL_EXCEPTION",{action:t,data:n,reason:a,transaction:l,invocation:o,revert:s})}var ac,Uh,eg;let s3=(eg=class{constructor(){M(this,ac)}getDefaultValue(e){const n=e.map(i=>ie(this,ac,Uh).call(this,gi.from(i)));return new Wv(n,"_").defaultValue()}encode(e,n){mD(n.length,e.length,"types/values length mismatch");const r=e.map(o=>ie(this,ac,Uh).call(this,gi.from(o))),i=new Wv(r,"_"),a=new Q5;return i.encode(a,n),a.data}decode(e,n,r){const i=e.map(o=>ie(this,ac,Uh).call(this,gi.from(o)));return new Wv(i,"_").decode(new wY(n,r,bk))}static _setDefaultMaxInflation(e){K(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),bk=e}static defaultAbiCoder(){return V6==null&&(V6=new eg),V6}static getBuiltinCallException(e,n,r){return xq(e,n,r,eg.defaultAbiCoder())}},ac=new WeakSet,Uh=function(e){if(e.isArray())return new WX(ie(this,ac,Uh).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new Wv(e.components.map(r=>ie(this,ac,Uh).call(this,r)),e.name);switch(e.baseType){case"address":return new QX(e.name);case"bool":return new JX(e.name);case"string":return new iZ(e.name);case"bytes":return new YX(e.name);case"":return new qX(e.name)}let n=e.type.match(wq);if(n){let r=parseInt(n[2]||"256");return K(r!==0&&r<=256&&r%8===0,"invalid "+n[1]+" bit length","param",e),new rZ(r/8,n[1]==="int",e.name)}if(n=e.type.match(bq),n){let r=parseInt(n[1]);return K(r!==0&&r<=32,"invalid bytes length","param",e),new XX(r,e.name)}K(!1,"invalid type","type",e.type)},eg),Aq=class{constructor(e,n,r){R(this,"fragment");R(this,"name");R(this,"signature");R(this,"topic");R(this,"args");const i=e.name,a=e.format();gt(this,{fragment:e,name:i,signature:a,topic:n,args:r})}},Eq=class{constructor(e,n,r,i){R(this,"fragment");R(this,"name");R(this,"args");R(this,"signature");R(this,"selector");R(this,"value");const a=e.name,o=e.format();gt(this,{fragment:e,name:a,args:r,signature:o,selector:n,value:i})}},Sq=class{constructor(e,n,r){R(this,"fragment");R(this,"name");R(this,"args");R(this,"signature");R(this,"selector");const i=e.name,a=e.format();gt(this,{fragment:e,name:i,args:r,signature:a,selector:n})}},wk=class{constructor(e){R(this,"hash");R(this,"_isIndexed");gt(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}};const xk={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"},Ak={"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&&xk[t.toString()]&&(e=xk[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};var Uo,Fo,jo,Dr,o0,Wb,s0,Jb,$c;let GP=($c=class{constructor(e){M(this,o0);M(this,s0);R(this,"fragments");R(this,"deploy");R(this,"fallback");R(this,"receive");M(this,Uo,void 0);M(this,Fo,void 0);M(this,jo,void 0);M(this,Dr,void 0);let n=[];typeof e=="string"?n=JSON.parse(e):n=e,O(this,jo,new Map),O(this,Uo,new Map),O(this,Fo,new Map);const r=[];for(const o of n)try{r.push(K2.from(o))}catch(s){console.log(`[Warning] Invalid Fragment ${JSON.stringify(o)}:`,s.message)}gt(this,{fragments:Object.freeze(r)});let i=null,a=!1;O(this,Dr,this.getAbiCoder()),this.fragments.forEach((o,s)=>{let l;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}gt(this,{deploy:o});return;case"fallback":o.inputs.length===0?a=!0:(K(!i||o.payable!==i.payable,"conflicting fallback fragments",`fragments[${s}]`,o),i=o,a=i.payable);return;case"function":l=b(this,jo);break;case"event":l=b(this,Fo);break;case"error":l=b(this,Uo);break;default:return}const c=o.format();l.has(c)||l.set(c,o)}),this.deploy||gt(this,{deploy:Vb.from("constructor()")}),gt(this,{fallback:i,receive:a})}format(e){const n=e?"minimal":"full";return this.fragments.map(i=>i.format(n))}formatJson(){const e=this.fragments.map(n=>n.format("json"));return JSON.stringify(e.map(n=>JSON.parse(n)))}getAbiCoder(){return s3.defaultAbiCoder()}getFunctionName(e){const n=ie(this,o0,Wb).call(this,e,null,!1);return K(n,"no matching function","key",e),n.name}hasFunction(e){return!!ie(this,o0,Wb).call(this,e,null,!1)}getFunction(e,n){return ie(this,o0,Wb).call(this,e,n||null,!0)}forEachFunction(e){const n=Array.from(b(this,jo).keys());n.sort((r,i)=>r.localeCompare(i));for(let r=0;rr.localeCompare(i));for(let r=0;r1){const a=i.map(o=>JSON.stringify(o.format())).join(", ");K(!1,`ambiguous error description (i.e. ${a})`,"name",e)}return i[0]}if(e=ks.from(e).format(),e==="Error(string)")return ks.from("error Error(string)");if(e==="Panic(uint256)")return ks.from("error Panic(uint256)");const r=b(this,Uo).get(e);return r||null}forEachError(e){const n=Array.from(b(this,Uo).keys());n.sort((r,i)=>r.localeCompare(i));for(let r=0;ra.type==="string"?ih(o):a.type==="bytes"?Sn(it(o)):(a.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":a.type.match(/^u?int/)?o=us(o):a.type.match(/^bytes/)?o=eY(o,32):a.type==="address"&&b(this,Dr).encode(["address"],[o]),nh(it(o),32));for(n.forEach((a,o)=>{const s=e.inputs[o];if(!s.indexed){K(a==null,"cannot filter non-indexed parameters; must be null","contract."+s.name,a);return}a==null?r.push(null):s.baseType==="array"||s.baseType==="tuple"?K(!1,"filtering with tuples or arrays not supported","contract."+s.name,a):Array.isArray(a)?r.push(a.map(l=>i(s,l))):r.push(i(s,a))});r.length&&r[r.length-1]===null;)r.pop();return r}encodeEventLog(e,n){if(typeof e=="string"){const o=this.getEvent(e);K(o,"unknown event","eventFragment",e),e=o}const r=[],i=[],a=[];return e.anonymous||r.push(e.topicHash),K(n.length===e.inputs.length,"event arguments/values mismatch","values",n),e.inputs.forEach((o,s)=>{const l=n[s];if(o.indexed)if(o.type==="string")r.push(ih(l));else if(o.type==="bytes")r.push(Sn(l));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");r.push(b(this,Dr).encode([o.type],[l]))}else i.push(o),a.push(l)}),{data:b(this,Dr).encode(i,a),topics:r}}decodeEventLog(e,n,r){if(typeof e=="string"){const d=this.getEvent(e);K(d,"unknown event","eventFragment",e),e=d}if(r!=null&&!e.anonymous){const d=e.topicHash;K(gn(r[0],32)&&r[0].toLowerCase()===d,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}const i=[],a=[],o=[];e.inputs.forEach((d,g)=>{d.indexed?d.type==="string"||d.type==="bytes"||d.baseType==="tuple"||d.baseType==="array"?(i.push(gi.from({type:"bytes32",name:d.name})),o.push(!0)):(i.push(d),o.push(!1)):(a.push(d),o.push(!1))});const s=r!=null?b(this,Dr).decode(i,Zn(r)):null,l=b(this,Dr).decode(a,n,!0),c=[],u=[];let f=0,h=0;return e.inputs.forEach((d,g)=>{let p=null;if(d.indexed)if(s==null)p=new wk(null);else if(o[g])p=new wk(s[h++]);else try{p=s[h++]}catch(m){p=m}else try{p=l[f++]}catch(m){p=m}c.push(p),u.push(d.name||null)}),kD.fromItems(c,u)}parseTransaction(e){const n=Jt(e.data,"tx.data"),r=et(e.value!=null?e.value:0,"tx.value"),i=this.getFunction(it(n.slice(0,4)));if(!i)return null;const a=b(this,Dr).decode(i.inputs,n.slice(4));return new Eq(i,i.selector,a,r)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const n=this.getEvent(e.topics[0]);return!n||n.anonymous?null:new Aq(n,n.topicHash,this.decodeEventLog(n,e.data,e.topics))}parseError(e){const n=it(e),r=this.getError(Un(n,0,4));if(!r)return null;const i=b(this,Dr).decode(r.inputs,Un(n,4));return new Sq(r,r.selector,i)}static from(e){return e instanceof $c?e:typeof e=="string"?new $c(JSON.parse(e)):typeof e.format=="function"?new $c(e.format("json")):new $c(e)}},Uo=new WeakMap,Fo=new WeakMap,jo=new WeakMap,Dr=new WeakMap,o0=new WeakSet,Wb=function(e,n,r){if(gn(e)){const a=e.toLowerCase();for(const o of b(this,jo).values())if(a===o.selector)return o;return null}if(e.indexOf("(")===-1){const a=[];for(const[o,s]of b(this,jo))o.split("(")[0]===e&&a.push(s);if(n){const o=n.length>0?n[n.length-1]:null;let s=n.length,l=!0;Di.isTyped(o)&&o.type==="overrides"&&(l=!1,s--);for(let c=a.length-1;c>=0;c--){const u=a[c].inputs.length;u!==s&&(!l||u!==s-1)&&a.splice(c,1)}for(let c=a.length-1;c>=0;c--){const u=a[c].inputs;for(let f=0;f=u.length){if(n[f].type==="overrides")continue;a.splice(c,1);break}if(n[f].type!==u[f].baseType){a.splice(c,1);break}}}}if(a.length===1&&n&&n.length!==a[0].inputs.length){const o=n[n.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&a.splice(0,1)}if(a.length===0)return null;if(a.length>1&&r){const o=a.map(s=>JSON.stringify(s.format())).join(", ");K(!1,`ambiguous function description (i.e. matches ${o})`,"key",e)}return a[0]}const i=b(this,jo).get(Qb.from(e).format());return i||null},s0=new WeakSet,Jb=function(e,n,r){if(gn(e)){const a=e.toLowerCase();for(const o of b(this,Fo).values())if(a===o.topicHash)return o;return null}if(e.indexOf("(")===-1){const a=[];for(const[o,s]of b(this,Fo))o.split("(")[0]===e&&a.push(s);if(n){for(let o=a.length-1;o>=0;o--)a[o].inputs.length=0;o--){const s=a[o].inputs;for(let l=0;l1&&r){const o=a.map(s=>JSON.stringify(s.format())).join(", ");K(!1,`ambiguous event description (i.e. matches ${o})`,"key",e)}return a[0]}const i=b(this,Fo).get(Gb.from(e).format());return i||null},$c);const jL=BigInt(0);function Cy(t){return t??null}function Kn(t){return t==null?null:t.toString()}let Ek=class{constructor(e,n,r){R(this,"gasPrice");R(this,"maxFeePerGas");R(this,"maxPriorityFeePerGas");gt(this,{gasPrice:Cy(e),maxFeePerGas:Cy(n),maxPriorityFeePerGas:Cy(r)})}toJSON(){const{gasPrice:e,maxFeePerGas:n,maxPriorityFeePerGas:r}=this;return{_type:"FeeData",gasPrice:Kn(e),maxFeePerGas:Kn(n),maxPriorityFeePerGas:Kn(r)}}};function Zw(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=it(t.data));const n="chainId,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of n)!(i in t)||t[i]==null||(e[i]=et(t[i],`request.${i}`));const r="type,nonce".split(/,/);for(const i of r)!(i in t)||t[i]==null||(e[i]=Bt(t[i],`request.${i}`));return t.accessList&&(e.accessList=gh(t.accessList)),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipRead=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),e}var Ls,nM;let Pq=(nM=class{constructor(e,n){R(this,"provider");R(this,"number");R(this,"hash");R(this,"timestamp");R(this,"parentHash");R(this,"parentBeaconBlockRoot");R(this,"nonce");R(this,"difficulty");R(this,"gasLimit");R(this,"gasUsed");R(this,"stateRoot");R(this,"receiptsRoot");R(this,"blobGasUsed");R(this,"excessBlobGas");R(this,"miner");R(this,"extraData");R(this,"baseFeePerGas");M(this,Ls,void 0);O(this,Ls,e.transactions.map(r=>typeof r!="string"?new VP(r,n):r)),gt(this,{provider:n,hash:Cy(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,extraData:e.extraData,baseFeePerGas:Cy(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return b(this,Ls).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=b(this,Ls).slice();return e.length===0?[]:(ye(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:n,extraData:r,gasLimit:i,gasUsed:a,hash:o,miner:s,nonce:l,number:c,parentHash:u,parentBeaconBlockRoot:f,stateRoot:h,receiptsRoot:d,timestamp:g,transactions:p}=this;return{_type:"Block",baseFeePerGas:Kn(e),difficulty:Kn(n),extraData:r,gasLimit:Kn(i),gasUsed:Kn(a),blobGasUsed:Kn(this.blobGasUsed),excessBlobGas:Kn(this.excessBlobGas),hash:o,miner:s,nonce:l,number:c,parentHash:u,timestamp:g,parentBeaconBlockRoot:f,stateRoot:h,receiptsRoot:d,transactions:p}}[Symbol.iterator](){let e=0;const n=this.transactions;return{next:()=>enew sv(i,n))));let r=jL;e.effectiveGasPrice!=null?r=e.effectiveGasPrice:e.gasPrice!=null&&(r=e.gasPrice),gt(this,{provider:n,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:r,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return b(this,vm)}toJSON(){const{to:e,from:n,contractAddress:r,hash:i,index:a,blockHash:o,blockNumber:s,logsBloom:l,logs:c,status:u,root:f}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:s,contractAddress:r,cumulativeGasUsed:Kn(this.cumulativeGasUsed),from:n,gasPrice:Kn(this.gasPrice),blobGasUsed:Kn(this.blobGasUsed),blobGasPrice:Kn(this.blobGasPrice),gasUsed:Kn(this.gasUsed),hash:i,index:a,logs:c,logsBloom:l,root:f,status:u,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e{if(s)return null;const{blockNumber:h,nonce:d}=await ti({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(d{if(h==null||h.status!==0)return h;ye(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:h.to,from:h.from,data:""},receipt:h})},u=await this.provider.getTransactionReceipt(this.hash);if(r===0)return c(u);if(u){if(await u.confirmations()>=r)return c(u)}else if(await l(),r===0)return null;return await new Promise((h,d)=>{const g=[],p=()=>{g.forEach(y=>y())};if(g.push(()=>{s=!0}),i>0){const y=setTimeout(()=>{p(),d(qn("wait for transaction timeout","TIMEOUT"))},i);g.push(()=>{clearTimeout(y)})}const m=async y=>{if(await y.confirmations()>=r){p();try{h(c(y))}catch(v){d(v)}}};if(g.push(()=>{this.provider.off(this.hash,m)}),this.provider.on(this.hash,m),a>=0){const y=async()=>{try{await l()}catch(v){if(Qr(v,"TRANSACTION_REPLACED")){p(),d(v);return}}s||this.provider.once("block",y)};g.push(()=>{this.provider.off("block",y)}),this.provider.once("block",y)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return ye(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),GL(this)}reorderedEvent(e){return ye(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),ye(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),HL(this,e)}replaceableTransaction(e){K(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const n=new bm(this,this.provider);return O(n,oc,e),n}},oc=new WeakMap,bm);function Oq(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function HL(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function GL(t){return{orphan:"drop-transaction",tx:t}}function Tq(t){return{orphan:"drop-log",log:{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,address:t.address,data:t.data,topics:Object.freeze(t.topics.slice()),index:t.index}}}let QP=class extends sv{constructor(n,r,i){super(n,n.provider);R(this,"interface");R(this,"fragment");R(this,"args");const a=r.decodeEventLog(i,n.data,n.topics);gt(this,{args:a,fragment:i,interface:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}},VL=class extends sv{constructor(n,r){super(n,n.provider);R(this,"error");gt(this,{error:r})}};var l0,iM;let Cq=(iM=class extends zL{constructor(n,r,i){super(i,r);M(this,l0,void 0);O(this,l0,n)}get logs(){return super.logs.map(n=>{const r=n.topics.length?b(this,l0).getEvent(n.topics[0]):null;if(r)try{return new QP(n,b(this,l0),r)}catch(i){return new VL(n,i)}return n})}},l0=new WeakMap,iM);var wm,aM;let KP=(aM=class extends VP{constructor(n,r,i){super(i,r);M(this,wm,void 0);O(this,wm,n)}async wait(n,r){const i=await super.wait(n,r);return i==null?null:new Cq(b(this,wm),this.provider,i)}},wm=new WeakMap,aM),QL=class extends xD{constructor(n,r,i,a){super(n,r,i);R(this,"log");gt(this,{log:a})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}},kq=class extends QL{constructor(e,n,r,i,a){super(e,n,r,new QP(a,e.interface,i));const o=e.interface.decodeEventLog(i,this.log.data,this.log.topics);gt(this,{args:o,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}};const Sk=BigInt(0);function KL(t){return t&&typeof t.call=="function"}function WL(t){return t&&typeof t.estimateGas=="function"}function J2(t){return t&&typeof t.resolveName=="function"}function JL(t){return t&&typeof t.sendTransaction=="function"}function YL(t){if(t!=null){if(J2(t))return t;if(t.provider)return t.provider}}var xm,oM;let _q=(oM=class{constructor(e,n,r){M(this,xm,void 0);R(this,"fragment");if(gt(this,{fragment:n}),n.inputs.lengthr[l]==null?null:s.walkAsync(r[l],(u,f)=>u==="address"?Array.isArray(f)?Promise.all(f.map(h=>li(h,a))):li(f,a):f)));return e.interface.encodeFilterTopics(n,o)}())}getTopicFilter(){return b(this,xm)}},xm=new WeakMap,oM);function oh(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function Uu(t){return t==null?null:t.provider||null}async function WP(t,e){const n=Di.dereference(t,"overrides");K(typeof n=="object","invalid overrides parameter","overrides",t);const r=Zw(n);return K(r.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),K(r.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=r.from),r}async function XL(t,e,n){const r=oh(t,"resolveName"),i=J2(r)?r:null;return await Promise.all(e.map((a,o)=>a.walkAsync(n[o],(s,l)=>(l=Di.dereference(l,s),s==="address"?li(l,i):l))))}function Nq(t){const e=async function(o){const s=await WP(o,["data"]);s.to=await t.getAddress(),s.from&&(s.from=await li(s.from,YL(t.runner)));const l=t.interface,c=et(s.value||Sk,"overrides.value")===Sk,u=(s.data||"0x")==="0x";l.fallback&&!l.fallback.payable&&l.receive&&!u&&!c&&K(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),K(l.fallback||u,"cannot send data to receive-only contract","overrides.data",s.data);const f=l.receive||l.fallback&&l.fallback.payable;return K(f||c,"cannot send value to non-payable fallback","overrides.value",s.value),K(l.fallback||u,"cannot send data to receive-only contract","overrides.data",s.data),s},n=async function(o){const s=oh(t.runner,"call");ye(KL(s),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const l=await e(o);try{return await s.call(l)}catch(c){throw PP(c)&&c.data?t.interface.makeError(c.data,l):c}},r=async function(o){const s=t.runner;ye(JL(s),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const l=await s.sendTransaction(await e(o)),c=Uu(t.runner);return new KP(t.interface,c,l)},i=async function(o){const s=oh(t.runner,"estimateGas");return ye(WL(s),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await s.estimateGas(await e(o))},a=async o=>await r(o);return gt(a,{_contract:t,estimateGas:i,populateTransaction:e,send:r,staticCall:n}),a}function Iq(t,e){const n=function(...c){const u=t.interface.getFunction(e,c);return ye(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:c}}),u},r=async function(...c){const u=n(...c);let f={};if(u.inputs.length+1===c.length&&(f=await WP(c.pop()),f.from&&(f.from=await li(f.from,YL(t.runner)))),u.inputs.length!==c.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const h=await XL(t.runner,u.inputs,c);return Object.assign({},f,await ti({to:t.getAddress(),data:t.interface.encodeFunctionData(u,h)}))},i=async function(...c){const u=await s(...c);return u.length===1?u[0]:u},a=async function(...c){const u=t.runner;ye(JL(u),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const f=await u.sendTransaction(await r(...c)),h=Uu(t.runner);return new KP(t.interface,h,f)},o=async function(...c){const u=oh(t.runner,"estimateGas");return ye(WL(u),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await u.estimateGas(await r(...c))},s=async function(...c){const u=oh(t.runner,"call");ye(KL(u),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const f=await r(...c);let h="0x";try{h=await u.call(f)}catch(g){throw PP(g)&&g.data?t.interface.makeError(g.data,f):g}const d=n(...c);return t.interface.decodeFunctionResult(d,h)},l=async(...c)=>n(...c).constant?await i(...c):await a(...c);return gt(l,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:n,estimateGas:o,populateTransaction:r,send:a,staticCall:i,staticCallResult:s}),Object.defineProperty(l,"fragment",{configurable:!1,enumerable:!0,get:()=>{const c=t.interface.getFunction(e);return ye(c,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),c}}),l}function Rq(t,e){const n=function(...i){const a=t.interface.getEvent(e,i);return ye(a,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:i}}),a},r=function(...i){return new _q(t,n(...i),i)};return gt(r,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:n}),Object.defineProperty(r,"fragment",{configurable:!1,enumerable:!0,get:()=>{const i=t.interface.getEvent(e);return ye(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),i}}),r}const qw=Symbol.for("_ethersInternal_contract"),ZL=new WeakMap;function Mq(t,e){ZL.set(t[qw],e)}function Qi(t){return ZL.get(t[qw])}function Bq(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function JP(t,e){let n,r=null;if(Array.isArray(e)){const a=function(o){if(gn(o,32))return o;const s=t.interface.getEvent(o);return K(s,"unknown fragment","name",o),s.topicHash};n=e.map(o=>o==null?null:Array.isArray(o)?o.map(a):a(o))}else e==="*"?n=[null]:typeof e=="string"?gn(e,32)?n=[e]:(r=t.interface.getEvent(e),K(r,"unknown fragment","event",e),n=[r.topicHash]):Bq(e)?n=await e.getTopicFilter():"fragment"in e?(r=e.fragment,n=[r.topicHash]):K(!1,"unknown event name","event",e);n=n.map(a=>{if(a==null)return null;if(Array.isArray(a)){const o=Array.from(new Set(a.map(s=>s.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return a.toLowerCase()});const i=n.map(a=>a==null?"null":Array.isArray(a)?a.join("|"):a).join("&");return{fragment:r,tag:i,topics:n}}async function ay(t,e){const{subs:n}=Qi(t);return n.get((await JP(t,e)).tag)||null}async function Pk(t,e,n){const r=Uu(t.runner);ye(r,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:i,tag:a,topics:o}=await JP(t,n),{addr:s,subs:l}=Qi(t);let c=l.get(a);if(!c){const f={address:s||t,topics:o},h=m=>{let y=i;if(y==null)try{y=t.interface.getEvent(m.topics[0])}catch{}if(y){const v=y,x=i?t.interface.decodeEventLog(i,m.data,m.topics):[];c3(t,n,x,A=>new kq(t,A,n,v,m))}else c3(t,n,[],v=>new QL(t,v,n,m))};let d=[];c={tag:a,listeners:[],start:()=>{d.length||d.push(r.on(f,h))},stop:async()=>{if(d.length==0)return;let m=d;d=[],await Promise.all(m),r.off(f,h)}},l.set(a,c)}return c}let l3=Promise.resolve();async function Dq(t,e,n,r){await l3;const i=await ay(t,e);if(!i)return!1;const a=i.listeners.length;return i.listeners=i.listeners.filter(({listener:o,once:s})=>{const l=Array.from(n);r&&l.push(r(s?null:o));try{o.call(t,...l)}catch{}return!s}),i.listeners.length===0&&(i.stop(),Qi(t).subs.delete(i.tag)),a>0}async function c3(t,e,n,r){try{await l3}catch{}const i=Dq(t,e,n,r);return l3=i,await i}const Yv=["then"];var LPe,Jf;let u3=(Jf=class{constructor(e,n,r,i){R(this,"target");R(this,"interface");R(this,"runner");R(this,"filters");R(this,LPe);R(this,"fallback");K(typeof e=="string"||rL(e),"invalid value for Contract target","target",e),r==null&&(r=null);const a=GP.from(n);gt(this,{target:e,runner:r,interface:a}),Object.defineProperty(this,qw,{value:{}});let o,s=null,l=null;if(i){const f=Uu(r);l=new KP(this.interface,f,i)}let c=new Map;if(typeof e=="string")if(gn(e))s=e,o=Promise.resolve(e);else{const f=oh(r,"resolveName");if(!J2(f))throw qn("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=f.resolveName(e).then(h=>{if(h==null)throw qn("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return Qi(this).addr=h,h})}else o=e.getAddress().then(f=>{if(f==null)throw new Error("TODO");return Qi(this).addr=f,f});Mq(this,{addrPromise:o,addr:s,deployTx:l,subs:c});const u=new Proxy({},{get:(f,h,d)=>{if(typeof h=="symbol"||Yv.indexOf(h)>=0)return Reflect.get(f,h,d);try{return this.getEvent(h)}catch(g){if(!Qr(g,"INVALID_ARGUMENT")||g.argument!=="key")throw g}},has:(f,h)=>Yv.indexOf(h)>=0?Reflect.has(f,h):Reflect.has(f,h)||this.interface.hasEvent(String(h))});return gt(this,{filters:u}),gt(this,{fallback:a.receive||a.fallback?Nq(this):null}),new Proxy(this,{get:(f,h,d)=>{if(typeof h=="symbol"||h in f||Yv.indexOf(h)>=0)return Reflect.get(f,h,d);try{return f.getFunction(h)}catch(g){if(!Qr(g,"INVALID_ARGUMENT")||g.argument!=="key")throw g}},has:(f,h)=>typeof h=="symbol"||h in f||Yv.indexOf(h)>=0?Reflect.has(f,h):f.interface.hasFunction(h)})}connect(e){return new Jf(this.target,this.interface,e)}attach(e){return new Jf(e,this.interface,this.runner)}async getAddress(){return await Qi(this).addrPromise}async getDeployedCode(){const e=Uu(this.runner);ye(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const n=await e.getCode(await this.getAddress());return n==="0x"?null:n}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const r=Uu(this.runner);return ye(r!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((i,a)=>{const o=async()=>{try{if(await this.getDeployedCode()!=null)return i(this);r.once("block",o)}catch(s){a(s)}};o()})}deploymentTransaction(){return Qi(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),Iq(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),Rq(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,n,r){n==null&&(n=0),r==null&&(r="latest");const{addr:i,addrPromise:a}=Qi(this),o=i||await a,{fragment:s,topics:l}=await JP(this,e),c={address:o,topics:l,fromBlock:n,toBlock:r},u=Uu(this.runner);return ye(u,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await u.getLogs(c)).map(f=>{let h=s;if(h==null)try{h=this.interface.getEvent(f.topics[0])}catch{}if(h)try{return new QP(f,this.interface,h)}catch(d){return new VL(f,d)}return new sv(f,u)})}async on(e,n){const r=await Pk(this,"on",e);return r.listeners.push({listener:n,once:!1}),r.start(),this}async once(e,n){const r=await Pk(this,"once",e);return r.listeners.push({listener:n,once:!0}),r.start(),this}async emit(e,...n){return await c3(this,e,n,null)}async listenerCount(e){if(e){const i=await ay(this,e);return i?i.listeners.length:0}const{subs:n}=Qi(this);let r=0;for(const{listeners:i}of n.values())r+=i.length;return r}async listeners(e){if(e){const i=await ay(this,e);return i?i.listeners.map(({listener:a})=>a):[]}const{subs:n}=Qi(this);let r=[];for(const{listeners:i}of n.values())r=r.concat(i.map(({listener:a})=>a));return r}async off(e,n){const r=await ay(this,e);if(!r)return this;if(n){const i=r.listeners.map(({listener:a})=>a).indexOf(n);i>=0&&r.listeners.splice(i,1)}return(n==null||r.listeners.length===0)&&(r.stop(),Qi(this).subs.delete(r.tag)),this}async removeAllListeners(e){if(e){const n=await ay(this,e);if(!n)return this;n.stop(),Qi(this).subs.delete(n.tag)}else{const{subs:n}=Qi(this);for(const{tag:r,stop:i}of n.values())i(),n.delete(r)}return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return await this.off(e,n)}static buildClass(e){class n extends Jf{constructor(i,a=null){super(i,e,a)}}return n}static from(e,n,r){return r==null&&(r=null),new this(e,n,r)}},LPe=qw,Jf);function Lq(){return u3}let _d=class extends Lq(){};class YP{constructor(e,n,r){R(this,"interface");R(this,"bytecode");R(this,"runner");const i=GP.from(e);n instanceof Uint8Array||(typeof n=="object"&&(n=n.object),n.startsWith("0x")||(n="0x"+n)),n=it(Jt(n)),gt(this,{bytecode:n,interface:i,runner:r||null})}attach(e){return new u3(e,this.interface,this.runner)}async getDeployTransaction(...e){let n={};const r=this.interface.deploy;if(r.inputs.length+1===e.length&&(n=await WP(e.pop())),r.inputs.length!==e.length)throw new Error("incorrect number of arguments to constructor");const i=await XL(this.runner,r.inputs,e),a=Zn([this.bytecode,this.interface.encodeDeploy(i)]);return Object.assign({},n,{data:a})}async deploy(...e){const n=await this.getDeployTransaction(...e);ye(this.runner&&typeof this.runner.sendTransaction=="function","factory runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const r=await this.runner.sendTransaction(n),i=nL(r);return new u3(i,this.interface,this.runner,r)}connect(e){return new YP(this.interface,this.bytecode,e)}static fromSolidity(e,n){K(e!=null,"bad compiler output","output",e),typeof e=="string"&&(e=JSON.parse(e));const r=e.abi;let i="";return e.bytecode?i=e.bytecode:e.evm&&e.evm.bytecode&&(i=e.evm.bytecode),new this(r,i,n)}}function Q6(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):K(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}let $q=class{constructor(e){R(this,"name");gt(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,n){throw new Error("unsupported coin")}async decodeAddress(e,n){throw new Error("unsupported coin")}};const qL=new RegExp("^(ipfs)://(.*)$","i"),Ok=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),qL,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var sc,of,lc,Fh,s2,Xc,e$;let Tk=(Xc=class{constructor(e,n,r){M(this,lc);R(this,"provider");R(this,"address");R(this,"name");M(this,sc,void 0);M(this,of,void 0);gt(this,{provider:e,address:n,name:r}),O(this,sc,null),O(this,of,new _d(n,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return b(this,sc)==null&&O(this,sc,(async()=>{try{return await b(this,of).supportsInterface("0x9061b923")}catch(e){if(Qr(e,"CALL_EXCEPTION"))return!1;throw O(this,sc,null),e}})()),await b(this,sc)}async getAddress(e){if(e==null&&(e=60),e===60)try{const a=await ie(this,lc,Fh).call(this,"addr(bytes32)");return a==null||a===l1?null:a}catch(a){if(Qr(a,"CALL_EXCEPTION"))return null;throw a}if(e>=0&&e<2147483648){let a=e+2147483648;const o=await ie(this,lc,Fh).call(this,"addr(bytes32,uint)",[a]);if(gn(o,20))return fn(o)}let n=null;for(const a of this.provider.plugins)if(a instanceof $q&&a.supportsCoinType(e)){n=a;break}if(n==null)return null;const r=await ie(this,lc,Fh).call(this,"addr(bytes32,uint)",[e]);if(r==null||r==="0x")return null;const i=await n.decodeAddress(e,r);if(i!=null)return i;ye(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:r}})}async getText(e){const n=await ie(this,lc,Fh).call(this,"text(bytes32,string)",[e]);return n==null||n==="0x"?null:n}async getContentHash(){const e=await ie(this,lc,Fh).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const n=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const i=n[1]==="e3010170"?"ipfs":"ipns",a=parseInt(n[4],16);if(n[5].length===a*2)return`${i}://${rY("0x"+n[2])}`}const r=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&r[1].length===64)return`bzz://${r[1]}`;ye(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const n=await this.getText("avatar");if(n==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:n});for(let r=0;r{if(e&&n==null)return null;if(!Array.isArray(n))throw new Error("not an array");return n.map(r=>t(r))}}function lv(t,e){return n=>{const r={};for(const i in t){let a=i;if(e&&i in e&&!(a in n)){for(const o of e[i])if(o in n){a=o;break}}try{const o=t[i](n[a]);o!==void 0&&(r[i]=o)}catch(o){const s=o instanceof Error?o.message:"not-an-error";ye(!1,`invalid value for value.${i} (${s})`,"BAD_DATA",{value:n})}}return r}}function Uq(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}K(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function Pp(t){return K(gn(t,!0),"invalid data","value",t),t}function Vr(t){return K(gn(t,32),"invalid hash","value",t),t}const Fq=lv({address:fn,blockHash:Vr,blockNumber:Bt,data:Pp,index:Bt,removed:Kt(Uq,!1),topics:Y2(Vr),transactionHash:Vr,transactionIndex:Bt},{index:["logIndex"]});function jq(t){return Fq(t)}const zq=lv({hash:Kt(Vr),parentHash:Vr,parentBeaconBlockRoot:Kt(Vr,null),number:Bt,timestamp:Bt,nonce:Kt(Pp),difficulty:et,gasLimit:et,gasUsed:et,stateRoot:Kt(Vr,null),receiptsRoot:Kt(Vr,null),blobGasUsed:Kt(et,null),excessBlobGas:Kt(et,null),miner:Kt(fn),extraData:Pp,baseFeePerGas:Kt(et)});function Hq(t){const e=zq(t);return e.transactions=t.transactions.map(n=>typeof n=="string"?n:t$(n)),e}const Gq=lv({transactionIndex:Bt,blockNumber:Bt,transactionHash:Vr,address:fn,topics:Y2(Vr),data:Pp,index:Bt,blockHash:Vr},{index:["logIndex"]});function Vq(t){return Gq(t)}const Qq=lv({to:Kt(fn,null),from:Kt(fn,null),contractAddress:Kt(fn,null),index:Bt,root:Kt(it),gasUsed:et,blobGasUsed:Kt(et,null),logsBloom:Kt(Pp),blockHash:Vr,hash:Vr,logs:Y2(Vq),blockNumber:Bt,cumulativeGasUsed:et,effectiveGasPrice:Kt(et),blobGasPrice:Kt(et,null),status:Kt(Bt),type:Kt(Bt,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function Kq(t){return Qq(t)}function t$(t){t.to&&et(t.to)===Ck&&(t.to="0x0000000000000000000000000000000000000000");const e=lv({hash:Vr,index:Kt(Bt,void 0),type:n=>n==="0x"||n==null?0:Bt(n),accessList:Kt(gh,null),blobVersionedHashes:Kt(Y2(Vr,!0),null),blockHash:Kt(Vr,null),blockNumber:Kt(Bt,null),transactionIndex:Kt(Bt,null),from:fn,gasPrice:Kt(et),maxPriorityFeePerGas:Kt(et),maxFeePerGas:Kt(et),maxFeePerBlobGas:Kt(et,null),gasLimit:et,to:Kt(fn,null),value:et,nonce:Bt,data:Pp,creates:Kt(fn,null),chainId:Kt(et,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(t);if(e.to==null&&e.creates==null&&(e.creates=nL(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=Al.from(t.signature):e.signature=Al.from(t),e.chainId==null){const n=e.signature.legacyChainId;n!=null&&(e.chainId=n)}return e.blockHash&&et(e.blockHash)===Ck&&(e.blockHash=null),e}const Wq="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";let XP=class n${constructor(e){R(this,"name");gt(this,{name:e})}clone(){return new n$(this.name)}},r$=class i$ extends XP{constructor(n,r){n==null&&(n=0);super(`org.ethers.network.plugins.GasCost#${n||0}`);R(this,"effectiveBlock");R(this,"txBase");R(this,"txCreate");R(this,"txDataZero");R(this,"txDataNonzero");R(this,"txAccessListStorageKey");R(this,"txAccessListAddress");const i={effectiveBlock:n};function a(o,s){let l=(r||{})[o];l==null&&(l=s),K(typeof l=="number",`invalud value for ${o}`,"costs",r),i[o]=l}a("txBase",21e3),a("txCreate",32e3),a("txDataZero",4),a("txDataNonzero",16),a("txAccessListStorageKey",1900),a("txAccessListAddress",2400),gt(this,i)}clone(){return new i$(this.effectiveBlock,this)}},a$=class o$ extends XP{constructor(n,r){super("org.ethers.plugins.network.Ens");R(this,"address");R(this,"targetNetwork");gt(this,{address:n||Wq,targetNetwork:r??1})}clone(){return new o$(this.address,this.targetNetwork)}};var Am,Em,sM;let Jq=(sM=class extends XP{constructor(n,r){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");M(this,Am,void 0);M(this,Em,void 0);O(this,Am,n),O(this,Em,r)}get url(){return b(this,Am)}get processFunc(){return b(this,Em)}clone(){return this}},Am=new WeakMap,Em=new WeakMap,sM);const K6=new Map;var c0,u0,cc,Uc;let Bc=(Uc=class{constructor(e,n){M(this,c0,void 0);M(this,u0,void 0);M(this,cc,void 0);O(this,c0,e),O(this,u0,et(n)),O(this,cc,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return b(this,c0)}set name(e){O(this,c0,e)}get chainId(){return b(this,u0)}set chainId(e){O(this,u0,et(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===et(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===et(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===et(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(b(this,cc).values())}attachPlugin(e){if(b(this,cc).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return b(this,cc).set(e.name,e.clone()),this}getPlugin(e){return b(this,cc).get(e)||null}getPlugins(e){return this.plugins.filter(n=>n.name.split("#")[0]===e)}clone(){const e=new Uc(this.name,this.chainId);return this.plugins.forEach(n=>{e.attachPlugin(n.clone())}),e}computeIntrinsicGas(e){const n=this.getPlugin("org.ethers.plugins.network.GasCost")||new r$;let r=n.txBase;if(e.to==null&&(r+=n.txCreate),e.data)for(let i=2;i9){let i=BigInt(r[1].substring(0,9));r[1].substring(9).match(/^0+$/)||i++,r[1]=i.toString()}return BigInt(r[0]+r[1])}function _k(t){return new Jq(t,async(e,n,r)=>{r.setHeader("User-Agent","ethers");let i;try{const[a,o]=await Promise.all([r.send(),e()]);i=a;const s=i.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:kk(s.maxFee,9),maxPriorityFeePerGas:kk(s.maxPriorityFee,9)}}catch(a){ye(!1,`error encountered with polygon gas station (${JSON.stringify(r.url)})`,"SERVER_ERROR",{request:r,response:i,error:a})}})}let Nk=!1;function Yq(){if(Nk)return;Nk=!0;function t(e,n,r){const i=function(){const a=new Bc(e,n);return r.ensNetwork!=null&&a.attachPlugin(new a$(null,r.ensNetwork)),a.attachPlugin(new r$),(r.plugins||[]).forEach(o=>{a.attachPlugin(o)}),a};Bc.register(e,i),Bc.register(n,i),r.altNames&&r.altNames.forEach(a=>{Bc.register(a,i)})}t("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),t("ropsten",3,{ensNetwork:3}),t("rinkeby",4,{ensNetwork:4}),t("goerli",5,{ensNetwork:5}),t("kovan",42,{ensNetwork:42}),t("sepolia",11155111,{ensNetwork:11155111}),t("holesky",17e3,{ensNetwork:17e3}),t("classic",61,{}),t("classicKotti",6,{}),t("arbitrum",42161,{ensNetwork:1}),t("arbitrum-goerli",421613,{}),t("arbitrum-sepolia",421614,{}),t("base",8453,{ensNetwork:1}),t("base-goerli",84531,{}),t("base-sepolia",84532,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("matic",137,{ensNetwork:1,plugins:[_k("https://gasstation.polygon.technology/v2")]}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[_k("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[]}),t("optimism-goerli",420,{}),t("optimism-sepolia",11155420,{}),t("xdai",100,{ensNetwork:1})}function f3(t){return JSON.parse(JSON.stringify(t))}var $s,Aa,uc,zo,f0,Yb,lM;let Xq=(lM=class{constructor(e){M(this,f0);M(this,$s,void 0);M(this,Aa,void 0);M(this,uc,void 0);M(this,zo,void 0);O(this,$s,e),O(this,Aa,null),O(this,uc,4e3),O(this,zo,-2)}get pollingInterval(){return b(this,uc)}set pollingInterval(e){O(this,uc,e)}start(){b(this,Aa)||(O(this,Aa,b(this,$s)._setTimeout(ie(this,f0,Yb).bind(this),b(this,uc))),ie(this,f0,Yb).call(this))}stop(){b(this,Aa)&&(b(this,$s)._clearTimeout(b(this,Aa)),O(this,Aa,null))}pause(e){this.stop(),e&&O(this,zo,-2)}resume(){this.start()}},$s=new WeakMap,Aa=new WeakMap,uc=new WeakMap,zo=new WeakMap,f0=new WeakSet,Yb=async function(){try{const e=await b(this,$s).getBlockNumber();if(b(this,zo)===-2){O(this,zo,e);return}if(e!==b(this,zo)){for(let n=b(this,zo)+1;n<=e;n++){if(b(this,Aa)==null)return;await b(this,$s).emit("block",n)}O(this,zo,e)}}catch{}b(this,Aa)!=null&&O(this,Aa,b(this,$s)._setTimeout(ie(this,f0,Yb).bind(this),b(this,uc)))},lM);var sf,lf,fc,cM;let ZP=(cM=class{constructor(e){M(this,sf,void 0);M(this,lf,void 0);M(this,fc,void 0);O(this,sf,e),O(this,fc,!1),O(this,lf,n=>{this._poll(n,b(this,sf))})}async _poll(e,n){throw new Error("sub-classes must override this")}start(){b(this,fc)||(O(this,fc,!0),b(this,lf).call(this,-2),b(this,sf).on("block",b(this,lf)))}stop(){b(this,fc)&&(O(this,fc,!1),b(this,sf).off("block",b(this,lf)))}pause(e){this.stop()}resume(){this.start()}},sf=new WeakMap,lf=new WeakMap,fc=new WeakMap,cM);var h0,Us,uM;let Zq=(uM=class extends ZP{constructor(n,r){super(n);M(this,h0,void 0);M(this,Us,void 0);O(this,h0,r),O(this,Us,-2)}pause(n){n&&O(this,Us,-2),super.pause(n)}async _poll(n,r){const i=await r.getBlock(b(this,h0));i!=null&&(b(this,Us)===-2?O(this,Us,i.number):i.number>b(this,Us)&&(r.emit(b(this,h0),i.number),O(this,Us,i.number)))}},h0=new WeakMap,Us=new WeakMap,uM);var l2,fM;let qq=(fM=class extends ZP{constructor(n,r){super(n);M(this,l2,void 0);O(this,l2,f3(r))}async _poll(n,r){throw new Error("@TODO")}},l2=new WeakMap,fM);var d0,hM;let eee=(hM=class extends ZP{constructor(n,r){super(n);M(this,d0,void 0);O(this,d0,r)}async _poll(n,r){const i=await r.getTransactionReceipt(b(this,d0));i&&r.emit(b(this,d0),i)}},d0=new WeakMap,hM);var Fs,p0,g0,hc,Ea,c2,s$,dM;let qP=(dM=class{constructor(e,n){M(this,c2);M(this,Fs,void 0);M(this,p0,void 0);M(this,g0,void 0);M(this,hc,void 0);M(this,Ea,void 0);O(this,Fs,e),O(this,p0,f3(n)),O(this,g0,ie(this,c2,s$).bind(this)),O(this,hc,!1),O(this,Ea,-2)}start(){b(this,hc)||(O(this,hc,!0),b(this,Ea)===-2&&b(this,Fs).getBlockNumber().then(e=>{O(this,Ea,e)}),b(this,Fs).on("block",b(this,g0)))}stop(){b(this,hc)&&(O(this,hc,!1),b(this,Fs).off("block",b(this,g0)))}pause(e){this.stop(),e&&O(this,Ea,-2)}resume(){this.start()}},Fs=new WeakMap,p0=new WeakMap,g0=new WeakMap,hc=new WeakMap,Ea=new WeakMap,c2=new WeakSet,s$=async function(e){if(b(this,Ea)===-2)return;const n=f3(b(this,p0));n.fromBlock=b(this,Ea)+1,n.toBlock=e;const r=await b(this,Fs).getLogs(n);if(r.length===0){b(this,Ea){if(r==null)return"null";if(typeof r=="bigint")return`bigint:${r.toString()}`;if(typeof r=="string")return r.toLowerCase();if(typeof r=="object"&&!Array.isArray(r)){const i=Object.keys(r);return i.sort(),i.reduce((a,o)=>(a[o]=r[o],a),{})}return r})}let l$=class{constructor(e){R(this,"name");gt(this,{name:e})}start(){}stop(){}pause(e){}resume(){}};function ree(t){return JSON.parse(JSON.stringify(t))}function h3(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function W6(t,e){if(t==null)throw new Error("invalid event");if(Array.isArray(t)&&(t={topics:t}),typeof t=="string")switch(t){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:t,tag:t}}if(gn(t,32)){const n=t.toLowerCase();return{type:"transaction",tag:Xb("tx",{hash:n}),hash:n}}if(t.orphan){const n=t;return{type:"orphan",tag:Xb("orphan",n),filter:ree(n)}}if(t.address||t.topics){const n=t,r={topics:(n.topics||[]).map(i=>i==null?null:Array.isArray(i)?h3(i.map(a=>a.toLowerCase())):i.toLowerCase())};if(n.address){const i=[],a=[],o=s=>{gn(s)?i.push(s):a.push((async()=>{i.push(await li(s,e))})())};Array.isArray(n.address)?n.address.forEach(o):o(n.address),a.length&&await Promise.all(a),r.address=h3(i.map(s=>s.toLowerCase()))}return{filter:r,tag:Xb("event",r),type:"event"}}K(!1,"unknown ProviderEvent","event",t)}function J6(){return new Date().getTime()}const iee={cacheTimeout:250,pollingInterval:4e3};var Lr,dc,$r,y0,Zi,cf,pc,js,Sm,Sa,m0,v0,Zr,Gi,Pm,d3,Om,p3,uf,oy,Tm,g3,ff,sy,b0,Zb,pM;let aee=(pM=class{constructor(e,n){M(this,Zr);M(this,Pm);M(this,Om);M(this,uf);M(this,Tm);M(this,ff);M(this,b0);M(this,Lr,void 0);M(this,dc,void 0);M(this,$r,void 0);M(this,y0,void 0);M(this,Zi,void 0);M(this,cf,void 0);M(this,pc,void 0);M(this,js,void 0);M(this,Sm,void 0);M(this,Sa,void 0);M(this,m0,void 0);M(this,v0,void 0);if(O(this,v0,Object.assign({},iee,n||{})),e==="any")O(this,cf,!0),O(this,Zi,null);else if(e){const r=Bc.from(e);O(this,cf,!1),O(this,Zi,Promise.resolve(r)),setTimeout(()=>{this.emit("network",r,null)},0)}else O(this,cf,!1),O(this,Zi,null);O(this,js,-1),O(this,pc,new Map),O(this,Lr,new Map),O(this,dc,new Map),O(this,$r,null),O(this,y0,!1),O(this,Sm,1),O(this,Sa,new Map),O(this,m0,!1)}get pollingInterval(){return b(this,v0).pollingInterval}get provider(){return this}get plugins(){return Array.from(b(this,dc).values())}attachPlugin(e){if(b(this,dc).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return b(this,dc).set(e.name,e.connect(this)),this}getPlugin(e){return b(this,dc).get(e)||null}get disableCcipRead(){return b(this,m0)}set disableCcipRead(e){O(this,m0,!!e)}async ccipReadFetch(e,n,r){if(this.disableCcipRead||r.length===0||e.to==null)return null;const i=e.to.toLowerCase(),a=n.toLowerCase(),o=[];for(let s=0;s=500,`response not found during CCIP fetch: ${f}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:l,errorMessage:f}}),o.push(f)}ye(!1,`error encountered during CCIP fetch: ${o.map(s=>JSON.stringify(s)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:r,errorMessages:o}})}_wrapBlock(e,n){return new Pq(Hq(e),this)}_wrapLog(e,n){return new sv(jq(e),this)}_wrapTransactionReceipt(e,n){return new zL(Kq(e),this)}_wrapTransactionResponse(e,n){return new VP(t$(e),this)}_detectNetwork(){ye(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){ye(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=Bt(await ie(this,Zr,Gi).call(this,{method:"getBlockNumber"}),"%response");return b(this,js)>=0&&O(this,js,e),e}_getAddress(e){return li(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if(gn(e))return gn(e,32)?e:fd(e);if(typeof e=="bigint"&&(e=Bt(e,"blockTag")),typeof e=="number")return e>=0?fd(e):b(this,js)>=0?fd(b(this,js)+e):this.getBlockNumber().then(n=>fd(n+e));K(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const n=(e.topics||[]).map(l=>l==null?null:Array.isArray(l)?h3(l.map(c=>c.toLowerCase())):l.toLowerCase()),r="blockHash"in e?e.blockHash:void 0,i=(l,c,u)=>{let f;switch(l.length){case 0:break;case 1:f=l[0];break;default:l.sort(),f=l}if(r&&(c!=null||u!=null))throw new Error("invalid filter");const h={};return f&&(h.address=f),n.length&&(h.topics=n),c&&(h.fromBlock=c),u&&(h.toBlock=u),r&&(h.blockHash=r),h};let a=[];if(e.address)if(Array.isArray(e.address))for(const l of e.address)a.push(this._getAddress(l));else a.push(this._getAddress(e.address));let o;"fromBlock"in e&&(o=this._getBlockTag(e.fromBlock));let s;return"toBlock"in e&&(s=this._getBlockTag(e.toBlock)),a.filter(l=>typeof l!="string").length||o!=null&&typeof o!="string"||s!=null&&typeof s!="string"?Promise.all([Promise.all(a),o,s]).then(l=>i(l[0],l[1],l[2])):i(a,o,s)}_getTransactionRequest(e){const n=Zw(e),r=[];if(["to","from"].forEach(i=>{if(n[i]==null)return;const a=li(n[i],this);Xv(a)?r.push(async function(){n[i]=await a}()):n[i]=a}),n.blockTag!=null){const i=this._getBlockTag(n.blockTag);Xv(i)?r.push(async function(){n.blockTag=await i}()):n.blockTag=i}return r.length?async function(){return await Promise.all(r),n}():n}async getNetwork(){if(b(this,Zi)==null){const i=(async()=>{try{const a=await this._detectNetwork();return this.emit("network",a,null),a}catch(a){throw b(this,Zi)===i&&O(this,Zi,null),a}})();return O(this,Zi,i),(await i).clone()}const e=b(this,Zi),[n,r]=await Promise.all([e,this._detectNetwork()]);return n.chainId!==r.chainId&&(b(this,cf)?(this.emit("network",r,n),b(this,Zi)===e&&O(this,Zi,Promise.resolve(r))):ye(!1,`network changed: ${n.chainId} => ${r.chainId} `,"NETWORK_ERROR",{event:"changed"})),n.clone()}async getFeeData(){const e=await this.getNetwork(),n=async()=>{const{_block:i,gasPrice:a,priorityFee:o}=await ti({_block:ie(this,Tm,g3).call(this,"latest",!1),gasPrice:(async()=>{try{const u=await ie(this,Zr,Gi).call(this,{method:"getGasPrice"});return et(u,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const u=await ie(this,Zr,Gi).call(this,{method:"getPriorityFee"});return et(u,"%response")}catch{}return null})()});let s=null,l=null;const c=this._wrapBlock(i,e);return c&&c.baseFeePerGas&&(l=o??BigInt("1000000000"),s=c.baseFeePerGas*tee+l),new Ek(a,s,l)},r=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(r){const i=new rh(r.url),a=await r.processFunc(n,this,i);return new Ek(a.gasPrice,a.maxFeePerGas,a.maxPriorityFeePerGas)}return await n()}async estimateGas(e){let n=this._getTransactionRequest(e);return Xv(n)&&(n=await n),et(await ie(this,Zr,Gi).call(this,{method:"estimateGas",transaction:n}),"%response")}async call(e){const{tx:n,blockTag:r}=await ti({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await ie(this,Om,p3).call(this,ie(this,Pm,d3).call(this,n,r,e.enableCcipRead?0:-1))}async getBalance(e,n){return et(await ie(this,uf,oy).call(this,{method:"getBalance"},e,n),"%response")}async getTransactionCount(e,n){return Bt(await ie(this,uf,oy).call(this,{method:"getTransactionCount"},e,n),"%response")}async getCode(e,n){return it(await ie(this,uf,oy).call(this,{method:"getCode"},e,n))}async getStorage(e,n,r){const i=et(n,"position");return it(await ie(this,uf,oy).call(this,{method:"getStorage",position:i},e,r))}async broadcastTransaction(e){const{blockNumber:n,hash:r,network:i}=await ti({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),a=CL.from(e);if(a.hash!==r)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(a,i).replaceableTransaction(n)}async getBlock(e,n){const{network:r,params:i}=await ti({network:this.getNetwork(),params:ie(this,Tm,g3).call(this,e,!!n)});return i==null?null:this._wrapBlock(i,r)}async getTransaction(e){const{network:n,params:r}=await ti({network:this.getNetwork(),params:ie(this,Zr,Gi).call(this,{method:"getTransaction",hash:e})});return r==null?null:this._wrapTransactionResponse(r,n)}async getTransactionReceipt(e){const{network:n,params:r}=await ti({network:this.getNetwork(),params:ie(this,Zr,Gi).call(this,{method:"getTransactionReceipt",hash:e})});if(r==null)return null;if(r.gasPrice==null&&r.effectiveGasPrice==null){const i=await ie(this,Zr,Gi).call(this,{method:"getTransaction",hash:e});if(i==null)throw new Error("report this; could not find tx or effectiveGasPrice");r.effectiveGasPrice=i.gasPrice}return this._wrapTransactionReceipt(r,n)}async getTransactionResult(e){const{result:n}=await ti({network:this.getNetwork(),result:ie(this,Zr,Gi).call(this,{method:"getTransactionResult",hash:e})});return n==null?null:it(n)}async getLogs(e){let n=this._getFilter(e);Xv(n)&&(n=await n);const{network:r,params:i}=await ti({network:this.getNetwork(),params:ie(this,Zr,Gi).call(this,{method:"getLogs",filter:n})});return i.map(a=>this._wrapLog(a,r))}_getProvider(e){ye(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await Tk.fromName(this,e)}async getAvatar(e){const n=await this.getResolver(e);return n?await n.getAvatar():null}async resolveName(e){const n=await this.getResolver(e);return n?await n.getAddress():null}async lookupAddress(e){e=fn(e);const n=i3(e.substring(2).toLowerCase()+".addr.reverse");try{const r=await Tk.getEnsAddress(this),a=await new _d(r,["function resolver(bytes32) view returns (address)"],this).resolver(n);if(a==null||a===l1)return null;const s=await new _d(a,["function name(bytes32) view returns (string)"],this).name(n);return await this.resolveName(s)!==e?null:s}catch(r){if(Qr(r,"BAD_DATA")&&r.value==="0x"||Qr(r,"CALL_EXCEPTION"))return null;throw r}return null}async waitForTransaction(e,n,r){const i=n??1;return i===0?this.getTransactionReceipt(e):new Promise(async(a,o)=>{let s=null;const l=async c=>{try{const u=await this.getTransactionReceipt(e);if(u!=null&&c-u.blockNumber+1>=i){a(u),s&&(clearTimeout(s),s=null);return}}catch(u){console.log("EEE",u)}this.once("block",l)};r!=null&&(s=setTimeout(()=>{s!=null&&(s=null,this.off("block",l),o(qn("timeout","TIMEOUT",{reason:"timeout"})))},r)),l(await this.getBlockNumber())})}async waitForBlock(e){ye(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const n=b(this,Sa).get(e);n&&(n.timer&&clearTimeout(n.timer),b(this,Sa).delete(e))}_setTimeout(e,n){n==null&&(n=0);const r=vs(this,Sm)._++,i=()=>{b(this,Sa).delete(r),e()};if(this.paused)b(this,Sa).set(r,{timer:null,func:i,time:n});else{const a=setTimeout(i,n);b(this,Sa).set(r,{timer:a,func:i,time:J6()})}return r}_forEachSubscriber(e){for(const n of b(this,Lr).values())e(n.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new l$(e.type);case"block":{const n=new Xq(this);return n.pollingInterval=this.pollingInterval,n}case"safe":case"finalized":return new Zq(this,e.type);case"event":return new qP(this,e.filter);case"transaction":return new eee(this,e.hash);case"orphan":return new qq(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,n){for(const r of b(this,Lr).values())if(r.subscriber===e){r.started&&r.subscriber.stop(),r.subscriber=n,r.started&&n.start(),b(this,$r)!=null&&n.pause(b(this,$r));break}}async on(e,n){const r=await ie(this,b0,Zb).call(this,e);return r.listeners.push({listener:n,once:!1}),r.started||(r.subscriber.start(),r.started=!0,b(this,$r)!=null&&r.subscriber.pause(b(this,$r))),this}async once(e,n){const r=await ie(this,b0,Zb).call(this,e);return r.listeners.push({listener:n,once:!0}),r.started||(r.subscriber.start(),r.started=!0,b(this,$r)!=null&&r.subscriber.pause(b(this,$r))),this}async emit(e,...n){const r=await ie(this,ff,sy).call(this,e,n);if(!r||r.listeners.length===0)return!1;const i=r.listeners.length;return r.listeners=r.listeners.filter(({listener:a,once:o})=>{const s=new xD(this,o?null:a,e);try{a.call(this,...n,s)}catch{}return!o}),r.listeners.length===0&&(r.started&&r.subscriber.stop(),b(this,Lr).delete(r.tag)),i>0}async listenerCount(e){if(e){const r=await ie(this,ff,sy).call(this,e);return r?r.listeners.length:0}let n=0;for(const{listeners:r}of b(this,Lr).values())n+=r.length;return n}async listeners(e){if(e){const r=await ie(this,ff,sy).call(this,e);return r?r.listeners.map(({listener:i})=>i):[]}let n=[];for(const{listeners:r}of b(this,Lr).values())n=n.concat(r.map(({listener:i})=>i));return n}async off(e,n){const r=await ie(this,ff,sy).call(this,e);if(!r)return this;if(n){const i=r.listeners.map(({listener:a})=>a).indexOf(n);i>=0&&r.listeners.splice(i,1)}return(!n||r.listeners.length===0)&&(r.started&&r.subscriber.stop(),b(this,Lr).delete(r.tag)),this}async removeAllListeners(e){if(e){const{tag:n,started:r,subscriber:i}=await ie(this,b0,Zb).call(this,e);r&&i.stop(),b(this,Lr).delete(n)}else for(const[n,{started:r,subscriber:i}]of b(this,Lr))r&&i.stop(),b(this,Lr).delete(n);return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return this.off(e,n)}get destroyed(){return b(this,y0)}destroy(){this.removeAllListeners();for(const e of b(this,Sa).keys())this._clearTimeout(e);O(this,y0,!0)}get paused(){return b(this,$r)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(O(this,js,-1),b(this,$r)!=null){if(b(this,$r)==!!e)return;ye(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(n=>n.pause(e)),O(this,$r,!!e);for(const n of b(this,Sa).values())n.timer&&clearTimeout(n.timer),n.time=J6()-n.time}resume(){if(b(this,$r)!=null){this._forEachSubscriber(e=>e.resume()),O(this,$r,null);for(const e of b(this,Sa).values()){let n=e.time;n<0&&(n=0),e.time=J6(),setTimeout(e.func,n)}}}},Lr=new WeakMap,dc=new WeakMap,$r=new WeakMap,y0=new WeakMap,Zi=new WeakMap,cf=new WeakMap,pc=new WeakMap,js=new WeakMap,Sm=new WeakMap,Sa=new WeakMap,m0=new WeakMap,v0=new WeakMap,Zr=new WeakSet,Gi=async function(e){const n=b(this,v0).cacheTimeout;if(n<0)return await this._perform(e);const r=Xb(e.method,e);let i=b(this,pc).get(r);return i||(i=this._perform(e),b(this,pc).set(r,i),setTimeout(()=>{b(this,pc).get(r)===i&&b(this,pc).delete(r)},n)),await i},Pm=new WeakSet,d3=async function(e,n,r){ye(r=0&&n==="latest"&&i.to!=null&&Un(a.data,0,4)==="0x556f1830"){const o=a.data,s=await li(i.to,this);let l;try{l=uee(Un(a.data,4))}catch(f){ye(!1,f.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:o}})}ye(l.sender.toLowerCase()===s.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:o,reason:"OffchainLookup",transaction:i,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:l.errorArgs}});const c=await this.ccipReadFetch(i,l.calldata,l.urls);ye(c!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:a.data,errorArgs:l.errorArgs}});const u={to:s,data:Zn([l.selector,cee([c,l.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:u});try{const f=await ie(this,Pm,d3).call(this,u,n,r+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},u),result:f}),f}catch(f){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},u),error:f}),f}}throw a}},Om=new WeakSet,p3=async function(e){const{value:n}=await ti({network:this.getNetwork(),value:e});return n},uf=new WeakSet,oy=async function(e,n,r){let i=this._getAddress(n),a=this._getBlockTag(r);return(typeof i!="string"||typeof a!="string")&&([i,a]=await Promise.all([i,a])),await ie(this,Om,p3).call(this,ie(this,Zr,Gi).call(this,Object.assign(e,{address:i,blockTag:a})))},Tm=new WeakSet,g3=async function(e,n){if(gn(e,32))return await ie(this,Zr,Gi).call(this,{method:"getBlock",blockHash:e,includeTransactions:n});let r=this._getBlockTag(e);return typeof r!="string"&&(r=await r),await ie(this,Zr,Gi).call(this,{method:"getBlock",blockTag:r,includeTransactions:n})},ff=new WeakSet,sy=async function(e,n){let r=await W6(e,this);return r.type==="event"&&n&&n.length>0&&n[0].removed===!0&&(r=await W6({orphan:"drop-log",log:n[0]},this)),b(this,Lr).get(r.tag)||null},b0=new WeakSet,Zb=async function(e){const n=await W6(e,this),r=n.tag;let i=b(this,Lr).get(r);return i||(i={subscriber:this._getSubscriber(n),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},b(this,Lr).set(r,i)),i},pM);function oee(t,e){try{const n=y3(t,e);if(n)return Vw(n)}catch{}return null}function y3(t,e){if(t==="0x")return null;try{const n=Bt(Un(t,e,e+32)),r=Bt(Un(t,n,n+32));return Un(t,n+32,n+32+r)}catch{}return null}function Ik(t){const e=oi(t);if(e.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(e,32-e.length),n}function see(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const lee=new Uint8Array([]);function cee(t){const e=[];let n=0;for(let r=0;r=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const n=Un(t,0,32);ye(Un(n,0,12)===Un(Rk,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=Un(n,12);try{const r=[],i=Bt(Un(t,32,64)),a=Bt(Un(t,i,i+32)),o=Un(t,i+32);for(let s=0;se[r]),e}function Ch(t,e){if(t.provider)return t.provider;ye(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function Mk(t,e){let n=Zw(e);if(n.to!=null&&(n.to=li(n.to,t)),n.from!=null){const r=n.from;n.from=Promise.all([t.getAddress(),li(r,t)]).then(([i,a])=>(K(i.toLowerCase()===a.toLowerCase(),"transaction from mismatch","tx.from",a),i))}else n.from=t.getAddress();return await ti(n)}let fee=class{constructor(e){R(this,"provider");gt(this,{provider:e||null})}async getNonce(e){return Ch(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await Mk(this,e)}async populateTransaction(e){const n=Ch(this,"populateTransaction"),r=await Mk(this,e);r.nonce==null&&(r.nonce=await this.getNonce("pending")),r.gasLimit==null&&(r.gasLimit=await this.estimateGas(r));const i=await this.provider.getNetwork();if(r.chainId!=null){const o=et(r.chainId);K(o===i.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else r.chainId=i.chainId;const a=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||a)?K(!1,"eip-1559 transaction do not support gasPrice","tx",e):(r.type===0||r.type===1)&&a&&K(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1){const o=await n.getFeeData();ye(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice)}else{const o=await n.getFeeData();if(r.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const s=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=s,r.maxPriorityFeePerGas=s}else r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(ye(!a,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice),r.type=0):ye(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await ti(r)}async estimateGas(e){return Ch(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Ch(this,"call").call(await this.populateCall(e))}async resolveName(e){return await Ch(this,"resolveName").resolveName(e)}async sendTransaction(e){const n=Ch(this,"sendTransaction"),r=await this.populateTransaction(e);delete r.from;const i=CL.from(r);return await n.broadcastTransaction(await this.signTransaction(i))}};function hee(t){return JSON.parse(JSON.stringify(t))}var wi,Ho,hf,gc,df,w0,Cm,m3,km,v3,gM;let c$=(gM=class{constructor(e){M(this,Cm);M(this,km);M(this,wi,void 0);M(this,Ho,void 0);M(this,hf,void 0);M(this,gc,void 0);M(this,df,void 0);M(this,w0,void 0);O(this,wi,e),O(this,Ho,null),O(this,hf,ie(this,Cm,m3).bind(this)),O(this,gc,!1),O(this,df,null),O(this,w0,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,n){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){b(this,gc)||(O(this,gc,!0),ie(this,Cm,m3).call(this,-2))}stop(){b(this,gc)&&(O(this,gc,!1),O(this,w0,!0),ie(this,km,v3).call(this),b(this,wi).off("block",b(this,hf)))}pause(e){e&&ie(this,km,v3).call(this),b(this,wi).off("block",b(this,hf))}resume(){this.start()}},wi=new WeakMap,Ho=new WeakMap,hf=new WeakMap,gc=new WeakMap,df=new WeakMap,w0=new WeakMap,Cm=new WeakSet,m3=async function(e){try{b(this,Ho)==null&&O(this,Ho,this._subscribe(b(this,wi)));let n=null;try{n=await b(this,Ho)}catch(a){if(!Qr(a,"UNSUPPORTED_OPERATION")||a.operation!=="eth_newFilter")throw a}if(n==null){O(this,Ho,null),b(this,wi)._recoverSubscriber(this,this._recover(b(this,wi)));return}const r=await b(this,wi).getNetwork();if(b(this,df)||O(this,df,r),b(this,df).chainId!==r.chainId)throw new Error("chaid changed");if(b(this,w0))return;const i=await b(this,wi).send("eth_getFilterChanges",[n]);await this._emitResults(b(this,wi),i)}catch(n){console.log("@TODO",n)}b(this,wi).once("block",b(this,hf))},km=new WeakSet,v3=function(){const e=b(this,Ho);e&&(O(this,Ho,null),e.then(n=>{b(this,wi).send("eth_uninstallFilter",[n])}))},gM);var pf,yM;let dee=(yM=class extends c${constructor(n,r){super(n);M(this,pf,void 0);O(this,pf,hee(r))}_recover(n){return new qP(n,b(this,pf))}async _subscribe(n){return await n.send("eth_newFilter",[b(this,pf)])}async _emitResults(n,r){for(const i of r)n.emit(b(this,pf),n._wrapLog(i,n._network))}},pf=new WeakMap,yM),pee=class extends c${async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,n){for(const r of n)e.emit("pending",r)}};const gee="bigint,boolean,function,number,string,symbol".split(/,/g);function qb(t){if(t==null||gee.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(qb);if(typeof t=="object")return Object.keys(t).reduce((e,n)=>(e[n]=t[n],e),{});throw new Error(`should not happen: ${t} (${typeof t})`)}function yee(t){return new Promise(e=>{setTimeout(e,t)})}function kh(t){return t&&t.toLowerCase()}function Bk(t){return t&&typeof t.pollingInterval=="number"}const mee={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};let Y6=class extends fee{constructor(n,r){super(n);R(this,"address");r=fn(r),gt(this,{address:r})}connect(n){ye(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(n){return await this.populateCall(n)}async sendUncheckedTransaction(n){const r=qb(n),i=[];if(r.from){const o=r.from;i.push((async()=>{const s=await li(o,this.provider);K(s!=null&&s.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=s})())}else r.from=this.address;if(r.gasLimit==null&&i.push((async()=>{r.gasLimit=await this.provider.estimateGas({...r,from:this.address})})()),r.to!=null){const o=r.to;i.push((async()=>{r.to=await li(o,this.provider)})())}i.length&&await Promise.all(i);const a=this.provider.getRpcTransaction(r);return this.provider.send("eth_sendTransaction",[a])}async sendTransaction(n){const r=await this.provider.getBlockNumber(),i=await this.sendUncheckedTransaction(n);return await new Promise((a,o)=>{const s=[1e3,100];let l=0;const c=async()=>{try{const u=await this.provider.getTransaction(i);if(u!=null){a(u.replaceableTransaction(r));return}}catch(u){if(Qr(u,"CANCELLED")||Qr(u,"BAD_DATA")||Qr(u,"NETWORK_ERROR")){u.info==null&&(u.info={}),u.info.sendTransactionHash=i,o(u);return}if(Qr(u,"INVALID_ARGUMENT")&&(l++,u.info==null&&(u.info={}),u.info.sendTransactionHash=i,l>10)){o(u);return}this.provider.emit("error",qn("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:u}))}this.provider._setTimeout(()=>{c()},s.pop()||4e3)};c()})}async signTransaction(n){const r=qb(n);if(r.from){const a=await li(r.from,this.provider);K(a!=null&&a.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=a}else r.from=this.address;const i=this.provider.getRpcTransaction(r);return await this.provider.send("eth_signTransaction",[i])}async signMessage(n){const r=typeof n=="string"?fl(n):n;return await this.provider.send("personal_sign",[it(r),this.address.toLowerCase()])}async signTypedData(n,r,i){const a=qb(i),o=await lk.resolveNames(n,r,a,async s=>{const l=await li(s);return K(l!=null,"TypedData does not support null address","value",s),l});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(lk.getPayload(o.domain,r,o.value))])}async unlock(n){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),n,null])}async _legacySignMessage(n){const r=typeof n=="string"?fl(n):n;return await this.provider.send("eth_sign",[this.address.toLowerCase(),it(r)])}};var gf,x0,zs,Go,so,Pa,xi,_m,b3,mM;let vee=(mM=class extends aee{constructor(n,r){super(n,r);M(this,_m);M(this,gf,void 0);M(this,x0,void 0);M(this,zs,void 0);M(this,Go,void 0);M(this,so,void 0);M(this,Pa,void 0);M(this,xi,void 0);O(this,x0,1),O(this,gf,Object.assign({},mee,r||{})),O(this,zs,[]),O(this,Go,null),O(this,Pa,null),O(this,xi,null);{let a=null;const o=new Promise(s=>{a=s});O(this,so,{promise:o,resolve:a})}const i=this._getOption("staticNetwork");typeof i=="boolean"?(K(!i||n!=="any","staticNetwork cannot be used on special network 'any'","options",r),i&&n!=null&&O(this,Pa,Bc.from(n))):i&&(K(n==null||i.matches(n),"staticNetwork MUST match network object","options",r),O(this,Pa,i))}_getOption(n){return b(this,gf)[n]}get _network(){return ye(b(this,Pa),"network is not available yet","NETWORK_ERROR"),b(this,Pa)}async _perform(n){if(n.method==="call"||n.method==="estimateGas"){let i=n.transaction;if(i&&i.type!=null&&et(i.type)&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const a=await this.getFeeData();a.maxFeePerGas==null&&a.maxPriorityFeePerGas==null&&(n=Object.assign({},n,{transaction:Object.assign({},i,{type:void 0})}))}}const r=this.getRpcRequest(n);return r!=null?await this.send(r.method,r.args):super._perform(n)}async _detectNetwork(){const n=this._getOption("staticNetwork");if(n)if(n===!0){if(b(this,Pa))return b(this,Pa)}else return n;return b(this,xi)?await b(this,xi):this.ready?(O(this,xi,(async()=>{try{const r=Bc.from(et(await this.send("eth_chainId",[])));return O(this,xi,null),r}catch(r){throw O(this,xi,null),r}})()),await b(this,xi)):(O(this,xi,(async()=>{const r={id:vs(this,x0)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:r});let i;try{i=(await this._send(r))[0],O(this,xi,null)}catch(a){throw O(this,xi,null),this.emit("debug",{action:"receiveRpcError",error:a}),a}if(this.emit("debug",{action:"receiveRpcResult",result:i}),"result"in i)return Bc.from(et(i.result));throw this.getRpcError(r,i)})()),await b(this,xi))}_start(){b(this,so)==null||b(this,so).resolve==null||(b(this,so).resolve(),O(this,so,null),(async()=>{for(;b(this,Pa)==null&&!this.destroyed;)try{O(this,Pa,await this._detectNetwork())}catch(n){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",qn("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:n}})),await yee(1e3)}ie(this,_m,b3).call(this)})())}async _waitUntilReady(){if(b(this,so)!=null)return await b(this,so).promise}_getSubscriber(n){return n.type==="pending"?new pee(this):n.type==="event"?this._getOption("polling")?new qP(this,n.filter):new dee(this,n.filter):n.type==="orphan"&&n.filter.orphan==="drop-log"?new l$("orphan"):super._getSubscriber(n)}get ready(){return b(this,so)==null}getRpcTransaction(n){const r={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(i=>{if(n[i]==null)return;let a=i;i==="gasLimit"&&(a="gas"),r[a]=fd(et(n[i],`tx.${i}`))}),["from","to","data"].forEach(i=>{n[i]!=null&&(r[i]=it(n[i]))}),n.accessList&&(r.accessList=gh(n.accessList)),r}getRpcRequest(n){switch(n.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[kh(n.address),n.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[kh(n.address),n.blockTag]};case"getCode":return{method:"eth_getCode",args:[kh(n.address),n.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[kh(n.address),"0x"+n.position.toString(16),n.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[n.signedTransaction]};case"getBlock":if("blockTag"in n)return{method:"eth_getBlockByNumber",args:[n.blockTag,!!n.includeTransactions]};if("blockHash"in n)return{method:"eth_getBlockByHash",args:[n.blockHash,!!n.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[n.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[n.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(n.transaction),n.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(n.transaction)]};case"getLogs":return n.filter&&n.filter.address!=null&&(Array.isArray(n.filter.address)?n.filter.address=n.filter.address.map(kh):n.filter.address=kh(n.filter.address)),{method:"eth_getLogs",args:[n.filter]}}return null}getRpcError(n,r){const{method:i}=n,{error:a}=r;if(i==="eth_estimateGas"&&a.message){const l=a.message;if(!l.match(/revert/i)&&l.match(/insufficient funds/i))return qn("insufficient funds","INSUFFICIENT_FUNDS",{transaction:n.params[0],info:{payload:n,error:a}})}if(i==="eth_call"||i==="eth_estimateGas"){const l=w3(a),c=s3.getBuiltinCallException(i==="eth_call"?"call":"estimateGas",n.params[0],l?l.data:null);return c.info={error:a,payload:n},c}const o=JSON.stringify(wee(a));if(typeof a.message=="string"&&a.message.match(/user denied|ethers-user-denied/i))return qn("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[i]||"unknown",reason:"rejected",info:{payload:n,error:a}});if(i==="eth_sendRawTransaction"||i==="eth_sendTransaction"){const l=n.params[0];if(o.match(/insufficient funds|base fee exceeds gas limit/i))return qn("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:l,info:{error:a}});if(o.match(/nonce/i)&&o.match(/too low/i))return qn("nonce has already been used","NONCE_EXPIRED",{transaction:l,info:{error:a}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return qn("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:l,info:{error:a}});if(o.match(/only replay-protected/i))return qn("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:i,info:{transaction:l,info:{error:a}}})}let s=!!o.match(/the method .* does not exist/i);return s||a&&a.details&&a.details.startsWith("Unauthorized method:")&&(s=!0),s?qn("unsupported operation","UNSUPPORTED_OPERATION",{operation:n.method,info:{error:a,payload:n}}):qn("could not coalesce error","UNKNOWN_ERROR",{error:a,payload:n})}send(n,r){if(this.destroyed)return Promise.reject(qn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n}));const i=vs(this,x0)._++,a=new Promise((o,s)=>{b(this,zs).push({resolve:o,reject:s,payload:{method:n,params:r,id:i,jsonrpc:"2.0"}})});return ie(this,_m,b3).call(this),a}async getSigner(n){n==null&&(n=0);const r=this.send("eth_accounts",[]);if(typeof n=="number"){const a=await r;if(n>=a.length)throw new Error("no such account");return new Y6(this,a[n])}const{accounts:i}=await ti({network:this.getNetwork(),accounts:r});n=fn(n);for(const a of i)if(fn(a)===n)return new Y6(this,n);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(r=>new Y6(this,r))}destroy(){b(this,Go)&&(clearTimeout(b(this,Go)),O(this,Go,null));for(const{payload:n,reject:r}of b(this,zs))r(qn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n.method}));O(this,zs,[]),super.destroy()}},gf=new WeakMap,x0=new WeakMap,zs=new WeakMap,Go=new WeakMap,so=new WeakMap,Pa=new WeakMap,xi=new WeakMap,_m=new WeakSet,b3=function(){if(b(this,Go))return;const n=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");O(this,Go,setTimeout(()=>{O(this,Go,null);const r=b(this,zs);for(O(this,zs,[]);r.length;){const i=[r.shift()];for(;r.length&&i.length!==b(this,gf).batchMaxCount;)if(i.push(r.shift()),JSON.stringify(i.map(o=>o.payload)).length>b(this,gf).batchMaxSize){r.unshift(i.pop());break}(async()=>{const a=i.length===1?i[0].payload:i.map(o=>o.payload);this.emit("debug",{action:"sendRpcPayload",payload:a});try{const o=await this._send(a);this.emit("debug",{action:"receiveRpcResult",result:o});for(const{resolve:s,reject:l,payload:c}of i){if(this.destroyed){l(qn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:c.method}));continue}const u=o.filter(f=>f.id===c.id)[0];if(u==null){const f=qn("missing response for request","BAD_DATA",{value:o,info:{payload:c}});this.emit("error",f),l(f);continue}if("error"in u){l(this.getRpcError(c,u));continue}s(u.result)}}catch(o){this.emit("debug",{action:"receiveRpcError",error:o});for(const{reject:s}of i)s(o)}})()}},n))},mM);var yc,vM;let u$=(vM=class extends vee{constructor(n,r){super(n,r);M(this,yc,void 0);O(this,yc,4e3)}_getSubscriber(n){const r=super._getSubscriber(n);return Bk(r)&&(r.pollingInterval=b(this,yc)),r}get pollingInterval(){return b(this,yc)}set pollingInterval(n){if(!Number.isInteger(n)||n<0)throw new Error("invalid interval");O(this,yc,n),this._forEachSubscriber(r=>{Bk(r)&&(r.pollingInterval=b(this,yc))})}},yc=new WeakMap,vM);var A0,bM;let bee=(bM=class extends u${constructor(n,r,i){n==null&&(n="http://localhost:8545");super(r,i);M(this,A0,void 0);typeof n=="string"?O(this,A0,new rh(n)):O(this,A0,n.clone())}_getConnection(){return b(this,A0).clone()}async send(n,r){return await this._start(),await super.send(n,r)}async _send(n){const r=this._getConnection();r.body=JSON.stringify(n),r.setHeader("content-type","application/json");const i=await r.send();i.assertOk();let a=i.bodyJson;return Array.isArray(a)||(a=[a]),a}},A0=new WeakMap,bM);function w3(t){if(t==null)return null;if(typeof t.message=="string"&&t.message.match(/revert/i)&&gn(t.data))return{message:t.message,data:t.data};if(typeof t=="object"){for(const e in t){const n=w3(t[e]);if(n)return n}return null}if(typeof t=="string")try{return w3(JSON.parse(t))}catch{}return null}function x3(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const n in t)x3(t[n],e);if(typeof t=="string")try{return x3(JSON.parse(t),e)}catch{}}}function wee(t){const e=[];return x3(t,e),e}var E0,wM;let f$=(wM=class extends u${constructor(n,r){K(n&&n.request,"invalid EIP-1193 provider","ethereum",n);super(r,{batchMaxCount:1});M(this,E0,void 0);O(this,E0,async(i,a)=>{const o={method:i,params:a};this.emit("debug",{action:"sendEip1193Request",payload:o});try{const s=await n.request(o);return this.emit("debug",{action:"receiveEip1193Result",result:s}),s}catch(s){const l=new Error(s.message);throw l.code=s.code,l.data=s.data,l.payload=o,this.emit("debug",{action:"receiveEip1193Error",error:l}),l}})}async send(n,r){return await this._start(),await super.send(n,r)}async _send(n){K(!Array.isArray(n),"EIP-1193 does not support batch request","payload",n);try{const r=await b(this,E0).call(this,n.method,n.params||[]);return[{id:n.id,result:r}]}catch(r){return[{id:n.id,error:{code:r.code,data:r.data,message:r.message}}]}}getRpcError(n,r){switch(r=JSON.parse(JSON.stringify(r)),r.error.code||-1){case 4001:r.error.message=`ethers-user-denied: ${r.error.message}`;break;case 4200:r.error.message=`ethers-unsupported: ${r.error.message}`;break}return super.getRpcError(n,r)}async hasSigner(n){n==null&&(n=0);const r=await this.send("eth_accounts",[]);return typeof n=="number"?r.length>n:(n=n.toLowerCase(),r.filter(i=>i.toLowerCase()===n).length!==0)}async getSigner(n){if(n==null&&(n=0),!await this.hasSigner(n))try{await b(this,E0).call(this,"eth_requestAccounts",[])}catch(r){const i=r.payload;throw this.getRpcError(i,{id:i.id,error:r})}return await super.getSigner(n)}},E0=new WeakMap,wM);const xee=["string","number","bigint","symbol"],Aee=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function Eee(t){if(t===null)return"null";if(t===void 0)return"undefined";if(t===!0||t===!1)return"boolean";const e=typeof t;if(xee.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(t))return"Array";if(See(t))return"Buffer";const n=Pee(t);return n||"Object"}function See(t){return t&&t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer.call(null,t)}function Pee(t){const e=Object.prototype.toString.call(t).slice(8,-1);if(Aee.includes(e))return e}class de{constructor(e,n,r){this.major=e,this.majorEncoded=e<<5,this.name=n,this.terminal=r}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.majore.major?1:0}}de.uint=new de(0,"uint",!0);de.negint=new de(1,"negint",!0);de.bytes=new de(2,"bytes",!0);de.string=new de(3,"string",!0);de.array=new de(4,"array",!1);de.map=new de(5,"map",!1);de.tag=new de(6,"tag",!1);de.float=new de(7,"float",!0);de.false=new de(7,"false",!0);de.true=new de(7,"true",!0);de.null=new de(7,"null",!0);de.undefined=new de(7,"undefined",!0);de.break=new de(7,"break",!0);class ut{constructor(e,n,r){this.type=e,this.value=n,this.encodedLength=r,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}}const og=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",Oee=new TextDecoder,Tee=new TextEncoder;function ex(t){return og&&globalThis.Buffer.isBuffer(t)}function h$(t){return t instanceof Uint8Array?ex(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t:Uint8Array.from(t)}const Cee=og?(t,e,n)=>n-e>64?globalThis.Buffer.from(t.subarray(e,n)).toString("utf8"):Lk(t,e,n):(t,e,n)=>n-e>64?Oee.decode(t.subarray(e,n)):Lk(t,e,n),kee=og?t=>t.length>64?globalThis.Buffer.from(t):Dk(t):t=>t.length>64?Tee.encode(t):Dk(t),bs=t=>Uint8Array.from(t),eO=og?(t,e,n)=>ex(t)?new Uint8Array(t.subarray(e,n)):t.slice(e,n):(t,e,n)=>t.slice(e,n),_ee=og?(t,e)=>(t=t.map(n=>n instanceof Uint8Array?n:globalThis.Buffer.from(n)),h$(globalThis.Buffer.concat(t,e))):(t,e)=>{const n=new Uint8Array(e);let r=0;for(let i of t)r+i.length>n.length&&(i=i.subarray(0,n.length-r)),n.set(i,r),r+=i.length;return n},Nee=og?t=>globalThis.Buffer.allocUnsafe(t):t=>new Uint8Array(t);function Iee(t,e){if(ex(t)&&ex(e))return t.compare(e);for(let n=0;n55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&a.push(239,191,189);continue}else if(o+1===r){(e-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;a.push(n)}else if(n<2048){if((e-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((e-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((e-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return a}function Lk(t,e,n){const r=[];for(;e239?4:i>223?3:i>191?2:1;if(e+o<=n){let s,l,c,u;switch(o){case 1:i<128&&(a=i);break;case 2:s=t[e+1],(s&192)===128&&(u=(i&31)<<6|s&63,u>127&&(a=u));break;case 3:s=t[e+1],l=t[e+2],(s&192)===128&&(l&192)===128&&(u=(i&15)<<12|(s&63)<<6|l&63,u>2047&&(u<55296||u>57343)&&(a=u));break;case 4:s=t[e+1],l=t[e+2],c=t[e+3],(s&192)===128&&(l&192)===128&&(c&192)===128&&(u=(i&15)<<18|(s&63)<<12|(l&63)<<6|c&63,u>65535&&u<1114112&&(a=u))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),e+=o}return Ree(r)}const $k=4096;function Ree(t){const e=t.length;if(e<=$k)return String.fromCharCode.apply(String,t);let n="",r=0;for(;rr.length/2?(n=this.cursor===r.length?r:r.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):n=eO(r,0,this.cursor)}else n=_ee(this.chunks,this.cursor);return e&&this.reset(),n}}const $t="CBOR decode error:",p$="CBOR encode error:";function sg(t,e,n){if(t.length-e>>8,r&255])}else if(n>>24&255,r>>>16&255,r>>>8&255,r&255])}else{const r=BigInt(n);if(r>BigInt(32)&BigInt(4294967295));i[8]=a&255,a=a>>8,i[7]=a&255,a=a>>8,i[6]=a&255,a=a>>8,i[5]=a&255,i[4]=o&255,o=o>>8,i[3]=o&255,o=o>>8,i[2]=o&255,o=o>>8,i[1]=o&255,t.push(i)}else throw new Error(`${$t} encountered BigInt larger than allowable range`)}}wh.encodedSize=function(e){return Qa.encodedSize(e.value)};Qa.encodedSize=function(e){return en.value?1:0};function Uee(t,e,n,r){return new ut(de.negint,-1-yh(t,e+1,r),2)}function Fee(t,e,n,r){return new ut(de.negint,-1-mh(t,e+1,r),3)}function jee(t,e,n,r){return new ut(de.negint,-1-vh(t,e+1,r),5)}const tO=BigInt(-1),g$=BigInt(1);function zee(t,e,n,r){const i=bh(t,e+1,r);if(typeof i!="bigint"){const a=-1-i;if(a>=Number.MIN_SAFE_INTEGER)return new ut(de.negint,a,9)}if(r.allowBigInt!==!0)throw new Error(`${$t} integers outside of the safe integer range are not supported`);return new ut(de.negint,tO-BigInt(i),9)}function nO(t,e){const n=e.value,r=typeof n=="bigint"?n*tO-g$:n*-1-1;Qa(t,e.type.majorEncoded,r)}nO.encodedSize=function(e){const n=e.value,r=typeof n=="bigint"?n*tO-g$:n*-1-1;return rn.value?-1:0};function cv(t,e,n,r){sg(t,e,n+r);const i=eO(t,e+n,e+n+r);return new ut(de.bytes,i,n+r)}function Hee(t,e,n,r){return cv(t,e,1,n)}function Gee(t,e,n,r){return cv(t,e,2,yh(t,e+1,r))}function Vee(t,e,n,r){return cv(t,e,3,mh(t,e+1,r))}function Qee(t,e,n,r){return cv(t,e,5,vh(t,e+1,r))}function Kee(t,e,n,r){const i=bh(t,e+1,r);if(typeof i=="bigint")throw new Error(`${$t} 64-bit integer bytes lengths not supported`);return cv(t,e,9,i)}function tx(t){return t.encodedBytes===void 0&&(t.encodedBytes=t.type===de.string?kee(t.value):t.value),t.encodedBytes}function X2(t,e){const n=tx(e);Qa(t,e.type.majorEncoded,n.length),t.push(n)}X2.encodedSize=function(e){const n=tx(e);return Qa.encodedSize(n.length)+n.length};X2.compareTokens=function(e,n){return Wee(tx(e),tx(n))};function Wee(t,e){return t.lengthe.length?1:Iee(t,e)}function uv(t,e,n,r,i){const a=n+r;sg(t,e,a);const o=new ut(de.string,Cee(t,e+n,e+a),a);return i.retainStringBytes===!0&&(o.byteValue=eO(t,e+n,e+a)),o}function Jee(t,e,n,r){return uv(t,e,1,n,r)}function Yee(t,e,n,r){return uv(t,e,2,yh(t,e+1,r),r)}function Xee(t,e,n,r){return uv(t,e,3,mh(t,e+1,r),r)}function Zee(t,e,n,r){return uv(t,e,5,vh(t,e+1,r),r)}function qee(t,e,n,r){const i=bh(t,e+1,r);if(typeof i=="bigint")throw new Error(`${$t} 64-bit integer string lengths not supported`);return uv(t,e,9,i,r)}const ete=X2;function lg(t,e,n,r){return new ut(de.array,r,n)}function tte(t,e,n,r){return lg(t,e,1,n)}function nte(t,e,n,r){return lg(t,e,2,yh(t,e+1,r))}function rte(t,e,n,r){return lg(t,e,3,mh(t,e+1,r))}function ite(t,e,n,r){return lg(t,e,5,vh(t,e+1,r))}function ate(t,e,n,r){const i=bh(t,e+1,r);if(typeof i=="bigint")throw new Error(`${$t} 64-bit integer array lengths not supported`);return lg(t,e,9,i)}function ote(t,e,n,r){if(r.allowIndefinite===!1)throw new Error(`${$t} indefinite length items not allowed`);return lg(t,e,1,1/0)}function rO(t,e){Qa(t,de.array.majorEncoded,e.value)}rO.compareTokens=wh.compareTokens;rO.encodedSize=function(e){return Qa.encodedSize(e.value)};function cg(t,e,n,r){return new ut(de.map,r,n)}function ste(t,e,n,r){return cg(t,e,1,n)}function lte(t,e,n,r){return cg(t,e,2,yh(t,e+1,r))}function cte(t,e,n,r){return cg(t,e,3,mh(t,e+1,r))}function ute(t,e,n,r){return cg(t,e,5,vh(t,e+1,r))}function fte(t,e,n,r){const i=bh(t,e+1,r);if(typeof i=="bigint")throw new Error(`${$t} 64-bit integer map lengths not supported`);return cg(t,e,9,i)}function hte(t,e,n,r){if(r.allowIndefinite===!1)throw new Error(`${$t} indefinite length items not allowed`);return cg(t,e,1,1/0)}function iO(t,e){Qa(t,de.map.majorEncoded,e.value)}iO.compareTokens=wh.compareTokens;iO.encodedSize=function(e){return Qa.encodedSize(e.value)};function dte(t,e,n,r){return new ut(de.tag,n,1)}function pte(t,e,n,r){return new ut(de.tag,yh(t,e+1,r),2)}function gte(t,e,n,r){return new ut(de.tag,mh(t,e+1,r),3)}function yte(t,e,n,r){return new ut(de.tag,vh(t,e+1,r),5)}function mte(t,e,n,r){return new ut(de.tag,bh(t,e+1,r),9)}function aO(t,e){Qa(t,de.tag.majorEncoded,e.value)}aO.compareTokens=wh.compareTokens;aO.encodedSize=function(e){return Qa.encodedSize(e.value)};const vte=20,bte=21,wte=22,xte=23;function Ate(t,e,n,r){if(r.allowUndefined===!1)throw new Error(`${$t} undefined values are not supported`);return r.coerceUndefinedToNull===!0?new ut(de.null,null,1):new ut(de.undefined,void 0,1)}function Ete(t,e,n,r){if(r.allowIndefinite===!1)throw new Error(`${$t} indefinite length items not allowed`);return new ut(de.break,void 0,1)}function oO(t,e,n){if(n){if(n.allowNaN===!1&&Number.isNaN(t))throw new Error(`${$t} NaN values are not supported`);if(n.allowInfinity===!1&&(t===1/0||t===-1/0))throw new Error(`${$t} Infinity values are not supported`)}return new ut(de.float,t,e)}function Ste(t,e,n,r){return oO(lO(t,e+1),3,r)}function Pte(t,e,n,r){return oO(cO(t,e+1),5,r)}function Ote(t,e,n,r){return oO(b$(t,e+1),9,r)}function sO(t,e,n){const r=e.value;if(r===!1)t.push([de.float.majorEncoded|vte]);else if(r===!0)t.push([de.float.majorEncoded|bte]);else if(r===null)t.push([de.float.majorEncoded|wte]);else if(r===void 0)t.push([de.float.majorEncoded|xte]);else{let i,a=!1;(!n||n.float64!==!0)&&(m$(r),i=lO(eo,1),r===i||Number.isNaN(r)?(eo[0]=249,t.push(eo.slice(0,3)),a=!0):(v$(r),i=cO(eo,1),r===i&&(eo[0]=250,t.push(eo.slice(0,5)),a=!0))),a||(Tte(r),i=b$(eo,1),eo[0]=251,t.push(eo.slice(0,9)))}}sO.encodedSize=function(e,n){const r=e.value;if(r===!1||r===!0||r===null||r===void 0)return 1;if(!n||n.float64!==!0){m$(r);let i=lO(eo,1);if(r===i||Number.isNaN(r))return 3;if(v$(r),i=cO(eo,1),r===i)return 5}return 9};const y$=new ArrayBuffer(9),ba=new DataView(y$,1),eo=new Uint8Array(y$,0);function m$(t){if(t===1/0)ba.setUint16(0,31744,!1);else if(t===-1/0)ba.setUint16(0,64512,!1);else if(Number.isNaN(t))ba.setUint16(0,32256,!1);else{ba.setFloat32(0,t);const e=ba.getUint32(0),n=(e&2139095040)>>23,r=e&8388607;if(n===255)ba.setUint16(0,31744,!1);else if(n===0)ba.setUint16(0,(t&2147483648)>>16|r>>13,!1);else{const i=n-127;i<-24?ba.setUint16(0,0):i<-14?ba.setUint16(0,(e&2147483648)>>16|1<<24+i,!1):ba.setUint16(0,(e&2147483648)>>16|i+15<<10|r>>13,!1)}}}function lO(t,e){if(t.length-e<2)throw new Error(`${$t} not enough data for float16`);const n=(t[e]<<8)+t[e+1];if(n===31744)return 1/0;if(n===64512)return-1/0;if(n===32256)return NaN;const r=n>>10&31,i=n&1023;let a;return r===0?a=i*2**-24:r!==31?a=(i+1024)*2**(r-25):a=i===0?1/0:NaN,n&32768?-a:a}function v$(t){ba.setFloat32(0,t,!1)}function cO(t,e){if(t.length-e<4)throw new Error(`${$t} not enough data for float32`);const n=(t.byteOffset||0)+e;return new DataView(t.buffer,n,4).getFloat32(0,!1)}function Tte(t){ba.setFloat64(0,t,!1)}function b$(t,e){if(t.length-e<8)throw new Error(`${$t} not enough data for float64`);const n=(t.byteOffset||0)+e;return new DataView(t.buffer,n,8).getFloat64(0,!1)}sO.compareTokens=wh.compareTokens;function tn(t,e,n){throw new Error(`${$t} encountered invalid minor (${n}) for major ${t[e]>>>5}`)}function Z2(t){return()=>{throw new Error(`${$t} ${t}`)}}const Ie=[];for(let t=0;t<=23;t++)Ie[t]=tn;Ie[24]=Bee;Ie[25]=Dee;Ie[26]=Lee;Ie[27]=$ee;Ie[28]=tn;Ie[29]=tn;Ie[30]=tn;Ie[31]=tn;for(let t=32;t<=55;t++)Ie[t]=tn;Ie[56]=Uee;Ie[57]=Fee;Ie[58]=jee;Ie[59]=zee;Ie[60]=tn;Ie[61]=tn;Ie[62]=tn;Ie[63]=tn;for(let t=64;t<=87;t++)Ie[t]=Hee;Ie[88]=Gee;Ie[89]=Vee;Ie[90]=Qee;Ie[91]=Kee;Ie[92]=tn;Ie[93]=tn;Ie[94]=tn;Ie[95]=Z2("indefinite length bytes/strings are not supported");for(let t=96;t<=119;t++)Ie[t]=Jee;Ie[120]=Yee;Ie[121]=Xee;Ie[122]=Zee;Ie[123]=qee;Ie[124]=tn;Ie[125]=tn;Ie[126]=tn;Ie[127]=Z2("indefinite length bytes/strings are not supported");for(let t=128;t<=151;t++)Ie[t]=tte;Ie[152]=nte;Ie[153]=rte;Ie[154]=ite;Ie[155]=ate;Ie[156]=tn;Ie[157]=tn;Ie[158]=tn;Ie[159]=ote;for(let t=160;t<=183;t++)Ie[t]=ste;Ie[184]=lte;Ie[185]=cte;Ie[186]=ute;Ie[187]=fte;Ie[188]=tn;Ie[189]=tn;Ie[190]=tn;Ie[191]=hte;for(let t=192;t<=215;t++)Ie[t]=dte;Ie[216]=pte;Ie[217]=gte;Ie[218]=yte;Ie[219]=mte;Ie[220]=tn;Ie[221]=tn;Ie[222]=tn;Ie[223]=tn;for(let t=224;t<=243;t++)Ie[t]=Z2("simple values are not supported");Ie[244]=tn;Ie[245]=tn;Ie[246]=tn;Ie[247]=Ate;Ie[248]=Z2("simple values are not supported");Ie[249]=Ste;Ie[250]=Pte;Ie[251]=Ote;Ie[252]=tn;Ie[253]=tn;Ie[254]=tn;Ie[255]=Ete;const gs=[];for(let t=0;t<24;t++)gs[t]=new ut(de.uint,t,1);for(let t=-1;t>=-24;t--)gs[31-t]=new ut(de.negint,t,1);gs[64]=new ut(de.bytes,new Uint8Array(0),1);gs[96]=new ut(de.string,"",1);gs[128]=new ut(de.array,0,1);gs[160]=new ut(de.map,0,1);gs[244]=new ut(de.false,!1,1);gs[245]=new ut(de.true,!0,1);gs[246]=new ut(de.null,null,1);function Cte(t){switch(t.type){case de.false:return bs([244]);case de.true:return bs([245]);case de.null:return bs([246]);case de.bytes:return t.value.length?void 0:bs([64]);case de.string:return t.value===""?bs([96]):void 0;case de.array:return t.value===0?bs([128]):void 0;case de.map:return t.value===0?bs([160]):void 0;case de.uint:return t.value<24?bs([Number(t.value)]):void 0;case de.negint:if(t.value>=-24)return bs([31-Number(t.value)])}}const kte={float64:!1,mapSorter:Ite,quickEncodeToken:Cte};function _te(){const t=[];return t[de.uint.major]=wh,t[de.negint.major]=nO,t[de.bytes.major]=X2,t[de.string.major]=ete,t[de.array.major]=rO,t[de.map.major]=iO,t[de.tag.major]=aO,t[de.float.major]=sO,t}const w$=_te(),X6=new d$;class nx{constructor(e,n){this.obj=e,this.parent=n}includes(e){let n=this;do if(n.obj===e)return!0;while(n=n.parent);return!1}static createCheck(e,n){if(e&&e.includes(n))throw new Error(`${p$} object contains circular references`);return new nx(n,e)}}const Ql={null:new ut(de.null,null),undefined:new ut(de.undefined,void 0),true:new ut(de.true,!0),false:new ut(de.false,!1),emptyArray:new ut(de.array,0),emptyMap:new ut(de.map,0)},eu={number(t,e,n,r){return!Number.isInteger(t)||!Number.isSafeInteger(t)?new ut(de.float,t):t>=0?new ut(de.uint,t):new ut(de.negint,t)},bigint(t,e,n,r){return t>=BigInt(0)?new ut(de.uint,t):new ut(de.negint,t)},Uint8Array(t,e,n,r){return new ut(de.bytes,t)},string(t,e,n,r){return new ut(de.string,t)},boolean(t,e,n,r){return t?Ql.true:Ql.false},null(t,e,n,r){return Ql.null},undefined(t,e,n,r){return Ql.undefined},ArrayBuffer(t,e,n,r){return new ut(de.bytes,new Uint8Array(t))},DataView(t,e,n,r){return new ut(de.bytes,new Uint8Array(t.buffer,t.byteOffset,t.byteLength))},Array(t,e,n,r){if(!t.length)return n.addBreakTokens===!0?[Ql.emptyArray,new ut(de.break)]:Ql.emptyArray;r=nx.createCheck(r,t);const i=[];let a=0;for(const o of t)i[a++]=ew(o,n,r);return n.addBreakTokens?[new ut(de.array,t.length),i,new ut(de.break)]:[new ut(de.array,t.length),i]},Object(t,e,n,r){const i=e!=="Object",a=i?t.keys():Object.keys(t),o=i?t.size:a.length;if(!o)return n.addBreakTokens===!0?[Ql.emptyMap,new ut(de.break)]:Ql.emptyMap;r=nx.createCheck(r,t);const s=[];let l=0;for(const c of a)s[l++]=[ew(c,n,r),ew(i?t.get(c):t[c],n,r)];return Nte(s,n),n.addBreakTokens?[new ut(de.map,o),s,new ut(de.break)]:[new ut(de.map,o),s]}};eu.Map=eu.Object;eu.Buffer=eu.Uint8Array;for(const t of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))eu[`${t}Array`]=eu.DataView;function ew(t,e={},n){const r=Eee(t),i=e&&e.typeEncoders&&e.typeEncoders[r]||eu[r];if(typeof i=="function"){const o=i(t,r,e,n);if(o!=null)return o}const a=eu[r];if(!a)throw new Error(`${p$} unsupported type: ${r}`);return a(t,r,e,n)}function Nte(t,e){e.mapSorter&&t.sort(e.mapSorter)}function Ite(t,e){const n=Array.isArray(t[0])?t[0][0]:t[0],r=Array.isArray(e[0])?e[0][0]:e[0];if(n.type!==r.type)return n.type.compare(r.type);const i=n.type.major,a=w$[i].compareTokens(n,r);return a===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),a}function x$(t,e,n,r){if(Array.isArray(e))for(const i of e)x$(t,i,n,r);else n[e.type.major](t,e,r)}function Rte(t,e,n){const r=ew(t,n);if(!Array.isArray(r)&&n.quickEncodeToken){const i=n.quickEncodeToken(r);if(i)return i;const a=e[r.type.major];if(a.encodedSize){const o=a.encodedSize(r,n),s=new d$(o);if(a(s,r,n),s.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${r} was wrong`);return h$(s.chunks[0])}}return X6.reset(),x$(X6,r,e,n),X6.toBytes(!0)}function jh(t,e){return e=Object.assign({},kte,e),Rte(t,w$,e)}const Mte={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0};class Bte{constructor(e,n={}){this.pos=0,this.data=e,this.options=n}done(){return this.pos>=this.data.length}next(){const e=this.data[this.pos];let n=gs[e];if(n===void 0){const r=Ie[e];if(!r)throw new Error(`${$t} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);const i=e&31;n=r(this.data,this.pos,i,this.options)}return this.pos+=n.encodedLength,n}}const p1=Symbol.for("DONE"),q2=Symbol.for("BREAK");function Dte(t,e,n){const r=[];for(let i=0;ia.trim());for(let a=0;aPromise.resolve(t[r])))).reduce((r,i,a)=>(r[e[a]]=i,r),{})}function mt(t,e,n){for(let r in e){let i=e[r];const a=n?n[r]:null;a&&Ute(i,a,r),Object.defineProperty(t,r,{enumerable:!0,value:i,writable:!1})}}function hd(t){if(t==null)return"null";if(Array.isArray(t))return"[ "+t.map(hd).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let n="0x";for(let r=0;r>4],n+=e[t[r]&15];return n}if(typeof t=="object"&&typeof t.toJSON=="function")return hd(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":return BigInt(t).toString();case"number":return t.toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{ "+e.map(n=>`${hd(n)}: ${hd(t[n])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Kr(t,e){return t&&t.code===e}function uO(t){return Kr(t,"CALL_EXCEPTION")}function er(t,e,n){let r=t;{const a=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${hd(n)}`);for(const o in n){if(o==="shortMessage")continue;const s=n[o];a.push(o+"="+hd(s))}}a.push(`code=${e}`),a.push(`version=${$te}`),a.length&&(t+=" ("+a.join(", ")+")")}let i;switch(e){case"INVALID_ARGUMENT":i=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":i=new RangeError(t);break;default:i=new Error(t)}return mt(i,{code:e}),n&&Object.assign(i,n),i.shortMessage==null&&mt(i,{shortMessage:r}),i}function me(t,e,n,r){if(!t)throw er(e,n,r)}function Y(t,e,n,r){me(t,e,"INVALID_ARGUMENT",{argument:n,value:r})}function A$(t,e,n){n==null&&(n=""),n&&(n=": "+n),me(t>=e,"missing arguemnt"+n,"MISSING_ARGUMENT",{count:t,expectedCount:e}),me(t<=e,"too many arguemnts"+n,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}const Fte=["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");t.push(e)}catch{}return t},[]);function jte(t){me(Fte.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}function eA(t,e,n){if(n==null&&(n=""),t!==e){let r=n,i="new";n&&(r+=".",i+=" "+n),me(!1,`private constructor; use ${r}from* methods`,"UNSUPPORTED_OPERATION",{operation:i})}}function E$(t,e,n){if(t instanceof Uint8Array)return n?new Uint8Array(t):t;if(typeof t=="string"&&t.match(/^0x([0-9a-f][0-9a-f])*$/i)){const r=new Uint8Array((t.length-2)/2);let i=2;for(let a=0;a>4]+Uk[i&15]}return n}function lr(t){return"0x"+t.map(e=>Ze(e).substring(2)).join("")}function Nd(t){return In(t,!0)?(t.length-2)/2:Pt(t).length}function Fn(t,e,n){const r=Pt(t);return n!=null&&n>r.length&&me(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n}),Ze(r.slice(e??0,n??r.length))}function S$(t,e,n){const r=Pt(t);me(e>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),n?i.set(r,e-r.length):i.set(r,0),Ze(i)}function sh(t,e){return S$(t,e,!0)}function zte(t,e){return S$(t,e,!1)}const tA=BigInt(0),wo=BigInt(1),dd=9007199254740991;function Hte(t,e){const n=nA(t,"value"),r=BigInt(Lt(e,"width"));if(me(n>>r===tA,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),n>>r-wo){const i=(wo<=-dd&&t<=dd,"overflow",e||"value",t),BigInt(t);case"string":try{if(t==="")throw new Error("empty string");return t[0]==="-"&&t[1]!=="-"?-BigInt(t.substring(1)):BigInt(t)}catch(n){Y(!1,`invalid BigNumberish string: ${n.message}`,e||"value",t)}}Y(!1,"invalid BigNumberish value",e||"value",t)}function nA(t,e){const n=ot(t,e);return me(n>=tA,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),n}const Fk="0123456789abcdef";function fO(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=Fk[n>>4],e+=Fk[n&15];return BigInt(e)}return ot(t)}function Lt(t,e){switch(typeof t){case"bigint":return Y(t>=-dd&&t<=dd,"overflow",e||"value",t),Number(t);case"number":return Y(Number.isInteger(t),"underflow",e||"value",t),Y(t>=-dd&&t<=dd,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return Lt(BigInt(t),e)}catch(n){Y(!1,`invalid numeric string: ${n.message}`,e||"value",t)}}Y(!1,"invalid numeric value",e||"value",t)}function Gte(t){return Lt(fO(t))}function fs(t,e){let r=nA(t,"value").toString(16);if(e==null)r.length%2&&(r="0"+r);else{const i=Lt(e,"width");for(me(i*2>=r.length,`value exceeds width (${i} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});r.length>6===2;o++)a++;return a}return t==="OVERRUN"?n.length-e-1:0}function Jte(t,e,n,r,i){return t==="OVERLONG"?(Y(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),r.push(i),0):(r.push(65533),T$(t,e,n))}const Yte=Object.freeze({error:Wte,ignore:T$,replace:Jte});function Xte(t,e){e==null&&(e=Yte.error);const n=Pt(t,"bytes"),r=[];let i=0;for(;i>7)){r.push(a);continue}let o=null,s=null;if((a&224)===192)o=1,s=127;else if((a&240)===224)o=2,s=2047;else if((a&248)===240)o=3,s=65535;else{(a&192)===128?i+=e("UNEXPECTED_CONTINUE",i-1,n,r):i+=e("BAD_PREFIX",i-1,n,r);continue}if(i-1+o>=n.length){i+=e("OVERRUN",i-1,n,r);continue}let l=a&(1<<8-o-1)-1;for(let c=0;c1114111){i+=e("OUT_OF_RANGE",i-1-o,n,r,l);continue}if(l>=55296&&l<=57343){i+=e("UTF16_SURROGATE",i-1-o,n,r,l);continue}if(l<=s){i+=e("OVERLONG",i-1-o,n,r,l);continue}r.push(l)}}return r}function dl(t,e){e!=null&&(jte(e),t=t.normalize(e));let n=[];for(let r=0;r>6|192),n.push(i&63|128);else if((i&64512)==55296){r++;const a=t.charCodeAt(r);Y(r>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(o&63|128)}else n.push(i>>12|224),n.push(i>>6&63|128),n.push(i&63|128)}return new Uint8Array(n)}function Zte(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function hO(t,e){return Zte(Xte(t,e))}function C$(t){async function e(n,r){const i=n.url.split(":")[0].toLowerCase();me(i==="http"||i==="https",`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),me(i==="https"||!n.credentials||n.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let a;if(r){const f=new AbortController;a=f.signal,r.addListener(()=>{f.abort()})}const o={method:n.method,headers:new Headers(Array.from(n)),body:n.body||void 0,signal:a},s=await fetch(n.url,o),l={};s.headers.forEach((f,h)=>{l[h.toLowerCase()]=f});const c=await s.arrayBuffer(),u=c==null?null:new Uint8Array(c);return{statusCode:s.status,statusMessage:s.statusText,headers:l,body:u}}return e}const qte=12,ene=250;let Hk=C$();const tne=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),nne=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let Z6=!1;async function k$(t,e){try{const n=t.match(tne);if(!n)throw new Error("invalid data");return new Jc(200,"OK",{"content-type":n[1]||"text/plain"},n[2]?Qte(n[3]):ine(n[3]))}catch{return new Jc(599,"BAD REQUEST (invalid data: URI)",{},null,new Sl(t))}}function _$(t){async function e(n,r){try{const i=n.match(nne);if(!i)throw new Error("invalid link");return new Sl(`${t}${i[2]}`)}catch{return new Jc(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Sl(n))}}return e}const Zv={data:k$,ipfs:_$("https://gateway.ipfs.io/ipfs/")},N$=new WeakMap;var yf,mc;class rne{constructor(e){M(this,yf,void 0);M(this,mc,void 0);O(this,yf,[]),O(this,mc,!1),N$.set(e,()=>{if(!b(this,mc)){O(this,mc,!0);for(const n of b(this,yf))setTimeout(()=>{n()},0);O(this,yf,[])}})}addListener(e){me(!b(this,mc),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),b(this,yf).push(e)}get cancelled(){return b(this,mc)}checkSignal(){me(!this.cancelled,"cancelled","CANCELLED",{})}}yf=new WeakMap,mc=new WeakMap;function qv(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}var P0,O0,lo,Hs,T0,C0,fr,qi,Gs,mf,vf,bf,Vo,Vs,vc,wf,cy;const u2=class u2{constructor(e){M(this,wf);M(this,P0,void 0);M(this,O0,void 0);M(this,lo,void 0);M(this,Hs,void 0);M(this,T0,void 0);M(this,C0,void 0);M(this,fr,void 0);M(this,qi,void 0);M(this,Gs,void 0);M(this,mf,void 0);M(this,vf,void 0);M(this,bf,void 0);M(this,Vo,void 0);M(this,Vs,void 0);M(this,vc,void 0);O(this,C0,String(e)),O(this,P0,!1),O(this,O0,!0),O(this,lo,{}),O(this,Hs,""),O(this,T0,3e5),O(this,Vs,{slotInterval:ene,maxAttempts:qte}),O(this,vc,null)}get url(){return b(this,C0)}set url(e){O(this,C0,String(e))}get body(){return b(this,fr)==null?null:new Uint8Array(b(this,fr))}set body(e){if(e==null)O(this,fr,void 0),O(this,qi,void 0);else if(typeof e=="string")O(this,fr,dl(e)),O(this,qi,"text/plain");else if(e instanceof Uint8Array)O(this,fr,e),O(this,qi,"application/octet-stream");else if(typeof e=="object")O(this,fr,dl(JSON.stringify(e))),O(this,qi,"application/json");else throw new Error("invalid body")}hasBody(){return b(this,fr)!=null}get method(){return b(this,Hs)?b(this,Hs):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),O(this,Hs,String(e).toUpperCase())}get headers(){const e=Object.assign({},b(this,lo));return b(this,Gs)&&(e.authorization=`Basic ${Kte(dl(b(this,Gs)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&b(this,qi)&&(e["content-type"]=b(this,qi)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,n){b(this,lo)[String(e).toLowerCase()]=String(n)}clearHeaders(){O(this,lo,{})}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r=0,"timeout must be non-zero","timeout",e),O(this,T0,e)}get preflightFunc(){return b(this,mf)||null}set preflightFunc(e){O(this,mf,e)}get processFunc(){return b(this,vf)||null}set processFunc(e){O(this,vf,e)}get retryFunc(){return b(this,bf)||null}set retryFunc(e){O(this,bf,e)}get getUrlFunc(){return b(this,vc)||Hk}set getUrlFunc(e){O(this,vc,e)}toString(){return``}setThrottleParams(e){e.slotInterval!=null&&(b(this,Vs).slotInterval=e.slotInterval),e.maxAttempts!=null&&(b(this,Vs).maxAttempts=e.maxAttempts)}send(){return me(b(this,Vo)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),O(this,Vo,new rne(this)),ie(this,wf,cy).call(this,0,Gk()+this.timeout,0,this,new Jc(0,"",{},null,this))}cancel(){me(b(this,Vo)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=N$.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const n=this.url.split(":")[0].toLowerCase(),r=e.split(":")[0].toLowerCase();me(this.method==="GET"&&(n!=="https"||r!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const i=new u2(e);return i.method="GET",i.allowGzip=this.allowGzip,i.timeout=this.timeout,O(i,lo,Object.assign({},b(this,lo))),b(this,fr)&&O(i,fr,new Uint8Array(b(this,fr))),O(i,qi,b(this,qi)),i}clone(){const e=new u2(this.url);return O(e,Hs,b(this,Hs)),b(this,fr)&&O(e,fr,b(this,fr)),O(e,qi,b(this,qi)),O(e,lo,Object.assign({},b(this,lo))),O(e,Gs,b(this,Gs)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),O(e,mf,b(this,mf)),O(e,vf,b(this,vf)),O(e,bf,b(this,bf)),O(e,vc,b(this,vc)),e}static lockConfig(){Z6=!0}static getGateway(e){return Zv[e.toLowerCase()]||null}static registerGateway(e,n){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(Z6)throw new Error("gateways locked");Zv[e]=n}static registerGetUrl(e){if(Z6)throw new Error("gateways locked");Hk=e}static createGetUrlFunc(e){return C$()}static createDataGateway(){return k$}static createIpfsGatewayFunc(e){return _$(e)}};P0=new WeakMap,O0=new WeakMap,lo=new WeakMap,Hs=new WeakMap,T0=new WeakMap,C0=new WeakMap,fr=new WeakMap,qi=new WeakMap,Gs=new WeakMap,mf=new WeakMap,vf=new WeakMap,bf=new WeakMap,Vo=new WeakMap,Vs=new WeakMap,vc=new WeakMap,wf=new WeakSet,cy=async function(e,n,r,i,a){var u,f,h;if(e>=b(this,Vs).maxAttempts)return a.makeServerError("exceeded maximum retry limit");me(Gk()<=n,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),r>0&&await ane(r);let o=this.clone();const s=(o.url.split(":")[0]||"").toLowerCase();if(s in Zv){const d=await Zv[s](o.url,qv(b(i,Vo)));if(d instanceof Jc){let g=d;if(this.processFunc){qv(b(i,Vo));try{g=await this.processFunc(o,g)}catch(p){(p.throttle==null||typeof p.stall!="number")&&g.makeServerError("error in post-processing function",p).assertOk()}}return g}o=d}this.preflightFunc&&(o=await this.preflightFunc(o));const l=await this.getUrlFunc(o,qv(b(i,Vo)));let c=new Jc(l.statusCode,l.statusMessage,l.headers,l.body,i);if(c.statusCode===301||c.statusCode===302){try{const d=c.headers.location||"";return ie(u=o.redirect(d),wf,cy).call(u,e+1,n,0,i,c)}catch{}return c}else if(c.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,c,e))){const d=c.headers["retry-after"];let g=b(this,Vs).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof d=="string"&&d.match(/^[1-9][0-9]*$/)&&(g=parseInt(d)),ie(f=o.clone(),wf,cy).call(f,e+1,n,g,i,c)}if(this.processFunc){qv(b(i,Vo));try{c=await this.processFunc(o,c)}catch(d){(d.throttle==null||typeof d.stall!="number")&&c.makeServerError("error in post-processing function",d).assertOk();let g=b(this,Vs).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return d.stall>=0&&(g=d.stall),ie(h=o.clone(),wf,cy).call(h,e+1,n,g,i,c)}}return c};let Sl=u2;var Nm,Im,Rm,co,k0,xf;const L4=class L4{constructor(e,n,r,i,a){M(this,Nm,void 0);M(this,Im,void 0);M(this,Rm,void 0);M(this,co,void 0);M(this,k0,void 0);M(this,xf,void 0);O(this,Nm,e),O(this,Im,n),O(this,Rm,Object.keys(r).reduce((o,s)=>(o[s.toLowerCase()]=String(r[s]),o),{})),O(this,co,i==null?null:new Uint8Array(i)),O(this,k0,a||null),O(this,xf,{message:""})}toString(){return``}get statusCode(){return b(this,Nm)}get statusMessage(){return b(this,Im)}get headers(){return Object.assign({},b(this,Rm))}get body(){return b(this,co)==null?null:new Uint8Array(b(this,co))}get bodyText(){try{return b(this,co)==null?"":hO(b(this,co))}catch{me(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{me(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r=0,"invalid stall timeout","stall",n);const r=new Error(e||"throttling requests");throw mt(r,{stall:n,throttle:!0}),r}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return b(this,co)!=null}get request(){return b(this,k0)}ok(){return b(this,xf).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:n}=b(this,xf);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`),me(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:n})}};Nm=new WeakMap,Im=new WeakMap,Rm=new WeakMap,co=new WeakMap,k0=new WeakMap,xf=new WeakMap;let Jc=L4;function Gk(){return new Date().getTime()}function ine(t){return dl(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,n)=>String.fromCharCode(parseInt(n,16))))}function ane(t){return new Promise(e=>setTimeout(e,t))}function one(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function Vk(t,e,n){let r=0;for(let i=0;i{me(r<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:r})};if(t[e]>=248){const r=t[e]-247;n(e+1+r);const i=Vk(t,e+1,r);return n(e+1+r+i),Qk(t,e,e+1+r,r+i)}else if(t[e]>=192){const r=t[e]-192;return n(e+1+r),Qk(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;n(e+1+r);const i=Vk(t,e+1,r);n(e+1+r+i);const a=Ze(t.slice(e+1+r,e+1+r+i));return{consumed:1+r+i,result:a}}else if(t[e]>=128){const r=t[e]-128;n(e+1+r);const i=Ze(t.slice(e+1,e+1+r));return{consumed:1+r,result:i}}return{consumed:1,result:one(t[e])}}function dO(t){const e=Pt(t,"data"),n=I$(e,0);return Y(n.consumed===e.length,"unexpected junk after rlp payload","data",t),n.result}function Kk(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function R$(t){if(Array.isArray(t)){let r=[];if(t.forEach(function(a){r=r.concat(R$(a))}),r.length<=55)return r.unshift(192+r.length),r;const i=Kk(r.length);return i.unshift(247+i.length),i.concat(r)}const e=Array.prototype.slice.call(Pt(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const n=Kk(e.length);return n.unshift(183+n.length),n.concat(e)}const Wk="0123456789abcdef";function y1(t){let e="0x";for(const n of R$(t))e+=Wk[n>>4],e+=Wk[n&15];return e}const ui=32,A3=new Uint8Array(ui),sne=["then"],eb={};function Ug(t,e){const n=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw n.error=e,n}var bc;const Fy=class Fy extends Array{constructor(...n){const r=n[0];let i=n[1],a=(n[2]||[]).slice(),o=!0;r!==eb&&(i=n,a=[],o=!1);super(i.length);M(this,bc,void 0);i.forEach((l,c)=>{this[c]=l});const s=a.reduce((l,c)=>(typeof c=="string"&&l.set(c,(l.get(c)||0)+1),l),new Map);if(O(this,bc,Object.freeze(i.map((l,c)=>{const u=a[c];return u!=null&&s.get(u)===1?u:null}))),!!o)return Object.freeze(this),new Proxy(this,{get:(l,c,u)=>{if(typeof c=="string"){if(c.match(/^[0-9]+$/)){const h=Lt(c,"%index");if(h<0||h>=this.length)throw new RangeError("out of result range");const d=l[h];return d instanceof Error&&Ug(`index ${h}`,d),d}if(sne.indexOf(c)>=0)return Reflect.get(l,c,u);const f=l[c];if(f instanceof Function)return function(...h){return f.apply(this===u?l:this,h)};if(!(c in l))return l.getValue.apply(this===u?l:this,[c])}return Reflect.get(l,c,u)}})}toArray(){const n=[];return this.forEach((r,i)=>{r instanceof Error&&Ug(`index ${i}`,r),n.push(r)}),n}toObject(){return b(this,bc).reduce((n,r,i)=>(me(r!=null,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"}),r in n||(n[r]=this.getValue(r)),n),{})}slice(n,r){n==null&&(n=0),n<0&&(n+=this.length,n<0&&(n=0)),r==null&&(r=this.length),r<0&&(r+=this.length,r<0&&(r=0)),r>this.length&&(r=this.length);const i=[],a=[];for(let o=n;o{b(this,Qs)[e]=Jk(n)}}}Qs=new WeakMap,Af=new WeakMap,_0=new WeakSet,nw=function(e){return b(this,Qs).push(e),O(this,Af,b(this,Af)+e.length),e.length};var Ai,ea,Ef,Sf,wc,Mm,P3,f2,M$;const $4=class $4{constructor(e,n,r){M(this,Mm);M(this,f2);R(this,"allowLoose");M(this,Ai,void 0);M(this,ea,void 0);M(this,Ef,void 0);M(this,Sf,void 0);M(this,wc,void 0);mt(this,{allowLoose:!!n}),O(this,Ai,Or(e)),O(this,Ef,0),O(this,Sf,null),O(this,wc,r??1024),O(this,ea,0)}get data(){return Ze(b(this,Ai))}get dataLength(){return b(this,Ai).length}get consumed(){return b(this,ea)}get bytes(){return new Uint8Array(b(this,Ai))}subReader(e){const n=new $4(b(this,Ai).slice(b(this,ea)+e),this.allowLoose,b(this,wc));return O(n,Sf,this),n}readBytes(e,n){let r=ie(this,f2,M$).call(this,0,e,!!n);return ie(this,Mm,P3).call(this,e),O(this,ea,b(this,ea)+r.length),r.slice(0,e)}readValue(){return fO(this.readBytes(ui))}readIndex(){return Gte(this.readBytes(ui))}};Ai=new WeakMap,ea=new WeakMap,Ef=new WeakMap,Sf=new WeakMap,wc=new WeakMap,Mm=new WeakSet,P3=function(e){var n;if(b(this,Sf))return ie(n=b(this,Sf),Mm,P3).call(n,e);O(this,Ef,b(this,Ef)+e),me(b(this,wc)<1||b(this,Ef)<=b(this,wc)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${b(this,wc)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:Or(b(this,Ai)),offset:b(this,ea),length:e,info:{bytesRead:b(this,Ef),dataLength:this.dataLength}})},f2=new WeakSet,M$=function(e,n,r){let i=Math.ceil(n/ui)*ui;return b(this,ea)+i>b(this,Ai).length&&(this.allowLoose&&r&&b(this,ea)+n<=b(this,Ai).length?i=n:me(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Or(b(this,Ai)),length:b(this,Ai).length,offset:b(this,ea)+i})),b(this,Ai).slice(b(this,ea),b(this,ea)+i)};let S3=$4,B$=!1;const D$=function(t){return GD(t)};let L$=D$;function Nn(t){const e=Pt(t,"data");return Ze(L$(e))}Nn._=D$;Nn.lock=function(){B$=!0};Nn.register=function(t){if(B$)throw new TypeError("keccak256 is locked");L$=t};Object.freeze(Nn);const O3="0x0000000000000000000000000000000000000000",Yk="0x0000000000000000000000000000000000000000000000000000000000000000",Xk=BigInt(0),Zk=BigInt(1),qk=BigInt(2),e_=BigInt(27),t_=BigInt(28),tb=BigInt(35),_h={};function n_(t){return sh(sa(t),32)}var N0,I0,R0,Pf;const to=class to{constructor(e,n,r,i){M(this,N0,void 0);M(this,I0,void 0);M(this,R0,void 0);M(this,Pf,void 0);eA(e,_h,"Signature"),O(this,N0,n),O(this,I0,r),O(this,R0,i),O(this,Pf,null)}get r(){return b(this,N0)}set r(e){Y(Nd(e)===32,"invalid r","value",e),O(this,N0,Ze(e))}get s(){return b(this,I0)}set s(e){Y(Nd(e)===32,"invalid s","value",e);const n=Ze(e);Y(parseInt(n.substring(0,3))<8,"non-canonical s","value",n),O(this,I0,n)}get v(){return b(this,R0)}set v(e){const n=Lt(e,"value");Y(n===27||n===28,"invalid v","v",e),O(this,R0,n)}get networkV(){return b(this,Pf)}get legacyChainId(){const e=this.networkV;return e==null?null:to.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=Pt(this.s);return this.yParity&&(e[0]|=128),Ze(e)}get compactSerialized(){return lr([this.r,this.yParityAndS])}get serialized(){return lr([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new to(_h,this.r,this.s,this.v);return this.networkV&&O(e,Pf,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const n=ot(e,"v");return n==e_||n==t_?Xk:(Y(n>=tb,"invalid EIP-155 v","v",e),(n-tb)/qk)}static getChainIdV(e,n){return ot(e)*qk+BigInt(35+n-27)}static getNormalizedV(e){const n=ot(e);return n===Xk||n===e_?27:n===Zk||n===t_?28:(Y(n>=tb,"invalid v","v",e),n&Zk?27:28)}static from(e){function n(c,u){Y(c,u,"signature",e)}if(e==null)return new to(_h,Yk,Yk,27);if(typeof e=="string"){const c=Pt(e,"signature");if(c.length===64){const u=Ze(c.slice(0,32)),f=c.slice(32,64),h=f[0]&128?28:27;return f[0]&=127,new to(_h,u,Ze(f),h)}if(c.length===65){const u=Ze(c.slice(0,32)),f=c.slice(32,64);n((f[0]&128)===0,"non-canonical s");const h=to.getNormalizedV(c[64]);return new to(_h,u,Ze(f),h)}n(!1,"invalid raw signature length")}if(e instanceof to)return e.clone();const r=e.r;n(r!=null,"missing r");const i=n_(r),a=function(c,u){if(c!=null)return n_(c);if(u!=null){n(In(u,32),"invalid yParityAndS");const f=Pt(u);return f[0]&=127,Ze(f)}n(!1,"missing s")}(e.s,e.yParityAndS);n((Pt(a)[0]&128)==0,"non-canonical s");const{networkV:o,v:s}=function(c,u,f){if(c!=null){const h=ot(c);return{networkV:h>=tb?h:void 0,v:to.getNormalizedV(h)}}if(u!=null)return n(In(u,32),"invalid yParityAndS"),{v:Pt(u)[0]&128?28:27};if(f!=null){switch(Lt(f,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}n(!1,"invalid yParity")}n(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),l=new to(_h,i,a,s);return o&&O(l,Pf,o),n(e.yParity==null||Lt(e.yParity,"sig.yParity")===l.yParity,"yParity mismatch"),n(e.yParityAndS==null||e.yParityAndS===l.yParityAndS,"yParityAndS mismatch"),l}};N0=new WeakMap,I0=new WeakMap,R0=new WeakMap,Pf=new WeakMap;let To=to;var Ks;const ku=class ku{constructor(e){M(this,Ks,void 0);Y(Nd(e)===32,"invalid private key","privateKey","[REDACTED]"),O(this,Ks,Ze(e))}get privateKey(){return b(this,Ks)}get publicKey(){return ku.computePublicKey(b(this,Ks))}get compressedPublicKey(){return ku.computePublicKey(b(this,Ks),!0)}sign(e){Y(Nd(e)===32,"invalid digest length","digest",e);const n=ri.sign(Or(e),Or(b(this,Ks)),{lowS:!0});return To.from({r:fs(n.r,32),s:fs(n.s,32),v:n.recovery?28:27})}computeSharedSecret(e){const n=ku.computePublicKey(e);return Ze(ri.getSharedSecret(Or(b(this,Ks)),Pt(n),!1))}static computePublicKey(e,n){let r=Pt(e,"key");if(r.length===32){const a=ri.getPublicKey(r,!!n);return Ze(a)}if(r.length===64){const a=new Uint8Array(65);a[0]=4,a.set(r,1),r=a}const i=ri.ProjectivePoint.fromHex(r);return Ze(i.toRawBytes(n))}static recoverPublicKey(e,n){Y(Nd(e)===32,"invalid digest length","digest",e);const r=To.from(n);let i=ri.Signature.fromCompact(Or(lr([r.r,r.s])));i=i.addRecoveryBit(r.yParity);const a=i.recoverPublicKey(Or(e));return Y(a!=null,"invalid signautre for digest","signature",n),"0x"+a.toHex(!1)}static addPoints(e,n,r){const i=ri.ProjectivePoint.fromHex(ku.computePublicKey(e).substring(2)),a=ri.ProjectivePoint.fromHex(ku.computePublicKey(n).substring(2));return"0x"+i.add(a).toHex(!!r)}};Ks=new WeakMap;let m1=ku;const lne=BigInt(0),cne=BigInt(36);function r_(t){t=t.toLowerCase();const e=t.substring(2).split(""),n=new Uint8Array(40);for(let i=0;i<40;i++)n[i]=e[i].charCodeAt(0);const r=Pt(Nn(n));for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(r[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const pO={};for(let t=0;t<10;t++)pO[String(t)]=String(t);for(let t=0;t<26;t++)pO[String.fromCharCode(65+t)]=String(10+t);const i_=15;function une(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(r=>pO[r]).join("");for(;e.length>=i_;){let r=e.substring(0,i_);e=parseInt(r,10)%97+e.substring(r.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}const fne=function(){const t={};for(let e=0;e<36;e++){const n="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[n]=BigInt(e)}return t}();function hne(t){t=t.toLowerCase();let e=lne;for(let n=0;ne.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 this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return b(this,Of)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return b(this,Of)===!0?-1:b(this,Of)===!1?this.value.length:null}static from(e,n){return new Os(Es,e,n)}static uint8(e){return Qe(e,8)}static uint16(e){return Qe(e,16)}static uint24(e){return Qe(e,24)}static uint32(e){return Qe(e,32)}static uint40(e){return Qe(e,40)}static uint48(e){return Qe(e,48)}static uint56(e){return Qe(e,56)}static uint64(e){return Qe(e,64)}static uint72(e){return Qe(e,72)}static uint80(e){return Qe(e,80)}static uint88(e){return Qe(e,88)}static uint96(e){return Qe(e,96)}static uint104(e){return Qe(e,104)}static uint112(e){return Qe(e,112)}static uint120(e){return Qe(e,120)}static uint128(e){return Qe(e,128)}static uint136(e){return Qe(e,136)}static uint144(e){return Qe(e,144)}static uint152(e){return Qe(e,152)}static uint160(e){return Qe(e,160)}static uint168(e){return Qe(e,168)}static uint176(e){return Qe(e,176)}static uint184(e){return Qe(e,184)}static uint192(e){return Qe(e,192)}static uint200(e){return Qe(e,200)}static uint208(e){return Qe(e,208)}static uint216(e){return Qe(e,216)}static uint224(e){return Qe(e,224)}static uint232(e){return Qe(e,232)}static uint240(e){return Qe(e,240)}static uint248(e){return Qe(e,248)}static uint256(e){return Qe(e,256)}static uint(e){return Qe(e,256)}static int8(e){return Qe(e,-8)}static int16(e){return Qe(e,-16)}static int24(e){return Qe(e,-24)}static int32(e){return Qe(e,-32)}static int40(e){return Qe(e,-40)}static int48(e){return Qe(e,-48)}static int56(e){return Qe(e,-56)}static int64(e){return Qe(e,-64)}static int72(e){return Qe(e,-72)}static int80(e){return Qe(e,-80)}static int88(e){return Qe(e,-88)}static int96(e){return Qe(e,-96)}static int104(e){return Qe(e,-104)}static int112(e){return Qe(e,-112)}static int120(e){return Qe(e,-120)}static int128(e){return Qe(e,-128)}static int136(e){return Qe(e,-136)}static int144(e){return Qe(e,-144)}static int152(e){return Qe(e,-152)}static int160(e){return Qe(e,-160)}static int168(e){return Qe(e,-168)}static int176(e){return Qe(e,-176)}static int184(e){return Qe(e,-184)}static int192(e){return Qe(e,-192)}static int200(e){return Qe(e,-200)}static int208(e){return Qe(e,-208)}static int216(e){return Qe(e,-216)}static int224(e){return Qe(e,-224)}static int232(e){return Qe(e,-232)}static int240(e){return Qe(e,-240)}static int248(e){return Qe(e,-248)}static int256(e){return Qe(e,-256)}static int(e){return Qe(e,-256)}static bytes1(e){return qt(e,1)}static bytes2(e){return qt(e,2)}static bytes3(e){return qt(e,3)}static bytes4(e){return qt(e,4)}static bytes5(e){return qt(e,5)}static bytes6(e){return qt(e,6)}static bytes7(e){return qt(e,7)}static bytes8(e){return qt(e,8)}static bytes9(e){return qt(e,9)}static bytes10(e){return qt(e,10)}static bytes11(e){return qt(e,11)}static bytes12(e){return qt(e,12)}static bytes13(e){return qt(e,13)}static bytes14(e){return qt(e,14)}static bytes15(e){return qt(e,15)}static bytes16(e){return qt(e,16)}static bytes17(e){return qt(e,17)}static bytes18(e){return qt(e,18)}static bytes19(e){return qt(e,19)}static bytes20(e){return qt(e,20)}static bytes21(e){return qt(e,21)}static bytes22(e){return qt(e,22)}static bytes23(e){return qt(e,23)}static bytes24(e){return qt(e,24)}static bytes25(e){return qt(e,25)}static bytes26(e){return qt(e,26)}static bytes27(e){return qt(e,27)}static bytes28(e){return qt(e,28)}static bytes29(e){return qt(e,29)}static bytes30(e){return qt(e,30)}static bytes31(e){return qt(e,31)}static bytes32(e){return qt(e,32)}static address(e){return new Os(Es,"address",e)}static bool(e){return new Os(Es,"bool",!!e)}static bytes(e){return new Os(Es,"bytes",e)}static string(e){return new Os(Es,"string",e)}static array(e,n){throw new Error("not implemented yet")}static tuple(e,n){throw new Error("not implemented yet")}static overrides(e){return new Os(Es,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===a_}static dereference(e,n){if(Os.isTyped(e)){if(e.type!==n)throw new Error(`invalid type: expecetd ${n}, got ${e.type}`);return e.value}return e}};Of=new WeakMap;let Wr=Os;class pne extends Ml{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,n){let r=Wr.dereference(n,"string");try{r=rn(r)}catch(i){return this._throwError(i.message,n)}return e.writeValue(r)}decode(e){return rn(fs(e.readValue(),20))}}class gne extends Ml{constructor(n){super(n.name,n.type,"_",n.dynamic);R(this,"coder");this.coder=n}defaultValue(){return this.coder.defaultValue()}encode(n,r){return this.coder.encode(n,r)}decode(n){return this.coder.decode(n)}}function U$(t,e,n){let r=[];if(Array.isArray(n))r=n;else if(n&&typeof n=="object"){let l={};r=e.map(c=>{const u=c.localName;return me(u,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:c},value:n}),me(!l[u],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:c},value:n}),l[u]=!0,n[u]})}else Y(!1,"invalid tuple value","tuple",n);Y(e.length===r.length,"types/value length mismatch","tuple",n);let i=new E3,a=new E3,o=[];e.forEach((l,c)=>{let u=r[c];if(l.dynamic){let f=a.length;l.encode(a,u);let h=i.writeUpdatableValue();o.push(d=>{h(d+f)})}else l.encode(i,u)}),o.forEach(l=>{l(i.length)});let s=t.appendWriter(i);return s+=t.appendWriter(a),s}function F$(t,e){let n=[],r=[],i=t.subReader(0);return e.forEach(a=>{let o=null;if(a.dynamic){let s=t.readIndex(),l=i.subReader(s);try{o=a.decode(l)}catch(c){if(Kr(c,"BUFFER_OVERRUN"))throw c;o=c,o.baseType=a.name,o.name=a.localName,o.type=a.type}}else try{o=a.decode(t)}catch(s){if(Kr(s,"BUFFER_OVERRUN"))throw s;o=s,o.baseType=a.name,o.name=a.localName,o.type=a.type}if(o==null)throw new Error("investigate");n.push(o),r.push(a.localName||null)}),ix.fromItems(n,r)}class yne extends Ml{constructor(n,r,i){const a=n.type+"["+(r>=0?r:"")+"]",o=r===-1||n.dynamic;super("array",a,i,o);R(this,"coder");R(this,"length");mt(this,{coder:n,length:r})}defaultValue(){const n=this.coder.defaultValue(),r=[];for(let i=0;io||i<-(o+Ene))&&this._throwError("value out-of-bounds",r),i=P$(i,8*ui)}else(ily(a,this.size*8))&&this._throwError("value out-of-bounds",r);return n.writeValue(i)}decode(n){let r=ly(n.readValue(),this.size*8);return this.signed&&(r=Hte(r,this.size*8)),r}}class One extends j${constructor(e){super("string",e)}defaultValue(){return""}encode(e,n){return super.encode(e,dl(Wr.dereference(n,"string")))}decode(e){return hO(super.decode(e))}}class nb extends Ml{constructor(n,r){let i=!1;const a=[];n.forEach(s=>{s.dynamic&&(i=!0),a.push(s.type)});const o="tuple("+a.join(",")+")";super("tuple",o,r,i);R(this,"coders");mt(this,{coders:Object.freeze(n.slice())})}defaultValue(){const n=[];this.coders.forEach(i=>{n.push(i.defaultValue())});const r=this.coders.reduce((i,a)=>{const o=a.localName;return o&&(i[o]||(i[o]=0),i[o]++),i},{});return this.coders.forEach((i,a)=>{let o=i.localName;!o||r[o]!==1||(o==="length"&&(o="_length"),n[o]==null&&(n[o]=n[a]))}),Object.freeze(n)}encode(n,r){const i=Wr.dereference(r,"tuple");return U$(n,this.coders,i)}decode(n){return F$(n,this.coders)}}function lh(t){return Nn(dl(t))}var Tne="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8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lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const o_=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),s_=4;function Cne(t){let e=0;function n(){return t[e++]<<8|t[e++]}let r=n(),i=1,a=[0,1];for(let S=1;S>--l&1}const f=31,h=2**f,d=h>>>1,g=d>>1,p=h-1;let m=0;for(let S=0;S1;){let B=E+T>>>1;S>>1|u(),C=C<<1^d,N=(N^d)<<1|d|1;v=C,x=1+N-C}let A=r-4;return y.map(S=>{switch(S-A){case 3:return A+65792+(t[s++]<<16|t[s++]<<8|t[s++]);case 2:return A+256+(t[s++]<<8|t[s++]);case 1:return A+t[s++];default:return S-1}})}function kne(t){let e=0;return()=>t[e++]}function z$(t){return kne(Cne(_ne(t)))}function _ne(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,a)=>e[i.charCodeAt(0)]=a);let n=t.length,r=new Uint8Array(6*n>>3);for(let i=0,a=0,o=0,s=0;i=8&&(r[a++]=s>>(o-=8));return r}function Nne(t){return t&1?~t>>1:t>>1}function Ine(t,e){let n=Array(t);for(let r=0,i=0;r{let e=v1(t);if(e.length)return e})}function G$(t){let e=[];for(;;){let n=t();if(n==0)break;e.push(Rne(n,t))}for(;;){let n=t()-1;if(n<0)break;e.push(Mne(n,t))}return e.flat()}function b1(t){let e=[];for(;;){let n=t(e.length);if(!n)break;e.push(n)}return e}function V$(t,e,n){let r=Array(t).fill().map(()=>[]);for(let i=0;ir[o].push(a));return r}function Rne(t,e){let n=1+e(),r=e(),i=b1(e);return V$(i.length,1+t,e).flatMap((o,s)=>{let[l,...c]=o;return Array(i[s]).fill().map((u,f)=>{let h=f*r;return[l+f*n,c.map(d=>d+h)]})})}function Mne(t,e){let n=1+e();return V$(n,1+t,e).map(i=>[i[0],i.slice(1)])}function Bne(t){let e=[],n=v1(t);return i(r([]),[]),e;function r(a){let o=t(),s=b1(()=>{let l=v1(t).map(c=>n[c]);if(l.length)return r(l)});return{S:o,B:s,Q:a}}function i({S:a,B:o},s,l){if(!(a&4&&l===s[s.length-1])){a&2&&(l=s[s.length-1]),a&1&&e.push(s);for(let c of o)for(let u of c.Q)i(c,[...s,u],l)}}}function Dne(t){return t.toString(16).toUpperCase().padStart(2,"0")}function Q$(t){return`{${Dne(t)}}`}function Lne(t){let e=[];for(let n=0,r=t.length;n>24&255}function J$(t){return t&16777215}let T3,l_,C3,rw;function Vne(){let t=z$(Une);T3=new Map(H$(t).flatMap((e,n)=>e.map(r=>[r,n+1<<24]))),l_=new Set(v1(t)),C3=new Map,rw=new Map;for(let[e,n]of G$(t)){if(!l_.has(e)&&n.length==2){let[r,i]=n,a=rw.get(r);a||(a=new Map,rw.set(r,a)),a.set(i,e)}C3.set(e,n.reverse())}}function Y$(t){return t>=w1&&t=ax&&t=ox&&esx&&e0&&i(sx+c)}else{let o=C3.get(a);o?n.push(...o):i(a)}if(!n.length)break;a=n.pop()}if(r&&e.length>1){let a=uy(e[0]);for(let o=1;o0&&i>=o)o==0?(e.push(r,...n),n.length=0,r=s):n.push(s),i=o;else{let l=Qne(r,s);l>=0?r=l:i==0&&o==0?(e.push(r),r=s):(n.push(s),i=o)}}return r>=0&&e.push(r,...n),e}function Z$(t){return X$(t).map(J$)}function Wne(t){return Kne(X$(t))}const c_=45,q$=".",eU=65039,tU=1,pd=t=>Array.from(t);function x1(t,e){return t.P.has(e)||t.Q.has(e)}class Jne extends Array{get is_emoji(){return!0}}let k3,nU,ju,_3,rU,Id,eE,zh,iU,u_,N3;function gO(){if(k3)return;let t=z$(Tne);const e=()=>v1(t),n=()=>new Set(e());k3=new Map(G$(t)),nU=n(),ju=e(),_3=new Set(e().map(u=>ju[u])),ju=new Set(ju),rU=n(),n();let r=H$(t),i=t();const a=()=>new Set(e().flatMap(u=>r[u]).concat(e()));Id=b1(u=>{let f=b1(t).map(h=>h+96);if(f.length){let h=u>=i;f[0]-=32,f=Op(f),h&&(f=`Restricted[${f}]`);let d=a(),g=a(),p=!t();return{N:f,P:d,Q:g,M:p,R:h}}}),eE=n(),zh=new Map;let o=e().concat(pd(eE)).sort((u,f)=>u-f);o.forEach((u,f)=>{let h=t(),d=o[f]=h?o[f-h]:{V:[],M:new Map};d.V.push(u),eE.has(u)||zh.set(u,d)});for(let{V:u,M:f}of new Set(zh.values())){let h=[];for(let g of u){let p=Id.filter(y=>x1(y,g)),m=h.find(({G:y})=>p.some(v=>y.has(v)));m||(m={G:new Set,V:[]},h.push(m)),m.V.push(g),p.forEach(y=>m.G.add(y))}let d=h.flatMap(g=>pd(g.G));for(let{G:g,V:p}of h){let m=new Set(d.filter(y=>!g.has(y)));for(let y of p)f.set(y,m)}}let s=new Set,l=new Set;const c=u=>s.has(u)?l.add(u):s.add(u);for(let u of Id){for(let f of u.P)c(f);for(let f of u.Q)c(f)}for(let u of s)!zh.has(u)&&!l.has(u)&&zh.set(u,tU);iU=new Set(pd(s).concat(pd(Z$(s)))),u_=Bne(t).map(u=>Jne.from(u)).sort($ne),N3=new Map;for(let u of u_){let f=[N3];for(let h of u){let d=f.map(g=>{let p=g.get(h);return p||(p=new Map,g.set(h,p)),p});h===eU?f.push(...d):f=d}for(let h of f)h.V=u}}function yO(t){return(aU(t)?"":`${mO(rA([t]))} `)+Q$(t)}function mO(t){return`"${t}"‎`}function Yne(t){if(t.length>=4&&t[2]==c_&&t[3]==c_)throw new Error(`invalid label extension: "${Op(t.slice(0,4))}"`)}function Xne(t){for(let n=t.lastIndexOf(95);n>0;)if(t[--n]!==95)throw new Error("underscore allowed only at start")}function Zne(t){let e=t[0],n=o_.get(e);if(n)throw ky(`leading ${n}`);let r=t.length,i=-1;for(let a=1;a{let a=Lne(i),o={input:a,offset:r};r+=a.length+1;try{let s=o.tokens=ore(a,e,n),l=s.length,c;if(!l)throw new Error("empty label");let u=o.output=s.flat();if(Xne(u),!(o.emoji=l>1||s[0].is_emoji)&&u.every(h=>h<128))Yne(u),c="ASCII";else{let h=s.flatMap(d=>d.is_emoji?[]:d);if(!h.length)c="Emoji";else{if(ju.has(u[0]))throw ky("leading combining mark");for(let p=1;po.has(s)):pd(o),!n.length)return}else r.push(i)}if(n){for(let i of n)if(r.every(a=>x1(i,a)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function rre(t){let e=Id;for(let n of t){let r=e.filter(i=>x1(i,n));if(!r.length)throw Id.some(i=>x1(i,n))?sU(e[0],n):oU(n);if(e=r,r.length==1)break}return e}function ire(t){return t.map(({input:e,error:n,output:r})=>{if(n){let i=n.message;throw new Error(t.length==1?i:`Invalid label ${mO(rA(e))}: ${i}`)}return Op(r)}).join(q$)}function oU(t){return new Error(`disallowed character: ${yO(t)}`)}function sU(t,e){let n=yO(e),r=Id.find(i=>i.P.has(e));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${t.N} + ${n}`)}function ky(t){return new Error(`illegal placement: ${t}`)}function are(t,e){for(let n of e)if(!x1(t,n))throw sU(t,n);if(t.M){let n=Z$(e);for(let r=1,i=n.length;rs_)throw new Error(`excessive non-spacing marks: ${mO(rA(n.slice(r-1,a)))} (${a-r}/${s_})`);r=a}}}function ore(t,e,n){let r=[],i=[];for(t=t.slice().reverse();t.length;){let a=lre(t);if(a)i.length&&(r.push(e(i)),i=[]),r.push(n(a));else{let o=t.pop();if(iU.has(o))i.push(o);else{let s=k3.get(o);if(s)i.push(...s);else if(!nU.has(o))throw oU(o)}}}return i.length&&r.push(e(i)),r}function sre(t){return t.filter(e=>e!=eU)}function lre(t,e){let n=N3,r,i=t.length;for(;i&&(n=n.get(t[--i]),!!n);){let{V:a}=n;a&&(r=a,e&&e.push(...t.slice(i).reverse()),t.length=i)}return r}const lU=new Uint8Array(32);lU.fill(0);function f_(t){return Y(t.length!==0,"invalid ENS name; empty component","comp",t),t}function cU(t){const e=dl(cre(t)),n=[];if(t.length===0)return n;let r=0;for(let i=0;i{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const n=new Uint8Array(e.length+1);return n.set(e,1),n[0]=n.length-1,n})))+"00"}function tE(t,e){return{address:rn(t),storageKeys:e.map((n,r)=>(Y(In(n,32),"invalid slot",`storageKeys[${r}]`,n),n.toLowerCase()))}}function xh(t){if(Array.isArray(t))return t.map((n,r)=>Array.isArray(n)?(Y(n.length===2,"invalid slot set",`value[${r}]`,n),tE(n[0],n[1])):(Y(n!=null&&typeof n=="object","invalid address-slot set","value",t),tE(n.address,n.storageKeys)));Y(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(n=>{const r=t[n].reduce((i,a)=>(i[a]=!0,i),{});return tE(n,Object.keys(r).sort())});return e.sort((n,r)=>n.address.localeCompare(r.address)),e}function fre(t){let e;return typeof t=="string"?e=m1.computePublicKey(t,!1):e=t.publicKey,rn(Nn("0x"+e.substring(4)).substring(26))}function hre(t,e){return fre(m1.recoverPublicKey(t,e))}const ki=BigInt(0),dre=BigInt(2),pre=BigInt(27),gre=BigInt(28),yre=BigInt(35),mre=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function vO(t){return t==="0x"?null:rn(t)}function uU(t,e){try{return xh(t)}catch(n){Y(!1,n.message,e,t)}}function iA(t,e){return t==="0x"?0:Lt(t,e)}function ii(t,e){if(t==="0x")return ki;const n=ot(t,e);return Y(n<=mre,"value exceeds uint size",e,n),n}function Er(t,e){const n=ot(t,"value"),r=sa(n);return Y(r.length<=32,"value too large",`tx.${e}`,n),r}function fU(t){return xh(t).map(e=>[e.address,e.storageKeys])}function vre(t){const e=dO(t);Y(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",t);const n={type:0,nonce:iA(e[0],"nonce"),gasPrice:ii(e[1],"gasPrice"),gasLimit:ii(e[2],"gasLimit"),to:vO(e[3]),value:ii(e[4],"value"),data:Ze(e[5]),chainId:ki};if(e.length===6)return n;const r=ii(e[6],"v"),i=ii(e[7],"r"),a=ii(e[8],"s");if(i===ki&&a===ki)n.chainId=r;else{let o=(r-yre)/dre;o=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),me(!n||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),me(this.type!==0||!r,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const i=[];return this.type!=null?i.push(this.type):n?i.push(2):e?(i.push(1),r||i.push(0)):r?(i.push(1),i.push(2)):(i.push(0),i.push(1),i.push(2)),i.sort(),i}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}clone(){return Zl.from(this)}toJSON(){const e=n=>n==null?null:n.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new Zl;if(typeof e=="string"){const r=Pt(e);if(r[0]>=127)return Zl.from(vre(r));switch(r[0]){case 1:return Zl.from(wre(r));case 2:return Zl.from(bre(r))}me(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const n=new Zl;return e.type!=null&&(n.type=e.type),e.to!=null&&(n.to=e.to),e.nonce!=null&&(n.nonce=e.nonce),e.gasLimit!=null&&(n.gasLimit=e.gasLimit),e.gasPrice!=null&&(n.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(n.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(n.maxFeePerGas=e.maxFeePerGas),e.data!=null&&(n.data=e.data),e.value!=null&&(n.value=e.value),e.chainId!=null&&(n.chainId=e.chainId),e.signature!=null&&(n.signature=To.from(e.signature)),e.accessList!=null&&(n.accessList=e.accessList),e.hash!=null&&(Y(n.isSigned(),"unsigned transaction cannot define hash","tx",e),Y(n.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(Y(n.isSigned(),"unsigned transaction cannot define from","tx",e),Y(n.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),n}};Ws=new WeakMap,M0=new WeakMap,B0=new WeakMap,D0=new WeakMap,L0=new WeakMap,$0=new WeakMap,U0=new WeakMap,F0=new WeakMap,j0=new WeakMap,z0=new WeakMap,H0=new WeakMap,G0=new WeakMap;let A1=Zl;const dU=new Uint8Array(32);dU.fill(0);const xre=BigInt(-1),pU=BigInt(0),gU=BigInt(1),Are=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function Ere(t){const e=Pt(t),n=e.length%32;return n?lr([e,dU.slice(n)]):Ze(e)}const Sre=fs(gU,32),Pre=fs(pU,32),g_={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},nE=["name","version","chainId","verifyingContract","salt"];function y_(t){return function(e){return Y(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const Ore={name:y_("name"),version:y_("version"),chainId:function(t){const e=ot(t,"domain.chainId");return Y(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):Fu(e)},verifyingContract:function(t){try{return rn(t).toLowerCase()}catch{}Y(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=Pt(t,"domain.salt");return Y(e.length===32,'invalid domain value "salt"',"domain.salt",t),Ze(e)}};function rE(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const n=e[1]==="",r=parseInt(e[2]||"256");Y(r%8===0&&r!==0&&r<=256&&(e[2]==null||e[2]===String(r)),"invalid numeric width","type",t);const i=ly(Are,n?r-1:r),a=n?(i+gU)*xre:pU;return function(o){const s=ot(o,"value");return Y(s>=a&&s<=i,`value out-of-bounds for ${t}`,"value",s),fs(n?P$(s,256):s,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const n=parseInt(e[1]);return Y(n!==0&&n<=32&&e[1]===String(n),"invalid bytes width","type",t),function(r){const i=Pt(r);return Y(i.length===n,`invalid length for ${t}`,"value",r),Ere(r)}}}switch(t){case"address":return function(e){return sh(rn(e),32)};case"bool":return function(e){return e?Sre:Pre};case"bytes":return function(e){return Nn(e)};case"string":return function(e){return lh(e)}}return null}function m_(t,e){return`${t}(${e.map(({name:n,type:r})=>r+" "+n).join(",")})`}var Bm,Js,V0,h2,yU;const wa=class wa{constructor(e){M(this,h2);R(this,"primaryType");M(this,Bm,void 0);M(this,Js,void 0);M(this,V0,void 0);O(this,Bm,JSON.stringify(e)),O(this,Js,new Map),O(this,V0,new Map);const n=new Map,r=new Map,i=new Map;Object.keys(e).forEach(s=>{n.set(s,new Set),r.set(s,[]),i.set(s,new Set)});for(const s in e){const l=new Set;for(const c of e[s]){Y(!l.has(c.name),`duplicate variable name ${JSON.stringify(c.name)} in ${JSON.stringify(s)}`,"types",e),l.add(c.name);const u=c.type.match(/^([^\x5b]*)(\x5b|$)/)[1]||null;Y(u!==s,`circular type reference to ${JSON.stringify(u)}`,"types",e),!rE(u)&&(Y(r.has(u),`unknown type ${JSON.stringify(u)}`,"types",e),r.get(u).push(s),n.get(s).add(u))}}const a=Array.from(r.keys()).filter(s=>r.get(s).length===0);Y(a.length!==0,"missing primary type","types",e),Y(a.length===1,`ambiguous primary types or unused types: ${a.map(s=>JSON.stringify(s)).join(", ")}`,"types",e),mt(this,{primaryType:a[0]});function o(s,l){Y(!l.has(s),`circular type reference to ${JSON.stringify(s)}`,"types",e),l.add(s);for(const c of n.get(s))if(r.has(c)){o(c,l);for(const u of l)i.get(u).add(c)}l.delete(s)}o(this.primaryType,new Set);for(const[s,l]of i){const c=Array.from(l);c.sort(),b(this,Js).set(s,m_(s,e[s])+c.map(u=>m_(u,e[u])).join(""))}}get types(){return JSON.parse(b(this,Bm))}getEncoder(e){let n=b(this,V0).get(e);return n||(n=ie(this,h2,yU).call(this,e),b(this,V0).set(e,n)),n}encodeType(e){const n=b(this,Js).get(e);return Y(n,`unknown type: ${JSON.stringify(e)}`,"name",e),n}encodeData(e,n){return this.getEncoder(e)(n)}hashStruct(e,n){return Nn(this.encodeData(e,n))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,n,r){if(rE(e))return r(e,n);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i)return Y(!i[3]||parseInt(i[3])===n.length,`array length mismatch; expected length ${parseInt(i[3])}`,"value",n),n.map(o=>this._visit(i[1],o,r));const a=this.types[e];if(a)return a.reduce((o,{name:s,type:l})=>(o[s]=this._visit(l,n[s],r),o),{});Y(!1,`unknown type: ${e}`,"type",e)}visit(e,n){return this._visit(this.primaryType,e,n)}static from(e){return new wa(e)}static getPrimaryType(e){return wa.from(e).primaryType}static hashStruct(e,n,r){return wa.from(n).hashStruct(e,r)}static hashDomain(e){const n=[];for(const r in e){if(e[r]==null)continue;const i=g_[r];Y(i,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),n.push({name:r,type:i})}return n.sort((r,i)=>nE.indexOf(r.name)-nE.indexOf(i.name)),wa.hashStruct("EIP712Domain",{EIP712Domain:n},e)}static encode(e,n,r){return lr(["0x1901",wa.hashDomain(e),wa.from(n).hash(r)])}static hash(e,n,r){return Nn(wa.encode(e,n,r))}static async resolveNames(e,n,r,i){e=Object.assign({},e);for(const s in e)e[s]==null&&delete e[s];const a={};e.verifyingContract&&!In(e.verifyingContract,20)&&(a[e.verifyingContract]="0x");const o=wa.from(n);o.visit(r,(s,l)=>(s==="address"&&!In(l,20)&&(a[l]="0x"),l));for(const s in a)a[s]=await i(s);return e.verifyingContract&&a[e.verifyingContract]&&(e.verifyingContract=a[e.verifyingContract]),r=o.visit(r,(s,l)=>s==="address"&&a[l]?a[l]:l),{domain:e,value:r}}static getPayload(e,n,r){wa.hashDomain(e);const i={},a=[];nE.forEach(l=>{const c=e[l];c!=null&&(i[l]=Ore[l](c),a.push({name:l,type:g_[l]}))});const o=wa.from(n),s=Object.assign({},n);return Y(s.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",n),s.EIP712Domain=a,o.encode(r),{types:s,domain:i,primaryType:o.primaryType,message:o.visit(r,(l,c)=>{if(l.match(/^bytes(\d*)/))return Ze(Pt(c));if(l.match(/^u?int/))return ot(c).toString();switch(l){case"address":return c.toLowerCase();case"bool":return!!c;case"string":return Y(typeof c=="string","invalid string","value",c),c}Y(!1,"unsupported type","type",l)})}}};Bm=new WeakMap,Js=new WeakMap,V0=new WeakMap,h2=new WeakSet,yU=function(e){{const i=rE(e);if(i)return i}const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const i=n[1],a=this.getEncoder(i);return o=>{Y(!n[3]||parseInt(n[3])===o.length,`array length mismatch; expected length ${parseInt(n[3])}`,"value",o);let s=o.map(a);return b(this,Js).has(i)&&(s=s.map(Nn)),Nn(lr(s))}}const r=this.types[e];if(r){const i=lh(b(this,Js).get(e));return a=>{const o=r.map(({name:s,type:l})=>{const c=this.getEncoder(l)(a[s]);return b(this,Js).has(l)?Nn(c):c});return o.unshift(i),lr(o)}}Y(!1,`unknown type: ${e}`,"type",e)};let E1=wa;function hi(t){const e=new Set;return t.forEach(n=>e.add(n)),Object.freeze(e)}const Tre="external public payable",Cre=hi(Tre.split(" ")),mU="constant external internal payable private public pure view",kre=hi(mU.split(" ")),vU="constructor error event fallback function receive struct",bU=hi(vU.split(" ")),wU="calldata memory storage payable indexed",_re=hi(wU.split(" ")),Nre="tuple returns",Ire=[vU,wU,Nre,mU].join(" "),Rre=hi(Ire.split(" ")),Mre={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},Bre=new RegExp("^(\\s*)"),Dre=new RegExp("^([0-9]+)"),Lre=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),xU=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),AU=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var wr,uo,Dm,R3;const d2=class d2{constructor(e){M(this,Dm);M(this,wr,void 0);M(this,uo,void 0);O(this,wr,0),O(this,uo,e.slice())}get offset(){return b(this,wr)}get length(){return b(this,uo).length-b(this,wr)}clone(){return new d2(b(this,uo))}reset(){O(this,wr,0)}popKeyword(e){const n=this.peek();if(n.type!=="KEYWORD"||!e.has(n.text))throw new Error(`expected keyword ${n.text}`);return this.pop().text}popType(e){if(this.peek().type!==e)throw new Error(`expected ${e}; got ${JSON.stringify(this.peek())}`);return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=ie(this,Dm,R3).call(this,b(this,wr)+1,e.match+1);return O(this,wr,e.match+1),n}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=[];for(;b(this,wr)=b(this,uo).length)throw new Error("out-of-bounds");return b(this,uo)[b(this,wr)]}peekKeyword(e){const n=this.peekType("KEYWORD");return n!=null&&e.has(n)?n:null}peekType(e){if(this.length===0)return null;const n=this.peek();return n.type===e?n.text:null}pop(){const e=this.peek();return vs(this,wr)._++,e}toString(){const e=[];for(let n=b(this,wr);n`}};wr=new WeakMap,uo=new WeakMap,Dm=new WeakSet,R3=function(e=0,n=0){return new d2(b(this,uo).slice(e,n).map(r=>Object.freeze(Object.assign({},r,{match:r.match-e,linkBack:r.linkBack-e,linkNext:r.linkNext-e}))))};let Co=d2;function su(t){const e=[],n=o=>{const s=a0&&e[e.length-1].type==="NUMBER"){const f=e.pop().text;u=f+u,e[e.length-1].value=Lt(f)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=u}continue}if(s=o.match(Lre),s){if(l.text=s[1],a+=l.text.length,Rre.has(l.text)){l.type="KEYWORD";continue}if(l.text.match(AU)){l.type="TYPE";continue}l.type="ID";continue}if(s=o.match(Dre),s){l.text=s[1],l.type="NUMBER",a+=l.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${a}`)}return new Co(e.map(o=>Object.freeze(o)))}function v_(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 aA(t,e){if(e.peekKeyword(bU)){const n=e.pop().text;if(n!==t)throw new Error(`expected ${t}, got ${n}`)}return e.popType("ID")}function Pl(t,e){const n=new Set;for(;;){const r=t.peekType("KEYWORD");if(r==null||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 EU(t){let e=Pl(t,kre);return v_(e,hi("constant payable nonpayable".split(" "))),v_(e,hi("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 pl(t,e){return t.popParams().map(n=>Cr.from(n,e))}function SU(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return ot(t.pop().text);throw new Error("invalid gas")}return null}function ch(t){if(t.length)throw new Error(`unexpected tokens: ${t.toString()}`)}const $re=new RegExp(/^(.*)\[([0-9]*)\]$/);function b_(t){const e=t.match(AU);if(Y(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const n=parseInt(e[2]);Y(n!==0&&n<=32,"invalid bytes length","type",t)}else if(e[3]){const n=parseInt(e[3]);Y(n!==0&&n<=256&&n%8===0,"invalid numeric width","type",t)}return t}const _n={},Ui=Symbol.for("_ethers_internal"),w_="_ParamTypeInternal",x_="_ErrorInternal",A_="_EventInternal",E_="_ConstructorInternal",S_="_FallbackInternal",P_="_FunctionInternal",O_="_StructInternal";var Q0,iw;const xa=class xa{constructor(e,n,r,i,a,o,s,l){M(this,Q0);R(this,"name");R(this,"type");R(this,"baseType");R(this,"indexed");R(this,"components");R(this,"arrayLength");R(this,"arrayChildren");if(eA(e,_n,"ParamType"),Object.defineProperty(this,Ui,{value:w_}),o&&(o=Object.freeze(o.slice())),i==="array"){if(s==null||l==null)throw new Error("")}else if(s!=null||l!=null)throw new Error("");if(i==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");mt(this,{name:n,type:r,baseType:i,indexed:a,components:o,arrayLength:s,arrayChildren:l})}format(e){if(e==null&&(e="sighash"),e==="json"){const r=this.name||"";if(this.isArray()){const a=JSON.parse(this.arrayChildren.format("json"));return a.name=r,a.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(a)}const i={type:this.baseType==="tuple"?"tuple":this.type,name:r};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(a=>JSON.parse(a.format(e)))),JSON.stringify(i)}let n="";return this.isArray()?(n+=this.arrayChildren.format(e),n+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?n+="("+this.components.map(r=>r.format(e)).join(e==="full"?", ":",")+")":n+=this.type,e!=="sighash"&&(this.indexed===!0&&(n+=" indexed"),e==="full"&&this.name&&(n+=" "+this.name)),n}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,n){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const r=this;return e.map(i=>r.arrayChildren.walk(i,n))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const r=this;return e.map((i,a)=>r.components[a].walk(i,n))}return n(this.type,e)}async walkAsync(e,n){const r=[],i=[e];return ie(this,Q0,iw).call(this,r,e,n,a=>{i[0]=a}),r.length&&await Promise.all(r),i[0]}static from(e,n){if(xa.isParamType(e))return e;if(typeof e=="string")try{return xa.from(su(e),n)}catch{Y(!1,"invalid param type","obj",e)}else if(e instanceof Co){let s="",l="",c=null;Pl(e,hi(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(l="tuple",c=e.popParams().map(p=>xa.from(p)),s=`tuple(${c.map(p=>p.format()).join(",")})`):(s=b_(e.popType("TYPE")),l=s);let u=null,f=null;for(;e.length&&e.peekType("BRACKET");){const p=e.pop();u=new xa(_n,"",s,l,null,c,f,u),f=p.value,s+=p.text,l="array",c=null}let h=null;if(Pl(e,_re).has("indexed")){if(!n)throw new Error("");h=!0}const g=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new xa(_n,g,s,l,h,c,f,u)}const r=e.name;Y(!r||typeof r=="string"&&r.match(xU),"invalid name","obj.name",r);let i=e.indexed;i!=null&&(Y(n,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let a=e.type,o=a.match($re);if(o){const s=parseInt(o[2]||"-1"),l=xa.from({type:o[1],components:e.components});return new xa(_n,r||"",a,"array",i,null,s,l)}if(a==="tuple"||a.startsWith("tuple(")||a.startsWith("(")){const s=e.components!=null?e.components.map(c=>xa.from(c)):null;return new xa(_n,r||"",a,"tuple",i,s,null,null)}return a=b_(e.type),new xa(_n,r||"",a,a,i,null,null,null)}static isParamType(e){return e&&e[Ui]===w_}};Q0=new WeakSet,iw=function(e,n,r,i){if(this.isArray()){if(!Array.isArray(n))throw new Error("invalid array value");if(this.arrayLength!==-1&&n.length!==this.arrayLength)throw new Error("array is wrong length");const o=this.arrayChildren,s=n.slice();s.forEach((l,c)=>{var u;ie(u=o,Q0,iw).call(u,e,l,r,f=>{s[c]=f})}),i(s);return}if(this.isTuple()){const o=this.components;let s;if(Array.isArray(n))s=n.slice();else{if(n==null||typeof n!="object")throw new Error("invalid tuple value");s=o.map(l=>{if(!l.name)throw new Error("cannot use object value with unnamed components");if(!(l.name in n))throw new Error(`missing value for component ${l.name}`);return n[l.name]})}if(s.length!==this.components.length)throw new Error("array is wrong length");s.forEach((l,c)=>{var u;ie(u=o[c],Q0,iw).call(u,e,l,r,f=>{s[c]=f})}),i(s);return}const a=r(this.type,n);a.then?e.push(async function(){i(await a)}()):i(a)};let Cr=xa;class uh{constructor(e,n,r){R(this,"type");R(this,"inputs");eA(e,_n,"Fragment"),r=Object.freeze(r.slice()),mt(this,{type:n,inputs:r})}static from(e){if(typeof e=="string"){try{uh.from(JSON.parse(e))}catch{}return uh.from(su(e))}if(e instanceof Co)switch(e.peekKeyword(bU)){case"constructor":return sl.from(e);case"error":return _i.from(e);case"event":return qo.from(e);case"fallback":case"receive":return _s.from(e);case"function":return es.from(e);case"struct":return zf.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return sl.from(e);case"error":return _i.from(e);case"event":return qo.from(e);case"fallback":case"receive":return _s.from(e);case"function":return es.from(e);case"struct":return zf.from(e)}me(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}Y(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return sl.isFragment(e)}static isError(e){return _i.isFragment(e)}static isEvent(e){return qo.isFragment(e)}static isFunction(e){return es.isFragment(e)}static isStruct(e){return zf.isFragment(e)}}class oA extends uh{constructor(n,r,i,a){super(n,r,a);R(this,"name");Y(typeof i=="string"&&i.match(xU),"invalid identifier","name",i),a=Object.freeze(a.slice()),mt(this,{name:i})}}function S1(t,e){return"("+e.map(n=>n.format(t)).join(t==="full"?", ":",")+")"}class _i extends oA{constructor(e,n,r){super(e,"error",n,r),Object.defineProperty(this,Ui,{value:x_})}get selector(){return lh(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(e)))});const n=[];return e!=="sighash"&&n.push("error"),n.push(this.name+S1(e,this.inputs)),n.join(" ")}static from(e){if(_i.isFragment(e))return e;if(typeof e=="string")return _i.from(su(e));if(e instanceof Co){const n=aA("error",e),r=pl(e);return ch(e),new _i(_n,n,r)}return new _i(_n,e.name,e.inputs?e.inputs.map(Cr.from):[])}static isFragment(e){return e&&e[Ui]===x_}}class qo extends oA{constructor(n,r,i,a){super(n,"event",r,i);R(this,"anonymous");Object.defineProperty(this,Ui,{value:A_}),mt(this,{anonymous:a})}get topicHash(){return lh(this.format("sighash"))}format(n){if(n==null&&(n="sighash"),n==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(n)))});const r=[];return n!=="sighash"&&r.push("event"),r.push(this.name+S1(n,this.inputs)),n!=="sighash"&&this.anonymous&&r.push("anonymous"),r.join(" ")}static getTopicHash(n,r){return r=(r||[]).map(a=>Cr.from(a)),new qo(_n,n,r,!1).topicHash}static from(n){if(qo.isFragment(n))return n;if(typeof n=="string")try{return qo.from(su(n))}catch{Y(!1,"invalid event fragment","obj",n)}else if(n instanceof Co){const r=aA("event",n),i=pl(n,!0),a=!!Pl(n,hi(["anonymous"])).has("anonymous");return ch(n),new qo(_n,r,i,a)}return new qo(_n,n.name,n.inputs?n.inputs.map(r=>Cr.from(r,!0)):[],!!n.anonymous)}static isFragment(n){return n&&n[Ui]===A_}}class sl extends uh{constructor(n,r,i,a,o){super(n,r,i);R(this,"payable");R(this,"gas");Object.defineProperty(this,Ui,{value:E_}),mt(this,{payable:a,gas:o})}format(n){if(me(n!=null&&n!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),n==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(n)))});const r=[`constructor${S1(n,this.inputs)}`];return this.payable&&r.push("payable"),this.gas!=null&&r.push(`@${this.gas.toString()}`),r.join(" ")}static from(n){if(sl.isFragment(n))return n;if(typeof n=="string")try{return sl.from(su(n))}catch{Y(!1,"invalid constuctor fragment","obj",n)}else if(n instanceof Co){Pl(n,hi(["constructor"]));const r=pl(n),i=!!Pl(n,Cre).has("payable"),a=SU(n);return ch(n),new sl(_n,"constructor",r,i,a)}return new sl(_n,"constructor",n.inputs?n.inputs.map(Cr.from):[],!!n.payable,n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[Ui]===E_}}class _s extends uh{constructor(n,r,i){super(n,"fallback",r);R(this,"payable");Object.defineProperty(this,Ui,{value:S_}),mt(this,{payable:i})}format(n){const r=this.inputs.length===0?"receive":"fallback";if(n==="json"){const i=this.payable?"payable":"nonpayable";return JSON.stringify({type:r,stateMutability:i})}return`${r}()${this.payable?" payable":""}`}static from(n){if(_s.isFragment(n))return n;if(typeof n=="string")try{return _s.from(su(n))}catch{Y(!1,"invalid fallback fragment","obj",n)}else if(n instanceof Co){const r=n.toString(),i=n.peekKeyword(hi(["fallback","receive"]));if(Y(i,"type must be fallback or receive","obj",r),n.popKeyword(hi(["fallback","receive"]))==="receive"){const l=pl(n);return Y(l.length===0,"receive cannot have arguments","obj.inputs",l),Pl(n,hi(["payable"])),ch(n),new _s(_n,[],!0)}let o=pl(n);o.length?Y(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(l=>l.format("minimal")).join(", ")):o=[Cr.from("bytes")];const s=EU(n);if(Y(s==="nonpayable"||s==="payable","fallback cannot be constants","obj.stateMutability",s),Pl(n,hi(["returns"])).has("returns")){const l=pl(n);Y(l.length===1&&l[0].type==="bytes","invalid fallback outputs","obj.outputs",l.map(c=>c.format("minimal")).join(", "))}return ch(n),new _s(_n,o,s==="payable")}if(n.type==="receive")return new _s(_n,[],!0);if(n.type==="fallback"){const r=[Cr.from("bytes")],i=n.stateMutability==="payable";return new _s(_n,r,i)}Y(!1,"invalid fallback description","obj",n)}static isFragment(n){return n&&n[Ui]===S_}}class es extends oA{constructor(n,r,i,a,o,s){super(n,"function",r,a);R(this,"constant");R(this,"outputs");R(this,"stateMutability");R(this,"payable");R(this,"gas");Object.defineProperty(this,Ui,{value:P_}),o=Object.freeze(o.slice()),mt(this,{constant:i==="view"||i==="pure",gas:s,outputs:o,payable:i==="payable",stateMutability:i})}get selector(){return lh(this.format("sighash")).substring(0,10)}format(n){if(n==null&&(n="sighash"),n==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(n))),outputs:this.outputs.map(i=>JSON.parse(i.format(n)))});const r=[];return n!=="sighash"&&r.push("function"),r.push(this.name+S1(n,this.inputs)),n!=="sighash"&&(this.stateMutability!=="nonpayable"&&r.push(this.stateMutability),this.outputs&&this.outputs.length&&(r.push("returns"),r.push(S1(n,this.outputs))),this.gas!=null&&r.push(`@${this.gas.toString()}`)),r.join(" ")}static getSelector(n,r){return r=(r||[]).map(a=>Cr.from(a)),new es(_n,n,"view",r,[],null).selector}static from(n){if(es.isFragment(n))return n;if(typeof n=="string")try{return es.from(su(n))}catch{Y(!1,"invalid function fragment","obj",n)}else if(n instanceof Co){const i=aA("function",n),a=pl(n),o=EU(n);let s=[];Pl(n,hi(["returns"])).has("returns")&&(s=pl(n));const l=SU(n);return ch(n),new es(_n,i,o,a,s,l)}let r=n.stateMutability;return r==null&&(r="payable",typeof n.constant=="boolean"?(r="view",n.constant||(r="payable",typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable"))):typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable")),new es(_n,n.name,r,n.inputs?n.inputs.map(Cr.from):[],n.outputs?n.outputs.map(Cr.from):[],n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[Ui]===P_}}class zf extends oA{constructor(e,n,r){super(e,"struct",n,r),Object.defineProperty(this,Ui,{value:O_})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return zf.from(su(e))}catch{Y(!1,"invalid struct fragment","obj",e)}else if(e instanceof Co){const n=aA("struct",e),r=pl(e);return ch(e),new zf(_n,n,r)}return new zf(_n,e.name,e.inputs?e.inputs.map(Cr.from):[])}static isFragment(e){return e&&e[Ui]===O_}}const _o=new Map;_o.set(0,"GENERIC_PANIC");_o.set(1,"ASSERT_FALSE");_o.set(17,"OVERFLOW");_o.set(18,"DIVIDE_BY_ZERO");_o.set(33,"ENUM_RANGE_ERROR");_o.set(34,"BAD_STORAGE_DATA");_o.set(49,"STACK_UNDERFLOW");_o.set(50,"ARRAY_RANGE_ERROR");_o.set(65,"OUT_OF_MEMORY");_o.set(81,"UNINITIALIZED_FUNCTION_CALL");const Ure=new RegExp(/^bytes([0-9]*)$/),Fre=new RegExp(/^(u?int)([0-9]*)$/);let iE=null,T_=1024;function jre(t,e,n,r){let i="missing revert data",a=null;const o=null;let s=null;if(n){i="execution reverted";const c=Pt(n);if(n=Ze(n),c.length===0)i+=" (no data present; likely require(false) occurred",a="require(false)";else if(c.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(Ze(c.slice(0,4))==="0x08c379a0")try{a=r.decode(["string"],c.slice(4))[0],s={signature:"Error(string)",name:"Error",args:[a]},i+=`: ${JSON.stringify(a)}`}catch{i+=" (could not decode reason; invalid string data)"}else if(Ze(c.slice(0,4))==="0x4e487b71")try{const u=Number(r.decode(["uint256"],c.slice(4))[0]);s={signature:"Panic(uint256)",name:"Panic",args:[u]},a=`Panic due to ${_o.get(u)||"UNKNOWN"}(${u})`,i+=`: ${a}`}catch{i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const l={to:e.to?rn(e.to):null,data:e.data||"0x"};return e.from&&(l.from=rn(e.from)),er(i,"CALL_EXCEPTION",{action:t,data:n,reason:a,transaction:l,invocation:o,revert:s})}var xc,Hh;const p2=class p2{constructor(){M(this,xc)}getDefaultValue(e){const n=e.map(i=>ie(this,xc,Hh).call(this,Cr.from(i)));return new nb(n,"_").defaultValue()}encode(e,n){A$(n.length,e.length,"types/values length mismatch");const r=e.map(o=>ie(this,xc,Hh).call(this,Cr.from(o))),i=new nb(r,"_"),a=new E3;return i.encode(a,n),a.data}decode(e,n,r){const i=e.map(o=>ie(this,xc,Hh).call(this,Cr.from(o)));return new nb(i,"_").decode(new S3(n,r,T_))}static _setDefaultMaxInflation(e){Y(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),T_=e}static defaultAbiCoder(){return iE==null&&(iE=new p2),iE}static getBuiltinCallException(e,n,r){return jre(e,n,r,p2.defaultAbiCoder())}};xc=new WeakSet,Hh=function(e){if(e.isArray())return new yne(ie(this,xc,Hh).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new nb(e.components.map(r=>ie(this,xc,Hh).call(this,r)),e.name);switch(e.baseType){case"address":return new pne(e.name);case"bool":return new mne(e.name);case"string":return new One(e.name);case"bytes":return new vne(e.name);case"":return new xne(e.name)}let n=e.type.match(Fre);if(n){let r=parseInt(n[2]||"256");return Y(r!==0&&r<=256&&r%8===0,"invalid "+n[1]+" bit length","param",e),new Pne(r/8,n[1]==="int",e.name)}if(n=e.type.match(Ure),n){let r=parseInt(n[1]);return Y(r!==0&&r<=32,"invalid bytes length","param",e),new bne(r,e.name)}Y(!1,"invalid type","type",e.type)};let P1=p2;class zre{constructor(e,n,r){R(this,"fragment");R(this,"name");R(this,"signature");R(this,"topic");R(this,"args");const i=e.name,a=e.format();mt(this,{fragment:e,name:i,signature:a,topic:n,args:r})}}class Hre{constructor(e,n,r,i){R(this,"fragment");R(this,"name");R(this,"args");R(this,"signature");R(this,"selector");R(this,"value");const a=e.name,o=e.format();mt(this,{fragment:e,name:a,args:r,signature:o,selector:n,value:i})}}class Gre{constructor(e,n,r){R(this,"fragment");R(this,"name");R(this,"args");R(this,"signature");R(this,"selector");const i=e.name,a=e.format();mt(this,{fragment:e,name:i,args:r,signature:a,selector:n})}}class C_{constructor(e){R(this,"hash");R(this,"_isIndexed");mt(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const k_={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"},__={"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&&k_[t.toString()]&&(e=k_[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};var Qo,Ko,Wo,Ur,K0,aw,W0,ow;const vd=class vd{constructor(e){M(this,K0);M(this,W0);R(this,"fragments");R(this,"deploy");R(this,"fallback");R(this,"receive");M(this,Qo,void 0);M(this,Ko,void 0);M(this,Wo,void 0);M(this,Ur,void 0);let n=[];typeof e=="string"?n=JSON.parse(e):n=e,O(this,Wo,new Map),O(this,Qo,new Map),O(this,Ko,new Map);const r=[];for(const o of n)try{r.push(uh.from(o))}catch(s){console.log("EE",s)}mt(this,{fragments:Object.freeze(r)});let i=null,a=!1;O(this,Ur,this.getAbiCoder()),this.fragments.forEach((o,s)=>{let l;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}mt(this,{deploy:o});return;case"fallback":o.inputs.length===0?a=!0:(Y(!i||o.payable!==i.payable,"conflicting fallback fragments",`fragments[${s}]`,o),i=o,a=i.payable);return;case"function":l=b(this,Wo);break;case"event":l=b(this,Ko);break;case"error":l=b(this,Qo);break;default:return}const c=o.format();l.has(c)||l.set(c,o)}),this.deploy||mt(this,{deploy:sl.from("constructor()")}),mt(this,{fallback:i,receive:a})}format(e){const n=e?"minimal":"full";return this.fragments.map(i=>i.format(n))}formatJson(){const e=this.fragments.map(n=>n.format("json"));return JSON.stringify(e.map(n=>JSON.parse(n)))}getAbiCoder(){return P1.defaultAbiCoder()}getFunctionName(e){const n=ie(this,K0,aw).call(this,e,null,!1);return Y(n,"no matching function","key",e),n.name}hasFunction(e){return!!ie(this,K0,aw).call(this,e,null,!1)}getFunction(e,n){return ie(this,K0,aw).call(this,e,n||null,!0)}forEachFunction(e){const n=Array.from(b(this,Wo).keys());n.sort((r,i)=>r.localeCompare(i));for(let r=0;rr.localeCompare(i));for(let r=0;r1){const a=i.map(o=>JSON.stringify(o.format())).join(", ");Y(!1,`ambiguous error description (i.e. ${a})`,"name",e)}return i[0]}if(e=_i.from(e).format(),e==="Error(string)")return _i.from("error Error(string)");if(e==="Panic(uint256)")return _i.from("error Panic(uint256)");const r=b(this,Qo).get(e);return r||null}forEachError(e){const n=Array.from(b(this,Qo).keys());n.sort((r,i)=>r.localeCompare(i));for(let r=0;ra.type==="string"?lh(o):a.type==="bytes"?Nn(Ze(o)):(a.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":a.type.match(/^u?int/)?o=fs(o):a.type.match(/^bytes/)?o=zte(o,32):a.type==="address"&&b(this,Ur).encode(["address"],[o]),sh(Ze(o),32));for(n.forEach((a,o)=>{const s=e.inputs[o];if(!s.indexed){Y(a==null,"cannot filter non-indexed parameters; must be null","contract."+s.name,a);return}a==null?r.push(null):s.baseType==="array"||s.baseType==="tuple"?Y(!1,"filtering with tuples or arrays not supported","contract."+s.name,a):Array.isArray(a)?r.push(a.map(l=>i(s,l))):r.push(i(s,a))});r.length&&r[r.length-1]===null;)r.pop();return r}encodeEventLog(e,n){if(typeof e=="string"){const o=this.getEvent(e);Y(o,"unknown event","eventFragment",e),e=o}const r=[],i=[],a=[];return e.anonymous||r.push(e.topicHash),Y(n.length===e.inputs.length,"event arguments/values mismatch","values",n),e.inputs.forEach((o,s)=>{const l=n[s];if(o.indexed)if(o.type==="string")r.push(lh(l));else if(o.type==="bytes")r.push(Nn(l));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");r.push(b(this,Ur).encode([o.type],[l]))}else i.push(o),a.push(l)}),{data:b(this,Ur).encode(i,a),topics:r}}decodeEventLog(e,n,r){if(typeof e=="string"){const d=this.getEvent(e);Y(d,"unknown event","eventFragment",e),e=d}if(r!=null&&!e.anonymous){const d=e.topicHash;Y(In(r[0],32)&&r[0].toLowerCase()===d,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}const i=[],a=[],o=[];e.inputs.forEach((d,g)=>{d.indexed?d.type==="string"||d.type==="bytes"||d.baseType==="tuple"||d.baseType==="array"?(i.push(Cr.from({type:"bytes32",name:d.name})),o.push(!0)):(i.push(d),o.push(!1)):(a.push(d),o.push(!1))});const s=r!=null?b(this,Ur).decode(i,lr(r)):null,l=b(this,Ur).decode(a,n,!0),c=[],u=[];let f=0,h=0;return e.inputs.forEach((d,g)=>{let p=null;if(d.indexed)if(s==null)p=new C_(null);else if(o[g])p=new C_(s[h++]);else try{p=s[h++]}catch(m){p=m}else try{p=l[f++]}catch(m){p=m}c.push(p),u.push(d.name||null)}),ix.fromItems(c,u)}parseTransaction(e){const n=Pt(e.data,"tx.data"),r=ot(e.value!=null?e.value:0,"tx.value"),i=this.getFunction(Ze(n.slice(0,4)));if(!i)return null;const a=b(this,Ur).decode(i.inputs,n.slice(4));return new Hre(i,i.selector,a,r)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const n=this.getEvent(e.topics[0]);return!n||n.anonymous?null:new zre(n,n.topicHash,this.decodeEventLog(n,e.data,e.topics))}parseError(e){const n=Ze(e),r=this.getError(Fn(n,0,4));if(!r)return null;const i=b(this,Ur).decode(r.inputs,Fn(n,4));return new Gre(r,r.selector,i)}static from(e){return e instanceof vd?e:typeof e=="string"?new vd(JSON.parse(e)):typeof e.format=="function"?new vd(e.format("json")):new vd(e)}};Qo=new WeakMap,Ko=new WeakMap,Wo=new WeakMap,Ur=new WeakMap,K0=new WeakSet,aw=function(e,n,r){if(In(e)){const a=e.toLowerCase();for(const o of b(this,Wo).values())if(a===o.selector)return o;return null}if(e.indexOf("(")===-1){const a=[];for(const[o,s]of b(this,Wo))o.split("(")[0]===e&&a.push(s);if(n){const o=n.length>0?n[n.length-1]:null;let s=n.length,l=!0;Wr.isTyped(o)&&o.type==="overrides"&&(l=!1,s--);for(let c=a.length-1;c>=0;c--){const u=a[c].inputs.length;u!==s&&(!l||u!==s-1)&&a.splice(c,1)}for(let c=a.length-1;c>=0;c--){const u=a[c].inputs;for(let f=0;f=u.length){if(n[f].type==="overrides")continue;a.splice(c,1);break}if(n[f].type!==u[f].baseType){a.splice(c,1);break}}}}if(a.length===1&&n&&n.length!==a[0].inputs.length){const o=n[n.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&a.splice(0,1)}if(a.length===0)return null;if(a.length>1&&r){const o=a.map(s=>JSON.stringify(s.format())).join(", ");Y(!1,`ambiguous function description (i.e. matches ${o})`,"key",e)}return a[0]}const i=b(this,Wo).get(es.from(e).format());return i||null},W0=new WeakSet,ow=function(e,n,r){if(In(e)){const a=e.toLowerCase();for(const o of b(this,Ko).values())if(a===o.topicHash)return o;return null}if(e.indexOf("(")===-1){const a=[];for(const[o,s]of b(this,Ko))o.split("(")[0]===e&&a.push(s);if(n){for(let o=a.length-1;o>=0;o--)a[o].inputs.length=0;o--){const s=a[o].inputs;for(let l=0;l1&&r){const o=a.map(s=>JSON.stringify(s.format())).join(", ");Y(!1,`ambiguous event description (i.e. matches ${o})`,"key",e)}return a[0]}const i=b(this,Ko).get(qo.from(e).format());return i||null};let M3=vd;const PU=BigInt(0);function _y(t){return t??null}function Gr(t){return t==null?null:t.toString()}class N_{constructor(e,n,r){R(this,"gasPrice");R(this,"maxFeePerGas");R(this,"maxPriorityFeePerGas");mt(this,{gasPrice:_y(e),maxFeePerGas:_y(n),maxPriorityFeePerGas:_y(r)})}toJSON(){const{gasPrice:e,maxFeePerGas:n,maxPriorityFeePerGas:r}=this;return{_type:"FeeData",gasPrice:Gr(e),maxFeePerGas:Gr(n),maxPriorityFeePerGas:Gr(r)}}}function cx(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=Ze(t.data));const n="chainId,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of n)!(i in t)||t[i]==null||(e[i]=ot(t[i],`request.${i}`));const r="type,nonce".split(/,/);for(const i of r)!(i in t)||t[i]==null||(e[i]=Lt(t[i],`request.${i}`));return t.accessList&&(e.accessList=xh(t.accessList)),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipRead=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),e}var Ys;class Vre{constructor(e,n){R(this,"provider");R(this,"number");R(this,"hash");R(this,"timestamp");R(this,"parentHash");R(this,"nonce");R(this,"difficulty");R(this,"gasLimit");R(this,"gasUsed");R(this,"miner");R(this,"extraData");R(this,"baseFeePerGas");M(this,Ys,void 0);O(this,Ys,e.transactions.map(r=>typeof r!="string"?new O1(r,n):r)),mt(this,{provider:n,hash:_y(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,miner:e.miner,extraData:e.extraData,baseFeePerGas:_y(e.baseFeePerGas)})}get transactions(){return b(this,Ys).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=b(this,Ys).slice();return e.length===0?[]:(me(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:n,extraData:r,gasLimit:i,gasUsed:a,hash:o,miner:s,nonce:l,number:c,parentHash:u,timestamp:f,transactions:h}=this;return{_type:"Block",baseFeePerGas:Gr(e),difficulty:Gr(n),extraData:r,gasLimit:Gr(i),gasUsed:Gr(a),hash:o,miner:s,nonce:l,number:c,parentHash:u,timestamp:f,transactions:h}}[Symbol.iterator](){let e=0;const n=this.transactions;return{next:()=>enew fv(i,n))));let r=PU;e.effectiveGasPrice!=null?r=e.effectiveGasPrice:e.gasPrice!=null&&(r=e.gasPrice),mt(this,{provider:n,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,gasPrice:r,type:e.type,status:e.status,root:e.root})}get logs(){return b(this,Lm)}toJSON(){const{to:e,from:n,contractAddress:r,hash:i,index:a,blockHash:o,blockNumber:s,logsBloom:l,logs:c,status:u,root:f}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:s,contractAddress:r,cumulativeGasUsed:Gr(this.cumulativeGasUsed),from:n,gasPrice:Gr(this.gasPrice),gasUsed:Gr(this.gasUsed),hash:i,index:a,logs:c,logsBloom:l,root:f,status:u,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e{if(s)return null;const{blockNumber:h,nonce:d}=await ni({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(d{if(h==null||h.status!==0)return h;me(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:h.to,from:h.from,data:""},receipt:h})},u=await this.provider.getTransactionReceipt(this.hash);if(r===0)return c(u);if(u){if(await u.confirmations()>=r)return c(u)}else if(await l(),r===0)return null;return await new Promise((h,d)=>{const g=[],p=()=>{g.forEach(y=>y())};if(g.push(()=>{s=!0}),i>0){const y=setTimeout(()=>{p(),d(er("wait for transaction timeout","TIMEOUT"))},i);g.push(()=>{clearTimeout(y)})}const m=async y=>{if(await y.confirmations()>=r){p();try{h(c(y))}catch(v){d(v)}}};if(g.push(()=>{this.provider.off(this.hash,m)}),this.provider.on(this.hash,m),a>=0){const y=async()=>{try{await l()}catch(v){if(Kr(v,"TRANSACTION_REPLACED")){p(),d(v);return}}s||this.provider.once("block",y)};g.push(()=>{this.provider.off("block",y)}),this.provider.once("block",y)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}removedEvent(){return me(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),CU(this)}reorderedEvent(e){return me(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),me(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),TU(this,e)}replaceableTransaction(e){Y(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const n=new U4(this,this.provider);return O(n,Ac,e),n}};Ac=new WeakMap;let O1=U4;function Qre(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function TU(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function CU(t){return{orphan:"drop-transaction",tx:t}}function Kre(t){return{orphan:"drop-log",log:{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,address:t.address,data:t.data,topics:Object.freeze(t.topics.slice()),index:t.index}}}class bO extends fv{constructor(n,r,i){super(n,n.provider);R(this,"interface");R(this,"fragment");R(this,"args");const a=r.decodeEventLog(i,n.data,n.topics);mt(this,{args:a,fragment:i,interface:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class kU extends fv{constructor(n,r){super(n,n.provider);R(this,"error");mt(this,{error:r})}}var J0;class Wre extends OU{constructor(n,r,i){super(i,r);M(this,J0,void 0);O(this,J0,n)}get logs(){return super.logs.map(n=>{const r=n.topics.length?b(this,J0).getEvent(n.topics[0]):null;if(r)try{return new bO(n,b(this,J0),r)}catch(i){return new kU(n,i)}return n})}}J0=new WeakMap;var $m;class wO extends O1{constructor(n,r,i){super(i,r);M(this,$m,void 0);O(this,$m,n)}async wait(n){const r=await super.wait(n);return r==null?null:new Wre(b(this,$m),this.provider,r)}}$m=new WeakMap;class _U extends O${constructor(n,r,i,a){super(n,r,i);R(this,"log");mt(this,{log:a})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class Jre extends _U{constructor(e,n,r,i,a){super(e,n,r,new bO(a,e.interface,i));const o=e.interface.decodeEventLog(i,this.log.data,this.log.topics);mt(this,{args:o,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const I_=BigInt(0);function NU(t){return t&&typeof t.call=="function"}function IU(t){return t&&typeof t.estimateGas=="function"}function sA(t){return t&&typeof t.resolveName=="function"}function RU(t){return t&&typeof t.sendTransaction=="function"}function MU(t){if(t!=null){if(sA(t))return t;if(t.provider)return t.provider}}var Um;class Yre{constructor(e,n,r){M(this,Um,void 0);R(this,"fragment");if(mt(this,{fragment:n}),n.inputs.lengthr[l]==null?null:s.walkAsync(r[l],(u,f)=>u==="address"?Array.isArray(f)?Promise.all(f.map(h=>fi(h,a))):fi(f,a):f)));return e.interface.encodeFilterTopics(n,o)}())}getTopicFilter(){return b(this,Um)}}Um=new WeakMap;function fh(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function zu(t){return t==null?null:t.provider||null}async function BU(t,e){const n=Wr.dereference(t,"overrides");Y(typeof n=="object","invalid overrides parameter","overrides",t);const r=cx(n);return Y(r.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),Y(r.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=r.from),r}async function Xre(t,e,n){const r=fh(t,"resolveName"),i=sA(r)?r:null;return await Promise.all(e.map((a,o)=>a.walkAsync(n[o],(s,l)=>(l=Wr.dereference(l,s),s==="address"?fi(l,i):l))))}function Zre(t){const e=async function(o){const s=await BU(o,["data"]);s.to=await t.getAddress(),s.from&&(s.from=await fi(s.from,MU(t.runner)));const l=t.interface,c=ot(s.value||I_,"overrides.value")===I_,u=(s.data||"0x")==="0x";l.fallback&&!l.fallback.payable&&l.receive&&!u&&!c&&Y(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),Y(l.fallback||u,"cannot send data to receive-only contract","overrides.data",s.data);const f=l.receive||l.fallback&&l.fallback.payable;return Y(f||c,"cannot send value to non-payable fallback","overrides.value",s.value),Y(l.fallback||u,"cannot send data to receive-only contract","overrides.data",s.data),s},n=async function(o){const s=fh(t.runner,"call");me(NU(s),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const l=await e(o);try{return await s.call(l)}catch(c){throw uO(c)&&c.data?t.interface.makeError(c.data,l):c}},r=async function(o){const s=t.runner;me(RU(s),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const l=await s.sendTransaction(await e(o)),c=zu(t.runner);return new wO(t.interface,c,l)},i=async function(o){const s=fh(t.runner,"estimateGas");return me(IU(s),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await s.estimateGas(await e(o))},a=async o=>await r(o);return mt(a,{_contract:t,estimateGas:i,populateTransaction:e,send:r,staticCall:n}),a}function qre(t,e){const n=function(...c){const u=t.interface.getFunction(e,c);return me(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:c}}),u},r=async function(...c){const u=n(...c);let f={};if(u.inputs.length+1===c.length&&(f=await BU(c.pop()),f.from&&(f.from=await fi(f.from,MU(t.runner)))),u.inputs.length!==c.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const h=await Xre(t.runner,u.inputs,c);return Object.assign({},f,await ni({to:t.getAddress(),data:t.interface.encodeFunctionData(u,h)}))},i=async function(...c){const u=await s(...c);return u.length===1?u[0]:u},a=async function(...c){const u=t.runner;me(RU(u),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const f=await u.sendTransaction(await r(...c)),h=zu(t.runner);return new wO(t.interface,h,f)},o=async function(...c){const u=fh(t.runner,"estimateGas");return me(IU(u),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await u.estimateGas(await r(...c))},s=async function(...c){const u=fh(t.runner,"call");me(NU(u),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const f=await r(...c);let h="0x";try{h=await u.call(f)}catch(g){throw uO(g)&&g.data?t.interface.makeError(g.data,f):g}const d=n(...c);return t.interface.decodeFunctionResult(d,h)},l=async(...c)=>n(...c).constant?await i(...c):await a(...c);return mt(l,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:n,estimateGas:o,populateTransaction:r,send:a,staticCall:i,staticCallResult:s}),Object.defineProperty(l,"fragment",{configurable:!1,enumerable:!0,get:()=>{const c=t.interface.getFunction(e);return me(c,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),c}}),l}function eie(t,e){const n=function(...i){const a=t.interface.getEvent(e,i);return me(a,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:i}}),a},r=function(...i){return new Yre(t,n(...i),i)};return mt(r,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:n}),Object.defineProperty(r,"fragment",{configurable:!1,enumerable:!0,get:()=>{const i=t.interface.getEvent(e);return me(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),i}}),r}const ux=Symbol.for("_ethersInternal_contract"),DU=new WeakMap;function tie(t,e){DU.set(t[ux],e)}function Ki(t){return DU.get(t[ux])}function nie(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function xO(t,e){let n,r=null;if(Array.isArray(e)){const a=function(o){if(In(o,32))return o;const s=t.interface.getEvent(o);return Y(s,"unknown fragment","name",o),s.topicHash};n=e.map(o=>o==null?null:Array.isArray(o)?o.map(a):a(o))}else e==="*"?n=[null]:typeof e=="string"?In(e,32)?n=[e]:(r=t.interface.getEvent(e),Y(r,"unknown fragment","event",e),n=[r.topicHash]):nie(e)?n=await e.getTopicFilter():"fragment"in e?(r=e.fragment,n=[r.topicHash]):Y(!1,"unknown event name","event",e);n=n.map(a=>{if(a==null)return null;if(Array.isArray(a)){const o=Array.from(new Set(a.map(s=>s.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return a.toLowerCase()});const i=n.map(a=>a==null?"null":Array.isArray(a)?a.join("|"):a).join("&");return{fragment:r,tag:i,topics:n}}async function fy(t,e){const{subs:n}=Ki(t);return n.get((await xO(t,e)).tag)||null}async function R_(t,e,n){const r=zu(t.runner);me(r,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:i,tag:a,topics:o}=await xO(t,n),{addr:s,subs:l}=Ki(t);let c=l.get(a);if(!c){const f={address:s||t,topics:o},h=m=>{let y=i;if(y==null)try{y=t.interface.getEvent(m.topics[0])}catch{}if(y){const v=y,x=i?t.interface.decodeEventLog(i,m.data,m.topics):[];D3(t,n,x,A=>new Jre(t,A,n,v,m))}else D3(t,n,[],v=>new _U(t,v,n,m))};let d=[];c={tag:a,listeners:[],start:()=>{d.length||d.push(r.on(f,h))},stop:async()=>{if(d.length==0)return;let m=d;d=[],await Promise.all(m),r.off(f,h)}},l.set(a,c)}return c}let B3=Promise.resolve();async function rie(t,e,n,r){await B3;const i=await fy(t,e);if(!i)return!1;const a=i.listeners.length;return i.listeners=i.listeners.filter(({listener:o,once:s})=>{const l=Array.from(n);r&&l.push(r(s?null:o));try{o.call(t,...l)}catch{}return!s}),i.listeners.length===0&&(i.stop(),Ki(t).subs.delete(i.tag)),a>0}async function D3(t,e,n,r){try{await B3}catch{}const i=rie(t,e,n,r);return B3=i,await i}const rb=["then"];var $Pe;const jy=class jy{constructor(e,n,r,i){R(this,"target");R(this,"interface");R(this,"runner");R(this,"filters");R(this,$Pe);R(this,"fallback");Y(typeof e=="string"||$$(e),"invalid value for Contract target","target",e),r==null&&(r=null);const a=M3.from(n);mt(this,{target:e,runner:r,interface:a}),Object.defineProperty(this,ux,{value:{}});let o,s=null,l=null;if(i){const f=zu(r);l=new wO(this.interface,f,i)}let c=new Map;if(typeof e=="string")if(In(e))s=e,o=Promise.resolve(e);else{const f=fh(r,"resolveName");if(!sA(f))throw er("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=f.resolveName(e).then(h=>{if(h==null)throw er("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return Ki(this).addr=h,h})}else o=e.getAddress().then(f=>{if(f==null)throw new Error("TODO");return Ki(this).addr=f,f});tie(this,{addrPromise:o,addr:s,deployTx:l,subs:c});const u=new Proxy({},{get:(f,h,d)=>{if(typeof h=="symbol"||rb.indexOf(h)>=0)return Reflect.get(f,h,d);try{return this.getEvent(h)}catch(g){if(!Kr(g,"INVALID_ARGUMENT")||g.argument!=="key")throw g}},has:(f,h)=>rb.indexOf(h)>=0?Reflect.has(f,h):Reflect.has(f,h)||this.interface.hasEvent(String(h))});return mt(this,{filters:u}),mt(this,{fallback:a.receive||a.fallback?Zre(this):null}),new Proxy(this,{get:(f,h,d)=>{if(typeof h=="symbol"||h in f||rb.indexOf(h)>=0)return Reflect.get(f,h,d);try{return f.getFunction(h)}catch(g){if(!Kr(g,"INVALID_ARGUMENT")||g.argument!=="key")throw g}},has:(f,h)=>typeof h=="symbol"||h in f||rb.indexOf(h)>=0?Reflect.has(f,h):f.interface.hasFunction(h)})}connect(e){return new jy(this.target,this.interface,e)}attach(e){return new jy(e,this.interface,this.runner)}async getAddress(){return await Ki(this).addrPromise}async getDeployedCode(){const e=zu(this.runner);me(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const n=await e.getCode(await this.getAddress());return n==="0x"?null:n}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const r=zu(this.runner);return me(r!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((i,a)=>{const o=async()=>{try{if(await this.getDeployedCode()!=null)return i(this);r.once("block",o)}catch(s){a(s)}};o()})}deploymentTransaction(){return Ki(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),qre(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),eie(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,n,r){n==null&&(n=0),r==null&&(r="latest");const{addr:i,addrPromise:a}=Ki(this),o=i||await a,{fragment:s,topics:l}=await xO(this,e),c={address:o,topics:l,fromBlock:n,toBlock:r},u=zu(this.runner);return me(u,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await u.getLogs(c)).map(f=>{let h=s;if(h==null)try{h=this.interface.getEvent(f.topics[0])}catch{}if(h)try{return new bO(f,this.interface,h)}catch(d){return new kU(f,d)}return new fv(f,u)})}async on(e,n){const r=await R_(this,"on",e);return r.listeners.push({listener:n,once:!1}),r.start(),this}async once(e,n){const r=await R_(this,"once",e);return r.listeners.push({listener:n,once:!0}),r.start(),this}async emit(e,...n){return await D3(this,e,n,null)}async listenerCount(e){if(e){const i=await fy(this,e);return i?i.listeners.length:0}const{subs:n}=Ki(this);let r=0;for(const{listeners:i}of n.values())r+=i.length;return r}async listeners(e){if(e){const i=await fy(this,e);return i?i.listeners.map(({listener:a})=>a):[]}const{subs:n}=Ki(this);let r=[];for(const{listeners:i}of n.values())r=r.concat(i.map(({listener:a})=>a));return r}async off(e,n){const r=await fy(this,e);if(!r)return this;if(n){const i=r.listeners.map(({listener:a})=>a).indexOf(n);i>=0&&r.listeners.splice(i,1)}return(n==null||r.listeners.length===0)&&(r.stop(),Ki(this).subs.delete(r.tag)),this}async removeAllListeners(e){if(e){const n=await fy(this,e);if(!n)return this;n.stop(),Ki(this).subs.delete(n.tag)}else{const{subs:n}=Ki(this);for(const{tag:r,stop:i}of n.values())i(),n.delete(r)}return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return await this.off(e,n)}static buildClass(e){class n extends jy{constructor(i,a=null){super(i,e,a)}}return n}static from(e,n,r){return r==null&&(r=null),new this(e,n,r)}};$Pe=ux;let L3=jy;function iie(){return L3}class Ny extends iie(){}function aE(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Y(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class aie{constructor(e){R(this,"name");mt(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,n){throw new Error("unsupported coin")}async decodeAddress(e,n){throw new Error("unsupported coin")}}const LU=new RegExp("^(ipfs)://(.*)$","i"),M_=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),LU,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var Ec,Tf,Sc,Gh,g2,$U;const bd=class bd{constructor(e,n,r){M(this,Sc);R(this,"provider");R(this,"address");R(this,"name");M(this,Ec,void 0);M(this,Tf,void 0);mt(this,{provider:e,address:n,name:r}),O(this,Ec,null),O(this,Tf,new Ny(n,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return b(this,Ec)==null&&O(this,Ec,(async()=>{try{return await b(this,Tf).supportsInterface("0x9061b923")}catch(e){if(Kr(e,"CALL_EXCEPTION"))return!1;throw O(this,Ec,null),e}})()),await b(this,Ec)}async getAddress(e){if(e==null&&(e=60),e===60)try{const a=await ie(this,Sc,Gh).call(this,"addr(bytes32)");return a==null||a===O3?null:a}catch(a){if(Kr(a,"CALL_EXCEPTION"))return null;throw a}if(e>=0&&e<2147483648){let a=e+2147483648;const o=await ie(this,Sc,Gh).call(this,"addr(bytes32,uint)",[a]);if(In(o,20))return rn(o)}let n=null;for(const a of this.provider.plugins)if(a instanceof aie&&a.supportsCoinType(e)){n=a;break}if(n==null)return null;const r=await ie(this,Sc,Gh).call(this,"addr(bytes32,uint)",[e]);if(r==null||r==="0x")return null;const i=await n.decodeAddress(e,r);if(i!=null)return i;me(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:r}})}async getText(e){const n=await ie(this,Sc,Gh).call(this,"text(bytes32,string)",[e]);return n==null||n==="0x"?null:n}async getContentHash(){const e=await ie(this,Sc,Gh).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const n=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const i=n[1]==="e3010170"?"ipfs":"ipns",a=parseInt(n[4],16);if(n[5].length===a*2)return`${i}://${Vte("0x"+n[2])}`}const r=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&r[1].length===64)return`bzz://${r[1]}`;me(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const n=await this.getText("avatar");if(n==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:n});for(let r=0;r{if(!Array.isArray(e))throw new Error("not an array");return e.map(n=>t(n))}}function hv(t,e){return n=>{const r={};for(const i in t){let a=i;if(e&&i in e&&!(a in n)){for(const o of e[i])if(o in n){a=o;break}}try{const o=t[i](n[a]);o!==void 0&&(r[i]=o)}catch(o){const s=o instanceof Error?o.message:"not-an-error";me(!1,`invalid value for value.${i} (${s})`,"BAD_DATA",{value:n})}}return r}}function oie(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}Y(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function Cp(t){return Y(In(t,!0),"invalid data","value",t),t}function za(t){return Y(In(t,32),"invalid hash","value",t),t}const sie=hv({address:rn,blockHash:za,blockNumber:Lt,data:Cp,index:Lt,removed:Tn(oie,!1),topics:AO(za),transactionHash:za,transactionIndex:Lt},{index:["logIndex"]});function lie(t){return sie(t)}const cie=hv({hash:Tn(za),parentHash:za,number:Lt,timestamp:Lt,nonce:Tn(Cp),difficulty:ot,gasLimit:ot,gasUsed:ot,miner:Tn(rn),extraData:Cp,baseFeePerGas:Tn(ot)});function uie(t){const e=cie(t);return e.transactions=t.transactions.map(n=>typeof n=="string"?n:UU(n)),e}const fie=hv({transactionIndex:Lt,blockNumber:Lt,transactionHash:za,address:rn,topics:AO(za),data:Cp,index:Lt,blockHash:za},{index:["logIndex"]});function hie(t){return fie(t)}const die=hv({to:Tn(rn,null),from:Tn(rn,null),contractAddress:Tn(rn,null),index:Lt,root:Tn(Ze),gasUsed:ot,logsBloom:Tn(Cp),blockHash:za,hash:za,logs:AO(hie),blockNumber:Lt,cumulativeGasUsed:ot,effectiveGasPrice:Tn(ot),status:Tn(Lt),type:Tn(Lt,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function pie(t){return die(t)}function UU(t){t.to&&ot(t.to)===B_&&(t.to="0x0000000000000000000000000000000000000000");const e=hv({hash:za,type:n=>n==="0x"||n==null?0:Lt(n),accessList:Tn(xh,null),blockHash:Tn(za,null),blockNumber:Tn(Lt,null),transactionIndex:Tn(Lt,null),from:rn,gasPrice:Tn(ot),maxPriorityFeePerGas:Tn(ot),maxFeePerGas:Tn(ot),gasLimit:ot,to:Tn(rn,null),value:ot,nonce:Lt,data:Cp,creates:Tn(rn,null),chainId:Tn(ot,null)},{data:["input"],gasLimit:["gas"]})(t);if(e.to==null&&e.creates==null&&(e.creates=dne(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=To.from(t.signature):e.signature=To.from(t),e.chainId==null){const n=e.signature.legacyChainId;n!=null&&(e.chainId=n)}return e.blockHash&&ot(e.blockHash)===B_&&(e.blockHash=null),e}const gie="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class dv{constructor(e){R(this,"name");mt(this,{name:e})}clone(){return new dv(this.name)}}class lA extends dv{constructor(n,r){n==null&&(n=0);super(`org.ethers.network.plugins.GasCost#${n||0}`);R(this,"effectiveBlock");R(this,"txBase");R(this,"txCreate");R(this,"txDataZero");R(this,"txDataNonzero");R(this,"txAccessListStorageKey");R(this,"txAccessListAddress");const i={effectiveBlock:n};function a(o,s){let l=(r||{})[o];l==null&&(l=s),Y(typeof l=="number",`invalud value for ${o}`,"costs",r),i[o]=l}a("txBase",21e3),a("txCreate",32e3),a("txDataZero",4),a("txDataNonzero",16),a("txAccessListStorageKey",1900),a("txAccessListAddress",2400),mt(this,i)}clone(){return new lA(this.effectiveBlock,this)}}class cA extends dv{constructor(n,r){super("org.ethers.plugins.network.Ens");R(this,"address");R(this,"targetNetwork");mt(this,{address:n||gie,targetNetwork:r??1})}clone(){return new cA(this.address,this.targetNetwork)}}var Fm,jm;class yie extends dv{constructor(n,r){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");M(this,Fm,void 0);M(this,jm,void 0);O(this,Fm,n),O(this,jm,r)}get url(){return b(this,Fm)}get processFunc(){return b(this,jm)}clone(){return this}}Fm=new WeakMap,jm=new WeakMap;const oE=new Map;var Y0,X0,Pc;const wd=class wd{constructor(e,n){M(this,Y0,void 0);M(this,X0,void 0);M(this,Pc,void 0);O(this,Y0,e),O(this,X0,ot(n)),O(this,Pc,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return b(this,Y0)}set name(e){O(this,Y0,e)}get chainId(){return b(this,X0)}set chainId(e){O(this,X0,ot(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===ot(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===ot(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===ot(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(b(this,Pc).values())}attachPlugin(e){if(b(this,Pc).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return b(this,Pc).set(e.name,e.clone()),this}getPlugin(e){return b(this,Pc).get(e)||null}getPlugins(e){return this.plugins.filter(n=>n.name.split("#")[0]===e)}clone(){const e=new wd(this.name,this.chainId);return this.plugins.forEach(n=>{e.attachPlugin(n.clone())}),e}computeIntrinsicGas(e){const n=this.getPlugin("org.ethers.plugins.network.GasCost")||new lA;let r=n.txBase;if(e.to==null&&(r+=n.txCreate),e.data)for(let i=2;i9){let i=BigInt(r[1].substring(0,9));r[1].substring(9).match(/^0+$/)||i++,r[1]=i.toString()}return BigInt(r[0]+r[1])}function L_(t){return new yie(t,async(e,n,r)=>{r.setHeader("User-Agent","ethers");let i;try{const[a,o]=await Promise.all([r.send(),e()]);i=a;const s=i.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:D_(s.maxFee,9),maxPriorityFeePerGas:D_(s.maxPriorityFee,9)}}catch(a){me(!1,`error encountered with polygon gas station (${JSON.stringify(r.url)})`,"SERVER_ERROR",{request:r,response:i,error:a})}})}let $_=!1;function mie(){if($_)return;$_=!0;function t(e,n,r){const i=function(){const a=new ns(e,n);return r.ensNetwork!=null&&a.attachPlugin(new cA(null,r.ensNetwork)),a.attachPlugin(new lA),(r.plugins||[]).forEach(o=>{a.attachPlugin(o)}),a};ns.register(e,i),ns.register(n,i),r.altNames&&r.altNames.forEach(a=>{ns.register(a,i)})}t("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),t("ropsten",3,{ensNetwork:3}),t("rinkeby",4,{ensNetwork:4}),t("goerli",5,{ensNetwork:5}),t("kovan",42,{ensNetwork:42}),t("sepolia",11155111,{ensNetwork:11155111}),t("classic",61,{}),t("classicKotti",6,{}),t("arbitrum",42161,{ensNetwork:1}),t("arbitrum-goerli",421613,{}),t("base",8453,{ensNetwork:1}),t("base-goerli",84531,{}),t("base-sepolia",84532,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("matic",137,{ensNetwork:1,plugins:[L_("https://gasstation.polygon.technology/v2")]}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[L_("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[]}),t("optimism-goerli",420,{}),t("xdai",100,{ensNetwork:1})}function $3(t){return JSON.parse(JSON.stringify(t))}var Xs,Oa,Oc,Jo,Z0,sw;class vie{constructor(e){M(this,Z0);M(this,Xs,void 0);M(this,Oa,void 0);M(this,Oc,void 0);M(this,Jo,void 0);O(this,Xs,e),O(this,Oa,null),O(this,Oc,4e3),O(this,Jo,-2)}get pollingInterval(){return b(this,Oc)}set pollingInterval(e){O(this,Oc,e)}start(){b(this,Oa)||(O(this,Oa,b(this,Xs)._setTimeout(ie(this,Z0,sw).bind(this),b(this,Oc))),ie(this,Z0,sw).call(this))}stop(){b(this,Oa)&&(b(this,Xs)._clearTimeout(b(this,Oa)),O(this,Oa,null))}pause(e){this.stop(),e&&O(this,Jo,-2)}resume(){this.start()}}Xs=new WeakMap,Oa=new WeakMap,Oc=new WeakMap,Jo=new WeakMap,Z0=new WeakSet,sw=async function(){try{const e=await b(this,Xs).getBlockNumber();if(b(this,Jo)===-2){O(this,Jo,e);return}if(e!==b(this,Jo)){for(let n=b(this,Jo)+1;n<=e;n++){if(b(this,Oa)==null)return;await b(this,Xs).emit("block",n)}O(this,Jo,e)}}catch{}b(this,Oa)!=null&&O(this,Oa,b(this,Xs)._setTimeout(ie(this,Z0,sw).bind(this),b(this,Oc)))};var Cf,kf,Tc;class EO{constructor(e){M(this,Cf,void 0);M(this,kf,void 0);M(this,Tc,void 0);O(this,Cf,e),O(this,Tc,!1),O(this,kf,n=>{this._poll(n,b(this,Cf))})}async _poll(e,n){throw new Error("sub-classes must override this")}start(){b(this,Tc)||(O(this,Tc,!0),b(this,kf).call(this,-2),b(this,Cf).on("block",b(this,kf)))}stop(){b(this,Tc)&&(O(this,Tc,!1),b(this,Cf).off("block",b(this,kf)))}pause(e){this.stop()}resume(){this.start()}}Cf=new WeakMap,kf=new WeakMap,Tc=new WeakMap;var q0,Zs;class bie extends EO{constructor(n,r){super(n);M(this,q0,void 0);M(this,Zs,void 0);O(this,q0,r),O(this,Zs,-2)}pause(n){n&&O(this,Zs,-2),super.pause(n)}async _poll(n,r){const i=await r.getBlock(b(this,q0));i!=null&&(b(this,Zs)===-2?O(this,Zs,i.number):i.number>b(this,Zs)&&(r.emit(b(this,q0),i.number),O(this,Zs,i.number)))}}q0=new WeakMap,Zs=new WeakMap;var y2;class wie extends EO{constructor(n,r){super(n);M(this,y2,void 0);O(this,y2,$3(r))}async _poll(n,r){throw new Error("@TODO")}}y2=new WeakMap;var ep;class xie extends EO{constructor(n,r){super(n);M(this,ep,void 0);O(this,ep,r)}async _poll(n,r){const i=await r.getTransactionReceipt(b(this,ep));i&&r.emit(b(this,ep),i)}}ep=new WeakMap;var qs,tp,np,Cc,Ta,m2,FU;class SO{constructor(e,n){M(this,m2);M(this,qs,void 0);M(this,tp,void 0);M(this,np,void 0);M(this,Cc,void 0);M(this,Ta,void 0);O(this,qs,e),O(this,tp,$3(n)),O(this,np,ie(this,m2,FU).bind(this)),O(this,Cc,!1),O(this,Ta,-2)}start(){b(this,Cc)||(O(this,Cc,!0),b(this,Ta)===-2&&b(this,qs).getBlockNumber().then(e=>{O(this,Ta,e)}),b(this,qs).on("block",b(this,np)))}stop(){b(this,Cc)&&(O(this,Cc,!1),b(this,qs).off("block",b(this,np)))}pause(e){this.stop(),e&&O(this,Ta,-2)}resume(){this.start()}}qs=new WeakMap,tp=new WeakMap,np=new WeakMap,Cc=new WeakMap,Ta=new WeakMap,m2=new WeakSet,FU=async function(e){if(b(this,Ta)===-2)return;const n=$3(b(this,tp));n.fromBlock=b(this,Ta)+1,n.toBlock=e;const r=await b(this,qs).getLogs(n);if(r.length===0){b(this,Ta){if(r==null)return"null";if(typeof r=="bigint")return`bigint:${r.toString()}`;if(typeof r=="string")return r.toLowerCase();if(typeof r=="object"&&!Array.isArray(r)){const i=Object.keys(r);return i.sort(),i.reduce((a,o)=>(a[o]=r[o],a),{})}return r})}class jU{constructor(e){R(this,"name");mt(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function Sie(t){return JSON.parse(JSON.stringify(t))}function U3(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function sE(t,e){if(t==null)throw new Error("invalid event");if(Array.isArray(t)&&(t={topics:t}),typeof t=="string")switch(t){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:t,tag:t}}if(In(t,32)){const n=t.toLowerCase();return{type:"transaction",tag:lw("tx",{hash:n}),hash:n}}if(t.orphan){const n=t;return{type:"orphan",tag:lw("orphan",n),filter:Sie(n)}}if(t.address||t.topics){const n=t,r={topics:(n.topics||[]).map(i=>i==null?null:Array.isArray(i)?U3(i.map(a=>a.toLowerCase())):i.toLowerCase())};if(n.address){const i=[],a=[],o=s=>{In(s)?i.push(s):a.push((async()=>{i.push(await fi(s,e))})())};Array.isArray(n.address)?n.address.forEach(o):o(n.address),a.length&&await Promise.all(a),r.address=U3(i.map(s=>s.toLowerCase()))}return{filter:r,tag:lw("event",r),type:"event"}}Y(!1,"unknown ProviderEvent","event",t)}function lE(){return new Date().getTime()}const Pie={cacheTimeout:250,pollingInterval:4e3};var Fr,kc,jr,rp,ta,_f,_c,el,zm,Ca,ip,ap,qr,Vi,Hm,F3,Gm,j3,Nf,hy,Vm,z3,If,dy,op,cw;class zU{constructor(e,n){M(this,qr);M(this,Hm);M(this,Gm);M(this,Nf);M(this,Vm);M(this,If);M(this,op);M(this,Fr,void 0);M(this,kc,void 0);M(this,jr,void 0);M(this,rp,void 0);M(this,ta,void 0);M(this,_f,void 0);M(this,_c,void 0);M(this,el,void 0);M(this,zm,void 0);M(this,Ca,void 0);M(this,ip,void 0);M(this,ap,void 0);if(O(this,ap,Object.assign({},Pie,n||{})),e==="any")O(this,_f,!0),O(this,ta,null);else if(e){const r=ns.from(e);O(this,_f,!1),O(this,ta,Promise.resolve(r)),setTimeout(()=>{this.emit("network",r,null)},0)}else O(this,_f,!1),O(this,ta,null);O(this,el,-1),O(this,_c,new Map),O(this,Fr,new Map),O(this,kc,new Map),O(this,jr,null),O(this,rp,!1),O(this,zm,1),O(this,Ca,new Map),O(this,ip,!1)}get pollingInterval(){return b(this,ap).pollingInterval}get provider(){return this}get plugins(){return Array.from(b(this,kc).values())}attachPlugin(e){if(b(this,kc).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return b(this,kc).set(e.name,e.connect(this)),this}getPlugin(e){return b(this,kc).get(e)||null}get disableCcipRead(){return b(this,ip)}set disableCcipRead(e){O(this,ip,!!e)}async ccipReadFetch(e,n,r){if(this.disableCcipRead||r.length===0||e.to==null)return null;const i=e.to.toLowerCase(),a=n.toLowerCase(),o=[];for(let s=0;s=500,`response not found during CCIP fetch: ${f}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:l,errorMessage:f}}),o.push(f)}me(!1,`error encountered during CCIP fetch: ${o.map(s=>JSON.stringify(s)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:r,errorMessages:o}})}_wrapBlock(e,n){return new Vre(uie(e),this)}_wrapLog(e,n){return new fv(lie(e),this)}_wrapTransactionReceipt(e,n){return new OU(pie(e),this)}_wrapTransactionResponse(e,n){return new O1(UU(e),this)}_detectNetwork(){me(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){me(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=Lt(await ie(this,qr,Vi).call(this,{method:"getBlockNumber"}),"%response");return b(this,el)>=0&&O(this,el,e),e}_getAddress(e){return fi(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if(In(e))return In(e,32)?e:Fu(e);if(typeof e=="bigint"&&(e=Lt(e,"blockTag")),typeof e=="number")return e>=0?Fu(e):b(this,el)>=0?Fu(b(this,el)+e):this.getBlockNumber().then(n=>Fu(n+e));Y(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const n=(e.topics||[]).map(l=>l==null?null:Array.isArray(l)?U3(l.map(c=>c.toLowerCase())):l.toLowerCase()),r="blockHash"in e?e.blockHash:void 0,i=(l,c,u)=>{let f;switch(l.length){case 0:break;case 1:f=l[0];break;default:l.sort(),f=l}if(r&&(c!=null||u!=null))throw new Error("invalid filter");const h={};return f&&(h.address=f),n.length&&(h.topics=n),c&&(h.fromBlock=c),u&&(h.toBlock=u),r&&(h.blockHash=r),h};let a=[];if(e.address)if(Array.isArray(e.address))for(const l of e.address)a.push(this._getAddress(l));else a.push(this._getAddress(e.address));let o;"fromBlock"in e&&(o=this._getBlockTag(e.fromBlock));let s;return"toBlock"in e&&(s=this._getBlockTag(e.toBlock)),a.filter(l=>typeof l!="string").length||o!=null&&typeof o!="string"||s!=null&&typeof s!="string"?Promise.all([Promise.all(a),o,s]).then(l=>i(l[0],l[1],l[2])):i(a,o,s)}_getTransactionRequest(e){const n=cx(e),r=[];if(["to","from"].forEach(i=>{if(n[i]==null)return;const a=fi(n[i],this);ib(a)?r.push(async function(){n[i]=await a}()):n[i]=a}),n.blockTag!=null){const i=this._getBlockTag(n.blockTag);ib(i)?r.push(async function(){n.blockTag=await i}()):n.blockTag=i}return r.length?async function(){return await Promise.all(r),n}():n}async getNetwork(){if(b(this,ta)==null){const i=(async()=>{try{const a=await this._detectNetwork();return this.emit("network",a,null),a}catch(a){throw b(this,ta)===i&&O(this,ta,null),a}})();return O(this,ta,i),(await i).clone()}const e=b(this,ta),[n,r]=await Promise.all([e,this._detectNetwork()]);return n.chainId!==r.chainId&&(b(this,_f)?(this.emit("network",r,n),b(this,ta)===e&&O(this,ta,Promise.resolve(r))):me(!1,`network changed: ${n.chainId} => ${r.chainId} `,"NETWORK_ERROR",{event:"changed"})),n.clone()}async getFeeData(){const e=await this.getNetwork(),n=async()=>{const{_block:i,gasPrice:a,priorityFee:o}=await ni({_block:ie(this,Vm,z3).call(this,"latest",!1),gasPrice:(async()=>{try{const u=await ie(this,qr,Vi).call(this,{method:"getGasPrice"});return ot(u,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const u=await ie(this,qr,Vi).call(this,{method:"getPriorityFee"});return ot(u,"%response")}catch{}return null})()});let s=null,l=null;const c=this._wrapBlock(i,e);return c&&c.baseFeePerGas&&(l=o??BigInt("1000000000"),s=c.baseFeePerGas*Aie+l),new N_(a,s,l)},r=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(r){const i=new Sl(r.url),a=await r.processFunc(n,this,i);return new N_(a.gasPrice,a.maxFeePerGas,a.maxPriorityFeePerGas)}return await n()}async estimateGas(e){let n=this._getTransactionRequest(e);return ib(n)&&(n=await n),ot(await ie(this,qr,Vi).call(this,{method:"estimateGas",transaction:n}),"%response")}async call(e){const{tx:n,blockTag:r}=await ni({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await ie(this,Gm,j3).call(this,ie(this,Hm,F3).call(this,n,r,e.enableCcipRead?0:-1))}async getBalance(e,n){return ot(await ie(this,Nf,hy).call(this,{method:"getBalance"},e,n),"%response")}async getTransactionCount(e,n){return Lt(await ie(this,Nf,hy).call(this,{method:"getTransactionCount"},e,n),"%response")}async getCode(e,n){return Ze(await ie(this,Nf,hy).call(this,{method:"getCode"},e,n))}async getStorage(e,n,r){const i=ot(n,"position");return Ze(await ie(this,Nf,hy).call(this,{method:"getStorage",position:i},e,r))}async broadcastTransaction(e){const{blockNumber:n,hash:r,network:i}=await ni({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),a=A1.from(e);if(a.hash!==r)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(a,i).replaceableTransaction(n)}async getBlock(e,n){const{network:r,params:i}=await ni({network:this.getNetwork(),params:ie(this,Vm,z3).call(this,e,!!n)});return i==null?null:this._wrapBlock(i,r)}async getTransaction(e){const{network:n,params:r}=await ni({network:this.getNetwork(),params:ie(this,qr,Vi).call(this,{method:"getTransaction",hash:e})});return r==null?null:this._wrapTransactionResponse(r,n)}async getTransactionReceipt(e){const{network:n,params:r}=await ni({network:this.getNetwork(),params:ie(this,qr,Vi).call(this,{method:"getTransactionReceipt",hash:e})});if(r==null)return null;if(r.gasPrice==null&&r.effectiveGasPrice==null){const i=await ie(this,qr,Vi).call(this,{method:"getTransaction",hash:e});if(i==null)throw new Error("report this; could not find tx or effectiveGasPrice");r.effectiveGasPrice=i.gasPrice}return this._wrapTransactionReceipt(r,n)}async getTransactionResult(e){const{result:n}=await ni({network:this.getNetwork(),result:ie(this,qr,Vi).call(this,{method:"getTransactionResult",hash:e})});return n==null?null:Ze(n)}async getLogs(e){let n=this._getFilter(e);ib(n)&&(n=await n);const{network:r,params:i}=await ni({network:this.getNetwork(),params:ie(this,qr,Vi).call(this,{method:"getLogs",filter:n})});return i.map(a=>this._wrapLog(a,r))}_getProvider(e){me(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await fx.fromName(this,e)}async getAvatar(e){const n=await this.getResolver(e);return n?await n.getAvatar():null}async resolveName(e){const n=await this.getResolver(e);return n?await n.getAddress():null}async lookupAddress(e){e=rn(e);const n=I3(e.substring(2).toLowerCase()+".addr.reverse");try{const r=await fx.getEnsAddress(this),a=await new Ny(r,["function resolver(bytes32) view returns (address)"],this).resolver(n);if(a==null||a===O3)return null;const s=await new Ny(a,["function name(bytes32) view returns (string)"],this).name(n);return await this.resolveName(s)!==e?null:s}catch(r){if(Kr(r,"BAD_DATA")&&r.value==="0x"||Kr(r,"CALL_EXCEPTION"))return null;throw r}return null}async waitForTransaction(e,n,r){const i=n??1;return i===0?this.getTransactionReceipt(e):new Promise(async(a,o)=>{let s=null;const l=async c=>{try{const u=await this.getTransactionReceipt(e);if(u!=null&&c-u.blockNumber+1>=i){a(u),s&&(clearTimeout(s),s=null);return}}catch(u){console.log("EEE",u)}this.once("block",l)};r!=null&&(s=setTimeout(()=>{s!=null&&(s=null,this.off("block",l),o(er("timeout","TIMEOUT",{reason:"timeout"})))},r)),l(await this.getBlockNumber())})}async waitForBlock(e){me(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const n=b(this,Ca).get(e);n&&(n.timer&&clearTimeout(n.timer),b(this,Ca).delete(e))}_setTimeout(e,n){n==null&&(n=0);const r=vs(this,zm)._++,i=()=>{b(this,Ca).delete(r),e()};if(this.paused)b(this,Ca).set(r,{timer:null,func:i,time:n});else{const a=setTimeout(i,n);b(this,Ca).set(r,{timer:a,func:i,time:lE()})}return r}_forEachSubscriber(e){for(const n of b(this,Fr).values())e(n.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new jU(e.type);case"block":{const n=new vie(this);return n.pollingInterval=this.pollingInterval,n}case"safe":case"finalized":return new bie(this,e.type);case"event":return new SO(this,e.filter);case"transaction":return new xie(this,e.hash);case"orphan":return new wie(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,n){for(const r of b(this,Fr).values())if(r.subscriber===e){r.started&&r.subscriber.stop(),r.subscriber=n,r.started&&n.start(),b(this,jr)!=null&&n.pause(b(this,jr));break}}async on(e,n){const r=await ie(this,op,cw).call(this,e);return r.listeners.push({listener:n,once:!1}),r.started||(r.subscriber.start(),r.started=!0,b(this,jr)!=null&&r.subscriber.pause(b(this,jr))),this}async once(e,n){const r=await ie(this,op,cw).call(this,e);return r.listeners.push({listener:n,once:!0}),r.started||(r.subscriber.start(),r.started=!0,b(this,jr)!=null&&r.subscriber.pause(b(this,jr))),this}async emit(e,...n){const r=await ie(this,If,dy).call(this,e,n);if(!r||r.listeners.length===0)return!1;const i=r.listeners.length;return r.listeners=r.listeners.filter(({listener:a,once:o})=>{const s=new O$(this,o?null:a,e);try{a.call(this,...n,s)}catch{}return!o}),r.listeners.length===0&&(r.started&&r.subscriber.stop(),b(this,Fr).delete(r.tag)),i>0}async listenerCount(e){if(e){const r=await ie(this,If,dy).call(this,e);return r?r.listeners.length:0}let n=0;for(const{listeners:r}of b(this,Fr).values())n+=r.length;return n}async listeners(e){if(e){const r=await ie(this,If,dy).call(this,e);return r?r.listeners.map(({listener:i})=>i):[]}let n=[];for(const{listeners:r}of b(this,Fr).values())n=n.concat(r.map(({listener:i})=>i));return n}async off(e,n){const r=await ie(this,If,dy).call(this,e);if(!r)return this;if(n){const i=r.listeners.map(({listener:a})=>a).indexOf(n);i>=0&&r.listeners.splice(i,1)}return(!n||r.listeners.length===0)&&(r.started&&r.subscriber.stop(),b(this,Fr).delete(r.tag)),this}async removeAllListeners(e){if(e){const{tag:n,started:r,subscriber:i}=await ie(this,op,cw).call(this,e);r&&i.stop(),b(this,Fr).delete(n)}else for(const[n,{started:r,subscriber:i}]of b(this,Fr))r&&i.stop(),b(this,Fr).delete(n);return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return this.off(e,n)}get destroyed(){return b(this,rp)}destroy(){this.removeAllListeners();for(const e of b(this,Ca).keys())this._clearTimeout(e);O(this,rp,!0)}get paused(){return b(this,jr)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(O(this,el,-1),b(this,jr)!=null){if(b(this,jr)==!!e)return;me(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(n=>n.pause(e)),O(this,jr,!!e);for(const n of b(this,Ca).values())n.timer&&clearTimeout(n.timer),n.time=lE()-n.time}resume(){if(b(this,jr)!=null){this._forEachSubscriber(e=>e.resume()),O(this,jr,null);for(const e of b(this,Ca).values()){let n=e.time;n<0&&(n=0),e.time=lE(),setTimeout(e.func,n)}}}}Fr=new WeakMap,kc=new WeakMap,jr=new WeakMap,rp=new WeakMap,ta=new WeakMap,_f=new WeakMap,_c=new WeakMap,el=new WeakMap,zm=new WeakMap,Ca=new WeakMap,ip=new WeakMap,ap=new WeakMap,qr=new WeakSet,Vi=async function(e){const n=b(this,ap).cacheTimeout;if(n<0)return await this._perform(e);const r=lw(e.method,e);let i=b(this,_c).get(r);return i||(i=this._perform(e),b(this,_c).set(r,i),setTimeout(()=>{b(this,_c).get(r)===i&&b(this,_c).delete(r)},n)),await i},Hm=new WeakSet,F3=async function(e,n,r){me(r=0&&n==="latest"&&i.to!=null&&Fn(a.data,0,4)==="0x556f1830"){const o=a.data,s=await fi(i.to,this);let l;try{l=_ie(Fn(a.data,4))}catch(f){me(!1,f.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:o}})}me(l.sender.toLowerCase()===s.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:o,reason:"OffchainLookup",transaction:i,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:l.errorArgs}});const c=await this.ccipReadFetch(i,l.calldata,l.urls);me(c!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:a.data,errorArgs:l.errorArgs}});const u={to:s,data:lr([l.selector,kie([c,l.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:u});try{const f=await ie(this,Hm,F3).call(this,u,n,r+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},u),result:f}),f}catch(f){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},u),error:f}),f}}throw a}},Gm=new WeakSet,j3=async function(e){const{value:n}=await ni({network:this.getNetwork(),value:e});return n},Nf=new WeakSet,hy=async function(e,n,r){let i=this._getAddress(n),a=this._getBlockTag(r);return(typeof i!="string"||typeof a!="string")&&([i,a]=await Promise.all([i,a])),await ie(this,Gm,j3).call(this,ie(this,qr,Vi).call(this,Object.assign(e,{address:i,blockTag:a})))},Vm=new WeakSet,z3=async function(e,n){if(In(e,32))return await ie(this,qr,Vi).call(this,{method:"getBlock",blockHash:e,includeTransactions:n});let r=this._getBlockTag(e);return typeof r!="string"&&(r=await r),await ie(this,qr,Vi).call(this,{method:"getBlock",blockTag:r,includeTransactions:n})},If=new WeakSet,dy=async function(e,n){let r=await sE(e,this);return r.type==="event"&&n&&n.length>0&&n[0].removed===!0&&(r=await sE({orphan:"drop-log",log:n[0]},this)),b(this,Fr).get(r.tag)||null},op=new WeakSet,cw=async function(e){const n=await sE(e,this),r=n.tag;let i=b(this,Fr).get(r);return i||(i={subscriber:this._getSubscriber(n),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},b(this,Fr).set(r,i)),i};function Oie(t,e){try{const n=H3(t,e);if(n)return hO(n)}catch{}return null}function H3(t,e){if(t==="0x")return null;try{const n=Lt(Fn(t,e,e+32)),r=Lt(Fn(t,n,n+32));return Fn(t,n+32,n+32+r)}catch{}return null}function U_(t){const e=sa(t);if(e.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(e,32-e.length),n}function Tie(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const Cie=new Uint8Array([]);function kie(t){const e=[];let n=0;for(let r=0;r=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const n=Fn(t,0,32);me(Fn(n,0,12)===Fn(F_,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=Fn(n,12);try{const r=[],i=Lt(Fn(t,32,64)),a=Lt(Fn(t,i,i+32)),o=Fn(t,i+32);for(let s=0;se[r]),e}function Nh(t,e){if(t.provider)return t.provider;me(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function j_(t,e){let n=cx(e);if(n.to!=null&&(n.to=fi(n.to,t)),n.from!=null){const r=n.from;n.from=Promise.all([t.getAddress(),fi(r,t)]).then(([i,a])=>(Y(i.toLowerCase()===a.toLowerCase(),"transaction from mismatch","tx.from",a),i))}else n.from=t.getAddress();return await ni(n)}class HU{constructor(e){R(this,"provider");mt(this,{provider:e||null})}async getNonce(e){return Nh(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await j_(this,e)}async populateTransaction(e){const n=Nh(this,"populateTransaction"),r=await j_(this,e);r.nonce==null&&(r.nonce=await this.getNonce("pending")),r.gasLimit==null&&(r.gasLimit=await this.estimateGas(r));const i=await this.provider.getNetwork();if(r.chainId!=null){const o=ot(r.chainId);Y(o===i.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else r.chainId=i.chainId;const a=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||a)?Y(!1,"eip-1559 transaction do not support gasPrice","tx",e):(r.type===0||r.type===1)&&a&&Y(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1){const o=await n.getFeeData();me(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice)}else{const o=await n.getFeeData();if(r.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const s=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=s,r.maxPriorityFeePerGas=s}else r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(me(!a,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice),r.type=0):me(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await ni(r)}async estimateGas(e){return Nh(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Nh(this,"call").call(await this.populateCall(e))}async resolveName(e){return await Nh(this,"resolveName").resolveName(e)}async sendTransaction(e){const n=Nh(this,"sendTransaction"),r=await this.populateTransaction(e);delete r.from;const i=A1.from(r);return await n.broadcastTransaction(await this.signTransaction(i))}}function Nie(t){return JSON.parse(JSON.stringify(t))}var Ei,Yo,Rf,Nc,Mf,sp,Qm,G3,Km,V3;class GU{constructor(e){M(this,Qm);M(this,Km);M(this,Ei,void 0);M(this,Yo,void 0);M(this,Rf,void 0);M(this,Nc,void 0);M(this,Mf,void 0);M(this,sp,void 0);O(this,Ei,e),O(this,Yo,null),O(this,Rf,ie(this,Qm,G3).bind(this)),O(this,Nc,!1),O(this,Mf,null),O(this,sp,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,n){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){b(this,Nc)||(O(this,Nc,!0),ie(this,Qm,G3).call(this,-2))}stop(){b(this,Nc)&&(O(this,Nc,!1),O(this,sp,!0),ie(this,Km,V3).call(this),b(this,Ei).off("block",b(this,Rf)))}pause(e){e&&ie(this,Km,V3).call(this),b(this,Ei).off("block",b(this,Rf))}resume(){this.start()}}Ei=new WeakMap,Yo=new WeakMap,Rf=new WeakMap,Nc=new WeakMap,Mf=new WeakMap,sp=new WeakMap,Qm=new WeakSet,G3=async function(e){try{b(this,Yo)==null&&O(this,Yo,this._subscribe(b(this,Ei)));let n=null;try{n=await b(this,Yo)}catch(a){if(!Kr(a,"UNSUPPORTED_OPERATION")||a.operation!=="eth_newFilter")throw a}if(n==null){O(this,Yo,null),b(this,Ei)._recoverSubscriber(this,this._recover(b(this,Ei)));return}const r=await b(this,Ei).getNetwork();if(b(this,Mf)||O(this,Mf,r),b(this,Mf).chainId!==r.chainId)throw new Error("chaid changed");if(b(this,sp))return;const i=await b(this,Ei).send("eth_getFilterChanges",[n]);await this._emitResults(b(this,Ei),i)}catch(n){console.log("@TODO",n)}b(this,Ei).once("block",b(this,Rf))},Km=new WeakSet,V3=function(){const e=b(this,Yo);e&&(O(this,Yo,null),e.then(n=>{b(this,Ei).send("eth_uninstallFilter",[n])}))};var Bf;class Iie extends GU{constructor(n,r){super(n);M(this,Bf,void 0);O(this,Bf,Nie(r))}_recover(n){return new SO(n,b(this,Bf))}async _subscribe(n){return await n.send("eth_newFilter",[b(this,Bf)])}async _emitResults(n,r){for(const i of r)n.emit(b(this,Bf),n._wrapLog(i,n._network))}}Bf=new WeakMap;class Rie extends GU{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,n){for(const r of n)e.emit("pending",r)}}const Mie="bigint,boolean,function,number,string,symbol".split(/,/g);function uw(t){if(t==null||Mie.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(uw);if(typeof t=="object")return Object.keys(t).reduce((e,n)=>(e[n]=t[n],e),{});throw new Error(`should not happen: ${t} (${typeof t})`)}function Bie(t){return new Promise(e=>{setTimeout(e,t)})}function Ih(t){return t&&t.toLowerCase()}function z_(t){return t&&typeof t.pollingInterval=="number"}const Die={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class cE extends HU{constructor(n,r){super(n);R(this,"address");r=rn(r),mt(this,{address:r})}connect(n){me(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(n){return await this.populateCall(n)}async sendUncheckedTransaction(n){const r=uw(n),i=[];if(r.from){const o=r.from;i.push((async()=>{const s=await fi(o,this.provider);Y(s!=null&&s.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=s})())}else r.from=this.address;if(r.gasLimit==null&&i.push((async()=>{r.gasLimit=await this.provider.estimateGas({...r,from:this.address})})()),r.to!=null){const o=r.to;i.push((async()=>{r.to=await fi(o,this.provider)})())}i.length&&await Promise.all(i);const a=this.provider.getRpcTransaction(r);return this.provider.send("eth_sendTransaction",[a])}async sendTransaction(n){const r=await this.provider.getBlockNumber(),i=await this.sendUncheckedTransaction(n);return await new Promise((a,o)=>{const s=[1e3,100];let l=0;const c=async()=>{try{const u=await this.provider.getTransaction(i);if(u!=null){a(u.replaceableTransaction(r));return}}catch(u){if(Kr(u,"CANCELLED")||Kr(u,"BAD_DATA")||Kr(u,"NETWORK_ERROR")){u.info==null&&(u.info={}),u.info.sendTransactionHash=i,o(u);return}if(Kr(u,"INVALID_ARGUMENT")&&(l++,u.info==null&&(u.info={}),u.info.sendTransactionHash=i,l>10)){o(u);return}this.provider.emit("error",er("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:u}))}this.provider._setTimeout(()=>{c()},s.pop()||4e3)};c()})}async signTransaction(n){const r=uw(n);if(r.from){const a=await fi(r.from,this.provider);Y(a!=null&&a.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=a}else r.from=this.address;const i=this.provider.getRpcTransaction(r);return await this.provider.send("eth_signTransaction",[i])}async signMessage(n){const r=typeof n=="string"?dl(n):n;return await this.provider.send("personal_sign",[Ze(r),this.address.toLowerCase()])}async signTypedData(n,r,i){const a=uw(i),o=await E1.resolveNames(n,r,a,async s=>{const l=await fi(s);return Y(l!=null,"TypedData does not support null address","value",s),l});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(E1.getPayload(o.domain,r,o.value))])}async unlock(n){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),n,null])}async _legacySignMessage(n){const r=typeof n=="string"?dl(n):n;return await this.provider.send("eth_sign",[this.address.toLowerCase(),Ze(r)])}}var Df,lp,tl,Xo,fo,ka,Si,Wm,Q3;class Lie extends zU{constructor(n,r){super(n,r);M(this,Wm);M(this,Df,void 0);M(this,lp,void 0);M(this,tl,void 0);M(this,Xo,void 0);M(this,fo,void 0);M(this,ka,void 0);M(this,Si,void 0);O(this,lp,1),O(this,Df,Object.assign({},Die,r||{})),O(this,tl,[]),O(this,Xo,null),O(this,ka,null),O(this,Si,null);{let a=null;const o=new Promise(s=>{a=s});O(this,fo,{promise:o,resolve:a})}const i=this._getOption("staticNetwork");typeof i=="boolean"?(Y(!i||n!=="any","staticNetwork cannot be used on special network 'any'","options",r),i&&n!=null&&O(this,ka,ns.from(n))):i&&(Y(n==null||i.matches(n),"staticNetwork MUST match network object","options",r),O(this,ka,i))}_getOption(n){return b(this,Df)[n]}get _network(){return me(b(this,ka),"network is not available yet","NETWORK_ERROR"),b(this,ka)}async _perform(n){if(n.method==="call"||n.method==="estimateGas"){let i=n.transaction;if(i&&i.type!=null&&ot(i.type)&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const a=await this.getFeeData();a.maxFeePerGas==null&&a.maxPriorityFeePerGas==null&&(n=Object.assign({},n,{transaction:Object.assign({},i,{type:void 0})}))}}const r=this.getRpcRequest(n);return r!=null?await this.send(r.method,r.args):super._perform(n)}async _detectNetwork(){const n=this._getOption("staticNetwork");if(n)if(n===!0){if(b(this,ka))return b(this,ka)}else return n;return b(this,Si)?await b(this,Si):this.ready?(O(this,Si,(async()=>{try{const r=ns.from(ot(await this.send("eth_chainId",[])));return O(this,Si,null),r}catch(r){throw O(this,Si,null),r}})()),await b(this,Si)):(O(this,Si,(async()=>{const r={id:vs(this,lp)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:r});let i;try{i=(await this._send(r))[0],O(this,Si,null)}catch(a){throw O(this,Si,null),this.emit("debug",{action:"receiveRpcError",error:a}),a}if(this.emit("debug",{action:"receiveRpcResult",result:i}),"result"in i)return ns.from(ot(i.result));throw this.getRpcError(r,i)})()),await b(this,Si))}_start(){b(this,fo)==null||b(this,fo).resolve==null||(b(this,fo).resolve(),O(this,fo,null),(async()=>{for(;b(this,ka)==null&&!this.destroyed;)try{O(this,ka,await this._detectNetwork())}catch(n){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",er("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:n}})),await Bie(1e3)}ie(this,Wm,Q3).call(this)})())}async _waitUntilReady(){if(b(this,fo)!=null)return await b(this,fo).promise}_getSubscriber(n){return n.type==="pending"?new Rie(this):n.type==="event"?this._getOption("polling")?new SO(this,n.filter):new Iie(this,n.filter):n.type==="orphan"&&n.filter.orphan==="drop-log"?new jU("orphan"):super._getSubscriber(n)}get ready(){return b(this,fo)==null}getRpcTransaction(n){const r={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(i=>{if(n[i]==null)return;let a=i;i==="gasLimit"&&(a="gas"),r[a]=Fu(ot(n[i],`tx.${i}`))}),["from","to","data"].forEach(i=>{n[i]!=null&&(r[i]=Ze(n[i]))}),n.accessList&&(r.accessList=xh(n.accessList)),r}getRpcRequest(n){switch(n.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[Ih(n.address),n.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[Ih(n.address),n.blockTag]};case"getCode":return{method:"eth_getCode",args:[Ih(n.address),n.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[Ih(n.address),"0x"+n.position.toString(16),n.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[n.signedTransaction]};case"getBlock":if("blockTag"in n)return{method:"eth_getBlockByNumber",args:[n.blockTag,!!n.includeTransactions]};if("blockHash"in n)return{method:"eth_getBlockByHash",args:[n.blockHash,!!n.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[n.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[n.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(n.transaction),n.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(n.transaction)]};case"getLogs":return n.filter&&n.filter.address!=null&&(Array.isArray(n.filter.address)?n.filter.address=n.filter.address.map(Ih):n.filter.address=Ih(n.filter.address)),{method:"eth_getLogs",args:[n.filter]}}return null}getRpcError(n,r){const{method:i}=n,{error:a}=r;if(i==="eth_estimateGas"&&a.message){const l=a.message;if(!l.match(/revert/i)&&l.match(/insufficient funds/i))return er("insufficient funds","INSUFFICIENT_FUNDS",{transaction:n.params[0],info:{payload:n,error:a}})}if(i==="eth_call"||i==="eth_estimateGas"){const l=K3(a),c=P1.getBuiltinCallException(i==="eth_call"?"call":"estimateGas",n.params[0],l?l.data:null);return c.info={error:a,payload:n},c}const o=JSON.stringify(Uie(a));if(typeof a.message=="string"&&a.message.match(/user denied|ethers-user-denied/i))return er("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[i]||"unknown",reason:"rejected",info:{payload:n,error:a}});if(i==="eth_sendRawTransaction"||i==="eth_sendTransaction"){const l=n.params[0];if(o.match(/insufficient funds|base fee exceeds gas limit/i))return er("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:l,info:{error:a}});if(o.match(/nonce/i)&&o.match(/too low/i))return er("nonce has already been used","NONCE_EXPIRED",{transaction:l,info:{error:a}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return er("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:l,info:{error:a}});if(o.match(/only replay-protected/i))return er("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:i,info:{transaction:l,info:{error:a}}})}let s=!!o.match(/the method .* does not exist/i);return s||a&&a.details&&a.details.startsWith("Unauthorized method:")&&(s=!0),s?er("unsupported operation","UNSUPPORTED_OPERATION",{operation:n.method,info:{error:a,payload:n}}):er("could not coalesce error","UNKNOWN_ERROR",{error:a,payload:n})}send(n,r){if(this.destroyed)return Promise.reject(er("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n}));const i=vs(this,lp)._++,a=new Promise((o,s)=>{b(this,tl).push({resolve:o,reject:s,payload:{method:n,params:r,id:i,jsonrpc:"2.0"}})});return ie(this,Wm,Q3).call(this),a}async getSigner(n){n==null&&(n=0);const r=this.send("eth_accounts",[]);if(typeof n=="number"){const a=await r;if(n>=a.length)throw new Error("no such account");return new cE(this,a[n])}const{accounts:i}=await ni({network:this.getNetwork(),accounts:r});n=rn(n);for(const a of i)if(rn(a)===n)return new cE(this,n);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(r=>new cE(this,r))}destroy(){b(this,Xo)&&(clearTimeout(b(this,Xo)),O(this,Xo,null));for(const{payload:n,reject:r}of b(this,tl))r(er("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n.method}));O(this,tl,[]),super.destroy()}}Df=new WeakMap,lp=new WeakMap,tl=new WeakMap,Xo=new WeakMap,fo=new WeakMap,ka=new WeakMap,Si=new WeakMap,Wm=new WeakSet,Q3=function(){if(b(this,Xo))return;const n=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");O(this,Xo,setTimeout(()=>{O(this,Xo,null);const r=b(this,tl);for(O(this,tl,[]);r.length;){const i=[r.shift()];for(;r.length&&i.length!==b(this,Df).batchMaxCount;)if(i.push(r.shift()),JSON.stringify(i.map(o=>o.payload)).length>b(this,Df).batchMaxSize){r.unshift(i.pop());break}(async()=>{const a=i.length===1?i[0].payload:i.map(o=>o.payload);this.emit("debug",{action:"sendRpcPayload",payload:a});try{const o=await this._send(a);this.emit("debug",{action:"receiveRpcResult",result:o});for(const{resolve:s,reject:l,payload:c}of i){if(this.destroyed){l(er("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:c.method}));continue}const u=o.filter(f=>f.id===c.id)[0];if(u==null){const f=er("missing response for request","BAD_DATA",{value:o,info:{payload:c}});this.emit("error",f),l(f);continue}if("error"in u){l(this.getRpcError(c,u));continue}s(u.result)}}catch(o){this.emit("debug",{action:"receiveRpcError",error:o});for(const{reject:s}of i)s(o)}})()}},n))};var Ic;class VU extends Lie{constructor(n,r){super(n,r);M(this,Ic,void 0);O(this,Ic,4e3)}_getSubscriber(n){const r=super._getSubscriber(n);return z_(r)&&(r.pollingInterval=b(this,Ic)),r}get pollingInterval(){return b(this,Ic)}set pollingInterval(n){if(!Number.isInteger(n)||n<0)throw new Error("invalid interval");O(this,Ic,n),this._forEachSubscriber(r=>{z_(r)&&(r.pollingInterval=b(this,Ic))})}}Ic=new WeakMap;var cp;class $ie extends VU{constructor(n,r,i){n==null&&(n="http://localhost:8545");super(r,i);M(this,cp,void 0);typeof n=="string"?O(this,cp,new Sl(n)):O(this,cp,n.clone())}_getConnection(){return b(this,cp).clone()}async send(n,r){return await this._start(),await super.send(n,r)}async _send(n){const r=this._getConnection();r.body=JSON.stringify(n),r.setHeader("content-type","application/json");const i=await r.send();i.assertOk();let a=i.bodyJson;return Array.isArray(a)||(a=[a]),a}}cp=new WeakMap;function K3(t){if(t==null)return null;if(typeof t.message=="string"&&t.message.match(/revert/i)&&In(t.data))return{message:t.message,data:t.data};if(typeof t=="object"){for(const e in t){const n=K3(t[e]);if(n)return n}return null}if(typeof t=="string")try{return K3(JSON.parse(t))}catch{}return null}function W3(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const n in t)W3(t[n],e);if(typeof t=="string")try{return W3(JSON.parse(t),e)}catch{}}}function Uie(t){const e=[];return W3(t,e),e}var up;class Fie extends VU{constructor(n,r){super(r,{batchMaxCount:1});M(this,up,void 0);O(this,up,async(i,a)=>{const o={method:i,params:a};this.emit("debug",{action:"sendEip1193Request",payload:o});try{const s=await n.request(o);return this.emit("debug",{action:"receiveEip1193Result",result:s}),s}catch(s){const l=new Error(s.message);throw l.code=s.code,l.data=s.data,l.payload=o,this.emit("debug",{action:"receiveEip1193Error",error:l}),l}})}async send(n,r){return await this._start(),await super.send(n,r)}async _send(n){Y(!Array.isArray(n),"EIP-1193 does not support batch request","payload",n);try{const r=await b(this,up).call(this,n.method,n.params||[]);return[{id:n.id,result:r}]}catch(r){return[{id:n.id,error:{code:r.code,data:r.data,message:r.message}}]}}getRpcError(n,r){switch(r=JSON.parse(JSON.stringify(r)),r.error.code||-1){case 4001:r.error.message=`ethers-user-denied: ${r.error.message}`;break;case 4200:r.error.message=`ethers-unsupported: ${r.error.message}`;break}return super.getRpcError(n,r)}async hasSigner(n){n==null&&(n=0);const r=await this.send("eth_accounts",[]);return typeof n=="number"?r.length>n:(n=n.toLowerCase(),r.filter(i=>i.toLowerCase()===n).length!==0)}async getSigner(n){if(n==null&&(n=0),!await this.hasSigner(n))try{await b(this,up).call(this,"eth_requestAccounts",[])}catch(r){const i=r.payload;throw this.getRpcError(i,{id:i.id,error:r})}return await super.getSigner(n)}}up=new WeakMap;var QU={exports:{}};(function(t){/** + */function jw(){return jw=Object.assign?Object.assign.bind():function(t){for(var e=1;e{let r=t[n];return e.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function sK(t,e){let n=F5(t);return e&&e.forEach((r,i)=>{n.has(i)||e.getAll(i).forEach(a=>{n.append(i,a)})}),n}const lK="6";try{window.__reactRouterVersion=lK}catch{}function cK(t,e){return NQ({basename:e==null?void 0:e.basename,future:jw({},e==null?void 0:e.future,{v7_prependBasename:!0}),history:eQ({window:e==null?void 0:e.window}),hydrationData:(e==null?void 0:e.hydrationData)||uK(),routes:t,mapRouteProperties:oK,window:e==null?void 0:e.window}).initialize()}function uK(){var t;let e=(t=window)==null?void 0:t.__staticRouterHydrationData;return e&&e.errors&&(e=jw({},e,{errors:fK(e.errors)})),e}function fK(t){if(!t)return null;let e=Object.entries(t),n={};for(let[r,i]of e)if(i&&i.__type==="RouteErrorResponse")n[r]=new wP(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let a=window[i.__subType];if(typeof a=="function")try{let o=new a(i.message);o.stack="",n[r]=o}catch{}}if(n[r]==null){let a=new Error(i.message);a.stack="",n[r]=a}}else n[r]=i;return n}const hK=F.createContext({isTransitioning:!1}),dK=F.createContext(new Map),pK="startTransition",uC=zH[pK],gK="flushSync",fC=qV[gK];function yK(t){uC?uC(t):t()}function Mg(t){fC?fC(t):t()}class mK{constructor(){this.status="pending",this.promise=new Promise((e,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function vK(t){let{fallbackElement:e,router:n,future:r}=t,[i,a]=F.useState(n.state),[o,s]=F.useState(),[l,c]=F.useState({isTransitioning:!1}),[u,f]=F.useState(),[h,d]=F.useState(),[g,p]=F.useState(),m=F.useRef(new Map),{v7_startTransition:y}=r||{},v=F.useCallback(T=>{y?yK(T):T()},[y]),x=F.useCallback((T,C)=>{let{deletedFetchers:N,unstable_flushSync:B,unstable_viewTransitionOpts:L}=C;N.forEach(j=>m.current.delete(j)),T.fetchers.forEach((j,Z)=>{j.data!==void 0&&m.current.set(Z,j.data)});let U=n.window==null||typeof n.window.document.startViewTransition!="function";if(!L||U){B?Mg(()=>a(T)):v(()=>a(T));return}if(B){Mg(()=>{h&&(u&&u.resolve(),h.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:L.currentLocation,nextLocation:L.nextLocation})});let j=n.window.document.startViewTransition(()=>{Mg(()=>a(T))});j.finished.finally(()=>{Mg(()=>{f(void 0),d(void 0),s(void 0),c({isTransitioning:!1})})}),Mg(()=>d(j));return}h?(u&&u.resolve(),h.skipTransition(),p({state:T,currentLocation:L.currentLocation,nextLocation:L.nextLocation})):(s(T),c({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}))},[n.window,h,u,m,v]);F.useLayoutEffect(()=>n.subscribe(x),[n,x]),F.useEffect(()=>{l.isTransitioning&&!l.flushSync&&f(new mK)},[l]),F.useEffect(()=>{if(u&&o&&n.window){let T=o,C=u.promise,N=n.window.document.startViewTransition(async()=>{v(()=>a(T)),await C});N.finished.finally(()=>{f(void 0),d(void 0),s(void 0),c({isTransitioning:!1})}),d(N)}},[v,o,u,n.window]),F.useEffect(()=>{u&&o&&i.location.key===o.location.key&&u.resolve()},[u,h,i.location,o]),F.useEffect(()=>{!l.isTransitioning&&g&&(s(g.state),c({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),p(void 0))},[l.isTransitioning,g]),F.useEffect(()=>{},[]);let A=F.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:T=>n.navigate(T),push:(T,C,N)=>n.navigate(T,{state:C,preventScrollReset:N==null?void 0:N.preventScrollReset}),replace:(T,C,N)=>n.navigate(T,{replace:!0,state:C,preventScrollReset:N==null?void 0:N.preventScrollReset})}),[n]),S=n.basename||"/",E=F.useMemo(()=>({router:n,navigator:A,static:!1,basename:S}),[n,A,S]);return F.createElement(F.Fragment,null,F.createElement(M2.Provider,{value:E},F.createElement(V7.Provider,{value:i},F.createElement(dK.Provider,{value:m.current},F.createElement(hK.Provider,{value:l},F.createElement(aK,{basename:S,location:i.location,navigationType:i.historyAction,navigator:A,future:{v7_relativeSplatPath:n.future.v7_relativeSplatPath}},i.initialized||n.future.v7_partialHydration?F.createElement(bK,{routes:n.routes,future:n.future,state:i}):e))))),null)}function bK(t){let{routes:e,future:n,state:r}=t;return KQ(e,void 0,r,n)}var hC;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(hC||(hC={}));var dC;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(dC||(dC={}));function wK(t){let e=F.useRef(F5(t)),n=F.useRef(!1),r=D2(),i=F.useMemo(()=>sK(r.search,n.current?null:e.current),[r.search]),a=W7(),o=F.useCallback((s,l)=>{const c=F5(typeof s=="function"?s(i):s);n.current=!0,a("?"+c,l)},[a,i]);return[i,o]}const xK="_header_1d5it_1",AK="_subHeader_1d5it_13",EK="_inViewPlaceholder_1d5it_20",SK="_headerSticky_1d5it_33",PK="_logo_1d5it_42",Bg={header:xK,subHeader:AK,inViewPlaceholder:EK,headerSticky:SK,logo:PK},q7=F.createContext({}),ig=()=>{const t=F.useContext(q7);if(Object.keys(t).length===0)throw new Error("[useAppState] Component not wrapped within a Provider");return t},OK={large:{width:153,height:50},small:{width:55,height:18}},TK=({className:t})=>{const{state:{isDesktopScreen:e}}=ig(),n=OK[e?"large":"small"];return J.jsxs("svg",{className:t,width:n.width,height:n.height,viewBox:"0 0 153 50",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[J.jsx("path",{d:"M65.882 36L59.031 20.5H63.712L67.804 30.42L71.896 20.5H76.639L69.757 36H65.882ZM90.2073 34.016C88.616 35.566 86.694 36.341 84.4413 36.341C82.1886 36.341 80.2666 35.566 78.6753 34.016C77.084 32.4453 76.2883 30.5233 76.2883 28.25C76.2883 25.9973 77.084 24.0857 78.6753 22.515C80.2666 20.9443 82.1886 20.159 84.4413 20.159C86.694 20.159 88.616 20.9443 90.2073 22.515C91.7986 24.0857 92.5943 25.9973 92.5943 28.25C92.5943 30.5233 91.7986 32.4453 90.2073 34.016ZM84.4413 32.373C85.5366 32.373 86.446 31.9907 87.1693 31.226C87.9133 30.4407 88.2853 29.4487 88.2853 28.25C88.2853 27.0513 87.9133 26.0697 87.1693 25.305C86.446 24.5197 85.5366 24.127 84.4413 24.127C83.3253 24.127 82.3953 24.5197 81.6513 25.305C80.928 26.0697 80.5663 27.0513 80.5663 28.25C80.5663 29.4487 80.928 30.4407 81.6513 31.226C82.3953 31.9907 83.3253 32.373 84.4413 32.373ZM96.3453 36V18.268H90.4863V13.99H106.792V18.268H100.871V36H96.3453ZM108.973 36V13.99H122.675V18.268H113.468V22.794H120.815V27.072H113.468V31.722H122.675V36H108.973ZM125.663 36V13.99H139.365V18.268H130.158V22.794H137.505V27.072H130.158V31.722H139.365V36H125.663Z",fill:"white"}),J.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M40.438 11.9201C37.0276 7.57101 32.0669 4.81953 26.5305 4.81953C15.8563 4.81953 8.06102 14.7604 8.06102 25.5444C8.06102 33.0444 13.0217 38.6805 18.5581 38.6805C19.0896 38.6805 19.5768 38.6361 20.1083 38.5473C16.3878 35.7959 13.9961 30.8254 13.9961 25.5C13.9961 16.9793 19.7539 10.3669 26.5305 10.3669C33.9272 10.3669 39.065 17.7337 39.065 25.5C39.065 31.2692 36.9833 36.9941 33.3957 41.2101C30.251 44.8935 26.1762 47.2456 21.7028 47.9556C21.7028 47.9556 22.0571 48 22.5443 48C34.9459 48 45 37.926 45 25.5C45 20.3965 43.3169 15.6923 40.438 11.9201ZM37.0276 25.5C37.0276 18 32.0669 12.3639 26.5305 12.3639C25.999 12.3639 25.5118 12.4083 24.9803 12.497C28.7008 15.2041 31.0482 20.1302 31.0482 25.5C31.0482 34.0207 25.2904 40.6331 18.5138 40.6331C11.1171 40.6331 5.97933 33.2663 5.97933 25.5C5.97933 19.7308 8.06102 14.0059 11.6486 9.78994C14.7933 6.10651 18.8681 3.75444 23.3415 3.04438C23.3415 3.04438 22.9872 3 22.4557 3C10.0541 3 0 13.074 0 25.5C0 30.6035 1.68307 35.3077 4.56201 39.0799C7.97244 43.429 12.9774 46.1805 18.4695 46.1805C29.2323 46.2249 37.0276 36.284 37.0276 25.5Z",fill:"white"})]})},eD=F.createContext({}),iv=()=>{const t=F.useContext(eD);if(Object.keys(t).length===0)throw new Error("[useWeb3] Component not wrapped within a Provider");return t};var CK={VITE_NETWORK:"23295",VITE_WEB3_GATEWAY:"https://testnet.sapphire.oasis.dev",VITE_PROPOSAL_START_TIME:"1710865800",VITE_CONTRACT_ACL_ALLOWALL:"0x8e29375FE5Db7eBb1b5eF24B7D397bBF0B01De09",VITE_CONTRACT_ACL_NATIVEBALANCE:"0x38FF18441b182ac603aADCA8ADDb257c6F5d103d",VITE_CONTRACT_POLLMANAGER:"0xdAB5845136b3102E63023BB2A2405cb71608605d",VITE_CONTRACT_POLLMANAGER_ACL:"0x8e29375FE5Db7eBb1b5eF24B7D397bBF0B01De09",VITE_PROPOSAL_ID:"0xb7799d0f7a33320ccf32803ce11d4df22f5772aa1ec81aaab6d4abe26fa50e9b",BASE_URL:"/votee",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const zw=new Map([[23294n,{chainId:"0x5afe",chainName:"Oasis Sapphire",iconUrls:["https://votee.oasis.io/rose.png"],nativeCurrency:{name:"ROSE",symbol:"ROSE",decimals:18},rpcUrls:["https://sapphire.oasis.io/","wss://sapphire.oasis.io/ws"],blockExplorerUrls:["https://explorer.oasis.io/mainnet/sapphire"]}],[23295n,{chainId:"0x5aff",chainName:"Oasis Sapphire Testnet",iconUrls:["https://votee.oasis.io/rose.png"],nativeCurrency:{name:"TEST",symbol:"TEST",decimals:18},rpcUrls:["https://testnet.sapphire.oasis.dev/","wss://testnet.sapphire.oasis.dev/ws"],blockExplorerUrls:["https://explorer.oasis.io/testnet/sapphire"]}]]),kK={"Oasis Sapphire":"Sapphire","Oasis Sapphire Testnet":"Sapphire Testnet"},_K=150000n,tD=Object.freeze([{name:"Capybara",description:"A friendly capybara with a rose in its hand, symbolizing the interoperability pioneered by the Oasis Network.",imagePath:"https://fakeimg.pl/182x182"},{name:"Desert Owl",description:"A wise owl with scrolls in its claws, symbolizing the knowledge pioneered by the Oasis Network.",imagePath:"https://fakeimg.pl/182x182"},{name:"Fennec Fox",description:"A nimble fox with sunglasses on its eyes, symbolizing the privacy pioneered by the Oasis Network.",imagePath:"https://fakeimg.pl/182x182"}]),NK="https://metamask.io/",IK="https://oasisprotocol.org/oasis-mascot-voting",{VITE_NETWORK:RK,VITE_PROPOSAL_START_TIME:MK,VITE_WEB3_GATEWAY:pC,VITE_CONTRACT_ACL_ALLOWALL:FPe,VITE_CONTRACT_ACL_NATIVEBALANCE:jPe,VITE_CONTRACT_POLLMANAGER:_6,VITE_CONTRACT_POLLMANAGER_ACL:zPe,VITE_PROPOSAL_ID:Fv}=CK,Hw=BigInt(RK)??0n,N6=Number(MK)??0,BK="_button_1wfen_1",DK="_buttonDisabled_1wfen_26",LK="_buttonSmall_1wfen_31",$K="_buttonMedium_1wfen_39",UK="_buttonSolid_1wfen_47",FK="_buttonPrimary_1wfen_48",jK="_buttonSecondary_1wfen_53",zK="_buttonSuccess_1wfen_58",HK="_buttonOutline_1wfen_65",GK="_buttonText_1wfen_85",VK="_fullWidth_1wfen_107",So={button:BK,buttonDisabled:DK,buttonSmall:LK,buttonMedium:$K,buttonSolid:UK,buttonPrimary:FK,buttonSecondary:jK,buttonSuccess:zK,buttonOutline:HK,buttonText:GK,fullWidth:VK},QK=/^(0x[a-zA-Z0-9]{4})[a-zA-Z0-9]+([a-zA-Z0-9]{4})$/;class Jn{}R(Jn,"truncateAddress",e=>{const n=e.match(QK);if(!n||(n==null?void 0:n.length)<=0)return e;const[,r,i]=n;return`${r}…${i}`}),R(Jn,"getTransactionUrl",(e,n)=>`${e}/tx/${n}`),R(Jn,"getAccountUrl",(e,n)=>`${e}/address/${n}`),R(Jn,"clsx",(...e)=>e.map(n=>n?[n]:[]).flat().join(" ")),R(Jn,"getNetworkFriendlyName",e=>kK[e]??"Unknown network"),R(Jn,"truncate",(e,n=200)=>e.slice(0,n));const KK={small:So.buttonSmall,medium:So.buttonMedium},WK={primary:So.buttonPrimary,secondary:So.buttonSecondary,success:So.buttonSuccess},JK={solid:So.buttonSolid,outline:So.buttonOutline,text:So.buttonText},nl=({className:t,children:e,disabled:n,color:r="primary",size:i="medium",variant:a="solid",fullWidth:o,onClick:s,type:l})=>J.jsx("button",{className:Jn.clsx(t,So.button,n?So.buttonDisabled:void 0,o?So.fullWidth:void 0,WK[r],KK[i],JK[a]),onClick:s,disabled:n,type:l,children:e});class j5 extends Error{constructor(e){super(e)}}var Nl=function(t){t==null&&(t=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,t.constructor==Array?this.init_by_array(t,t.length):this.init_seed(t)};Nl.prototype.init_seed=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(((t&4294901760)>>>16)*1812433253<<16)+(t&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};Nl.prototype.init_by_array=function(t,e){var n,r,i;for(this.init_seed(19650218),n=1,r=0,i=this.N>e?this.N:e;i;i--){var a=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((a&4294901760)>>>16)*1664525<<16)+(a&65535)*1664525)+t[r]+r,this.mt[n]>>>=0,n++,r++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),r>=e&&(r=0)}for(i=this.N-1;i;i--){var a=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((a&4294901760)>>>16)*1566083941<<16)+(a&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};Nl.prototype.random_int=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n>>1^e[t&1];for(;n>>1^e[t&1];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[t&1],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0};Nl.prototype.random_int31=function(){return this.random_int()>>>1};Nl.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};Nl.prototype.random=function(){return this.random_int()*(1/4294967296)};Nl.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};Nl.prototype.random_long=function(){var t=this.random_int()>>>5,e=this.random_int()>>>6;return(t*67108864+e)*(1/9007199254740992)};var YK=Nl;function XK(t,e){var n=document.createElement("div");return n.style.borderRadius="50px",n.style.overflow="hidden",n.style.padding="0px",n.style.margin="0px",n.style.width=""+t+"px",n.style.height=""+t+"px",n.style.display="inline-block",n.style.background=e,{container:n}}var ZK=XK,nD={exports:{}};(function(t){var e=function(){function n(l,c,u,f){typeof c=="object"&&(u=c.depth,f=c.prototype,c.filter,c=c.circular);var h=[],d=[],g=typeof Buffer<"u";typeof c>"u"&&(c=!0),typeof u>"u"&&(u=1/0);function p(m,y){if(m===null)return null;if(y==0)return m;var v,x;if(typeof m!="object")return m;if(n.__isArray(m))v=[];else if(n.__isRegExp(m))v=new RegExp(m.source,s(m)),m.lastIndex&&(v.lastIndex=m.lastIndex);else if(n.__isDate(m))v=new Date(m.getTime());else{if(g&&Buffer.isBuffer(m))return Buffer.allocUnsafe?v=Buffer.allocUnsafe(m.length):v=new Buffer(m.length),m.copy(v),v;typeof f>"u"?(x=Object.getPrototypeOf(m),v=Object.create(x)):(v=Object.create(f),x=f)}if(c){var A=h.indexOf(m);if(A!=-1)return d[A];h.push(m),d.push(v)}for(var S in m){var E;x&&(E=Object.getOwnPropertyDescriptor(x,S)),!(E&&E.set==null)&&(v[S]=p(m[S],y-1))}return v}return p(l,u)}n.clonePrototype=function(c){if(c===null)return null;var u=function(){};return u.prototype=c,new u};function r(l){return Object.prototype.toString.call(l)}n.__objToStr=r;function i(l){return typeof l=="object"&&r(l)==="[object Date]"}n.__isDate=i;function a(l){return typeof l=="object"&&r(l)==="[object Array]"}n.__isArray=a;function o(l){return typeof l=="object"&&r(l)==="[object RegExp]"}n.__isRegExp=o;function s(l){var c="";return l.global&&(c+="g"),l.ignoreCase&&(c+="i"),l.multiline&&(c+="m"),c}return n.__getRegExpFlags=s,n}();t.exports&&(t.exports=e)})(nD);var qK=nD.exports,rD={exports:{}},eW={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Uf=eW,iD={};for(var I6 in Uf)Uf.hasOwnProperty(I6)&&(iD[Uf[I6]]=I6);var qe=rD.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var vi in qe)if(qe.hasOwnProperty(vi)){if(!("channels"in qe[vi]))throw new Error("missing channels property: "+vi);if(!("labels"in qe[vi]))throw new Error("missing channel labels property: "+vi);if(qe[vi].labels.length!==qe[vi].channels)throw new Error("channel and label counts mismatch: "+vi);var tW=qe[vi].channels,nW=qe[vi].labels;delete qe[vi].channels,delete qe[vi].labels,Object.defineProperty(qe[vi],"channels",{value:tW}),Object.defineProperty(qe[vi],"labels",{value:nW})}qe.rgb.hsl=function(t){var e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=a-i,s,l,c;return a===i?s=0:e===a?s=(n-r)/o:n===a?s=2+(r-e)/o:r===a&&(s=4+(e-n)/o),s=Math.min(s*60,360),s<0&&(s+=360),c=(i+a)/2,a===i?l=0:c<=.5?l=o/(a+i):l=o/(2-a-i),[s,l*100,c*100]};qe.rgb.hsv=function(t){var e,n,r,i,a,o=t[0]/255,s=t[1]/255,l=t[2]/255,c=Math.max(o,s,l),u=c-Math.min(o,s,l),f=function(h){return(c-h)/6/u+1/2};return u===0?i=a=0:(a=u/c,e=f(o),n=f(s),r=f(l),o===c?i=r-n:s===c?i=1/3+e-r:l===c&&(i=2/3+n-e),i<0?i+=1:i>1&&(i-=1)),[i*360,a*100,c*100]};qe.rgb.hwb=function(t){var e=t[0],n=t[1],r=t[2],i=qe.rgb.hsl(t)[0],a=1/255*Math.min(e,Math.min(n,r));return r=1-1/255*Math.max(e,Math.max(n,r)),[i,a*100,r*100]};qe.rgb.cmyk=function(t){var e=t[0]/255,n=t[1]/255,r=t[2]/255,i,a,o,s;return s=Math.min(1-e,1-n,1-r),i=(1-e-s)/(1-s)||0,a=(1-n-s)/(1-s)||0,o=(1-r-s)/(1-s)||0,[i*100,a*100,o*100,s*100]};function rW(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2)}qe.rgb.keyword=function(t){var e=iD[t];if(e)return e;var n=1/0,r;for(var i in Uf)if(Uf.hasOwnProperty(i)){var a=Uf[i],o=rW(t,a);o.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92;var i=e*.4124+n*.3576+r*.1805,a=e*.2126+n*.7152+r*.0722,o=e*.0193+n*.1192+r*.9505;return[i*100,a*100,o*100]};qe.rgb.lab=function(t){var e=qe.rgb.xyz(t),n=e[0],r=e[1],i=e[2],a,o,s;return n/=95.047,r/=100,i/=108.883,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,a=116*r-16,o=500*(n-r),s=200*(r-i),[a,o,s]};qe.hsl.rgb=function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100,i,a,o,s,l;if(n===0)return l=r*255,[l,l,l];r<.5?a=r*(1+n):a=r+n-r*n,i=2*r-a,s=[0,0,0];for(var c=0;c<3;c++)o=e+1/3*-(c-1),o<0&&o++,o>1&&o--,6*o<1?l=i+(a-i)*6*o:2*o<1?l=a:3*o<2?l=i+(a-i)*(2/3-o)*6:l=i,s[c]=l*255;return s};qe.hsl.hsv=function(t){var e=t[0],n=t[1]/100,r=t[2]/100,i=n,a=Math.max(r,.01),o,s;return r*=2,n*=r<=1?r:2-r,i*=a<=1?a:2-a,s=(r+n)/2,o=r===0?2*i/(a+i):2*n/(r+n),[e,o*100,s*100]};qe.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,r=t[2]/100,i=Math.floor(e)%6,a=e-Math.floor(e),o=255*r*(1-n),s=255*r*(1-n*a),l=255*r*(1-n*(1-a));switch(r*=255,i){case 0:return[r,l,o];case 1:return[s,r,o];case 2:return[o,r,l];case 3:return[o,s,r];case 4:return[l,o,r];case 5:return[r,o,s]}};qe.hsv.hsl=function(t){var e=t[0],n=t[1]/100,r=t[2]/100,i=Math.max(r,.01),a,o,s;return s=(2-n)*r,a=(2-n)*i,o=n*i,o/=a<=1?a:2-a,o=o||0,s/=2,[e,o*100,s*100]};qe.hwb.rgb=function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100,i=n+r,a,o,s,l;i>1&&(n/=i,r/=i),a=Math.floor(6*e),o=1-r,s=6*e-a,a&1&&(s=1-s),l=n+s*(o-n);var c,u,f;switch(a){default:case 6:case 0:c=o,u=l,f=n;break;case 1:c=l,u=o,f=n;break;case 2:c=n,u=o,f=l;break;case 3:c=n,u=l,f=o;break;case 4:c=l,u=n,f=o;break;case 5:c=o,u=n,f=l;break}return[c*255,u*255,f*255]};qe.cmyk.rgb=function(t){var e=t[0]/100,n=t[1]/100,r=t[2]/100,i=t[3]/100,a,o,s;return a=1-Math.min(1,e*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),s=1-Math.min(1,r*(1-i)+i),[a*255,o*255,s*255]};qe.xyz.rgb=function(t){var e=t[0]/100,n=t[1]/100,r=t[2]/100,i,a,o;return i=e*3.2406+n*-1.5372+r*-.4986,a=e*-.9689+n*1.8758+r*.0415,o=e*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[i*255,a*255,o*255]};qe.xyz.lab=function(t){var e=t[0],n=t[1],r=t[2],i,a,o;return e/=95.047,n/=100,r/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,i=116*n-16,a=500*(e-n),o=200*(n-r),[i,a,o]};qe.lab.xyz=function(t){var e=t[0],n=t[1],r=t[2],i,a,o;a=(e+16)/116,i=n/500+a,o=a-r/200;var s=Math.pow(a,3),l=Math.pow(i,3),c=Math.pow(o,3);return a=s>.008856?s:(a-16/116)/7.787,i=l>.008856?l:(i-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,i*=95.047,a*=100,o*=108.883,[i,a,o]};qe.lab.lch=function(t){var e=t[0],n=t[1],r=t[2],i,a,o;return i=Math.atan2(r,n),a=i*360/2/Math.PI,a<0&&(a+=360),o=Math.sqrt(n*n+r*r),[e,o,a]};qe.lch.lab=function(t){var e=t[0],n=t[1],r=t[2],i,a,o;return o=r/360*2*Math.PI,i=n*Math.cos(o),a=n*Math.sin(o),[e,i,a]};qe.rgb.ansi16=function(t){var e=t[0],n=t[1],r=t[2],i=1 in arguments?arguments[1]:qe.rgb.hsv(t)[2];if(i=Math.round(i/50),i===0)return 30;var a=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return i===2&&(a+=60),a};qe.hsv.ansi16=function(t){return qe.rgb.ansi16(qe.hsv.rgb(t),t[2])};qe.rgb.ansi256=function(t){var e=t[0],n=t[1],r=t[2];if(e===n&&n===r)return e<8?16:e>248?231:Math.round((e-8)/247*24)+232;var i=16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5);return i};qe.ansi16.rgb=function(t){var e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];var n=(~~(t>50)+1)*.5,r=(e&1)*n*255,i=(e>>1&1)*n*255,a=(e>>2&1)*n*255;return[r,i,a]};qe.ansi256.rgb=function(t){if(t>=232){var e=(t-232)*10+8;return[e,e,e]}t-=16;var n,r=Math.floor(t/36)/5*255,i=Math.floor((n=t%36)/6)/5*255,a=n%6/5*255;return[r,i,a]};qe.rgb.hex=function(t){var e=((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255),n=e.toString(16).toUpperCase();return"000000".substring(n.length)+n};qe.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var n=e[0];e[0].length===3&&(n=n.split("").map(function(s){return s+s}).join(""));var r=parseInt(n,16),i=r>>16&255,a=r>>8&255,o=r&255;return[i,a,o]};qe.rgb.hcg=function(t){var e=t[0]/255,n=t[1]/255,r=t[2]/255,i=Math.max(Math.max(e,n),r),a=Math.min(Math.min(e,n),r),o=i-a,s,l;return o<1?s=a/(1-o):s=0,o<=0?l=0:i===e?l=(n-r)/o%6:i===n?l=2+(r-e)/o:l=4+(e-n)/o+4,l/=6,l%=1,[l*360,o*100,s*100]};qe.hsl.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=1,i=0;return n<.5?r=2*e*n:r=2*e*(1-n),r<1&&(i=(n-.5*r)/(1-r)),[t[0],r*100,i*100]};qe.hsv.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=e*n,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],r*100,i*100]};qe.hcg.rgb=function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100;if(n===0)return[r*255,r*255,r*255];var i=[0,0,0],a=e%1*6,o=a%1,s=1-o,l=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return l=(1-n)*r,[(n*i[0]+l)*255,(n*i[1]+l)*255,(n*i[2]+l)*255]};qe.hcg.hsv=function(t){var e=t[1]/100,n=t[2]/100,r=e+n*(1-e),i=0;return r>0&&(i=e/r),[t[0],i*100,r*100]};qe.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100,r=n*(1-e)+.5*e,i=0;return r>0&&r<.5?i=e/(2*r):r>=.5&&r<1&&(i=e/(2*(1-r))),[t[0],i*100,r*100]};qe.hcg.hwb=function(t){var e=t[1]/100,n=t[2]/100,r=e+n*(1-e);return[t[0],(r-e)*100,(1-r)*100]};qe.hwb.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=1-n,i=r-e,a=0;return i<1&&(a=(r-i)/(1-i)),[t[0],i*100,a*100]};qe.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};qe.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};qe.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};qe.gray.hsl=qe.gray.hsv=function(t){return[0,0,t[0]]};qe.gray.hwb=function(t){return[0,100,t[0]]};qe.gray.cmyk=function(t){return[0,0,0,t[0]]};qe.gray.lab=function(t){return[t[0],0,0]};qe.gray.hex=function(t){var e=Math.round(t[0]/100*255)&255,n=(e<<16)+(e<<8)+e,r=n.toString(16).toUpperCase();return"000000".substring(r.length)+r};qe.rgb.gray=function(t){var e=(t[0]+t[1]+t[2])/3;return[e/255*100]};var aD=rD.exports,Gw=aD;function iW(){for(var t={},e=Object.keys(Gw),n=e.length,r=0;r1&&(n=Array.prototype.slice.call(arguments)),t(n))};return"conversion"in t&&(e.conversion=t.conversion),e}function hW(t){var e=function(n){if(n==null)return n;arguments.length>1&&(n=Array.prototype.slice.call(arguments));var r=t(n);if(typeof r=="object")for(var i=r.length,a=0;an?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb,e=(t[0]*299+t[1]*587+t[2]*114)/1e3;return e<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){return this.values.hsl[2]+=this.values.hsl[2]*t,this.setValues("hsl",this.values.hsl),this},darken:function(t){return this.values.hsl[2]-=this.values.hsl[2]*t,this.setValues("hsl",this.values.hsl),this},saturate:function(t){return this.values.hsl[1]+=this.values.hsl[1]*t,this.setValues("hsl",this.values.hsl),this},desaturate:function(t){return this.values.hsl[1]-=this.values.hsl[1]*t,this.setValues("hsl",this.values.hsl),this},whiten:function(t){return this.values.hwb[1]+=this.values.hwb[1]*t,this.setValues("hwb",this.values.hwb),this},blacken:function(t){return this.values.hwb[2]+=this.values.hwb[2]*t,this.setValues("hwb",this.values.hwb),this},greyscale:function(){var t=this.values.rgb,e=t[0]*.3+t[1]*.59+t[2]*.11;return this.setValues("rgb",[e,e,e]),this},clearer:function(t){return this.setValues("alpha",this.values.alpha-this.values.alpha*t),this},opaquer:function(t){return this.setValues("alpha",this.values.alpha+this.values.alpha*t),this},rotate:function(t){var e=this.values.hsl[0];return e=(e+t)%360,e=e<0?360+e:e,this.values.hsl[0]=e,this.setValues("hsl",this.values.hsl),this},mix:function(t,e){var n=this,r=t,i=e===void 0?.5:e,a=2*i-1,o=n.alpha()-r.alpha(),s=((a*o===-1?a:(a+o)/(1+a*o))+1)/2,l=1-s;return this.rgb(s*n.red()+l*r.red(),s*n.green()+l*r.green(),s*n.blue()+l*r.blue()).alpha(n.alpha()*i+r.alpha()*(1-i))},toJSON:function(){return this.rgb()},clone:function(){var t=new os;return t.values=PW(this.values),t}};os.prototype.getValues=function(t){for(var e={},n=0;n=0&&e<=2}}const jW=({address:t,size:e})=>{const n=F.useRef(null);return F.useEffect(()=>{var r;if(n!=null&&n.current){const i=Cs.jsNumberForAddress(t),a=$W(e,i);(r=n.current)==null||r.replaceChildren(a)}},[e,n,t]),J.jsx("div",{ref:n,style:{width:e,height:e},className:FW.jazzIcon})},zW=F.memo(jW),HW="_connectedAccount_1shrx_1",GW="_connectedAccountDetails_1shrx_14",VW="_connectedAccountAddress_1shrx_25",QW="_network_1shrx_36",jv={connectedAccount:HW,connectedAccountDetails:GW,connectedAccountAddress:VW,network:QW},KW=({className:t,address:e,chainName:n})=>{const{state:{explorerBaseUrl:r}}=iv(),{state:{isDesktopScreen:i}}=ig(),a=r?Jn.getAccountUrl(r,e):void 0,o=Jn.getNetworkFriendlyName(n);return J.jsxs("a",{href:a,className:Jn.clsx(t,jv.connectedAccount),target:"_blank",rel:"nofollow noreferrer",children:[J.jsx(zW,{size:i?30:20,address:e}),i&&J.jsxs("p",{className:jv.connectedAccountDetails,children:[J.jsx("span",{className:jv.network,children:o}),J.jsx("abbr",{title:e,className:jv.connectedAccountAddress,children:Jn.truncateAddress(e)})]})]})},WW="_connectWalletBtn_10gns_1",JW="_connectWalletBtnLabel_10gns_16",YW="_stickyConnectedAccount_10gns_20",Dg={connectWalletBtn:WW,connectWalletBtnLabel:JW,stickyConnectedAccount:YW},XW=t=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},F.createElement("path",{d:"M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"})),mC={small:{width:14,height:14},medium:{width:30,height:30},large:{width:64,height:64},xlarge:{width:100,height:100}},ag=({children:t,size:e="medium",width:n,height:r})=>F.cloneElement(t,{...mC[e]?mC[e]:{},...n?{width:n}:{},...r?{height:r}:{}}),dD=t=>J.jsx(ag,{...t,children:J.jsx(XW,{})}),ZW=({mobileSticky:t})=>{const{state:{isDesktopScreen:e},setAppError:n}=ig(),[r,i]=F.useState(!1),[a,o]=F.useState(!0),[s,l]=F.useState(!1),{state:{isConnected:c,account:u,chainName:f},connectWallet:h,switchNetwork:d,isProviderAvailable:g}=iv();F.useEffect(()=>{(async()=>{i(!0),o(await g()),i(!1)})()},[]);const p=async()=>{i(!0);try{await h()}catch(y){y instanceof j5?l(!0):n(y)}finally{i(!1)}},m=async()=>{i(!0);try{await d(),l(!1),p()}catch(y){n(y)}finally{i(!1)}};return J.jsxs(J.Fragment,{children:[!c&&!a&&J.jsx("a",{href:NK,target:"_blank",rel:"noopener noreferrer",children:J.jsx(nl,{className:Dg.connectWalletBtn,color:t?"primary":"secondary",disabled:r,children:"Install MetaMask"})}),!c&&a&&s&&J.jsx(nl,{className:Dg.connectWalletBtn,color:t?"primary":"secondary",disabled:r,onClick:m,children:"Switch Network"}),!c&&a&&!s&&J.jsx(nl,{className:Dg.connectWalletBtn,color:t?"primary":"secondary",disabled:r,onClick:p,children:J.jsxs("label",{className:Dg.connectWalletBtnLabel,children:["Connect wallet",J.jsx(dD,{size:e?"medium":"small"})]})}),c&&u&&J.jsx(KW,{className:t?Dg.stickyConnectedAccount:void 0,address:u,chainName:f})]})},qW="_alert_17r1y_1",eJ="_icon_17r1y_20",tJ="_actions_17r1y_25",nJ="_alertError_17r1y_40",rJ="_alertSuccess_17r1y_46",iJ="_alertLoading_17r1y_61",aJ="_rotating_17r1y_1",oJ="_alertInsufficientBalance_17r1y_78",Bu={alert:qW,icon:eJ,actions:tJ,alertError:nJ,alertSuccess:rJ,alertLoading:iJ,rotating:aJ,alertInsufficientBalance:oJ},sJ="_card_12zm2_1",lJ={card:sJ},SP=({children:t,className:e})=>J.jsx("div",{className:Jn.clsx(lJ.card,e),children:t}),cJ=t=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},F.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-8,56a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z"})),uJ=({width:t=124,height:e=124,size:n})=>J.jsx(ag,{width:t,height:e,size:n,children:J.jsx(cJ,{})}),fJ=t=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},F.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"})),pD=t=>J.jsx(ag,{...t,children:J.jsx(fJ,{})}),hJ=t=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},F.createElement("path",{d:"M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm37.25,58.75a8,8,0,0,0,5.66-2.35l22.63-22.62a8,8,0,0,0-11.32-11.32L167.6,77.09a8,8,0,0,0,5.65,13.66ZM224,120H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z"})),dJ=({size:t="large",...e})=>J.jsx(ag,{size:t,...e,children:J.jsx(hJ,{})}),pJ=t=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},F.createElement("path",{d:"M192,116a12,12,0,1,1-12-12A12,12,0,0,1,192,116ZM152,64H112a8,8,0,0,0,0,16h40a8,8,0,0,0,0-16Zm96,48v32a24,24,0,0,1-24,24h-2.36l-16.21,45.38A16,16,0,0,1,190.36,224H177.64a16,16,0,0,1-15.07-10.62L160.65,208h-57.3l-1.92,5.38A16,16,0,0,1,86.36,224H73.64a16,16,0,0,1-15.07-10.62L46,178.22a87.69,87.69,0,0,1-21.44-48.38A16,16,0,0,0,16,144a8,8,0,0,1-16,0,32,32,0,0,1,24.28-31A88.12,88.12,0,0,1,112,32H216a8,8,0,0,1,0,16H194.61a87.93,87.93,0,0,1,30.17,37c.43,1,.85,2,1.25,3A24,24,0,0,1,248,112Zm-16,0a8,8,0,0,0-8-8h-3.66a8,8,0,0,1-7.64-5.6A71.9,71.9,0,0,0,144,48H112A72,72,0,0,0,58.91,168.64a8,8,0,0,1,1.64,2.71L73.64,208H86.36l3.82-10.69A8,8,0,0,1,97.71,192h68.58a8,8,0,0,1,7.53,5.31L177.64,208h12.72l18.11-50.69A8,8,0,0,1,216,152h8a8,8,0,0,0,8-8Z"})),gJ=({size:t="large",...e})=>J.jsx(ag,{size:t,...e,children:J.jsx(pJ,{})}),yJ={error:{header:"Something went wrong",icon:J.jsx(uJ,{})},success:{header:"Vote cast",icon:J.jsx(pD,{size:"xlarge"})},loading:{header:"Casting your vote",icon:J.jsx(dJ,{})},"insufficient-balance":{header:"Insufficient balance",icon:J.jsx(gJ,{})}},mJ={error:Bu.alertError,success:Bu.alertSuccess,loading:Bu.alertLoading,"insufficient-balance":Bu.alertInsufficientBalance},Du=({children:t,className:e,type:n,actions:r,headerText:i})=>{const{header:a,icon:o}=yJ[n];return J.jsx(SP,{className:Jn.clsx(e,mJ[n]),children:J.jsxs("div",{className:Bu.alert,children:[J.jsx("h2",{children:i??a}),J.jsx("p",{children:t}),J.jsx("div",{className:Bu.icon,children:o}),J.jsx("div",{className:Bu.actions,children:r})]})})};var G5=new Map,zv=new WeakMap,vC=0,vJ=void 0;function bJ(t){return t?(zv.has(t)||(vC+=1,zv.set(t,vC.toString())),zv.get(t)):"0"}function wJ(t){return Object.keys(t).sort().filter(e=>t[e]!==void 0).map(e=>`${e}_${e==="root"?bJ(t.root):t[e]}`).toString()}function xJ(t){const e=wJ(t);let n=G5.get(e);if(!n){const r=new Map;let i;const a=new IntersectionObserver(o=>{o.forEach(s=>{var l;const c=s.isIntersecting&&i.some(u=>s.intersectionRatio>=u);t.trackVisibility&&typeof s.isVisible>"u"&&(s.isVisible=c),(l=r.get(s.target))==null||l.forEach(u=>{u(c,s)})})},t);i=a.thresholds||(Array.isArray(t.threshold)?t.threshold:[t.threshold||0]),n={id:e,observer:a,elements:r},G5.set(e,n)}return n}function AJ(t,e,n={},r=vJ){if(typeof window.IntersectionObserver>"u"&&r!==void 0){const l=t.getBoundingClientRect();return e(r,{isIntersecting:r,target:t,intersectionRatio:typeof n.threshold=="number"?n.threshold:0,time:0,boundingClientRect:l,intersectionRect:l,rootBounds:l}),()=>{}}const{id:i,observer:a,elements:o}=xJ(n),s=o.get(t)||[];return o.has(t)||o.set(t,s),s.push(e),a.observe(t),function(){s.splice(s.indexOf(e),1),s.length===0&&(o.delete(t),a.unobserve(t)),o.size===0&&(a.disconnect(),G5.delete(i))}}function EJ({threshold:t,delay:e,trackVisibility:n,rootMargin:r,root:i,triggerOnce:a,skip:o,initialInView:s,fallbackInView:l,onChange:c}={}){var u;const[f,h]=F.useState(null),d=F.useRef(),[g,p]=F.useState({inView:!!s,entry:void 0});d.current=c,F.useEffect(()=>{if(o||!f)return;let x;return x=AJ(f,(A,S)=>{p({inView:A,entry:S}),d.current&&d.current(A,S),S.isIntersecting&&a&&x&&(x(),x=void 0)},{root:i,rootMargin:r,threshold:t,trackVisibility:n,delay:e},l),()=>{x&&x()}},[Array.isArray(t)?t.toString():t,f,i,r,a,o,n,l,e]);const m=(u=g.entry)==null?void 0:u.target,y=F.useRef();!f&&m&&!a&&!o&&y.current!==m&&(y.current=m,p({inView:!!s,entry:void 0}));const v=[h,g.inView,g.entry];return v.ref=v[0],v.inView=v[1],v.entry=v[2],v}const SJ="_layout_xbptv_1",PJ="_main_xbptv_8",bC={layout:SJ,main:PJ},gD=({children:t})=>J.jsx("div",{className:bC.layout,children:J.jsx("main",{className:bC.main,children:t})}),OJ=()=>{const{state:{isInitialLoading:t,appError:e,isMobileScreen:n},clearAppError:r}=ig(),{ref:i,inView:a}=EJ({threshold:1,initialInView:!0});return J.jsxs(J.Fragment,{children:[n&&J.jsx("div",{className:Bg.inViewPlaceholder,ref:i}),J.jsxs(gD,{children:[J.jsxs("header",{className:Jn.clsx(Bg.header,n&&!a?Bg.headerSticky:void 0),children:[J.jsx(TK,{className:Bg.logo}),J.jsx(ZW,{mobileSticky:n&&!a})]}),J.jsx("section",{className:Bg.subHeader,children:J.jsx("h1",{children:"Oasis Mascot"})}),J.jsxs("section",{children:[!t&&e&&J.jsx(Du,{type:"error",actions:J.jsx(nl,{variant:"text",onClick:r,children:"< Go back "}),children:Jn.truncate(e)}),t&&J.jsx(Du,{headerText:"Please wait",type:"loading",actions:J.jsx("span",{children:"Fetching poll..."})}),!t&&!e&&J.jsx(iK,{})]})]})]})},TJ="_cardHeaderText_uydtc_1",CJ="_mascotCards_uydtc_12",kJ="_mascotCardActions_uydtc_19",_J="_cardAction_uydtc_25",NJ="_voteBtnLabel_uydtc_36",IJ="_voteBtnLabelDisabled_uydtc_42",RJ="_cardFooterText_uydtc_48",MJ="_insufficientBalanceAlertActions_uydtc_57",BJ="_cardInfoText_uydtc_67",DJ="_landingPageLink_uydtc_77",LJ="_mascotCardSelectBtn_uydtc_81",$J="_mascotCardSelectedCheckIcon_uydtc_85",UJ="_headerText_uydtc_105",Hi={cardHeaderText:TJ,mascotCards:CJ,mascotCardActions:kJ,cardAction:_J,voteBtnLabel:NJ,voteBtnLabelDisabled:IJ,cardFooterText:RJ,insufficientBalanceAlertActions:MJ,cardInfoText:BJ,landingPageLink:DJ,mascotCardSelectBtn:LJ,mascotCardSelectedCheckIcon:$J,headerText:UJ},FJ="_mascotCard_1bkx9_1",jJ="_mascotCardSelected_1bkx9_10",zJ="_mascotCardVertical_1bkx9_14",HJ="_mascotCardDescription_1bkx9_32",GJ="_mascotCardHorizontal_1bkx9_37",VJ="_mascotCardTitle_1bkx9_52",sd={mascotCard:FJ,mascotCardSelected:jJ,mascotCardVertical:zJ,mascotCardDescription:HJ,mascotCardHorizontal:GJ,mascotCardTitle:VJ},QJ={vertical:sd.mascotCardVertical,horizontal:sd.mascotCardHorizontal},yD=({image:t,title:e,description:n,actions:r,selected:i,orientation:a="vertical"})=>J.jsxs("div",{className:Jn.clsx(sd.mascotCard,i?sd.mascotCardSelected:void 0,QJ[a]),children:[t,J.jsxs("div",{children:[J.jsx("h3",{className:sd.mascotCardTitle,children:e}),J.jsx("p",{className:sd.mascotCardDescription,children:n})]}),r]}),KJ=new Intl.DateTimeFormat("en",{timeStyle:"long",dateStyle:"long"});class ld{static intlDateFormat(e){return KJ.format(e)}static unixFormatToDate(e){return new Date(Number(e)*1e3)}}const WJ=()=>{const{state:{isConnected:t,account:e},vote:n,canVoteOnPoll:r}=iv(),{state:{poll:i,previousVote:a,isMobileScreen:o,isDesktopScreen:s},setPreviousVoteForCurrentWallet:l}=ig(),[c]=wK(),u=c.get("choice")??null,f=Cs.toNullableInt(u),h=Cs.isValidMascotChoiceId(f)?f:null,[d,g]=F.useState(h),[p,m]=F.useState("vote"),[y,v]=F.useState(!1),[x,A]=F.useState("");F.useEffect(()=>{m("vote")},[e]),F.useEffect(()=>{Cs.isValidMascotChoiceId(a)&&g(a)},[a]);const S=F.useMemo(()=>{if((t||d===null)&&!Cs.isValidMascotChoiceId(a))return J.jsxs(J.Fragment,{children:[J.jsx(J.Fragment,{children:"Continue"}),s&&J.jsx(dD,{})]});if(t&&Cs.isValidMascotChoiceId(a))return J.jsx(J.Fragment,{children:"Amend your vote"});if(!t&&d!==null)return J.jsx(J.Fragment,{children:"Wallet not connected"})},[t,s,a,d]),E=U=>{g(U)},T=async()=>{if(d!==null){v(!0);try{if(!await r()){m("insufficient-balance");return}m("loading"),await n(d),l(d),m("success")}catch(U){console.error(U),A(U.message??JSON.stringify(U)),m("error")}finally{v(!1)}}},C=()=>{m("vote")};if((i==null?void 0:i.active)===!1)return J.jsx(Z7,{to:"/results",replace:!0});const N=y||d===null||!t||a===d,B=J.jsxs(J.Fragment,{children:["Select your preferred mascot option. Once you confirm this vote you will not be able to retract it. Read more about the campaign ",J.jsx("a",{className:Hi.landingPageLink,href:IK,target:"_blank",rel:"noopener noreferrer",children:"on our website"}),"."]}),L=J.jsx("p",{className:Hi.cardInfoText,children:"You have already cast your vote. It can be amended below."});return J.jsxs(J.Fragment,{children:[p==="loading"&&J.jsx(Du,{type:"loading",actions:J.jsx("span",{children:"Submitting vote..."}),children:"Your vote is always private, and can be changed until the poll closes."}),p==="error"&&x&&J.jsx(Du,{type:"error",actions:J.jsx(nl,{disabled:y,onClick:C,children:"Try again"}),children:Jn.truncate(x)}),p==="success"&&J.jsx(Du,{type:"success",actions:J.jsxs("span",{children:["Your vote has been successfully submitted.",J.jsx("br",{}),"Thank you for your participation."]})}),p==="insufficient-balance"&&J.jsx(Du,{type:"insufficient-balance",actions:J.jsxs("div",{className:Hi.insufficientBalanceAlertActions,children:[J.jsx(nl,{disabled:y,onClick:T,children:"Try again"}),J.jsx(nl,{variant:"text",disabled:y,onClick:C,children:"< Cancel "})]}),children:"Please note there is a 100 ROSE threshold in order to cast your vote."}),p==="vote"&&J.jsxs(J.Fragment,{children:[o&&J.jsx("p",{className:Hi.headerText,children:B}),J.jsxs(SP,{children:[s&&J.jsx("p",{className:Hi.cardHeaderText,children:B}),J.jsx("div",{className:Hi.mascotCards,children:tD.map(({name:U,description:j,imagePath:Z},G)=>{const H=G===d;return J.jsx(yD,{title:U,description:j,image:J.jsx("img",{alt:U,src:Z}),selected:H,actions:J.jsxs(J.Fragment,{children:[J.jsx("div",{className:Hi.mascotCardActions,children:J.jsxs(nl,{className:Hi.mascotCardSelectBtn,variant:H?"solid":"outline",size:s?"small":"medium",color:H?"success":"secondary",disabled:y,onClick:()=>E(G),fullWidth:o,children:["Select",H?"ed":""]})}),H&&J.jsx("span",{className:Hi.mascotCardSelectedCheckIcon,children:J.jsx(pD,{size:"medium"})})]})},U)})}),J.jsxs("div",{className:Hi.cardAction,children:[(t||d===null)&&Cs.isValidMascotChoiceId(a)&&L,J.jsx(nl,{disabled:N,onClick:T,children:J.jsx("label",{className:Jn.clsx(N?Hi.voteBtnLabelDisabled:Hi.voteBtnLabel),children:S})})]}),J.jsxs("p",{className:Hi.cardFooterText,children:["Please note there is a 100 ROSE threshold in order to cast your vote.",!!(i!=null&&i.params.closeTimestamp)&&J.jsxs(J.Fragment,{children:[s?J.jsx("br",{}):J.jsx(J.Fragment,{children:" "}),J.jsxs("span",{children:["Poll closes on ",ld.intlDateFormat(ld.unixFormatToDate(i.params.closeTimestamp))]})]})]})]})]})]})},JJ="6.11.1";function YJ(t,e,n){const r=e.split("|").map(a=>a.trim());for(let a=0;aPromise.resolve(t[r])))).reduce((r,i,a)=>(r[e[a]]=i,r),{})}function gt(t,e,n){for(let r in e){let i=e[r];const a=n?n[r]:null;a&&YJ(i,a,r),Object.defineProperty(t,r,{enumerable:!0,value:i,writable:!1})}}function cd(t){if(t==null)return"null";if(Array.isArray(t))return"[ "+t.map(cd).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let n="0x";for(let r=0;r>4],n+=e[t[r]&15];return n}if(typeof t=="object"&&typeof t.toJSON=="function")return cd(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":return BigInt(t).toString();case"number":return t.toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{ "+e.map(n=>`${cd(n)}: ${cd(t[n])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Qr(t,e){return t&&t.code===e}function PP(t){return Qr(t,"CALL_EXCEPTION")}function qn(t,e,n){let r=t;{const a=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${cd(n)}`);for(const o in n){if(o==="shortMessage")continue;const s=n[o];a.push(o+"="+cd(s))}}a.push(`code=${e}`),a.push(`version=${JJ}`),a.length&&(t+=" ("+a.join(", ")+")")}let i;switch(e){case"INVALID_ARGUMENT":i=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":i=new RangeError(t);break;default:i=new Error(t)}return gt(i,{code:e}),n&&Object.assign(i,n),i.shortMessage==null&>(i,{shortMessage:r}),i}function ye(t,e,n,r){if(!t)throw qn(e,n,r)}function K(t,e,n,r){ye(t,e,"INVALID_ARGUMENT",{argument:n,value:r})}function mD(t,e,n){n==null&&(n=""),n&&(n=": "+n),ye(t>=e,"missing arguemnt"+n,"MISSING_ARGUMENT",{count:t,expectedCount:e}),ye(t<=e,"too many arguments"+n,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}const XJ=["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");t.push(e)}catch{}return t},[]);function ZJ(t){ye(XJ.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}function L2(t,e,n){if(n==null&&(n=""),t!==e){let r=n,i="new";n&&(r+=".",i+=" "+n),ye(!1,`private constructor; use ${r}from* methods`,"UNSUPPORTED_OPERATION",{operation:i})}}function vD(t,e,n){if(t instanceof Uint8Array)return n?new Uint8Array(t):t;if(typeof t=="string"&&t.match(/^0x([0-9a-f][0-9a-f])*$/i)){const r=new Uint8Array((t.length-2)/2);let i=2;for(let a=0;a>4]+wC[i&15]}return n}function Zn(t){return"0x"+t.map(e=>it(e).substring(2)).join("")}function Td(t){return gn(t,!0)?(t.length-2)/2:Jt(t).length}function Un(t,e,n){const r=Jt(t);return n!=null&&n>r.length&&ye(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n}),it(r.slice(e??0,n??r.length))}function bD(t,e,n){const r=Jt(t);ye(e>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),n?i.set(r,e-r.length):i.set(r,0),it(i)}function nh(t,e){return bD(t,e,!0)}function eY(t,e){return bD(t,e,!1)}const $2=BigInt(0),bo=BigInt(1),ud=9007199254740991;function tY(t,e){const n=U2(t,"value"),r=BigInt(Bt(e,"width"));if(ye(n>>r===$2,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),n>>r-bo){const i=(bo<=-ud&&t<=ud,"overflow",e||"value",t),BigInt(t);case"string":try{if(t==="")throw new Error("empty string");return t[0]==="-"&&t[1]!=="-"?-BigInt(t.substring(1)):BigInt(t)}catch(n){K(!1,`invalid BigNumberish string: ${n.message}`,e||"value",t)}}K(!1,"invalid BigNumberish value",e||"value",t)}function U2(t,e){const n=et(t,e);return ye(n>=$2,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),n}const xC="0123456789abcdef";function OP(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=xC[n>>4],e+=xC[n&15];return BigInt(e)}return et(t)}function Bt(t,e){switch(typeof t){case"bigint":return K(t>=-ud&&t<=ud,"overflow",e||"value",t),Number(t);case"number":return K(Number.isInteger(t),"underflow",e||"value",t),K(t>=-ud&&t<=ud,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return Bt(BigInt(t),e)}catch(n){K(!1,`invalid numeric string: ${n.message}`,e||"value",t)}}K(!1,"invalid numeric value",e||"value",t)}function nY(t){return Bt(OP(t))}function us(t,e){let r=U2(t,"value").toString(16);if(e==null)r.length%2&&(r="0"+r);else{const i=Bt(e,"width");for(ye(i*2>=r.length,`value exceeds width (${i} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});r.length>6===2;o++)a++;return a}return t==="OVERRUN"?n.length-e-1:0}function sY(t,e,n,r,i){return t==="OVERLONG"?(K(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),r.push(i),0):(r.push(65533),AD(t,e,n))}const lY=Object.freeze({error:oY,ignore:AD,replace:sY});function cY(t,e){e==null&&(e=lY.error);const n=Jt(t,"bytes"),r=[];let i=0;for(;i>7)){r.push(a);continue}let o=null,s=null;if((a&224)===192)o=1,s=127;else if((a&240)===224)o=2,s=2047;else if((a&248)===240)o=3,s=65535;else{(a&192)===128?i+=e("UNEXPECTED_CONTINUE",i-1,n,r):i+=e("BAD_PREFIX",i-1,n,r);continue}if(i-1+o>=n.length){i+=e("OVERRUN",i-1,n,r);continue}let l=a&(1<<8-o-1)-1;for(let c=0;c1114111){i+=e("OUT_OF_RANGE",i-1-o,n,r,l);continue}if(l>=55296&&l<=57343){i+=e("UTF16_SURROGATE",i-1-o,n,r,l);continue}if(l<=s){i+=e("OVERLONG",i-1-o,n,r,l);continue}r.push(l)}}return r}function fl(t,e){K(typeof t=="string","invalid string value","str",t),e!=null&&(ZJ(e),t=t.normalize(e));let n=[];for(let r=0;r>6|192),n.push(i&63|128);else if((i&64512)==55296){r++;const a=t.charCodeAt(r);K(r>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(o&63|128)}else n.push(i>>12|224),n.push(i>>6&63|128),n.push(i&63|128)}return new Uint8Array(n)}function uY(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Vw(t,e){return uY(cY(t,e))}function ED(t){async function e(n,r){const i=n.url.split(":")[0].toLowerCase();ye(i==="http"||i==="https",`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),ye(i==="https"||!n.credentials||n.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let a;if(r){const f=new AbortController;a=f.signal,r.addListener(()=>{f.abort()})}const o={method:n.method,headers:new Headers(Array.from(n)),body:n.body||void 0,signal:a},s=await fetch(n.url,o),l={};s.headers.forEach((f,h)=>{l[h.toLowerCase()]=f});const c=await s.arrayBuffer(),u=c==null?null:new Uint8Array(c);return{statusCode:s.status,statusMessage:s.statusText,headers:l,body:u}}return e}const fY=12,hY=250;let SC=ED();const dY=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),pY=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let M6=!1;async function SD(t,e){try{const n=t.match(dY);if(!n)throw new Error("invalid data");return new Cd(200,"OK",{"content-type":n[1]||"text/plain"},n[2]?iY(n[3]):yY(n[3]))}catch{return new Cd(599,"BAD REQUEST (invalid data: URI)",{},null,new rh(t))}}function PD(t){async function e(n,r){try{const i=n.match(pY);if(!i)throw new Error("invalid link");return new rh(`${t}${i[2]}`)}catch{return new Cd(599,"BAD REQUEST (invalid IPFS URI)",{},null,new rh(n))}}return e}const Hv={data:SD,ipfs:PD("https://gateway.ipfs.io/ipfs/")},OD=new WeakMap;var Qu,tc,eM;let gY=(eM=class{constructor(e){M(this,Qu,void 0);M(this,tc,void 0);O(this,Qu,[]),O(this,tc,!1),OD.set(e,()=>{if(!b(this,tc)){O(this,tc,!0);for(const n of b(this,Qu))setTimeout(()=>{n()},0);O(this,Qu,[])}})}addListener(e){ye(!b(this,tc),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),b(this,Qu).push(e)}get cancelled(){return b(this,tc)}checkSignal(){ye(!this.cancelled,"cancelled","CANCELLED",{})}},Qu=new WeakMap,tc=new WeakMap,eM);function Gv(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}var $d,Ud,ao,Ns,Fd,jd,ur,Ji,Is,Ku,Wu,Ju,Lo,Rs,nc,Yu,ty,Zp;let rh=(Zp=class{constructor(e){M(this,Yu);M(this,$d,void 0);M(this,Ud,void 0);M(this,ao,void 0);M(this,Ns,void 0);M(this,Fd,void 0);M(this,jd,void 0);M(this,ur,void 0);M(this,Ji,void 0);M(this,Is,void 0);M(this,Ku,void 0);M(this,Wu,void 0);M(this,Ju,void 0);M(this,Lo,void 0);M(this,Rs,void 0);M(this,nc,void 0);O(this,jd,String(e)),O(this,$d,!1),O(this,Ud,!0),O(this,ao,{}),O(this,Ns,""),O(this,Fd,3e5),O(this,Rs,{slotInterval:hY,maxAttempts:fY}),O(this,nc,null)}get url(){return b(this,jd)}set url(e){O(this,jd,String(e))}get body(){return b(this,ur)==null?null:new Uint8Array(b(this,ur))}set body(e){if(e==null)O(this,ur,void 0),O(this,Ji,void 0);else if(typeof e=="string")O(this,ur,fl(e)),O(this,Ji,"text/plain");else if(e instanceof Uint8Array)O(this,ur,e),O(this,Ji,"application/octet-stream");else if(typeof e=="object")O(this,ur,fl(JSON.stringify(e))),O(this,Ji,"application/json");else throw new Error("invalid body")}hasBody(){return b(this,ur)!=null}get method(){return b(this,Ns)?b(this,Ns):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),O(this,Ns,String(e).toUpperCase())}get headers(){const e=Object.assign({},b(this,ao));return b(this,Is)&&(e.authorization=`Basic ${aY(fl(b(this,Is)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&b(this,Ji)&&(e["content-type"]=b(this,Ji)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,n){b(this,ao)[String(e).toLowerCase()]=String(n)}clearHeaders(){O(this,ao,{})}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r=0,"timeout must be non-zero","timeout",e),O(this,Fd,e)}get preflightFunc(){return b(this,Ku)||null}set preflightFunc(e){O(this,Ku,e)}get processFunc(){return b(this,Wu)||null}set processFunc(e){O(this,Wu,e)}get retryFunc(){return b(this,Ju)||null}set retryFunc(e){O(this,Ju,e)}get getUrlFunc(){return b(this,nc)||SC}set getUrlFunc(e){O(this,nc,e)}toString(){return``}setThrottleParams(e){e.slotInterval!=null&&(b(this,Rs).slotInterval=e.slotInterval),e.maxAttempts!=null&&(b(this,Rs).maxAttempts=e.maxAttempts)}send(){return ye(b(this,Lo)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),O(this,Lo,new gY(this)),ie(this,Yu,ty).call(this,0,PC()+this.timeout,0,this,new Cd(0,"",{},null,this))}cancel(){ye(b(this,Lo)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=OD.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const n=this.url.split(":")[0].toLowerCase(),r=e.split(":")[0].toLowerCase();ye(this.method==="GET"&&(n!=="https"||r!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const i=new Zp(e);return i.method="GET",i.allowGzip=this.allowGzip,i.timeout=this.timeout,O(i,ao,Object.assign({},b(this,ao))),b(this,ur)&&O(i,ur,new Uint8Array(b(this,ur))),O(i,Ji,b(this,Ji)),i}clone(){const e=new Zp(this.url);return O(e,Ns,b(this,Ns)),b(this,ur)&&O(e,ur,b(this,ur)),O(e,Ji,b(this,Ji)),O(e,ao,Object.assign({},b(this,ao))),O(e,Is,b(this,Is)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),O(e,Ku,b(this,Ku)),O(e,Wu,b(this,Wu)),O(e,Ju,b(this,Ju)),O(e,nc,b(this,nc)),e}static lockConfig(){M6=!0}static getGateway(e){return Hv[e.toLowerCase()]||null}static registerGateway(e,n){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(M6)throw new Error("gateways locked");Hv[e]=n}static registerGetUrl(e){if(M6)throw new Error("gateways locked");SC=e}static createGetUrlFunc(e){return ED()}static createDataGateway(){return SD}static createIpfsGatewayFunc(e){return PD(e)}},$d=new WeakMap,Ud=new WeakMap,ao=new WeakMap,Ns=new WeakMap,Fd=new WeakMap,jd=new WeakMap,ur=new WeakMap,Ji=new WeakMap,Is=new WeakMap,Ku=new WeakMap,Wu=new WeakMap,Ju=new WeakMap,Lo=new WeakMap,Rs=new WeakMap,nc=new WeakMap,Yu=new WeakSet,ty=async function(e,n,r,i,a){var u,f,h;if(e>=b(this,Rs).maxAttempts)return a.makeServerError("exceeded maximum retry limit");ye(PC()<=n,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),r>0&&await mY(r);let o=this.clone();const s=(o.url.split(":")[0]||"").toLowerCase();if(s in Hv){const d=await Hv[s](o.url,Gv(b(i,Lo)));if(d instanceof Cd){let g=d;if(this.processFunc){Gv(b(i,Lo));try{g=await this.processFunc(o,g)}catch(p){(p.throttle==null||typeof p.stall!="number")&&g.makeServerError("error in post-processing function",p).assertOk()}}return g}o=d}this.preflightFunc&&(o=await this.preflightFunc(o));const l=await this.getUrlFunc(o,Gv(b(i,Lo)));let c=new Cd(l.statusCode,l.statusMessage,l.headers,l.body,i);if(c.statusCode===301||c.statusCode===302){try{const d=c.headers.location||"";return ie(u=o.redirect(d),Yu,ty).call(u,e+1,n,0,i,c)}catch{}return c}else if(c.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,c,e))){const d=c.headers["retry-after"];let g=b(this,Rs).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof d=="string"&&d.match(/^[1-9][0-9]*$/)&&(g=parseInt(d)),ie(f=o.clone(),Yu,ty).call(f,e+1,n,g,i,c)}if(this.processFunc){Gv(b(i,Lo));try{c=await this.processFunc(o,c)}catch(d){(d.throttle==null||typeof d.stall!="number")&&c.makeServerError("error in post-processing function",d).assertOk();let g=b(this,Rs).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return d.stall>=0&&(g=d.stall),ie(h=o.clone(),Yu,ty).call(h,e+1,n,g,i,c)}}return c},Zp);var um,fm,hm,Yi,zd,Xu,dm;let Cd=(dm=class{constructor(e,n,r,i,a){M(this,um,void 0);M(this,fm,void 0);M(this,hm,void 0);M(this,Yi,void 0);M(this,zd,void 0);M(this,Xu,void 0);O(this,um,e),O(this,fm,n),O(this,hm,Object.keys(r).reduce((o,s)=>(o[s.toLowerCase()]=String(r[s]),o),{})),O(this,Yi,i==null?null:new Uint8Array(i)),O(this,zd,a||null),O(this,Xu,{message:""})}toString(){return``}get statusCode(){return b(this,um)}get statusMessage(){return b(this,fm)}get headers(){return Object.assign({},b(this,hm))}get body(){return b(this,Yi)==null?null:new Uint8Array(b(this,Yi))}get bodyText(){try{return b(this,Yi)==null?"":Vw(b(this,Yi))}catch{ye(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{ye(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r=0,"invalid stall timeout","stall",n);const r=new Error(e||"throttling requests");throw gt(r,{stall:n,throttle:!0}),r}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return b(this,Yi)!=null}get request(){return b(this,zd)}ok(){return b(this,Xu).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:n}=b(this,Xu);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let r=null;this.request&&(r=this.request.url);let i=null;try{b(this,Yi)&&(i=Vw(b(this,Yi)))}catch{}ye(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:n,info:{requestUrl:r,responseBody:i,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}},um=new WeakMap,fm=new WeakMap,hm=new WeakMap,Yi=new WeakMap,zd=new WeakMap,Xu=new WeakMap,dm);function PC(){return new Date().getTime()}function yY(t){return fl(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,n)=>String.fromCharCode(parseInt(n,16))))}function mY(t){return new Promise(e=>setTimeout(e,t))}function vY(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function OC(t,e,n){let r=0;for(let i=0;i{ye(r<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:r})};if(t[e]>=248){const r=t[e]-247;n(e+1+r);const i=OC(t,e+1,r);return n(e+1+r+i),TC(t,e,e+1+r,r+i)}else if(t[e]>=192){const r=t[e]-192;return n(e+1+r),TC(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;n(e+1+r);const i=OC(t,e+1,r);n(e+1+r+i);const a=it(t.slice(e+1+r,e+1+r+i));return{consumed:1+r+i,result:a}}else if(t[e]>=128){const r=t[e]-128;n(e+1+r);const i=it(t.slice(e+1,e+1+r));return{consumed:1+r,result:i}}return{consumed:1,result:vY(t[e])}}function F2(t){const e=Jt(t,"data"),n=TD(e,0);return K(n.consumed===e.length,"unexpected junk after rlp payload","data",t),n.result}function CC(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function CD(t){if(Array.isArray(t)){let r=[];if(t.forEach(function(a){r=r.concat(CD(a))}),r.length<=55)return r.unshift(192+r.length),r;const i=CC(r.length);return i.unshift(247+i.length),i.concat(r)}const e=Array.prototype.slice.call(Jt(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const n=CC(e.length);return n.unshift(183+n.length),n.concat(e)}const kC="0123456789abcdef";function vp(t){let e="0x";for(const n of CD(t))e+=kC[n>>4],e+=kC[n&15];return e}const si=32,V5=new Uint8Array(si),bY=["then"],Vv={};function Lg(t,e){const n=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw n.error=e,n}var rc,Wf;let kD=(Wf=class extends Array{constructor(...n){const r=n[0];let i=n[1],a=(n[2]||[]).slice(),o=!0;r!==Vv&&(i=n,a=[],o=!1);super(i.length);M(this,rc,void 0);i.forEach((l,c)=>{this[c]=l});const s=a.reduce((l,c)=>(typeof c=="string"&&l.set(c,(l.get(c)||0)+1),l),new Map);if(O(this,rc,Object.freeze(i.map((l,c)=>{const u=a[c];return u!=null&&s.get(u)===1?u:null}))),!!o)return Object.freeze(this),new Proxy(this,{get:(l,c,u)=>{if(typeof c=="string"){if(c.match(/^[0-9]+$/)){const h=Bt(c,"%index");if(h<0||h>=this.length)throw new RangeError("out of result range");const d=l[h];return d instanceof Error&&Lg(`index ${h}`,d),d}if(bY.indexOf(c)>=0)return Reflect.get(l,c,u);const f=l[c];if(f instanceof Function)return function(...h){return f.apply(this===u?l:this,h)};if(!(c in l))return l.getValue.apply(this===u?l:this,[c])}return Reflect.get(l,c,u)}})}toArray(){const n=[];return this.forEach((r,i)=>{r instanceof Error&&Lg(`index ${i}`,r),n.push(r)}),n}toObject(){return b(this,rc).reduce((n,r,i)=>(ye(r!=null,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"}),r in n||(n[r]=this.getValue(r)),n),{})}slice(n,r){n==null&&(n=0),n<0&&(n+=this.length,n<0&&(n=0)),r==null&&(r=this.length),r<0&&(r+=this.length,r<0&&(r=0)),r>this.length&&(r=this.length);const i=[],a=[];for(let o=n;o{b(this,Ms)[e]=_C(n)}}},Ms=new WeakMap,Zu=new WeakMap,Hd=new WeakSet,jb=function(e){return b(this,Ms).push(e),O(this,Zu,b(this,Zu)+e.length),e.length},tM);var bi,Xi,qu,ef,ic,pm,K5,a2,_D,gm;let wY=(gm=class{constructor(e,n,r){M(this,pm);M(this,a2);R(this,"allowLoose");M(this,bi,void 0);M(this,Xi,void 0);M(this,qu,void 0);M(this,ef,void 0);M(this,ic,void 0);gt(this,{allowLoose:!!n}),O(this,bi,ai(e)),O(this,qu,0),O(this,ef,null),O(this,ic,r??1024),O(this,Xi,0)}get data(){return it(b(this,bi))}get dataLength(){return b(this,bi).length}get consumed(){return b(this,Xi)}get bytes(){return new Uint8Array(b(this,bi))}subReader(e){const n=new gm(b(this,bi).slice(b(this,Xi)+e),this.allowLoose,b(this,ic));return O(n,ef,this),n}readBytes(e,n){let r=ie(this,a2,_D).call(this,0,e,!!n);return ie(this,pm,K5).call(this,e),O(this,Xi,b(this,Xi)+r.length),r.slice(0,e)}readValue(){return OP(this.readBytes(si))}readIndex(){return nY(this.readBytes(si))}},bi=new WeakMap,Xi=new WeakMap,qu=new WeakMap,ef=new WeakMap,ic=new WeakMap,pm=new WeakSet,K5=function(e){var n;if(b(this,ef))return ie(n=b(this,ef),pm,K5).call(n,e);O(this,qu,b(this,qu)+e),ye(b(this,ic)<1||b(this,qu)<=b(this,ic)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${b(this,ic)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:ai(b(this,bi)),offset:b(this,Xi),length:e,info:{bytesRead:b(this,qu),dataLength:this.dataLength}})},a2=new WeakSet,_D=function(e,n,r){let i=Math.ceil(n/si)*si;return b(this,Xi)+i>b(this,bi).length&&(this.allowLoose&&r&&b(this,Xi)+n<=b(this,bi).length?i=n:ye(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:ai(b(this,bi)),length:b(this,bi).length,offset:b(this,Xi)+i})),b(this,bi).slice(b(this,Xi),b(this,Xi)+i)},gm);function Qw(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function TP(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function xY(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Qw(t.outputLen),Qw(t.blockLen)}function bp(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function ND(t,e){TP(t);const n=e.outputLen;if(t.lengtht instanceof Uint8Array,AY=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),D6=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Mo=(t,e)=>t<<32-e|t>>>e,EY=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!EY)throw new Error("Non little-endian hardware is not supported");function SY(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function j2(t){if(typeof t=="string"&&(t=SY(t)),!ID(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function PY(...t){const e=new Uint8Array(t.reduce((r,i)=>r+i.length,0));let n=0;return t.forEach(r=>{if(!ID(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}let CP=class{clone(){return this._cloneInto()}};function kP(t){const e=r=>t().update(j2(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function OY(t=32){if(B6&&typeof B6.getRandomValues=="function")return B6.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}class RD extends CP{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,xY(e);const r=j2(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,a=new Uint8Array(i);a.set(r.length>i?e.create().update(r).digest():r);for(let o=0;onew RD(t,e).update(n).digest();_P.create=(t,e)=>new RD(t,e);function TY(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),l=r?4:0,c=r?0:4;t.setUint32(e+l,o,r),t.setUint32(e+c,s,r)}class MD extends CP{constructor(e,n,r,i){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=D6(this.buffer)}update(e){bp(this);const{view:n,buffer:r,blockLen:i}=this;e=j2(e);const a=e.length;for(let o=0;oi-o&&(this.process(r,0),o=0);for(let f=o;fu.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;ft&e^~t&n,kY=(t,e,n)=>t&e^t&n^e&n,_Y=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),zl=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Hl=new Uint32Array(64);class NY extends MD{constructor(){super(64,32,8,!1),this.A=zl[0]|0,this.B=zl[1]|0,this.C=zl[2]|0,this.D=zl[3]|0,this.E=zl[4]|0,this.F=zl[5]|0,this.G=zl[6]|0,this.H=zl[7]|0}get(){const{A:e,B:n,C:r,D:i,E:a,F:o,G:s,H:l}=this;return[e,n,r,i,a,o,s,l]}set(e,n,r,i,a,o,s,l){this.A=e|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=a|0,this.F=o|0,this.G=s|0,this.H=l|0}process(e,n){for(let f=0;f<16;f++,n+=4)Hl[f]=e.getUint32(n,!1);for(let f=16;f<64;f++){const h=Hl[f-15],d=Hl[f-2],g=Mo(h,7)^Mo(h,18)^h>>>3,p=Mo(d,17)^Mo(d,19)^d>>>10;Hl[f]=p+Hl[f-7]+g+Hl[f-16]|0}let{A:r,B:i,C:a,D:o,E:s,F:l,G:c,H:u}=this;for(let f=0;f<64;f++){const h=Mo(s,6)^Mo(s,11)^Mo(s,25),d=u+h+CY(s,l,c)+_Y[f]+Hl[f]|0,p=(Mo(r,2)^Mo(r,13)^Mo(r,22))+kY(r,i,a)|0;u=c,c=l,l=s,s=o+d|0,o=a,a=i,i=r,r=d+p|0}r=r+this.A|0,i=i+this.B|0,a=a+this.C|0,o=o+this.D|0,s=s+this.E|0,l=l+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,i,a,o,s,l,c,u)}roundClean(){Hl.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const IY=kP(()=>new NY),Qv=BigInt(2**32-1),W5=BigInt(32);function BD(t,e=!1){return e?{h:Number(t&Qv),l:Number(t>>W5&Qv)}:{h:Number(t>>W5&Qv)|0,l:Number(t&Qv)|0}}function DD(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let i=0;iBigInt(t>>>0)<>>0),MY=(t,e,n)=>t>>>n,BY=(t,e,n)=>t<<32-n|e>>>n,DY=(t,e,n)=>t>>>n|e<<32-n,LY=(t,e,n)=>t<<32-n|e>>>n,$Y=(t,e,n)=>t<<64-n|e>>>n-32,UY=(t,e,n)=>t>>>n-32|e<<64-n,FY=(t,e)=>e,jY=(t,e)=>t,LD=(t,e,n)=>t<>>32-n,$D=(t,e,n)=>e<>>32-n,UD=(t,e,n)=>e<>>64-n,FD=(t,e,n)=>t<>>64-n;function zY(t,e,n,r){const i=(e>>>0)+(r>>>0);return{h:t+n+(i/2**32|0)|0,l:i|0}}const HY=(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),GY=(t,e,n,r)=>e+n+r+(t/2**32|0)|0,VY=(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),QY=(t,e,n,r,i)=>e+n+r+i+(t/2**32|0)|0,KY=(t,e,n,r,i)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0),WY=(t,e,n,r,i,a)=>e+n+r+i+a+(t/2**32|0)|0,Nt={fromBig:BD,split:DD,toBig:RY,shrSH:MY,shrSL:BY,rotrSH:DY,rotrSL:LY,rotrBH:$Y,rotrBL:UY,rotr32H:FY,rotr32L:jY,rotlSH:LD,rotlSL:$D,rotlBH:UD,rotlBL:FD,add:zY,add3L:HY,add3H:GY,add4L:VY,add4H:QY,add5H:WY,add5L:KY},[JY,YY]=Nt.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),Gl=new Uint32Array(80),Vl=new Uint32Array(80);class XY extends MD{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:n,Bh:r,Bl:i,Ch:a,Cl:o,Dh:s,Dl:l,Eh:c,El:u,Fh:f,Fl:h,Gh:d,Gl:g,Hh:p,Hl:m}=this;return[e,n,r,i,a,o,s,l,c,u,f,h,d,g,p,m]}set(e,n,r,i,a,o,s,l,c,u,f,h,d,g,p,m){this.Ah=e|0,this.Al=n|0,this.Bh=r|0,this.Bl=i|0,this.Ch=a|0,this.Cl=o|0,this.Dh=s|0,this.Dl=l|0,this.Eh=c|0,this.El=u|0,this.Fh=f|0,this.Fl=h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add3H(G,N,L,j),i=G|0}({h:r,l:i}=Nt.add(this.Ah|0,this.Al|0,r|0,i|0)),{h:a,l:o}=Nt.add(this.Bh|0,this.Bl|0,a|0,o|0),{h:s,l}=Nt.add(this.Ch|0,this.Cl|0,s|0,l|0),{h:c,l:u}=Nt.add(this.Dh|0,this.Dl|0,c|0,u|0),{h:f,l:h}=Nt.add(this.Eh|0,this.El|0,f|0,h|0),{h:d,l:g}=Nt.add(this.Fh|0,this.Fl|0,d|0,g|0),{h:p,l:m}=Nt.add(this.Gh|0,this.Gl|0,p|0,m|0),{h:y,l:v}=Nt.add(this.Hh|0,this.Hl|0,y|0,v|0),this.set(r,i,a,o,s,l,c,u,f,h,d,g,p,m,y,v)}roundClean(){Gl.fill(0),Vl.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class ZY extends XY{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}const qY=kP(()=>new ZY),[jD,zD,HD]=[[],[],[]],eX=BigInt(0),$g=BigInt(1),tX=BigInt(2),nX=BigInt(7),rX=BigInt(256),iX=BigInt(113);for(let t=0,e=$g,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],jD.push(2*(5*r+n)),zD.push((t+1)*(t+2)/2%64);let i=eX;for(let a=0;a<7;a++)e=(e<<$g^(e>>nX)*iX)%rX,e&tX&&(i^=$g<<($g<n>32?UD(t,e,n):LD(t,e,n),IC=(t,e,n)=>n>32?FD(t,e,n):$D(t,e,n);function sX(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let o=0;o<10;o++)n[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const s=(o+8)%10,l=(o+2)%10,c=n[l],u=n[l+1],f=NC(c,u,1)^n[s],h=IC(c,u,1)^n[s+1];for(let d=0;d<50;d+=10)t[o+d]^=f,t[o+d+1]^=h}let i=t[2],a=t[3];for(let o=0;o<24;o++){const s=zD[o],l=NC(i,a,s),c=IC(i,a,s),u=jD[o];i=t[u],a=t[u+1],t[u]=l,t[u+1]=c}for(let o=0;o<50;o+=10){for(let s=0;s<10;s++)n[s]=t[o+s];for(let s=0;s<10;s++)t[o+s]^=~n[(s+2)%10]&n[(s+4)%10]}t[0]^=aX[r],t[1]^=oX[r]}n.fill(0)}class NP extends CP{constructor(e,n,r,i=!1,a=24){if(super(),this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=i,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Qw(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=AY(this.state)}keccak(){sX(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){bp(this);const{blockLen:n,state:r}=this;e=j2(e);const i=e.length;for(let a=0;a=r&&this.keccak();const o=Math.min(r-this.posOut,a-i);e.set(n.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Qw(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(ND(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:n,suffix:r,outputLen:i,rounds:a,enableXOF:o}=this;return e||(e=new NP(n,r,i,o,a)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=a,e.suffix=r,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const lX=(t,e,n)=>kP(()=>new NP(e,t,n)),GD=lX(1,136,256/8);let VD=!1;const QD=function(t){return GD(t)};let KD=QD;function Sn(t){const e=Jt(t,"data");return it(KD(e))}Sn._=QD;Sn.lock=function(){VD=!0};Sn.register=function(t){if(VD)throw new TypeError("keccak256 is locked");KD=t};Object.freeze(Sn);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const WD=BigInt(0),z2=BigInt(1),cX=BigInt(2),H2=t=>t instanceof Uint8Array,uX=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function wp(t){if(!H2(t))throw new Error("Uint8Array expected");let e="";for(let n=0;nr+i.length,0));let n=0;return t.forEach(r=>{if(!H2(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}function hX(t,e){if(t.length!==e.length)return!1;for(let n=0;nWD;t>>=z2,e+=1);return e}function gX(t,e){return t>>BigInt(e)&z2}const yX=(t,e,n)=>t|(n?z2:WD)<(cX<new Uint8Array(t),RC=t=>Uint8Array.from(t);function YD(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=L6(t),i=L6(t),a=0;const o=()=>{r.fill(1),i.fill(0),a=0},s=(...f)=>n(i,r,...f),l=(f=L6())=>{i=s(RC([0]),f),r=s(),f.length!==0&&(i=s(RC([1]),f),r=s())},c=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const h=[];for(;f{o(),l(f);let d;for(;!(d=h(c()));)l();return o(),d}}const mX={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function av(t,e,n={}){const r=(i,a,o)=>{const s=mX[a];if(typeof s!="function")throw new Error(`Invalid validator "${a}", expected function`);const l=t[i];if(!(o&&l===void 0)&&!s(l,t))throw new Error(`Invalid param ${String(i)}=${l} (${typeof l}), expected ${a}`)};for(const[i,a]of Object.entries(e))r(i,a,!1);for(const[i,a]of Object.entries(n))r(i,a,!0);return t}const vX=Object.freeze(Object.defineProperty({__proto__:null,bitGet:gX,bitLen:pX,bitMask:BP,bitSet:yX,bytesToHex:wp,bytesToNumberBE:jf,bytesToNumberLE:RP,concatBytes:s1,createHmacDrbg:YD,ensureBytes:io,equalBytes:hX,hexToBytes:xp,hexToNumber:IP,numberToBytesBE:Ap,numberToBytesLE:MP,numberToHexUnpadded:JD,numberToVarBytesBE:fX,utf8ToBytes:dX,validateObject:av},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const gr=BigInt(0),Yn=BigInt(1),Tu=BigInt(2),bX=BigInt(3),J5=BigInt(4),MC=BigInt(5),BC=BigInt(8);BigInt(9);BigInt(16);function Ti(t,e){const n=t%e;return n>=gr?n:e+n}function wX(t,e,n){if(n<=gr||e 0");if(n===Yn)return gr;let r=Yn;for(;e>gr;)e&Yn&&(r=r*t%n),t=t*t%n,e>>=Yn;return r}function ga(t,e,n){let r=t;for(;e-- >gr;)r*=r,r%=n;return r}function Y5(t,e){if(t===gr||e<=gr)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let n=Ti(t,e),r=e,i=gr,a=Yn;for(;n!==gr;){const s=r/n,l=r%n,c=i-a*s;r=n,n=l,i=a,a=c}if(r!==Yn)throw new Error("invert: does not exist");return Ti(i,e)}function xX(t){const e=(t-Yn)/Tu;let n,r,i;for(n=t-Yn,r=0;n%Tu===gr;n/=Tu,r++);for(i=Tu;i(r[i]="function",r),e);return av(t,n)}function PX(t,e,n){if(n 0");if(n===gr)return t.ONE;if(n===Yn)return e;let r=t.ONE,i=e;for(;n>gr;)n&Yn&&(r=t.mul(r,i)),i=t.sqr(i),n>>=Yn;return r}function OX(t,e){const n=new Array(e.length),r=e.reduce((a,o,s)=>t.is0(o)?a:(n[s]=a,t.mul(a,o)),t.ONE),i=t.inv(r);return e.reduceRight((a,o,s)=>t.is0(o)?a:(n[s]=t.mul(a,n[s]),t.mul(a,o)),i),n}function XD(t,e){const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function TX(t,e,n=!1,r={}){if(t<=gr)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:a}=XD(t,e);if(a>2048)throw new Error("Field lengths over 2048 bytes are not supported");const o=AX(t),s=Object.freeze({ORDER:t,BITS:i,BYTES:a,MASK:BP(i),ZERO:gr,ONE:Yn,create:l=>Ti(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return gr<=l&&ll===gr,isOdd:l=>(l&Yn)===Yn,neg:l=>Ti(-l,t),eql:(l,c)=>l===c,sqr:l=>Ti(l*l,t),add:(l,c)=>Ti(l+c,t),sub:(l,c)=>Ti(l-c,t),mul:(l,c)=>Ti(l*c,t),pow:(l,c)=>PX(s,l,c),div:(l,c)=>Ti(l*Y5(c,t),t),sqrN:l=>l*l,addN:(l,c)=>l+c,subN:(l,c)=>l-c,mulN:(l,c)=>l*c,inv:l=>Y5(l,t),sqrt:r.sqrt||(l=>o(s,l)),invertBatch:l=>OX(s,l),cmov:(l,c,u)=>u?c:l,toBytes:l=>n?MP(l,a):Ap(l,a),fromBytes:l=>{if(l.length!==a)throw new Error(`Fp.fromBytes: expected ${a}, got ${l.length}`);return n?RP(l):jf(l)}});return Object.freeze(s)}function ZD(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function qD(t){const e=ZD(t);return e+Math.ceil(e/2)}function CX(t,e,n=!1){const r=t.length,i=ZD(e),a=qD(e);if(r<16||r1024)throw new Error(`expected ${a}-1024 bytes of input, got ${r}`);const o=n?jf(t):RP(t),s=Ti(o,e-Yn)+Yn;return n?MP(s,i):Ap(s,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const kX=BigInt(0),$6=BigInt(1);function _X(t,e){const n=(i,a)=>{const o=a.negate();return i?o:a},r=i=>{const a=Math.ceil(e/i)+1,o=2**(i-1);return{windows:a,windowSize:o}};return{constTimeNegate:n,unsafeLadder(i,a){let o=t.ZERO,s=i;for(;a>kX;)a&$6&&(o=o.add(s)),s=s.double(),a>>=$6;return o},precomputeWindow(i,a){const{windows:o,windowSize:s}=r(a),l=[];let c=i,u=c;for(let f=0;f>=d,m>l&&(m-=h,o+=$6);const y=p,v=p+Math.abs(m)-1,x=g%2!==0,A=m<0;m===0?u=u.add(n(x,a[y])):c=c.add(n(A,a[v]))}return{p:c,f:u}},wNAFCached(i,a,o,s){const l=i._WINDOW_SIZE||1;let c=a.get(i);return c||(c=this.precomputeWindow(i,l),l!==1&&a.set(i,s(c))),this.wNAF(l,c,o)}}}function eL(t){return SX(t.Fp),av(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...XD(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function NX(t){const e=eL(t);av(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:i}=e;if(n){if(!r.eql(i,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:IX,hexToBytes:RX}=vX,Lu={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=Lu;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const n=t[1],r=t.subarray(2,n+2);if(!n||r.length!==n)throw new e("Invalid signature integer: wrong length");if(r[0]&128)throw new e("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:IX(r),l:t.subarray(n+2)}},toSig(t){const{Err:e}=Lu,n=typeof t=="string"?RX(t):t;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new e("Invalid signature tag");if(n[1]!==r-2)throw new e("Invalid signature: incorrect length");const{d:i,l:a}=Lu._parseInt(n.subarray(2)),{d:o,l:s}=Lu._parseInt(a);if(s.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:o}},hexFromSig(t){const e=c=>Number.parseInt(c[0],16)&8?"00"+c:c,n=c=>{const u=c.toString(16);return u.length&1?`0${u}`:u},r=e(n(t.s)),i=e(n(t.r)),a=r.length/2,o=i.length/2,s=n(a),l=n(o);return`30${n(o+a+4)}02${l}${i}02${s}${r}`}},rl=BigInt(0),Na=BigInt(1);BigInt(2);const DC=BigInt(3);BigInt(4);function MX(t){const e=NX(t),{Fp:n}=e,r=e.toBytes||((g,p,m)=>{const y=p.toAffine();return s1(Uint8Array.from([4]),n.toBytes(y.x),n.toBytes(y.y))}),i=e.fromBytes||(g=>{const p=g.subarray(1),m=n.fromBytes(p.subarray(0,n.BYTES)),y=n.fromBytes(p.subarray(n.BYTES,2*n.BYTES));return{x:m,y}});function a(g){const{a:p,b:m}=e,y=n.sqr(g),v=n.mul(y,g);return n.add(n.add(v,n.mul(g,p)),m)}if(!n.eql(n.sqr(e.Gy),a(e.Gx)))throw new Error("bad generator point: equation left != right");function o(g){return typeof g=="bigint"&&rln.eql(x,n.ZERO);return v(m)&&v(y)?f.ZERO:new f(m,y,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(p){const m=n.invertBatch(p.map(y=>y.pz));return p.map((y,v)=>y.toAffine(m[v])).map(f.fromAffine)}static fromHex(p){const m=f.fromAffine(i(io("pointHex",p)));return m.assertValidity(),m}static fromPrivateKey(p){return f.BASE.multiply(l(p))}_setWindowSize(p){this._WINDOW_SIZE=p,c.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:p,y:m}=this.toAffine();if(!n.isValid(p)||!n.isValid(m))throw new Error("bad point: x or y not FE");const y=n.sqr(m),v=a(p);if(!n.eql(y,v))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:p}=this.toAffine();if(n.isOdd)return!n.isOdd(p);throw new Error("Field doesn't support isOdd")}equals(p){u(p);const{px:m,py:y,pz:v}=this,{px:x,py:A,pz:S}=p,E=n.eql(n.mul(m,S),n.mul(x,v)),T=n.eql(n.mul(y,S),n.mul(A,v));return E&&T}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:p,b:m}=e,y=n.mul(m,DC),{px:v,py:x,pz:A}=this;let S=n.ZERO,E=n.ZERO,T=n.ZERO,C=n.mul(v,v),N=n.mul(x,x),B=n.mul(A,A),L=n.mul(v,x);return L=n.add(L,L),T=n.mul(v,A),T=n.add(T,T),S=n.mul(p,T),E=n.mul(y,B),E=n.add(S,E),S=n.sub(N,E),E=n.add(N,E),E=n.mul(S,E),S=n.mul(L,S),T=n.mul(y,T),B=n.mul(p,B),L=n.sub(C,B),L=n.mul(p,L),L=n.add(L,T),T=n.add(C,C),C=n.add(T,C),C=n.add(C,B),C=n.mul(C,L),E=n.add(E,C),B=n.mul(x,A),B=n.add(B,B),C=n.mul(B,L),S=n.sub(S,C),T=n.mul(B,N),T=n.add(T,T),T=n.add(T,T),new f(S,E,T)}add(p){u(p);const{px:m,py:y,pz:v}=this,{px:x,py:A,pz:S}=p;let E=n.ZERO,T=n.ZERO,C=n.ZERO;const N=e.a,B=n.mul(e.b,DC);let L=n.mul(m,x),U=n.mul(y,A),j=n.mul(v,S),Z=n.add(m,y),G=n.add(x,A);Z=n.mul(Z,G),G=n.add(L,U),Z=n.sub(Z,G),G=n.add(m,v);let H=n.add(x,S);return G=n.mul(G,H),H=n.add(L,j),G=n.sub(G,H),H=n.add(y,v),E=n.add(A,S),H=n.mul(H,E),E=n.add(U,j),H=n.sub(H,E),C=n.mul(N,G),E=n.mul(B,j),C=n.add(E,C),E=n.sub(U,C),C=n.add(U,C),T=n.mul(E,C),U=n.add(L,L),U=n.add(U,L),j=n.mul(N,j),G=n.mul(B,G),U=n.add(U,j),j=n.sub(L,j),j=n.mul(N,j),G=n.add(G,j),L=n.mul(U,G),T=n.add(T,L),L=n.mul(H,G),E=n.mul(Z,E),E=n.sub(E,L),L=n.mul(Z,U),C=n.mul(H,C),C=n.add(C,L),new f(E,T,C)}subtract(p){return this.add(p.negate())}is0(){return this.equals(f.ZERO)}wNAF(p){return d.wNAFCached(this,c,p,m=>{const y=n.invertBatch(m.map(v=>v.pz));return m.map((v,x)=>v.toAffine(y[x])).map(f.fromAffine)})}multiplyUnsafe(p){const m=f.ZERO;if(p===rl)return m;if(s(p),p===Na)return this;const{endo:y}=e;if(!y)return d.unsafeLadder(this,p);let{k1neg:v,k1:x,k2neg:A,k2:S}=y.splitScalar(p),E=m,T=m,C=this;for(;x>rl||S>rl;)x&Na&&(E=E.add(C)),S&Na&&(T=T.add(C)),C=C.double(),x>>=Na,S>>=Na;return v&&(E=E.negate()),A&&(T=T.negate()),T=new f(n.mul(T.px,y.beta),T.py,T.pz),E.add(T)}multiply(p){s(p);let m=p,y,v;const{endo:x}=e;if(x){const{k1neg:A,k1:S,k2neg:E,k2:T}=x.splitScalar(m);let{p:C,f:N}=this.wNAF(S),{p:B,f:L}=this.wNAF(T);C=d.constTimeNegate(A,C),B=d.constTimeNegate(E,B),B=new f(n.mul(B.px,x.beta),B.py,B.pz),y=C.add(B),v=N.add(L)}else{const{p:A,f:S}=this.wNAF(m);y=A,v=S}return f.normalizeZ([y,v])[0]}multiplyAndAddUnsafe(p,m,y){const v=f.BASE,x=(S,E)=>E===rl||E===Na||!S.equals(v)?S.multiplyUnsafe(E):S.multiply(E),A=x(this,m).add(x(p,y));return A.is0()?void 0:A}toAffine(p){const{px:m,py:y,pz:v}=this,x=this.is0();p==null&&(p=x?n.ONE:n.inv(v));const A=n.mul(m,p),S=n.mul(y,p),E=n.mul(v,p);if(x)return{x:n.ZERO,y:n.ZERO};if(!n.eql(E,n.ONE))throw new Error("invZ was invalid");return{x:A,y:S}}isTorsionFree(){const{h:p,isTorsionFree:m}=e;if(p===Na)return!0;if(m)return m(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:p,clearCofactor:m}=e;return p===Na?this:m?m(f,this):this.multiplyUnsafe(e.h)}toRawBytes(p=!0){return this.assertValidity(),r(f,this,p)}toHex(p=!0){return wp(this.toRawBytes(p))}}f.BASE=new f(e.Gx,e.Gy,n.ONE),f.ZERO=new f(n.ZERO,n.ONE,n.ZERO);const h=e.nBitLength,d=_X(f,e.endo?Math.ceil(h/2):h);return{CURVE:e,ProjectivePoint:f,normPrivateKeyToScalar:l,weierstrassEquation:a,isWithinCurveOrder:o}}function BX(t){const e=eL(t);return av(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function DX(t){const e=BX(t),{Fp:n,n:r}=e,i=n.BYTES+1,a=2*n.BYTES+1;function o(G){return rlwp(Ap(G,e.nByteLength));function g(G){const H=r>>Na;return G>H}function p(G){return g(G)?s(-G):G}const m=(G,H,re)=>jf(G.slice(H,re));class y{constructor(H,re,V){this.r=H,this.s=re,this.recovery=V,this.assertValidity()}static fromCompact(H){const re=e.nByteLength;return H=io("compactSignature",H,re*2),new y(m(H,0,re),m(H,re,2*re))}static fromDER(H){const{r:re,s:V}=Lu.toSig(io("DER",H));return new y(re,V)}assertValidity(){if(!h(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!h(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(H){return new y(this.r,this.s,H)}recoverPublicKey(H){const{r:re,s:V,recovery:ee}=this,pe=T(io("msgHash",H));if(ee==null||![0,1,2,3].includes(ee))throw new Error("recovery id invalid");const Ae=ee===2||ee===3?re+e.n:re;if(Ae>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const we=ee&1?"03":"02",Ye=c.fromHex(we+d(Ae)),nt=l(Ae),De=s(-pe*nt),st=s(V*nt),Tt=c.BASE.multiplyAndAddUnsafe(Ye,De,st);if(!Tt)throw new Error("point at infinify");return Tt.assertValidity(),Tt}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new y(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return xp(this.toDERHex())}toDERHex(){return Lu.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return xp(this.toCompactHex())}toCompactHex(){return d(this.r)+d(this.s)}}const v={isValidPrivateKey(G){try{return u(G),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const G=qD(e.n);return CX(e.randomBytes(G),e.n)},precompute(G=8,H=c.BASE){return H._setWindowSize(G),H.multiply(BigInt(3)),H}};function x(G,H=!0){return c.fromPrivateKey(G).toRawBytes(H)}function A(G){const H=G instanceof Uint8Array,re=typeof G=="string",V=(H||re)&&G.length;return H?V===i||V===a:re?V===2*i||V===2*a:G instanceof c}function S(G,H,re=!0){if(A(G))throw new Error("first arg must be private key");if(!A(H))throw new Error("second arg must be public key");return c.fromHex(H).multiply(u(G)).toRawBytes(re)}const E=e.bits2int||function(G){const H=jf(G),re=G.length*8-e.nBitLength;return re>0?H>>BigInt(re):H},T=e.bits2int_modN||function(G){return s(E(G))},C=BP(e.nBitLength);function N(G){if(typeof G!="bigint")throw new Error("bigint expected");if(!(rl<=G&&GEe in re))throw new Error("sign() legacy options not supported");const{hash:V,randomBytes:ee}=e;let{lowS:pe,prehash:Ae,extraEntropy:we}=re;pe==null&&(pe=!0),G=io("msgHash",G),Ae&&(G=io("prehashed msgHash",V(G)));const Ye=T(G),nt=u(H),De=[N(nt),N(Ye)];if(we!=null){const Ee=we===!0?ee(n.BYTES):we;De.push(io("extraEntropy",Ee))}const st=s1(...De),Tt=Ye;function ln(Ee){const ne=E(Ee);if(!h(ne))return;const le=l(ne),te=c.BASE.multiply(ne).toAffine(),Ce=s(te.x);if(Ce===rl)return;const Se=s(le*s(Tt+Ce*nt));if(Se===rl)return;let ze=(te.x===Ce?0:2)|Number(te.y&Na),$e=Se;return pe&&g(Se)&&($e=p(Se),ze^=1),new y(Ce,$e,ze)}return{seed:st,k2sig:ln}}const L={lowS:e.lowS,prehash:!1},U={lowS:e.lowS,prehash:!1};function j(G,H,re=L){const{seed:V,k2sig:ee}=B(G,H,re),pe=e;return YD(pe.hash.outputLen,pe.nByteLength,pe.hmac)(V,ee)}c.BASE._setWindowSize(8);function Z(G,H,re,V=U){var te;const ee=G;if(H=io("msgHash",H),re=io("publicKey",re),"strict"in V)throw new Error("options.strict was renamed to lowS");const{lowS:pe,prehash:Ae}=V;let we,Ye;try{if(typeof ee=="string"||ee instanceof Uint8Array)try{we=y.fromDER(ee)}catch(Ce){if(!(Ce instanceof Lu.Err))throw Ce;we=y.fromCompact(ee)}else if(typeof ee=="object"&&typeof ee.r=="bigint"&&typeof ee.s=="bigint"){const{r:Ce,s:Se}=ee;we=new y(Ce,Se)}else throw new Error("PARSE");Ye=c.fromHex(re)}catch(Ce){if(Ce.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(pe&&we.hasHighS())return!1;Ae&&(H=e.hash(H));const{r:nt,s:De}=we,st=T(H),Tt=l(De),ln=s(st*Tt),Ee=s(nt*Tt),ne=(te=c.BASE.multiplyAndAddUnsafe(Ye,ln,Ee))==null?void 0:te.toAffine();return ne?s(ne.x)===nt:!1}return{CURVE:e,getPublicKey:x,getSharedSecret:S,sign:j,verify:Z,ProjectivePoint:c,Signature:y,utils:v}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function LX(t){return{hash:t,hmac:(e,...n)=>_P(t,e,PY(...n)),randomBytes:OY}}function $X(t,e){const n=r=>DX({...t,...LX(r)});return Object.freeze({...n(e),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const tL=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),LC=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),UX=BigInt(1),X5=BigInt(2),$C=(t,e)=>(t+e/X5)/e;function FX(t){const e=tL,n=BigInt(3),r=BigInt(6),i=BigInt(11),a=BigInt(22),o=BigInt(23),s=BigInt(44),l=BigInt(88),c=t*t*t%e,u=c*c*t%e,f=ga(u,n,e)*u%e,h=ga(f,n,e)*u%e,d=ga(h,X5,e)*c%e,g=ga(d,i,e)*d%e,p=ga(g,a,e)*g%e,m=ga(p,s,e)*p%e,y=ga(m,l,e)*m%e,v=ga(y,s,e)*p%e,x=ga(v,n,e)*u%e,A=ga(x,o,e)*g%e,S=ga(A,r,e)*c%e,E=ga(S,X5,e);if(!Z5.eql(Z5.sqr(E),t))throw new Error("Cannot find square root");return E}const Z5=TX(tL,void 0,void 0,{sqrt:FX}),ri=$X({a:BigInt(0),b:BigInt(7),Fp:Z5,n:LC,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=LC,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-UX*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=n,o=BigInt("0x100000000000000000000000000000000"),s=$C(a*t,e),l=$C(-r*t,e);let c=Ti(t-s*n-l*i,e),u=Ti(-s*r-l*a,e);const f=c>o,h=u>o;if(f&&(c=e-c),h&&(u=e-u),c>o||u>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:f,k1:c,k2neg:h,k2:u}}}},IY);BigInt(0);ri.ProjectivePoint;const l1="0x0000000000000000000000000000000000000000",UC="0x0000000000000000000000000000000000000000000000000000000000000000",FC=BigInt(0),jC=BigInt(1),zC=BigInt(2),HC=BigInt(27),GC=BigInt(28),Kv=BigInt(35),Th={};function VC(t){return nh(oi(t),32)}var Gd,Vd,Qd,tf,na;let Al=(na=class{constructor(e,n,r,i){M(this,Gd,void 0);M(this,Vd,void 0);M(this,Qd,void 0);M(this,tf,void 0);L2(e,Th,"Signature"),O(this,Gd,n),O(this,Vd,r),O(this,Qd,i),O(this,tf,null)}get r(){return b(this,Gd)}set r(e){K(Td(e)===32,"invalid r","value",e),O(this,Gd,it(e))}get s(){return b(this,Vd)}set s(e){K(Td(e)===32,"invalid s","value",e);const n=it(e);K(parseInt(n.substring(0,3))<8,"non-canonical s","value",n),O(this,Vd,n)}get v(){return b(this,Qd)}set v(e){const n=Bt(e,"value");K(n===27||n===28,"invalid v","v",e),O(this,Qd,n)}get networkV(){return b(this,tf)}get legacyChainId(){const e=this.networkV;return e==null?null:na.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=Jt(this.s);return this.yParity&&(e[0]|=128),it(e)}get compactSerialized(){return Zn([this.r,this.yParityAndS])}get serialized(){return Zn([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new na(Th,this.r,this.s,this.v);return this.networkV&&O(e,tf,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const n=et(e,"v");return n==HC||n==GC?FC:(K(n>=Kv,"invalid EIP-155 v","v",e),(n-Kv)/zC)}static getChainIdV(e,n){return et(e)*zC+BigInt(35+n-27)}static getNormalizedV(e){const n=et(e);return n===FC||n===HC?27:n===jC||n===GC?28:(K(n>=Kv,"invalid v","v",e),n&jC?27:28)}static from(e){function n(c,u){K(c,u,"signature",e)}if(e==null)return new na(Th,UC,UC,27);if(typeof e=="string"){const c=Jt(e,"signature");if(c.length===64){const u=it(c.slice(0,32)),f=c.slice(32,64),h=f[0]&128?28:27;return f[0]&=127,new na(Th,u,it(f),h)}if(c.length===65){const u=it(c.slice(0,32)),f=c.slice(32,64);n((f[0]&128)===0,"non-canonical s");const h=na.getNormalizedV(c[64]);return new na(Th,u,it(f),h)}n(!1,"invalid raw signature length")}if(e instanceof na)return e.clone();const r=e.r;n(r!=null,"missing r");const i=VC(r),a=function(c,u){if(c!=null)return VC(c);if(u!=null){n(gn(u,32),"invalid yParityAndS");const f=Jt(u);return f[0]&=127,it(f)}n(!1,"missing s")}(e.s,e.yParityAndS);n((Jt(a)[0]&128)==0,"non-canonical s");const{networkV:o,v:s}=function(c,u,f){if(c!=null){const h=et(c);return{networkV:h>=Kv?h:void 0,v:na.getNormalizedV(h)}}if(u!=null)return n(gn(u,32),"invalid yParityAndS"),{v:Jt(u)[0]&128?28:27};if(f!=null){switch(Bt(f,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}n(!1,"invalid yParity")}n(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),l=new na(Th,i,a,s);return o&&O(l,tf,o),n(e.yParity==null||Bt(e.yParity,"sig.yParity")===l.yParity,"yParity mismatch"),n(e.yParityAndS==null||e.yParityAndS===l.yParityAndS,"yParityAndS mismatch"),l}},Gd=new WeakMap,Vd=new WeakMap,Qd=new WeakMap,tf=new WeakMap,na);var Bs,il;let DP=(il=class{constructor(e){M(this,Bs,void 0);K(Td(e)===32,"invalid private key","privateKey","[REDACTED]"),O(this,Bs,it(e))}get privateKey(){return b(this,Bs)}get publicKey(){return il.computePublicKey(b(this,Bs))}get compressedPublicKey(){return il.computePublicKey(b(this,Bs),!0)}sign(e){K(Td(e)===32,"invalid digest length","digest",e);const n=ri.sign(ai(e),ai(b(this,Bs)),{lowS:!0});return Al.from({r:us(n.r,32),s:us(n.s,32),v:n.recovery?28:27})}computeSharedSecret(e){const n=il.computePublicKey(e);return it(ri.getSharedSecret(ai(b(this,Bs)),Jt(n),!1))}static computePublicKey(e,n){let r=Jt(e,"key");if(r.length===32){const a=ri.getPublicKey(r,!!n);return it(a)}if(r.length===64){const a=new Uint8Array(65);a[0]=4,a.set(r,1),r=a}const i=ri.ProjectivePoint.fromHex(r);return it(i.toRawBytes(n))}static recoverPublicKey(e,n){K(Td(e)===32,"invalid digest length","digest",e);const r=Al.from(n);let i=ri.Signature.fromCompact(ai(Zn([r.r,r.s])));i=i.addRecoveryBit(r.yParity);const a=i.recoverPublicKey(ai(e));return K(a!=null,"invalid signautre for digest","signature",n),"0x"+a.toHex(!1)}static addPoints(e,n,r){const i=ri.ProjectivePoint.fromHex(il.computePublicKey(e).substring(2)),a=ri.ProjectivePoint.fromHex(il.computePublicKey(n).substring(2));return"0x"+i.add(a).toHex(!!r)}},Bs=new WeakMap,il);const jX=BigInt(0),zX=BigInt(36);function QC(t){t=t.toLowerCase();const e=t.substring(2).split(""),n=new Uint8Array(40);for(let i=0;i<40;i++)n[i]=e[i].charCodeAt(0);const r=Jt(Sn(n));for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(r[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const LP={};for(let t=0;t<10;t++)LP[String(t)]=String(t);for(let t=0;t<26;t++)LP[String.fromCharCode(65+t)]=String(10+t);const KC=15;function HX(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(r=>LP[r]).join("");for(;e.length>=KC;){let r=e.substring(0,KC);e=parseInt(r,10)%97+e.substring(r.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}const GX=function(){const t={};for(let e=0;e<36;e++){const n="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[n]=BigInt(e)}return t}();function VX(t){t=t.toLowerCase();let e=jX;for(let n=0;ne.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 this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return b(this,nf)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return b(this,nf)===!0?-1:b(this,nf)===!1?this.value.length:null}static from(e,n){return new yo(As,e,n)}static uint8(e){return Ve(e,8)}static uint16(e){return Ve(e,16)}static uint24(e){return Ve(e,24)}static uint32(e){return Ve(e,32)}static uint40(e){return Ve(e,40)}static uint48(e){return Ve(e,48)}static uint56(e){return Ve(e,56)}static uint64(e){return Ve(e,64)}static uint72(e){return Ve(e,72)}static uint80(e){return Ve(e,80)}static uint88(e){return Ve(e,88)}static uint96(e){return Ve(e,96)}static uint104(e){return Ve(e,104)}static uint112(e){return Ve(e,112)}static uint120(e){return Ve(e,120)}static uint128(e){return Ve(e,128)}static uint136(e){return Ve(e,136)}static uint144(e){return Ve(e,144)}static uint152(e){return Ve(e,152)}static uint160(e){return Ve(e,160)}static uint168(e){return Ve(e,168)}static uint176(e){return Ve(e,176)}static uint184(e){return Ve(e,184)}static uint192(e){return Ve(e,192)}static uint200(e){return Ve(e,200)}static uint208(e){return Ve(e,208)}static uint216(e){return Ve(e,216)}static uint224(e){return Ve(e,224)}static uint232(e){return Ve(e,232)}static uint240(e){return Ve(e,240)}static uint248(e){return Ve(e,248)}static uint256(e){return Ve(e,256)}static uint(e){return Ve(e,256)}static int8(e){return Ve(e,-8)}static int16(e){return Ve(e,-16)}static int24(e){return Ve(e,-24)}static int32(e){return Ve(e,-32)}static int40(e){return Ve(e,-40)}static int48(e){return Ve(e,-48)}static int56(e){return Ve(e,-56)}static int64(e){return Ve(e,-64)}static int72(e){return Ve(e,-72)}static int80(e){return Ve(e,-80)}static int88(e){return Ve(e,-88)}static int96(e){return Ve(e,-96)}static int104(e){return Ve(e,-104)}static int112(e){return Ve(e,-112)}static int120(e){return Ve(e,-120)}static int128(e){return Ve(e,-128)}static int136(e){return Ve(e,-136)}static int144(e){return Ve(e,-144)}static int152(e){return Ve(e,-152)}static int160(e){return Ve(e,-160)}static int168(e){return Ve(e,-168)}static int176(e){return Ve(e,-176)}static int184(e){return Ve(e,-184)}static int192(e){return Ve(e,-192)}static int200(e){return Ve(e,-200)}static int208(e){return Ve(e,-208)}static int216(e){return Ve(e,-216)}static int224(e){return Ve(e,-224)}static int232(e){return Ve(e,-232)}static int240(e){return Ve(e,-240)}static int248(e){return Ve(e,-248)}static int256(e){return Ve(e,-256)}static int(e){return Ve(e,-256)}static bytes1(e){return Zt(e,1)}static bytes2(e){return Zt(e,2)}static bytes3(e){return Zt(e,3)}static bytes4(e){return Zt(e,4)}static bytes5(e){return Zt(e,5)}static bytes6(e){return Zt(e,6)}static bytes7(e){return Zt(e,7)}static bytes8(e){return Zt(e,8)}static bytes9(e){return Zt(e,9)}static bytes10(e){return Zt(e,10)}static bytes11(e){return Zt(e,11)}static bytes12(e){return Zt(e,12)}static bytes13(e){return Zt(e,13)}static bytes14(e){return Zt(e,14)}static bytes15(e){return Zt(e,15)}static bytes16(e){return Zt(e,16)}static bytes17(e){return Zt(e,17)}static bytes18(e){return Zt(e,18)}static bytes19(e){return Zt(e,19)}static bytes20(e){return Zt(e,20)}static bytes21(e){return Zt(e,21)}static bytes22(e){return Zt(e,22)}static bytes23(e){return Zt(e,23)}static bytes24(e){return Zt(e,24)}static bytes25(e){return Zt(e,25)}static bytes26(e){return Zt(e,26)}static bytes27(e){return Zt(e,27)}static bytes28(e){return Zt(e,28)}static bytes29(e){return Zt(e,29)}static bytes30(e){return Zt(e,30)}static bytes31(e){return Zt(e,31)}static bytes32(e){return Zt(e,32)}static address(e){return new yo(As,"address",e)}static bool(e){return new yo(As,"bool",!!e)}static bytes(e){return new yo(As,"bytes",e)}static string(e){return new yo(As,"string",e)}static array(e,n){throw new Error("not implemented yet")}static tuple(e,n){throw new Error("not implemented yet")}static overrides(e){return new yo(As,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===WC}static dereference(e,n){if(yo.isTyped(e)){if(e.type!==n)throw new Error(`invalid type: expecetd ${n}, got ${e.type}`);return e.value}return e}},nf=new WeakMap,yo),QX=class extends Il{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,n){let r=Di.dereference(n,"string");try{r=fn(r)}catch(i){return this._throwError(i.message,n)}return e.writeValue(r)}decode(e){return fn(us(e.readValue(),20))}},KX=class extends Il{constructor(n){super(n.name,n.type,"_",n.dynamic);R(this,"coder");this.coder=n}defaultValue(){return this.coder.defaultValue()}encode(n,r){return this.coder.encode(n,r)}decode(n){return this.coder.decode(n)}};function iL(t,e,n){let r=[];if(Array.isArray(n))r=n;else if(n&&typeof n=="object"){let l={};r=e.map(c=>{const u=c.localName;return ye(u,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:c},value:n}),ye(!l[u],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:c},value:n}),l[u]=!0,n[u]})}else K(!1,"invalid tuple value","tuple",n);K(e.length===r.length,"types/value length mismatch","tuple",n);let i=new Q5,a=new Q5,o=[];e.forEach((l,c)=>{let u=r[c];if(l.dynamic){let f=a.length;l.encode(a,u);let h=i.writeUpdatableValue();o.push(d=>{h(d+f)})}else l.encode(i,u)}),o.forEach(l=>{l(i.length)});let s=t.appendWriter(i);return s+=t.appendWriter(a),s}function aL(t,e){let n=[],r=[],i=t.subReader(0);return e.forEach(a=>{let o=null;if(a.dynamic){let s=t.readIndex(),l=i.subReader(s);try{o=a.decode(l)}catch(c){if(Qr(c,"BUFFER_OVERRUN"))throw c;o=c,o.baseType=a.name,o.name=a.localName,o.type=a.type}}else try{o=a.decode(t)}catch(s){if(Qr(s,"BUFFER_OVERRUN"))throw s;o=s,o.baseType=a.name,o.name=a.localName,o.type=a.type}if(o==null)throw new Error("investigate");n.push(o),r.push(a.localName||null)}),kD.fromItems(n,r)}let WX=class extends Il{constructor(n,r,i){const a=n.type+"["+(r>=0?r:"")+"]",o=r===-1||n.dynamic;super("array",a,i,o);R(this,"coder");R(this,"length");gt(this,{coder:n,length:r})}defaultValue(){const n=this.coder.defaultValue(),r=[];for(let i=0;io||i<-(o+tZ))&&this._throwError("value out-of-bounds",r),i=wD(i,8*si)}else(iey(a,this.size*8))&&this._throwError("value out-of-bounds",r);return n.writeValue(i)}decode(n){let r=ey(n.readValue(),this.size*8);return this.signed&&(r=tY(r,this.size*8)),r}},iZ=class extends oL{constructor(e){super("string",e)}defaultValue(){return""}encode(e,n){return super.encode(e,fl(Di.dereference(n,"string")))}decode(e){return Vw(super.decode(e))}},Wv=class extends Il{constructor(n,r){let i=!1;const a=[];n.forEach(s=>{s.dynamic&&(i=!0),a.push(s.type)});const o="tuple("+a.join(",")+")";super("tuple",o,r,i);R(this,"coders");gt(this,{coders:Object.freeze(n.slice())})}defaultValue(){const n=[];this.coders.forEach(i=>{n.push(i.defaultValue())});const r=this.coders.reduce((i,a)=>{const o=a.localName;return o&&(i[o]||(i[o]=0),i[o]++),i},{});return this.coders.forEach((i,a)=>{let o=i.localName;!o||r[o]!==1||(o==="length"&&(o="_length"),n[o]==null&&(n[o]=n[a]))}),Object.freeze(n)}encode(n,r){const i=Di.dereference(r,"tuple");return iL(n,this.coders,i)}decode(n){return aL(n,this.coders)}};function ih(t){return Sn(fl(t))}var aZ="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwA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FEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const JC=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),YC=4;function oZ(t){let e=0;function n(){return t[e++]<<8|t[e++]}let r=n(),i=1,a=[0,1];for(let S=1;S>--l&1}const f=31,h=2**f,d=h>>>1,g=d>>1,p=h-1;let m=0;for(let S=0;S1;){let B=E+T>>>1;S>>1|u(),C=C<<1^d,N=(N^d)<<1|d|1;v=C,x=1+N-C}let A=r-4;return y.map(S=>{switch(S-A){case 3:return A+65792+(t[s++]<<16|t[s++]<<8|t[s++]);case 2:return A+256+(t[s++]<<8|t[s++]);case 1:return A+t[s++];default:return S-1}})}function sZ(t){let e=0;return()=>t[e++]}function sL(t){return sZ(oZ(lZ(t)))}function lZ(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,a)=>e[i.charCodeAt(0)]=a);let n=t.length,r=new Uint8Array(6*n>>3);for(let i=0,a=0,o=0,s=0;i=8&&(r[a++]=s>>(o-=8));return r}function cZ(t){return t&1?~t>>1:t>>1}function uZ(t,e){let n=Array(t);for(let r=0,i=0;r{let e=c1(t);if(e.length)return e})}function cL(t){let e=[];for(;;){let n=t();if(n==0)break;e.push(fZ(n,t))}for(;;){let n=t()-1;if(n<0)break;e.push(hZ(n,t))}return e.flat()}function u1(t){let e=[];for(;;){let n=t(e.length);if(!n)break;e.push(n)}return e}function uL(t,e,n){let r=Array(t).fill().map(()=>[]);for(let i=0;ir[o].push(a));return r}function fZ(t,e){let n=1+e(),r=e(),i=u1(e);return uL(i.length,1+t,e).flatMap((o,s)=>{let[l,...c]=o;return Array(i[s]).fill().map((u,f)=>{let h=f*r;return[l+f*n,c.map(d=>d+h)]})})}function hZ(t,e){let n=1+e();return uL(n,1+t,e).map(i=>[i[0],i.slice(1)])}function dZ(t){let e=[],n=c1(t);return i(r([]),[]),e;function r(a){let o=t(),s=u1(()=>{let l=c1(t).map(c=>n[c]);if(l.length)return r(l)});return{S:o,B:s,Q:a}}function i({S:a,B:o},s,l){if(!(a&4&&l===s[s.length-1])){a&2&&(l=s[s.length-1]),a&1&&e.push(s);for(let c of o)for(let u of c.Q)i(c,[...s,u],l)}}}function pZ(t){return t.toString(16).toUpperCase().padStart(2,"0")}function fL(t){return`{${pZ(t)}}`}function gZ(t){let e=[];for(let n=0,r=t.length;n>24&255}function pL(t){return t&16777215}let q5,XC,e3,zb;function EZ(){let t=sL(mZ);q5=new Map(lL(t).flatMap((e,n)=>e.map(r=>[r,n+1<<24]))),XC=new Set(c1(t)),e3=new Map,zb=new Map;for(let[e,n]of cL(t)){if(!XC.has(e)&&n.length==2){let[r,i]=n,a=zb.get(r);a||(a=new Map,zb.set(r,a)),a.set(i,e)}e3.set(e,n.reverse())}}function gL(t){return t>=f1&&t=Kw&&t=Ww&&eJw&&e0&&i(Jw+c)}else{let o=e3.get(a);o?n.push(...o):i(a)}if(!n.length)break;a=n.pop()}if(r&&e.length>1){let a=ny(e[0]);for(let o=1;o0&&i>=o)o==0?(e.push(r,...n),n.length=0,r=s):n.push(s),i=o;else{let l=SZ(r,s);l>=0?r=l:i==0&&o==0?(e.push(r),r=s):(n.push(s),i=o)}}return r>=0&&e.push(r,...n),e}function mL(t){return yL(t).map(pL)}function OZ(t){return PZ(yL(t))}const ZC=45,vL=".",bL=65039,wL=1,Xw=t=>Array.from(t);function h1(t,e){return t.P.has(e)||t.Q.has(e)}let TZ=class extends Array{get is_emoji(){return!0}},t3,xL,$u,n3,AL,kd,F6,Dh,Au,qC,r3;function $P(){if(t3)return;let t=sL(aZ);const e=()=>c1(t),n=()=>new Set(e()),r=(u,f)=>f.forEach(h=>u.add(h));t3=new Map(cL(t)),xL=n(),$u=e(),n3=new Set(e().map(u=>$u[u])),$u=new Set($u),AL=n(),n();let i=lL(t),a=t();const o=()=>{let u=new Set;return e().forEach(f=>r(u,i[f])),r(u,e()),u};kd=u1(u=>{let f=u1(t).map(h=>h+96);if(f.length){let h=u>=a;f[0]-=32,f=Ep(f),h&&(f=`Restricted[${f}]`);let d=o(),g=o(),p=!t();return{N:f,P:d,Q:g,M:p,R:h}}}),F6=n(),Dh=new Map;let s=e().concat(Xw(F6)).sort((u,f)=>u-f);s.forEach((u,f)=>{let h=t(),d=s[f]=h?s[f-h]:{V:[],M:new Map};d.V.push(u),F6.has(u)||Dh.set(u,d)});for(let{V:u,M:f}of new Set(Dh.values())){let h=[];for(let g of u){let p=kd.filter(y=>h1(y,g)),m=h.find(({G:y})=>p.some(v=>y.has(v)));m||(m={G:new Set,V:[]},h.push(m)),m.V.push(g),r(m.G,p)}let d=h.flatMap(g=>Xw(g.G));for(let{G:g,V:p}of h){let m=new Set(d.filter(y=>!g.has(y)));for(let y of p)f.set(y,m)}}Au=new Set;let l=new Set;const c=u=>Au.has(u)?l.add(u):Au.add(u);for(let u of kd){for(let f of u.P)c(f);for(let f of u.Q)c(f)}for(let u of Au)!Dh.has(u)&&!l.has(u)&&Dh.set(u,wL);r(Au,mL(Au)),qC=dZ(t).map(u=>TZ.from(u)).sort(yZ),r3=new Map;for(let u of qC){let f=[r3];for(let h of u){let d=f.map(g=>{let p=g.get(h);return p||(p=new Map,g.set(h,p)),p});h===bL?f.push(...d):f=d}for(let h of f)h.V=u}}function UP(t){return(EL(t)?"":`${FP(G2([t]))} `)+fL(t)}function FP(t){return`"${t}"‎`}function CZ(t){if(t.length>=4&&t[2]==ZC&&t[3]==ZC)throw new Error(`invalid label extension: "${Ep(t.slice(0,4))}"`)}function kZ(t){for(let n=t.lastIndexOf(95);n>0;)if(t[--n]!==95)throw new Error("underscore allowed only at start")}function _Z(t){let e=t[0],n=JC.get(e);if(n)throw Ty(`leading ${n}`);let r=t.length,i=-1;for(let a=1;ae&&(e>>=1,t=[...t.slice(0,e),8230,...t.slice(-e)]);let i=0,a=t.length;for(let o=0;o{let a=gZ(i),o={input:a,offset:r};r+=a.length+1;try{let s=o.tokens=$Z(a,e,n),l=s.length,c;if(!l)throw new Error("empty label");let u=o.output=s.flat();if(kZ(u),!(o.emoji=l>1||s[0].is_emoji)&&u.every(h=>h<128))CZ(u),c="ASCII";else{let h=s.flatMap(d=>d.is_emoji?[]:d);if(!h.length)c="Emoji";else{if($u.has(u[0]))throw Ty("leading combining mark");for(let p=1;po.has(s)):Xw(o),!n.length)return}else r.push(i)}if(n){for(let i of n)if(r.every(a=>h1(i,a)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function BZ(t){let e=kd;for(let n of t){let r=e.filter(i=>h1(i,n));if(!r.length)throw kd.some(i=>h1(i,n))?PL(e[0],n):SL(n);if(e=r,r.length==1)break}return e}function DZ(t){return t.map(({input:e,error:n,output:r})=>{if(n){let i=n.message;throw new Error(t.length==1?i:`Invalid label ${FP(G2(e,63))}: ${i}`)}return Ep(r)}).join(vL)}function SL(t){return new Error(`disallowed character: ${UP(t)}`)}function PL(t,e){let n=UP(e),r=kd.find(i=>i.P.has(e));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${t.N} + ${n}`)}function Ty(t){return new Error(`illegal placement: ${t}`)}function LZ(t,e){for(let n of e)if(!h1(t,n))throw PL(t,n);if(t.M){let n=mL(e);for(let r=1,i=n.length;rYC)throw new Error(`excessive non-spacing marks: ${FP(G2(n.slice(r-1,a)))} (${a-r}/${YC})`);r=a}}}function $Z(t,e,n){let r=[],i=[];for(t=t.slice().reverse();t.length;){let a=FZ(t);if(a)i.length&&(r.push(e(i)),i=[]),r.push(n(a));else{let o=t.pop();if(Au.has(o))i.push(o);else{let s=t3.get(o);if(s)i.push(...s);else if(!xL.has(o))throw SL(o)}}}return i.length&&r.push(e(i)),r}function UZ(t){return t.filter(e=>e!=bL)}function FZ(t,e){let n=r3,r,i=t.length;for(;i&&(n=n.get(t[--i]),!!n);){let{V:a}=n;a&&(r=a,e&&e.push(...t.slice(i).reverse()),t.length=i)}return r}const OL=new Uint8Array(32);OL.fill(0);function ek(t){return K(t.length!==0,"invalid ENS name; empty component","comp",t),t}function TL(t){const e=fl(jZ(t)),n=[];if(t.length===0)return n;let r=0;for(let i=0;i{K(r.length<=n,`label ${JSON.stringify(t)} exceeds ${n} bytes`,"name",t);const i=new Uint8Array(r.length+1);return i.set(r,1),i[0]=i.length-1,i})))+"00"}function j6(t,e){return{address:fn(t),storageKeys:e.map((n,r)=>(K(gn(n,32),"invalid slot",`storageKeys[${r}]`,n),n.toLowerCase()))}}function gh(t){if(Array.isArray(t))return t.map((n,r)=>Array.isArray(n)?(K(n.length===2,"invalid slot set",`value[${r}]`,n),j6(n[0],n[1])):(K(n!=null&&typeof n=="object","invalid address-slot set","value",t),j6(n.address,n.storageKeys)));K(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(n=>{const r=t[n].reduce((i,a)=>(i[a]=!0,i),{});return j6(n,Object.keys(r).sort())});return e.sort((n,r)=>n.address.localeCompare(r.address)),e}function HZ(t){let e;return typeof t=="string"?e=DP.computePublicKey(t,!1):e=t.publicKey,fn(Sn("0x"+e.substring(4)).substring(26))}function GZ(t,e){return HZ(DP.recoverPublicKey(t,e))}const pr=BigInt(0),VZ=BigInt(2),QZ=BigInt(27),KZ=BigInt(28),WZ=BigInt(35),JZ=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function V2(t){return t==="0x"?null:fn(t)}function jP(t,e){try{return gh(t)}catch(n){K(!1,n.message,e,t)}}function ov(t,e){return t==="0x"?0:Bt(t,e)}function Xn(t,e){if(t==="0x")return pr;const n=et(t,e);return K(n<=JZ,"value exceeds uint size",e,n),n}function wn(t,e){const n=et(t,"value"),r=oi(n);return K(r.length<=32,"value too large",`tx.${e}`,n),r}function zP(t){return gh(t).map(e=>[e.address,e.storageKeys])}function YZ(t,e){K(Array.isArray(t),`invalid ${e}`,"value",t);for(let n=0;n=0?2:e.pop()}inferTypes(){const e=this.gasPrice!=null,n=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,r=this.accessList!=null,i=b(this,rf)!=null||b(this,af);this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&ye(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),ye(!n||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),ye(this.type!==0||!r,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const a=[];return this.type!=null?a.push(this.type):n?a.push(2):e?(a.push(1),r||a.push(0)):r?(a.push(1),a.push(2)):(i&&this.to||(a.push(0),a.push(1),a.push(2)),a.push(3)),a.sort(),a}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return mo.from(this)}toJSON(){const e=n=>n==null?null:n.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new mo;if(typeof e=="string"){const r=Jt(e);if(r[0]>=127)return mo.from(XZ(r));switch(r[0]){case 1:return mo.from(qZ(r));case 2:return mo.from(ZZ(r));case 3:return mo.from(eq(r))}ye(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const n=new mo;return e.type!=null&&(n.type=e.type),e.to!=null&&(n.to=e.to),e.nonce!=null&&(n.nonce=e.nonce),e.gasLimit!=null&&(n.gasLimit=e.gasLimit),e.gasPrice!=null&&(n.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(n.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(n.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(n.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(n.data=e.data),e.value!=null&&(n.value=e.value),e.chainId!=null&&(n.chainId=e.chainId),e.signature!=null&&(n.signature=Al.from(e.signature)),e.accessList!=null&&(n.accessList=e.accessList),e.blobVersionedHashes!=null&&(n.blobVersionedHashes=e.blobVersionedHashes),e.hash!=null&&(K(n.isSigned(),"unsigned transaction cannot define hash","tx",e),K(n.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(K(n.isSigned(),"unsigned transaction cannot define from","tx",e),K(n.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),n}},$o=new WeakMap,Kd=new WeakMap,Wd=new WeakMap,Jd=new WeakMap,Yd=new WeakMap,Xd=new WeakMap,Zd=new WeakMap,qd=new WeakMap,e0=new WeakMap,t0=new WeakMap,n0=new WeakMap,r0=new WeakMap,rf=new WeakMap,af=new WeakMap,mo);const kL=new Uint8Array(32);kL.fill(0);const tq=BigInt(-1),_L=BigInt(0),NL=BigInt(1),nq=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function rq(t){const e=Jt(t),n=e.length%32;return n?Zn([e,kL.slice(n)]):it(e)}const iq=us(NL,32),aq=us(_L,32),ak={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},z6=["name","version","chainId","verifyingContract","salt"];function ok(t){return function(e){return K(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const oq={name:ok("name"),version:ok("version"),chainId:function(t){const e=et(t,"domain.chainId");return K(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):fd(e)},verifyingContract:function(t){try{return fn(t).toLowerCase()}catch{}K(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=Jt(t,"domain.salt");return K(e.length===32,'invalid domain value "salt"',"domain.salt",t),it(e)}};function H6(t){{const e=t.match(/^(u?)int(\d+)$/);if(e){const n=e[1]==="",r=parseInt(e[2]);K(r%8===0&&r!==0&&r<=256&&e[2]===String(r),"invalid numeric width","type",t);const i=ey(nq,n?r-1:r),a=n?(i+NL)*tq:_L;return function(o){const s=et(o,"value");return K(s>=a&&s<=i,`value out-of-bounds for ${t}`,"value",s),us(n?wD(s,256):s,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const n=parseInt(e[1]);return K(n!==0&&n<=32&&e[1]===String(n),"invalid bytes width","type",t),function(r){const i=Jt(r);return K(i.length===n,`invalid length for ${t}`,"value",r),rq(r)}}}switch(t){case"address":return function(e){return nh(fn(e),32)};case"bool":return function(e){return e?iq:aq};case"bytes":return function(e){return Sn(e)};case"string":return function(e){return ih(e)}}return null}function sk(t,e){return`${t}(${e.map(({name:n,type:r})=>r+" "+n).join(",")})`}function Jv(t){const e=t.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:t}}var ym,Ds,i0,o2,IL,Pi;let lk=(Pi=class{constructor(e){M(this,o2);R(this,"primaryType");M(this,ym,void 0);M(this,Ds,void 0);M(this,i0,void 0);O(this,Ds,new Map),O(this,i0,new Map);const n=new Map,r=new Map,i=new Map,a={};Object.keys(e).forEach(l=>{a[l]=e[l].map(({name:c,type:u})=>{let{base:f,index:h}=Jv(u);return f==="int"&&!e.int&&(f="int256"),f==="uint"&&!e.uint&&(f="uint256"),{name:c,type:f+(h||"")}}),n.set(l,new Set),r.set(l,[]),i.set(l,new Set)}),O(this,ym,JSON.stringify(a));for(const l in a){const c=new Set;for(const u of a[l]){K(!c.has(u.name),`duplicate variable name ${JSON.stringify(u.name)} in ${JSON.stringify(l)}`,"types",e),c.add(u.name);const f=Jv(u.type).base;K(f!==l,`circular type reference to ${JSON.stringify(f)}`,"types",e),!H6(f)&&(K(r.has(f),`unknown type ${JSON.stringify(f)}`,"types",e),r.get(f).push(l),n.get(l).add(f))}}const o=Array.from(r.keys()).filter(l=>r.get(l).length===0);K(o.length!==0,"missing primary type","types",e),K(o.length===1,`ambiguous primary types or unused types: ${o.map(l=>JSON.stringify(l)).join(", ")}`,"types",e),gt(this,{primaryType:o[0]});function s(l,c){K(!c.has(l),`circular type reference to ${JSON.stringify(l)}`,"types",e),c.add(l);for(const u of n.get(l))if(r.has(u)){s(u,c);for(const f of c)i.get(f).add(u)}c.delete(l)}s(this.primaryType,new Set);for(const[l,c]of i){const u=Array.from(c);u.sort(),b(this,Ds).set(l,sk(l,a[l])+u.map(f=>sk(f,a[f])).join(""))}}get types(){return JSON.parse(b(this,ym))}getEncoder(e){let n=b(this,i0).get(e);return n||(n=ie(this,o2,IL).call(this,e),b(this,i0).set(e,n)),n}encodeType(e){const n=b(this,Ds).get(e);return K(n,`unknown type: ${JSON.stringify(e)}`,"name",e),n}encodeData(e,n){return this.getEncoder(e)(n)}hashStruct(e,n){return Sn(this.encodeData(e,n))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,n,r){if(H6(e))return r(e,n);const i=Jv(e).array;if(i)return K(i.count===-1||i.count===n.length,`array length mismatch; expected length ${i.count}`,"value",n),n.map(o=>this._visit(i.prefix,o,r));const a=this.types[e];if(a)return a.reduce((o,{name:s,type:l})=>(o[s]=this._visit(l,n[s],r),o),{});K(!1,`unknown type: ${e}`,"type",e)}visit(e,n){return this._visit(this.primaryType,e,n)}static from(e){return new Pi(e)}static getPrimaryType(e){return Pi.from(e).primaryType}static hashStruct(e,n,r){return Pi.from(n).hashStruct(e,r)}static hashDomain(e){const n=[];for(const r in e){if(e[r]==null)continue;const i=ak[r];K(i,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),n.push({name:r,type:i})}return n.sort((r,i)=>z6.indexOf(r.name)-z6.indexOf(i.name)),Pi.hashStruct("EIP712Domain",{EIP712Domain:n},e)}static encode(e,n,r){return Zn(["0x1901",Pi.hashDomain(e),Pi.from(n).hash(r)])}static hash(e,n,r){return Sn(Pi.encode(e,n,r))}static async resolveNames(e,n,r,i){e=Object.assign({},e);for(const s in e)e[s]==null&&delete e[s];const a={};e.verifyingContract&&!gn(e.verifyingContract,20)&&(a[e.verifyingContract]="0x");const o=Pi.from(n);o.visit(r,(s,l)=>(s==="address"&&!gn(l,20)&&(a[l]="0x"),l));for(const s in a)a[s]=await i(s);return e.verifyingContract&&a[e.verifyingContract]&&(e.verifyingContract=a[e.verifyingContract]),r=o.visit(r,(s,l)=>s==="address"&&a[l]?a[l]:l),{domain:e,value:r}}static getPayload(e,n,r){Pi.hashDomain(e);const i={},a=[];z6.forEach(l=>{const c=e[l];c!=null&&(i[l]=oq[l](c),a.push({name:l,type:ak[l]}))});const o=Pi.from(n);n=o.types;const s=Object.assign({},n);return K(s.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",n),s.EIP712Domain=a,o.encode(r),{types:s,domain:i,primaryType:o.primaryType,message:o.visit(r,(l,c)=>{if(l.match(/^bytes(\d*)/))return it(Jt(c));if(l.match(/^u?int/))return et(c).toString();switch(l){case"address":return c.toLowerCase();case"bool":return!!c;case"string":return K(typeof c=="string","invalid string","value",c),c}K(!1,"unsupported type","type",l)})}}},ym=new WeakMap,Ds=new WeakMap,i0=new WeakMap,o2=new WeakSet,IL=function(e){{const i=H6(e);if(i)return i}const n=Jv(e).array;if(n){const i=n.prefix,a=this.getEncoder(i);return o=>{K(n.count===-1||n.count===o.length,`array length mismatch; expected length ${n.count}`,"value",o);let s=o.map(a);return b(this,Ds).has(i)&&(s=s.map(Sn)),Sn(Zn(s))}}const r=this.types[e];if(r){const i=ih(b(this,Ds).get(e));return a=>{const o=r.map(({name:s,type:l})=>{const c=this.getEncoder(l)(a[s]);return b(this,Ds).has(l)?Sn(c):c});return o.unshift(i),Zn(o)}}K(!1,`unknown type: ${e}`,"type",e)},Pi);function ci(t){const e=new Set;return t.forEach(n=>e.add(n)),Object.freeze(e)}const sq="external public payable override",lq=ci(sq.split(" ")),RL="constant external internal payable private public pure view override",cq=ci(RL.split(" ")),ML="constructor error event fallback function receive struct",BL=ci(ML.split(" ")),DL="calldata memory storage payable indexed",uq=ci(DL.split(" ")),fq="tuple returns",hq=[ML,DL,fq,RL].join(" "),dq=ci(hq.split(" ")),pq={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},gq=new RegExp("^(\\s*)"),yq=new RegExp("^([0-9]+)"),mq=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),LL=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),$L=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var br,oo,mm,a3,qp;let Rl=(qp=class{constructor(e){M(this,mm);M(this,br,void 0);M(this,oo,void 0);O(this,br,0),O(this,oo,e.slice())}get offset(){return b(this,br)}get length(){return b(this,oo).length-b(this,br)}clone(){return new qp(b(this,oo))}reset(){O(this,br,0)}popKeyword(e){const n=this.peek();if(n.type!=="KEYWORD"||!e.has(n.text))throw new Error(`expected keyword ${n.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const n=this.peek();throw new Error(`expected ${e}; got ${n.type} ${JSON.stringify(n.text)}`)}return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=ie(this,mm,a3).call(this,b(this,br)+1,e.match+1);return O(this,br,e.match+1),n}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=[];for(;b(this,br)=b(this,oo).length)throw new Error("out-of-bounds");return b(this,oo)[b(this,br)]}peekKeyword(e){const n=this.peekType("KEYWORD");return n!=null&&e.has(n)?n:null}peekType(e){if(this.length===0)return null;const n=this.peek();return n.type===e?n.text:null}pop(){const e=this.peek();return vs(this,br)._++,e}toString(){const e=[];for(let n=b(this,br);n`}},br=new WeakMap,oo=new WeakMap,mm=new WeakSet,a3=function(e=0,n=0){return new qp(b(this,oo).slice(e,n).map(r=>Object.freeze(Object.assign({},r,{match:r.match-e,linkBack:r.linkBack-e,linkNext:r.linkNext-e}))))},qp);function ou(t){const e=[],n=o=>{const s=a0&&e[e.length-1].type==="NUMBER"){const f=e.pop().text;u=f+u,e[e.length-1].value=Bt(f)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=u}continue}if(s=o.match(mq),s){if(l.text=s[1],a+=l.text.length,dq.has(l.text)){l.type="KEYWORD";continue}if(l.text.match($L)){l.type="TYPE";continue}l.type="ID";continue}if(s=o.match(yq),s){l.text=s[1],l.type="NUMBER",a+=l.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${a}`)}return new Rl(e.map(o=>Object.freeze(o)))}function ck(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 Q2(t,e){if(e.peekKeyword(BL)){const n=e.pop().text;if(n!==t)throw new Error(`expected ${t}, got ${n}`)}return e.popType("ID")}function El(t,e){const n=new Set;for(;;){const r=t.peekType("KEYWORD");if(r==null||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 UL(t){let e=El(t,cq);return ck(e,ci("constant payable nonpayable".split(" "))),ck(e,ci("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 hl(t,e){return t.popParams().map(n=>gi.from(n,e))}function FL(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return et(t.pop().text);throw new Error("invalid gas")}return null}function ah(t){if(t.length)throw new Error(`unexpected tokens at offset ${t.offset}: ${t.toString()}`)}const vq=new RegExp(/^(.*)\[([0-9]*)\]$/);function uk(t){const e=t.match($L);if(K(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const n=parseInt(e[2]);K(n!==0&&n<=32,"invalid bytes length","type",t)}else if(e[3]){const n=parseInt(e[3]);K(n!==0&&n<=256&&n%8===0,"invalid numeric width","type",t)}return t}const kn={},$i=Symbol.for("_ethers_internal"),fk="_ParamTypeInternal",hk="_ErrorInternal",dk="_EventInternal",pk="_ConstructorInternal",gk="_FallbackInternal",yk="_FunctionInternal",mk="_StructInternal";var a0,Hb,Oi;let gi=(Oi=class{constructor(e,n,r,i,a,o,s,l){M(this,a0);R(this,"name");R(this,"type");R(this,"baseType");R(this,"indexed");R(this,"components");R(this,"arrayLength");R(this,"arrayChildren");if(L2(e,kn,"ParamType"),Object.defineProperty(this,$i,{value:fk}),o&&(o=Object.freeze(o.slice())),i==="array"){if(s==null||l==null)throw new Error("")}else if(s!=null||l!=null)throw new Error("");if(i==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");gt(this,{name:n,type:r,baseType:i,indexed:a,components:o,arrayLength:s,arrayChildren:l})}format(e){if(e==null&&(e="sighash"),e==="json"){const r=this.name||"";if(this.isArray()){const a=JSON.parse(this.arrayChildren.format("json"));return a.name=r,a.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(a)}const i={type:this.baseType==="tuple"?"tuple":this.type,name:r};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(a=>JSON.parse(a.format(e)))),JSON.stringify(i)}let n="";return this.isArray()?(n+=this.arrayChildren.format(e),n+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?n+="("+this.components.map(r=>r.format(e)).join(e==="full"?", ":",")+")":n+=this.type,e!=="sighash"&&(this.indexed===!0&&(n+=" indexed"),e==="full"&&this.name&&(n+=" "+this.name)),n}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,n){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const r=this;return e.map(i=>r.arrayChildren.walk(i,n))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const r=this;return e.map((i,a)=>r.components[a].walk(i,n))}return n(this.type,e)}async walkAsync(e,n){const r=[],i=[e];return ie(this,a0,Hb).call(this,r,e,n,a=>{i[0]=a}),r.length&&await Promise.all(r),i[0]}static from(e,n){if(Oi.isParamType(e))return e;if(typeof e=="string")try{return Oi.from(ou(e),n)}catch{K(!1,"invalid param type","obj",e)}else if(e instanceof Rl){let s="",l="",c=null;El(e,ci(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(l="tuple",c=e.popParams().map(p=>Oi.from(p)),s=`tuple(${c.map(p=>p.format()).join(",")})`):(s=uk(e.popType("TYPE")),l=s);let u=null,f=null;for(;e.length&&e.peekType("BRACKET");){const p=e.pop();u=new Oi(kn,"",s,l,null,c,f,u),f=p.value,s+=p.text,l="array",c=null}let h=null;if(El(e,uq).has("indexed")){if(!n)throw new Error("");h=!0}const g=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new Oi(kn,g,s,l,h,c,f,u)}const r=e.name;K(!r||typeof r=="string"&&r.match(LL),"invalid name","obj.name",r);let i=e.indexed;i!=null&&(K(n,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let a=e.type,o=a.match(vq);if(o){const s=parseInt(o[2]||"-1"),l=Oi.from({type:o[1],components:e.components});return new Oi(kn,r||"",a,"array",i,null,s,l)}if(a==="tuple"||a.startsWith("tuple(")||a.startsWith("(")){const s=e.components!=null?e.components.map(c=>Oi.from(c)):null;return new Oi(kn,r||"",a,"tuple",i,s,null,null)}return a=uk(e.type),new Oi(kn,r||"",a,a,i,null,null,null)}static isParamType(e){return e&&e[$i]===fk}},a0=new WeakSet,Hb=function(e,n,r,i){if(this.isArray()){if(!Array.isArray(n))throw new Error("invalid array value");if(this.arrayLength!==-1&&n.length!==this.arrayLength)throw new Error("array is wrong length");const o=this.arrayChildren,s=n.slice();s.forEach((l,c)=>{var u;ie(u=o,a0,Hb).call(u,e,l,r,f=>{s[c]=f})}),i(s);return}if(this.isTuple()){const o=this.components;let s;if(Array.isArray(n))s=n.slice();else{if(n==null||typeof n!="object")throw new Error("invalid tuple value");s=o.map(l=>{if(!l.name)throw new Error("cannot use object value with unnamed components");if(!(l.name in n))throw new Error(`missing value for component ${l.name}`);return n[l.name]})}if(s.length!==this.components.length)throw new Error("array is wrong length");s.forEach((l,c)=>{var u;ie(u=o[c],a0,Hb).call(u,e,l,r,f=>{s[c]=f})}),i(s);return}const a=r(this.type,n);a.then?e.push(async function(){i(await a)}()):i(a)},Oi),K2=class o3{constructor(e,n,r){R(this,"type");R(this,"inputs");L2(e,kn,"Fragment"),r=Object.freeze(r.slice()),gt(this,{type:n,inputs:r})}static from(e){if(typeof e=="string"){try{o3.from(JSON.parse(e))}catch{}return o3.from(ou(e))}if(e instanceof Rl)switch(e.peekKeyword(BL)){case"constructor":return Vb.from(e);case"error":return ks.from(e);case"event":return Gb.from(e);case"fallback":case"receive":return vk.from(e);case"function":return Qb.from(e);case"struct":return G6.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return Vb.from(e);case"error":return ks.from(e);case"event":return Gb.from(e);case"fallback":case"receive":return vk.from(e);case"function":return Qb.from(e);case"struct":return G6.from(e)}ye(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}K(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return Vb.isFragment(e)}static isError(e){return ks.isFragment(e)}static isEvent(e){return Gb.isFragment(e)}static isFunction(e){return Qb.isFragment(e)}static isStruct(e){return G6.isFragment(e)}},W2=class extends K2{constructor(n,r,i,a){super(n,r,a);R(this,"name");K(typeof i=="string"&&i.match(LL),"invalid identifier","name",i),a=Object.freeze(a.slice()),gt(this,{name:i})}};function d1(t,e){return"("+e.map(n=>n.format(t)).join(t==="full"?", ":",")+")"}let ks=class ry extends W2{constructor(e,n,r){super(e,"error",n,r),Object.defineProperty(this,$i,{value:hk})}get selector(){return ih(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(e)))});const n=[];return e!=="sighash"&&n.push("error"),n.push(this.name+d1(e,this.inputs)),n.join(" ")}static from(e){if(ry.isFragment(e))return e;if(typeof e=="string")return ry.from(ou(e));if(e instanceof Rl){const n=Q2("error",e),r=hl(e);return ah(e),new ry(kn,n,r)}return new ry(kn,e.name,e.inputs?e.inputs.map(gi.from):[])}static isFragment(e){return e&&e[$i]===hk}},Gb=class Lh extends W2{constructor(n,r,i,a){super(n,"event",r,i);R(this,"anonymous");Object.defineProperty(this,$i,{value:dk}),gt(this,{anonymous:a})}get topicHash(){return ih(this.format("sighash"))}format(n){if(n==null&&(n="sighash"),n==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(n)))});const r=[];return n!=="sighash"&&r.push("event"),r.push(this.name+d1(n,this.inputs)),n!=="sighash"&&this.anonymous&&r.push("anonymous"),r.join(" ")}static getTopicHash(n,r){return r=(r||[]).map(a=>gi.from(a)),new Lh(kn,n,r,!1).topicHash}static from(n){if(Lh.isFragment(n))return n;if(typeof n=="string")try{return Lh.from(ou(n))}catch{K(!1,"invalid event fragment","obj",n)}else if(n instanceof Rl){const r=Q2("event",n),i=hl(n,!0),a=!!El(n,ci(["anonymous"])).has("anonymous");return ah(n),new Lh(kn,r,i,a)}return new Lh(kn,n.name,n.inputs?n.inputs.map(r=>gi.from(r,!0)):[],!!n.anonymous)}static isFragment(n){return n&&n[$i]===dk}},Vb=class iy extends K2{constructor(n,r,i,a,o){super(n,r,i);R(this,"payable");R(this,"gas");Object.defineProperty(this,$i,{value:pk}),gt(this,{payable:a,gas:o})}format(n){if(ye(n!=null&&n!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),n==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(n)))});const r=[`constructor${d1(n,this.inputs)}`];return this.payable&&r.push("payable"),this.gas!=null&&r.push(`@${this.gas.toString()}`),r.join(" ")}static from(n){if(iy.isFragment(n))return n;if(typeof n=="string")try{return iy.from(ou(n))}catch{K(!1,"invalid constuctor fragment","obj",n)}else if(n instanceof Rl){El(n,ci(["constructor"]));const r=hl(n),i=!!El(n,lq).has("payable"),a=FL(n);return ah(n),new iy(kn,"constructor",r,i,a)}return new iy(kn,"constructor",n.inputs?n.inputs.map(gi.from):[],!!n.payable,n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[$i]===pk}},vk=class Eu extends K2{constructor(n,r,i){super(n,"fallback",r);R(this,"payable");Object.defineProperty(this,$i,{value:gk}),gt(this,{payable:i})}format(n){const r=this.inputs.length===0?"receive":"fallback";if(n==="json"){const i=this.payable?"payable":"nonpayable";return JSON.stringify({type:r,stateMutability:i})}return`${r}()${this.payable?" payable":""}`}static from(n){if(Eu.isFragment(n))return n;if(typeof n=="string")try{return Eu.from(ou(n))}catch{K(!1,"invalid fallback fragment","obj",n)}else if(n instanceof Rl){const r=n.toString(),i=n.peekKeyword(ci(["fallback","receive"]));if(K(i,"type must be fallback or receive","obj",r),n.popKeyword(ci(["fallback","receive"]))==="receive"){const l=hl(n);return K(l.length===0,"receive cannot have arguments","obj.inputs",l),El(n,ci(["payable"])),ah(n),new Eu(kn,[],!0)}let o=hl(n);o.length?K(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(l=>l.format("minimal")).join(", ")):o=[gi.from("bytes")];const s=UL(n);if(K(s==="nonpayable"||s==="payable","fallback cannot be constants","obj.stateMutability",s),El(n,ci(["returns"])).has("returns")){const l=hl(n);K(l.length===1&&l[0].type==="bytes","invalid fallback outputs","obj.outputs",l.map(c=>c.format("minimal")).join(", "))}return ah(n),new Eu(kn,o,s==="payable")}if(n.type==="receive")return new Eu(kn,[],!0);if(n.type==="fallback"){const r=[gi.from("bytes")],i=n.stateMutability==="payable";return new Eu(kn,r,i)}K(!1,"invalid fallback description","obj",n)}static isFragment(n){return n&&n[$i]===gk}},Qb=class $h extends W2{constructor(n,r,i,a,o,s){super(n,"function",r,a);R(this,"constant");R(this,"outputs");R(this,"stateMutability");R(this,"payable");R(this,"gas");Object.defineProperty(this,$i,{value:yk}),o=Object.freeze(o.slice()),gt(this,{constant:i==="view"||i==="pure",gas:s,outputs:o,payable:i==="payable",stateMutability:i})}get selector(){return ih(this.format("sighash")).substring(0,10)}format(n){if(n==null&&(n="sighash"),n==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(n))),outputs:this.outputs.map(i=>JSON.parse(i.format(n)))});const r=[];return n!=="sighash"&&r.push("function"),r.push(this.name+d1(n,this.inputs)),n!=="sighash"&&(this.stateMutability!=="nonpayable"&&r.push(this.stateMutability),this.outputs&&this.outputs.length&&(r.push("returns"),r.push(d1(n,this.outputs))),this.gas!=null&&r.push(`@${this.gas.toString()}`)),r.join(" ")}static getSelector(n,r){return r=(r||[]).map(a=>gi.from(a)),new $h(kn,n,"view",r,[],null).selector}static from(n){if($h.isFragment(n))return n;if(typeof n=="string")try{return $h.from(ou(n))}catch{K(!1,"invalid function fragment","obj",n)}else if(n instanceof Rl){const i=Q2("function",n),a=hl(n),o=UL(n);let s=[];El(n,ci(["returns"])).has("returns")&&(s=hl(n));const l=FL(n);return ah(n),new $h(kn,i,o,a,s,l)}let r=n.stateMutability;return r==null&&(r="payable",typeof n.constant=="boolean"?(r="view",n.constant||(r="payable",typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable"))):typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable")),new $h(kn,n.name,r,n.inputs?n.inputs.map(gi.from):[],n.outputs?n.outputs.map(gi.from):[],n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[$i]===yk}},G6=class Kb extends W2{constructor(e,n,r){super(e,"struct",n,r),Object.defineProperty(this,$i,{value:mk})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return Kb.from(ou(e))}catch{K(!1,"invalid struct fragment","obj",e)}else if(e instanceof Rl){const n=Q2("struct",e),r=hl(e);return ah(e),new Kb(kn,n,r)}return new Kb(kn,e.name,e.inputs?e.inputs.map(gi.from):[])}static isFragment(e){return e&&e[$i]===mk}};const ko=new Map;ko.set(0,"GENERIC_PANIC");ko.set(1,"ASSERT_FALSE");ko.set(17,"OVERFLOW");ko.set(18,"DIVIDE_BY_ZERO");ko.set(33,"ENUM_RANGE_ERROR");ko.set(34,"BAD_STORAGE_DATA");ko.set(49,"STACK_UNDERFLOW");ko.set(50,"ARRAY_RANGE_ERROR");ko.set(65,"OUT_OF_MEMORY");ko.set(81,"UNINITIALIZED_FUNCTION_CALL");const bq=new RegExp(/^bytes([0-9]*)$/),wq=new RegExp(/^(u?int)([0-9]*)$/);let V6=null,bk=1024;function xq(t,e,n,r){let i="missing revert data",a=null;const o=null;let s=null;if(n){i="execution reverted";const c=Jt(n);if(n=it(n),c.length===0)i+=" (no data present; likely require(false) occurred",a="require(false)";else if(c.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(it(c.slice(0,4))==="0x08c379a0")try{a=r.decode(["string"],c.slice(4))[0],s={signature:"Error(string)",name:"Error",args:[a]},i+=`: ${JSON.stringify(a)}`}catch{i+=" (could not decode reason; invalid string data)"}else if(it(c.slice(0,4))==="0x4e487b71")try{const u=Number(r.decode(["uint256"],c.slice(4))[0]);s={signature:"Panic(uint256)",name:"Panic",args:[u]},a=`Panic due to ${ko.get(u)||"UNKNOWN"}(${u})`,i+=`: ${a}`}catch{i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const l={to:e.to?fn(e.to):null,data:e.data||"0x"};return e.from&&(l.from=fn(e.from)),qn(i,"CALL_EXCEPTION",{action:t,data:n,reason:a,transaction:l,invocation:o,revert:s})}var ac,Uh,eg;let s3=(eg=class{constructor(){M(this,ac)}getDefaultValue(e){const n=e.map(i=>ie(this,ac,Uh).call(this,gi.from(i)));return new Wv(n,"_").defaultValue()}encode(e,n){mD(n.length,e.length,"types/values length mismatch");const r=e.map(o=>ie(this,ac,Uh).call(this,gi.from(o))),i=new Wv(r,"_"),a=new Q5;return i.encode(a,n),a.data}decode(e,n,r){const i=e.map(o=>ie(this,ac,Uh).call(this,gi.from(o)));return new Wv(i,"_").decode(new wY(n,r,bk))}static _setDefaultMaxInflation(e){K(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),bk=e}static defaultAbiCoder(){return V6==null&&(V6=new eg),V6}static getBuiltinCallException(e,n,r){return xq(e,n,r,eg.defaultAbiCoder())}},ac=new WeakSet,Uh=function(e){if(e.isArray())return new WX(ie(this,ac,Uh).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new Wv(e.components.map(r=>ie(this,ac,Uh).call(this,r)),e.name);switch(e.baseType){case"address":return new QX(e.name);case"bool":return new JX(e.name);case"string":return new iZ(e.name);case"bytes":return new YX(e.name);case"":return new qX(e.name)}let n=e.type.match(wq);if(n){let r=parseInt(n[2]||"256");return K(r!==0&&r<=256&&r%8===0,"invalid "+n[1]+" bit length","param",e),new rZ(r/8,n[1]==="int",e.name)}if(n=e.type.match(bq),n){let r=parseInt(n[1]);return K(r!==0&&r<=32,"invalid bytes length","param",e),new XX(r,e.name)}K(!1,"invalid type","type",e.type)},eg),Aq=class{constructor(e,n,r){R(this,"fragment");R(this,"name");R(this,"signature");R(this,"topic");R(this,"args");const i=e.name,a=e.format();gt(this,{fragment:e,name:i,signature:a,topic:n,args:r})}},Eq=class{constructor(e,n,r,i){R(this,"fragment");R(this,"name");R(this,"args");R(this,"signature");R(this,"selector");R(this,"value");const a=e.name,o=e.format();gt(this,{fragment:e,name:a,args:r,signature:o,selector:n,value:i})}},Sq=class{constructor(e,n,r){R(this,"fragment");R(this,"name");R(this,"args");R(this,"signature");R(this,"selector");const i=e.name,a=e.format();gt(this,{fragment:e,name:i,args:r,signature:a,selector:n})}},wk=class{constructor(e){R(this,"hash");R(this,"_isIndexed");gt(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}};const xk={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"},Ak={"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&&xk[t.toString()]&&(e=xk[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};var Uo,Fo,jo,Dr,o0,Wb,s0,Jb,$c;let GP=($c=class{constructor(e){M(this,o0);M(this,s0);R(this,"fragments");R(this,"deploy");R(this,"fallback");R(this,"receive");M(this,Uo,void 0);M(this,Fo,void 0);M(this,jo,void 0);M(this,Dr,void 0);let n=[];typeof e=="string"?n=JSON.parse(e):n=e,O(this,jo,new Map),O(this,Uo,new Map),O(this,Fo,new Map);const r=[];for(const o of n)try{r.push(K2.from(o))}catch(s){console.log(`[Warning] Invalid Fragment ${JSON.stringify(o)}:`,s.message)}gt(this,{fragments:Object.freeze(r)});let i=null,a=!1;O(this,Dr,this.getAbiCoder()),this.fragments.forEach((o,s)=>{let l;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}gt(this,{deploy:o});return;case"fallback":o.inputs.length===0?a=!0:(K(!i||o.payable!==i.payable,"conflicting fallback fragments",`fragments[${s}]`,o),i=o,a=i.payable);return;case"function":l=b(this,jo);break;case"event":l=b(this,Fo);break;case"error":l=b(this,Uo);break;default:return}const c=o.format();l.has(c)||l.set(c,o)}),this.deploy||gt(this,{deploy:Vb.from("constructor()")}),gt(this,{fallback:i,receive:a})}format(e){const n=e?"minimal":"full";return this.fragments.map(i=>i.format(n))}formatJson(){const e=this.fragments.map(n=>n.format("json"));return JSON.stringify(e.map(n=>JSON.parse(n)))}getAbiCoder(){return s3.defaultAbiCoder()}getFunctionName(e){const n=ie(this,o0,Wb).call(this,e,null,!1);return K(n,"no matching function","key",e),n.name}hasFunction(e){return!!ie(this,o0,Wb).call(this,e,null,!1)}getFunction(e,n){return ie(this,o0,Wb).call(this,e,n||null,!0)}forEachFunction(e){const n=Array.from(b(this,jo).keys());n.sort((r,i)=>r.localeCompare(i));for(let r=0;rr.localeCompare(i));for(let r=0;r1){const a=i.map(o=>JSON.stringify(o.format())).join(", ");K(!1,`ambiguous error description (i.e. ${a})`,"name",e)}return i[0]}if(e=ks.from(e).format(),e==="Error(string)")return ks.from("error Error(string)");if(e==="Panic(uint256)")return ks.from("error Panic(uint256)");const r=b(this,Uo).get(e);return r||null}forEachError(e){const n=Array.from(b(this,Uo).keys());n.sort((r,i)=>r.localeCompare(i));for(let r=0;ra.type==="string"?ih(o):a.type==="bytes"?Sn(it(o)):(a.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":a.type.match(/^u?int/)?o=us(o):a.type.match(/^bytes/)?o=eY(o,32):a.type==="address"&&b(this,Dr).encode(["address"],[o]),nh(it(o),32));for(n.forEach((a,o)=>{const s=e.inputs[o];if(!s.indexed){K(a==null,"cannot filter non-indexed parameters; must be null","contract."+s.name,a);return}a==null?r.push(null):s.baseType==="array"||s.baseType==="tuple"?K(!1,"filtering with tuples or arrays not supported","contract."+s.name,a):Array.isArray(a)?r.push(a.map(l=>i(s,l))):r.push(i(s,a))});r.length&&r[r.length-1]===null;)r.pop();return r}encodeEventLog(e,n){if(typeof e=="string"){const o=this.getEvent(e);K(o,"unknown event","eventFragment",e),e=o}const r=[],i=[],a=[];return e.anonymous||r.push(e.topicHash),K(n.length===e.inputs.length,"event arguments/values mismatch","values",n),e.inputs.forEach((o,s)=>{const l=n[s];if(o.indexed)if(o.type==="string")r.push(ih(l));else if(o.type==="bytes")r.push(Sn(l));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");r.push(b(this,Dr).encode([o.type],[l]))}else i.push(o),a.push(l)}),{data:b(this,Dr).encode(i,a),topics:r}}decodeEventLog(e,n,r){if(typeof e=="string"){const d=this.getEvent(e);K(d,"unknown event","eventFragment",e),e=d}if(r!=null&&!e.anonymous){const d=e.topicHash;K(gn(r[0],32)&&r[0].toLowerCase()===d,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}const i=[],a=[],o=[];e.inputs.forEach((d,g)=>{d.indexed?d.type==="string"||d.type==="bytes"||d.baseType==="tuple"||d.baseType==="array"?(i.push(gi.from({type:"bytes32",name:d.name})),o.push(!0)):(i.push(d),o.push(!1)):(a.push(d),o.push(!1))});const s=r!=null?b(this,Dr).decode(i,Zn(r)):null,l=b(this,Dr).decode(a,n,!0),c=[],u=[];let f=0,h=0;return e.inputs.forEach((d,g)=>{let p=null;if(d.indexed)if(s==null)p=new wk(null);else if(o[g])p=new wk(s[h++]);else try{p=s[h++]}catch(m){p=m}else try{p=l[f++]}catch(m){p=m}c.push(p),u.push(d.name||null)}),kD.fromItems(c,u)}parseTransaction(e){const n=Jt(e.data,"tx.data"),r=et(e.value!=null?e.value:0,"tx.value"),i=this.getFunction(it(n.slice(0,4)));if(!i)return null;const a=b(this,Dr).decode(i.inputs,n.slice(4));return new Eq(i,i.selector,a,r)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const n=this.getEvent(e.topics[0]);return!n||n.anonymous?null:new Aq(n,n.topicHash,this.decodeEventLog(n,e.data,e.topics))}parseError(e){const n=it(e),r=this.getError(Un(n,0,4));if(!r)return null;const i=b(this,Dr).decode(r.inputs,Un(n,4));return new Sq(r,r.selector,i)}static from(e){return e instanceof $c?e:typeof e=="string"?new $c(JSON.parse(e)):typeof e.format=="function"?new $c(e.format("json")):new $c(e)}},Uo=new WeakMap,Fo=new WeakMap,jo=new WeakMap,Dr=new WeakMap,o0=new WeakSet,Wb=function(e,n,r){if(gn(e)){const a=e.toLowerCase();for(const o of b(this,jo).values())if(a===o.selector)return o;return null}if(e.indexOf("(")===-1){const a=[];for(const[o,s]of b(this,jo))o.split("(")[0]===e&&a.push(s);if(n){const o=n.length>0?n[n.length-1]:null;let s=n.length,l=!0;Di.isTyped(o)&&o.type==="overrides"&&(l=!1,s--);for(let c=a.length-1;c>=0;c--){const u=a[c].inputs.length;u!==s&&(!l||u!==s-1)&&a.splice(c,1)}for(let c=a.length-1;c>=0;c--){const u=a[c].inputs;for(let f=0;f=u.length){if(n[f].type==="overrides")continue;a.splice(c,1);break}if(n[f].type!==u[f].baseType){a.splice(c,1);break}}}}if(a.length===1&&n&&n.length!==a[0].inputs.length){const o=n[n.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&a.splice(0,1)}if(a.length===0)return null;if(a.length>1&&r){const o=a.map(s=>JSON.stringify(s.format())).join(", ");K(!1,`ambiguous function description (i.e. matches ${o})`,"key",e)}return a[0]}const i=b(this,jo).get(Qb.from(e).format());return i||null},s0=new WeakSet,Jb=function(e,n,r){if(gn(e)){const a=e.toLowerCase();for(const o of b(this,Fo).values())if(a===o.topicHash)return o;return null}if(e.indexOf("(")===-1){const a=[];for(const[o,s]of b(this,Fo))o.split("(")[0]===e&&a.push(s);if(n){for(let o=a.length-1;o>=0;o--)a[o].inputs.length=0;o--){const s=a[o].inputs;for(let l=0;l1&&r){const o=a.map(s=>JSON.stringify(s.format())).join(", ");K(!1,`ambiguous event description (i.e. matches ${o})`,"key",e)}return a[0]}const i=b(this,Fo).get(Gb.from(e).format());return i||null},$c);const jL=BigInt(0);function Cy(t){return t??null}function Kn(t){return t==null?null:t.toString()}let Ek=class{constructor(e,n,r){R(this,"gasPrice");R(this,"maxFeePerGas");R(this,"maxPriorityFeePerGas");gt(this,{gasPrice:Cy(e),maxFeePerGas:Cy(n),maxPriorityFeePerGas:Cy(r)})}toJSON(){const{gasPrice:e,maxFeePerGas:n,maxPriorityFeePerGas:r}=this;return{_type:"FeeData",gasPrice:Kn(e),maxFeePerGas:Kn(n),maxPriorityFeePerGas:Kn(r)}}};function Zw(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=it(t.data));const n="chainId,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of n)!(i in t)||t[i]==null||(e[i]=et(t[i],`request.${i}`));const r="type,nonce".split(/,/);for(const i of r)!(i in t)||t[i]==null||(e[i]=Bt(t[i],`request.${i}`));return t.accessList&&(e.accessList=gh(t.accessList)),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipRead=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),e}var Ls,nM;let Pq=(nM=class{constructor(e,n){R(this,"provider");R(this,"number");R(this,"hash");R(this,"timestamp");R(this,"parentHash");R(this,"parentBeaconBlockRoot");R(this,"nonce");R(this,"difficulty");R(this,"gasLimit");R(this,"gasUsed");R(this,"stateRoot");R(this,"receiptsRoot");R(this,"blobGasUsed");R(this,"excessBlobGas");R(this,"miner");R(this,"extraData");R(this,"baseFeePerGas");M(this,Ls,void 0);O(this,Ls,e.transactions.map(r=>typeof r!="string"?new VP(r,n):r)),gt(this,{provider:n,hash:Cy(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,extraData:e.extraData,baseFeePerGas:Cy(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return b(this,Ls).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=b(this,Ls).slice();return e.length===0?[]:(ye(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:n,extraData:r,gasLimit:i,gasUsed:a,hash:o,miner:s,nonce:l,number:c,parentHash:u,parentBeaconBlockRoot:f,stateRoot:h,receiptsRoot:d,timestamp:g,transactions:p}=this;return{_type:"Block",baseFeePerGas:Kn(e),difficulty:Kn(n),extraData:r,gasLimit:Kn(i),gasUsed:Kn(a),blobGasUsed:Kn(this.blobGasUsed),excessBlobGas:Kn(this.excessBlobGas),hash:o,miner:s,nonce:l,number:c,parentHash:u,timestamp:g,parentBeaconBlockRoot:f,stateRoot:h,receiptsRoot:d,transactions:p}}[Symbol.iterator](){let e=0;const n=this.transactions;return{next:()=>enew sv(i,n))));let r=jL;e.effectiveGasPrice!=null?r=e.effectiveGasPrice:e.gasPrice!=null&&(r=e.gasPrice),gt(this,{provider:n,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:r,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return b(this,vm)}toJSON(){const{to:e,from:n,contractAddress:r,hash:i,index:a,blockHash:o,blockNumber:s,logsBloom:l,logs:c,status:u,root:f}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:s,contractAddress:r,cumulativeGasUsed:Kn(this.cumulativeGasUsed),from:n,gasPrice:Kn(this.gasPrice),blobGasUsed:Kn(this.blobGasUsed),blobGasPrice:Kn(this.blobGasPrice),gasUsed:Kn(this.gasUsed),hash:i,index:a,logs:c,logsBloom:l,root:f,status:u,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e{if(s)return null;const{blockNumber:h,nonce:d}=await ti({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(d{if(h==null||h.status!==0)return h;ye(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:h.to,from:h.from,data:""},receipt:h})},u=await this.provider.getTransactionReceipt(this.hash);if(r===0)return c(u);if(u){if(await u.confirmations()>=r)return c(u)}else if(await l(),r===0)return null;return await new Promise((h,d)=>{const g=[],p=()=>{g.forEach(y=>y())};if(g.push(()=>{s=!0}),i>0){const y=setTimeout(()=>{p(),d(qn("wait for transaction timeout","TIMEOUT"))},i);g.push(()=>{clearTimeout(y)})}const m=async y=>{if(await y.confirmations()>=r){p();try{h(c(y))}catch(v){d(v)}}};if(g.push(()=>{this.provider.off(this.hash,m)}),this.provider.on(this.hash,m),a>=0){const y=async()=>{try{await l()}catch(v){if(Qr(v,"TRANSACTION_REPLACED")){p(),d(v);return}}s||this.provider.once("block",y)};g.push(()=>{this.provider.off("block",y)}),this.provider.once("block",y)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return ye(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),GL(this)}reorderedEvent(e){return ye(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),ye(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),HL(this,e)}replaceableTransaction(e){K(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const n=new bm(this,this.provider);return O(n,oc,e),n}},oc=new WeakMap,bm);function Oq(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function HL(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function GL(t){return{orphan:"drop-transaction",tx:t}}function Tq(t){return{orphan:"drop-log",log:{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,address:t.address,data:t.data,topics:Object.freeze(t.topics.slice()),index:t.index}}}let QP=class extends sv{constructor(n,r,i){super(n,n.provider);R(this,"interface");R(this,"fragment");R(this,"args");const a=r.decodeEventLog(i,n.data,n.topics);gt(this,{args:a,fragment:i,interface:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}},VL=class extends sv{constructor(n,r){super(n,n.provider);R(this,"error");gt(this,{error:r})}};var l0,iM;let Cq=(iM=class extends zL{constructor(n,r,i){super(i,r);M(this,l0,void 0);O(this,l0,n)}get logs(){return super.logs.map(n=>{const r=n.topics.length?b(this,l0).getEvent(n.topics[0]):null;if(r)try{return new QP(n,b(this,l0),r)}catch(i){return new VL(n,i)}return n})}},l0=new WeakMap,iM);var wm,aM;let KP=(aM=class extends VP{constructor(n,r,i){super(i,r);M(this,wm,void 0);O(this,wm,n)}async wait(n,r){const i=await super.wait(n,r);return i==null?null:new Cq(b(this,wm),this.provider,i)}},wm=new WeakMap,aM),QL=class extends xD{constructor(n,r,i,a){super(n,r,i);R(this,"log");gt(this,{log:a})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}},kq=class extends QL{constructor(e,n,r,i,a){super(e,n,r,new QP(a,e.interface,i));const o=e.interface.decodeEventLog(i,this.log.data,this.log.topics);gt(this,{args:o,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}};const Sk=BigInt(0);function KL(t){return t&&typeof t.call=="function"}function WL(t){return t&&typeof t.estimateGas=="function"}function J2(t){return t&&typeof t.resolveName=="function"}function JL(t){return t&&typeof t.sendTransaction=="function"}function YL(t){if(t!=null){if(J2(t))return t;if(t.provider)return t.provider}}var xm,oM;let _q=(oM=class{constructor(e,n,r){M(this,xm,void 0);R(this,"fragment");if(gt(this,{fragment:n}),n.inputs.lengthr[l]==null?null:s.walkAsync(r[l],(u,f)=>u==="address"?Array.isArray(f)?Promise.all(f.map(h=>li(h,a))):li(f,a):f)));return e.interface.encodeFilterTopics(n,o)}())}getTopicFilter(){return b(this,xm)}},xm=new WeakMap,oM);function oh(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function Uu(t){return t==null?null:t.provider||null}async function WP(t,e){const n=Di.dereference(t,"overrides");K(typeof n=="object","invalid overrides parameter","overrides",t);const r=Zw(n);return K(r.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),K(r.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=r.from),r}async function XL(t,e,n){const r=oh(t,"resolveName"),i=J2(r)?r:null;return await Promise.all(e.map((a,o)=>a.walkAsync(n[o],(s,l)=>(l=Di.dereference(l,s),s==="address"?li(l,i):l))))}function Nq(t){const e=async function(o){const s=await WP(o,["data"]);s.to=await t.getAddress(),s.from&&(s.from=await li(s.from,YL(t.runner)));const l=t.interface,c=et(s.value||Sk,"overrides.value")===Sk,u=(s.data||"0x")==="0x";l.fallback&&!l.fallback.payable&&l.receive&&!u&&!c&&K(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),K(l.fallback||u,"cannot send data to receive-only contract","overrides.data",s.data);const f=l.receive||l.fallback&&l.fallback.payable;return K(f||c,"cannot send value to non-payable fallback","overrides.value",s.value),K(l.fallback||u,"cannot send data to receive-only contract","overrides.data",s.data),s},n=async function(o){const s=oh(t.runner,"call");ye(KL(s),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const l=await e(o);try{return await s.call(l)}catch(c){throw PP(c)&&c.data?t.interface.makeError(c.data,l):c}},r=async function(o){const s=t.runner;ye(JL(s),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const l=await s.sendTransaction(await e(o)),c=Uu(t.runner);return new KP(t.interface,c,l)},i=async function(o){const s=oh(t.runner,"estimateGas");return ye(WL(s),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await s.estimateGas(await e(o))},a=async o=>await r(o);return gt(a,{_contract:t,estimateGas:i,populateTransaction:e,send:r,staticCall:n}),a}function Iq(t,e){const n=function(...c){const u=t.interface.getFunction(e,c);return ye(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:c}}),u},r=async function(...c){const u=n(...c);let f={};if(u.inputs.length+1===c.length&&(f=await WP(c.pop()),f.from&&(f.from=await li(f.from,YL(t.runner)))),u.inputs.length!==c.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const h=await XL(t.runner,u.inputs,c);return Object.assign({},f,await ti({to:t.getAddress(),data:t.interface.encodeFunctionData(u,h)}))},i=async function(...c){const u=await s(...c);return u.length===1?u[0]:u},a=async function(...c){const u=t.runner;ye(JL(u),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const f=await u.sendTransaction(await r(...c)),h=Uu(t.runner);return new KP(t.interface,h,f)},o=async function(...c){const u=oh(t.runner,"estimateGas");return ye(WL(u),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await u.estimateGas(await r(...c))},s=async function(...c){const u=oh(t.runner,"call");ye(KL(u),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const f=await r(...c);let h="0x";try{h=await u.call(f)}catch(g){throw PP(g)&&g.data?t.interface.makeError(g.data,f):g}const d=n(...c);return t.interface.decodeFunctionResult(d,h)},l=async(...c)=>n(...c).constant?await i(...c):await a(...c);return gt(l,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:n,estimateGas:o,populateTransaction:r,send:a,staticCall:i,staticCallResult:s}),Object.defineProperty(l,"fragment",{configurable:!1,enumerable:!0,get:()=>{const c=t.interface.getFunction(e);return ye(c,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),c}}),l}function Rq(t,e){const n=function(...i){const a=t.interface.getEvent(e,i);return ye(a,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:i}}),a},r=function(...i){return new _q(t,n(...i),i)};return gt(r,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:n}),Object.defineProperty(r,"fragment",{configurable:!1,enumerable:!0,get:()=>{const i=t.interface.getEvent(e);return ye(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),i}}),r}const qw=Symbol.for("_ethersInternal_contract"),ZL=new WeakMap;function Mq(t,e){ZL.set(t[qw],e)}function Qi(t){return ZL.get(t[qw])}function Bq(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function JP(t,e){let n,r=null;if(Array.isArray(e)){const a=function(o){if(gn(o,32))return o;const s=t.interface.getEvent(o);return K(s,"unknown fragment","name",o),s.topicHash};n=e.map(o=>o==null?null:Array.isArray(o)?o.map(a):a(o))}else e==="*"?n=[null]:typeof e=="string"?gn(e,32)?n=[e]:(r=t.interface.getEvent(e),K(r,"unknown fragment","event",e),n=[r.topicHash]):Bq(e)?n=await e.getTopicFilter():"fragment"in e?(r=e.fragment,n=[r.topicHash]):K(!1,"unknown event name","event",e);n=n.map(a=>{if(a==null)return null;if(Array.isArray(a)){const o=Array.from(new Set(a.map(s=>s.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return a.toLowerCase()});const i=n.map(a=>a==null?"null":Array.isArray(a)?a.join("|"):a).join("&");return{fragment:r,tag:i,topics:n}}async function ay(t,e){const{subs:n}=Qi(t);return n.get((await JP(t,e)).tag)||null}async function Pk(t,e,n){const r=Uu(t.runner);ye(r,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:i,tag:a,topics:o}=await JP(t,n),{addr:s,subs:l}=Qi(t);let c=l.get(a);if(!c){const f={address:s||t,topics:o},h=m=>{let y=i;if(y==null)try{y=t.interface.getEvent(m.topics[0])}catch{}if(y){const v=y,x=i?t.interface.decodeEventLog(i,m.data,m.topics):[];c3(t,n,x,A=>new kq(t,A,n,v,m))}else c3(t,n,[],v=>new QL(t,v,n,m))};let d=[];c={tag:a,listeners:[],start:()=>{d.length||d.push(r.on(f,h))},stop:async()=>{if(d.length==0)return;let m=d;d=[],await Promise.all(m),r.off(f,h)}},l.set(a,c)}return c}let l3=Promise.resolve();async function Dq(t,e,n,r){await l3;const i=await ay(t,e);if(!i)return!1;const a=i.listeners.length;return i.listeners=i.listeners.filter(({listener:o,once:s})=>{const l=Array.from(n);r&&l.push(r(s?null:o));try{o.call(t,...l)}catch{}return!s}),i.listeners.length===0&&(i.stop(),Qi(t).subs.delete(i.tag)),a>0}async function c3(t,e,n,r){try{await l3}catch{}const i=Dq(t,e,n,r);return l3=i,await i}const Yv=["then"];var LPe,Jf;let u3=(Jf=class{constructor(e,n,r,i){R(this,"target");R(this,"interface");R(this,"runner");R(this,"filters");R(this,LPe);R(this,"fallback");K(typeof e=="string"||rL(e),"invalid value for Contract target","target",e),r==null&&(r=null);const a=GP.from(n);gt(this,{target:e,runner:r,interface:a}),Object.defineProperty(this,qw,{value:{}});let o,s=null,l=null;if(i){const f=Uu(r);l=new KP(this.interface,f,i)}let c=new Map;if(typeof e=="string")if(gn(e))s=e,o=Promise.resolve(e);else{const f=oh(r,"resolveName");if(!J2(f))throw qn("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=f.resolveName(e).then(h=>{if(h==null)throw qn("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return Qi(this).addr=h,h})}else o=e.getAddress().then(f=>{if(f==null)throw new Error("TODO");return Qi(this).addr=f,f});Mq(this,{addrPromise:o,addr:s,deployTx:l,subs:c});const u=new Proxy({},{get:(f,h,d)=>{if(typeof h=="symbol"||Yv.indexOf(h)>=0)return Reflect.get(f,h,d);try{return this.getEvent(h)}catch(g){if(!Qr(g,"INVALID_ARGUMENT")||g.argument!=="key")throw g}},has:(f,h)=>Yv.indexOf(h)>=0?Reflect.has(f,h):Reflect.has(f,h)||this.interface.hasEvent(String(h))});return gt(this,{filters:u}),gt(this,{fallback:a.receive||a.fallback?Nq(this):null}),new Proxy(this,{get:(f,h,d)=>{if(typeof h=="symbol"||h in f||Yv.indexOf(h)>=0)return Reflect.get(f,h,d);try{return f.getFunction(h)}catch(g){if(!Qr(g,"INVALID_ARGUMENT")||g.argument!=="key")throw g}},has:(f,h)=>typeof h=="symbol"||h in f||Yv.indexOf(h)>=0?Reflect.has(f,h):f.interface.hasFunction(h)})}connect(e){return new Jf(this.target,this.interface,e)}attach(e){return new Jf(e,this.interface,this.runner)}async getAddress(){return await Qi(this).addrPromise}async getDeployedCode(){const e=Uu(this.runner);ye(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const n=await e.getCode(await this.getAddress());return n==="0x"?null:n}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const r=Uu(this.runner);return ye(r!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((i,a)=>{const o=async()=>{try{if(await this.getDeployedCode()!=null)return i(this);r.once("block",o)}catch(s){a(s)}};o()})}deploymentTransaction(){return Qi(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),Iq(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),Rq(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,n,r){n==null&&(n=0),r==null&&(r="latest");const{addr:i,addrPromise:a}=Qi(this),o=i||await a,{fragment:s,topics:l}=await JP(this,e),c={address:o,topics:l,fromBlock:n,toBlock:r},u=Uu(this.runner);return ye(u,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await u.getLogs(c)).map(f=>{let h=s;if(h==null)try{h=this.interface.getEvent(f.topics[0])}catch{}if(h)try{return new QP(f,this.interface,h)}catch(d){return new VL(f,d)}return new sv(f,u)})}async on(e,n){const r=await Pk(this,"on",e);return r.listeners.push({listener:n,once:!1}),r.start(),this}async once(e,n){const r=await Pk(this,"once",e);return r.listeners.push({listener:n,once:!0}),r.start(),this}async emit(e,...n){return await c3(this,e,n,null)}async listenerCount(e){if(e){const i=await ay(this,e);return i?i.listeners.length:0}const{subs:n}=Qi(this);let r=0;for(const{listeners:i}of n.values())r+=i.length;return r}async listeners(e){if(e){const i=await ay(this,e);return i?i.listeners.map(({listener:a})=>a):[]}const{subs:n}=Qi(this);let r=[];for(const{listeners:i}of n.values())r=r.concat(i.map(({listener:a})=>a));return r}async off(e,n){const r=await ay(this,e);if(!r)return this;if(n){const i=r.listeners.map(({listener:a})=>a).indexOf(n);i>=0&&r.listeners.splice(i,1)}return(n==null||r.listeners.length===0)&&(r.stop(),Qi(this).subs.delete(r.tag)),this}async removeAllListeners(e){if(e){const n=await ay(this,e);if(!n)return this;n.stop(),Qi(this).subs.delete(n.tag)}else{const{subs:n}=Qi(this);for(const{tag:r,stop:i}of n.values())i(),n.delete(r)}return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return await this.off(e,n)}static buildClass(e){class n extends Jf{constructor(i,a=null){super(i,e,a)}}return n}static from(e,n,r){return r==null&&(r=null),new this(e,n,r)}},LPe=qw,Jf);function Lq(){return u3}let _d=class extends Lq(){};class YP{constructor(e,n,r){R(this,"interface");R(this,"bytecode");R(this,"runner");const i=GP.from(e);n instanceof Uint8Array||(typeof n=="object"&&(n=n.object),n.startsWith("0x")||(n="0x"+n)),n=it(Jt(n)),gt(this,{bytecode:n,interface:i,runner:r||null})}attach(e){return new u3(e,this.interface,this.runner)}async getDeployTransaction(...e){let n={};const r=this.interface.deploy;if(r.inputs.length+1===e.length&&(n=await WP(e.pop())),r.inputs.length!==e.length)throw new Error("incorrect number of arguments to constructor");const i=await XL(this.runner,r.inputs,e),a=Zn([this.bytecode,this.interface.encodeDeploy(i)]);return Object.assign({},n,{data:a})}async deploy(...e){const n=await this.getDeployTransaction(...e);ye(this.runner&&typeof this.runner.sendTransaction=="function","factory runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const r=await this.runner.sendTransaction(n),i=nL(r);return new u3(i,this.interface,this.runner,r)}connect(e){return new YP(this.interface,this.bytecode,e)}static fromSolidity(e,n){K(e!=null,"bad compiler output","output",e),typeof e=="string"&&(e=JSON.parse(e));const r=e.abi;let i="";return e.bytecode?i=e.bytecode:e.evm&&e.evm.bytecode&&(i=e.evm.bytecode),new this(r,i,n)}}function Q6(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):K(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}let $q=class{constructor(e){R(this,"name");gt(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,n){throw new Error("unsupported coin")}async decodeAddress(e,n){throw new Error("unsupported coin")}};const qL=new RegExp("^(ipfs)://(.*)$","i"),Ok=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),qL,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var sc,of,lc,Fh,s2,Xc,e$;let Tk=(Xc=class{constructor(e,n,r){M(this,lc);R(this,"provider");R(this,"address");R(this,"name");M(this,sc,void 0);M(this,of,void 0);gt(this,{provider:e,address:n,name:r}),O(this,sc,null),O(this,of,new _d(n,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return b(this,sc)==null&&O(this,sc,(async()=>{try{return await b(this,of).supportsInterface("0x9061b923")}catch(e){if(Qr(e,"CALL_EXCEPTION"))return!1;throw O(this,sc,null),e}})()),await b(this,sc)}async getAddress(e){if(e==null&&(e=60),e===60)try{const a=await ie(this,lc,Fh).call(this,"addr(bytes32)");return a==null||a===l1?null:a}catch(a){if(Qr(a,"CALL_EXCEPTION"))return null;throw a}if(e>=0&&e<2147483648){let a=e+2147483648;const o=await ie(this,lc,Fh).call(this,"addr(bytes32,uint)",[a]);if(gn(o,20))return fn(o)}let n=null;for(const a of this.provider.plugins)if(a instanceof $q&&a.supportsCoinType(e)){n=a;break}if(n==null)return null;const r=await ie(this,lc,Fh).call(this,"addr(bytes32,uint)",[e]);if(r==null||r==="0x")return null;const i=await n.decodeAddress(e,r);if(i!=null)return i;ye(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:r}})}async getText(e){const n=await ie(this,lc,Fh).call(this,"text(bytes32,string)",[e]);return n==null||n==="0x"?null:n}async getContentHash(){const e=await ie(this,lc,Fh).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const n=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const i=n[1]==="e3010170"?"ipfs":"ipns",a=parseInt(n[4],16);if(n[5].length===a*2)return`${i}://${rY("0x"+n[2])}`}const r=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&r[1].length===64)return`bzz://${r[1]}`;ye(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const n=await this.getText("avatar");if(n==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:n});for(let r=0;r{if(e&&n==null)return null;if(!Array.isArray(n))throw new Error("not an array");return n.map(r=>t(r))}}function lv(t,e){return n=>{const r={};for(const i in t){let a=i;if(e&&i in e&&!(a in n)){for(const o of e[i])if(o in n){a=o;break}}try{const o=t[i](n[a]);o!==void 0&&(r[i]=o)}catch(o){const s=o instanceof Error?o.message:"not-an-error";ye(!1,`invalid value for value.${i} (${s})`,"BAD_DATA",{value:n})}}return r}}function Uq(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}K(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function Pp(t){return K(gn(t,!0),"invalid data","value",t),t}function Vr(t){return K(gn(t,32),"invalid hash","value",t),t}const Fq=lv({address:fn,blockHash:Vr,blockNumber:Bt,data:Pp,index:Bt,removed:Kt(Uq,!1),topics:Y2(Vr),transactionHash:Vr,transactionIndex:Bt},{index:["logIndex"]});function jq(t){return Fq(t)}const zq=lv({hash:Kt(Vr),parentHash:Vr,parentBeaconBlockRoot:Kt(Vr,null),number:Bt,timestamp:Bt,nonce:Kt(Pp),difficulty:et,gasLimit:et,gasUsed:et,stateRoot:Kt(Vr,null),receiptsRoot:Kt(Vr,null),blobGasUsed:Kt(et,null),excessBlobGas:Kt(et,null),miner:Kt(fn),extraData:Pp,baseFeePerGas:Kt(et)});function Hq(t){const e=zq(t);return e.transactions=t.transactions.map(n=>typeof n=="string"?n:t$(n)),e}const Gq=lv({transactionIndex:Bt,blockNumber:Bt,transactionHash:Vr,address:fn,topics:Y2(Vr),data:Pp,index:Bt,blockHash:Vr},{index:["logIndex"]});function Vq(t){return Gq(t)}const Qq=lv({to:Kt(fn,null),from:Kt(fn,null),contractAddress:Kt(fn,null),index:Bt,root:Kt(it),gasUsed:et,blobGasUsed:Kt(et,null),logsBloom:Kt(Pp),blockHash:Vr,hash:Vr,logs:Y2(Vq),blockNumber:Bt,cumulativeGasUsed:et,effectiveGasPrice:Kt(et),blobGasPrice:Kt(et,null),status:Kt(Bt),type:Kt(Bt,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function Kq(t){return Qq(t)}function t$(t){t.to&&et(t.to)===Ck&&(t.to="0x0000000000000000000000000000000000000000");const e=lv({hash:Vr,index:Kt(Bt,void 0),type:n=>n==="0x"||n==null?0:Bt(n),accessList:Kt(gh,null),blobVersionedHashes:Kt(Y2(Vr,!0),null),blockHash:Kt(Vr,null),blockNumber:Kt(Bt,null),transactionIndex:Kt(Bt,null),from:fn,gasPrice:Kt(et),maxPriorityFeePerGas:Kt(et),maxFeePerGas:Kt(et),maxFeePerBlobGas:Kt(et,null),gasLimit:et,to:Kt(fn,null),value:et,nonce:Bt,data:Pp,creates:Kt(fn,null),chainId:Kt(et,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(t);if(e.to==null&&e.creates==null&&(e.creates=nL(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=Al.from(t.signature):e.signature=Al.from(t),e.chainId==null){const n=e.signature.legacyChainId;n!=null&&(e.chainId=n)}return e.blockHash&&et(e.blockHash)===Ck&&(e.blockHash=null),e}const Wq="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";let XP=class n${constructor(e){R(this,"name");gt(this,{name:e})}clone(){return new n$(this.name)}},r$=class i$ extends XP{constructor(n,r){n==null&&(n=0);super(`org.ethers.network.plugins.GasCost#${n||0}`);R(this,"effectiveBlock");R(this,"txBase");R(this,"txCreate");R(this,"txDataZero");R(this,"txDataNonzero");R(this,"txAccessListStorageKey");R(this,"txAccessListAddress");const i={effectiveBlock:n};function a(o,s){let l=(r||{})[o];l==null&&(l=s),K(typeof l=="number",`invalud value for ${o}`,"costs",r),i[o]=l}a("txBase",21e3),a("txCreate",32e3),a("txDataZero",4),a("txDataNonzero",16),a("txAccessListStorageKey",1900),a("txAccessListAddress",2400),gt(this,i)}clone(){return new i$(this.effectiveBlock,this)}},a$=class o$ extends XP{constructor(n,r){super("org.ethers.plugins.network.Ens");R(this,"address");R(this,"targetNetwork");gt(this,{address:n||Wq,targetNetwork:r??1})}clone(){return new o$(this.address,this.targetNetwork)}};var Am,Em,sM;let Jq=(sM=class extends XP{constructor(n,r){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");M(this,Am,void 0);M(this,Em,void 0);O(this,Am,n),O(this,Em,r)}get url(){return b(this,Am)}get processFunc(){return b(this,Em)}clone(){return this}},Am=new WeakMap,Em=new WeakMap,sM);const K6=new Map;var c0,u0,cc,Uc;let Bc=(Uc=class{constructor(e,n){M(this,c0,void 0);M(this,u0,void 0);M(this,cc,void 0);O(this,c0,e),O(this,u0,et(n)),O(this,cc,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return b(this,c0)}set name(e){O(this,c0,e)}get chainId(){return b(this,u0)}set chainId(e){O(this,u0,et(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===et(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===et(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===et(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(b(this,cc).values())}attachPlugin(e){if(b(this,cc).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return b(this,cc).set(e.name,e.clone()),this}getPlugin(e){return b(this,cc).get(e)||null}getPlugins(e){return this.plugins.filter(n=>n.name.split("#")[0]===e)}clone(){const e=new Uc(this.name,this.chainId);return this.plugins.forEach(n=>{e.attachPlugin(n.clone())}),e}computeIntrinsicGas(e){const n=this.getPlugin("org.ethers.plugins.network.GasCost")||new r$;let r=n.txBase;if(e.to==null&&(r+=n.txCreate),e.data)for(let i=2;i9){let i=BigInt(r[1].substring(0,9));r[1].substring(9).match(/^0+$/)||i++,r[1]=i.toString()}return BigInt(r[0]+r[1])}function _k(t){return new Jq(t,async(e,n,r)=>{r.setHeader("User-Agent","ethers");let i;try{const[a,o]=await Promise.all([r.send(),e()]);i=a;const s=i.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:kk(s.maxFee,9),maxPriorityFeePerGas:kk(s.maxPriorityFee,9)}}catch(a){ye(!1,`error encountered with polygon gas station (${JSON.stringify(r.url)})`,"SERVER_ERROR",{request:r,response:i,error:a})}})}let Nk=!1;function Yq(){if(Nk)return;Nk=!0;function t(e,n,r){const i=function(){const a=new Bc(e,n);return r.ensNetwork!=null&&a.attachPlugin(new a$(null,r.ensNetwork)),a.attachPlugin(new r$),(r.plugins||[]).forEach(o=>{a.attachPlugin(o)}),a};Bc.register(e,i),Bc.register(n,i),r.altNames&&r.altNames.forEach(a=>{Bc.register(a,i)})}t("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),t("ropsten",3,{ensNetwork:3}),t("rinkeby",4,{ensNetwork:4}),t("goerli",5,{ensNetwork:5}),t("kovan",42,{ensNetwork:42}),t("sepolia",11155111,{ensNetwork:11155111}),t("holesky",17e3,{ensNetwork:17e3}),t("classic",61,{}),t("classicKotti",6,{}),t("arbitrum",42161,{ensNetwork:1}),t("arbitrum-goerli",421613,{}),t("arbitrum-sepolia",421614,{}),t("base",8453,{ensNetwork:1}),t("base-goerli",84531,{}),t("base-sepolia",84532,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("matic",137,{ensNetwork:1,plugins:[_k("https://gasstation.polygon.technology/v2")]}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[_k("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[]}),t("optimism-goerli",420,{}),t("optimism-sepolia",11155420,{}),t("xdai",100,{ensNetwork:1})}function f3(t){return JSON.parse(JSON.stringify(t))}var $s,Aa,uc,zo,f0,Yb,lM;let Xq=(lM=class{constructor(e){M(this,f0);M(this,$s,void 0);M(this,Aa,void 0);M(this,uc,void 0);M(this,zo,void 0);O(this,$s,e),O(this,Aa,null),O(this,uc,4e3),O(this,zo,-2)}get pollingInterval(){return b(this,uc)}set pollingInterval(e){O(this,uc,e)}start(){b(this,Aa)||(O(this,Aa,b(this,$s)._setTimeout(ie(this,f0,Yb).bind(this),b(this,uc))),ie(this,f0,Yb).call(this))}stop(){b(this,Aa)&&(b(this,$s)._clearTimeout(b(this,Aa)),O(this,Aa,null))}pause(e){this.stop(),e&&O(this,zo,-2)}resume(){this.start()}},$s=new WeakMap,Aa=new WeakMap,uc=new WeakMap,zo=new WeakMap,f0=new WeakSet,Yb=async function(){try{const e=await b(this,$s).getBlockNumber();if(b(this,zo)===-2){O(this,zo,e);return}if(e!==b(this,zo)){for(let n=b(this,zo)+1;n<=e;n++){if(b(this,Aa)==null)return;await b(this,$s).emit("block",n)}O(this,zo,e)}}catch{}b(this,Aa)!=null&&O(this,Aa,b(this,$s)._setTimeout(ie(this,f0,Yb).bind(this),b(this,uc)))},lM);var sf,lf,fc,cM;let ZP=(cM=class{constructor(e){M(this,sf,void 0);M(this,lf,void 0);M(this,fc,void 0);O(this,sf,e),O(this,fc,!1),O(this,lf,n=>{this._poll(n,b(this,sf))})}async _poll(e,n){throw new Error("sub-classes must override this")}start(){b(this,fc)||(O(this,fc,!0),b(this,lf).call(this,-2),b(this,sf).on("block",b(this,lf)))}stop(){b(this,fc)&&(O(this,fc,!1),b(this,sf).off("block",b(this,lf)))}pause(e){this.stop()}resume(){this.start()}},sf=new WeakMap,lf=new WeakMap,fc=new WeakMap,cM);var h0,Us,uM;let Zq=(uM=class extends ZP{constructor(n,r){super(n);M(this,h0,void 0);M(this,Us,void 0);O(this,h0,r),O(this,Us,-2)}pause(n){n&&O(this,Us,-2),super.pause(n)}async _poll(n,r){const i=await r.getBlock(b(this,h0));i!=null&&(b(this,Us)===-2?O(this,Us,i.number):i.number>b(this,Us)&&(r.emit(b(this,h0),i.number),O(this,Us,i.number)))}},h0=new WeakMap,Us=new WeakMap,uM);var l2,fM;let qq=(fM=class extends ZP{constructor(n,r){super(n);M(this,l2,void 0);O(this,l2,f3(r))}async _poll(n,r){throw new Error("@TODO")}},l2=new WeakMap,fM);var d0,hM;let eee=(hM=class extends ZP{constructor(n,r){super(n);M(this,d0,void 0);O(this,d0,r)}async _poll(n,r){const i=await r.getTransactionReceipt(b(this,d0));i&&r.emit(b(this,d0),i)}},d0=new WeakMap,hM);var Fs,p0,g0,hc,Ea,c2,s$,dM;let qP=(dM=class{constructor(e,n){M(this,c2);M(this,Fs,void 0);M(this,p0,void 0);M(this,g0,void 0);M(this,hc,void 0);M(this,Ea,void 0);O(this,Fs,e),O(this,p0,f3(n)),O(this,g0,ie(this,c2,s$).bind(this)),O(this,hc,!1),O(this,Ea,-2)}start(){b(this,hc)||(O(this,hc,!0),b(this,Ea)===-2&&b(this,Fs).getBlockNumber().then(e=>{O(this,Ea,e)}),b(this,Fs).on("block",b(this,g0)))}stop(){b(this,hc)&&(O(this,hc,!1),b(this,Fs).off("block",b(this,g0)))}pause(e){this.stop(),e&&O(this,Ea,-2)}resume(){this.start()}},Fs=new WeakMap,p0=new WeakMap,g0=new WeakMap,hc=new WeakMap,Ea=new WeakMap,c2=new WeakSet,s$=async function(e){if(b(this,Ea)===-2)return;const n=f3(b(this,p0));n.fromBlock=b(this,Ea)+1,n.toBlock=e;const r=await b(this,Fs).getLogs(n);if(r.length===0){b(this,Ea){if(r==null)return"null";if(typeof r=="bigint")return`bigint:${r.toString()}`;if(typeof r=="string")return r.toLowerCase();if(typeof r=="object"&&!Array.isArray(r)){const i=Object.keys(r);return i.sort(),i.reduce((a,o)=>(a[o]=r[o],a),{})}return r})}let l$=class{constructor(e){R(this,"name");gt(this,{name:e})}start(){}stop(){}pause(e){}resume(){}};function ree(t){return JSON.parse(JSON.stringify(t))}function h3(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function W6(t,e){if(t==null)throw new Error("invalid event");if(Array.isArray(t)&&(t={topics:t}),typeof t=="string")switch(t){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:t,tag:t}}if(gn(t,32)){const n=t.toLowerCase();return{type:"transaction",tag:Xb("tx",{hash:n}),hash:n}}if(t.orphan){const n=t;return{type:"orphan",tag:Xb("orphan",n),filter:ree(n)}}if(t.address||t.topics){const n=t,r={topics:(n.topics||[]).map(i=>i==null?null:Array.isArray(i)?h3(i.map(a=>a.toLowerCase())):i.toLowerCase())};if(n.address){const i=[],a=[],o=s=>{gn(s)?i.push(s):a.push((async()=>{i.push(await li(s,e))})())};Array.isArray(n.address)?n.address.forEach(o):o(n.address),a.length&&await Promise.all(a),r.address=h3(i.map(s=>s.toLowerCase()))}return{filter:r,tag:Xb("event",r),type:"event"}}K(!1,"unknown ProviderEvent","event",t)}function J6(){return new Date().getTime()}const iee={cacheTimeout:250,pollingInterval:4e3};var Lr,dc,$r,y0,Zi,cf,pc,js,Sm,Sa,m0,v0,Zr,Gi,Pm,d3,Om,p3,uf,oy,Tm,g3,ff,sy,b0,Zb,pM;let aee=(pM=class{constructor(e,n){M(this,Zr);M(this,Pm);M(this,Om);M(this,uf);M(this,Tm);M(this,ff);M(this,b0);M(this,Lr,void 0);M(this,dc,void 0);M(this,$r,void 0);M(this,y0,void 0);M(this,Zi,void 0);M(this,cf,void 0);M(this,pc,void 0);M(this,js,void 0);M(this,Sm,void 0);M(this,Sa,void 0);M(this,m0,void 0);M(this,v0,void 0);if(O(this,v0,Object.assign({},iee,n||{})),e==="any")O(this,cf,!0),O(this,Zi,null);else if(e){const r=Bc.from(e);O(this,cf,!1),O(this,Zi,Promise.resolve(r)),setTimeout(()=>{this.emit("network",r,null)},0)}else O(this,cf,!1),O(this,Zi,null);O(this,js,-1),O(this,pc,new Map),O(this,Lr,new Map),O(this,dc,new Map),O(this,$r,null),O(this,y0,!1),O(this,Sm,1),O(this,Sa,new Map),O(this,m0,!1)}get pollingInterval(){return b(this,v0).pollingInterval}get provider(){return this}get plugins(){return Array.from(b(this,dc).values())}attachPlugin(e){if(b(this,dc).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return b(this,dc).set(e.name,e.connect(this)),this}getPlugin(e){return b(this,dc).get(e)||null}get disableCcipRead(){return b(this,m0)}set disableCcipRead(e){O(this,m0,!!e)}async ccipReadFetch(e,n,r){if(this.disableCcipRead||r.length===0||e.to==null)return null;const i=e.to.toLowerCase(),a=n.toLowerCase(),o=[];for(let s=0;s=500,`response not found during CCIP fetch: ${f}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:l,errorMessage:f}}),o.push(f)}ye(!1,`error encountered during CCIP fetch: ${o.map(s=>JSON.stringify(s)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:r,errorMessages:o}})}_wrapBlock(e,n){return new Pq(Hq(e),this)}_wrapLog(e,n){return new sv(jq(e),this)}_wrapTransactionReceipt(e,n){return new zL(Kq(e),this)}_wrapTransactionResponse(e,n){return new VP(t$(e),this)}_detectNetwork(){ye(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){ye(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=Bt(await ie(this,Zr,Gi).call(this,{method:"getBlockNumber"}),"%response");return b(this,js)>=0&&O(this,js,e),e}_getAddress(e){return li(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if(gn(e))return gn(e,32)?e:fd(e);if(typeof e=="bigint"&&(e=Bt(e,"blockTag")),typeof e=="number")return e>=0?fd(e):b(this,js)>=0?fd(b(this,js)+e):this.getBlockNumber().then(n=>fd(n+e));K(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const n=(e.topics||[]).map(l=>l==null?null:Array.isArray(l)?h3(l.map(c=>c.toLowerCase())):l.toLowerCase()),r="blockHash"in e?e.blockHash:void 0,i=(l,c,u)=>{let f;switch(l.length){case 0:break;case 1:f=l[0];break;default:l.sort(),f=l}if(r&&(c!=null||u!=null))throw new Error("invalid filter");const h={};return f&&(h.address=f),n.length&&(h.topics=n),c&&(h.fromBlock=c),u&&(h.toBlock=u),r&&(h.blockHash=r),h};let a=[];if(e.address)if(Array.isArray(e.address))for(const l of e.address)a.push(this._getAddress(l));else a.push(this._getAddress(e.address));let o;"fromBlock"in e&&(o=this._getBlockTag(e.fromBlock));let s;return"toBlock"in e&&(s=this._getBlockTag(e.toBlock)),a.filter(l=>typeof l!="string").length||o!=null&&typeof o!="string"||s!=null&&typeof s!="string"?Promise.all([Promise.all(a),o,s]).then(l=>i(l[0],l[1],l[2])):i(a,o,s)}_getTransactionRequest(e){const n=Zw(e),r=[];if(["to","from"].forEach(i=>{if(n[i]==null)return;const a=li(n[i],this);Xv(a)?r.push(async function(){n[i]=await a}()):n[i]=a}),n.blockTag!=null){const i=this._getBlockTag(n.blockTag);Xv(i)?r.push(async function(){n.blockTag=await i}()):n.blockTag=i}return r.length?async function(){return await Promise.all(r),n}():n}async getNetwork(){if(b(this,Zi)==null){const i=(async()=>{try{const a=await this._detectNetwork();return this.emit("network",a,null),a}catch(a){throw b(this,Zi)===i&&O(this,Zi,null),a}})();return O(this,Zi,i),(await i).clone()}const e=b(this,Zi),[n,r]=await Promise.all([e,this._detectNetwork()]);return n.chainId!==r.chainId&&(b(this,cf)?(this.emit("network",r,n),b(this,Zi)===e&&O(this,Zi,Promise.resolve(r))):ye(!1,`network changed: ${n.chainId} => ${r.chainId} `,"NETWORK_ERROR",{event:"changed"})),n.clone()}async getFeeData(){const e=await this.getNetwork(),n=async()=>{const{_block:i,gasPrice:a,priorityFee:o}=await ti({_block:ie(this,Tm,g3).call(this,"latest",!1),gasPrice:(async()=>{try{const u=await ie(this,Zr,Gi).call(this,{method:"getGasPrice"});return et(u,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const u=await ie(this,Zr,Gi).call(this,{method:"getPriorityFee"});return et(u,"%response")}catch{}return null})()});let s=null,l=null;const c=this._wrapBlock(i,e);return c&&c.baseFeePerGas&&(l=o??BigInt("1000000000"),s=c.baseFeePerGas*tee+l),new Ek(a,s,l)},r=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(r){const i=new rh(r.url),a=await r.processFunc(n,this,i);return new Ek(a.gasPrice,a.maxFeePerGas,a.maxPriorityFeePerGas)}return await n()}async estimateGas(e){let n=this._getTransactionRequest(e);return Xv(n)&&(n=await n),et(await ie(this,Zr,Gi).call(this,{method:"estimateGas",transaction:n}),"%response")}async call(e){const{tx:n,blockTag:r}=await ti({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await ie(this,Om,p3).call(this,ie(this,Pm,d3).call(this,n,r,e.enableCcipRead?0:-1))}async getBalance(e,n){return et(await ie(this,uf,oy).call(this,{method:"getBalance"},e,n),"%response")}async getTransactionCount(e,n){return Bt(await ie(this,uf,oy).call(this,{method:"getTransactionCount"},e,n),"%response")}async getCode(e,n){return it(await ie(this,uf,oy).call(this,{method:"getCode"},e,n))}async getStorage(e,n,r){const i=et(n,"position");return it(await ie(this,uf,oy).call(this,{method:"getStorage",position:i},e,r))}async broadcastTransaction(e){const{blockNumber:n,hash:r,network:i}=await ti({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),a=CL.from(e);if(a.hash!==r)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(a,i).replaceableTransaction(n)}async getBlock(e,n){const{network:r,params:i}=await ti({network:this.getNetwork(),params:ie(this,Tm,g3).call(this,e,!!n)});return i==null?null:this._wrapBlock(i,r)}async getTransaction(e){const{network:n,params:r}=await ti({network:this.getNetwork(),params:ie(this,Zr,Gi).call(this,{method:"getTransaction",hash:e})});return r==null?null:this._wrapTransactionResponse(r,n)}async getTransactionReceipt(e){const{network:n,params:r}=await ti({network:this.getNetwork(),params:ie(this,Zr,Gi).call(this,{method:"getTransactionReceipt",hash:e})});if(r==null)return null;if(r.gasPrice==null&&r.effectiveGasPrice==null){const i=await ie(this,Zr,Gi).call(this,{method:"getTransaction",hash:e});if(i==null)throw new Error("report this; could not find tx or effectiveGasPrice");r.effectiveGasPrice=i.gasPrice}return this._wrapTransactionReceipt(r,n)}async getTransactionResult(e){const{result:n}=await ti({network:this.getNetwork(),result:ie(this,Zr,Gi).call(this,{method:"getTransactionResult",hash:e})});return n==null?null:it(n)}async getLogs(e){let n=this._getFilter(e);Xv(n)&&(n=await n);const{network:r,params:i}=await ti({network:this.getNetwork(),params:ie(this,Zr,Gi).call(this,{method:"getLogs",filter:n})});return i.map(a=>this._wrapLog(a,r))}_getProvider(e){ye(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await Tk.fromName(this,e)}async getAvatar(e){const n=await this.getResolver(e);return n?await n.getAvatar():null}async resolveName(e){const n=await this.getResolver(e);return n?await n.getAddress():null}async lookupAddress(e){e=fn(e);const n=i3(e.substring(2).toLowerCase()+".addr.reverse");try{const r=await Tk.getEnsAddress(this),a=await new _d(r,["function resolver(bytes32) view returns (address)"],this).resolver(n);if(a==null||a===l1)return null;const s=await new _d(a,["function name(bytes32) view returns (string)"],this).name(n);return await this.resolveName(s)!==e?null:s}catch(r){if(Qr(r,"BAD_DATA")&&r.value==="0x"||Qr(r,"CALL_EXCEPTION"))return null;throw r}return null}async waitForTransaction(e,n,r){const i=n??1;return i===0?this.getTransactionReceipt(e):new Promise(async(a,o)=>{let s=null;const l=async c=>{try{const u=await this.getTransactionReceipt(e);if(u!=null&&c-u.blockNumber+1>=i){a(u),s&&(clearTimeout(s),s=null);return}}catch(u){console.log("EEE",u)}this.once("block",l)};r!=null&&(s=setTimeout(()=>{s!=null&&(s=null,this.off("block",l),o(qn("timeout","TIMEOUT",{reason:"timeout"})))},r)),l(await this.getBlockNumber())})}async waitForBlock(e){ye(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const n=b(this,Sa).get(e);n&&(n.timer&&clearTimeout(n.timer),b(this,Sa).delete(e))}_setTimeout(e,n){n==null&&(n=0);const r=vs(this,Sm)._++,i=()=>{b(this,Sa).delete(r),e()};if(this.paused)b(this,Sa).set(r,{timer:null,func:i,time:n});else{const a=setTimeout(i,n);b(this,Sa).set(r,{timer:a,func:i,time:J6()})}return r}_forEachSubscriber(e){for(const n of b(this,Lr).values())e(n.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new l$(e.type);case"block":{const n=new Xq(this);return n.pollingInterval=this.pollingInterval,n}case"safe":case"finalized":return new Zq(this,e.type);case"event":return new qP(this,e.filter);case"transaction":return new eee(this,e.hash);case"orphan":return new qq(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,n){for(const r of b(this,Lr).values())if(r.subscriber===e){r.started&&r.subscriber.stop(),r.subscriber=n,r.started&&n.start(),b(this,$r)!=null&&n.pause(b(this,$r));break}}async on(e,n){const r=await ie(this,b0,Zb).call(this,e);return r.listeners.push({listener:n,once:!1}),r.started||(r.subscriber.start(),r.started=!0,b(this,$r)!=null&&r.subscriber.pause(b(this,$r))),this}async once(e,n){const r=await ie(this,b0,Zb).call(this,e);return r.listeners.push({listener:n,once:!0}),r.started||(r.subscriber.start(),r.started=!0,b(this,$r)!=null&&r.subscriber.pause(b(this,$r))),this}async emit(e,...n){const r=await ie(this,ff,sy).call(this,e,n);if(!r||r.listeners.length===0)return!1;const i=r.listeners.length;return r.listeners=r.listeners.filter(({listener:a,once:o})=>{const s=new xD(this,o?null:a,e);try{a.call(this,...n,s)}catch{}return!o}),r.listeners.length===0&&(r.started&&r.subscriber.stop(),b(this,Lr).delete(r.tag)),i>0}async listenerCount(e){if(e){const r=await ie(this,ff,sy).call(this,e);return r?r.listeners.length:0}let n=0;for(const{listeners:r}of b(this,Lr).values())n+=r.length;return n}async listeners(e){if(e){const r=await ie(this,ff,sy).call(this,e);return r?r.listeners.map(({listener:i})=>i):[]}let n=[];for(const{listeners:r}of b(this,Lr).values())n=n.concat(r.map(({listener:i})=>i));return n}async off(e,n){const r=await ie(this,ff,sy).call(this,e);if(!r)return this;if(n){const i=r.listeners.map(({listener:a})=>a).indexOf(n);i>=0&&r.listeners.splice(i,1)}return(!n||r.listeners.length===0)&&(r.started&&r.subscriber.stop(),b(this,Lr).delete(r.tag)),this}async removeAllListeners(e){if(e){const{tag:n,started:r,subscriber:i}=await ie(this,b0,Zb).call(this,e);r&&i.stop(),b(this,Lr).delete(n)}else for(const[n,{started:r,subscriber:i}]of b(this,Lr))r&&i.stop(),b(this,Lr).delete(n);return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return this.off(e,n)}get destroyed(){return b(this,y0)}destroy(){this.removeAllListeners();for(const e of b(this,Sa).keys())this._clearTimeout(e);O(this,y0,!0)}get paused(){return b(this,$r)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(O(this,js,-1),b(this,$r)!=null){if(b(this,$r)==!!e)return;ye(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(n=>n.pause(e)),O(this,$r,!!e);for(const n of b(this,Sa).values())n.timer&&clearTimeout(n.timer),n.time=J6()-n.time}resume(){if(b(this,$r)!=null){this._forEachSubscriber(e=>e.resume()),O(this,$r,null);for(const e of b(this,Sa).values()){let n=e.time;n<0&&(n=0),e.time=J6(),setTimeout(e.func,n)}}}},Lr=new WeakMap,dc=new WeakMap,$r=new WeakMap,y0=new WeakMap,Zi=new WeakMap,cf=new WeakMap,pc=new WeakMap,js=new WeakMap,Sm=new WeakMap,Sa=new WeakMap,m0=new WeakMap,v0=new WeakMap,Zr=new WeakSet,Gi=async function(e){const n=b(this,v0).cacheTimeout;if(n<0)return await this._perform(e);const r=Xb(e.method,e);let i=b(this,pc).get(r);return i||(i=this._perform(e),b(this,pc).set(r,i),setTimeout(()=>{b(this,pc).get(r)===i&&b(this,pc).delete(r)},n)),await i},Pm=new WeakSet,d3=async function(e,n,r){ye(r=0&&n==="latest"&&i.to!=null&&Un(a.data,0,4)==="0x556f1830"){const o=a.data,s=await li(i.to,this);let l;try{l=uee(Un(a.data,4))}catch(f){ye(!1,f.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:o}})}ye(l.sender.toLowerCase()===s.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:o,reason:"OffchainLookup",transaction:i,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:l.errorArgs}});const c=await this.ccipReadFetch(i,l.calldata,l.urls);ye(c!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:a.data,errorArgs:l.errorArgs}});const u={to:s,data:Zn([l.selector,cee([c,l.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:u});try{const f=await ie(this,Pm,d3).call(this,u,n,r+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},u),result:f}),f}catch(f){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},u),error:f}),f}}throw a}},Om=new WeakSet,p3=async function(e){const{value:n}=await ti({network:this.getNetwork(),value:e});return n},uf=new WeakSet,oy=async function(e,n,r){let i=this._getAddress(n),a=this._getBlockTag(r);return(typeof i!="string"||typeof a!="string")&&([i,a]=await Promise.all([i,a])),await ie(this,Om,p3).call(this,ie(this,Zr,Gi).call(this,Object.assign(e,{address:i,blockTag:a})))},Tm=new WeakSet,g3=async function(e,n){if(gn(e,32))return await ie(this,Zr,Gi).call(this,{method:"getBlock",blockHash:e,includeTransactions:n});let r=this._getBlockTag(e);return typeof r!="string"&&(r=await r),await ie(this,Zr,Gi).call(this,{method:"getBlock",blockTag:r,includeTransactions:n})},ff=new WeakSet,sy=async function(e,n){let r=await W6(e,this);return r.type==="event"&&n&&n.length>0&&n[0].removed===!0&&(r=await W6({orphan:"drop-log",log:n[0]},this)),b(this,Lr).get(r.tag)||null},b0=new WeakSet,Zb=async function(e){const n=await W6(e,this),r=n.tag;let i=b(this,Lr).get(r);return i||(i={subscriber:this._getSubscriber(n),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},b(this,Lr).set(r,i)),i},pM);function oee(t,e){try{const n=y3(t,e);if(n)return Vw(n)}catch{}return null}function y3(t,e){if(t==="0x")return null;try{const n=Bt(Un(t,e,e+32)),r=Bt(Un(t,n,n+32));return Un(t,n+32,n+32+r)}catch{}return null}function Ik(t){const e=oi(t);if(e.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(e,32-e.length),n}function see(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const lee=new Uint8Array([]);function cee(t){const e=[];let n=0;for(let r=0;r=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const n=Un(t,0,32);ye(Un(n,0,12)===Un(Rk,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=Un(n,12);try{const r=[],i=Bt(Un(t,32,64)),a=Bt(Un(t,i,i+32)),o=Un(t,i+32);for(let s=0;se[r]),e}function Ch(t,e){if(t.provider)return t.provider;ye(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function Mk(t,e){let n=Zw(e);if(n.to!=null&&(n.to=li(n.to,t)),n.from!=null){const r=n.from;n.from=Promise.all([t.getAddress(),li(r,t)]).then(([i,a])=>(K(i.toLowerCase()===a.toLowerCase(),"transaction from mismatch","tx.from",a),i))}else n.from=t.getAddress();return await ti(n)}let fee=class{constructor(e){R(this,"provider");gt(this,{provider:e||null})}async getNonce(e){return Ch(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await Mk(this,e)}async populateTransaction(e){const n=Ch(this,"populateTransaction"),r=await Mk(this,e);r.nonce==null&&(r.nonce=await this.getNonce("pending")),r.gasLimit==null&&(r.gasLimit=await this.estimateGas(r));const i=await this.provider.getNetwork();if(r.chainId!=null){const o=et(r.chainId);K(o===i.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else r.chainId=i.chainId;const a=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||a)?K(!1,"eip-1559 transaction do not support gasPrice","tx",e):(r.type===0||r.type===1)&&a&&K(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1){const o=await n.getFeeData();ye(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice)}else{const o=await n.getFeeData();if(r.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const s=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=s,r.maxPriorityFeePerGas=s}else r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(ye(!a,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice),r.type=0):ye(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await ti(r)}async estimateGas(e){return Ch(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Ch(this,"call").call(await this.populateCall(e))}async resolveName(e){return await Ch(this,"resolveName").resolveName(e)}async sendTransaction(e){const n=Ch(this,"sendTransaction"),r=await this.populateTransaction(e);delete r.from;const i=CL.from(r);return await n.broadcastTransaction(await this.signTransaction(i))}};function hee(t){return JSON.parse(JSON.stringify(t))}var wi,Ho,hf,gc,df,w0,Cm,m3,km,v3,gM;let c$=(gM=class{constructor(e){M(this,Cm);M(this,km);M(this,wi,void 0);M(this,Ho,void 0);M(this,hf,void 0);M(this,gc,void 0);M(this,df,void 0);M(this,w0,void 0);O(this,wi,e),O(this,Ho,null),O(this,hf,ie(this,Cm,m3).bind(this)),O(this,gc,!1),O(this,df,null),O(this,w0,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,n){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){b(this,gc)||(O(this,gc,!0),ie(this,Cm,m3).call(this,-2))}stop(){b(this,gc)&&(O(this,gc,!1),O(this,w0,!0),ie(this,km,v3).call(this),b(this,wi).off("block",b(this,hf)))}pause(e){e&&ie(this,km,v3).call(this),b(this,wi).off("block",b(this,hf))}resume(){this.start()}},wi=new WeakMap,Ho=new WeakMap,hf=new WeakMap,gc=new WeakMap,df=new WeakMap,w0=new WeakMap,Cm=new WeakSet,m3=async function(e){try{b(this,Ho)==null&&O(this,Ho,this._subscribe(b(this,wi)));let n=null;try{n=await b(this,Ho)}catch(a){if(!Qr(a,"UNSUPPORTED_OPERATION")||a.operation!=="eth_newFilter")throw a}if(n==null){O(this,Ho,null),b(this,wi)._recoverSubscriber(this,this._recover(b(this,wi)));return}const r=await b(this,wi).getNetwork();if(b(this,df)||O(this,df,r),b(this,df).chainId!==r.chainId)throw new Error("chaid changed");if(b(this,w0))return;const i=await b(this,wi).send("eth_getFilterChanges",[n]);await this._emitResults(b(this,wi),i)}catch(n){console.log("@TODO",n)}b(this,wi).once("block",b(this,hf))},km=new WeakSet,v3=function(){const e=b(this,Ho);e&&(O(this,Ho,null),e.then(n=>{b(this,wi).send("eth_uninstallFilter",[n])}))},gM);var pf,yM;let dee=(yM=class extends c${constructor(n,r){super(n);M(this,pf,void 0);O(this,pf,hee(r))}_recover(n){return new qP(n,b(this,pf))}async _subscribe(n){return await n.send("eth_newFilter",[b(this,pf)])}async _emitResults(n,r){for(const i of r)n.emit(b(this,pf),n._wrapLog(i,n._network))}},pf=new WeakMap,yM),pee=class extends c${async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,n){for(const r of n)e.emit("pending",r)}};const gee="bigint,boolean,function,number,string,symbol".split(/,/g);function qb(t){if(t==null||gee.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(qb);if(typeof t=="object")return Object.keys(t).reduce((e,n)=>(e[n]=t[n],e),{});throw new Error(`should not happen: ${t} (${typeof t})`)}function yee(t){return new Promise(e=>{setTimeout(e,t)})}function kh(t){return t&&t.toLowerCase()}function Bk(t){return t&&typeof t.pollingInterval=="number"}const mee={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};let Y6=class extends fee{constructor(n,r){super(n);R(this,"address");r=fn(r),gt(this,{address:r})}connect(n){ye(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(n){return await this.populateCall(n)}async sendUncheckedTransaction(n){const r=qb(n),i=[];if(r.from){const o=r.from;i.push((async()=>{const s=await li(o,this.provider);K(s!=null&&s.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=s})())}else r.from=this.address;if(r.gasLimit==null&&i.push((async()=>{r.gasLimit=await this.provider.estimateGas({...r,from:this.address})})()),r.to!=null){const o=r.to;i.push((async()=>{r.to=await li(o,this.provider)})())}i.length&&await Promise.all(i);const a=this.provider.getRpcTransaction(r);return this.provider.send("eth_sendTransaction",[a])}async sendTransaction(n){const r=await this.provider.getBlockNumber(),i=await this.sendUncheckedTransaction(n);return await new Promise((a,o)=>{const s=[1e3,100];let l=0;const c=async()=>{try{const u=await this.provider.getTransaction(i);if(u!=null){a(u.replaceableTransaction(r));return}}catch(u){if(Qr(u,"CANCELLED")||Qr(u,"BAD_DATA")||Qr(u,"NETWORK_ERROR")){u.info==null&&(u.info={}),u.info.sendTransactionHash=i,o(u);return}if(Qr(u,"INVALID_ARGUMENT")&&(l++,u.info==null&&(u.info={}),u.info.sendTransactionHash=i,l>10)){o(u);return}this.provider.emit("error",qn("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:u}))}this.provider._setTimeout(()=>{c()},s.pop()||4e3)};c()})}async signTransaction(n){const r=qb(n);if(r.from){const a=await li(r.from,this.provider);K(a!=null&&a.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=a}else r.from=this.address;const i=this.provider.getRpcTransaction(r);return await this.provider.send("eth_signTransaction",[i])}async signMessage(n){const r=typeof n=="string"?fl(n):n;return await this.provider.send("personal_sign",[it(r),this.address.toLowerCase()])}async signTypedData(n,r,i){const a=qb(i),o=await lk.resolveNames(n,r,a,async s=>{const l=await li(s);return K(l!=null,"TypedData does not support null address","value",s),l});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(lk.getPayload(o.domain,r,o.value))])}async unlock(n){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),n,null])}async _legacySignMessage(n){const r=typeof n=="string"?fl(n):n;return await this.provider.send("eth_sign",[this.address.toLowerCase(),it(r)])}};var gf,x0,zs,Go,so,Pa,xi,_m,b3,mM;let vee=(mM=class extends aee{constructor(n,r){super(n,r);M(this,_m);M(this,gf,void 0);M(this,x0,void 0);M(this,zs,void 0);M(this,Go,void 0);M(this,so,void 0);M(this,Pa,void 0);M(this,xi,void 0);O(this,x0,1),O(this,gf,Object.assign({},mee,r||{})),O(this,zs,[]),O(this,Go,null),O(this,Pa,null),O(this,xi,null);{let a=null;const o=new Promise(s=>{a=s});O(this,so,{promise:o,resolve:a})}const i=this._getOption("staticNetwork");typeof i=="boolean"?(K(!i||n!=="any","staticNetwork cannot be used on special network 'any'","options",r),i&&n!=null&&O(this,Pa,Bc.from(n))):i&&(K(n==null||i.matches(n),"staticNetwork MUST match network object","options",r),O(this,Pa,i))}_getOption(n){return b(this,gf)[n]}get _network(){return ye(b(this,Pa),"network is not available yet","NETWORK_ERROR"),b(this,Pa)}async _perform(n){if(n.method==="call"||n.method==="estimateGas"){let i=n.transaction;if(i&&i.type!=null&&et(i.type)&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const a=await this.getFeeData();a.maxFeePerGas==null&&a.maxPriorityFeePerGas==null&&(n=Object.assign({},n,{transaction:Object.assign({},i,{type:void 0})}))}}const r=this.getRpcRequest(n);return r!=null?await this.send(r.method,r.args):super._perform(n)}async _detectNetwork(){const n=this._getOption("staticNetwork");if(n)if(n===!0){if(b(this,Pa))return b(this,Pa)}else return n;return b(this,xi)?await b(this,xi):this.ready?(O(this,xi,(async()=>{try{const r=Bc.from(et(await this.send("eth_chainId",[])));return O(this,xi,null),r}catch(r){throw O(this,xi,null),r}})()),await b(this,xi)):(O(this,xi,(async()=>{const r={id:vs(this,x0)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:r});let i;try{i=(await this._send(r))[0],O(this,xi,null)}catch(a){throw O(this,xi,null),this.emit("debug",{action:"receiveRpcError",error:a}),a}if(this.emit("debug",{action:"receiveRpcResult",result:i}),"result"in i)return Bc.from(et(i.result));throw this.getRpcError(r,i)})()),await b(this,xi))}_start(){b(this,so)==null||b(this,so).resolve==null||(b(this,so).resolve(),O(this,so,null),(async()=>{for(;b(this,Pa)==null&&!this.destroyed;)try{O(this,Pa,await this._detectNetwork())}catch(n){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",qn("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:n}})),await yee(1e3)}ie(this,_m,b3).call(this)})())}async _waitUntilReady(){if(b(this,so)!=null)return await b(this,so).promise}_getSubscriber(n){return n.type==="pending"?new pee(this):n.type==="event"?this._getOption("polling")?new qP(this,n.filter):new dee(this,n.filter):n.type==="orphan"&&n.filter.orphan==="drop-log"?new l$("orphan"):super._getSubscriber(n)}get ready(){return b(this,so)==null}getRpcTransaction(n){const r={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(i=>{if(n[i]==null)return;let a=i;i==="gasLimit"&&(a="gas"),r[a]=fd(et(n[i],`tx.${i}`))}),["from","to","data"].forEach(i=>{n[i]!=null&&(r[i]=it(n[i]))}),n.accessList&&(r.accessList=gh(n.accessList)),r}getRpcRequest(n){switch(n.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[kh(n.address),n.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[kh(n.address),n.blockTag]};case"getCode":return{method:"eth_getCode",args:[kh(n.address),n.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[kh(n.address),"0x"+n.position.toString(16),n.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[n.signedTransaction]};case"getBlock":if("blockTag"in n)return{method:"eth_getBlockByNumber",args:[n.blockTag,!!n.includeTransactions]};if("blockHash"in n)return{method:"eth_getBlockByHash",args:[n.blockHash,!!n.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[n.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[n.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(n.transaction),n.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(n.transaction)]};case"getLogs":return n.filter&&n.filter.address!=null&&(Array.isArray(n.filter.address)?n.filter.address=n.filter.address.map(kh):n.filter.address=kh(n.filter.address)),{method:"eth_getLogs",args:[n.filter]}}return null}getRpcError(n,r){const{method:i}=n,{error:a}=r;if(i==="eth_estimateGas"&&a.message){const l=a.message;if(!l.match(/revert/i)&&l.match(/insufficient funds/i))return qn("insufficient funds","INSUFFICIENT_FUNDS",{transaction:n.params[0],info:{payload:n,error:a}})}if(i==="eth_call"||i==="eth_estimateGas"){const l=w3(a),c=s3.getBuiltinCallException(i==="eth_call"?"call":"estimateGas",n.params[0],l?l.data:null);return c.info={error:a,payload:n},c}const o=JSON.stringify(wee(a));if(typeof a.message=="string"&&a.message.match(/user denied|ethers-user-denied/i))return qn("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[i]||"unknown",reason:"rejected",info:{payload:n,error:a}});if(i==="eth_sendRawTransaction"||i==="eth_sendTransaction"){const l=n.params[0];if(o.match(/insufficient funds|base fee exceeds gas limit/i))return qn("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:l,info:{error:a}});if(o.match(/nonce/i)&&o.match(/too low/i))return qn("nonce has already been used","NONCE_EXPIRED",{transaction:l,info:{error:a}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return qn("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:l,info:{error:a}});if(o.match(/only replay-protected/i))return qn("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:i,info:{transaction:l,info:{error:a}}})}let s=!!o.match(/the method .* does not exist/i);return s||a&&a.details&&a.details.startsWith("Unauthorized method:")&&(s=!0),s?qn("unsupported operation","UNSUPPORTED_OPERATION",{operation:n.method,info:{error:a,payload:n}}):qn("could not coalesce error","UNKNOWN_ERROR",{error:a,payload:n})}send(n,r){if(this.destroyed)return Promise.reject(qn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n}));const i=vs(this,x0)._++,a=new Promise((o,s)=>{b(this,zs).push({resolve:o,reject:s,payload:{method:n,params:r,id:i,jsonrpc:"2.0"}})});return ie(this,_m,b3).call(this),a}async getSigner(n){n==null&&(n=0);const r=this.send("eth_accounts",[]);if(typeof n=="number"){const a=await r;if(n>=a.length)throw new Error("no such account");return new Y6(this,a[n])}const{accounts:i}=await ti({network:this.getNetwork(),accounts:r});n=fn(n);for(const a of i)if(fn(a)===n)return new Y6(this,n);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(r=>new Y6(this,r))}destroy(){b(this,Go)&&(clearTimeout(b(this,Go)),O(this,Go,null));for(const{payload:n,reject:r}of b(this,zs))r(qn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n.method}));O(this,zs,[]),super.destroy()}},gf=new WeakMap,x0=new WeakMap,zs=new WeakMap,Go=new WeakMap,so=new WeakMap,Pa=new WeakMap,xi=new WeakMap,_m=new WeakSet,b3=function(){if(b(this,Go))return;const n=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");O(this,Go,setTimeout(()=>{O(this,Go,null);const r=b(this,zs);for(O(this,zs,[]);r.length;){const i=[r.shift()];for(;r.length&&i.length!==b(this,gf).batchMaxCount;)if(i.push(r.shift()),JSON.stringify(i.map(o=>o.payload)).length>b(this,gf).batchMaxSize){r.unshift(i.pop());break}(async()=>{const a=i.length===1?i[0].payload:i.map(o=>o.payload);this.emit("debug",{action:"sendRpcPayload",payload:a});try{const o=await this._send(a);this.emit("debug",{action:"receiveRpcResult",result:o});for(const{resolve:s,reject:l,payload:c}of i){if(this.destroyed){l(qn("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:c.method}));continue}const u=o.filter(f=>f.id===c.id)[0];if(u==null){const f=qn("missing response for request","BAD_DATA",{value:o,info:{payload:c}});this.emit("error",f),l(f);continue}if("error"in u){l(this.getRpcError(c,u));continue}s(u.result)}}catch(o){this.emit("debug",{action:"receiveRpcError",error:o});for(const{reject:s}of i)s(o)}})()}},n))},mM);var yc,vM;let u$=(vM=class extends vee{constructor(n,r){super(n,r);M(this,yc,void 0);O(this,yc,4e3)}_getSubscriber(n){const r=super._getSubscriber(n);return Bk(r)&&(r.pollingInterval=b(this,yc)),r}get pollingInterval(){return b(this,yc)}set pollingInterval(n){if(!Number.isInteger(n)||n<0)throw new Error("invalid interval");O(this,yc,n),this._forEachSubscriber(r=>{Bk(r)&&(r.pollingInterval=b(this,yc))})}},yc=new WeakMap,vM);var A0,bM;let bee=(bM=class extends u${constructor(n,r,i){n==null&&(n="http://localhost:8545");super(r,i);M(this,A0,void 0);typeof n=="string"?O(this,A0,new rh(n)):O(this,A0,n.clone())}_getConnection(){return b(this,A0).clone()}async send(n,r){return await this._start(),await super.send(n,r)}async _send(n){const r=this._getConnection();r.body=JSON.stringify(n),r.setHeader("content-type","application/json");const i=await r.send();i.assertOk();let a=i.bodyJson;return Array.isArray(a)||(a=[a]),a}},A0=new WeakMap,bM);function w3(t){if(t==null)return null;if(typeof t.message=="string"&&t.message.match(/revert/i)&&gn(t.data))return{message:t.message,data:t.data};if(typeof t=="object"){for(const e in t){const n=w3(t[e]);if(n)return n}return null}if(typeof t=="string")try{return w3(JSON.parse(t))}catch{}return null}function x3(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const n in t)x3(t[n],e);if(typeof t=="string")try{return x3(JSON.parse(t),e)}catch{}}}function wee(t){const e=[];return x3(t,e),e}var E0,wM;let f$=(wM=class extends u${constructor(n,r){K(n&&n.request,"invalid EIP-1193 provider","ethereum",n);super(r,{batchMaxCount:1});M(this,E0,void 0);O(this,E0,async(i,a)=>{const o={method:i,params:a};this.emit("debug",{action:"sendEip1193Request",payload:o});try{const s=await n.request(o);return this.emit("debug",{action:"receiveEip1193Result",result:s}),s}catch(s){const l=new Error(s.message);throw l.code=s.code,l.data=s.data,l.payload=o,this.emit("debug",{action:"receiveEip1193Error",error:l}),l}})}async send(n,r){return await this._start(),await super.send(n,r)}async _send(n){K(!Array.isArray(n),"EIP-1193 does not support batch request","payload",n);try{const r=await b(this,E0).call(this,n.method,n.params||[]);return[{id:n.id,result:r}]}catch(r){return[{id:n.id,error:{code:r.code,data:r.data,message:r.message}}]}}getRpcError(n,r){switch(r=JSON.parse(JSON.stringify(r)),r.error.code||-1){case 4001:r.error.message=`ethers-user-denied: ${r.error.message}`;break;case 4200:r.error.message=`ethers-unsupported: ${r.error.message}`;break}return super.getRpcError(n,r)}async hasSigner(n){n==null&&(n=0);const r=await this.send("eth_accounts",[]);return typeof n=="number"?r.length>n:(n=n.toLowerCase(),r.filter(i=>i.toLowerCase()===n).length!==0)}async getSigner(n){if(n==null&&(n=0),!await this.hasSigner(n))try{await b(this,E0).call(this,"eth_requestAccounts",[])}catch(r){const i=r.payload;throw this.getRpcError(i,{id:i.id,error:r})}return await super.getSigner(n)}},E0=new WeakMap,wM);const xee=["string","number","bigint","symbol"],Aee=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function Eee(t){if(t===null)return"null";if(t===void 0)return"undefined";if(t===!0||t===!1)return"boolean";const e=typeof t;if(xee.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(t))return"Array";if(See(t))return"Buffer";const n=Pee(t);return n||"Object"}function See(t){return t&&t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer.call(null,t)}function Pee(t){const e=Object.prototype.toString.call(t).slice(8,-1);if(Aee.includes(e))return e}class de{constructor(e,n,r){this.major=e,this.majorEncoded=e<<5,this.name=n,this.terminal=r}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.majore.major?1:0}}de.uint=new de(0,"uint",!0);de.negint=new de(1,"negint",!0);de.bytes=new de(2,"bytes",!0);de.string=new de(3,"string",!0);de.array=new de(4,"array",!1);de.map=new de(5,"map",!1);de.tag=new de(6,"tag",!1);de.float=new de(7,"float",!0);de.false=new de(7,"false",!0);de.true=new de(7,"true",!0);de.null=new de(7,"null",!0);de.undefined=new de(7,"undefined",!0);de.break=new de(7,"break",!0);class ut{constructor(e,n,r){this.type=e,this.value=n,this.encodedLength=r,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}}const og=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",Oee=new TextDecoder,Tee=new TextEncoder;function ex(t){return og&&globalThis.Buffer.isBuffer(t)}function h$(t){return t instanceof Uint8Array?ex(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t:Uint8Array.from(t)}const Cee=og?(t,e,n)=>n-e>64?globalThis.Buffer.from(t.subarray(e,n)).toString("utf8"):Lk(t,e,n):(t,e,n)=>n-e>64?Oee.decode(t.subarray(e,n)):Lk(t,e,n),kee=og?t=>t.length>64?globalThis.Buffer.from(t):Dk(t):t=>t.length>64?Tee.encode(t):Dk(t),bs=t=>Uint8Array.from(t),eO=og?(t,e,n)=>ex(t)?new Uint8Array(t.subarray(e,n)):t.slice(e,n):(t,e,n)=>t.slice(e,n),_ee=og?(t,e)=>(t=t.map(n=>n instanceof Uint8Array?n:globalThis.Buffer.from(n)),h$(globalThis.Buffer.concat(t,e))):(t,e)=>{const n=new Uint8Array(e);let r=0;for(let i of t)r+i.length>n.length&&(i=i.subarray(0,n.length-r)),n.set(i,r),r+=i.length;return n},Nee=og?t=>globalThis.Buffer.allocUnsafe(t):t=>new Uint8Array(t);function Iee(t,e){if(ex(t)&&ex(e))return t.compare(e);for(let n=0;n55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&a.push(239,191,189);continue}else if(o+1===r){(e-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;a.push(n)}else if(n<2048){if((e-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((e-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((e-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return a}function Lk(t,e,n){const r=[];for(;e239?4:i>223?3:i>191?2:1;if(e+o<=n){let s,l,c,u;switch(o){case 1:i<128&&(a=i);break;case 2:s=t[e+1],(s&192)===128&&(u=(i&31)<<6|s&63,u>127&&(a=u));break;case 3:s=t[e+1],l=t[e+2],(s&192)===128&&(l&192)===128&&(u=(i&15)<<12|(s&63)<<6|l&63,u>2047&&(u<55296||u>57343)&&(a=u));break;case 4:s=t[e+1],l=t[e+2],c=t[e+3],(s&192)===128&&(l&192)===128&&(c&192)===128&&(u=(i&15)<<18|(s&63)<<12|(l&63)<<6|c&63,u>65535&&u<1114112&&(a=u))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),e+=o}return Ree(r)}const $k=4096;function Ree(t){const e=t.length;if(e<=$k)return String.fromCharCode.apply(String,t);let n="",r=0;for(;rr.length/2?(n=this.cursor===r.length?r:r.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):n=eO(r,0,this.cursor)}else n=_ee(this.chunks,this.cursor);return e&&this.reset(),n}}const $t="CBOR decode error:",p$="CBOR encode error:";function sg(t,e,n){if(t.length-e>>8,r&255])}else if(n>>24&255,r>>>16&255,r>>>8&255,r&255])}else{const r=BigInt(n);if(r>BigInt(32)&BigInt(4294967295));i[8]=a&255,a=a>>8,i[7]=a&255,a=a>>8,i[6]=a&255,a=a>>8,i[5]=a&255,i[4]=o&255,o=o>>8,i[3]=o&255,o=o>>8,i[2]=o&255,o=o>>8,i[1]=o&255,t.push(i)}else throw new Error(`${$t} encountered BigInt larger than allowable range`)}}wh.encodedSize=function(e){return Qa.encodedSize(e.value)};Qa.encodedSize=function(e){return en.value?1:0};function Uee(t,e,n,r){return new ut(de.negint,-1-yh(t,e+1,r),2)}function Fee(t,e,n,r){return new ut(de.negint,-1-mh(t,e+1,r),3)}function jee(t,e,n,r){return new ut(de.negint,-1-vh(t,e+1,r),5)}const tO=BigInt(-1),g$=BigInt(1);function zee(t,e,n,r){const i=bh(t,e+1,r);if(typeof i!="bigint"){const a=-1-i;if(a>=Number.MIN_SAFE_INTEGER)return new ut(de.negint,a,9)}if(r.allowBigInt!==!0)throw new Error(`${$t} integers outside of the safe integer range are not supported`);return new ut(de.negint,tO-BigInt(i),9)}function nO(t,e){const n=e.value,r=typeof n=="bigint"?n*tO-g$:n*-1-1;Qa(t,e.type.majorEncoded,r)}nO.encodedSize=function(e){const n=e.value,r=typeof n=="bigint"?n*tO-g$:n*-1-1;return rn.value?-1:0};function cv(t,e,n,r){sg(t,e,n+r);const i=eO(t,e+n,e+n+r);return new ut(de.bytes,i,n+r)}function Hee(t,e,n,r){return cv(t,e,1,n)}function Gee(t,e,n,r){return cv(t,e,2,yh(t,e+1,r))}function Vee(t,e,n,r){return cv(t,e,3,mh(t,e+1,r))}function Qee(t,e,n,r){return cv(t,e,5,vh(t,e+1,r))}function Kee(t,e,n,r){const i=bh(t,e+1,r);if(typeof i=="bigint")throw new Error(`${$t} 64-bit integer bytes lengths not supported`);return cv(t,e,9,i)}function tx(t){return t.encodedBytes===void 0&&(t.encodedBytes=t.type===de.string?kee(t.value):t.value),t.encodedBytes}function X2(t,e){const n=tx(e);Qa(t,e.type.majorEncoded,n.length),t.push(n)}X2.encodedSize=function(e){const n=tx(e);return Qa.encodedSize(n.length)+n.length};X2.compareTokens=function(e,n){return Wee(tx(e),tx(n))};function Wee(t,e){return t.lengthe.length?1:Iee(t,e)}function uv(t,e,n,r,i){const a=n+r;sg(t,e,a);const o=new ut(de.string,Cee(t,e+n,e+a),a);return i.retainStringBytes===!0&&(o.byteValue=eO(t,e+n,e+a)),o}function Jee(t,e,n,r){return uv(t,e,1,n,r)}function Yee(t,e,n,r){return uv(t,e,2,yh(t,e+1,r),r)}function Xee(t,e,n,r){return uv(t,e,3,mh(t,e+1,r),r)}function Zee(t,e,n,r){return uv(t,e,5,vh(t,e+1,r),r)}function qee(t,e,n,r){const i=bh(t,e+1,r);if(typeof i=="bigint")throw new Error(`${$t} 64-bit integer string lengths not supported`);return uv(t,e,9,i,r)}const ete=X2;function lg(t,e,n,r){return new ut(de.array,r,n)}function tte(t,e,n,r){return lg(t,e,1,n)}function nte(t,e,n,r){return lg(t,e,2,yh(t,e+1,r))}function rte(t,e,n,r){return lg(t,e,3,mh(t,e+1,r))}function ite(t,e,n,r){return lg(t,e,5,vh(t,e+1,r))}function ate(t,e,n,r){const i=bh(t,e+1,r);if(typeof i=="bigint")throw new Error(`${$t} 64-bit integer array lengths not supported`);return lg(t,e,9,i)}function ote(t,e,n,r){if(r.allowIndefinite===!1)throw new Error(`${$t} indefinite length items not allowed`);return lg(t,e,1,1/0)}function rO(t,e){Qa(t,de.array.majorEncoded,e.value)}rO.compareTokens=wh.compareTokens;rO.encodedSize=function(e){return Qa.encodedSize(e.value)};function cg(t,e,n,r){return new ut(de.map,r,n)}function ste(t,e,n,r){return cg(t,e,1,n)}function lte(t,e,n,r){return cg(t,e,2,yh(t,e+1,r))}function cte(t,e,n,r){return cg(t,e,3,mh(t,e+1,r))}function ute(t,e,n,r){return cg(t,e,5,vh(t,e+1,r))}function fte(t,e,n,r){const i=bh(t,e+1,r);if(typeof i=="bigint")throw new Error(`${$t} 64-bit integer map lengths not supported`);return cg(t,e,9,i)}function hte(t,e,n,r){if(r.allowIndefinite===!1)throw new Error(`${$t} indefinite length items not allowed`);return cg(t,e,1,1/0)}function iO(t,e){Qa(t,de.map.majorEncoded,e.value)}iO.compareTokens=wh.compareTokens;iO.encodedSize=function(e){return Qa.encodedSize(e.value)};function dte(t,e,n,r){return new ut(de.tag,n,1)}function pte(t,e,n,r){return new ut(de.tag,yh(t,e+1,r),2)}function gte(t,e,n,r){return new ut(de.tag,mh(t,e+1,r),3)}function yte(t,e,n,r){return new ut(de.tag,vh(t,e+1,r),5)}function mte(t,e,n,r){return new ut(de.tag,bh(t,e+1,r),9)}function aO(t,e){Qa(t,de.tag.majorEncoded,e.value)}aO.compareTokens=wh.compareTokens;aO.encodedSize=function(e){return Qa.encodedSize(e.value)};const vte=20,bte=21,wte=22,xte=23;function Ate(t,e,n,r){if(r.allowUndefined===!1)throw new Error(`${$t} undefined values are not supported`);return r.coerceUndefinedToNull===!0?new ut(de.null,null,1):new ut(de.undefined,void 0,1)}function Ete(t,e,n,r){if(r.allowIndefinite===!1)throw new Error(`${$t} indefinite length items not allowed`);return new ut(de.break,void 0,1)}function oO(t,e,n){if(n){if(n.allowNaN===!1&&Number.isNaN(t))throw new Error(`${$t} NaN values are not supported`);if(n.allowInfinity===!1&&(t===1/0||t===-1/0))throw new Error(`${$t} Infinity values are not supported`)}return new ut(de.float,t,e)}function Ste(t,e,n,r){return oO(lO(t,e+1),3,r)}function Pte(t,e,n,r){return oO(cO(t,e+1),5,r)}function Ote(t,e,n,r){return oO(b$(t,e+1),9,r)}function sO(t,e,n){const r=e.value;if(r===!1)t.push([de.float.majorEncoded|vte]);else if(r===!0)t.push([de.float.majorEncoded|bte]);else if(r===null)t.push([de.float.majorEncoded|wte]);else if(r===void 0)t.push([de.float.majorEncoded|xte]);else{let i,a=!1;(!n||n.float64!==!0)&&(m$(r),i=lO(eo,1),r===i||Number.isNaN(r)?(eo[0]=249,t.push(eo.slice(0,3)),a=!0):(v$(r),i=cO(eo,1),r===i&&(eo[0]=250,t.push(eo.slice(0,5)),a=!0))),a||(Tte(r),i=b$(eo,1),eo[0]=251,t.push(eo.slice(0,9)))}}sO.encodedSize=function(e,n){const r=e.value;if(r===!1||r===!0||r===null||r===void 0)return 1;if(!n||n.float64!==!0){m$(r);let i=lO(eo,1);if(r===i||Number.isNaN(r))return 3;if(v$(r),i=cO(eo,1),r===i)return 5}return 9};const y$=new ArrayBuffer(9),ba=new DataView(y$,1),eo=new Uint8Array(y$,0);function m$(t){if(t===1/0)ba.setUint16(0,31744,!1);else if(t===-1/0)ba.setUint16(0,64512,!1);else if(Number.isNaN(t))ba.setUint16(0,32256,!1);else{ba.setFloat32(0,t);const e=ba.getUint32(0),n=(e&2139095040)>>23,r=e&8388607;if(n===255)ba.setUint16(0,31744,!1);else if(n===0)ba.setUint16(0,(t&2147483648)>>16|r>>13,!1);else{const i=n-127;i<-24?ba.setUint16(0,0):i<-14?ba.setUint16(0,(e&2147483648)>>16|1<<24+i,!1):ba.setUint16(0,(e&2147483648)>>16|i+15<<10|r>>13,!1)}}}function lO(t,e){if(t.length-e<2)throw new Error(`${$t} not enough data for float16`);const n=(t[e]<<8)+t[e+1];if(n===31744)return 1/0;if(n===64512)return-1/0;if(n===32256)return NaN;const r=n>>10&31,i=n&1023;let a;return r===0?a=i*2**-24:r!==31?a=(i+1024)*2**(r-25):a=i===0?1/0:NaN,n&32768?-a:a}function v$(t){ba.setFloat32(0,t,!1)}function cO(t,e){if(t.length-e<4)throw new Error(`${$t} not enough data for float32`);const n=(t.byteOffset||0)+e;return new DataView(t.buffer,n,4).getFloat32(0,!1)}function Tte(t){ba.setFloat64(0,t,!1)}function b$(t,e){if(t.length-e<8)throw new Error(`${$t} not enough data for float64`);const n=(t.byteOffset||0)+e;return new DataView(t.buffer,n,8).getFloat64(0,!1)}sO.compareTokens=wh.compareTokens;function tn(t,e,n){throw new Error(`${$t} encountered invalid minor (${n}) for major ${t[e]>>>5}`)}function Z2(t){return()=>{throw new Error(`${$t} ${t}`)}}const Ie=[];for(let t=0;t<=23;t++)Ie[t]=tn;Ie[24]=Bee;Ie[25]=Dee;Ie[26]=Lee;Ie[27]=$ee;Ie[28]=tn;Ie[29]=tn;Ie[30]=tn;Ie[31]=tn;for(let t=32;t<=55;t++)Ie[t]=tn;Ie[56]=Uee;Ie[57]=Fee;Ie[58]=jee;Ie[59]=zee;Ie[60]=tn;Ie[61]=tn;Ie[62]=tn;Ie[63]=tn;for(let t=64;t<=87;t++)Ie[t]=Hee;Ie[88]=Gee;Ie[89]=Vee;Ie[90]=Qee;Ie[91]=Kee;Ie[92]=tn;Ie[93]=tn;Ie[94]=tn;Ie[95]=Z2("indefinite length bytes/strings are not supported");for(let t=96;t<=119;t++)Ie[t]=Jee;Ie[120]=Yee;Ie[121]=Xee;Ie[122]=Zee;Ie[123]=qee;Ie[124]=tn;Ie[125]=tn;Ie[126]=tn;Ie[127]=Z2("indefinite length bytes/strings are not supported");for(let t=128;t<=151;t++)Ie[t]=tte;Ie[152]=nte;Ie[153]=rte;Ie[154]=ite;Ie[155]=ate;Ie[156]=tn;Ie[157]=tn;Ie[158]=tn;Ie[159]=ote;for(let t=160;t<=183;t++)Ie[t]=ste;Ie[184]=lte;Ie[185]=cte;Ie[186]=ute;Ie[187]=fte;Ie[188]=tn;Ie[189]=tn;Ie[190]=tn;Ie[191]=hte;for(let t=192;t<=215;t++)Ie[t]=dte;Ie[216]=pte;Ie[217]=gte;Ie[218]=yte;Ie[219]=mte;Ie[220]=tn;Ie[221]=tn;Ie[222]=tn;Ie[223]=tn;for(let t=224;t<=243;t++)Ie[t]=Z2("simple values are not supported");Ie[244]=tn;Ie[245]=tn;Ie[246]=tn;Ie[247]=Ate;Ie[248]=Z2("simple values are not supported");Ie[249]=Ste;Ie[250]=Pte;Ie[251]=Ote;Ie[252]=tn;Ie[253]=tn;Ie[254]=tn;Ie[255]=Ete;const gs=[];for(let t=0;t<24;t++)gs[t]=new ut(de.uint,t,1);for(let t=-1;t>=-24;t--)gs[31-t]=new ut(de.negint,t,1);gs[64]=new ut(de.bytes,new Uint8Array(0),1);gs[96]=new ut(de.string,"",1);gs[128]=new ut(de.array,0,1);gs[160]=new ut(de.map,0,1);gs[244]=new ut(de.false,!1,1);gs[245]=new ut(de.true,!0,1);gs[246]=new ut(de.null,null,1);function Cte(t){switch(t.type){case de.false:return bs([244]);case de.true:return bs([245]);case de.null:return bs([246]);case de.bytes:return t.value.length?void 0:bs([64]);case de.string:return t.value===""?bs([96]):void 0;case de.array:return t.value===0?bs([128]):void 0;case de.map:return t.value===0?bs([160]):void 0;case de.uint:return t.value<24?bs([Number(t.value)]):void 0;case de.negint:if(t.value>=-24)return bs([31-Number(t.value)])}}const kte={float64:!1,mapSorter:Ite,quickEncodeToken:Cte};function _te(){const t=[];return t[de.uint.major]=wh,t[de.negint.major]=nO,t[de.bytes.major]=X2,t[de.string.major]=ete,t[de.array.major]=rO,t[de.map.major]=iO,t[de.tag.major]=aO,t[de.float.major]=sO,t}const w$=_te(),X6=new d$;class nx{constructor(e,n){this.obj=e,this.parent=n}includes(e){let n=this;do if(n.obj===e)return!0;while(n=n.parent);return!1}static createCheck(e,n){if(e&&e.includes(n))throw new Error(`${p$} object contains circular references`);return new nx(n,e)}}const Ql={null:new ut(de.null,null),undefined:new ut(de.undefined,void 0),true:new ut(de.true,!0),false:new ut(de.false,!1),emptyArray:new ut(de.array,0),emptyMap:new ut(de.map,0)},eu={number(t,e,n,r){return!Number.isInteger(t)||!Number.isSafeInteger(t)?new ut(de.float,t):t>=0?new ut(de.uint,t):new ut(de.negint,t)},bigint(t,e,n,r){return t>=BigInt(0)?new ut(de.uint,t):new ut(de.negint,t)},Uint8Array(t,e,n,r){return new ut(de.bytes,t)},string(t,e,n,r){return new ut(de.string,t)},boolean(t,e,n,r){return t?Ql.true:Ql.false},null(t,e,n,r){return Ql.null},undefined(t,e,n,r){return Ql.undefined},ArrayBuffer(t,e,n,r){return new ut(de.bytes,new Uint8Array(t))},DataView(t,e,n,r){return new ut(de.bytes,new Uint8Array(t.buffer,t.byteOffset,t.byteLength))},Array(t,e,n,r){if(!t.length)return n.addBreakTokens===!0?[Ql.emptyArray,new ut(de.break)]:Ql.emptyArray;r=nx.createCheck(r,t);const i=[];let a=0;for(const o of t)i[a++]=ew(o,n,r);return n.addBreakTokens?[new ut(de.array,t.length),i,new ut(de.break)]:[new ut(de.array,t.length),i]},Object(t,e,n,r){const i=e!=="Object",a=i?t.keys():Object.keys(t),o=i?t.size:a.length;if(!o)return n.addBreakTokens===!0?[Ql.emptyMap,new ut(de.break)]:Ql.emptyMap;r=nx.createCheck(r,t);const s=[];let l=0;for(const c of a)s[l++]=[ew(c,n,r),ew(i?t.get(c):t[c],n,r)];return Nte(s,n),n.addBreakTokens?[new ut(de.map,o),s,new ut(de.break)]:[new ut(de.map,o),s]}};eu.Map=eu.Object;eu.Buffer=eu.Uint8Array;for(const t of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))eu[`${t}Array`]=eu.DataView;function ew(t,e={},n){const r=Eee(t),i=e&&e.typeEncoders&&e.typeEncoders[r]||eu[r];if(typeof i=="function"){const o=i(t,r,e,n);if(o!=null)return o}const a=eu[r];if(!a)throw new Error(`${p$} unsupported type: ${r}`);return a(t,r,e,n)}function Nte(t,e){e.mapSorter&&t.sort(e.mapSorter)}function Ite(t,e){const n=Array.isArray(t[0])?t[0][0]:t[0],r=Array.isArray(e[0])?e[0][0]:e[0];if(n.type!==r.type)return n.type.compare(r.type);const i=n.type.major,a=w$[i].compareTokens(n,r);return a===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),a}function x$(t,e,n,r){if(Array.isArray(e))for(const i of e)x$(t,i,n,r);else n[e.type.major](t,e,r)}function Rte(t,e,n){const r=ew(t,n);if(!Array.isArray(r)&&n.quickEncodeToken){const i=n.quickEncodeToken(r);if(i)return i;const a=e[r.type.major];if(a.encodedSize){const o=a.encodedSize(r,n),s=new d$(o);if(a(s,r,n),s.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${r} was wrong`);return h$(s.chunks[0])}}return X6.reset(),x$(X6,r,e,n),X6.toBytes(!0)}function jh(t,e){return e=Object.assign({},kte,e),Rte(t,w$,e)}const Mte={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0};class Bte{constructor(e,n={}){this.pos=0,this.data=e,this.options=n}done(){return this.pos>=this.data.length}next(){const e=this.data[this.pos];let n=gs[e];if(n===void 0){const r=Ie[e];if(!r)throw new Error(`${$t} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);const i=e&31;n=r(this.data,this.pos,i,this.options)}return this.pos+=n.encodedLength,n}}const p1=Symbol.for("DONE"),q2=Symbol.for("BREAK");function Dte(t,e,n){const r=[];for(let i=0;ia.trim());for(let a=0;aPromise.resolve(t[r])))).reduce((r,i,a)=>(r[e[a]]=i,r),{})}function mt(t,e,n){for(let r in e){let i=e[r];const a=n?n[r]:null;a&&Ute(i,a,r),Object.defineProperty(t,r,{enumerable:!0,value:i,writable:!1})}}function hd(t){if(t==null)return"null";if(Array.isArray(t))return"[ "+t.map(hd).join(", ")+" ]";if(t instanceof Uint8Array){const e="0123456789abcdef";let n="0x";for(let r=0;r>4],n+=e[t[r]&15];return n}if(typeof t=="object"&&typeof t.toJSON=="function")return hd(t.toJSON());switch(typeof t){case"boolean":case"symbol":return t.toString();case"bigint":return BigInt(t).toString();case"number":return t.toString();case"string":return JSON.stringify(t);case"object":{const e=Object.keys(t);return e.sort(),"{ "+e.map(n=>`${hd(n)}: ${hd(t[n])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Kr(t,e){return t&&t.code===e}function uO(t){return Kr(t,"CALL_EXCEPTION")}function er(t,e,n){let r=t;{const a=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${hd(n)}`);for(const o in n){if(o==="shortMessage")continue;const s=n[o];a.push(o+"="+hd(s))}}a.push(`code=${e}`),a.push(`version=${$te}`),a.length&&(t+=" ("+a.join(", ")+")")}let i;switch(e){case"INVALID_ARGUMENT":i=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":i=new RangeError(t);break;default:i=new Error(t)}return mt(i,{code:e}),n&&Object.assign(i,n),i.shortMessage==null&&mt(i,{shortMessage:r}),i}function me(t,e,n,r){if(!t)throw er(e,n,r)}function Y(t,e,n,r){me(t,e,"INVALID_ARGUMENT",{argument:n,value:r})}function A$(t,e,n){n==null&&(n=""),n&&(n=": "+n),me(t>=e,"missing arguemnt"+n,"MISSING_ARGUMENT",{count:t,expectedCount:e}),me(t<=e,"too many arguemnts"+n,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}const Fte=["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");t.push(e)}catch{}return t},[]);function jte(t){me(Fte.indexOf(t)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:t}})}function eA(t,e,n){if(n==null&&(n=""),t!==e){let r=n,i="new";n&&(r+=".",i+=" "+n),me(!1,`private constructor; use ${r}from* methods`,"UNSUPPORTED_OPERATION",{operation:i})}}function E$(t,e,n){if(t instanceof Uint8Array)return n?new Uint8Array(t):t;if(typeof t=="string"&&t.match(/^0x([0-9a-f][0-9a-f])*$/i)){const r=new Uint8Array((t.length-2)/2);let i=2;for(let a=0;a>4]+Uk[i&15]}return n}function lr(t){return"0x"+t.map(e=>Ze(e).substring(2)).join("")}function Nd(t){return In(t,!0)?(t.length-2)/2:Pt(t).length}function Fn(t,e,n){const r=Pt(t);return n!=null&&n>r.length&&me(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n}),Ze(r.slice(e??0,n??r.length))}function S$(t,e,n){const r=Pt(t);me(e>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),n?i.set(r,e-r.length):i.set(r,0),Ze(i)}function sh(t,e){return S$(t,e,!0)}function zte(t,e){return S$(t,e,!1)}const tA=BigInt(0),wo=BigInt(1),dd=9007199254740991;function Hte(t,e){const n=nA(t,"value"),r=BigInt(Lt(e,"width"));if(me(n>>r===tA,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),n>>r-wo){const i=(wo<=-dd&&t<=dd,"overflow",e||"value",t),BigInt(t);case"string":try{if(t==="")throw new Error("empty string");return t[0]==="-"&&t[1]!=="-"?-BigInt(t.substring(1)):BigInt(t)}catch(n){Y(!1,`invalid BigNumberish string: ${n.message}`,e||"value",t)}}Y(!1,"invalid BigNumberish value",e||"value",t)}function nA(t,e){const n=ot(t,e);return me(n>=tA,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),n}const Fk="0123456789abcdef";function fO(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=Fk[n>>4],e+=Fk[n&15];return BigInt(e)}return ot(t)}function Lt(t,e){switch(typeof t){case"bigint":return Y(t>=-dd&&t<=dd,"overflow",e||"value",t),Number(t);case"number":return Y(Number.isInteger(t),"underflow",e||"value",t),Y(t>=-dd&&t<=dd,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return Lt(BigInt(t),e)}catch(n){Y(!1,`invalid numeric string: ${n.message}`,e||"value",t)}}Y(!1,"invalid numeric value",e||"value",t)}function Gte(t){return Lt(fO(t))}function fs(t,e){let r=nA(t,"value").toString(16);if(e==null)r.length%2&&(r="0"+r);else{const i=Lt(e,"width");for(me(i*2>=r.length,`value exceeds width (${i} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});r.length>6===2;o++)a++;return a}return t==="OVERRUN"?n.length-e-1:0}function Jte(t,e,n,r,i){return t==="OVERLONG"?(Y(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),r.push(i),0):(r.push(65533),T$(t,e,n))}const Yte=Object.freeze({error:Wte,ignore:T$,replace:Jte});function Xte(t,e){e==null&&(e=Yte.error);const n=Pt(t,"bytes"),r=[];let i=0;for(;i>7)){r.push(a);continue}let o=null,s=null;if((a&224)===192)o=1,s=127;else if((a&240)===224)o=2,s=2047;else if((a&248)===240)o=3,s=65535;else{(a&192)===128?i+=e("UNEXPECTED_CONTINUE",i-1,n,r):i+=e("BAD_PREFIX",i-1,n,r);continue}if(i-1+o>=n.length){i+=e("OVERRUN",i-1,n,r);continue}let l=a&(1<<8-o-1)-1;for(let c=0;c1114111){i+=e("OUT_OF_RANGE",i-1-o,n,r,l);continue}if(l>=55296&&l<=57343){i+=e("UTF16_SURROGATE",i-1-o,n,r,l);continue}if(l<=s){i+=e("OVERLONG",i-1-o,n,r,l);continue}r.push(l)}}return r}function dl(t,e){e!=null&&(jte(e),t=t.normalize(e));let n=[];for(let r=0;r>6|192),n.push(i&63|128);else if((i&64512)==55296){r++;const a=t.charCodeAt(r);Y(r>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(o&63|128)}else n.push(i>>12|224),n.push(i>>6&63|128),n.push(i&63|128)}return new Uint8Array(n)}function Zte(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function hO(t,e){return Zte(Xte(t,e))}function C$(t){async function e(n,r){const i=n.url.split(":")[0].toLowerCase();me(i==="http"||i==="https",`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),me(i==="https"||!n.credentials||n.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let a;if(r){const f=new AbortController;a=f.signal,r.addListener(()=>{f.abort()})}const o={method:n.method,headers:new Headers(Array.from(n)),body:n.body||void 0,signal:a},s=await fetch(n.url,o),l={};s.headers.forEach((f,h)=>{l[h.toLowerCase()]=f});const c=await s.arrayBuffer(),u=c==null?null:new Uint8Array(c);return{statusCode:s.status,statusMessage:s.statusText,headers:l,body:u}}return e}const qte=12,ene=250;let Hk=C$();const tne=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),nne=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let Z6=!1;async function k$(t,e){try{const n=t.match(tne);if(!n)throw new Error("invalid data");return new Jc(200,"OK",{"content-type":n[1]||"text/plain"},n[2]?Qte(n[3]):ine(n[3]))}catch{return new Jc(599,"BAD REQUEST (invalid data: URI)",{},null,new Sl(t))}}function _$(t){async function e(n,r){try{const i=n.match(nne);if(!i)throw new Error("invalid link");return new Sl(`${t}${i[2]}`)}catch{return new Jc(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Sl(n))}}return e}const Zv={data:k$,ipfs:_$("https://gateway.ipfs.io/ipfs/")},N$=new WeakMap;var yf,mc;class rne{constructor(e){M(this,yf,void 0);M(this,mc,void 0);O(this,yf,[]),O(this,mc,!1),N$.set(e,()=>{if(!b(this,mc)){O(this,mc,!0);for(const n of b(this,yf))setTimeout(()=>{n()},0);O(this,yf,[])}})}addListener(e){me(!b(this,mc),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),b(this,yf).push(e)}get cancelled(){return b(this,mc)}checkSignal(){me(!this.cancelled,"cancelled","CANCELLED",{})}}yf=new WeakMap,mc=new WeakMap;function qv(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}var P0,O0,lo,Hs,T0,C0,fr,qi,Gs,mf,vf,bf,Vo,Vs,vc,wf,cy;const u2=class u2{constructor(e){M(this,wf);M(this,P0,void 0);M(this,O0,void 0);M(this,lo,void 0);M(this,Hs,void 0);M(this,T0,void 0);M(this,C0,void 0);M(this,fr,void 0);M(this,qi,void 0);M(this,Gs,void 0);M(this,mf,void 0);M(this,vf,void 0);M(this,bf,void 0);M(this,Vo,void 0);M(this,Vs,void 0);M(this,vc,void 0);O(this,C0,String(e)),O(this,P0,!1),O(this,O0,!0),O(this,lo,{}),O(this,Hs,""),O(this,T0,3e5),O(this,Vs,{slotInterval:ene,maxAttempts:qte}),O(this,vc,null)}get url(){return b(this,C0)}set url(e){O(this,C0,String(e))}get body(){return b(this,fr)==null?null:new Uint8Array(b(this,fr))}set body(e){if(e==null)O(this,fr,void 0),O(this,qi,void 0);else if(typeof e=="string")O(this,fr,dl(e)),O(this,qi,"text/plain");else if(e instanceof Uint8Array)O(this,fr,e),O(this,qi,"application/octet-stream");else if(typeof e=="object")O(this,fr,dl(JSON.stringify(e))),O(this,qi,"application/json");else throw new Error("invalid body")}hasBody(){return b(this,fr)!=null}get method(){return b(this,Hs)?b(this,Hs):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),O(this,Hs,String(e).toUpperCase())}get headers(){const e=Object.assign({},b(this,lo));return b(this,Gs)&&(e.authorization=`Basic ${Kte(dl(b(this,Gs)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&b(this,qi)&&(e["content-type"]=b(this,qi)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,n){b(this,lo)[String(e).toLowerCase()]=String(n)}clearHeaders(){O(this,lo,{})}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r=0,"timeout must be non-zero","timeout",e),O(this,T0,e)}get preflightFunc(){return b(this,mf)||null}set preflightFunc(e){O(this,mf,e)}get processFunc(){return b(this,vf)||null}set processFunc(e){O(this,vf,e)}get retryFunc(){return b(this,bf)||null}set retryFunc(e){O(this,bf,e)}get getUrlFunc(){return b(this,vc)||Hk}set getUrlFunc(e){O(this,vc,e)}toString(){return``}setThrottleParams(e){e.slotInterval!=null&&(b(this,Vs).slotInterval=e.slotInterval),e.maxAttempts!=null&&(b(this,Vs).maxAttempts=e.maxAttempts)}send(){return me(b(this,Vo)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),O(this,Vo,new rne(this)),ie(this,wf,cy).call(this,0,Gk()+this.timeout,0,this,new Jc(0,"",{},null,this))}cancel(){me(b(this,Vo)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=N$.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const n=this.url.split(":")[0].toLowerCase(),r=e.split(":")[0].toLowerCase();me(this.method==="GET"&&(n!=="https"||r!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const i=new u2(e);return i.method="GET",i.allowGzip=this.allowGzip,i.timeout=this.timeout,O(i,lo,Object.assign({},b(this,lo))),b(this,fr)&&O(i,fr,new Uint8Array(b(this,fr))),O(i,qi,b(this,qi)),i}clone(){const e=new u2(this.url);return O(e,Hs,b(this,Hs)),b(this,fr)&&O(e,fr,b(this,fr)),O(e,qi,b(this,qi)),O(e,lo,Object.assign({},b(this,lo))),O(e,Gs,b(this,Gs)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),O(e,mf,b(this,mf)),O(e,vf,b(this,vf)),O(e,bf,b(this,bf)),O(e,vc,b(this,vc)),e}static lockConfig(){Z6=!0}static getGateway(e){return Zv[e.toLowerCase()]||null}static registerGateway(e,n){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(Z6)throw new Error("gateways locked");Zv[e]=n}static registerGetUrl(e){if(Z6)throw new Error("gateways locked");Hk=e}static createGetUrlFunc(e){return C$()}static createDataGateway(){return k$}static createIpfsGatewayFunc(e){return _$(e)}};P0=new WeakMap,O0=new WeakMap,lo=new WeakMap,Hs=new WeakMap,T0=new WeakMap,C0=new WeakMap,fr=new WeakMap,qi=new WeakMap,Gs=new WeakMap,mf=new WeakMap,vf=new WeakMap,bf=new WeakMap,Vo=new WeakMap,Vs=new WeakMap,vc=new WeakMap,wf=new WeakSet,cy=async function(e,n,r,i,a){var u,f,h;if(e>=b(this,Vs).maxAttempts)return a.makeServerError("exceeded maximum retry limit");me(Gk()<=n,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),r>0&&await ane(r);let o=this.clone();const s=(o.url.split(":")[0]||"").toLowerCase();if(s in Zv){const d=await Zv[s](o.url,qv(b(i,Vo)));if(d instanceof Jc){let g=d;if(this.processFunc){qv(b(i,Vo));try{g=await this.processFunc(o,g)}catch(p){(p.throttle==null||typeof p.stall!="number")&&g.makeServerError("error in post-processing function",p).assertOk()}}return g}o=d}this.preflightFunc&&(o=await this.preflightFunc(o));const l=await this.getUrlFunc(o,qv(b(i,Vo)));let c=new Jc(l.statusCode,l.statusMessage,l.headers,l.body,i);if(c.statusCode===301||c.statusCode===302){try{const d=c.headers.location||"";return ie(u=o.redirect(d),wf,cy).call(u,e+1,n,0,i,c)}catch{}return c}else if(c.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,c,e))){const d=c.headers["retry-after"];let g=b(this,Vs).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof d=="string"&&d.match(/^[1-9][0-9]*$/)&&(g=parseInt(d)),ie(f=o.clone(),wf,cy).call(f,e+1,n,g,i,c)}if(this.processFunc){qv(b(i,Vo));try{c=await this.processFunc(o,c)}catch(d){(d.throttle==null||typeof d.stall!="number")&&c.makeServerError("error in post-processing function",d).assertOk();let g=b(this,Vs).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return d.stall>=0&&(g=d.stall),ie(h=o.clone(),wf,cy).call(h,e+1,n,g,i,c)}}return c};let Sl=u2;var Nm,Im,Rm,co,k0,xf;const L4=class L4{constructor(e,n,r,i,a){M(this,Nm,void 0);M(this,Im,void 0);M(this,Rm,void 0);M(this,co,void 0);M(this,k0,void 0);M(this,xf,void 0);O(this,Nm,e),O(this,Im,n),O(this,Rm,Object.keys(r).reduce((o,s)=>(o[s.toLowerCase()]=String(r[s]),o),{})),O(this,co,i==null?null:new Uint8Array(i)),O(this,k0,a||null),O(this,xf,{message:""})}toString(){return``}get statusCode(){return b(this,Nm)}get statusMessage(){return b(this,Im)}get headers(){return Object.assign({},b(this,Rm))}get body(){return b(this,co)==null?null:new Uint8Array(b(this,co))}get bodyText(){try{return b(this,co)==null?"":hO(b(this,co))}catch{me(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{me(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r=0,"invalid stall timeout","stall",n);const r=new Error(e||"throttling requests");throw mt(r,{stall:n,throttle:!0}),r}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return b(this,co)!=null}get request(){return b(this,k0)}ok(){return b(this,xf).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:n}=b(this,xf);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`),me(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:n})}};Nm=new WeakMap,Im=new WeakMap,Rm=new WeakMap,co=new WeakMap,k0=new WeakMap,xf=new WeakMap;let Jc=L4;function Gk(){return new Date().getTime()}function ine(t){return dl(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,n)=>String.fromCharCode(parseInt(n,16))))}function ane(t){return new Promise(e=>setTimeout(e,t))}function one(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function Vk(t,e,n){let r=0;for(let i=0;i{me(r<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:r})};if(t[e]>=248){const r=t[e]-247;n(e+1+r);const i=Vk(t,e+1,r);return n(e+1+r+i),Qk(t,e,e+1+r,r+i)}else if(t[e]>=192){const r=t[e]-192;return n(e+1+r),Qk(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;n(e+1+r);const i=Vk(t,e+1,r);n(e+1+r+i);const a=Ze(t.slice(e+1+r,e+1+r+i));return{consumed:1+r+i,result:a}}else if(t[e]>=128){const r=t[e]-128;n(e+1+r);const i=Ze(t.slice(e+1,e+1+r));return{consumed:1+r,result:i}}return{consumed:1,result:one(t[e])}}function dO(t){const e=Pt(t,"data"),n=I$(e,0);return Y(n.consumed===e.length,"unexpected junk after rlp payload","data",t),n.result}function Kk(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function R$(t){if(Array.isArray(t)){let r=[];if(t.forEach(function(a){r=r.concat(R$(a))}),r.length<=55)return r.unshift(192+r.length),r;const i=Kk(r.length);return i.unshift(247+i.length),i.concat(r)}const e=Array.prototype.slice.call(Pt(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const n=Kk(e.length);return n.unshift(183+n.length),n.concat(e)}const Wk="0123456789abcdef";function y1(t){let e="0x";for(const n of R$(t))e+=Wk[n>>4],e+=Wk[n&15];return e}const ui=32,A3=new Uint8Array(ui),sne=["then"],eb={};function Ug(t,e){const n=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw n.error=e,n}var bc;const Fy=class Fy extends Array{constructor(...n){const r=n[0];let i=n[1],a=(n[2]||[]).slice(),o=!0;r!==eb&&(i=n,a=[],o=!1);super(i.length);M(this,bc,void 0);i.forEach((l,c)=>{this[c]=l});const s=a.reduce((l,c)=>(typeof c=="string"&&l.set(c,(l.get(c)||0)+1),l),new Map);if(O(this,bc,Object.freeze(i.map((l,c)=>{const u=a[c];return u!=null&&s.get(u)===1?u:null}))),!!o)return Object.freeze(this),new Proxy(this,{get:(l,c,u)=>{if(typeof c=="string"){if(c.match(/^[0-9]+$/)){const h=Lt(c,"%index");if(h<0||h>=this.length)throw new RangeError("out of result range");const d=l[h];return d instanceof Error&&Ug(`index ${h}`,d),d}if(sne.indexOf(c)>=0)return Reflect.get(l,c,u);const f=l[c];if(f instanceof Function)return function(...h){return f.apply(this===u?l:this,h)};if(!(c in l))return l.getValue.apply(this===u?l:this,[c])}return Reflect.get(l,c,u)}})}toArray(){const n=[];return this.forEach((r,i)=>{r instanceof Error&&Ug(`index ${i}`,r),n.push(r)}),n}toObject(){return b(this,bc).reduce((n,r,i)=>(me(r!=null,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"}),r in n||(n[r]=this.getValue(r)),n),{})}slice(n,r){n==null&&(n=0),n<0&&(n+=this.length,n<0&&(n=0)),r==null&&(r=this.length),r<0&&(r+=this.length,r<0&&(r=0)),r>this.length&&(r=this.length);const i=[],a=[];for(let o=n;o{b(this,Qs)[e]=Jk(n)}}}Qs=new WeakMap,Af=new WeakMap,_0=new WeakSet,nw=function(e){return b(this,Qs).push(e),O(this,Af,b(this,Af)+e.length),e.length};var Ai,ea,Ef,Sf,wc,Mm,P3,f2,M$;const $4=class $4{constructor(e,n,r){M(this,Mm);M(this,f2);R(this,"allowLoose");M(this,Ai,void 0);M(this,ea,void 0);M(this,Ef,void 0);M(this,Sf,void 0);M(this,wc,void 0);mt(this,{allowLoose:!!n}),O(this,Ai,Or(e)),O(this,Ef,0),O(this,Sf,null),O(this,wc,r??1024),O(this,ea,0)}get data(){return Ze(b(this,Ai))}get dataLength(){return b(this,Ai).length}get consumed(){return b(this,ea)}get bytes(){return new Uint8Array(b(this,Ai))}subReader(e){const n=new $4(b(this,Ai).slice(b(this,ea)+e),this.allowLoose,b(this,wc));return O(n,Sf,this),n}readBytes(e,n){let r=ie(this,f2,M$).call(this,0,e,!!n);return ie(this,Mm,P3).call(this,e),O(this,ea,b(this,ea)+r.length),r.slice(0,e)}readValue(){return fO(this.readBytes(ui))}readIndex(){return Gte(this.readBytes(ui))}};Ai=new WeakMap,ea=new WeakMap,Ef=new WeakMap,Sf=new WeakMap,wc=new WeakMap,Mm=new WeakSet,P3=function(e){var n;if(b(this,Sf))return ie(n=b(this,Sf),Mm,P3).call(n,e);O(this,Ef,b(this,Ef)+e),me(b(this,wc)<1||b(this,Ef)<=b(this,wc)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${b(this,wc)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:Or(b(this,Ai)),offset:b(this,ea),length:e,info:{bytesRead:b(this,Ef),dataLength:this.dataLength}})},f2=new WeakSet,M$=function(e,n,r){let i=Math.ceil(n/ui)*ui;return b(this,ea)+i>b(this,Ai).length&&(this.allowLoose&&r&&b(this,ea)+n<=b(this,Ai).length?i=n:me(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Or(b(this,Ai)),length:b(this,Ai).length,offset:b(this,ea)+i})),b(this,Ai).slice(b(this,ea),b(this,ea)+i)};let S3=$4,B$=!1;const D$=function(t){return GD(t)};let L$=D$;function Nn(t){const e=Pt(t,"data");return Ze(L$(e))}Nn._=D$;Nn.lock=function(){B$=!0};Nn.register=function(t){if(B$)throw new TypeError("keccak256 is locked");L$=t};Object.freeze(Nn);const O3="0x0000000000000000000000000000000000000000",Yk="0x0000000000000000000000000000000000000000000000000000000000000000",Xk=BigInt(0),Zk=BigInt(1),qk=BigInt(2),e_=BigInt(27),t_=BigInt(28),tb=BigInt(35),_h={};function n_(t){return sh(sa(t),32)}var N0,I0,R0,Pf;const to=class to{constructor(e,n,r,i){M(this,N0,void 0);M(this,I0,void 0);M(this,R0,void 0);M(this,Pf,void 0);eA(e,_h,"Signature"),O(this,N0,n),O(this,I0,r),O(this,R0,i),O(this,Pf,null)}get r(){return b(this,N0)}set r(e){Y(Nd(e)===32,"invalid r","value",e),O(this,N0,Ze(e))}get s(){return b(this,I0)}set s(e){Y(Nd(e)===32,"invalid s","value",e);const n=Ze(e);Y(parseInt(n.substring(0,3))<8,"non-canonical s","value",n),O(this,I0,n)}get v(){return b(this,R0)}set v(e){const n=Lt(e,"value");Y(n===27||n===28,"invalid v","v",e),O(this,R0,n)}get networkV(){return b(this,Pf)}get legacyChainId(){const e=this.networkV;return e==null?null:to.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=Pt(this.s);return this.yParity&&(e[0]|=128),Ze(e)}get compactSerialized(){return lr([this.r,this.yParityAndS])}get serialized(){return lr([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new to(_h,this.r,this.s,this.v);return this.networkV&&O(e,Pf,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(e){const n=ot(e,"v");return n==e_||n==t_?Xk:(Y(n>=tb,"invalid EIP-155 v","v",e),(n-tb)/qk)}static getChainIdV(e,n){return ot(e)*qk+BigInt(35+n-27)}static getNormalizedV(e){const n=ot(e);return n===Xk||n===e_?27:n===Zk||n===t_?28:(Y(n>=tb,"invalid v","v",e),n&Zk?27:28)}static from(e){function n(c,u){Y(c,u,"signature",e)}if(e==null)return new to(_h,Yk,Yk,27);if(typeof e=="string"){const c=Pt(e,"signature");if(c.length===64){const u=Ze(c.slice(0,32)),f=c.slice(32,64),h=f[0]&128?28:27;return f[0]&=127,new to(_h,u,Ze(f),h)}if(c.length===65){const u=Ze(c.slice(0,32)),f=c.slice(32,64);n((f[0]&128)===0,"non-canonical s");const h=to.getNormalizedV(c[64]);return new to(_h,u,Ze(f),h)}n(!1,"invalid raw signature length")}if(e instanceof to)return e.clone();const r=e.r;n(r!=null,"missing r");const i=n_(r),a=function(c,u){if(c!=null)return n_(c);if(u!=null){n(In(u,32),"invalid yParityAndS");const f=Pt(u);return f[0]&=127,Ze(f)}n(!1,"missing s")}(e.s,e.yParityAndS);n((Pt(a)[0]&128)==0,"non-canonical s");const{networkV:o,v:s}=function(c,u,f){if(c!=null){const h=ot(c);return{networkV:h>=tb?h:void 0,v:to.getNormalizedV(h)}}if(u!=null)return n(In(u,32),"invalid yParityAndS"),{v:Pt(u)[0]&128?28:27};if(f!=null){switch(Lt(f,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}n(!1,"invalid yParity")}n(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),l=new to(_h,i,a,s);return o&&O(l,Pf,o),n(e.yParity==null||Lt(e.yParity,"sig.yParity")===l.yParity,"yParity mismatch"),n(e.yParityAndS==null||e.yParityAndS===l.yParityAndS,"yParityAndS mismatch"),l}};N0=new WeakMap,I0=new WeakMap,R0=new WeakMap,Pf=new WeakMap;let To=to;var Ks;const ku=class ku{constructor(e){M(this,Ks,void 0);Y(Nd(e)===32,"invalid private key","privateKey","[REDACTED]"),O(this,Ks,Ze(e))}get privateKey(){return b(this,Ks)}get publicKey(){return ku.computePublicKey(b(this,Ks))}get compressedPublicKey(){return ku.computePublicKey(b(this,Ks),!0)}sign(e){Y(Nd(e)===32,"invalid digest length","digest",e);const n=ri.sign(Or(e),Or(b(this,Ks)),{lowS:!0});return To.from({r:fs(n.r,32),s:fs(n.s,32),v:n.recovery?28:27})}computeSharedSecret(e){const n=ku.computePublicKey(e);return Ze(ri.getSharedSecret(Or(b(this,Ks)),Pt(n),!1))}static computePublicKey(e,n){let r=Pt(e,"key");if(r.length===32){const a=ri.getPublicKey(r,!!n);return Ze(a)}if(r.length===64){const a=new Uint8Array(65);a[0]=4,a.set(r,1),r=a}const i=ri.ProjectivePoint.fromHex(r);return Ze(i.toRawBytes(n))}static recoverPublicKey(e,n){Y(Nd(e)===32,"invalid digest length","digest",e);const r=To.from(n);let i=ri.Signature.fromCompact(Or(lr([r.r,r.s])));i=i.addRecoveryBit(r.yParity);const a=i.recoverPublicKey(Or(e));return Y(a!=null,"invalid signautre for digest","signature",n),"0x"+a.toHex(!1)}static addPoints(e,n,r){const i=ri.ProjectivePoint.fromHex(ku.computePublicKey(e).substring(2)),a=ri.ProjectivePoint.fromHex(ku.computePublicKey(n).substring(2));return"0x"+i.add(a).toHex(!!r)}};Ks=new WeakMap;let m1=ku;const lne=BigInt(0),cne=BigInt(36);function r_(t){t=t.toLowerCase();const e=t.substring(2).split(""),n=new Uint8Array(40);for(let i=0;i<40;i++)n[i]=e[i].charCodeAt(0);const r=Pt(Nn(n));for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(r[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const pO={};for(let t=0;t<10;t++)pO[String(t)]=String(t);for(let t=0;t<26;t++)pO[String.fromCharCode(65+t)]=String(10+t);const i_=15;function une(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(r=>pO[r]).join("");for(;e.length>=i_;){let r=e.substring(0,i_);e=parseInt(r,10)%97+e.substring(r.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}const fne=function(){const t={};for(let e=0;e<36;e++){const n="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[n]=BigInt(e)}return t}();function hne(t){t=t.toLowerCase();let e=lne;for(let n=0;ne.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 this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return b(this,Of)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return b(this,Of)===!0?-1:b(this,Of)===!1?this.value.length:null}static from(e,n){return new Os(Es,e,n)}static uint8(e){return Qe(e,8)}static uint16(e){return Qe(e,16)}static uint24(e){return Qe(e,24)}static uint32(e){return Qe(e,32)}static uint40(e){return Qe(e,40)}static uint48(e){return Qe(e,48)}static uint56(e){return Qe(e,56)}static uint64(e){return Qe(e,64)}static uint72(e){return Qe(e,72)}static uint80(e){return Qe(e,80)}static uint88(e){return Qe(e,88)}static uint96(e){return Qe(e,96)}static uint104(e){return Qe(e,104)}static uint112(e){return Qe(e,112)}static uint120(e){return Qe(e,120)}static uint128(e){return Qe(e,128)}static uint136(e){return Qe(e,136)}static uint144(e){return Qe(e,144)}static uint152(e){return Qe(e,152)}static uint160(e){return Qe(e,160)}static uint168(e){return Qe(e,168)}static uint176(e){return Qe(e,176)}static uint184(e){return Qe(e,184)}static uint192(e){return Qe(e,192)}static uint200(e){return Qe(e,200)}static uint208(e){return Qe(e,208)}static uint216(e){return Qe(e,216)}static uint224(e){return Qe(e,224)}static uint232(e){return Qe(e,232)}static uint240(e){return Qe(e,240)}static uint248(e){return Qe(e,248)}static uint256(e){return Qe(e,256)}static uint(e){return Qe(e,256)}static int8(e){return Qe(e,-8)}static int16(e){return Qe(e,-16)}static int24(e){return Qe(e,-24)}static int32(e){return Qe(e,-32)}static int40(e){return Qe(e,-40)}static int48(e){return Qe(e,-48)}static int56(e){return Qe(e,-56)}static int64(e){return Qe(e,-64)}static int72(e){return Qe(e,-72)}static int80(e){return Qe(e,-80)}static int88(e){return Qe(e,-88)}static int96(e){return Qe(e,-96)}static int104(e){return Qe(e,-104)}static int112(e){return Qe(e,-112)}static int120(e){return Qe(e,-120)}static int128(e){return Qe(e,-128)}static int136(e){return Qe(e,-136)}static int144(e){return Qe(e,-144)}static int152(e){return Qe(e,-152)}static int160(e){return Qe(e,-160)}static int168(e){return Qe(e,-168)}static int176(e){return Qe(e,-176)}static int184(e){return Qe(e,-184)}static int192(e){return Qe(e,-192)}static int200(e){return Qe(e,-200)}static int208(e){return Qe(e,-208)}static int216(e){return Qe(e,-216)}static int224(e){return Qe(e,-224)}static int232(e){return Qe(e,-232)}static int240(e){return Qe(e,-240)}static int248(e){return Qe(e,-248)}static int256(e){return Qe(e,-256)}static int(e){return Qe(e,-256)}static bytes1(e){return qt(e,1)}static bytes2(e){return qt(e,2)}static bytes3(e){return qt(e,3)}static bytes4(e){return qt(e,4)}static bytes5(e){return qt(e,5)}static bytes6(e){return qt(e,6)}static bytes7(e){return qt(e,7)}static bytes8(e){return qt(e,8)}static bytes9(e){return qt(e,9)}static bytes10(e){return qt(e,10)}static bytes11(e){return qt(e,11)}static bytes12(e){return qt(e,12)}static bytes13(e){return qt(e,13)}static bytes14(e){return qt(e,14)}static bytes15(e){return qt(e,15)}static bytes16(e){return qt(e,16)}static bytes17(e){return qt(e,17)}static bytes18(e){return qt(e,18)}static bytes19(e){return qt(e,19)}static bytes20(e){return qt(e,20)}static bytes21(e){return qt(e,21)}static bytes22(e){return qt(e,22)}static bytes23(e){return qt(e,23)}static bytes24(e){return qt(e,24)}static bytes25(e){return qt(e,25)}static bytes26(e){return qt(e,26)}static bytes27(e){return qt(e,27)}static bytes28(e){return qt(e,28)}static bytes29(e){return qt(e,29)}static bytes30(e){return qt(e,30)}static bytes31(e){return qt(e,31)}static bytes32(e){return qt(e,32)}static address(e){return new Os(Es,"address",e)}static bool(e){return new Os(Es,"bool",!!e)}static bytes(e){return new Os(Es,"bytes",e)}static string(e){return new Os(Es,"string",e)}static array(e,n){throw new Error("not implemented yet")}static tuple(e,n){throw new Error("not implemented yet")}static overrides(e){return new Os(Es,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===a_}static dereference(e,n){if(Os.isTyped(e)){if(e.type!==n)throw new Error(`invalid type: expecetd ${n}, got ${e.type}`);return e.value}return e}};Of=new WeakMap;let Wr=Os;class pne extends Ml{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,n){let r=Wr.dereference(n,"string");try{r=rn(r)}catch(i){return this._throwError(i.message,n)}return e.writeValue(r)}decode(e){return rn(fs(e.readValue(),20))}}class gne extends Ml{constructor(n){super(n.name,n.type,"_",n.dynamic);R(this,"coder");this.coder=n}defaultValue(){return this.coder.defaultValue()}encode(n,r){return this.coder.encode(n,r)}decode(n){return this.coder.decode(n)}}function U$(t,e,n){let r=[];if(Array.isArray(n))r=n;else if(n&&typeof n=="object"){let l={};r=e.map(c=>{const u=c.localName;return me(u,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:c},value:n}),me(!l[u],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:c},value:n}),l[u]=!0,n[u]})}else Y(!1,"invalid tuple value","tuple",n);Y(e.length===r.length,"types/value length mismatch","tuple",n);let i=new E3,a=new E3,o=[];e.forEach((l,c)=>{let u=r[c];if(l.dynamic){let f=a.length;l.encode(a,u);let h=i.writeUpdatableValue();o.push(d=>{h(d+f)})}else l.encode(i,u)}),o.forEach(l=>{l(i.length)});let s=t.appendWriter(i);return s+=t.appendWriter(a),s}function F$(t,e){let n=[],r=[],i=t.subReader(0);return e.forEach(a=>{let o=null;if(a.dynamic){let s=t.readIndex(),l=i.subReader(s);try{o=a.decode(l)}catch(c){if(Kr(c,"BUFFER_OVERRUN"))throw c;o=c,o.baseType=a.name,o.name=a.localName,o.type=a.type}}else try{o=a.decode(t)}catch(s){if(Kr(s,"BUFFER_OVERRUN"))throw s;o=s,o.baseType=a.name,o.name=a.localName,o.type=a.type}if(o==null)throw new Error("investigate");n.push(o),r.push(a.localName||null)}),ix.fromItems(n,r)}class yne extends Ml{constructor(n,r,i){const a=n.type+"["+(r>=0?r:"")+"]",o=r===-1||n.dynamic;super("array",a,i,o);R(this,"coder");R(this,"length");mt(this,{coder:n,length:r})}defaultValue(){const n=this.coder.defaultValue(),r=[];for(let i=0;io||i<-(o+Ene))&&this._throwError("value out-of-bounds",r),i=P$(i,8*ui)}else(ily(a,this.size*8))&&this._throwError("value out-of-bounds",r);return n.writeValue(i)}decode(n){let r=ly(n.readValue(),this.size*8);return this.signed&&(r=Hte(r,this.size*8)),r}}class One extends j${constructor(e){super("string",e)}defaultValue(){return""}encode(e,n){return super.encode(e,dl(Wr.dereference(n,"string")))}decode(e){return hO(super.decode(e))}}class nb extends Ml{constructor(n,r){let i=!1;const a=[];n.forEach(s=>{s.dynamic&&(i=!0),a.push(s.type)});const o="tuple("+a.join(",")+")";super("tuple",o,r,i);R(this,"coders");mt(this,{coders:Object.freeze(n.slice())})}defaultValue(){const n=[];this.coders.forEach(i=>{n.push(i.defaultValue())});const r=this.coders.reduce((i,a)=>{const o=a.localName;return o&&(i[o]||(i[o]=0),i[o]++),i},{});return this.coders.forEach((i,a)=>{let o=i.localName;!o||r[o]!==1||(o==="length"&&(o="_length"),n[o]==null&&(n[o]=n[a]))}),Object.freeze(n)}encode(n,r){const i=Wr.dereference(r,"tuple");return U$(n,this.coders,i)}decode(n){return F$(n,this.coders)}}function lh(t){return Nn(d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QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const o_=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),s_=4;function Cne(t){let e=0;function n(){return t[e++]<<8|t[e++]}let r=n(),i=1,a=[0,1];for(let S=1;S>--l&1}const f=31,h=2**f,d=h>>>1,g=d>>1,p=h-1;let m=0;for(let S=0;S1;){let B=E+T>>>1;S>>1|u(),C=C<<1^d,N=(N^d)<<1|d|1;v=C,x=1+N-C}let A=r-4;return y.map(S=>{switch(S-A){case 3:return A+65792+(t[s++]<<16|t[s++]<<8|t[s++]);case 2:return A+256+(t[s++]<<8|t[s++]);case 1:return A+t[s++];default:return S-1}})}function kne(t){let e=0;return()=>t[e++]}function z$(t){return kne(Cne(_ne(t)))}function _ne(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,a)=>e[i.charCodeAt(0)]=a);let n=t.length,r=new Uint8Array(6*n>>3);for(let i=0,a=0,o=0,s=0;i=8&&(r[a++]=s>>(o-=8));return r}function Nne(t){return t&1?~t>>1:t>>1}function Ine(t,e){let n=Array(t);for(let r=0,i=0;r{let e=v1(t);if(e.length)return e})}function G$(t){let e=[];for(;;){let n=t();if(n==0)break;e.push(Rne(n,t))}for(;;){let n=t()-1;if(n<0)break;e.push(Mne(n,t))}return e.flat()}function b1(t){let e=[];for(;;){let n=t(e.length);if(!n)break;e.push(n)}return e}function V$(t,e,n){let r=Array(t).fill().map(()=>[]);for(let i=0;ir[o].push(a));return r}function Rne(t,e){let n=1+e(),r=e(),i=b1(e);return V$(i.length,1+t,e).flatMap((o,s)=>{let[l,...c]=o;return Array(i[s]).fill().map((u,f)=>{let h=f*r;return[l+f*n,c.map(d=>d+h)]})})}function Mne(t,e){let n=1+e();return V$(n,1+t,e).map(i=>[i[0],i.slice(1)])}function Bne(t){let e=[],n=v1(t);return i(r([]),[]),e;function r(a){let o=t(),s=b1(()=>{let l=v1(t).map(c=>n[c]);if(l.length)return r(l)});return{S:o,B:s,Q:a}}function i({S:a,B:o},s,l){if(!(a&4&&l===s[s.length-1])){a&2&&(l=s[s.length-1]),a&1&&e.push(s);for(let c of o)for(let u of c.Q)i(c,[...s,u],l)}}}function Dne(t){return t.toString(16).toUpperCase().padStart(2,"0")}function Q$(t){return`{${Dne(t)}}`}function Lne(t){let e=[];for(let n=0,r=t.length;n>24&255}function J$(t){return t&16777215}let T3,l_,C3,rw;function Vne(){let t=z$(Une);T3=new Map(H$(t).flatMap((e,n)=>e.map(r=>[r,n+1<<24]))),l_=new Set(v1(t)),C3=new Map,rw=new Map;for(let[e,n]of G$(t)){if(!l_.has(e)&&n.length==2){let[r,i]=n,a=rw.get(r);a||(a=new Map,rw.set(r,a)),a.set(i,e)}C3.set(e,n.reverse())}}function Y$(t){return t>=w1&&t=ax&&t=ox&&esx&&e0&&i(sx+c)}else{let o=C3.get(a);o?n.push(...o):i(a)}if(!n.length)break;a=n.pop()}if(r&&e.length>1){let a=uy(e[0]);for(let o=1;o0&&i>=o)o==0?(e.push(r,...n),n.length=0,r=s):n.push(s),i=o;else{let l=Qne(r,s);l>=0?r=l:i==0&&o==0?(e.push(r),r=s):(n.push(s),i=o)}}return r>=0&&e.push(r,...n),e}function Z$(t){return X$(t).map(J$)}function Wne(t){return Kne(X$(t))}const c_=45,q$=".",eU=65039,tU=1,pd=t=>Array.from(t);function x1(t,e){return t.P.has(e)||t.Q.has(e)}class Jne extends Array{get is_emoji(){return!0}}let k3,nU,ju,_3,rU,Id,eE,zh,iU,u_,N3;function gO(){if(k3)return;let t=z$(Tne);const e=()=>v1(t),n=()=>new Set(e());k3=new Map(G$(t)),nU=n(),ju=e(),_3=new Set(e().map(u=>ju[u])),ju=new Set(ju),rU=n(),n();let r=H$(t),i=t();const a=()=>new Set(e().flatMap(u=>r[u]).concat(e()));Id=b1(u=>{let f=b1(t).map(h=>h+96);if(f.length){let h=u>=i;f[0]-=32,f=Op(f),h&&(f=`Restricted[${f}]`);let d=a(),g=a(),p=!t();return{N:f,P:d,Q:g,M:p,R:h}}}),eE=n(),zh=new Map;let o=e().concat(pd(eE)).sort((u,f)=>u-f);o.forEach((u,f)=>{let h=t(),d=o[f]=h?o[f-h]:{V:[],M:new Map};d.V.push(u),eE.has(u)||zh.set(u,d)});for(let{V:u,M:f}of new Set(zh.values())){let h=[];for(let g of u){let p=Id.filter(y=>x1(y,g)),m=h.find(({G:y})=>p.some(v=>y.has(v)));m||(m={G:new Set,V:[]},h.push(m)),m.V.push(g),p.forEach(y=>m.G.add(y))}let d=h.flatMap(g=>pd(g.G));for(let{G:g,V:p}of h){let m=new Set(d.filter(y=>!g.has(y)));for(let y of p)f.set(y,m)}}let s=new Set,l=new Set;const c=u=>s.has(u)?l.add(u):s.add(u);for(let u of Id){for(let f of u.P)c(f);for(let f of u.Q)c(f)}for(let u of s)!zh.has(u)&&!l.has(u)&&zh.set(u,tU);iU=new Set(pd(s).concat(pd(Z$(s)))),u_=Bne(t).map(u=>Jne.from(u)).sort($ne),N3=new Map;for(let u of u_){let f=[N3];for(let h of u){let d=f.map(g=>{let p=g.get(h);return p||(p=new Map,g.set(h,p)),p});h===eU?f.push(...d):f=d}for(let h of f)h.V=u}}function yO(t){return(aU(t)?"":`${mO(rA([t]))} `)+Q$(t)}function mO(t){return`"${t}"‎`}function Yne(t){if(t.length>=4&&t[2]==c_&&t[3]==c_)throw new Error(`invalid label extension: "${Op(t.slice(0,4))}"`)}function Xne(t){for(let n=t.lastIndexOf(95);n>0;)if(t[--n]!==95)throw new Error("underscore allowed only at start")}function Zne(t){let e=t[0],n=o_.get(e);if(n)throw ky(`leading ${n}`);let r=t.length,i=-1;for(let a=1;a{let a=Lne(i),o={input:a,offset:r};r+=a.length+1;try{let s=o.tokens=ore(a,e,n),l=s.length,c;if(!l)throw new Error("empty label");let u=o.output=s.flat();if(Xne(u),!(o.emoji=l>1||s[0].is_emoji)&&u.every(h=>h<128))Yne(u),c="ASCII";else{let h=s.flatMap(d=>d.is_emoji?[]:d);if(!h.length)c="Emoji";else{if(ju.has(u[0]))throw ky("leading combining mark");for(let p=1;po.has(s)):pd(o),!n.length)return}else r.push(i)}if(n){for(let i of n)if(r.every(a=>x1(i,a)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function rre(t){let e=Id;for(let n of t){let r=e.filter(i=>x1(i,n));if(!r.length)throw Id.some(i=>x1(i,n))?sU(e[0],n):oU(n);if(e=r,r.length==1)break}return e}function ire(t){return t.map(({input:e,error:n,output:r})=>{if(n){let i=n.message;throw new Error(t.length==1?i:`Invalid label ${mO(rA(e))}: ${i}`)}return Op(r)}).join(q$)}function oU(t){return new Error(`disallowed character: ${yO(t)}`)}function sU(t,e){let n=yO(e),r=Id.find(i=>i.P.has(e));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${t.N} + ${n}`)}function ky(t){return new Error(`illegal placement: ${t}`)}function are(t,e){for(let n of e)if(!x1(t,n))throw sU(t,n);if(t.M){let n=Z$(e);for(let r=1,i=n.length;rs_)throw new Error(`excessive non-spacing marks: ${mO(rA(n.slice(r-1,a)))} (${a-r}/${s_})`);r=a}}}function ore(t,e,n){let r=[],i=[];for(t=t.slice().reverse();t.length;){let a=lre(t);if(a)i.length&&(r.push(e(i)),i=[]),r.push(n(a));else{let o=t.pop();if(iU.has(o))i.push(o);else{let s=k3.get(o);if(s)i.push(...s);else if(!nU.has(o))throw oU(o)}}}return i.length&&r.push(e(i)),r}function sre(t){return t.filter(e=>e!=eU)}function lre(t,e){let n=N3,r,i=t.length;for(;i&&(n=n.get(t[--i]),!!n);){let{V:a}=n;a&&(r=a,e&&e.push(...t.slice(i).reverse()),t.length=i)}return r}const lU=new Uint8Array(32);lU.fill(0);function f_(t){return Y(t.length!==0,"invalid ENS name; empty component","comp",t),t}function cU(t){const e=dl(cre(t)),n=[];if(t.length===0)return n;let r=0;for(let i=0;i{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const n=new Uint8Array(e.length+1);return n.set(e,1),n[0]=n.length-1,n})))+"00"}function tE(t,e){return{address:rn(t),storageKeys:e.map((n,r)=>(Y(In(n,32),"invalid slot",`storageKeys[${r}]`,n),n.toLowerCase()))}}function xh(t){if(Array.isArray(t))return t.map((n,r)=>Array.isArray(n)?(Y(n.length===2,"invalid slot set",`value[${r}]`,n),tE(n[0],n[1])):(Y(n!=null&&typeof n=="object","invalid address-slot set","value",t),tE(n.address,n.storageKeys)));Y(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(n=>{const r=t[n].reduce((i,a)=>(i[a]=!0,i),{});return tE(n,Object.keys(r).sort())});return e.sort((n,r)=>n.address.localeCompare(r.address)),e}function fre(t){let e;return typeof t=="string"?e=m1.computePublicKey(t,!1):e=t.publicKey,rn(Nn("0x"+e.substring(4)).substring(26))}function hre(t,e){return fre(m1.recoverPublicKey(t,e))}const ki=BigInt(0),dre=BigInt(2),pre=BigInt(27),gre=BigInt(28),yre=BigInt(35),mre=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function vO(t){return t==="0x"?null:rn(t)}function uU(t,e){try{return xh(t)}catch(n){Y(!1,n.message,e,t)}}function iA(t,e){return t==="0x"?0:Lt(t,e)}function ii(t,e){if(t==="0x")return ki;const n=ot(t,e);return Y(n<=mre,"value exceeds uint size",e,n),n}function Er(t,e){const n=ot(t,"value"),r=sa(n);return Y(r.length<=32,"value too large",`tx.${e}`,n),r}function fU(t){return xh(t).map(e=>[e.address,e.storageKeys])}function vre(t){const e=dO(t);Y(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",t);const n={type:0,nonce:iA(e[0],"nonce"),gasPrice:ii(e[1],"gasPrice"),gasLimit:ii(e[2],"gasLimit"),to:vO(e[3]),value:ii(e[4],"value"),data:Ze(e[5]),chainId:ki};if(e.length===6)return n;const r=ii(e[6],"v"),i=ii(e[7],"r"),a=ii(e[8],"s");if(i===ki&&a===ki)n.chainId=r;else{let o=(r-yre)/dre;o=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),me(!n||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),me(this.type!==0||!r,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const i=[];return this.type!=null?i.push(this.type):n?i.push(2):e?(i.push(1),r||i.push(0)):r?(i.push(1),i.push(2)):(i.push(0),i.push(1),i.push(2)),i.sort(),i}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}clone(){return Zl.from(this)}toJSON(){const e=n=>n==null?null:n.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new Zl;if(typeof e=="string"){const r=Pt(e);if(r[0]>=127)return Zl.from(vre(r));switch(r[0]){case 1:return Zl.from(wre(r));case 2:return Zl.from(bre(r))}me(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const n=new Zl;return e.type!=null&&(n.type=e.type),e.to!=null&&(n.to=e.to),e.nonce!=null&&(n.nonce=e.nonce),e.gasLimit!=null&&(n.gasLimit=e.gasLimit),e.gasPrice!=null&&(n.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(n.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(n.maxFeePerGas=e.maxFeePerGas),e.data!=null&&(n.data=e.data),e.value!=null&&(n.value=e.value),e.chainId!=null&&(n.chainId=e.chainId),e.signature!=null&&(n.signature=To.from(e.signature)),e.accessList!=null&&(n.accessList=e.accessList),e.hash!=null&&(Y(n.isSigned(),"unsigned transaction cannot define hash","tx",e),Y(n.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(Y(n.isSigned(),"unsigned transaction cannot define from","tx",e),Y(n.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),n}};Ws=new WeakMap,M0=new WeakMap,B0=new WeakMap,D0=new WeakMap,L0=new WeakMap,$0=new WeakMap,U0=new WeakMap,F0=new WeakMap,j0=new WeakMap,z0=new WeakMap,H0=new WeakMap,G0=new WeakMap;let A1=Zl;const dU=new Uint8Array(32);dU.fill(0);const xre=BigInt(-1),pU=BigInt(0),gU=BigInt(1),Are=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function Ere(t){const e=Pt(t),n=e.length%32;return n?lr([e,dU.slice(n)]):Ze(e)}const Sre=fs(gU,32),Pre=fs(pU,32),g_={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},nE=["name","version","chainId","verifyingContract","salt"];function y_(t){return function(e){return Y(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const Ore={name:y_("name"),version:y_("version"),chainId:function(t){const e=ot(t,"domain.chainId");return Y(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):Fu(e)},verifyingContract:function(t){try{return rn(t).toLowerCase()}catch{}Y(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=Pt(t,"domain.salt");return Y(e.length===32,'invalid domain value "salt"',"domain.salt",t),Ze(e)}};function rE(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const n=e[1]==="",r=parseInt(e[2]||"256");Y(r%8===0&&r!==0&&r<=256&&(e[2]==null||e[2]===String(r)),"invalid numeric width","type",t);const i=ly(Are,n?r-1:r),a=n?(i+gU)*xre:pU;return function(o){const s=ot(o,"value");return Y(s>=a&&s<=i,`value out-of-bounds for ${t}`,"value",s),fs(n?P$(s,256):s,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const n=parseInt(e[1]);return Y(n!==0&&n<=32&&e[1]===String(n),"invalid bytes width","type",t),function(r){const i=Pt(r);return Y(i.length===n,`invalid length for ${t}`,"value",r),Ere(r)}}}switch(t){case"address":return function(e){return sh(rn(e),32)};case"bool":return function(e){return e?Sre:Pre};case"bytes":return function(e){return Nn(e)};case"string":return function(e){return lh(e)}}return null}function m_(t,e){return`${t}(${e.map(({name:n,type:r})=>r+" "+n).join(",")})`}var Bm,Js,V0,h2,yU;const wa=class wa{constructor(e){M(this,h2);R(this,"primaryType");M(this,Bm,void 0);M(this,Js,void 0);M(this,V0,void 0);O(this,Bm,JSON.stringify(e)),O(this,Js,new Map),O(this,V0,new Map);const n=new Map,r=new Map,i=new Map;Object.keys(e).forEach(s=>{n.set(s,new Set),r.set(s,[]),i.set(s,new Set)});for(const s in e){const l=new Set;for(const c of e[s]){Y(!l.has(c.name),`duplicate variable name ${JSON.stringify(c.name)} in ${JSON.stringify(s)}`,"types",e),l.add(c.name);const u=c.type.match(/^([^\x5b]*)(\x5b|$)/)[1]||null;Y(u!==s,`circular type reference to ${JSON.stringify(u)}`,"types",e),!rE(u)&&(Y(r.has(u),`unknown type ${JSON.stringify(u)}`,"types",e),r.get(u).push(s),n.get(s).add(u))}}const a=Array.from(r.keys()).filter(s=>r.get(s).length===0);Y(a.length!==0,"missing primary type","types",e),Y(a.length===1,`ambiguous primary types or unused types: ${a.map(s=>JSON.stringify(s)).join(", ")}`,"types",e),mt(this,{primaryType:a[0]});function o(s,l){Y(!l.has(s),`circular type reference to ${JSON.stringify(s)}`,"types",e),l.add(s);for(const c of n.get(s))if(r.has(c)){o(c,l);for(const u of l)i.get(u).add(c)}l.delete(s)}o(this.primaryType,new Set);for(const[s,l]of i){const c=Array.from(l);c.sort(),b(this,Js).set(s,m_(s,e[s])+c.map(u=>m_(u,e[u])).join(""))}}get types(){return JSON.parse(b(this,Bm))}getEncoder(e){let n=b(this,V0).get(e);return n||(n=ie(this,h2,yU).call(this,e),b(this,V0).set(e,n)),n}encodeType(e){const n=b(this,Js).get(e);return Y(n,`unknown type: ${JSON.stringify(e)}`,"name",e),n}encodeData(e,n){return this.getEncoder(e)(n)}hashStruct(e,n){return Nn(this.encodeData(e,n))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,n,r){if(rE(e))return r(e,n);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i)return Y(!i[3]||parseInt(i[3])===n.length,`array length mismatch; expected length ${parseInt(i[3])}`,"value",n),n.map(o=>this._visit(i[1],o,r));const a=this.types[e];if(a)return a.reduce((o,{name:s,type:l})=>(o[s]=this._visit(l,n[s],r),o),{});Y(!1,`unknown type: ${e}`,"type",e)}visit(e,n){return this._visit(this.primaryType,e,n)}static from(e){return new wa(e)}static getPrimaryType(e){return wa.from(e).primaryType}static hashStruct(e,n,r){return wa.from(n).hashStruct(e,r)}static hashDomain(e){const n=[];for(const r in e){if(e[r]==null)continue;const i=g_[r];Y(i,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),n.push({name:r,type:i})}return n.sort((r,i)=>nE.indexOf(r.name)-nE.indexOf(i.name)),wa.hashStruct("EIP712Domain",{EIP712Domain:n},e)}static encode(e,n,r){return lr(["0x1901",wa.hashDomain(e),wa.from(n).hash(r)])}static hash(e,n,r){return Nn(wa.encode(e,n,r))}static async resolveNames(e,n,r,i){e=Object.assign({},e);for(const s in e)e[s]==null&&delete e[s];const a={};e.verifyingContract&&!In(e.verifyingContract,20)&&(a[e.verifyingContract]="0x");const o=wa.from(n);o.visit(r,(s,l)=>(s==="address"&&!In(l,20)&&(a[l]="0x"),l));for(const s in a)a[s]=await i(s);return e.verifyingContract&&a[e.verifyingContract]&&(e.verifyingContract=a[e.verifyingContract]),r=o.visit(r,(s,l)=>s==="address"&&a[l]?a[l]:l),{domain:e,value:r}}static getPayload(e,n,r){wa.hashDomain(e);const i={},a=[];nE.forEach(l=>{const c=e[l];c!=null&&(i[l]=Ore[l](c),a.push({name:l,type:g_[l]}))});const o=wa.from(n),s=Object.assign({},n);return Y(s.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",n),s.EIP712Domain=a,o.encode(r),{types:s,domain:i,primaryType:o.primaryType,message:o.visit(r,(l,c)=>{if(l.match(/^bytes(\d*)/))return Ze(Pt(c));if(l.match(/^u?int/))return ot(c).toString();switch(l){case"address":return c.toLowerCase();case"bool":return!!c;case"string":return Y(typeof c=="string","invalid string","value",c),c}Y(!1,"unsupported type","type",l)})}}};Bm=new WeakMap,Js=new WeakMap,V0=new WeakMap,h2=new WeakSet,yU=function(e){{const i=rE(e);if(i)return i}const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const i=n[1],a=this.getEncoder(i);return o=>{Y(!n[3]||parseInt(n[3])===o.length,`array length mismatch; expected length ${parseInt(n[3])}`,"value",o);let s=o.map(a);return b(this,Js).has(i)&&(s=s.map(Nn)),Nn(lr(s))}}const r=this.types[e];if(r){const i=lh(b(this,Js).get(e));return a=>{const o=r.map(({name:s,type:l})=>{const c=this.getEncoder(l)(a[s]);return b(this,Js).has(l)?Nn(c):c});return o.unshift(i),lr(o)}}Y(!1,`unknown type: ${e}`,"type",e)};let E1=wa;function hi(t){const e=new Set;return t.forEach(n=>e.add(n)),Object.freeze(e)}const Tre="external public payable",Cre=hi(Tre.split(" ")),mU="constant external internal payable private public pure view",kre=hi(mU.split(" ")),vU="constructor error event fallback function receive struct",bU=hi(vU.split(" ")),wU="calldata memory storage payable indexed",_re=hi(wU.split(" ")),Nre="tuple returns",Ire=[vU,wU,Nre,mU].join(" "),Rre=hi(Ire.split(" ")),Mre={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},Bre=new RegExp("^(\\s*)"),Dre=new RegExp("^([0-9]+)"),Lre=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),xU=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),AU=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var wr,uo,Dm,R3;const d2=class d2{constructor(e){M(this,Dm);M(this,wr,void 0);M(this,uo,void 0);O(this,wr,0),O(this,uo,e.slice())}get offset(){return b(this,wr)}get length(){return b(this,uo).length-b(this,wr)}clone(){return new d2(b(this,uo))}reset(){O(this,wr,0)}popKeyword(e){const n=this.peek();if(n.type!=="KEYWORD"||!e.has(n.text))throw new Error(`expected keyword ${n.text}`);return this.pop().text}popType(e){if(this.peek().type!==e)throw new Error(`expected ${e}; got ${JSON.stringify(this.peek())}`);return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=ie(this,Dm,R3).call(this,b(this,wr)+1,e.match+1);return O(this,wr,e.match+1),n}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=[];for(;b(this,wr)=b(this,uo).length)throw new Error("out-of-bounds");return b(this,uo)[b(this,wr)]}peekKeyword(e){const n=this.peekType("KEYWORD");return n!=null&&e.has(n)?n:null}peekType(e){if(this.length===0)return null;const n=this.peek();return n.type===e?n.text:null}pop(){const e=this.peek();return vs(this,wr)._++,e}toString(){const e=[];for(let n=b(this,wr);n`}};wr=new WeakMap,uo=new WeakMap,Dm=new WeakSet,R3=function(e=0,n=0){return new d2(b(this,uo).slice(e,n).map(r=>Object.freeze(Object.assign({},r,{match:r.match-e,linkBack:r.linkBack-e,linkNext:r.linkNext-e}))))};let Co=d2;function su(t){const e=[],n=o=>{const s=a0&&e[e.length-1].type==="NUMBER"){const f=e.pop().text;u=f+u,e[e.length-1].value=Lt(f)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=u}continue}if(s=o.match(Lre),s){if(l.text=s[1],a+=l.text.length,Rre.has(l.text)){l.type="KEYWORD";continue}if(l.text.match(AU)){l.type="TYPE";continue}l.type="ID";continue}if(s=o.match(Dre),s){l.text=s[1],l.type="NUMBER",a+=l.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${a}`)}return new Co(e.map(o=>Object.freeze(o)))}function v_(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 aA(t,e){if(e.peekKeyword(bU)){const n=e.pop().text;if(n!==t)throw new Error(`expected ${t}, got ${n}`)}return e.popType("ID")}function Pl(t,e){const n=new Set;for(;;){const r=t.peekType("KEYWORD");if(r==null||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 EU(t){let e=Pl(t,kre);return v_(e,hi("constant payable nonpayable".split(" "))),v_(e,hi("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 pl(t,e){return t.popParams().map(n=>Cr.from(n,e))}function SU(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return ot(t.pop().text);throw new Error("invalid gas")}return null}function ch(t){if(t.length)throw new Error(`unexpected tokens: ${t.toString()}`)}const $re=new RegExp(/^(.*)\[([0-9]*)\]$/);function b_(t){const e=t.match(AU);if(Y(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const n=parseInt(e[2]);Y(n!==0&&n<=32,"invalid bytes length","type",t)}else if(e[3]){const n=parseInt(e[3]);Y(n!==0&&n<=256&&n%8===0,"invalid numeric width","type",t)}return t}const _n={},Ui=Symbol.for("_ethers_internal"),w_="_ParamTypeInternal",x_="_ErrorInternal",A_="_EventInternal",E_="_ConstructorInternal",S_="_FallbackInternal",P_="_FunctionInternal",O_="_StructInternal";var Q0,iw;const xa=class xa{constructor(e,n,r,i,a,o,s,l){M(this,Q0);R(this,"name");R(this,"type");R(this,"baseType");R(this,"indexed");R(this,"components");R(this,"arrayLength");R(this,"arrayChildren");if(eA(e,_n,"ParamType"),Object.defineProperty(this,Ui,{value:w_}),o&&(o=Object.freeze(o.slice())),i==="array"){if(s==null||l==null)throw new Error("")}else if(s!=null||l!=null)throw new Error("");if(i==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");mt(this,{name:n,type:r,baseType:i,indexed:a,components:o,arrayLength:s,arrayChildren:l})}format(e){if(e==null&&(e="sighash"),e==="json"){const r=this.name||"";if(this.isArray()){const a=JSON.parse(this.arrayChildren.format("json"));return a.name=r,a.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(a)}const i={type:this.baseType==="tuple"?"tuple":this.type,name:r};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(a=>JSON.parse(a.format(e)))),JSON.stringify(i)}let n="";return this.isArray()?(n+=this.arrayChildren.format(e),n+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?n+="("+this.components.map(r=>r.format(e)).join(e==="full"?", ":",")+")":n+=this.type,e!=="sighash"&&(this.indexed===!0&&(n+=" indexed"),e==="full"&&this.name&&(n+=" "+this.name)),n}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,n){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const r=this;return e.map(i=>r.arrayChildren.walk(i,n))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const r=this;return e.map((i,a)=>r.components[a].walk(i,n))}return n(this.type,e)}async walkAsync(e,n){const r=[],i=[e];return ie(this,Q0,iw).call(this,r,e,n,a=>{i[0]=a}),r.length&&await Promise.all(r),i[0]}static from(e,n){if(xa.isParamType(e))return e;if(typeof e=="string")try{return xa.from(su(e),n)}catch{Y(!1,"invalid param type","obj",e)}else if(e instanceof Co){let s="",l="",c=null;Pl(e,hi(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(l="tuple",c=e.popParams().map(p=>xa.from(p)),s=`tuple(${c.map(p=>p.format()).join(",")})`):(s=b_(e.popType("TYPE")),l=s);let u=null,f=null;for(;e.length&&e.peekType("BRACKET");){const p=e.pop();u=new xa(_n,"",s,l,null,c,f,u),f=p.value,s+=p.text,l="array",c=null}let h=null;if(Pl(e,_re).has("indexed")){if(!n)throw new Error("");h=!0}const g=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new xa(_n,g,s,l,h,c,f,u)}const r=e.name;Y(!r||typeof r=="string"&&r.match(xU),"invalid name","obj.name",r);let i=e.indexed;i!=null&&(Y(n,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let a=e.type,o=a.match($re);if(o){const s=parseInt(o[2]||"-1"),l=xa.from({type:o[1],components:e.components});return new xa(_n,r||"",a,"array",i,null,s,l)}if(a==="tuple"||a.startsWith("tuple(")||a.startsWith("(")){const s=e.components!=null?e.components.map(c=>xa.from(c)):null;return new xa(_n,r||"",a,"tuple",i,s,null,null)}return a=b_(e.type),new xa(_n,r||"",a,a,i,null,null,null)}static isParamType(e){return e&&e[Ui]===w_}};Q0=new WeakSet,iw=function(e,n,r,i){if(this.isArray()){if(!Array.isArray(n))throw new Error("invalid array value");if(this.arrayLength!==-1&&n.length!==this.arrayLength)throw new Error("array is wrong length");const o=this.arrayChildren,s=n.slice();s.forEach((l,c)=>{var u;ie(u=o,Q0,iw).call(u,e,l,r,f=>{s[c]=f})}),i(s);return}if(this.isTuple()){const o=this.components;let s;if(Array.isArray(n))s=n.slice();else{if(n==null||typeof n!="object")throw new Error("invalid tuple value");s=o.map(l=>{if(!l.name)throw new Error("cannot use object value with unnamed components");if(!(l.name in n))throw new Error(`missing value for component ${l.name}`);return n[l.name]})}if(s.length!==this.components.length)throw new Error("array is wrong length");s.forEach((l,c)=>{var u;ie(u=o[c],Q0,iw).call(u,e,l,r,f=>{s[c]=f})}),i(s);return}const a=r(this.type,n);a.then?e.push(async function(){i(await a)}()):i(a)};let Cr=xa;class uh{constructor(e,n,r){R(this,"type");R(this,"inputs");eA(e,_n,"Fragment"),r=Object.freeze(r.slice()),mt(this,{type:n,inputs:r})}static from(e){if(typeof e=="string"){try{uh.from(JSON.parse(e))}catch{}return uh.from(su(e))}if(e instanceof Co)switch(e.peekKeyword(bU)){case"constructor":return sl.from(e);case"error":return _i.from(e);case"event":return qo.from(e);case"fallback":case"receive":return _s.from(e);case"function":return es.from(e);case"struct":return zf.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return sl.from(e);case"error":return _i.from(e);case"event":return qo.from(e);case"fallback":case"receive":return _s.from(e);case"function":return es.from(e);case"struct":return zf.from(e)}me(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}Y(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return sl.isFragment(e)}static isError(e){return _i.isFragment(e)}static isEvent(e){return qo.isFragment(e)}static isFunction(e){return es.isFragment(e)}static isStruct(e){return zf.isFragment(e)}}class oA extends uh{constructor(n,r,i,a){super(n,r,a);R(this,"name");Y(typeof i=="string"&&i.match(xU),"invalid identifier","name",i),a=Object.freeze(a.slice()),mt(this,{name:i})}}function S1(t,e){return"("+e.map(n=>n.format(t)).join(t==="full"?", ":",")+")"}class _i extends oA{constructor(e,n,r){super(e,"error",n,r),Object.defineProperty(this,Ui,{value:x_})}get selector(){return lh(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(e)))});const n=[];return e!=="sighash"&&n.push("error"),n.push(this.name+S1(e,this.inputs)),n.join(" ")}static from(e){if(_i.isFragment(e))return e;if(typeof e=="string")return _i.from(su(e));if(e instanceof Co){const n=aA("error",e),r=pl(e);return ch(e),new _i(_n,n,r)}return new _i(_n,e.name,e.inputs?e.inputs.map(Cr.from):[])}static isFragment(e){return e&&e[Ui]===x_}}class qo extends oA{constructor(n,r,i,a){super(n,"event",r,i);R(this,"anonymous");Object.defineProperty(this,Ui,{value:A_}),mt(this,{anonymous:a})}get topicHash(){return lh(this.format("sighash"))}format(n){if(n==null&&(n="sighash"),n==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(n)))});const r=[];return n!=="sighash"&&r.push("event"),r.push(this.name+S1(n,this.inputs)),n!=="sighash"&&this.anonymous&&r.push("anonymous"),r.join(" ")}static getTopicHash(n,r){return r=(r||[]).map(a=>Cr.from(a)),new qo(_n,n,r,!1).topicHash}static from(n){if(qo.isFragment(n))return n;if(typeof n=="string")try{return qo.from(su(n))}catch{Y(!1,"invalid event fragment","obj",n)}else if(n instanceof Co){const r=aA("event",n),i=pl(n,!0),a=!!Pl(n,hi(["anonymous"])).has("anonymous");return ch(n),new qo(_n,r,i,a)}return new qo(_n,n.name,n.inputs?n.inputs.map(r=>Cr.from(r,!0)):[],!!n.anonymous)}static isFragment(n){return n&&n[Ui]===A_}}class sl extends uh{constructor(n,r,i,a,o){super(n,r,i);R(this,"payable");R(this,"gas");Object.defineProperty(this,Ui,{value:E_}),mt(this,{payable:a,gas:o})}format(n){if(me(n!=null&&n!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),n==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(n)))});const r=[`constructor${S1(n,this.inputs)}`];return this.payable&&r.push("payable"),this.gas!=null&&r.push(`@${this.gas.toString()}`),r.join(" ")}static from(n){if(sl.isFragment(n))return n;if(typeof n=="string")try{return sl.from(su(n))}catch{Y(!1,"invalid constuctor fragment","obj",n)}else if(n instanceof Co){Pl(n,hi(["constructor"]));const r=pl(n),i=!!Pl(n,Cre).has("payable"),a=SU(n);return ch(n),new sl(_n,"constructor",r,i,a)}return new sl(_n,"constructor",n.inputs?n.inputs.map(Cr.from):[],!!n.payable,n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[Ui]===E_}}class _s extends uh{constructor(n,r,i){super(n,"fallback",r);R(this,"payable");Object.defineProperty(this,Ui,{value:S_}),mt(this,{payable:i})}format(n){const r=this.inputs.length===0?"receive":"fallback";if(n==="json"){const i=this.payable?"payable":"nonpayable";return JSON.stringify({type:r,stateMutability:i})}return`${r}()${this.payable?" payable":""}`}static from(n){if(_s.isFragment(n))return n;if(typeof n=="string")try{return _s.from(su(n))}catch{Y(!1,"invalid fallback fragment","obj",n)}else if(n instanceof Co){const r=n.toString(),i=n.peekKeyword(hi(["fallback","receive"]));if(Y(i,"type must be fallback or receive","obj",r),n.popKeyword(hi(["fallback","receive"]))==="receive"){const l=pl(n);return Y(l.length===0,"receive cannot have arguments","obj.inputs",l),Pl(n,hi(["payable"])),ch(n),new _s(_n,[],!0)}let o=pl(n);o.length?Y(o.length===1&&o[0].type==="bytes","invalid fallback inputs","obj.inputs",o.map(l=>l.format("minimal")).join(", ")):o=[Cr.from("bytes")];const s=EU(n);if(Y(s==="nonpayable"||s==="payable","fallback cannot be constants","obj.stateMutability",s),Pl(n,hi(["returns"])).has("returns")){const l=pl(n);Y(l.length===1&&l[0].type==="bytes","invalid fallback outputs","obj.outputs",l.map(c=>c.format("minimal")).join(", "))}return ch(n),new _s(_n,o,s==="payable")}if(n.type==="receive")return new _s(_n,[],!0);if(n.type==="fallback"){const r=[Cr.from("bytes")],i=n.stateMutability==="payable";return new _s(_n,r,i)}Y(!1,"invalid fallback description","obj",n)}static isFragment(n){return n&&n[Ui]===S_}}class es extends oA{constructor(n,r,i,a,o,s){super(n,"function",r,a);R(this,"constant");R(this,"outputs");R(this,"stateMutability");R(this,"payable");R(this,"gas");Object.defineProperty(this,Ui,{value:P_}),o=Object.freeze(o.slice()),mt(this,{constant:i==="view"||i==="pure",gas:s,outputs:o,payable:i==="payable",stateMutability:i})}get selector(){return lh(this.format("sighash")).substring(0,10)}format(n){if(n==null&&(n="sighash"),n==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(n))),outputs:this.outputs.map(i=>JSON.parse(i.format(n)))});const r=[];return n!=="sighash"&&r.push("function"),r.push(this.name+S1(n,this.inputs)),n!=="sighash"&&(this.stateMutability!=="nonpayable"&&r.push(this.stateMutability),this.outputs&&this.outputs.length&&(r.push("returns"),r.push(S1(n,this.outputs))),this.gas!=null&&r.push(`@${this.gas.toString()}`)),r.join(" ")}static getSelector(n,r){return r=(r||[]).map(a=>Cr.from(a)),new es(_n,n,"view",r,[],null).selector}static from(n){if(es.isFragment(n))return n;if(typeof n=="string")try{return es.from(su(n))}catch{Y(!1,"invalid function fragment","obj",n)}else if(n instanceof Co){const i=aA("function",n),a=pl(n),o=EU(n);let s=[];Pl(n,hi(["returns"])).has("returns")&&(s=pl(n));const l=SU(n);return ch(n),new es(_n,i,o,a,s,l)}let r=n.stateMutability;return r==null&&(r="payable",typeof n.constant=="boolean"?(r="view",n.constant||(r="payable",typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable"))):typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable")),new es(_n,n.name,r,n.inputs?n.inputs.map(Cr.from):[],n.outputs?n.outputs.map(Cr.from):[],n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[Ui]===P_}}class zf extends oA{constructor(e,n,r){super(e,"struct",n,r),Object.defineProperty(this,Ui,{value:O_})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return zf.from(su(e))}catch{Y(!1,"invalid struct fragment","obj",e)}else if(e instanceof Co){const n=aA("struct",e),r=pl(e);return ch(e),new zf(_n,n,r)}return new zf(_n,e.name,e.inputs?e.inputs.map(Cr.from):[])}static isFragment(e){return e&&e[Ui]===O_}}const _o=new Map;_o.set(0,"GENERIC_PANIC");_o.set(1,"ASSERT_FALSE");_o.set(17,"OVERFLOW");_o.set(18,"DIVIDE_BY_ZERO");_o.set(33,"ENUM_RANGE_ERROR");_o.set(34,"BAD_STORAGE_DATA");_o.set(49,"STACK_UNDERFLOW");_o.set(50,"ARRAY_RANGE_ERROR");_o.set(65,"OUT_OF_MEMORY");_o.set(81,"UNINITIALIZED_FUNCTION_CALL");const Ure=new RegExp(/^bytes([0-9]*)$/),Fre=new RegExp(/^(u?int)([0-9]*)$/);let iE=null,T_=1024;function jre(t,e,n,r){let i="missing revert data",a=null;const o=null;let s=null;if(n){i="execution reverted";const c=Pt(n);if(n=Ze(n),c.length===0)i+=" (no data present; likely require(false) occurred",a="require(false)";else if(c.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(Ze(c.slice(0,4))==="0x08c379a0")try{a=r.decode(["string"],c.slice(4))[0],s={signature:"Error(string)",name:"Error",args:[a]},i+=`: ${JSON.stringify(a)}`}catch{i+=" (could not decode reason; invalid string data)"}else if(Ze(c.slice(0,4))==="0x4e487b71")try{const u=Number(r.decode(["uint256"],c.slice(4))[0]);s={signature:"Panic(uint256)",name:"Panic",args:[u]},a=`Panic due to ${_o.get(u)||"UNKNOWN"}(${u})`,i+=`: ${a}`}catch{i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const l={to:e.to?rn(e.to):null,data:e.data||"0x"};return e.from&&(l.from=rn(e.from)),er(i,"CALL_EXCEPTION",{action:t,data:n,reason:a,transaction:l,invocation:o,revert:s})}var xc,Hh;const p2=class p2{constructor(){M(this,xc)}getDefaultValue(e){const n=e.map(i=>ie(this,xc,Hh).call(this,Cr.from(i)));return new nb(n,"_").defaultValue()}encode(e,n){A$(n.length,e.length,"types/values length mismatch");const r=e.map(o=>ie(this,xc,Hh).call(this,Cr.from(o))),i=new nb(r,"_"),a=new E3;return i.encode(a,n),a.data}decode(e,n,r){const i=e.map(o=>ie(this,xc,Hh).call(this,Cr.from(o)));return new nb(i,"_").decode(new S3(n,r,T_))}static _setDefaultMaxInflation(e){Y(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),T_=e}static defaultAbiCoder(){return iE==null&&(iE=new p2),iE}static getBuiltinCallException(e,n,r){return jre(e,n,r,p2.defaultAbiCoder())}};xc=new WeakSet,Hh=function(e){if(e.isArray())return new yne(ie(this,xc,Hh).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new nb(e.components.map(r=>ie(this,xc,Hh).call(this,r)),e.name);switch(e.baseType){case"address":return new pne(e.name);case"bool":return new mne(e.name);case"string":return new One(e.name);case"bytes":return new vne(e.name);case"":return new xne(e.name)}let n=e.type.match(Fre);if(n){let r=parseInt(n[2]||"256");return Y(r!==0&&r<=256&&r%8===0,"invalid "+n[1]+" bit length","param",e),new Pne(r/8,n[1]==="int",e.name)}if(n=e.type.match(Ure),n){let r=parseInt(n[1]);return Y(r!==0&&r<=32,"invalid bytes length","param",e),new bne(r,e.name)}Y(!1,"invalid type","type",e.type)};let P1=p2;class zre{constructor(e,n,r){R(this,"fragment");R(this,"name");R(this,"signature");R(this,"topic");R(this,"args");const i=e.name,a=e.format();mt(this,{fragment:e,name:i,signature:a,topic:n,args:r})}}class Hre{constructor(e,n,r,i){R(this,"fragment");R(this,"name");R(this,"args");R(this,"signature");R(this,"selector");R(this,"value");const a=e.name,o=e.format();mt(this,{fragment:e,name:a,args:r,signature:o,selector:n,value:i})}}class Gre{constructor(e,n,r){R(this,"fragment");R(this,"name");R(this,"args");R(this,"signature");R(this,"selector");const i=e.name,a=e.format();mt(this,{fragment:e,name:i,args:r,signature:a,selector:n})}}class C_{constructor(e){R(this,"hash");R(this,"_isIndexed");mt(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const k_={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"},__={"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&&k_[t.toString()]&&(e=k_[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}};var Qo,Ko,Wo,Ur,K0,aw,W0,ow;const vd=class vd{constructor(e){M(this,K0);M(this,W0);R(this,"fragments");R(this,"deploy");R(this,"fallback");R(this,"receive");M(this,Qo,void 0);M(this,Ko,void 0);M(this,Wo,void 0);M(this,Ur,void 0);let n=[];typeof e=="string"?n=JSON.parse(e):n=e,O(this,Wo,new Map),O(this,Qo,new Map),O(this,Ko,new Map);const r=[];for(const o of n)try{r.push(uh.from(o))}catch(s){console.log("EE",s)}mt(this,{fragments:Object.freeze(r)});let i=null,a=!1;O(this,Ur,this.getAbiCoder()),this.fragments.forEach((o,s)=>{let l;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}mt(this,{deploy:o});return;case"fallback":o.inputs.length===0?a=!0:(Y(!i||o.payable!==i.payable,"conflicting fallback fragments",`fragments[${s}]`,o),i=o,a=i.payable);return;case"function":l=b(this,Wo);break;case"event":l=b(this,Ko);break;case"error":l=b(this,Qo);break;default:return}const c=o.format();l.has(c)||l.set(c,o)}),this.deploy||mt(this,{deploy:sl.from("constructor()")}),mt(this,{fallback:i,receive:a})}format(e){const n=e?"minimal":"full";return this.fragments.map(i=>i.format(n))}formatJson(){const e=this.fragments.map(n=>n.format("json"));return JSON.stringify(e.map(n=>JSON.parse(n)))}getAbiCoder(){return P1.defaultAbiCoder()}getFunctionName(e){const n=ie(this,K0,aw).call(this,e,null,!1);return Y(n,"no matching function","key",e),n.name}hasFunction(e){return!!ie(this,K0,aw).call(this,e,null,!1)}getFunction(e,n){return ie(this,K0,aw).call(this,e,n||null,!0)}forEachFunction(e){const n=Array.from(b(this,Wo).keys());n.sort((r,i)=>r.localeCompare(i));for(let r=0;rr.localeCompare(i));for(let r=0;r1){const a=i.map(o=>JSON.stringify(o.format())).join(", ");Y(!1,`ambiguous error description (i.e. ${a})`,"name",e)}return i[0]}if(e=_i.from(e).format(),e==="Error(string)")return _i.from("error Error(string)");if(e==="Panic(uint256)")return _i.from("error Panic(uint256)");const r=b(this,Qo).get(e);return r||null}forEachError(e){const n=Array.from(b(this,Qo).keys());n.sort((r,i)=>r.localeCompare(i));for(let r=0;ra.type==="string"?lh(o):a.type==="bytes"?Nn(Ze(o)):(a.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":a.type.match(/^u?int/)?o=fs(o):a.type.match(/^bytes/)?o=zte(o,32):a.type==="address"&&b(this,Ur).encode(["address"],[o]),sh(Ze(o),32));for(n.forEach((a,o)=>{const s=e.inputs[o];if(!s.indexed){Y(a==null,"cannot filter non-indexed parameters; must be null","contract."+s.name,a);return}a==null?r.push(null):s.baseType==="array"||s.baseType==="tuple"?Y(!1,"filtering with tuples or arrays not supported","contract."+s.name,a):Array.isArray(a)?r.push(a.map(l=>i(s,l))):r.push(i(s,a))});r.length&&r[r.length-1]===null;)r.pop();return r}encodeEventLog(e,n){if(typeof e=="string"){const o=this.getEvent(e);Y(o,"unknown event","eventFragment",e),e=o}const r=[],i=[],a=[];return e.anonymous||r.push(e.topicHash),Y(n.length===e.inputs.length,"event arguments/values mismatch","values",n),e.inputs.forEach((o,s)=>{const l=n[s];if(o.indexed)if(o.type==="string")r.push(lh(l));else if(o.type==="bytes")r.push(Nn(l));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");r.push(b(this,Ur).encode([o.type],[l]))}else i.push(o),a.push(l)}),{data:b(this,Ur).encode(i,a),topics:r}}decodeEventLog(e,n,r){if(typeof e=="string"){const d=this.getEvent(e);Y(d,"unknown event","eventFragment",e),e=d}if(r!=null&&!e.anonymous){const d=e.topicHash;Y(In(r[0],32)&&r[0].toLowerCase()===d,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}const i=[],a=[],o=[];e.inputs.forEach((d,g)=>{d.indexed?d.type==="string"||d.type==="bytes"||d.baseType==="tuple"||d.baseType==="array"?(i.push(Cr.from({type:"bytes32",name:d.name})),o.push(!0)):(i.push(d),o.push(!1)):(a.push(d),o.push(!1))});const s=r!=null?b(this,Ur).decode(i,lr(r)):null,l=b(this,Ur).decode(a,n,!0),c=[],u=[];let f=0,h=0;return e.inputs.forEach((d,g)=>{let p=null;if(d.indexed)if(s==null)p=new C_(null);else if(o[g])p=new C_(s[h++]);else try{p=s[h++]}catch(m){p=m}else try{p=l[f++]}catch(m){p=m}c.push(p),u.push(d.name||null)}),ix.fromItems(c,u)}parseTransaction(e){const n=Pt(e.data,"tx.data"),r=ot(e.value!=null?e.value:0,"tx.value"),i=this.getFunction(Ze(n.slice(0,4)));if(!i)return null;const a=b(this,Ur).decode(i.inputs,n.slice(4));return new Hre(i,i.selector,a,r)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const n=this.getEvent(e.topics[0]);return!n||n.anonymous?null:new zre(n,n.topicHash,this.decodeEventLog(n,e.data,e.topics))}parseError(e){const n=Ze(e),r=this.getError(Fn(n,0,4));if(!r)return null;const i=b(this,Ur).decode(r.inputs,Fn(n,4));return new Gre(r,r.selector,i)}static from(e){return e instanceof vd?e:typeof e=="string"?new vd(JSON.parse(e)):typeof e.format=="function"?new vd(e.format("json")):new vd(e)}};Qo=new WeakMap,Ko=new WeakMap,Wo=new WeakMap,Ur=new WeakMap,K0=new WeakSet,aw=function(e,n,r){if(In(e)){const a=e.toLowerCase();for(const o of b(this,Wo).values())if(a===o.selector)return o;return null}if(e.indexOf("(")===-1){const a=[];for(const[o,s]of b(this,Wo))o.split("(")[0]===e&&a.push(s);if(n){const o=n.length>0?n[n.length-1]:null;let s=n.length,l=!0;Wr.isTyped(o)&&o.type==="overrides"&&(l=!1,s--);for(let c=a.length-1;c>=0;c--){const u=a[c].inputs.length;u!==s&&(!l||u!==s-1)&&a.splice(c,1)}for(let c=a.length-1;c>=0;c--){const u=a[c].inputs;for(let f=0;f=u.length){if(n[f].type==="overrides")continue;a.splice(c,1);break}if(n[f].type!==u[f].baseType){a.splice(c,1);break}}}}if(a.length===1&&n&&n.length!==a[0].inputs.length){const o=n[n.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&a.splice(0,1)}if(a.length===0)return null;if(a.length>1&&r){const o=a.map(s=>JSON.stringify(s.format())).join(", ");Y(!1,`ambiguous function description (i.e. matches ${o})`,"key",e)}return a[0]}const i=b(this,Wo).get(es.from(e).format());return i||null},W0=new WeakSet,ow=function(e,n,r){if(In(e)){const a=e.toLowerCase();for(const o of b(this,Ko).values())if(a===o.topicHash)return o;return null}if(e.indexOf("(")===-1){const a=[];for(const[o,s]of b(this,Ko))o.split("(")[0]===e&&a.push(s);if(n){for(let o=a.length-1;o>=0;o--)a[o].inputs.length=0;o--){const s=a[o].inputs;for(let l=0;l1&&r){const o=a.map(s=>JSON.stringify(s.format())).join(", ");Y(!1,`ambiguous event description (i.e. matches ${o})`,"key",e)}return a[0]}const i=b(this,Ko).get(qo.from(e).format());return i||null};let M3=vd;const PU=BigInt(0);function _y(t){return t??null}function Gr(t){return t==null?null:t.toString()}class N_{constructor(e,n,r){R(this,"gasPrice");R(this,"maxFeePerGas");R(this,"maxPriorityFeePerGas");mt(this,{gasPrice:_y(e),maxFeePerGas:_y(n),maxPriorityFeePerGas:_y(r)})}toJSON(){const{gasPrice:e,maxFeePerGas:n,maxPriorityFeePerGas:r}=this;return{_type:"FeeData",gasPrice:Gr(e),maxFeePerGas:Gr(n),maxPriorityFeePerGas:Gr(r)}}}function cx(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=Ze(t.data));const n="chainId,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of n)!(i in t)||t[i]==null||(e[i]=ot(t[i],`request.${i}`));const r="type,nonce".split(/,/);for(const i of r)!(i in t)||t[i]==null||(e[i]=Lt(t[i],`request.${i}`));return t.accessList&&(e.accessList=xh(t.accessList)),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipRead=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),e}var Ys;class Vre{constructor(e,n){R(this,"provider");R(this,"number");R(this,"hash");R(this,"timestamp");R(this,"parentHash");R(this,"nonce");R(this,"difficulty");R(this,"gasLimit");R(this,"gasUsed");R(this,"miner");R(this,"extraData");R(this,"baseFeePerGas");M(this,Ys,void 0);O(this,Ys,e.transactions.map(r=>typeof r!="string"?new O1(r,n):r)),mt(this,{provider:n,hash:_y(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,miner:e.miner,extraData:e.extraData,baseFeePerGas:_y(e.baseFeePerGas)})}get transactions(){return b(this,Ys).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=b(this,Ys).slice();return e.length===0?[]:(me(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:n,extraData:r,gasLimit:i,gasUsed:a,hash:o,miner:s,nonce:l,number:c,parentHash:u,timestamp:f,transactions:h}=this;return{_type:"Block",baseFeePerGas:Gr(e),difficulty:Gr(n),extraData:r,gasLimit:Gr(i),gasUsed:Gr(a),hash:o,miner:s,nonce:l,number:c,parentHash:u,timestamp:f,transactions:h}}[Symbol.iterator](){let e=0;const n=this.transactions;return{next:()=>enew fv(i,n))));let r=PU;e.effectiveGasPrice!=null?r=e.effectiveGasPrice:e.gasPrice!=null&&(r=e.gasPrice),mt(this,{provider:n,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,gasPrice:r,type:e.type,status:e.status,root:e.root})}get logs(){return b(this,Lm)}toJSON(){const{to:e,from:n,contractAddress:r,hash:i,index:a,blockHash:o,blockNumber:s,logsBloom:l,logs:c,status:u,root:f}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:s,contractAddress:r,cumulativeGasUsed:Gr(this.cumulativeGasUsed),from:n,gasPrice:Gr(this.gasPrice),gasUsed:Gr(this.gasUsed),hash:i,index:a,logs:c,logsBloom:l,root:f,status:u,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e{if(s)return null;const{blockNumber:h,nonce:d}=await ni({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(d{if(h==null||h.status!==0)return h;me(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:h.to,from:h.from,data:""},receipt:h})},u=await this.provider.getTransactionReceipt(this.hash);if(r===0)return c(u);if(u){if(await u.confirmations()>=r)return c(u)}else if(await l(),r===0)return null;return await new Promise((h,d)=>{const g=[],p=()=>{g.forEach(y=>y())};if(g.push(()=>{s=!0}),i>0){const y=setTimeout(()=>{p(),d(er("wait for transaction timeout","TIMEOUT"))},i);g.push(()=>{clearTimeout(y)})}const m=async y=>{if(await y.confirmations()>=r){p();try{h(c(y))}catch(v){d(v)}}};if(g.push(()=>{this.provider.off(this.hash,m)}),this.provider.on(this.hash,m),a>=0){const y=async()=>{try{await l()}catch(v){if(Kr(v,"TRANSACTION_REPLACED")){p(),d(v);return}}s||this.provider.once("block",y)};g.push(()=>{this.provider.off("block",y)}),this.provider.once("block",y)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}removedEvent(){return me(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),CU(this)}reorderedEvent(e){return me(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),me(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),TU(this,e)}replaceableTransaction(e){Y(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const n=new U4(this,this.provider);return O(n,Ac,e),n}};Ac=new WeakMap;let O1=U4;function Qre(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function TU(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function CU(t){return{orphan:"drop-transaction",tx:t}}function Kre(t){return{orphan:"drop-log",log:{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,address:t.address,data:t.data,topics:Object.freeze(t.topics.slice()),index:t.index}}}class bO extends fv{constructor(n,r,i){super(n,n.provider);R(this,"interface");R(this,"fragment");R(this,"args");const a=r.decodeEventLog(i,n.data,n.topics);mt(this,{args:a,fragment:i,interface:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class kU extends fv{constructor(n,r){super(n,n.provider);R(this,"error");mt(this,{error:r})}}var J0;class Wre extends OU{constructor(n,r,i){super(i,r);M(this,J0,void 0);O(this,J0,n)}get logs(){return super.logs.map(n=>{const r=n.topics.length?b(this,J0).getEvent(n.topics[0]):null;if(r)try{return new bO(n,b(this,J0),r)}catch(i){return new kU(n,i)}return n})}}J0=new WeakMap;var $m;class wO extends O1{constructor(n,r,i){super(i,r);M(this,$m,void 0);O(this,$m,n)}async wait(n){const r=await super.wait(n);return r==null?null:new Wre(b(this,$m),this.provider,r)}}$m=new WeakMap;class _U extends O${constructor(n,r,i,a){super(n,r,i);R(this,"log");mt(this,{log:a})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class Jre extends _U{constructor(e,n,r,i,a){super(e,n,r,new bO(a,e.interface,i));const o=e.interface.decodeEventLog(i,this.log.data,this.log.topics);mt(this,{args:o,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const I_=BigInt(0);function NU(t){return t&&typeof t.call=="function"}function IU(t){return t&&typeof t.estimateGas=="function"}function sA(t){return t&&typeof t.resolveName=="function"}function RU(t){return t&&typeof t.sendTransaction=="function"}function MU(t){if(t!=null){if(sA(t))return t;if(t.provider)return t.provider}}var Um;class Yre{constructor(e,n,r){M(this,Um,void 0);R(this,"fragment");if(mt(this,{fragment:n}),n.inputs.lengthr[l]==null?null:s.walkAsync(r[l],(u,f)=>u==="address"?Array.isArray(f)?Promise.all(f.map(h=>fi(h,a))):fi(f,a):f)));return e.interface.encodeFilterTopics(n,o)}())}getTopicFilter(){return b(this,Um)}}Um=new WeakMap;function fh(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function zu(t){return t==null?null:t.provider||null}async function BU(t,e){const n=Wr.dereference(t,"overrides");Y(typeof n=="object","invalid overrides parameter","overrides",t);const r=cx(n);return Y(r.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),Y(r.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=r.from),r}async function Xre(t,e,n){const r=fh(t,"resolveName"),i=sA(r)?r:null;return await Promise.all(e.map((a,o)=>a.walkAsync(n[o],(s,l)=>(l=Wr.dereference(l,s),s==="address"?fi(l,i):l))))}function Zre(t){const e=async function(o){const s=await BU(o,["data"]);s.to=await t.getAddress(),s.from&&(s.from=await fi(s.from,MU(t.runner)));const l=t.interface,c=ot(s.value||I_,"overrides.value")===I_,u=(s.data||"0x")==="0x";l.fallback&&!l.fallback.payable&&l.receive&&!u&&!c&&Y(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),Y(l.fallback||u,"cannot send data to receive-only contract","overrides.data",s.data);const f=l.receive||l.fallback&&l.fallback.payable;return Y(f||c,"cannot send value to non-payable fallback","overrides.value",s.value),Y(l.fallback||u,"cannot send data to receive-only contract","overrides.data",s.data),s},n=async function(o){const s=fh(t.runner,"call");me(NU(s),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const l=await e(o);try{return await s.call(l)}catch(c){throw uO(c)&&c.data?t.interface.makeError(c.data,l):c}},r=async function(o){const s=t.runner;me(RU(s),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const l=await s.sendTransaction(await e(o)),c=zu(t.runner);return new wO(t.interface,c,l)},i=async function(o){const s=fh(t.runner,"estimateGas");return me(IU(s),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await s.estimateGas(await e(o))},a=async o=>await r(o);return mt(a,{_contract:t,estimateGas:i,populateTransaction:e,send:r,staticCall:n}),a}function qre(t,e){const n=function(...c){const u=t.interface.getFunction(e,c);return me(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:c}}),u},r=async function(...c){const u=n(...c);let f={};if(u.inputs.length+1===c.length&&(f=await BU(c.pop()),f.from&&(f.from=await fi(f.from,MU(t.runner)))),u.inputs.length!==c.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const h=await Xre(t.runner,u.inputs,c);return Object.assign({},f,await ni({to:t.getAddress(),data:t.interface.encodeFunctionData(u,h)}))},i=async function(...c){const u=await s(...c);return u.length===1?u[0]:u},a=async function(...c){const u=t.runner;me(RU(u),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const f=await u.sendTransaction(await r(...c)),h=zu(t.runner);return new wO(t.interface,h,f)},o=async function(...c){const u=fh(t.runner,"estimateGas");return me(IU(u),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await u.estimateGas(await r(...c))},s=async function(...c){const u=fh(t.runner,"call");me(NU(u),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const f=await r(...c);let h="0x";try{h=await u.call(f)}catch(g){throw uO(g)&&g.data?t.interface.makeError(g.data,f):g}const d=n(...c);return t.interface.decodeFunctionResult(d,h)},l=async(...c)=>n(...c).constant?await i(...c):await a(...c);return mt(l,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:n,estimateGas:o,populateTransaction:r,send:a,staticCall:i,staticCallResult:s}),Object.defineProperty(l,"fragment",{configurable:!1,enumerable:!0,get:()=>{const c=t.interface.getFunction(e);return me(c,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),c}}),l}function eie(t,e){const n=function(...i){const a=t.interface.getEvent(e,i);return me(a,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:i}}),a},r=function(...i){return new Yre(t,n(...i),i)};return mt(r,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:n}),Object.defineProperty(r,"fragment",{configurable:!1,enumerable:!0,get:()=>{const i=t.interface.getEvent(e);return me(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),i}}),r}const ux=Symbol.for("_ethersInternal_contract"),DU=new WeakMap;function tie(t,e){DU.set(t[ux],e)}function Ki(t){return DU.get(t[ux])}function nie(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function xO(t,e){let n,r=null;if(Array.isArray(e)){const a=function(o){if(In(o,32))return o;const s=t.interface.getEvent(o);return Y(s,"unknown fragment","name",o),s.topicHash};n=e.map(o=>o==null?null:Array.isArray(o)?o.map(a):a(o))}else e==="*"?n=[null]:typeof e=="string"?In(e,32)?n=[e]:(r=t.interface.getEvent(e),Y(r,"unknown fragment","event",e),n=[r.topicHash]):nie(e)?n=await e.getTopicFilter():"fragment"in e?(r=e.fragment,n=[r.topicHash]):Y(!1,"unknown event name","event",e);n=n.map(a=>{if(a==null)return null;if(Array.isArray(a)){const o=Array.from(new Set(a.map(s=>s.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return a.toLowerCase()});const i=n.map(a=>a==null?"null":Array.isArray(a)?a.join("|"):a).join("&");return{fragment:r,tag:i,topics:n}}async function fy(t,e){const{subs:n}=Ki(t);return n.get((await xO(t,e)).tag)||null}async function R_(t,e,n){const r=zu(t.runner);me(r,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:i,tag:a,topics:o}=await xO(t,n),{addr:s,subs:l}=Ki(t);let c=l.get(a);if(!c){const f={address:s||t,topics:o},h=m=>{let y=i;if(y==null)try{y=t.interface.getEvent(m.topics[0])}catch{}if(y){const v=y,x=i?t.interface.decodeEventLog(i,m.data,m.topics):[];D3(t,n,x,A=>new Jre(t,A,n,v,m))}else D3(t,n,[],v=>new _U(t,v,n,m))};let d=[];c={tag:a,listeners:[],start:()=>{d.length||d.push(r.on(f,h))},stop:async()=>{if(d.length==0)return;let m=d;d=[],await Promise.all(m),r.off(f,h)}},l.set(a,c)}return c}let B3=Promise.resolve();async function rie(t,e,n,r){await B3;const i=await fy(t,e);if(!i)return!1;const a=i.listeners.length;return i.listeners=i.listeners.filter(({listener:o,once:s})=>{const l=Array.from(n);r&&l.push(r(s?null:o));try{o.call(t,...l)}catch{}return!s}),i.listeners.length===0&&(i.stop(),Ki(t).subs.delete(i.tag)),a>0}async function D3(t,e,n,r){try{await B3}catch{}const i=rie(t,e,n,r);return B3=i,await i}const rb=["then"];var $Pe;const jy=class jy{constructor(e,n,r,i){R(this,"target");R(this,"interface");R(this,"runner");R(this,"filters");R(this,$Pe);R(this,"fallback");Y(typeof e=="string"||$$(e),"invalid value for Contract target","target",e),r==null&&(r=null);const a=M3.from(n);mt(this,{target:e,runner:r,interface:a}),Object.defineProperty(this,ux,{value:{}});let o,s=null,l=null;if(i){const f=zu(r);l=new wO(this.interface,f,i)}let c=new Map;if(typeof e=="string")if(In(e))s=e,o=Promise.resolve(e);else{const f=fh(r,"resolveName");if(!sA(f))throw er("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=f.resolveName(e).then(h=>{if(h==null)throw er("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return Ki(this).addr=h,h})}else o=e.getAddress().then(f=>{if(f==null)throw new Error("TODO");return Ki(this).addr=f,f});tie(this,{addrPromise:o,addr:s,deployTx:l,subs:c});const u=new Proxy({},{get:(f,h,d)=>{if(typeof h=="symbol"||rb.indexOf(h)>=0)return Reflect.get(f,h,d);try{return this.getEvent(h)}catch(g){if(!Kr(g,"INVALID_ARGUMENT")||g.argument!=="key")throw g}},has:(f,h)=>rb.indexOf(h)>=0?Reflect.has(f,h):Reflect.has(f,h)||this.interface.hasEvent(String(h))});return mt(this,{filters:u}),mt(this,{fallback:a.receive||a.fallback?Zre(this):null}),new Proxy(this,{get:(f,h,d)=>{if(typeof h=="symbol"||h in f||rb.indexOf(h)>=0)return Reflect.get(f,h,d);try{return f.getFunction(h)}catch(g){if(!Kr(g,"INVALID_ARGUMENT")||g.argument!=="key")throw g}},has:(f,h)=>typeof h=="symbol"||h in f||rb.indexOf(h)>=0?Reflect.has(f,h):f.interface.hasFunction(h)})}connect(e){return new jy(this.target,this.interface,e)}attach(e){return new jy(e,this.interface,this.runner)}async getAddress(){return await Ki(this).addrPromise}async getDeployedCode(){const e=zu(this.runner);me(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const n=await e.getCode(await this.getAddress());return n==="0x"?null:n}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const r=zu(this.runner);return me(r!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((i,a)=>{const o=async()=>{try{if(await this.getDeployedCode()!=null)return i(this);r.once("block",o)}catch(s){a(s)}};o()})}deploymentTransaction(){return Ki(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),qre(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),eie(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,n,r){n==null&&(n=0),r==null&&(r="latest");const{addr:i,addrPromise:a}=Ki(this),o=i||await a,{fragment:s,topics:l}=await xO(this,e),c={address:o,topics:l,fromBlock:n,toBlock:r},u=zu(this.runner);return me(u,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await u.getLogs(c)).map(f=>{let h=s;if(h==null)try{h=this.interface.getEvent(f.topics[0])}catch{}if(h)try{return new bO(f,this.interface,h)}catch(d){return new kU(f,d)}return new fv(f,u)})}async on(e,n){const r=await R_(this,"on",e);return r.listeners.push({listener:n,once:!1}),r.start(),this}async once(e,n){const r=await R_(this,"once",e);return r.listeners.push({listener:n,once:!0}),r.start(),this}async emit(e,...n){return await D3(this,e,n,null)}async listenerCount(e){if(e){const i=await fy(this,e);return i?i.listeners.length:0}const{subs:n}=Ki(this);let r=0;for(const{listeners:i}of n.values())r+=i.length;return r}async listeners(e){if(e){const i=await fy(this,e);return i?i.listeners.map(({listener:a})=>a):[]}const{subs:n}=Ki(this);let r=[];for(const{listeners:i}of n.values())r=r.concat(i.map(({listener:a})=>a));return r}async off(e,n){const r=await fy(this,e);if(!r)return this;if(n){const i=r.listeners.map(({listener:a})=>a).indexOf(n);i>=0&&r.listeners.splice(i,1)}return(n==null||r.listeners.length===0)&&(r.stop(),Ki(this).subs.delete(r.tag)),this}async removeAllListeners(e){if(e){const n=await fy(this,e);if(!n)return this;n.stop(),Ki(this).subs.delete(n.tag)}else{const{subs:n}=Ki(this);for(const{tag:r,stop:i}of n.values())i(),n.delete(r)}return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return await this.off(e,n)}static buildClass(e){class n extends jy{constructor(i,a=null){super(i,e,a)}}return n}static from(e,n,r){return r==null&&(r=null),new this(e,n,r)}};$Pe=ux;let L3=jy;function iie(){return L3}class Ny extends iie(){}function aE(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Y(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class aie{constructor(e){R(this,"name");mt(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,n){throw new Error("unsupported coin")}async decodeAddress(e,n){throw new Error("unsupported coin")}}const LU=new RegExp("^(ipfs)://(.*)$","i"),M_=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),LU,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var Ec,Tf,Sc,Gh,g2,$U;const bd=class bd{constructor(e,n,r){M(this,Sc);R(this,"provider");R(this,"address");R(this,"name");M(this,Ec,void 0);M(this,Tf,void 0);mt(this,{provider:e,address:n,name:r}),O(this,Ec,null),O(this,Tf,new Ny(n,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return b(this,Ec)==null&&O(this,Ec,(async()=>{try{return await b(this,Tf).supportsInterface("0x9061b923")}catch(e){if(Kr(e,"CALL_EXCEPTION"))return!1;throw O(this,Ec,null),e}})()),await b(this,Ec)}async getAddress(e){if(e==null&&(e=60),e===60)try{const a=await ie(this,Sc,Gh).call(this,"addr(bytes32)");return a==null||a===O3?null:a}catch(a){if(Kr(a,"CALL_EXCEPTION"))return null;throw a}if(e>=0&&e<2147483648){let a=e+2147483648;const o=await ie(this,Sc,Gh).call(this,"addr(bytes32,uint)",[a]);if(In(o,20))return rn(o)}let n=null;for(const a of this.provider.plugins)if(a instanceof aie&&a.supportsCoinType(e)){n=a;break}if(n==null)return null;const r=await ie(this,Sc,Gh).call(this,"addr(bytes32,uint)",[e]);if(r==null||r==="0x")return null;const i=await n.decodeAddress(e,r);if(i!=null)return i;me(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:r}})}async getText(e){const n=await ie(this,Sc,Gh).call(this,"text(bytes32,string)",[e]);return n==null||n==="0x"?null:n}async getContentHash(){const e=await ie(this,Sc,Gh).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const n=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const i=n[1]==="e3010170"?"ipfs":"ipns",a=parseInt(n[4],16);if(n[5].length===a*2)return`${i}://${Vte("0x"+n[2])}`}const r=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&r[1].length===64)return`bzz://${r[1]}`;me(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const n=await this.getText("avatar");if(n==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:n});for(let r=0;r{if(!Array.isArray(e))throw new Error("not an array");return e.map(n=>t(n))}}function hv(t,e){return n=>{const r={};for(const i in t){let a=i;if(e&&i in e&&!(a in n)){for(const o of e[i])if(o in n){a=o;break}}try{const o=t[i](n[a]);o!==void 0&&(r[i]=o)}catch(o){const s=o instanceof Error?o.message:"not-an-error";me(!1,`invalid value for value.${i} (${s})`,"BAD_DATA",{value:n})}}return r}}function oie(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}Y(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function Cp(t){return Y(In(t,!0),"invalid data","value",t),t}function za(t){return Y(In(t,32),"invalid hash","value",t),t}const sie=hv({address:rn,blockHash:za,blockNumber:Lt,data:Cp,index:Lt,removed:Tn(oie,!1),topics:AO(za),transactionHash:za,transactionIndex:Lt},{index:["logIndex"]});function lie(t){return sie(t)}const cie=hv({hash:Tn(za),parentHash:za,number:Lt,timestamp:Lt,nonce:Tn(Cp),difficulty:ot,gasLimit:ot,gasUsed:ot,miner:Tn(rn),extraData:Cp,baseFeePerGas:Tn(ot)});function uie(t){const e=cie(t);return e.transactions=t.transactions.map(n=>typeof n=="string"?n:UU(n)),e}const fie=hv({transactionIndex:Lt,blockNumber:Lt,transactionHash:za,address:rn,topics:AO(za),data:Cp,index:Lt,blockHash:za},{index:["logIndex"]});function hie(t){return fie(t)}const die=hv({to:Tn(rn,null),from:Tn(rn,null),contractAddress:Tn(rn,null),index:Lt,root:Tn(Ze),gasUsed:ot,logsBloom:Tn(Cp),blockHash:za,hash:za,logs:AO(hie),blockNumber:Lt,cumulativeGasUsed:ot,effectiveGasPrice:Tn(ot),status:Tn(Lt),type:Tn(Lt,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function pie(t){return die(t)}function UU(t){t.to&&ot(t.to)===B_&&(t.to="0x0000000000000000000000000000000000000000");const e=hv({hash:za,type:n=>n==="0x"||n==null?0:Lt(n),accessList:Tn(xh,null),blockHash:Tn(za,null),blockNumber:Tn(Lt,null),transactionIndex:Tn(Lt,null),from:rn,gasPrice:Tn(ot),maxPriorityFeePerGas:Tn(ot),maxFeePerGas:Tn(ot),gasLimit:ot,to:Tn(rn,null),value:ot,nonce:Lt,data:Cp,creates:Tn(rn,null),chainId:Tn(ot,null)},{data:["input"],gasLimit:["gas"]})(t);if(e.to==null&&e.creates==null&&(e.creates=dne(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=To.from(t.signature):e.signature=To.from(t),e.chainId==null){const n=e.signature.legacyChainId;n!=null&&(e.chainId=n)}return e.blockHash&&ot(e.blockHash)===B_&&(e.blockHash=null),e}const gie="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class dv{constructor(e){R(this,"name");mt(this,{name:e})}clone(){return new dv(this.name)}}class lA extends dv{constructor(n,r){n==null&&(n=0);super(`org.ethers.network.plugins.GasCost#${n||0}`);R(this,"effectiveBlock");R(this,"txBase");R(this,"txCreate");R(this,"txDataZero");R(this,"txDataNonzero");R(this,"txAccessListStorageKey");R(this,"txAccessListAddress");const i={effectiveBlock:n};function a(o,s){let l=(r||{})[o];l==null&&(l=s),Y(typeof l=="number",`invalud value for ${o}`,"costs",r),i[o]=l}a("txBase",21e3),a("txCreate",32e3),a("txDataZero",4),a("txDataNonzero",16),a("txAccessListStorageKey",1900),a("txAccessListAddress",2400),mt(this,i)}clone(){return new lA(this.effectiveBlock,this)}}class cA extends dv{constructor(n,r){super("org.ethers.plugins.network.Ens");R(this,"address");R(this,"targetNetwork");mt(this,{address:n||gie,targetNetwork:r??1})}clone(){return new cA(this.address,this.targetNetwork)}}var Fm,jm;class yie extends dv{constructor(n,r){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");M(this,Fm,void 0);M(this,jm,void 0);O(this,Fm,n),O(this,jm,r)}get url(){return b(this,Fm)}get processFunc(){return b(this,jm)}clone(){return this}}Fm=new WeakMap,jm=new WeakMap;const oE=new Map;var Y0,X0,Pc;const wd=class wd{constructor(e,n){M(this,Y0,void 0);M(this,X0,void 0);M(this,Pc,void 0);O(this,Y0,e),O(this,X0,ot(n)),O(this,Pc,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return b(this,Y0)}set name(e){O(this,Y0,e)}get chainId(){return b(this,X0)}set chainId(e){O(this,X0,ot(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===ot(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===ot(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===ot(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(b(this,Pc).values())}attachPlugin(e){if(b(this,Pc).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return b(this,Pc).set(e.name,e.clone()),this}getPlugin(e){return b(this,Pc).get(e)||null}getPlugins(e){return this.plugins.filter(n=>n.name.split("#")[0]===e)}clone(){const e=new wd(this.name,this.chainId);return this.plugins.forEach(n=>{e.attachPlugin(n.clone())}),e}computeIntrinsicGas(e){const n=this.getPlugin("org.ethers.plugins.network.GasCost")||new lA;let r=n.txBase;if(e.to==null&&(r+=n.txCreate),e.data)for(let i=2;i9){let i=BigInt(r[1].substring(0,9));r[1].substring(9).match(/^0+$/)||i++,r[1]=i.toString()}return BigInt(r[0]+r[1])}function L_(t){return new yie(t,async(e,n,r)=>{r.setHeader("User-Agent","ethers");let i;try{const[a,o]=await Promise.all([r.send(),e()]);i=a;const s=i.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:D_(s.maxFee,9),maxPriorityFeePerGas:D_(s.maxPriorityFee,9)}}catch(a){me(!1,`error encountered with polygon gas station (${JSON.stringify(r.url)})`,"SERVER_ERROR",{request:r,response:i,error:a})}})}let $_=!1;function mie(){if($_)return;$_=!0;function t(e,n,r){const i=function(){const a=new ns(e,n);return r.ensNetwork!=null&&a.attachPlugin(new cA(null,r.ensNetwork)),a.attachPlugin(new lA),(r.plugins||[]).forEach(o=>{a.attachPlugin(o)}),a};ns.register(e,i),ns.register(n,i),r.altNames&&r.altNames.forEach(a=>{ns.register(a,i)})}t("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),t("ropsten",3,{ensNetwork:3}),t("rinkeby",4,{ensNetwork:4}),t("goerli",5,{ensNetwork:5}),t("kovan",42,{ensNetwork:42}),t("sepolia",11155111,{ensNetwork:11155111}),t("classic",61,{}),t("classicKotti",6,{}),t("arbitrum",42161,{ensNetwork:1}),t("arbitrum-goerli",421613,{}),t("base",8453,{ensNetwork:1}),t("base-goerli",84531,{}),t("base-sepolia",84532,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("matic",137,{ensNetwork:1,plugins:[L_("https://gasstation.polygon.technology/v2")]}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[L_("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[]}),t("optimism-goerli",420,{}),t("xdai",100,{ensNetwork:1})}function $3(t){return JSON.parse(JSON.stringify(t))}var Xs,Oa,Oc,Jo,Z0,sw;class vie{constructor(e){M(this,Z0);M(this,Xs,void 0);M(this,Oa,void 0);M(this,Oc,void 0);M(this,Jo,void 0);O(this,Xs,e),O(this,Oa,null),O(this,Oc,4e3),O(this,Jo,-2)}get pollingInterval(){return b(this,Oc)}set pollingInterval(e){O(this,Oc,e)}start(){b(this,Oa)||(O(this,Oa,b(this,Xs)._setTimeout(ie(this,Z0,sw).bind(this),b(this,Oc))),ie(this,Z0,sw).call(this))}stop(){b(this,Oa)&&(b(this,Xs)._clearTimeout(b(this,Oa)),O(this,Oa,null))}pause(e){this.stop(),e&&O(this,Jo,-2)}resume(){this.start()}}Xs=new WeakMap,Oa=new WeakMap,Oc=new WeakMap,Jo=new WeakMap,Z0=new WeakSet,sw=async function(){try{const e=await b(this,Xs).getBlockNumber();if(b(this,Jo)===-2){O(this,Jo,e);return}if(e!==b(this,Jo)){for(let n=b(this,Jo)+1;n<=e;n++){if(b(this,Oa)==null)return;await b(this,Xs).emit("block",n)}O(this,Jo,e)}}catch{}b(this,Oa)!=null&&O(this,Oa,b(this,Xs)._setTimeout(ie(this,Z0,sw).bind(this),b(this,Oc)))};var Cf,kf,Tc;class EO{constructor(e){M(this,Cf,void 0);M(this,kf,void 0);M(this,Tc,void 0);O(this,Cf,e),O(this,Tc,!1),O(this,kf,n=>{this._poll(n,b(this,Cf))})}async _poll(e,n){throw new Error("sub-classes must override this")}start(){b(this,Tc)||(O(this,Tc,!0),b(this,kf).call(this,-2),b(this,Cf).on("block",b(this,kf)))}stop(){b(this,Tc)&&(O(this,Tc,!1),b(this,Cf).off("block",b(this,kf)))}pause(e){this.stop()}resume(){this.start()}}Cf=new WeakMap,kf=new WeakMap,Tc=new WeakMap;var q0,Zs;class bie extends EO{constructor(n,r){super(n);M(this,q0,void 0);M(this,Zs,void 0);O(this,q0,r),O(this,Zs,-2)}pause(n){n&&O(this,Zs,-2),super.pause(n)}async _poll(n,r){const i=await r.getBlock(b(this,q0));i!=null&&(b(this,Zs)===-2?O(this,Zs,i.number):i.number>b(this,Zs)&&(r.emit(b(this,q0),i.number),O(this,Zs,i.number)))}}q0=new WeakMap,Zs=new WeakMap;var y2;class wie extends EO{constructor(n,r){super(n);M(this,y2,void 0);O(this,y2,$3(r))}async _poll(n,r){throw new Error("@TODO")}}y2=new WeakMap;var ep;class xie extends EO{constructor(n,r){super(n);M(this,ep,void 0);O(this,ep,r)}async _poll(n,r){const i=await r.getTransactionReceipt(b(this,ep));i&&r.emit(b(this,ep),i)}}ep=new WeakMap;var qs,tp,np,Cc,Ta,m2,FU;class SO{constructor(e,n){M(this,m2);M(this,qs,void 0);M(this,tp,void 0);M(this,np,void 0);M(this,Cc,void 0);M(this,Ta,void 0);O(this,qs,e),O(this,tp,$3(n)),O(this,np,ie(this,m2,FU).bind(this)),O(this,Cc,!1),O(this,Ta,-2)}start(){b(this,Cc)||(O(this,Cc,!0),b(this,Ta)===-2&&b(this,qs).getBlockNumber().then(e=>{O(this,Ta,e)}),b(this,qs).on("block",b(this,np)))}stop(){b(this,Cc)&&(O(this,Cc,!1),b(this,qs).off("block",b(this,np)))}pause(e){this.stop(),e&&O(this,Ta,-2)}resume(){this.start()}}qs=new WeakMap,tp=new WeakMap,np=new WeakMap,Cc=new WeakMap,Ta=new WeakMap,m2=new WeakSet,FU=async function(e){if(b(this,Ta)===-2)return;const n=$3(b(this,tp));n.fromBlock=b(this,Ta)+1,n.toBlock=e;const r=await b(this,qs).getLogs(n);if(r.length===0){b(this,Ta){if(r==null)return"null";if(typeof r=="bigint")return`bigint:${r.toString()}`;if(typeof r=="string")return r.toLowerCase();if(typeof r=="object"&&!Array.isArray(r)){const i=Object.keys(r);return i.sort(),i.reduce((a,o)=>(a[o]=r[o],a),{})}return r})}class jU{constructor(e){R(this,"name");mt(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function Sie(t){return JSON.parse(JSON.stringify(t))}function U3(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function sE(t,e){if(t==null)throw new Error("invalid event");if(Array.isArray(t)&&(t={topics:t}),typeof t=="string")switch(t){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:t,tag:t}}if(In(t,32)){const n=t.toLowerCase();return{type:"transaction",tag:lw("tx",{hash:n}),hash:n}}if(t.orphan){const n=t;return{type:"orphan",tag:lw("orphan",n),filter:Sie(n)}}if(t.address||t.topics){const n=t,r={topics:(n.topics||[]).map(i=>i==null?null:Array.isArray(i)?U3(i.map(a=>a.toLowerCase())):i.toLowerCase())};if(n.address){const i=[],a=[],o=s=>{In(s)?i.push(s):a.push((async()=>{i.push(await fi(s,e))})())};Array.isArray(n.address)?n.address.forEach(o):o(n.address),a.length&&await Promise.all(a),r.address=U3(i.map(s=>s.toLowerCase()))}return{filter:r,tag:lw("event",r),type:"event"}}Y(!1,"unknown ProviderEvent","event",t)}function lE(){return new Date().getTime()}const Pie={cacheTimeout:250,pollingInterval:4e3};var Fr,kc,jr,rp,ta,_f,_c,el,zm,Ca,ip,ap,qr,Vi,Hm,F3,Gm,j3,Nf,hy,Vm,z3,If,dy,op,cw;class zU{constructor(e,n){M(this,qr);M(this,Hm);M(this,Gm);M(this,Nf);M(this,Vm);M(this,If);M(this,op);M(this,Fr,void 0);M(this,kc,void 0);M(this,jr,void 0);M(this,rp,void 0);M(this,ta,void 0);M(this,_f,void 0);M(this,_c,void 0);M(this,el,void 0);M(this,zm,void 0);M(this,Ca,void 0);M(this,ip,void 0);M(this,ap,void 0);if(O(this,ap,Object.assign({},Pie,n||{})),e==="any")O(this,_f,!0),O(this,ta,null);else if(e){const r=ns.from(e);O(this,_f,!1),O(this,ta,Promise.resolve(r)),setTimeout(()=>{this.emit("network",r,null)},0)}else O(this,_f,!1),O(this,ta,null);O(this,el,-1),O(this,_c,new Map),O(this,Fr,new Map),O(this,kc,new Map),O(this,jr,null),O(this,rp,!1),O(this,zm,1),O(this,Ca,new Map),O(this,ip,!1)}get pollingInterval(){return b(this,ap).pollingInterval}get provider(){return this}get plugins(){return Array.from(b(this,kc).values())}attachPlugin(e){if(b(this,kc).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return b(this,kc).set(e.name,e.connect(this)),this}getPlugin(e){return b(this,kc).get(e)||null}get disableCcipRead(){return b(this,ip)}set disableCcipRead(e){O(this,ip,!!e)}async ccipReadFetch(e,n,r){if(this.disableCcipRead||r.length===0||e.to==null)return null;const i=e.to.toLowerCase(),a=n.toLowerCase(),o=[];for(let s=0;s=500,`response not found during CCIP fetch: ${f}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:l,errorMessage:f}}),o.push(f)}me(!1,`error encountered during CCIP fetch: ${o.map(s=>JSON.stringify(s)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:r,errorMessages:o}})}_wrapBlock(e,n){return new Vre(uie(e),this)}_wrapLog(e,n){return new fv(lie(e),this)}_wrapTransactionReceipt(e,n){return new OU(pie(e),this)}_wrapTransactionResponse(e,n){return new O1(UU(e),this)}_detectNetwork(){me(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){me(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=Lt(await ie(this,qr,Vi).call(this,{method:"getBlockNumber"}),"%response");return b(this,el)>=0&&O(this,el,e),e}_getAddress(e){return fi(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if(In(e))return In(e,32)?e:Fu(e);if(typeof e=="bigint"&&(e=Lt(e,"blockTag")),typeof e=="number")return e>=0?Fu(e):b(this,el)>=0?Fu(b(this,el)+e):this.getBlockNumber().then(n=>Fu(n+e));Y(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const n=(e.topics||[]).map(l=>l==null?null:Array.isArray(l)?U3(l.map(c=>c.toLowerCase())):l.toLowerCase()),r="blockHash"in e?e.blockHash:void 0,i=(l,c,u)=>{let f;switch(l.length){case 0:break;case 1:f=l[0];break;default:l.sort(),f=l}if(r&&(c!=null||u!=null))throw new Error("invalid filter");const h={};return f&&(h.address=f),n.length&&(h.topics=n),c&&(h.fromBlock=c),u&&(h.toBlock=u),r&&(h.blockHash=r),h};let a=[];if(e.address)if(Array.isArray(e.address))for(const l of e.address)a.push(this._getAddress(l));else a.push(this._getAddress(e.address));let o;"fromBlock"in e&&(o=this._getBlockTag(e.fromBlock));let s;return"toBlock"in e&&(s=this._getBlockTag(e.toBlock)),a.filter(l=>typeof l!="string").length||o!=null&&typeof o!="string"||s!=null&&typeof s!="string"?Promise.all([Promise.all(a),o,s]).then(l=>i(l[0],l[1],l[2])):i(a,o,s)}_getTransactionRequest(e){const n=cx(e),r=[];if(["to","from"].forEach(i=>{if(n[i]==null)return;const a=fi(n[i],this);ib(a)?r.push(async function(){n[i]=await a}()):n[i]=a}),n.blockTag!=null){const i=this._getBlockTag(n.blockTag);ib(i)?r.push(async function(){n.blockTag=await i}()):n.blockTag=i}return r.length?async function(){return await Promise.all(r),n}():n}async getNetwork(){if(b(this,ta)==null){const i=(async()=>{try{const a=await this._detectNetwork();return this.emit("network",a,null),a}catch(a){throw b(this,ta)===i&&O(this,ta,null),a}})();return O(this,ta,i),(await i).clone()}const e=b(this,ta),[n,r]=await Promise.all([e,this._detectNetwork()]);return n.chainId!==r.chainId&&(b(this,_f)?(this.emit("network",r,n),b(this,ta)===e&&O(this,ta,Promise.resolve(r))):me(!1,`network changed: ${n.chainId} => ${r.chainId} `,"NETWORK_ERROR",{event:"changed"})),n.clone()}async getFeeData(){const e=await this.getNetwork(),n=async()=>{const{_block:i,gasPrice:a,priorityFee:o}=await ni({_block:ie(this,Vm,z3).call(this,"latest",!1),gasPrice:(async()=>{try{const u=await ie(this,qr,Vi).call(this,{method:"getGasPrice"});return ot(u,"%response")}catch{}return null})(),priorityFee:(async()=>{try{const u=await ie(this,qr,Vi).call(this,{method:"getPriorityFee"});return ot(u,"%response")}catch{}return null})()});let s=null,l=null;const c=this._wrapBlock(i,e);return c&&c.baseFeePerGas&&(l=o??BigInt("1000000000"),s=c.baseFeePerGas*Aie+l),new N_(a,s,l)},r=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(r){const i=new Sl(r.url),a=await r.processFunc(n,this,i);return new N_(a.gasPrice,a.maxFeePerGas,a.maxPriorityFeePerGas)}return await n()}async estimateGas(e){let n=this._getTransactionRequest(e);return ib(n)&&(n=await n),ot(await ie(this,qr,Vi).call(this,{method:"estimateGas",transaction:n}),"%response")}async call(e){const{tx:n,blockTag:r}=await ni({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await ie(this,Gm,j3).call(this,ie(this,Hm,F3).call(this,n,r,e.enableCcipRead?0:-1))}async getBalance(e,n){return ot(await ie(this,Nf,hy).call(this,{method:"getBalance"},e,n),"%response")}async getTransactionCount(e,n){return Lt(await ie(this,Nf,hy).call(this,{method:"getTransactionCount"},e,n),"%response")}async getCode(e,n){return Ze(await ie(this,Nf,hy).call(this,{method:"getCode"},e,n))}async getStorage(e,n,r){const i=ot(n,"position");return Ze(await ie(this,Nf,hy).call(this,{method:"getStorage",position:i},e,r))}async broadcastTransaction(e){const{blockNumber:n,hash:r,network:i}=await ni({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),a=A1.from(e);if(a.hash!==r)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(a,i).replaceableTransaction(n)}async getBlock(e,n){const{network:r,params:i}=await ni({network:this.getNetwork(),params:ie(this,Vm,z3).call(this,e,!!n)});return i==null?null:this._wrapBlock(i,r)}async getTransaction(e){const{network:n,params:r}=await ni({network:this.getNetwork(),params:ie(this,qr,Vi).call(this,{method:"getTransaction",hash:e})});return r==null?null:this._wrapTransactionResponse(r,n)}async getTransactionReceipt(e){const{network:n,params:r}=await ni({network:this.getNetwork(),params:ie(this,qr,Vi).call(this,{method:"getTransactionReceipt",hash:e})});if(r==null)return null;if(r.gasPrice==null&&r.effectiveGasPrice==null){const i=await ie(this,qr,Vi).call(this,{method:"getTransaction",hash:e});if(i==null)throw new Error("report this; could not find tx or effectiveGasPrice");r.effectiveGasPrice=i.gasPrice}return this._wrapTransactionReceipt(r,n)}async getTransactionResult(e){const{result:n}=await ni({network:this.getNetwork(),result:ie(this,qr,Vi).call(this,{method:"getTransactionResult",hash:e})});return n==null?null:Ze(n)}async getLogs(e){let n=this._getFilter(e);ib(n)&&(n=await n);const{network:r,params:i}=await ni({network:this.getNetwork(),params:ie(this,qr,Vi).call(this,{method:"getLogs",filter:n})});return i.map(a=>this._wrapLog(a,r))}_getProvider(e){me(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await fx.fromName(this,e)}async getAvatar(e){const n=await this.getResolver(e);return n?await n.getAvatar():null}async resolveName(e){const n=await this.getResolver(e);return n?await n.getAddress():null}async lookupAddress(e){e=rn(e);const n=I3(e.substring(2).toLowerCase()+".addr.reverse");try{const r=await fx.getEnsAddress(this),a=await new Ny(r,["function resolver(bytes32) view returns (address)"],this).resolver(n);if(a==null||a===O3)return null;const s=await new Ny(a,["function name(bytes32) view returns (string)"],this).name(n);return await this.resolveName(s)!==e?null:s}catch(r){if(Kr(r,"BAD_DATA")&&r.value==="0x"||Kr(r,"CALL_EXCEPTION"))return null;throw r}return null}async waitForTransaction(e,n,r){const i=n??1;return i===0?this.getTransactionReceipt(e):new Promise(async(a,o)=>{let s=null;const l=async c=>{try{const u=await this.getTransactionReceipt(e);if(u!=null&&c-u.blockNumber+1>=i){a(u),s&&(clearTimeout(s),s=null);return}}catch(u){console.log("EEE",u)}this.once("block",l)};r!=null&&(s=setTimeout(()=>{s!=null&&(s=null,this.off("block",l),o(er("timeout","TIMEOUT",{reason:"timeout"})))},r)),l(await this.getBlockNumber())})}async waitForBlock(e){me(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const n=b(this,Ca).get(e);n&&(n.timer&&clearTimeout(n.timer),b(this,Ca).delete(e))}_setTimeout(e,n){n==null&&(n=0);const r=vs(this,zm)._++,i=()=>{b(this,Ca).delete(r),e()};if(this.paused)b(this,Ca).set(r,{timer:null,func:i,time:n});else{const a=setTimeout(i,n);b(this,Ca).set(r,{timer:a,func:i,time:lE()})}return r}_forEachSubscriber(e){for(const n of b(this,Fr).values())e(n.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new jU(e.type);case"block":{const n=new vie(this);return n.pollingInterval=this.pollingInterval,n}case"safe":case"finalized":return new bie(this,e.type);case"event":return new SO(this,e.filter);case"transaction":return new xie(this,e.hash);case"orphan":return new wie(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,n){for(const r of b(this,Fr).values())if(r.subscriber===e){r.started&&r.subscriber.stop(),r.subscriber=n,r.started&&n.start(),b(this,jr)!=null&&n.pause(b(this,jr));break}}async on(e,n){const r=await ie(this,op,cw).call(this,e);return r.listeners.push({listener:n,once:!1}),r.started||(r.subscriber.start(),r.started=!0,b(this,jr)!=null&&r.subscriber.pause(b(this,jr))),this}async once(e,n){const r=await ie(this,op,cw).call(this,e);return r.listeners.push({listener:n,once:!0}),r.started||(r.subscriber.start(),r.started=!0,b(this,jr)!=null&&r.subscriber.pause(b(this,jr))),this}async emit(e,...n){const r=await ie(this,If,dy).call(this,e,n);if(!r||r.listeners.length===0)return!1;const i=r.listeners.length;return r.listeners=r.listeners.filter(({listener:a,once:o})=>{const s=new O$(this,o?null:a,e);try{a.call(this,...n,s)}catch{}return!o}),r.listeners.length===0&&(r.started&&r.subscriber.stop(),b(this,Fr).delete(r.tag)),i>0}async listenerCount(e){if(e){const r=await ie(this,If,dy).call(this,e);return r?r.listeners.length:0}let n=0;for(const{listeners:r}of b(this,Fr).values())n+=r.length;return n}async listeners(e){if(e){const r=await ie(this,If,dy).call(this,e);return r?r.listeners.map(({listener:i})=>i):[]}let n=[];for(const{listeners:r}of b(this,Fr).values())n=n.concat(r.map(({listener:i})=>i));return n}async off(e,n){const r=await ie(this,If,dy).call(this,e);if(!r)return this;if(n){const i=r.listeners.map(({listener:a})=>a).indexOf(n);i>=0&&r.listeners.splice(i,1)}return(!n||r.listeners.length===0)&&(r.started&&r.subscriber.stop(),b(this,Fr).delete(r.tag)),this}async removeAllListeners(e){if(e){const{tag:n,started:r,subscriber:i}=await ie(this,op,cw).call(this,e);r&&i.stop(),b(this,Fr).delete(n)}else for(const[n,{started:r,subscriber:i}]of b(this,Fr))r&&i.stop(),b(this,Fr).delete(n);return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return this.off(e,n)}get destroyed(){return b(this,rp)}destroy(){this.removeAllListeners();for(const e of b(this,Ca).keys())this._clearTimeout(e);O(this,rp,!0)}get paused(){return b(this,jr)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(O(this,el,-1),b(this,jr)!=null){if(b(this,jr)==!!e)return;me(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(n=>n.pause(e)),O(this,jr,!!e);for(const n of b(this,Ca).values())n.timer&&clearTimeout(n.timer),n.time=lE()-n.time}resume(){if(b(this,jr)!=null){this._forEachSubscriber(e=>e.resume()),O(this,jr,null);for(const e of b(this,Ca).values()){let n=e.time;n<0&&(n=0),e.time=lE(),setTimeout(e.func,n)}}}}Fr=new WeakMap,kc=new WeakMap,jr=new WeakMap,rp=new WeakMap,ta=new WeakMap,_f=new WeakMap,_c=new WeakMap,el=new WeakMap,zm=new WeakMap,Ca=new WeakMap,ip=new WeakMap,ap=new WeakMap,qr=new WeakSet,Vi=async function(e){const n=b(this,ap).cacheTimeout;if(n<0)return await this._perform(e);const r=lw(e.method,e);let i=b(this,_c).get(r);return i||(i=this._perform(e),b(this,_c).set(r,i),setTimeout(()=>{b(this,_c).get(r)===i&&b(this,_c).delete(r)},n)),await i},Hm=new WeakSet,F3=async function(e,n,r){me(r=0&&n==="latest"&&i.to!=null&&Fn(a.data,0,4)==="0x556f1830"){const o=a.data,s=await fi(i.to,this);let l;try{l=_ie(Fn(a.data,4))}catch(f){me(!1,f.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:o}})}me(l.sender.toLowerCase()===s.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:o,reason:"OffchainLookup",transaction:i,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:l.errorArgs}});const c=await this.ccipReadFetch(i,l.calldata,l.urls);me(c!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:a.data,errorArgs:l.errorArgs}});const u={to:s,data:lr([l.selector,kie([c,l.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:u});try{const f=await ie(this,Hm,F3).call(this,u,n,r+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},u),result:f}),f}catch(f){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},u),error:f}),f}}throw a}},Gm=new WeakSet,j3=async function(e){const{value:n}=await ni({network:this.getNetwork(),value:e});return n},Nf=new WeakSet,hy=async function(e,n,r){let i=this._getAddress(n),a=this._getBlockTag(r);return(typeof i!="string"||typeof a!="string")&&([i,a]=await Promise.all([i,a])),await ie(this,Gm,j3).call(this,ie(this,qr,Vi).call(this,Object.assign(e,{address:i,blockTag:a})))},Vm=new WeakSet,z3=async function(e,n){if(In(e,32))return await ie(this,qr,Vi).call(this,{method:"getBlock",blockHash:e,includeTransactions:n});let r=this._getBlockTag(e);return typeof r!="string"&&(r=await r),await ie(this,qr,Vi).call(this,{method:"getBlock",blockTag:r,includeTransactions:n})},If=new WeakSet,dy=async function(e,n){let r=await sE(e,this);return r.type==="event"&&n&&n.length>0&&n[0].removed===!0&&(r=await sE({orphan:"drop-log",log:n[0]},this)),b(this,Fr).get(r.tag)||null},op=new WeakSet,cw=async function(e){const n=await sE(e,this),r=n.tag;let i=b(this,Fr).get(r);return i||(i={subscriber:this._getSubscriber(n),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},b(this,Fr).set(r,i)),i};function Oie(t,e){try{const n=H3(t,e);if(n)return hO(n)}catch{}return null}function H3(t,e){if(t==="0x")return null;try{const n=Lt(Fn(t,e,e+32)),r=Lt(Fn(t,n,n+32));return Fn(t,n+32,n+32+r)}catch{}return null}function U_(t){const e=sa(t);if(e.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(e,32-e.length),n}function Tie(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const Cie=new Uint8Array([]);function kie(t){const e=[];let n=0;for(let r=0;r=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const n=Fn(t,0,32);me(Fn(n,0,12)===Fn(F_,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=Fn(n,12);try{const r=[],i=Lt(Fn(t,32,64)),a=Lt(Fn(t,i,i+32)),o=Fn(t,i+32);for(let s=0;se[r]),e}function Nh(t,e){if(t.provider)return t.provider;me(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function j_(t,e){let n=cx(e);if(n.to!=null&&(n.to=fi(n.to,t)),n.from!=null){const r=n.from;n.from=Promise.all([t.getAddress(),fi(r,t)]).then(([i,a])=>(Y(i.toLowerCase()===a.toLowerCase(),"transaction from mismatch","tx.from",a),i))}else n.from=t.getAddress();return await ni(n)}class HU{constructor(e){R(this,"provider");mt(this,{provider:e||null})}async getNonce(e){return Nh(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await j_(this,e)}async populateTransaction(e){const n=Nh(this,"populateTransaction"),r=await j_(this,e);r.nonce==null&&(r.nonce=await this.getNonce("pending")),r.gasLimit==null&&(r.gasLimit=await this.estimateGas(r));const i=await this.provider.getNetwork();if(r.chainId!=null){const o=ot(r.chainId);Y(o===i.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else r.chainId=i.chainId;const a=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||a)?Y(!1,"eip-1559 transaction do not support gasPrice","tx",e):(r.type===0||r.type===1)&&a&&Y(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1){const o=await n.getFeeData();me(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice)}else{const o=await n.getFeeData();if(r.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const s=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=s,r.maxPriorityFeePerGas=s}else r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?(me(!a,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=o.gasPrice),r.type=0):me(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=o.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await ni(r)}async estimateGas(e){return Nh(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Nh(this,"call").call(await this.populateCall(e))}async resolveName(e){return await Nh(this,"resolveName").resolveName(e)}async sendTransaction(e){const n=Nh(this,"sendTransaction"),r=await this.populateTransaction(e);delete r.from;const i=A1.from(r);return await n.broadcastTransaction(await this.signTransaction(i))}}function Nie(t){return JSON.parse(JSON.stringify(t))}var Ei,Yo,Rf,Nc,Mf,sp,Qm,G3,Km,V3;class GU{constructor(e){M(this,Qm);M(this,Km);M(this,Ei,void 0);M(this,Yo,void 0);M(this,Rf,void 0);M(this,Nc,void 0);M(this,Mf,void 0);M(this,sp,void 0);O(this,Ei,e),O(this,Yo,null),O(this,Rf,ie(this,Qm,G3).bind(this)),O(this,Nc,!1),O(this,Mf,null),O(this,sp,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,n){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){b(this,Nc)||(O(this,Nc,!0),ie(this,Qm,G3).call(this,-2))}stop(){b(this,Nc)&&(O(this,Nc,!1),O(this,sp,!0),ie(this,Km,V3).call(this),b(this,Ei).off("block",b(this,Rf)))}pause(e){e&&ie(this,Km,V3).call(this),b(this,Ei).off("block",b(this,Rf))}resume(){this.start()}}Ei=new WeakMap,Yo=new WeakMap,Rf=new WeakMap,Nc=new WeakMap,Mf=new WeakMap,sp=new WeakMap,Qm=new WeakSet,G3=async function(e){try{b(this,Yo)==null&&O(this,Yo,this._subscribe(b(this,Ei)));let n=null;try{n=await b(this,Yo)}catch(a){if(!Kr(a,"UNSUPPORTED_OPERATION")||a.operation!=="eth_newFilter")throw a}if(n==null){O(this,Yo,null),b(this,Ei)._recoverSubscriber(this,this._recover(b(this,Ei)));return}const r=await b(this,Ei).getNetwork();if(b(this,Mf)||O(this,Mf,r),b(this,Mf).chainId!==r.chainId)throw new Error("chaid changed");if(b(this,sp))return;const i=await b(this,Ei).send("eth_getFilterChanges",[n]);await this._emitResults(b(this,Ei),i)}catch(n){console.log("@TODO",n)}b(this,Ei).once("block",b(this,Rf))},Km=new WeakSet,V3=function(){const e=b(this,Yo);e&&(O(this,Yo,null),e.then(n=>{b(this,Ei).send("eth_uninstallFilter",[n])}))};var Bf;class Iie extends GU{constructor(n,r){super(n);M(this,Bf,void 0);O(this,Bf,Nie(r))}_recover(n){return new SO(n,b(this,Bf))}async _subscribe(n){return await n.send("eth_newFilter",[b(this,Bf)])}async _emitResults(n,r){for(const i of r)n.emit(b(this,Bf),n._wrapLog(i,n._network))}}Bf=new WeakMap;class Rie extends GU{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,n){for(const r of n)e.emit("pending",r)}}const Mie="bigint,boolean,function,number,string,symbol".split(/,/g);function uw(t){if(t==null||Mie.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(uw);if(typeof t=="object")return Object.keys(t).reduce((e,n)=>(e[n]=t[n],e),{});throw new Error(`should not happen: ${t} (${typeof t})`)}function Bie(t){return new Promise(e=>{setTimeout(e,t)})}function Ih(t){return t&&t.toLowerCase()}function z_(t){return t&&typeof t.pollingInterval=="number"}const Die={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class cE extends HU{constructor(n,r){super(n);R(this,"address");r=rn(r),mt(this,{address:r})}connect(n){me(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(n){return await this.populateCall(n)}async sendUncheckedTransaction(n){const r=uw(n),i=[];if(r.from){const o=r.from;i.push((async()=>{const s=await fi(o,this.provider);Y(s!=null&&s.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=s})())}else r.from=this.address;if(r.gasLimit==null&&i.push((async()=>{r.gasLimit=await this.provider.estimateGas({...r,from:this.address})})()),r.to!=null){const o=r.to;i.push((async()=>{r.to=await fi(o,this.provider)})())}i.length&&await Promise.all(i);const a=this.provider.getRpcTransaction(r);return this.provider.send("eth_sendTransaction",[a])}async sendTransaction(n){const r=await this.provider.getBlockNumber(),i=await this.sendUncheckedTransaction(n);return await new Promise((a,o)=>{const s=[1e3,100];let l=0;const c=async()=>{try{const u=await this.provider.getTransaction(i);if(u!=null){a(u.replaceableTransaction(r));return}}catch(u){if(Kr(u,"CANCELLED")||Kr(u,"BAD_DATA")||Kr(u,"NETWORK_ERROR")){u.info==null&&(u.info={}),u.info.sendTransactionHash=i,o(u);return}if(Kr(u,"INVALID_ARGUMENT")&&(l++,u.info==null&&(u.info={}),u.info.sendTransactionHash=i,l>10)){o(u);return}this.provider.emit("error",er("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:u}))}this.provider._setTimeout(()=>{c()},s.pop()||4e3)};c()})}async signTransaction(n){const r=uw(n);if(r.from){const a=await fi(r.from,this.provider);Y(a!=null&&a.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=a}else r.from=this.address;const i=this.provider.getRpcTransaction(r);return await this.provider.send("eth_signTransaction",[i])}async signMessage(n){const r=typeof n=="string"?dl(n):n;return await this.provider.send("personal_sign",[Ze(r),this.address.toLowerCase()])}async signTypedData(n,r,i){const a=uw(i),o=await E1.resolveNames(n,r,a,async s=>{const l=await fi(s);return Y(l!=null,"TypedData does not support null address","value",s),l});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(E1.getPayload(o.domain,r,o.value))])}async unlock(n){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),n,null])}async _legacySignMessage(n){const r=typeof n=="string"?dl(n):n;return await this.provider.send("eth_sign",[this.address.toLowerCase(),Ze(r)])}}var Df,lp,tl,Xo,fo,ka,Si,Wm,Q3;class Lie extends zU{constructor(n,r){super(n,r);M(this,Wm);M(this,Df,void 0);M(this,lp,void 0);M(this,tl,void 0);M(this,Xo,void 0);M(this,fo,void 0);M(this,ka,void 0);M(this,Si,void 0);O(this,lp,1),O(this,Df,Object.assign({},Die,r||{})),O(this,tl,[]),O(this,Xo,null),O(this,ka,null),O(this,Si,null);{let a=null;const o=new Promise(s=>{a=s});O(this,fo,{promise:o,resolve:a})}const i=this._getOption("staticNetwork");typeof i=="boolean"?(Y(!i||n!=="any","staticNetwork cannot be used on special network 'any'","options",r),i&&n!=null&&O(this,ka,ns.from(n))):i&&(Y(n==null||i.matches(n),"staticNetwork MUST match network object","options",r),O(this,ka,i))}_getOption(n){return b(this,Df)[n]}get _network(){return me(b(this,ka),"network is not available yet","NETWORK_ERROR"),b(this,ka)}async _perform(n){if(n.method==="call"||n.method==="estimateGas"){let i=n.transaction;if(i&&i.type!=null&&ot(i.type)&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const a=await this.getFeeData();a.maxFeePerGas==null&&a.maxPriorityFeePerGas==null&&(n=Object.assign({},n,{transaction:Object.assign({},i,{type:void 0})}))}}const r=this.getRpcRequest(n);return r!=null?await this.send(r.method,r.args):super._perform(n)}async _detectNetwork(){const n=this._getOption("staticNetwork");if(n)if(n===!0){if(b(this,ka))return b(this,ka)}else return n;return b(this,Si)?await b(this,Si):this.ready?(O(this,Si,(async()=>{try{const r=ns.from(ot(await this.send("eth_chainId",[])));return O(this,Si,null),r}catch(r){throw O(this,Si,null),r}})()),await b(this,Si)):(O(this,Si,(async()=>{const r={id:vs(this,lp)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:r});let i;try{i=(await this._send(r))[0],O(this,Si,null)}catch(a){throw O(this,Si,null),this.emit("debug",{action:"receiveRpcError",error:a}),a}if(this.emit("debug",{action:"receiveRpcResult",result:i}),"result"in i)return ns.from(ot(i.result));throw this.getRpcError(r,i)})()),await b(this,Si))}_start(){b(this,fo)==null||b(this,fo).resolve==null||(b(this,fo).resolve(),O(this,fo,null),(async()=>{for(;b(this,ka)==null&&!this.destroyed;)try{O(this,ka,await this._detectNetwork())}catch(n){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",er("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:n}})),await Bie(1e3)}ie(this,Wm,Q3).call(this)})())}async _waitUntilReady(){if(b(this,fo)!=null)return await b(this,fo).promise}_getSubscriber(n){return n.type==="pending"?new Rie(this):n.type==="event"?this._getOption("polling")?new SO(this,n.filter):new Iie(this,n.filter):n.type==="orphan"&&n.filter.orphan==="drop-log"?new jU("orphan"):super._getSubscriber(n)}get ready(){return b(this,fo)==null}getRpcTransaction(n){const r={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(i=>{if(n[i]==null)return;let a=i;i==="gasLimit"&&(a="gas"),r[a]=Fu(ot(n[i],`tx.${i}`))}),["from","to","data"].forEach(i=>{n[i]!=null&&(r[i]=Ze(n[i]))}),n.accessList&&(r.accessList=xh(n.accessList)),r}getRpcRequest(n){switch(n.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[Ih(n.address),n.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[Ih(n.address),n.blockTag]};case"getCode":return{method:"eth_getCode",args:[Ih(n.address),n.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[Ih(n.address),"0x"+n.position.toString(16),n.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[n.signedTransaction]};case"getBlock":if("blockTag"in n)return{method:"eth_getBlockByNumber",args:[n.blockTag,!!n.includeTransactions]};if("blockHash"in n)return{method:"eth_getBlockByHash",args:[n.blockHash,!!n.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[n.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[n.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(n.transaction),n.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(n.transaction)]};case"getLogs":return n.filter&&n.filter.address!=null&&(Array.isArray(n.filter.address)?n.filter.address=n.filter.address.map(Ih):n.filter.address=Ih(n.filter.address)),{method:"eth_getLogs",args:[n.filter]}}return null}getRpcError(n,r){const{method:i}=n,{error:a}=r;if(i==="eth_estimateGas"&&a.message){const l=a.message;if(!l.match(/revert/i)&&l.match(/insufficient funds/i))return er("insufficient funds","INSUFFICIENT_FUNDS",{transaction:n.params[0],info:{payload:n,error:a}})}if(i==="eth_call"||i==="eth_estimateGas"){const l=K3(a),c=P1.getBuiltinCallException(i==="eth_call"?"call":"estimateGas",n.params[0],l?l.data:null);return c.info={error:a,payload:n},c}const o=JSON.stringify(Uie(a));if(typeof a.message=="string"&&a.message.match(/user denied|ethers-user-denied/i))return er("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[i]||"unknown",reason:"rejected",info:{payload:n,error:a}});if(i==="eth_sendRawTransaction"||i==="eth_sendTransaction"){const l=n.params[0];if(o.match(/insufficient funds|base fee exceeds gas limit/i))return er("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:l,info:{error:a}});if(o.match(/nonce/i)&&o.match(/too low/i))return er("nonce has already been used","NONCE_EXPIRED",{transaction:l,info:{error:a}});if(o.match(/replacement transaction/i)&&o.match(/underpriced/i))return er("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:l,info:{error:a}});if(o.match(/only replay-protected/i))return er("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:i,info:{transaction:l,info:{error:a}}})}let s=!!o.match(/the method .* does not exist/i);return s||a&&a.details&&a.details.startsWith("Unauthorized method:")&&(s=!0),s?er("unsupported operation","UNSUPPORTED_OPERATION",{operation:n.method,info:{error:a,payload:n}}):er("could not coalesce error","UNKNOWN_ERROR",{error:a,payload:n})}send(n,r){if(this.destroyed)return Promise.reject(er("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n}));const i=vs(this,lp)._++,a=new Promise((o,s)=>{b(this,tl).push({resolve:o,reject:s,payload:{method:n,params:r,id:i,jsonrpc:"2.0"}})});return ie(this,Wm,Q3).call(this),a}async getSigner(n){n==null&&(n=0);const r=this.send("eth_accounts",[]);if(typeof n=="number"){const a=await r;if(n>=a.length)throw new Error("no such account");return new cE(this,a[n])}const{accounts:i}=await ni({network:this.getNetwork(),accounts:r});n=rn(n);for(const a of i)if(rn(a)===n)return new cE(this,n);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(r=>new cE(this,r))}destroy(){b(this,Xo)&&(clearTimeout(b(this,Xo)),O(this,Xo,null));for(const{payload:n,reject:r}of b(this,tl))r(er("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n.method}));O(this,tl,[]),super.destroy()}}Df=new WeakMap,lp=new WeakMap,tl=new WeakMap,Xo=new WeakMap,fo=new WeakMap,ka=new WeakMap,Si=new WeakMap,Wm=new WeakSet,Q3=function(){if(b(this,Xo))return;const n=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");O(this,Xo,setTimeout(()=>{O(this,Xo,null);const r=b(this,tl);for(O(this,tl,[]);r.length;){const i=[r.shift()];for(;r.length&&i.length!==b(this,Df).batchMaxCount;)if(i.push(r.shift()),JSON.stringify(i.map(o=>o.payload)).length>b(this,Df).batchMaxSize){r.unshift(i.pop());break}(async()=>{const a=i.length===1?i[0].payload:i.map(o=>o.payload);this.emit("debug",{action:"sendRpcPayload",payload:a});try{const o=await this._send(a);this.emit("debug",{action:"receiveRpcResult",result:o});for(const{resolve:s,reject:l,payload:c}of i){if(this.destroyed){l(er("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:c.method}));continue}const u=o.filter(f=>f.id===c.id)[0];if(u==null){const f=er("missing response for request","BAD_DATA",{value:o,info:{payload:c}});this.emit("error",f),l(f);continue}if("error"in u){l(this.getRpcError(c,u));continue}s(u.result)}}catch(o){this.emit("debug",{action:"receiveRpcError",error:o});for(const{reject:s}of i)s(o)}})()}},n))};var Ic;class VU extends Lie{constructor(n,r){super(n,r);M(this,Ic,void 0);O(this,Ic,4e3)}_getSubscriber(n){const r=super._getSubscriber(n);return z_(r)&&(r.pollingInterval=b(this,Ic)),r}get pollingInterval(){return b(this,Ic)}set pollingInterval(n){if(!Number.isInteger(n)||n<0)throw new Error("invalid interval");O(this,Ic,n),this._forEachSubscriber(r=>{z_(r)&&(r.pollingInterval=b(this,Ic))})}}Ic=new WeakMap;var cp;class $ie extends VU{constructor(n,r,i){n==null&&(n="http://localhost:8545");super(r,i);M(this,cp,void 0);typeof n=="string"?O(this,cp,new Sl(n)):O(this,cp,n.clone())}_getConnection(){return b(this,cp).clone()}async send(n,r){return await this._start(),await super.send(n,r)}async _send(n){const r=this._getConnection();r.body=JSON.stringify(n),r.setHeader("content-type","application/json");const i=await r.send();i.assertOk();let a=i.bodyJson;return Array.isArray(a)||(a=[a]),a}}cp=new WeakMap;function K3(t){if(t==null)return null;if(typeof t.message=="string"&&t.message.match(/revert/i)&&In(t.data))return{message:t.message,data:t.data};if(typeof t=="object"){for(const e in t){const n=K3(t[e]);if(n)return n}return null}if(typeof t=="string")try{return K3(JSON.parse(t))}catch{}return null}function W3(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const n in t)W3(t[n],e);if(typeof t=="string")try{return W3(JSON.parse(t),e)}catch{}}}function Uie(t){const e=[];return W3(t,e),e}var up;class Fie extends VU{constructor(n,r){super(r,{batchMaxCount:1});M(this,up,void 0);O(this,up,async(i,a)=>{const o={method:i,params:a};this.emit("debug",{action:"sendEip1193Request",payload:o});try{const s=await n.request(o);return this.emit("debug",{action:"receiveEip1193Result",result:s}),s}catch(s){const l=new Error(s.message);throw l.code=s.code,l.data=s.data,l.payload=o,this.emit("debug",{action:"receiveEip1193Error",error:l}),l}})}async send(n,r){return await this._start(),await super.send(n,r)}async _send(n){Y(!Array.isArray(n),"EIP-1193 does not support batch request","payload",n);try{const r=await b(this,up).call(this,n.method,n.params||[]);return[{id:n.id,result:r}]}catch(r){return[{id:n.id,error:{code:r.code,data:r.data,message:r.message}}]}}getRpcError(n,r){switch(r=JSON.parse(JSON.stringify(r)),r.error.code||-1){case 4001:r.error.message=`ethers-user-denied: ${r.error.message}`;break;case 4200:r.error.message=`ethers-unsupported: ${r.error.message}`;break}return super.getRpcError(n,r)}async hasSigner(n){n==null&&(n=0);const r=await this.send("eth_accounts",[]);return typeof n=="number"?r.length>n:(n=n.toLowerCase(),r.filter(i=>i.toLowerCase()===n).length!==0)}async getSigner(n){if(n==null&&(n=0),!await this.hasSigner(n))try{await b(this,up).call(this,"eth_requestAccounts",[])}catch(r){const i=r.payload;throw this.getRpcError(i,{id:i.id,error:r})}return await super.getSigner(n)}}up=new WeakMap;var QU={exports:{}};(function(t){/** * @license (c) Franz X Antesberger 2013 - */(function(e){var n=4294967296;e.fromBytesBigEndian=function(r,i,a,o){return(r<<24|i<<16|a<<8|o)>>>0},e.getByteBigEndian=function(r,i){return r>>>8*(3-i)&255},e.getBytesBigEndian=function(r){return[e.getByteBigEndian(r,0),e.getByteBigEndian(r,1),e.getByteBigEndian(r,2),e.getByteBigEndian(r,3)]},e.toHex=function(r,i){i=i||8;var a=r.toString(16);return a.length>>0},e.highPart=function(r){return e.toUint32(r/n)},e.or=function(r,i){for(var a=r,o=1;o>>0},e.and=function(r,i){for(var a=r,o=1;o>>0},e.xor=function(r,i){for(var a=r,o=1;o>>0},e.not=function(r){return~r>>>0},e.shiftLeft=function(r,i){return r<>>0},e.shiftRight=function(r,i){return r>>>i},e.rotateLeft=function(r,i){return(r<>>0|r>>>32-i)>>>0},e.rotateRight=function(r,i){return(r>>>i|r<<32-i>>>0)>>>0},e.choose=function(r,i,a){return(r&(i^a)^a)>>>0},e.majority=function(r,i,a){return(r&(i|a)|i&a)>>>0},e.addMod32=function(r){for(var i=r,a=1;a>>0},e.log2=function(r){return Math.floor(Math.log(r)/Math.LN2)},e.mult=function(r,i,a){var o=((r&4294901760)>>>0)*i,s=(r&65535)*i,l=e.toUint32(o)+e.toUint32(s)>=n?1:0;a[0]=e.highPart(o)+e.highPart(s)+l>>>0,a[1]=(o>>>0)+(s>>>0)}})(t.exports={})})(QU);var PO=QU.exports,D=PO;const jie=[1,2,4,8,16,32,64,128,27,54],kp=D.fromBytesBigEndian(85,85,85,85),_p=D.fromBytesBigEndian(170,170,170,170),ab=D.fromBytesBigEndian(51,51,51,51),ob=D.fromBytesBigEndian(204,204,204,204),H_=D.fromBytesBigEndian(15,15,15,15),G_=D.fromBytesBigEndian(240,240,240,240),zie=D.fromBytesBigEndian(0,0,0,255),Hie=D.fromBytesBigEndian(0,0,252,0),Gie=D.fromBytesBigEndian(0,0,3,0),Vie=D.fromBytesBigEndian(0,240,0,0),Qie=D.fromBytesBigEndian(0,15,0,0),Kie=D.fromBytesBigEndian(192,0,0,0),Wie=D.fromBytesBigEndian(63,0,0,0);function J3(){return new Uint32Array(8)}function fw(t,e){t[0]=D.xor(t[0],e[0]),t[1]=D.xor(t[1],e[1]),t[2]=D.xor(t[2],e[2]),t[3]=D.xor(t[3],e[3]),t[4]=D.xor(t[4],e[4]),t[5]=D.xor(t[5],e[5]),t[6]=D.xor(t[6],e[6]),t[7]=D.xor(t[7],e[7])}function hx(t){const e=t[7],n=t[6],r=t[5],i=t[4],a=t[3],o=t[2],s=t[1],l=t[0],c=D.xor(i,o),u=D.xor(e,s),f=D.xor(e,i),h=D.xor(e,o),d=D.xor(n,r),g=D.xor(d,l),p=D.xor(g,i),m=D.xor(u,c),y=D.xor(g,e),v=D.xor(g,s),x=D.xor(v,h),A=D.xor(a,m),S=D.xor(A,o),E=D.xor(A,n),T=D.xor(S,l),C=D.xor(S,d),N=D.xor(E,f),B=D.xor(l,N),L=D.xor(C,N),U=D.xor(C,h),j=D.xor(d,N),Z=D.xor(u,j),G=D.xor(e,j),H=D.and(m,S),re=D.and(x,T),V=D.xor(re,H),ee=D.and(p,l),pe=D.xor(ee,H),Ae=D.and(u,j),we=D.and(v,g),Ye=D.xor(we,Ae),nt=D.and(y,B),De=D.xor(nt,Ae),st=D.and(f,N),Tt=D.and(c,L),ln=D.xor(Tt,st),Ee=D.and(h,C),ne=D.xor(Ee,st),le=D.xor(V,ln),te=D.xor(pe,ne),Ce=D.xor(Ye,ln),Se=D.xor(De,ne),ze=D.xor(le,E),$e=D.xor(te,U),rt=D.xor(Ce,Z),dt=D.xor(Se,G),wt=D.xor(ze,$e),yt=D.and(ze,rt),Pe=D.xor(dt,yt),nn=D.and(wt,Pe),cn=D.xor(nn,$e),Gn=D.xor(rt,dt),Wa=D.xor($e,yt),ms=D.and(Wa,Gn),Yr=D.xor(ms,dt),du=D.xor(rt,Yr),ji=D.xor(Pe,Yr),pu=D.and(dt,ji),Ja=D.xor(pu,du),Ul=D.xor(Pe,pu),Fl=D.and(cn,Ul),zi=D.xor(wt,Fl),Xr=D.xor(zi,Ja),pa=D.xor(cn,Yr),Ya=D.xor(cn,zi),Io=D.xor(Yr,Ja),Xa=D.xor(pa,Xr),gu=D.and(Io,S),yu=D.and(Ja,T),Ph=D.and(Yr,l),Q=D.and(Ya,j),q=D.and(zi,g),se=D.and(cn,B),Oe=D.and(pa,N),Ge=D.and(Xa,L),xt=D.and(Xr,C),pt=D.and(Io,m),lt=D.and(Ja,x),Ue=D.and(Yr,p),Ct=D.and(Ya,u),P=D.and(zi,v),k=D.and(cn,y),_=D.and(pa,f),w=D.and(Xa,c),I=D.and(Xr,h),z=D.xor(_,w),W=D.xor(lt,Ue),ce=D.xor(se,P),ve=D.xor(pt,lt),Le=D.xor(Ph,Ct),Te=D.xor(Ph,se),Rt=D.xor(Ge,xt),Re=D.xor(gu,Q),ft=D.xor(Oe,Ge),at=D.xor(w,I),vt=D.xor(Ct,ce),ke=D.xor(Le,Re),_e=D.xor(q,z),Xe=D.xor(Q,ft),ht=D.xor(z,ke),Fe=D.xor(k,ke),tt=D.xor(Rt,_e),Be=D.xor(ve,_e),He=D.xor(q,Xe),Je=D.xor(Fe,tt),Me=D.xor(yu,Be),ae=D.xor(Xe,Be),oe=D.xor(vt,D.not(tt)),ge=D.xor(ce,D.not(ht)),ue=D.xor(He,Je),fe=D.xor(Re,Me),be=D.xor(Te,Me),ct=D.xor(W,Je),At=D.xor(He,D.not(fe)),St=D.xor(at,D.not(ue));t[7]=ae,t[6]=At,t[5]=St,t[4]=fe,t[3]=be,t[2]=ct,t[1]=oe,t[0]=ge}function Y3(t){for(let e=0;e<8;e++){const n=t[e];t[e]=D.or(D.and(n,zie),D.shiftRight(D.and(n,Hie),2),D.shiftLeft(D.and(n,Gie),6),D.shiftRight(D.and(n,Vie),4),D.shiftLeft(D.and(n,Qie),4),D.shiftRight(D.and(n,Kie),6),D.shiftLeft(D.and(n,Wie),2))}}function KU(t){const e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],c=D.or(D.shiftRight(e,8),D.shiftLeft(e,24)),u=D.or(D.shiftRight(n,8),D.shiftLeft(n,24)),f=D.or(D.shiftRight(r,8),D.shiftLeft(r,24)),h=D.or(D.shiftRight(i,8),D.shiftLeft(i,24)),d=D.or(D.shiftRight(a,8),D.shiftLeft(a,24)),g=D.or(D.shiftRight(o,8),D.shiftLeft(o,24)),p=D.or(D.shiftRight(s,8),D.shiftLeft(s,24)),m=D.or(D.shiftRight(l,8),D.shiftLeft(l,24));t[0]=D.xor(l,m,c,D.rotateRight(D.xor(e,c),16)),t[1]=D.xor(e,c,l,m,u,D.rotateRight(D.xor(n,u),16)),t[2]=D.xor(n,u,f,D.rotateRight(D.xor(r,f),16)),t[3]=D.xor(r,f,l,m,h,D.rotateRight(D.xor(i,h),16)),t[4]=D.xor(i,h,l,m,d,D.rotateRight(D.xor(a,d),16)),t[5]=D.xor(a,d,g,D.rotateRight(D.xor(o,g),16)),t[6]=D.xor(o,g,p,D.rotateRight(D.xor(s,p),16)),t[7]=D.xor(s,p,m,D.rotateRight(D.xor(l,m),16))}function WU(t,e){const n=new DataView(e.buffer);t[0]=n.getUint32(0+e.byteOffset,!0),t[2]=n.getUint32(4+e.byteOffset,!0),t[4]=n.getUint32(8+e.byteOffset,!0),t[6]=n.getUint32(12+e.byteOffset,!0),t[1]=0,t[3]=0,t[5]=0,t[7]=0,Ol(t)}function JU(t,e,n){const r=new DataView(e.buffer),i=new DataView(n.buffer);t[0]=r.getUint32(0+e.byteOffset,!0),t[2]=r.getUint32(4+e.byteOffset,!0),t[4]=r.getUint32(8+e.byteOffset,!0),t[6]=r.getUint32(12+e.byteOffset,!0),t[1]=i.getUint32(0+n.byteOffset,!0),t[3]=i.getUint32(4+n.byteOffset,!0),t[5]=i.getUint32(8+n.byteOffset,!0),t[7]=i.getUint32(12+n.byteOffset,!0),Ol(t)}function YU(t,e){Ol(e);const n=new DataView(t.buffer);n.setUint32(0+t.byteOffset,e[0],!0),n.setUint32(4+t.byteOffset,e[2],!0),n.setUint32(8+t.byteOffset,e[4],!0),n.setUint32(12+t.byteOffset,e[6],!0)}function XU(t,e,n){Ol(n);const r=new DataView(t.buffer),i=new DataView(e.buffer);r.setUint32(0+t.byteOffset,n[0],!0),r.setUint32(4+t.byteOffset,n[2],!0),r.setUint32(8+t.byteOffset,n[4],!0),r.setUint32(12+t.byteOffset,n[6],!0),i.setUint32(0+e.byteOffset,n[1],!0),i.setUint32(4+e.byteOffset,n[3],!0),i.setUint32(8+e.byteOffset,n[5],!0),i.setUint32(12+e.byteOffset,n[7],!0)}function Ol(t){for(let e=0;e<8;e+=2){const n=t[e],r=t[e+1];t[e]=D.or(D.and(n,kp),D.shiftLeft(D.and(r,kp),1)),t[e+1]=D.or(D.shiftRight(D.and(n,_p),1),D.and(r,_p))}for(let e=0;e<8;e+=4){const n=t[e],r=t[e+1],i=t[e+2],a=t[e+3];t[e]=D.or(D.and(n,ab),D.shiftLeft(D.and(i,ab),2)),t[e+2]=D.or(D.shiftRight(D.and(n,ob),2),D.and(i,ob)),t[e+1]=D.or(D.and(r,ab),D.shiftLeft(D.and(a,ab),2)),t[e+3]=D.or(D.shiftRight(D.and(r,ob),2),D.and(a,ob))}for(let e=0;e<4;e++){const n=t[e],r=t[e+4];t[e]=D.or(D.and(n,H_),D.shiftLeft(D.and(r,H_),4)),t[e+4]=D.or(D.shiftRight(D.and(n,G_),4),D.and(r,G_))}}function Jie(t,e){const n=new DataView(e.buffer);for(let r=0;r<4;r++){const i=n.getUint32(r*4+e.byteOffset,!0);t[r*2]=i,t[r*2+1]=i}Ol(t);for(let r=0,i=0;r<4;r=r+1,i=i+2){let a=D.or(D.and(t[i+0],kp),D.and(t[i+1],_p)),o=a;a=D.and(a,kp),t[i]=D.or(a,D.shiftLeft(a,1)),o=D.and(o,_p),t[i+1]=D.or(o,D.shiftRight(o,1))}}function ZU(t,e,n){const r=(e+1)*4;for(let i=0,a=0;i6&&u==4&&(a=V_(a)),a=D.xor(a,i[(c-o)*2]),i[c*2]=a,i[c*2+1]=a,u++,u==o&&(u=0,f++);for(let c=0;c>7,i=n>>5&1;t[e]=n<<1|r^i}}function rae(t){for(let e=0;e>6&1;t[e]=n>>1|(r^i)<<7}}function K_(t,e){t[0]^=1,t[1]^=2,t[2]^=4,t[3]^=8,t[4]^=fb[e],t[5]^=fb[e],t[6]^=fb[e],t[7]^=fb[e]}function iae(t,e){let n=t.subarray(16,32),r=t.subarray(0,16);Li(e[0],n,r,Np),K_(e[0],0);for(let i=1;i<=Dc;i++)nae(n),Z3(n),rae(r),Z3(r),Li(e[i],n,r,Np),K_(e[i],i)}function py(t,e,n){let r=new Uint8Array(n);Li(t[0],e[0],r,Np);for(let i=1;i<=Dc;i++)Z3(r),Li(t[i],e[i],r,Np)}function Yl(){let t=[];for(let e=0;e<=Dc;e++)t.push(new Uint8Array(16));return t}class aae{static bcEncrypt(e,n,r,i){let a=Yl();py(a,n,r);let o=Et.newQ(),s=Et.newQ();Et.load4xU32(o,i),Et.load4xU32(s,a[0]),Et.addRoundKey(o,s);for(let l=1;l<=Dc;l++)Et.subBytes(o),Et.shiftRows(o),Et.mixColumns(o),Et.load4xU32(s,a[l]),Et.addRoundKey(o,s);Et.store4xU32(e,o)}static bcKeystreamx2(e,n,r,i){let a=[Yl(),Yl()];for(let l=0;l<2;l++)py(a[l],n,r[l]);let o=Et.newQ(),s=Et.newQ();Et.rkeyOrtho(o,i),Et.load8xU32(s,a[0][0],a[1][0]),Et.addRoundKey(o,s);for(let l=1;l<=Dc;l++)Et.subBytes(o),Et.shiftRows(o),Et.mixColumns(o),Et.load8xU32(s,a[0][l],a[1][l]),Et.addRoundKey(o,s);Et.store8xU32(e.subarray(0,16),e.subarray(16,32),o)}static bcTagx1(e,n,r,i){let a=Yl();py(a,n,r);let o=Et.newQ(),s=Et.newQ();Et.load4xU32(o,i),Et.load4xU32(s,a[0]),Et.addRoundKey(o,s);for(let d=1;d<=Dc;d++)Et.subBytes(o),Et.shiftRows(o),Et.mixColumns(o),Et.load4xU32(s,a[d]),Et.addRoundKey(o,s);const l=new DataView(e.buffer);let c=l.getUint32(0,!0),u=l.getUint32(4,!0),f=l.getUint32(8,!0),h=l.getUint32(12,!0);Et.ortho(o),c=Ia.xor(c,o[0]),u=Ia.xor(u,o[2]),f=Ia.xor(f,o[4]),h=Ia.xor(h,o[6]),l.setUint32(0,c,!0),l.setUint32(4,u,!0),l.setUint32(8,f,!0),l.setUint32(12,h,!0)}static bcTagx2(e,n,r,i){let a=[Yl(),Yl()];for(let d=0;d<2;d++)py(a[d],n,r[d]);let o=Et.newQ(),s=Et.newQ();Et.load8xU32(o,i.subarray(0,16),i.subarray(16,32)),Et.load8xU32(s,a[0][0],a[1][0]),Et.addRoundKey(o,s);for(let d=1;d<=Dc;d++)Et.subBytes(o),Et.shiftRows(o),Et.mixColumns(o),Et.load8xU32(s,a[0][d],a[1][d]),Et.addRoundKey(o,s);const l=new DataView(e.buffer);let c=l.getUint32(0,!0),u=l.getUint32(4,!0),f=l.getUint32(8,!0),h=l.getUint32(12,!0);Et.ortho(o),c=Ia.xor(c,o[0],o[1]),u=Ia.xor(u,o[2],o[3]),f=Ia.xor(f,o[4],o[5]),h=Ia.xor(h,o[6],o[7]),l.setUint32(0,c,!0),l.setUint32(4,u,!0),l.setUint32(8,f,!0),l.setUint32(12,h,!0)}}class oae{static bcEncrypt(e,n,r,i){let a=Yl();py(a,n,r);const o=new DataView(i.buffer);let s=o.getUint32(0+i.byteOffset,!1),l=o.getUint32(4+i.byteOffset,!1),c=o.getUint32(8+i.byteOffset,!1),u=o.getUint32(12+i.byteOffset,!1);const f=new DataView(a[0].buffer);s=Ia.xor(s,f.getUint32(0+a[0].byteOffset,!1)),l=Ia.xor(l,f.getUint32(4+a[0].byteOffset,!1)),c=Ia.xor(c,f.getUint32(8+a[0].byteOffset,!1)),u=Ia.xor(u,f.getUint32(12+a[0].byteOffset,!1));for(let d=1;d<=Dc;d++)[s,l,c,u]=eae.aesencVartime(s,l,c,u,a[d]);const h=new DataView(e.buffer);h.setUint32(0+e.byteOffset,s,!1),h.setUint32(4+e.byteOffset,l,!1),h.setUint32(8+e.byteOffset,c,!1),h.setUint32(12+e.byteOffset,u,!1)}static bcKeystreamx2(e,n,r,i){this.bcEncrypt(e.subarray(0,16),n,r[0],i),this.bcEncrypt(e.subarray(16,32),n,r[1],i)}static bcTagx1(e,n,r,i){let a=new Uint8Array(Ne);this.bcEncrypt(a,n,r,i),Li(e,e,a,Ne)}static bcTagx2(e,n,r,i){let a=new Uint8Array(2*Ne);this.bcEncrypt(a.subarray(0,16),n,r[0],i.subarray(0,16)),this.bcEncrypt(a.subarray(16,32),n,r[1],i.subarray(16,32)),Li(e,e,a.subarray(0,16),Ne),Li(e,e,a.subarray(16,32),Ne)}}function zr(t,e,n){t.set(new Uint8Array(12)),new DataView(t.buffer).setUint32(12+t.byteOffset,n,!1),t[0]=e<=2*Ne;s+=2)zr(o[0],Rd,s),zr(o[1],Rd,s+1),t.bcTagx2(u,e,o,i.subarray(s*Ne,(s+2)*Ne)),c-=2*Ne;for(;c>=Ne;s++)zr(o[0],Rd,s),t.bcTagx1(u,e,o[0],i.subarray(s*Ne,(s+1)*Ne)),c-=Ne;if(c>0){zr(o[0],tF,s);let g=new Uint8Array(Ne);g.set(i.subarray(i.length-c)),g[c]=128,t.bcTagx1(u,e,o[0],g)}let f=a.length;for(l=0;f>=2*Ne;l+=2)zr(o[0],Md,l),zr(o[1],Md,l+1),t.bcTagx2(u,e,o,a.subarray(l*Ne,(l+2)*Ne)),f-=2*Ne;for(;f>=Ne;l++)zr(o[0],Md,l),t.bcTagx1(u,e,o[0],a.subarray(l*Ne,(l+1)*Ne)),f-=Ne;if(f>0){zr(o[0],nF,l);let g=new Uint8Array(Ne);g.set(a.subarray(a.length-f)),g[f]=128,t.bcTagx1(u,e,o[0],g)}let h=new Uint8Array(Ne);h.set(n,1),h[0]=rF<=2*Ne;l+=2)Lc(o[0],u,l),Lc(o[1],u,l+1),t.bcKeystreamx2(d,e,o,h),Li(r.subarray(l*Ne,(l+2)*Ne),a.subarray(l*Ne,(l+2)*Ne),d,2*Ne),f-=2*Ne;for(;f>=Ne;l++)Lc(o[0],u,l),t.bcEncrypt(d,e,o[0],h),Li(r.subarray(l*Ne,(l+1)*Ne),a.subarray(l*Ne,(l+1)*Ne),d,Ne),f-=Ne;f>0&&(Lc(o[0],u,l),t.bcEncrypt(d,e,o[0],h),Li(r.subarray(l*Ne,a.length),a.subarray(l*Ne),d,f)),r.set(u,a.length)}function lae(t,e,n,r,i,a){let o=a.length-Hf;const s=a.subarray(0,o),l=a.subarray(o);let c=0,u=q3(),f=new Uint8Array(Ne);f.set(n,1);let h=new Uint8Array(2*Ne);for(c=0;o>=2*Ne;c+=2)Lc(u[0],l,c),Lc(u[1],l,c+1),t.bcKeystreamx2(h,e,u,f),Li(r.subarray(c*Ne,(c+2)*Ne),s.subarray(c*Ne,(c+2)*Ne),h,2*Ne),o-=2*Ne;for(;o>=Ne;c++)Lc(u[0],l,c),t.bcEncrypt(h,e,u[0],f),Li(r.subarray(c*Ne,(c+1)*Ne),s.subarray(c*Ne,(c+1)*Ne),h,Ne),o-=Ne;o>0&&(Lc(u[0],l,c),t.bcEncrypt(h,e,u[0],f),Li(r.subarray(c*Ne),s.subarray(c*Ne),h,o));let d=0,g=i.length,p=q3(),m=new Uint8Array(Hf);for(d=0;g>=2*Ne;d+=2)zr(p[0],Rd,d),zr(p[1],Rd,d+1),t.bcTagx2(m,e,p,i.subarray(d*Ne,(d+2)*Ne)),g-=2*Ne;for(;g>=Ne;d++)zr(p[0],Rd,d),t.bcTagx1(m,e,p[0],i.subarray(d*Ne,(d+1)*Ne)),g-=Ne;if(g>0){zr(p[0],tF,d);let x=new Uint8Array(Ne);x.set(i.subarray(i.length-g)),x[g]=128,t.bcTagx1(m,e,p[0],x)}let y=r.length;for(c=0;y>=2*Ne;c+=2)zr(p[0],Md,c),zr(p[1],Md,c+1),t.bcTagx2(m,e,p,r.subarray(c*Ne,(c+2)*Ne)),y-=2*Ne;for(;y>=Ne;c++)zr(p[0],Md,c),t.bcTagx1(m,e,p[0],r.subarray(c*Ne,(c+1)*Ne)),y-=Ne;if(y>0){zr(p[0],nF,c);let x=new Uint8Array(Ne);x.set(r.subarray(r.length-y)),x[y]=128,t.bcTagx1(m,e,p[0],x)}if(f[0]=rF<>24&255,P[k+1]=_>>16&255,P[k+2]=_>>8&255,P[k+3]=_&255,P[k+4]=w>>24&255,P[k+5]=w>>16&255,P[k+6]=w>>8&255,P[k+7]=w&255}function p(P,k,_,w,I){var z,W=0;for(z=0;z>>8)-1}function m(P,k,_,w){return p(P,k,_,w,16)}function y(P,k,_,w){return p(P,k,_,w,32)}function v(P,k,_,w){for(var I=w[0]&255|(w[1]&255)<<8|(w[2]&255)<<16|(w[3]&255)<<24,z=_[0]&255|(_[1]&255)<<8|(_[2]&255)<<16|(_[3]&255)<<24,W=_[4]&255|(_[5]&255)<<8|(_[6]&255)<<16|(_[7]&255)<<24,ce=_[8]&255|(_[9]&255)<<8|(_[10]&255)<<16|(_[11]&255)<<24,ve=_[12]&255|(_[13]&255)<<8|(_[14]&255)<<16|(_[15]&255)<<24,Le=w[4]&255|(w[5]&255)<<8|(w[6]&255)<<16|(w[7]&255)<<24,Te=k[0]&255|(k[1]&255)<<8|(k[2]&255)<<16|(k[3]&255)<<24,Rt=k[4]&255|(k[5]&255)<<8|(k[6]&255)<<16|(k[7]&255)<<24,Re=k[8]&255|(k[9]&255)<<8|(k[10]&255)<<16|(k[11]&255)<<24,ft=k[12]&255|(k[13]&255)<<8|(k[14]&255)<<16|(k[15]&255)<<24,at=w[8]&255|(w[9]&255)<<8|(w[10]&255)<<16|(w[11]&255)<<24,vt=_[16]&255|(_[17]&255)<<8|(_[18]&255)<<16|(_[19]&255)<<24,ke=_[20]&255|(_[21]&255)<<8|(_[22]&255)<<16|(_[23]&255)<<24,_e=_[24]&255|(_[25]&255)<<8|(_[26]&255)<<16|(_[27]&255)<<24,Xe=_[28]&255|(_[29]&255)<<8|(_[30]&255)<<16|(_[31]&255)<<24,ht=w[12]&255|(w[13]&255)<<8|(w[14]&255)<<16|(w[15]&255)<<24,Fe=I,tt=z,Be=W,He=ce,Je=ve,Me=Le,ae=Te,oe=Rt,ge=Re,ue=ft,fe=at,be=vt,ct=ke,At=_e,St=Xe,Ot=ht,$,Mt=0;Mt<20;Mt+=2)$=Fe+ct|0,Je^=$<<7|$>>>25,$=Je+Fe|0,ge^=$<<9|$>>>23,$=ge+Je|0,ct^=$<<13|$>>>19,$=ct+ge|0,Fe^=$<<18|$>>>14,$=Me+tt|0,ue^=$<<7|$>>>25,$=ue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P[14]=He>>>16&255,P[15]=He>>>24&255,P[16]=Je>>>0&255,P[17]=Je>>>8&255,P[18]=Je>>>16&255,P[19]=Je>>>24&255,P[20]=Me>>>0&255,P[21]=Me>>>8&255,P[22]=Me>>>16&255,P[23]=Me>>>24&255,P[24]=ae>>>0&255,P[25]=ae>>>8&255,P[26]=ae>>>16&255,P[27]=ae>>>24&255,P[28]=oe>>>0&255,P[29]=oe>>>8&255,P[30]=oe>>>16&255,P[31]=oe>>>24&255,P[32]=ge>>>0&255,P[33]=ge>>>8&255,P[34]=ge>>>16&255,P[35]=ge>>>24&255,P[36]=ue>>>0&255,P[37]=ue>>>8&255,P[38]=ue>>>16&255,P[39]=ue>>>24&255,P[40]=fe>>>0&255,P[41]=fe>>>8&255,P[42]=fe>>>16&255,P[43]=fe>>>24&255,P[44]=be>>>0&255,P[45]=be>>>8&255,P[46]=be>>>16&255,P[47]=be>>>24&255,P[48]=ct>>>0&255,P[49]=ct>>>8&255,P[50]=ct>>>16&255,P[51]=ct>>>24&255,P[52]=At>>>0&255,P[53]=At>>>8&255,P[54]=At>>>16&255,P[55]=At>>>24&255,P[56]=St>>>0&255,P[57]=St>>>8&255,P[58]=St>>>16&255,P[59]=St>>>24&255,P[60]=Ot>>>0&255,P[61]=Ot>>>8&255,P[62]=Ot>>>16&255,P[63]=Ot>>>24&255}function x(P,k,_,w){for(var I=w[0]&255|(w[1]&255)<<8|(w[2]&255)<<16|(w[3]&255)<<24,z=_[0]&255|(_[1]&255)<<8|(_[2]&255)<<16|(_[3]&255)<<24,W=_[4]&255|(_[5]&255)<<8|(_[6]&255)<<16|(_[7]&255)<<24,ce=_[8]&255|(_[9]&255)<<8|(_[10]&255)<<16|(_[11]&255)<<24,ve=_[12]&255|(_[13]&255)<<8|(_[14]&255)<<16|(_[15]&255)<<24,Le=w[4]&255|(w[5]&255)<<8|(w[6]&255)<<16|(w[7]&255)<<24,Te=k[0]&255|(k[1]&255)<<8|(k[2]&255)<<16|(k[3]&255)<<24,Rt=k[4]&255|(k[5]&255)<<8|(k[6]&255)<<16|(k[7]&255)<<24,Re=k[8]&255|(k[9]&255)<<8|(k[10]&255)<<16|(k[11]&255)<<24,ft=k[12]&255|(k[13]&255)<<8|(k[14]&255)<<16|(k[15]&255)<<24,at=w[8]&255|(w[9]&255)<<8|(w[10]&255)<<16|(w[11]&255)<<24,vt=_[16]&255|(_[17]&255)<<8|(_[18]&255)<<16|(_[19]&255)<<24,ke=_[20]&255|(_[21]&255)<<8|(_[22]&255)<<16|(_[23]&255)<<24,_e=_[24]&255|(_[25]&255)<<8|(_[26]&255)<<16|(_[27]&255)<<24,Xe=_[28]&255|(_[29]&255)<<8|(_[30]&255)<<16|(_[31]&255)<<24,ht=w[12]&255|(w[13]&255)<<8|(w[14]&255)<<16|(w[15]&255)<<24,Fe=I,tt=z,Be=W,He=ce,Je=ve,Me=Le,ae=Te,oe=Rt,ge=Re,ue=ft,fe=at,be=vt,ct=ke,At=_e,St=Xe,Ot=ht,$,Mt=0;Mt<20;Mt+=2)$=Fe+ct|0,Je^=$<<7|$>>>25,$=Je+Fe|0,ge^=$<<9|$>>>23,$=ge+Je|0,ct^=$<<13|$>>>19,$=ct+ge|0,Fe^=$<<18|$>>>14,$=Me+tt|0,ue^=$<<7|$>>>25,$=ue+Me|0,At^=$<<9|$>>>23,$=At+ue|0,tt^=$<<13|$>>>19,$=tt+At|0,Me^=$<<18|$>>>14,$=fe+ae|0,St^=$<<7|$>>>25,$=St+fe|0,Be^=$<<9|$>>>23,$=Be+St|0,ae^=$<<13|$>>>19,$=ae+Be|0,fe^=$<<18|$>>>14,$=Ot+be|0,He^=$<<7|$>>>25,$=He+Ot|0,oe^=$<<9|$>>>23,$=oe+He|0,be^=$<<13|$>>>19,$=be+oe|0,Ot^=$<<18|$>>>14,$=Fe+He|0,tt^=$<<7|$>>>25,$=tt+Fe|0,Be^=$<<9|$>>>23,$=Be+tt|0,He^=$<<13|$>>>19,$=He+Be|0,Fe^=$<<18|$>>>14,$=Me+Je|0,ae^=$<<7|$>>>25,$=ae+Me|0,oe^=$<<9|$>>>23,$=oe+ae|0,Je^=$<<13|$>>>19,$=Je+oe|0,Me^=$<<18|$>>>14,$=fe+ue|0,be^=$<<7|$>>>25,$=be+fe|0,ge^=$<<9|$>>>23,$=ge+be|0,ue^=$<<13|$>>>19,$=ue+ge|0,fe^=$<<18|$>>>14,$=Ot+St|0,ct^=$<<7|$>>>25,$=ct+Ot|0,At^=$<<9|$>>>23,$=At+ct|0,St^=$<<13|$>>>19,$=St+At|0,Ot^=$<<18|$>>>14;P[0]=Fe>>>0&255,P[1]=Fe>>>8&255,P[2]=Fe>>>16&255,P[3]=Fe>>>24&255,P[4]=Me>>>0&255,P[5]=Me>>>8&255,P[6]=Me>>>16&255,P[7]=Me>>>24&255,P[8]=fe>>>0&255,P[9]=fe>>>8&255,P[10]=fe>>>16&255,P[11]=fe>>>24&255,P[12]=Ot>>>0&255,P[13]=Ot>>>8&255,P[14]=Ot>>>16&255,P[15]=Ot>>>24&255,P[16]=ae>>>0&255,P[17]=ae>>>8&255,P[18]=ae>>>16&255,P[19]=ae>>>24&255,P[20]=oe>>>0&255,P[21]=oe>>>8&255,P[22]=oe>>>16&255,P[23]=oe>>>24&255,P[24]=ge>>>0&255,P[25]=ge>>>8&255,P[26]=ge>>>16&255,P[27]=ge>>>24&255,P[28]=ue>>>0&255,P[29]=ue>>>8&255,P[30]=ue>>>16&255,P[31]=ue>>>24&255}function A(P,k,_,w){v(P,k,_,w)}function S(P,k,_,w){x(P,k,_,w)}var E=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function T(P,k,_,w,I,z,W){var ce=new Uint8Array(16),ve=new Uint8Array(64),Le,Te;for(Te=0;Te<16;Te++)ce[Te]=0;for(Te=0;Te<8;Te++)ce[Te]=z[Te];for(;I>=64;){for(A(ve,ce,W,E),Te=0;Te<64;Te++)P[k+Te]=_[w+Te]^ve[Te];for(Le=1,Te=8;Te<16;Te++)Le=Le+(ce[Te]&255)|0,ce[Te]=Le&255,Le>>>=8;I-=64,k+=64,w+=64}if(I>0)for(A(ve,ce,W,E),Te=0;Te=64;){for(A(W,z,I,E),ve=0;ve<64;ve++)P[k+ve]=W[ve];for(ce=1,ve=8;ve<16;ve++)ce=ce+(z[ve]&255)|0,z[ve]=ce&255,ce>>>=8;_-=64,k+=64}if(_>0)for(A(W,z,I,E),ve=0;ve<_;ve++)P[k+ve]=W[ve];return 0}function N(P,k,_,w,I){var z=new Uint8Array(32);S(z,w,I,E);for(var W=new Uint8Array(8),ce=0;ce<8;ce++)W[ce]=w[ce+16];return C(P,k,_,W,z)}function B(P,k,_,w,I,z,W){var ce=new Uint8Array(32);S(ce,z,W,E);for(var ve=new Uint8Array(8),Le=0;Le<8;Le++)ve[Le]=z[Le+16];return T(P,k,_,w,I,ve,ce)}var L=function(P){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var k,_,w,I,z,W,ce,ve;k=P[0]&255|(P[1]&255)<<8,this.r[0]=k&8191,_=P[2]&255|(P[3]&255)<<8,this.r[1]=(k>>>13|_<<3)&8191,w=P[4]&255|(P[5]&255)<<8,this.r[2]=(_>>>10|w<<6)&7939,I=P[6]&255|(P[7]&255)<<8,this.r[3]=(w>>>7|I<<9)&8191,z=P[8]&255|(P[9]&255)<<8,this.r[4]=(I>>>4|z<<12)&255,this.r[5]=z>>>1&8190,W=P[10]&255|(P[11]&255)<<8,this.r[6]=(z>>>14|W<<2)&8191,ce=P[12]&255|(P[13]&255)<<8,this.r[7]=(W>>>11|ce<<5)&8065,ve=P[14]&255|(P[15]&255)<<8,this.r[8]=(ce>>>8|ve<<8)&8191,this.r[9]=ve>>>5&127,this.pad[0]=P[16]&255|(P[17]&255)<<8,this.pad[1]=P[18]&255|(P[19]&255)<<8,this.pad[2]=P[20]&255|(P[21]&255)<<8,this.pad[3]=P[22]&255|(P[23]&255)<<8,this.pad[4]=P[24]&255|(P[25]&255)<<8,this.pad[5]=P[26]&255|(P[27]&255)<<8,this.pad[6]=P[28]&255|(P[29]&255)<<8,this.pad[7]=P[30]&255|(P[31]&255)<<8};L.prototype.blocks=function(P,k,_){for(var w=this.fin?0:2048,I,z,W,ce,ve,Le,Te,Rt,Re,ft,at,vt,ke,_e,Xe,ht,Fe,tt,Be,He=this.h[0],Je=this.h[1],Me=this.h[2],ae=this.h[3],oe=this.h[4],ge=this.h[5],ue=this.h[6],fe=this.h[7],be=this.h[8],ct=this.h[9],At=this.r[0],St=this.r[1],Ot=this.r[2],$=this.r[3],Mt=this.r[4],Ht=this.r[5],Gt=this.r[6],_t=this.r[7],jt=this.r[8],zt=this.r[9];_>=16;)I=P[k+0]&255|(P[k+1]&255)<<8,He+=I&8191,z=P[k+2]&255|(P[k+3]&255)<<8,Je+=(I>>>13|z<<3)&8191,W=P[k+4]&255|(P[k+5]&255)<<8,Me+=(z>>>10|W<<6)&8191,ce=P[k+6]&255|(P[k+7]&255)<<8,ae+=(W>>>7|ce<<9)&8191,ve=P[k+8]&255|(P[k+9]&255)<<8,oe+=(ce>>>4|ve<<12)&8191,ge+=ve>>>1&8191,Le=P[k+10]&255|(P[k+11]&255)<<8,ue+=(ve>>>14|Le<<2)&8191,Te=P[k+12]&255|(P[k+13]&255)<<8,fe+=(Le>>>11|Te<<5)&8191,Rt=P[k+14]&255|(P[k+15]&255)<<8,be+=(Te>>>8|Rt<<8)&8191,ct+=Rt>>>5|w,Re=0,ft=Re,ft+=He*At,ft+=Je*(5*zt),ft+=Me*(5*jt),ft+=ae*(5*_t),ft+=oe*(5*Gt),Re=ft>>>13,ft&=8191,ft+=ge*(5*Ht),ft+=ue*(5*Mt),ft+=fe*(5*$),ft+=be*(5*Ot),ft+=ct*(5*St),Re+=ft>>>13,ft&=8191,at=Re,at+=He*St,at+=Je*At,at+=Me*(5*zt),at+=ae*(5*jt),at+=oe*(5*_t),Re=at>>>13,at&=8191,at+=ge*(5*Gt),at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=He*jt,tt+=Je*_t,tt+=Me*Gt,tt+=ae*Ht,tt+=oe*Mt,Re=tt>>>13,tt&=8191,tt+=ge*$,tt+=ue*Ot,tt+=fe*St,tt+=be*At,tt+=ct*(5*zt),Re+=tt>>>13,tt&=8191,Be=Re,Be+=He*zt,Be+=Je*jt,Be+=Me*_t,Be+=ae*Gt,Be+=oe*Ht,Re=Be>>>13,Be&=8191,Be+=ge*Mt,Be+=ue*$,Be+=fe*Ot,Be+=be*St,Be+=ct*At,Re+=Be>>>13,Be&=8191,Re=(Re<<2)+Re|0,Re=Re+ft|0,ft=Re&8191,Re=Re>>>13,at+=Re,He=ft,Je=at,Me=vt,ae=ke,oe=_e,ge=Xe,ue=ht,fe=Fe,be=tt,ct=Be,k+=16,_-=16;this.h[0]=He,this.h[1]=Je,this.h[2]=Me,this.h[3]=ae,this.h[4]=oe,this.h[5]=ge,this.h[6]=ue,this.h[7]=fe,this.h[8]=be,this.h[9]=ct},L.prototype.finish=function(P,k){var _=new Uint16Array(10),w,I,z,W;if(this.leftover){for(W=this.leftover,this.buffer[W++]=1;W<16;W++)this.buffer[W]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(w=this.h[1]>>>13,this.h[1]&=8191,W=2;W<10;W++)this.h[W]+=w,w=this.h[W]>>>13,this.h[W]&=8191;for(this.h[0]+=w*5,w=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=w,w=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=w,_[0]=this.h[0]+5,w=_[0]>>>13,_[0]&=8191,W=1;W<10;W++)_[W]=this.h[W]+w,w=_[W]>>>13,_[W]&=8191;for(_[9]-=8192,I=(w^1)-1,W=0;W<10;W++)_[W]&=I;for(I=~I,W=0;W<10;W++)this.h[W]=this.h[W]&I|_[W];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,z=this.h[0]+this.pad[0],this.h[0]=z&65535,W=1;W<8;W++)z=(this.h[W]+this.pad[W]|0)+(z>>>16)|0,this.h[W]=z&65535;P[k+0]=this.h[0]>>>0&255,P[k+1]=this.h[0]>>>8&255,P[k+2]=this.h[1]>>>0&255,P[k+3]=this.h[1]>>>8&255,P[k+4]=this.h[2]>>>0&255,P[k+5]=this.h[2]>>>8&255,P[k+6]=this.h[3]>>>0&255,P[k+7]=this.h[3]>>>8&255,P[k+8]=this.h[4]>>>0&255,P[k+9]=this.h[4]>>>8&255,P[k+10]=this.h[5]>>>0&255,P[k+11]=this.h[5]>>>8&255,P[k+12]=this.h[6]>>>0&255,P[k+13]=this.h[6]>>>8&255,P[k+14]=this.h[7]>>>0&255,P[k+15]=this.h[7]>>>8&255},L.prototype.update=function(P,k,_){var w,I;if(this.leftover){for(I=16-this.leftover,I>_&&(I=_),w=0;w=16&&(I=_-_%16,this.blocks(P,k,I),k+=I,_-=I),_){for(w=0;w<_;w++)this.buffer[this.leftover+w]=P[k+w];this.leftover+=_}};function U(P,k,_,w,I,z){var W=new L(z);return W.update(_,w,I),W.finish(P,k),0}function j(P,k,_,w,I,z){var W=new Uint8Array(16);return U(W,0,_,w,I,z),m(P,k,W,0)}function Z(P,k,_,w,I){var z;if(_<32)return-1;for(B(P,0,k,0,_,w,I),U(P,16,P,32,_-32,P),z=0;z<16;z++)P[z]=0;return 0}function G(P,k,_,w,I){var z,W=new Uint8Array(32);if(_<32||(N(W,0,32,w,I),j(k,16,k,32,_-32,W)!==0))return-1;for(B(P,0,k,0,_,w,I),z=0;z<32;z++)P[z]=0;return 0}function H(P,k){var _;for(_=0;_<16;_++)P[_]=k[_]|0}function re(P){var k,_,w=1;for(k=0;k<16;k++)_=P[k]+w+65535,w=Math.floor(_/65536),P[k]=_-w*65536;P[0]+=w-1+37*(w-1)}function V(P,k,_){for(var w,I=~(_-1),z=0;z<16;z++)w=I&(P[z]^k[z]),P[z]^=w,k[z]^=w}function ee(P,k){var _,w,I,z=n(),W=n();for(_=0;_<16;_++)W[_]=k[_];for(re(W),re(W),re(W),w=0;w<2;w++){for(z[0]=W[0]-65517,_=1;_<15;_++)z[_]=W[_]-65535-(z[_-1]>>16&1),z[_-1]&=65535;z[15]=W[15]-32767-(z[14]>>16&1),I=z[15]>>16&1,z[14]&=65535,V(W,z,1-I)}for(_=0;_<16;_++)P[2*_]=W[_]&255,P[2*_+1]=W[_]>>8}function pe(P,k){var _=new Uint8Array(32),w=new Uint8Array(32);return ee(_,P),ee(w,k),y(_,0,w,0)}function Ae(P){var k=new Uint8Array(32);return ee(k,P),k[0]&1}function we(P,k){var _;for(_=0;_<16;_++)P[_]=k[2*_]+(k[2*_+1]<<8);P[15]&=32767}function Ye(P,k,_){for(var w=0;w<16;w++)P[w]=k[w]+_[w]}function nt(P,k,_){for(var w=0;w<16;w++)P[w]=k[w]-_[w]}function De(P,k,_){var w,I,z=0,W=0,ce=0,ve=0,Le=0,Te=0,Rt=0,Re=0,ft=0,at=0,vt=0,ke=0,_e=0,Xe=0,ht=0,Fe=0,tt=0,Be=0,He=0,Je=0,Me=0,ae=0,oe=0,ge=0,ue=0,fe=0,be=0,ct=0,At=0,St=0,Ot=0,$=_[0],Mt=_[1],Ht=_[2],Gt=_[3],_t=_[4],jt=_[5],zt=_[6],Vn=_[7],an=_[8],Bn=_[9],Dn=_[10],Ln=_[11],rr=_[12],_r=_[13],Nr=_[14],Ir=_[15];w=k[0],z+=w*$,W+=w*Mt,ce+=w*Ht,ve+=w*Gt,Le+=w*_t,Te+=w*jt,Rt+=w*zt,Re+=w*Vn,ft+=w*an,at+=w*Bn,vt+=w*Dn,ke+=w*Ln,_e+=w*rr,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rr,be+=w*_r,ct+=w*Nr,At+=w*Ir,w=k[14],ht+=w*$,Fe+=w*Mt,tt+=w*Ht,Be+=w*Gt,He+=w*_t,Je+=w*jt,Me+=w*zt,ae+=w*Vn,oe+=w*an,ge+=w*Bn,ue+=w*Dn,fe+=w*Ln,be+=w*rr,ct+=w*_r,At+=w*Nr,St+=w*Ir,w=k[15],Fe+=w*$,tt+=w*Mt,Be+=w*Ht,He+=w*Gt,Je+=w*_t,Me+=w*jt,ae+=w*zt,oe+=w*Vn,ge+=w*an,ue+=w*Bn,fe+=w*Dn,be+=w*Ln,ct+=w*rr,At+=w*_r,St+=w*Nr,Ot+=w*Ir,z+=38*tt,W+=38*Be,ce+=38*He,ve+=38*Je,Le+=38*Me,Te+=38*ae,Rt+=38*oe,Re+=38*ge,ft+=38*ue,at+=38*fe,vt+=38*be,ke+=38*ct,_e+=38*At,Xe+=38*St,ht+=38*Ot,I=1,w=z+I+65535,I=Math.floor(w/65536),z=w-I*65536,w=W+I+65535,I=Math.floor(w/65536),W=w-I*65536,w=ce+I+65535,I=Math.floor(w/65536),ce=w-I*65536,w=ve+I+65535,I=Math.floor(w/65536),ve=w-I*65536,w=Le+I+65535,I=Math.floor(w/65536),Le=w-I*65536,w=Te+I+65535,I=Math.floor(w/65536),Te=w-I*65536,w=Rt+I+65535,I=Math.floor(w/65536),Rt=w-I*65536,w=Re+I+65535,I=Math.floor(w/65536),Re=w-I*65536,w=ft+I+65535,I=Math.floor(w/65536),ft=w-I*65536,w=at+I+65535,I=Math.floor(w/65536),at=w-I*65536,w=vt+I+65535,I=Math.floor(w/65536),vt=w-I*65536,w=ke+I+65535,I=Math.floor(w/65536),ke=w-I*65536,w=_e+I+65535,I=Math.floor(w/65536),_e=w-I*65536,w=Xe+I+65535,I=Math.floor(w/65536),Xe=w-I*65536,w=ht+I+65535,I=Math.floor(w/65536),ht=w-I*65536,w=Fe+I+65535,I=Math.floor(w/65536),Fe=w-I*65536,z+=I-1+37*(I-1),I=1,w=z+I+65535,I=Math.floor(w/65536),z=w-I*65536,w=W+I+65535,I=Math.floor(w/65536),W=w-I*65536,w=ce+I+65535,I=Math.floor(w/65536),ce=w-I*65536,w=ve+I+65535,I=Math.floor(w/65536),ve=w-I*65536,w=Le+I+65535,I=Math.floor(w/65536),Le=w-I*65536,w=Te+I+65535,I=Math.floor(w/65536),Te=w-I*65536,w=Rt+I+65535,I=Math.floor(w/65536),Rt=w-I*65536,w=Re+I+65535,I=Math.floor(w/65536),Re=w-I*65536,w=ft+I+65535,I=Math.floor(w/65536),ft=w-I*65536,w=at+I+65535,I=Math.floor(w/65536),at=w-I*65536,w=vt+I+65535,I=Math.floor(w/65536),vt=w-I*65536,w=ke+I+65535,I=Math.floor(w/65536),ke=w-I*65536,w=_e+I+65535,I=Math.floor(w/65536),_e=w-I*65536,w=Xe+I+65535,I=Math.floor(w/65536),Xe=w-I*65536,w=ht+I+65535,I=Math.floor(w/65536),ht=w-I*65536,w=Fe+I+65535,I=Math.floor(w/65536),Fe=w-I*65536,z+=I-1+37*(I-1),P[0]=z,P[1]=W,P[2]=ce,P[3]=ve,P[4]=Le,P[5]=Te,P[6]=Rt,P[7]=Re,P[8]=ft,P[9]=at,P[10]=vt,P[11]=ke,P[12]=_e,P[13]=Xe,P[14]=ht,P[15]=Fe}function st(P,k){De(P,k,k)}function Tt(P,k){var _=n(),w;for(w=0;w<16;w++)_[w]=k[w];for(w=253;w>=0;w--)st(_,_),w!==2&&w!==4&&De(_,_,k);for(w=0;w<16;w++)P[w]=_[w]}function ln(P,k){var _=n(),w;for(w=0;w<16;w++)_[w]=k[w];for(w=250;w>=0;w--)st(_,_),w!==1&&De(_,_,k);for(w=0;w<16;w++)P[w]=_[w]}function Ee(P,k,_){var w=new Uint8Array(32),I=new Float64Array(80),z,W,ce=n(),ve=n(),Le=n(),Te=n(),Rt=n(),Re=n();for(W=0;W<31;W++)w[W]=k[W];for(w[31]=k[31]&127|64,w[0]&=248,we(I,_),W=0;W<16;W++)ve[W]=I[W],Te[W]=ce[W]=Le[W]=0;for(ce[0]=Te[0]=1,W=254;W>=0;--W)z=w[W>>>3]>>>(W&7)&1,V(ce,ve,z),V(Le,Te,z),Ye(Rt,ce,Le),nt(ce,ce,Le),Ye(Le,ve,Te),nt(ve,ve,Te),st(Te,Rt),st(Re,ce),De(ce,Le,ce),De(Le,ve,Rt),Ye(Rt,ce,Le),nt(ce,ce,Le),st(ve,ce),nt(Le,Te,Re),De(ce,Le,l),Ye(ce,ce,Te),De(Le,Le,ce),De(ce,Te,Re),De(Te,ve,I),st(ve,Rt),V(ce,ve,z),V(Le,Te,z);for(W=0;W<16;W++)I[W+16]=ce[W],I[W+32]=Le[W],I[W+48]=ve[W],I[W+64]=Te[W];var ft=I.subarray(32),at=I.subarray(16);return Tt(ft,ft),De(at,at,ft),ee(P,at),0}function ne(P,k){return Ee(P,k,a)}function le(P,k){return r(k,32),ne(P,k)}function te(P,k,_){var w=new Uint8Array(32);return Ee(w,_,k),S(P,i,w,E)}var Ce=Z,Se=G;function ze(P,k,_,w,I,z){var W=new Uint8Array(32);return te(W,I,z),Ce(P,k,_,w,W)}function $e(P,k,_,w,I,z){var W=new Uint8Array(32);return te(W,I,z),Se(P,k,_,w,W)}var rt=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function dt(P,k,_,w){for(var I=new Int32Array(16),z=new Int32Array(16),W,ce,ve,Le,Te,Rt,Re,ft,at,vt,ke,_e,Xe,ht,Fe,tt,Be,He,Je,Me,ae,oe,ge,ue,fe,be,ct=P[0],At=P[1],St=P[2],Ot=P[3],$=P[4],Mt=P[5],Ht=P[6],Gt=P[7],_t=k[0],jt=k[1],zt=k[2],Vn=k[3],an=k[4],Bn=k[5],Dn=k[6],Ln=k[7],rr=0;w>=128;){for(Je=0;Je<16;Je++)Me=8*Je+rr,I[Je]=_[Me+0]<<24|_[Me+1]<<16|_[Me+2]<<8|_[Me+3],z[Je]=_[Me+4]<<24|_[Me+5]<<16|_[Me+6]<<8|_[Me+7];for(Je=0;Je<80;Je++)if(W=ct,ce=At,ve=St,Le=Ot,Te=$,Rt=Mt,Re=Ht,ft=Gt,at=_t,vt=jt,ke=zt,_e=Vn,Xe=an,ht=Bn,Fe=Dn,tt=Ln,ae=Gt,oe=Ln,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=($>>>14|an<<18)^($>>>18|an<<14)^(an>>>9|$<<23),oe=(an>>>14|$<<18)^(an>>>18|$<<14)^($>>>9|an<<23),ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ae=$&Mt^~$&Ht,oe=an&Bn^~an&Dn,ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ae=rt[Je*2],oe=rt[Je*2+1],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ae=I[Je%16],oe=z[Je%16],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,Be=fe&65535|be<<16,He=ge&65535|ue<<16,ae=Be,oe=He,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=(ct>>>28|_t<<4)^(_t>>>2|ct<<30)^(_t>>>7|ct<<25),oe=(_t>>>28|ct<<4)^(ct>>>2|_t<<30)^(ct>>>7|_t<<25),ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ae=ct&At^ct&St^At&St,oe=_t&jt^_t&zt^jt&zt,ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,ft=fe&65535|be<<16,tt=ge&65535|ue<<16,ae=Le,oe=_e,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=Be,oe=He,ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,Le=fe&65535|be<<16,_e=ge&65535|ue<<16,At=W,St=ce,Ot=ve,$=Le,Mt=Te,Ht=Rt,Gt=Re,ct=ft,jt=at,zt=vt,Vn=ke,an=_e,Bn=Xe,Dn=ht,Ln=Fe,_t=tt,Je%16===15)for(Me=0;Me<16;Me++)ae=I[Me],oe=z[Me],ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=I[(Me+9)%16],oe=z[(Me+9)%16],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,Be=I[(Me+1)%16],He=z[(Me+1)%16],ae=(Be>>>1|He<<31)^(Be>>>8|He<<24)^Be>>>7,oe=(He>>>1|Be<<31)^(He>>>8|Be<<24)^(He>>>7|Be<<25),ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,Be=I[(Me+14)%16],He=z[(Me+14)%16],ae=(Be>>>19|He<<13)^(He>>>29|Be<<3)^Be>>>6,oe=(He>>>19|Be<<13)^(Be>>>29|He<<3)^(He>>>6|Be<<26),ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,I[Me]=fe&65535|be<<16,z[Me]=ge&65535|ue<<16;ae=ct,oe=_t,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[0],oe=k[0],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[0]=ct=fe&65535|be<<16,k[0]=_t=ge&65535|ue<<16,ae=At,oe=jt,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[1],oe=k[1],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[1]=At=fe&65535|be<<16,k[1]=jt=ge&65535|ue<<16,ae=St,oe=zt,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[2],oe=k[2],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[2]=St=fe&65535|be<<16,k[2]=zt=ge&65535|ue<<16,ae=Ot,oe=Vn,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[3],oe=k[3],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[3]=Ot=fe&65535|be<<16,k[3]=Vn=ge&65535|ue<<16,ae=$,oe=an,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[4],oe=k[4],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[4]=$=fe&65535|be<<16,k[4]=an=ge&65535|ue<<16,ae=Mt,oe=Bn,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[5],oe=k[5],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[5]=Mt=fe&65535|be<<16,k[5]=Bn=ge&65535|ue<<16,ae=Ht,oe=Dn,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[6],oe=k[6],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[6]=Ht=fe&65535|be<<16,k[6]=Dn=ge&65535|ue<<16,ae=Gt,oe=Ln,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[7],oe=k[7],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[7]=Gt=fe&65535|be<<16,k[7]=Ln=ge&65535|ue<<16,rr+=128,w-=128}return w}function wt(P,k,_){var w=new Int32Array(8),I=new Int32Array(8),z=new Uint8Array(256),W,ce=_;for(w[0]=1779033703,w[1]=3144134277,w[2]=1013904242,w[3]=2773480762,w[4]=1359893119,w[5]=2600822924,w[6]=528734635,w[7]=1541459225,I[0]=4089235720,I[1]=2227873595,I[2]=4271175723,I[3]=1595750129,I[4]=2917565137,I[5]=725511199,I[6]=4215389547,I[7]=327033209,dt(w,I,k,_),_%=128,W=0;W<_;W++)z[W]=k[ce-_+W];for(z[_]=128,_=256-128*(_<112?1:0),z[_-9]=0,g(z,_-8,ce/536870912|0,ce<<3),dt(w,I,z,_),W=0;W<8;W++)g(P,8*W,w[W],I[W]);return 0}function yt(P,k){var _=n(),w=n(),I=n(),z=n(),W=n(),ce=n(),ve=n(),Le=n(),Te=n();nt(_,P[1],P[0]),nt(Te,k[1],k[0]),De(_,_,Te),Ye(w,P[0],P[1]),Ye(Te,k[0],k[1]),De(w,w,Te),De(I,P[3],k[3]),De(I,I,u),De(z,P[2],k[2]),Ye(z,z,z),nt(W,w,_),nt(ce,z,I),Ye(ve,z,I),Ye(Le,w,_),De(P[0],W,ce),De(P[1],Le,ve),De(P[2],ve,ce),De(P[3],W,Le)}function Pe(P,k,_){var w;for(w=0;w<4;w++)V(P[w],k[w],_)}function nn(P,k){var _=n(),w=n(),I=n();Tt(I,k[2]),De(_,k[0],I),De(w,k[1],I),ee(P,w),P[31]^=Ae(_)<<7}function cn(P,k,_){var w,I;for(H(P[0],o),H(P[1],s),H(P[2],s),H(P[3],o),I=255;I>=0;--I)w=_[I/8|0]>>(I&7)&1,Pe(P,k,w),yt(k,P),yt(P,P),Pe(P,k,w)}function Gn(P,k){var _=[n(),n(),n(),n()];H(_[0],f),H(_[1],h),H(_[2],s),De(_[3],f,h),cn(P,_,k)}function Wa(P,k,_){var w=new Uint8Array(64),I=[n(),n(),n(),n()],z;for(_||r(k,32),wt(w,k,32),w[0]&=248,w[31]&=127,w[31]|=64,Gn(I,w),nn(P,I),z=0;z<32;z++)k[z+32]=P[z];return 0}var ms=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Yr(P,k){var _,w,I,z;for(w=63;w>=32;--w){for(_=0,I=w-32,z=w-12;I>4)*ms[I],_=k[I]>>8,k[I]&=255;for(I=0;I<32;I++)k[I]-=_*ms[I];for(w=0;w<32;w++)k[w+1]+=k[w]>>8,P[w]=k[w]&255}function du(P){var k=new Float64Array(64),_;for(_=0;_<64;_++)k[_]=P[_];for(_=0;_<64;_++)P[_]=0;Yr(P,k)}function ji(P,k,_,w){var I=new Uint8Array(64),z=new Uint8Array(64),W=new Uint8Array(64),ce,ve,Le=new Float64Array(64),Te=[n(),n(),n(),n()];wt(I,w,32),I[0]&=248,I[31]&=127,I[31]|=64;var Rt=_+64;for(ce=0;ce<_;ce++)P[64+ce]=k[ce];for(ce=0;ce<32;ce++)P[32+ce]=I[32+ce];for(wt(W,P.subarray(32),_+32),du(W),Gn(Te,W),nn(P,Te),ce=32;ce<64;ce++)P[ce]=w[ce];for(wt(z,P,_+64),du(z),ce=0;ce<64;ce++)Le[ce]=0;for(ce=0;ce<32;ce++)Le[ce]=W[ce];for(ce=0;ce<32;ce++)for(ve=0;ve<32;ve++)Le[ce+ve]+=z[ce]*I[ve];return Yr(P.subarray(32),Le),Rt}function pu(P,k){var _=n(),w=n(),I=n(),z=n(),W=n(),ce=n(),ve=n();return H(P[2],s),we(P[1],k),st(I,P[1]),De(z,I,c),nt(I,I,P[2]),Ye(z,P[2],z),st(W,z),st(ce,W),De(ve,ce,W),De(_,ve,I),De(_,_,z),ln(_,_),De(_,_,I),De(_,_,z),De(_,_,z),De(P[0],_,z),st(w,P[0]),De(w,w,z),pe(w,I)&&De(P[0],P[0],d),st(w,P[0]),De(w,w,z),pe(w,I)?-1:(Ae(P[0])===k[31]>>7&&nt(P[0],o,P[0]),De(P[3],P[0],P[1]),0)}function Ja(P,k,_,w){var I,z=new Uint8Array(32),W=new Uint8Array(64),ce=[n(),n(),n(),n()],ve=[n(),n(),n(),n()];if(_<64||pu(ve,w))return-1;for(I=0;I<_;I++)P[I]=k[I];for(I=0;I<32;I++)P[I+32]=w[I];if(wt(W,P,_),du(W),cn(ce,ve,W),Gn(ve,k.subarray(32)),yt(ce,ve),nn(z,ce),_-=64,y(k,0,z,0)){for(I=0;I<_;I++)P[I]=0;return-1}for(I=0;I<_;I++)P[I]=k[I+64];return _}var Ul=32,Fl=24,zi=32,Xr=16,pa=32,Ya=32,Io=32,Xa=32,gu=32,yu=Fl,Ph=zi,Q=Xr,q=64,se=32,Oe=64,Ge=32,xt=64;e.lowlevel={crypto_core_hsalsa20:S,crypto_stream_xor:B,crypto_stream:N,crypto_stream_salsa20_xor:T,crypto_stream_salsa20:C,crypto_onetimeauth:U,crypto_onetimeauth_verify:j,crypto_verify_16:m,crypto_verify_32:y,crypto_secretbox:Z,crypto_secretbox_open:G,crypto_scalarmult:Ee,crypto_scalarmult_base:ne,crypto_box_beforenm:te,crypto_box_afternm:Ce,crypto_box:ze,crypto_box_open:$e,crypto_box_keypair:le,crypto_hash:wt,crypto_sign:ji,crypto_sign_keypair:Wa,crypto_sign_open:Ja,crypto_secretbox_KEYBYTES:Ul,crypto_secretbox_NONCEBYTES:Fl,crypto_secretbox_ZEROBYTES:zi,crypto_secretbox_BOXZEROBYTES:Xr,crypto_scalarmult_BYTES:pa,crypto_scalarmult_SCALARBYTES:Ya,crypto_box_PUBLICKEYBYTES:Io,crypto_box_SECRETKEYBYTES:Xa,crypto_box_BEFORENMBYTES:gu,crypto_box_NONCEBYTES:yu,crypto_box_ZEROBYTES:Ph,crypto_box_BOXZEROBYTES:Q,crypto_sign_BYTES:q,crypto_sign_PUBLICKEYBYTES:se,crypto_sign_SECRETKEYBYTES:Oe,crypto_sign_SEEDBYTES:Ge,crypto_hash_BYTES:xt,gf:n,D:c,L:ms,pack25519:ee,unpack25519:we,M:De,A:Ye,S:st,Z:nt,pow2523:ln,add:yt,set25519:H,modL:Yr,scalarmult:cn,scalarbase:Gn};function pt(P,k){if(P.length!==Ul)throw new Error("bad key size");if(k.length!==Fl)throw new Error("bad nonce size")}function lt(P,k){if(P.length!==Io)throw new Error("bad public key size");if(k.length!==Xa)throw new Error("bad secret key size")}function Ue(){for(var P=0;P=0},e.sign.keyPair=function(){var P=new Uint8Array(se),k=new Uint8Array(Oe);return Wa(P,k),{publicKey:P,secretKey:k}},e.sign.keyPair.fromSecretKey=function(P){if(Ue(P),P.length!==Oe)throw new Error("bad secret key size");for(var k=new Uint8Array(se),_=0;_`0x${"0".repeat(40)}`;class Eae{constructor(){this.cachedSignatures=new Map,this.cachedLeashes=new Map}clear(){this.cachedSignatures.clear(),this.cachedLeashes.clear()}cache(e,n,r,i,a){this.cachedSignatures.has(e)||this.cachedSignatures.set(e,new Map),this.cachedSignatures.get(e).set(i,a),this.cachedLeashes.set(n,{nonce:r.leash.nonce,block_number:r.leash.blockNumber,block_hash:r.leash.blockHash,block_range:r.leash.blockRange})}get(e,n){var r;return(r=this.cachedSignatures.get(e))===null||r===void 0?void 0:r.get(n)}getLeash(e){return this.cachedLeashes.get(e)}}const Iy=new Eae;function Sae(t){return{domain:{name:"oasis-runtime-sdk/evm: signed query",version:"1.0.0",chainId:t},types:{Call:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"gasLimit",type:"uint64"},{name:"gasPrice",type:"uint256"},{name:"value",type:"uint256"},{name:"data",type:"bytes"},{name:"leash",type:"Leash"}],Leash:[{name:"nonce",type:"uint64"},{name:"blockNumber",type:"uint64"},{name:"blockHash",type:"bytes32"},{name:"blockRange",type:"uint64"}]}}}class uA{static make(e,n,r){return gx(this,void 0,void 0,function*(){const i=yield Oae(n,r==null?void 0:r.leash);return new uA(i,yield Cae(Tae(e,i),n,{chainId:r==null?void 0:r.chainId}),e.data?sF(e.data):void 0)})}constructor(e,n,r){this.leash=e,this.signature=n,this.data=r,hw.add(this)}encode(){return J_(this,hw,"m",n8).call(this,this.data?{body:this.data}:void 0)}encryptEncode(e){return gx(this,void 0,void 0,function*(){return this.data?J_(this,hw,"m",n8).call(this,yield e.encryptEnvelope(this.data)):this.encode()})}}hw=new WeakSet,n8=function(e){return Ze(jh({data:e||void 0,leash:this.leash,signature:this.signature}))};function sF(t){return Array.isArray(t)?new Uint8Array(t):Or(t)}function Pae(t){return Array.isArray(t)?Ze(new Uint8Array(t)):Ze(t)}function Oae(t,e){var n;return gx(this,void 0,void 0,function*(){((e==null?void 0:e.nonce)!==void 0||(e==null?void 0:e.block)!==void 0)&&Iy.clear();let r;if(e!=null&&e.nonce)r=e.nonce;else if("getNonce"in t)r=t.getNonce("pending");else{const l=yield t.getAddress();r=t.provider.getTransactionCount(l,"pending")}let i;if((e==null?void 0:e.block)!==void 0)i=e.block;else{if(!t.provider)throw new Error("`sapphire.wrap`ped signer was not connected to a provider");const l=yield t.provider.getBlock("latest");if(!l)throw new Error("unable to get latest block");i=t.provider.getBlock(l.number-2)}const[a,o]=yield Promise.all([r,i]),s=(n=e==null?void 0:e.blockRange)!==null&&n!==void 0?n:wae;if((e==null?void 0:e.nonce)===void 0&&(e==null?void 0:e.block)===void 0){if(!t.provider)throw new Error("`sapphire.wrap`ped signer was not connected to a provider");const{chainId:l}=yield t.provider.getNetwork(),c=Iy.getLeash(BigInt(l));if(c!==void 0){if(c.nonce>a&&c.block_number+s>o.number+2)return c;Iy.clear()}}return{nonce:e!=null&&e.nonce?e.nonce:a+bae,block_number:o.number,block_hash:Or(o.hash),block_range:s}})}function Tae(t,e){var n,r,i,a,o;return{from:t.from,to:(n=t.to)!==null&&n!==void 0?n:Aae(),gasLimit:Number(BigInt((i=(r=t.gasLimit)!==null&&r!==void 0?r:t.gasLimit)!==null&&i!==void 0?i:mae)),gasPrice:BigInt((a=t.gasPrice)!==null&&a!==void 0?a:yae),value:BigInt((o=t.value)!==null&&o!==void 0?o:vae),data:t.data?Pae(t.data):xae,leash:{nonce:e.nonce,blockNumber:e.block_number,blockHash:e.block_hash,blockRange:e.block_range}}}function Cae(t,e,n){return gx(this,void 0,void 0,function*(){const r=yield e.getAddress();let i;if(n!=null&&n.chainId)i=BigInt(n.chainId);else if(e.provider)({chainId:i}=yield e.provider.getNetwork());else throw new Error("must either connect provider or provide manual chainId override");const{domain:a,types:o}=Sae(Number(i)),s=kae(a),l=_ae(t),c=E1.hash(s,o,l);let u=Iy.get(r,c);return u!==void 0||(u=Pt("_signTypedData"in e?yield e._signTypedData(s,o,l):yield e.signTypedData(s,o,l)),Iy.cache(r,BigInt(i),t,c,u)),u})}function kae(t){const e=Object.assign(Object.assign({},t),{chainId:t.chainId?fs(t.chainId):void 0});return t.salt&&(e.salt=sF(t.salt)),e}function _ae(t){const e=n=>{if(n!=null)return typeof n=="string"?n:n instanceof BigInt?fs(n.toString()):Fu(n)};return Object.assign(Object.assign({},t),{gasPrice:e(t.gasPrice),value:e(t.value),data:t.data?Pt(t.data):void 0})}const Nae="modulepreload",Iae=function(t){return"/votee/"+t},Y_={},Rae=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){const a=document.getElementsByTagName("link");i=Promise.all(n.map(o=>{if(o=Iae(o),o in Y_)return;Y_[o]=!0;const s=o.endsWith(".css"),l=s?'[rel="stylesheet"]':"";if(!!r)for(let f=a.length-1;f>=0;f--){const h=a[f];if(h.href===o&&(!s||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${l}`))return;const u=document.createElement("link");if(u.rel=s?"stylesheet":Nae,s||(u.as="script",u.crossOrigin=""),u.href=o,document.head.appendChild(u),s)return new Promise((f,h)=>{u.addEventListener("load",f),u.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${o}`)))})}))}return i.then(()=>e()).catch(a=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a})},fE={chainId:23294,defaultGateway:"https://sapphire.oasis.io/",runtimeId:"0x000000000000000000000000000000000000000000000000f80306c9858e7279"},hE={chainId:23295,defaultGateway:"https://testnet.sapphire.oasis.dev/",runtimeId:"0x000000000000000000000000000000000000000000000000a6d1e3ebf60dff6c"},dE={chainId:23293,defaultGateway:"http://localhost:8545/",runtimeId:"0x8000000000000000000000000000000000000000000000000000000000000000"},Mae={mainnet:fE,testnet:hE,localnet:dE,[fE.chainId]:fE,[hE.chainId]:hE,[dE.chainId]:dE};var Rp=function(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{c(r.next(u))}catch(f){o(f)}}function l(u){try{c(r.throw(u))}catch(f){o(f)}}function c(u){u.done?a(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})};const Bae=60*5*1e3;function lF(t,e){return{key:Pt(t.key),checksum:Pt(t.checksum),signature:Pt(t.signature),epoch:t.epoch,chainId:e,fetched:new Date}}function Dae(t){return Rp(this,void 0,void 0,function*(){const e=yield Rae(()=>import(t.split(":")[0]),__vite__mapDeps([])),n=cF();return new Promise((r,i)=>{const a={method:"POST",headers:{"content-type":"application/json","content-length":n.length}},o=e.request(t,a,s=>{const l=[];s.on("error",c=>i(c)),s.on("data",c=>l.push(c)),s.on("end",()=>{r(JSON.parse(Buffer.concat(l).toString()))})});o.on("error",s=>i(s)),o.write(n),o.end()})})}function Lae(t,e){return Rp(this,void 0,void 0,function*(){const n=yield e(t,{method:"POST",headers:{"content-type":"application/json"},body:cF()});if(!n.ok)throw new Ry("Failed to fetch runtime public key.",n);return yield n.json()})}function cF(){return JSON.stringify({jsonrpc:"2.0",id:Math.floor(Math.random()*1e9),method:i8,params:[]})}function $ae(t,e){var n;return Rp(this,void 0,void 0,function*(){const{defaultGateway:r}=Mae[t];if(!r)throw new Error(`Unable to fetch runtime public key for network with unknown ID: ${t}.`);const i=(n=e==null?void 0:e.fetch)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.fetch,a=yield i?Lae(r,i):Dae(r);return lF(a.result,t)})}function X_(t){return typeof t=="string"?t.startsWith("0x")?parseInt(t,16):parseInt(t):t}function Uae(t){return Rp(this,void 0,void 0,function*(){const e="provider"in t?t.provider:t;let n;if(e){let r;if("request"in e){const i=e;n=X_(yield i.request({method:"eth_chainId"}));try{r=yield i.request({method:i8,params:[]})}catch{}}else if("send"in e){const i=e;n=X_(yield i.send("eth_chainId",[]));try{r=yield i.send(i8,[])}catch{}}else throw new Error("fetchRuntimePublicKey does not support non-request non-send provier!");if(r&&"key"in r)return lF(r,n)}if(!n)throw new Error("fetchRuntimePublicKey failed to retrieve chainId from provider");return $ae(n)})}class Fae{}class jae extends Fae{constructor(e){super(),e||(e=Bae),this.timeoutMilliseconds=e}fetch(e){return Rp(this,void 0,void 0,function*(){if(this.pubkey){const n=this.pubkey,r=Date.now()-this.timeoutMilliseconds;if(n.fetched&&n.fetched.valueOf()>r)return n}return this.pubkey=yield Uae(e)})}cipher(e){return Rp(this,void 0,void 0,function*(){const n=yield this.fetch(e);return dx.ephemeral(n.key,n.epoch)})}}var hs=function(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{c(r.next(u))}catch(f){o(f)}}function l(u){try{c(r.throw(u))}catch(f){o(f)}}function c(u){u.done?a(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})},zae=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);ihs(this,void 0,void 0,function*(){return yield i({method:o[0],params:o[1]})})),"sendAsync"in t&&(a.sendAsync=()=>{throw new Error("sendAsync not supported by Sapphire wrapper!")}),CO(t,n,a)}function Vae(t,e){return n=>hs(this,void 0,void 0,function*(){const r=yield t.getSigner(),i=yield e.fetcher.cipher(t),{method:a,params:o}=yield Xae(n,r,i),s=yield r.provider.send(a,o??[]);return a==="eth_call"?yield i.decryptEncoded(s):s})}function CO(t,e,n){return new Proxy(t,{get(r,i){if(i===TO)return e;if(i in n)return Reflect.get(n,i);const a=Reflect.get(r,i);return typeof a=="function"?a.bind(r):a}})}function kO(t,e){const n=fA(e);let r;if(t.provider)try{const a=fF(t.provider,n,t);r=t.connect(a)}catch(a){if(a.code!=="UNSUPPORTED_OPERATION")throw a;r=t}else r=t;const i={sendTransaction:Z_(r.sendTransaction.bind(r),n,r),signTransaction:Z_(r.signTransaction.bind(r),n,r),call:yx(r,"call",n),estimateGas:yx(r,"estimateGas",n),connect(a){const o=r.connect(a);return kO(o,n)}};return CO(r,n,i)}function fF(t,e,n){const r=fA(e);if(Reflect.get(t,TO)!==void 0)return t;const i={call:yx(t,"call",r),estimateGas:yx(t,"estimateGas",r)};return n&&("broadcastTransaction"in t?i.broadcastTransaction=a=>hs(this,void 0,void 0,function*(){const o=yield r.fetcher.cipher(t),s=yield r8(a,o,n);return t.broadcastTransaction(s)}):i.sendTransaction=a=>hs(this,void 0,void 0,function*(){const o=yield r.fetcher.cipher(t),s=yield r8(a,o,n);return t.sendTransaction(s)})),CO(t,r,i)}function Qae(t){return Reflect.get(t,"_isSigner")===!0}function Kae(t){return t instanceof HU||Reflect.get(t,"signTypedData")!==void 0&&Reflect.get(t,"signTransaction")!==void 0}function hF(t){return Qae(t)||Kae(t)}function Wae(t){return Reflect.get(t,"_isProvider")===!0}function Jae(t){return t instanceof zU||Reflect.get(t,"waitForBlock")&&Reflect.get(t,"destroy")&&Reflect.get(t,"broadcastTransaction")}function Yae(t){return Wae(t)||Jae(t)}function yx(t,e,n){const r=(i,a,o,s)=>hs(this,void 0,void 0,function*(){var l;let c=a.data;return o||(c=yield s.encryptEncode((l=a.data)!==null&&l!==void 0?l:new Uint8Array)),yield i[e](Object.assign(Object.assign({},a),{data:Ze(c)}))});return i=>hs(this,void 0,void 0,function*(){const a=Reflect.get(t,"populateCall");a!==void 0&&(i=yield a.bind(t)(i));let o;const s=pF(i.data,!0),l=yield n.fetcher.cipher(t);if(!s&&hF(t)){const c=t;if(!c.provider)throw new Error("signer not connected to a provider");const u=c.provider;if(yield dF(i)){const f=yield uA.make(i,c);o=yield u[e](Object.assign(Object.assign({},i),{data:yield f.encryptEncode(l)}))}else o=yield r(u,i,s,l)}else o=yield r(t,i,s,l);return!s&&typeof o=="string"?yield l.decryptEncoded(o):o})}function Z_(t,e,n){return(r,...i)=>hs(this,void 0,void 0,function*(){if(r.data){const a=yield e.fetcher.cipher(n);r.data=yield a.encryptEncode(r.data)}return t(r,...i)})}function dF(t){return hs(this,void 0,void 0,function*(){const[e,n]=yield Promise.all([t.from,t.to]);return!!n&&!!e&&typeof e=="string"&&!/^(0x)?0{40}$/.test(e)})}function Xae({method:t,params:e},n,r){return hs(this,void 0,void 0,function*(){if(!Array.isArray(e))return{method:t,params:e};if(t==="eth_sendRawTransaction")return{method:t,params:[yield r8(e[0],r,n)]};if((t==="eth_call"||t==="eth_estimateGas")&&(yield dF(e[0]))){const i=yield uA.make(e[0],n),a=Object.assign(Object.assign({},e[0]),{data:yield i.encryptEncode(r)});return{method:t,params:[a,...e.slice(1)]}}return/^eth_((send|sign)Transaction|call|estimateGas)$/.test(t)&&e[0].data?(e[0].data=yield r.encryptEncode(e[0].data),{method:t,params:e}):{method:t,params:e}})}class pE extends Error{}const Zae="Un-enveloped data was passed to sendRawTransaction, which is likely incorrect. Is the dapp using the Sapphire compat lib correctly?";function r8(t,e,n){return hs(this,void 0,void 0,function*(){const r=A1.from(t);if(pF(r.data,!1)||r.isSigned()&&(!n||(yield n.getAddress())!==r.from))return t;r.data=yield e.encryptEncode(r.data);try{return n.signTransaction(r)}catch(i){throw new Ry(Zae,i)}})}function qae(t){return"data"in t&&"leash"in t&&"signature"in t}function pF(t,e){try{const n=tw(Pt(t));let r;if(qae(n)){if(!e)throw new pE("Got unexpected signed query!");r=n.data}else r=n;if(!eoe(r))throw new pE("Bogus Sapphire enveloped data found in transaction!");return!0}catch(n){if(n instanceof pE)throw n}return!1}function eoe(t){const{format:e,body:n}=t,r=zae(t,["format","body"]);return!(Object.keys(r).length>0||!n||e!==null&&e!==Ip.Plain&&(rx(n)||!rx(n.data)))}const i8="oasis_callDataPublicKey";class Ry extends Error{constructor(e,n){super(e),this.response=n}}function toe({mustBeMetaMask:t=!1,silent:e=!1,timeout:n=3e3}={}){i();let r=!1;return new Promise(a=>{window.ethereum?o():(window.addEventListener("ethereum#initialized",o,{once:!0}),setTimeout(()=>{o()},n));function o(){if(r)return;r=!0,window.removeEventListener("ethereum#initialized",o);const{ethereum:s}=window;s&&(!t||s.isMetaMask)?a(s):(!e&&console.error("@metamask/detect-provider:",t&&s?"Non-MetaMask window.ethereum detected.":"Unable to detect window.ethereum."),a(null))}});function i(){if(typeof t!="boolean")throw new Error("@metamask/detect-provider: Expected option 'mustBeMetaMask' to be a boolean.");if(typeof e!="boolean")throw new Error("@metamask/detect-provider: Expected option 'silent' to be a boolean.");if(typeof n!="number")throw new Error("@metamask/detect-provider: Expected option 'timeout' to be a number.")}}var noe=toe;const roe=Xt(noe),gF=F.createContext({}),ioe=({children:t})=>{const e=async()=>!!await roe({mustBeMetaMask:!1}),n=async()=>{var s,l;const o=await(((l=(s=window.ethereum)==null?void 0:s.request)==null?void 0:l.call(s,{method:"eth_requestAccounts"}))||Promise.resolve([]));if(!o||(o==null?void 0:o.length)<=0)throw new Error("[EIP1193Context] Request account failed!");return o[0]},r=(o=Hw)=>{var l,c;if(!zw.has(o))throw new Error(`Chain configuration for chain id '${o}' not found!`);const s=zw.get(o);return(c=(l=window.ethereum)==null?void 0:l.request)==null?void 0:c.call(l,{method:"wallet_addEthereumChain",params:[s]})},a={isEIP1193ProviderAvailable:e,connectWallet:n,switchNetwork:async(o=Hw)=>{var u,f;const s=new f$(window.ethereum);if((await uF(s).getNetwork()).chainId!==BigInt(o))try{const h=us(o).replace("0x0","0x");await((f=(u=window.ethereum).request)==null?void 0:f.call(u,{method:"wallet_switchEthereumChain",params:[{chainId:h}]}))}catch(h){const d=h;if((d==null?void 0:d.code)!==4902&&(d==null?void 0:d.code)!==-32603)throw d;r(o)}}};return J.jsx(gF.Provider,{value:a,children:t})},aoe=()=>{const t=F.useContext(gF);if(Object.keys(t).length===0)throw new Error("[useEIP1193] Component not wrapped within a Provider");return t},db=[{inputs:[{internalType:"contract IPollManagerACL",name:"in_managerACL",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"Close_NotActive",type:"error"},{inputs:[],name:"Close_NotAllowed",type:"error"},{inputs:[],name:"Create_AlreadyExists",type:"error"},{inputs:[],name:"Create_InvalidACL",type:"error"},{inputs:[],name:"Create_NoChoices",type:"error"},{inputs:[],name:"Create_NotAllowed",type:"error"},{inputs:[],name:"Create_TooManyChoices",type:"error"},{inputs:[],name:"Poll_NotActive",type:"error"},{inputs:[],name:"Poll_NotPublishingVotes",type:"error"},{inputs:[],name:"Poll_StillActive",type:"error"},{inputs:[],name:"Vote_NotActive",type:"error"},{inputs:[],name:"Vote_NotAllowed",type:"error"},{inputs:[],name:"Vote_UnknownChoice",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"id",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"topChoice",type:"uint256"}],name:"ProposalClosed",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"id",type:"bytes32"}],name:"ProposalCreated",type:"event"},{inputs:[],name:"MAX_CHOICES",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"PAST_PROPOSALS",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"PROPOSALS",outputs:[{internalType:"bool",name:"active",type:"bool"},{internalType:"uint8",name:"topChoice",type:"uint8"},{components:[{internalType:"bytes",name:"ipfsHash",type:"bytes"},{internalType:"uint8",name:"numChoices",type:"uint8"},{internalType:"uint64",name:"closeTimestamp",type:"uint64"},{internalType:"contract IPollACL",name:"acl",type:"address"}],internalType:"struct PollManager.ProposalParams",name:"params",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"in_id",type:"bytes32"}],name:"ballotIsActive",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"in_proposalId",type:"bytes32"},{internalType:"address",name:"in_voter",type:"address"},{internalType:"bytes",name:"in_data",type:"bytes"}],name:"canVoteOnPoll",outputs:[{internalType:"uint256",name:"out_weight",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"in_proposalId",type:"bytes32"}],name:"close",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"bytes",name:"ipfsHash",type:"bytes"},{internalType:"uint8",name:"numChoices",type:"uint8"},{internalType:"uint64",name:"closeTimestamp",type:"uint64"},{internalType:"contract IPollACL",name:"acl",type:"address"}],internalType:"struct PollManager.ProposalParams",name:"in_params",type:"tuple"},{internalType:"bytes",name:"in_aclData",type:"bytes"}],name:"create",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"getACL",outputs:[{internalType:"contract IPollManagerACL",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"proposalId",type:"bytes32"}],name:"getPollACL",outputs:[{internalType:"contract IPollACL",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"in_proposalId",type:"bytes32"}],name:"getVoteCounts",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes32",name:"in_proposalId",type:"bytes32"},{internalType:"uint8",name:"in_choiceId",type:"uint8"},{internalType:"bytes",name:"in_data",type:"bytes"}],name:"vote",outputs:[],stateMutability:"nonpayable",type:"function"}],q_="0x60a03461007157601f61163c38819003918201601f19168301916001600160401b038311848410176100765780849260209460405283398101031261007157516001600160a01b0381168103610071576080526040516115af908161008d82396080518181816103b301526110b60152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe608080604052600436101561001357600080fd5b600090813560e01c90816301ffc9a7146110e55750806308737695146110a057806339c79e0c14610e075780635f98ac7814610dd8578063613e0f8c14610d9f5780636dea101c14610d4d578063782fb5d414610c1b5780638732765714610a82578063892d13071461033a578063d4c0ed3e1461031e578063d50b2843146101035763ff2990a0146100a557600080fd5b3461010057606036600319011261010057602435906001600160a01b038216820361010057604435906001600160401b0382116101005760206100f8846100ef3660048701611210565b916004356112f5565b604051908152f35b80fd5b50346101005760603660031901126101005760043560243560ff81168103610319576001600160401b039160443583811161031557610149610151913690600401611210565b9033846112f5565b818552600160205260ff600260408720015416918260ff851610156102d957855284602052604085203386528060205260408620946101a86101968754948515611409565b6101a285801515611409565b9061141c565b936002830154916040519083602083015260208252816040810110906040830111176102c35760408101604052602081519101209160ff60018901541690895b838110610232578a8a600160ff8c8c8c8c8c6002820155811561021a575b505084551660ff1982840154161791015580f35b600b610229910191825461141c565b90558680610206565b806102418a9260038901611263565b90549060031b1c836102648b60ff61025b8d8a8814611409565b96168514611409565b91189283039283116102ad5761027d879160019461141c565b186102a561028e8360038b01611263565b819391549060031b91821b91600019901b19161790565b9055016101e8565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b60405162461bcd60e51b8152602060048201526014602482015273566f74655f556e6b6e6f776e43686f696365282960601b6044820152606490fd5b8480fd5b600080fd5b5034610100578060031936011261010057602060405160088152f35b5034610100576003196040368201126108d0576001600160401b03600435116108d05760806004353603918201126108d0576024356001600160401b0381116108df5761038b903690600401611210565b60405160016290108360e01b03198152306004820152336024820152919290916020816044817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa908115610a46578591610a63575b5015610a5157602460206001600160a01b0361040b60043560640161128a565b6040516301ffc9a760e01b815263b91f535b60e01b600482015293849290918391165afa908115610a46578591610a17575b5015610a055760ff61045360246004350161129e565b16156109f357600860ff61046b60246004350161129e565b16116109e1576040519033602083015260606040830152602219016004356004013512156109b75760043560043560040135016001600160401b036004820135116103155760048101353603602482011361031557816105466104e5610554936080808501526101008401906024600482013591016112ac565b60ff6104f560246004350161123d565b1660a08401526001600160401b036105116044600435016112cd565b1660c08401526001600160a01b0361052d6004356064016112e1565b1660e0840152828103601f1901606084015285876112ac565b03601f1981018352826111ef565b6020815191012092838152600160205260ff6040822054166109cf576040518060608101106001600160401b036060830111176102c35760608101604052600181528160208201526040516105a8816111d4565b6001600160401b0360043560040135116108df5736602360043560040135600435010112156108df576001600160401b036004803580820135010135116109bb5760405161060a6004803580820135010135601f01601f1916602001826111ef565b60048035808201350190810135808352369101602401116109b7576004803580820135019081013590602401602083013783602060048035810135813501013583010152815261065e60246004350161123d565b60208201526106716044600435016112cd565b60408201526106846064600435016112e1565b606082015260408281019182528684526001602090815290842083518154929094015161ffff1990921693151560ff169390931760089190911b61ff0016178255519081518051906001600160401b0382116109a3576106e76001840154611187565b601f811161095e575b50602090601f83116001146108ee5760029392918691836108e3575b50508160011b916000199060031b1c19161760018201555b019060ff6020820151169082549168ffffffffffffffff00604083015160081b169160606901000000000000000000600160e81b0391015160481b169262ffffff60e81b16171717905561077784611513565b508381528060205260408120936040513060601b60208201523360601b6034820152602881528060608101106001600160401b036060830111176102c357606081016040526020815191012092836002870155825b60ff6107dc60246004350161129e565b168110156108005780856107f861028e60019460038c01611263565b9055016107cc565b50846001600160a01b0361081860043560640161128a565b16610852575b6020837f288a29bca04edb18fcdb2c76d6e3b03b8a137c85c70d1a4cb8aacfa868d6051082604051838152a1604051908152f35b83906001600160a01b0361086a60043560640161128a565b16803b156108df576108a7938360405180968195829463c60e204760e01b84528a60048501523360248501526060604485015260648401916112ac565b03925af180156108d4576108bc575b8061081e565b6108c683916111c1565b6108d057816108b6565b5080fd5b6040513d85823e3d90fd5b8280fd5b01519050388061070c565b906001840186526020862091865b601f1985168110610946575091839160019360029695601f1981161061092d575b505050811b016001820155610724565b015160001960f88460031b161c1916905538808061091d565b919260206001819286850151815501940192016108fc565b60018401865260208620601f840160051c81016020851061099c575b601f830160051c820181106109905750506106f0565b6000815560010161097a565b508061097a565b634e487b7160e01b85526041600452602485fd5b8380fd5b634e487b7160e01b83526041600452602483fd5b604051637830599760e11b8152600490fd5b60405163b3aaf68560e01b8152600490fd5b604051630f922a5760e01b8152600490fd5b6040516376c8e1c760e01b8152600490fd5b610a39915060203d602011610a3f575b610a3181836111ef565b81019061124b565b3861043d565b503d610a27565b6040513d87823e3d90fd5b60405163537f370960e01b8152600490fd5b610a7c915060203d602011610a3f57610a3181836111ef565b386103eb565b5034610100576020806003193601126108d05760043582526001916001825260408120918254926001810160405195610aba876111d4565b604051918591815491610acc83611187565b9283865287600182169182600014610bf5575050600114610bb3575b50505090610afb816002949303826111ef565b86520154938181019460ff811686526001600160401b0360408301818360081c16815260018060a01b039384606082019460481c16845260ff6040519881811615158a5260081c1686890152606060408901525194608060608901528551958660e08a0152875b878110610b9e5750505060ff8798610100989789888a01015251166080870152511660a0850152511660c0830152601f80199101168101030190f35b8181018301518a820161010001528201610b62565b875285872094939250859187915b818310610bde575093945091925090820101610afb826002610ae8565b865485840185015295860195879390920191610bc1565b60ff19168782015293151560051b86019093019350610afb925084915060029050610ae8565b50346101005760209081600319360112610100576004358152600191600181526040822090828152604083209160ff815416610d3b578360ff60028793015416610c7d610c6782611273565b91610c7560405193846111ef565b808352611273565b8185019590601f1901368737600281015490600390810184865b610cd6575b505050506040519380850191818652518092526040850195925b828110610cc35785870386f35b8351875295810195928101928401610cb6565b8495979498969851811015610d2f5783610cf08284611263565b905490851b1c188651821015610d1b57600582901b8701860152959793969395939493860186610c97565b634e487b7160e01b89526032600452602489fd5b97959796949396610c9c565b60405163ce381d3560e01b8152600490fd5b5034610100576020366003190112610100576004356004548110156108d05760209060046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0154604051908152f35b5034610100576020366003190112610100576020906004358152600182526002604060018060a01b039220015460481c16604051908152f35b50346101005760203660031901126101005760ff60406020926004358152600184522054166040519015158152f35b5034610100576020806003193601126108d057600435908183526001808252604084209060ff9160ff8154161561108e576002018054604051630ada2bb960e31b81523060048201526024810187905233604482015290936001600160a01b03939091868160648160488a901c89165afa908115611083578991611066575b5015611038575b929190868852878652604088209388948990600281015460ff8c991691846003809201905b610ff3575b505050898b52505060018752505060408720805461ffff191661ff00600886901b1617905591925090610ee985611429565b50600454600160401b811015610fdf576001810180600455811015610fcb579085879392600485527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01555460481c16803b156108d05781906024604051809481936346ba4a8760e11b83528960048401525af18015610a4657610f96575b50907f32c34fd89f87a7cc9f257c5f4c2ed207f4776f12b94e6aec10d90ce489d6c52891604051908152a280f35b93610fc37f32c34fd89f87a7cc9f257c5f4c2ed207f4776f12b94e6aec10d90ce489d6c5289392956111c1565b939091610f68565b634e487b7160e01b87526032600452602487fd5b634e487b7160e01b87526041600452602487fd5b868b168481101561103257836110098d84611263565b905490851b1c1890868211611027575b505099850186169985610eb2565b9a5094508686611019565b50610eb7565b600885901c6001600160401b0316801561105457421015610e8d575b604051630e01f48b60e11b8152600490fd5b61107d9150873d8911610a3f57610a3181836111ef565b38610e86565b6040513d8b823e3d90fd5b604051632e72894160e11b8152600490fd5b50346101005780600319360112610100576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b9050346108d05760203660031901126108d05760043563ffffffff60e01b81168091036108df57602092506301ffc9a760e01b8114908115611129575b5015158152f35b639664e9b960e01b14905038611122565b6002548110156111715760026000527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0190600090565b634e487b7160e01b600052603260045260246000fd5b90600182811c921680156111b7575b60208310146111a157565b634e487b7160e01b600052602260045260246000fd5b91607f1691611196565b6001600160401b0381116102c357604052565b608081019081106001600160401b038211176102c357604052565b90601f801991011681019081106001600160401b038211176102c357604052565b9181601f84011215610319578235916001600160401b038311610319576020838186019501011161031957565b359060ff8216820361031957565b90816020910312610319575180151581036103195790565b6008821015611171570190600090565b6001600160401b0381116102c35760051b60200190565b356001600160a01b03811681036103195790565b3560ff811681036103195790565b908060209392818452848401376000828201840152601f01601f1916010190565b35906001600160401b038216820361031957565b35906001600160a01b038216820361031957565b93929093600094818652600160205260409384872060ff815416156113f85760020154926001600160401b038460081c16806113eb575b50855163525a5ded60e11b815230600482015260248101919091526001600160a01b039283166044820152608060648201529360209385939092849283916113789160848401916112ac565b039260481c165afa9384156113e05780946113a9575b505082156113995750565b516305c1721760e41b8152600490fd5b909193506020823d6020116113d8575b816113c6602093836111ef565b8101031261010057505191388061138e565b3d91506113b9565b8251903d90823e3d90fd5b4210156113f8573861132c565b855163137436d960e01b8152600490fd5b818102929181159184041417156102ad57565b919082018092116102ad57565b600081815260036020526040812054909190801561150e57600019908082018181116114fa57600254908382019182116114e6578082036114b2575b505050600254801561149e5781019061147d8261113a565b909182549160031b1b19169055600255815260036020526040812055600190565b634e487b7160e01b84526031600452602484fd5b6114d06114c161028e9361113a565b90549060031b1c92839261113a565b9055845260036020526040842055388080611465565b634e487b7160e01b86526011600452602486fd5b634e487b7160e01b85526011600452602485fd5b505090565b60008181526003602052604081205461157457600254600160401b81101561156057908261154c61028e8460016040960160025561113a565b905560025492815260036020522055600190565b634e487b7160e01b82526041600452602482fd5b90509056fea26469706673582212208bf15ca60379d1f9df63d16ec0780cf392c8a1817ccceb0ea6880c22e44c30f464736f6c63430008170033",ooe=t=>t.length>1;class mx extends YP{constructor(...e){ooe(e)?super(...e):super(db,q_,e[0])}getDeployTransaction(e,n){return super.getDeployTransaction(e,n||{})}deploy(e,n){return super.deploy(e,n||{})}connect(e){return super.connect(e)}static createInterface(){return new GP(db)}static connect(e,n){return new _d(e,db,n)}}R(mx,"bytecode",q_),R(mx,"abi",db);const eN=new Uint8Array([]),soe={isConnected:!1,isVoidSignerConnected:!1,ethProvider:null,sapphireEthProvider:null,account:null,explorerBaseUrl:null,chainName:null,pollManagerVoidSigner:null},loe=({children:t})=>{const{isEIP1193ProviderAvailable:e,connectWallet:n,switchNetwork:r}=aoe(),[i,a]=F.useState({...soe});F.useEffect(()=>{(async()=>{if(!pC||!_6)return;const N=new bee(pC,void 0,{staticNetwork:!0}),B=await mx.connect(_6,N);a(L=>({...L,pollManagerVoidSigner:B,isVoidSignerConnected:!0}))})()},[]);const o=C=>{a(N=>({...N,isConnected:C}))},s=F.useCallback(C=>{if(C.length<=0){o(!1);return}const[N]=C;a(B=>({...B,account:N}))},[]),l=(C,N=i.sapphireEthProvider)=>{if(!N)throw new Error("[Web3Context] Sapphire provider is required!");if(!zw.has(C)||Hw!==C)throw new j5("Unknown network!");const{blockExplorerUrls:B,chainName:L}=zw.get(C),[U]=B;a(j=>({...j,explorerBaseUrl:U,chainName:L}))},c=F.useCallback(()=>{window.location.reload()},[]),u=F.useCallback(()=>o(!0),[]),f=F.useCallback(()=>o(!1),[]),h=(()=>{let C=!1;return N=>{var B,L,U,j;C||((B=N==null?void 0:N.on)==null||B.call(N,"accountsChanged",s),(L=N==null?void 0:N.on)==null||L.call(N,"chainChanged",c),(U=N==null?void 0:N.on)==null||U.call(N,"connect",u),(j=N==null?void 0:N.on)==null||j.call(N,"disconnect",f),C=!0)}})(),d=async(C,N)=>{try{const B=new f$(N),L=uF(B),U=await L.getNetwork();l(U.chainId,L),a(j=>({...j,isConnected:!0,ethProvider:B,sapphireEthProvider:L,account:C}))}catch(B){throw a(L=>({...L,isConnected:!1})),B instanceof j5?B:new Error("[Web3Context] Unable to initialize providers!")}},g=async()=>{const{account:C,sapphireEthProvider:N}=i;if(!C||!N)throw new Error("[Web3Context] Unable to fetch balance!");return await N.getBalance(C)},p=async()=>e(),m=async()=>{const C=await n();if(!C)throw new Error("[Web3Context] Request account failed!");await d(C,window.ethereum),h(window.ethereum)},y=async(C=Hw)=>r(C),v=async C=>{if(!C)throw new Error("[txHash] is required!");const{sapphireEthProvider:N}=i;if(!N)throw new Error("[sapphireEthProvider] not initialized!");const B=await N.waitForTransaction(C);if((B==null?void 0:B.status)===0)throw new Error("Transaction failed");return await N.getTransaction(C)},T={state:i,isProviderAvailable:p,connectWallet:m,switchNetwork:y,getBalance:g,getTransaction:v,getPoll:async()=>{const{pollManagerVoidSigner:C}=i;if(!C)throw new Error("[pollManagerWithoutSigner] not initialized!");return await C.PROPOSALS(us(Fv))},canVoteOnPoll:async()=>{const{pollManagerVoidSigner:C,account:N}=i;if(!C)throw new Error("[pollManagerVoidSigner] not initialized!");if(!N)throw new Error("[account] Wallet not connected!");return await C.canVoteOnPoll(Fv,N,eN).then(B=>Promise.resolve(B===1n)).catch(()=>Promise.resolve(!1))},vote:async C=>{const{sapphireEthProvider:N}=i;if(!N)throw new Error("[sapphireEthProvider] not initialized!");const B=kO(await N.getSigner()),U=await mx.connect(_6,B).vote.populateTransaction(Fv,C,eN);U.gasLimit=_K,U.value=0n;const j=await B.sendTransaction(U);return await v(j.hash)},getVoteCounts:async()=>{const{pollManagerVoidSigner:C}=i;if(!C)throw new Error("[pollManagerVoidSigner] not initialized!");return await C.getVoteCounts(Fv)}};return J.jsx(eD.Provider,{value:T,children:t})},coe="_cardHeaderText_937ca_1",uoe="_winningMascot_937ca_11",foe="_winningMascotBadge_937ca_15",hoe="_mascotPollData_937ca_32",doe="_cardFooterText_937ca_39",poe="_mascotResultsTable_937ca_48",goe="_answerColName_937ca_65",yoe="_mascotPollDataPieChart_937ca_78",moe="_headerText_937ca_83",ws={cardHeaderText:coe,winningMascot:uoe,winningMascotBadge:foe,mascotPollData:hoe,cardFooterText:doe,mascotResultsTable:poe,answerColName:goe,mascotPollDataPieChart:yoe,headerText:moe},voe=t=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},F.createElement("path",{d:"M232,64H208V56a16,16,0,0,0-16-16H64A16,16,0,0,0,48,56v8H24A16,16,0,0,0,8,80V96a40,40,0,0,0,40,40h3.65A80.13,80.13,0,0,0,120,191.61V216H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16H136V191.58c31.94-3.23,58.44-25.64,68.08-55.58H208a40,40,0,0,0,40-40V80A16,16,0,0,0,232,64ZM48,120A24,24,0,0,1,24,96V80H48v32q0,4,.39,8ZM232,96a24,24,0,0,1-24,24h-.5a81.81,81.81,0,0,0,.5-8.9V80h24Z"})),boe=t=>J.jsx(ag,{...t,children:J.jsx(voe,{})}),woe="_pieChart_1ctih_1",xoe="_pieChartCell_1ctih_6",tN={pieChart:woe,pieChartCell:xoe};function yF(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e-1}var wle=ble,xle=dA;function Ale(t,e){var n=this.__data__,r=xle(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var Ele=Ale,Sle=ole,Ple=ple,Ole=mle,Tle=wle,Cle=Ele;function dg(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e>>0},e.getByteBigEndian=function(r,i){return r>>>8*(3-i)&255},e.getBytesBigEndian=function(r){return[e.getByteBigEndian(r,0),e.getByteBigEndian(r,1),e.getByteBigEndian(r,2),e.getByteBigEndian(r,3)]},e.toHex=function(r,i){i=i||8;var a=r.toString(16);return a.length>>0},e.highPart=function(r){return e.toUint32(r/n)},e.or=function(r,i){for(var a=r,o=1;o>>0},e.and=function(r,i){for(var a=r,o=1;o>>0},e.xor=function(r,i){for(var a=r,o=1;o>>0},e.not=function(r){return~r>>>0},e.shiftLeft=function(r,i){return r<>>0},e.shiftRight=function(r,i){return r>>>i},e.rotateLeft=function(r,i){return(r<>>0|r>>>32-i)>>>0},e.rotateRight=function(r,i){return(r>>>i|r<<32-i>>>0)>>>0},e.choose=function(r,i,a){return(r&(i^a)^a)>>>0},e.majority=function(r,i,a){return(r&(i|a)|i&a)>>>0},e.addMod32=function(r){for(var i=r,a=1;a>>0},e.log2=function(r){return Math.floor(Math.log(r)/Math.LN2)},e.mult=function(r,i,a){var o=((r&4294901760)>>>0)*i,s=(r&65535)*i,l=e.toUint32(o)+e.toUint32(s)>=n?1:0;a[0]=e.highPart(o)+e.highPart(s)+l>>>0,a[1]=(o>>>0)+(s>>>0)}})(t.exports={})})(QU);var PO=QU.exports,D=PO;const jie=[1,2,4,8,16,32,64,128,27,54],kp=D.fromBytesBigEndian(85,85,85,85),_p=D.fromBytesBigEndian(170,170,170,170),ab=D.fromBytesBigEndian(51,51,51,51),ob=D.fromBytesBigEndian(204,204,204,204),H_=D.fromBytesBigEndian(15,15,15,15),G_=D.fromBytesBigEndian(240,240,240,240),zie=D.fromBytesBigEndian(0,0,0,255),Hie=D.fromBytesBigEndian(0,0,252,0),Gie=D.fromBytesBigEndian(0,0,3,0),Vie=D.fromBytesBigEndian(0,240,0,0),Qie=D.fromBytesBigEndian(0,15,0,0),Kie=D.fromBytesBigEndian(192,0,0,0),Wie=D.fromBytesBigEndian(63,0,0,0);function J3(){return new Uint32Array(8)}function fw(t,e){t[0]=D.xor(t[0],e[0]),t[1]=D.xor(t[1],e[1]),t[2]=D.xor(t[2],e[2]),t[3]=D.xor(t[3],e[3]),t[4]=D.xor(t[4],e[4]),t[5]=D.xor(t[5],e[5]),t[6]=D.xor(t[6],e[6]),t[7]=D.xor(t[7],e[7])}function hx(t){const e=t[7],n=t[6],r=t[5],i=t[4],a=t[3],o=t[2],s=t[1],l=t[0],c=D.xor(i,o),u=D.xor(e,s),f=D.xor(e,i),h=D.xor(e,o),d=D.xor(n,r),g=D.xor(d,l),p=D.xor(g,i),m=D.xor(u,c),y=D.xor(g,e),v=D.xor(g,s),x=D.xor(v,h),A=D.xor(a,m),S=D.xor(A,o),E=D.xor(A,n),T=D.xor(S,l),C=D.xor(S,d),N=D.xor(E,f),B=D.xor(l,N),L=D.xor(C,N),U=D.xor(C,h),j=D.xor(d,N),Z=D.xor(u,j),G=D.xor(e,j),H=D.and(m,S),re=D.and(x,T),V=D.xor(re,H),ee=D.and(p,l),pe=D.xor(ee,H),Ae=D.and(u,j),we=D.and(v,g),Ye=D.xor(we,Ae),nt=D.and(y,B),De=D.xor(nt,Ae),st=D.and(f,N),Tt=D.and(c,L),ln=D.xor(Tt,st),Ee=D.and(h,C),ne=D.xor(Ee,st),le=D.xor(V,ln),te=D.xor(pe,ne),Ce=D.xor(Ye,ln),Se=D.xor(De,ne),ze=D.xor(le,E),$e=D.xor(te,U),rt=D.xor(Ce,Z),dt=D.xor(Se,G),wt=D.xor(ze,$e),yt=D.and(ze,rt),Pe=D.xor(dt,yt),nn=D.and(wt,Pe),cn=D.xor(nn,$e),Gn=D.xor(rt,dt),Wa=D.xor($e,yt),ms=D.and(Wa,Gn),Yr=D.xor(ms,dt),du=D.xor(rt,Yr),ji=D.xor(Pe,Yr),pu=D.and(dt,ji),Ja=D.xor(pu,du),Ul=D.xor(Pe,pu),Fl=D.and(cn,Ul),zi=D.xor(wt,Fl),Xr=D.xor(zi,Ja),pa=D.xor(cn,Yr),Ya=D.xor(cn,zi),Io=D.xor(Yr,Ja),Xa=D.xor(pa,Xr),gu=D.and(Io,S),yu=D.and(Ja,T),Ph=D.and(Yr,l),Q=D.and(Ya,j),q=D.and(zi,g),se=D.and(cn,B),Oe=D.and(pa,N),Ge=D.and(Xa,L),xt=D.and(Xr,C),pt=D.and(Io,m),lt=D.and(Ja,x),Ue=D.and(Yr,p),Ct=D.and(Ya,u),P=D.and(zi,v),k=D.and(cn,y),_=D.and(pa,f),w=D.and(Xa,c),I=D.and(Xr,h),z=D.xor(_,w),W=D.xor(lt,Ue),ce=D.xor(se,P),ve=D.xor(pt,lt),Le=D.xor(Ph,Ct),Te=D.xor(Ph,se),Rt=D.xor(Ge,xt),Re=D.xor(gu,Q),ft=D.xor(Oe,Ge),at=D.xor(w,I),vt=D.xor(Ct,ce),ke=D.xor(Le,Re),_e=D.xor(q,z),Xe=D.xor(Q,ft),ht=D.xor(z,ke),Fe=D.xor(k,ke),tt=D.xor(Rt,_e),Be=D.xor(ve,_e),He=D.xor(q,Xe),Je=D.xor(Fe,tt),Me=D.xor(yu,Be),ae=D.xor(Xe,Be),oe=D.xor(vt,D.not(tt)),ge=D.xor(ce,D.not(ht)),ue=D.xor(He,Je),fe=D.xor(Re,Me),be=D.xor(Te,Me),ct=D.xor(W,Je),At=D.xor(He,D.not(fe)),St=D.xor(at,D.not(ue));t[7]=ae,t[6]=At,t[5]=St,t[4]=fe,t[3]=be,t[2]=ct,t[1]=oe,t[0]=ge}function Y3(t){for(let e=0;e<8;e++){const n=t[e];t[e]=D.or(D.and(n,zie),D.shiftRight(D.and(n,Hie),2),D.shiftLeft(D.and(n,Gie),6),D.shiftRight(D.and(n,Vie),4),D.shiftLeft(D.and(n,Qie),4),D.shiftRight(D.and(n,Kie),6),D.shiftLeft(D.and(n,Wie),2))}}function KU(t){const e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],c=D.or(D.shiftRight(e,8),D.shiftLeft(e,24)),u=D.or(D.shiftRight(n,8),D.shiftLeft(n,24)),f=D.or(D.shiftRight(r,8),D.shiftLeft(r,24)),h=D.or(D.shiftRight(i,8),D.shiftLeft(i,24)),d=D.or(D.shiftRight(a,8),D.shiftLeft(a,24)),g=D.or(D.shiftRight(o,8),D.shiftLeft(o,24)),p=D.or(D.shiftRight(s,8),D.shiftLeft(s,24)),m=D.or(D.shiftRight(l,8),D.shiftLeft(l,24));t[0]=D.xor(l,m,c,D.rotateRight(D.xor(e,c),16)),t[1]=D.xor(e,c,l,m,u,D.rotateRight(D.xor(n,u),16)),t[2]=D.xor(n,u,f,D.rotateRight(D.xor(r,f),16)),t[3]=D.xor(r,f,l,m,h,D.rotateRight(D.xor(i,h),16)),t[4]=D.xor(i,h,l,m,d,D.rotateRight(D.xor(a,d),16)),t[5]=D.xor(a,d,g,D.rotateRight(D.xor(o,g),16)),t[6]=D.xor(o,g,p,D.rotateRight(D.xor(s,p),16)),t[7]=D.xor(s,p,m,D.rotateRight(D.xor(l,m),16))}function WU(t,e){const n=new DataView(e.buffer);t[0]=n.getUint32(0+e.byteOffset,!0),t[2]=n.getUint32(4+e.byteOffset,!0),t[4]=n.getUint32(8+e.byteOffset,!0),t[6]=n.getUint32(12+e.byteOffset,!0),t[1]=0,t[3]=0,t[5]=0,t[7]=0,Ol(t)}function JU(t,e,n){const r=new DataView(e.buffer),i=new DataView(n.buffer);t[0]=r.getUint32(0+e.byteOffset,!0),t[2]=r.getUint32(4+e.byteOffset,!0),t[4]=r.getUint32(8+e.byteOffset,!0),t[6]=r.getUint32(12+e.byteOffset,!0),t[1]=i.getUint32(0+n.byteOffset,!0),t[3]=i.getUint32(4+n.byteOffset,!0),t[5]=i.getUint32(8+n.byteOffset,!0),t[7]=i.getUint32(12+n.byteOffset,!0),Ol(t)}function YU(t,e){Ol(e);const n=new DataView(t.buffer);n.setUint32(0+t.byteOffset,e[0],!0),n.setUint32(4+t.byteOffset,e[2],!0),n.setUint32(8+t.byteOffset,e[4],!0),n.setUint32(12+t.byteOffset,e[6],!0)}function XU(t,e,n){Ol(n);const r=new DataView(t.buffer),i=new DataView(e.buffer);r.setUint32(0+t.byteOffset,n[0],!0),r.setUint32(4+t.byteOffset,n[2],!0),r.setUint32(8+t.byteOffset,n[4],!0),r.setUint32(12+t.byteOffset,n[6],!0),i.setUint32(0+e.byteOffset,n[1],!0),i.setUint32(4+e.byteOffset,n[3],!0),i.setUint32(8+e.byteOffset,n[5],!0),i.setUint32(12+e.byteOffset,n[7],!0)}function Ol(t){for(let e=0;e<8;e+=2){const n=t[e],r=t[e+1];t[e]=D.or(D.and(n,kp),D.shiftLeft(D.and(r,kp),1)),t[e+1]=D.or(D.shiftRight(D.and(n,_p),1),D.and(r,_p))}for(let e=0;e<8;e+=4){const n=t[e],r=t[e+1],i=t[e+2],a=t[e+3];t[e]=D.or(D.and(n,ab),D.shiftLeft(D.and(i,ab),2)),t[e+2]=D.or(D.shiftRight(D.and(n,ob),2),D.and(i,ob)),t[e+1]=D.or(D.and(r,ab),D.shiftLeft(D.and(a,ab),2)),t[e+3]=D.or(D.shiftRight(D.and(r,ob),2),D.and(a,ob))}for(let e=0;e<4;e++){const n=t[e],r=t[e+4];t[e]=D.or(D.and(n,H_),D.shiftLeft(D.and(r,H_),4)),t[e+4]=D.or(D.shiftRight(D.and(n,G_),4),D.and(r,G_))}}function Jie(t,e){const n=new DataView(e.buffer);for(let r=0;r<4;r++){const i=n.getUint32(r*4+e.byteOffset,!0);t[r*2]=i,t[r*2+1]=i}Ol(t);for(let r=0,i=0;r<4;r=r+1,i=i+2){let a=D.or(D.and(t[i+0],kp),D.and(t[i+1],_p)),o=a;a=D.and(a,kp),t[i]=D.or(a,D.shiftLeft(a,1)),o=D.and(o,_p),t[i+1]=D.or(o,D.shiftRight(o,1))}}function ZU(t,e,n){const r=(e+1)*4;for(let i=0,a=0;i6&&u==4&&(a=V_(a)),a=D.xor(a,i[(c-o)*2]),i[c*2]=a,i[c*2+1]=a,u++,u==o&&(u=0,f++);for(let c=0;c>7,i=n>>5&1;t[e]=n<<1|r^i}}function rae(t){for(let e=0;e>6&1;t[e]=n>>1|(r^i)<<7}}function K_(t,e){t[0]^=1,t[1]^=2,t[2]^=4,t[3]^=8,t[4]^=fb[e],t[5]^=fb[e],t[6]^=fb[e],t[7]^=fb[e]}function iae(t,e){let n=t.subarray(16,32),r=t.subarray(0,16);Li(e[0],n,r,Np),K_(e[0],0);for(let i=1;i<=Dc;i++)nae(n),Z3(n),rae(r),Z3(r),Li(e[i],n,r,Np),K_(e[i],i)}function py(t,e,n){let r=new Uint8Array(n);Li(t[0],e[0],r,Np);for(let i=1;i<=Dc;i++)Z3(r),Li(t[i],e[i],r,Np)}function Yl(){let t=[];for(let e=0;e<=Dc;e++)t.push(new Uint8Array(16));return t}class aae{static bcEncrypt(e,n,r,i){let a=Yl();py(a,n,r);let o=Et.newQ(),s=Et.newQ();Et.load4xU32(o,i),Et.load4xU32(s,a[0]),Et.addRoundKey(o,s);for(let l=1;l<=Dc;l++)Et.subBytes(o),Et.shiftRows(o),Et.mixColumns(o),Et.load4xU32(s,a[l]),Et.addRoundKey(o,s);Et.store4xU32(e,o)}static bcKeystreamx2(e,n,r,i){let a=[Yl(),Yl()];for(let l=0;l<2;l++)py(a[l],n,r[l]);let o=Et.newQ(),s=Et.newQ();Et.rkeyOrtho(o,i),Et.load8xU32(s,a[0][0],a[1][0]),Et.addRoundKey(o,s);for(let l=1;l<=Dc;l++)Et.subBytes(o),Et.shiftRows(o),Et.mixColumns(o),Et.load8xU32(s,a[0][l],a[1][l]),Et.addRoundKey(o,s);Et.store8xU32(e.subarray(0,16),e.subarray(16,32),o)}static bcTagx1(e,n,r,i){let a=Yl();py(a,n,r);let o=Et.newQ(),s=Et.newQ();Et.load4xU32(o,i),Et.load4xU32(s,a[0]),Et.addRoundKey(o,s);for(let d=1;d<=Dc;d++)Et.subBytes(o),Et.shiftRows(o),Et.mixColumns(o),Et.load4xU32(s,a[d]),Et.addRoundKey(o,s);const l=new DataView(e.buffer);let c=l.getUint32(0,!0),u=l.getUint32(4,!0),f=l.getUint32(8,!0),h=l.getUint32(12,!0);Et.ortho(o),c=Ia.xor(c,o[0]),u=Ia.xor(u,o[2]),f=Ia.xor(f,o[4]),h=Ia.xor(h,o[6]),l.setUint32(0,c,!0),l.setUint32(4,u,!0),l.setUint32(8,f,!0),l.setUint32(12,h,!0)}static bcTagx2(e,n,r,i){let a=[Yl(),Yl()];for(let d=0;d<2;d++)py(a[d],n,r[d]);let o=Et.newQ(),s=Et.newQ();Et.load8xU32(o,i.subarray(0,16),i.subarray(16,32)),Et.load8xU32(s,a[0][0],a[1][0]),Et.addRoundKey(o,s);for(let d=1;d<=Dc;d++)Et.subBytes(o),Et.shiftRows(o),Et.mixColumns(o),Et.load8xU32(s,a[0][d],a[1][d]),Et.addRoundKey(o,s);const l=new DataView(e.buffer);let c=l.getUint32(0,!0),u=l.getUint32(4,!0),f=l.getUint32(8,!0),h=l.getUint32(12,!0);Et.ortho(o),c=Ia.xor(c,o[0],o[1]),u=Ia.xor(u,o[2],o[3]),f=Ia.xor(f,o[4],o[5]),h=Ia.xor(h,o[6],o[7]),l.setUint32(0,c,!0),l.setUint32(4,u,!0),l.setUint32(8,f,!0),l.setUint32(12,h,!0)}}class oae{static bcEncrypt(e,n,r,i){let a=Yl();py(a,n,r);const o=new DataView(i.buffer);let s=o.getUint32(0+i.byteOffset,!1),l=o.getUint32(4+i.byteOffset,!1),c=o.getUint32(8+i.byteOffset,!1),u=o.getUint32(12+i.byteOffset,!1);const f=new DataView(a[0].buffer);s=Ia.xor(s,f.getUint32(0+a[0].byteOffset,!1)),l=Ia.xor(l,f.getUint32(4+a[0].byteOffset,!1)),c=Ia.xor(c,f.getUint32(8+a[0].byteOffset,!1)),u=Ia.xor(u,f.getUint32(12+a[0].byteOffset,!1));for(let d=1;d<=Dc;d++)[s,l,c,u]=eae.aesencVartime(s,l,c,u,a[d]);const h=new DataView(e.buffer);h.setUint32(0+e.byteOffset,s,!1),h.setUint32(4+e.byteOffset,l,!1),h.setUint32(8+e.byteOffset,c,!1),h.setUint32(12+e.byteOffset,u,!1)}static bcKeystreamx2(e,n,r,i){this.bcEncrypt(e.subarray(0,16),n,r[0],i),this.bcEncrypt(e.subarray(16,32),n,r[1],i)}static bcTagx1(e,n,r,i){let a=new Uint8Array(Ne);this.bcEncrypt(a,n,r,i),Li(e,e,a,Ne)}static bcTagx2(e,n,r,i){let a=new Uint8Array(2*Ne);this.bcEncrypt(a.subarray(0,16),n,r[0],i.subarray(0,16)),this.bcEncrypt(a.subarray(16,32),n,r[1],i.subarray(16,32)),Li(e,e,a.subarray(0,16),Ne),Li(e,e,a.subarray(16,32),Ne)}}function zr(t,e,n){t.set(new Uint8Array(12)),new DataView(t.buffer).setUint32(12+t.byteOffset,n,!1),t[0]=e<=2*Ne;s+=2)zr(o[0],Rd,s),zr(o[1],Rd,s+1),t.bcTagx2(u,e,o,i.subarray(s*Ne,(s+2)*Ne)),c-=2*Ne;for(;c>=Ne;s++)zr(o[0],Rd,s),t.bcTagx1(u,e,o[0],i.subarray(s*Ne,(s+1)*Ne)),c-=Ne;if(c>0){zr(o[0],tF,s);let g=new Uint8Array(Ne);g.set(i.subarray(i.length-c)),g[c]=128,t.bcTagx1(u,e,o[0],g)}let f=a.length;for(l=0;f>=2*Ne;l+=2)zr(o[0],Md,l),zr(o[1],Md,l+1),t.bcTagx2(u,e,o,a.subarray(l*Ne,(l+2)*Ne)),f-=2*Ne;for(;f>=Ne;l++)zr(o[0],Md,l),t.bcTagx1(u,e,o[0],a.subarray(l*Ne,(l+1)*Ne)),f-=Ne;if(f>0){zr(o[0],nF,l);let g=new Uint8Array(Ne);g.set(a.subarray(a.length-f)),g[f]=128,t.bcTagx1(u,e,o[0],g)}let h=new Uint8Array(Ne);h.set(n,1),h[0]=rF<=2*Ne;l+=2)Lc(o[0],u,l),Lc(o[1],u,l+1),t.bcKeystreamx2(d,e,o,h),Li(r.subarray(l*Ne,(l+2)*Ne),a.subarray(l*Ne,(l+2)*Ne),d,2*Ne),f-=2*Ne;for(;f>=Ne;l++)Lc(o[0],u,l),t.bcEncrypt(d,e,o[0],h),Li(r.subarray(l*Ne,(l+1)*Ne),a.subarray(l*Ne,(l+1)*Ne),d,Ne),f-=Ne;f>0&&(Lc(o[0],u,l),t.bcEncrypt(d,e,o[0],h),Li(r.subarray(l*Ne,a.length),a.subarray(l*Ne),d,f)),r.set(u,a.length)}function lae(t,e,n,r,i,a){let o=a.length-Hf;const s=a.subarray(0,o),l=a.subarray(o);let c=0,u=q3(),f=new Uint8Array(Ne);f.set(n,1);let h=new Uint8Array(2*Ne);for(c=0;o>=2*Ne;c+=2)Lc(u[0],l,c),Lc(u[1],l,c+1),t.bcKeystreamx2(h,e,u,f),Li(r.subarray(c*Ne,(c+2)*Ne),s.subarray(c*Ne,(c+2)*Ne),h,2*Ne),o-=2*Ne;for(;o>=Ne;c++)Lc(u[0],l,c),t.bcEncrypt(h,e,u[0],f),Li(r.subarray(c*Ne,(c+1)*Ne),s.subarray(c*Ne,(c+1)*Ne),h,Ne),o-=Ne;o>0&&(Lc(u[0],l,c),t.bcEncrypt(h,e,u[0],f),Li(r.subarray(c*Ne),s.subarray(c*Ne),h,o));let d=0,g=i.length,p=q3(),m=new Uint8Array(Hf);for(d=0;g>=2*Ne;d+=2)zr(p[0],Rd,d),zr(p[1],Rd,d+1),t.bcTagx2(m,e,p,i.subarray(d*Ne,(d+2)*Ne)),g-=2*Ne;for(;g>=Ne;d++)zr(p[0],Rd,d),t.bcTagx1(m,e,p[0],i.subarray(d*Ne,(d+1)*Ne)),g-=Ne;if(g>0){zr(p[0],tF,d);let x=new Uint8Array(Ne);x.set(i.subarray(i.length-g)),x[g]=128,t.bcTagx1(m,e,p[0],x)}let y=r.length;for(c=0;y>=2*Ne;c+=2)zr(p[0],Md,c),zr(p[1],Md,c+1),t.bcTagx2(m,e,p,r.subarray(c*Ne,(c+2)*Ne)),y-=2*Ne;for(;y>=Ne;c++)zr(p[0],Md,c),t.bcTagx1(m,e,p[0],r.subarray(c*Ne,(c+1)*Ne)),y-=Ne;if(y>0){zr(p[0],nF,c);let x=new Uint8Array(Ne);x.set(r.subarray(r.length-y)),x[y]=128,t.bcTagx1(m,e,p[0],x)}if(f[0]=rF<>24&255,P[k+1]=_>>16&255,P[k+2]=_>>8&255,P[k+3]=_&255,P[k+4]=w>>24&255,P[k+5]=w>>16&255,P[k+6]=w>>8&255,P[k+7]=w&255}function p(P,k,_,w,I){var z,W=0;for(z=0;z>>8)-1}function m(P,k,_,w){return p(P,k,_,w,16)}function y(P,k,_,w){return p(P,k,_,w,32)}function v(P,k,_,w){for(var I=w[0]&255|(w[1]&255)<<8|(w[2]&255)<<16|(w[3]&255)<<24,z=_[0]&255|(_[1]&255)<<8|(_[2]&255)<<16|(_[3]&255)<<24,W=_[4]&255|(_[5]&255)<<8|(_[6]&255)<<16|(_[7]&255)<<24,ce=_[8]&255|(_[9]&255)<<8|(_[10]&255)<<16|(_[11]&255)<<24,ve=_[12]&255|(_[13]&255)<<8|(_[14]&255)<<16|(_[15]&255)<<24,Le=w[4]&255|(w[5]&255)<<8|(w[6]&255)<<16|(w[7]&255)<<24,Te=k[0]&255|(k[1]&255)<<8|(k[2]&255)<<16|(k[3]&255)<<24,Rt=k[4]&255|(k[5]&255)<<8|(k[6]&255)<<16|(k[7]&255)<<24,Re=k[8]&255|(k[9]&255)<<8|(k[10]&255)<<16|(k[11]&255)<<24,ft=k[12]&255|(k[13]&255)<<8|(k[14]&255)<<16|(k[15]&255)<<24,at=w[8]&255|(w[9]&255)<<8|(w[10]&255)<<16|(w[11]&255)<<24,vt=_[16]&255|(_[17]&255)<<8|(_[18]&255)<<16|(_[19]&255)<<24,ke=_[20]&255|(_[21]&255)<<8|(_[22]&255)<<16|(_[23]&255)<<24,_e=_[24]&255|(_[25]&255)<<8|(_[26]&255)<<16|(_[27]&255)<<24,Xe=_[28]&255|(_[29]&255)<<8|(_[30]&255)<<16|(_[31]&255)<<24,ht=w[12]&255|(w[13]&255)<<8|(w[14]&255)<<16|(w[15]&255)<<24,Fe=I,tt=z,Be=W,He=ce,Je=ve,Me=Le,ae=Te,oe=Rt,ge=Re,ue=ft,fe=at,be=vt,ct=ke,At=_e,St=Xe,Ot=ht,$,Mt=0;Mt<20;Mt+=2)$=Fe+ct|0,Je^=$<<7|$>>>25,$=Je+Fe|0,ge^=$<<9|$>>>23,$=ge+Je|0,ct^=$<<13|$>>>19,$=ct+ge|0,Fe^=$<<18|$>>>14,$=Me+tt|0,ue^=$<<7|$>>>25,$=ue+Me|0,At^=$<<9|$>>>23,$=At+ue|0,tt^=$<<13|$>>>19,$=tt+At|0,Me^=$<<18|$>>>14,$=fe+ae|0,St^=$<<7|$>>>25,$=St+fe|0,Be^=$<<9|$>>>23,$=Be+St|0,ae^=$<<13|$>>>19,$=ae+Be|0,fe^=$<<18|$>>>14,$=Ot+be|0,He^=$<<7|$>>>25,$=He+Ot|0,oe^=$<<9|$>>>23,$=oe+He|0,be^=$<<13|$>>>19,$=be+oe|0,Ot^=$<<18|$>>>14,$=Fe+He|0,tt^=$<<7|$>>>25,$=tt+Fe|0,Be^=$<<9|$>>>23,$=Be+tt|0,He^=$<<13|$>>>19,$=He+Be|0,Fe^=$<<18|$>>>14,$=Me+Je|0,ae^=$<<7|$>>>25,$=ae+Me|0,oe^=$<<9|$>>>23,$=oe+ae|0,Je^=$<<13|$>>>19,$=Je+oe|0,Me^=$<<18|$>>>14,$=fe+ue|0,be^=$<<7|$>>>25,$=be+fe|0,ge^=$<<9|$>>>23,$=ge+be|0,ue^=$<<13|$>>>19,$=ue+ge|0,fe^=$<<18|$>>>14,$=Ot+St|0,ct^=$<<7|$>>>25,$=ct+Ot|0,At^=$<<9|$>>>23,$=At+ct|0,St^=$<<13|$>>>19,$=St+At|0,Ot^=$<<18|$>>>14;Fe=Fe+I|0,tt=tt+z|0,Be=Be+W|0,He=He+ce|0,Je=Je+ve|0,Me=Me+Le|0,ae=ae+Te|0,oe=oe+Rt|0,ge=ge+Re|0,ue=ue+ft|0,fe=fe+at|0,be=be+vt|0,ct=ct+ke|0,At=At+_e|0,St=St+Xe|0,Ot=Ot+ht|0,P[0]=Fe>>>0&255,P[1]=Fe>>>8&255,P[2]=Fe>>>16&255,P[3]=Fe>>>24&255,P[4]=tt>>>0&255,P[5]=tt>>>8&255,P[6]=tt>>>16&255,P[7]=tt>>>24&255,P[8]=Be>>>0&255,P[9]=Be>>>8&255,P[10]=Be>>>16&255,P[11]=Be>>>24&255,P[12]=He>>>0&255,P[13]=He>>>8&255,P[14]=He>>>16&255,P[15]=He>>>24&255,P[16]=Je>>>0&255,P[17]=Je>>>8&255,P[18]=Je>>>16&255,P[19]=Je>>>24&255,P[20]=Me>>>0&255,P[21]=Me>>>8&255,P[22]=Me>>>16&255,P[23]=Me>>>24&255,P[24]=ae>>>0&255,P[25]=ae>>>8&255,P[26]=ae>>>16&255,P[27]=ae>>>24&255,P[28]=oe>>>0&255,P[29]=oe>>>8&255,P[30]=oe>>>16&255,P[31]=oe>>>24&255,P[32]=ge>>>0&255,P[33]=ge>>>8&255,P[34]=ge>>>16&255,P[35]=ge>>>24&255,P[36]=ue>>>0&255,P[37]=ue>>>8&255,P[38]=ue>>>16&255,P[39]=ue>>>24&255,P[40]=fe>>>0&255,P[41]=fe>>>8&255,P[42]=fe>>>16&255,P[43]=fe>>>24&255,P[44]=be>>>0&255,P[45]=be>>>8&255,P[46]=be>>>16&255,P[47]=be>>>24&255,P[48]=ct>>>0&255,P[49]=ct>>>8&255,P[50]=ct>>>16&255,P[51]=ct>>>24&255,P[52]=At>>>0&255,P[53]=At>>>8&255,P[54]=At>>>16&255,P[55]=At>>>24&255,P[56]=St>>>0&255,P[57]=St>>>8&255,P[58]=St>>>16&255,P[59]=St>>>24&255,P[60]=Ot>>>0&255,P[61]=Ot>>>8&255,P[62]=Ot>>>16&255,P[63]=Ot>>>24&255}function x(P,k,_,w){for(var I=w[0]&255|(w[1]&255)<<8|(w[2]&255)<<16|(w[3]&255)<<24,z=_[0]&255|(_[1]&255)<<8|(_[2]&255)<<16|(_[3]&255)<<24,W=_[4]&255|(_[5]&255)<<8|(_[6]&255)<<16|(_[7]&255)<<24,ce=_[8]&255|(_[9]&255)<<8|(_[10]&255)<<16|(_[11]&255)<<24,ve=_[12]&255|(_[13]&255)<<8|(_[14]&255)<<16|(_[15]&255)<<24,Le=w[4]&255|(w[5]&255)<<8|(w[6]&255)<<16|(w[7]&255)<<24,Te=k[0]&255|(k[1]&255)<<8|(k[2]&255)<<16|(k[3]&255)<<24,Rt=k[4]&255|(k[5]&255)<<8|(k[6]&255)<<16|(k[7]&255)<<24,Re=k[8]&255|(k[9]&255)<<8|(k[10]&255)<<16|(k[11]&255)<<24,ft=k[12]&255|(k[13]&255)<<8|(k[14]&255)<<16|(k[15]&255)<<24,at=w[8]&255|(w[9]&255)<<8|(w[10]&255)<<16|(w[11]&255)<<24,vt=_[16]&255|(_[17]&255)<<8|(_[18]&255)<<16|(_[19]&255)<<24,ke=_[20]&255|(_[21]&255)<<8|(_[22]&255)<<16|(_[23]&255)<<24,_e=_[24]&255|(_[25]&255)<<8|(_[26]&255)<<16|(_[27]&255)<<24,Xe=_[28]&255|(_[29]&255)<<8|(_[30]&255)<<16|(_[31]&255)<<24,ht=w[12]&255|(w[13]&255)<<8|(w[14]&255)<<16|(w[15]&255)<<24,Fe=I,tt=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9]=fe>>>8&255,P[10]=fe>>>16&255,P[11]=fe>>>24&255,P[12]=Ot>>>0&255,P[13]=Ot>>>8&255,P[14]=Ot>>>16&255,P[15]=Ot>>>24&255,P[16]=ae>>>0&255,P[17]=ae>>>8&255,P[18]=ae>>>16&255,P[19]=ae>>>24&255,P[20]=oe>>>0&255,P[21]=oe>>>8&255,P[22]=oe>>>16&255,P[23]=oe>>>24&255,P[24]=ge>>>0&255,P[25]=ge>>>8&255,P[26]=ge>>>16&255,P[27]=ge>>>24&255,P[28]=ue>>>0&255,P[29]=ue>>>8&255,P[30]=ue>>>16&255,P[31]=ue>>>24&255}function A(P,k,_,w){v(P,k,_,w)}function S(P,k,_,w){x(P,k,_,w)}var E=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function T(P,k,_,w,I,z,W){var ce=new Uint8Array(16),ve=new Uint8Array(64),Le,Te;for(Te=0;Te<16;Te++)ce[Te]=0;for(Te=0;Te<8;Te++)ce[Te]=z[Te];for(;I>=64;){for(A(ve,ce,W,E),Te=0;Te<64;Te++)P[k+Te]=_[w+Te]^ve[Te];for(Le=1,Te=8;Te<16;Te++)Le=Le+(ce[Te]&255)|0,ce[Te]=Le&255,Le>>>=8;I-=64,k+=64,w+=64}if(I>0)for(A(ve,ce,W,E),Te=0;Te=64;){for(A(W,z,I,E),ve=0;ve<64;ve++)P[k+ve]=W[ve];for(ce=1,ve=8;ve<16;ve++)ce=ce+(z[ve]&255)|0,z[ve]=ce&255,ce>>>=8;_-=64,k+=64}if(_>0)for(A(W,z,I,E),ve=0;ve<_;ve++)P[k+ve]=W[ve];return 0}function N(P,k,_,w,I){var z=new Uint8Array(32);S(z,w,I,E);for(var W=new Uint8Array(8),ce=0;ce<8;ce++)W[ce]=w[ce+16];return C(P,k,_,W,z)}function B(P,k,_,w,I,z,W){var ce=new Uint8Array(32);S(ce,z,W,E);for(var ve=new Uint8Array(8),Le=0;Le<8;Le++)ve[Le]=z[Le+16];return T(P,k,_,w,I,ve,ce)}var L=function(P){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var k,_,w,I,z,W,ce,ve;k=P[0]&255|(P[1]&255)<<8,this.r[0]=k&8191,_=P[2]&255|(P[3]&255)<<8,this.r[1]=(k>>>13|_<<3)&8191,w=P[4]&255|(P[5]&255)<<8,this.r[2]=(_>>>10|w<<6)&7939,I=P[6]&255|(P[7]&255)<<8,this.r[3]=(w>>>7|I<<9)&8191,z=P[8]&255|(P[9]&255)<<8,this.r[4]=(I>>>4|z<<12)&255,this.r[5]=z>>>1&8190,W=P[10]&255|(P[11]&255)<<8,this.r[6]=(z>>>14|W<<2)&8191,ce=P[12]&255|(P[13]&255)<<8,this.r[7]=(W>>>11|ce<<5)&8065,ve=P[14]&255|(P[15]&255)<<8,this.r[8]=(ce>>>8|ve<<8)&8191,this.r[9]=ve>>>5&127,this.pad[0]=P[16]&255|(P[17]&255)<<8,this.pad[1]=P[18]&255|(P[19]&255)<<8,this.pad[2]=P[20]&255|(P[21]&255)<<8,this.pad[3]=P[22]&255|(P[23]&255)<<8,this.pad[4]=P[24]&255|(P[25]&255)<<8,this.pad[5]=P[26]&255|(P[27]&255)<<8,this.pad[6]=P[28]&255|(P[29]&255)<<8,this.pad[7]=P[30]&255|(P[31]&255)<<8};L.prototype.blocks=function(P,k,_){for(var w=this.fin?0:2048,I,z,W,ce,ve,Le,Te,Rt,Re,ft,at,vt,ke,_e,Xe,ht,Fe,tt,Be,He=this.h[0],Je=this.h[1],Me=this.h[2],ae=this.h[3],oe=this.h[4],ge=this.h[5],ue=this.h[6],fe=this.h[7],be=this.h[8],ct=this.h[9],At=this.r[0],St=this.r[1],Ot=this.r[2],$=this.r[3],Mt=this.r[4],Ht=this.r[5],Gt=this.r[6],_t=this.r[7],jt=this.r[8],zt=this.r[9];_>=16;)I=P[k+0]&255|(P[k+1]&255)<<8,He+=I&8191,z=P[k+2]&255|(P[k+3]&255)<<8,Je+=(I>>>13|z<<3)&8191,W=P[k+4]&255|(P[k+5]&255)<<8,Me+=(z>>>10|W<<6)&8191,ce=P[k+6]&255|(P[k+7]&255)<<8,ae+=(W>>>7|ce<<9)&8191,ve=P[k+8]&255|(P[k+9]&255)<<8,oe+=(ce>>>4|ve<<12)&8191,ge+=ve>>>1&8191,Le=P[k+10]&255|(P[k+11]&255)<<8,ue+=(ve>>>14|Le<<2)&8191,Te=P[k+12]&255|(P[k+13]&255)<<8,fe+=(Le>>>11|Te<<5)&8191,Rt=P[k+14]&255|(P[k+15]&255)<<8,be+=(Te>>>8|Rt<<8)&8191,ct+=Rt>>>5|w,Re=0,ft=Re,ft+=He*At,ft+=Je*(5*zt),ft+=Me*(5*jt),ft+=ae*(5*_t),ft+=oe*(5*Gt),Re=ft>>>13,ft&=8191,ft+=ge*(5*Ht),ft+=ue*(5*Mt),ft+=fe*(5*$),ft+=be*(5*Ot),ft+=ct*(5*St),Re+=ft>>>13,ft&=8191,at=Re,at+=He*St,at+=Je*At,at+=Me*(5*zt),at+=ae*(5*jt),at+=oe*(5*_t),Re=at>>>13,at&=8191,at+=ge*(5*Gt),at+=ue*(5*Ht),at+=fe*(5*Mt),at+=be*(5*$),at+=ct*(5*Ot),Re+=at>>>13,at&=8191,vt=Re,vt+=He*Ot,vt+=Je*St,vt+=Me*At,vt+=ae*(5*zt),vt+=oe*(5*jt),Re=vt>>>13,vt&=8191,vt+=ge*(5*_t),vt+=ue*(5*Gt),vt+=fe*(5*Ht),vt+=be*(5*Mt),vt+=ct*(5*$),Re+=vt>>>13,vt&=8191,ke=Re,ke+=He*$,ke+=Je*Ot,ke+=Me*St,ke+=ae*At,ke+=oe*(5*zt),Re=ke>>>13,ke&=8191,ke+=ge*(5*jt),ke+=ue*(5*_t),ke+=fe*(5*Gt),ke+=be*(5*Ht),ke+=ct*(5*Mt),Re+=ke>>>13,ke&=8191,_e=Re,_e+=He*Mt,_e+=Je*$,_e+=Me*Ot,_e+=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,this.h[3]=ae,this.h[4]=oe,this.h[5]=ge,this.h[6]=ue,this.h[7]=fe,this.h[8]=be,this.h[9]=ct},L.prototype.finish=function(P,k){var _=new Uint16Array(10),w,I,z,W;if(this.leftover){for(W=this.leftover,this.buffer[W++]=1;W<16;W++)this.buffer[W]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(w=this.h[1]>>>13,this.h[1]&=8191,W=2;W<10;W++)this.h[W]+=w,w=this.h[W]>>>13,this.h[W]&=8191;for(this.h[0]+=w*5,w=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=w,w=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=w,_[0]=this.h[0]+5,w=_[0]>>>13,_[0]&=8191,W=1;W<10;W++)_[W]=this.h[W]+w,w=_[W]>>>13,_[W]&=8191;for(_[9]-=8192,I=(w^1)-1,W=0;W<10;W++)_[W]&=I;for(I=~I,W=0;W<10;W++)this.h[W]=this.h[W]&I|_[W];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,z=this.h[0]+this.pad[0],this.h[0]=z&65535,W=1;W<8;W++)z=(this.h[W]+this.pad[W]|0)+(z>>>16)|0,this.h[W]=z&65535;P[k+0]=this.h[0]>>>0&255,P[k+1]=this.h[0]>>>8&255,P[k+2]=this.h[1]>>>0&255,P[k+3]=this.h[1]>>>8&255,P[k+4]=this.h[2]>>>0&255,P[k+5]=this.h[2]>>>8&255,P[k+6]=this.h[3]>>>0&255,P[k+7]=this.h[3]>>>8&255,P[k+8]=this.h[4]>>>0&255,P[k+9]=this.h[4]>>>8&255,P[k+10]=this.h[5]>>>0&255,P[k+11]=this.h[5]>>>8&255,P[k+12]=this.h[6]>>>0&255,P[k+13]=this.h[6]>>>8&255,P[k+14]=this.h[7]>>>0&255,P[k+15]=this.h[7]>>>8&255},L.prototype.update=function(P,k,_){var w,I;if(this.leftover){for(I=16-this.leftover,I>_&&(I=_),w=0;w=16&&(I=_-_%16,this.blocks(P,k,I),k+=I,_-=I),_){for(w=0;w<_;w++)this.buffer[this.leftover+w]=P[k+w];this.leftover+=_}};function U(P,k,_,w,I,z){var W=new L(z);return W.update(_,w,I),W.finish(P,k),0}function j(P,k,_,w,I,z){var W=new Uint8Array(16);return U(W,0,_,w,I,z),m(P,k,W,0)}function Z(P,k,_,w,I){var z;if(_<32)return-1;for(B(P,0,k,0,_,w,I),U(P,16,P,32,_-32,P),z=0;z<16;z++)P[z]=0;return 0}function G(P,k,_,w,I){var z,W=new Uint8Array(32);if(_<32||(N(W,0,32,w,I),j(k,16,k,32,_-32,W)!==0))return-1;for(B(P,0,k,0,_,w,I),z=0;z<32;z++)P[z]=0;return 0}function H(P,k){var _;for(_=0;_<16;_++)P[_]=k[_]|0}function re(P){var k,_,w=1;for(k=0;k<16;k++)_=P[k]+w+65535,w=Math.floor(_/65536),P[k]=_-w*65536;P[0]+=w-1+37*(w-1)}function V(P,k,_){for(var w,I=~(_-1),z=0;z<16;z++)w=I&(P[z]^k[z]),P[z]^=w,k[z]^=w}function ee(P,k){var _,w,I,z=n(),W=n();for(_=0;_<16;_++)W[_]=k[_];for(re(W),re(W),re(W),w=0;w<2;w++){for(z[0]=W[0]-65517,_=1;_<15;_++)z[_]=W[_]-65535-(z[_-1]>>16&1),z[_-1]&=65535;z[15]=W[15]-32767-(z[14]>>16&1),I=z[15]>>16&1,z[14]&=65535,V(W,z,1-I)}for(_=0;_<16;_++)P[2*_]=W[_]&255,P[2*_+1]=W[_]>>8}function pe(P,k){var _=new Uint8Array(32),w=new Uint8Array(32);return ee(_,P),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fe,vt+=38*be,ke+=38*ct,_e+=38*At,Xe+=38*St,ht+=38*Ot,I=1,w=z+I+65535,I=Math.floor(w/65536),z=w-I*65536,w=W+I+65535,I=Math.floor(w/65536),W=w-I*65536,w=ce+I+65535,I=Math.floor(w/65536),ce=w-I*65536,w=ve+I+65535,I=Math.floor(w/65536),ve=w-I*65536,w=Le+I+65535,I=Math.floor(w/65536),Le=w-I*65536,w=Te+I+65535,I=Math.floor(w/65536),Te=w-I*65536,w=Rt+I+65535,I=Math.floor(w/65536),Rt=w-I*65536,w=Re+I+65535,I=Math.floor(w/65536),Re=w-I*65536,w=ft+I+65535,I=Math.floor(w/65536),ft=w-I*65536,w=at+I+65535,I=Math.floor(w/65536),at=w-I*65536,w=vt+I+65535,I=Math.floor(w/65536),vt=w-I*65536,w=ke+I+65535,I=Math.floor(w/65536),ke=w-I*65536,w=_e+I+65535,I=Math.floor(w/65536),_e=w-I*65536,w=Xe+I+65535,I=Math.floor(w/65536),Xe=w-I*65536,w=ht+I+65535,I=Math.floor(w/65536),ht=w-I*65536,w=Fe+I+65535,I=Math.floor(w/65536),Fe=w-I*65536,z+=I-1+37*(I-1),I=1,w=z+I+65535,I=Math.floor(w/65536),z=w-I*65536,w=W+I+65535,I=Math.floor(w/65536),W=w-I*65536,w=ce+I+65535,I=Math.floor(w/65536),ce=w-I*65536,w=ve+I+65535,I=Math.floor(w/65536),ve=w-I*65536,w=Le+I+65535,I=Math.floor(w/65536),Le=w-I*65536,w=Te+I+65535,I=Math.floor(w/65536),Te=w-I*65536,w=Rt+I+65535,I=Math.floor(w/65536),Rt=w-I*65536,w=Re+I+65535,I=Math.floor(w/65536),Re=w-I*65536,w=ft+I+65535,I=Math.floor(w/65536),ft=w-I*65536,w=at+I+65535,I=Math.floor(w/65536),at=w-I*65536,w=vt+I+65535,I=Math.floor(w/65536),vt=w-I*65536,w=ke+I+65535,I=Math.floor(w/65536),ke=w-I*65536,w=_e+I+65535,I=Math.floor(w/65536),_e=w-I*65536,w=Xe+I+65535,I=Math.floor(w/65536),Xe=w-I*65536,w=ht+I+65535,I=Math.floor(w/65536),ht=w-I*65536,w=Fe+I+65535,I=Math.floor(w/65536),Fe=w-I*65536,z+=I-1+37*(I-1),P[0]=z,P[1]=W,P[2]=ce,P[3]=ve,P[4]=Le,P[5]=Te,P[6]=Rt,P[7]=Re,P[8]=ft,P[9]=at,P[10]=vt,P[11]=ke,P[12]=_e,P[13]=Xe,P[14]=ht,P[15]=Fe}function st(P,k){De(P,k,k)}function Tt(P,k){var _=n(),w;for(w=0;w<16;w++)_[w]=k[w];for(w=253;w>=0;w--)st(_,_),w!==2&&w!==4&&De(_,_,k);for(w=0;w<16;w++)P[w]=_[w]}function ln(P,k){var _=n(),w;for(w=0;w<16;w++)_[w]=k[w];for(w=250;w>=0;w--)st(_,_),w!==1&&De(_,_,k);for(w=0;w<16;w++)P[w]=_[w]}function Ee(P,k,_){var w=new Uint8Array(32),I=new Float64Array(80),z,W,ce=n(),ve=n(),Le=n(),Te=n(),Rt=n(),Re=n();for(W=0;W<31;W++)w[W]=k[W];for(w[31]=k[31]&127|64,w[0]&=248,we(I,_),W=0;W<16;W++)ve[W]=I[W],Te[W]=ce[W]=Le[W]=0;for(ce[0]=Te[0]=1,W=254;W>=0;--W)z=w[W>>>3]>>>(W&7)&1,V(ce,ve,z),V(Le,Te,z),Ye(Rt,ce,Le),nt(ce,ce,Le),Ye(Le,ve,Te),nt(ve,ve,Te),st(Te,Rt),st(Re,ce),De(ce,Le,ce),De(Le,ve,Rt),Ye(Rt,ce,Le),nt(ce,ce,Le),st(ve,ce),nt(Le,Te,Re),De(ce,Le,l),Ye(ce,ce,Te),De(Le,Le,ce),De(ce,Te,Re),De(Te,ve,I),st(ve,Rt),V(ce,ve,z),V(Le,Te,z);for(W=0;W<16;W++)I[W+16]=ce[W],I[W+32]=Le[W],I[W+48]=ve[W],I[W+64]=Te[W];var ft=I.subarray(32),at=I.subarray(16);return Tt(ft,ft),De(at,at,ft),ee(P,at),0}function ne(P,k){return Ee(P,k,a)}function le(P,k){return r(k,32),ne(P,k)}function te(P,k,_){var w=new Uint8Array(32);return Ee(w,_,k),S(P,i,w,E)}var Ce=Z,Se=G;function ze(P,k,_,w,I,z){var W=new Uint8Array(32);return te(W,I,z),Ce(P,k,_,w,W)}function $e(P,k,_,w,I,z){var W=new Uint8Array(32);return te(W,I,z),Se(P,k,_,w,W)}var rt=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function dt(P,k,_,w){for(var I=new Int32Array(16),z=new Int32Array(16),W,ce,ve,Le,Te,Rt,Re,ft,at,vt,ke,_e,Xe,ht,Fe,tt,Be,He,Je,Me,ae,oe,ge,ue,fe,be,ct=P[0],At=P[1],St=P[2],Ot=P[3],$=P[4],Mt=P[5],Ht=P[6],Gt=P[7],_t=k[0],jt=k[1],zt=k[2],Vn=k[3],an=k[4],Bn=k[5],Dn=k[6],Ln=k[7],rr=0;w>=128;){for(Je=0;Je<16;Je++)Me=8*Je+rr,I[Je]=_[Me+0]<<24|_[Me+1]<<16|_[Me+2]<<8|_[Me+3],z[Je]=_[Me+4]<<24|_[Me+5]<<16|_[Me+6]<<8|_[Me+7];for(Je=0;Je<80;Je++)if(W=ct,ce=At,ve=St,Le=Ot,Te=$,Rt=Mt,Re=Ht,ft=Gt,at=_t,vt=jt,ke=zt,_e=Vn,Xe=an,ht=Bn,Fe=Dn,tt=Ln,ae=Gt,oe=Ln,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=($>>>14|an<<18)^($>>>18|an<<14)^(an>>>9|$<<23),oe=(an>>>14|$<<18)^(an>>>18|$<<14)^($>>>9|an<<23),ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ae=$&Mt^~$&Ht,oe=an&Bn^~an&Dn,ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ae=rt[Je*2],oe=rt[Je*2+1],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ae=I[Je%16],oe=z[Je%16],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,Be=fe&65535|be<<16,He=ge&65535|ue<<16,ae=Be,oe=He,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=(ct>>>28|_t<<4)^(_t>>>2|ct<<30)^(_t>>>7|ct<<25),oe=(_t>>>28|ct<<4)^(ct>>>2|_t<<30)^(ct>>>7|_t<<25),ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ae=ct&At^ct&St^At&St,oe=_t&jt^_t&zt^jt&zt,ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,ft=fe&65535|be<<16,tt=ge&65535|ue<<16,ae=Le,oe=_e,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=Be,oe=He,ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,Le=fe&65535|be<<16,_e=ge&65535|ue<<16,At=W,St=ce,Ot=ve,$=Le,Mt=Te,Ht=Rt,Gt=Re,ct=ft,jt=at,zt=vt,Vn=ke,an=_e,Bn=Xe,Dn=ht,Ln=Fe,_t=tt,Je%16===15)for(Me=0;Me<16;Me++)ae=I[Me],oe=z[Me],ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=I[(Me+9)%16],oe=z[(Me+9)%16],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,Be=I[(Me+1)%16],He=z[(Me+1)%16],ae=(Be>>>1|He<<31)^(Be>>>8|He<<24)^Be>>>7,oe=(He>>>1|Be<<31)^(He>>>8|Be<<24)^(He>>>7|Be<<25),ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,Be=I[(Me+14)%16],He=z[(Me+14)%16],ae=(Be>>>19|He<<13)^(He>>>29|Be<<3)^Be>>>6,oe=(He>>>19|Be<<13)^(Be>>>29|He<<3)^(He>>>6|Be<<26),ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,I[Me]=fe&65535|be<<16,z[Me]=ge&65535|ue<<16;ae=ct,oe=_t,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[0],oe=k[0],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[0]=ct=fe&65535|be<<16,k[0]=_t=ge&65535|ue<<16,ae=At,oe=jt,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[1],oe=k[1],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[1]=At=fe&65535|be<<16,k[1]=jt=ge&65535|ue<<16,ae=St,oe=zt,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[2],oe=k[2],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[2]=St=fe&65535|be<<16,k[2]=zt=ge&65535|ue<<16,ae=Ot,oe=Vn,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[3],oe=k[3],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[3]=Ot=fe&65535|be<<16,k[3]=Vn=ge&65535|ue<<16,ae=$,oe=an,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[4],oe=k[4],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[4]=$=fe&65535|be<<16,k[4]=an=ge&65535|ue<<16,ae=Mt,oe=Bn,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[5],oe=k[5],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[5]=Mt=fe&65535|be<<16,k[5]=Bn=ge&65535|ue<<16,ae=Ht,oe=Dn,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[6],oe=k[6],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[6]=Ht=fe&65535|be<<16,k[6]=Dn=ge&65535|ue<<16,ae=Gt,oe=Ln,ge=oe&65535,ue=oe>>>16,fe=ae&65535,be=ae>>>16,ae=P[7],oe=k[7],ge+=oe&65535,ue+=oe>>>16,fe+=ae&65535,be+=ae>>>16,ue+=ge>>>16,fe+=ue>>>16,be+=fe>>>16,P[7]=Gt=fe&65535|be<<16,k[7]=Ln=ge&65535|ue<<16,rr+=128,w-=128}return w}function wt(P,k,_){var w=new Int32Array(8),I=new Int32Array(8),z=new Uint8Array(256),W,ce=_;for(w[0]=1779033703,w[1]=3144134277,w[2]=1013904242,w[3]=2773480762,w[4]=1359893119,w[5]=2600822924,w[6]=528734635,w[7]=1541459225,I[0]=4089235720,I[1]=2227873595,I[2]=4271175723,I[3]=1595750129,I[4]=2917565137,I[5]=725511199,I[6]=4215389547,I[7]=327033209,dt(w,I,k,_),_%=128,W=0;W<_;W++)z[W]=k[ce-_+W];for(z[_]=128,_=256-128*(_<112?1:0),z[_-9]=0,g(z,_-8,ce/536870912|0,ce<<3),dt(w,I,z,_),W=0;W<8;W++)g(P,8*W,w[W],I[W]);return 0}function yt(P,k){var _=n(),w=n(),I=n(),z=n(),W=n(),ce=n(),ve=n(),Le=n(),Te=n();nt(_,P[1],P[0]),nt(Te,k[1],k[0]),De(_,_,Te),Ye(w,P[0],P[1]),Ye(Te,k[0],k[1]),De(w,w,Te),De(I,P[3],k[3]),De(I,I,u),De(z,P[2],k[2]),Ye(z,z,z),nt(W,w,_),nt(ce,z,I),Ye(ve,z,I),Ye(Le,w,_),De(P[0],W,ce),De(P[1],Le,ve),De(P[2],ve,ce),De(P[3],W,Le)}function Pe(P,k,_){var w;for(w=0;w<4;w++)V(P[w],k[w],_)}function nn(P,k){var _=n(),w=n(),I=n();Tt(I,k[2]),De(_,k[0],I),De(w,k[1],I),ee(P,w),P[31]^=Ae(_)<<7}function cn(P,k,_){var w,I;for(H(P[0],o),H(P[1],s),H(P[2],s),H(P[3],o),I=255;I>=0;--I)w=_[I/8|0]>>(I&7)&1,Pe(P,k,w),yt(k,P),yt(P,P),Pe(P,k,w)}function Gn(P,k){var _=[n(),n(),n(),n()];H(_[0],f),H(_[1],h),H(_[2],s),De(_[3],f,h),cn(P,_,k)}function Wa(P,k,_){var w=new Uint8Array(64),I=[n(),n(),n(),n()],z;for(_||r(k,32),wt(w,k,32),w[0]&=248,w[31]&=127,w[31]|=64,Gn(I,w),nn(P,I),z=0;z<32;z++)k[z+32]=P[z];return 0}var ms=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Yr(P,k){var _,w,I,z;for(w=63;w>=32;--w){for(_=0,I=w-32,z=w-12;I>4)*ms[I],_=k[I]>>8,k[I]&=255;for(I=0;I<32;I++)k[I]-=_*ms[I];for(w=0;w<32;w++)k[w+1]+=k[w]>>8,P[w]=k[w]&255}function du(P){var k=new Float64Array(64),_;for(_=0;_<64;_++)k[_]=P[_];for(_=0;_<64;_++)P[_]=0;Yr(P,k)}function ji(P,k,_,w){var I=new Uint8Array(64),z=new Uint8Array(64),W=new Uint8Array(64),ce,ve,Le=new Float64Array(64),Te=[n(),n(),n(),n()];wt(I,w,32),I[0]&=248,I[31]&=127,I[31]|=64;var Rt=_+64;for(ce=0;ce<_;ce++)P[64+ce]=k[ce];for(ce=0;ce<32;ce++)P[32+ce]=I[32+ce];for(wt(W,P.subarray(32),_+32),du(W),Gn(Te,W),nn(P,Te),ce=32;ce<64;ce++)P[ce]=w[ce];for(wt(z,P,_+64),du(z),ce=0;ce<64;ce++)Le[ce]=0;for(ce=0;ce<32;ce++)Le[ce]=W[ce];for(ce=0;ce<32;ce++)for(ve=0;ve<32;ve++)Le[ce+ve]+=z[ce]*I[ve];return Yr(P.subarray(32),Le),Rt}function pu(P,k){var _=n(),w=n(),I=n(),z=n(),W=n(),ce=n(),ve=n();return H(P[2],s),we(P[1],k),st(I,P[1]),De(z,I,c),nt(I,I,P[2]),Ye(z,P[2],z),st(W,z),st(ce,W),De(ve,ce,W),De(_,ve,I),De(_,_,z),ln(_,_),De(_,_,I),De(_,_,z),De(_,_,z),De(P[0],_,z),st(w,P[0]),De(w,w,z),pe(w,I)&&De(P[0],P[0],d),st(w,P[0]),De(w,w,z),pe(w,I)?-1:(Ae(P[0])===k[31]>>7&&nt(P[0],o,P[0]),De(P[3],P[0],P[1]),0)}function Ja(P,k,_,w){var I,z=new Uint8Array(32),W=new Uint8Array(64),ce=[n(),n(),n(),n()],ve=[n(),n(),n(),n()];if(_<64||pu(ve,w))return-1;for(I=0;I<_;I++)P[I]=k[I];for(I=0;I<32;I++)P[I+32]=w[I];if(wt(W,P,_),du(W),cn(ce,ve,W),Gn(ve,k.subarray(32)),yt(ce,ve),nn(z,ce),_-=64,y(k,0,z,0)){for(I=0;I<_;I++)P[I]=0;return-1}for(I=0;I<_;I++)P[I]=k[I+64];return _}var Ul=32,Fl=24,zi=32,Xr=16,pa=32,Ya=32,Io=32,Xa=32,gu=32,yu=Fl,Ph=zi,Q=Xr,q=64,se=32,Oe=64,Ge=32,xt=64;e.lowlevel={crypto_core_hsalsa20:S,crypto_stream_xor:B,crypto_stream:N,crypto_stream_salsa20_xor:T,crypto_stream_salsa20:C,crypto_onetimeauth:U,crypto_onetimeauth_verify:j,crypto_verify_16:m,crypto_verify_32:y,crypto_secretbox:Z,crypto_secretbox_open:G,crypto_scalarmult:Ee,crypto_scalarmult_base:ne,crypto_box_beforenm:te,crypto_box_afternm:Ce,crypto_box:ze,crypto_box_open:$e,crypto_box_keypair:le,crypto_hash:wt,crypto_sign:ji,crypto_sign_keypair:Wa,crypto_sign_open:Ja,crypto_secretbox_KEYBYTES:Ul,crypto_secretbox_NONCEBYTES:Fl,crypto_secretbox_ZEROBYTES:zi,crypto_secretbox_BOXZEROBYTES:Xr,crypto_scalarmult_BYTES:pa,crypto_scalarmult_SCALARBYTES:Ya,crypto_box_PUBLICKEYBYTES:Io,crypto_box_SECRETKEYBYTES:Xa,crypto_box_BEFORENMBYTES:gu,crypto_box_NONCEBYTES:yu,crypto_box_ZEROBYTES:Ph,crypto_box_BOXZEROBYTES:Q,crypto_sign_BYTES:q,crypto_sign_PUBLICKEYBYTES:se,crypto_sign_SECRETKEYBYTES:Oe,crypto_sign_SEEDBYTES:Ge,crypto_hash_BYTES:xt,gf:n,D:c,L:ms,pack25519:ee,unpack25519:we,M:De,A:Ye,S:st,Z:nt,pow2523:ln,add:yt,set25519:H,modL:Yr,scalarmult:cn,scalarbase:Gn};function pt(P,k){if(P.length!==Ul)throw new Error("bad key size");if(k.length!==Fl)throw new Error("bad nonce size")}function lt(P,k){if(P.length!==Io)throw new Error("bad public key size");if(k.length!==Xa)throw new Error("bad secret key size")}function Ue(){for(var P=0;P=0},e.sign.keyPair=function(){var P=new Uint8Array(se),k=new Uint8Array(Oe);return Wa(P,k),{publicKey:P,secretKey:k}},e.sign.keyPair.fromSecretKey=function(P){if(Ue(P),P.length!==Oe)throw new Error("bad secret key size");for(var k=new Uint8Array(se),_=0;_`0x${"0".repeat(40)}`;class Eae{constructor(){this.cachedSignatures=new Map,this.cachedLeashes=new Map}clear(){this.cachedSignatures.clear(),this.cachedLeashes.clear()}cache(e,n,r,i,a){this.cachedSignatures.has(e)||this.cachedSignatures.set(e,new Map),this.cachedSignatures.get(e).set(i,a),this.cachedLeashes.set(n,{nonce:r.leash.nonce,block_number:r.leash.blockNumber,block_hash:r.leash.blockHash,block_range:r.leash.blockRange})}get(e,n){var r;return(r=this.cachedSignatures.get(e))===null||r===void 0?void 0:r.get(n)}getLeash(e){return this.cachedLeashes.get(e)}}const Iy=new Eae;function Sae(t){return{domain:{name:"oasis-runtime-sdk/evm: signed query",version:"1.0.0",chainId:t},types:{Call:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"gasLimit",type:"uint64"},{name:"gasPrice",type:"uint256"},{name:"value",type:"uint256"},{name:"data",type:"bytes"},{name:"leash",type:"Leash"}],Leash:[{name:"nonce",type:"uint64"},{name:"blockNumber",type:"uint64"},{name:"blockHash",type:"bytes32"},{name:"blockRange",type:"uint64"}]}}}class uA{static make(e,n,r){return gx(this,void 0,void 0,function*(){const i=yield Oae(n,r==null?void 0:r.leash);return new uA(i,yield Cae(Tae(e,i),n,{chainId:r==null?void 0:r.chainId}),e.data?sF(e.data):void 0)})}constructor(e,n,r){this.leash=e,this.signature=n,this.data=r,hw.add(this)}encode(){return J_(this,hw,"m",n8).call(this,this.data?{body:this.data}:void 0)}encryptEncode(e){return gx(this,void 0,void 0,function*(){return this.data?J_(this,hw,"m",n8).call(this,yield e.encryptEnvelope(this.data)):this.encode()})}}hw=new WeakSet,n8=function(e){return Ze(jh({data:e||void 0,leash:this.leash,signature:this.signature}))};function sF(t){return Array.isArray(t)?new Uint8Array(t):Or(t)}function Pae(t){return Array.isArray(t)?Ze(new Uint8Array(t)):Ze(t)}function Oae(t,e){var n;return gx(this,void 0,void 0,function*(){((e==null?void 0:e.nonce)!==void 0||(e==null?void 0:e.block)!==void 0)&&Iy.clear();let r;if(e!=null&&e.nonce)r=e.nonce;else if("getNonce"in t)r=t.getNonce("pending");else{const l=yield t.getAddress();r=t.provider.getTransactionCount(l,"pending")}let i;if((e==null?void 0:e.block)!==void 0)i=e.block;else{if(!t.provider)throw new Error("`sapphire.wrap`ped signer was not connected to a provider");const l=yield t.provider.getBlock("latest");if(!l)throw new Error("unable to get latest block");i=t.provider.getBlock(l.number-2)}const[a,o]=yield Promise.all([r,i]),s=(n=e==null?void 0:e.blockRange)!==null&&n!==void 0?n:wae;if((e==null?void 0:e.nonce)===void 0&&(e==null?void 0:e.block)===void 0){if(!t.provider)throw new Error("`sapphire.wrap`ped signer was not connected to a provider");const{chainId:l}=yield t.provider.getNetwork(),c=Iy.getLeash(BigInt(l));if(c!==void 0){if(c.nonce>a&&c.block_number+s>o.number+2)return c;Iy.clear()}}return{nonce:e!=null&&e.nonce?e.nonce:a+bae,block_number:o.number,block_hash:Or(o.hash),block_range:s}})}function Tae(t,e){var n,r,i,a,o;return{from:t.from,to:(n=t.to)!==null&&n!==void 0?n:Aae(),gasLimit:Number(BigInt((i=(r=t.gasLimit)!==null&&r!==void 0?r:t.gasLimit)!==null&&i!==void 0?i:mae)),gasPrice:BigInt((a=t.gasPrice)!==null&&a!==void 0?a:yae),value:BigInt((o=t.value)!==null&&o!==void 0?o:vae),data:t.data?Pae(t.data):xae,leash:{nonce:e.nonce,blockNumber:e.block_number,blockHash:e.block_hash,blockRange:e.block_range}}}function Cae(t,e,n){return gx(this,void 0,void 0,function*(){const r=yield e.getAddress();let i;if(n!=null&&n.chainId)i=BigInt(n.chainId);else if(e.provider)({chainId:i}=yield e.provider.getNetwork());else throw new Error("must either connect provider or provide manual chainId override");const{domain:a,types:o}=Sae(Number(i)),s=kae(a),l=_ae(t),c=E1.hash(s,o,l);let u=Iy.get(r,c);return u!==void 0||(u=Pt("_signTypedData"in e?yield e._signTypedData(s,o,l):yield e.signTypedData(s,o,l)),Iy.cache(r,BigInt(i),t,c,u)),u})}function kae(t){const e=Object.assign(Object.assign({},t),{chainId:t.chainId?fs(t.chainId):void 0});return t.salt&&(e.salt=sF(t.salt)),e}function _ae(t){const e=n=>{if(n!=null)return typeof n=="string"?n:n instanceof BigInt?fs(n.toString()):Fu(n)};return Object.assign(Object.assign({},t),{gasPrice:e(t.gasPrice),value:e(t.value),data:t.data?Pt(t.data):void 0})}const Nae="modulepreload",Iae=function(t){return"/votee/"+t},Y_={},Rae=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){const a=document.getElementsByTagName("link");i=Promise.all(n.map(o=>{if(o=Iae(o),o in Y_)return;Y_[o]=!0;const s=o.endsWith(".css"),l=s?'[rel="stylesheet"]':"";if(!!r)for(let f=a.length-1;f>=0;f--){const h=a[f];if(h.href===o&&(!s||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${l}`))return;const u=document.createElement("link");if(u.rel=s?"stylesheet":Nae,s||(u.as="script",u.crossOrigin=""),u.href=o,document.head.appendChild(u),s)return new Promise((f,h)=>{u.addEventListener("load",f),u.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${o}`)))})}))}return i.then(()=>e()).catch(a=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a})},fE={chainId:23294,defaultGateway:"https://sapphire.oasis.io/",runtimeId:"0x000000000000000000000000000000000000000000000000f80306c9858e7279"},hE={chainId:23295,defaultGateway:"https://testnet.sapphire.oasis.dev/",runtimeId:"0x000000000000000000000000000000000000000000000000a6d1e3ebf60dff6c"},dE={chainId:23293,defaultGateway:"http://localhost:8545/",runtimeId:"0x8000000000000000000000000000000000000000000000000000000000000000"},Mae={mainnet:fE,testnet:hE,localnet:dE,[fE.chainId]:fE,[hE.chainId]:hE,[dE.chainId]:dE};var Rp=function(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{c(r.next(u))}catch(f){o(f)}}function l(u){try{c(r.throw(u))}catch(f){o(f)}}function c(u){u.done?a(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})};const Bae=60*5*1e3;function lF(t,e){return{key:Pt(t.key),checksum:Pt(t.checksum),signature:Pt(t.signature),epoch:t.epoch,chainId:e,fetched:new Date}}function Dae(t){return Rp(this,void 0,void 0,function*(){const e=yield Rae(()=>import(t.split(":")[0]),__vite__mapDeps([])),n=cF();return new Promise((r,i)=>{const a={method:"POST",headers:{"content-type":"application/json","content-length":n.length}},o=e.request(t,a,s=>{const l=[];s.on("error",c=>i(c)),s.on("data",c=>l.push(c)),s.on("end",()=>{r(JSON.parse(Buffer.concat(l).toString()))})});o.on("error",s=>i(s)),o.write(n),o.end()})})}function Lae(t,e){return Rp(this,void 0,void 0,function*(){const n=yield e(t,{method:"POST",headers:{"content-type":"application/json"},body:cF()});if(!n.ok)throw new Ry("Failed to fetch runtime public key.",n);return yield n.json()})}function cF(){return JSON.stringify({jsonrpc:"2.0",id:Math.floor(Math.random()*1e9),method:i8,params:[]})}function $ae(t,e){var n;return Rp(this,void 0,void 0,function*(){const{defaultGateway:r}=Mae[t];if(!r)throw new Error(`Unable to fetch runtime public key for network with unknown ID: ${t}.`);const i=(n=e==null?void 0:e.fetch)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.fetch,a=yield i?Lae(r,i):Dae(r);return lF(a.result,t)})}function X_(t){return typeof t=="string"?t.startsWith("0x")?parseInt(t,16):parseInt(t):t}function Uae(t){return Rp(this,void 0,void 0,function*(){const e="provider"in t?t.provider:t;let n;if(e){let r;if("request"in e){const i=e;n=X_(yield i.request({method:"eth_chainId"}));try{r=yield i.request({method:i8,params:[]})}catch{}}else if("send"in e){const i=e;n=X_(yield i.send("eth_chainId",[]));try{r=yield i.send(i8,[])}catch{}}else throw new Error("fetchRuntimePublicKey does not support non-request non-send provier!");if(r&&"key"in r)return lF(r,n)}if(!n)throw new Error("fetchRuntimePublicKey failed to retrieve chainId from provider");return $ae(n)})}class Fae{}class jae extends Fae{constructor(e){super(),e||(e=Bae),this.timeoutMilliseconds=e}fetch(e){return Rp(this,void 0,void 0,function*(){if(this.pubkey){const n=this.pubkey,r=Date.now()-this.timeoutMilliseconds;if(n.fetched&&n.fetched.valueOf()>r)return n}return this.pubkey=yield Uae(e)})}cipher(e){return Rp(this,void 0,void 0,function*(){const n=yield this.fetch(e);return dx.ephemeral(n.key,n.epoch)})}}var hs=function(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(u){try{c(r.next(u))}catch(f){o(f)}}function l(u){try{c(r.throw(u))}catch(f){o(f)}}function c(u){u.done?a(u.value):i(u.value).then(s,l)}c((r=r.apply(t,e||[])).next())})},zae=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);ihs(this,void 0,void 0,function*(){return yield i({method:o[0],params:o[1]})})),"sendAsync"in t&&(a.sendAsync=()=>{throw new Error("sendAsync not supported by Sapphire wrapper!")}),CO(t,n,a)}function Vae(t,e){return n=>hs(this,void 0,void 0,function*(){const r=yield t.getSigner(),i=yield e.fetcher.cipher(t),{method:a,params:o}=yield Xae(n,r,i),s=yield r.provider.send(a,o??[]);return a==="eth_call"?yield i.decryptEncoded(s):s})}function CO(t,e,n){return new Proxy(t,{get(r,i){if(i===TO)return e;if(i in n)return Reflect.get(n,i);const a=Reflect.get(r,i);return typeof a=="function"?a.bind(r):a}})}function kO(t,e){const n=fA(e);let r;if(t.provider)try{const a=fF(t.provider,n,t);r=t.connect(a)}catch(a){if(a.code!=="UNSUPPORTED_OPERATION")throw a;r=t}else r=t;const i={sendTransaction:Z_(r.sendTransaction.bind(r),n,r),signTransaction:Z_(r.signTransaction.bind(r),n,r),call:yx(r,"call",n),estimateGas:yx(r,"estimateGas",n),connect(a){const o=r.connect(a);return kO(o,n)}};return CO(r,n,i)}function fF(t,e,n){const r=fA(e);if(Reflect.get(t,TO)!==void 0)return t;const i={call:yx(t,"call",r),estimateGas:yx(t,"estimateGas",r)};return n&&("broadcastTransaction"in t?i.broadcastTransaction=a=>hs(this,void 0,void 0,function*(){const o=yield r.fetcher.cipher(t),s=yield r8(a,o,n);return t.broadcastTransaction(s)}):i.sendTransaction=a=>hs(this,void 0,void 0,function*(){const o=yield r.fetcher.cipher(t),s=yield r8(a,o,n);return t.sendTransaction(s)})),CO(t,r,i)}function Qae(t){return Reflect.get(t,"_isSigner")===!0}function Kae(t){return t instanceof HU||Reflect.get(t,"signTypedData")!==void 0&&Reflect.get(t,"signTransaction")!==void 0}function hF(t){return Qae(t)||Kae(t)}function Wae(t){return Reflect.get(t,"_isProvider")===!0}function Jae(t){return t instanceof zU||Reflect.get(t,"waitForBlock")&&Reflect.get(t,"destroy")&&Reflect.get(t,"broadcastTransaction")}function Yae(t){return Wae(t)||Jae(t)}function yx(t,e,n){const r=(i,a,o,s)=>hs(this,void 0,void 0,function*(){var l;let c=a.data;return o||(c=yield s.encryptEncode((l=a.data)!==null&&l!==void 0?l:new Uint8Array)),yield i[e](Object.assign(Object.assign({},a),{data:Ze(c)}))});return i=>hs(this,void 0,void 0,function*(){const a=Reflect.get(t,"populateCall");a!==void 0&&(i=yield a.bind(t)(i));let o;const s=pF(i.data,!0),l=yield n.fetcher.cipher(t);if(!s&&hF(t)){const c=t;if(!c.provider)throw new Error("signer not connected to a provider");const u=c.provider;if(yield dF(i)){const f=yield uA.make(i,c);o=yield u[e](Object.assign(Object.assign({},i),{data:yield f.encryptEncode(l)}))}else o=yield r(u,i,s,l)}else o=yield r(t,i,s,l);return!s&&typeof o=="string"?yield l.decryptEncoded(o):o})}function Z_(t,e,n){return(r,...i)=>hs(this,void 0,void 0,function*(){if(r.data){const a=yield e.fetcher.cipher(n);r.data=yield a.encryptEncode(r.data)}return t(r,...i)})}function dF(t){return hs(this,void 0,void 0,function*(){const[e,n]=yield Promise.all([t.from,t.to]);return!!n&&!!e&&typeof e=="string"&&!/^(0x)?0{40}$/.test(e)})}function Xae({method:t,params:e},n,r){return hs(this,void 0,void 0,function*(){if(!Array.isArray(e))return{method:t,params:e};if(t==="eth_sendRawTransaction")return{method:t,params:[yield r8(e[0],r,n)]};if((t==="eth_call"||t==="eth_estimateGas")&&(yield dF(e[0]))){const i=yield uA.make(e[0],n),a=Object.assign(Object.assign({},e[0]),{data:yield i.encryptEncode(r)});return{method:t,params:[a,...e.slice(1)]}}return/^eth_((send|sign)Transaction|call|estimateGas)$/.test(t)&&e[0].data?(e[0].data=yield r.encryptEncode(e[0].data),{method:t,params:e}):{method:t,params:e}})}class pE extends Error{}const Zae="Un-enveloped data was passed to sendRawTransaction, which is likely incorrect. Is the dapp using the Sapphire compat lib correctly?";function r8(t,e,n){return hs(this,void 0,void 0,function*(){const r=A1.from(t);if(pF(r.data,!1)||r.isSigned()&&(!n||(yield n.getAddress())!==r.from))return t;r.data=yield e.encryptEncode(r.data);try{return n.signTransaction(r)}catch(i){throw new Ry(Zae,i)}})}function qae(t){return"data"in t&&"leash"in t&&"signature"in t}function pF(t,e){try{const n=tw(Pt(t));let r;if(qae(n)){if(!e)throw new pE("Got unexpected signed query!");r=n.data}else r=n;if(!eoe(r))throw new pE("Bogus Sapphire enveloped data found in transaction!");return!0}catch(n){if(n instanceof pE)throw n}return!1}function eoe(t){const{format:e,body:n}=t,r=zae(t,["format","body"]);return!(Object.keys(r).length>0||!n||e!==null&&e!==Ip.Plain&&(rx(n)||!rx(n.data)))}const i8="oasis_callDataPublicKey";class Ry extends Error{constructor(e,n){super(e),this.response=n}}function toe({mustBeMetaMask:t=!1,silent:e=!1,timeout:n=3e3}={}){i();let r=!1;return new Promise(a=>{window.ethereum?o():(window.addEventListener("ethereum#initialized",o,{once:!0}),setTimeout(()=>{o()},n));function o(){if(r)return;r=!0,window.removeEventListener("ethereum#initialized",o);const{ethereum:s}=window;s&&(!t||s.isMetaMask)?a(s):(!e&&console.error("@metamask/detect-provider:",t&&s?"Non-MetaMask window.ethereum detected.":"Unable to detect window.ethereum."),a(null))}});function i(){if(typeof t!="boolean")throw new Error("@metamask/detect-provider: Expected option 'mustBeMetaMask' to be a boolean.");if(typeof e!="boolean")throw new Error("@metamask/detect-provider: Expected option 'silent' to be a boolean.");if(typeof n!="number")throw new Error("@metamask/detect-provider: Expected option 'timeout' to be a number.")}}var noe=toe;const roe=Xt(noe),gF=F.createContext({}),ioe=({children:t})=>{const e=async()=>!!await roe({mustBeMetaMask:!1}),n=async()=>{var s,l;const o=await(((l=(s=window.ethereum)==null?void 0:s.request)==null?void 0:l.call(s,{method:"eth_requestAccounts"}))||Promise.resolve([]));if(!o||(o==null?void 0:o.length)<=0)throw new Error("[EIP1193Context] Request account failed!");return o[0]},r=(o=Hw)=>{var l,c;if(!zw.has(o))throw new Error(`Chain configuration for chain id '${o}' not found!`);const s=zw.get(o);return(c=(l=window.ethereum)==null?void 0:l.request)==null?void 0:c.call(l,{method:"wallet_addEthereumChain",params:[s]})},a={isEIP1193ProviderAvailable:e,connectWallet:n,switchNetwork:async(o=Hw)=>{var u,f;const s=new f$(window.ethereum);if((await uF(s).getNetwork()).chainId!==BigInt(o))try{const h=us(o).replace("0x0","0x");await((f=(u=window.ethereum).request)==null?void 0:f.call(u,{method:"wallet_switchEthereumChain",params:[{chainId:h}]}))}catch(h){const d=h;if((d==null?void 0:d.code)!==4902&&(d==null?void 0:d.code)!==-32603)throw d;r(o)}}};return J.jsx(gF.Provider,{value:a,children:t})},aoe=()=>{const t=F.useContext(gF);if(Object.keys(t).length===0)throw new Error("[useEIP1193] Component not wrapped within a Provider");return t},db=[{inputs:[{internalType:"contract IPollManagerACL",name:"in_managerACL",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"Close_NotActive",type:"error"},{inputs:[],name:"Close_NotAllowed",type:"error"},{inputs:[],name:"Create_AlreadyExists",type:"error"},{inputs:[],name:"Create_InvalidACL",type:"error"},{inputs:[],name:"Create_NoChoices",type:"error"},{inputs:[],name:"Create_NotAllowed",type:"error"},{inputs:[],name:"Create_TooManyChoices",type:"error"},{inputs:[],name:"Poll_NotActive",type:"error"},{inputs:[],name:"Poll_NotPublishingVotes",type:"error"},{inputs:[],name:"Poll_StillActive",type:"error"},{inputs:[],name:"Vote_NotActive",type:"error"},{inputs:[],name:"Vote_NotAllowed",type:"error"},{inputs:[],name:"Vote_UnknownChoice",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"id",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"topChoice",type:"uint256"}],name:"ProposalClosed",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"id",type:"bytes32"}],name:"ProposalCreated",type:"event"},{inputs:[],name:"MAX_CHOICES",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"PAST_PROPOSALS",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"PROPOSALS",outputs:[{internalType:"bool",name:"active",type:"bool"},{internalType:"uint8",name:"topChoice",type:"uint8"},{components:[{internalType:"bytes",name:"ipfsHash",type:"bytes"},{internalType:"uint8",name:"numChoices",type:"uint8"},{internalType:"uint64",name:"closeTimestamp",type:"uint64"},{internalType:"contract IPollACL",name:"acl",type:"address"}],internalType:"struct PollManager.ProposalParams",name:"params",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"in_id",type:"bytes32"}],name:"ballotIsActive",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"in_proposalId",type:"bytes32"},{internalType:"address",name:"in_voter",type:"address"},{internalType:"bytes",name:"in_data",type:"bytes"}],name:"canVoteOnPoll",outputs:[{internalType:"uint256",name:"out_weight",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"in_proposalId",type:"bytes32"}],name:"close",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"bytes",name:"ipfsHash",type:"bytes"},{internalType:"uint8",name:"numChoices",type:"uint8"},{internalType:"uint64",name:"closeTimestamp",type:"uint64"},{internalType:"contract IPollACL",name:"acl",type:"address"}],internalType:"struct PollManager.ProposalParams",name:"in_params",type:"tuple"},{internalType:"bytes",name:"in_aclData",type:"bytes"}],name:"create",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"getACL",outputs:[{internalType:"contract IPollManagerACL",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"proposalId",type:"bytes32"}],name:"getPollACL",outputs:[{internalType:"contract IPollACL",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"in_proposalId",type:"bytes32"}],name:"getVoteCounts",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"bytes32",name:"in_proposalId",type:"bytes32"},{internalType:"uint8",name:"in_choiceId",type:"uint8"},{internalType:"bytes",name:"in_data",type:"bytes"}],name:"vote",outputs:[],stateMutability:"nonpayable",type:"function"}],q_="0x60a03461007157601f61163c38819003918201601f19168301916001600160401b038311848410176100765780849260209460405283398101031261007157516001600160a01b0381168103610071576080526040516115af908161008d82396080518181816103b301526110b60152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe608080604052600436101561001357600080fd5b600090813560e01c90816301ffc9a7146110e55750806308737695146110a057806339c79e0c14610e075780635f98ac7814610dd8578063613e0f8c14610d9f5780636dea101c14610d4d578063782fb5d414610c1b5780638732765714610a82578063892d13071461033a578063d4c0ed3e1461031e578063d50b2843146101035763ff2990a0146100a557600080fd5b3461010057606036600319011261010057602435906001600160a01b038216820361010057604435906001600160401b0382116101005760206100f8846100ef3660048701611210565b916004356112f5565b604051908152f35b80fd5b50346101005760603660031901126101005760043560243560ff81168103610319576001600160401b039160443583811161031557610149610151913690600401611210565b9033846112f5565b818552600160205260ff600260408720015416918260ff851610156102d957855284602052604085203386528060205260408620946101a86101968754948515611409565b6101a285801515611409565b9061141c565b936002830154916040519083602083015260208252816040810110906040830111176102c35760408101604052602081519101209160ff60018901541690895b838110610232578a8a600160ff8c8c8c8c8c6002820155811561021a575b505084551660ff1982840154161791015580f35b600b610229910191825461141c565b90558680610206565b806102418a9260038901611263565b90549060031b1c836102648b60ff61025b8d8a8814611409565b96168514611409565b91189283039283116102ad5761027d879160019461141c565b186102a561028e8360038b01611263565b819391549060031b91821b91600019901b19161790565b9055016101e8565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b60405162461bcd60e51b8152602060048201526014602482015273566f74655f556e6b6e6f776e43686f696365282960601b6044820152606490fd5b8480fd5b600080fd5b5034610100578060031936011261010057602060405160088152f35b5034610100576003196040368201126108d0576001600160401b03600435116108d05760806004353603918201126108d0576024356001600160401b0381116108df5761038b903690600401611210565b60405160016290108360e01b03198152306004820152336024820152919290916020816044817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa908115610a46578591610a63575b5015610a5157602460206001600160a01b0361040b60043560640161128a565b6040516301ffc9a760e01b815263b91f535b60e01b600482015293849290918391165afa908115610a46578591610a17575b5015610a055760ff61045360246004350161129e565b16156109f357600860ff61046b60246004350161129e565b16116109e1576040519033602083015260606040830152602219016004356004013512156109b75760043560043560040135016001600160401b036004820135116103155760048101353603602482011361031557816105466104e5610554936080808501526101008401906024600482013591016112ac565b60ff6104f560246004350161123d565b1660a08401526001600160401b036105116044600435016112cd565b1660c08401526001600160a01b0361052d6004356064016112e1565b1660e0840152828103601f1901606084015285876112ac565b03601f1981018352826111ef565b6020815191012092838152600160205260ff6040822054166109cf576040518060608101106001600160401b036060830111176102c35760608101604052600181528160208201526040516105a8816111d4565b6001600160401b0360043560040135116108df5736602360043560040135600435010112156108df576001600160401b036004803580820135010135116109bb5760405161060a6004803580820135010135601f01601f1916602001826111ef565b60048035808201350190810135808352369101602401116109b7576004803580820135019081013590602401602083013783602060048035810135813501013583010152815261065e60246004350161123d565b60208201526106716044600435016112cd565b60408201526106846064600435016112e1565b606082015260408281019182528684526001602090815290842083518154929094015161ffff1990921693151560ff169390931760089190911b61ff0016178255519081518051906001600160401b0382116109a3576106e76001840154611187565b601f811161095e575b50602090601f83116001146108ee5760029392918691836108e3575b50508160011b916000199060031b1c19161760018201555b019060ff6020820151169082549168ffffffffffffffff00604083015160081b169160606901000000000000000000600160e81b0391015160481b169262ffffff60e81b16171717905561077784611513565b508381528060205260408120936040513060601b60208201523360601b6034820152602881528060608101106001600160401b036060830111176102c357606081016040526020815191012092836002870155825b60ff6107dc60246004350161129e565b168110156108005780856107f861028e60019460038c01611263565b9055016107cc565b50846001600160a01b0361081860043560640161128a565b16610852575b6020837f288a29bca04edb18fcdb2c76d6e3b03b8a137c85c70d1a4cb8aacfa868d6051082604051838152a1604051908152f35b83906001600160a01b0361086a60043560640161128a565b16803b156108df576108a7938360405180968195829463c60e204760e01b84528a60048501523360248501526060604485015260648401916112ac565b03925af180156108d4576108bc575b8061081e565b6108c683916111c1565b6108d057816108b6565b5080fd5b6040513d85823e3d90fd5b8280fd5b01519050388061070c565b906001840186526020862091865b601f1985168110610946575091839160019360029695601f1981161061092d575b505050811b016001820155610724565b015160001960f88460031b161c1916905538808061091d565b919260206001819286850151815501940192016108fc565b60018401865260208620601f840160051c81016020851061099c575b601f830160051c820181106109905750506106f0565b6000815560010161097a565b508061097a565b634e487b7160e01b85526041600452602485fd5b8380fd5b634e487b7160e01b83526041600452602483fd5b604051637830599760e11b8152600490fd5b60405163b3aaf68560e01b8152600490fd5b604051630f922a5760e01b8152600490fd5b6040516376c8e1c760e01b8152600490fd5b610a39915060203d602011610a3f575b610a3181836111ef565b81019061124b565b3861043d565b503d610a27565b6040513d87823e3d90fd5b60405163537f370960e01b8152600490fd5b610a7c915060203d602011610a3f57610a3181836111ef565b386103eb565b5034610100576020806003193601126108d05760043582526001916001825260408120918254926001810160405195610aba876111d4565b604051918591815491610acc83611187565b9283865287600182169182600014610bf5575050600114610bb3575b50505090610afb816002949303826111ef565b86520154938181019460ff811686526001600160401b0360408301818360081c16815260018060a01b039384606082019460481c16845260ff6040519881811615158a5260081c1686890152606060408901525194608060608901528551958660e08a0152875b878110610b9e5750505060ff8798610100989789888a01015251166080870152511660a0850152511660c0830152601f80199101168101030190f35b8181018301518a820161010001528201610b62565b875285872094939250859187915b818310610bde575093945091925090820101610afb826002610ae8565b865485840185015295860195879390920191610bc1565b60ff19168782015293151560051b86019093019350610afb925084915060029050610ae8565b50346101005760209081600319360112610100576004358152600191600181526040822090828152604083209160ff815416610d3b578360ff60028793015416610c7d610c6782611273565b91610c7560405193846111ef565b808352611273565b8185019590601f1901368737600281015490600390810184865b610cd6575b505050506040519380850191818652518092526040850195925b828110610cc35785870386f35b8351875295810195928101928401610cb6565b8495979498969851811015610d2f5783610cf08284611263565b905490851b1c188651821015610d1b57600582901b8701860152959793969395939493860186610c97565b634e487b7160e01b89526032600452602489fd5b97959796949396610c9c565b60405163ce381d3560e01b8152600490fd5b5034610100576020366003190112610100576004356004548110156108d05760209060046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0154604051908152f35b5034610100576020366003190112610100576020906004358152600182526002604060018060a01b039220015460481c16604051908152f35b50346101005760203660031901126101005760ff60406020926004358152600184522054166040519015158152f35b5034610100576020806003193601126108d057600435908183526001808252604084209060ff9160ff8154161561108e576002018054604051630ada2bb960e31b81523060048201526024810187905233604482015290936001600160a01b03939091868160648160488a901c89165afa908115611083578991611066575b5015611038575b929190868852878652604088209388948990600281015460ff8c991691846003809201905b610ff3575b505050898b52505060018752505060408720805461ffff191661ff00600886901b1617905591925090610ee985611429565b50600454600160401b811015610fdf576001810180600455811015610fcb579085879392600485527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01555460481c16803b156108d05781906024604051809481936346ba4a8760e11b83528960048401525af18015610a4657610f96575b50907f32c34fd89f87a7cc9f257c5f4c2ed207f4776f12b94e6aec10d90ce489d6c52891604051908152a280f35b93610fc37f32c34fd89f87a7cc9f257c5f4c2ed207f4776f12b94e6aec10d90ce489d6c5289392956111c1565b939091610f68565b634e487b7160e01b87526032600452602487fd5b634e487b7160e01b87526041600452602487fd5b868b168481101561103257836110098d84611263565b905490851b1c1890868211611027575b505099850186169985610eb2565b9a5094508686611019565b50610eb7565b600885901c6001600160401b0316801561105457421015610e8d575b604051630e01f48b60e11b8152600490fd5b61107d9150873d8911610a3f57610a3181836111ef565b38610e86565b6040513d8b823e3d90fd5b604051632e72894160e11b8152600490fd5b50346101005780600319360112610100576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b9050346108d05760203660031901126108d05760043563ffffffff60e01b81168091036108df57602092506301ffc9a760e01b8114908115611129575b5015158152f35b639664e9b960e01b14905038611122565b6002548110156111715760026000527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0190600090565b634e487b7160e01b600052603260045260246000fd5b90600182811c921680156111b7575b60208310146111a157565b634e487b7160e01b600052602260045260246000fd5b91607f1691611196565b6001600160401b0381116102c357604052565b608081019081106001600160401b038211176102c357604052565b90601f801991011681019081106001600160401b038211176102c357604052565b9181601f84011215610319578235916001600160401b038311610319576020838186019501011161031957565b359060ff8216820361031957565b90816020910312610319575180151581036103195790565b6008821015611171570190600090565b6001600160401b0381116102c35760051b60200190565b356001600160a01b03811681036103195790565b3560ff811681036103195790565b908060209392818452848401376000828201840152601f01601f1916010190565b35906001600160401b038216820361031957565b35906001600160a01b038216820361031957565b93929093600094818652600160205260409384872060ff815416156113f85760020154926001600160401b038460081c16806113eb575b50855163525a5ded60e11b815230600482015260248101919091526001600160a01b039283166044820152608060648201529360209385939092849283916113789160848401916112ac565b039260481c165afa9384156113e05780946113a9575b505082156113995750565b516305c1721760e41b8152600490fd5b909193506020823d6020116113d8575b816113c6602093836111ef565b8101031261010057505191388061138e565b3d91506113b9565b8251903d90823e3d90fd5b4210156113f8573861132c565b855163137436d960e01b8152600490fd5b818102929181159184041417156102ad57565b919082018092116102ad57565b600081815260036020526040812054909190801561150e57600019908082018181116114fa57600254908382019182116114e6578082036114b2575b505050600254801561149e5781019061147d8261113a565b909182549160031b1b19169055600255815260036020526040812055600190565b634e487b7160e01b84526031600452602484fd5b6114d06114c161028e9361113a565b90549060031b1c92839261113a565b9055845260036020526040842055388080611465565b634e487b7160e01b86526011600452602486fd5b634e487b7160e01b85526011600452602485fd5b505090565b60008181526003602052604081205461157457600254600160401b81101561156057908261154c61028e8460016040960160025561113a565b905560025492815260036020522055600190565b634e487b7160e01b82526041600452602482fd5b90509056fea26469706673582212208bf15ca60379d1f9df63d16ec0780cf392c8a1817ccceb0ea6880c22e44c30f464736f6c63430008170033",ooe=t=>t.length>1;class mx extends YP{constructor(...e){ooe(e)?super(...e):super(db,q_,e[0])}getDeployTransaction(e,n){return super.getDeployTransaction(e,n||{})}deploy(e,n){return super.deploy(e,n||{})}connect(e){return super.connect(e)}static createInterface(){return new GP(db)}static connect(e,n){return new _d(e,db,n)}}R(mx,"bytecode",q_),R(mx,"abi",db);const eN=new Uint8Array([]),soe={isConnected:!1,isVoidSignerConnected:!1,ethProvider:null,sapphireEthProvider:null,account:null,explorerBaseUrl:null,chainName:null,pollManagerVoidSigner:null},loe=({children:t})=>{const{isEIP1193ProviderAvailable:e,connectWallet:n,switchNetwork:r}=aoe(),[i,a]=F.useState({...soe});F.useEffect(()=>{(async()=>{if(!pC||!_6)return;const N=new bee(pC,void 0,{staticNetwork:!0}),B=await mx.connect(_6,N);a(L=>({...L,pollManagerVoidSigner:B,isVoidSignerConnected:!0}))})()},[]);const o=C=>{a(N=>({...N,isConnected:C}))},s=F.useCallback(C=>{if(C.length<=0){o(!1);return}const[N]=C;a(B=>({...B,account:N}))},[]),l=(C,N=i.sapphireEthProvider)=>{if(!N)throw new Error("[Web3Context] Sapphire provider is required!");if(!zw.has(C)||Hw!==C)throw new j5("Unknown network!");const{blockExplorerUrls:B,chainName:L}=zw.get(C),[U]=B;a(j=>({...j,explorerBaseUrl:U,chainName:L}))},c=F.useCallback(()=>{i.isConnected&&window.location.reload()},[i.isConnected]),u=F.useCallback(()=>o(!0),[]),f=F.useCallback(()=>o(!1),[]),h=(()=>{let C=!1;return N=>{var B,L,U,j;C||((B=N==null?void 0:N.on)==null||B.call(N,"accountsChanged",s),(L=N==null?void 0:N.on)==null||L.call(N,"chainChanged",c),(U=N==null?void 0:N.on)==null||U.call(N,"connect",u),(j=N==null?void 0:N.on)==null||j.call(N,"disconnect",f),C=!0)}})(),d=async(C,N)=>{try{const B=new f$(N),L=uF(B),U=await L.getNetwork();l(U.chainId,L),a(j=>({...j,isConnected:!0,ethProvider:B,sapphireEthProvider:L,account:C}))}catch(B){throw a(L=>({...L,isConnected:!1})),B instanceof j5?B:new Error("[Web3Context] Unable to initialize providers!")}},g=async()=>{const{account:C,sapphireEthProvider:N}=i;if(!C||!N)throw new Error("[Web3Context] Unable to fetch balance!");return await N.getBalance(C)},p=async()=>e(),m=async()=>{const C=await n();if(!C)throw new Error("[Web3Context] Request account failed!");await d(C,window.ethereum),h(window.ethereum)},y=async(C=Hw)=>r(C),v=async C=>{if(!C)throw new Error("[txHash] is required!");const{sapphireEthProvider:N}=i;if(!N)throw new Error("[sapphireEthProvider] not initialized!");const B=await N.waitForTransaction(C);if((B==null?void 0:B.status)===0)throw new Error("Transaction failed");return await N.getTransaction(C)},T={state:i,isProviderAvailable:p,connectWallet:m,switchNetwork:y,getBalance:g,getTransaction:v,getPoll:async()=>{const{pollManagerVoidSigner:C}=i;if(!C)throw new Error("[pollManagerWithoutSigner] not initialized!");return await C.PROPOSALS(us(Fv))},canVoteOnPoll:async()=>{const{pollManagerVoidSigner:C,account:N}=i;if(!C)throw new Error("[pollManagerVoidSigner] not initialized!");if(!N)throw new Error("[account] Wallet not connected!");return await C.canVoteOnPoll(Fv,N,eN).then(B=>Promise.resolve(B===1n)).catch(()=>Promise.resolve(!1))},vote:async C=>{const{sapphireEthProvider:N}=i;if(!N)throw new Error("[sapphireEthProvider] not initialized!");const B=kO(await N.getSigner()),U=await mx.connect(_6,B).vote.populateTransaction(Fv,C,eN);U.gasLimit=_K,U.value=0n;const j=await B.sendTransaction(U);return await v(j.hash)},getVoteCounts:async()=>{const{pollManagerVoidSigner:C}=i;if(!C)throw new Error("[pollManagerVoidSigner] not initialized!");return await C.getVoteCounts(Fv)}};return J.jsx(eD.Provider,{value:T,children:t})},coe="_cardHeaderText_937ca_1",uoe="_winningMascot_937ca_11",foe="_winningMascotBadge_937ca_15",hoe="_mascotPollData_937ca_32",doe="_cardFooterText_937ca_39",poe="_mascotResultsTable_937ca_48",goe="_answerColName_937ca_65",yoe="_mascotPollDataPieChart_937ca_78",moe="_headerText_937ca_83",ws={cardHeaderText:coe,winningMascot:uoe,winningMascotBadge:foe,mascotPollData:hoe,cardFooterText:doe,mascotResultsTable:poe,answerColName:goe,mascotPollDataPieChart:yoe,headerText:moe},voe=t=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",fill:"currentColor",...t},F.createElement("path",{d:"M232,64H208V56a16,16,0,0,0-16-16H64A16,16,0,0,0,48,56v8H24A16,16,0,0,0,8,80V96a40,40,0,0,0,40,40h3.65A80.13,80.13,0,0,0,120,191.61V216H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16H136V191.58c31.94-3.23,58.44-25.64,68.08-55.58H208a40,40,0,0,0,40-40V80A16,16,0,0,0,232,64ZM48,120A24,24,0,0,1,24,96V80H48v32q0,4,.39,8ZM232,96a24,24,0,0,1-24,24h-.5a81.81,81.81,0,0,0,.5-8.9V80h24Z"})),boe=t=>J.jsx(ag,{...t,children:J.jsx(voe,{})}),woe="_pieChart_1ctih_1",xoe="_pieChartCell_1ctih_6",tN={pieChart:woe,pieChartCell:xoe};function yF(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e-1}var wle=ble,xle=dA;function Ale(t,e){var n=this.__data__,r=xle(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var Ele=Ale,Sle=ole,Ple=ple,Ole=mle,Tle=wle,Cle=Ele;function dg(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e Oasis voTEE - +