From 959f83712e0c41c2f54bc07956e5c5f1f8e43887 Mon Sep 17 00:00:00 2001 From: Alberto Granzotto Date: Fri, 24 May 2024 20:07:38 +0200 Subject: [PATCH] bump --- assets/index-50e9acf6.js | 128 +++++++++++++++++++++++++++++++++++++++ index.html | 2 +- 2 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 assets/index-50e9acf6.js diff --git a/assets/index-50e9acf6.js b/assets/index-50e9acf6.js new file mode 100644 index 0000000..f41f33e --- /dev/null +++ b/assets/index-50e9acf6.js @@ -0,0 +1,128 @@ +var TE=Object.defineProperty;var OE=(n,e,t)=>e in n?TE(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var R=(n,e,t)=>(OE(n,typeof e!="symbol"?e+"":e,t),t),f6=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)};var g=(n,e,t)=>(f6(n,e,"read from private field"),t?t.call(n):e.get(n)),$=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},k=(n,e,t,r)=>(f6(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t);var hr=(n,e,t,r)=>({set _(s){k(n,e,s,t)},get _(){return g(n,e,r)}}),Q=(n,e,t)=>(f6(n,e,"access private method"),t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function t(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=t(s);fetch(s.href,i)}})();function we(){}const B4=n=>n;function F4(n,e){for(const t in e)n[t]=e[t];return n}function NE(n){return n&&typeof n=="object"&&typeof n.then=="function"}function U4(n){return n()}function lg(){return Object.create(null)}function os(n){n.forEach(U4)}function lh(n){return typeof n=="function"}function on(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let ed;function P1(n,e){return ed||(ed=document.createElement("a")),ed.href=e,n===ed.href}function IE(n){return Object.keys(n).length===0}function P5(n,...e){if(n==null)return we;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function BE(n){let e;return P5(n,t=>e=t)(),e}function mt(n,e,t){n.$$.on_destroy.push(P5(e,t))}function Sr(n,e,t){return n.set(t),e}const L4=typeof window<"u";let FE=L4?()=>window.performance.now():()=>Date.now(),k5=L4?n=>requestAnimationFrame(n):we;const po=new Set;function D4(n){po.forEach(e=>{e.c(n)||(po.delete(e),e.f())}),po.size!==0&&k5(D4)}function UE(n){let e;return po.size===0&&k5(D4),{promise:new Promise(t=>{po.add(e={c:n,f:t})}),abort(){po.delete(e)}}}function ve(n,e){n.appendChild(e)}function M4(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function LE(n){const e=ce("style");return DE(M4(n),e),e.sheet}function DE(n,e){ve(n.head||n,e)}function se(n,e,t){n.insertBefore(e,t||null)}function re(n){n.parentNode.removeChild(n)}function j4(n,e){for(let t=0;tn.removeEventListener(e,t,r)}function k1(n){return function(e){return e.preventDefault(),n.call(this,e)}}function Fe(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function ME(n){return Array.from(n.childNodes)}function Yi(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function es(n,e){n.value=e??""}function jE(n,e,t,r){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,r?"important":"")}function $4(n,e,{bubbles:t=!1,cancelable:r=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,r,e),s}const C1=new Map;let S1=0;function $E(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function HE(n,e){const t={stylesheet:LE(e),rules:{}};return C1.set(n,t),t}function fg(n,e,t,r,s,i,a,o=0){const u=16.666/r;let c=`{ +`;for(let v=0;v<=1;v+=u){const w=e+(t-e)*i(v);c+=v*100+`%{${a(w,1-w)}} +`}const l=c+`100% {${a(t,1-t)}} +}`,d=`__svelte_${$E(l)}_${o}`,f=M4(n),{stylesheet:h,rules:p}=C1.get(f)||HE(f,n);p[d]||(p[d]=!0,h.insertRule(`@keyframes ${d} ${l}`,h.cssRules.length));const b=n.style.animation||"";return n.style.animation=`${b?`${b}, `:""}${d} ${r}ms linear ${s}ms 1 both`,S1+=1,d}function GE(n,e){const t=(n.style.animation||"").split(", "),r=t.filter(e?i=>i.indexOf(e)<0:i=>i.indexOf("__svelte")===-1),s=t.length-r.length;s&&(n.style.animation=r.join(", "),S1-=s,S1||zE())}function zE(){k5(()=>{S1||(C1.forEach(n=>{const{stylesheet:e}=n;let t=e.cssRules.length;for(;t--;)e.deleteRule(t);n.rules={}}),C1.clear())})}let Bl;function Ds(n){Bl=n}function Cf(){if(!Bl)throw new Error("Function called outside component initialization");return Bl}function WE(n){Cf().$$.on_mount.push(n)}function KE(n){Cf().$$.after_update.push(n)}function VE(n){Cf().$$.on_destroy.push(n)}function qE(){const n=Cf();return(e,t,{cancelable:r=!1}={})=>{const s=n.$$.callbacks[e];if(s){const i=$4(e,t,{cancelable:r});return s.slice().forEach(a=>{a.call(n,i)}),!i.defaultPrevented}return!0}}function dg(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(r=>r.call(this,e))}const il=[],op=[],Ud=[],hg=[],H4=Promise.resolve();let cp=!1;function G4(){cp||(cp=!0,H4.then(C5))}function JE(){return G4(),H4}function Zi(n){Ud.push(n)}const d6=new Set;let td=0;function C5(){const n=Bl;do{for(;td{Jc=null})),Jc}function h6(n,e,t){n.dispatchEvent($4(`${e?"intro":"outro"}${t}`))}const Ld=new Set;let Ms;function yn(){Ms={r:0,c:[],p:Ms}}function mn(){Ms.r||os(Ms.c),Ms=Ms.p}function $e(n,e){n&&n.i&&(Ld.delete(n),n.i(e))}function ze(n,e,t,r){if(n&&n.o){if(Ld.has(n))return;Ld.add(n),Ms.c.push(()=>{Ld.delete(n),r&&(t&&n.d(1),r())}),n.o(e)}else r&&r()}const ZE={duration:0};function Xi(n,e,t,r){let s=e(n,t),i=r?0:1,a=null,o=null,u=null;function c(){u&&GE(n,u)}function l(f,h){const p=f.b-i;return h*=Math.abs(p),{a:i,b:f.b,d:p,duration:h,start:f.start,end:f.start+h,group:f.group}}function d(f){const{delay:h=0,duration:p=300,easing:b=B4,tick:v=we,css:w}=s||ZE,m={start:FE()+h,b:f};f||(m.group=Ms,Ms.r+=1),a||o?o=m:(w&&(c(),u=fg(n,i,f,p,h,b,w)),f&&v(0,1),a=l(m,p),Zi(()=>h6(n,f,"start")),UE(x=>{if(o&&x>o.start&&(a=l(o,p),o=null,h6(n,a.b,"start"),w&&(c(),u=fg(n,i,a.b,a.duration,0,b,s.css))),a){if(x>=a.end)v(i=a.b,1-i),h6(n,a.b,"end"),o||(a.b?c():--a.group.r||os(a.group.c)),a=null;else if(x>=a.start){const y=x-a.start;i=a.a+a.d*b(y/a.duration),v(i,1-i)}}return!!(a||o)}))}return{run(f){lh(s)?YE().then(()=>{s=s(),d(f)}):d(f)},end(){c(),a=o=null}}}function hc(n,e){const t=e.token={};function r(s,i,a,o){if(e.token!==t)return;e.resolved=o;let u=e.ctx;a!==void 0&&(u=u.slice(),u[a]=o);const c=s&&(e.current=s)(u);let l=!1;e.block&&(e.blocks?e.blocks.forEach((d,f)=>{f!==i&&d&&(yn(),ze(d,1,1,()=>{e.blocks[f]===d&&(e.blocks[f]=null)}),mn())}):e.block.d(1),c.c(),$e(c,1),c.m(e.mount(),e.anchor),l=!0),e.block=c,e.blocks&&(e.blocks[i]=c),l&&C5()}if(NE(n)){const s=Cf();if(n.then(i=>{Ds(s),r(e.then,1,e.value,i),Ds(null)},i=>{if(Ds(s),r(e.catch,2,e.error,i),Ds(null),!e.hasCatch)throw i}),e.current!==e.pending)return r(e.pending,0),!0}else{if(e.current!==e.then)return r(e.then,1,e.value,n),!0;e.resolved=n}}function S5(n,e,t){const r=e.slice(),{resolved:s}=n;n.current===n.then&&(r[n.value]=s),n.current===n.catch&&(r[n.error]=s),n.block.p(r,t)}function z4(n,e){const t={},r={},s={$$scope:1};let i=n.length;for(;i--;){const a=n[i],o=e[i];if(o){for(const u in a)u in o||(r[u]=1);for(const u in o)s[u]||(t[u]=o[u],s[u]=1);n[i]=o}else for(const u in a)s[u]=1}for(const a in r)a in t||(t[a]=void 0);return t}function W4(n){return typeof n=="object"&&n!==null?n:{}}function Ir(n){n&&n.c()}function or(n,e,t,r){const{fragment:s,on_mount:i,on_destroy:a,after_update:o}=n.$$;s&&s.m(e,t),r||Zi(()=>{const u=i.map(U4).filter(lh);a?a.push(...u):os(u),n.$$.on_mount=[]}),o.forEach(Zi)}function cr(n,e){const t=n.$$;t.fragment!==null&&(os(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function XE(n,e){n.$$.dirty[0]===-1&&(il.push(n),G4(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const p=h.length?h[0]:f;return c.ctx&&s(c.ctx[d],c.ctx[d]=p)&&(!c.skip_bound&&c.bound[d]&&c.bound[d](p),l&&XE(n,d)),f}):[],c.update(),l=!0,os(c.before_update),c.fragment=r?r(c.ctx):!1,e.target){if(e.hydrate){const d=ME(e.target);c.fragment&&c.fragment.l(d),d.forEach(re)}else c.fragment&&c.fragment.c();e.intro&&$e(n.$$.fragment),or(n,e.target,e.anchor,e.customElement),C5()}Ds(u)}class _n{$destroy(){cr(this,1),this.$destroy=we}$on(e,t){const r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(t),()=>{const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}$set(e){this.$$set&&!IE(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Ha=[];function R5(n,e){return{subscribe:Ki(n,e).subscribe}}function Ki(n,e=we){let t;const r=new Set;function s(o){if(on(n,o)&&(n=o,t)){const u=!Ha.length;for(const c of r)c[1](),Ha.push(c,n);if(u){for(let c=0;c{r.delete(c),r.size===0&&(t(),t=null)}}return{set:s,update:i,subscribe:a}}function fr(n,e,t){const r=!Array.isArray(n),s=r?[n]:n,i=e.length<2;return R5(t,a=>{let o=!1;const u=[];let c=0,l=we;const d=()=>{if(c)return;l();const h=e(r?u[0]:u,a);i?a(h):l=lh(h)?h:we},f=s.map((h,p)=>P5(h,b=>{u[p]=b,c&=~(1<{c|=1<{cr(l,1)}),mn()}i?(e=new i(a()),e.$on("routeEvent",o[7]),Ir(e.$$.fragment),$e(e.$$.fragment,1),or(e,t.parentNode,t)):e=null}else i&&e.$set(c)},i(o){r||(e&&$e(e.$$.fragment,o),r=!0)},o(o){e&&ze(e.$$.fragment,o),r=!1},d(o){o&&re(t),e&&cr(e,o)}}}function n_(n){let e,t,r;const s=[{params:n[1]},n[2]];var i=n[0];function a(o){let u={};for(let c=0;c{cr(l,1)}),mn()}i?(e=new i(a()),e.$on("routeEvent",o[6]),Ir(e.$$.fragment),$e(e.$$.fragment,1),or(e,t.parentNode,t)):e=null}else i&&e.$set(c)},i(o){r||(e&&$e(e.$$.fragment,o),r=!0)},o(o){e&&ze(e.$$.fragment,o),r=!1},d(o){o&&re(t),e&&cr(e,o)}}}function r_(n){let e,t,r,s;const i=[n_,t_],a=[];function o(u,c){return u[1]?0:1}return e=o(n),t=a[e]=i[e](n),{c(){t.c(),r=cn()},m(u,c){a[e].m(u,c),se(u,r,c),s=!0},p(u,[c]){let l=e;e=o(u),e===l?a[e].p(u,c):(yn(),ze(a[l],1,1,()=>{a[l]=null}),mn(),t=a[e],t?t.p(u,c):(t=a[e]=i[e](u),t.c()),$e(t,1),t.m(r.parentNode,r))},i(u){s||($e(t),s=!0)},o(u){ze(t),s=!1},d(u){a[e].d(u),u&&re(r)}}}function pg(){const n=window.location.href.indexOf("#/");let e=n>-1?window.location.href.substr(n+1):"/";const t=e.indexOf("?");let r="";return t>-1&&(r=e.substr(t+1),e=e.substr(0,t)),{location:e,querystring:r}}const T5=R5(null,function(e){e(pg());const t=()=>{e(pg())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});fr(T5,n=>n.location);fr(T5,n=>n.querystring);const bg=Ki(void 0);function s_(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function i_(n,e,t){let{routes:r={}}=e,{prefix:s=""}=e,{restoreScrollState:i=!1}=e;class a{constructor(A,S){if(!S||typeof S!="function"&&(typeof S!="object"||S._sveltesparouter!==!0))throw Error("Invalid component object");if(!A||typeof A=="string"&&(A.length<1||A.charAt(0)!="/"&&A.charAt(0)!="*")||typeof A=="object"&&!(A instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:D,keys:O}=e_(A);this.path=A,typeof S=="object"&&S._sveltesparouter===!0?(this.component=S.component,this.conditions=S.conditions||[],this.userData=S.userData,this.props=S.props||{}):(this.component=()=>Promise.resolve(S),this.conditions=[],this.props={}),this._pattern=D,this._keys=O}match(A){if(s){if(typeof s=="string")if(A.startsWith(s))A=A.substr(s.length)||"/";else return null;else if(s instanceof RegExp){const _=A.match(s);if(_&&_[0])A=A.substr(_[0].length)||"/";else return null}}const S=this._pattern.exec(A);if(S===null)return null;if(this._keys===!1)return S;const D={};let O=0;for(;O{o.push(new a(A,y))}):Object.keys(r).forEach(y=>{o.push(new a(y,r[y]))});let u=null,c=null,l={};const d=qE();async function f(y,A){await JE(),d(y,A)}let h=null,p=null;i&&(p=y=>{y.state&&(y.state.__svelte_spa_router_scrollY||y.state.__svelte_spa_router_scrollX)?h=y.state:h=null},window.addEventListener("popstate",p),KE(()=>{s_(h)}));let b=null,v=null;const w=T5.subscribe(async y=>{b=y;let A=0;for(;A{bg.set(c)});return}t(0,u=null),v=null,bg.set(void 0)});VE(()=>{w(),p&&window.removeEventListener("popstate",p)});function m(y){dg.call(this,n,y)}function x(y){dg.call(this,n,y)}return n.$$set=y=>{"routes"in y&&t(3,r=y.routes),"prefix"in y&&t(4,s=y.prefix),"restoreScrollState"in y&&t(5,i=y.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=i?"manual":"auto")},[u,c,l,r,s,i,m,x]}class a_ extends _n{constructor(e){super(),En(this,e,i_,r_,on,{routes:3,prefix:4,restoreScrollState:5})}}function o_(n){let e;return{c(){e=ce("nav"),e.innerHTML=``,Fe(e,"class","thc--header")},m(t,r){se(t,e,r)},p:we,i:we,o:we,d(t){t&&re(e)}}}class c_ extends _n{constructor(e){super(),En(this,e,null,o_,on,{})}}function e0(n,{delay:e=0,duration:t=400,easing:r=B4}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:r,css:i=>`opacity: ${i*s}`}}const K4="6.7.0";function u_(n,e,t){const r=e.split("|").map(i=>i.trim());for(let i=0;iPromise.resolve(n[r])))).reduce((r,s,i)=>(r[e[i]]=s,r),{})}function Te(n,e,t){for(let r in e){let s=e[r];const i=t?t[r]:null;i&&u_(s,i,r),Object.defineProperty(n,r,{enumerable:!0,value:s,writable:!1})}}function io(n){if(n==null)return"null";if(Array.isArray(n))return"[ "+n.map(io).join(", ")+" ]";if(n instanceof Uint8Array){const e="0123456789abcdef";let t="0x";for(let r=0;r>4],t+=e[n[r]&15];return t}if(typeof n=="object"&&typeof n.toJSON=="function")return io(n.toJSON());switch(typeof n){case"boolean":case"symbol":return n.toString();case"bigint":return BigInt(n).toString();case"number":return n.toString();case"string":return JSON.stringify(n);case"object":{const e=Object.keys(n);return e.sort(),"{ "+e.map(t=>`${io(t)}: ${io(n[t])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function ir(n,e){return n&&n.code===e}function O5(n){return ir(n,"CALL_EXCEPTION")}function _t(n,e,t){{const s=[];if(t){if("message"in t||"code"in t||"name"in t)throw new Error(`value will overwrite populated values: ${io(t)}`);for(const i in t){const a=t[i];s.push(i+"="+io(a))}}s.push(`code=${e}`),s.push(`version=${K4}`),s.length&&(n+=" ("+s.join(", ")+")")}let r;switch(e){case"INVALID_ARGUMENT":r=new TypeError(n);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":r=new RangeError(n);break;default:r=new Error(n)}return Te(r,{code:e}),t&&Object.assign(r,t),r}function ae(n,e,t,r){if(!n)throw _t(e,t,r)}function Z(n,e,t,r){ae(n,e,"INVALID_ARGUMENT",{argument:t,value:r})}function V4(n,e,t){t==null&&(t=""),t&&(t=": "+t),ae(n>=e,"missing arguemnt"+t,"MISSING_ARGUMENT",{count:n,expectedCount:e}),ae(n<=e,"too many arguemnts"+t,"UNEXPECTED_ARGUMENT",{count:n,expectedCount:e})}const l_=["NFD","NFC","NFKD","NFKC"].reduce((n,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"){const t=String.fromCharCode(233).normalize("NFD"),r=String.fromCharCode(101,769);if(t!==r)throw new Error("broken")}n.push(e)}catch{}return n},[]);function q4(n){ae(l_.indexOf(n)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:n}})}function Na(n,e,t){if(t==null&&(t=""),n!==e){let r=t,s="new";t&&(r+=".",s+=" "+t),ae(!1,`private constructor; use ${r}from* methods`,"UNSUPPORTED_OPERATION",{operation:s})}}function J4(n,e,t){if(n instanceof Uint8Array)return t?new Uint8Array(n):n;if(typeof n=="string"&&n.match(/^0x([0-9a-f][0-9a-f])*$/i)){const r=new Uint8Array((n.length-2)/2);let s=2;for(let i=0;i>4]+gg[s&15]}return t}function ot(n){return"0x"+n.map(e=>de(e).substring(2)).join("")}function bo(n){return yt(n,!0)?(n.length-2)/2:Ce(n).length}function ft(n,e,t){const r=Ce(n);return t!=null&&t>r.length&&ae(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:t}),de(r.slice(e??0,t??r.length))}function Y4(n,e,t){const r=Ce(n);ae(e>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:e,offset:e+1});const s=new Uint8Array(e);return s.fill(0),t?s.set(r,e-r.length):s.set(r,0),de(s)}function ma(n,e){return Y4(n,e,!0)}function f_(n,e){return Y4(n,e,!1)}const fh=BigInt(0),Tr=BigInt(1),ao=9007199254740991;function d_(n,e){const t=dh(n,"value"),r=BigInt(He(e,"width"));if(ae(t>>r===fh,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:n}),t>>r-Tr){const s=(Tr<=-ao&&n<=ao,"overflow",e||"value",n),BigInt(n);case"string":try{if(n==="")throw new Error("empty string");return n[0]==="-"&&n[1]!=="-"?-BigInt(n.substring(1)):BigInt(n)}catch(t){Z(!1,`invalid BigNumberish string: ${t.message}`,e||"value",n)}}Z(!1,"invalid BigNumberish value",e||"value",n)}function dh(n,e){const t=Ne(n,e);return ae(t>=fh,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:n}),t}const yg="0123456789abcdef";function hh(n){if(n instanceof Uint8Array){let e="0x0";for(const t of n)e+=yg[t>>4],e+=yg[t&15];return BigInt(e)}return Ne(n)}function He(n,e){switch(typeof n){case"bigint":return Z(n>=-ao&&n<=ao,"overflow",e||"value",n),Number(n);case"number":return Z(Number.isInteger(n),"underflow",e||"value",n),Z(n>=-ao&&n<=ao,"overflow",e||"value",n),n;case"string":try{if(n==="")throw new Error("empty string");return He(BigInt(n),e)}catch(t){Z(!1,`invalid numeric string: ${t.message}`,e||"value",n)}}Z(!1,"invalid numeric value",e||"value",n)}function h_(n){return He(hh(n))}function Ks(n,e){let r=dh(n,"value").toString(16);if(e==null)r.length%2&&(r="0"+r);else{const s=He(e,"width");for(ae(s*2>=r.length,`value exceeds width (${s} bits)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:n});r.length>6===2;a++)i++;return i}return n==="OVERRUN"?t.length-e-1:0}function w_(n,e,t,r,s){return n==="OVERLONG"?(Z(typeof s=="number","invalid bad code point for replacement","badCodepoint",s),r.push(s),0):(r.push(65533),t7(n,e,t))}const v_=Object.freeze({error:x_,ignore:t7,replace:w_});function A_(n,e){e==null&&(e=v_.error);const t=Ce(n,"bytes"),r=[];let s=0;for(;s>7)){r.push(i);continue}let a=null,o=null;if((i&224)===192)a=1,o=127;else if((i&240)===224)a=2,o=2047;else if((i&248)===240)a=3,o=65535;else{(i&192)===128?s+=e("UNEXPECTED_CONTINUE",s-1,t,r):s+=e("BAD_PREFIX",s-1,t,r);continue}if(s-1+a>=t.length){s+=e("OVERRUN",s-1,t,r);continue}let u=i&(1<<8-a-1)-1;for(let c=0;c1114111){s+=e("OUT_OF_RANGE",s-1-a,t,r,u);continue}if(u>=55296&&u<=57343){s+=e("UTF16_SURROGATE",s-1-a,t,r,u);continue}if(u<=o){s+=e("OVERLONG",s-1-a,t,r,u);continue}r.push(u)}}return r}function Pt(n,e){e!=null&&(q4(e),n=n.normalize(e));let t=[];for(let r=0;r>6|192),t.push(s&63|128);else if((s&64512)==55296){r++;const i=n.charCodeAt(r);Z(r>18|240),t.push(a>>12&63|128),t.push(a>>6&63|128),t.push(a&63|128)}else t.push(s>>12|224),t.push(s>>6&63|128),t.push(s&63|128)}return new Uint8Array(t)}function E_(n){return n.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function N5(n,e){return E_(A_(n,e))}async function __(n,e){const t=n.url.split(":")[0].toLowerCase();ae(t==="http"||t==="https",`unsupported protocol ${t}`,"UNSUPPORTED_OPERATION",{info:{protocol:t},operation:"request"}),ae(t==="https"||!n.credentials||n.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let r;if(e){const c=new AbortController;r=c.signal,e.addListener(()=>{c.abort()})}const s={method:n.method,headers:new Headers(Array.from(n)),body:n.body||void 0,signal:r},i=await fetch(n.url,s),a={};i.headers.forEach((c,l)=>{a[l.toLowerCase()]=c});const o=await i.arrayBuffer(),u=o==null?null:new Uint8Array(o);return{statusCode:i.status,statusMessage:i.statusText,headers:a,body:u}}const P_=12,k_=250;let mg=__;const C_=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),S_=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let p6=!1;async function n7(n,e){try{const t=n.match(C_);if(!t)throw new Error("invalid data");return new Vi(200,"OK",{"content-type":t[1]||"text/plain"},t[2]?y_(t[3]):T_(t[3]))}catch{return new Vi(599,"BAD REQUEST (invalid data: URI)",{},null,new Vs(n))}}function r7(n){async function e(t,r){try{const s=t.match(S_);if(!s)throw new Error("invalid link");return new Vs(`${n}${s[2]}`)}catch{return new Vi(599,"BAD REQUEST (invalid IPFS URI)",{},null,new Vs(t))}}return e}const rd={data:n7,ipfs:r7("https://gateway.ipfs.io/ipfs/")},s7=new WeakMap;var H0,_i;class R_{constructor(e){$(this,H0,void 0);$(this,_i,void 0);k(this,H0,[]),k(this,_i,!1),s7.set(e,()=>{if(!g(this,_i)){k(this,_i,!0);for(const t of g(this,H0))setTimeout(()=>{t()},0);k(this,H0,[])}})}addListener(e){ae(!g(this,_i),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),g(this,H0).push(e)}get cancelled(){return g(this,_i)}checkSignal(){ae(!this.cancelled,"cancelled","CANCELLED",{})}}H0=new WeakMap,_i=new WeakMap;function sd(n){if(n==null)throw new Error("missing signal; should not happen");return n.checkSignal(),n}var wo,vo,Er,_s,Ao,Eo,Ct,Bn,Ps,G0,z0,W0,zr,ks,K0,ol;const th=class th{constructor(e){$(this,K0);$(this,wo,void 0);$(this,vo,void 0);$(this,Er,void 0);$(this,_s,void 0);$(this,Ao,void 0);$(this,Eo,void 0);$(this,Ct,void 0);$(this,Bn,void 0);$(this,Ps,void 0);$(this,G0,void 0);$(this,z0,void 0);$(this,W0,void 0);$(this,zr,void 0);$(this,ks,void 0);k(this,Eo,String(e)),k(this,wo,!1),k(this,vo,!0),k(this,Er,{}),k(this,_s,""),k(this,Ao,3e5),k(this,ks,{slotInterval:k_,maxAttempts:P_})}get url(){return g(this,Eo)}set url(e){k(this,Eo,String(e))}get body(){return g(this,Ct)==null?null:new Uint8Array(g(this,Ct))}set body(e){if(e==null)k(this,Ct,void 0),k(this,Bn,void 0);else if(typeof e=="string")k(this,Ct,Pt(e)),k(this,Bn,"text/plain");else if(e instanceof Uint8Array)k(this,Ct,e),k(this,Bn,"application/octet-stream");else if(typeof e=="object")k(this,Ct,Pt(JSON.stringify(e))),k(this,Bn,"application/json");else throw new Error("invalid body")}hasBody(){return g(this,Ct)!=null}get method(){return g(this,_s)?g(this,_s):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),k(this,_s,String(e).toUpperCase())}get headers(){const e=Object.assign({},g(this,Er));return g(this,Ps)&&(e.authorization=`Basic ${m_(Pt(g(this,Ps)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&g(this,Bn)&&(e["content-type"]=g(this,Bn)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,t){g(this,Er)[String(e).toLowerCase()]=String(t)}clearHeaders(){k(this,Er,{})}[Symbol.iterator](){const e=this.headers,t=Object.keys(e);let r=0;return{next:()=>{if(r=0,"timeout must be non-zero","timeout",e),k(this,Ao,e)}get preflightFunc(){return g(this,G0)||null}set preflightFunc(e){k(this,G0,e)}get processFunc(){return g(this,z0)||null}set processFunc(e){k(this,z0,e)}get retryFunc(){return g(this,W0)||null}set retryFunc(e){k(this,W0,e)}toString(){return``}setThrottleParams(e){e.slotInterval!=null&&(g(this,ks).slotInterval=e.slotInterval),e.maxAttempts!=null&&(g(this,ks).maxAttempts=e.maxAttempts)}send(){return ae(g(this,zr)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),k(this,zr,new R_(this)),Q(this,K0,ol).call(this,0,xg()+this.timeout,0,this,new Vi(0,"",{},null,this))}cancel(){ae(g(this,zr)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=s7.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const t=this.url.split(":")[0].toLowerCase(),r=e.split(":")[0].toLowerCase();ae(this.method==="GET"&&(t!=="https"||r!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const s=new th(e);return s.method="GET",s.allowGzip=this.allowGzip,s.timeout=this.timeout,k(s,Er,Object.assign({},g(this,Er))),g(this,Ct)&&k(s,Ct,new Uint8Array(g(this,Ct))),k(s,Bn,g(this,Bn)),s}clone(){const e=new th(this.url);return k(e,_s,g(this,_s)),g(this,Ct)&&k(e,Ct,g(this,Ct)),k(e,Bn,g(this,Bn)),k(e,Er,Object.assign({},g(this,Er))),k(e,Ps,g(this,Ps)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),k(e,G0,g(this,G0)),k(e,z0,g(this,z0)),k(e,W0,g(this,W0)),e}static lockConfig(){p6=!0}static getGateway(e){return rd[e.toLowerCase()]||null}static registerGateway(e,t){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(p6)throw new Error("gateways locked");rd[e]=t}static registerGetUrl(e){if(p6)throw new Error("gateways locked");mg=e}static createDataGateway(){return n7}static createIpfsGatewayFunc(e){return r7(e)}};wo=new WeakMap,vo=new WeakMap,Er=new WeakMap,_s=new WeakMap,Ao=new WeakMap,Eo=new WeakMap,Ct=new WeakMap,Bn=new WeakMap,Ps=new WeakMap,G0=new WeakMap,z0=new WeakMap,W0=new WeakMap,zr=new WeakMap,ks=new WeakMap,K0=new WeakSet,ol=async function(e,t,r,s,i){var l,d,f;if(e>=g(this,ks).maxAttempts)return i.makeServerError("exceeded maximum retry limit");ae(xg()<=t,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:s}),r>0&&await O_(r);let a=this.clone();const o=(a.url.split(":")[0]||"").toLowerCase();if(o in rd){const h=await rd[o](a.url,sd(g(s,zr)));if(h instanceof Vi){let p=h;if(this.processFunc){sd(g(s,zr));try{p=await this.processFunc(a,p)}catch(b){(b.throttle==null||typeof b.stall!="number")&&p.makeServerError("error in post-processing function",b).assertOk()}}return p}a=h}this.preflightFunc&&(a=await this.preflightFunc(a));const u=await mg(a,sd(g(s,zr)));let c=new Vi(u.statusCode,u.statusMessage,u.headers,u.body,s);if(c.statusCode===301||c.statusCode===302){try{const h=c.headers.location||"";return Q(l=a.redirect(h),K0,ol).call(l,e+1,t,0,s,c)}catch{}return c}else if(c.statusCode===429&&(this.retryFunc==null||await this.retryFunc(a,c,e))){const h=c.headers["retry-after"];let p=g(this,ks).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof h=="string"&&h.match(/^[1-9][0-9]*$/)&&(p=parseInt(h)),Q(d=a.clone(),K0,ol).call(d,e+1,t,p,s,c)}if(this.processFunc){sd(g(s,zr));try{c=await this.processFunc(a,c)}catch(h){(h.throttle==null||typeof h.stall!="number")&&c.makeServerError("error in post-processing function",h).assertOk();let p=g(this,ks).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return h.stall>=0&&(p=h.stall),Q(f=a.clone(),K0,ol).call(f,e+1,t,p,s,c)}}return c};let Vs=th;var Zl,Xl,ef,_r,_o,V0;const Zb=class Zb{constructor(e,t,r,s,i){$(this,Zl,void 0);$(this,Xl,void 0);$(this,ef,void 0);$(this,_r,void 0);$(this,_o,void 0);$(this,V0,void 0);k(this,Zl,e),k(this,Xl,t),k(this,ef,Object.keys(r).reduce((a,o)=>(a[o.toLowerCase()]=String(r[o]),a),{})),k(this,_r,s==null?null:new Uint8Array(s)),k(this,_o,i||null),k(this,V0,{message:""})}toString(){return``}get statusCode(){return g(this,Zl)}get statusMessage(){return g(this,Xl)}get headers(){return Object.assign({},g(this,ef))}get body(){return g(this,_r)==null?null:new Uint8Array(g(this,_r))}get bodyText(){try{return g(this,_r)==null?"":N5(g(this,_r))}catch{ae(!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{ae(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,t=Object.keys(e);let r=0;return{next:()=>{if(r=0,"invalid stall timeout","stall",t);const r=new Error(e||"throttling requests");throw Te(r,{stall:t,throttle:!0}),r}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return g(this,_r)!=null}get request(){return g(this,_o)}ok(){return g(this,V0).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:t}=g(this,V0);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`),ae(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:t})}};Zl=new WeakMap,Xl=new WeakMap,ef=new WeakMap,_r=new WeakMap,_o=new WeakMap,V0=new WeakMap;let Vi=Zb;function xg(){return new Date().getTime()}function T_(n){return Pt(n.replace(/%([0-9a-f][0-9a-f])/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))}function O_(n){return new Promise(e=>setTimeout(e,n))}function N_(n){let e=n.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function wg(n,e,t){let r=0;for(let s=0;s{ae(r<=n.length,"data short segment too short","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:r})};if(n[e]>=248){const r=n[e]-247;t(e+1+r);const s=wg(n,e+1,r);return t(e+1+r+s),vg(n,e,e+1+r,r+s)}else if(n[e]>=192){const r=n[e]-192;return t(e+1+r),vg(n,e,e+1,r)}else if(n[e]>=184){const r=n[e]-183;t(e+1+r);const s=wg(n,e+1,r);t(e+1+r+s);const i=de(n.slice(e+1+r,e+1+r+s));return{consumed:1+r+s,result:i}}else if(n[e]>=128){const r=n[e]-128;t(e+1+r);const s=de(n.slice(e+1,e+1+r));return{consumed:1+r,result:s}}return{consumed:1,result:N_(n[e])}}function I5(n){const e=Ce(n,"data"),t=i7(e,0);return Z(t.consumed===e.length,"unexpected junk after rlp payload","data",n),t.result}function Ag(n){const e=[];for(;n;)e.unshift(n&255),n>>=8;return e}function a7(n){if(Array.isArray(n)){let r=[];if(n.forEach(function(i){r=r.concat(a7(i))}),r.length<=55)return r.unshift(192+r.length),r;const s=Ag(r.length);return s.unshift(247+s.length),s.concat(r)}const e=Array.prototype.slice.call(Ce(n,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const t=Ag(e.length);return t.unshift(183+t.length),t.concat(e)}const Eg="0123456789abcdef";function Fl(n){let e="0x";for(const t of a7(n))e+=Eg[t>>4],e+=Eg[t&15];return e}function I_(n){const e=Ce(n,"randomBytes");e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=de(e);return[t.substring(2,10),t.substring(10,14),t.substring(14,18),t.substring(18,22),t.substring(22,34)].join("-")}const tn=32,fp=new Uint8Array(tn),B_=["then"],id={};function Qc(n,e){const t=new Error(`deferred error during ABI decoding triggered accessing ${n}`);throw t.error=e,t}var Pi,ga;let o7=(ga=class extends Array{constructor(...t){const r=t[0];let s=t[1],i=(t[2]||[]).slice(),a=!0;r!==id&&(s=t,i=[],a=!1);super(s.length);$(this,Pi,void 0);s.forEach((u,c)=>{this[c]=u});const o=i.reduce((u,c)=>(typeof c=="string"&&u.set(c,(u.get(c)||0)+1),u),new Map);if(k(this,Pi,Object.freeze(s.map((u,c)=>{const l=i[c];return l!=null&&o.get(l)===1?l:null}))),!!a)return Object.freeze(this),new Proxy(this,{get:(u,c,l)=>{if(typeof c=="string"){if(c.match(/^[0-9]+$/)){const f=He(c,"%index");if(f<0||f>=this.length)throw new RangeError("out of result range");const h=u[f];return h instanceof Error&&Qc(`index ${f}`,h),h}if(B_.indexOf(c)>=0)return Reflect.get(u,c,l);const d=u[c];if(d instanceof Function)return function(...f){return d.apply(this===l?u:this,f)};if(!(c in u))return u.getValue.apply(this===l?u:this,[c])}return Reflect.get(u,c,l)}})}toArray(){const t=[];return this.forEach((r,s)=>{r instanceof Error&&Qc(`index ${s}`,r),t.push(r)}),t}toObject(){return g(this,Pi).reduce((t,r,s)=>(ae(r!=null,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"}),r in t||(t[r]=this.getValue(r)),t),{})}slice(t,r){t==null&&(t=0),t<0&&(t+=this.length,t<0&&(t=0)),r==null&&(r=this.length),r<0&&(r+=this.length,r<0&&(r=0)),r>this.length&&(r=this.length);const s=[],i=[];for(let a=t;a{g(this,Cs)[e]=_g(t)}}},Cs=new WeakMap,q0=new WeakMap,Po=new WeakSet,Dd=function(e){return g(this,Cs).push(e),k(this,q0,g(this,q0)+e.length),e.length},R4);var Fn,Xn,nh,c7,tf;let F_=(tf=class{constructor(e,t){$(this,nh);R(this,"allowLoose");$(this,Fn,void 0);$(this,Xn,void 0);Te(this,{allowLoose:!!t}),k(this,Fn,qt(e)),k(this,Xn,0)}get data(){return de(g(this,Fn))}get dataLength(){return g(this,Fn).length}get consumed(){return g(this,Xn)}get bytes(){return new Uint8Array(g(this,Fn))}subReader(e){return new tf(g(this,Fn).slice(g(this,Xn)+e),this.allowLoose)}readBytes(e,t){let r=Q(this,nh,c7).call(this,0,e,!!t);return k(this,Xn,g(this,Xn)+r.length),r.slice(0,e)}readValue(){return hh(this.readBytes(tn))}readIndex(){return h_(this.readBytes(tn))}},Fn=new WeakMap,Xn=new WeakMap,nh=new WeakSet,c7=function(e,t,r){let s=Math.ceil(t/tn)*tn;return g(this,Xn)+s>g(this,Fn).length&&(this.allowLoose&&r&&g(this,Xn)+t<=g(this,Fn).length?s=t:ae(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:qt(g(this,Fn)),length:g(this,Fn).length,offset:g(this,Xn)+s})),g(this,Fn).slice(g(this,Xn),g(this,Xn)+s)},tf);function hp(n){if(!Number.isSafeInteger(n)||n<0)throw new Error(`Wrong positive integer: ${n}`)}function U_(n){if(typeof n!="boolean")throw new Error(`Expected boolean, not ${n}`)}function u7(n,...e){if(!(n instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(e.length>0&&!e.includes(n.length))throw new TypeError(`Expected Uint8Array of length ${e}, not of length=${n.length}`)}function L_(n){if(typeof n!="function"||typeof n.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");hp(n.outputLen),hp(n.blockLen)}function D_(n,e=!0){if(n.destroyed)throw new Error("Hash instance has been destroyed");if(e&&n.finished)throw new Error("Hash#digest() has already been called")}function M_(n,e){u7(n);const t=e.outputLen;if(n.lengthnew Uint32Array(n.buffer,n.byteOffset,Math.floor(n.byteLength/4)),Pl=n=>new DataView(n.buffer,n.byteOffset,n.byteLength),$r=(n,e)=>n<<32-e|n>>>e,j_=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!j_)throw new Error("Non little-endian hardware is not supported");Array.from({length:256},(n,e)=>e.toString(16).padStart(2,"0"));const $_=async()=>{};async function pp(n,e,t){let r=Date.now();for(let s=0;s=0&&iObject.prototype.toString.call(n)==="[object Object]"&&n.constructor===Object;function l7(n,e){if(e!==void 0&&(typeof e!="object"||!G_(e)))throw new TypeError("Options should be object or undefined");return Object.assign(n,e)}function Oc(n){const e=r=>n().update(xa(r)).digest(),t=n();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>n(),e}function z_(n){const e=(r,s)=>n(s).update(xa(r)).digest(),t=n({});return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=r=>n(r),e}class f7 extends R1{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,pt.hash(e);const r=xa(t);if(this.iHash=e.create(),!(this.iHash instanceof R1))throw new TypeError("Expected instance of class which extends utils.Hash");const s=this.blockLen=this.iHash.blockLen;this.outputLen=this.iHash.outputLen;const i=new Uint8Array(s);i.set(r.length>this.iHash.blockLen?e.create().update(r).digest():r);for(let a=0;anew f7(n,e).update(t).digest();ph.create=(n,e)=>new f7(n,e);const W_=Object.freeze(Object.defineProperty({__proto__:null,hmac:ph},Symbol.toStringTag,{value:"Module"}));function d7(n,e,t,r){pt.hash(n);const s=l7({dkLen:32,asyncTick:10},r),{c:i,dkLen:a,asyncTick:o}=s;if(pt.number(i),pt.number(a),pt.number(o),i<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const u=xa(e),c=xa(t),l=new Uint8Array(a),d=ph.create(n,u),f=d._cloneInto().update(c);return{c:i,dkLen:a,asyncTick:o,DK:l,PRF:d,PRFSalt:f}}function h7(n,e,t,r,s){return n.destroy(),e.destroy(),r&&r.destroy(),s.fill(0),t}function bh(n,e,t,r){const{c:s,dkLen:i,DK:a,PRF:o,PRFSalt:u}=d7(n,e,t,r);let c;const l=new Uint8Array(4),d=Pl(l),f=new Uint8Array(o.outputLen);for(let h=1,p=0;p{u._cloneInto(l).update(h).digestInto(h);for(let m=0;m>s&i),o=Number(t&i),u=r?4:0,c=r?0:4;n.setUint32(e+u,a,r),n.setUint32(e+c,o,r)}class B5 extends R1{constructor(e,t,r,s){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Pl(this.buffer)}update(e){pt.exists(this);const{view:t,buffer:r,blockLen:s}=this;e=xa(e);const i=e.length;for(let a=0;as-a&&(this.process(r,0),a=0);for(let u=a;uo.setUint32(4*c,u,i))}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:s,finished:i,destroyed:a,pos:o}=this;return e.length=s,e.pos=o,e.finished=i,e.destroyed=a,s%t&&e.buffer.set(r),e}}const J_=(n,e,t)=>n&e^~n&t,Q_=(n,e,t)=>n&e^n&t^e&t,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]),fi=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),di=new Uint32Array(64);class Z_ extends B5{constructor(){super(64,32,8,!1),this.A=fi[0]|0,this.B=fi[1]|0,this.C=fi[2]|0,this.D=fi[3]|0,this.E=fi[4]|0,this.F=fi[5]|0,this.G=fi[6]|0,this.H=fi[7]|0}get(){const{A:e,B:t,C:r,D:s,E:i,F:a,G:o,H:u}=this;return[e,t,r,s,i,a,o,u]}set(e,t,r,s,i,a,o,u){this.A=e|0,this.B=t|0,this.C=r|0,this.D=s|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=u|0}process(e,t){for(let d=0;d<16;d++,t+=4)di[d]=e.getUint32(t,!1);for(let d=16;d<64;d++){const f=di[d-15],h=di[d-2],p=$r(f,7)^$r(f,18)^f>>>3,b=$r(h,17)^$r(h,19)^h>>>10;di[d]=b+di[d-7]+p+di[d-16]|0}let{A:r,B:s,C:i,D:a,E:o,F:u,G:c,H:l}=this;for(let d=0;d<64;d++){const f=$r(o,6)^$r(o,11)^$r(o,25),h=l+f+J_(o,u,c)+Y_[d]+di[d]|0,b=($r(r,2)^$r(r,13)^$r(r,22))+Q_(r,s,i)|0;l=c,c=u,u=o,o=a+h|0,a=i,i=s,s=r,r=h+b|0}r=r+this.A|0,s=s+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,u=u+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(r,s,i,a,o,u,c,l)}roundClean(){di.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Nc=Oc(()=>new Z_),X_=Object.freeze(Object.defineProperty({__proto__:null,sha256:Nc},Symbol.toStringTag,{value:"Module"})),ad=BigInt(2**32-1),bp=BigInt(32);function p7(n,e=!1){return e?{h:Number(n&ad),l:Number(n>>bp&ad)}:{h:Number(n>>bp&ad)|0,l:Number(n&ad)|0}}function eP(n,e=!1){let t=new Uint32Array(n.length),r=new Uint32Array(n.length);for(let s=0;sBigInt(n>>>0)<>>0),nP=(n,e,t)=>n>>>t,rP=(n,e,t)=>n<<32-t|e>>>t,sP=(n,e,t)=>n>>>t|e<<32-t,iP=(n,e,t)=>n<<32-t|e>>>t,aP=(n,e,t)=>n<<64-t|e>>>t-32,oP=(n,e,t)=>n>>>t-32|e<<64-t,cP=(n,e)=>e,uP=(n,e)=>n,lP=(n,e,t)=>n<>>32-t,fP=(n,e,t)=>e<>>32-t,dP=(n,e,t)=>e<>>64-t,hP=(n,e,t)=>n<>>64-t;function pP(n,e,t,r){const s=(e>>>0)+(r>>>0);return{h:n+t+(s/2**32|0)|0,l:s|0}}const bP=(n,e,t)=>(n>>>0)+(e>>>0)+(t>>>0),gP=(n,e,t,r)=>e+t+r+(n/2**32|0)|0,yP=(n,e,t,r)=>(n>>>0)+(e>>>0)+(t>>>0)+(r>>>0),mP=(n,e,t,r,s)=>e+t+r+s+(n/2**32|0)|0,xP=(n,e,t,r,s)=>(n>>>0)+(e>>>0)+(t>>>0)+(r>>>0)+(s>>>0),wP=(n,e,t,r,s,i)=>e+t+r+s+i+(n/2**32|0)|0,je={fromBig:p7,split:eP,toBig:tP,shrSH:nP,shrSL:rP,rotrSH:sP,rotrSL:iP,rotrBH:aP,rotrBL:oP,rotr32H:cP,rotr32L:uP,rotlSH:lP,rotlSL:fP,rotlBH:dP,rotlBL:hP,add:pP,add3L:bP,add3H:gP,add4L:yP,add4H:mP,add5H:wP,add5L:xP},[vP,AP]=je.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(n=>BigInt(n))),hi=new Uint32Array(80),pi=new Uint32Array(80);class gh extends B5{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:r,Bl:s,Ch:i,Cl:a,Dh:o,Dl:u,Eh:c,El:l,Fh:d,Fl:f,Gh:h,Gl:p,Hh:b,Hl:v}=this;return[e,t,r,s,i,a,o,u,c,l,d,f,h,p,b,v]}set(e,t,r,s,i,a,o,u,c,l,d,f,h,p,b,v){this.Ah=e|0,this.Al=t|0,this.Bh=r|0,this.Bl=s|0,this.Ch=i|0,this.Cl=a|0,this.Dh=o|0,this.Dl=u|0,this.Eh=c|0,this.El=l|0,this.Fh=d|0,this.Fl=f|0,this.Gh=h|0,this.Gl=p|0,this.Hh=b|0,this.Hl=v|0}process(e,t){for(let x=0;x<16;x++,t+=4)hi[x]=e.getUint32(t),pi[x]=e.getUint32(t+=4);for(let x=16;x<80;x++){const y=hi[x-15]|0,A=pi[x-15]|0,S=je.rotrSH(y,A,1)^je.rotrSH(y,A,8)^je.shrSH(y,A,7),D=je.rotrSL(y,A,1)^je.rotrSL(y,A,8)^je.shrSL(y,A,7),O=hi[x-2]|0,_=pi[x-2]|0,E=je.rotrSH(O,_,19)^je.rotrBH(O,_,61)^je.shrSH(O,_,6),C=je.rotrSL(O,_,19)^je.rotrBL(O,_,61)^je.shrSL(O,_,6),P=je.add4L(D,C,pi[x-7],pi[x-16]),I=je.add4H(P,S,E,hi[x-7],hi[x-16]);hi[x]=I|0,pi[x]=P|0}let{Ah:r,Al:s,Bh:i,Bl:a,Ch:o,Cl:u,Dh:c,Dl:l,Eh:d,El:f,Fh:h,Fl:p,Gh:b,Gl:v,Hh:w,Hl:m}=this;for(let x=0;x<80;x++){const y=je.rotrSH(d,f,14)^je.rotrSH(d,f,18)^je.rotrBH(d,f,41),A=je.rotrSL(d,f,14)^je.rotrSL(d,f,18)^je.rotrBL(d,f,41),S=d&h^~d&b,D=f&p^~f&v,O=je.add5L(m,A,D,AP[x],pi[x]),_=je.add5H(O,w,y,S,vP[x],hi[x]),E=O|0,C=je.rotrSH(r,s,28)^je.rotrBH(r,s,34)^je.rotrBH(r,s,39),P=je.rotrSL(r,s,28)^je.rotrBL(r,s,34)^je.rotrBL(r,s,39),I=r&i^r&o^i&o,j=s&a^s&u^a&u;w=b|0,m=v|0,b=h|0,v=p|0,h=d|0,p=f|0,{h:d,l:f}=je.add(c|0,l|0,_|0,E|0),c=o|0,l=u|0,o=i|0,u=a|0,i=r|0,a=s|0;const z=je.add3L(E,P,j);r=je.add3H(z,_,C,I),s=z|0}({h:r,l:s}=je.add(this.Ah|0,this.Al|0,r|0,s|0)),{h:i,l:a}=je.add(this.Bh|0,this.Bl|0,i|0,a|0),{h:o,l:u}=je.add(this.Ch|0,this.Cl|0,o|0,u|0),{h:c,l}=je.add(this.Dh|0,this.Dl|0,c|0,l|0),{h:d,l:f}=je.add(this.Eh|0,this.El|0,d|0,f|0),{h,l:p}=je.add(this.Fh|0,this.Fl|0,h|0,p|0),{h:b,l:v}=je.add(this.Gh|0,this.Gl|0,b|0,v|0),{h:w,l:m}=je.add(this.Hh|0,this.Hl|0,w|0,m|0),this.set(r,s,i,a,o,u,c,l,d,f,h,p,b,v,w,m)}roundClean(){hi.fill(0),pi.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 EP extends gh{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class _P extends gh{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}const yh=Oc(()=>new gh),PP=Oc(()=>new EP),kP=Oc(()=>new _P),CP=Object.freeze(Object.defineProperty({__proto__:null,SHA512:gh,sha384:kP,sha512:yh,sha512_256:PP},Symbol.toStringTag,{value:"Module"}));function SP(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}const Pg=SP(),kg=Pg.crypto||Pg.msCrypto;function RP(n){switch(n){case"sha256":return Nc.create();case"sha512":return yh.create()}Z(!1,"invalid hashing algorithm name","algorithm",n)}function TP(n,e){const t={sha256:Nc,sha512:yh}[n];return Z(t!=null,"invalid hmac algorithm","algorithm",n),ph.create(t,e)}function OP(n,e,t,r,s){const i={sha256:Nc,sha512:yh}[s];return Z(i!=null,"invalid pbkdf2 algorithm","algorithm",s),bh(i,n,e,{c:t,dkLen:r})}function NP(n){ae(kg!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),Z(Number.isInteger(n)&&n>0&&n<=1024,"invalid length","length",n);const e=new Uint8Array(n);return kg.getRandomValues(e),e}let b7=!1;const g7=function(n,e,t){return TP(n,e).update(t).digest()};let y7=g7;function Ia(n,e,t){const r=Ce(e,"key"),s=Ce(t,"data");return de(y7(n,r,s))}Ia._=g7;Ia.lock=function(){b7=!0};Ia.register=function(n){if(b7)throw new Error("computeHmac is locked");y7=n};Object.freeze(Ia);const[m7,x7,w7]=[[],[],[]],IP=BigInt(0),Yc=BigInt(1),BP=BigInt(2),FP=BigInt(7),UP=BigInt(256),LP=BigInt(113);for(let n=0,e=Yc,t=1,r=0;n<24;n++){[t,r]=[r,(2*t+3*r)%5],m7.push(2*(5*r+t)),x7.push((n+1)*(n+2)/2%64);let s=IP;for(let i=0;i<7;i++)e=(e<>FP)*LP)%UP,e&BP&&(s^=Yc<<(Yc<t>32?je.rotlBH(n,e,t):je.rotlSH(n,e,t),Sg=(n,e,t)=>t>32?je.rotlBL(n,e,t):je.rotlSL(n,e,t);function v7(n,e=24){const t=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let a=0;a<10;a++)t[a]=n[a]^n[a+10]^n[a+20]^n[a+30]^n[a+40];for(let a=0;a<10;a+=2){const o=(a+8)%10,u=(a+2)%10,c=t[u],l=t[u+1],d=Cg(c,l,1)^t[o],f=Sg(c,l,1)^t[o+1];for(let h=0;h<50;h+=10)n[a+h]^=d,n[a+h+1]^=f}let s=n[2],i=n[3];for(let a=0;a<24;a++){const o=x7[a],u=Cg(s,i,o),c=Sg(s,i,o),l=m7[a];s=n[l],i=n[l+1],n[l]=u,n[l+1]=c}for(let a=0;a<50;a+=10){for(let o=0;o<10;o++)t[o]=n[a+o];for(let o=0;o<10;o++)n[a+o]^=~t[(o+2)%10]&t[(o+4)%10]}n[0]^=DP[r],n[1]^=MP[r]}t.fill(0)}let F5=class A7 extends R1{constructor(e,t,r,s=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=s,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,pt.number(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Md(this.state)}keccak(){v7(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){pt.exists(this);const{blockLen:t,state:r}=this;e=xa(e);const s=e.length;for(let i=0;i=r&&this.keccak();const a=Math.min(r-this.posOut,i-s);e.set(t.subarray(this.posOut,this.posOut+a),s),this.posOut+=a,s+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return pt.number(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(pt.output(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:s,rounds:i,enableXOF:a}=this;return e||(e=new A7(t,r,s,a,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=s,e.enableXOF=a,e.destroyed=this.destroyed,e}};const n0=(n,e,t)=>Oc(()=>new F5(e,n,t)),jP=n0(6,144,224/8),$P=n0(6,136,256/8),HP=n0(6,104,384/8),GP=n0(6,72,512/8),zP=n0(1,144,224/8),E7=n0(1,136,256/8),WP=n0(1,104,384/8),KP=n0(1,72,512/8),_7=(n,e,t)=>z_((r={})=>new F5(e,n,r.dkLen===void 0?t:r.dkLen,!0)),VP=_7(31,168,128/8),qP=_7(31,136,256/8),JP=Object.freeze(Object.defineProperty({__proto__:null,Keccak:F5,keccakP:v7,keccak_224:zP,keccak_256:E7,keccak_384:WP,keccak_512:KP,sha3_224:jP,sha3_256:$P,sha3_384:HP,sha3_512:GP,shake128:VP,shake256:qP},Symbol.toStringTag,{value:"Module"}));let P7=!1;const k7=function(n){return E7(n)};let C7=k7;function st(n){const e=Ce(n,"data");return de(C7(e))}st._=k7;st.lock=function(){P7=!0};st.register=function(n){if(P7)throw new TypeError("keccak256 is locked");C7=n};Object.freeze(st);const QP=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),S7=Uint8Array.from({length:16},(n,e)=>e),YP=S7.map(n=>(9*n+5)%16);let U5=[S7],L5=[YP];for(let n=0;n<4;n++)for(let e of[U5,L5])e.push(e[n].map(t=>QP[t]));const R7=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(n=>new Uint8Array(n)),ZP=U5.map((n,e)=>n.map(t=>R7[e][t])),XP=L5.map((n,e)=>n.map(t=>R7[e][t])),ek=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),tk=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),od=(n,e)=>n<>>32-e;function Rg(n,e,t,r){return n===0?e^t^r:n===1?e&t|~e&r:n===2?(e|~t)^r:n===3?e&r|t&~r:e^(t|~r)}const cd=new Uint32Array(16);class T7 extends B5{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:t,h2:r,h3:s,h4:i}=this;return[e,t,r,s,i]}set(e,t,r,s,i){this.h0=e|0,this.h1=t|0,this.h2=r|0,this.h3=s|0,this.h4=i|0}process(e,t){for(let h=0;h<16;h++,t+=4)cd[h]=e.getUint32(t,!0);let r=this.h0|0,s=r,i=this.h1|0,a=i,o=this.h2|0,u=o,c=this.h3|0,l=c,d=this.h4|0,f=d;for(let h=0;h<5;h++){const p=4-h,b=ek[h],v=tk[h],w=U5[h],m=L5[h],x=ZP[h],y=XP[h];for(let A=0;A<16;A++){const S=od(r+Rg(h,i,o,c)+cd[w[A]]+b,x[A])+d|0;r=d,d=c,c=od(o,10)|0,o=i,i=S}for(let A=0;A<16;A++){const S=od(s+Rg(p,a,u,l)+cd[m[A]]+v,y[A])+f|0;s=f,f=l,l=od(u,10)|0,u=a,a=S}}this.set(this.h1+o+l|0,this.h2+c+f|0,this.h3+d+s|0,this.h4+r+a|0,this.h0+i+u|0)}roundClean(){cd.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const O7=Oc(()=>new T7),nk=Object.freeze(Object.defineProperty({__proto__:null,RIPEMD160:T7,ripemd160:O7},Symbol.toStringTag,{value:"Module"}));let N7=!1;const I7=function(n){return O7(n)};let B7=I7;function Ic(n){const e=Ce(n,"data");return de(B7(e))}Ic._=I7;Ic.lock=function(){N7=!0};Ic.register=function(n){if(N7)throw new TypeError("ripemd160 is locked");B7=n};Object.freeze(Ic);let F7=!1;const U7=function(n,e,t,r,s){return OP(n,e,t,r,s)};let L7=U7;function r0(n,e,t,r,s){const i=Ce(n,"password"),a=Ce(e,"salt");return de(L7(i,a,t,r,s))}r0._=U7;r0.lock=function(){F7=!0};r0.register=function(n){if(F7)throw new Error("pbkdf2 is locked");L7=n};Object.freeze(r0);let D7=!1;const M7=function(n){return new Uint8Array(NP(n))};let j7=M7;function Gs(n){return j7(n)}Gs._=M7;Gs.lock=function(){D7=!0};Gs.register=function(n){if(D7)throw new Error("randomBytes is locked");j7=n};Object.freeze(Gs);const Ze=(n,e)=>n<>>32-e;function Tg(n,e,t,r,s,i){let a=n[e++]^t[r++],o=n[e++]^t[r++],u=n[e++]^t[r++],c=n[e++]^t[r++],l=n[e++]^t[r++],d=n[e++]^t[r++],f=n[e++]^t[r++],h=n[e++]^t[r++],p=n[e++]^t[r++],b=n[e++]^t[r++],v=n[e++]^t[r++],w=n[e++]^t[r++],m=n[e++]^t[r++],x=n[e++]^t[r++],y=n[e++]^t[r++],A=n[e++]^t[r++],S=a,D=o,O=u,_=c,E=l,C=d,P=f,I=h,j=p,z=b,F=v,W=w,H=m,L=x,M=y,T=A;for(let B=0;B<8;B+=2)E^=Ze(S+H|0,7),j^=Ze(E+S|0,9),H^=Ze(j+E|0,13),S^=Ze(H+j|0,18),z^=Ze(C+D|0,7),L^=Ze(z+C|0,9),D^=Ze(L+z|0,13),C^=Ze(D+L|0,18),M^=Ze(F+P|0,7),O^=Ze(M+F|0,9),P^=Ze(O+M|0,13),F^=Ze(P+O|0,18),_^=Ze(T+W|0,7),I^=Ze(_+T|0,9),W^=Ze(I+_|0,13),T^=Ze(W+I|0,18),D^=Ze(S+_|0,7),O^=Ze(D+S|0,9),_^=Ze(O+D|0,13),S^=Ze(_+O|0,18),P^=Ze(C+E|0,7),I^=Ze(P+C|0,9),E^=Ze(I+P|0,13),C^=Ze(E+I|0,18),W^=Ze(F+z|0,7),j^=Ze(W+F|0,9),z^=Ze(j+W|0,13),F^=Ze(z+j|0,18),H^=Ze(T+M|0,7),L^=Ze(H+T|0,9),M^=Ze(L+H|0,13),T^=Ze(M+L|0,18);s[i++]=a+S|0,s[i++]=o+D|0,s[i++]=u+O|0,s[i++]=c+_|0,s[i++]=l+E|0,s[i++]=d+C|0,s[i++]=f+P|0,s[i++]=h+I|0,s[i++]=p+j|0,s[i++]=b+z|0,s[i++]=v+F|0,s[i++]=w+W|0,s[i++]=m+H|0,s[i++]=x+L|0,s[i++]=y+M|0,s[i++]=A+T|0}function go(n,e,t,r,s){let i=r+0,a=r+16*s;for(let o=0;o<16;o++)t[a+o]=n[e+(2*s-1)*16+o];for(let o=0;o0&&(a+=16),Tg(t,i,n,e+=16,t,a)}function $7(n,e,t){const r=l7({dkLen:32,asyncTick:10,maxmem:1073742848},t),{N:s,r:i,p:a,dkLen:o,asyncTick:u,maxmem:c,onProgress:l}=r;if(pt.number(s),pt.number(i),pt.number(a),pt.number(o),pt.number(u),pt.number(c),l!==void 0&&typeof l!="function")throw new Error("progressCb should be function");const d=128*i,f=d/4;if(s<=1||s&s-1||s>=2**(d/8)||s>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(a<0||a>(2**32-1)*32/d)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(o<0||o>(2**32-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const h=d*(s+a);if(h>c)throw new Error(`Scrypt: parameters too large, ${h} (128 * r * (N + p)) > ${c} (maxmem)`);const p=bh(Nc,n,e,{c:1,dkLen:d*a}),b=Md(p),v=Md(new Uint8Array(d*s)),w=Md(new Uint8Array(d));let m=()=>{};if(l){const x=2*s*a,y=Math.max(Math.floor(x/1e4),1);let A=0;m=()=>{A++,l&&(!(A%y)||A===x)&&l(A/x)}}return{N:s,r:i,p:a,dkLen:o,blockSize32:f,V:v,B32:b,B:p,tmp:w,blockMixCb:m,asyncTick:u}}function H7(n,e,t,r,s){const i=bh(Nc,n,t,{c:1,dkLen:e});return t.fill(0),r.fill(0),s.fill(0),i}function G7(n,e,t){const{N:r,r:s,p:i,dkLen:a,blockSize32:o,V:u,B32:c,B:l,tmp:d,blockMixCb:f}=$7(n,e,t);for(let h=0;h{go(u,v,u,v+=o,s),f()}),go(u,(r-1)*o,c,b,s),f(),await pp(r,h,w=>{const m=c[b+o-16]%r;for(let x=0;x(n+e/Hi)/e,ud={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar(n){const{n:e}=it,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-dt*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=t,a=BigInt("0x100000000000000000000000000000000"),o=Ng(i*n,e),u=Ng(-r*n,e);let c=ye(n-o*t-u*s,e),l=ye(-o*r-u*i,e);const d=c>a,f=l>a;if(d&&(c=e-c),f&&(l=e-l),c>a||l>a)throw new Error("splitScalarEndo: Endomorphism failed, k="+n);return{k1neg:d,k1:c,k2neg:f,k2:l}}},Nr=32,wa=32,tw=32,T1=Nr+1,O1=2*Nr+1;function Ig(n){const{a:e,b:t}=it,r=ye(n*n),s=ye(r*n);return ye(s+e*n+t)}const ld=it.a===Ke;class D5 extends Error{constructor(e){super(e)}}function Bg(n){if(!(n instanceof nt))throw new TypeError("JacobianPoint expected")}class nt{constructor(e,t,r){this.x=e,this.y=t,this.z=r}static fromAffine(e){if(!(e instanceof We))throw new TypeError("JacobianPoint#fromAffine: expected Point");return e.equals(We.ZERO)?nt.ZERO:new nt(e.x,e.y,dt)}static toAffineBatch(e){const t=uk(e.map(r=>r.z));return e.map((r,s)=>r.toAffine(t[s]))}static normalizeZ(e){return nt.toAffineBatch(e).map(nt.fromAffine)}equals(e){Bg(e);const{x:t,y:r,z:s}=this,{x:i,y:a,z:o}=e,u=ye(s*s),c=ye(o*o),l=ye(t*c),d=ye(i*u),f=ye(ye(r*o)*c),h=ye(ye(a*s)*u);return l===d&&f===h}negate(){return new nt(this.x,ye(-this.y),this.z)}double(){const{x:e,y:t,z:r}=this,s=ye(e*e),i=ye(t*t),a=ye(i*i),o=e+i,u=ye(Hi*(ye(o*o)-s-a)),c=ye(kl*s),l=ye(c*c),d=ye(l-Hi*u),f=ye(c*(u-d)-Og*a),h=ye(Hi*t*r);return new nt(d,f,h)}add(e){Bg(e);const{x:t,y:r,z:s}=this,{x:i,y:a,z:o}=e;if(i===Ke||a===Ke)return this;if(t===Ke||r===Ke)return e;const u=ye(s*s),c=ye(o*o),l=ye(t*c),d=ye(i*u),f=ye(ye(r*o)*c),h=ye(ye(a*s)*u),p=ye(d-l),b=ye(h-f);if(p===Ke)return b===Ke?this.double():nt.ZERO;const v=ye(p*p),w=ye(p*v),m=ye(l*v),x=ye(b*b-w-Hi*m),y=ye(b*(m-x)-f*w),A=ye(s*o*p);return new nt(x,y,A)}subtract(e){return this.add(e.negate())}multiplyUnsafe(e){const t=nt.ZERO;if(typeof e=="bigint"&&e===Ke)return t;let r=Lg(e);if(r===dt)return this;if(!ld){let d=t,f=this;for(;r>Ke;)r&dt&&(d=d.add(f)),f=f.double(),r>>=dt;return d}let{k1neg:s,k1:i,k2neg:a,k2:o}=ud.splitScalar(r),u=t,c=t,l=this;for(;i>Ke||o>Ke;)i&dt&&(u=u.add(l)),o&dt&&(c=c.add(l)),l=l.double(),i>>=dt,o>>=dt;return s&&(u=u.negate()),a&&(c=c.negate()),c=new nt(ye(c.x*ud.beta),c.y,c.z),u.add(c)}precomputeWindow(e){const t=ld?128/e+1:256/e+1,r=[];let s=this,i=s;for(let a=0;a>=d,p>u&&(p-=l,e+=dt);const b=h,v=h+Math.abs(p)-1,w=f%2!==0,m=p<0;p===0?a=a.add(fd(w,s[b])):i=i.add(fd(m,s[v]))}return{p:i,f:a}}multiply(e,t){let r=Lg(e),s,i;if(ld){const{k1neg:a,k1:o,k2neg:u,k2:c}=ud.splitScalar(r);let{p:l,f:d}=this.wNAF(o,t),{p:f,f:h}=this.wNAF(c,t);l=fd(a,l),f=fd(u,f),f=new nt(ye(f.x*ud.beta),f.y,f.z),s=l.add(f),i=d.add(h)}else{const{p:a,f:o}=this.wNAF(r,t);s=a,i=o}return nt.normalizeZ([s,i])[0]}toAffine(e){const{x:t,y:r,z:s}=this,i=this.equals(nt.ZERO);e==null&&(e=i?Og:Uc(s));const a=e,o=ye(a*a),u=ye(o*a),c=ye(t*o),l=ye(r*u),d=ye(s*a);if(i)return We.ZERO;if(d!==dt)throw new Error("invZ was invalid");return new We(c,l)}}nt.BASE=new nt(it.Gx,it.Gy,dt);nt.ZERO=new nt(Ke,dt,Ke);function fd(n,e){const t=e.negate();return n?t:e}const gp=new WeakMap;class We{constructor(e,t){this.x=e,this.y=t}_setWindowSize(e){this._WINDOW_SIZE=e,gp.delete(this)}hasEvenY(){return this.y%Hi===Ke}static fromCompressedHex(e){const t=e.length===32,r=Dn(t?e:e.subarray(1));if(!$d(r))throw new Error("Point is not on curve");const s=Ig(r);let i=ck(s);const a=(i&dt)===dt;t?a&&(i=ye(-i)):(e[0]&1)===1!==a&&(i=ye(-i));const o=new We(r,i);return o.assertValidity(),o}static fromUncompressedHex(e){const t=Dn(e.subarray(1,Nr+1)),r=Dn(e.subarray(Nr+1,Nr*2+1)),s=new We(t,r);return s.assertValidity(),s}static fromHex(e){const t=as(e),r=t.length,s=t[0];if(r===Nr)return this.fromCompressedHex(t);if(r===T1&&(s===2||s===3))return this.fromCompressedHex(t);if(r===O1&&s===4)return this.fromUncompressedHex(t);throw new Error(`Point.fromHex: received invalid point. Expected 32-${T1} compressed bytes or ${O1} uncompressed bytes, not ${r}`)}static fromPrivateKey(e){return We.BASE.multiply(va(e))}static fromSignature(e,t,r){const{r:s,s:i}=sw(t);if(![0,1,2,3].includes(r))throw new Error("Cannot recover: invalid recovery bit");const a=M5(as(e)),{n:o}=it,u=r===2||r===3?s+o:s,c=Uc(u,o),l=ye(-a*c,o),d=ye(i*c,o),f=r&1?"03":"02",h=We.fromHex(f+qi(u)),p=We.BASE.multiplyAndAddUnsafe(h,l,d);if(!p)throw new Error("Cannot recover signature: point at infinify");return p.assertValidity(),p}toRawBytes(e=!1){return Ji(this.toHex(e))}toHex(e=!1){const t=qi(this.x);return e?`${this.hasEvenY()?"02":"03"}${t}`:`04${t}${qi(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const e="Point is not on elliptic curve",{x:t,y:r}=this;if(!$d(t)||!$d(r))throw new Error(e);const s=ye(r*r),i=Ig(t);if(ye(s-i)!==Ke)throw new Error(e)}equals(e){return this.x===e.x&&this.y===e.y}negate(){return new We(this.x,ye(-this.y))}double(){return nt.fromAffine(this).double().toAffine()}add(e){return nt.fromAffine(this).add(nt.fromAffine(e)).toAffine()}subtract(e){return this.add(e.negate())}multiply(e){return nt.fromAffine(this).multiply(e,this).toAffine()}multiplyAndAddUnsafe(e,t,r){const s=nt.fromAffine(this),i=t===Ke||t===dt||this!==We.BASE?s.multiplyUnsafe(t):s.multiply(t),a=nt.fromAffine(e).multiplyUnsafe(r),o=i.add(a);return o.equals(nt.ZERO)?void 0:o.toAffine()}}We.BASE=new We(it.Gx,it.Gy);We.ZERO=new We(Ke,Ke);function Fg(n){return Number.parseInt(n[0],16)>=8?"00"+n:n}function Ug(n){if(n.length<2||n[0]!==2)throw new Error(`Invalid signature integer tag: ${pc(n)}`);const e=n[1],t=n.subarray(2,e+2);if(!e||t.length!==e)throw new Error("Invalid signature integer: wrong length");if(t[0]===0&&t[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:Dn(t),left:n.subarray(e+2)}}function ik(n){if(n.length<2||n[0]!=48)throw new Error(`Invalid signature tag: ${pc(n)}`);if(n[1]!==n.length-2)throw new Error("Invalid signature: incorrect length");const{data:e,left:t}=Ug(n.subarray(2)),{data:r,left:s}=Ug(t);if(s.length)throw new Error(`Invalid signature: left bytes after parsing: ${pc(s)}`);return{r:e,s:r}}let ha=class jd{constructor(e,t){this.r=e,this.s=t,this.assertValidity()}static fromCompact(e){const t=e instanceof Uint8Array,r="Signature.fromCompact";if(typeof e!="string"&&!t)throw new TypeError(`${r}: Expected string or Uint8Array`);const s=t?pc(e):e;if(s.length!==128)throw new Error(`${r}: Expected 64-byte hex`);return new jd(N1(s.slice(0,64)),N1(s.slice(64,128)))}static fromDER(e){const t=e instanceof Uint8Array;if(typeof e!="string"&&!t)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");const{r,s}=ik(t?e:Ji(e));return new jd(r,s)}static fromHex(e){return this.fromDER(e)}assertValidity(){const{r:e,s:t}=this;if(!gc(e))throw new Error("Invalid Signature: r must be 0 < r < n");if(!gc(t))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){const e=it.n>>dt;return this.s>e}normalizeS(){return this.hasHighS()?new jd(this.r,ye(-this.s,it.n)):this}toDERRawBytes(){return Ji(this.toDERHex())}toDERHex(){const e=Fg(Zc(this.s)),t=Fg(Zc(this.r)),r=e.length/2,s=t.length/2,i=Zc(r),a=Zc(s);return`30${Zc(s+r+4)}02${a}${t}02${i}${e}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return Ji(this.toCompactHex())}toCompactHex(){return qi(this.r)+qi(this.s)}};function Ai(...n){if(!n.every(r=>r instanceof Uint8Array))throw new Error("Uint8Array list expected");if(n.length===1)return n[0];const e=n.reduce((r,s)=>r+s.length,0),t=new Uint8Array(e);for(let r=0,s=0;re.toString(16).padStart(2,"0"));function pc(n){if(!(n instanceof Uint8Array))throw new Error("Expected Uint8Array");let e="";for(let t=0;t0)return BigInt(n);if(typeof n=="bigint"&&gc(n))return n;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function ye(n,e=it.P){const t=n%e;return t>=Ke?t:e+t}function Gn(n,e){const{P:t}=it;let r=n;for(;e-- >Ke;)r*=r,r%=t;return r}function ck(n){const{P:e}=it,t=BigInt(6),r=BigInt(11),s=BigInt(22),i=BigInt(23),a=BigInt(44),o=BigInt(88),u=n*n*n%e,c=u*u*n%e,l=Gn(c,kl)*c%e,d=Gn(l,kl)*c%e,f=Gn(d,Hi)*u%e,h=Gn(f,r)*f%e,p=Gn(h,s)*h%e,b=Gn(p,a)*p%e,v=Gn(b,o)*b%e,w=Gn(v,a)*p%e,m=Gn(w,kl)*c%e,x=Gn(m,i)*h%e,y=Gn(x,t)*u%e,A=Gn(y,Hi);if(A*A%e!==n)throw new Error("Cannot find square root");return A}function Uc(n,e=it.P){if(n===Ke||e<=Ke)throw new Error(`invert: expected positive integers, got n=${n} mod=${e}`);let t=ye(n,e),r=e,s=Ke,i=dt;for(;t!==Ke;){const o=r/t,u=r%t,c=s-i*o;r=t,t=u,s=i,i=c}if(r!==dt)throw new Error("invert: does not exist");return ye(s,e)}function uk(n,e=it.P){const t=new Array(n.length),r=n.reduce((i,a,o)=>a===Ke?i:(t[o]=i,ye(i*a,e)),dt),s=Uc(r,e);return n.reduceRight((i,a,o)=>a===Ke?i:(t[o]=ye(i*t[o],e),ye(i*a,e)),s),t}function lk(n){const e=n.length*8-wa*8,t=Dn(n);return e>0?t>>BigInt(e):t}function M5(n,e=!1){const t=lk(n);if(e)return t;const{n:r}=it;return t>=r?t-r:t}let yo,Cl;class nw{constructor(e,t){if(this.hashLen=e,this.qByteLen=t,typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");this.v=new Uint8Array(e).fill(1),this.k=new Uint8Array(e).fill(0),this.counter=0}hmac(...e){return gn.hmacSha256(this.k,...e)}hmacSync(...e){return Cl(this.k,...e)}checkSync(){if(typeof Cl!="function")throw new D5("hmacSha256Sync needs to be set")}incr(){if(this.counter>=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}async reseed(e=new Uint8Array){this.k=await this.hmac(this.v,Uint8Array.from([0]),e),this.v=await this.hmac(this.v),e.length!==0&&(this.k=await this.hmac(this.v,Uint8Array.from([1]),e),this.v=await this.hmac(this.v))}reseedSync(e=new Uint8Array){this.checkSync(),this.k=this.hmacSync(this.v,Uint8Array.from([0]),e),this.v=this.hmacSync(this.v),e.length!==0&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),e),this.v=this.hmacSync(this.v))}async generate(){this.incr();let e=0;const t=[];for(;e0)e=BigInt(n);else if(typeof n=="string"){if(n.length!==2*wa)throw new Error("Expected 32 bytes of private key");e=N1(n)}else if(n instanceof Uint8Array){if(n.length!==wa)throw new Error("Expected 32 bytes of private key");e=Dn(n)}else throw new TypeError("Expected valid private key");if(!gc(e))throw new Error("Expected private key: 0 < key < n");return e}function j5(n){return n instanceof We?(n.assertValidity(),n):We.fromHex(n)}function sw(n){if(n instanceof ha)return n.assertValidity(),n;try{return ha.fromDER(n)}catch{return ha.fromCompact(n)}}function iw(n,e=!1){return We.fromPrivateKey(n).toRawBytes(e)}function aw(n,e,t,r=!1){return We.fromSignature(n,e,t).toRawBytes(r)}function Dg(n){const e=n instanceof Uint8Array,t=typeof n=="string",r=(e||t)&&n.length;return e?r===T1||r===O1:t?r===T1*2||r===O1*2:n instanceof We}function ow(n,e,t=!1){if(Dg(n))throw new TypeError("getSharedSecret: first arg must be private key");if(!Dg(e))throw new TypeError("getSharedSecret: second arg must be public key");const r=j5(e);return r.assertValidity(),r.multiply(va(n)).toRawBytes(t)}function cw(n){const e=n.length>Nr?n.slice(0,Nr):n;return Dn(e)}function fk(n){const e=cw(n),t=ye(e,it.n);return uw(t{n=as(n);const e=wa+8;if(n.length1024)throw new Error("Expected valid bytes of private key as per FIPS 186");const t=ye(Dn(n),it.n-dt)+dt;return bc(t)},randomBytes:(n=32)=>{if(kn.web)return kn.web.getRandomValues(new Uint8Array(n));if(kn.node){const{randomBytes:e}=kn.node;return Uint8Array.from(e(n))}else throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>gn.hashToPrivateKey(gn.randomBytes(wa+8)),precompute(n=8,e=We.BASE){const t=e===We.BASE?e:new We(e.x,e.y);return t._setWindowSize(n),t.multiply(kl),t},sha256:async(...n)=>{if(kn.web){const e=await kn.web.subtle.digest("SHA-256",Ai(...n));return new Uint8Array(e)}else if(kn.node){const{createHash:e}=kn.node,t=e("sha256");return n.forEach(r=>t.update(r)),Uint8Array.from(t.digest())}else throw new Error("The environment doesn't have sha256 function")},hmacSha256:async(n,...e)=>{if(kn.web){const t=await kn.web.subtle.importKey("raw",n,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),r=Ai(...e),s=await kn.web.subtle.sign("HMAC",t,r);return new Uint8Array(s)}else if(kn.node){const{createHmac:t}=kn.node,r=t("sha256",n);return e.forEach(s=>r.update(s)),Uint8Array.from(r.digest())}else throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,taggedHash:async(n,...e)=>{let t=dd[n];if(t===void 0){const r=await gn.sha256(Uint8Array.from(n,s=>s.charCodeAt(0)));t=Ai(r,r),dd[n]=t}return gn.sha256(t,...e)},taggedHashSync:(n,...e)=>{if(typeof yo!="function")throw new D5("sha256Sync is undefined, you need to set it");let t=dd[n];if(t===void 0){const r=yo(Uint8Array.from(n,s=>s.charCodeAt(0)));t=Ai(r,r),dd[n]=t}return yo(t,...e)},_JacobianPoint:nt};Object.defineProperties(gn,{sha256Sync:{configurable:!1,get(){return yo},set(n){yo||(yo=n)}},hmacSha256Sync:{configurable:!1,get(){return Cl},set(n){Cl||(Cl=n)}}});const xk=Object.freeze(Object.defineProperty({__proto__:null,CURVE:it,Point:We,Signature:ha,getPublicKey:iw,getSharedSecret:ow,recoverPublicKey:aw,schnorr:mk,sign:dk,signSync:dw,utils:gn,verify:pk},Symbol.toStringTag,{value:"Module"})),yp="0x0000000000000000000000000000000000000000",Mg="0x0000000000000000000000000000000000000000000000000000000000000000",wk=`Ethereum Signed Message: +`,jg=BigInt(0),$g=BigInt(1),Hg=BigInt(2),Gg=BigInt(27),zg=BigInt(28),hd=BigInt(35),Ga={};function Wg(n){return ma(bn(n),32)}var ko,Co,So,J0;const vr=class vr{constructor(e,t,r,s){$(this,ko,void 0);$(this,Co,void 0);$(this,So,void 0);$(this,J0,void 0);Na(e,Ga,"Signature"),k(this,ko,t),k(this,Co,r),k(this,So,s),k(this,J0,null)}get r(){return g(this,ko)}set r(e){Z(bo(e)===32,"invalid r","value",e),k(this,ko,de(e))}get s(){return g(this,Co)}set s(e){Z(bo(e)===32,"invalid s","value",e);const t=de(e);Z(parseInt(t.substring(0,3))<8,"non-canonical s","value",t),k(this,Co,t)}get v(){return g(this,So)}set v(e){const t=He(e,"value");Z(t===27||t===28,"invalid v","v",e),k(this,So,t)}get networkV(){return g(this,J0)}get legacyChainId(){const e=this.networkV;return e==null?null:vr.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=Ce(this.s);return this.yParity&&(e[0]|=128),de(e)}get compactSerialized(){return ot([this.r,this.yParityAndS])}get serialized(){return ot([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 vr(Ga,this.r,this.s,this.v);return this.networkV&&k(e,J0,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 t=Ne(e,"v");return t==Gg||t==zg?jg:(Z(t>=hd,"invalid EIP-155 v","v",e),(t-hd)/Hg)}static getChainIdV(e,t){return Ne(e)*Hg+BigInt(35+t-27)}static getNormalizedV(e){const t=Ne(e);return t===jg||t===Gg?27:t===$g||t===zg?28:(Z(t>=hd,"invalid v","v",e),t&$g?27:28)}static from(e){function t(c,l){Z(c,l,"signature",e)}if(e==null)return new vr(Ga,Mg,Mg,27);if(typeof e=="string"){const c=Ce(e,"signature");if(c.length===64){const l=de(c.slice(0,32)),d=c.slice(32,64),f=d[0]&128?28:27;return d[0]&=127,new vr(Ga,l,de(d),f)}if(c.length===65){const l=de(c.slice(0,32)),d=c.slice(32,64);t((d[0]&128)===0,"non-canonical s");const f=vr.getNormalizedV(c[64]);return new vr(Ga,l,de(d),f)}t(!1,"invalid raw signature length")}if(e instanceof vr)return e.clone();const r=e.r;t(r!=null,"missing r");const s=Wg(r),i=function(c,l){if(c!=null)return Wg(c);if(l!=null){t(yt(l,32),"invalid yParityAndS");const d=Ce(l);return d[0]&=127,de(d)}t(!1,"missing s")}(e.s,e.yParityAndS);t((Ce(i)[0]&128)==0,"non-canonical s");const{networkV:a,v:o}=function(c,l,d){if(c!=null){const f=Ne(c);return{networkV:f>=hd?f:void 0,v:vr.getNormalizedV(f)}}if(l!=null)return t(yt(l,32),"invalid yParityAndS"),{v:Ce(l)[0]&128?28:27};if(d!=null){switch(He(d,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}t(!1,"invalid yParity")}t(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),u=new vr(Ga,s,i,o);return a&&k(u,J0,a),t(e.yParity==null||He(e.yParity,"sig.yParity")===u.yParity,"yParity mismatch"),t(e.yParityAndS==null||e.yParityAndS===u.yParityAndS,"yParityAndS mismatch"),u}};ko=new WeakMap,Co=new WeakMap,So=new WeakMap,J0=new WeakMap;let ur=vr;gn.hmacSha256Sync=function(n,...e){return Ce(Ia("sha256",n,ot(e)))};var Ss;const U0=class U0{constructor(e){$(this,Ss,void 0);Z(bo(e)===32,"invalid private key","privateKey","[REDACTED]"),k(this,Ss,de(e))}get privateKey(){return g(this,Ss)}get publicKey(){return U0.computePublicKey(g(this,Ss))}get compressedPublicKey(){return U0.computePublicKey(g(this,Ss),!0)}sign(e){Z(bo(e)===32,"invalid digest length","digest",e);const[t,r]=dw(qt(e),qt(g(this,Ss)),{recovered:!0,canonical:!0}),s=ha.fromHex(t);return ur.from({r:Ks("0x"+s.r.toString(16),32),s:Ks("0x"+s.s.toString(16),32),v:r?28:27})}computeSharedSecret(e){const t=U0.computePublicKey(e);return de(ow(qt(g(this,Ss)),Ce(t)))}static computePublicKey(e,t){let r=Ce(e,"key");if(r.length===32){const i=iw(r,!!t);return de(i)}if(r.length===64){const i=new Uint8Array(65);i[0]=4,i.set(r,1),r=i}const s=We.fromHex(r);return de(s.toRawBytes(t))}static recoverPublicKey(e,t){Z(bo(e)===32,"invalid digest length","digest",e);const r=ur.from(t),s=ha.fromCompact(qt(ot([r.r,r.s]))).toDERRawBytes(),i=aw(qt(e),s,r.yParity);return Z(i!=null,"invalid signautre for digest","signature",t),de(i)}static addPoints(e,t,r){const s=We.fromHex(U0.computePublicKey(e).substring(2)),i=We.fromHex(U0.computePublicKey(t).substring(2));return"0x"+s.add(i).toHex(!!r)}};Ss=new WeakMap;let rs=U0;const vk=BigInt(0),Ak=BigInt(36);function Kg(n){n=n.toLowerCase();const e=n.substring(2).split(""),t=new Uint8Array(40);for(let s=0;s<40;s++)t[s]=e[s].charCodeAt(0);const r=Ce(st(t));for(let s=0;s<40;s+=2)r[s>>1]>>4>=8&&(e[s]=e[s].toUpperCase()),(r[s>>1]&15)>=8&&(e[s+1]=e[s+1].toUpperCase());return"0x"+e.join("")}const $5={};for(let n=0;n<10;n++)$5[String(n)]=String(n);for(let n=0;n<26;n++)$5[String.fromCharCode(65+n)]=String(10+n);const Vg=15;function Ek(n){n=n.toUpperCase(),n=n.substring(4)+n.substring(0,2)+"00";let e=n.split("").map(r=>$5[r]).join("");for(;e.length>=Vg;){let r=e.substring(0,Vg);e=parseInt(r,10)%97+e.substring(r.length)}let t=String(98-parseInt(e,10)%97);for(;t.length<2;)t="0"+t;return t}const _k=function(){const n={};for(let e=0;e<36;e++){const t="0123456789abcdefghijklmnopqrstuvwxyz"[e];n[t]=BigInt(e)}return n}();function Pk(n){n=n.toLowerCase();let e=vk;for(let t=0;te.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 g(this,Q0)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return g(this,Q0)===!0?-1:g(this,Q0)===!1?this.value.length:null}static from(e,t){return new Rr(xs,e,t)}static uint8(e){return Pe(e,8)}static uint16(e){return Pe(e,16)}static uint24(e){return Pe(e,24)}static uint32(e){return Pe(e,32)}static uint40(e){return Pe(e,40)}static uint48(e){return Pe(e,48)}static uint56(e){return Pe(e,56)}static uint64(e){return Pe(e,64)}static uint72(e){return Pe(e,72)}static uint80(e){return Pe(e,80)}static uint88(e){return Pe(e,88)}static uint96(e){return Pe(e,96)}static uint104(e){return Pe(e,104)}static uint112(e){return Pe(e,112)}static uint120(e){return Pe(e,120)}static uint128(e){return Pe(e,128)}static uint136(e){return Pe(e,136)}static uint144(e){return Pe(e,144)}static uint152(e){return Pe(e,152)}static uint160(e){return Pe(e,160)}static uint168(e){return Pe(e,168)}static uint176(e){return Pe(e,176)}static uint184(e){return Pe(e,184)}static uint192(e){return Pe(e,192)}static uint200(e){return Pe(e,200)}static uint208(e){return Pe(e,208)}static uint216(e){return Pe(e,216)}static uint224(e){return Pe(e,224)}static uint232(e){return Pe(e,232)}static uint240(e){return Pe(e,240)}static uint248(e){return Pe(e,248)}static uint256(e){return Pe(e,256)}static uint(e){return Pe(e,256)}static int8(e){return Pe(e,-8)}static int16(e){return Pe(e,-16)}static int24(e){return Pe(e,-24)}static int32(e){return Pe(e,-32)}static int40(e){return Pe(e,-40)}static int48(e){return Pe(e,-48)}static int56(e){return Pe(e,-56)}static int64(e){return Pe(e,-64)}static int72(e){return Pe(e,-72)}static int80(e){return Pe(e,-80)}static int88(e){return Pe(e,-88)}static int96(e){return Pe(e,-96)}static int104(e){return Pe(e,-104)}static int112(e){return Pe(e,-112)}static int120(e){return Pe(e,-120)}static int128(e){return Pe(e,-128)}static int136(e){return Pe(e,-136)}static int144(e){return Pe(e,-144)}static int152(e){return Pe(e,-152)}static int160(e){return Pe(e,-160)}static int168(e){return Pe(e,-168)}static int176(e){return Pe(e,-176)}static int184(e){return Pe(e,-184)}static int192(e){return Pe(e,-192)}static int200(e){return Pe(e,-200)}static int208(e){return Pe(e,-208)}static int216(e){return Pe(e,-216)}static int224(e){return Pe(e,-224)}static int232(e){return Pe(e,-232)}static int240(e){return Pe(e,-240)}static int248(e){return Pe(e,-248)}static int256(e){return Pe(e,-256)}static int(e){return Pe(e,-256)}static bytes1(e){return Xe(e,1)}static bytes2(e){return Xe(e,2)}static bytes3(e){return Xe(e,3)}static bytes4(e){return Xe(e,4)}static bytes5(e){return Xe(e,5)}static bytes6(e){return Xe(e,6)}static bytes7(e){return Xe(e,7)}static bytes8(e){return Xe(e,8)}static bytes9(e){return Xe(e,9)}static bytes10(e){return Xe(e,10)}static bytes11(e){return Xe(e,11)}static bytes12(e){return Xe(e,12)}static bytes13(e){return Xe(e,13)}static bytes14(e){return Xe(e,14)}static bytes15(e){return Xe(e,15)}static bytes16(e){return Xe(e,16)}static bytes17(e){return Xe(e,17)}static bytes18(e){return Xe(e,18)}static bytes19(e){return Xe(e,19)}static bytes20(e){return Xe(e,20)}static bytes21(e){return Xe(e,21)}static bytes22(e){return Xe(e,22)}static bytes23(e){return Xe(e,23)}static bytes24(e){return Xe(e,24)}static bytes25(e){return Xe(e,25)}static bytes26(e){return Xe(e,26)}static bytes27(e){return Xe(e,27)}static bytes28(e){return Xe(e,28)}static bytes29(e){return Xe(e,29)}static bytes30(e){return Xe(e,30)}static bytes31(e){return Xe(e,31)}static bytes32(e){return Xe(e,32)}static address(e){return new Rr(xs,"address",e)}static bool(e){return new Rr(xs,"bool",!!e)}static bytes(e){return new Rr(xs,"bytes",e)}static string(e){return new Rr(xs,"string",e)}static array(e,t){throw new Error("not implemented yet")}static tuple(e,t){throw new Error("not implemented yet")}static overrides(e){return new Rr(xs,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===qg}static dereference(e,t){if(Rr.isTyped(e)){if(e.type!==t)throw new Error(`invalid type: expecetd ${t}, got ${e.type}`);return e.value}return e}},Q0=new WeakMap,Rr),Ck=class extends ti{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){let r=xn.dereference(t,"string");try{r=Ve(r)}catch(s){return this._throwError(s.message,t)}return e.writeValue(r)}decode(e){return Ve(Ks(e.readValue(),20))}},Sk=class extends ti{constructor(t){super(t.name,t.type,"_",t.dynamic);R(this,"coder");this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,r){return this.coder.encode(t,r)}decode(t){return this.coder.decode(t)}};function xw(n,e,t){let r=[];if(Array.isArray(t))r=t;else if(t&&typeof t=="object"){let u={};r=e.map(c=>{const l=c.localName;return ae(l,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:c},value:t}),ae(!u[l],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:c},value:t}),u[l]=!0,t[l]})}else Z(!1,"invalid tuple value","tuple",t);Z(e.length===r.length,"types/value length mismatch","tuple",t);let s=new dp,i=new dp,a=[];e.forEach((u,c)=>{let l=r[c];if(u.dynamic){let d=i.length;u.encode(i,l);let f=s.writeUpdatableValue();a.push(h=>{f(h+d)})}else u.encode(s,l)}),a.forEach(u=>{u(s.length)});let o=n.appendWriter(s);return o+=n.appendWriter(i),o}function ww(n,e){let t=[],r=[],s=n.subReader(0);return e.forEach(i=>{let a=null;if(i.dynamic){let o=n.readIndex(),u=s.subReader(o);try{a=i.decode(u)}catch(c){if(ir(c,"BUFFER_OVERRUN"))throw c;a=c,a.baseType=i.name,a.name=i.localName,a.type=i.type}}else try{a=i.decode(n)}catch(o){if(ir(o,"BUFFER_OVERRUN"))throw o;a=o,a.baseType=i.name,a.name=i.localName,a.type=i.type}if(a==null)throw new Error("investigate");t.push(a),r.push(i.localName||null)}),o7.fromItems(t,r)}let Rk=class extends ti{constructor(t,r,s){const i=t.type+"["+(r>=0?r:"")+"]",a=r===-1||t.dynamic;super("array",i,s,a);R(this,"coder");R(this,"length");Te(this,{coder:t,length:r})}defaultValue(){const t=this.coder.defaultValue(),r=[];for(let s=0;sa||s<-(a+Uk))&&this._throwError("value out-of-bounds",r),s=Z4(s,8*tn)}else(sal(i,this.size*8))&&this._throwError("value out-of-bounds",r);return t.writeValue(s)}decode(t){let r=al(t.readValue(),this.size*8);return this.signed&&(r=d_(r,this.size*8)),r}},Mk=class extends vw{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,Pt(xn.dereference(t,"string")))}decode(e){return N5(super.decode(e))}},pd=class extends ti{constructor(t,r){let s=!1;const i=[];t.forEach(o=>{o.dynamic&&(s=!0),i.push(o.type)});const a="tuple("+i.join(",")+")";super("tuple",a,r,s);R(this,"coders");Te(this,{coders:Object.freeze(t.slice())})}defaultValue(){const t=[];this.coders.forEach(s=>{t.push(s.defaultValue())});const r=this.coders.reduce((s,i)=>{const a=i.localName;return a&&(s[a]||(s[a]=0),s[a]++),s},{});return this.coders.forEach((s,i)=>{let a=s.localName;!a||r[a]!==1||(a==="length"&&(a="_length"),t[a]==null&&(t[a]=t[i]))}),Object.freeze(t)}encode(t,r){const s=xn.dereference(r,"tuple");return xw(t,this.coders,s)}decode(t){return ww(t,this.coders)}};function qs(n){return st(Pt(n))}function jk(n){let e=0;function t(){return n[e++]<<8|n[e++]}let r=t(),s=1,i=[0,1];for(let A=1;A>--u&1}const d=31,f=2**d,h=f>>>1,p=h>>1,b=f-1;let v=0;for(let A=0;A1;){let E=S+D>>>1;A>>1|l(),O=O<<1^h,_=(_^h)<<1|h|1;m=O,x=1+_-O}let y=r-4;return w.map(A=>{switch(A-y){case 3:return y+65792+(n[o++]<<16|n[o++]<<8|n[o++]);case 2:return y+256+(n[o++]<<8|n[o++]);case 1:return y+n[o++];default:return A-1}})}function $k(n){let e=0;return()=>n[e++]}function Aw(n){return $k(jk(Hk(n)))}function Hk(n){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((s,i)=>e[s.charCodeAt(0)]=i);let t=n.length,r=new Uint8Array(6*t>>3);for(let s=0,i=0,a=0,o=0;s=8&&(r[i++]=o>>(a-=8));return r}function Gk(n){return n&1?~n>>1:n>>1}function zk(n,e){let t=Array(n);for(let r=0,s=0;r{let e=t0(n);if(e.length)return e})}function _w(n){let e=[];for(;;){let t=n();if(t==0)break;e.push(Wk(t,n))}for(;;){let t=n()-1;if(t<0)break;e.push(Kk(t,n))}return e.flat()}function Ul(n){let e=[];for(;;){let t=n(e.length);if(!t)break;e.push(t)}return e}function Pw(n,e,t){let r=Array(n).fill().map(()=>[]);for(let s=0;sr[a].push(i));return r}function Wk(n,e){let t=1+e(),r=e(),s=Ul(e);return Pw(s.length,1+n,e).flatMap((a,o)=>{let[u,...c]=a;return Array(s[o]).fill().map((l,d)=>{let f=d*r;return[u+d*t,c.map(h=>h+f)]})})}function Kk(n,e){let t=1+e();return Pw(t,1+n,e).map(s=>[s[0],s.slice(1)])}var Mn=Aw("AEgSbwjEDVYByQKaAQsBOQDpATQAngDUAHsAoABoANQAagCNAEQAhABMAHIAOwA9ACsANgAmAGIAHgAvACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGAAeABMAFwAXAA0ADgAWAA8AFAAVBFsF1QEXE0o3xAXUALIArkABaACmAgPGAK6AMDAwMAE/qAYK7P4HQAblMgVYBVkAPSw5Afa3EgfJwgAPA8meNALGCjACjqIChtk/j2+KAsXMAoPzASDgCgDyrgFCAi6OCkCQAOQA4woWABjVuskNDD6eBBx4AP4COhi+D+wKBirqBgSCaA0cBy4ArABqku+mnIAAXAaUJAbqABwAPAyUFvyp/Mo8INAIvCoDshQ8APcubKQAon4ZABgEJtgXAR4AuhnOBPsKIE04CZgJiR8cVlpM5INDABQADQAWAA9sVQAiAA8ASO8W2T30OVnKluYvChEeX05ZPe0AFAANABYAD2wgXUCYAMPsABwAOgzGFryp/AHauQVcBeMC0KACxLEKTR2kZhR0Gm5M9gC8DmgC4gAMLjSKF8qSAoF8ARMcAL4OaALiAAwuAUlQJpJMCwMt/AUpCthqGK4B2EQAciwSeAIyFiIDKCi6OGwAOuIB9iYAyA7MtgEcZIIAsgYABgCK1EoFHNZsGACoKNIBogAAAAAAKy4DnABoAQoaPu43dQQZGACrAcgCIgDgLBJ0OvRQsTOiKDVJBfsoBVoFWbC5BWo7XkITO1hCmHuUZmCh+QwUA8YIJvJ4JASkTAJUVAJ2HKwoAZCkpjZcA0YYBIRiCgDSBqxAMCQHKgI6XgBsAWIgcgCEHhoAlgFKuAAoahgBsMYDOC4iRFQBcFoGZgJmAPJKGAMqAgYASkIArABeAHQALLYGCPTwGo6AAAAKIgAqALQcSAHSAdwIDDKXeYHpAAsAEgA1AD4AOTR3etTBEGAQXQJNCkxtOxUMAq0PpwvmERYM0irM09kANKoH7ANUB+wDVANUB+wH7ANUB+wDVANUA1QDVBwL8BvUwRBgD0kEbgWPBYwE1wiEJkoRggcpCNNUDnQfHEgDRgD9IyZJHTuUMwwlQ0wNTQQH/TZDbKh9OQNIMaxU9pCjA8wyUDltAh5yEqEAKw90HTW2Tn96SHGhCkxPr7WASWNOaAK/Oqk/+QoiCZRvvHdPBj4QGCeiEPQMMAGyATgN6kvVBO4GOATGH3oZFg/KlZkIoi3aDOom4C6egFcj8iqABepL8TzaC0pRZQ9WC2IJ4DpggUsDHgEKIogK2g02CGoQ8ArGaA3iEUIHNgPSSZcAogb+Cw4dMhWyJg1iqQsGOXQG+BrzC4wmrBMmevkF0BoeBkoBJhr8AMwu5IWtWi5cGU9cBgALIiPEFKVQHQ0iQLR4RRoYBxIlpgKOQ21KhFEzHpAh8zw6DWMuEFF5B/I8AhlMC348m0aoRQsRzz6KPUUiRkwpBDJ8LCwniAnMD4IMtnxvAVYJHgmuDG4TLhEUN8IINgcWKpchJxIIHkaSYJcE9JwD8BPOAwgFPAk+BxADshwqEysVJgUKgSHUAvA20i6wAoxWfQEUBcgPIh/cEE1H3Q7mCJgCYgOAJegAKhUeABQimAhAYABcj9VTAi7ICMRqaSNxA2QU5F4RcAeODlQHpBwwFbwc3nDFXgiGBSigrAlYAXIJlgFcBOAIBjVYjJ0gPmdQi1UYmCBeQTxd+QIuDGIVnES6h3UCiA9oEhgBMgFwBzYM/gJ0EeoRaBCSCOiGATWyM/U6IgRMIYAgDgokA0xsywskJvYM9WYBoBJfAwk0OnfrZ6hgsyEX+gcWMsJBXSHuC49PygyZGr4YP1QrGeEHvAPwGvAn50FUBfwDoAAQOkoz6wS6C2YIiAk8AEYOoBQH1BhnCm6MzQEuiAG0lgNUjoACbIwGNAcIAGQIhAV24gAaAqQIoAACAMwDVAA2AqoHmgAWAII+AToDJCwBHuICjAOQCC7IAZIsAfAmBBjADBIA9DRuRwLDrgKAZ2afBdpVAosCRjIBSiIEAktETgOsbt4A2ABIBhDcRAESqEfIF+BAAdxsKADEAPgAAjIHAj4BygHwagC0AVwLLgmfsLIBSuYmAIAAEmgB1AKGANoAMgB87gFQAEoFVvYF0AJMRgEOLhUoVF4BuAMcATABCgB2BsiKosYEHARqB9ACEBgV3gLvKweyAyLcE8pCwgK921IAMhMKNQqkCqNgWF0wAy5vPU0ACx+lPsQ/SwVOO1A7VTtQO1U7UDtVO1A7VTtQO1UDlLzfvN8KaV9CYegMow3RRMU6RhPYYE5gLxPFLbQUvhXLJVMZOhq5JwIl4VUGDwEt0GYtCCk0che5ADwpZYM+Y4MeLQpIHORTjlT1LRgArkufM6wNqRsSRD0FRHXqYicWCwofAmR+AmI/WEqsWDcdAqH0AmiVAmYGAp+BOBgIAmY4AmYjBGsEfAN/EAN+jzkDOXQUOX86ICACbBoCMjM4BwJtxAJtq+yHMGRCKAFkANsA3gBHAgeVDIoA+wi/AAqyAncsAnafPAJ5SEACeLcaWdhFq0bwAnw8AnrFAn0GAnztR/1IemAhACgSSVVKWBIUSskC0P4C0MlLJAOITAOH40TCkS8C8p5dAAMDq0vLTCoiAMxNSU2sAos8AorVvhgEGkBkArQCjjQCjlk9lH4CjtYCjll1UbFTMgdS0VSCApP4ApMJAOYAGVUbVaxVzQMsGCmSgzLeeGNFODYCl5wC769YHqUAViIClowClnmZAKZZqVoGfkoAOAKWsgKWS1xBXM4CmcgCmWFcx10EFgKcmDm/OpoCnBMCn5gCnrWHABoMLicMAp3uAp6PALI6YTFh7AKe0AKgawGmAp6cHAKeS6JjxWQkIigCJ6wCJnsCoPgCoEnUAqYsAqXLAqf8AHoCp+9oeWiuAABGahlqzgKs4AKsqwKtZAKs/wJXGgJV2QKx3tQDH0tslAKyugoCsuUUbN1tYG1FXAMlygK2WTg8bo0DKUICuFsCuUQSArkndHAzcN4CvRYDLa8DMg4CvoVx/wMzbgK+F3Mfc0wCw8gCwwFzf3RIMkJ03QM8pAM8lwM9vALFeQLGRALGDYYCyGZOAshBAslMAskrAmSaAt3PeHZeeKt5IkvNAxigZv8CYfEZ8JUhewhej164DgLPaALPaSxIUM/wEJwAw6oCz3ABJucDTg9+SAIC3CQC24cC0kwDUlkDU1wA/gNViYCGPMgT6l1CcoLLg4oC2sQC2duEDYRGpzkDhqIALANkC4ZuVvYAUgLfYgLetXB0AuIs7REB8y0kAfSYAfLPhALr8ALpbXYC6vYC6uEA9kQBtgLuhgLrmZanlwAC7jwDhd2YdnDdcZ4C8wAAZgOOE5mQAvcQA5FrA5KEAveVAvnWAvhjmhmaqLg0mxsDnYAC/vcBGAA2nxmfsAMFigOmZwOm1gDOwgMGZ6GFogIGAwxGAQwBHAdqBl62ZAIAuARovA6IHrAKABRyNgAgAzASSgOGfAFgJB4AjOwAHgDmoAScjgi0BhygwgCoBRK86h4+PxZ5BWk4P0EsQiJCtV9yEl+9AJbGBTMAkE0am7o7J2AzErrQDjAYxxiKyfcFWAVZBVgFWQVkBVkFWAVZBVgFWQVYBVkFWAVZRxYI2IZoAwMDCmVe6iwEygOyBjC8vAC8BKi8AOhBKhazBUc+aj5xQkBCt192OF/pAFgSM6wAjP/MbMv9puhGez4nJAUsFyg3Nn5u32vB8hnDLGoBbNdvMRgFYAVrycLJuQjQSlwBAQEKfV5+jL8AND+CAAQW0gbmriQGAIzEDAMCDgDlZh4+JSBLQrJCvUI5JF8oYDcoOSQJwj4KRT9EPnk+gj5xPnICikK9SkM8X8xPUGtOCy1sVTBrDG8gX+E0OxwJaJwKYyQsPR4nQqxCvSzMAsv9X8oPIC8KCQoAACN+nt9rOy5LGMmsya0JZsLMzQphQWAP5hCkEgCTjh5GQiYbqm06zjkKND9EPnFCQBwICx5NSG1cLS5a4rwTCn7uHixCQBxeCUsKDzRVREM4BTtEnC0KghwuQkAb9glUIyQZMTIBBo9i8F8KcmTKYAxgLiRvAERgGjoDHB9gtAcDbBFmT2BOEgIAZOhgFmCWYH5gtGBMYJJpFhgGtg/cVqq8WwtDF6wBvCzOwgMgFgEdBB8BegJtMDGWU4EBiwq5SBsA5SR0jwvLDqdN6wGcAoidUAVBYAD4AD4LATUXWHsMpg0lILuwSABQDTUAFhO4NVUC0wxLZhEcANlPBnYECx9bADIAtwKbKAsWcKwzOaAaAVwBhwn9A9ruEAarBksGugAey1aqWwq7YhOKCy1ADrwBvAEjA0hbKSkpIR8gIi0TJwciDY4AVQJvWJFKlgJvIA9ySAHUdRDPUiEaqrFN6wcSBU1gAPgAPgsBewAHJW0LiAymOTEuyLBXDgwAYL0MAGRKaFAiIhzAADIAtwKbKC08D88CkRh8ULxYyXRzjtilnA72mhU+G+0S2hIHDxwByAk7EJQGESwNNwwAPAC0zwEDAKUA4gCbizAAFQBcG8cvbXcrDsIRAzwlRNTiHR8MG34CfATCC6vxbQA4Oi4Opzkuz6IdB7wKABA7Ls8SGgB9rNsdD7wbSBzOoncfAT4qYB0C7KAJBE3z5R9mDL0M+wg9Cj8ABcELPgJMDbwIvQ09CT0KvS7PoisOvAaYAhwPjBriBBwLvBY8AKELPBC8BRihe90AO2wMPQACpwm9BRzR9QYFB2/LBnwAB7wSXBISvQECAOsCAAB1FVwHFswV/HAXvBg8AC68AuyovAAevAJWISuAAAG8AALkFT0VvCvso7zJqDwEAp8nTAACXADn3hm8CaVcD7/FAPUafAiiBQv/cQDfvKe8GNwavKOMeXMG/KmchAASvAcbDAADlABtvAcAC7ynPAIaPLsIopzLDvwHwak8AOF8L7dtvwNJAAPsABW8AAb8AAm8AGmMABq8AA68Axi8jmoV/AABXAAObAAuTB8ABrwAF7wIIgANSwC6vCcAA7wADpwq7ACyWwAcHAAbvAAB7AqiAAXHCxYV3AAHnABCvAEDAGm8AAt8AB28AAi8CaIABcsAbqAZ1gCSCCIABcsAATwAB9wAHZwIIgAGmwAJfAAbLABtHADmvIEACFwACDwAFLwAaPwJIgAGywDjjAAJPAuiDsX7YAAHPABunUBJAEgACrwFAAM8AAmuAzgABxwAGXwAAgym/AAKHAAKPAAJ/KfsBrwACRwAAwwAEDwBABQ8ABFsAA+MAA3sAA28ABkMBxYcABU8AG6cFrQBvAC7ABM8BABpLAsA4UwAAjwABFMAF3wFHAAG0QAYvB8BfClTADpGALAJBw4McwApK3EBpQYIXwJtJA0ACghwTG1gK4oggRVjLjcDogq1AALZABcC/ARvAXdzSFMVIgNQAhY/AS0GBHRHvnxTe0EAKgAyAvwAVAvcAHyRLQEsAHfmDhIzRwJLAFgGAAJRAQiLzQB5PAQhpgBbANcWAJZpOCCMAM5ssgDQ1RcJw3Z0HBlXHgrSAYmRrCNUVE5JEz3DivoAgB04QSos4RKYUABzASosMSlDGhADMVYE+MbvAExm3QBrAnICQBF7Osh4LzXWBhETIAUVCK6v/xPNACYAAQIbAIYAiQCONgDjALQA1QCdPQC7AKsApgChAOcAnwDTAJwA4AEBAPwAwAB6AFsAywDNAPwA1wDrAIkAogEqAOMA2ADVBAIIKzTT09PTtb/bzM/NQjEWAUsBVS5GAVMBYgFhAVQBRUpCRGcMAUwUBgkEMzcMBwAgDSQmKCs3OTk8PDw9Pg0/HVBQUFBSUlFSKFNUVlVVHFxgYF9hYCNlZ29ucXFxcXFxc3Nzc3Nzc3Nzc3N1dXZ1dFsAPesAQgCTAHEAKwBf8QCHAFAAUAAwAm/oAIT+8fEAXQCM6wCYAEgAWwBd+PipAH4AfgBiAE8AqgAdAK8AfAI5AjwA9QDgAPcA9wDhAPgA4gDiAOEA3wAoAnQBSgE5ATcBTQE3ATcBNwEyATEBMQExARUBURAAKgkBAEwYCxcEFhcPAIcAjwCfAEoAYxkCKgBvAGgAkAMOAyArAxpCP0gqAIoCSADAAlACnQC5Ao8CjwKPAo8CjwKPAoQCjwKPAo8CjwKPAo8CjgKOApECmQKQAo8CjwKNAo0CjQKNAosCjgJuAc0CkAKYAo8CjwKOF3oMAPcGA5gCWgIzGAFNETYC2xILLBQBRzgUTpIBdKU9AWJaAP4DOkgA/wCSKh4ZkGsAKmEAagAvAIoDlcyM8K+FWwa7LA/DEgKe1nUrCwQkWwGzAN5/gYB/gX+Cg4N/hIeFf4aJh4GIg4mDin+Lf4x/jYuOf49/kIORf5J/k3+Uf5WElomXg5h/AIMloQCEBDwEOQQ7BD4EPARCBD8EOgRABEIEQQQ9BD8EQgCkA4gAylIA0AINAPdbAPcBGgD3APUA9QD2APXVhSRmvwD3APUA9QD2APUdAIpbAPcAigEaAPcAigLtAPcAitWFJGa/HQD4WwEaAPcA9wD1APUA9gD1APgA9QD1APYA9dWFJGa/HQCKWwEaAPcAigD3AIoC7QD3AIrVhSRmvx0CRAE3AksBOgJMwgOfAu0Dn9WFJGa/HQCKWwEaA58AigOfAIoC7QOfAIrVhSRmvx0EMQCKBDIAigeOMm4hLQCKAT9vBCQA/gDHWwMAVVv/FDMDAIoDPtkASgMAigMAl2dBtv/TrfLzakaPh3aztmIuZQrR3ER2n5Yo+qNR2jK/aP/V04UK1njIJXLgkab9PjOxyJDVbIN3R/FZLoZVl2kYFQIZ7V6LpRqGDt9OdDohnJKp5yX/HLj0voPpLrneDaN11t5W3sSM4ALscgSw8fyWLVkKa/cNcQmjYOgTLZUgOLi2F05g4TR0RfgZ4PBdntxdV3qvdxQt8DeaMMgjJMgwUxYN3tUNpUNx21AvwADDAIa0+raTWaoBXmShAl5AThpMi282o+WzOKMlxjHj7a+DI6AM6VI9w+xyh3Eyg/1XvPmbqjeg2MGXugHt8wW03DQMRTd5iqqOhjLvyOCcKtViGwAHVLyl86KqvxVX7MxSW8HLq6KCrLpB8SspAOHO9IuOwCh9poLoMEha9CHCxlRAXJNDobducWjqhFHqCkzjTM2V9CHslwq4iU19IxqhIFZMve15lDTiMVZIPdADXGxTqzSTv0dDWyk1ht430yvaYCy9qY0MQ3cC5c1uw4mHcTGkMHTAGC99TkNXFAiLQgw9ZWhwKJjGCe+J5FIaMpYhhyUnEgfrF3zEtzn40DdgCIJUJfZ0mo3eXsDwneJ8AYCr7Vx2eHFnt2H6ZEyAHs9JoQ4Lzh5zBoGOGwAz37NOPuqSNmZf51hBEovtpm2T1wI79OBWDyvCFYkONqAKGVYgIL0F+uxTcMLSPtFbiNDbBPFgip8MGDmLLHbSyGXdCMO6f7teiW9EEmorZ+75KzanZwvUySgjoUQBTfHlOIerJs6Y9wLlgDw18AB1ne0tZRNgGjcrqHbtubSUooEpy4hWpDzTSrmvqw0H9AoXQLolMt9eOM+l9RitBB1OBnrdC1XL4yLFyXqZSgZhv7FnnDEXLUeffb4nVDqYTLY6X7gHVaK4ZZlepja2Oe6OhLDI/Ve5SQTCmJdH3HJeb14cw99XsBQAlDy5s5kil2sGezZA3tFok2IsNja7QuFgM30Hff3NGSsSVFYZLOcTBOvlPx8vLhjJrSI7xrNMA/BOzpBIJrdR1+v+zw4RZ7ry6aq4/tFfvPQxQCPDsXlcRvIZYl+E5g3kJ+zLMZon0yElBvEOQTh6SaAdIO6BwdqJqfvgU+e8Y65FQhdiHkZMVt9/39N2jGd26J6cNjq8cQIyp6RonRPgVn2fl89uRDcQ27GacaN0MPrcNyRlbUWelKfDfyrNVVGBG5sjd3jXzTx06ywyzuWn5jbvEfPPCTbpClkgEu9oPLKICxU5HuDe3jA1XnvU85IYYhaEtOU1YVWYhEFsa4/TQj3rHdsU2da2eVbF8YjSI0m619/8bLMZu3xildwqM7zf1cjn4Whx0PSYXcY5bR7wEQfGC7CTOXwZdmsdTO8q3uGm7Rh/RfCWwpzBHCAaVfjxgibL5vUeL0pH6bzDmI9yCXKC/okkmbc28OJvI87L/bjFzpq0DHepw4kT1Od+fL7cyuFaRgfaUWB2++TCFvz11J0leEtrGkpccfX9z2LY39sph4PBHCjNOOkd0ybUm+ZzS8GkFbqMpq8uiX2yHpa0jllTLfGTDBMYR6FT5FWLLDPMkYxt1Q0eyMvxJWztDjy0m6VvZPvamrFXjHmPpU6WxrZqH6WW//I37RwvqPQhPz8I3RPuXAk1C94ZprQWm9iGM/KgiGDO6SV9sjp+Jmk4TBajMNJ5zzWZ1k1jrteQQBp9C2dOvmbIeeEME8y573Q8TgGe+ZCzutM45gYLBzYm2LNvgq2kebAbMpHRDSyh6dQ27GbsAAdCqQVVXWC1C+zpwBM2Lr4eqtobmmu1vJEDlIQR1iN8CUWpztq50z7FFQBn3SKViX6wSqzVQCoYvAjByjeSa+h1PRnYWvBinTDB9cHt4eqDsPS4jcD3FwXJKT0RQsl8EvslI2SFaz2OtmYLFV8FwgvWroZ3fKmh7btewX9tfL2upXsrsqpLJzpzNGyNlnuZyetg7DIOxQTMBR7dqlrTlZ6FWi1g4j1NSjA2j1Yd7fzTH6k9LxCyUCneAKYCU581bnvKih6KJTeTeCX4Zhme/QIz7w2o+AdSgtLAkdrLS9nfweYEqrMLsrGGSWXtgWamAWp6+x6GM/Z8jNw3BqPNQ39hrzYLECn3tPvh/LqKbRSCiDGauDKBBj/kGbpnM1Bb/my8hv4NWStclkwjfl57y4oNDgw1JAG9VOti3QVVoSziMEsSdfEjaCPIDb7SgpLXykQsM+nbqbt97I0mIlzWv0uqFobLMAq8Rd9pszUBKxFhBPwOjf//gVOz2r7URJ2OnpviCXv9iz3a4X/YLBYbXoYwxBv/Kq0a5s4utQHzoTerJ7PmFW/no/ZAsid/hRIV82tD+Qabh5F1ssIM8Ri3chu0PuPD3sSJRMjDoxLAbwUbroiPAz/V52e8s3DIixxlO7OrvhMj3qfzA0kKxzwicr5wJmZwJxTXgrwYsqhRvpgC2Nfdyd+TYYxJSZgk+gk2g9KyHSlwQVAyPtWWgvVGyVBqsU2LpDlLNosSAtolC1uBKt5pQZLhAxTjeGCWIC/HVpagc5rRwkgpCHKEsjA8d+scp8aiMewwQBhp5dYTV5t/Nvl+HbDMu8F3S0psPyZb1bSnqlHPFUnMQeQqSqwDBT23fJO9gO3aVaa1icrXU0PKwlMM5K+iL3ATcVq2fFWKk0irCTF4LDVDG4gUpkyplq6efcZS+WDR1woApjD18x+2JQR9oOXzuA7uy4b+/91WsJd/tSd1QcAH8PVPXApieA37B7YXPhDPH1azP3PKR+HfHmOoDYLeuKsIi/ssSsdYs62qJo14Hw1P2N/6zpr8F3FTWmJ4ysAVcl84Iv/tl///Z8FaAWbBQbyMNDZjrZ2JwdRjtd1jOeNumSodFtr4/Zf45iRJf/8HSW+KIB/+GlKu8Rv1BPLr/4duoL+kFPRqrstEr41gfJupoJRf4hcYDWX93FOcfEBiIivxtjtV8g7mvOReiamYWKE7vfPbv3v2L9Kwq3cIDFGLyhyfOGuf/9vA5muH6Pjg7B4SUj2ydDXra9fSBI+DrsNHA6l51wfHssJb+11TfNk7B8OleUe3Y+ZmHboMFHdv7FFP2cfISFyeAQR0sk/Xv62HBTdW4HmnGSLFk/cqyWVVFJkdIIa+4hos3JRHcqLoRKM5h2Qtk1RZtzISMtlXTfTqIc77YsCCgQD0r61jtxskCctwJOtjE/pL8wC4LBD4AZFjh2wzzFCrT/PNqW0/DeBbkfMfzVm9yy06WiF+1mTdNNEAytVtohBKg3brWd2VQa+aF+cQ0mW5CvbwOlWCT07liX226PjiVLwFCRs/Ax2/u+ZNPjrNFIWIPf5GjHyUKp60OeXe9F01f7IaPf/SDTvyDAf7LSWWejtiZcsqtWZjrdn6A2MqBwnSeKhrZOlUMmgMionmiCIvXqKZfmhGZ1MwD3uMF4n9KJcfWLA3cL5pq48tm5NDYNh3SS/TKUtmFSlQR89MR4+kxcqJgpGbhm9gXneDELkyqAN5nitmIzTscKeJRXqd64RiaOALR2d295NWwbjHRNG2AU5oR9OS2oJg/5CY6BFPc1JvD2Mxdhp2/MZdI8dLePxiP4KRIp8VXmqfg+jqd/RNG7GNuq1U2SiI4735Bdc0MVFx6mH5UOWEa5HuhYykd6t4M1gYLVS8m1B+9bUqi5DziQq7qT8d94cxB6AB4WqMCOF/zPPtRSZUUaMSsvHOWxGASufywTX8ogy6HgUf9p+Z30wUEosl8qgmwm6o2AV6nO9HKQjRHpN6SUegI5pvR61RLnUJ1lqCtmfcsRQutEizVpAaPXN7xMp5UQ5OSZK6tniCK9CpyMd7LjR6+MxfoMEDPpWdf2p2m5N3KO4QMxf+V7vGdYjemQczQ+m2MGIkFNYDMf0Yop2eSx81sP36WHUczqEhKysp2iJSYAvfgJjinKwToPvRKb+HBi+7cJ96S5ngfLOXaHAFRLkulo4TnXTFO51gX0TCCo4ZUHdbpdgkMEwUZAPjh6M+hA8DzycbtxAgH3uD6i0nN1aTiIuQ4BYCE9dEHHwAmINU+4YEWx4EC3OZwFGfYZMPLScVlb+BAAJeARUh+gdWA3/gRqCrf1jecgqeFf1MdzrrP4SVlGm5mMihSP+zYYksAB7O+SBPwNQqSNMiLnkviY/klwgcRmvqtCqeWeA0gjuir4CMZqmw/ntP6M+l0pdN8/P9xI53aP7x/zavJbbKOz8VzO/nXxIr1tjparMnqd6iWdByHKw4lF4p/u57Yv07WeZPDnRl7wgmDVZZ44fQsjdYO/gmXQ+940PRGst8UMQApFC4OOV22e4N+lVOPyFLAOj4t8R3PFw/FjbSWy0ELuAFReNkee8ORcBOT2NPDcs7OfpUmzvn/F9Czk9o9naMyVYy/j8I5qVFmQDFcptBp65J/+sJA3w/j6y/eqUkKxTsf0CZjtNdRSBEmJ2tmfgmJbqpcsSagk+Ul9qdyV+NnqFBIJZFCB1XwPvWGDBOjVUmpWGHsWA5uDuMgLUNKZ4vlq5qfzY1LnRhCc/mh5/EX+hzuGdDy5aYYx4BAdwTTeZHcZpl3X0YyuxZFWNE6wFNppYs3LcFJePOyfKZ8KYb7dmRyvDOcORLPH0sytC6mH1US3JVj6paYM1GEr+CUmyHRnabHPqLlh6Kl0/BWd3ebziDfvpRQpPoR7N+LkUeYWtQ6Rn5v5+NtNeBPs2+DKDlzEVR5aYbTVPrZekJsZ9UC9qtVcP99thVIt1GREnN8zXP8mBfzS+wKYym8fcW6KqrE702Zco+hFQAEIR7qimo7dd7wO8B7R+QZPTuCWm1UAwblDTyURSbd85P4Pz+wBpQyGPeEpsEvxxIZkKsyfSOUcfE3UqzMFwZKYijb7sOkzpou+tC4bPXey5GI1GUAg9c3vLwIwAhcdPHRsYvpAfzkZHWY20vWxxJO0lvKfj6sG2g/pJ1vd/X2EBZkyEjLN4nUZOpOO7MewyHCrxQK8d5aF7rCeQlFX+XksK6l6z971BPuJqwdjj68ULOj9ZTDdOLopMdOLL0PFSS792SXE/EC9EDnIXZGYhr52aQb+9b2zEdBSnpkxAdBUkwJDqGCpZk/HkRidjdp0zKv/Cm52EenmfeKX6HkLUJgMbTTxxIZkIeL/6xuAaAAHbA7mONVduTHNX/UJj1nJEaI7f3HlUyiqKn7VfBE+bdb4HWln1HPJx001Ulq1tOxFf8WZEARvq5Da1+pE7fPVxLntGACz3nkoLsKcPdUqdCwwiyWkmXTd5+bv3j7HaReRt3ESn783Ew3SWsvkEjKtbocNksbrLmV+GVZn1+Uneo35MT1/4r8fngQX5/ptORfgmWfF6KSB/ssJmUSijXxQqUpzkANEkSkYgYj560OOjJr6uqckFuO15TRNgABEwNDjus1V3q2huLPYERMCLXUNmJJpbMrUQsSO7Qnxta55TvPWL6gWmMOvFknqETzqzFVO8SVkovEdYatypLGmDy9VWfgAc0KyIChiOhbd7UlbAeVLPZyEDp4POXKBwN/KP5pT6Cyqs6yaI00vXMn1ubk9OWT9Q/O2t/C25qlnO/zO0xcBzpMBCAB8vsdsh3U8fnPX1XlPEWfaYJxKVaTUgfCESWl4CCkIyjE6iQ5JFcwU6S4/IH0/Agacp8d5Gzq2+GzPnJ7+sqk40mfFQpKrDbAKwLlr3ONEati2k/ycLMSUu7V/7BBkDlNyXoN9tvqXCbbMc4SSQXgC/DBUY9QjtrCtQ+susEomCq8xcNJNNMWCH31GtlTw2BdCXkJBjT+/QNWlBWwQ5SWCh1LdQ99QVii/DyTxjSR6rmdap3l3L3aiplQpPYlrzNm9er88fXd2+ao+YdUNjtqmxiVxmyYPzJxl67OokDcTezEGqldkGgPbRdXA+fGcuZVkembZByo7J1dMnkGNjwwCny+FNcVcWvWYL9mg8oF7jACVWI3bA64EXpdM8bSIEVIAs5JJH+LHXgnCsgcMGPZyAAVBncvbLiexzg9YozcytjPXVlAbQAC7Tc4S0C8QN4LlAGjj4pQAVWrwkaDoUYGxxvkCWKRRHkdzJB5zpREleBDL1oDKEvAqmkDibVC4kTqF89YO6laUjgtJPebBfzr16tg4t10GmN1sJ5vezk2sUOq8blCn5mPZyT3ltaDcddKupQjqusNM9wtFVD0ABzv17fZDn7GPT1nkCtdcgYejcK1qOcTGtPxnCX1rErEjVWCnEJv5HaOAUjgpiKQjUKkQi64D5g2COgwas8FcgIl0Pw95H9dWxE3QG0VbMNffh6BPlAojLDf4es2/5Xfq7hw5NGcON2g8Qsy2UQm94KddKyy3kdJxWgpNaEc15xcylbLC3vnT26u8qS90qc2MU8LdOJc5VPF5KnSpXIhnj1eJJ/jszjZ01oR6JDFJRoeTPO/wh4IPFbdG9KljuSzeuI92p8JF/bpgDE8wG86/W2EBKgPrmzdLijxssQn8mM44ky/KLGOJcrSwXIpZa/Z3v7W6HCRk7ewds99LTsUW1LbeJytw8Q/BFZVZyfO9BUHOCe2suuEkO8DU4fLX0IQSQ2TdOkKXDtPf3sNV9tYhYFueuPRhfQlEEy+aYM/MCz7diDNmFSswYYlZZPmKr2Q5AxLsSVEqqBtn6hVl1BCFOFExnqnIsmyY/NA8jXnDaNzr7Zv3hu+I1Mf/PJjk0gALN2G8ABzdf9FNvWHvZHhv6xIoDCXf964MxG92vGZtx/LYU5PeZqgly8tT5tGeQGeJzMMsJc5p+a5Rn2PtEhiRzo/5Owjy1n0Lzx3ev8GHQmeWb8vagG6O5Qk5nrZuQTiKODI4UqL0LLAusS2Ve7j1Ivdxquu1BR9Rc4QkOiUPwQXJv6du2E8i5pDhVoQpUhyMWGUT2O2YODIhjAfI71gxep5r5zAY7GBUZpy51hAw0pcCCrhOmU8Wp6ujQTdZQsCjtq6SHX8QAMNiPCIIkoxhHEZPgsBcOlP4aErJZPhF7qvx6gHrn8hEwPwYbx8YmT/n7lbcmTip1v8kgsrIjFTAlvLY4Nuil0KDmgz3svYs0ZJ3O3Is/vSx4xpxF1e2VAtZE8dJxGYEIhCSuPvCjP54l/NSNDnwlKvAW8mG+AQkgp7a87Igh26uKMFGD0PoPHTSvoWxiHuk+su8XkQiHIjeYKl/RdcOHpxhQH3zHCNE3aARm83Bl6zGxU/vMltlVPQhubcqhW4RYkl6uXk5JdP/QpzaKFpw2M8zvysv2qj7xaQECuu2akM0Cssj/uB9+wDR7uA6XOnLNaoczalHoMj33eiiu+DRaFsUmlmUZuh9bjDY4INMNSSAivSh03uJvny4Gj+D+neudoa7iJi7c4VFlZ/J5gUR82308zSNAt/ZroBXDWw0fV3eVPAn3aX0mtJabF6RsUZmL+Ehn+wn51/4QipMjD+6y64t7bjL6bjENan2prQ4h7++hBJ9NXvX8CUocJqMC937IasLzm5K0qwXeFMAimMHkEIQIQI2LrQ9sLBfXuyp66zWvlsh74GPv7Xpabj993pRNNDuFud5oIcn/92isbADXdpRPbjmbCNOrwRbxGZx2XmYNGMiV5kjF4IKyxCBvKier9U4uVoheCdmk83rp5G0PihAm2fAtczI4b9BWqX+nrZTrJX5kSwQddi93NQrXG+Cl3eBGNkM77VBsMpEolhXex1MVvMkZN9fG59GGbciH11FEXaY1MxrArovaSjE/lUUqBg2cZBNmiWbvzCHCPJ4RVGFK2dTbObM1m+gJyEX53fa7u3+TZpm74mNEzWbkVL4vjNwfL9uzRCu1cgbrNx5Yv5dDruNrIOgwIk+UZWwJfdbu/WHul6PMmRflVCIzd7B37Pgm/Up/NuCiQW7RXyafevN3AL6ycciCc4ZPlTRzEu+aURGlUBOJbUEsheX7PPyrrhdUt5JAG12EEEZpY/N3Vhbl5uLAfT0CbC2XmpnryFkxZmBTs5prvEeuf0bn73i3O82WTiQtJWEPLsBXnQmdnKhB06NbbhLtlTZYJMxDMJpFeajSNRDB2v61BMUHqXggUwRJ19m6p5zl51v11q34T74lTXdJURuV6+bg2D6qpfGnLy7KGLuLZngobM4pIouz4+n0/UzFKxDgLM4h+fUwKZozQ9UGrHjcif51Ruonz7oIVZ56xWtZS8z7u5zay6J2LD4gCYh2RXoBRLDKsUlZ80R8kmoxlJiL8aZCy2wCAonnucFxCLT1HKoMhbPKt34D97EXPPh0joO93iJVF1Uruew61Qoy3ZUVNX9uIJDt9AQWKLLo+mSzmTibyLHq0D6hhzpvgUgI6ekyVEL3FD+Fi5R3A8MRHPXspN1VyKkfRlC+OGiNgPC4NREZpFETgVmdXrQ2TxChuS3aY+Ndc7CiYv5+CmzfiqeZrWIQJW/C4RvjbGUoJFf1K6ZdR2xL/bG4kVq1+I4jQWX+26YUijpp+lpN7o5c6ZodXJCF56UkFGsqz44sIg8jrdWvbjRCxi2Bk0iyM3a7ecAV93zB6h1Ei38c0s6+8nrbkopArccGP8vntQe1bFeEh2nJIFOHX/k3/UHb5PtKGpnzbkmnRETMX+9X/QduLZWw/feklW/kH/JnzToJe9Kgu9Hct1UGbH5BPCLo4OOtQnZonW0xnyCcdtKyPQ/sbLiSTYJdSx4sJqWLMnfn6fIqPB3WAgk00J+fCOkomPHqtS67pf0mFmKoItYZUlJu6BihSZ8qve8+/X+LX1MhQXF95AshfUleCtmdn6l6QFXzLg2sgLn1oyVFuZecv7fzsIHzoRlAGp0gwYDOn1S4qabWvB5xUaE+Svw4KmjWtxdnuQbI32dw87D4N95u8qQRJTSQg0wLxOLkxSrPMLEn1UIhNKjAa9VLs3WLaXGrtCIt8bKY2AQP/ZdyRU6zT/E8qP2ltyBE2CCZPgWgEYDoJJO4n92y61ylNaSFXKohJhLjkfvYWm592539sIpmBNLlDo1bExFBfmHJJ0lFEiC/fj8v42OoMC9Mo3whIoWvyHfq6Uacqq55mzFf/EGC+NP/gHjhd6urc6R0hES27VXux7UY8CGKPohplWIZtTrFSaPWslCWy78E22Pw8fvReSUZx/txqLtHrFqg1DY/Eus6Iq1heZdrdcqE0/c971Bz1HW/XNXHsXpUIbI4kHdOfCc6T5zHZzvzQJB0ggMFL6IGPAilU9bj/ASdPk6fNvNtZqPuwEDhMBtBnhCexo6D6VAGIOPvJPPV523Y8R8a9vCqZbswSZKzOT1291BsUbmUWehtbb1fdRX9hiJKXvwr1QX6GjnZMgyMvnwOo2Dr24amr7FqEAbVeJAjRNOceM2EQ1Mna9fInqPJ5mh5X8CzT1aDOv08An0blz0fF5Gq4mS2cwq5glwIOlY5nznE8X4j/UdZ3FJsVIXte1JH0A7iibuPfazStM5O/Vo3KXIpXBeGORV0M9XDXFvsYZUHGvFCUubWzTw248EHE0cpQM2zNg6rjavreq3NHCAWsoZ7wvVy7l5gvtKRmIj1MnvfWEm0yFnGcuOq192350a5WefpfKCcX3Sn+AgHU+qnpstNtddbdVebagJU390lq9ko4aI9rqdaWXYG8tv5O/ZQHSqDRYHC6zfH10l5z++opso7aOSaIczlQ13iAzXvLdEu0V7kwNUZ1c8Y8aq7SeIEe5p902FlNkW8DnwHyueHchbK8vVFJfmr9mz7P8nUSccl1ULaoWMRSI1ls32kvlK0h46h3J25Yd9AzfcJbp9qYF/SEt3H5j69mMdcsNxZcAzT/A89ov3tglTX54y/EwjMfuoDoxPwLJDm5I7q6F9Kp469yNy1zSxz0N4HbRRBj9xFFuogvBspv7DXUNIsGxTINEQfmctb42XImWAODgARNo7dfcTqFKq6aTfivmvunLmzP9f8yLsJvXD3JbcPcDGNriMAcjzeDTNr65t8YB5tsnFDFLa0Uwmd2OvUdkLMX9TsAUYUfooSv47sw5J88j7CpahRjjO3/UhOXjTS39W5YZAel2KTbQd1h7INOw9P23GW7GDAe4agIUFHP48MZr7ubq0efFmmtwYMyk7D0r1oeG/CGOODgb9Ur+JMHxkwzPbtCX2ZnENQuI0RN5SyTIZuoY4XS9Rd/tPe3vNAZGSHM/YYwqs9xkkENx0O+eC2YVW1cwOJ3ckE890nbQeHLKlW15L0P0W2VliyYrfNr0nrIYddoRyGaCtj4OYd2MT7ebApqZOAQIaSHJM4mphhfjNjtnjg6YRyx9qM2FT3xOiYIMqXPFWdzhSgFF8ItocqVV09CmIoO8k6U/oJB7++wSX/YksxfPXHyjSgAGZOj1aKEq9fSvXBqtp2wu8/FxEf5AxapAD06pPGuLVUYLdgEzHR8wqRGYEwiUO9MyYbgswstuLYhwYFpSVKOdzAihZ9LuHtD598EGhINU9xc9xhL+QgTLAstmPIvvm2xyRw/WTUPXkP3ZHu6GyPmj5xFH9/QGpkglKXRVUBgVmLOJx8uZO2AstxQYocZH2JhORlxawj66BAXUEs7K/gPxINIRAFyK3WLuyq9oBTF9wEbnmCot82WjIg7CPNwYK3KrZMrKAz5yFszg4wCVLJVnIL8+OYA0xRDH8cHQjQUiQ2i1mr/be32k/3Xej9sdf3iuGvZHyLFSJvPSqz/wltnxumTJYKZsrWXtx/Rmu39jjV9lFaJttfFn57/No2h/unsJmMHbrnZ8csxkp5HQ4xR1s0HH+t3Iz82a3iQWTUDGq/+l2W3TUYLE8zNdL8Y+5oXaIH/Y2UUcX67cXeN4WvENZjz4+8q7vjhowOI3rSjFhGZ6KzwmU7+5nFV+kGWAZ5z2UWvzq0TK0pk1hPwAN4jbw//1CApRvIaIjhSGhioY6TUmsToek9cF9XjJdHvLPcyyCV3lbR5Jiz/ts46ay2F820VjTXvllElwrGzKcNSyvQlWDXdwrUINXmHorAM3fE19ngLZmgeUaCJLsSITf2VcfAOuWwX7mTPdP8Zb/04KqRniufCpwnDUk7sP0RX6cud/sanFMagnzKInSRVey0YzlVSOtA/AjrofmSH6RYbJQ8b4NDeTkIGc6247+Mnbez/qhJ9GAv9fGNFercPnnrf285Qgs+UqThLRgflcAKFuqWhLzZaR4QqvSwa3xe0LPkqj9xJWub195r7NrrR0e78FR+0mRBNMPsraqZctAUVAJfYKehTDV1MGGQSeDsOK9J3sbUuKRIS/WilX/64CBms9jCZocBlsBSZaIAjWm/SUZ8daWL2a/cJFyUOFqE3Epc2RWbtjNyPwOGpWtzu32kUooUqsJud7IV4E8rstUBXM7tGEtBx99x60g1duhyvxeKJSl8s5E34HTMmADT0836aEdg5Dv9rVyCz8i2REOmiz6wtIVFN0HsjAoN37SrY0bV1Ms8CRUILhvZvvRaDzoVCaSI0u8EPuTe4b7OPowgRGODl22UBBmHSTUY8e4DyL+Bc7bngo+2T8HtNvzyATSL5iJZgFPKpmUyZv54vVL90+/RQGATUmNKnrIvcJMYON9fl83naW5sf6hRkbbTC9RUEE6XADwjgA46wWfUQ+QWZl0J4PVTWAln/YfAz/SV3q3J9+yCYDleruoN5uoc/wT2f4YONGTb6zTGq3V+3JqzmCOjwebKln+fExVLN7sqtqfMnsKVXWbb2Ai5m3D/fCTgX7oKYzTZvj+m28XnDqPbXuP4MyWdmPezcesdrh7rCzA7BWdObiuyDEKjjzBbQ0qnuwjliz+b+j7aPMKlkXyIznV3tGzAfYwIbzGGt098oh4eq3ruDjdgHtjxfFCjHrjjRbHajoz/YOY4raojPFQ910GIlBV7hq47UDgpyajBxQUmD8NctiLV1rTSLAEsQDLTeRKcmPBMVMFF0SPBBhZ5oXoxtD3lMhuAQXmA+57OcciczVW9e9zwSIAHS+FJmvfXMJGF1dMBsIUMaPjvgaVqUc3p32qVCMQYFEiRLzlVSOGMCmv/HJIxAHe3mL/XnoZ1IkWLeRZfgyByjnDbbeRK5KL7bYHSVJZ9UFq+yCiNKeRUaYjgbC3hVUvfJAhy/QNl/JqLKVvGMk9ZcfyGidNeo/VTxK9vUpodzfQI9Z2eAre4nmrkzgxKSnT5IJ1D69oHuUS5hp7pK9IAWuNrAOtOH0mAuwCrY8mXAtVXUeaNK3OXr6PRvmWg4VQqFSy+a1GZfFYgdsJELG8N0kvqmzvwZ02Plf5fH9QTy6br0oY/IDsEA+GBf9pEVWCIuBCjsup3LDSDqI+5+0IKSUFr7A96A2f0FbcU9fqljdqvsd8sG55KcKloHIFZem2Wb6pCLXybnVSB0sjCXzdS8IKvE");const Jg=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),Qg=4;function Vk(n){return n.toString(16).toUpperCase().padStart(2,"0")}function kw(n){return`{${Vk(n)}}`}function H5(n){let e=[];for(let t=0,r=n.length;t>24&255}function Sw(n){return n&16777215}const qk=new Map(Ew(G5).flatMap((n,e)=>n.map(t=>[t,e+1<<24]))),Jk=new Set(t0(G5)),Rw=new Map,mp=new Map;for(let[n,e]of _w(G5)){if(!Jk.has(n)&&e.length==2){let[t,r]=e,s=mp.get(t);s||(s=new Map,mp.set(t,s)),s.set(r,n)}Rw.set(n,e.reverse())}const Ll=44032,B1=4352,F1=4449,U1=4519,Tw=19,Ow=21,mc=28,L1=Ow*mc,Qk=Tw*L1,Yk=Ll+Qk,Zk=B1+Tw,Xk=F1+Ow,eC=U1+mc;function Nw(n){return n>=Ll&&n=B1&&n=F1&&eU1&&e0&&s(U1+c)}else{let a=Rw.get(i);a?t.push(...a):s(i)}if(!t.length)break;i=t.pop()}if(r&&e.length>1){let i=cl(e[0]);for(let a=1;a0&&s>=a)a==0?(e.push(r,...t),t.length=0,r=o):t.push(o),s=a;else{let u=tC(r,o);u>=0?r=u:s==0&&a==0?(e.push(r),r=o):(t.push(o),s=a)}}return r>=0&&e.push(r,...t),e}function mh(n){return Iw(n).map(Sw)}function xh(n){return nC(Iw(n))}const rC=46,D1=65039,M1=".",Bw=1,Yg=45;function Lc(){return new Set(t0(Mn))}const Fw=new Map(_w(Mn)),Uw=Lc(),j1=Lc(),Zg=new Set(t0(Mn).map(function(n){return this[n]},[...j1])),sC=Lc(),iC=Lc(),aC=Ew(Mn);function Xg(){return new Set([t0(Mn).map(n=>aC[n]),t0(Mn)].flat(2))}const oC=Mn(),Dl=Ul(n=>{let e=Ul(Mn).map(t=>t+96);if(e.length){let t=n>=oC;e[0]-=32,e=Aa(e),t&&(e=`Restricted[${e}]`);let r=Xg(),s=Xg(),i=[...r,...s].sort((o,u)=>o-u),a=!Mn();return{N:e,P:r,M:a,R:t,V:new Set(i)}}}),ey=Lc(),Ml=new Map;[...ey,...Lc()].sort((n,e)=>n-e).map((n,e,t)=>{let r=Mn(),s=t[e]=r?t[e-r]:{V:[],M:new Map};s.V.push(n),ey.has(n)||Ml.set(n,s)});for(let{V:n,M:e}of new Set(Ml.values())){let t=[];for(let s of n){let i=Dl.filter(o=>o.V.has(s)),a=t.find(({G:o})=>i.some(u=>o.has(u)));a||(a={G:new Set,V:[]},t.push(a)),a.V.push(s),i.forEach(o=>a.G.add(o))}let r=t.flatMap(({G:s})=>[...s]);for(let{G:s,V:i}of t){let a=new Set(r.filter(o=>!s.has(o)));for(let o of i)e.set(o,a)}}let jl=new Set,Lw=new Set;for(let n of Dl)for(let e of n.V)(jl.has(e)?Lw:jl).add(e);for(let n of jl)!Ml.has(n)&&!Lw.has(n)&&Ml.set(n,Bw);const Dw=new Set([...jl,...mh(jl)]),cC=t0(Mn),Mw=jw([]);function jw(n){let e=Ul(()=>{let o=t0(Mn).map(u=>cC[u]);if(o.length)return jw(o)}).sort((o,u)=>u.Q.size-o.Q.size),t=Mn(),r=t%3;t=t/3|0;let s=t&1;t>>=1;let i=t&1,a=t&2;return{B:e,V:r,F:s,S:i,C:a,Q:new Set(n)}}class uC extends Array{get is_emoji(){return!0}}function Sf(n,e=kw){let t=[];$w(n[0])&&t.push("◌");let r=0,s=n.length;for(let i=0;i=4&&n[2]==Yg&&n[3]==Yg)throw new Error("invalid label extension")}function ty(n){for(let t=n.lastIndexOf(95);t>0;)if(n[--t]!==95)throw new Error("underscore allowed only at start")}function fC(n){let e=n[0],t=Jg.get(e);if(t)throw Sl(`leading ${t}`);let r=n.length,s=-1;for(let i=1;iAa(Kw(H5(r),t).flatMap(s=>s.is_emoji?q5(s):s))).join(M1)}function Hw(n){return Gw(V5(n))}function hC(n){let e=V5(n,!0);for(let{type:t,output:r,error:s}of e)if(!s&&t!=="Greek"){let i=0;for(;;){let a=r.indexOf(958,i);if(a<0)break;r[a]=926,i=a+1}}return Gw(e)}function V5(n,e){let t=0;return n.split(M1).map(r=>{let s=H5(r),i={input:s,offset:t};t+=s.length+1;let a;try{let o=i.tokens=Kw(s,xh),u=o.length,c;if(u){let l=o[0],d=u>1||l.is_emoji;if(!d&&l.every(f=>f<128))a=l,ty(a),lC(a),c="ASCII";else if(d&&(i.emoji=!0,l=o.flatMap(f=>f.is_emoji?[]:f)),a=o.flatMap(f=>!e&&f.is_emoji?q5(f):f),ty(a),!l.length)c="Emoji";else{if(j1.has(a[0]))throw Sl("leading combining mark");for(let p=1;pa.has(o)):[...a],!t.length)return}else r.push(s)}if(t){for(let s of t)if(r.every(i=>s.V.has(i)))throw new Error(`whole-script confusable: ${n.N}/${s.N}`)}}function bC(n){let e=Dl;for(let t of n){let r=e.filter(s=>s.V.has(t));if(!r.length)throw e===Dl?zw(t):Ww(e[0],t);if(e=r,r.length==1)break}return e}function Gw(n){return n.map(({input:e,error:t,output:r})=>{if(t){let s=t.message;throw new Error(n.length==1?s:`Invalid label ${W5(Sf(e))}: ${s}`)}return Aa(r)}).join(M1)}function zw(n){return new Error(`disallowed character: ${z5(n)}`)}function Ww(n,e){let t=z5(e),r=Dl.find(s=>s.P.has(e));return r&&(t=`${r.N} ${t}`),new Error(`illegal mixture: ${n.N} + ${t}`)}function Sl(n){return new Error(`illegal placement: ${n}`)}function gC(n,e){let{V:t,M:r}=n;for(let s of e)if(!t.has(s))throw Ww(n,s);if(r){let s=mh(e);for(let i=1,a=s.length;iQg)throw new Error(`non-spacing marks: too many ${W5(Sf(s.slice(i-1,o)))} (${o-i}/${Qg})`);i=o}}}function Kw(n,e){let t=[],r=[];for(n=n.slice().reverse();n.length;){let s=Vw(n);if(s)r.length&&(t.push(e(r)),r=[]),t.push(s);else{let i=n.pop();if(Dw.has(i))r.push(i);else{let a=Fw.get(i);if(a)r.push(...a);else if(!Uw.has(i))throw zw(i)}}}return r.length&&t.push(e(r)),t}function q5(n){return n.filter(e=>e!=D1)}function Vw(n,e){let t=Mw,r,s,i=[],a=n.length;for(e&&(e.length=0);a;){let o=n[--a];if(t=t.B.find(u=>u.Q.has(o)),!t)break;if(t.S)s=o;else if(t.C&&o===s)break;i.push(o),t.F&&(i.push(D1),a>0&&n[a-1]==D1&&a--),t.V&&(r=qw(i,t),e&&e.push(...n.slice(a).reverse()),n.length=a)}return r}function qw(n,e){let t=uC.from(n);return e.V==2&&t.splice(1,1),t}function yC(){let n=[];return e(Mw,[]),n.sort(Cw);function e(t,r,s){if(t.S)s=r[r.length-1];else if(t.C&&s===r[r.length-1])return;t.F&&r.push(D1),t.V&&n.push(qw(r,t));for(let i of t.B)for(let a of i.Q)e(i,[...r,a],s)}}const Rl="valid",Jw="mapped",g6="ignored",mC="disallowed",xC="emoji",wC="nfc",vC="stop";function Qw(n,{nf:e=!0}={}){let t=H5(n).reverse(),r=[],s=[];for(;t.length;){let i=Vw(t,r);if(i)s.push({type:xC,emoji:i,input:r.slice(),cps:q5(i)});else{let a=t.pop();if(a==rC)s.push({type:vC,cp:a});else if(Dw.has(a))s.push({type:Rl,cps:[a]});else if(Uw.has(a))s.push({type:g6,cp:a});else{let o=Fw.get(a);o?s.push({type:Jw,cp:a,cps:o.slice()}):s.push({type:mC,cp:a})}}}if(e)for(let i=0,a=-1;iy6(f.type)?f.cps:[]),d=xh(l);Cw(d,l)?(s.splice(a,u-a,{type:wC,input:l,cps:d,tokens0:ry(c),tokens:Qw(Aa(d),{nf:!1})}),i=a):i=u-1,a=-1}else a=i;else o.type!==g6&&(a=-1)}return ry(s)}function y6(n){return n==Rl||n==Jw}function ny(n){return n.some(e=>iC.has(e))}function ry(n){for(let e=0;er.cps)})}return n}const AC=Object.freeze(Object.defineProperty({__proto__:null,ens_beautify:hC,ens_emoji:yC,ens_normalize:Hw,ens_normalize_fragment:dC,ens_split:V5,ens_tokenize:Qw,is_combining_mark:$w,nfc:xh,nfd:mh,safe_str_from_cps:Sf,should_escape:K5},Symbol.toStringTag,{value:"Module"})),Yw=new Uint8Array(32);Yw.fill(0);function sy(n){return Z(n.length!==0,"invalid ENS name; empty component","comp",n),n}function Zw(n){const e=Pt(EC(n)),t=[];if(n.length===0)return t;let r=0;for(let s=0;s{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t})))+"00"}function m6(n,e){return{address:Ve(n),storageKeys:e.map((t,r)=>(Z(yt(t,32),"invalid slot",`storageKeys[${r}]`,t),t.toLowerCase()))}}function Ba(n){if(Array.isArray(n))return n.map((t,r)=>Array.isArray(t)?(Z(t.length===2,"invalid slot set",`value[${r}]`,t),m6(t[0],t[1])):(Z(t!=null&&typeof t=="object","invalid address-slot set","value",n),m6(t.address,t.storageKeys)));Z(n!=null&&typeof n=="object","invalid access list","value",n);const e=Object.keys(n).map(t=>{const r=n[t].reduce((s,i)=>(s[i]=!0,s),{});return m6(t,Object.keys(r).sort())});return e.sort((t,r)=>t.address.localeCompare(r.address)),e}function Rf(n){let e;return typeof n=="string"?e=rs.computePublicKey(n,!1):e=n.publicKey,Ve(st("0x"+e.substring(4)).substring(26))}function PC(n,e){return Rf(rs.recoverPublicKey(n,e))}const hn=BigInt(0),kC=BigInt(2),CC=BigInt(27),SC=BigInt(28),RC=BigInt(35),TC=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function J5(n){return n==="0x"?null:Ve(n)}function Xw(n,e){try{return Ba(n)}catch(t){Z(!1,t.message,e,n)}}function wh(n,e){return n==="0x"?0:He(n,e)}function en(n,e){if(n==="0x")return hn;const t=Ne(n,e);return Z(t<=TC,"value exceeds uint size",e,t),t}function Ft(n,e){const t=Ne(n,"value"),r=bn(t);return Z(r.length<=32,"value too large",`tx.${e}`,t),r}function e9(n){return Ba(n).map(e=>[e.address,e.storageKeys])}function OC(n){const e=I5(n);Z(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",n);const t={type:0,nonce:wh(e[0],"nonce"),gasPrice:en(e[1],"gasPrice"),gasLimit:en(e[2],"gasLimit"),to:J5(e[3]),value:en(e[4],"value"),data:de(e[5]),chainId:hn};if(e.length===6)return t;const r=en(e[6],"v"),s=en(e[7],"r"),i=en(e[8],"s");if(s===hn&&i===hn)t.chainId=r;else{let a=(r-RC)/kC;a=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),ae(!t||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),ae(this.type!==0||!r,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const s=[];return this.type!=null?s.push(this.type):t?s.push(2):e?(s.push(1),r||s.push(0)):r?(s.push(1),s.push(2)):(s.push(0),s.push(1),s.push(2)),s.sort(),s}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}clone(){return vi.from(this)}toJSON(){const e=t=>t==null?null:t.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 vi;if(typeof e=="string"){const r=Ce(e);if(r[0]>=127)return vi.from(OC(r));switch(r[0]){case 1:return vi.from(IC(r));case 2:return vi.from(NC(r))}ae(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const t=new vi;return e.type!=null&&(t.type=e.type),e.to!=null&&(t.to=e.to),e.nonce!=null&&(t.nonce=e.nonce),e.gasLimit!=null&&(t.gasLimit=e.gasLimit),e.gasPrice!=null&&(t.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(t.maxFeePerGas=e.maxFeePerGas),e.data!=null&&(t.data=e.data),e.value!=null&&(t.value=e.value),e.chainId!=null&&(t.chainId=e.chainId),e.signature!=null&&(t.signature=ur.from(e.signature)),e.accessList!=null&&(t.accessList=e.accessList),e.hash!=null&&(Z(t.isSigned(),"unsigned transaction cannot define hash","tx",e),Z(t.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(Z(t.isSigned(),"unsigned transaction cannot define from","tx",e),Z(t.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),t}};Rs=new WeakMap,Ro=new WeakMap,To=new WeakMap,Oo=new WeakMap,No=new WeakMap,Io=new WeakMap,Bo=new WeakMap,Fo=new WeakMap,Uo=new WeakMap,Lo=new WeakMap,Do=new WeakMap,Mo=new WeakMap;let $l=vi;function BC(n){return typeof n=="string"&&(n=Pt(n)),st(ot([Pt(wk),Pt(String(n.length)),n]))}const n9=new Uint8Array(32);n9.fill(0);const FC=BigInt(-1),r9=BigInt(0),s9=BigInt(1),UC=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function LC(n){const e=Ce(n),t=e.length%32;return t?ot([e,n9.slice(t)]):de(e)}const DC=Ks(s9,32),MC=Ks(r9,32),cy={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},x6=["name","version","chainId","verifyingContract","salt"];function uy(n){return function(e){return Z(typeof e=="string",`invalid domain value for ${JSON.stringify(n)}`,`domain.${n}`,e),e}}const jC={name:uy("name"),version:uy("version"),chainId:function(n){const e=Ne(n,"domain.chainId");return Z(e>=0,"invalid chain ID","domain.chainId",n),Number.isSafeInteger(e)?Number(e):oo(e)},verifyingContract:function(n){try{return Ve(n).toLowerCase()}catch{}Z(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",n)},salt:function(n){const e=Ce(n,"domain.salt");return Z(e.length===32,'invalid domain value "salt"',"domain.salt",n),de(e)}};function w6(n){{const e=n.match(/^(u?)int(\d*)$/);if(e){const t=e[1]==="",r=parseInt(e[2]||"256");Z(r%8===0&&r!==0&&r<=256&&(e[2]==null||e[2]===String(r)),"invalid numeric width","type",n);const s=al(UC,t?r-1:r),i=t?(s+s9)*FC:r9;return function(a){const o=Ne(a,"value");return Z(o>=i&&o<=s,`value out-of-bounds for ${n}`,"value",o),Ks(t?Z4(o,256):o,32)}}}{const e=n.match(/^bytes(\d+)$/);if(e){const t=parseInt(e[1]);return Z(t!==0&&t<=32&&e[1]===String(t),"invalid bytes width","type",n),function(r){const s=Ce(r);return Z(s.length===t,`invalid length for ${n}`,"value",r),LC(r)}}}switch(n){case"address":return function(e){return ma(Ve(e),32)};case"bool":return function(e){return e?DC:MC};case"bytes":return function(e){return st(e)};case"string":return function(e){return qs(e)}}return null}function ly(n,e){return`${n}(${e.map(({name:t,type:r})=>r+" "+t).join(",")})`}var nf,Ts,jo,rh,i9;const Yn=class Yn{constructor(e){$(this,rh);R(this,"primaryType");$(this,nf,void 0);$(this,Ts,void 0);$(this,jo,void 0);k(this,nf,JSON.stringify(e)),k(this,Ts,new Map),k(this,jo,new Map);const t=new Map,r=new Map,s=new Map;Object.keys(e).forEach(o=>{t.set(o,new Set),r.set(o,[]),s.set(o,new Set)});for(const o in e){const u=new Set;for(const c of e[o]){Z(!u.has(c.name),`duplicate variable name ${JSON.stringify(c.name)} in ${JSON.stringify(o)}`,"types",e),u.add(c.name);const l=c.type.match(/^([^\x5b]*)(\x5b|$)/)[1]||null;Z(l!==o,`circular type reference to ${JSON.stringify(l)}`,"types",e),!w6(l)&&(Z(r.has(l),`unknown type ${JSON.stringify(l)}`,"types",e),r.get(l).push(o),t.get(o).add(l))}}const i=Array.from(r.keys()).filter(o=>r.get(o).length===0);Z(i.length!==0,"missing primary type","types",e),Z(i.length===1,`ambiguous primary types or unused types: ${i.map(o=>JSON.stringify(o)).join(", ")}`,"types",e),Te(this,{primaryType:i[0]});function a(o,u){Z(!u.has(o),`circular type reference to ${JSON.stringify(o)}`,"types",e),u.add(o);for(const c of t.get(o))if(r.has(c)){a(c,u);for(const l of u)s.get(l).add(c)}u.delete(o)}a(this.primaryType,new Set);for(const[o,u]of s){const c=Array.from(u);c.sort(),g(this,Ts).set(o,ly(o,e[o])+c.map(l=>ly(l,e[l])).join(""))}}get types(){return JSON.parse(g(this,nf))}getEncoder(e){let t=g(this,jo).get(e);return t||(t=Q(this,rh,i9).call(this,e),g(this,jo).set(e,t)),t}encodeType(e){const t=g(this,Ts).get(e);return Z(t,`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return st(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if(w6(e))return r(e,t);const s=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(s)return Z(!s[3]||parseInt(s[3])===t.length,`array length mismatch; expected length ${parseInt(s[3])}`,"value",t),t.map(a=>this._visit(s[1],a,r));const i=this.types[e];if(i)return i.reduce((a,{name:o,type:u})=>(a[o]=this._visit(u,t[o],r),a),{});Z(!1,`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new Yn(e)}static getPrimaryType(e){return Yn.from(e).primaryType}static hashStruct(e,t,r){return Yn.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){if(e[r]==null)continue;const s=cy[r];Z(s,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:s})}return t.sort((r,s)=>x6.indexOf(r.name)-x6.indexOf(s.name)),Yn.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return ot(["0x1901",Yn.hashDomain(e),Yn.from(t).hash(r)])}static hash(e,t,r){return st(Yn.encode(e,t,r))}static async resolveNames(e,t,r,s){e=Object.assign({},e);for(const o in e)e[o]==null&&delete e[o];const i={};e.verifyingContract&&!yt(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const a=Yn.from(t);a.visit(r,(o,u)=>(o==="address"&&!yt(u,20)&&(i[u]="0x"),u));for(const o in i)i[o]=await s(o);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),r=a.visit(r,(o,u)=>o==="address"&&i[u]?i[u]:u),{domain:e,value:r}}static getPayload(e,t,r){Yn.hashDomain(e);const s={},i=[];x6.forEach(u=>{const c=e[u];c!=null&&(s[u]=jC[u](c),i.push({name:u,type:cy[u]}))});const a=Yn.from(t),o=Object.assign({},t);return Z(o.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",t),o.EIP712Domain=i,a.encode(r),{types:o,domain:s,primaryType:a.primaryType,message:a.visit(r,(u,c)=>{if(u.match(/^bytes(\d*)/))return de(Ce(c));if(u.match(/^u?int/))return Ne(c).toString();switch(u){case"address":return c.toLowerCase();case"bool":return!!c;case"string":return Z(typeof c=="string","invalid string","value",c),c}Z(!1,"unsupported type","type",u)})}}};nf=new WeakMap,Ts=new WeakMap,jo=new WeakMap,rh=new WeakSet,i9=function(e){{const s=w6(e);if(s)return s}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const s=t[1],i=this.getEncoder(s);return a=>{Z(!t[3]||parseInt(t[3])===a.length,`array length mismatch; expected length ${parseInt(t[3])}`,"value",a);let o=a.map(i);return g(this,Ts).has(s)&&(o=o.map(st)),st(ot(o))}}const r=this.types[e];if(r){const s=qs(g(this,Ts).get(e));return i=>{const a=r.map(({name:o,type:u})=>{const c=this.getEncoder(u)(i[o]);return g(this,Ts).has(u)?st(c):c});return a.unshift(s),ot(a)}}Z(!1,`unknown type: ${e}`,"type",e)};let xc=Yn;function nn(n){const e=new Set;return n.forEach(t=>e.add(t)),Object.freeze(e)}const $C="external public payable",HC=nn($C.split(" ")),a9="constant external internal payable private public pure view",GC=nn(a9.split(" ")),o9="constructor error event fallback function receive struct",c9=nn(o9.split(" ")),u9="calldata memory storage payable indexed",zC=nn(u9.split(" ")),WC="tuple returns",KC=[o9,u9,WC,a9].join(" "),VC=nn(KC.split(" ")),qC={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},JC=new RegExp("^(\\s*)"),QC=new RegExp("^([0-9]+)"),YC=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),l9=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),f9=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var It,Pr,rf,wp,Rc;let ni=(Rc=class{constructor(e){$(this,rf);$(this,It,void 0);$(this,Pr,void 0);k(this,It,0),k(this,Pr,e.slice())}get offset(){return g(this,It)}get length(){return g(this,Pr).length-g(this,It)}clone(){return new Rc(g(this,Pr))}reset(){k(this,It,0)}popKeyword(e){const t=this.peek();if(t.type!=="KEYWORD"||!e.has(t.text))throw new Error(`expected keyword ${t.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 t=Q(this,rf,wp).call(this,g(this,It)+1,e.match+1);return k(this,It,e.match+1),t}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const t=[];for(;g(this,It)=g(this,Pr).length)throw new Error("out-of-bounds");return g(this,Pr)[g(this,It)]}peekKeyword(e){const t=this.peekType("KEYWORD");return t!=null&&e.has(t)?t:null}peekType(e){if(this.length===0)return null;const t=this.peek();return t.type===e?t.text:null}pop(){const e=this.peek();return hr(this,It)._++,e}toString(){const e=[];for(let t=g(this,It);t`}},It=new WeakMap,Pr=new WeakMap,rf=new WeakSet,wp=function(e=0,t=0){return new Rc(g(this,Pr).slice(e,t).map(r=>Object.freeze(Object.assign({},r,{match:r.match-e,linkBack:r.linkBack-e,linkNext:r.linkNext-e}))))},Rc);function s0(n){const e=[],t=a=>{const o=i0&&e[e.length-1].type==="NUMBER"){const d=e.pop().text;l=d+l,e[e.length-1].value=He(d)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=l}continue}if(o=a.match(YC),o){if(u.text=o[1],i+=u.text.length,VC.has(u.text)){u.type="KEYWORD";continue}if(u.text.match(f9)){u.type="TYPE";continue}u.type="ID";continue}if(o=a.match(QC),o){u.text=o[1],u.type="NUMBER",i+=u.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(a[0])} at position ${i}`)}return new ni(e.map(a=>Object.freeze(a)))}function fy(n,e){let t=[];for(const r in e.keys())n.has(r)&&t.push(r);if(t.length>1)throw new Error(`conflicting types: ${t.join(", ")}`)}function vh(n,e){if(e.peekKeyword(c9)){const t=e.pop().text;if(t!==n)throw new Error(`expected ${n}, got ${t}`)}return e.popType("ID")}function Js(n,e){const t=new Set;for(;;){const r=n.peekType("KEYWORD");if(r==null||e&&!e.has(r))break;if(n.pop(),t.has(r))throw new Error(`duplicate keywords: ${JSON.stringify(r)}`);t.add(r)}return Object.freeze(t)}function d9(n){let e=Js(n,GC);return fy(e,nn("constant payable nonpayable".split(" "))),fy(e,nn("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 zs(n,e){return n.popParams().map(t=>an.from(t,e))}function h9(n){if(n.peekType("AT")){if(n.pop(),n.peekType("NUMBER"))return Ne(n.pop().text);throw new Error("invalid gas")}return null}function Ea(n){if(n.length)throw new Error(`unexpected tokens: ${n.toString()}`)}const ZC=new RegExp(/^(.*)\[([0-9]*)\]$/);function dy(n){const e=n.match(f9);if(Z(e,"invalid type","type",n),n==="uint")return"uint256";if(n==="int")return"int256";if(e[2]){const t=parseInt(e[2]);Z(t!==0&&t<=32,"invalid bytes length","type",n)}else if(e[3]){const t=parseInt(e[3]);Z(t!==0&&t<=256&&t%8===0,"invalid numeric width","type",n)}return n}const bt={},wn=Symbol.for("_ethers_internal"),hy="_ParamTypeInternal",py="_ErrorInternal",by="_EventInternal",gy="_ConstructorInternal",yy="_FallbackInternal",my="_FunctionInternal",xy="_StructInternal";var $o,Hd,dn;let an=(dn=class{constructor(e,t,r,s,i,a,o,u){$(this,$o);R(this,"name");R(this,"type");R(this,"baseType");R(this,"indexed");R(this,"components");R(this,"arrayLength");R(this,"arrayChildren");if(Na(e,bt,"ParamType"),Object.defineProperty(this,wn,{value:hy}),a&&(a=Object.freeze(a.slice())),s==="array"){if(o==null||u==null)throw new Error("")}else if(o!=null||u!=null)throw new Error("");if(s==="tuple"){if(a==null)throw new Error("")}else if(a!=null)throw new Error("");Te(this,{name:t,type:r,baseType:s,indexed:i,components:a,arrayLength:o,arrayChildren:u})}format(e){if(e==null&&(e="sighash"),e==="json"){const r=this.name||"";if(this.isArray()){const i=JSON.parse(this.arrayChildren.format("json"));return i.name=r,i.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(i)}const s={type:this.baseType==="tuple"?"tuple":this.type,name:r};return typeof this.indexed=="boolean"&&(s.indexed=this.indexed),this.isTuple()&&(s.components=this.components.map(i=>JSON.parse(i.format(e)))),JSON.stringify(s)}let t="";return this.isArray()?(t+=this.arrayChildren.format(e),t+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?(e!=="sighash"&&(t+=this.type),t+="("+this.components.map(r=>r.format(e)).join(e==="full"?", ":",")+")"):t+=this.type,e!=="sighash"&&(this.indexed===!0&&(t+=" indexed"),e==="full"&&this.name&&(t+=" "+this.name)),t}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,t){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(s=>r.arrayChildren.walk(s,t))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const r=this;return e.map((s,i)=>r.components[i].walk(s,t))}return t(this.type,e)}async walkAsync(e,t){const r=[],s=[e];return Q(this,$o,Hd).call(this,r,e,t,i=>{s[0]=i}),r.length&&await Promise.all(r),s[0]}static from(e,t){if(dn.isParamType(e))return e;if(typeof e=="string")try{return dn.from(s0(e),t)}catch{Z(!1,"invalid param type","obj",e)}else if(e instanceof ni){let o="",u="",c=null;Js(e,nn(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(u="tuple",c=e.popParams().map(b=>dn.from(b)),o=`tuple(${c.map(b=>b.format()).join(",")})`):(o=dy(e.popType("TYPE")),u=o);let l=null,d=null;for(;e.length&&e.peekType("BRACKET");){const b=e.pop();l=new dn(bt,"",o,u,null,c,d,l),d=b.value,o+=b.text,u="array",c=null}let f=null;if(Js(e,zC).has("indexed")){if(!t)throw new Error("");f=!0}const p=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new dn(bt,p,o,u,f,c,d,l)}const r=e.name;Z(!r||typeof r=="string"&&r.match(l9),"invalid name","obj.name",r);let s=e.indexed;s!=null&&(Z(t,"parameter cannot be indexed","obj.indexed",e.indexed),s=!!s);let i=e.type,a=i.match(ZC);if(a){const o=parseInt(a[2]||"-1"),u=dn.from({type:a[1],components:e.components});return new dn(bt,r||"",i,"array",s,null,o,u)}if(i==="tuple"||i.startsWith("tuple(")||i.startsWith("(")){const o=e.components!=null?e.components.map(c=>dn.from(c)):null;return new dn(bt,r||"",i,"tuple",s,o,null,null)}return i=dy(e.type),new dn(bt,r||"",i,i,s,null,null,null)}static isParamType(e){return e&&e[wn]===hy}},$o=new WeakSet,Hd=function(e,t,r,s){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(this.arrayLength!==-1&&t.length!==this.arrayLength)throw new Error("array is wrong length");const a=this.arrayChildren,o=t.slice();o.forEach((u,c)=>{var l;Q(l=a,$o,Hd).call(l,e,u,r,d=>{o[c]=d})}),s(o);return}if(this.isTuple()){const a=this.components;let o;if(Array.isArray(t))o=t.slice();else{if(t==null||typeof t!="object")throw new Error("invalid tuple value");o=a.map(u=>{if(!u.name)throw new Error("cannot use object value with unnamed components");if(!(u.name in t))throw new Error(`missing value for component ${u.name}`);return t[u.name]})}if(o.length!==this.components.length)throw new Error("array is wrong length");o.forEach((u,c)=>{var l;Q(l=a[c],$o,Hd).call(l,e,u,r,d=>{o[c]=d})}),s(o);return}const i=r(this.type,t);i.then?e.push(async function(){s(await i)}()):s(i)},dn),Ah=class vp{constructor(e,t,r){R(this,"type");R(this,"inputs");Na(e,bt,"Fragment"),r=Object.freeze(r.slice()),Te(this,{type:t,inputs:r})}static from(e){if(typeof e=="string"){try{vp.from(JSON.parse(e))}catch{}return vp.from(s0(e))}if(e instanceof ni)switch(e.peekKeyword(c9)){case"constructor":return zd.from(e);case"error":return As.from(e);case"event":return Gd.from(e);case"fallback":case"receive":return wy.from(e);case"function":return Wd.from(e);case"struct":return v6.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return zd.from(e);case"error":return As.from(e);case"event":return Gd.from(e);case"fallback":case"receive":return wy.from(e);case"function":return Wd.from(e);case"struct":return v6.from(e)}ae(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}Z(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return zd.isFragment(e)}static isError(e){return As.isFragment(e)}static isEvent(e){return Gd.isFragment(e)}static isFunction(e){return Wd.isFragment(e)}static isStruct(e){return v6.isFragment(e)}},Eh=class extends Ah{constructor(t,r,s,i){super(t,r,i);R(this,"name");Z(typeof s=="string"&&s.match(l9),"invalid identifier","name",s),i=Object.freeze(i.slice()),Te(this,{name:s})}};function Hl(n,e){return"("+e.map(t=>t.format(n)).join(n==="full"?", ":",")+")"}let As=class ul extends Eh{constructor(e,t,r){super(e,"error",t,r),Object.defineProperty(this,wn,{value:py})}get selector(){return qs(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 t=[];return e!=="sighash"&&t.push("error"),t.push(this.name+Hl(e,this.inputs)),t.join(" ")}static from(e){if(ul.isFragment(e))return e;if(typeof e=="string")return ul.from(s0(e));if(e instanceof ni){const t=vh("error",e),r=zs(e);return Ea(e),new ul(bt,t,r)}return new ul(bt,e.name,e.inputs?e.inputs.map(an.from):[])}static isFragment(e){return e&&e[wn]===py}},Gd=class Qa extends Eh{constructor(t,r,s,i){super(t,"event",r,s);R(this,"anonymous");Object.defineProperty(this,wn,{value:by}),Te(this,{anonymous:i})}get topicHash(){return qs(this.format("sighash"))}format(t){if(t==null&&(t="sighash"),t==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(s=>JSON.parse(s.format(t)))});const r=[];return t!=="sighash"&&r.push("event"),r.push(this.name+Hl(t,this.inputs)),t!=="sighash"&&this.anonymous&&r.push("anonymous"),r.join(" ")}static getTopicHash(t,r){return r=(r||[]).map(i=>an.from(i)),new Qa(bt,t,r,!1).topicHash}static from(t){if(Qa.isFragment(t))return t;if(typeof t=="string")try{return Qa.from(s0(t))}catch{Z(!1,"invalid event fragment","obj",t)}else if(t instanceof ni){const r=vh("event",t),s=zs(t,!0),i=!!Js(t,nn(["anonymous"])).has("anonymous");return Ea(t),new Qa(bt,r,s,i)}return new Qa(bt,t.name,t.inputs?t.inputs.map(r=>an.from(r,!0)):[],!!t.anonymous)}static isFragment(t){return t&&t[wn]===by}},zd=class ll extends Ah{constructor(t,r,s,i,a){super(t,r,s);R(this,"payable");R(this,"gas");Object.defineProperty(this,wn,{value:gy}),Te(this,{payable:i,gas:a})}format(t){if(ae(t!=null&&t!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),t==="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(s=>JSON.parse(s.format(t)))});const r=[`constructor${Hl(t,this.inputs)}`];return r.push(this.payable?"payable":"nonpayable"),this.gas!=null&&r.push(`@${this.gas.toString()}`),r.join(" ")}static from(t){if(ll.isFragment(t))return t;if(typeof t=="string")try{return ll.from(s0(t))}catch{Z(!1,"invalid constuctor fragment","obj",t)}else if(t instanceof ni){Js(t,nn(["constructor"]));const r=zs(t),s=!!Js(t,HC).has("payable"),i=h9(t);return Ea(t),new ll(bt,"constructor",r,s,i)}return new ll(bt,"constructor",t.inputs?t.inputs.map(an.from):[],!!t.payable,t.gas!=null?t.gas:null)}static isFragment(t){return t&&t[wn]===gy}},wy=class T0 extends Ah{constructor(t,r,s){super(t,"fallback",r);R(this,"payable");Object.defineProperty(this,wn,{value:yy}),Te(this,{payable:s})}format(t){const r=this.inputs.length===0?"receive":"fallback";if(t==="json"){const s=this.payable?"payable":"nonpayable";return JSON.stringify({type:r,stateMutability:s})}return`${r}()${this.payable?" payable":""}`}static from(t){if(T0.isFragment(t))return t;if(typeof t=="string")try{return T0.from(s0(t))}catch{Z(!1,"invalid fallback fragment","obj",t)}else if(t instanceof ni){const r=t.toString(),s=t.peekKeyword(nn(["fallback","receive"]));if(Z(s,"type must be fallback or receive","obj",r),t.popKeyword(nn(["fallback","receive"]))==="receive"){const u=zs(t);return Z(u.length===0,"receive cannot have arguments","obj.inputs",u),Js(t,nn(["payable"])),Ea(t),new T0(bt,[],!0)}let a=zs(t);a.length?Z(a.length===1&&a[0].type==="bytes","invalid fallback inputs","obj.inputs",a.map(u=>u.format("minimal")).join(", ")):a=[an.from("bytes")];const o=d9(t);if(Z(o==="nonpayable"||o==="payable","fallback cannot be constants","obj.stateMutability",o),Js(t,nn(["returns"])).has("returns")){const u=zs(t);Z(u.length===1&&u[0].type==="bytes","invalid fallback outputs","obj.outputs",u.map(c=>c.format("minimal")).join(", "))}return Ea(t),new T0(bt,a,o==="payable")}if(t.type==="receive")return new T0(bt,[],!0);if(t.type==="fallback"){const r=[an.from("bytes")],s=t.stateMutability==="payable";return new T0(bt,r,s)}Z(!1,"invalid fallback description","obj",t)}static isFragment(t){return t&&t[wn]===yy}},Wd=class Ya extends Eh{constructor(t,r,s,i,a,o){super(t,"function",r,i);R(this,"constant");R(this,"outputs");R(this,"stateMutability");R(this,"payable");R(this,"gas");Object.defineProperty(this,wn,{value:my}),a=Object.freeze(a.slice()),Te(this,{constant:s==="view"||s==="pure",gas:o,outputs:a,payable:s==="payable",stateMutability:s})}get selector(){return qs(this.format("sighash")).substring(0,10)}format(t){if(t==null&&(t="sighash"),t==="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(s=>JSON.parse(s.format(t))),outputs:this.outputs.map(s=>JSON.parse(s.format(t)))});const r=[];return t!=="sighash"&&r.push("function"),r.push(this.name+Hl(t,this.inputs)),t!=="sighash"&&(this.stateMutability!=="nonpayable"&&r.push(this.stateMutability),this.outputs&&this.outputs.length&&(r.push("returns"),r.push(Hl(t,this.outputs))),this.gas!=null&&r.push(`@${this.gas.toString()}`)),r.join(" ")}static getSelector(t,r){return r=(r||[]).map(i=>an.from(i)),new Ya(bt,t,"view",r,[],null).selector}static from(t){if(Ya.isFragment(t))return t;if(typeof t=="string")try{return Ya.from(s0(t))}catch{Z(!1,"invalid function fragment","obj",t)}else if(t instanceof ni){const s=vh("function",t),i=zs(t),a=d9(t);let o=[];Js(t,nn(["returns"])).has("returns")&&(o=zs(t));const u=h9(t);return Ea(t),new Ya(bt,s,a,i,o,u)}let r=t.stateMutability;return r==null&&(r="payable",typeof t.constant=="boolean"?(r="view",t.constant||(r="payable",typeof t.payable=="boolean"&&!t.payable&&(r="nonpayable"))):typeof t.payable=="boolean"&&!t.payable&&(r="nonpayable")),new Ya(bt,t.name,r,t.inputs?t.inputs.map(an.from):[],t.outputs?t.outputs.map(an.from):[],t.gas!=null?t.gas:null)}static isFragment(t){return t&&t[wn]===my}},v6=class Kd extends Eh{constructor(e,t,r){super(e,"struct",t,r),Object.defineProperty(this,wn,{value:xy})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return Kd.from(s0(e))}catch{Z(!1,"invalid struct fragment","obj",e)}else if(e instanceof ni){const t=vh("struct",e),r=zs(e);return Ea(e),new Kd(bt,t,r)}return new Kd(bt,e.name,e.inputs?e.inputs.map(an.from):[])}static isFragment(e){return e&&e[wn]===xy}};const Lr=new Map;Lr.set(0,"GENERIC_PANIC");Lr.set(1,"ASSERT_FALSE");Lr.set(17,"OVERFLOW");Lr.set(18,"DIVIDE_BY_ZERO");Lr.set(33,"ENUM_RANGE_ERROR");Lr.set(34,"BAD_STORAGE_DATA");Lr.set(49,"STACK_UNDERFLOW");Lr.set(50,"ARRAY_RANGE_ERROR");Lr.set(65,"OUT_OF_MEMORY");Lr.set(81,"UNINITIALIZED_FUNCTION_CALL");const XC=new RegExp(/^bytes([0-9]*)$/),eS=new RegExp(/^(u?int)([0-9]*)$/);let A6=null;function tS(n,e,t,r){let s="missing revert data",i=null;const a=null;let o=null;if(t){s="execution reverted";const c=Ce(t);if(t=de(t),c.length===0)s+=" (no data present; likely require(false) occurred",i="require(false)";else if(c.length%32!==4)s+=" (could not decode reason; invalid data length)";else if(de(c.slice(0,4))==="0x08c379a0")try{i=r.decode(["string"],c.slice(4))[0],o={signature:"Error(string)",name:"Error",args:[i]},s+=`: ${JSON.stringify(i)}`}catch{s+=" (could not decode reason; invalid string data)"}else if(de(c.slice(0,4))==="0x4e487b71")try{const l=Number(r.decode(["uint256"],c.slice(4))[0]);o={signature:"Panic(uint256)",name:"Panic",args:[l]},i=`Panic due to ${Lr.get(l)||"UNKNOWN"}(${l})`,s+=`: ${i}`}catch{s+=" (could not decode panic code)"}else s+=" (unknown custom error)"}const u={to:e.to?Ve(e.to):null,data:e.data||"0x"};return e.from&&(u.from=Ve(e.from)),_t(s,"CALL_EXCEPTION",{action:n,data:t,reason:i,transaction:u,invocation:a,revert:o})}var ki,Za,Tc;let Ap=(Tc=class{constructor(){$(this,ki)}getDefaultValue(e){const t=e.map(s=>Q(this,ki,Za).call(this,an.from(s)));return new pd(t,"_").defaultValue()}encode(e,t){V4(t.length,e.length,"types/values length mismatch");const r=e.map(a=>Q(this,ki,Za).call(this,an.from(a))),s=new pd(r,"_"),i=new dp;return s.encode(i,t),i.data}decode(e,t,r){const s=e.map(a=>Q(this,ki,Za).call(this,an.from(a)));return new pd(s,"_").decode(new F_(t,r))}static defaultAbiCoder(){return A6==null&&(A6=new Tc),A6}static getBuiltinCallException(e,t,r){return tS(e,t,r,Tc.defaultAbiCoder())}},ki=new WeakSet,Za=function(e){if(e.isArray())return new Rk(Q(this,ki,Za).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new pd(e.components.map(r=>Q(this,ki,Za).call(this,r)),e.name);switch(e.baseType){case"address":return new Ck(e.name);case"bool":return new Tk(e.name);case"string":return new Mk(e.name);case"bytes":return new Ok(e.name);case"":return new Bk(e.name)}let t=e.type.match(eS);if(t){let r=parseInt(t[2]||"256");return Z(r!==0&&r<=256&&r%8===0,"invalid "+t[1]+" bit length","param",e),new Dk(r/8,t[1]==="int",e.name)}if(t=e.type.match(XC),t){let r=parseInt(t[1]);return Z(r!==0&&r<=32,"invalid bytes length","param",e),new Nk(r,e.name)}Z(!1,"invalid type","type",e.type)},Tc),nS=class{constructor(e,t,r){R(this,"fragment");R(this,"name");R(this,"signature");R(this,"topic");R(this,"args");const s=e.name,i=e.format();Te(this,{fragment:e,name:s,signature:i,topic:t,args:r})}},rS=class{constructor(e,t,r,s){R(this,"fragment");R(this,"name");R(this,"args");R(this,"signature");R(this,"selector");R(this,"value");const i=e.name,a=e.format();Te(this,{fragment:e,name:i,args:r,signature:a,selector:t,value:s})}},sS=class{constructor(e,t,r){R(this,"fragment");R(this,"name");R(this,"args");R(this,"signature");R(this,"selector");const s=e.name,i=e.format();Te(this,{fragment:e,name:s,args:r,signature:i,selector:t})}},vy=class{constructor(e){R(this,"hash");R(this,"_isIndexed");Te(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}};const Ay={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"},Ey={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:n=>`reverted with reason string ${JSON.stringify(n)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:n=>{let e="unknown panic code";return n>=0&&n<=255&&Ay[n.toString()]&&(e=Ay[n.toString()]),`reverted with panic code 0x${n.toString(16)} (${e})`}}};var Wr,Kr,Vr,$t,Ho,Vd,Go,qd,Wi;let iS=(Wi=class{constructor(e){$(this,Ho);$(this,Go);R(this,"fragments");R(this,"deploy");R(this,"fallback");R(this,"receive");$(this,Wr,void 0);$(this,Kr,void 0);$(this,Vr,void 0);$(this,$t,void 0);let t=[];typeof e=="string"?t=JSON.parse(e):t=e,k(this,Vr,new Map),k(this,Wr,new Map),k(this,Kr,new Map);const r=[];for(const a of t)try{r.push(Ah.from(a))}catch(o){console.log("EE",o)}Te(this,{fragments:Object.freeze(r)});let s=null,i=!1;k(this,$t,this.getAbiCoder()),this.fragments.forEach((a,o)=>{let u;switch(a.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Te(this,{deploy:a});return;case"fallback":a.inputs.length===0?i=!0:(Z(!s||a.payable!==s.payable,"conflicting fallback fragments",`fragments[${o}]`,a),s=a,i=s.payable);return;case"function":u=g(this,Vr);break;case"event":u=g(this,Kr);break;case"error":u=g(this,Wr);break;default:return}const c=a.format();u.has(c)||u.set(c,a)}),this.deploy||Te(this,{deploy:zd.from("constructor()")}),Te(this,{fallback:s,receive:i})}format(e){const t=e?"minimal":"full";return this.fragments.map(s=>s.format(t))}formatJson(){const e=this.fragments.map(t=>t.format("json"));return JSON.stringify(e.map(t=>JSON.parse(t)))}getAbiCoder(){return Ap.defaultAbiCoder()}getFunctionName(e){const t=Q(this,Ho,Vd).call(this,e,null,!1);return Z(t,"no matching function","key",e),t.name}hasFunction(e){return!!Q(this,Ho,Vd).call(this,e,null,!1)}getFunction(e,t){return Q(this,Ho,Vd).call(this,e,t||null,!0)}forEachFunction(e){const t=Array.from(g(this,Vr).keys());t.sort((r,s)=>r.localeCompare(s));for(let r=0;rr.localeCompare(s));for(let r=0;r1){const i=s.map(a=>JSON.stringify(a.format())).join(", ");Z(!1,`ambiguous error description (i.e. ${i})`,"name",e)}return s[0]}if(e=As.from(e).format(),e==="Error(string)")return As.from("error Error(string)");if(e==="Panic(uint256)")return As.from("error Panic(uint256)");const r=g(this,Wr).get(e);return r||null}forEachError(e){const t=Array.from(g(this,Wr).keys());t.sort((r,s)=>r.localeCompare(s));for(let r=0;ri.type==="string"?qs(a):i.type==="bytes"?st(de(a)):(i.type==="bool"&&typeof a=="boolean"?a=a?"0x01":"0x00":i.type.match(/^u?int/)?a=Ks(a):i.type.match(/^bytes/)?a=f_(a,32):i.type==="address"&&g(this,$t).encode(["address"],[a]),ma(de(a),32));for(t.forEach((i,a)=>{const o=e.inputs[a];if(!o.indexed){Z(i==null,"cannot filter non-indexed parameters; must be null","contract."+o.name,i);return}i==null?r.push(null):o.baseType==="array"||o.baseType==="tuple"?Z(!1,"filtering with tuples or arrays not supported","contract."+o.name,i):Array.isArray(i)?r.push(i.map(u=>s(o,u))):r.push(s(o,i))});r.length&&r[r.length-1]===null;)r.pop();return r}encodeEventLog(e,t){if(typeof e=="string"){const a=this.getEvent(e);Z(a,"unknown event","eventFragment",e),e=a}const r=[],s=[],i=[];return e.anonymous||r.push(e.topicHash),Z(t.length===e.inputs.length,"event arguments/values mismatch","values",t),e.inputs.forEach((a,o)=>{const u=t[o];if(a.indexed)if(a.type==="string")r.push(qs(u));else if(a.type==="bytes")r.push(st(u));else{if(a.baseType==="tuple"||a.baseType==="array")throw new Error("not implemented");r.push(g(this,$t).encode([a.type],[u]))}else s.push(a),i.push(u)}),{data:g(this,$t).encode(s,i),topics:r}}decodeEventLog(e,t,r){if(typeof e=="string"){const h=this.getEvent(e);Z(h,"unknown event","eventFragment",e),e=h}if(r!=null&&!e.anonymous){const h=e.topicHash;Z(yt(r[0],32)&&r[0].toLowerCase()===h,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}const s=[],i=[],a=[];e.inputs.forEach((h,p)=>{h.indexed?h.type==="string"||h.type==="bytes"||h.baseType==="tuple"||h.baseType==="array"?(s.push(an.from({type:"bytes32",name:h.name})),a.push(!0)):(s.push(h),a.push(!1)):(i.push(h),a.push(!1))});const o=r!=null?g(this,$t).decode(s,ot(r)):null,u=g(this,$t).decode(i,t,!0),c=[],l=[];let d=0,f=0;return e.inputs.forEach((h,p)=>{let b=null;if(h.indexed)if(o==null)b=new vy(null);else if(a[p])b=new vy(o[f++]);else try{b=o[f++]}catch(v){b=v}else try{b=u[d++]}catch(v){b=v}c.push(b),l.push(h.name||null)}),o7.fromItems(c,l)}parseTransaction(e){const t=Ce(e.data,"tx.data"),r=Ne(e.value!=null?e.value:0,"tx.value"),s=this.getFunction(de(t.slice(0,4)));if(!s)return null;const i=g(this,$t).decode(s.inputs,t.slice(4));return new rS(s,s.selector,i,r)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new nS(t,t.topicHash,this.decodeEventLog(t,e.data,e.topics))}parseError(e){const t=de(e),r=this.getError(ft(t,0,4));if(!r)return null;const s=g(this,$t).decode(r.inputs,ft(t,4));return new sS(r,r.selector,s)}static from(e){return e instanceof Wi?e:typeof e=="string"?new Wi(JSON.parse(e)):typeof e.format=="function"?new Wi(e.format("json")):new Wi(e)}},Wr=new WeakMap,Kr=new WeakMap,Vr=new WeakMap,$t=new WeakMap,Ho=new WeakSet,Vd=function(e,t,r){if(yt(e)){const i=e.toLowerCase();for(const a of g(this,Vr).values())if(i===a.selector)return a;return null}if(e.indexOf("(")===-1){const i=[];for(const[a,o]of g(this,Vr))a.split("(")[0]===e&&i.push(o);if(t){const a=t.length>0?t[t.length-1]:null;let o=t.length,u=!0;xn.isTyped(a)&&a.type==="overrides"&&(u=!1,o--);for(let c=i.length-1;c>=0;c--){const l=i[c].inputs.length;l!==o&&(!u||l!==o-1)&&i.splice(c,1)}for(let c=i.length-1;c>=0;c--){const l=i[c].inputs;for(let d=0;d=l.length){if(t[d].type==="overrides")continue;i.splice(c,1);break}if(t[d].type!==l[d].baseType){i.splice(c,1);break}}}}if(i.length===1&&t&&t.length!==i[0].inputs.length){const a=t[t.length-1];(a==null||Array.isArray(a)||typeof a!="object")&&i.splice(0,1)}if(i.length===0)return null;if(i.length>1&&r){const a=i.map(o=>JSON.stringify(o.format())).join(", ");Z(!1,`ambiguous function description (i.e. matches ${a})`,"key",e)}return i[0]}const s=g(this,Vr).get(Wd.from(e).format());return s||null},Go=new WeakSet,qd=function(e,t,r){if(yt(e)){const i=e.toLowerCase();for(const a of g(this,Kr).values())if(i===a.topicHash)return a;return null}if(e.indexOf("(")===-1){const i=[];for(const[a,o]of g(this,Kr))a.split("(")[0]===e&&i.push(o);if(t){for(let a=i.length-1;a>=0;a--)i[a].inputs.length=0;a--){const o=i[a].inputs;for(let u=0;u1&&r){const a=i.map(o=>JSON.stringify(o.format())).join(", ");Z(!1,`ambiguous event description (i.e. matches ${a})`,"key",e)}return i[0]}const s=g(this,Kr).get(Gd.from(e).format());return s||null},Wi);const p9=BigInt(0);function Tl(n){return n??null}function Vt(n){return n==null?null:n.toString()}class _y{constructor(e,t,r){R(this,"gasPrice");R(this,"maxFeePerGas");R(this,"maxPriorityFeePerGas");Te(this,{gasPrice:Tl(e),maxFeePerGas:Tl(t),maxPriorityFeePerGas:Tl(r)})}toJSON(){const{gasPrice:e,maxFeePerGas:t,maxPriorityFeePerGas:r}=this;return{_type:"FeeData",gasPrice:Vt(e),maxFeePerGas:Vt(t),maxPriorityFeePerGas:Vt(r)}}}function $1(n){const e={};n.to&&(e.to=n.to),n.from&&(e.from=n.from),n.data&&(e.data=de(n.data));const t="chainId,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const s of t)!(s in n)||n[s]==null||(e[s]=Ne(n[s],`request.${s}`));const r="type,nonce".split(/,/);for(const s of r)!(s in n)||n[s]==null||(e[s]=He(n[s],`request.${s}`));return n.accessList&&(e.accessList=Ba(n.accessList)),"blockTag"in n&&(e.blockTag=n.blockTag),"enableCcipRead"in n&&(e.enableCcipRead=!!n.enableCcipRead),"customData"in n&&(e.customData=n.customData),e}var Os;class aS{constructor(e,t){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");$(this,Os,void 0);k(this,Os,e.transactions.map(r=>typeof r!="string"?new Q5(r,t):r)),Te(this,{provider:t,hash:Tl(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:Tl(e.baseFeePerGas)})}get transactions(){return g(this,Os).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=g(this,Os).slice();return e.length===0?[]:(ae(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:t,extraData:r,gasLimit:s,gasUsed:i,hash:a,miner:o,nonce:u,number:c,parentHash:l,timestamp:d,transactions:f}=this;return{_type:"Block",baseFeePerGas:Vt(e),difficulty:Vt(t),extraData:r,gasLimit:Vt(s),gasUsed:Vt(i),hash:a,miner:o,nonce:u,number:c,parentHash:l,timestamp:d,transactions:f}}[Symbol.iterator](){let e=0;const t=this.transactions;return{next:()=>enew Tf(s,t))));let r=p9;e.effectiveGasPrice!=null?r=e.effectiveGasPrice:e.gasPrice!=null&&(r=e.gasPrice),Te(this,{provider:t,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,gasPrice:r,type:e.type,status:e.status,root:e.root})}get logs(){return g(this,sf)}toJSON(){const{to:e,from:t,contractAddress:r,hash:s,index:i,blockHash:a,blockNumber:o,logsBloom:u,logs:c,status:l,root:d}=this;return{_type:"TransactionReceipt",blockHash:a,blockNumber:o,contractAddress:r,cumulativeGasUsed:Vt(this.cumulativeGasUsed),from:t,gasPrice:Vt(this.gasPrice),gasUsed:Vt(this.gasUsed),hash:s,index:i,logs:c,logsBloom:u,root:d,status:l,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e{if(o)return null;const{blockNumber:f,nonce:h}=await Wt({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(h{if(f==null||f.status!==0)return f;ae(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:f.to,from:f.from,data:""},receipt:f})},l=await this.provider.getTransactionReceipt(this.hash);if(r===0)return c(l);if(l){if(await l.confirmations()>=r)return c(l)}else if(await u(),r===0)return null;return await new Promise((f,h)=>{const p=[],b=()=>{p.forEach(w=>w())};if(p.push(()=>{o=!0}),s>0){const w=setTimeout(()=>{b(),h(_t("wait for transaction timeout","TIMEOUT"))},s);p.push(()=>{clearTimeout(w)})}const v=async w=>{if(await w.confirmations()>=r){b();try{f(c(w))}catch(m){h(m)}}};if(p.push(()=>{this.provider.off(this.hash,v)}),this.provider.on(this.hash,v),i>=0){const w=async()=>{try{await u()}catch(m){if(ir(m,"TRANSACTION_REPLACED")){b(),h(m);return}}o||this.provider.once("block",w)};p.push(()=>{this.provider.off("block",w)}),this.provider.once("block",w)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}removedEvent(){return ae(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),y9(this)}reorderedEvent(e){return ae(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),ae(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),g9(this,e)}replaceableTransaction(e){Z(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const t=new af(this,this.provider);return k(t,Ci,e),t}},Ci=new WeakMap,af);function oS(n){return{orphan:"drop-block",hash:n.hash,number:n.number}}function g9(n,e){return{orphan:"reorder-transaction",tx:n,other:e}}function y9(n){return{orphan:"drop-transaction",tx:n}}function cS(n){return{orphan:"drop-log",log:{transactionHash:n.transactionHash,blockHash:n.blockHash,blockNumber:n.blockNumber,address:n.address,data:n.data,topics:Object.freeze(n.topics.slice()),index:n.index}}}let Y5=class extends Tf{constructor(t,r,s){super(t,t.provider);R(this,"interface");R(this,"fragment");R(this,"args");const i=r.decodeEventLog(s,t.data,t.topics);Te(this,{args:i,fragment:s,interface:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}},m9=class extends Tf{constructor(t,r){super(t,t.provider);R(this,"error");Te(this,{error:r})}};var zo,O4;let uS=(O4=class extends b9{constructor(t,r,s){super(s,r);$(this,zo,void 0);k(this,zo,t)}get logs(){return super.logs.map(t=>{const r=t.topics.length?g(this,zo).getEvent(t.topics[0]):null;if(r)try{return new Y5(t,g(this,zo),r)}catch(s){return new m9(t,s)}return t})}},zo=new WeakMap,O4);var of,N4;let Z5=(N4=class extends Q5{constructor(t,r,s){super(s,r);$(this,of,void 0);k(this,of,t)}async wait(t){const r=await super.wait(t);return r==null?null:new uS(g(this,of),this.provider,r)}},of=new WeakMap,N4),x9=class extends e7{constructor(t,r,s,i){super(t,r,s);R(this,"log");Te(this,{log:i})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}},lS=class extends x9{constructor(e,t,r,s,i){super(e,t,r,new Y5(i,e.interface,s));const a=e.interface.decodeEventLog(s,this.log.data,this.log.topics);Te(this,{args:a,fragment:s})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}};const Py=BigInt(0);function w9(n){return n&&typeof n.call=="function"}function v9(n){return n&&typeof n.estimateGas=="function"}function X5(n){return n&&typeof n.resolveName=="function"}function A9(n){return n&&typeof n.sendTransaction=="function"}var cf,I4;let fS=(I4=class{constructor(e,t,r){$(this,cf,void 0);R(this,"fragment");if(Te(this,{fragment:t}),t.inputs.lengthr[u]==null?null:o.walkAsync(r[u],(l,d)=>l==="address"?Array.isArray(d)?Promise.all(d.map(f=>Jt(f,i))):Jt(d,i):d)));return e.interface.encodeFilterTopics(t,a)}())}getTopicFilter(){return g(this,cf)}},cf=new WeakMap,I4);function _a(n,e){return n==null?null:typeof n[e]=="function"?n:n.provider&&typeof n.provider[e]=="function"?n.provider:null}function j0(n){return n==null?null:n.provider||null}async function E9(n,e){const t=xn.dereference(n,"overrides");Z(typeof t=="object","invalid overrides parameter","overrides",n);const r=$1(t);return Z(r.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),Z(r.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=await Jt(r.from)),r}async function dS(n,e,t){const r=_a(n,"resolveName"),s=X5(r)?r:null;return await Promise.all(e.map((i,a)=>i.walkAsync(t[a],(o,u)=>(u=xn.dereference(u,o),o==="address"?Jt(u,s):u))))}function hS(n){const e=async function(a){const o=await E9(a,["data"]);o.to=await n.getAddress();const u=n.interface,c=Ne(o.value||Py,"overrides.value")===Py,l=(o.data||"0x")==="0x";u.fallback&&!u.fallback.payable&&u.receive&&!l&&!c&&Z(!1,"cannot send data to receive or send value to non-payable fallback","overrides",a),Z(u.fallback||l,"cannot send data to receive-only contract","overrides.data",o.data);const d=u.receive||u.fallback&&u.fallback.payable;return Z(d||c,"cannot send value to non-payable fallback","overrides.value",o.value),Z(u.fallback||l,"cannot send data to receive-only contract","overrides.data",o.data),o},t=async function(a){const o=_a(n.runner,"call");ae(w9(o),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const u=await e(a);try{return await o.call(u)}catch(c){throw O5(c)&&c.data?n.interface.makeError(c.data,u):c}},r=async function(a){const o=n.runner;ae(A9(o),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const u=await o.sendTransaction(await e(a)),c=j0(n.runner);return new Z5(n.interface,c,u)},s=async function(a){const o=_a(n.runner,"estimateGas");return ae(v9(o),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await o.estimateGas(await e(a))},i=async a=>await r(a);return Te(i,{_contract:n,estimateGas:s,populateTransaction:e,send:r,staticCall:t}),i}function pS(n,e){const t=function(...c){const l=n.interface.getFunction(e,c);return ae(l,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:c}}),l},r=async function(...c){const l=t(...c);let d={};if(l.inputs.length+1===c.length&&(d=await E9(c.pop())),l.inputs.length!==c.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const f=await dS(n.runner,l.inputs,c);return Object.assign({},d,await Wt({to:n.getAddress(),data:n.interface.encodeFunctionData(l,f)}))},s=async function(...c){const l=await o(...c);return l.length===1?l[0]:l},i=async function(...c){const l=n.runner;ae(A9(l),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const d=await l.sendTransaction(await r(...c)),f=j0(n.runner);return new Z5(n.interface,f,d)},a=async function(...c){const l=_a(n.runner,"estimateGas");return ae(v9(l),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await l.estimateGas(await r(...c))},o=async function(...c){const l=_a(n.runner,"call");ae(w9(l),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const d=await r(...c);let f="0x";try{f=await l.call(d)}catch(p){throw O5(p)&&p.data?n.interface.makeError(p.data,d):p}const h=t(...c);return n.interface.decodeFunctionResult(h,f)},u=async(...c)=>t(...c).constant?await s(...c):await i(...c);return Te(u,{name:n.interface.getFunctionName(e),_contract:n,_key:e,getFragment:t,estimateGas:a,populateTransaction:r,send:i,staticCall:s,staticCallResult:o}),Object.defineProperty(u,"fragment",{configurable:!1,enumerable:!0,get:()=>{const c=n.interface.getFunction(e);return ae(c,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),c}}),u}function bS(n,e){const t=function(...s){const i=n.interface.getEvent(e,s);return ae(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:s}}),i},r=function(...s){return new fS(n,t(...s),s)};return Te(r,{name:n.interface.getEventName(e),_contract:n,_key:e,getFragment:t}),Object.defineProperty(r,"fragment",{configurable:!1,enumerable:!0,get:()=>{const s=n.interface.getEvent(e);return ae(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),s}}),r}const H1=Symbol.for("_ethersInternal_contract"),_9=new WeakMap;function gS(n,e){_9.set(n[H1],e)}function Nn(n){return _9.get(n[H1])}function yS(n){return n&&typeof n=="object"&&"getTopicFilter"in n&&typeof n.getTopicFilter=="function"&&n.fragment}async function eb(n,e){let t,r=null;if(Array.isArray(e)){const i=function(a){if(yt(a,32))return a;const o=n.interface.getEvent(a);return Z(o,"unknown fragment","name",a),o.topicHash};t=e.map(a=>a==null?null:Array.isArray(a)?a.map(i):i(a))}else e==="*"?t=[null]:typeof e=="string"?yt(e,32)?t=[e]:(r=n.interface.getEvent(e),Z(r,"unknown fragment","event",e),t=[r.topicHash]):yS(e)?t=await e.getTopicFilter():"fragment"in e?(r=e.fragment,t=[r.topicHash]):Z(!1,"unknown event name","event",e);t=t.map(i=>{if(i==null)return null;if(Array.isArray(i)){const a=Array.from(new Set(i.map(o=>o.toLowerCase())).values());return a.length===1?a[0]:(a.sort(),a)}return i.toLowerCase()});const s=t.map(i=>i==null?"null":Array.isArray(i)?i.join("|"):i).join("&");return{fragment:r,tag:s,topics:t}}async function fl(n,e){const{subs:t}=Nn(n);return t.get((await eb(n,e)).tag)||null}async function ky(n,e,t){const r=j0(n.runner);ae(r,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:s,tag:i,topics:a}=await eb(n,t),{addr:o,subs:u}=Nn(n);let c=u.get(i);if(!c){const d={address:o||n,topics:a},f=v=>{let w=s;if(w==null)try{w=n.interface.getEvent(v.topics[0])}catch{}if(w){const m=w,x=s?n.interface.decodeEventLog(s,v.data,v.topics):[];_p(n,t,x,y=>new lS(n,y,t,m,v))}else _p(n,t,[],m=>new x9(n,m,t,v))};let h=[];c={tag:i,listeners:[],start:()=>{h.length||h.push(r.on(d,f))},stop:async()=>{if(h.length==0)return;let v=h;h=[],await Promise.all(v),r.off(d,f)}},u.set(i,c)}return c}let Ep=Promise.resolve();async function mS(n,e,t,r){await Ep;const s=await fl(n,e);if(!s)return!1;const i=s.listeners.length;return s.listeners=s.listeners.filter(({listener:a,once:o})=>{const u=Array.from(t);r&&u.push(r(o?null:a));try{a.call(n,...u)}catch{}return!o}),s.listeners.length===0&&(s.stop(),Nn(n).subs.delete(s.tag)),i>0}async function _p(n,e,t,r){try{await Ep}catch{}const s=mS(n,e,t,r);return Ep=s,await s}const bd=["then"];var $D,ya;let xS=(ya=class{constructor(e,t,r,s){R(this,"target");R(this,"interface");R(this,"runner");R(this,"filters");R(this,$D);R(this,"fallback");Z(typeof e=="string"||mw(e),"invalid value for Contract target","target",e),r==null&&(r=null);const i=iS.from(t);Te(this,{target:e,runner:r,interface:i}),Object.defineProperty(this,H1,{value:{}});let a,o=null,u=null;if(s){const d=j0(r);u=new Z5(this.interface,d,s)}let c=new Map;if(typeof e=="string")if(yt(e))o=e,a=Promise.resolve(e);else{const d=_a(r,"resolveName");if(!X5(d))throw _t("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});a=d.resolveName(e).then(f=>{if(f==null)throw _t("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return Nn(this).addr=f,f})}else a=e.getAddress().then(d=>{if(d==null)throw new Error("TODO");return Nn(this).addr=d,d});gS(this,{addrPromise:a,addr:o,deployTx:u,subs:c});const l=new Proxy({},{get:(d,f,h)=>{if(typeof f=="symbol"||bd.indexOf(f)>=0)return Reflect.get(d,f,h);try{return this.getEvent(f)}catch(p){if(!ir(p,"INVALID_ARGUMENT")||p.argument!=="key")throw p}},has:(d,f)=>bd.indexOf(f)>=0?Reflect.has(d,f):Reflect.has(d,f)||this.interface.hasEvent(String(f))});return Te(this,{filters:l}),Te(this,{fallback:i.receive||i.fallback?hS(this):null}),new Proxy(this,{get:(d,f,h)=>{if(typeof f=="symbol"||f in d||bd.indexOf(f)>=0)return Reflect.get(d,f,h);try{return d.getFunction(f)}catch(p){if(!ir(p,"INVALID_ARGUMENT")||p.argument!=="key")throw p}},has:(d,f)=>typeof f=="symbol"||f in d||bd.indexOf(f)>=0?Reflect.has(d,f):d.interface.hasFunction(f)})}connect(e){return new ya(this.target,this.interface,e)}attach(e){return new ya(e,this.interface,this.runner)}async getAddress(){return await Nn(this).addrPromise}async getDeployedCode(){const e=j0(this.runner);ae(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const t=await e.getCode(await this.getAddress());return t==="0x"?null:t}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const r=j0(this.runner);return ae(r!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((s,i)=>{const a=async()=>{try{if(await this.getDeployedCode()!=null)return s(this);r.once("block",a)}catch(o){i(o)}};a()})}deploymentTransaction(){return Nn(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),pS(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),bS(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,t,r){t==null&&(t=0),r==null&&(r="latest");const{addr:s,addrPromise:i}=Nn(this),a=s||await i,{fragment:o,topics:u}=await eb(this,e),c={address:a,topics:u,fromBlock:t,toBlock:r},l=j0(this.runner);return ae(l,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await l.getLogs(c)).map(d=>{let f=o;if(f==null)try{f=this.interface.getEvent(d.topics[0])}catch{}if(f)try{return new Y5(d,this.interface,f)}catch(h){return new m9(d,h)}return new Tf(d,l)})}async on(e,t){const r=await ky(this,"on",e);return r.listeners.push({listener:t,once:!1}),r.start(),this}async once(e,t){const r=await ky(this,"once",e);return r.listeners.push({listener:t,once:!0}),r.start(),this}async emit(e,...t){return await _p(this,e,t,null)}async listenerCount(e){if(e){const s=await fl(this,e);return s?s.listeners.length:0}const{subs:t}=Nn(this);let r=0;for(const{listeners:s}of t.values())r+=s.length;return r}async listeners(e){if(e){const s=await fl(this,e);return s?s.listeners.map(({listener:i})=>i):[]}const{subs:t}=Nn(this);let r=[];for(const{listeners:s}of t.values())r=r.concat(s.map(({listener:i})=>i));return r}async off(e,t){const r=await fl(this,e);if(!r)return this;if(t){const s=r.listeners.map(({listener:i})=>i).indexOf(t);s>=0&&r.listeners.splice(s,1)}return(t==null||r.listeners.length===0)&&(r.stop(),Nn(this).subs.delete(r.tag)),this}async removeAllListeners(e){if(e){const t=await fl(this,e);if(!t)return this;t.stop(),Nn(this).subs.delete(t.tag)}else{const{subs:t}=Nn(this);for(const{tag:r,stop:s}of t.values())s(),t.delete(r)}return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return await this.off(e,t)}static buildClass(e){class t extends ya{constructor(s,i=null){super(s,e,i)}}return t}static from(e,t,r){return r==null&&(r=null),new this(e,t,r)}},$D=H1,ya);function wS(){return xS}let Ol=class extends wS(){};function E6(n){return n.match(/^ipfs:\/\/ipfs\//i)?n=n.substring(12):n.match(/^ipfs:\/\//i)?n=n.substring(7):Z(!1,"unsupported IPFS format","link",n),`https://gateway.ipfs.io/ipfs/${n}`}class vS{constructor(e){R(this,"name");Te(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,t){throw new Error("unsupported coin")}async decodeAddress(e,t){throw new Error("unsupported coin")}}const P9=new RegExp("^(ipfs)://(.*)$","i"),Cy=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),P9,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];var Si,Y0,Ri,Xa,sh,k9;const fo=class fo{constructor(e,t,r){$(this,Ri);R(this,"provider");R(this,"address");R(this,"name");$(this,Si,void 0);$(this,Y0,void 0);Te(this,{provider:e,address:t,name:r}),k(this,Si,null),k(this,Y0,new Ol(t,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return g(this,Si)==null&&k(this,Si,(async()=>{try{return await g(this,Y0).supportsInterface("0x9061b923")}catch(e){if(ir(e,"CALL_EXCEPTION"))return!1;throw k(this,Si,null),e}})()),await g(this,Si)}async getAddress(e){if(e==null&&(e=60),e===60)try{const i=await Q(this,Ri,Xa).call(this,"addr(bytes32)");return i==null||i===yp?null:i}catch(i){if(ir(i,"CALL_EXCEPTION"))return null;throw i}if(e>=0&&e<2147483648){let i=e+2147483648;const a=await Q(this,Ri,Xa).call(this,"addr(bytes32,uint)",[i]);if(yt(a,20))return Ve(a)}let t=null;for(const i of this.provider.plugins)if(i instanceof vS&&i.supportsCoinType(e)){t=i;break}if(t==null)return null;const r=await Q(this,Ri,Xa).call(this,"addr(bytes32,uint)",[e]);if(r==null||r==="0x")return null;const s=await t.decodeAddress(e,r);if(s!=null)return s;ae(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:r}})}async getText(e){const t=await Q(this,Ri,Xa).call(this,"text(bytes32,string)",[e]);return t==null||t==="0x"?null:t}async getContentHash(){const e=await Q(this,Ri,Xa).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const t=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const s=t[1]==="e3010170"?"ipfs":"ipns",i=parseInt(t[4],16);if(t[5].length===i*2)return`${s}://${X4("0x"+t[2])}`}const r=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&r[1].length===64)return`bzz://${r[1]}`;ae(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const t=await this.getText("avatar");if(t==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:t});for(let r=0;r{if(!Array.isArray(e))throw new Error("not an array");return e.map(t=>n(t))}}function Of(n,e){return t=>{const r={};for(const s in n){let i=s;if(e&&s in e&&!(i in t)){for(const a of e[s])if(a in t){i=a;break}}try{const a=n[s](t[i]);a!==void 0&&(r[s]=a)}catch(a){const o=a instanceof Error?a.message:"not-an-error";ae(!1,`invalid value for value.${s} (${o})`,"BAD_DATA",{value:t})}}return r}}function AS(n){switch(n){case!0:case"true":return!0;case!1:case"false":return!1}Z(!1,`invalid boolean; ${JSON.stringify(n)}`,"value",n)}function wc(n){return Z(yt(n,!0),"invalid data","value",n),n}function ar(n){return Z(yt(n,32),"invalid hash","value",n),n}const ES=Of({address:Ve,blockHash:ar,blockNumber:He,data:wc,index:He,removed:ht(AS,!1),topics:tb(ar),transactionHash:ar,transactionIndex:He},{index:["logIndex"]});function _S(n){return ES(n)}const PS=Of({hash:ht(ar),parentHash:ar,number:He,timestamp:He,nonce:ht(wc),difficulty:Ne,gasLimit:Ne,gasUsed:Ne,miner:ht(Ve),extraData:wc,baseFeePerGas:ht(Ne)});function kS(n){const e=PS(n);return e.transactions=n.transactions.map(t=>typeof t=="string"?t:C9(t)),e}const CS=Of({transactionIndex:He,blockNumber:He,transactionHash:ar,address:Ve,topics:tb(ar),data:wc,index:He,blockHash:ar},{index:["logIndex"]});function SS(n){return CS(n)}const RS=Of({to:ht(Ve,null),from:ht(Ve,null),contractAddress:ht(Ve,null),index:He,root:ht(de),gasUsed:Ne,logsBloom:ht(wc),blockHash:ar,hash:ar,logs:tb(SS),blockNumber:He,cumulativeGasUsed:Ne,effectiveGasPrice:ht(Ne),status:ht(He),type:ht(He,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function TS(n){return RS(n)}function C9(n){n.to&&Ne(n.to)===Sy&&(n.to="0x0000000000000000000000000000000000000000");const e=Of({hash:ar,type:t=>t==="0x"||t==null?0:He(t),accessList:ht(Ba,null),blockHash:ht(ar,null),blockNumber:ht(He,null),transactionIndex:ht(He,null),from:Ve,gasPrice:ht(Ne),maxPriorityFeePerGas:ht(Ne),maxFeePerGas:ht(Ne),gasLimit:Ne,to:ht(Ve,null),value:Ne,nonce:He,data:wc,creates:ht(Ve,null),chainId:ht(Ne,null)},{data:["input"],gasLimit:["gas"]})(n);if(e.to==null&&e.creates==null&&(e.creates=kk(e)),(n.type===1||n.type===2)&&n.accessList==null&&(e.accessList=[]),n.signature?e.signature=ur.from(n.signature):e.signature=ur.from(n),e.chainId==null){const t=e.signature.legacyChainId;t!=null&&(e.chainId=t)}return e.blockHash&&Ne(e.blockHash)===Sy&&(e.blockHash=null),e}const OS="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class Nf{constructor(e){R(this,"name");Te(this,{name:e})}clone(){return new Nf(this.name)}}class _h extends Nf{constructor(t,r){t==null&&(t=0);super(`org.ethers.network.plugins.GasCost#${t||0}`);R(this,"effectiveBlock");R(this,"txBase");R(this,"txCreate");R(this,"txDataZero");R(this,"txDataNonzero");R(this,"txAccessListStorageKey");R(this,"txAccessListAddress");const s={effectiveBlock:t};function i(a,o){let u=(r||{})[a];u==null&&(u=o),Z(typeof u=="number",`invalud value for ${a}`,"costs",r),s[a]=u}i("txBase",21e3),i("txCreate",32e3),i("txDataZero",4),i("txDataNonzero",16),i("txAccessListStorageKey",1900),i("txAccessListAddress",2400),Te(this,s)}clone(){return new _h(this.effectiveBlock,this)}}class Ph extends Nf{constructor(t,r){super("org.ethers.plugins.network.Ens");R(this,"address");R(this,"targetNetwork");Te(this,{address:t||OS,targetNetwork:r??1})}clone(){return new Ph(this.address,this.targetNetwork)}}var uf,lf;class S9 extends Nf{constructor(t,r){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");$(this,uf,void 0);$(this,lf,void 0);k(this,uf,t),k(this,lf,r)}get url(){return g(this,uf)}get processFunc(){return g(this,lf)}clone(){return this}}uf=new WeakMap,lf=new WeakMap;const _6=new Map;var Wo,Ko,Ti;const ho=class ho{constructor(e,t){$(this,Wo,void 0);$(this,Ko,void 0);$(this,Ti,void 0);k(this,Wo,e),k(this,Ko,Ne(t)),k(this,Ti,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return g(this,Wo)}set name(e){k(this,Wo,e)}get chainId(){return g(this,Ko)}set chainId(e){k(this,Ko,Ne(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===Ne(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===Ne(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===Ne(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(g(this,Ti).values())}attachPlugin(e){if(g(this,Ti).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return g(this,Ti).set(e.name,e.clone()),this}getPlugin(e){return g(this,Ti).get(e)||null}getPlugins(e){return this.plugins.filter(t=>t.name.split("#")[0]===e)}clone(){const e=new ho(this.name,this.chainId);return this.plugins.forEach(t=>{e.attachPlugin(t.clone())}),e}computeIntrinsicGas(e){const t=this.getPlugin("org.ethers.plugins.network.GasCost")||new _h;let r=t.txBase;if(e.to==null&&(r+=t.txCreate),e.data)for(let s=2;s9){let s=BigInt(r[1].substring(0,9));r[1].substring(9).match(/^0+$/)||s++,r[1]=s.toString()}return BigInt(r[0]+r[1])}function Ty(n){return new S9(n,async(e,t,r)=>{r.setHeader("User-Agent","ethers");let s;try{s=await r.send();const i=s.bodyJson.standard;return{maxFeePerGas:Ry(i.maxFee,9),maxPriorityFeePerGas:Ry(i.maxPriorityFee,9)}}catch(i){ae(!1,`error encountered with polygon gas station (${JSON.stringify(r.url)})`,"SERVER_ERROR",{request:r,response:s,error:i})}})}function NS(n){return new S9("data:",async(e,t,r)=>{const s=await e();if(s.maxFeePerGas==null||s.maxPriorityFeePerGas==null)return s;const i=s.maxFeePerGas-s.maxPriorityFeePerGas;return{gasPrice:s.gasPrice,maxFeePerGas:i+n,maxPriorityFeePerGas:n}})}let Oy=!1;function IS(){if(Oy)return;Oy=!0;function n(e,t,r){const s=function(){const i=new js(e,t);return r.ensNetwork!=null&&i.attachPlugin(new Ph(null,r.ensNetwork)),i.attachPlugin(new _h),(r.plugins||[]).forEach(a=>{i.attachPlugin(a)}),i};js.register(e,s),js.register(t,s),r.altNames&&r.altNames.forEach(i=>{js.register(i,s)})}n("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),n("ropsten",3,{ensNetwork:3}),n("rinkeby",4,{ensNetwork:4}),n("goerli",5,{ensNetwork:5}),n("kovan",42,{ensNetwork:42}),n("sepolia",11155111,{}),n("classic",61,{}),n("classicKotti",6,{}),n("arbitrum",42161,{ensNetwork:1}),n("arbitrum-goerli",421613,{}),n("bnb",56,{ensNetwork:1}),n("bnbt",97,{}),n("linea",59144,{ensNetwork:1}),n("linea-goerli",59140,{}),n("matic",137,{ensNetwork:1,plugins:[Ty("https://gasstation.polygon.technology/v2")]}),n("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[Ty("https://gasstation-testnet.polygon.technology/v2")]}),n("optimism",10,{ensNetwork:1,plugins:[NS(BigInt("1000000"))]}),n("optimism-goerli",420,{}),n("xdai",100,{ensNetwork:1})}function Pp(n){return JSON.parse(JSON.stringify(n))}var Ns,er,Oi,qr,Vo,Jd;class BS{constructor(e){$(this,Vo);$(this,Ns,void 0);$(this,er,void 0);$(this,Oi,void 0);$(this,qr,void 0);k(this,Ns,e),k(this,er,null),k(this,Oi,4e3),k(this,qr,-2)}get pollingInterval(){return g(this,Oi)}set pollingInterval(e){k(this,Oi,e)}start(){g(this,er)||(k(this,er,g(this,Ns)._setTimeout(Q(this,Vo,Jd).bind(this),g(this,Oi))),Q(this,Vo,Jd).call(this))}stop(){g(this,er)&&(g(this,Ns)._clearTimeout(g(this,er)),k(this,er,null))}pause(e){this.stop(),e&&k(this,qr,-2)}resume(){this.start()}}Ns=new WeakMap,er=new WeakMap,Oi=new WeakMap,qr=new WeakMap,Vo=new WeakSet,Jd=async function(){try{const e=await g(this,Ns).getBlockNumber();if(g(this,qr)===-2){k(this,qr,e);return}if(e!==g(this,qr)){for(let t=g(this,qr)+1;t<=e;t++){if(g(this,er)==null)return;await g(this,Ns).emit("block",t)}k(this,qr,e)}}catch{}g(this,er)!=null&&k(this,er,g(this,Ns)._setTimeout(Q(this,Vo,Jd).bind(this),g(this,Oi)))};var Z0,X0,Ni;class R9{constructor(e){$(this,Z0,void 0);$(this,X0,void 0);$(this,Ni,void 0);k(this,Z0,e),k(this,Ni,!1),k(this,X0,t=>{this._poll(t,g(this,Z0))})}async _poll(e,t){throw new Error("sub-classes must override this")}start(){g(this,Ni)||(k(this,Ni,!0),g(this,X0).call(this,-2),g(this,Z0).on("block",g(this,X0)))}stop(){g(this,Ni)&&(k(this,Ni,!1),g(this,Z0).off("block",g(this,X0)))}pause(e){this.stop()}resume(){this.start()}}Z0=new WeakMap,X0=new WeakMap,Ni=new WeakMap;var ih;class FS extends R9{constructor(t,r){super(t);$(this,ih,void 0);k(this,ih,Pp(r))}async _poll(t,r){throw new Error("@TODO")}}ih=new WeakMap;var qo;class US extends R9{constructor(t,r){super(t);$(this,qo,void 0);k(this,qo,r)}async _poll(t,r){const s=await r.getTransactionReceipt(g(this,qo));s&&r.emit(g(this,qo),s)}}qo=new WeakMap;var Is,Jo,Qo,Ii,tr,ah,T9;class nb{constructor(e,t){$(this,ah);$(this,Is,void 0);$(this,Jo,void 0);$(this,Qo,void 0);$(this,Ii,void 0);$(this,tr,void 0);k(this,Is,e),k(this,Jo,Pp(t)),k(this,Qo,Q(this,ah,T9).bind(this)),k(this,Ii,!1),k(this,tr,-2)}start(){g(this,Ii)||(k(this,Ii,!0),g(this,tr)===-2&&g(this,Is).getBlockNumber().then(e=>{k(this,tr,e)}),g(this,Is).on("block",g(this,Qo)))}stop(){g(this,Ii)&&(k(this,Ii,!1),g(this,Is).off("block",g(this,Qo)))}pause(e){this.stop(),e&&k(this,tr,-2)}resume(){this.start()}}Is=new WeakMap,Jo=new WeakMap,Qo=new WeakMap,Ii=new WeakMap,tr=new WeakMap,ah=new WeakSet,T9=async function(e){if(g(this,tr)===-2)return;const t=Pp(g(this,Jo));t.fromBlock=g(this,tr)+1,t.toBlock=e;const r=await g(this,Is).getLogs(t);if(r.length===0){g(this,tr){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 s=Object.keys(r);return s.sort(),s.reduce((i,a)=>(i[a]=r[a],i),{})}return r})}class O9{constructor(e){R(this,"name");Te(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function MS(n){return JSON.parse(JSON.stringify(n))}function kp(n){return n=Array.from(new Set(n).values()),n.sort(),n}async function P6(n,e){if(n==null)throw new Error("invalid event");if(Array.isArray(n)&&(n={topics:n}),typeof n=="string")switch(n){case"block":case"pending":case"debug":case"error":case"network":return{type:n,tag:n}}if(yt(n,32)){const t=n.toLowerCase();return{type:"transaction",tag:Qd("tx",{hash:t}),hash:t}}if(n.orphan){const t=n;return{type:"orphan",tag:Qd("orphan",t),filter:MS(t)}}if(n.address||n.topics){const t=n,r={topics:(t.topics||[]).map(s=>s==null?null:Array.isArray(s)?kp(s.map(i=>i.toLowerCase())):s.toLowerCase())};if(t.address){const s=[],i=[],a=o=>{yt(o)?s.push(o):i.push((async()=>{s.push(await Jt(o,e))})())};Array.isArray(t.address)?t.address.forEach(a):a(t.address),i.length&&await Promise.all(i),r.address=kp(s.map(o=>o.toLowerCase()))}return{filter:r,tag:Qd("event",r),type:"event"}}Z(!1,"unknown ProviderEvent","event",n)}function k6(){return new Date().getTime()}const jS={cacheTimeout:250,pollingInterval:4e3};var Ht,Bi,Gt,Yo,Un,ea,Fi,Bs,ff,nr,Zo,Xo,un,Vn,df,Cp,hf,Sp,ta,dl,pf,Rp,na,hl,ec,Yd;class $S{constructor(e,t){$(this,un);$(this,df);$(this,hf);$(this,ta);$(this,pf);$(this,na);$(this,ec);$(this,Ht,void 0);$(this,Bi,void 0);$(this,Gt,void 0);$(this,Yo,void 0);$(this,Un,void 0);$(this,ea,void 0);$(this,Fi,void 0);$(this,Bs,void 0);$(this,ff,void 0);$(this,nr,void 0);$(this,Zo,void 0);$(this,Xo,void 0);if(k(this,Xo,Object.assign({},jS,t||{})),e==="any")k(this,ea,!0),k(this,Un,null);else if(e){const r=js.from(e);k(this,ea,!1),k(this,Un,Promise.resolve(r)),setTimeout(()=>{this.emit("network",r,null)},0)}else k(this,ea,!1),k(this,Un,null);k(this,Bs,-1),k(this,Fi,new Map),k(this,Ht,new Map),k(this,Bi,new Map),k(this,Gt,null),k(this,Yo,!1),k(this,ff,1),k(this,nr,new Map),k(this,Zo,!1)}get pollingInterval(){return g(this,Xo).pollingInterval}get provider(){return this}get plugins(){return Array.from(g(this,Bi).values())}attachPlugin(e){if(g(this,Bi).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return g(this,Bi).set(e.name,e.connect(this)),this}getPlugin(e){return g(this,Bi).get(e)||null}get disableCcipRead(){return g(this,Zo)}set disableCcipRead(e){k(this,Zo,!!e)}async ccipReadFetch(e,t,r){if(this.disableCcipRead||r.length===0||e.to==null)return null;const s=e.to.toLowerCase(),i=t.toLowerCase(),a=[];for(let o=0;o=500,`response not found during CCIP fetch: ${d}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:u,errorMessage:d}}),a.push(d)}ae(!1,`error encountered during CCIP fetch: ${a.map(o=>JSON.stringify(o)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:r,errorMessages:a}})}_wrapBlock(e,t){return new aS(kS(e),this)}_wrapLog(e,t){return new Tf(_S(e),this)}_wrapTransactionReceipt(e,t){return new b9(TS(e),this)}_wrapTransactionResponse(e,t){return new Q5(C9(e),this)}_detectNetwork(){ae(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){ae(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=He(await Q(this,un,Vn).call(this,{method:"getBlockNumber"}),"%response");return g(this,Bs)>=0&&k(this,Bs,e),e}_getAddress(e){return Jt(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(yt(e))return yt(e,32)?e:oo(e);if(typeof e=="bigint"&&(e=He(e,"blockTag")),typeof e=="number")return e>=0?oo(e):g(this,Bs)>=0?oo(g(this,Bs)+e):this.getBlockNumber().then(t=>oo(t+e));Z(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const t=(e.topics||[]).map(u=>u==null?null:Array.isArray(u)?kp(u.map(c=>c.toLowerCase())):u.toLowerCase()),r="blockHash"in e?e.blockHash:void 0,s=(u,c,l)=>{let d;switch(u.length){case 0:break;case 1:d=u[0];break;default:u.sort(),d=u}if(r&&(c!=null||l!=null))throw new Error("invalid filter");const f={};return d&&(f.address=d),t.length&&(f.topics=t),c&&(f.fromBlock=c),l&&(f.toBlock=l),r&&(f.blockHash=r),f};let i=[];if(e.address)if(Array.isArray(e.address))for(const u of e.address)i.push(this._getAddress(u));else i.push(this._getAddress(e.address));let a;"fromBlock"in e&&(a=this._getBlockTag(e.fromBlock));let o;return"toBlock"in e&&(o=this._getBlockTag(e.toBlock)),i.filter(u=>typeof u!="string").length||a!=null&&typeof a!="string"||o!=null&&typeof o!="string"?Promise.all([Promise.all(i),a,o]).then(u=>s(u[0],u[1],u[2])):s(i,a,o)}_getTransactionRequest(e){const t=$1(e),r=[];if(["to","from"].forEach(s=>{if(t[s]==null)return;const i=Jt(t[s]);gd(i)?r.push(async function(){t[s]=await i}()):t[s]=i}),t.blockTag!=null){const s=this._getBlockTag(t.blockTag);gd(s)?r.push(async function(){t.blockTag=await s}()):t.blockTag=s}return r.length?async function(){return await Promise.all(r),t}():t}async getNetwork(){if(g(this,Un)==null){const s=this._detectNetwork().then(i=>(this.emit("network",i,null),i),i=>{throw g(this,Un)===s&&k(this,Un,null),i});return k(this,Un,s),(await s).clone()}const e=g(this,Un),[t,r]=await Promise.all([e,this._detectNetwork()]);return t.chainId!==r.chainId&&(g(this,ea)?(this.emit("network",r,t),g(this,Un)===e&&k(this,Un,Promise.resolve(r))):ae(!1,`network changed: ${t.chainId} => ${r.chainId} `,"NETWORK_ERROR",{event:"changed"})),t.clone()}async getFeeData(){const e=await this.getNetwork(),t=async()=>{const{_block:s,gasPrice:i}=await Wt({_block:Q(this,pf,Rp).call(this,"latest",!1),gasPrice:(async()=>{try{const c=await Q(this,un,Vn).call(this,{method:"getGasPrice"});return Ne(c,"%response")}catch{}return null})()});let a=null,o=null;const u=this._wrapBlock(s,e);return u&&u.baseFeePerGas&&(o=BigInt("1000000000"),a=u.baseFeePerGas*LS+o),new _y(i,a,o)},r=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(r){const s=new Vs(r.url),i=await r.processFunc(t,this,s);return new _y(i.gasPrice,i.maxFeePerGas,i.maxPriorityFeePerGas)}return await t()}async estimateGas(e){let t=this._getTransactionRequest(e);return gd(t)&&(t=await t),Ne(await Q(this,un,Vn).call(this,{method:"estimateGas",transaction:t}),"%response")}async call(e){const{tx:t,blockTag:r}=await Wt({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await Q(this,hf,Sp).call(this,Q(this,df,Cp).call(this,t,r,e.enableCcipRead?0:-1))}async getBalance(e,t){return Ne(await Q(this,ta,dl).call(this,{method:"getBalance"},e,t),"%response")}async getTransactionCount(e,t){return He(await Q(this,ta,dl).call(this,{method:"getTransactionCount"},e,t),"%response")}async getCode(e,t){return de(await Q(this,ta,dl).call(this,{method:"getCode"},e,t))}async getStorage(e,t,r){const s=Ne(t,"position");return de(await Q(this,ta,dl).call(this,{method:"getStorage",position:s},e,r))}async broadcastTransaction(e){const{blockNumber:t,hash:r,network:s}=await Wt({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),i=$l.from(e);if(i.hash!==r)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(i,s).replaceableTransaction(t)}async getBlock(e,t){const{network:r,params:s}=await Wt({network:this.getNetwork(),params:Q(this,pf,Rp).call(this,e,!!t)});return s==null?null:this._wrapBlock(s,r)}async getTransaction(e){const{network:t,params:r}=await Wt({network:this.getNetwork(),params:Q(this,un,Vn).call(this,{method:"getTransaction",hash:e})});return r==null?null:this._wrapTransactionResponse(r,t)}async getTransactionReceipt(e){const{network:t,params:r}=await Wt({network:this.getNetwork(),params:Q(this,un,Vn).call(this,{method:"getTransactionReceipt",hash:e})});if(r==null)return null;if(r.gasPrice==null&&r.effectiveGasPrice==null){const s=await Q(this,un,Vn).call(this,{method:"getTransaction",hash:e});if(s==null)throw new Error("report this; could not find tx or effectiveGasPrice");r.effectiveGasPrice=s.gasPrice}return this._wrapTransactionReceipt(r,t)}async getTransactionResult(e){const{result:t}=await Wt({network:this.getNetwork(),result:Q(this,un,Vn).call(this,{method:"getTransactionResult",hash:e})});return t==null?null:de(t)}async getLogs(e){let t=this._getFilter(e);gd(t)&&(t=await t);const{network:r,params:s}=await Wt({network:this.getNetwork(),params:Q(this,un,Vn).call(this,{method:"getLogs",filter:t})});return s.map(i=>this._wrapLog(i,r))}_getProvider(e){ae(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await G1.fromName(this,e)}async getAvatar(e){const t=await this.getResolver(e);return t?await t.getAvatar():null}async resolveName(e){const t=await this.getResolver(e);return t?await t.getAddress():null}async lookupAddress(e){e=Ve(e);const t=xp(e.substring(2).toLowerCase()+".addr.reverse");try{const r=await G1.getEnsAddress(this),i=await new Ol(r,["function resolver(bytes32) view returns (address)"],this).resolver(t);if(i==null||i===yp)return null;const o=await new Ol(i,["function name(bytes32) view returns (string)"],this).name(t);return await this.resolveName(o)!==e?null:o}catch(r){if(ir(r,"BAD_DATA")&&r.value==="0x"||ir(r,"CALL_EXCEPTION"))return null;throw r}return null}async waitForTransaction(e,t,r){const s=t??1;return s===0?this.getTransactionReceipt(e):new Promise(async(i,a)=>{let o=null;const u=async c=>{try{const l=await this.getTransactionReceipt(e);if(l!=null&&c-l.blockNumber+1>=s){i(l),o&&(clearTimeout(o),o=null);return}}catch(l){console.log("EEE",l)}this.once("block",u)};r!=null&&(o=setTimeout(()=>{o!=null&&(o=null,this.off("block",u),a(_t("timeout","TIMEOUT",{reason:"timeout"})))},r)),u(await this.getBlockNumber())})}async waitForBlock(e){ae(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const t=g(this,nr).get(e);t&&(t.timer&&clearTimeout(t.timer),g(this,nr).delete(e))}_setTimeout(e,t){t==null&&(t=0);const r=hr(this,ff)._++,s=()=>{g(this,nr).delete(r),e()};if(this.paused)g(this,nr).set(r,{timer:null,func:s,time:t});else{const i=setTimeout(s,t);g(this,nr).set(r,{timer:i,func:s,time:k6()})}return r}_forEachSubscriber(e){for(const t of g(this,Ht).values())e(t.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new O9(e.type);case"block":{const t=new BS(this);return t.pollingInterval=this.pollingInterval,t}case"event":return new nb(this,e.filter);case"transaction":return new US(this,e.hash);case"orphan":return new FS(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,t){for(const r of g(this,Ht).values())if(r.subscriber===e){r.started&&r.subscriber.stop(),r.subscriber=t,r.started&&t.start(),g(this,Gt)!=null&&t.pause(g(this,Gt));break}}async on(e,t){const r=await Q(this,ec,Yd).call(this,e);return r.listeners.push({listener:t,once:!1}),r.started||(r.subscriber.start(),r.started=!0,g(this,Gt)!=null&&r.subscriber.pause(g(this,Gt))),this}async once(e,t){const r=await Q(this,ec,Yd).call(this,e);return r.listeners.push({listener:t,once:!0}),r.started||(r.subscriber.start(),r.started=!0,g(this,Gt)!=null&&r.subscriber.pause(g(this,Gt))),this}async emit(e,...t){const r=await Q(this,na,hl).call(this,e,t);if(!r||r.listeners.length===0)return!1;const s=r.listeners.length;return r.listeners=r.listeners.filter(({listener:i,once:a})=>{const o=new e7(this,a?null:i,e);try{i.call(this,...t,o)}catch{}return!a}),r.listeners.length===0&&(r.started&&r.subscriber.stop(),g(this,Ht).delete(r.tag)),s>0}async listenerCount(e){if(e){const r=await Q(this,na,hl).call(this,e);return r?r.listeners.length:0}let t=0;for(const{listeners:r}of g(this,Ht).values())t+=r.length;return t}async listeners(e){if(e){const r=await Q(this,na,hl).call(this,e);return r?r.listeners.map(({listener:s})=>s):[]}let t=[];for(const{listeners:r}of g(this,Ht).values())t=t.concat(r.map(({listener:s})=>s));return t}async off(e,t){const r=await Q(this,na,hl).call(this,e);if(!r)return this;if(t){const s=r.listeners.map(({listener:i})=>i).indexOf(t);s>=0&&r.listeners.splice(s,1)}return(!t||r.listeners.length===0)&&(r.started&&r.subscriber.stop(),g(this,Ht).delete(r.tag)),this}async removeAllListeners(e){if(e){const{tag:t,started:r,subscriber:s}=await Q(this,ec,Yd).call(this,e);r&&s.stop(),g(this,Ht).delete(t)}else for(const[t,{started:r,subscriber:s}]of g(this,Ht))r&&s.stop(),g(this,Ht).delete(t);return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return this.off(e,t)}get destroyed(){return g(this,Yo)}destroy(){this.removeAllListeners();for(const e of g(this,nr).keys())this._clearTimeout(e);k(this,Yo,!0)}get paused(){return g(this,Gt)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(k(this,Bs,-1),g(this,Gt)!=null){if(g(this,Gt)==!!e)return;ae(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(t=>t.pause(e)),k(this,Gt,!!e);for(const t of g(this,nr).values())t.timer&&clearTimeout(t.timer),t.time=k6()-t.time}resume(){if(g(this,Gt)!=null){this._forEachSubscriber(e=>e.resume()),k(this,Gt,null);for(const e of g(this,nr).values()){let t=e.time;t<0&&(t=0),e.time=k6(),setTimeout(e.func,t)}}}}Ht=new WeakMap,Bi=new WeakMap,Gt=new WeakMap,Yo=new WeakMap,Un=new WeakMap,ea=new WeakMap,Fi=new WeakMap,Bs=new WeakMap,ff=new WeakMap,nr=new WeakMap,Zo=new WeakMap,Xo=new WeakMap,un=new WeakSet,Vn=async function(e){const t=g(this,Xo).cacheTimeout;if(t<0)return await this._perform(e);const r=Qd(e.method,e);let s=g(this,Fi).get(r);return s||(s=this._perform(e),g(this,Fi).set(r,s),setTimeout(()=>{g(this,Fi).get(r)===s&&g(this,Fi).delete(r)},t)),await s},df=new WeakSet,Cp=async function(e,t,r){ae(r=0&&t==="latest"&&s.to!=null&&ft(i.data,0,4)==="0x556f1830"){const a=i.data,o=await Jt(s.to,this);let u;try{u=KS(ft(i.data,4))}catch(d){ae(!1,d.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:s,info:{data:a}})}ae(u.sender.toLowerCase()===o.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:a,reason:"OffchainLookup",transaction:s,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:u.errorArgs}});const c=await this.ccipReadFetch(s,u.calldata,u.urls);ae(c!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:s,info:{data:i.data,errorArgs:u.errorArgs}});const l={to:o,data:ot([u.selector,WS([c,u.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:l});try{const d=await Q(this,df,Cp).call(this,l,t,r+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},l),result:d}),d}catch(d){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},l),error:d}),d}}throw i}},hf=new WeakSet,Sp=async function(e){const{value:t}=await Wt({network:this.getNetwork(),value:e});return t},ta=new WeakSet,dl=async function(e,t,r){let s=this._getAddress(t),i=this._getBlockTag(r);return(typeof s!="string"||typeof i!="string")&&([s,i]=await Promise.all([s,i])),await Q(this,hf,Sp).call(this,Q(this,un,Vn).call(this,Object.assign(e,{address:s,blockTag:i})))},pf=new WeakSet,Rp=async function(e,t){if(yt(e,32))return await Q(this,un,Vn).call(this,{method:"getBlock",blockHash:e,includeTransactions:t});let r=this._getBlockTag(e);return typeof r!="string"&&(r=await r),await Q(this,un,Vn).call(this,{method:"getBlock",blockTag:r,includeTransactions:t})},na=new WeakSet,hl=async function(e,t){let r=await P6(e,this);return r.type==="event"&&t&&t.length>0&&t[0].removed===!0&&(r=await P6({orphan:"drop-log",log:t[0]},this)),g(this,Ht).get(r.tag)||null},ec=new WeakSet,Yd=async function(e){const t=await P6(e,this),r=t.tag;let s=g(this,Ht).get(r);return s||(s={subscriber:this._getSubscriber(t),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},g(this,Ht).set(r,s)),s};function HS(n,e){try{const t=Tp(n,e);if(t)return N5(t)}catch{}return null}function Tp(n,e){if(n==="0x")return null;try{const t=He(ft(n,e,e+32)),r=He(ft(n,t,t+32));return ft(n,t+32,t+32+r)}catch{}return null}function Ny(n){const e=bn(n);if(e.length>32)throw new Error("internal; should not happen");const t=new Uint8Array(32);return t.set(e,32-e.length),t}function GS(n){if(n.length%32===0)return n;const e=new Uint8Array(Math.ceil(n.length/32)*32);return e.set(n),e}const zS=new Uint8Array([]);function WS(n){const e=[];let t=0;for(let r=0;r=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const t=ft(n,0,32);ae(ft(t,0,12)===ft(Iy,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=ft(t,12);try{const r=[],s=He(ft(n,32,64)),i=He(ft(n,s,s+32)),a=ft(n,s+32);for(let o=0;oe[r]),e}function za(n,e){if(n.provider)return n.provider;ae(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function By(n,e){let t=$1(e);if(t.to!=null&&(t.to=Jt(t.to,n)),t.from!=null){const r=t.from;t.from=Promise.all([n.getAddress(),Jt(r,n)]).then(([s,i])=>(Z(s.toLowerCase()===i.toLowerCase(),"transaction from mismatch","tx.from",i),s))}else t.from=n.getAddress();return await Wt(t)}class rb{constructor(e){R(this,"provider");Te(this,{provider:e||null})}async getNonce(e){return za(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await By(this,e)}async populateTransaction(e){const t=za(this,"populateTransaction"),r=await By(this,e);r.nonce==null&&(r.nonce=await this.getNonce("pending")),r.gasLimit==null&&(r.gasLimit=await this.estimateGas(r));const s=await this.provider.getNetwork();if(r.chainId!=null){const a=Ne(r.chainId);Z(a===s.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else r.chainId=s.chainId;const i=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||i)?Z(!1,"eip-1559 transaction do not support gasPrice","tx",e):(r.type===0||r.type===1)&&i&&Z(!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 a=await t.getFeeData();ae(a.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),r.gasPrice==null&&(r.gasPrice=a.gasPrice)}else{const a=await t.getFeeData();if(r.type==null)if(a.maxFeePerGas!=null&&a.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const o=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=o,r.maxPriorityFeePerGas=o}else r.maxFeePerGas==null&&(r.maxFeePerGas=a.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=a.maxPriorityFeePerGas);else a.gasPrice!=null?(ae(!i,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=a.gasPrice),r.type=0):ae(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=a.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=a.maxPriorityFeePerGas))}return await Wt(r)}async estimateGas(e){return za(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return za(this,"call").call(await this.populateCall(e))}async resolveName(e){return await za(this,"resolveName").resolveName(e)}async sendTransaction(e){const t=za(this,"sendTransaction"),r=await this.populateTransaction(e);delete r.from;const s=$l.from(r);return await t.broadcastTransaction(await this.signTransaction(s))}}var tc,Zd;const Xb=class Xb extends rb{constructor(t,r){super(r);$(this,tc);R(this,"address");Te(this,{address:t})}async getAddress(){return this.address}connect(t){return new Xb(this.address,t)}async signTransaction(t){Q(this,tc,Zd).call(this,"transactions","signTransaction")}async signMessage(t){Q(this,tc,Zd).call(this,"messages","signMessage")}async signTypedData(t,r,s){Q(this,tc,Zd).call(this,"typed-data","signTypedData")}};tc=new WeakSet,Zd=function(t,r){ae(!1,`VoidSigner cannot sign ${t}`,"UNSUPPORTED_OPERATION",{operation:r})};let Op=Xb;function VS(n){return JSON.parse(JSON.stringify(n))}var ln,Jr,ra,Ui,sa,nc,bf,Np,gf,Ip;class N9{constructor(e){$(this,bf);$(this,gf);$(this,ln,void 0);$(this,Jr,void 0);$(this,ra,void 0);$(this,Ui,void 0);$(this,sa,void 0);$(this,nc,void 0);k(this,ln,e),k(this,Jr,null),k(this,ra,Q(this,bf,Np).bind(this)),k(this,Ui,!1),k(this,sa,null),k(this,nc,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,t){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){g(this,Ui)||(k(this,Ui,!0),Q(this,bf,Np).call(this,-2))}stop(){g(this,Ui)&&(k(this,Ui,!1),k(this,nc,!0),Q(this,gf,Ip).call(this),g(this,ln).off("block",g(this,ra)))}pause(e){e&&Q(this,gf,Ip).call(this),g(this,ln).off("block",g(this,ra))}resume(){this.start()}}ln=new WeakMap,Jr=new WeakMap,ra=new WeakMap,Ui=new WeakMap,sa=new WeakMap,nc=new WeakMap,bf=new WeakSet,Np=async function(e){try{g(this,Jr)==null&&k(this,Jr,this._subscribe(g(this,ln)));let t=null;try{t=await g(this,Jr)}catch(i){if(!ir(i,"UNSUPPORTED_OPERATION")||i.operation!=="eth_newFilter")throw i}if(t==null){k(this,Jr,null),g(this,ln)._recoverSubscriber(this,this._recover(g(this,ln)));return}const r=await g(this,ln).getNetwork();if(g(this,sa)||k(this,sa,r),g(this,sa).chainId!==r.chainId)throw new Error("chaid changed");if(g(this,nc))return;const s=await g(this,ln).send("eth_getFilterChanges",[t]);await this._emitResults(g(this,ln),s)}catch(t){console.log("@TODO",t)}g(this,ln).once("block",g(this,ra))},gf=new WeakSet,Ip=function(){const e=g(this,Jr);e&&(k(this,Jr,null),e.then(t=>{g(this,ln).send("eth_uninstallFilter",[t])}))};var ia;class qS extends N9{constructor(t,r){super(t);$(this,ia,void 0);k(this,ia,VS(r))}_recover(t){return new nb(t,g(this,ia))}async _subscribe(t){return await t.send("eth_newFilter",[g(this,ia)])}async _emitResults(t,r){for(const s of r)t.emit(g(this,ia),t._wrapLog(s,t._network))}}ia=new WeakMap;class JS extends N9{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,t){for(const r of t)e.emit("pending",r)}}const QS="bigint,boolean,function,number,string,symbol".split(/,/g);function Xd(n){if(n==null||QS.indexOf(typeof n)>=0||typeof n.getAddress=="function")return n;if(Array.isArray(n))return n.map(Xd);if(typeof n=="object")return Object.keys(n).reduce((e,t)=>(e[t]=n[t],e),{});throw new Error(`should not happen: ${n} (${typeof n})`)}function YS(n){return new Promise(e=>{setTimeout(e,n)})}function Wa(n){return n&&n.toLowerCase()}function Fy(n){return n&&typeof n.pollingInterval=="number"}const ZS={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class C6 extends rb{constructor(t,r){super(t);R(this,"address");r=Ve(r),Te(this,{address:r})}connect(t){ae(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(t){return await this.populateCall(t)}async sendUncheckedTransaction(t){const r=Xd(t),s=[];if(r.from){const a=r.from;s.push((async()=>{const o=await Jt(a,this.provider);Z(o!=null&&o.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",t),r.from=o})())}else r.from=this.address;if(r.gasLimit==null&&s.push((async()=>{r.gasLimit=await this.provider.estimateGas({...r,from:this.address})})()),r.to!=null){const a=r.to;s.push((async()=>{r.to=await Jt(a,this.provider)})())}s.length&&await Promise.all(s);const i=this.provider.getRpcTransaction(r);return this.provider.send("eth_sendTransaction",[i])}async sendTransaction(t){const r=await this.provider.getBlockNumber(),s=await this.sendUncheckedTransaction(t);return await new Promise((i,a)=>{const o=[1e3,100],u=async()=>{const c=await this.provider.getTransaction(s);if(c!=null){i(c.replaceableTransaction(r));return}this.provider._setTimeout(()=>{u()},o.pop()||4e3)};u()})}async signTransaction(t){const r=Xd(t);if(r.from){const i=await Jt(r.from,this.provider);Z(i!=null&&i.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",t),r.from=i}else r.from=this.address;const s=this.provider.getRpcTransaction(r);return await this.provider.send("eth_signTransaction",[s])}async signMessage(t){const r=typeof t=="string"?Pt(t):t;return await this.provider.send("personal_sign",[de(r),this.address.toLowerCase()])}async signTypedData(t,r,s){const i=Xd(s),a=await xc.resolveNames(t,r,i,async o=>{const u=await Jt(o);return Z(u!=null,"TypedData does not support null address","value",o),u});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(xc.getPayload(a.domain,r,a.value))])}async unlock(t){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),t,null])}async _legacySignMessage(t){const r=typeof t=="string"?Pt(t):t;return await this.provider.send("eth_sign",[this.address.toLowerCase(),de(r)])}}var aa,rc,Fs,Qr,kr,Us,yf,Bp;class XS extends $S{constructor(t,r){super(t,r);$(this,yf);$(this,aa,void 0);$(this,rc,void 0);$(this,Fs,void 0);$(this,Qr,void 0);$(this,kr,void 0);$(this,Us,void 0);k(this,rc,1),k(this,aa,Object.assign({},ZS,r||{})),k(this,Fs,[]),k(this,Qr,null),k(this,Us,null);{let i=null;const a=new Promise(o=>{i=o});k(this,kr,{promise:a,resolve:i})}const s=this._getOption("staticNetwork");s&&(Z(t==null||s.matches(t),"staticNetwork MUST match network object","options",r),k(this,Us,s))}_getOption(t){return g(this,aa)[t]}get _network(){return ae(g(this,Us),"network is not available yet","NETWORK_ERROR"),g(this,Us)}async _perform(t){if(t.method==="call"||t.method==="estimateGas"){let s=t.transaction;if(s&&s.type!=null&&Ne(s.type)&&s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null){const i=await this.getFeeData();i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null&&(t=Object.assign({},t,{transaction:Object.assign({},s,{type:void 0})}))}}const r=this.getRpcRequest(t);return r!=null?await this.send(r.method,r.args):super._perform(t)}async _detectNetwork(){const t=this._getOption("staticNetwork");if(t)return t;if(this.ready)return js.from(Ne(await this.send("eth_chainId",[])));const r={id:hr(this,rc)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:r});let s;try{s=(await this._send(r))[0]}catch(i){throw this.emit("debug",{action:"receiveRpcError",error:i}),i}if(this.emit("debug",{action:"receiveRpcResult",result:s}),"result"in s)return js.from(Ne(s.result));throw this.getRpcError(r,s)}_start(){g(this,kr)==null||g(this,kr).resolve==null||(g(this,kr).resolve(),k(this,kr,null),(async()=>{for(;g(this,Us)==null&&!this.destroyed;)try{k(this,Us,await this._detectNetwork())}catch(t){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",_t("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:t}})),await YS(1e3)}Q(this,yf,Bp).call(this)})())}async _waitUntilReady(){if(g(this,kr)!=null)return await g(this,kr).promise}_getSubscriber(t){return t.type==="pending"?new JS(this):t.type==="event"?this._getOption("polling")?new nb(this,t.filter):new qS(this,t.filter):t.type==="orphan"&&t.filter.orphan==="drop-log"?new O9("orphan"):super._getSubscriber(t)}get ready(){return g(this,kr)==null}getRpcTransaction(t){const r={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(s=>{if(t[s]==null)return;let i=s;s==="gasLimit"&&(i="gas"),r[i]=oo(Ne(t[s],`tx.${s}`))}),["from","to","data"].forEach(s=>{t[s]!=null&&(r[s]=de(t[s]))}),t.accessList&&(r.accessList=Ba(t.accessList)),r}getRpcRequest(t){switch(t.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getBalance":return{method:"eth_getBalance",args:[Wa(t.address),t.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[Wa(t.address),t.blockTag]};case"getCode":return{method:"eth_getCode",args:[Wa(t.address),t.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[Wa(t.address),"0x"+t.position.toString(16),t.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[t.signedTransaction]};case"getBlock":if("blockTag"in t)return{method:"eth_getBlockByNumber",args:[t.blockTag,!!t.includeTransactions]};if("blockHash"in t)return{method:"eth_getBlockByHash",args:[t.blockHash,!!t.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[t.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[t.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(t.transaction),t.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(t.transaction)]};case"getLogs":return t.filter&&t.filter.address!=null&&(Array.isArray(t.filter.address)?t.filter.address=t.filter.address.map(Wa):t.filter.address=Wa(t.filter.address)),{method:"eth_getLogs",args:[t.filter]}}return null}getRpcError(t,r){const{method:s}=t,{error:i}=r;if(s==="eth_estimateGas"&&i.message){const u=i.message;if(!u.match(/revert/i)&&u.match(/insufficient funds/i))return _t("insufficient funds","INSUFFICIENT_FUNDS",{transaction:t.params[0],info:{payload:t,error:i}})}if(s==="eth_call"||s==="eth_estimateGas"){const u=Fp(i),c=Ap.getBuiltinCallException(s==="eth_call"?"call":"estimateGas",t.params[0],u?u.data:null);return c.info={error:i,payload:t},c}const a=JSON.stringify(nR(i));if(typeof i.message=="string"&&i.message.match(/user denied|ethers-user-denied/i))return _t("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"}[s]||"unknown",reason:"rejected",info:{payload:t,error:i}});if(s==="eth_sendRawTransaction"||s==="eth_sendTransaction"){const u=t.params[0];if(a.match(/insufficient funds|base fee exceeds gas limit/i))return _t("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:u,info:{error:i}});if(a.match(/nonce/i)&&a.match(/too low/i))return _t("nonce has already been used","NONCE_EXPIRED",{transaction:u,info:{error:i}});if(a.match(/replacement transaction/i)&&a.match(/underpriced/i))return _t("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:u,info:{error:i}});if(a.match(/only replay-protected/i))return _t("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:s,info:{transaction:u,info:{error:i}}})}let o=!!a.match(/the method .* does not exist/i);return o||i&&i.details&&i.details.startsWith("Unauthorized method:")&&(o=!0),o?_t("unsupported operation","UNSUPPORTED_OPERATION",{operation:t.method,info:{error:i,payload:t}}):_t("could not coalesce error","UNKNOWN_ERROR",{error:i,payload:t})}send(t,r){if(this.destroyed)return Promise.reject(_t("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:t}));const s=hr(this,rc)._++,i=new Promise((a,o)=>{g(this,Fs).push({resolve:a,reject:o,payload:{method:t,params:r,id:s,jsonrpc:"2.0"}})});return Q(this,yf,Bp).call(this),i}async getSigner(t){t==null&&(t=0);const r=this.send("eth_accounts",[]);if(typeof t=="number"){const i=await r;if(t>=i.length)throw new Error("no such account");return new C6(this,i[t])}const{accounts:s}=await Wt({network:this.getNetwork(),accounts:r});t=Ve(t);for(const i of s)if(Ve(i)===t)return new C6(this,t);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(r=>new C6(this,r))}destroy(){g(this,Qr)&&(clearTimeout(g(this,Qr)),k(this,Qr,null));for(const{payload:t,reject:r}of g(this,Fs))r(_t("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:t.method}));k(this,Fs,[]),super.destroy()}}aa=new WeakMap,rc=new WeakMap,Fs=new WeakMap,Qr=new WeakMap,kr=new WeakMap,Us=new WeakMap,yf=new WeakSet,Bp=function(){if(g(this,Qr))return;const t=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");k(this,Qr,setTimeout(()=>{k(this,Qr,null);const r=g(this,Fs);for(k(this,Fs,[]);r.length;){const s=[r.shift()];for(;r.length&&s.length!==g(this,aa).batchMaxCount;)if(s.push(r.shift()),JSON.stringify(s.map(a=>a.payload)).length>g(this,aa).batchMaxSize){r.unshift(s.pop());break}(async()=>{const i=s.length===1?s[0].payload:s.map(a=>a.payload);this.emit("debug",{action:"sendRpcPayload",payload:i});try{const a=await this._send(i);this.emit("debug",{action:"receiveRpcResult",result:a});for(const{resolve:o,reject:u,payload:c}of s){if(this.destroyed){u(_t("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:c.method}));continue}const l=a.filter(d=>d.id===c.id)[0];if(l==null){const d=_t("missing response for request","BAD_DATA",{value:a,info:{payload:c}});this.emit("error",d),u(d);continue}if("error"in l){u(this.getRpcError(c,l));continue}o(l.result)}}catch(a){this.emit("debug",{action:"receiveRpcError",error:a});for(const{reject:o}of s)o(a)}})()}},t))};var Li;class eR extends XS{constructor(t,r){super(t,r);$(this,Li,void 0);k(this,Li,4e3)}_getSubscriber(t){const r=super._getSubscriber(t);return Fy(r)&&(r.pollingInterval=g(this,Li)),r}get pollingInterval(){return g(this,Li)}set pollingInterval(t){if(!Number.isInteger(t)||t<0)throw new Error("invalid interval");k(this,Li,t),this._forEachSubscriber(r=>{Fy(r)&&(r.pollingInterval=g(this,Li))})}}Li=new WeakMap;var sc;class tR extends eR{constructor(t,r,s){t==null&&(t="http://localhost:8545");super(r,s);$(this,sc,void 0);typeof t=="string"?k(this,sc,new Vs(t)):k(this,sc,t.clone())}_getConnection(){return g(this,sc).clone()}async send(t,r){return await this._start(),await super.send(t,r)}async _send(t){const r=this._getConnection();r.body=JSON.stringify(t),r.setHeader("content-type","application/json");const s=await r.send();s.assertOk();let i=s.bodyJson;return Array.isArray(i)||(i=[i]),i}}sc=new WeakMap;function Fp(n){if(n==null)return null;if(typeof n.message=="string"&&n.message.match(/revert/i)&&yt(n.data))return{message:n.message,data:n.data};if(typeof n=="object"){for(const e in n){const t=Fp(n[e]);if(t)return t}return null}if(typeof n=="string")try{return Fp(JSON.parse(n))}catch{}return null}function Up(n,e){if(n!=null){if(typeof n.message=="string"&&e.push(n.message),typeof n=="object")for(const t in n)Up(n[t],e);if(typeof n=="string")try{return Up(JSON.parse(n),e)}catch{}}}function nR(n){const e=[];return Up(n,e),e}var ic;const eg=class eg extends rb{constructor(t,r){super(r);R(this,"address");$(this,ic,void 0);Z(t&&typeof t.sign=="function","invalid private key","privateKey","[ REDACTED ]"),k(this,ic,t);const s=Rf(this.signingKey.publicKey);Te(this,{address:s})}get signingKey(){return g(this,ic)}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(t){return new eg(g(this,ic),t)}async signTransaction(t){const{to:r,from:s}=await Wt({to:t.to?Jt(t.to,this.provider):void 0,from:t.from?Jt(t.from,this.provider):void 0});r!=null&&(t.to=r),s!=null&&(t.from=s),t.from!=null&&(Z(Ve(t.from)===this.address,"transaction from address mismatch","tx.from",t.from),delete t.from);const i=$l.from(t);return i.signature=this.signingKey.sign(i.unsignedHash),i.serialized}async signMessage(t){return this.signMessageSync(t)}signMessageSync(t){return this.signingKey.sign(BC(t)).serialized}async signTypedData(t,r,s){const i=await xc.resolveNames(t,r,s,async a=>{ae(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:a}});const o=await this.provider.resolveName(a);return ae(o!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:a}),o});return this.signingKey.sign(xc.hash(i.domain,r,i.value)).serialized}};ic=new WeakMap;let z1=eg;const W1=" !#$%&'()*+,-./<=>?@[]^_`{|}~",rR=/^[a-z]*$/i;function Uy(n,e){let t=97;return n.reduce((r,s)=>(s===e?t++:s.match(rR)?r.push(String.fromCharCode(t)+s):(t=97,r.push(s)),r),[])}function sR(n,e){for(let s=W1.length-1;s>=0;s--)n=n.split(W1[s]).join(e.substring(2*s,2*s+2));const t=[],r=n.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(s,i,a,o)=>{if(a)for(let u=parseInt(a);u>=0;u--)t.push(";");else t.push(i.toLowerCase());return""});if(r)throw new Error(`leftovers: ${JSON.stringify(r)}`);return Uy(Uy(t,";"),":")}function iR(n){return Z(n[0]==="0","unsupported auwl data","data",n),sR(n.substring(1+2*W1.length),n.substring(1,1+2*W1.length))}class aR{constructor(e){R(this,"locale");Te(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(" ")}}var ac,mf,oa,xf,Lp;class oR extends aR{constructor(t,r,s){super(t);$(this,xf);$(this,ac,void 0);$(this,mf,void 0);$(this,oa,void 0);k(this,ac,r),k(this,mf,s),k(this,oa,null)}get _data(){return g(this,ac)}_decodeWords(){return iR(g(this,ac))}getWord(t){const r=Q(this,xf,Lp).call(this);return Z(t>=0&&t=12&&t.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const r=new Uint8Array(Math.ceil(11*t.length/8));let s=0;for(let c=0;c=0,`invalid mnemonic word at index ${c}`,"mnemonic","[ REDACTED ]");for(let d=0;d<11;d++)l&1<<10-d&&(r[s>>3]|=1<<7-s%8),s++}const i=32*t.length/3,a=t.length/3,o=I9(a),u=Ce(Br(r.slice(0,i/8)))[0]&o;return Z(u===(r[r.length-1]&o),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),de(r.slice(0,i/8))}function T6(n,e){Z(n.length%4===0&&n.length>=16&&n.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),e==null&&(e=Pa.wordlist());const t=[0];let r=11;for(let a=0;a8?(t[t.length-1]<<=8,t[t.length-1]|=n[a],r-=8):(t[t.length-1]<<=r,t[t.length-1]|=n[a]>>8-r,t.push(n[a]&lR(8-r)),r+=3);const s=n.length/4,i=parseInt(Br(n).substring(2,4),16)&I9(s);return t[t.length-1]<<=s,t[t.length-1]|=i>>8-s,e.join(t.map(a=>e.getWord(a)))}const O6={};class ka{constructor(e,t,r,s,i){R(this,"phrase");R(this,"password");R(this,"wordlist");R(this,"entropy");s==null&&(s=""),i==null&&(i=Pa.wordlist()),Na(e,O6,"Mnemonic"),Te(this,{phrase:r,password:s,wordlist:i,entropy:t})}computeSeed(){const e=Pt("mnemonic"+this.password,"NFKD");return r0(Pt(this.phrase,"NFKD"),e,2048,64,"sha512")}static fromPhrase(e,t,r){const s=R6(e,r);return e=T6(Ce(s),r),new ka(O6,s,e,t,r)}static fromEntropy(e,t,r){const s=Ce(e,"entropy"),i=T6(s,r);return new ka(O6,de(s),i,t,r)}static entropyToPhrase(e,t){const r=Ce(e,"entropy");return T6(r,t)}static phraseToEntropy(e,t){return R6(e,t)}static isValidMnemonic(e,t){try{return R6(e,t),!0}catch{}return!1}}/*! MIT License. Copyright 2015-2022 Richard Moore . See LICENSE.txt. */var Nt=globalThis&&globalThis.__classPrivateFieldGet||function(n,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(n):r?r.value:e.get(n)},N6=globalThis&&globalThis.__classPrivateFieldSet||function(n,e,t,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!s:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(n,t):s?s.value=t:e.set(n,t),t},e1,qn,Hr;const fR={16:10,24:12,32:14},dR=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],zn=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],yd=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],hR=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],pR=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],bR=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],gR=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],yR=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],mR=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],xR=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],wR=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],vR=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],AR=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],ER=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],_R=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function I6(n){const e=[];for(let t=0;t>2,Nt(this,Hr,"f")[a][l%4]=i[l],Nt(this,qn,"f")[t-a][l%4]=i[l];let o=0,u=s,c;for(;u>16&255]<<24^zn[c>>8&255]<<16^zn[c&255]<<8^zn[c>>24&255]^dR[o]<<24,o+=1,s!=8)for(let h=1;h>8&255]<<8^zn[c>>16&255]<<16^zn[c>>24&255]<<24;for(let h=s/2+1;h>2,f=u%4,Nt(this,Hr,"f")[d][f]=i[l],Nt(this,qn,"f")[t-d][f]=i[l++],u++}for(let l=1;l>24&255]^AR[c>>16&255]^ER[c>>8&255]^_R[c&255]}encrypt(e){if(e.length!=16)throw new TypeError("invalid plaintext size (must be 16 bytes)");const t=Nt(this,Hr,"f").length-1,r=[0,0,0,0];let s=I6(e);for(let o=0;o<4;o++)s[o]^=Nt(this,Hr,"f")[0][o];for(let o=1;o>24&255]^pR[s[(u+1)%4]>>16&255]^bR[s[(u+2)%4]>>8&255]^gR[s[(u+3)%4]&255]^Nt(this,Hr,"f")[o][u];s=r.slice()}const i=new Uint8Array(16);let a=0;for(let o=0;o<4;o++)a=Nt(this,Hr,"f")[t][o],i[4*o]=(zn[s[o]>>24&255]^a>>24)&255,i[4*o+1]=(zn[s[(o+1)%4]>>16&255]^a>>16)&255,i[4*o+2]=(zn[s[(o+2)%4]>>8&255]^a>>8)&255,i[4*o+3]=(zn[s[(o+3)%4]&255]^a)&255;return i}decrypt(e){if(e.length!=16)throw new TypeError("invalid ciphertext size (must be 16 bytes)");const t=Nt(this,qn,"f").length-1,r=[0,0,0,0];let s=I6(e);for(let o=0;o<4;o++)s[o]^=Nt(this,qn,"f")[0][o];for(let o=1;o>24&255]^mR[s[(u+3)%4]>>16&255]^xR[s[(u+2)%4]>>8&255]^wR[s[(u+1)%4]&255]^Nt(this,qn,"f")[o][u];s=r.slice()}const i=new Uint8Array(16);let a=0;for(let o=0;o<4;o++)a=Nt(this,qn,"f")[t][o],i[4*o]=(yd[s[o]>>24&255]^a>>24)&255,i[4*o+1]=(yd[s[(o+3)%4]>>16&255]^a>>16)&255,i[4*o+2]=(yd[s[(o+2)%4]>>8&255]^a>>8)&255,i[4*o+3]=(yd[s[(o+1)%4]&255]^a)&255;return i}}e1=new WeakMap,qn=new WeakMap,Hr=new WeakMap;class Dc{constructor(e,t,r){if(r&&!(this instanceof r))throw new Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new kh(t)},name:{enumerable:!0,value:e}})}}var md=globalThis&&globalThis.__classPrivateFieldSet||function(n,e,t,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!s:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(n,t):s?s.value=t:e.set(n,t),t},Ka=globalThis&&globalThis.__classPrivateFieldGet||function(n,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(n):r?r.value:e.get(n)},pl,ys;class Ch extends Dc{constructor(e,t){if(super("ECC",e,Ch),pl.set(this,void 0),ys.set(this,void 0),t){if(t.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");md(this,pl,new Uint8Array(t),"f")}else md(this,pl,new Uint8Array(16),"f");md(this,ys,this.iv,"f")}get iv(){return new Uint8Array(Ka(this,pl,"f"))}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");const t=new Uint8Array(e.length);for(let r=0;rNumber.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let t=15;t>=0;--t)Wn(this,Jn,"f")[t]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(e.length!==16)throw new TypeError("invalid counter initial Uint8Array value length");Wn(this,Jn,"f").set(e)}increment(){for(let e=15;e>=0;e--)if(Wn(this,Jn,"f")[e]===255)Wn(this,Jn,"f")[e]=0;else{Wn(this,Jn,"f")[e]++;break}}encrypt(e){var t,r;const s=new Uint8Array(e);for(let i=0;i16)throw new TypeError("PKCS#7 padding byte out of range");const t=n.length-e;for(let r=0;r0&&(r&r-1)===0,"invalid kdf.N","kdf.N",r),Z(s>0&&i>0,"invalid kdf","kdf",e);const a=wt(n,"crypto.kdfparams.dklen:int!");return Z(a===32,"invalid kdf.dklen","kdf.dflen",a),{name:"scrypt",salt:t,N:r,r:s,p:i,dkLen:64}}else if(e.toLowerCase()==="pbkdf2"){const t=wt(n,"crypto.kdfparams.salt:data!"),r=wt(n,"crypto.kdfparams.prf:string!"),s=r.split("-").pop();Z(s==="sha256"||s==="sha512","invalid kdf.pdf","kdf.pdf",r);const i=wt(n,"crypto.kdfparams.c:int!"),a=wt(n,"crypto.kdfparams.dklen:int!");return Z(a===32,"invalid kdf.dklen","kdf.dklen",a),{name:"pbkdf2",salt:t,count:i,dkLen:a,algorithm:s}}}Z(!1,"unsupported key-derivation function","kdf",e)}function SR(n,e){const t=JSON.parse(n),r=If(e),s=L9(t);if(s.name==="pbkdf2"){const{salt:d,count:f,dkLen:h,algorithm:p}=s,b=r0(r,d,f,h,p);return K1(t,b)}ae(s.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:s});const{salt:i,N:a,r:o,p:u,dkLen:c}=s,l=Fc(r,i,a,o,u,c);return K1(t,l)}function Dy(n){return new Promise(e=>{setTimeout(()=>{e()},n)})}async function RR(n,e,t){const r=JSON.parse(n),s=If(e),i=L9(r);if(i.name==="pbkdf2"){t&&(t(0),await Dy(0));const{salt:f,count:h,dkLen:p,algorithm:b}=i,v=r0(s,f,h,p,b);return t&&(t(1),await Dy(0)),K1(r,v)}ae(i.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:i});const{salt:a,N:o,r:u,p:c,dkLen:l}=i,d=await Bc(s,a,o,u,c,l,t);return K1(r,d)}function D9(n){const e=n.salt!=null?Ce(n.salt,"options.salt"):Gs(32);let t=1<<17,r=8,s=1;return n.scrypt&&(n.scrypt.N&&(t=n.scrypt.N),n.scrypt.r&&(r=n.scrypt.r),n.scrypt.p&&(s=n.scrypt.p)),Z(typeof t=="number"&&t>0&&Number.isSafeInteger(t)&&(BigInt(t)&BigInt(t-1))===BigInt(0),"invalid scrypt N parameter","options.N",t),Z(typeof r=="number"&&r>0&&Number.isSafeInteger(r),"invalid scrypt r parameter","options.r",r),Z(typeof s=="number"&&s>0&&Number.isSafeInteger(s),"invalid scrypt p parameter","options.p",s),{name:"scrypt",dkLen:32,salt:e,N:t,r,p:s}}function M9(n,e,t,r){const s=Ce(t.privateKey,"privateKey"),i=r.iv!=null?Ce(r.iv,"options.iv"):Gs(16);Z(i.length===16,"invalid options.iv length","options.iv",r.iv);const a=r.uuid!=null?Ce(r.uuid,"options.uuid"):Gs(16);Z(a.length===16,"invalid options.uuid length","options.uuid",r.iv);const o=n.slice(0,16),u=n.slice(16,32),c=new Ca(o,i),l=Ce(c.encrypt(s)),d=st(ot([u,l])),f={address:t.address.substring(2).toLowerCase(),id:I_(a),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:de(i).substring(2)},ciphertext:de(l).substring(2),kdf:"scrypt",kdfparams:{salt:de(e.salt).substring(2),n:e.N,dklen:32,p:e.p,r:e.r},mac:d.substring(2)}};if(t.mnemonic){const h=r.client!=null?r.client:`ethers/${K4}`,p=t.mnemonic.path||U9,b=t.mnemonic.locale||"en",v=n.slice(32,64),w=Ce(t.mnemonic.entropy,"account.mnemonic.entropy"),m=Gs(16),x=new Ca(v,m),y=Ce(x.encrypt(w)),A=new Date,D="UTC--"+(A.getUTCFullYear()+"-"+eu(A.getUTCMonth()+1,2)+"-"+eu(A.getUTCDate(),2)+"T"+eu(A.getUTCHours(),2)+"-"+eu(A.getUTCMinutes(),2)+"-"+eu(A.getUTCSeconds(),2)+".0Z")+"--"+f.address;f["x-ethers"]={client:h,gethFilename:D,path:p,locale:b,mnemonicCounter:de(m).substring(2),mnemonicCiphertext:de(y).substring(2),version:"0.1"}}return JSON.stringify(f)}function j9(n,e,t){t==null&&(t={});const r=If(e),s=D9(t),i=Fc(r,s.salt,s.N,s.r,s.p,64);return M9(Ce(i),s,n,t)}async function $9(n,e,t){t==null&&(t={});const r=If(e),s=D9(t),i=await Bc(r,s.salt,s.N,s.r,s.p,64,t.progressCallback);return M9(Ce(i),s,n,t)}const F6="m/44'/60'/0'/0/0",TR=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),Qi=2147483648,OR=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),NR="0123456789abcdef";function V1(n,e){let t="";for(;n;)t=NR[n%16]+t,n=Math.trunc(n/16);for(;t.length=0;a-=8)s[33+(a>>3)]=n>>24-a&255;const i=Ce(Ia("sha512",e,s));return{IL:i.slice(0,32),IR:i.slice(32)}}function G9(n,e){const t=e.split("/");Z(t.length>0&&(t[0]==="m"||n.depth>0),"invalid path","path",e),t[0]==="m"&&t.shift();let r=n;for(let s=0;s=16&&s.length<=64,"invalid seed","seed","[REDACTED]");const i=Ce(Ia("sha512",TR,s)),a=new rs(de(i.slice(0,32)));return new Ar(Gr,a,"0x00000000",de(i.slice(32)),"m",0,0,r,null)},$(Ar,ca);let mo=Ar;class Gl extends Op{constructor(t,r,s,i,a,o,u,c,l){super(r,l);R(this,"publicKey");R(this,"fingerprint");R(this,"parentFingerprint");R(this,"chainCode");R(this,"path");R(this,"index");R(this,"depth");Na(t,Gr,"HDNodeVoidWallet"),Te(this,{publicKey:s});const d=ft(Ic(Br(s)),0,4);Te(this,{publicKey:s,fingerprint:d,parentFingerprint:i,chainCode:a,path:o,index:u,depth:c})}connect(t){return new Gl(Gr,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,t)}get extendedKey(){return ae(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),Mp(ot(["0x0488B21E",V1(this.depth,1),this.parentFingerprint,V1(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return this.path!=null}deriveChild(t){const r=He(t,"index");Z(r<=4294967295,"invalid index","index",r);let s=this.path;s&&(s+="/"+(r&~Qi),r&Qi&&(s+="'"));const{IR:i,IL:a}=H9(r,this.chainCode,this.publicKey,null),o=rs.addPoints(a,this.publicKey,!0),u=Rf(o);return new Gl(Gr,u,o,this.fingerprint,de(i),s,r,this.depth+1,this.provider)}derivePath(t){return G9(this,t)}}function My(n){try{if(JSON.parse(n).encseed)return!0}catch{}return!1}function jy(n,e){const t=JSON.parse(n),r=If(e),s=Ve(wt(t,"ethaddr:string!")),i=F9(wt(t,"encseed:string!"));Z(i&&i.length%16===0,"invalid encseed","json",n);const a=Ce(r0(r,r,2e3,32,"sha256")).slice(0,16),o=i.slice(0,16),u=i.slice(16),c=new Ch(a,o),l=B9(Ce(c.decrypt(u)));let d="";for(let f=0;f{setTimeout(()=>{e()},n)})}var vf,$p;const L0=class L0 extends z1{constructor(e,t){typeof e=="string"&&!e.startsWith("0x")&&(e="0x"+e);let r=typeof e=="string"?new rs(e):e;super(r,t)}connect(e){return new L0(this.signingKey,e)}async encrypt(e,t){const r={address:this.address,privateKey:this.privateKey};return await $9(r,e,{progressCallback:t})}encryptSync(e){const t={address:this.address,privateKey:this.privateKey};return j9(t,e)}static async fromEncryptedJson(e,t,r){var i;let s=null;return Ly(e)?s=await RR(e,t,r):My(e)&&(r&&(r(0),await $y(0)),s=jy(e,t),r&&(r(1),await $y(0))),Q(i=L0,vf,$p).call(i,s)}static fromEncryptedJsonSync(e,t){var s;let r=null;return Ly(e)?r=SR(e,t):My(e)?r=jy(e,t):Z(!1,"invalid JSON wallet","json","[ REDACTED ]"),Q(s=L0,vf,$p).call(s,r)}static createRandom(e){const t=mo.createRandom();return e?t.connect(e):t}static fromPhrase(e,t){const r=mo.fromPhrase(e);return t?r.connect(t):r}};vf=new WeakSet,$p=function(e){if(Z(e,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in e&&e.mnemonic&&e.mnemonic.locale==="en"){const r=ka.fromEntropy(e.mnemonic.entropy),s=mo.fromMnemonic(r,e.mnemonic.path);if(s.address===e.address&&s.privateKey===e.privateKey)return s;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const t=new L0(e.privateKey);return Z(t.address===e.address,"address/privateKey mismatch","json","[ REDACTED ]"),t},$(L0,vf);let Sa=L0;const ob={Treasure:"0x8aa64EF9FD4B9Bfa8A0ef3a2C745a10763461351",TreasureHuntCreator:"0xa602e08C4Ef757Ed98C15527E417249bAc98CB20",DisappearRenderer:"0xA49C53020554F16A30C0CB9d92107F2feb3B14AC"},IR="https://opt-mainnet.g.alchemy.com/v2/KIDjvhiGx5K8Qu-KUp-RJLgUshaBLtlc",BR=parseInt("10",10);class FR{constructor(e=window.localStorage){R(this,"storage");this.storage=e}get(e,t){const r=this.storage.getItem(e);return r===null?t===void 0?null:t:JSON.parse(r)}set(e,t,r){let s;if(t instanceof Function){const i=this.get(e,r);s=t(i)}else s=t;return this.storage.setItem(e,JSON.stringify(s)),s}has(e){return this.get(e)!==null}getsert(e,t){return this.has(e)||this.set(e,t),this.get(e)}clear(){this.storage.clear()}}const co=new FR;function cb(n,e){const t=Ki(co.getsert(n,e));return t.subscribe(r=>{co.set(n,r)}),t}class Bf extends Error{constructor(t,r){super(t);R(this,"parentError");Object.setPrototypeOf(this,Bf.prototype),this.parentError=r}}class UR extends Error{constructor(e){super(e),Object.setPrototypeOf(this,Bf.prototype)}}function LR(n){return new Promise(e=>{setTimeout(e,n)})}function Sh(n,e=!1){return async()=>{for(let t=0;t<3;t++)try{return await n()}catch(r){if(e||r instanceof Bf)console.error("Retry",t+1,r),await LR(1e3);else throw console.log("Unknown error"),r}throw console.error("Panic",n),new UR("Panic")}}function ub(n,e=!1){return Sh(n,e)()}var oe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function DR(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function jn(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var s=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:function(){return n[r]}})}),t}const MR=jn(ew),z9=R5(new tR(IR));window.Wallet=Sa;const n1=cb("mnemonic",()=>{var n;return(n=Sa.createRandom().mnemonic)==null?void 0:n.phrase}),Ff=fr([z9,n1],([n,e],t)=>{if(n&&e)try{const r=mo.fromMnemonic(ka.fromPhrase(e)),s=new Sa(r.privateKey,n);t(s)}catch(r){console.log(r)}else t(void 0)}),jR="6.12.1";function $R(n,e,t){const r=e.split("|").map(i=>i.trim());for(let i=0;iPromise.resolve(n[r])))).reduce((r,s,i)=>(r[e[i]]=s,r),{})}function Ge(n,e,t){for(let r in e){let s=e[r];const i=t?t[r]:null;i&&$R(s,i,r),Object.defineProperty(n,r,{enumerable:!0,value:s,writable:!1})}}function uo(n){if(n==null)return"null";if(Array.isArray(n))return"[ "+n.map(uo).join(", ")+" ]";if(n instanceof Uint8Array){const e="0123456789abcdef";let t="0x";for(let r=0;r>4],t+=e[n[r]&15];return t}if(typeof n=="object"&&typeof n.toJSON=="function")return uo(n.toJSON());switch(typeof n){case"boolean":case"symbol":return n.toString();case"bigint":return BigInt(n).toString();case"number":return n.toString();case"string":return JSON.stringify(n);case"object":{const e=Object.keys(n);return e.sort(),"{ "+e.map(t=>`${uo(t)}: ${uo(n[t])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function vc(n,e){return n&&n.code===e}function W9(n){return vc(n,"CALL_EXCEPTION")}function zl(n,e,t){let r=n;{const i=[];if(t){if("message"in t||"code"in t||"name"in t)throw new Error(`value will overwrite populated values: ${uo(t)}`);for(const a in t){if(a==="shortMessage")continue;const o=t[a];i.push(a+"="+uo(o))}}i.push(`code=${e}`),i.push(`version=${jR}`),i.length&&(n+=" ("+i.join(", ")+")")}let s;switch(e){case"INVALID_ARGUMENT":s=new TypeError(n);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":s=new RangeError(n);break;default:s=new Error(n)}return Ge(s,{code:e}),t&&Object.assign(s,t),s.shortMessage==null&&Ge(s,{shortMessage:r}),s}function Le(n,e,t,r){if(!n)throw zl(e,t,r)}function fe(n,e,t,r){Le(n,e,"INVALID_ARGUMENT",{argument:t,value:r})}function K9(n,e,t){t==null&&(t=""),t&&(t=": "+t),Le(n>=e,"missing arguemnt"+t,"MISSING_ARGUMENT",{count:n,expectedCount:e}),Le(n<=e,"too many arguments"+t,"UNEXPECTED_ARGUMENT",{count:n,expectedCount:e})}const HR=["NFD","NFC","NFKD","NFKC"].reduce((n,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"){const t=String.fromCharCode(233).normalize("NFD"),r=String.fromCharCode(101,769);if(t!==r)throw new Error("broken")}n.push(e)}catch{}return n},[]);function GR(n){Le(HR.indexOf(n)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:n}})}function lb(n,e,t){if(t==null&&(t=""),n!==e){let r=t,s="new";t&&(r+=".",s+=" "+t),Le(!1,`private constructor; use ${r}from* methods`,"UNSUPPORTED_OPERATION",{operation:s})}}function V9(n,e,t){if(n instanceof Uint8Array)return t?new Uint8Array(n):n;if(typeof n=="string"&&n.match(/^0x([0-9a-f][0-9a-f])*$/i)){const r=new Uint8Array((n.length-2)/2);let s=2;for(let i=0;i>4]+Hy[s&15]}return t}function pa(n){return"0x"+n.map(e=>vt(e).substring(2)).join("")}function I0(n,e,t){const r=lr(n);return t!=null&&t>r.length&&Le(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:t}),vt(r.slice(e??0,t??r.length))}function q9(n,e,t){const r=lr(n);Le(e>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:e,offset:e+1});const s=new Uint8Array(e);return s.fill(0),t?s.set(r,e-r.length):s.set(r,0),vt(s)}function WR(n,e){return q9(n,e,!0)}function KR(n,e){return q9(n,e,!1)}const Rh=BigInt(0),Or=BigInt(1),lo=9007199254740991;function VR(n,e){const t=Th(n,"value"),r=BigInt(si(e,"width"));if(Le(t>>r===Rh,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:n}),t>>r-Or){const s=(Or<=-lo&&n<=lo,"overflow",e||"value",n),BigInt(n);case"string":try{if(n==="")throw new Error("empty string");return n[0]==="-"&&n[1]!=="-"?-BigInt(n.substring(1)):BigInt(n)}catch(t){fe(!1,`invalid BigNumberish string: ${t.message}`,e||"value",n)}}fe(!1,"invalid BigNumberish value",e||"value",n)}function Th(n,e){const t=ri(n,e);return Le(t>=Rh,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:n}),t}const Gy="0123456789abcdef";function J9(n){if(n instanceof Uint8Array){let e="0x0";for(const t of n)e+=Gy[t>>4],e+=Gy[t&15];return BigInt(e)}return ri(n)}function si(n,e){switch(typeof n){case"bigint":return fe(n>=-lo&&n<=lo,"overflow",e||"value",n),Number(n);case"number":return fe(Number.isInteger(n),"underflow",e||"value",n),fe(n>=-lo&&n<=lo,"overflow",e||"value",n),n;case"string":try{if(n==="")throw new Error("empty string");return si(BigInt(n),e)}catch(t){fe(!1,`invalid numeric string: ${t.message}`,e||"value",n)}}fe(!1,"invalid numeric value",e||"value",n)}function JR(n){return si(J9(n))}function Q9(n,e){let r=Th(n,"value").toString(16);if(e==null)r.length%2&&(r="0"+r);else{const s=si(e,"width");for(Le(s*2>=r.length,`value exceeds width (${s} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:n});r.length>6===2;a++)i++;return i}return n==="OVERRUN"?t.length-e-1:0}function XR(n,e,t,r,s){return n==="OVERLONG"?(fe(typeof s=="number","invalid bad code point for replacement","badCodepoint",s),r.push(s),0):(r.push(65533),Y9(n,e,t))}const eT=Object.freeze({error:ZR,ignore:Y9,replace:XR});function tT(n,e){e==null&&(e=eT.error);const t=lr(n,"bytes"),r=[];let s=0;for(;s>7)){r.push(i);continue}let a=null,o=null;if((i&224)===192)a=1,o=127;else if((i&240)===224)a=2,o=2047;else if((i&248)===240)a=3,o=65535;else{(i&192)===128?s+=e("UNEXPECTED_CONTINUE",s-1,t,r):s+=e("BAD_PREFIX",s-1,t,r);continue}if(s-1+a>=t.length){s+=e("OVERRUN",s-1,t,r);continue}let u=i&(1<<8-a-1)-1;for(let c=0;c1114111){s+=e("OUT_OF_RANGE",s-1-a,t,r,u);continue}if(u>=55296&&u<=57343){s+=e("UTF16_SURROGATE",s-1-a,t,r,u);continue}if(u<=o){s+=e("OVERLONG",s-1-a,t,r,u);continue}r.push(u)}}return r}function Z9(n,e){fe(typeof n=="string","invalid string value","str",n),e!=null&&(GR(e),n=n.normalize(e));let t=[];for(let r=0;r>6|192),t.push(s&63|128);else if((s&64512)==55296){r++;const i=n.charCodeAt(r);fe(r>18|240),t.push(a>>12&63|128),t.push(a>>6&63|128),t.push(a&63|128)}else t.push(s>>12|224),t.push(s>>6&63|128),t.push(s&63|128)}return new Uint8Array(t)}function nT(n){return n.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function rT(n,e){return nT(tT(n,e))}function zy(n){const e=[];for(;n;)e.unshift(n&255),n>>=8;return e}function X9(n){if(Array.isArray(n)){let r=[];if(n.forEach(function(i){r=r.concat(X9(i))}),r.length<=55)return r.unshift(192+r.length),r;const s=zy(r.length);return s.unshift(247+s.length),s.concat(r)}const e=Array.prototype.slice.call(lr(n,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const t=zy(e.length);return t.unshift(183+t.length),t.concat(e)}const Wy="0123456789abcdef";function sT(n){let e="0x";for(const t of X9(n))e+=Wy[t>>4],e+=Wy[t&15];return e}const rn=32,Gp=new Uint8Array(rn),iT=["then"],wd={};function tu(n,e){const t=new Error(`deferred error during ABI decoding triggered accessing ${n}`);throw t.error=e,t}var Di;const D0=class D0 extends Array{constructor(...t){const r=t[0];let s=t[1],i=(t[2]||[]).slice(),a=!0;r!==wd&&(s=t,i=[],a=!1);super(s.length);$(this,Di,void 0);s.forEach((u,c)=>{this[c]=u});const o=i.reduce((u,c)=>(typeof c=="string"&&u.set(c,(u.get(c)||0)+1),u),new Map);if(k(this,Di,Object.freeze(s.map((u,c)=>{const l=i[c];return l!=null&&o.get(l)===1?l:null}))),!!a)return Object.freeze(this),new Proxy(this,{get:(u,c,l)=>{if(typeof c=="string"){if(c.match(/^[0-9]+$/)){const f=si(c,"%index");if(f<0||f>=this.length)throw new RangeError("out of result range");const h=u[f];return h instanceof Error&&tu(`index ${f}`,h),h}if(iT.indexOf(c)>=0)return Reflect.get(u,c,l);const d=u[c];if(d instanceof Function)return function(...f){return d.apply(this===l?u:this,f)};if(!(c in u))return u.getValue.apply(this===l?u:this,[c])}return Reflect.get(u,c,l)}})}toArray(t){const r=[];return this.forEach((s,i)=>{s instanceof Error&&tu(`index ${i}`,s),t&&s instanceof D0&&(s=s.toArray(t)),r.push(s)}),r}toObject(t){return g(this,Di).reduce((r,s,i)=>{if(Le(s!=null,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"}),!(s in r)){let a=this.getValue(s);t&&a instanceof D0&&(a=a.toObject(t)),r[s]=a}return r},{})}slice(t,r){t==null&&(t=0),t<0&&(t+=this.length,t<0&&(t=0)),r==null&&(r=this.length),r<0&&(r+=this.length,r<0&&(r=0)),r>this.length&&(r=this.length);const s=[],i=[];for(let a=t;a{g(this,Ls)[e]=Ky(t)}}}Ls=new WeakMap,ua=new WeakMap,cc=new WeakSet,r1=function(e){return g(this,Ls).push(e),k(this,ua,g(this,ua)+e.length),e.length};var fn,Ln,la,fa,Mi,Af,Kp,oh,ev;const tg=class tg{constructor(e,t,r){$(this,Af);$(this,oh);R(this,"allowLoose");$(this,fn,void 0);$(this,Ln,void 0);$(this,la,void 0);$(this,fa,void 0);$(this,Mi,void 0);Ge(this,{allowLoose:!!t}),k(this,fn,ss(e)),k(this,la,0),k(this,fa,null),k(this,Mi,r??1024),k(this,Ln,0)}get data(){return vt(g(this,fn))}get dataLength(){return g(this,fn).length}get consumed(){return g(this,Ln)}get bytes(){return new Uint8Array(g(this,fn))}subReader(e){const t=new tg(g(this,fn).slice(g(this,Ln)+e),this.allowLoose,g(this,Mi));return k(t,fa,this),t}readBytes(e,t){let r=Q(this,oh,ev).call(this,0,e,!!t);return Q(this,Af,Kp).call(this,e),k(this,Ln,g(this,Ln)+r.length),r.slice(0,e)}readValue(){return J9(this.readBytes(rn))}readIndex(){return JR(this.readBytes(rn))}};fn=new WeakMap,Ln=new WeakMap,la=new WeakMap,fa=new WeakMap,Mi=new WeakMap,Af=new WeakSet,Kp=function(e){var t;if(g(this,fa))return Q(t=g(this,fa),Af,Kp).call(t,e);k(this,la,g(this,la)+e),Le(g(this,Mi)<1||g(this,la)<=g(this,Mi)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${g(this,Mi)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:ss(g(this,fn)),offset:g(this,Ln),length:e,info:{bytesRead:g(this,la),dataLength:this.dataLength}})},oh=new WeakSet,ev=function(e,t,r){let s=Math.ceil(t/rn)*rn;return g(this,Ln)+s>g(this,fn).length&&(this.allowLoose&&r&&g(this,Ln)+t<=g(this,fn).length?s=t:Le(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:ss(g(this,fn)),length:g(this,fn).length,offset:g(this,Ln)+s})),g(this,fn).slice(g(this,Ln),g(this,Ln)+s)};let Wp=tg;function Vy(n){if(!Number.isSafeInteger(n)||n<0)throw new Error(`Wrong positive integer: ${n}`)}function tv(n,...e){if(!(n instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(n.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${n.length}`)}function qy(n,e=!0){if(n.destroyed)throw new Error("Hash instance has been destroyed");if(e&&n.finished)throw new Error("Hash#digest() has already been called")}function aT(n,e){tv(n);const t=e.outputLen;if(n.lengthn instanceof Uint8Array,cT=n=>new Uint32Array(n.buffer,n.byteOffset,Math.floor(n.byteLength/4)),uT=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!uT)throw new Error("Non little-endian hardware is not supported");function lT(n){if(typeof n!="string")throw new Error(`utf8ToBytes expected string, got ${typeof n}`);return new Uint8Array(new TextEncoder().encode(n))}function nv(n){if(typeof n=="string"&&(n=lT(n)),!oT(n))throw new Error(`expected Uint8Array, got ${typeof n}`);return n}class fT{clone(){return this._cloneInto()}}function dT(n){const e=r=>n().update(nv(r)).digest(),t=n();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>n(),e}const vd=BigInt(2**32-1),Jy=BigInt(32);function hT(n,e=!1){return e?{h:Number(n&vd),l:Number(n>>Jy&vd)}:{h:Number(n>>Jy&vd)|0,l:Number(n&vd)|0}}function pT(n,e=!1){let t=new Uint32Array(n.length),r=new Uint32Array(n.length);for(let s=0;sn<>>32-t,gT=(n,e,t)=>e<>>32-t,yT=(n,e,t)=>e<>>64-t,mT=(n,e,t)=>n<>>64-t,[rv,sv,iv]=[[],[],[]],xT=BigInt(0),nu=BigInt(1),wT=BigInt(2),vT=BigInt(7),AT=BigInt(256),ET=BigInt(113);for(let n=0,e=nu,t=1,r=0;n<24;n++){[t,r]=[r,(2*t+3*r)%5],rv.push(2*(5*r+t)),sv.push((n+1)*(n+2)/2%64);let s=xT;for(let i=0;i<7;i++)e=(e<>vT)*ET)%AT,e&wT&&(s^=nu<<(nu<t>32?yT(n,e,t):bT(n,e,t),Yy=(n,e,t)=>t>32?mT(n,e,t):gT(n,e,t);function kT(n,e=24){const t=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let a=0;a<10;a++)t[a]=n[a]^n[a+10]^n[a+20]^n[a+30]^n[a+40];for(let a=0;a<10;a+=2){const o=(a+8)%10,u=(a+2)%10,c=t[u],l=t[u+1],d=Qy(c,l,1)^t[o],f=Yy(c,l,1)^t[o+1];for(let h=0;h<50;h+=10)n[a+h]^=d,n[a+h+1]^=f}let s=n[2],i=n[3];for(let a=0;a<24;a++){const o=sv[a],u=Qy(s,i,o),c=Yy(s,i,o),l=rv[a];s=n[l],i=n[l+1],n[l]=u,n[l+1]=c}for(let a=0;a<50;a+=10){for(let o=0;o<10;o++)t[o]=n[a+o];for(let o=0;o<10;o++)n[a+o]^=~t[(o+2)%10]&t[(o+4)%10]}n[0]^=_T[r],n[1]^=PT[r]}t.fill(0)}class fb extends fT{constructor(e,t,r,s=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=s,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Vy(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=cT(this.state)}keccak(){kT(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){qy(this);const{blockLen:t,state:r}=this;e=nv(e);const s=e.length;for(let i=0;i=r&&this.keccak();const a=Math.min(r-this.posOut,i-s);e.set(t.subarray(this.posOut,this.posOut+a),s),this.posOut+=a,s+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Vy(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(aT(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:s,rounds:i,enableXOF:a}=this;return e||(e=new fb(t,r,s,a,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=s,e.enableXOF=a,e.destroyed=this.destroyed,e}}const CT=(n,e,t)=>dT(()=>new fb(e,n,t)),ST=CT(1,136,256/8);let av=!1;const ov=function(n){return ST(n)};let cv=ov;function Qs(n){const e=lr(n,"data");return vt(cv(e))}Qs._=ov;Qs.lock=function(){av=!0};Qs.register=function(n){if(av)throw new TypeError("keccak256 is locked");cv=n};Object.freeze(Qs);const RT=BigInt(0),TT=BigInt(36);function Zy(n){n=n.toLowerCase();const e=n.substring(2).split(""),t=new Uint8Array(40);for(let s=0;s<40;s++)t[s]=e[s].charCodeAt(0);const r=lr(Qs(t));for(let s=0;s<40;s+=2)r[s>>1]>>4>=8&&(e[s]=e[s].toUpperCase()),(r[s>>1]&15)>=8&&(e[s+1]=e[s+1].toUpperCase());return"0x"+e.join("")}const db={};for(let n=0;n<10;n++)db[String(n)]=String(n);for(let n=0;n<26;n++)db[String.fromCharCode(65+n)]=String(10+n);const Xy=15;function OT(n){n=n.toUpperCase(),n=n.substring(4)+n.substring(0,2)+"00";let e=n.split("").map(r=>db[r]).join("");for(;e.length>=Xy;){let r=e.substring(0,Xy);e=parseInt(r,10)%97+e.substring(r.length)}let t=String(98-parseInt(e,10)%97);for(;t.length<2;)t="0"+t;return t}const NT=function(){const n={};for(let e=0;e<36;e++){const t="0123456789abcdefghijklmnopqrstuvwxyz"[e];n[t]=BigInt(e)}return n}();function IT(n){n=n.toLowerCase();let e=RT;for(let t=0;te.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 g(this,da)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return g(this,da)===!0?-1:g(this,da)===!1?this.value.length:null}static from(e,t){return new vs(ws,e,t)}static uint8(e){return ke(e,8)}static uint16(e){return ke(e,16)}static uint24(e){return ke(e,24)}static uint32(e){return ke(e,32)}static uint40(e){return ke(e,40)}static uint48(e){return ke(e,48)}static uint56(e){return ke(e,56)}static uint64(e){return ke(e,64)}static uint72(e){return ke(e,72)}static uint80(e){return ke(e,80)}static uint88(e){return ke(e,88)}static uint96(e){return ke(e,96)}static uint104(e){return ke(e,104)}static uint112(e){return ke(e,112)}static uint120(e){return ke(e,120)}static uint128(e){return ke(e,128)}static uint136(e){return ke(e,136)}static uint144(e){return ke(e,144)}static uint152(e){return ke(e,152)}static uint160(e){return ke(e,160)}static uint168(e){return ke(e,168)}static uint176(e){return ke(e,176)}static uint184(e){return ke(e,184)}static uint192(e){return ke(e,192)}static uint200(e){return ke(e,200)}static uint208(e){return ke(e,208)}static uint216(e){return ke(e,216)}static uint224(e){return ke(e,224)}static uint232(e){return ke(e,232)}static uint240(e){return ke(e,240)}static uint248(e){return ke(e,248)}static uint256(e){return ke(e,256)}static uint(e){return ke(e,256)}static int8(e){return ke(e,-8)}static int16(e){return ke(e,-16)}static int24(e){return ke(e,-24)}static int32(e){return ke(e,-32)}static int40(e){return ke(e,-40)}static int48(e){return ke(e,-48)}static int56(e){return ke(e,-56)}static int64(e){return ke(e,-64)}static int72(e){return ke(e,-72)}static int80(e){return ke(e,-80)}static int88(e){return ke(e,-88)}static int96(e){return ke(e,-96)}static int104(e){return ke(e,-104)}static int112(e){return ke(e,-112)}static int120(e){return ke(e,-120)}static int128(e){return ke(e,-128)}static int136(e){return ke(e,-136)}static int144(e){return ke(e,-144)}static int152(e){return ke(e,-152)}static int160(e){return ke(e,-160)}static int168(e){return ke(e,-168)}static int176(e){return ke(e,-176)}static int184(e){return ke(e,-184)}static int192(e){return ke(e,-192)}static int200(e){return ke(e,-200)}static int208(e){return ke(e,-208)}static int216(e){return ke(e,-216)}static int224(e){return ke(e,-224)}static int232(e){return ke(e,-232)}static int240(e){return ke(e,-240)}static int248(e){return ke(e,-248)}static int256(e){return ke(e,-256)}static int(e){return ke(e,-256)}static bytes1(e){return et(e,1)}static bytes2(e){return et(e,2)}static bytes3(e){return et(e,3)}static bytes4(e){return et(e,4)}static bytes5(e){return et(e,5)}static bytes6(e){return et(e,6)}static bytes7(e){return et(e,7)}static bytes8(e){return et(e,8)}static bytes9(e){return et(e,9)}static bytes10(e){return et(e,10)}static bytes11(e){return et(e,11)}static bytes12(e){return et(e,12)}static bytes13(e){return et(e,13)}static bytes14(e){return et(e,14)}static bytes15(e){return et(e,15)}static bytes16(e){return et(e,16)}static bytes17(e){return et(e,17)}static bytes18(e){return et(e,18)}static bytes19(e){return et(e,19)}static bytes20(e){return et(e,20)}static bytes21(e){return et(e,21)}static bytes22(e){return et(e,22)}static bytes23(e){return et(e,23)}static bytes24(e){return et(e,24)}static bytes25(e){return et(e,25)}static bytes26(e){return et(e,26)}static bytes27(e){return et(e,27)}static bytes28(e){return et(e,28)}static bytes29(e){return et(e,29)}static bytes30(e){return et(e,30)}static bytes31(e){return et(e,31)}static bytes32(e){return et(e,32)}static address(e){return new vs(ws,"address",e)}static bool(e){return new vs(ws,"bool",!!e)}static bytes(e){return new vs(ws,"bytes",e)}static string(e){return new vs(ws,"string",e)}static array(e,t){throw new Error("not implemented yet")}static tuple(e,t){throw new Error("not implemented yet")}static overrides(e){return new vs(ws,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===em}static dereference(e,t){if(vs.isTyped(e)){if(e.type!==t)throw new Error(`invalid type: expecetd ${t}, got ${e.type}`);return e.value}return e}};da=new WeakMap;let Qt=vs;class FT extends ii{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){let r=Qt.dereference(t,"string");try{r=Ys(r)}catch(s){return this._throwError(s.message,t)}return e.writeValue(r)}decode(e){return Ys(Q9(e.readValue(),20))}}class UT extends ii{constructor(t){super(t.name,t.type,"_",t.dynamic);R(this,"coder");this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,r){return this.coder.encode(t,r)}decode(t){return this.coder.decode(t)}}function lv(n,e,t){let r=[];if(Array.isArray(t))r=t;else if(t&&typeof t=="object"){let u={};r=e.map(c=>{const l=c.localName;return Le(l,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:c},value:t}),Le(!u[l],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:c},value:t}),u[l]=!0,t[l]})}else fe(!1,"invalid tuple value","tuple",t);fe(e.length===r.length,"types/value length mismatch","tuple",t);let s=new zp,i=new zp,a=[];e.forEach((u,c)=>{let l=r[c];if(u.dynamic){let d=i.length;u.encode(i,l);let f=s.writeUpdatableValue();a.push(h=>{f(h+d)})}else u.encode(s,l)}),a.forEach(u=>{u(s.length)});let o=n.appendWriter(s);return o+=n.appendWriter(i),o}function fv(n,e){let t=[],r=[],s=n.subReader(0);return e.forEach(i=>{let a=null;if(i.dynamic){let o=n.readIndex(),u=s.subReader(o);try{a=i.decode(u)}catch(c){if(vc(c,"BUFFER_OVERRUN"))throw c;a=c,a.baseType=i.name,a.name=i.localName,a.type=i.type}}else try{a=i.decode(n)}catch(o){if(vc(o,"BUFFER_OVERRUN"))throw o;a=o,a.baseType=i.name,a.name=i.localName,a.type=i.type}if(a==null)throw new Error("investigate");t.push(a),r.push(i.localName||null)}),q1.fromItems(t,r)}class LT extends ii{constructor(t,r,s){const i=t.type+"["+(r>=0?r:"")+"]",a=r===-1||t.dynamic;super("array",i,s,a);R(this,"coder");R(this,"length");Ge(this,{coder:t,length:r})}defaultValue(){const t=this.coder.defaultValue(),r=[];for(let s=0;sa||s<-(a+zT))&&this._throwError("value out-of-bounds",r),s=qR(s,8*rn)}else(sxd(i,this.size*8))&&this._throwError("value out-of-bounds",r);return t.writeValue(s)}decode(t){let r=xd(t.readValue(),this.size*8);return this.signed&&(r=VR(r,this.size*8)),r}}class VT extends dv{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,Z9(Qt.dereference(t,"string")))}decode(e){return rT(super.decode(e))}}class Ad extends ii{constructor(t,r){let s=!1;const i=[];t.forEach(o=>{o.dynamic&&(s=!0),i.push(o.type)});const a="tuple("+i.join(",")+")";super("tuple",a,r,s);R(this,"coders");Ge(this,{coders:Object.freeze(t.slice())})}defaultValue(){const t=[];this.coders.forEach(s=>{t.push(s.defaultValue())});const r=this.coders.reduce((s,i)=>{const a=i.localName;return a&&(s[a]||(s[a]=0),s[a]++),s},{});return this.coders.forEach((s,i)=>{let a=s.localName;!a||r[a]!==1||(a==="length"&&(a="_length"),t[a]==null&&(t[a]=t[i]))}),Object.freeze(t)}encode(t,r){const s=Qt.dereference(r,"tuple");return lv(t,this.coders,s)}decode(t){return fv(t,this.coders)}}function Kl(n){return Qs(Z9(n))}function L6(n,e){return{address:Ys(n),storageKeys:e.map((t,r)=>(fe($s(t,32),"invalid slot",`storageKeys[${r}]`,t),t.toLowerCase()))}}function qT(n){if(Array.isArray(n))return n.map((t,r)=>Array.isArray(t)?(fe(t.length===2,"invalid slot set",`value[${r}]`,t),L6(t[0],t[1])):(fe(t!=null&&typeof t=="object","invalid address-slot set","value",n),L6(t.address,t.storageKeys)));fe(n!=null&&typeof n=="object","invalid access list","value",n);const e=Object.keys(n).map(t=>{const r=n[t].reduce((s,i)=>(s[i]=!0,s),{});return L6(t,Object.keys(r).sort())});return e.sort((t,r)=>t.address.localeCompare(r.address)),e}function sn(n){const e=new Set;return n.forEach(t=>e.add(t)),Object.freeze(e)}const JT="external public payable override",QT=sn(JT.split(" ")),hv="constant external internal payable private public pure view override",YT=sn(hv.split(" ")),pv="constructor error event fallback function receive struct",bv=sn(pv.split(" ")),gv="calldata memory storage payable indexed",ZT=sn(gv.split(" ")),XT="tuple returns",eO=[pv,gv,XT,hv].join(" "),tO=sn(eO.split(" ")),nO={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},rO=new RegExp("^(\\s*)"),sO=new RegExp("^([0-9]+)"),iO=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),yv=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),mv=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");var Bt,Cr,Ef,Vp;const ch=class ch{constructor(e){$(this,Ef);$(this,Bt,void 0);$(this,Cr,void 0);k(this,Bt,0),k(this,Cr,e.slice())}get offset(){return g(this,Bt)}get length(){return g(this,Cr).length-g(this,Bt)}clone(){return new ch(g(this,Cr))}reset(){k(this,Bt,0)}popKeyword(e){const t=this.peek();if(t.type!=="KEYWORD"||!e.has(t.text))throw new Error(`expected keyword ${t.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const t=this.peek();throw new Error(`expected ${e}; got ${t.type} ${JSON.stringify(t.text)}`)}return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const t=Q(this,Ef,Vp).call(this,g(this,Bt)+1,e.match+1);return k(this,Bt,e.match+1),t}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const t=[];for(;g(this,Bt)=g(this,Cr).length)throw new Error("out-of-bounds");return g(this,Cr)[g(this,Bt)]}peekKeyword(e){const t=this.peekType("KEYWORD");return t!=null&&e.has(t)?t:null}peekType(e){if(this.length===0)return null;const t=this.peek();return t.type===e?t.text:null}pop(){const e=this.peek();return hr(this,Bt)._++,e}toString(){const e=[];for(let t=g(this,Bt);t`}};Bt=new WeakMap,Cr=new WeakMap,Ef=new WeakSet,Vp=function(e=0,t=0){return new ch(g(this,Cr).slice(e,t).map(r=>Object.freeze(Object.assign({},r,{match:r.match-e,linkBack:r.linkBack-e,linkNext:r.linkNext-e}))))};let Fr=ch;function i0(n){const e=[],t=a=>{const o=i0&&e[e.length-1].type==="NUMBER"){const d=e.pop().text;l=d+l,e[e.length-1].value=si(d)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=l}continue}if(o=a.match(iO),o){if(u.text=o[1],i+=u.text.length,tO.has(u.text)){u.type="KEYWORD";continue}if(u.text.match(mv)){u.type="TYPE";continue}u.type="ID";continue}if(o=a.match(sO),o){u.text=o[1],u.type="NUMBER",i+=u.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(a[0])} at position ${i}`)}return new Fr(e.map(a=>Object.freeze(a)))}function tm(n,e){let t=[];for(const r in e.keys())n.has(r)&&t.push(r);if(t.length>1)throw new Error(`conflicting types: ${t.join(", ")}`)}function Oh(n,e){if(e.peekKeyword(bv)){const t=e.pop().text;if(t!==n)throw new Error(`expected ${n}, got ${t}`)}return e.popType("ID")}function Zs(n,e){const t=new Set;for(;;){const r=n.peekType("KEYWORD");if(r==null||e&&!e.has(r))break;if(n.pop(),t.has(r))throw new Error(`duplicate keywords: ${JSON.stringify(r)}`);t.add(r)}return Object.freeze(t)}function xv(n){let e=Zs(n,YT);return tm(e,sn("constant payable nonpayable".split(" "))),tm(e,sn("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 Ws(n,e){return n.popParams().map(t=>Ut.from(t,e))}function wv(n){if(n.peekType("AT")){if(n.pop(),n.peekType("NUMBER"))return ri(n.pop().text);throw new Error("invalid gas")}return null}function Ra(n){if(n.length)throw new Error(`unexpected tokens at offset ${n.offset}: ${n.toString()}`)}const aO=new RegExp(/^(.*)\[([0-9]*)\]$/);function nm(n){const e=n.match(mv);if(fe(e,"invalid type","type",n),n==="uint")return"uint256";if(n==="int")return"int256";if(e[2]){const t=parseInt(e[2]);fe(t!==0&&t<=32,"invalid bytes length","type",n)}else if(e[3]){const t=parseInt(e[3]);fe(t!==0&&t<=256&&t%8===0,"invalid numeric width","type",n)}return n}const gt={},vn=Symbol.for("_ethers_internal"),rm="_ParamTypeInternal",sm="_ErrorInternal",im="_EventInternal",am="_ConstructorInternal",om="_FallbackInternal",cm="_FunctionInternal",um="_StructInternal";var uc,s1;const Zn=class Zn{constructor(e,t,r,s,i,a,o,u){$(this,uc);R(this,"name");R(this,"type");R(this,"baseType");R(this,"indexed");R(this,"components");R(this,"arrayLength");R(this,"arrayChildren");if(lb(e,gt,"ParamType"),Object.defineProperty(this,vn,{value:rm}),a&&(a=Object.freeze(a.slice())),s==="array"){if(o==null||u==null)throw new Error("")}else if(o!=null||u!=null)throw new Error("");if(s==="tuple"){if(a==null)throw new Error("")}else if(a!=null)throw new Error("");Ge(this,{name:t,type:r,baseType:s,indexed:i,components:a,arrayLength:o,arrayChildren:u})}format(e){if(e==null&&(e="sighash"),e==="json"){const r=this.name||"";if(this.isArray()){const i=JSON.parse(this.arrayChildren.format("json"));return i.name=r,i.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(i)}const s={type:this.baseType==="tuple"?"tuple":this.type,name:r};return typeof this.indexed=="boolean"&&(s.indexed=this.indexed),this.isTuple()&&(s.components=this.components.map(i=>JSON.parse(i.format(e)))),JSON.stringify(s)}let t="";return this.isArray()?(t+=this.arrayChildren.format(e),t+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?t+="("+this.components.map(r=>r.format(e)).join(e==="full"?", ":",")+")":t+=this.type,e!=="sighash"&&(this.indexed===!0&&(t+=" indexed"),e==="full"&&this.name&&(t+=" "+this.name)),t}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,t){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(s=>r.arrayChildren.walk(s,t))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const r=this;return e.map((s,i)=>r.components[i].walk(s,t))}return t(this.type,e)}async walkAsync(e,t){const r=[],s=[e];return Q(this,uc,s1).call(this,r,e,t,i=>{s[0]=i}),r.length&&await Promise.all(r),s[0]}static from(e,t){if(Zn.isParamType(e))return e;if(typeof e=="string")try{return Zn.from(i0(e),t)}catch{fe(!1,"invalid param type","obj",e)}else if(e instanceof Fr){let o="",u="",c=null;Zs(e,sn(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(u="tuple",c=e.popParams().map(b=>Zn.from(b)),o=`tuple(${c.map(b=>b.format()).join(",")})`):(o=nm(e.popType("TYPE")),u=o);let l=null,d=null;for(;e.length&&e.peekType("BRACKET");){const b=e.pop();l=new Zn(gt,"",o,u,null,c,d,l),d=b.value,o+=b.text,u="array",c=null}let f=null;if(Zs(e,ZT).has("indexed")){if(!t)throw new Error("");f=!0}const p=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new Zn(gt,p,o,u,f,c,d,l)}const r=e.name;fe(!r||typeof r=="string"&&r.match(yv),"invalid name","obj.name",r);let s=e.indexed;s!=null&&(fe(t,"parameter cannot be indexed","obj.indexed",e.indexed),s=!!s);let i=e.type,a=i.match(aO);if(a){const o=parseInt(a[2]||"-1"),u=Zn.from({type:a[1],components:e.components});return new Zn(gt,r||"",i,"array",s,null,o,u)}if(i==="tuple"||i.startsWith("tuple(")||i.startsWith("(")){const o=e.components!=null?e.components.map(c=>Zn.from(c)):null;return new Zn(gt,r||"",i,"tuple",s,o,null,null)}return i=nm(e.type),new Zn(gt,r||"",i,i,s,null,null,null)}static isParamType(e){return e&&e[vn]===rm}};uc=new WeakSet,s1=function(e,t,r,s){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(this.arrayLength!==-1&&t.length!==this.arrayLength)throw new Error("array is wrong length");const a=this.arrayChildren,o=t.slice();o.forEach((u,c)=>{var l;Q(l=a,uc,s1).call(l,e,u,r,d=>{o[c]=d})}),s(o);return}if(this.isTuple()){const a=this.components;let o;if(Array.isArray(t))o=t.slice();else{if(t==null||typeof t!="object")throw new Error("invalid tuple value");o=a.map(u=>{if(!u.name)throw new Error("cannot use object value with unnamed components");if(!(u.name in t))throw new Error(`missing value for component ${u.name}`);return t[u.name]})}if(o.length!==this.components.length)throw new Error("array is wrong length");o.forEach((u,c)=>{var l;Q(l=a[c],uc,s1).call(l,e,u,r,d=>{o[c]=d})}),s(o);return}const i=r(this.type,t);i.then?e.push(async function(){s(await i)}()):s(i)};let Ut=Zn;class Ta{constructor(e,t,r){R(this,"type");R(this,"inputs");lb(e,gt,"Fragment"),r=Object.freeze(r.slice()),Ge(this,{type:t,inputs:r})}static from(e){if(typeof e=="string"){try{Ta.from(JSON.parse(e))}catch{}return Ta.from(i0(e))}if(e instanceof Fr)switch(e.peekKeyword(bv)){case"constructor":return Hs.from(e);case"error":return pn.from(e);case"event":return ts.from(e);case"fallback":case"receive":return Es.from(e);case"function":return ns.from(e);case"struct":return ba.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return Hs.from(e);case"error":return pn.from(e);case"event":return ts.from(e);case"fallback":case"receive":return Es.from(e);case"function":return ns.from(e);case"struct":return ba.from(e)}Le(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}fe(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return Hs.isFragment(e)}static isError(e){return pn.isFragment(e)}static isEvent(e){return ts.isFragment(e)}static isFunction(e){return ns.isFragment(e)}static isStruct(e){return ba.isFragment(e)}}class Nh extends Ta{constructor(t,r,s,i){super(t,r,i);R(this,"name");fe(typeof s=="string"&&s.match(yv),"invalid identifier","name",s),i=Object.freeze(i.slice()),Ge(this,{name:s})}}function Vl(n,e){return"("+e.map(t=>t.format(n)).join(n==="full"?", ":",")+")"}class pn extends Nh{constructor(e,t,r){super(e,"error",t,r),Object.defineProperty(this,vn,{value:sm})}get selector(){return Kl(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 t=[];return e!=="sighash"&&t.push("error"),t.push(this.name+Vl(e,this.inputs)),t.join(" ")}static from(e){if(pn.isFragment(e))return e;if(typeof e=="string")return pn.from(i0(e));if(e instanceof Fr){const t=Oh("error",e),r=Ws(e);return Ra(e),new pn(gt,t,r)}return new pn(gt,e.name,e.inputs?e.inputs.map(Ut.from):[])}static isFragment(e){return e&&e[vn]===sm}}class ts extends Nh{constructor(t,r,s,i){super(t,"event",r,s);R(this,"anonymous");Object.defineProperty(this,vn,{value:im}),Ge(this,{anonymous:i})}get topicHash(){return Kl(this.format("sighash"))}format(t){if(t==null&&(t="sighash"),t==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(s=>JSON.parse(s.format(t)))});const r=[];return t!=="sighash"&&r.push("event"),r.push(this.name+Vl(t,this.inputs)),t!=="sighash"&&this.anonymous&&r.push("anonymous"),r.join(" ")}static getTopicHash(t,r){return r=(r||[]).map(i=>Ut.from(i)),new ts(gt,t,r,!1).topicHash}static from(t){if(ts.isFragment(t))return t;if(typeof t=="string")try{return ts.from(i0(t))}catch{fe(!1,"invalid event fragment","obj",t)}else if(t instanceof Fr){const r=Oh("event",t),s=Ws(t,!0),i=!!Zs(t,sn(["anonymous"])).has("anonymous");return Ra(t),new ts(gt,r,s,i)}return new ts(gt,t.name,t.inputs?t.inputs.map(r=>Ut.from(r,!0)):[],!!t.anonymous)}static isFragment(t){return t&&t[vn]===im}}class Hs extends Ta{constructor(t,r,s,i,a){super(t,r,s);R(this,"payable");R(this,"gas");Object.defineProperty(this,vn,{value:am}),Ge(this,{payable:i,gas:a})}format(t){if(Le(t!=null&&t!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),t==="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(s=>JSON.parse(s.format(t)))});const r=[`constructor${Vl(t,this.inputs)}`];return this.payable&&r.push("payable"),this.gas!=null&&r.push(`@${this.gas.toString()}`),r.join(" ")}static from(t){if(Hs.isFragment(t))return t;if(typeof t=="string")try{return Hs.from(i0(t))}catch{fe(!1,"invalid constuctor fragment","obj",t)}else if(t instanceof Fr){Zs(t,sn(["constructor"]));const r=Ws(t),s=!!Zs(t,QT).has("payable"),i=wv(t);return Ra(t),new Hs(gt,"constructor",r,s,i)}return new Hs(gt,"constructor",t.inputs?t.inputs.map(Ut.from):[],!!t.payable,t.gas!=null?t.gas:null)}static isFragment(t){return t&&t[vn]===am}}class Es extends Ta{constructor(t,r,s){super(t,"fallback",r);R(this,"payable");Object.defineProperty(this,vn,{value:om}),Ge(this,{payable:s})}format(t){const r=this.inputs.length===0?"receive":"fallback";if(t==="json"){const s=this.payable?"payable":"nonpayable";return JSON.stringify({type:r,stateMutability:s})}return`${r}()${this.payable?" payable":""}`}static from(t){if(Es.isFragment(t))return t;if(typeof t=="string")try{return Es.from(i0(t))}catch{fe(!1,"invalid fallback fragment","obj",t)}else if(t instanceof Fr){const r=t.toString(),s=t.peekKeyword(sn(["fallback","receive"]));if(fe(s,"type must be fallback or receive","obj",r),t.popKeyword(sn(["fallback","receive"]))==="receive"){const u=Ws(t);return fe(u.length===0,"receive cannot have arguments","obj.inputs",u),Zs(t,sn(["payable"])),Ra(t),new Es(gt,[],!0)}let a=Ws(t);a.length?fe(a.length===1&&a[0].type==="bytes","invalid fallback inputs","obj.inputs",a.map(u=>u.format("minimal")).join(", ")):a=[Ut.from("bytes")];const o=xv(t);if(fe(o==="nonpayable"||o==="payable","fallback cannot be constants","obj.stateMutability",o),Zs(t,sn(["returns"])).has("returns")){const u=Ws(t);fe(u.length===1&&u[0].type==="bytes","invalid fallback outputs","obj.outputs",u.map(c=>c.format("minimal")).join(", "))}return Ra(t),new Es(gt,a,o==="payable")}if(t.type==="receive")return new Es(gt,[],!0);if(t.type==="fallback"){const r=[Ut.from("bytes")],s=t.stateMutability==="payable";return new Es(gt,r,s)}fe(!1,"invalid fallback description","obj",t)}static isFragment(t){return t&&t[vn]===om}}class ns extends Nh{constructor(t,r,s,i,a,o){super(t,"function",r,i);R(this,"constant");R(this,"outputs");R(this,"stateMutability");R(this,"payable");R(this,"gas");Object.defineProperty(this,vn,{value:cm}),a=Object.freeze(a.slice()),Ge(this,{constant:s==="view"||s==="pure",gas:o,outputs:a,payable:s==="payable",stateMutability:s})}get selector(){return Kl(this.format("sighash")).substring(0,10)}format(t){if(t==null&&(t="sighash"),t==="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(s=>JSON.parse(s.format(t))),outputs:this.outputs.map(s=>JSON.parse(s.format(t)))});const r=[];return t!=="sighash"&&r.push("function"),r.push(this.name+Vl(t,this.inputs)),t!=="sighash"&&(this.stateMutability!=="nonpayable"&&r.push(this.stateMutability),this.outputs&&this.outputs.length&&(r.push("returns"),r.push(Vl(t,this.outputs))),this.gas!=null&&r.push(`@${this.gas.toString()}`)),r.join(" ")}static getSelector(t,r){return r=(r||[]).map(i=>Ut.from(i)),new ns(gt,t,"view",r,[],null).selector}static from(t){if(ns.isFragment(t))return t;if(typeof t=="string")try{return ns.from(i0(t))}catch{fe(!1,"invalid function fragment","obj",t)}else if(t instanceof Fr){const s=Oh("function",t),i=Ws(t),a=xv(t);let o=[];Zs(t,sn(["returns"])).has("returns")&&(o=Ws(t));const u=wv(t);return Ra(t),new ns(gt,s,a,i,o,u)}let r=t.stateMutability;return r==null&&(r="payable",typeof t.constant=="boolean"?(r="view",t.constant||(r="payable",typeof t.payable=="boolean"&&!t.payable&&(r="nonpayable"))):typeof t.payable=="boolean"&&!t.payable&&(r="nonpayable")),new ns(gt,t.name,r,t.inputs?t.inputs.map(Ut.from):[],t.outputs?t.outputs.map(Ut.from):[],t.gas!=null?t.gas:null)}static isFragment(t){return t&&t[vn]===cm}}class ba extends Nh{constructor(e,t,r){super(e,"struct",t,r),Object.defineProperty(this,vn,{value:um})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return ba.from(i0(e))}catch{fe(!1,"invalid struct fragment","obj",e)}else if(e instanceof Fr){const t=Oh("struct",e),r=Ws(e);return Ra(e),new ba(gt,t,r)}return new ba(gt,e.name,e.inputs?e.inputs.map(Ut.from):[])}static isFragment(e){return e&&e[vn]===um}}const Dr=new Map;Dr.set(0,"GENERIC_PANIC");Dr.set(1,"ASSERT_FALSE");Dr.set(17,"OVERFLOW");Dr.set(18,"DIVIDE_BY_ZERO");Dr.set(33,"ENUM_RANGE_ERROR");Dr.set(34,"BAD_STORAGE_DATA");Dr.set(49,"STACK_UNDERFLOW");Dr.set(50,"ARRAY_RANGE_ERROR");Dr.set(65,"OUT_OF_MEMORY");Dr.set(81,"UNINITIALIZED_FUNCTION_CALL");const oO=new RegExp(/^bytes([0-9]*)$/),cO=new RegExp(/^(u?int)([0-9]*)$/);let D6=null,lm=1024;function uO(n,e,t,r){let s="missing revert data",i=null;const a=null;let o=null;if(t){s="execution reverted";const c=lr(t);if(t=vt(t),c.length===0)s+=" (no data present; likely require(false) occurred",i="require(false)";else if(c.length%32!==4)s+=" (could not decode reason; invalid data length)";else if(vt(c.slice(0,4))==="0x08c379a0")try{i=r.decode(["string"],c.slice(4))[0],o={signature:"Error(string)",name:"Error",args:[i]},s+=`: ${JSON.stringify(i)}`}catch{s+=" (could not decode reason; invalid string data)"}else if(vt(c.slice(0,4))==="0x4e487b71")try{const l=Number(r.decode(["uint256"],c.slice(4))[0]);o={signature:"Panic(uint256)",name:"Panic",args:[l]},i=`Panic due to ${Dr.get(l)||"UNKNOWN"}(${l})`,s+=`: ${i}`}catch{s+=" (could not decode panic code)"}else s+=" (unknown custom error)"}const u={to:e.to?Ys(e.to):null,data:e.data||"0x"};return e.from&&(u.from=Ys(e.from)),zl(s,"CALL_EXCEPTION",{action:n,data:t,reason:i,transaction:u,invocation:a,revert:o})}var ji,to;const uh=class uh{constructor(){$(this,ji)}getDefaultValue(e){const t=e.map(s=>Q(this,ji,to).call(this,Ut.from(s)));return new Ad(t,"_").defaultValue()}encode(e,t){K9(t.length,e.length,"types/values length mismatch");const r=e.map(a=>Q(this,ji,to).call(this,Ut.from(a))),s=new Ad(r,"_"),i=new zp;return s.encode(i,t),i.data}decode(e,t,r){const s=e.map(a=>Q(this,ji,to).call(this,Ut.from(a)));return new Ad(s,"_").decode(new Wp(t,r,lm))}static _setDefaultMaxInflation(e){fe(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),lm=e}static defaultAbiCoder(){return D6==null&&(D6=new uh),D6}static getBuiltinCallException(e,t,r){return uO(e,t,r,uh.defaultAbiCoder())}};ji=new WeakSet,to=function(e){if(e.isArray())return new LT(Q(this,ji,to).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new Ad(e.components.map(r=>Q(this,ji,to).call(this,r)),e.name);switch(e.baseType){case"address":return new FT(e.name);case"bool":return new DT(e.name);case"string":return new VT(e.name);case"bytes":return new MT(e.name);case"":return new HT(e.name)}let t=e.type.match(cO);if(t){let r=parseInt(t[2]||"256");return fe(r!==0&&r<=256&&r%8===0,"invalid "+t[1]+" bit length","param",e),new KT(r/8,t[1]==="int",e.name)}if(t=e.type.match(oO),t){let r=parseInt(t[1]);return fe(r!==0&&r<=32,"invalid bytes length","param",e),new jT(r,e.name)}fe(!1,"invalid type","type",e.type)};let J1=uh;class lO{constructor(e,t,r){R(this,"fragment");R(this,"name");R(this,"signature");R(this,"topic");R(this,"args");const s=e.name,i=e.format();Ge(this,{fragment:e,name:s,signature:i,topic:t,args:r})}}class fO{constructor(e,t,r,s){R(this,"fragment");R(this,"name");R(this,"args");R(this,"signature");R(this,"selector");R(this,"value");const i=e.name,a=e.format();Ge(this,{fragment:e,name:i,args:r,signature:a,selector:t,value:s})}}class dO{constructor(e,t,r){R(this,"fragment");R(this,"name");R(this,"args");R(this,"signature");R(this,"selector");const s=e.name,i=e.format();Ge(this,{fragment:e,name:s,args:r,signature:i,selector:t})}}class fm{constructor(e){R(this,"hash");R(this,"_isIndexed");Ge(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const dm={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"},hm={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:n=>`reverted with reason string ${JSON.stringify(n)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:n=>{let e="unknown panic code";return n>=0&&n<=255&&dm[n.toString()]&&(e=dm[n.toString()]),`reverted with panic code 0x${n.toString(16)} (${e})`}}};var Yr,Zr,Xr,zt,lc,i1,fc,a1;const M0=class M0{constructor(e){$(this,lc);$(this,fc);R(this,"fragments");R(this,"deploy");R(this,"fallback");R(this,"receive");$(this,Yr,void 0);$(this,Zr,void 0);$(this,Xr,void 0);$(this,zt,void 0);let t=[];typeof e=="string"?t=JSON.parse(e):t=e,k(this,Xr,new Map),k(this,Yr,new Map),k(this,Zr,new Map);const r=[];for(const a of t)try{r.push(Ta.from(a))}catch(o){console.log(`[Warning] Invalid Fragment ${JSON.stringify(a)}:`,o.message)}Ge(this,{fragments:Object.freeze(r)});let s=null,i=!1;k(this,zt,this.getAbiCoder()),this.fragments.forEach((a,o)=>{let u;switch(a.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Ge(this,{deploy:a});return;case"fallback":a.inputs.length===0?i=!0:(fe(!s||a.payable!==s.payable,"conflicting fallback fragments",`fragments[${o}]`,a),s=a,i=s.payable);return;case"function":u=g(this,Xr);break;case"event":u=g(this,Zr);break;case"error":u=g(this,Yr);break;default:return}const c=a.format();u.has(c)||u.set(c,a)}),this.deploy||Ge(this,{deploy:Hs.from("constructor()")}),Ge(this,{fallback:s,receive:i})}format(e){const t=e?"minimal":"full";return this.fragments.map(s=>s.format(t))}formatJson(){const e=this.fragments.map(t=>t.format("json"));return JSON.stringify(e.map(t=>JSON.parse(t)))}getAbiCoder(){return J1.defaultAbiCoder()}getFunctionName(e){const t=Q(this,lc,i1).call(this,e,null,!1);return fe(t,"no matching function","key",e),t.name}hasFunction(e){return!!Q(this,lc,i1).call(this,e,null,!1)}getFunction(e,t){return Q(this,lc,i1).call(this,e,t||null,!0)}forEachFunction(e){const t=Array.from(g(this,Xr).keys());t.sort((r,s)=>r.localeCompare(s));for(let r=0;rr.localeCompare(s));for(let r=0;r1){const i=s.map(a=>JSON.stringify(a.format())).join(", ");fe(!1,`ambiguous error description (i.e. ${i})`,"name",e)}return s[0]}if(e=pn.from(e).format(),e==="Error(string)")return pn.from("error Error(string)");if(e==="Panic(uint256)")return pn.from("error Panic(uint256)");const r=g(this,Yr).get(e);return r||null}forEachError(e){const t=Array.from(g(this,Yr).keys());t.sort((r,s)=>r.localeCompare(s));for(let r=0;ri.type==="string"?Kl(a):i.type==="bytes"?Qs(vt(a)):(i.type==="bool"&&typeof a=="boolean"?a=a?"0x01":"0x00":i.type.match(/^u?int/)?a=Q9(a):i.type.match(/^bytes/)?a=KR(a,32):i.type==="address"&&g(this,zt).encode(["address"],[a]),WR(vt(a),32));for(t.forEach((i,a)=>{const o=e.inputs[a];if(!o.indexed){fe(i==null,"cannot filter non-indexed parameters; must be null","contract."+o.name,i);return}i==null?r.push(null):o.baseType==="array"||o.baseType==="tuple"?fe(!1,"filtering with tuples or arrays not supported","contract."+o.name,i):Array.isArray(i)?r.push(i.map(u=>s(o,u))):r.push(s(o,i))});r.length&&r[r.length-1]===null;)r.pop();return r}encodeEventLog(e,t){if(typeof e=="string"){const a=this.getEvent(e);fe(a,"unknown event","eventFragment",e),e=a}const r=[],s=[],i=[];return e.anonymous||r.push(e.topicHash),fe(t.length===e.inputs.length,"event arguments/values mismatch","values",t),e.inputs.forEach((a,o)=>{const u=t[o];if(a.indexed)if(a.type==="string")r.push(Kl(u));else if(a.type==="bytes")r.push(Qs(u));else{if(a.baseType==="tuple"||a.baseType==="array")throw new Error("not implemented");r.push(g(this,zt).encode([a.type],[u]))}else s.push(a),i.push(u)}),{data:g(this,zt).encode(s,i),topics:r}}decodeEventLog(e,t,r){if(typeof e=="string"){const h=this.getEvent(e);fe(h,"unknown event","eventFragment",e),e=h}if(r!=null&&!e.anonymous){const h=e.topicHash;fe($s(r[0],32)&&r[0].toLowerCase()===h,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}const s=[],i=[],a=[];e.inputs.forEach((h,p)=>{h.indexed?h.type==="string"||h.type==="bytes"||h.baseType==="tuple"||h.baseType==="array"?(s.push(Ut.from({type:"bytes32",name:h.name})),a.push(!0)):(s.push(h),a.push(!1)):(i.push(h),a.push(!1))});const o=r!=null?g(this,zt).decode(s,pa(r)):null,u=g(this,zt).decode(i,t,!0),c=[],l=[];let d=0,f=0;return e.inputs.forEach((h,p)=>{let b=null;if(h.indexed)if(o==null)b=new fm(null);else if(a[p])b=new fm(o[f++]);else try{b=o[f++]}catch(v){b=v}else try{b=u[d++]}catch(v){b=v}c.push(b),l.push(h.name||null)}),q1.fromItems(c,l)}parseTransaction(e){const t=lr(e.data,"tx.data"),r=ri(e.value!=null?e.value:0,"tx.value"),s=this.getFunction(vt(t.slice(0,4)));if(!s)return null;const i=g(this,zt).decode(s.inputs,t.slice(4));return new fO(s,s.selector,i,r)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new lO(t,t.topicHash,this.decodeEventLog(t,e.data,e.topics))}parseError(e){const t=vt(e),r=this.getError(I0(t,0,4));if(!r)return null;const s=g(this,zt).decode(r.inputs,I0(t,4));return new dO(r,r.selector,s)}static from(e){return e instanceof M0?e:typeof e=="string"?new M0(JSON.parse(e)):typeof e.formatJson=="function"?new M0(e.formatJson()):typeof e.format=="function"?new M0(e.format("json")):new M0(e)}};Yr=new WeakMap,Zr=new WeakMap,Xr=new WeakMap,zt=new WeakMap,lc=new WeakSet,i1=function(e,t,r){if($s(e)){const i=e.toLowerCase();for(const a of g(this,Xr).values())if(i===a.selector)return a;return null}if(e.indexOf("(")===-1){const i=[];for(const[a,o]of g(this,Xr))a.split("(")[0]===e&&i.push(o);if(t){const a=t.length>0?t[t.length-1]:null;let o=t.length,u=!0;Qt.isTyped(a)&&a.type==="overrides"&&(u=!1,o--);for(let c=i.length-1;c>=0;c--){const l=i[c].inputs.length;l!==o&&(!u||l!==o-1)&&i.splice(c,1)}for(let c=i.length-1;c>=0;c--){const l=i[c].inputs;for(let d=0;d=l.length){if(t[d].type==="overrides")continue;i.splice(c,1);break}if(t[d].type!==l[d].baseType){i.splice(c,1);break}}}}if(i.length===1&&t&&t.length!==i[0].inputs.length){const a=t[t.length-1];(a==null||Array.isArray(a)||typeof a!="object")&&i.splice(0,1)}if(i.length===0)return null;if(i.length>1&&r){const a=i.map(o=>JSON.stringify(o.format())).join(", ");fe(!1,`ambiguous function description (i.e. matches ${a})`,"key",e)}return i[0]}const s=g(this,Xr).get(ns.from(e).format());return s||null},fc=new WeakSet,a1=function(e,t,r){if($s(e)){const i=e.toLowerCase();for(const a of g(this,Zr).values())if(i===a.topicHash)return a;return null}if(e.indexOf("(")===-1){const i=[];for(const[a,o]of g(this,Zr))a.split("(")[0]===e&&i.push(o);if(t){for(let a=i.length-1;a>=0;a--)i[a].inputs.length=0;a--){const o=i[a].inputs;for(let u=0;u1&&r){const a=i.map(o=>JSON.stringify(o.format())).join(", ");fe(!1,`ambiguous event description (i.e. matches ${a})`,"key",e)}return i[0]}const s=g(this,Zr).get(ts.from(e).format());return s||null};let Xs=M0;const vv=BigInt(0);function rr(n){return n==null?null:n.toString()}function hO(n){const e={};n.to&&(e.to=n.to),n.from&&(e.from=n.from),n.data&&(e.data=vt(n.data));const t="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const s of t)!(s in n)||n[s]==null||(e[s]=ri(n[s],`request.${s}`));const r="type,nonce".split(/,/);for(const s of r)!(s in n)||n[s]==null||(e[s]=si(n[s],`request.${s}`));return n.accessList&&(e.accessList=qT(n.accessList)),"blockTag"in n&&(e.blockTag=n.blockTag),"enableCcipRead"in n&&(e.enableCcipRead=!!n.enableCcipRead),"customData"in n&&(e.customData=n.customData),"blobVersionedHashes"in n&&n.blobVersionedHashes&&(e.blobVersionedHashes=n.blobVersionedHashes.slice()),"kzg"in n&&(e.kzg=n.kzg),"blobs"in n&&n.blobs&&(e.blobs=n.blobs.map(s=>zR(s)?vt(s):Object.assign({},s))),e}class Ih{constructor(e,t){R(this,"provider");R(this,"transactionHash");R(this,"blockHash");R(this,"blockNumber");R(this,"removed");R(this,"address");R(this,"data");R(this,"topics");R(this,"index");R(this,"transactionIndex");this.provider=t;const r=Object.freeze(e.topics.slice());Ge(this,{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,removed:e.removed,address:e.address,data:e.data,topics:r,index:e.index,transactionIndex:e.transactionIndex})}toJSON(){const{address:e,blockHash:t,blockNumber:r,data:s,index:i,removed:a,topics:o,transactionHash:u,transactionIndex:c}=this;return{_type:"log",address:e,blockHash:t,blockNumber:r,data:s,index:i,removed:a,topics:o,transactionHash:u,transactionIndex:c}}async getBlock(){const e=await this.provider.getBlock(this.blockHash);return Le(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransaction(){const e=await this.provider.getTransaction(this.transactionHash);return Le(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransactionReceipt(){const e=await this.provider.getTransactionReceipt(this.transactionHash);return Le(!!e,"failed to find transaction receipt","UNKNOWN_ERROR",{}),e}removedEvent(){return bO(this)}}var _f;class pO{constructor(e,t){R(this,"provider");R(this,"to");R(this,"from");R(this,"contractAddress");R(this,"hash");R(this,"index");R(this,"blockHash");R(this,"blockNumber");R(this,"logsBloom");R(this,"gasUsed");R(this,"blobGasUsed");R(this,"cumulativeGasUsed");R(this,"gasPrice");R(this,"blobGasPrice");R(this,"type");R(this,"status");R(this,"root");$(this,_f,void 0);k(this,_f,Object.freeze(e.logs.map(s=>new Ih(s,t))));let r=vv;e.effectiveGasPrice!=null?r=e.effectiveGasPrice:e.gasPrice!=null&&(r=e.gasPrice),Ge(this,{provider:t,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:r,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return g(this,_f)}toJSON(){const{to:e,from:t,contractAddress:r,hash:s,index:i,blockHash:a,blockNumber:o,logsBloom:u,logs:c,status:l,root:d}=this;return{_type:"TransactionReceipt",blockHash:a,blockNumber:o,contractAddress:r,cumulativeGasUsed:rr(this.cumulativeGasUsed),from:t,gasPrice:rr(this.gasPrice),blobGasUsed:rr(this.blobGasUsed),blobGasPrice:rr(this.blobGasPrice),gasUsed:rr(this.gasUsed),hash:s,index:i,logs:c,logsBloom:u,root:d,status:l,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e{if(o)return null;const{blockNumber:f,nonce:h}=await Hp({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(h{if(f==null||f.status!==0)return f;Le(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:f.to,from:f.from,data:""},receipt:f})},l=await this.provider.getTransactionReceipt(this.hash);if(r===0)return c(l);if(l){if(await l.confirmations()>=r)return c(l)}else if(await u(),r===0)return null;return await new Promise((f,h)=>{const p=[],b=()=>{p.forEach(w=>w())};if(p.push(()=>{o=!0}),s>0){const w=setTimeout(()=>{b(),h(zl("wait for transaction timeout","TIMEOUT"))},s);p.push(()=>{clearTimeout(w)})}const v=async w=>{if(await w.confirmations()>=r){b();try{f(c(w))}catch(m){h(m)}}};if(p.push(()=>{this.provider.off(this.hash,v)}),this.provider.on(this.hash,v),i>=0){const w=async()=>{try{await u()}catch(m){if(vc(m,"TRANSACTION_REPLACED")){b(),h(m);return}}o||this.provider.once("block",w)};p.push(()=>{this.provider.off("block",w)}),this.provider.once("block",w)}})}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 Le(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Ev(this)}reorderedEvent(e){return Le(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Le(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Av(this,e)}replaceableTransaction(e){fe(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const t=new ng(this,this.provider);return k(t,$i,e),t}};$i=new WeakMap;let qp=ng;function Av(n,e){return{orphan:"reorder-transaction",tx:n,other:e}}function Ev(n){return{orphan:"drop-transaction",tx:n}}function bO(n){return{orphan:"drop-log",log:{transactionHash:n.transactionHash,blockHash:n.blockHash,blockNumber:n.blockNumber,address:n.address,data:n.data,topics:Object.freeze(n.topics.slice()),index:n.index}}}class hb extends Ih{constructor(t,r,s){super(t,t.provider);R(this,"interface");R(this,"fragment");R(this,"args");const i=r.decodeEventLog(s,t.data,t.topics);Ge(this,{args:i,fragment:s,interface:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class _v extends Ih{constructor(t,r){super(t,t.provider);R(this,"error");Ge(this,{error:r})}}var dc;class gO extends pO{constructor(t,r,s){super(s,r);$(this,dc,void 0);k(this,dc,t)}get logs(){return super.logs.map(t=>{const r=t.topics.length?g(this,dc).getEvent(t.topics[0]):null;if(r)try{return new hb(t,g(this,dc),r)}catch(s){return new _v(t,s)}return t})}}dc=new WeakMap;var Pf;class pb extends qp{constructor(t,r,s){super(s,r);$(this,Pf,void 0);k(this,Pf,t)}async wait(t,r){const s=await super.wait(t,r);return s==null?null:new gO(g(this,Pf),this.provider,s)}}Pf=new WeakMap;class Pv extends YR{constructor(t,r,s,i){super(t,r,s);R(this,"log");Ge(this,{log:i})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class yO extends Pv{constructor(e,t,r,s,i){super(e,t,r,new hb(i,e.interface,s));const a=e.interface.decodeEventLog(s,this.log.data,this.log.topics);Ge(this,{args:a,fragment:s})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const pm=BigInt(0);function kv(n){return n&&typeof n.call=="function"}function Cv(n){return n&&typeof n.estimateGas=="function"}function Bh(n){return n&&typeof n.resolveName=="function"}function Sv(n){return n&&typeof n.sendTransaction=="function"}function Rv(n){if(n!=null){if(Bh(n))return n;if(n.provider)return n.provider}}var kf;class mO{constructor(e,t,r){$(this,kf,void 0);R(this,"fragment");if(Ge(this,{fragment:t}),t.inputs.lengthr[u]==null?null:o.walkAsync(r[u],(l,d)=>l==="address"?Array.isArray(d)?Promise.all(d.map(f=>Wl(f,i))):Wl(d,i):d)));return e.interface.encodeFilterTopics(t,a)}())}getTopicFilter(){return g(this,kf)}}kf=new WeakMap;function Oa(n,e){return n==null?null:typeof n[e]=="function"?n:n.provider&&typeof n.provider[e]=="function"?n.provider:null}function $0(n){return n==null?null:n.provider||null}async function bb(n,e){const t=Qt.dereference(n,"overrides");fe(typeof t=="object","invalid overrides parameter","overrides",n);const r=hO(t);return fe(r.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),fe(r.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=r.from),r}async function Tv(n,e,t){const r=Oa(n,"resolveName"),s=Bh(r)?r:null;return await Promise.all(e.map((i,a)=>i.walkAsync(t[a],(o,u)=>(u=Qt.dereference(u,o),o==="address"?Wl(u,s):u))))}function xO(n){const e=async function(a){const o=await bb(a,["data"]);o.to=await n.getAddress(),o.from&&(o.from=await Wl(o.from,Rv(n.runner)));const u=n.interface,c=ri(o.value||pm,"overrides.value")===pm,l=(o.data||"0x")==="0x";u.fallback&&!u.fallback.payable&&u.receive&&!l&&!c&&fe(!1,"cannot send data to receive or send value to non-payable fallback","overrides",a),fe(u.fallback||l,"cannot send data to receive-only contract","overrides.data",o.data);const d=u.receive||u.fallback&&u.fallback.payable;return fe(d||c,"cannot send value to non-payable fallback","overrides.value",o.value),fe(u.fallback||l,"cannot send data to receive-only contract","overrides.data",o.data),o},t=async function(a){const o=Oa(n.runner,"call");Le(kv(o),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const u=await e(a);try{return await o.call(u)}catch(c){throw W9(c)&&c.data?n.interface.makeError(c.data,u):c}},r=async function(a){const o=n.runner;Le(Sv(o),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const u=await o.sendTransaction(await e(a)),c=$0(n.runner);return new pb(n.interface,c,u)},s=async function(a){const o=Oa(n.runner,"estimateGas");return Le(Cv(o),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await o.estimateGas(await e(a))},i=async a=>await r(a);return Ge(i,{_contract:n,estimateGas:s,populateTransaction:e,send:r,staticCall:t}),i}function wO(n,e){const t=function(...c){const l=n.interface.getFunction(e,c);return Le(l,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:c}}),l},r=async function(...c){const l=t(...c);let d={};if(l.inputs.length+1===c.length&&(d=await bb(c.pop()),d.from&&(d.from=await Wl(d.from,Rv(n.runner)))),l.inputs.length!==c.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const f=await Tv(n.runner,l.inputs,c);return Object.assign({},d,await Hp({to:n.getAddress(),data:n.interface.encodeFunctionData(l,f)}))},s=async function(...c){const l=await o(...c);return l.length===1?l[0]:l},i=async function(...c){const l=n.runner;Le(Sv(l),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const d=await l.sendTransaction(await r(...c)),f=$0(n.runner);return new pb(n.interface,f,d)},a=async function(...c){const l=Oa(n.runner,"estimateGas");return Le(Cv(l),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await l.estimateGas(await r(...c))},o=async function(...c){const l=Oa(n.runner,"call");Le(kv(l),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const d=await r(...c);let f="0x";try{f=await l.call(d)}catch(p){throw W9(p)&&p.data?n.interface.makeError(p.data,d):p}const h=t(...c);return n.interface.decodeFunctionResult(h,f)},u=async(...c)=>t(...c).constant?await s(...c):await i(...c);return Ge(u,{name:n.interface.getFunctionName(e),_contract:n,_key:e,getFragment:t,estimateGas:a,populateTransaction:r,send:i,staticCall:s,staticCallResult:o}),Object.defineProperty(u,"fragment",{configurable:!1,enumerable:!0,get:()=>{const c=n.interface.getFunction(e);return Le(c,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),c}}),u}function vO(n,e){const t=function(...s){const i=n.interface.getEvent(e,s);return Le(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:s}}),i},r=function(...s){return new mO(n,t(...s),s)};return Ge(r,{name:n.interface.getEventName(e),_contract:n,_key:e,getFragment:t}),Object.defineProperty(r,"fragment",{configurable:!1,enumerable:!0,get:()=>{const s=n.interface.getEvent(e);return Le(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),s}}),r}const Q1=Symbol.for("_ethersInternal_contract"),Ov=new WeakMap;function AO(n,e){Ov.set(n[Q1],e)}function In(n){return Ov.get(n[Q1])}function EO(n){return n&&typeof n=="object"&&"getTopicFilter"in n&&typeof n.getTopicFilter=="function"&&n.fragment}async function gb(n,e){let t,r=null;if(Array.isArray(e)){const i=function(a){if($s(a,32))return a;const o=n.interface.getEvent(a);return fe(o,"unknown fragment","name",a),o.topicHash};t=e.map(a=>a==null?null:Array.isArray(a)?a.map(i):i(a))}else e==="*"?t=[null]:typeof e=="string"?$s(e,32)?t=[e]:(r=n.interface.getEvent(e),fe(r,"unknown fragment","event",e),t=[r.topicHash]):EO(e)?t=await e.getTopicFilter():"fragment"in e?(r=e.fragment,t=[r.topicHash]):fe(!1,"unknown event name","event",e);t=t.map(i=>{if(i==null)return null;if(Array.isArray(i)){const a=Array.from(new Set(i.map(o=>o.toLowerCase())).values());return a.length===1?a[0]:(a.sort(),a)}return i.toLowerCase()});const s=t.map(i=>i==null?"null":Array.isArray(i)?i.join("|"):i).join("&");return{fragment:r,tag:s,topics:t}}async function xl(n,e){const{subs:t}=In(n);return t.get((await gb(n,e)).tag)||null}async function bm(n,e,t){const r=$0(n.runner);Le(r,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:s,tag:i,topics:a}=await gb(n,t),{addr:o,subs:u}=In(n);let c=u.get(i);if(!c){const d={address:o||n,topics:a},f=v=>{let w=s;if(w==null)try{w=n.interface.getEvent(v.topics[0])}catch{}if(w){const m=w,x=s?n.interface.decodeEventLog(s,v.data,v.topics):[];Qp(n,t,x,y=>new yO(n,y,t,m,v))}else Qp(n,t,[],m=>new Pv(n,m,t,v))};let h=[];c={tag:i,listeners:[],start:()=>{h.length||h.push(r.on(d,f))},stop:async()=>{if(h.length==0)return;let v=h;h=[],await Promise.all(v),r.off(d,f)}},u.set(i,c)}return c}let Jp=Promise.resolve();async function _O(n,e,t,r){await Jp;const s=await xl(n,e);if(!s)return!1;const i=s.listeners.length;return s.listeners=s.listeners.filter(({listener:a,once:o})=>{const u=Array.from(t);r&&u.push(r(o?null:a));try{a.call(n,...u)}catch{}return!o}),s.listeners.length===0&&(s.stop(),In(n).subs.delete(s.tag)),i>0}async function Qp(n,e,t,r){try{await Jp}catch{}const s=_O(n,e,t,r);return Jp=s,await s}const Ed=["then"];var HD;const Il=class Il{constructor(e,t,r,s){R(this,"target");R(this,"interface");R(this,"runner");R(this,"filters");R(this,HD);R(this,"fallback");fe(typeof e=="string"||uv(e),"invalid value for Contract target","target",e),r==null&&(r=null);const i=Xs.from(t);Ge(this,{target:e,runner:r,interface:i}),Object.defineProperty(this,Q1,{value:{}});let a,o=null,u=null;if(s){const d=$0(r);u=new pb(this.interface,d,s)}let c=new Map;if(typeof e=="string")if($s(e))o=e,a=Promise.resolve(e);else{const d=Oa(r,"resolveName");if(!Bh(d))throw zl("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});a=d.resolveName(e).then(f=>{if(f==null)throw zl("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return In(this).addr=f,f})}else a=e.getAddress().then(d=>{if(d==null)throw new Error("TODO");return In(this).addr=d,d});AO(this,{addrPromise:a,addr:o,deployTx:u,subs:c});const l=new Proxy({},{get:(d,f,h)=>{if(typeof f=="symbol"||Ed.indexOf(f)>=0)return Reflect.get(d,f,h);try{return this.getEvent(f)}catch(p){if(!vc(p,"INVALID_ARGUMENT")||p.argument!=="key")throw p}},has:(d,f)=>Ed.indexOf(f)>=0?Reflect.has(d,f):Reflect.has(d,f)||this.interface.hasEvent(String(f))});return Ge(this,{filters:l}),Ge(this,{fallback:i.receive||i.fallback?xO(this):null}),new Proxy(this,{get:(d,f,h)=>{if(typeof f=="symbol"||f in d||Ed.indexOf(f)>=0)return Reflect.get(d,f,h);try{return d.getFunction(f)}catch(p){if(!vc(p,"INVALID_ARGUMENT")||p.argument!=="key")throw p}},has:(d,f)=>typeof f=="symbol"||f in d||Ed.indexOf(f)>=0?Reflect.has(d,f):d.interface.hasFunction(f)})}connect(e){return new Il(this.target,this.interface,e)}attach(e){return new Il(e,this.interface,this.runner)}async getAddress(){return await In(this).addrPromise}async getDeployedCode(){const e=$0(this.runner);Le(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const t=await e.getCode(await this.getAddress());return t==="0x"?null:t}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const r=$0(this.runner);return Le(r!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((s,i)=>{const a=async()=>{try{if(await this.getDeployedCode()!=null)return s(this);r.once("block",a)}catch(o){i(o)}};a()})}deploymentTransaction(){return In(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),wO(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),vO(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,t,r){t==null&&(t=0),r==null&&(r="latest");const{addr:s,addrPromise:i}=In(this),a=s||await i,{fragment:o,topics:u}=await gb(this,e),c={address:a,topics:u,fromBlock:t,toBlock:r},l=$0(this.runner);return Le(l,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await l.getLogs(c)).map(d=>{let f=o;if(f==null)try{f=this.interface.getEvent(d.topics[0])}catch{}if(f)try{return new hb(d,this.interface,f)}catch(h){return new _v(d,h)}return new Ih(d,l)})}async on(e,t){const r=await bm(this,"on",e);return r.listeners.push({listener:t,once:!1}),r.start(),this}async once(e,t){const r=await bm(this,"once",e);return r.listeners.push({listener:t,once:!0}),r.start(),this}async emit(e,...t){return await Qp(this,e,t,null)}async listenerCount(e){if(e){const s=await xl(this,e);return s?s.listeners.length:0}const{subs:t}=In(this);let r=0;for(const{listeners:s}of t.values())r+=s.length;return r}async listeners(e){if(e){const s=await xl(this,e);return s?s.listeners.map(({listener:i})=>i):[]}const{subs:t}=In(this);let r=[];for(const{listeners:s}of t.values())r=r.concat(s.map(({listener:i})=>i));return r}async off(e,t){const r=await xl(this,e);if(!r)return this;if(t){const s=r.listeners.map(({listener:i})=>i).indexOf(t);s>=0&&r.listeners.splice(s,1)}return(t==null||r.listeners.length===0)&&(r.stop(),In(this).subs.delete(r.tag)),this}async removeAllListeners(e){if(e){const t=await xl(this,e);if(!t)return this;t.stop(),In(this).subs.delete(t.tag)}else{const{subs:t}=In(this);for(const{tag:r,stop:s}of t.values())s(),t.delete(r)}return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return await this.off(e,t)}static buildClass(e){class t extends Il{constructor(s,i=null){super(s,e,i)}}return t}static from(e,t,r){return r==null&&(r=null),new this(e,t,r)}};HD=Q1;let ql=Il;function PO(){return ql}class Uf extends PO(){}class Fa{constructor(e,t,r){R(this,"interface");R(this,"bytecode");R(this,"runner");const s=Xs.from(e);t instanceof Uint8Array||(typeof t=="object"&&(t=t.object),t.startsWith("0x")||(t="0x"+t)),t=vt(lr(t)),Ge(this,{bytecode:t,interface:s,runner:r||null})}attach(e){return new ql(e,this.interface,this.runner)}async getDeployTransaction(...e){let t={};const r=this.interface.deploy;if(r.inputs.length+1===e.length&&(t=await bb(e.pop())),r.inputs.length!==e.length)throw new Error("incorrect number of arguments to constructor");const s=await Tv(this.runner,r.inputs,e),i=pa([this.bytecode,this.interface.encodeDeploy(s)]);return Object.assign({},t,{data:i})}async deploy(...e){const t=await this.getDeployTransaction(...e);Le(this.runner&&typeof this.runner.sendTransaction=="function","factory runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const r=await this.runner.sendTransaction(t),s=BT(r);return new ql(s,this.interface,this.runner,r)}connect(e){return new Fa(this.interface,this.bytecode,e)}static fromSolidity(e,t){fe(e!=null,"bad compiler output","output",e),typeof e=="string"&&(e=JSON.parse(e));const r=e.abi;let s="";return e.bytecode?s=e.bytecode:e.evm&&e.evm.bytecode&&(s=e.evm.bytecode),new this(r,s,t)}}const o1=[{inputs:[{internalType:"string",name:"uri_",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"accounts",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"uri",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}],Nv="0x60806040523480156200001157600080fd5b506040516200162b3803806200162b83398101604081905262000034916200006e565b6200003f8162000046565b506200029e565b6002620000548282620001d2565b5050565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156200008257600080fd5b82516001600160401b03808211156200009a57600080fd5b818501915085601f830112620000af57600080fd5b815181811115620000c457620000c462000058565b604051601f8201601f19908116603f01168101908382118183101715620000ef57620000ef62000058565b8160405282815288868487010111156200010857600080fd5b600093505b828410156200012c57848401860151818501870152928501926200010d565b600086848301015280965050505050505092915050565b600181811c908216806200015857607f821691505b6020821081036200017957634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620001cd57600081815260208120601f850160051c81016020861015620001a85750805b601f850160051c820191505b81811015620001c957828155600101620001b4565b5050505b505050565b81516001600160401b03811115620001ee57620001ee62000058565b6200020681620001ff845462000143565b846200017f565b602080601f8311600181146200023e5760008415620002255750858301515b600019600386901b1c1916600185901b178555620001c9565b600085815260208120601f198616915b828110156200026f578886015182559484019460019091019084016200024e565b50858210156200028e5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61137d80620002ae6000396000f3fe608060405234801561001057600080fd5b50600436106100875760003560e01c80634e1273f41161005b5780634e1273f41461010a578063a22cb4651461012a578063e985e9c51461013d578063f242432a1461017957600080fd5b8062fdd58e1461008c57806301ffc9a7146100b25780630e89341c146100d55780632eb2c2d6146100f5575b600080fd5b61009f61009a366004610b40565b61018c565b6040519081526020015b60405180910390f35b6100c56100c0366004610b83565b610225565b60405190151581526020016100a9565b6100e86100e3366004610ba7565b610275565b6040516100a99190610c06565b610108610103366004610d65565b610309565b005b61011d610118366004610e0f565b610355565b6040516100a99190610f15565b610108610138366004610f28565b61047f565b6100c561014b366004610f64565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b610108610187366004610f97565b61048e565b60006001600160a01b0383166101fc5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b506000818152602081815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216636cdb3d1360e11b148061025657506001600160e01b031982166303a24d0760e21b145b8061021f57506301ffc9a760e01b6001600160e01b031983161461021f565b60606002805461028490610ffc565b80601f01602080910402602001604051908101604052809291908181526020018280546102b090610ffc565b80156102fd5780601f106102d2576101008083540402835291602001916102fd565b820191906000526020600020905b8154815290600101906020018083116102e057829003601f168201915b50505050509050919050565b6001600160a01b0385163314806103255750610325853361014b565b6103415760405162461bcd60e51b81526004016101f390611036565b61034e85858585856104d3565b5050505050565b606081518351146103ba5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016101f3565b6000835167ffffffffffffffff8111156103d6576103d6610c19565b6040519080825280602002602001820160405280156103ff578160200160208202803683370190505b50905060005b84518110156104775761044a85828151811061042357610423611084565b602002602001015185838151811061043d5761043d611084565b602002602001015161018c565b82828151811061045c5761045c611084565b6020908102919091010152610470816110b0565b9050610405565b509392505050565b61048a3383836106b0565b5050565b6001600160a01b0385163314806104aa57506104aa853361014b565b6104c65760405162461bcd60e51b81526004016101f390611036565b61034e8585858585610790565b81518351146105355760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016101f3565b6001600160a01b03841661055b5760405162461bcd60e51b81526004016101f3906110c9565b3360005b845181101561064257600085828151811061057c5761057c611084565b60200260200101519050600085838151811061059a5761059a611084565b602090810291909101810151600084815280835260408082206001600160a01b038e1683529093529190912054909150818110156105ea5760405162461bcd60e51b81526004016101f39061110e565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290610627908490611158565b925050819055505050508061063b906110b0565b905061055f565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161069292919061116b565b60405180910390a46106a88187878787876108ba565b505050505050565b816001600160a01b0316836001600160a01b0316036107235760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016101f3565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0384166107b65760405162461bcd60e51b81526004016101f3906110c9565b3360006107c285610a1e565b905060006107cf85610a1e565b90506000868152602081815260408083206001600160a01b038c168452909152902054858110156108125760405162461bcd60e51b81526004016101f39061110e565b6000878152602081815260408083206001600160a01b038d8116855292528083208985039055908a1682528120805488929061084f908490611158565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46108af848a8a8a8a8a610a69565b505050505050505050565b6001600160a01b0384163b156106a85760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906108fe9089908990889088908890600401611199565b6020604051808303816000875af1925050508015610939575060408051601f3d908101601f19168201909252610936918101906111f7565b60015b6109e557610945611214565b806308c379a00361097e5750610959611230565b806109645750610980565b8060405162461bcd60e51b81526004016101f39190610c06565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016101f3565b6001600160e01b0319811663bc197c8160e01b14610a155760405162461bcd60e51b81526004016101f3906112ba565b50505050505050565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110610a5857610a58611084565b602090810291909101015292915050565b6001600160a01b0384163b156106a85760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190610aad9089908990889088908890600401611302565b6020604051808303816000875af1925050508015610ae8575060408051601f3d908101601f19168201909252610ae5918101906111f7565b60015b610af457610945611214565b6001600160e01b0319811663f23a6e6160e01b14610a155760405162461bcd60e51b81526004016101f3906112ba565b80356001600160a01b0381168114610b3b57600080fd5b919050565b60008060408385031215610b5357600080fd5b610b5c83610b24565b946020939093013593505050565b6001600160e01b031981168114610b8057600080fd5b50565b600060208284031215610b9557600080fd5b8135610ba081610b6a565b9392505050565b600060208284031215610bb957600080fd5b5035919050565b6000815180845260005b81811015610be657602081850181015186830182015201610bca565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000610ba06020830184610bc0565b634e487b7160e01b600052604160045260246000fd5b601f8201601f1916810167ffffffffffffffff81118282101715610c5557610c55610c19565b6040525050565b600067ffffffffffffffff821115610c7657610c76610c19565b5060051b60200190565b600082601f830112610c9157600080fd5b81356020610c9e82610c5c565b604051610cab8282610c2f565b83815260059390931b8501820192828101915086841115610ccb57600080fd5b8286015b84811015610ce65780358352918301918301610ccf565b509695505050505050565b600082601f830112610d0257600080fd5b813567ffffffffffffffff811115610d1c57610d1c610c19565b604051610d33601f8301601f191660200182610c2f565b818152846020838601011115610d4857600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a08688031215610d7d57600080fd5b610d8686610b24565b9450610d9460208701610b24565b9350604086013567ffffffffffffffff80821115610db157600080fd5b610dbd89838a01610c80565b94506060880135915080821115610dd357600080fd5b610ddf89838a01610c80565b93506080880135915080821115610df557600080fd5b50610e0288828901610cf1565b9150509295509295909350565b60008060408385031215610e2257600080fd5b823567ffffffffffffffff80821115610e3a57600080fd5b818501915085601f830112610e4e57600080fd5b81356020610e5b82610c5c565b604051610e688282610c2f565b83815260059390931b8501820192828101915089841115610e8857600080fd5b948201945b83861015610ead57610e9e86610b24565b82529482019490820190610e8d565b96505086013592505080821115610ec357600080fd5b50610ed085828601610c80565b9150509250929050565b600081518084526020808501945080840160005b83811015610f0a57815187529582019590820190600101610eee565b509495945050505050565b602081526000610ba06020830184610eda565b60008060408385031215610f3b57600080fd5b610f4483610b24565b915060208301358015158114610f5957600080fd5b809150509250929050565b60008060408385031215610f7757600080fd5b610f8083610b24565b9150610f8e60208401610b24565b90509250929050565b600080600080600060a08688031215610faf57600080fd5b610fb886610b24565b9450610fc660208701610b24565b93506040860135925060608601359150608086013567ffffffffffffffff811115610ff057600080fd5b610e0288828901610cf1565b600181811c9082168061101057607f821691505b60208210810361103057634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016110c2576110c261109a565b5060010190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b8082018082111561021f5761021f61109a565b60408152600061117e6040830185610eda565b82810360208401526111908185610eda565b95945050505050565b6001600160a01b0386811682528516602082015260a0604082018190526000906111c590830186610eda565b82810360608401526111d78186610eda565b905082810360808401526111eb8185610bc0565b98975050505050505050565b60006020828403121561120957600080fd5b8151610ba081610b6a565b600060033d111561122d5760046000803e5060005160e01c5b90565b600060443d101561123e5790565b6040516003193d81016004833e81513d67ffffffffffffffff816024840111818411171561126e57505050505090565b82850191508151818111156112865750505050505090565b843d87010160208285010111156112a05750505050505090565b6112af60208286010187610c2f565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b6001600160a01b03868116825285166020820152604081018490526060810183905260a06080820181905260009061133c90830184610bc0565b97965050505050505056fea26469706673582212204284438e4f04dca532566e13963eaa8d6079575ddf1ed2f270762e43a029f86b64736f6c63430008150033",kO=n=>n.length>1;class Iv extends Fa{constructor(...e){kO(e)?super(...e):super(o1,Nv,e[0])}getDeployTransaction(e,t){return super.getDeployTransaction(e,t||{})}deploy(e,t){return super.deploy(e,t||{})}connect(e){return super.connect(e)}static createInterface(){return new Xs(o1)}static connect(e,t){return new Uf(e,o1,t)}}Iv.bytecode=Nv;Iv.abi=o1;const c1=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint8",name:"version",type:"uint8"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"accounts",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"uri",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}],Bv="0x608060405234801561001057600080fd5b50611386806100206000396000f3fe608060405234801561001057600080fd5b50600436106100875760003560e01c80634e1273f41161005b5780634e1273f41461010a578063a22cb4651461012a578063e985e9c51461013d578063f242432a1461017957600080fd5b8062fdd58e1461008c57806301ffc9a7146100b25780630e89341c146100d55780632eb2c2d6146100f5575b600080fd5b61009f61009a366004610b49565b61018c565b6040519081526020015b60405180910390f35b6100c56100c0366004610b8c565b610227565b60405190151581526020016100a9565b6100e86100e3366004610bb0565b610277565b6040516100a99190610c0f565b610108610103366004610d6e565b61030b565b005b61011d610118366004610e18565b610357565b6040516100a99190610f1e565b610108610138366004610f31565b610481565b6100c561014b366004610f6d565b6001600160a01b03918216600090815260666020908152604080832093909416825291909152205460ff1690565b610108610187366004610fa0565b610490565b60006001600160a01b0383166101fc5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b5060008181526065602090815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216636cdb3d1360e11b148061025857506001600160e01b031982166303a24d0760e21b145b8061022157506301ffc9a760e01b6001600160e01b0319831614610221565b60606067805461028690611005565b80601f01602080910402602001604051908101604052809291908181526020018280546102b290611005565b80156102ff5780601f106102d4576101008083540402835291602001916102ff565b820191906000526020600020905b8154815290600101906020018083116102e257829003601f168201915b50505050509050919050565b6001600160a01b0385163314806103275750610327853361014b565b6103435760405162461bcd60e51b81526004016101f39061103f565b61035085858585856104d5565b5050505050565b606081518351146103bc5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016101f3565b6000835167ffffffffffffffff8111156103d8576103d8610c22565b604051908082528060200260200182016040528015610401578160200160208202803683370190505b50905060005b84518110156104795761044c8582815181106104255761042561108d565b602002602001015185838151811061043f5761043f61108d565b602002602001015161018c565b82828151811061045e5761045e61108d565b6020908102919091010152610472816110b9565b9050610407565b509392505050565b61048c3383836106b5565b5050565b6001600160a01b0385163314806104ac57506104ac853361014b565b6104c85760405162461bcd60e51b81526004016101f39061103f565b6103508585858585610795565b81518351146105375760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016101f3565b6001600160a01b03841661055d5760405162461bcd60e51b81526004016101f3906110d2565b3360005b845181101561064757600085828151811061057e5761057e61108d565b60200260200101519050600085838151811061059c5761059c61108d565b60209081029190910181015160008481526065835260408082206001600160a01b038e1683529093529190912054909150818110156105ed5760405162461bcd60e51b81526004016101f390611117565b60008381526065602090815260408083206001600160a01b038e8116855292528083208585039055908b1682528120805484929061062c908490611161565b9250508190555050505080610640906110b9565b9050610561565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051610697929190611174565b60405180910390a46106ad8187878787876108c3565b505050505050565b816001600160a01b0316836001600160a01b0316036107285760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016101f3565b6001600160a01b03838116600081815260666020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0384166107bb5760405162461bcd60e51b81526004016101f3906110d2565b3360006107c785610a27565b905060006107d485610a27565b905060008681526065602090815260408083206001600160a01b038c168452909152902054858110156108195760405162461bcd60e51b81526004016101f390611117565b60008781526065602090815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290610858908490611161565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46108b8848a8a8a8a8a610a72565b505050505050505050565b6001600160a01b0384163b156106ad5760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061090790899089908890889088906004016111a2565b6020604051808303816000875af1925050508015610942575060408051601f3d908101601f1916820190925261093f91810190611200565b60015b6109ee5761094e61121d565b806308c379a0036109875750610962611239565b8061096d5750610989565b8060405162461bcd60e51b81526004016101f39190610c0f565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016101f3565b6001600160e01b0319811663bc197c8160e01b14610a1e5760405162461bcd60e51b81526004016101f3906112c3565b50505050505050565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110610a6157610a6161108d565b602090810291909101015292915050565b6001600160a01b0384163b156106ad5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190610ab6908990899088908890889060040161130b565b6020604051808303816000875af1925050508015610af1575060408051601f3d908101601f19168201909252610aee91810190611200565b60015b610afd5761094e61121d565b6001600160e01b0319811663f23a6e6160e01b14610a1e5760405162461bcd60e51b81526004016101f3906112c3565b80356001600160a01b0381168114610b4457600080fd5b919050565b60008060408385031215610b5c57600080fd5b610b6583610b2d565b946020939093013593505050565b6001600160e01b031981168114610b8957600080fd5b50565b600060208284031215610b9e57600080fd5b8135610ba981610b73565b9392505050565b600060208284031215610bc257600080fd5b5035919050565b6000815180845260005b81811015610bef57602081850181015186830182015201610bd3565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000610ba96020830184610bc9565b634e487b7160e01b600052604160045260246000fd5b601f8201601f1916810167ffffffffffffffff81118282101715610c5e57610c5e610c22565b6040525050565b600067ffffffffffffffff821115610c7f57610c7f610c22565b5060051b60200190565b600082601f830112610c9a57600080fd5b81356020610ca782610c65565b604051610cb48282610c38565b83815260059390931b8501820192828101915086841115610cd457600080fd5b8286015b84811015610cef5780358352918301918301610cd8565b509695505050505050565b600082601f830112610d0b57600080fd5b813567ffffffffffffffff811115610d2557610d25610c22565b604051610d3c601f8301601f191660200182610c38565b818152846020838601011115610d5157600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a08688031215610d8657600080fd5b610d8f86610b2d565b9450610d9d60208701610b2d565b9350604086013567ffffffffffffffff80821115610dba57600080fd5b610dc689838a01610c89565b94506060880135915080821115610ddc57600080fd5b610de889838a01610c89565b93506080880135915080821115610dfe57600080fd5b50610e0b88828901610cfa565b9150509295509295909350565b60008060408385031215610e2b57600080fd5b823567ffffffffffffffff80821115610e4357600080fd5b818501915085601f830112610e5757600080fd5b81356020610e6482610c65565b604051610e718282610c38565b83815260059390931b8501820192828101915089841115610e9157600080fd5b948201945b83861015610eb657610ea786610b2d565b82529482019490820190610e96565b96505086013592505080821115610ecc57600080fd5b50610ed985828601610c89565b9150509250929050565b600081518084526020808501945080840160005b83811015610f1357815187529582019590820190600101610ef7565b509495945050505050565b602081526000610ba96020830184610ee3565b60008060408385031215610f4457600080fd5b610f4d83610b2d565b915060208301358015158114610f6257600080fd5b809150509250929050565b60008060408385031215610f8057600080fd5b610f8983610b2d565b9150610f9760208401610b2d565b90509250929050565b600080600080600060a08688031215610fb857600080fd5b610fc186610b2d565b9450610fcf60208701610b2d565b93506040860135925060608601359150608086013567ffffffffffffffff811115610ff957600080fd5b610e0b88828901610cfa565b600181811c9082168061101957607f821691505b60208210810361103957634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016110cb576110cb6110a3565b5060010190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b80820180821115610221576102216110a3565b6040815260006111876040830185610ee3565b82810360208401526111998185610ee3565b95945050505050565b6001600160a01b0386811682528516602082015260a0604082018190526000906111ce90830186610ee3565b82810360608401526111e08186610ee3565b905082810360808401526111f48185610bc9565b98975050505050505050565b60006020828403121561121257600080fd5b8151610ba981610b73565b600060033d11156112365760046000803e5060005160e01c5b90565b600060443d10156112475790565b6040516003193d81016004833e81513d67ffffffffffffffff816024840111818411171561127757505050505090565b828501915081518181111561128f5750505050505090565b843d87010160208285010111156112a95750505050505090565b6112b860208286010187610c38565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b6001600160a01b03868116825285166020820152604081018490526060810183905260a06080820181905260009061134590830184610bc9565b97965050505050505056fea2646970667358221220dae4233510b050968a6e79f835ddf8b2052adb501a1849bd4d2ef171d594e86964736f6c63430008150033",CO=n=>n.length>1;class Fv extends Fa{constructor(...e){CO(e)?super(...e):super(c1,Bv,e[0])}getDeployTransaction(e){return super.getDeployTransaction(e||{})}deploy(e){return super.deploy(e||{})}connect(e){return super.connect(e)}static createInterface(){return new Xs(c1)}static connect(e,t){return new Uf(e,c1,t)}}Fv.bytecode=Bv;Fv.abi=c1;const u1=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"render",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}],Uv="0x60046101008181526311dbdb1960e21b61012052608090815260066101408181526529b4b63b32b960d11b6101605260a0526101809081526542726f6e7a6560d01b6101a05260c052610200604052600c6101c09081526b24b73b32b9ba34b3b0ba37b960a11b6101e05260e0526200007c916001919062000176565b506040805160c081018252600360808201818152620c5cdd60ea1b60a0840152825282518084018452818152620c9b9960ea1b6020828101919091528084019190915283518085018552828152620cdc9960ea1b818301528385015283518085019094529083526209ce8d60eb1b9083015260608101919091526200010690600590600462000176565b503480156200011457600080fd5b50620001203362000126565b620003b1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b8260048101928215620001b4579160200282015b82811115620001b45782518290620001a39082620002e5565b50916020019190600101906200018a565b50620001c2929150620001c6565b5090565b80821115620001c2576000620001dd8282620001e7565b50600101620001c6565b508054620001f59062000256565b6000825580601f1062000206575050565b601f01602090049060005260206000209081019062000226919062000229565b50565b5b80821115620001c257600081556001016200022a565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200026b57607f821691505b6020821081036200028c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002e057600081815260208120601f850160051c81016020861015620002bb5750805b601f850160051c820191505b81811015620002dc57828155600101620002c7565b5050505b505050565b81516001600160401b0381111562000301576200030162000240565b620003198162000312845462000256565b8462000292565b602080601f831160018114620003515760008415620003385750858301515b600019600386901b1c1916600185901b178555620002dc565b600085815260208120601f198616915b82811015620003825788860151825594840194600190910190840162000361565b5085821015620003a15787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b611e7280620003c16000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c8063715018a6146100515780638da5cb5b1461005b578063c321118c1461007b578063f2fde38b1461009b575b600080fd5b6100596100ae565b005b6000546040516001600160a01b0390911681526020015b60405180910390f35b61008e61008936600461057d565b6100c2565b60405161007291906105ba565b6100596100a93660046105ed565b610157565b6100b66101d5565b6100c0600061022f565b565b606061013160016100d38185610633565b600481106100e3576100e361064c565b016100ed8461027f565b60056100fa600187610633565b6004811061010a5761010a61064c565b0160405160200161011d939291906106ff565b60405160208183030381529060405261041d565b60405160200161014191906108f0565b6040516020818303038152906040529050919050565b61015f6101d5565b6001600160a01b0381166101c95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6101d28161022f565b50565b6000546001600160a01b031633146100c05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101c0565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60608160010361030457604051806110a001604052806110648152602001610d1061106491396040518060a0016040528060778152602001610b6d607791396040516020016102ce9190610935565b60408051601f1981840301815260c083019091526089808352909190611db46020830139604051602001610141939291906109bb565b8160020361035157604051806110a001604052806110648152602001610d1061106491396040518060a0016040528060778152602001610b6d607791396040516020016102ce91906109fe565b8160030361039e57604051806110a001604052806110648152602001610d1061106491396040518060a0016040528060778152602001610b6d607791396040516020016102ce9190610a84565b8160040361040957604051806110a001604052806110648152602001610d10611064913960405180610160016040528061012c8152602001610be461012c91396040518060c0016040528060898152602001611db460899139604051602001610141939291906109bb565b505060408051602081019091526000815290565b6060815160000361043c57505060408051602081019091526000815290565b6000604051806060016040528060408152602001611d74604091399050600060038451600261046b9190610b0a565b6104759190610b1d565b610480906004610b3f565b67ffffffffffffffff81111561049857610498610b56565b6040519080825280601f01601f1916602001820160405280156104c2576020820181803683370190505b50905060018201602082018586518701602081018051600082525b82841015610538576003840193508351603f8160121c168701518653600186019550603f81600c1c168701518653600186019550603f8160061c168701518653600186019550603f81168701518653506001850194506104dd565b9052505085516003900660018114610557576002811461056a57610572565b603d6001830353603d6002830353610572565b603d60018303535b509195945050505050565b60006020828403121561058f57600080fd5b5035919050565b60005b838110156105b1578181015183820152602001610599565b50506000910152565b60208152600082518060208401526105d9816040850160208701610596565b601f01601f19169190910160400192915050565b6000602082840312156105ff57600080fd5b81356001600160a01b038116811461061657600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b818103818111156106465761064661061d565b92915050565b634e487b7160e01b600052603260045260246000fd5b8054600090600181811c908083168061067c57607f831692505b6020808410820361069d57634e487b7160e01b600052602260045260246000fd5b8180156106b157600181146106c6576106f3565b60ff19861689528415158502890196506106f3565b60008881526020902060005b868110156106eb5781548b8201529085019083016106d2565b505084890196505b50505050505092915050565b7403d913730b6b2911d112234b9b0b83832b0b910169605d1b815260006107296015830186610662565b7f222c20226465736372697074696f6e223a22436f6d6d656e6465746174696f6e81527f7320666f72207468652054726561737572652048756e74202a2a44697361707060208201527f6561722a2a2c2072756e206174204554484265726c696e342c204265726c696e604082015261171160f11b60608201527f2c22696d616765223a22646174613a696d6167652f7376672b786d6c2c000000606282015284516107dc81607f840160208901610596565b6e11161130ba3a3934b13aba32b9911d60891b607f92909101918201527f5b7b2274726169745f74797065223a22506f736974696f6e222c2276616c7565608e82015262111d1160e91b60ae82015261083860b1820185610662565b7f227d2c7b2274726169745f74797065223a2254726561737572652048756e742281527f2c2276616c7565223a22446973617070656172227d2c7b2274726169745f747960208201527f7065223a22486f7374222c2276616c7565223a224554484265726c696e34227d60408201527f2c7b2274726169745f74797065223a224c6f636174696f6e222c2276616c756560608201526c223a224265726c696e227d5d7d60981b6080820152608d019695505050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c00000081526000825161092881601d850160208701610596565b91909101601d0192915050565b60008251610947818460208701610596565b7f3c636972636c652063783d27333335272063793d273135352720723d273139279201918252507f2066696c6c3d272366666466323727207374726f6b653d2723303030303030276020820152751039ba3937b5b296bbb4b23a341e9399b83c1390179f60511b6040820152605601919050565b600084516109cd818460208901610596565b8451908301906109e1818360208901610596565b84519101906109f4818360208801610596565b0195945050505050565b60008251610a10818460208701610596565b7f3c636972636c652063783d27333335272063793d273135352720723d273139279201918252507f2066696c6c3d272362386238623827207374726f6b653d2723303030303030276020820152751039ba3937b5b296bbb4b23a341e9399b83c1390179f60511b6040820152605601919050565b60008251610a96818460208701610596565b7f3c636972636c652063783d27333335272063793d273135352720723d273139279201918252507f2066696c6c3d272361663630303727207374726f6b653d2723303030303030276020820152751039ba3937b5b296bbb4b23a341e9399b83c1390179f60511b6040820152605601919050565b808201808211156106465761064661061d565b600082610b3a57634e487b7160e01b600052601260045260246000fd5b500490565b80820281158282048414176106465761064661061d565b634e487b7160e01b600052604160045260246000fdfe3c70617468207374726f6b653d27233030303030302720643d274d20323538203930204c2033333520313535204c203339362031353527207374726f6b652d6c696e656361703d27726f756e64272066696c6c3d277472616e73706172656e7427207374726f6b652d77696474683d2733707827202f3e3c70617468207374726f6b653d27233030303030302720643d274d2032303320313530204c2032363520313535204c2033333520313535204c203339372031353027207374726f6b652d6c696e656361703d27726f756e64272066696c6c3d277472616e73706172656e7427207374726f6b652d77696474683d2733707827202f3e203c636972636c652063783d27323635272063793d273135352720723d273139272066696c6c3d272366666666666627207374726f6b653d27626c61636b27207374726f6b652d77696474683d2733707827202f3e203c636972636c652063783d27333335272063793d273135352720723d273139272066696c6c3d272366666666666627207374726f6b653d27626c61636b27207374726f6b652d77696474683d2733707827202f3e3c7376672077696474683d273130302527206865696768743d2731303025272076696577426f783d27302030203630302036303027207374796c653d276261636b67726f756e643a20626c61636b273e203c70617468207374726f6b653d277265642720643d274d2031323020323230204320313230202d32302c20343730202d32302034383020323230204320343830203330302c20343530203434302c2033303020353530204320313530203434302c20313230203330302c2031323020323230272066696c6c3d277472616e73706172656e7427202f3e203c70617468207374726f6b653d277265642720643d274d2031323020323230204320313230202d32302c20343730202d32302034383020323230204320343830203330302c20343530203434302c2033303020353530204320313530203434302c20313230203330302c2031323020323230272066696c6c3d277472616e73706172656e7427207472616e73666f726d3d277363616c6528302e393529207472616e736c6174652831362c20332927207374726f6b652d77696474683d27302e3527202f3e203c70617468207374726f6b653d277265642720643d274d2031323020323230204320313230202d32302c20343730202d32302034383020323230204320343830203330302c20343530203434302c2033303020353530204320313530203434302c20313230203330302c2031323020323230272066696c6c3d277472616e73706172656e7427207472616e73666f726d3d277363616c6528302e393029207472616e736c6174652833332c20362927207374726f6b652d77696474683d27302e3527202f3e203c70617468207374726f6b653d277265642720643d274d2031323020323230204320313230202d32302c20343730202d32302034383020323230204320343830203330302c20343530203434302c2033303020353530204320313530203434302c20313230203330302c2031323020323230272066696c6c3d277472616e73706172656e7427207472616e73666f726d3d277363616c6528302e383529207472616e736c6174652835332c20392927207374726f6b652d77696474683d27302e3527202f3e203c70617468207374726f6b653d277265642720643d274d2031323020323230204320313230202d32302c20343730202d32302034383020323230204320343830203330302c20343530203434302c2033303020353530204320313530203434302c20313230203330302c2031323020323230272066696c6c3d277472616e73706172656e7427207472616e73666f726d3d277363616c6528302e383029207472616e736c6174652837352c2031332927207374726f6b652d77696474683d27302e3527202f3e203c70617468207374726f6b653d277265642720643d274d2031323020323230204320313230202d32302c20343730202d32302034383020323230204320343830203330302c20343530203434302c2033303020353530204320313530203434302c20313230203330302c2031323020323230272066696c6c3d277472616e73706172656e7427207472616e73666f726d3d277363616c6528302e373529207472616e736c617465283130302c2031372927207374726f6b652d77696474683d27302e3527202f3e203c70617468207374726f6b653d277265642720643d274d2031323020323230204320313230202d32302c20343730202d32302034383020323230204320343830203330302c20343530203434302c2033303020353530204320313530203434302c20313230203330302c2031323020323230272066696c6c3d277472616e73706172656e7427207472616e73666f726d3d277363616c6528302e373029207472616e736c617465283132382c2032322927207374726f6b652d77696474683d27302e3527202f3e203c70617468207374726f6b653d277265642720643d274d2031323020323230204320313230202d32302c20343730202d32302034383020323230204320343830203330302c20343530203434302c2033303020353530204320313530203434302c20313230203330302c2031323020323230272066696c6c3d277472616e73706172656e7427207472616e73666f726d3d277363616c6528302e363529207472616e736c617465283136312c2032372927207374726f6b652d77696474683d27302e3527202f3e203c70617468207374726f6b653d277265642720643d274d2031323020323230204320313230202d32302c20343730202d32302034383020323230204320343830203330302c20343530203434302c2033303020353530204320313530203434302c20313230203330302c2031323020323230272066696c6c3d277472616e73706172656e7427207472616e73666f726d3d277363616c6528302e363029207472616e736c617465283230302c2033342927207374726f6b652d77696474683d27302e3527202f3e203c70617468207374726f6b653d277265642720643d274d2031323020323230204320313230202d32302c20343730202d32302034383020323230204320343830203330302c20343530203434302c2033303020353530204320313530203434302c20313230203330302c2031323020323230272066696c6c3d277472616e73706172656e7427207472616e73666f726d3d277363616c6528302e353529207472616e736c617465283234342c2034322927207374726f6b652d77696474683d27302e3527202f3e203c70617468207374726f6b653d277265642720643d274d2031323020323230204320313230202d32302c20343730202d32302034383020323230204320343830203330302c20343530203434302c2033303020353530204320313530203434302c20313230203330302c2031323020323230272066696c6c3d277472616e73706172656e7427207472616e73666f726d3d277363616c6528302e353029207472616e736c617465283330302c2035312927207374726f6b652d77696474683d27302e3527202f3e203c70617468207374726f6b653d277265642720643d274d2031323020323230204320313230202d32302c20343730202d32302034383020323230204320343830203330302c20343530203434302c2033303020353530204320313530203434302c20313230203330302c2031323020323230272066696c6c3d277472616e73706172656e7427207472616e73666f726d3d277363616c6528302e343529207472616e736c617465283336362c2036332927207374726f6b652d77696474683d27302e3527202f3e203c70617468207374726f6b653d277265642720643d274d2031323020323230204320313230202d32302c20343730202d32302034383020323230204320343830203330302c20343530203434302c2033303020353530204320313530203434302c20313230203330302c2031323020323230272066696c6c3d277472616e73706172656e7427207472616e73666f726d3d277363616c6528302e343029207472616e736c617465283435312c2037372927207374726f6b652d77696474683d27302e3527202f3e203c70617468207374726f6b653d277265642720643d274d2031323020323230204320313230202d32302c20343730202d32302034383020323230204320343830203330302c20343530203434302c2033303020353530204320313530203434302c20313230203330302c2031323020323230272066696c6c3d277472616e73706172656e7427207472616e73666f726d3d277363616c6528302e333529207472616e736c617465283535382c2039362927207374726f6b652d77696474683d27302e3527202f3e203c70617468207374726f6b653d277265642720643d274d2031323020323230204320313230202d32302c20343730202d32302034383020323230204320343830203330302c20343530203434302c2033303020353530204320313530203434302c20313230203330302c2031323020323230272066696c6c3d277472616e73706172656e7427207472616e73666f726d3d277363616c6528302e333029207472616e736c617465283730302c203132322927207374726f6b652d77696474683d27302e3527202f3e203c70617468207374726f6b653d277265642720643d274d2031323020323230204320313230202d32302c20343730202d32302034383020323230204320343830203330302c20343530203434302c2033303020353530204320313530203434302c20313230203330302c2031323020323230272066696c6c3d277472616e73706172656e7427207472616e73666f726d3d277363616c6528302e323529207472616e736c617465283839372c203135382927207374726f6b652d77696474683d27302e3527202f3e203c70617468207374726f6b653d277265642720643d274d2031323020323230204320313230202d32302c20343730202d32302034383020323230204320343830203330302c20343530203434302c2033303020353530204320313530203434302c20313230203330302c2031323020323230272066696c6c3d277472616e73706172656e7427207472616e73666f726d3d277363616c6528302e323029207472616e736c61746528313230302c203231322927207374726f6b652d77696474683d27302e3527202f3e203c70617468207374726f6b653d277265642720643d274d2031323020323230204320313230202d32302c20343730202d32302034383020323230204320343830203330302c20343530203434302c2033303020353530204320313530203434302c20313230203330302c2031323020323230272066696c6c3d277472616e73706172656e7427207472616e73666f726d3d277363616c6528302e313529207472616e736c61746528313730302c203330302927207374726f6b652d77696474683d27302e3527202f3e203c70617468207374726f6b653d277265642720643d274d2031323020323230204320313230202d32302c20343730202d32302034383020323230204320343830203330302c20343530203434302c2033303020353530204320313530203434302c20313230203330302c2031323020323230272066696c6c3d277472616e73706172656e7427207472616e73666f726d3d277363616c6528302e313029207472616e736c61746528323730312c203439302927207374726f6b652d77696474683d27302e3527202f3e203c70617468207374726f6b653d277265642720643d274d2031323020323230204320313230202d32302c20343730202d32302034383020323230204320343830203330302c20343530203434302c2033303020353530204320313530203434302c20313230203330302c2031323020323230272066696c6c3d277472616e73706172656e7427207472616e73666f726d3d277363616c6528302e303529207472616e736c61746528353730312c20313034302927207374726f6b652d77696474683d27302e3527202f3e203c67206f7061636974793d2731272069643d27736d696c6579273e203c636972636c652063783d27333030272063793d273138302720723d27313030272066696c6c3d2772656427202f3e203c636972636c652063783d27323635272063793d273135352720723d273135272066696c6c3d27626c61636b27202f3e203c636972636c652063783d27333335272063793d273135352720723d273135272066696c6c3d27626c61636b27202f3e4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f3c70617468207374726f6b653d27626c61636b2720643d274d2032353020323130204320323735203234302c20333235203234302c203335302032313027207374726f6b652d77696474683d27313327207374726f6b652d6c696e656361703d27726f756e64272066696c6c3d277472616e73706172656e7427202f3e203c2f673e203c2f7376673ea2646970667358221220a46f509b90d53453044f504e486712e22704f5ce4e71cc0f8da376a080fbb14964736f6c63430008150033",SO=n=>n.length>1;class Lv extends Fa{constructor(...e){SO(e)?super(...e):super(u1,Uv,e[0])}getDeployTransaction(e){return super.getDeployTransaction(e||{})}deploy(e){return super.deploy(e||{})}connect(e){return super.connect(e)}static createInterface(){return new Xs(u1)}static connect(e,t){return new Uf(e,u1,t)}}Lv.bytecode=Uv;Lv.abi=u1;const l1=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint8",name:"version",type:"uint8"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"TREASURE_HUNT_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"accounts",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"player",type:"address"},{internalType:"uint256",name:"badgeId",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"renderers",outputs:[{internalType:"contract IRenderer",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"thc",type:"address"},{internalType:"address",name:"renderer",type:"address"}],name:"updateRenderer",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"uri",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}],Dv="0x608060405234801561001057600080fd5b5061212b806100206000396000f3fe608060405234801561001057600080fd5b50600436106101415760003560e01c80637c86dd25116100b8578063a22cb4651161007c578063a22cb465146102ca578063aca3f2a0146102dd578063d547741f14610306578063e985e9c514610319578063f242432a14610355578063f2fde38b1461036857600080fd5b80637c86dd251461026f5780638129fc1c146102825780638da5cb5b1461028a57806391d14854146102af578063a217fddf146102c257600080fd5b80632f2ff15d1161010a5780632f2ff15d146101e757806335d4fc28146101fa57806336568abe1461022157806340c10f19146102345780634e1273f414610247578063715018a61461026757600080fd5b8062fdd58e1461014657806301ffc9a71461016c5780630e89341c1461018f578063248a9ca3146101af5780632eb2c2d6146101d2575b600080fd5b61015961015436600461162a565b61037b565b6040519081526020015b60405180910390f35b61017f61017a36600461166a565b610416565b6040519015158152602001610163565b6101a261019d366004611687565b610421565b60405161016391906116f0565b6101596101bd366004611687565b60009081526097602052604090206001015490565b6101e56101e036600461185f565b6104b1565b005b6101e56101f5366004611909565b6104fd565b6101597f223e343b2fcc9b551ee46570449ab0c68a68a82c1725bd7d72a39a28d970cdcd81565b6101e561022f366004611909565b610527565b6101e561024236600461162a565b6105a5565b61025a610255366004611935565b6105fa565b6040516101639190611a3b565b6101e5610724565b6101e561027d366004611a4e565b610738565b6101e561076e565b6033546001600160a01b03165b6040516001600160a01b039091168152602001610163565b61017f6102bd366004611909565b6108a2565b610159600081565b6101e56102d8366004611a78565b6108cd565b6102976102eb366004611ab4565b60fb602052600090815260409020546001600160a01b031681565b6101e5610314366004611909565b6108d8565b61017f610327366004611a4e565b6001600160a01b03918216600090815260ca6020908152604080832093909416825291909152205460ff1690565b6101e5610363366004611acf565b6108fd565b6101e5610376366004611ab4565b610942565b60006001600160a01b0383166103eb5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b50600081815260c9602090815260408083206001600160a01b03861684529091529020545b92915050565b6000610410826109b8565b606081811c600090815260fb6020526040908190205490516330c8446360e21b81526bffffffffffffffffffffffff841660048201526001600160a01b039091169063c321118c90602401600060405180830381865afa158015610489573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526104109190810190611b34565b6001600160a01b0385163314806104cd57506104cd8533610327565b6104e95760405162461bcd60e51b81526004016103e290611bb6565b6104f685858585856109f8565b5050505050565b60008281526097602052604090206001015461051881610bd8565b6105228383610be2565b505050565b6001600160a01b03811633146105975760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016103e2565b6105a18282610c68565b5050565b7f223e343b2fcc9b551ee46570449ab0c68a68a82c1725bd7d72a39a28d970cdcd6105cf81610bd8565b61052283836060336001600160a01b0316901b17600160405180602001604052806000815250610ccf565b6060815183511461065f5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016103e2565b6000835167ffffffffffffffff81111561067b5761067b611703565b6040519080825280602002602001820160405280156106a4578160200160208202803683370190505b50905060005b845181101561071c576106ef8582815181106106c8576106c8611c04565b60200260200101518583815181106106e2576106e2611c04565b602002602001015161037b565b82828151811061070157610701611c04565b602090810291909101015261071581611c30565b90506106aa565b509392505050565b61072c610de5565b6107366000610e3f565b565b610740610de5565b6001600160a01b03918216600090815260fb6020526040902080546001600160a01b03191691909216179055565b600054610100900460ff161580801561078e5750600054600160ff909116105b806107a85750303b1580156107a8575060005460ff166001145b61080b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103e2565b6000805460ff19166001179055801561082e576000805461ff0019166101001790555b610836610e91565b61084e60405180602001604052806000815250610ec0565b610859600033610be2565b801561089f576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b60009182526097602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6105a1338383610ef0565b6000828152609760205260409020600101546108f381610bd8565b6105228383610c68565b6001600160a01b03851633148061091957506109198533610327565b6109355760405162461bcd60e51b81526004016103e290611bb6565b6104f68585858585610fd0565b61094a610de5565b6001600160a01b0381166109af5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103e2565b61089f81610e3f565b60006001600160e01b03198216636cdb3d1360e11b14806109e957506001600160e01b031982166303a24d0760e21b145b806104105750610410826110fe565b8151835114610a5a5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016103e2565b6001600160a01b038416610a805760405162461bcd60e51b81526004016103e290611c49565b3360005b8451811015610b6a576000858281518110610aa157610aa1611c04565b602002602001015190506000858381518110610abf57610abf611c04565b602090810291909101810151600084815260c9835260408082206001600160a01b038e168352909352919091205490915081811015610b105760405162461bcd60e51b81526004016103e290611c8e565b600083815260c9602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290610b4f908490611cd8565b9250508190555050505080610b6390611c30565b9050610a84565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051610bba929190611ceb565b60405180910390a4610bd0818787878787611133565b505050505050565b61089f813361128e565b610bec82826108a2565b6105a15760008281526097602090815260408083206001600160a01b03851684529091529020805460ff19166001179055610c243390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b610c7282826108a2565b156105a15760008281526097602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6001600160a01b038416610d2f5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b60648201526084016103e2565b336000610d3b856112e7565b90506000610d48856112e7565b9050600086815260c9602090815260408083206001600160a01b038b16845290915281208054879290610d7c908490611cd8565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610ddc83600089898989611332565b50505050505050565b6033546001600160a01b031633146107365760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103e2565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16610eb85760405162461bcd60e51b81526004016103e290611d19565b6107366113ed565b600054610100900460ff16610ee75760405162461bcd60e51b81526004016103e290611d19565b61089f8161141d565b816001600160a01b0316836001600160a01b031603610f635760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016103e2565b6001600160a01b03838116600081815260ca6020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b038416610ff65760405162461bcd60e51b81526004016103e290611c49565b336000611002856112e7565b9050600061100f856112e7565b9050600086815260c9602090815260408083206001600160a01b038c168452909152902054858110156110545760405162461bcd60e51b81526004016103e290611c8e565b600087815260c9602090815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290611093908490611cd8565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46110f3848a8a8a8a8a611332565b505050505050505050565b60006001600160e01b03198216637965db0b60e01b148061041057506301ffc9a760e01b6001600160e01b0319831614610410565b6001600160a01b0384163b15610bd05760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906111779089908990889088908890600401611d64565b6020604051808303816000875af19250505080156111b2575060408051601f3d908101601f191682019092526111af91810190611dc2565b60015b61125e576111be611ddf565b806308c379a0036111f757506111d2611dfb565b806111dd57506111f9565b8060405162461bcd60e51b81526004016103e291906116f0565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016103e2565b6001600160e01b0319811663bc197c8160e01b14610ddc5760405162461bcd60e51b81526004016103e290611e85565b61129882826108a2565b6105a1576112a58161144d565b6112b083602061145f565b6040516020016112c1929190611ecd565b60408051601f198184030181529082905262461bcd60e51b82526103e2916004016116f0565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061132157611321611c04565b602090810291909101015292915050565b6001600160a01b0384163b15610bd05760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906113769089908990889088908890600401611f42565b6020604051808303816000875af19250505080156113b1575060408051601f3d908101601f191682019092526113ae91810190611dc2565b60015b6113bd576111be611ddf565b6001600160e01b0319811663f23a6e6160e01b14610ddc5760405162461bcd60e51b81526004016103e290611e85565b600054610100900460ff166114145760405162461bcd60e51b81526004016103e290611d19565b61073633610e3f565b600054610100900460ff166114445760405162461bcd60e51b81526004016103e290611d19565b61089f81611602565b60606104106001600160a01b03831660145b6060600061146e836002611f87565b611479906002611cd8565b67ffffffffffffffff81111561149157611491611703565b6040519080825280601f01601f1916602001820160405280156114bb576020820181803683370190505b509050600360fc1b816000815181106114d6576114d6611c04565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061150557611505611c04565b60200101906001600160f81b031916908160001a9053506000611529846002611f87565b611534906001611cd8565b90505b60018111156115ac576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061156857611568611c04565b1a60f81b82828151811061157e5761157e611c04565b60200101906001600160f81b031916908160001a90535060049490941c936115a581611f9e565b9050611537565b5083156115fb5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016103e2565b9392505050565b60cb6105a18282612035565b80356001600160a01b038116811461162557600080fd5b919050565b6000806040838503121561163d57600080fd5b6116468361160e565b946020939093013593505050565b6001600160e01b03198116811461089f57600080fd5b60006020828403121561167c57600080fd5b81356115fb81611654565b60006020828403121561169957600080fd5b5035919050565b60005b838110156116bb5781810151838201526020016116a3565b50506000910152565b600081518084526116dc8160208601602086016116a0565b601f01601f19169290920160200192915050565b6020815260006115fb60208301846116c4565b634e487b7160e01b600052604160045260246000fd5b601f8201601f1916810167ffffffffffffffff8111828210171561173f5761173f611703565b6040525050565b600067ffffffffffffffff82111561176057611760611703565b5060051b60200190565b600082601f83011261177b57600080fd5b8135602061178882611746565b6040516117958282611719565b83815260059390931b85018201928281019150868411156117b557600080fd5b8286015b848110156117d057803583529183019183016117b9565b509695505050505050565b600067ffffffffffffffff8211156117f5576117f5611703565b50601f01601f191660200190565b600082601f83011261181457600080fd5b813561181f816117db565b60405161182c8282611719565b82815285602084870101111561184157600080fd5b82602086016020830137600092810160200192909252509392505050565b600080600080600060a0868803121561187757600080fd5b6118808661160e565b945061188e6020870161160e565b9350604086013567ffffffffffffffff808211156118ab57600080fd5b6118b789838a0161176a565b945060608801359150808211156118cd57600080fd5b6118d989838a0161176a565b935060808801359150808211156118ef57600080fd5b506118fc88828901611803565b9150509295509295909350565b6000806040838503121561191c57600080fd5b8235915061192c6020840161160e565b90509250929050565b6000806040838503121561194857600080fd5b823567ffffffffffffffff8082111561196057600080fd5b818501915085601f83011261197457600080fd5b8135602061198182611746565b60405161198e8282611719565b83815260059390931b85018201928281019150898411156119ae57600080fd5b948201945b838610156119d3576119c48661160e565b825294820194908201906119b3565b965050860135925050808211156119e957600080fd5b506119f68582860161176a565b9150509250929050565b600081518084526020808501945080840160005b83811015611a3057815187529582019590820190600101611a14565b509495945050505050565b6020815260006115fb6020830184611a00565b60008060408385031215611a6157600080fd5b611a6a8361160e565b915061192c6020840161160e565b60008060408385031215611a8b57600080fd5b611a948361160e565b915060208301358015158114611aa957600080fd5b809150509250929050565b600060208284031215611ac657600080fd5b6115fb8261160e565b600080600080600060a08688031215611ae757600080fd5b611af08661160e565b9450611afe6020870161160e565b93506040860135925060608601359150608086013567ffffffffffffffff811115611b2857600080fd5b6118fc88828901611803565b600060208284031215611b4657600080fd5b815167ffffffffffffffff811115611b5d57600080fd5b8201601f81018413611b6e57600080fd5b8051611b79816117db565b604051611b868282611719565b828152866020848601011115611b9b57600080fd5b611bac8360208301602087016116a0565b9695505050505050565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611c4257611c42611c1a565b5060010190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b8082018082111561041057610410611c1a565b604081526000611cfe6040830185611a00565b8281036020840152611d108185611a00565b95945050505050565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6001600160a01b0386811682528516602082015260a060408201819052600090611d9090830186611a00565b8281036060840152611da28186611a00565b90508281036080840152611db681856116c4565b98975050505050505050565b600060208284031215611dd457600080fd5b81516115fb81611654565b600060033d1115611df85760046000803e5060005160e01c5b90565b600060443d1015611e095790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715611e3957505050505090565b8285019150815181811115611e515750505050505090565b843d8701016020828501011115611e6b5750505050505090565b611e7a60208286010187611719565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611f058160178501602088016116a0565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351611f368160288401602088016116a0565b01602801949350505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090611f7c908301846116c4565b979650505050505050565b808202811582820484141761041057610410611c1a565b600081611fad57611fad611c1a565b506000190190565b600181811c90821680611fc957607f821691505b602082108103611fe957634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561052257600081815260208120601f850160051c810160208610156120165750805b601f850160051c820191505b81811015610bd057828155600101612022565b815167ffffffffffffffff81111561204f5761204f611703565b6120638161205d8454611fb5565b84611fef565b602080601f83116001811461209857600084156120805750858301515b600019600386901b1c1916600185901b178555610bd0565b600085815260208120601f198616915b828110156120c7578886015182559484019460019091019084016120a8565b50858210156120e55787850151600019600388901b60f8161c191681555b5050505050600190811b0190555056fea2646970667358221220da03a93c54adabb8641b192a9c23eca9c95112bd22ec64c2d01dd78094214f8664736f6c63430008150033",RO=n=>n.length>1;class Mv extends Fa{constructor(...e){RO(e)?super(...e):super(l1,Dv,e[0])}getDeployTransaction(e){return super.getDeployTransaction(e||{})}deploy(e){return super.deploy(e||{})}connect(e){return super.connect(e)}static createInterface(){return new Xs(l1)}static connect(e,t){return new Uf(e,l1,t)}}Mv.bytecode=Dv;Mv.abi=l1;const f1=[{inputs:[{internalType:"address[]",name:"solutions_",type:"address[]"},{internalType:"address[]",name:"keys",type:"address[]"},{internalType:"address",name:"prize_",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"player",type:"address"},{indexed:!0,internalType:"uint256",name:"completedChapter",type:"uint256"}],name:"ChapterCompleted",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"msgSender",type:"address"}],name:"IncrementCounter",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"player",type:"address"},{indexed:!0,internalType:"uint256",name:"completedKey",type:"uint256"}],name:"KeyCompleted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"GAME_MASTER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"solution",type:"address"}],name:"addSolution",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint96",name:"",type:"uint96"},{internalType:"uint256",name:"",type:"uint256"}],name:"chapterToPlayers",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"contextCounter",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"currentChapter",outputs:[{internalType:"uint96",name:"",type:"uint96"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"gameMasters",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"a",type:"address"}],name:"getAddressHash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"page",type:"uint256"}],name:"getLeaderboard",outputs:[{internalType:"uint256[32]",name:"leaderboard",type:"uint256[32]"}],stateMutability:"view",type:"function"},{inputs:[],name:"getQuestsRootCID",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"keyToPos",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"playerToCurrentChapter",outputs:[{internalType:"uint96",name:"",type:"uint96"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"playerToKeys",outputs:[{internalType:"uint80",name:"",type:"uint80"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"players",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"prize",outputs:[{internalType:"contract ITreasure",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"questsRootCid",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"questsRootCid_",type:"bytes"}],name:"setup",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"solutions",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"submit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"submitKey",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalChapters",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalKeys",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}],jv="0x60806040523480156200001157600080fd5b506040516200265438038062002654833981016040819052620000349162000476565b6200003f3362000163565b82516200005490600890602086019062000315565b50600c80546001600160a01b0319166001600160a01b03831617905560005b82518160ff161015620000ff576200008d81600162000508565b60056000858460ff1681518110620000a957620000a962000524565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908360ff1602179055508080620000f6906200053a565b91505062000073565b5081516007805460ff191660ff9092169190911790556200012b600062000125620001b3565b620001d7565b6200015a7f1d93c87416ca7b54f0fb8323167b72760e8e2ec93d48660953897a150f97a8b462000125620001b3565b5050506200055c565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000620001c03362000260565b620001ca57503390565b5060131936013560601c90565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff166200025c5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45b5050565b600046610144148062000274575046610118145b15620002c8576001600160a01b0382167322dcc39b2ac376862183dd35a1664798dafc7da61480620002c257506001600160a01b03821673ba4082f4961c8fb76231995c967cd9aa40f321b5145b92915050565b6001600160a01b03821673b539068872230f20456cf38ec52ef2f91af4ae491480620002c257506001600160a01b038216738598806401a63ddf52473f1b3c55bc9e33e2d73b1492915050565b8280548282559060005260206000209081019282156200036d579160200282015b828111156200036d57825182546001600160a01b0319166001600160a01b0390911617825560209092019160019091019062000336565b506200037b9291506200037f565b5090565b5b808211156200037b576000815560010162000380565b634e487b7160e01b600052604160045260246000fd5b80516001600160a01b0381168114620003c457600080fd5b919050565b600082601f830112620003db57600080fd5b815160206001600160401b0380831115620003fa57620003fa62000396565b8260051b604051601f19603f8301168101818110848211171562000422576200042262000396565b6040529384528581018301938381019250878511156200044157600080fd5b83870191505b848210156200046b576200045b82620003ac565b8352918301919083019062000447565b979650505050505050565b6000806000606084860312156200048c57600080fd5b83516001600160401b0380821115620004a457600080fd5b620004b287838801620003c9565b94506020860151915080821115620004c957600080fd5b50620004d886828701620003c9565b925050620004e960408501620003ac565b90509250925092565b634e487b7160e01b600052601160045260246000fd5b60ff8181168382160190811115620002c257620002c2620004f2565b634e487b7160e01b600052603260045260246000fd5b600060ff821660ff8103620005535762000553620004f2565b60010192915050565b6120e8806200056c6000396000f3fe608060405234801561001057600080fd5b50600436106101e45760003560e01c8063888fa4a21161010f578063b71698c7116100a2578063e3ac5d2611610071578063e3ac5d26146104f7578063f2fde38b1461050a578063f71d96cb1461051d578063fbc20d841461053057600080fd5b8063b71698c714610456578063bbfff46114610469578063c3d8bfed146104dc578063d547741f146104e457600080fd5b80639ded06df116100de5780639ded06df146103f4578063a217fddf14610407578063a34b46fe1461040f578063ad1def1e1461042f57600080fd5b8063888fa4a21461037c5780638da5cb5b146103bd57806391d14854146103ce5780639bd0dbb8146103e157600080fd5b8063488bdabc116101875780638006a174116101565780638006a1741461030b578063817584b91461031e57806382b7616814610349578063832e16951461036957600080fd5b8063488bdabc146102c9578063626bb7fb146102e8578063715018a6146102fb57806376f0a0e81461030357600080fd5b8063248a9ca3116101c3578063248a9ca31461023c5780632f2ff15d1461026057806336568abe14610275578063385e18dd1461028857600080fd5b8062d25c23146101e957806301ffc9a7146102075780630db4e5f11461022a575b600080fd5b6101f1610553565b6040516101fe9190611ab2565b60405180910390f35b61021a610215366004611ac5565b6105e1565b60405190151581526020016101fe565b6008545b6040519081526020016101fe565b61022e61024a366004611aef565b6000908152600160208190526040909120015490565b61027361026e366004611b24565b610618565b005b610273610283366004611b24565b610643565b6102b1610296366004611b50565b6004602052600090815260409020546001600160601b031681565b6040516001600160601b0390911681526020016101fe565b6007546102d69060ff1681565b60405160ff90911681526020016101fe565b6102736102f6366004611b6b565b6106c6565b610273610892565b6102b16108a6565b610273610319366004611b6b565b6108dc565b61033161032c366004611aef565b610baf565b6040516001600160a01b0390911681526020016101fe565b61022e610357366004611b50565b60026020526000908152604090205481565b610273610377366004611b50565b610bd9565b6103a561038a366004611b50565b6006602052600090815260409020546001600160501b031681565b6040516001600160501b0390911681526020016101fe565b6000546001600160a01b0316610331565b61021a6103dc366004611b24565b610c56565b6103316103ef366004611ba6565b610c81565b610273610402366004611bf4565b610cb9565b61022e600081565b61042261041d366004611aef565b610e10565b6040516101fe9190611ca5565b61022e7f1d93c87416ca7b54f0fb8323167b72760e8e2ec93d48660953897a150f97a8b481565b610331610464366004611aef565b610f08565b61022e610477366004611b50565b6040517f19457468657265756d205369676e6564204d6573736167653a0a32300000000060208201526bffffffffffffffffffffffff19606083901b16603c820152600090605001604051602081830303815290604052805190602001209050919050565b6101f1610f18565b6102736104f2366004611b24565b610faa565b600c54610331906001600160a01b031681565b610273610518366004611b50565b610fd0565b61033161052b366004611aef565b611049565b6102d661053e366004611b50565b60056020526000908152604090205460ff1681565b600b805461056090611cdb565b80601f016020809104026020016040519081016040528092919081815260200182805461058c90611cdb565b80156105d95780601f106105ae576101008083540402835291602001916105d9565b820191906000526020600020905b8154815290600101906020018083116105bc57829003601f168201915b505050505081565b60006001600160e01b03198216637965db0b60e01b148061061257506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000828152600160208190526040909120015461063481611059565b61063e8383611063565b505050565b6001600160a01b03811633146106b85760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6106c282826110ce565b5050565b600060016106d5610477611135565b6040805160008152602081018083529290925260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa158015610723573d6000803e3d6000fd5b505060408051601f1901516001600160a01b03811660009081526005602052919091205490925060ff169050806107885760405162461bcd60e51b815260206004820152600960248201526857726f6e67206b657960b81b60448201526064016106af565b610793600182611d2b565b60ff166001901b600660006107a6611135565b6001600160a01b031681526020810191909152604001600090812080546001600160501b039384169381169390931769ffffffffffffffffffff199093169290921790915561082a906006906107fa611135565b6001600160a01b031681526020810191909152604001600020546001600160501b0316610825611135565b611156565b610835600182611d2b565b60ff16610840611135565b6001600160a01b03167fecca5bbef137d0fd675f3d49f8d7c0d30ea00b731a3d0a82f7374ecbd588f4bc60405160405180910390a361087e336111dc565b1561088b5761088b61128c565b5050505050565b61089a6112b7565b6108a46000611311565b565b6000600460006108b4611135565b6001600160a01b031681526020810191909152604001600020546001600160601b0316919050565b6000600460006108ea611135565b6001600160a01b031681526020810191909152604001600090812054600880546001600160601b039092169350908390811061092857610928611d44565b60009182526020822001546001600160a01b03169150610949610477611135565b60408051600081526020810180835283905260ff89169181019190915260608101879052608081018690529091506001600160a01b0383169060019060a0016020604051602081039080840390855afa1580156109aa573d6000803e3d6000fd5b505050602060405103516001600160a01b0316146109fc5760405162461bcd60e51b815260206004820152600f60248201526e2bb937b7339039b7b63aba34b7b71760891b60448201526064016106af565b60046000610a08611135565b6001600160a01b0316815260208101919091526040016000908120546001600160601b03169003610a70576009610a3d611135565b81546001810183556000928352602090922090910180546001600160a01b0319166001600160a01b039092169190911790555b60046000610a7c611135565b6001600160a01b031681526020810191909152604001600090812080546001600160601b031691610aac83611d5a565b91906101000a8154816001600160601b0302191690836001600160601b031602179055505060036000846001600160601b03166001600160601b03168152602001908152602001600020610afe611135565b81546001810183556000928352602090922090910180546001600160a01b0319166001600160a01b03909216919091179055610b4a6001600160601b038416610b45611135565b611361565b826001600160601b0316610b5c611135565b6001600160a01b03167fc3f611c90d559cedd2440cdd34473d14a3acb8d8ca8a45fc99a0a587eacdf5f060405160405180910390a3610b9a336111dc565b15610ba757610ba761128c565b505050505050565b600a8181548110610bbf57600080fd5b6000918252602090912001546001600160a01b0316905081565b7f1d93c87416ca7b54f0fb8323167b72760e8e2ec93d48660953897a150f97a8b4610c0381611059565b50600880546001810182556000919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30180546001600160a01b0319166001600160a01b0392909216919091179055565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60036020528160005260406000208181548110610c9d57600080fd5b6000918252602090912001546001600160a01b03169150829050565b7f1d93c87416ca7b54f0fb8323167b72760e8e2ec93d48660953897a150f97a8b4610ce381611059565b600b610cef8382611dc6565b50600c54604080516306ba9f8560e31b815290516001600160a01b03909216916391d148549183916335d4fc28916004808201926020929091908290030181865afa158015610d42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d669190611e86565b6040516001600160e01b031960e084901b1681526004810191909152306024820152604401602060405180830381865afa158015610da8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dcc9190611e9f565b6106c25760405162461bcd60e51b815260206004820152601560248201527411d85b59481b9bdd081d995c9a599a5959081e595d605a1b60448201526064016106af565b610e18611a43565b6000610e25602084611ec1565b905060005b602081108015610e445750600954610e428383611ed8565b105b15610f015760006009610e578484611ed8565b81548110610e6757610e67611d44565b6000918252602080832091909101546001600160a01b03811680845260068352604080852054600485529420549094506001600160501b0384169360ff90911660089190911b6affffffffffffffffffff001660609290921b6bffffffffffffffffffffffff1916919091171790869085908110610ee757610ee7611d44565b602002015250819050610ef981611eeb565b915050610e2a565b5050919050565b60088181548110610bbf57600080fd5b6060600b8054610f2790611cdb565b80601f0160208091040260200160405190810160405280929190818152602001828054610f5390611cdb565b8015610fa05780601f10610f7557610100808354040283529160200191610fa0565b820191906000526020600020905b815481529060010190602001808311610f8357829003601f168201915b5050505050905090565b60008281526001602081905260409091200154610fc681611059565b61063e83836110ce565b610fd86112b7565b6001600160a01b03811661103d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106af565b61104681611311565b50565b60098181548110610bbf57600080fd5b6110468133611416565b61106d8282610c56565b6106c25760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b6110d88282610c56565b156106c25760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000611140336111dc565b61114957503390565b5060131936013560601c90565b60075460019061116a9060ff166002611fe8565b6111749190611ff7565b82036106c257600c546040516340c10f1960e01b81526001600160a01b03838116600483015260056024830152909116906340c10f1990604401600060405180830381600087803b1580156111c857600080fd5b505af1158015610ba7573d6000803e3d6000fd5b60004661014414806111ef575046610118145b15611240576001600160a01b0382167322dcc39b2ac376862183dd35a1664798dafc7da6148061061257506001600160a01b03821673ba4082f4961c8fb76231995c967cd9aa40f321b51492915050565b6001600160a01b03821673b539068872230f20456cf38ec52ef2f91af4ae49148061061257506001600160a01b038216738598806401a63ddf52473f1b3c55bc9e33e2d73b1492915050565b6108a436605b19013560601c36603319013536604719013560601c6001600160a01b0316919061146f565b6000546001600160a01b031633146108a45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016106af565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600161136c60085490565b6113769190611ff7565b82036106c2576001600160601b0382166000908152600360208190526040822054919082116113a557816113a8565b60045b600c546040516340c10f1960e01b81526001600160a01b038681166004830152602482018490529293509116906340c10f1990604401600060405180830381600087803b1580156113f857600080fd5b505af115801561140c573d6000803e3d6000fd5b5050505050505050565b6114208282610c56565b6106c25761142d816114be565b6114388360206114d0565b60405160200161144992919061200a565b60408051601f198184030181529082905262461bcd60e51b82526106af91600401611ab2565b8060000361147c57505050565b6001600160a01b03831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146114b45761063e6001600160a01b0384168383611673565b61063e82826116c5565b60606106126001600160a01b03831660145b606060006114df836002611ec1565b6114ea906002611ed8565b67ffffffffffffffff81111561150257611502611bde565b6040519080825280601f01601f19166020018201604052801561152c576020820181803683370190505b509050600360fc1b8160008151811061154757611547611d44565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061157657611576611d44565b60200101906001600160f81b031916908160001a905350600061159a846002611ec1565b6115a5906001611ed8565b90505b600181111561161d576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106115d9576115d9611d44565b1a60f81b8282815181106115ef576115ef611d44565b60200101906001600160f81b031916908160001a90535060049490941c936116168161207f565b90506115a8565b50831561166c5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016106af565b9392505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261063e9084906117de565b804710156117155760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016106af565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611762576040519150601f19603f3d011682016040523d82523d6000602084013e611767565b606091505b505090508061063e5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016106af565b6000611833826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166118b39092919063ffffffff16565b90508051600014806118545750808060200190518101906118549190611e9f565b61063e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016106af565b60606118c284846000856118ca565b949350505050565b60608247101561192b5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016106af565b600080866001600160a01b031685876040516119479190612096565b60006040518083038185875af1925050503d8060008114611984576040519150601f19603f3d011682016040523d82523d6000602084013e611989565b606091505b509150915061199a878383876119a5565b979650505050505050565b60608315611a14578251600003611a0d576001600160a01b0385163b611a0d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016106af565b50816118c2565b6118c28383815115611a295781518083602001fd5b8060405162461bcd60e51b81526004016106af9190611ab2565b6040518061040001604052806020906020820280368337509192915050565b60005b83811015611a7d578181015183820152602001611a65565b50506000910152565b60008151808452611a9e816020860160208601611a62565b601f01601f19169290920160200192915050565b60208152600061166c6020830184611a86565b600060208284031215611ad757600080fd5b81356001600160e01b03198116811461166c57600080fd5b600060208284031215611b0157600080fd5b5035919050565b80356001600160a01b0381168114611b1f57600080fd5b919050565b60008060408385031215611b3757600080fd5b82359150611b4760208401611b08565b90509250929050565b600060208284031215611b6257600080fd5b61166c82611b08565b600080600060608486031215611b8057600080fd5b833560ff81168114611b9157600080fd5b95602085013595506040909401359392505050565b60008060408385031215611bb957600080fd5b82356001600160601b0381168114611bd057600080fd5b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b600060208284031215611c0657600080fd5b813567ffffffffffffffff80821115611c1e57600080fd5b818401915084601f830112611c3257600080fd5b813581811115611c4457611c44611bde565b604051601f8201601f19908116603f01168101908382118183101715611c6c57611c6c611bde565b81604052828152876020848701011115611c8557600080fd5b826020860160208301376000928101602001929092525095945050505050565b6104008101818360005b6020808210611cbe5750611cd2565b825184529283019290910190600101611caf565b50505092915050565b600181811c90821680611cef57607f821691505b602082108103611d0f57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60ff828116828216039081111561061257610612611d15565b634e487b7160e01b600052603260045260246000fd5b60006001600160601b03808316818103611d7657611d76611d15565b6001019392505050565b601f82111561063e57600081815260208120601f850160051c81016020861015611da75750805b601f850160051c820191505b81811015610ba757828155600101611db3565b815167ffffffffffffffff811115611de057611de0611bde565b611df481611dee8454611cdb565b84611d80565b602080601f831160018114611e295760008415611e115750858301515b600019600386901b1c1916600185901b178555610ba7565b600085815260208120601f198616915b82811015611e5857888601518255948401946001909101908401611e39565b5085821015611e765787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208284031215611e9857600080fd5b5051919050565b600060208284031215611eb157600080fd5b8151801515811461166c57600080fd5b808202811582820484141761061257610612611d15565b8082018082111561061257610612611d15565b600060018201611efd57611efd611d15565b5060010190565b600181815b80851115611f3f578160001904821115611f2557611f25611d15565b80851615611f3257918102915b93841c9390800290611f09565b509250929050565b600082611f5657506001610612565b81611f6357506000610612565b8160018114611f795760028114611f8357611f9f565b6001915050610612565b60ff841115611f9457611f94611d15565b50506001821b610612565b5060208310610133831016604e8410600b8410161715611fc2575081810a610612565b611fcc8383611f04565b8060001904821115611fe057611fe0611d15565b029392505050565b600061166c60ff841683611f47565b8181038181111561061257610612611d15565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351612042816017850160208801611a62565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351612073816028840160208801611a62565b01602801949350505050565b60008161208e5761208e611d15565b506000190190565b600082516120a8818460208701611a62565b919091019291505056fea2646970667358221220257f72ded98db36a2bb7e07fade0972f92f54927ff0c1c9cfc7d18d6151f5e5664736f6c63430008150033",TO=n=>n.length>1;class yb extends Fa{constructor(...e){TO(e)?super(...e):super(f1,jv,e[0])}getDeployTransaction(e,t,r,s){return super.getDeployTransaction(e,t,r,s||{})}deploy(e,t,r,s){return super.deploy(e,t,r,s||{})}connect(e){return super.connect(e)}static createInterface(){return new Xs(f1)}static connect(e,t){return new Uf(e,f1,t)}}yb.bytecode=jv;yb.abi=f1;var $v={exports:{}};function OO(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var M6={exports:{}},gm;function qe(){return gm||(gm=1,function(n,e){(function(t,r){n.exports=r()})(oe,function(){var t=t||function(r,s){var i;if(typeof window<"u"&&window.crypto&&(i=window.crypto),typeof self<"u"&&self.crypto&&(i=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(i=globalThis.crypto),!i&&typeof window<"u"&&window.msCrypto&&(i=window.msCrypto),!i&&typeof oe<"u"&&oe.crypto&&(i=oe.crypto),!i&&typeof OO=="function")try{i=MR}catch{}var a=function(){if(i){if(typeof i.getRandomValues=="function")try{return i.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof i.randomBytes=="function")try{return i.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function m(){}return function(x){var y;return m.prototype=x,y=new m,m.prototype=null,y}}(),u={},c=u.lib={},l=c.Base=function(){return{extend:function(m){var x=o(this);return m&&x.mixIn(m),(!x.hasOwnProperty("init")||this.init===x.init)&&(x.init=function(){x.$super.init.apply(this,arguments)}),x.init.prototype=x,x.$super=this,x},create:function(){var m=this.extend();return m.init.apply(m,arguments),m},init:function(){},mixIn:function(m){for(var x in m)m.hasOwnProperty(x)&&(this[x]=m[x]);m.hasOwnProperty("toString")&&(this.toString=m.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),d=c.WordArray=l.extend({init:function(m,x){m=this.words=m||[],x!=s?this.sigBytes=x:this.sigBytes=m.length*4},toString:function(m){return(m||h).stringify(this)},concat:function(m){var x=this.words,y=m.words,A=this.sigBytes,S=m.sigBytes;if(this.clamp(),A%4)for(var D=0;D>>2]>>>24-D%4*8&255;x[A+D>>>2]|=O<<24-(A+D)%4*8}else for(var _=0;_>>2]=y[_>>>2];return this.sigBytes+=S,this},clamp:function(){var m=this.words,x=this.sigBytes;m[x>>>2]&=4294967295<<32-x%4*8,m.length=r.ceil(x/4)},clone:function(){var m=l.clone.call(this);return m.words=this.words.slice(0),m},random:function(m){for(var x=[],y=0;y>>2]>>>24-S%4*8&255;A.push((D>>>4).toString(16)),A.push((D&15).toString(16))}return A.join("")},parse:function(m){for(var x=m.length,y=[],A=0;A>>3]|=parseInt(m.substr(A,2),16)<<24-A%8*4;return new d.init(y,x/2)}},p=f.Latin1={stringify:function(m){for(var x=m.words,y=m.sigBytes,A=[],S=0;S>>2]>>>24-S%4*8&255;A.push(String.fromCharCode(D))}return A.join("")},parse:function(m){for(var x=m.length,y=[],A=0;A>>2]|=(m.charCodeAt(A)&255)<<24-A%4*8;return new d.init(y,x)}},b=f.Utf8={stringify:function(m){try{return decodeURIComponent(escape(p.stringify(m)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(m){return p.parse(unescape(encodeURIComponent(m)))}},v=c.BufferedBlockAlgorithm=l.extend({reset:function(){this._data=new d.init,this._nDataBytes=0},_append:function(m){typeof m=="string"&&(m=b.parse(m)),this._data.concat(m),this._nDataBytes+=m.sigBytes},_process:function(m){var x,y=this._data,A=y.words,S=y.sigBytes,D=this.blockSize,O=D*4,_=S/O;m?_=r.ceil(_):_=r.max((_|0)-this._minBufferSize,0);var E=_*D,C=r.min(E*4,S);if(E){for(var P=0;P>>2]|=u[d]<<24-d%4*8;a.call(this,l,c)}else a.apply(this,arguments)};o.prototype=i}}(),t.lib.WordArray})}($6)),$6.exports}var H6={exports:{}},xm;function IO(){return xm||(xm=1,function(n,e){(function(t,r){n.exports=r(qe())})(oe,function(t){return function(){var r=t,s=r.lib,i=s.WordArray,a=r.enc;a.Utf16=a.Utf16BE={stringify:function(u){for(var c=u.words,l=u.sigBytes,d=[],f=0;f>>2]>>>16-f%4*8&65535;d.push(String.fromCharCode(h))}return d.join("")},parse:function(u){for(var c=u.length,l=[],d=0;d>>1]|=u.charCodeAt(d)<<16-d%2*16;return i.create(l,c*2)}},a.Utf16LE={stringify:function(u){for(var c=u.words,l=u.sigBytes,d=[],f=0;f>>2]>>>16-f%4*8&65535);d.push(String.fromCharCode(h))}return d.join("")},parse:function(u){for(var c=u.length,l=[],d=0;d>>1]|=o(u.charCodeAt(d)<<16-d%2*16);return i.create(l,c*2)}};function o(u){return u<<8&4278255360|u>>>8&16711935}}(),t.enc.Utf16})}(H6)),H6.exports}var G6={exports:{}},wm;function Mc(){return wm||(wm=1,function(n,e){(function(t,r){n.exports=r(qe())})(oe,function(t){return function(){var r=t,s=r.lib,i=s.WordArray,a=r.enc;a.Base64={stringify:function(u){var c=u.words,l=u.sigBytes,d=this._map;u.clamp();for(var f=[],h=0;h>>2]>>>24-h%4*8&255,b=c[h+1>>>2]>>>24-(h+1)%4*8&255,v=c[h+2>>>2]>>>24-(h+2)%4*8&255,w=p<<16|b<<8|v,m=0;m<4&&h+m*.75>>6*(3-m)&63));var x=d.charAt(64);if(x)for(;f.length%4;)f.push(x);return f.join("")},parse:function(u){var c=u.length,l=this._map,d=this._reverseMap;if(!d){d=this._reverseMap=[];for(var f=0;f>>6-h%4*2,v=p|b;d[f>>>2]|=v<<24-f%4*8,f++}return i.create(d,f)}}(),t.enc.Base64})}(G6)),G6.exports}var z6={exports:{}},vm;function BO(){return vm||(vm=1,function(n,e){(function(t,r){n.exports=r(qe())})(oe,function(t){return function(){var r=t,s=r.lib,i=s.WordArray,a=r.enc;a.Base64url={stringify:function(u,c=!0){var l=u.words,d=u.sigBytes,f=c?this._safe_map:this._map;u.clamp();for(var h=[],p=0;p>>2]>>>24-p%4*8&255,v=l[p+1>>>2]>>>24-(p+1)%4*8&255,w=l[p+2>>>2]>>>24-(p+2)%4*8&255,m=b<<16|v<<8|w,x=0;x<4&&p+x*.75>>6*(3-x)&63));var y=f.charAt(64);if(y)for(;h.length%4;)h.push(y);return h.join("")},parse:function(u,c=!0){var l=u.length,d=c?this._safe_map:this._map,f=this._reverseMap;if(!f){f=this._reverseMap=[];for(var h=0;h>>6-h%4*2,v=p|b;d[f>>>2]|=v<<24-f%4*8,f++}return i.create(d,f)}}(),t.enc.Base64url})}(z6)),z6.exports}var W6={exports:{}},Am;function jc(){return Am||(Am=1,function(n,e){(function(t,r){n.exports=r(qe())})(oe,function(t){return function(r){var s=t,i=s.lib,a=i.WordArray,o=i.Hasher,u=s.algo,c=[];(function(){for(var b=0;b<64;b++)c[b]=r.abs(r.sin(b+1))*4294967296|0})();var l=u.MD5=o.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(b,v){for(var w=0;w<16;w++){var m=v+w,x=b[m];b[m]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360}var y=this._hash.words,A=b[v+0],S=b[v+1],D=b[v+2],O=b[v+3],_=b[v+4],E=b[v+5],C=b[v+6],P=b[v+7],I=b[v+8],j=b[v+9],z=b[v+10],F=b[v+11],W=b[v+12],H=b[v+13],L=b[v+14],M=b[v+15],T=y[0],B=y[1],N=y[2],K=y[3];T=d(T,B,N,K,A,7,c[0]),K=d(K,T,B,N,S,12,c[1]),N=d(N,K,T,B,D,17,c[2]),B=d(B,N,K,T,O,22,c[3]),T=d(T,B,N,K,_,7,c[4]),K=d(K,T,B,N,E,12,c[5]),N=d(N,K,T,B,C,17,c[6]),B=d(B,N,K,T,P,22,c[7]),T=d(T,B,N,K,I,7,c[8]),K=d(K,T,B,N,j,12,c[9]),N=d(N,K,T,B,z,17,c[10]),B=d(B,N,K,T,F,22,c[11]),T=d(T,B,N,K,W,7,c[12]),K=d(K,T,B,N,H,12,c[13]),N=d(N,K,T,B,L,17,c[14]),B=d(B,N,K,T,M,22,c[15]),T=f(T,B,N,K,S,5,c[16]),K=f(K,T,B,N,C,9,c[17]),N=f(N,K,T,B,F,14,c[18]),B=f(B,N,K,T,A,20,c[19]),T=f(T,B,N,K,E,5,c[20]),K=f(K,T,B,N,z,9,c[21]),N=f(N,K,T,B,M,14,c[22]),B=f(B,N,K,T,_,20,c[23]),T=f(T,B,N,K,j,5,c[24]),K=f(K,T,B,N,L,9,c[25]),N=f(N,K,T,B,O,14,c[26]),B=f(B,N,K,T,I,20,c[27]),T=f(T,B,N,K,H,5,c[28]),K=f(K,T,B,N,D,9,c[29]),N=f(N,K,T,B,P,14,c[30]),B=f(B,N,K,T,W,20,c[31]),T=h(T,B,N,K,E,4,c[32]),K=h(K,T,B,N,I,11,c[33]),N=h(N,K,T,B,F,16,c[34]),B=h(B,N,K,T,L,23,c[35]),T=h(T,B,N,K,S,4,c[36]),K=h(K,T,B,N,_,11,c[37]),N=h(N,K,T,B,P,16,c[38]),B=h(B,N,K,T,z,23,c[39]),T=h(T,B,N,K,H,4,c[40]),K=h(K,T,B,N,A,11,c[41]),N=h(N,K,T,B,O,16,c[42]),B=h(B,N,K,T,C,23,c[43]),T=h(T,B,N,K,j,4,c[44]),K=h(K,T,B,N,W,11,c[45]),N=h(N,K,T,B,M,16,c[46]),B=h(B,N,K,T,D,23,c[47]),T=p(T,B,N,K,A,6,c[48]),K=p(K,T,B,N,P,10,c[49]),N=p(N,K,T,B,L,15,c[50]),B=p(B,N,K,T,E,21,c[51]),T=p(T,B,N,K,W,6,c[52]),K=p(K,T,B,N,O,10,c[53]),N=p(N,K,T,B,z,15,c[54]),B=p(B,N,K,T,S,21,c[55]),T=p(T,B,N,K,I,6,c[56]),K=p(K,T,B,N,M,10,c[57]),N=p(N,K,T,B,C,15,c[58]),B=p(B,N,K,T,H,21,c[59]),T=p(T,B,N,K,_,6,c[60]),K=p(K,T,B,N,F,10,c[61]),N=p(N,K,T,B,D,15,c[62]),B=p(B,N,K,T,j,21,c[63]),y[0]=y[0]+T|0,y[1]=y[1]+B|0,y[2]=y[2]+N|0,y[3]=y[3]+K|0},_doFinalize:function(){var b=this._data,v=b.words,w=this._nDataBytes*8,m=b.sigBytes*8;v[m>>>5]|=128<<24-m%32;var x=r.floor(w/4294967296),y=w;v[(m+64>>>9<<4)+15]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,v[(m+64>>>9<<4)+14]=(y<<8|y>>>24)&16711935|(y<<24|y>>>8)&4278255360,b.sigBytes=(v.length+1)*4,this._process();for(var A=this._hash,S=A.words,D=0;D<4;D++){var O=S[D];S[D]=(O<<8|O>>>24)&16711935|(O<<24|O>>>8)&4278255360}return A},clone:function(){var b=o.clone.call(this);return b._hash=this._hash.clone(),b}});function d(b,v,w,m,x,y,A){var S=b+(v&w|~v&m)+x+A;return(S<>>32-y)+v}function f(b,v,w,m,x,y,A){var S=b+(v&m|w&~m)+x+A;return(S<>>32-y)+v}function h(b,v,w,m,x,y,A){var S=b+(v^w^m)+x+A;return(S<>>32-y)+v}function p(b,v,w,m,x,y,A){var S=b+(w^(v|~m))+x+A;return(S<>>32-y)+v}s.MD5=o._createHelper(l),s.HmacMD5=o._createHmacHelper(l)}(Math),t.MD5})}(W6)),W6.exports}var K6={exports:{}},Em;function mb(){return Em||(Em=1,function(n,e){(function(t,r){n.exports=r(qe())})(oe,function(t){return function(){var r=t,s=r.lib,i=s.WordArray,a=s.Hasher,o=r.algo,u=[],c=o.SHA1=a.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(l,d){for(var f=this._hash.words,h=f[0],p=f[1],b=f[2],v=f[3],w=f[4],m=0;m<80;m++){if(m<16)u[m]=l[d+m]|0;else{var x=u[m-3]^u[m-8]^u[m-14]^u[m-16];u[m]=x<<1|x>>>31}var y=(h<<5|h>>>27)+w+u[m];m<20?y+=(p&b|~p&v)+1518500249:m<40?y+=(p^b^v)+1859775393:m<60?y+=(p&b|p&v|b&v)-1894007588:y+=(p^b^v)-899497514,w=v,v=b,b=p<<30|p>>>2,p=h,h=y}f[0]=f[0]+h|0,f[1]=f[1]+p|0,f[2]=f[2]+b|0,f[3]=f[3]+v|0,f[4]=f[4]+w|0},_doFinalize:function(){var l=this._data,d=l.words,f=this._nDataBytes*8,h=l.sigBytes*8;return d[h>>>5]|=128<<24-h%32,d[(h+64>>>9<<4)+14]=Math.floor(f/4294967296),d[(h+64>>>9<<4)+15]=f,l.sigBytes=d.length*4,this._process(),this._hash},clone:function(){var l=a.clone.call(this);return l._hash=this._hash.clone(),l}});r.SHA1=a._createHelper(c),r.HmacSHA1=a._createHmacHelper(c)}(),t.SHA1})}(K6)),K6.exports}var V6={exports:{}},_m;function Hv(){return _m||(_m=1,function(n,e){(function(t,r){n.exports=r(qe())})(oe,function(t){return function(r){var s=t,i=s.lib,a=i.WordArray,o=i.Hasher,u=s.algo,c=[],l=[];(function(){function h(w){for(var m=r.sqrt(w),x=2;x<=m;x++)if(!(w%x))return!1;return!0}function p(w){return(w-(w|0))*4294967296|0}for(var b=2,v=0;v<64;)h(b)&&(v<8&&(c[v]=p(r.pow(b,1/2))),l[v]=p(r.pow(b,1/3)),v++),b++})();var d=[],f=u.SHA256=o.extend({_doReset:function(){this._hash=new a.init(c.slice(0))},_doProcessBlock:function(h,p){for(var b=this._hash.words,v=b[0],w=b[1],m=b[2],x=b[3],y=b[4],A=b[5],S=b[6],D=b[7],O=0;O<64;O++){if(O<16)d[O]=h[p+O]|0;else{var _=d[O-15],E=(_<<25|_>>>7)^(_<<14|_>>>18)^_>>>3,C=d[O-2],P=(C<<15|C>>>17)^(C<<13|C>>>19)^C>>>10;d[O]=E+d[O-7]+P+d[O-16]}var I=y&A^~y&S,j=v&w^v&m^w&m,z=(v<<30|v>>>2)^(v<<19|v>>>13)^(v<<10|v>>>22),F=(y<<26|y>>>6)^(y<<21|y>>>11)^(y<<7|y>>>25),W=D+F+I+l[O]+d[O],H=z+j;D=S,S=A,A=y,y=x+W|0,x=m,m=w,w=v,v=W+H|0}b[0]=b[0]+v|0,b[1]=b[1]+w|0,b[2]=b[2]+m|0,b[3]=b[3]+x|0,b[4]=b[4]+y|0,b[5]=b[5]+A|0,b[6]=b[6]+S|0,b[7]=b[7]+D|0},_doFinalize:function(){var h=this._data,p=h.words,b=this._nDataBytes*8,v=h.sigBytes*8;return p[v>>>5]|=128<<24-v%32,p[(v+64>>>9<<4)+14]=r.floor(b/4294967296),p[(v+64>>>9<<4)+15]=b,h.sigBytes=p.length*4,this._process(),this._hash},clone:function(){var h=o.clone.call(this);return h._hash=this._hash.clone(),h}});s.SHA256=o._createHelper(f),s.HmacSHA256=o._createHmacHelper(f)}(Math),t.SHA256})}(V6)),V6.exports}var q6={exports:{}},Pm;function FO(){return Pm||(Pm=1,function(n,e){(function(t,r,s){n.exports=r(qe(),Hv())})(oe,function(t){return function(){var r=t,s=r.lib,i=s.WordArray,a=r.algo,o=a.SHA256,u=a.SHA224=o.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var c=o._doFinalize.call(this);return c.sigBytes-=4,c}});r.SHA224=o._createHelper(u),r.HmacSHA224=o._createHmacHelper(u)}(),t.SHA224})}(q6)),q6.exports}var J6={exports:{}},km;function Gv(){return km||(km=1,function(n,e){(function(t,r,s){n.exports=r(qe(),Fh())})(oe,function(t){return function(){var r=t,s=r.lib,i=s.Hasher,a=r.x64,o=a.Word,u=a.WordArray,c=r.algo;function l(){return o.create.apply(o,arguments)}var d=[l(1116352408,3609767458),l(1899447441,602891725),l(3049323471,3964484399),l(3921009573,2173295548),l(961987163,4081628472),l(1508970993,3053834265),l(2453635748,2937671579),l(2870763221,3664609560),l(3624381080,2734883394),l(310598401,1164996542),l(607225278,1323610764),l(1426881987,3590304994),l(1925078388,4068182383),l(2162078206,991336113),l(2614888103,633803317),l(3248222580,3479774868),l(3835390401,2666613458),l(4022224774,944711139),l(264347078,2341262773),l(604807628,2007800933),l(770255983,1495990901),l(1249150122,1856431235),l(1555081692,3175218132),l(1996064986,2198950837),l(2554220882,3999719339),l(2821834349,766784016),l(2952996808,2566594879),l(3210313671,3203337956),l(3336571891,1034457026),l(3584528711,2466948901),l(113926993,3758326383),l(338241895,168717936),l(666307205,1188179964),l(773529912,1546045734),l(1294757372,1522805485),l(1396182291,2643833823),l(1695183700,2343527390),l(1986661051,1014477480),l(2177026350,1206759142),l(2456956037,344077627),l(2730485921,1290863460),l(2820302411,3158454273),l(3259730800,3505952657),l(3345764771,106217008),l(3516065817,3606008344),l(3600352804,1432725776),l(4094571909,1467031594),l(275423344,851169720),l(430227734,3100823752),l(506948616,1363258195),l(659060556,3750685593),l(883997877,3785050280),l(958139571,3318307427),l(1322822218,3812723403),l(1537002063,2003034995),l(1747873779,3602036899),l(1955562222,1575990012),l(2024104815,1125592928),l(2227730452,2716904306),l(2361852424,442776044),l(2428436474,593698344),l(2756734187,3733110249),l(3204031479,2999351573),l(3329325298,3815920427),l(3391569614,3928383900),l(3515267271,566280711),l(3940187606,3454069534),l(4118630271,4000239992),l(116418474,1914138554),l(174292421,2731055270),l(289380356,3203993006),l(460393269,320620315),l(685471733,587496836),l(852142971,1086792851),l(1017036298,365543100),l(1126000580,2618297676),l(1288033470,3409855158),l(1501505948,4234509866),l(1607167915,987167468),l(1816402316,1246189591)],f=[];(function(){for(var p=0;p<80;p++)f[p]=l()})();var h=c.SHA512=i.extend({_doReset:function(){this._hash=new u.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(p,b){for(var v=this._hash.words,w=v[0],m=v[1],x=v[2],y=v[3],A=v[4],S=v[5],D=v[6],O=v[7],_=w.high,E=w.low,C=m.high,P=m.low,I=x.high,j=x.low,z=y.high,F=y.low,W=A.high,H=A.low,L=S.high,M=S.low,T=D.high,B=D.low,N=O.high,K=O.low,te=_,ne=E,le=C,ie=P,pe=I,xe=j,me=z,be=F,Ie=W,X=H,Ae=L,Oe=M,Me=T,Qe=B,Ye=N,ge=K,q=0;q<80;q++){var V,U,G=f[q];if(q<16)U=G.high=p[b+q*2]|0,V=G.low=p[b+q*2+1]|0;else{var Y=f[q-15],J=Y.high,ee=Y.low,ue=(J>>>1|ee<<31)^(J>>>8|ee<<24)^J>>>7,_e=(ee>>>1|J<<31)^(ee>>>8|J<<24)^(ee>>>7|J<<25),he=f[q-2],Ue=he.high,rt=he.low,At=(Ue>>>19|rt<<13)^(Ue<<3|rt>>>29)^Ue>>>6,qc=(rt>>>19|Ue<<13)^(rt<<3|Ue>>>29)^(rt>>>6|Ue<<26),u6=f[q-7],l6=u6.high,ui=u6.low,rg=f[q-16],vE=rg.high,sg=rg.low;V=_e+ui,U=ue+l6+(V>>>0<_e>>>0?1:0),V=V+qc,U=U+At+(V>>>0>>0?1:0),V=V+sg,U=U+vE+(V>>>0>>0?1:0),G.high=U,G.low=V}var AE=Ie&Ae^~Ie&Me,ig=X&Oe^~X&Qe,EE=te&le^te&pe^le&pe,_E=ne&ie^ne&xe^ie&xe,PE=(te>>>28|ne<<4)^(te<<30|ne>>>2)^(te<<25|ne>>>7),ag=(ne>>>28|te<<4)^(ne<<30|te>>>2)^(ne<<25|te>>>7),kE=(Ie>>>14|X<<18)^(Ie>>>18|X<<14)^(Ie<<23|X>>>9),CE=(X>>>14|Ie<<18)^(X>>>18|Ie<<14)^(X<<23|Ie>>>9),og=d[q],SE=og.high,cg=og.low,Pn=ge+CE,li=Ye+kE+(Pn>>>0>>0?1:0),Pn=Pn+ig,li=li+AE+(Pn>>>0>>0?1:0),Pn=Pn+cg,li=li+SE+(Pn>>>0>>0?1:0),Pn=Pn+V,li=li+U+(Pn>>>0>>0?1:0),ug=ag+_E,RE=PE+EE+(ug>>>0>>0?1:0);Ye=Me,ge=Qe,Me=Ae,Qe=Oe,Ae=Ie,Oe=X,X=be+Pn|0,Ie=me+li+(X>>>0>>0?1:0)|0,me=pe,be=xe,pe=le,xe=ie,le=te,ie=ne,ne=Pn+ug|0,te=li+RE+(ne>>>0>>0?1:0)|0}E=w.low=E+ne,w.high=_+te+(E>>>0>>0?1:0),P=m.low=P+ie,m.high=C+le+(P>>>0>>0?1:0),j=x.low=j+xe,x.high=I+pe+(j>>>0>>0?1:0),F=y.low=F+be,y.high=z+me+(F>>>0>>0?1:0),H=A.low=H+X,A.high=W+Ie+(H>>>0>>0?1:0),M=S.low=M+Oe,S.high=L+Ae+(M>>>0>>0?1:0),B=D.low=B+Qe,D.high=T+Me+(B>>>0>>0?1:0),K=O.low=K+ge,O.high=N+Ye+(K>>>0>>0?1:0)},_doFinalize:function(){var p=this._data,b=p.words,v=this._nDataBytes*8,w=p.sigBytes*8;b[w>>>5]|=128<<24-w%32,b[(w+128>>>10<<5)+30]=Math.floor(v/4294967296),b[(w+128>>>10<<5)+31]=v,p.sigBytes=b.length*4,this._process();var m=this._hash.toX32();return m},clone:function(){var p=i.clone.call(this);return p._hash=this._hash.clone(),p},blockSize:1024/32});r.SHA512=i._createHelper(h),r.HmacSHA512=i._createHmacHelper(h)}(),t.SHA512})}(J6)),J6.exports}var Q6={exports:{}},Cm;function UO(){return Cm||(Cm=1,function(n,e){(function(t,r,s){n.exports=r(qe(),Fh(),Gv())})(oe,function(t){return function(){var r=t,s=r.x64,i=s.Word,a=s.WordArray,o=r.algo,u=o.SHA512,c=o.SHA384=u.extend({_doReset:function(){this._hash=new a.init([new i.init(3418070365,3238371032),new i.init(1654270250,914150663),new i.init(2438529370,812702999),new i.init(355462360,4144912697),new i.init(1731405415,4290775857),new i.init(2394180231,1750603025),new i.init(3675008525,1694076839),new i.init(1203062813,3204075428)])},_doFinalize:function(){var l=u._doFinalize.call(this);return l.sigBytes-=16,l}});r.SHA384=u._createHelper(c),r.HmacSHA384=u._createHmacHelper(c)}(),t.SHA384})}(Q6)),Q6.exports}var Y6={exports:{}},Sm;function LO(){return Sm||(Sm=1,function(n,e){(function(t,r,s){n.exports=r(qe(),Fh())})(oe,function(t){return function(r){var s=t,i=s.lib,a=i.WordArray,o=i.Hasher,u=s.x64,c=u.Word,l=s.algo,d=[],f=[],h=[];(function(){for(var v=1,w=0,m=0;m<24;m++){d[v+5*w]=(m+1)*(m+2)/2%64;var x=w%5,y=(2*v+3*w)%5;v=x,w=y}for(var v=0;v<5;v++)for(var w=0;w<5;w++)f[v+5*w]=w+(2*v+3*w)%5*5;for(var A=1,S=0;S<24;S++){for(var D=0,O=0,_=0;_<7;_++){if(A&1){var E=(1<<_)-1;E<32?O^=1<>>24)&16711935|(A<<24|A>>>8)&4278255360,S=(S<<8|S>>>24)&16711935|(S<<24|S>>>8)&4278255360;var D=m[y];D.high^=S,D.low^=A}for(var O=0;O<24;O++){for(var _=0;_<5;_++){for(var E=0,C=0,P=0;P<5;P++){var D=m[_+5*P];E^=D.high,C^=D.low}var I=p[_];I.high=E,I.low=C}for(var _=0;_<5;_++)for(var j=p[(_+4)%5],z=p[(_+1)%5],F=z.high,W=z.low,E=j.high^(F<<1|W>>>31),C=j.low^(W<<1|F>>>31),P=0;P<5;P++){var D=m[_+5*P];D.high^=E,D.low^=C}for(var H=1;H<25;H++){var E,C,D=m[H],L=D.high,M=D.low,T=d[H];T<32?(E=L<>>32-T,C=M<>>32-T):(E=M<>>64-T,C=L<>>64-T);var B=p[f[H]];B.high=E,B.low=C}var N=p[0],K=m[0];N.high=K.high,N.low=K.low;for(var _=0;_<5;_++)for(var P=0;P<5;P++){var H=_+5*P,D=m[H],te=p[H],ne=p[(_+1)%5+5*P],le=p[(_+2)%5+5*P];D.high=te.high^~ne.high&le.high,D.low=te.low^~ne.low&le.low}var D=m[0],ie=h[O];D.high^=ie.high,D.low^=ie.low}},_doFinalize:function(){var v=this._data,w=v.words;this._nDataBytes*8;var m=v.sigBytes*8,x=this.blockSize*32;w[m>>>5]|=1<<24-m%32,w[(r.ceil((m+1)/x)*x>>>5)-1]|=128,v.sigBytes=w.length*4,this._process();for(var y=this._state,A=this.cfg.outputLength/8,S=A/8,D=[],O=0;O>>24)&16711935|(E<<24|E>>>8)&4278255360,C=(C<<8|C>>>24)&16711935|(C<<24|C>>>8)&4278255360,D.push(C),D.push(E)}return new a.init(D,A)},clone:function(){for(var v=o.clone.call(this),w=v._state=this._state.slice(0),m=0;m<25;m++)w[m]=w[m].clone();return v}});s.SHA3=o._createHelper(b),s.HmacSHA3=o._createHmacHelper(b)}(Math),t.SHA3})}(Y6)),Y6.exports}var Z6={exports:{}},Rm;function DO(){return Rm||(Rm=1,function(n,e){(function(t,r){n.exports=r(qe())})(oe,function(t){/** @preserve + (c) 2012 by Cédric Mesnil. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */return function(r){var s=t,i=s.lib,a=i.WordArray,o=i.Hasher,u=s.algo,c=a.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),l=a.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),d=a.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),f=a.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=a.create([0,1518500249,1859775393,2400959708,2840853838]),p=a.create([1352829926,1548603684,1836072691,2053994217,0]),b=u.RIPEMD160=o.extend({_doReset:function(){this._hash=a.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(S,D){for(var O=0;O<16;O++){var _=D+O,E=S[_];S[_]=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360}var C=this._hash.words,P=h.words,I=p.words,j=c.words,z=l.words,F=d.words,W=f.words,H,L,M,T,B,N,K,te,ne,le;N=H=C[0],K=L=C[1],te=M=C[2],ne=T=C[3],le=B=C[4];for(var ie,O=0;O<80;O+=1)ie=H+S[D+j[O]]|0,O<16?ie+=v(L,M,T)+P[0]:O<32?ie+=w(L,M,T)+P[1]:O<48?ie+=m(L,M,T)+P[2]:O<64?ie+=x(L,M,T)+P[3]:ie+=y(L,M,T)+P[4],ie=ie|0,ie=A(ie,F[O]),ie=ie+B|0,H=B,B=T,T=A(M,10),M=L,L=ie,ie=N+S[D+z[O]]|0,O<16?ie+=y(K,te,ne)+I[0]:O<32?ie+=x(K,te,ne)+I[1]:O<48?ie+=m(K,te,ne)+I[2]:O<64?ie+=w(K,te,ne)+I[3]:ie+=v(K,te,ne)+I[4],ie=ie|0,ie=A(ie,W[O]),ie=ie+le|0,N=le,le=ne,ne=A(te,10),te=K,K=ie;ie=C[1]+M+ne|0,C[1]=C[2]+T+le|0,C[2]=C[3]+B+N|0,C[3]=C[4]+H+K|0,C[4]=C[0]+L+te|0,C[0]=ie},_doFinalize:function(){var S=this._data,D=S.words,O=this._nDataBytes*8,_=S.sigBytes*8;D[_>>>5]|=128<<24-_%32,D[(_+64>>>9<<4)+14]=(O<<8|O>>>24)&16711935|(O<<24|O>>>8)&4278255360,S.sigBytes=(D.length+1)*4,this._process();for(var E=this._hash,C=E.words,P=0;P<5;P++){var I=C[P];C[P]=(I<<8|I>>>24)&16711935|(I<<24|I>>>8)&4278255360}return E},clone:function(){var S=o.clone.call(this);return S._hash=this._hash.clone(),S}});function v(S,D,O){return S^D^O}function w(S,D,O){return S&D|~S&O}function m(S,D,O){return(S|~D)^O}function x(S,D,O){return S&O|D&~O}function y(S,D,O){return S^(D|~O)}function A(S,D){return S<>>32-D}s.RIPEMD160=o._createHelper(b),s.HmacRIPEMD160=o._createHmacHelper(b)}(),t.RIPEMD160})}(Z6)),Z6.exports}var X6={exports:{}},Tm;function xb(){return Tm||(Tm=1,function(n,e){(function(t,r){n.exports=r(qe())})(oe,function(t){(function(){var r=t,s=r.lib,i=s.Base,a=r.enc,o=a.Utf8,u=r.algo;u.HMAC=i.extend({init:function(c,l){c=this._hasher=new c.init,typeof l=="string"&&(l=o.parse(l));var d=c.blockSize,f=d*4;l.sigBytes>f&&(l=c.finalize(l)),l.clamp();for(var h=this._oKey=l.clone(),p=this._iKey=l.clone(),b=h.words,v=p.words,w=0;w>>2]&255;E.sigBytes-=C}};i.BlockCipher=h.extend({cfg:h.cfg.extend({mode:v,padding:m}),reset:function(){var E;h.reset.call(this);var C=this.cfg,P=C.iv,I=C.mode;this._xformMode==this._ENC_XFORM_MODE?E=I.createEncryptor:(E=I.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==E?this._mode.init(this,P&&P.words):(this._mode=E.call(I,this,P&&P.words),this._mode.__creator=E)},_doProcessBlock:function(E,C){this._mode.processBlock(E,C)},_doFinalize:function(){var E,C=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(C.pad(this._data,this.blockSize),E=this._process(!0)):(E=this._process(!0),C.unpad(E)),E},blockSize:128/32});var x=i.CipherParams=a.extend({init:function(E){this.mixIn(E)},toString:function(E){return(E||this.formatter).stringify(this)}}),y=s.format={},A=y.OpenSSL={stringify:function(E){var C,P=E.ciphertext,I=E.salt;return I?C=o.create([1398893684,1701076831]).concat(I).concat(P):C=P,C.toString(l)},parse:function(E){var C,P=l.parse(E),I=P.words;return I[0]==1398893684&&I[1]==1701076831&&(C=o.create(I.slice(2,4)),I.splice(0,4),P.sigBytes-=16),x.create({ciphertext:P,salt:C})}},S=i.SerializableCipher=a.extend({cfg:a.extend({format:A}),encrypt:function(E,C,P,I){I=this.cfg.extend(I);var j=E.createEncryptor(P,I),z=j.finalize(C),F=j.cfg;return x.create({ciphertext:z,key:P,iv:F.iv,algorithm:E,mode:F.mode,padding:F.padding,blockSize:E.blockSize,formatter:I.format})},decrypt:function(E,C,P,I){I=this.cfg.extend(I),C=this._parse(C,I.format);var j=E.createDecryptor(P,I).finalize(C.ciphertext);return j},_parse:function(E,C){return typeof E=="string"?C.parse(E,this):E}}),D=s.kdf={},O=D.OpenSSL={execute:function(E,C,P,I){I||(I=o.random(64/8));var j=f.create({keySize:C+P}).compute(E,I),z=o.create(j.words.slice(C),P*4);return j.sigBytes=C*4,x.create({key:j,iv:z,salt:I})}},_=i.PasswordBasedCipher=S.extend({cfg:S.cfg.extend({kdf:O}),encrypt:function(E,C,P,I){I=this.cfg.extend(I);var j=I.kdf.execute(P,E.keySize,E.ivSize);I.iv=j.iv;var z=S.encrypt.call(this,E,C,j.key,I);return z.mixIn(j),z},decrypt:function(E,C,P,I){I=this.cfg.extend(I),C=this._parse(C,I.format);var j=I.kdf.execute(P,E.keySize,E.ivSize,C.salt);I.iv=j.iv;var z=S.decrypt.call(this,E,C,j.key,I);return z}})}()})}(n2)),n2.exports}var r2={exports:{}},Bm;function jO(){return Bm||(Bm=1,function(n,e){(function(t,r,s){n.exports=r(qe(),Lt())})(oe,function(t){return t.mode.CFB=function(){var r=t.lib.BlockCipherMode.extend();r.Encryptor=r.extend({processBlock:function(i,a){var o=this._cipher,u=o.blockSize;s.call(this,i,a,u,o),this._prevBlock=i.slice(a,a+u)}}),r.Decryptor=r.extend({processBlock:function(i,a){var o=this._cipher,u=o.blockSize,c=i.slice(a,a+u);s.call(this,i,a,u,o),this._prevBlock=c}});function s(i,a,o,u){var c,l=this._iv;l?(c=l.slice(0),this._iv=void 0):c=this._prevBlock,u.encryptBlock(c,0);for(var d=0;d>24&255)===255){var u=o>>16&255,c=o>>8&255,l=o&255;u===255?(u=0,c===255?(c=0,l===255?l=0:++l):++c):++u,o=0,o+=u<<16,o+=c<<8,o+=l}else o+=1<<24;return o}function i(o){return(o[0]=s(o[0]))===0&&(o[1]=s(o[1])),o}var a=r.Encryptor=r.extend({processBlock:function(o,u){var c=this._cipher,l=c.blockSize,d=this._iv,f=this._counter;d&&(f=this._counter=d.slice(0),this._iv=void 0),i(f);var h=f.slice(0);c.encryptBlock(h,0);for(var p=0;p>>2]|=o<<24-u%4*8,r.sigBytes+=o},unpad:function(r){var s=r.words[r.sigBytes-1>>>2]&255;r.sigBytes-=s}},t.pad.Ansix923})}(c2)),c2.exports}var u2={exports:{}},jm;function KO(){return jm||(jm=1,function(n,e){(function(t,r,s){n.exports=r(qe(),Lt())})(oe,function(t){return t.pad.Iso10126={pad:function(r,s){var i=s*4,a=i-r.sigBytes%i;r.concat(t.lib.WordArray.random(a-1)).concat(t.lib.WordArray.create([a<<24],1))},unpad:function(r){var s=r.words[r.sigBytes-1>>>2]&255;r.sigBytes-=s}},t.pad.Iso10126})}(u2)),u2.exports}var l2={exports:{}},$m;function VO(){return $m||($m=1,function(n,e){(function(t,r,s){n.exports=r(qe(),Lt())})(oe,function(t){return t.pad.Iso97971={pad:function(r,s){r.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(r,s)},unpad:function(r){t.pad.ZeroPadding.unpad(r),r.sigBytes--}},t.pad.Iso97971})}(l2)),l2.exports}var f2={exports:{}},Hm;function qO(){return Hm||(Hm=1,function(n,e){(function(t,r,s){n.exports=r(qe(),Lt())})(oe,function(t){return t.pad.ZeroPadding={pad:function(r,s){var i=s*4;r.clamp(),r.sigBytes+=i-(r.sigBytes%i||i)},unpad:function(r){for(var s=r.words,i=r.sigBytes-1,i=r.sigBytes-1;i>=0;i--)if(s[i>>>2]>>>24-i%4*8&255){r.sigBytes=i+1;break}}},t.pad.ZeroPadding})}(f2)),f2.exports}var d2={exports:{}},Gm;function JO(){return Gm||(Gm=1,function(n,e){(function(t,r,s){n.exports=r(qe(),Lt())})(oe,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})}(d2)),d2.exports}var h2={exports:{}},zm;function QO(){return zm||(zm=1,function(n,e){(function(t,r,s){n.exports=r(qe(),Lt())})(oe,function(t){return function(r){var s=t,i=s.lib,a=i.CipherParams,o=s.enc,u=o.Hex,c=s.format;c.Hex={stringify:function(l){return l.ciphertext.toString(u)},parse:function(l){var d=u.parse(l);return a.create({ciphertext:d})}}}(),t.format.Hex})}(h2)),h2.exports}var p2={exports:{}},Wm;function YO(){return Wm||(Wm=1,function(n,e){(function(t,r,s){n.exports=r(qe(),Mc(),jc(),Ua(),Lt())})(oe,function(t){return function(){var r=t,s=r.lib,i=s.BlockCipher,a=r.algo,o=[],u=[],c=[],l=[],d=[],f=[],h=[],p=[],b=[],v=[];(function(){for(var x=[],y=0;y<256;y++)y<128?x[y]=y<<1:x[y]=y<<1^283;for(var A=0,S=0,y=0;y<256;y++){var D=S^S<<1^S<<2^S<<3^S<<4;D=D>>>8^D&255^99,o[A]=D,u[D]=A;var O=x[A],_=x[O],E=x[_],C=x[D]*257^D*16843008;c[A]=C<<24|C>>>8,l[A]=C<<16|C>>>16,d[A]=C<<8|C>>>24,f[A]=C;var C=E*16843009^_*65537^O*257^A*16843008;h[D]=C<<24|C>>>8,p[D]=C<<16|C>>>16,b[D]=C<<8|C>>>24,v[D]=C,A?(A=O^x[x[x[E^O]]],S^=x[x[S]]):A=S=1}})();var w=[0,1,2,4,8,16,32,64,128,27,54],m=a.AES=i.extend({_doReset:function(){var x;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var y=this._keyPriorReset=this._key,A=y.words,S=y.sigBytes/4,D=this._nRounds=S+6,O=(D+1)*4,_=this._keySchedule=[],E=0;E6&&E%S==4&&(x=o[x>>>24]<<24|o[x>>>16&255]<<16|o[x>>>8&255]<<8|o[x&255]):(x=x<<8|x>>>24,x=o[x>>>24]<<24|o[x>>>16&255]<<16|o[x>>>8&255]<<8|o[x&255],x^=w[E/S|0]<<24),_[E]=_[E-S]^x);for(var C=this._invKeySchedule=[],P=0;P>>24]]^p[o[x>>>16&255]]^b[o[x>>>8&255]]^v[o[x&255]]}}},encryptBlock:function(x,y){this._doCryptBlock(x,y,this._keySchedule,c,l,d,f,o)},decryptBlock:function(x,y){var A=x[y+1];x[y+1]=x[y+3],x[y+3]=A,this._doCryptBlock(x,y,this._invKeySchedule,h,p,b,v,u);var A=x[y+1];x[y+1]=x[y+3],x[y+3]=A},_doCryptBlock:function(x,y,A,S,D,O,_,E){for(var C=this._nRounds,P=x[y]^A[0],I=x[y+1]^A[1],j=x[y+2]^A[2],z=x[y+3]^A[3],F=4,W=1;W>>24]^D[I>>>16&255]^O[j>>>8&255]^_[z&255]^A[F++],L=S[I>>>24]^D[j>>>16&255]^O[z>>>8&255]^_[P&255]^A[F++],M=S[j>>>24]^D[z>>>16&255]^O[P>>>8&255]^_[I&255]^A[F++],T=S[z>>>24]^D[P>>>16&255]^O[I>>>8&255]^_[j&255]^A[F++];P=H,I=L,j=M,z=T}var H=(E[P>>>24]<<24|E[I>>>16&255]<<16|E[j>>>8&255]<<8|E[z&255])^A[F++],L=(E[I>>>24]<<24|E[j>>>16&255]<<16|E[z>>>8&255]<<8|E[P&255])^A[F++],M=(E[j>>>24]<<24|E[z>>>16&255]<<16|E[P>>>8&255]<<8|E[I&255])^A[F++],T=(E[z>>>24]<<24|E[P>>>16&255]<<16|E[I>>>8&255]<<8|E[j&255])^A[F++];x[y]=H,x[y+1]=L,x[y+2]=M,x[y+3]=T},keySize:256/32});r.AES=i._createHelper(m)}(),t.AES})}(p2)),p2.exports}var b2={exports:{}},Km;function ZO(){return Km||(Km=1,function(n,e){(function(t,r,s){n.exports=r(qe(),Mc(),jc(),Ua(),Lt())})(oe,function(t){return function(){var r=t,s=r.lib,i=s.WordArray,a=s.BlockCipher,o=r.algo,u=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],c=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],l=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],d=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],f=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=o.DES=a.extend({_doReset:function(){for(var w=this._key,m=w.words,x=[],y=0;y<56;y++){var A=u[y]-1;x[y]=m[A>>>5]>>>31-A%32&1}for(var S=this._subKeys=[],D=0;D<16;D++){for(var O=S[D]=[],_=l[D],y=0;y<24;y++)O[y/6|0]|=x[(c[y]-1+_)%28]<<31-y%6,O[4+(y/6|0)]|=x[28+(c[y+24]-1+_)%28]<<31-y%6;O[0]=O[0]<<1|O[0]>>>31;for(var y=1;y<7;y++)O[y]=O[y]>>>(y-1)*4+3;O[7]=O[7]<<5|O[7]>>>27}for(var E=this._invSubKeys=[],y=0;y<16;y++)E[y]=S[15-y]},encryptBlock:function(w,m){this._doCryptBlock(w,m,this._subKeys)},decryptBlock:function(w,m){this._doCryptBlock(w,m,this._invSubKeys)},_doCryptBlock:function(w,m,x){this._lBlock=w[m],this._rBlock=w[m+1],p.call(this,4,252645135),p.call(this,16,65535),b.call(this,2,858993459),b.call(this,8,16711935),p.call(this,1,1431655765);for(var y=0;y<16;y++){for(var A=x[y],S=this._lBlock,D=this._rBlock,O=0,_=0;_<8;_++)O|=d[_][((D^A[_])&f[_])>>>0];this._lBlock=D,this._rBlock=S^O}var E=this._lBlock;this._lBlock=this._rBlock,this._rBlock=E,p.call(this,1,1431655765),b.call(this,8,16711935),b.call(this,2,858993459),p.call(this,16,65535),p.call(this,4,252645135),w[m]=this._lBlock,w[m+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function p(w,m){var x=(this._lBlock>>>w^this._rBlock)&m;this._rBlock^=x,this._lBlock^=x<>>w^this._lBlock)&m;this._lBlock^=x,this._rBlock^=x<192.");var x=m.slice(0,2),y=m.length<4?m.slice(0,2):m.slice(2,4),A=m.length<6?m.slice(0,2):m.slice(4,6);this._des1=h.createEncryptor(i.create(x)),this._des2=h.createEncryptor(i.create(y)),this._des3=h.createEncryptor(i.create(A))},encryptBlock:function(w,m){this._des1.encryptBlock(w,m),this._des2.decryptBlock(w,m),this._des3.encryptBlock(w,m)},decryptBlock:function(w,m){this._des3.decryptBlock(w,m),this._des2.encryptBlock(w,m),this._des1.decryptBlock(w,m)},keySize:192/32,ivSize:64/32,blockSize:64/32});r.TripleDES=a._createHelper(v)}(),t.TripleDES})}(b2)),b2.exports}var g2={exports:{}},Vm;function XO(){return Vm||(Vm=1,function(n,e){(function(t,r,s){n.exports=r(qe(),Mc(),jc(),Ua(),Lt())})(oe,function(t){return function(){var r=t,s=r.lib,i=s.StreamCipher,a=r.algo,o=a.RC4=i.extend({_doReset:function(){for(var l=this._key,d=l.words,f=l.sigBytes,h=this._S=[],p=0;p<256;p++)h[p]=p;for(var p=0,b=0;p<256;p++){var v=p%f,w=d[v>>>2]>>>24-v%4*8&255;b=(b+h[p]+w)%256;var m=h[p];h[p]=h[b],h[b]=m}this._i=this._j=0},_doProcessBlock:function(l,d){l[d]^=u.call(this)},keySize:256/32,ivSize:0});function u(){for(var l=this._S,d=this._i,f=this._j,h=0,p=0;p<4;p++){d=(d+1)%256,f=(f+l[d])%256;var b=l[d];l[d]=l[f],l[f]=b,h|=l[(l[d]+l[f])%256]<<24-p*8}return this._i=d,this._j=f,h}r.RC4=i._createHelper(o);var c=a.RC4Drop=o.extend({cfg:o.cfg.extend({drop:192}),_doReset:function(){o._doReset.call(this);for(var l=this.cfg.drop;l>0;l--)u.call(this)}});r.RC4Drop=i._createHelper(c)}(),t.RC4})}(g2)),g2.exports}var y2={exports:{}},qm;function eN(){return qm||(qm=1,function(n,e){(function(t,r,s){n.exports=r(qe(),Mc(),jc(),Ua(),Lt())})(oe,function(t){return function(){var r=t,s=r.lib,i=s.StreamCipher,a=r.algo,o=[],u=[],c=[],l=a.Rabbit=i.extend({_doReset:function(){for(var f=this._key.words,h=this.cfg.iv,p=0;p<4;p++)f[p]=(f[p]<<8|f[p]>>>24)&16711935|(f[p]<<24|f[p]>>>8)&4278255360;var b=this._X=[f[0],f[3]<<16|f[2]>>>16,f[1],f[0]<<16|f[3]>>>16,f[2],f[1]<<16|f[0]>>>16,f[3],f[2]<<16|f[1]>>>16],v=this._C=[f[2]<<16|f[2]>>>16,f[0]&4294901760|f[1]&65535,f[3]<<16|f[3]>>>16,f[1]&4294901760|f[2]&65535,f[0]<<16|f[0]>>>16,f[2]&4294901760|f[3]&65535,f[1]<<16|f[1]>>>16,f[3]&4294901760|f[0]&65535];this._b=0;for(var p=0;p<4;p++)d.call(this);for(var p=0;p<8;p++)v[p]^=b[p+4&7];if(h){var w=h.words,m=w[0],x=w[1],y=(m<<8|m>>>24)&16711935|(m<<24|m>>>8)&4278255360,A=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,S=y>>>16|A&4294901760,D=A<<16|y&65535;v[0]^=y,v[1]^=S,v[2]^=A,v[3]^=D,v[4]^=y,v[5]^=S,v[6]^=A,v[7]^=D;for(var p=0;p<4;p++)d.call(this)}},_doProcessBlock:function(f,h){var p=this._X;d.call(this),o[0]=p[0]^p[5]>>>16^p[3]<<16,o[1]=p[2]^p[7]>>>16^p[5]<<16,o[2]=p[4]^p[1]>>>16^p[7]<<16,o[3]=p[6]^p[3]>>>16^p[1]<<16;for(var b=0;b<4;b++)o[b]=(o[b]<<8|o[b]>>>24)&16711935|(o[b]<<24|o[b]>>>8)&4278255360,f[h+b]^=o[b]},blockSize:128/32,ivSize:64/32});function d(){for(var f=this._X,h=this._C,p=0;p<8;p++)u[p]=h[p];h[0]=h[0]+1295307597+this._b|0,h[1]=h[1]+3545052371+(h[0]>>>0>>0?1:0)|0,h[2]=h[2]+886263092+(h[1]>>>0>>0?1:0)|0,h[3]=h[3]+1295307597+(h[2]>>>0>>0?1:0)|0,h[4]=h[4]+3545052371+(h[3]>>>0>>0?1:0)|0,h[5]=h[5]+886263092+(h[4]>>>0>>0?1:0)|0,h[6]=h[6]+1295307597+(h[5]>>>0>>0?1:0)|0,h[7]=h[7]+3545052371+(h[6]>>>0>>0?1:0)|0,this._b=h[7]>>>0>>0?1:0;for(var p=0;p<8;p++){var b=f[p]+h[p],v=b&65535,w=b>>>16,m=((v*v>>>17)+v*w>>>15)+w*w,x=((b&4294901760)*b|0)+((b&65535)*b|0);c[p]=m^x}f[0]=c[0]+(c[7]<<16|c[7]>>>16)+(c[6]<<16|c[6]>>>16)|0,f[1]=c[1]+(c[0]<<8|c[0]>>>24)+c[7]|0,f[2]=c[2]+(c[1]<<16|c[1]>>>16)+(c[0]<<16|c[0]>>>16)|0,f[3]=c[3]+(c[2]<<8|c[2]>>>24)+c[1]|0,f[4]=c[4]+(c[3]<<16|c[3]>>>16)+(c[2]<<16|c[2]>>>16)|0,f[5]=c[5]+(c[4]<<8|c[4]>>>24)+c[3]|0,f[6]=c[6]+(c[5]<<16|c[5]>>>16)+(c[4]<<16|c[4]>>>16)|0,f[7]=c[7]+(c[6]<<8|c[6]>>>24)+c[5]|0}r.Rabbit=i._createHelper(l)}(),t.Rabbit})}(y2)),y2.exports}var m2={exports:{}},Jm;function tN(){return Jm||(Jm=1,function(n,e){(function(t,r,s){n.exports=r(qe(),Mc(),jc(),Ua(),Lt())})(oe,function(t){return function(){var r=t,s=r.lib,i=s.StreamCipher,a=r.algo,o=[],u=[],c=[],l=a.RabbitLegacy=i.extend({_doReset:function(){var f=this._key.words,h=this.cfg.iv,p=this._X=[f[0],f[3]<<16|f[2]>>>16,f[1],f[0]<<16|f[3]>>>16,f[2],f[1]<<16|f[0]>>>16,f[3],f[2]<<16|f[1]>>>16],b=this._C=[f[2]<<16|f[2]>>>16,f[0]&4294901760|f[1]&65535,f[3]<<16|f[3]>>>16,f[1]&4294901760|f[2]&65535,f[0]<<16|f[0]>>>16,f[2]&4294901760|f[3]&65535,f[1]<<16|f[1]>>>16,f[3]&4294901760|f[0]&65535];this._b=0;for(var v=0;v<4;v++)d.call(this);for(var v=0;v<8;v++)b[v]^=p[v+4&7];if(h){var w=h.words,m=w[0],x=w[1],y=(m<<8|m>>>24)&16711935|(m<<24|m>>>8)&4278255360,A=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,S=y>>>16|A&4294901760,D=A<<16|y&65535;b[0]^=y,b[1]^=S,b[2]^=A,b[3]^=D,b[4]^=y,b[5]^=S,b[6]^=A,b[7]^=D;for(var v=0;v<4;v++)d.call(this)}},_doProcessBlock:function(f,h){var p=this._X;d.call(this),o[0]=p[0]^p[5]>>>16^p[3]<<16,o[1]=p[2]^p[7]>>>16^p[5]<<16,o[2]=p[4]^p[1]>>>16^p[7]<<16,o[3]=p[6]^p[3]>>>16^p[1]<<16;for(var b=0;b<4;b++)o[b]=(o[b]<<8|o[b]>>>24)&16711935|(o[b]<<24|o[b]>>>8)&4278255360,f[h+b]^=o[b]},blockSize:128/32,ivSize:64/32});function d(){for(var f=this._X,h=this._C,p=0;p<8;p++)u[p]=h[p];h[0]=h[0]+1295307597+this._b|0,h[1]=h[1]+3545052371+(h[0]>>>0>>0?1:0)|0,h[2]=h[2]+886263092+(h[1]>>>0>>0?1:0)|0,h[3]=h[3]+1295307597+(h[2]>>>0>>0?1:0)|0,h[4]=h[4]+3545052371+(h[3]>>>0>>0?1:0)|0,h[5]=h[5]+886263092+(h[4]>>>0>>0?1:0)|0,h[6]=h[6]+1295307597+(h[5]>>>0>>0?1:0)|0,h[7]=h[7]+3545052371+(h[6]>>>0>>0?1:0)|0,this._b=h[7]>>>0>>0?1:0;for(var p=0;p<8;p++){var b=f[p]+h[p],v=b&65535,w=b>>>16,m=((v*v>>>17)+v*w>>>15)+w*w,x=((b&4294901760)*b|0)+((b&65535)*b|0);c[p]=m^x}f[0]=c[0]+(c[7]<<16|c[7]>>>16)+(c[6]<<16|c[6]>>>16)|0,f[1]=c[1]+(c[0]<<8|c[0]>>>24)+c[7]|0,f[2]=c[2]+(c[1]<<16|c[1]>>>16)+(c[0]<<16|c[0]>>>16)|0,f[3]=c[3]+(c[2]<<8|c[2]>>>24)+c[1]|0,f[4]=c[4]+(c[3]<<16|c[3]>>>16)+(c[2]<<16|c[2]>>>16)|0,f[5]=c[5]+(c[4]<<8|c[4]>>>24)+c[3]|0,f[6]=c[6]+(c[5]<<16|c[5]>>>16)+(c[4]<<16|c[4]>>>16)|0,f[7]=c[7]+(c[6]<<8|c[6]>>>24)+c[5]|0}r.RabbitLegacy=i._createHelper(l)}(),t.RabbitLegacy})}(m2)),m2.exports}(function(n,e){(function(t,r,s){n.exports=r(qe(),Fh(),NO(),IO(),Mc(),BO(),jc(),mb(),Hv(),FO(),Gv(),UO(),LO(),DO(),xb(),MO(),Ua(),Lt(),jO(),$O(),HO(),GO(),zO(),WO(),KO(),VO(),qO(),JO(),QO(),YO(),ZO(),XO(),eN(),tN())})(oe,function(t){return t})})($v);var nN=$v.exports;const Qm=DR(nN);function zv(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let $c=zv();function rN(n){$c=n}const sN=/[&<>"']/,iN=/[&<>"']/g,aN=/[<>"']|&(?!#?\w+;)/,oN=/[<>"']|&(?!#?\w+;)/g,cN={"&":"&","<":"<",">":">",'"':""","'":"'"},Ym=n=>cN[n];function Rt(n,e){if(e){if(sN.test(n))return n.replace(iN,Ym)}else if(aN.test(n))return n.replace(oN,Ym);return n}const uN=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Wv(n){return n.replace(uN,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const lN=/(^|[^\[])\^/g;function ct(n,e){n=typeof n=="string"?n:n.source,e=e||"";const t={replace:(r,s)=>(s=s.source||s,s=s.replace(lN,"$1"),n=n.replace(r,s),t),getRegex:()=>new RegExp(n,e)};return t}const fN=/[^\w:]/g,dN=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Zm(n,e,t){if(n){let r;try{r=decodeURIComponent(Wv(t)).replace(fN,"").toLowerCase()}catch{return null}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0||r.indexOf("data:")===0)return null}e&&!dN.test(t)&&(t=gN(e,t));try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}const _d={},hN=/^[^:]+:\/*[^/]*$/,pN=/^([^:]+:)[\s\S]*$/,bN=/^([^:]+:\/*[^/]*)[\s\S]*$/;function gN(n,e){_d[" "+n]||(hN.test(n)?_d[" "+n]=n+"/":_d[" "+n]=d1(n,"/",!0)),n=_d[" "+n];const t=n.indexOf(":")===-1;return e.substring(0,2)==="//"?t?e:n.replace(pN,"$1")+e:e.charAt(0)==="/"?t?e:n.replace(bN,"$1")+e:n+e}const Y1={exec:function(){}};function Mr(n){let e=1,t,r;for(;e{let u=!1,c=a;for(;--c>=0&&o[c]==="\\";)u=!u;return u?"|":" |"}),r=t.split(/ \|/);let s=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),r.length>e)r.splice(e);else for(;r.length1;)e&1&&(t+=n),e>>=1,n+=n;return t+n}function t8(n,e,t,r){const s=e.href,i=e.title?Rt(e.title):null,a=n[1].replace(/\\([\[\]])/g,"$1");if(n[0].charAt(0)!=="!"){r.state.inLink=!0;const o={type:"link",raw:t,href:s,title:i,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,o}return{type:"image",raw:t,href:s,title:i,text:Rt(a)}}function mN(n,e){const t=n.match(/^(\s+)(?:```)/);if(t===null)return e;const r=t[1];return e.split(` +`).map(s=>{const i=s.match(/^\s+/);if(i===null)return s;const[a]=i;return a.length>=r.length?s.slice(r.length):s}).join(` +`)}class wb{constructor(e){this.options=e||$c}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const r=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?r:d1(r,` +`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const r=t[0],s=mN(r,t[3]||"");return{type:"code",raw:r,lang:t[2]?t[2].trim():t[2],text:s}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let r=t[2].trim();if(/#$/.test(r)){const s=d1(r,"#");(this.options.pedantic||!s||/ $/.test(s))&&(r=s.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const r=t[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(r,[]),text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r,s,i,a,o,u,c,l,d,f,h,p,b=t[1].trim();const v=b.length>1,w={type:"list",raw:"",ordered:v,start:v?+b.slice(0,-1):"",loose:!1,items:[]};b=v?`\\d{1,9}\\${b.slice(-1)}`:`\\${b}`,this.options.pedantic&&(b=v?b:"[*+-]");const m=new RegExp(`^( {0,3}${b})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;e&&(p=!1,!(!(t=m.exec(e))||this.rules.block.hr.test(e)));){if(r=t[0],e=e.substring(r.length),l=t[2].split(` +`,1)[0],d=e.split(` +`,1)[0],this.options.pedantic?(a=2,h=l.trimLeft()):(a=t[2].search(/[^ ]/),a=a>4?1:a,h=l.slice(a),a+=t[1].length),u=!1,!l&&/^ *$/.test(d)&&(r+=d+` +`,e=e.substring(d.length+1),p=!0),!p){const y=new RegExp(`^ {0,${Math.min(3,a-1)}}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))`),A=new RegExp(`^ {0,${Math.min(3,a-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),S=new RegExp(`^ {0,${Math.min(3,a-1)}}(?:\`\`\`|~~~)`),D=new RegExp(`^ {0,${Math.min(3,a-1)}}#`);for(;e&&(f=e.split(` +`,1)[0],l=f,this.options.pedantic&&(l=l.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(S.test(l)||D.test(l)||y.test(l)||A.test(e)));){if(l.search(/[^ ]/)>=a||!l.trim())h+=` +`+l.slice(a);else if(!u)h+=` +`+l;else break;!u&&!l.trim()&&(u=!0),r+=f+` +`,e=e.substring(f.length+1)}}w.loose||(c?w.loose=!0:/\n *\n *$/.test(r)&&(c=!0)),this.options.gfm&&(s=/^\[[ xX]\] /.exec(h),s&&(i=s[0]!=="[ ] ",h=h.replace(/^\[[ xX]\] +/,""))),w.items.push({type:"list_item",raw:r,task:!!s,checked:i,loose:!1,text:h}),w.raw+=r}w.items[w.items.length-1].raw=r.trimRight(),w.items[w.items.length-1].text=h.trimRight(),w.raw=w.raw.trimRight();const x=w.items.length;for(o=0;oS.type==="space"),A=y.every(S=>{const D=S.raw.split("");let O=0;for(const _ of D)if(_===` +`&&(O+=1),O>1)return!0;return!1});!w.loose&&y.length&&A&&(w.loose=!0,w.items[o].loose=!0)}return w}}html(e){const t=this.rules.block.html.exec(e);if(t){const r={type:"html",raw:t[0],pre:!this.options.sanitizer&&(t[1]==="pre"||t[1]==="script"||t[1]==="style"),text:t[0]};if(this.options.sanitize){const s=this.options.sanitizer?this.options.sanitizer(t[0]):Rt(t[0]);r.type="paragraph",r.text=s,r.tokens=this.lexer.inline(s)}return r}}def(e){const t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}}table(e){const t=this.rules.block.table.exec(e);if(t){const r={type:"table",header:Xm(t[1]).map(s=>({text:s})),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(` +`):[]};if(r.header.length===r.align.length){r.raw=t[0];let s=r.align.length,i,a,o,u;for(i=0;i({text:c}));for(s=r.header.length,a=0;a/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):Rt(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const r=t[2].trim();if(!this.options.pedantic&&/^$/.test(r))return;const a=d1(r.slice(0,-1),"\\");if((r.length-a.length)%2===0)return}else{const a=yN(t[2],"()");if(a>-1){const u=(t[0].indexOf("!")===0?5:4)+t[1].length+a;t[2]=t[2].substring(0,a),t[0]=t[0].substring(0,u).trim(),t[3]=""}}let s=t[2],i="";if(this.options.pedantic){const a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(s);a&&(s=a[1],i=a[3])}else i=t[3]?t[3].slice(1,-1):"";return s=s.trim(),/^$/.test(r)?s=s.slice(1):s=s.slice(1,-1)),t8(t,{href:s&&s.replace(this.rules.inline._escapes,"$1"),title:i&&i.replace(this.rules.inline._escapes,"$1")},t[0],this.lexer)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let s=(r[2]||r[1]).replace(/\s+/g," ");if(s=t[s.toLowerCase()],!s||!s.href){const i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return t8(r,s,r[0],this.lexer)}}emStrong(e,t,r=""){let s=this.rules.inline.emStrong.lDelim.exec(e);if(!s||s[3]&&r.match(/[\p{L}\p{N}]/u))return;const i=s[1]||s[2]||"";if(!i||i&&(r===""||this.rules.inline.punctuation.exec(r))){const a=s[0].length-1;let o,u,c=a,l=0;const d=s[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+a);(s=d.exec(t))!=null;){if(o=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!o)continue;if(u=o.length,s[3]||s[4]){c+=u;continue}else if((s[5]||s[6])&&a%3&&!((a+u)%3)){l+=u;continue}if(c-=u,c>0)continue;if(u=Math.min(u,u+c+l),Math.min(a,u)%2){const h=e.slice(1,a+s.index+u);return{type:"em",raw:e.slice(0,a+s.index+u+1),text:h,tokens:this.lexer.inlineTokens(h)}}const f=e.slice(2,a+s.index+u-1);return{type:"strong",raw:e.slice(0,a+s.index+u+1),text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let r=t[2].replace(/\n/g," ");const s=/[^ ]/.test(r),i=/^ /.test(r)&&/ $/.test(r);return s&&i&&(r=r.substring(1,r.length-1)),r=Rt(r,!0),{type:"codespan",raw:t[0],text:r}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e,t){const r=this.rules.inline.autolink.exec(e);if(r){let s,i;return r[2]==="@"?(s=Rt(this.options.mangle?t(r[1]):r[1]),i="mailto:"+s):(s=Rt(r[1]),i=s),{type:"link",raw:r[0],text:s,href:i,tokens:[{type:"text",raw:s,text:s}]}}}url(e,t){let r;if(r=this.rules.inline.url.exec(e)){let s,i;if(r[2]==="@")s=Rt(this.options.mangle?t(r[0]):r[0]),i="mailto:"+s;else{let a;do a=r[0],r[0]=this.rules.inline._backpedal.exec(r[0])[0];while(a!==r[0]);s=Rt(r[0]),r[1]==="www."?i="http://"+s:i=s}return{type:"link",raw:r[0],text:s,href:i,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(e,t){const r=this.rules.inline.text.exec(e);if(r){let s;return this.lexer.state.inRawBlock?s=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):Rt(r[0]):r[0]:s=Rt(this.options.smartypants?t(r[0]):r[0]),{type:"text",raw:r[0],text:s}}}}const Be={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Y1,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};Be._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;Be._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;Be.def=ct(Be.def).replace("label",Be._label).replace("title",Be._title).getRegex();Be.bullet=/(?:[*+-]|\d{1,9}[.)])/;Be.listItemStart=ct(/^( *)(bull) */).replace("bull",Be.bullet).getRegex();Be.list=ct(Be.list).replace(/bull/g,Be.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Be.def.source+")").getRegex();Be._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";Be._comment=/|$)/;Be.html=ct(Be.html,"i").replace("comment",Be._comment).replace("tag",Be._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();Be.paragraph=ct(Be._paragraph).replace("hr",Be.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Be._tag).getRegex();Be.blockquote=ct(Be.blockquote).replace("paragraph",Be.paragraph).getRegex();Be.normal=Mr({},Be);Be.gfm=Mr({},Be.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});Be.gfm.table=ct(Be.gfm.table).replace("hr",Be.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Be._tag).getRegex();Be.gfm.paragraph=ct(Be._paragraph).replace("hr",Be.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",Be.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Be._tag).getRegex();Be.pedantic=Mr({},Be.normal,{html:ct(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Be._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Y1,paragraph:ct(Be.normal._paragraph).replace("hr",Be.hr).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",Be.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const Se={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Y1,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[^*]+(?=[^*])|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Y1,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";Se.punctuation=ct(Se.punctuation).replace(/punctuation/g,Se._punctuation).getRegex();Se.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;Se.escapedEmSt=/\\\*|\\_/g;Se._comment=ct(Be._comment).replace("(?:-->|$)","-->").getRegex();Se.emStrong.lDelim=ct(Se.emStrong.lDelim).replace(/punct/g,Se._punctuation).getRegex();Se.emStrong.rDelimAst=ct(Se.emStrong.rDelimAst,"g").replace(/punct/g,Se._punctuation).getRegex();Se.emStrong.rDelimUnd=ct(Se.emStrong.rDelimUnd,"g").replace(/punct/g,Se._punctuation).getRegex();Se._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;Se._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;Se._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;Se.autolink=ct(Se.autolink).replace("scheme",Se._scheme).replace("email",Se._email).getRegex();Se._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;Se.tag=ct(Se.tag).replace("comment",Se._comment).replace("attribute",Se._attribute).getRegex();Se._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;Se._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;Se._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;Se.link=ct(Se.link).replace("label",Se._label).replace("href",Se._href).replace("title",Se._title).getRegex();Se.reflink=ct(Se.reflink).replace("label",Se._label).replace("ref",Be._label).getRegex();Se.nolink=ct(Se.nolink).replace("ref",Be._label).getRegex();Se.reflinkSearch=ct(Se.reflinkSearch,"g").replace("reflink",Se.reflink).replace("nolink",Se.nolink).getRegex();Se.normal=Mr({},Se);Se.pedantic=Mr({},Se.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:ct(/^!?\[(label)\]\((.*?)\)/).replace("label",Se._label).getRegex(),reflink:ct(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Se._label).getRegex()});Se.gfm=Mr({},Se.normal,{escape:ct(Se.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(r="x"+r.toString(16)),e+="&#"+r+";";return e}class ei{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||$c,this.options.tokenizer=this.options.tokenizer||new wb,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:Be.normal,inline:Se.normal};this.options.pedantic?(t.block=Be.pedantic,t.inline=Se.pedantic):this.options.gfm&&(t.block=Be.gfm,this.options.breaks?t.inline=Se.breaks:t.inline=Se.gfm),this.tokenizer.rules=t}static get rules(){return{block:Be,inline:Se}}static lex(e,t){return new ei(t).lex(e)}static lexInline(e,t){return new ei(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,` +`),this.blockTokens(e,this.tokens);let t;for(;t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){this.options.pedantic?e=e.replace(/\t/g," ").replace(/^ +$/gm,""):e=e.replace(/^( *)(\t+)/gm,(o,u,c)=>u+" ".repeat(c.length));let r,s,i,a;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(o=>(r=o.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))){if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length),r.raw.length===1&&t.length>0?t[t.length-1].raw+=` +`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length),s=t[t.length-1],s&&(s.type==="paragraph"||s.type==="text")?(s.raw+=` +`+r.raw,s.text+=` +`+r.text,this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length),s=t[t.length-1],s&&(s.type==="paragraph"||s.type==="text")?(s.raw+=` +`+r.raw,s.text+=` +`+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=s.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(i=e,this.options.extensions&&this.options.extensions.startBlock){let o=1/0;const u=e.slice(1);let c;this.options.extensions.startBlock.forEach(function(l){c=l.call({lexer:this},u),typeof c=="number"&&c>=0&&(o=Math.min(o,c))}),o<1/0&&o>=0&&(i=e.substring(0,o+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){s=t[t.length-1],a&&s.type==="paragraph"?(s.raw+=` +`+r.raw,s.text+=` +`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(r),a=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length),s=t[t.length-1],s&&s.type==="text"?(s.raw+=` +`+r.raw,s.text+=` +`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(r);continue}if(e){const o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let r,s,i,a=e,o,u,c;if(this.tokens.links){const l=Object.keys(this.tokens.links);if(l.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)l.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,o.index)+"["+e8("a",o[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,o.index)+"["+e8("a",o[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(o=this.tokenizer.rules.inline.escapedEmSt.exec(a))!=null;)a=a.slice(0,o.index)+"++"+a.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(u||(c=""),u=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(l=>(r=l.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))){if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),s=t[t.length-1],s&&r.type==="text"&&s.type==="text"?(s.raw+=r.raw,s.text+=r.text):t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length),s=t[t.length-1],s&&r.type==="text"&&s.type==="text"?(s.raw+=r.raw,s.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,a,c)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e,n8)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e,n8))){e=e.substring(r.raw.length),t.push(r);continue}if(i=e,this.options.extensions&&this.options.extensions.startInline){let l=1/0;const d=e.slice(1);let f;this.options.extensions.startInline.forEach(function(h){f=h.call({lexer:this},d),typeof f=="number"&&f>=0&&(l=Math.min(l,f))}),l<1/0&&l>=0&&(i=e.substring(0,l+1))}if(r=this.tokenizer.inlineText(i,xN)){e=e.substring(r.raw.length),r.raw.slice(-1)!=="_"&&(c=r.raw.slice(-1)),u=!0,s=t[t.length-1],s&&s.type==="text"?(s.raw+=r.raw,s.text+=r.text):t.push(r);continue}if(e){const l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return t}}class vb{constructor(e){this.options=e||$c}code(e,t,r){const s=(t||"").match(/\S*/)[0];if(this.options.highlight){const i=this.options.highlight(e,s);i!=null&&i!==e&&(r=!0,e=i)}return e=e.replace(/\n$/,"")+` +`,s?'
'+(r?e:Rt(e,!0))+`
+`:"
"+(r?e:Rt(e,!0))+`
+`}blockquote(e){return`
+${e}
+`}html(e){return e}heading(e,t,r,s){if(this.options.headerIds){const i=this.options.headerPrefix+s.slug(r);return`${e} +`}return`${e} +`}hr(){return this.options.xhtml?`
+`:`
+`}list(e,t,r){const s=t?"ol":"ul",i=t&&r!==1?' start="'+r+'"':"";return"<"+s+i+`> +`+e+" +`}listitem(e){return`
  • ${e}
  • +`}checkbox(e){return" "}paragraph(e){return`

    ${e}

    +`}table(e,t){return t&&(t=`${t}`),` + +`+e+` +`+t+`
    +`}tablerow(e){return` +${e} +`}tablecell(e,t){const r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+` +`}strong(e){return`${e}`}em(e){return`${e}`}codespan(e){return`${e}`}br(){return this.options.xhtml?"
    ":"
    "}del(e){return`${e}`}link(e,t,r){if(e=Zm(this.options.sanitize,this.options.baseUrl,e),e===null)return r;let s='",s}image(e,t,r){if(e=Zm(this.options.sanitize,this.options.baseUrl,e),e===null)return r;let s=`${r}":">",s}text(e){return e}}class Vv{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,r){return""+r}image(e,t,r){return""+r}br(){return""}}class qv{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let r=e,s=0;if(this.seen.hasOwnProperty(r)){s=this.seen[e];do s++,r=e+"-"+s;while(this.seen.hasOwnProperty(r))}return t||(this.seen[e]=s,this.seen[r]=0),r}slug(e,t={}){const r=this.serialize(e);return this.getNextSafeSlug(r,t.dryrun)}}class is{constructor(e){this.options=e||$c,this.options.renderer=this.options.renderer||new vb,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Vv,this.slugger=new qv}static parse(e,t){return new is(t).parse(e)}static parseInline(e,t){return new is(t).parseInline(e)}parse(e,t=!0){let r="",s,i,a,o,u,c,l,d,f,h,p,b,v,w,m,x,y,A,S;const D=e.length;for(s=0;s0&&m.tokens[0].type==="paragraph"?(m.tokens[0].text=A+" "+m.tokens[0].text,m.tokens[0].tokens&&m.tokens[0].tokens.length>0&&m.tokens[0].tokens[0].type==="text"&&(m.tokens[0].tokens[0].text=A+" "+m.tokens[0].tokens[0].text)):m.tokens.unshift({type:"text",text:A}):w+=A),w+=this.parse(m.tokens,v),f+=this.renderer.listitem(w,y,x);r+=this.renderer.list(f,p,b);continue}case"html":{r+=this.renderer.html(h.text);continue}case"paragraph":{r+=this.renderer.paragraph(this.parseInline(h.tokens));continue}case"text":{for(f=h.tokens?this.parseInline(h.tokens):h.text;s+1"u"||n===null)throw new Error("marked(): input parameter is undefined or null");if(typeof n!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected");if(typeof e=="function"&&(t=e,e=null),e=Mr({},De.defaults,e||{}),Kv(e),t){const s=e.highlight;let i;try{i=ei.lex(n,e)}catch(u){return t(u)}const a=function(u){let c;if(!u)try{e.walkTokens&&De.walkTokens(i,e.walkTokens),c=is.parse(i,e)}catch(l){u=l}return e.highlight=s,u?t(u):t(null,c)};if(!s||s.length<3||(delete e.highlight,!i.length))return a();let o=0;De.walkTokens(i,function(u){u.type==="code"&&(o++,setTimeout(()=>{s(u.text,u.lang,function(c,l){if(c)return a(c);l!=null&&l!==u.text&&(u.text=l,u.escaped=!0),o--,o===0&&a()})},0))}),o===0&&a();return}function r(s){if(s.message+=` +Please report this to https://github.com/markedjs/marked.`,e.silent)return"

    An error occurred:

    "+Rt(s.message+"",!0)+"
    ";throw s}try{const s=ei.lex(n,e);if(e.walkTokens){if(e.async)return Promise.all(De.walkTokens(s,e.walkTokens)).then(()=>is.parse(s,e)).catch(r);De.walkTokens(s,e.walkTokens)}return is.parse(s,e)}catch(s){r(s)}}De.options=De.setOptions=function(n){return Mr(De.defaults,n),rN(De.defaults),De};De.getDefaults=zv;De.defaults=$c;De.use=function(...n){const e=Mr({},...n),t=De.defaults.extensions||{renderers:{},childTokens:{}};let r;n.forEach(s=>{if(s.extensions&&(r=!0,s.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if(i.renderer){const a=t.renderers?t.renderers[i.name]:null;a?t.renderers[i.name]=function(...o){let u=i.renderer.apply(this,o);return u===!1&&(u=a.apply(this,o)),u}:t.renderers[i.name]=i.renderer}if(i.tokenizer){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[i.level]?t[i.level].unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}i.childTokens&&(t.childTokens[i.name]=i.childTokens)})),s.renderer){const i=De.defaults.renderer||new vb;for(const a in s.renderer){const o=i[a];i[a]=(...u)=>{let c=s.renderer[a].apply(i,u);return c===!1&&(c=o.apply(i,u)),c}}e.renderer=i}if(s.tokenizer){const i=De.defaults.tokenizer||new wb;for(const a in s.tokenizer){const o=i[a];i[a]=(...u)=>{let c=s.tokenizer[a].apply(i,u);return c===!1&&(c=o.apply(i,u)),c}}e.tokenizer=i}if(s.walkTokens){const i=De.defaults.walkTokens;e.walkTokens=function(a){let o=[];return o.push(s.walkTokens.call(this,a)),i&&(o=o.concat(i.call(this,a))),o}}r&&(e.extensions=t),De.setOptions(e)})};De.walkTokens=function(n,e){let t=[];for(const r of n)switch(t=t.concat(e.call(De,r)),r.type){case"table":{for(const s of r.header)t=t.concat(De.walkTokens(s.tokens,e));for(const s of r.rows)for(const i of s)t=t.concat(De.walkTokens(i.tokens,e));break}case"list":{t=t.concat(De.walkTokens(r.items,e));break}default:De.defaults.extensions&&De.defaults.extensions.childTokens&&De.defaults.extensions.childTokens[r.type]?De.defaults.extensions.childTokens[r.type].forEach(function(s){t=t.concat(De.walkTokens(r[s],e))}):r.tokens&&(t=t.concat(De.walkTokens(r.tokens,e)))}return t};De.parseInline=function(n,e){if(typeof n>"u"||n===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof n!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected");e=Mr({},De.defaults,e||{}),Kv(e);try{const t=ei.lexInline(n,e);return e.walkTokens&&De.walkTokens(t,e.walkTokens),is.parseInline(t,e)}catch(t){if(t.message+=` +Please report this to https://github.com/markedjs/marked.`,e.silent)return"

    An error occurred:

    "+Rt(t.message+"",!0)+"
    ";throw t}};De.Parser=is;De.parser=is.parse;De.Renderer=vb;De.TextRenderer=Vv;De.Lexer=ei;De.lexer=ei.lex;De.Tokenizer=wb;De.Slugger=qv;De.parse=De;De.options;De.setOptions;De.use;De.walkTokens;De.parseInline;is.parse;ei.lex;var Ab={},Jv={},Uh={},Dt={},Lh={},tt={};Object.defineProperty(tt,"__esModule",{value:!0});tt.GELATO_RELAY_1BALANCE_CONCURRENT_ERC2771_ZKSYNC_ADDRESS=tt.GELATO_RELAY_CONCURRENT_ERC2771_ZKSYNC_ADDRESS=tt.GELATO_RELAY_1BALANCE_CONCURRENT_ERC2771_ADDRESS=tt.GELATO_RELAY_CONCURRENT_ERC2771_ADDRESS=tt.GELATO_RELAY_1BALANCE_ERC2771_ZKSYNC_ADDRESS=tt.GELATO_RELAY_ERC2771_ZKSYNC_ADDRESS=tt.GELATO_RELAY_1BALANCE_ERC2771_ADDRESS=tt.GELATO_RELAY_ERC2771_ADDRESS=tt.USER_NONCE_ABI=tt.DEFAULT_DEADLINE_GAP=tt.DEFAULT_INTERNAL_ERROR_MESSAGE=tt.SIGN_TYPED_DATA_V4=tt.GELATO_RELAY_URL=void 0;tt.GELATO_RELAY_URL="https://api.gelato.digital";tt.SIGN_TYPED_DATA_V4="eth_signTypedData_v4";tt.DEFAULT_INTERNAL_ERROR_MESSAGE="Internal Error";tt.DEFAULT_DEADLINE_GAP=86400;tt.USER_NONCE_ABI=["function userNonce(address account) external view returns (uint256)"];tt.GELATO_RELAY_ERC2771_ADDRESS="0xb539068872230f20456CF38EC52EF2f91AF4AE49";tt.GELATO_RELAY_1BALANCE_ERC2771_ADDRESS="0xd8253782c45a12053594b9deB72d8e8aB2Fca54c";tt.GELATO_RELAY_ERC2771_ZKSYNC_ADDRESS="0x22DCC39b2AC376862183dd35A1664798dafC7Da6";tt.GELATO_RELAY_1BALANCE_ERC2771_ZKSYNC_ADDRESS="0x97015cD4C3d456997DD1C40e2a18c79108FCc412";tt.GELATO_RELAY_CONCURRENT_ERC2771_ADDRESS="0x8598806401A63Ddf52473F1B3C55bC9E33e2d73b";tt.GELATO_RELAY_1BALANCE_CONCURRENT_ERC2771_ADDRESS="0xc65d82ECE367EF06bf2AB791B3f3CF037Dc0e816";tt.GELATO_RELAY_CONCURRENT_ERC2771_ZKSYNC_ADDRESS="0xBa4082F4961c8Fb76231995C967CD9aa40f321b5";tt.GELATO_RELAY_1BALANCE_CONCURRENT_ERC2771_ZKSYNC_ADDRESS="0xB8828e4c662D1a7e4f3d1f622EfAE6B63D852ED8";var Hc={};Object.defineProperty(Hc,"__esModule",{value:!0});Hc.isSigner=void 0;const wN=n=>"signTransaction"in n;Hc.isSigner=wN;var vN=oe&&oe.__awaiter||function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function o(l){try{c(r.next(l))}catch(d){a(d)}}function u(l){try{c(r.throw(l))}catch(d){a(d)}}function c(l){l.done?i(l.value):s(l.value).then(o,u)}c((r=r.apply(n,e||[])).next())})};Object.defineProperty(Lh,"__esModule",{value:!0});Lh.signTypedDataV4=void 0;const r8=tt,AN=Hc,EN=(n,e,t)=>vN(void 0,void 0,void 0,function*(){return(0,AN.isSigner)(n)?yield n.signTypedData(t.domain,t.types,t.message):n.provider.isMagic?yield n.send(r8.SIGN_TYPED_DATA_V4,[e,t]):(yield n.send(r8.SIGN_TYPED_DATA_V4,[e,JSON.stringify(t)])).replace(/00$/,"1b").replace(/01$/,"1c")});Lh.signTypedDataV4=EN;var Lf={};Object.defineProperty(Lf,"__esModule",{value:!0});Lf.calculateDeadline=void 0;const _N=n=>Math.floor(Date.now()/1e3)+n;Lf.calculateDeadline=_N;var Df={},Gc={},Yp=function(n,e){return Yp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])},Yp(n,e)};function PN(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Yp(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Zp=function(){return Zp=Object.assign||function(e){for(var t,r=1,s=arguments.length;r=0;o--)(a=n[o])&&(i=(s<3?a(i):s>3?a(e,t,i):a(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i}function SN(n,e){return function(t,r){e(t,r,n)}}function RN(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)}function TN(n,e,t,r){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function o(l){try{c(r.next(l))}catch(d){a(d)}}function u(l){try{c(r.throw(l))}catch(d){a(d)}}function c(l){l.done?i(l.value):s(l.value).then(o,u)}c((r=r.apply(n,e||[])).next())})}function ON(n,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,s,i,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(c){return function(l){return u([c,l])}}function u(c){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,s&&(i=c[0]&2?s.return:c[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,c[1])).done)return i;switch(s=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,s=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Qv(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),s,i=[],a;try{for(;(e===void 0||e-- >0)&&!(s=r.next()).done;)i.push(s.value)}catch(o){a={error:o}}finally{try{s&&!s.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return i}function IN(){for(var n=[],e=0;e1||o(f,h)})})}function o(f,h){try{u(r[f](h))}catch(p){d(i[0][3],p)}}function u(f){f.value instanceof Jl?Promise.resolve(f.value.v).then(c,l):d(i[0][2],f)}function c(f){o("next",f)}function l(f){o("throw",f)}function d(f,h){f(h),i.shift(),i.length&&o(i[0][0],i[0][1])}}function LN(n){var e,t;return e={},r("next"),r("throw",function(s){throw s}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(s,i){e[s]=n[s]?function(a){return(t=!t)?{value:Jl(n[s](a)),done:s==="return"}:i?i(a):a}:i}}function DN(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof Xp=="function"?Xp(n):n[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(i){t[i]=n[i]&&function(a){return new Promise(function(o,u){a=n[i](a),s(o,u,a.done,a.value)})}}function s(i,a,o,u){Promise.resolve(u).then(function(c){i({value:c,done:o})},a)}}function MN(n,e){return Object.defineProperty?Object.defineProperty(n,"raw",{value:e}):n.raw=e,n}var jN=Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e};function $N(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t in n)t!=="default"&&Object.prototype.hasOwnProperty.call(n,t)&&Eb(e,n,t);return jN(e,n),e}function HN(n){return n&&n.__esModule?n:{default:n}}function GN(n,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(n):r?r.value:e.get(n)}function zN(n,e,t,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!s:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(n,t):s?s.value=t:e.set(n,t),t}function WN(n,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof n=="function"?e===n:n.has(e)}const KN=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Zp},__asyncDelegator:LN,__asyncGenerator:UN,__asyncValues:DN,__await:Jl,__awaiter:TN,__classPrivateFieldGet:GN,__classPrivateFieldIn:WN,__classPrivateFieldSet:zN,__createBinding:Eb,__decorate:CN,__exportStar:NN,__extends:PN,__generator:ON,__importDefault:HN,__importStar:$N,__makeTemplateObject:MN,__metadata:RN,__param:SN,__read:Qv,__rest:kN,__spread:IN,__spreadArray:FN,__spreadArrays:BN,__values:Xp},Symbol.toStringTag,{value:"Module"})),Yv=jn(KN);var x2={},ru={},s8;function _b(){return s8||(s8=1,Object.defineProperty(ru,"__esModule",{value:!0}),ru.version=void 0,ru.version="6.7.0"),ru}var w2={},su={},v2={},l0={},ut={},Et={},f0={},i8;function La(){if(i8)return f0;i8=1,Object.defineProperty(f0,"__esModule",{value:!0}),f0.defineProperties=f0.resolveProperties=void 0;function n(r,s,i){const a=s.split("|").map(u=>u.trim());for(let u=0;uPromise.resolve(r[a])))).reduce((a,o,u)=>(a[s[u]]=o,a),{})}f0.resolveProperties=e;function t(r,s,i){for(let a in s){let o=s[a];const u=i?i[a]:null;u&&n(o,u,a),Object.defineProperty(r,a,{enumerable:!0,value:o,writable:!1})}}return f0.defineProperties=t,f0}var a8;function cs(){if(a8)return Et;a8=1,Object.defineProperty(Et,"__esModule",{value:!0}),Et.assertPrivate=Et.assertNormalize=Et.assertArgumentCount=Et.assertArgument=Et.assert=Et.makeError=Et.isCallException=Et.isError=void 0;const n=_b(),e=La();function t(f){if(f==null)return"null";if(Array.isArray(f))return"[ "+f.map(t).join(", ")+" ]";if(f instanceof Uint8Array){const h="0123456789abcdef";let p="0x";for(let b=0;b>4],p+=h[f[b]&15];return p}if(typeof f=="object"&&typeof f.toJSON=="function")return t(f.toJSON());switch(typeof f){case"boolean":case"symbol":return f.toString();case"bigint":return BigInt(f).toString();case"number":return f.toString();case"string":return JSON.stringify(f);case"object":{const h=Object.keys(f);return h.sort(),"{ "+h.map(p=>`${t(p)}: ${t(f[p])}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function r(f,h){return f&&f.code===h}Et.isError=r;function s(f){return r(f,"CALL_EXCEPTION")}Et.isCallException=s;function i(f,h,p){{const v=[];if(p){if("message"in p||"code"in p||"name"in p)throw new Error(`value will overwrite populated values: ${t(p)}`);for(const w in p){const m=p[w];v.push(w+"="+t(m))}}v.push(`code=${h}`),v.push(`version=${n.version}`),v.length&&(f+=" ("+v.join(", ")+")")}let b;switch(h){case"INVALID_ARGUMENT":b=new TypeError(f);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":b=new RangeError(f);break;default:b=new Error(f)}return(0,e.defineProperties)(b,{code:h}),p&&Object.assign(b,p),b}Et.makeError=i;function a(f,h,p,b){if(!f)throw i(h,p,b)}Et.assert=a;function o(f,h,p,b){a(f,h,"INVALID_ARGUMENT",{argument:p,value:b})}Et.assertArgument=o;function u(f,h,p){p==null&&(p=""),p&&(p=": "+p),a(f>=h,"missing arguemnt"+p,"MISSING_ARGUMENT",{count:f,expectedCount:h}),a(f<=h,"too many arguemnts"+p,"UNEXPECTED_ARGUMENT",{count:f,expectedCount:h})}Et.assertArgumentCount=u;const c=["NFD","NFC","NFKD","NFKC"].reduce((f,h)=>{try{if("test".normalize(h)!=="test")throw new Error("bad");if(h==="NFD"){const p=String.fromCharCode(233).normalize("NFD"),b=String.fromCharCode(101,769);if(p!==b)throw new Error("broken")}f.push(h)}catch{}return f},[]);function l(f){a(c.indexOf(f)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:f}})}Et.assertNormalize=l;function d(f,h,p){if(p==null&&(p=""),f!==h){let b=p,v="new";p&&(b+=".",v+=" "+p),a(!1,`private constructor; use ${b}from* methods`,"UNSUPPORTED_OPERATION",{operation:v})}}return Et.assertPrivate=d,Et}var o8;function Ur(){if(o8)return ut;o8=1,Object.defineProperty(ut,"__esModule",{value:!0}),ut.zeroPadBytes=ut.zeroPadValue=ut.stripZerosLeft=ut.dataSlice=ut.dataLength=ut.concat=ut.hexlify=ut.isBytesLike=ut.isHexString=ut.getBytesCopy=ut.getBytes=void 0;const n=cs();function e(b,v,w){if(b instanceof Uint8Array)return w?new Uint8Array(b):b;if(typeof b=="string"&&b.match(/^0x([0-9a-f][0-9a-f])*$/i)){const m=new Uint8Array((b.length-2)/2);let x=2;for(let y=0;y>4]+a[x&15]}return w}ut.hexlify=o;function u(b){return"0x"+b.map(v=>o(v).substring(2)).join("")}ut.concat=u;function c(b){return s(b,!0)?(b.length-2)/2:t(b).length}ut.dataLength=c;function l(b,v,w){const m=t(b);return w!=null&&w>m.length&&(0,n.assert)(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:m,length:m.length,offset:w}),o(m.slice(v??0,w??m.length))}ut.dataSlice=l;function d(b){let v=o(b).substring(2);for(;v.startsWith("00");)v=v.substring(2);return"0x"+v}ut.stripZerosLeft=d;function f(b,v,w){const m=t(b);(0,n.assert)(v>=m.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(m),length:v,offset:v+1});const x=new Uint8Array(v);return x.fill(0),w?x.set(m,v-m.length):x.set(m,0),o(x)}function h(b,v){return f(b,v,!0)}ut.zeroPadValue=h;function p(b,v){return f(b,v,!1)}return ut.zeroPadBytes=p,ut}var lt={},c8;function Mf(){if(c8)return lt;c8=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.toQuantity=lt.toBeArray=lt.toBeHex=lt.toNumber=lt.getNumber=lt.toBigInt=lt.getUint=lt.getBigInt=lt.mask=lt.toTwos=lt.fromTwos=void 0;const n=Ur(),e=cs(),t=BigInt(0),r=BigInt(1),s=9007199254740991;function i(w,m){const x=c(w,"value"),y=BigInt(f(m,"width"));if((0,e.assert)(x>>y===t,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:w}),x>>y-r){const A=(r<=-s&&w<=s,"overflow",m||"value",w),BigInt(w);case"string":try{if(w==="")throw new Error("empty string");return w[0]==="-"&&w[1]!=="-"?-BigInt(w.substring(1)):BigInt(w)}catch(x){(0,e.assertArgument)(!1,`invalid BigNumberish string: ${x.message}`,m||"value",w)}}(0,e.assertArgument)(!1,"invalid BigNumberish value",m||"value",w)}lt.getBigInt=u;function c(w,m){const x=u(w,m);return(0,e.assert)(x>=t,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:w}),x}lt.getUint=c;const l="0123456789abcdef";function d(w){if(w instanceof Uint8Array){let m="0x0";for(const x of w)m+=l[x>>4],m+=l[x&15];return BigInt(m)}return u(w)}lt.toBigInt=d;function f(w,m){switch(typeof w){case"bigint":return(0,e.assertArgument)(w>=-s&&w<=s,"overflow",m||"value",w),Number(w);case"number":return(0,e.assertArgument)(Number.isInteger(w),"underflow",m||"value",w),(0,e.assertArgument)(w>=-s&&w<=s,"overflow",m||"value",w),w;case"string":try{if(w==="")throw new Error("empty string");return f(BigInt(w),m)}catch(x){(0,e.assertArgument)(!1,`invalid numeric string: ${x.message}`,m||"value",w)}}(0,e.assertArgument)(!1,"invalid numeric value",m||"value",w)}lt.getNumber=f;function h(w){return f(d(w))}lt.toNumber=h;function p(w,m){let y=c(w,"value").toString(16);if(m==null)y.length%2&&(y="0"+y);else{const A=f(m,"width");for((0,e.assert)(A*2>=y.length,`value exceeds width (${A} bits)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:w});y.length>6===2;w++)v++;return v}return d==="OVERRUN"?h.length-f-1:0}function i(d,f,h,p,b){return d==="OVERLONG"?((0,t.assertArgument)(typeof b=="number","invalid bad code point for replacement","badCodepoint",b),p.push(b),0):(p.push(65533),s(d,f,h))}n.Utf8ErrorFuncs=Object.freeze({error:r,ignore:s,replace:i});function a(d,f){f==null&&(f=n.Utf8ErrorFuncs.error);const h=(0,e.getBytes)(d,"bytes"),p=[];let b=0;for(;b>7)){p.push(v);continue}let w=null,m=null;if((v&224)===192)w=1,m=127;else if((v&240)===224)w=2,m=2047;else if((v&248)===240)w=3,m=65535;else{(v&192)===128?b+=f("UNEXPECTED_CONTINUE",b-1,h,p):b+=f("BAD_PREFIX",b-1,h,p);continue}if(b-1+w>=h.length){b+=f("OVERRUN",b-1,h,p);continue}let x=v&(1<<8-w-1)-1;for(let y=0;y1114111){b+=f("OUT_OF_RANGE",b-1-w,h,p,x);continue}if(x>=55296&&x<=57343){b+=f("UTF16_SURROGATE",b-1-w,h,p,x);continue}if(x<=m){b+=f("OVERLONG",b-1-w,h,p,x);continue}p.push(x)}}return p}function o(d,f){f!=null&&((0,t.assertNormalize)(f),d=d.normalize(f));let h=[];for(let p=0;p>6|192),h.push(b&63|128);else if((b&64512)==55296){p++;const v=d.charCodeAt(p);(0,t.assertArgument)(p>18|240),h.push(w>>12&63|128),h.push(w>>6&63|128),h.push(w&63|128)}else h.push(b>>12|224),h.push(b>>6&63|128),h.push(b&63|128)}return new Uint8Array(h)}n.toUtf8Bytes=o;function u(d){return d.map(f=>f<=65535?String.fromCharCode(f):(f-=65536,String.fromCharCode((f>>10&1023)+55296,(f&1023)+56320))).join("")}function c(d,f){return u(a(d,f))}n.toUtf8String=c;function l(d,f){return a(o(d,f))}n.toUtf8CodePoints=l}(A2)),A2}var au={},h8;function JN(){if(h8)return au;h8=1,Object.defineProperty(au,"__esModule",{value:!0}),au.getUrl=void 0;const n=cs();async function e(t,r){const s=t.url.split(":")[0].toLowerCase();(0,n.assert)(s==="http"||s==="https",`unsupported protocol ${s}`,"UNSUPPORTED_OPERATION",{info:{protocol:s},operation:"request"}),(0,n.assert)(s==="https"||!t.credentials||t.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let i;if(r){const d=new AbortController;i=d.signal,r.addListener(()=>{d.abort()})}const a={method:t.method,headers:new Headers(Array.from(t)),body:t.body||void 0,signal:i},o=await fetch(t.url,a),u={};o.headers.forEach((d,f)=>{u[f.toLowerCase()]=d});const c=await o.arrayBuffer(),l=c==null?null:new Uint8Array(c);return{statusCode:o.status,statusMessage:o.statusText,headers:u,body:l}}return au.getUrl=e,au}var p8;function QN(){var D,O,_,E,C,P,I,j,z,F,W,H,L,M,T,B,N,wl,ne,le,ie,pe,xe,me;if(p8)return fs;p8=1,Object.defineProperty(fs,"__esModule",{value:!0}),fs.FetchResponse=fs.FetchRequest=fs.FetchCancelSignal=void 0;const n=Zv(),e=Ur(),t=cs(),r=La(),s=Pb(),i=JN(),a=12,o=250;let u=i.getUrl;const c=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),l=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let d=!1;async function f(Ie,X){try{const Ae=Ie.match(c);if(!Ae)throw new Error("invalid data");return new x(200,"OK",{"content-type":Ae[1]||"text/plain"},Ae[2]?(0,n.decodeBase64)(Ae[3]):A(Ae[3]))}catch{return new x(599,"BAD REQUEST (invalid data: URI)",{},null,new m(Ie))}}function h(Ie){async function X(Ae,Oe){try{const Me=Ae.match(l);if(!Me)throw new Error("invalid link");return new m(`${Ie}${Me[2]}`)}catch{return new x(599,"BAD REQUEST (invalid IPFS URI)",{},null,new m(Ae))}}return X}const p={data:f,ipfs:h("https://gateway.ipfs.io/ipfs/")},b=new WeakMap;class v{constructor(X){$(this,D,void 0);$(this,O,void 0);k(this,D,[]),k(this,O,!1),b.set(X,()=>{if(!g(this,O)){k(this,O,!0);for(const Ae of g(this,D))setTimeout(()=>{Ae()},0);k(this,D,[])}})}addListener(X){(0,t.assert)(!g(this,O),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),g(this,D).push(X)}get cancelled(){return g(this,O)}checkSignal(){(0,t.assert)(!this.cancelled,"cancelled","CANCELLED",{})}}D=new WeakMap,O=new WeakMap,fs.FetchCancelSignal=v;function w(Ie){if(Ie==null)throw new Error("missing signal; should not happen");return Ie.checkSignal(),Ie}const te=class te{constructor(X){$(this,N);$(this,_,void 0);$(this,E,void 0);$(this,C,void 0);$(this,P,void 0);$(this,I,void 0);$(this,j,void 0);$(this,z,void 0);$(this,F,void 0);$(this,W,void 0);$(this,H,void 0);$(this,L,void 0);$(this,M,void 0);$(this,T,void 0);$(this,B,void 0);k(this,j,String(X)),k(this,_,!1),k(this,E,!0),k(this,C,{}),k(this,P,""),k(this,I,3e5),k(this,B,{slotInterval:o,maxAttempts:a})}get url(){return g(this,j)}set url(X){k(this,j,String(X))}get body(){return g(this,z)==null?null:new Uint8Array(g(this,z))}set body(X){if(X==null)k(this,z,void 0),k(this,F,void 0);else if(typeof X=="string")k(this,z,(0,s.toUtf8Bytes)(X)),k(this,F,"text/plain");else if(X instanceof Uint8Array)k(this,z,X),k(this,F,"application/octet-stream");else if(typeof X=="object")k(this,z,(0,s.toUtf8Bytes)(JSON.stringify(X))),k(this,F,"application/json");else throw new Error("invalid body")}hasBody(){return g(this,z)!=null}get method(){return g(this,P)?g(this,P):this.hasBody()?"POST":"GET"}set method(X){X==null&&(X=""),k(this,P,String(X).toUpperCase())}get headers(){const X=Object.assign({},g(this,C));return g(this,W)&&(X.authorization=`Basic ${(0,n.encodeBase64)((0,s.toUtf8Bytes)(g(this,W)))}`),this.allowGzip&&(X["accept-encoding"]="gzip"),X["content-type"]==null&&g(this,F)&&(X["content-type"]=g(this,F)),this.body&&(X["content-length"]=String(this.body.length)),X}getHeader(X){return this.headers[X.toLowerCase()]}setHeader(X,Ae){g(this,C)[String(X).toLowerCase()]=String(Ae)}clearHeaders(){k(this,C,{})}[Symbol.iterator](){const X=this.headers,Ae=Object.keys(X);let Oe=0;return{next:()=>{if(Oe=0,"timeout must be non-zero","timeout",X),k(this,I,X)}get preflightFunc(){return g(this,H)||null}set preflightFunc(X){k(this,H,X)}get processFunc(){return g(this,L)||null}set processFunc(X){k(this,L,X)}get retryFunc(){return g(this,M)||null}set retryFunc(X){k(this,M,X)}toString(){return``}setThrottleParams(X){X.slotInterval!=null&&(g(this,B).slotInterval=X.slotInterval),X.maxAttempts!=null&&(g(this,B).maxAttempts=X.maxAttempts)}send(){return(0,t.assert)(g(this,T)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),k(this,T,new v(this)),Q(this,N,wl).call(this,0,y()+this.timeout,0,this,new x(0,"",{},null,this))}cancel(){(0,t.assert)(g(this,T)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const X=b.get(this);if(!X)throw new Error("missing signal; should not happen");X()}redirect(X){const Ae=this.url.split(":")[0].toLowerCase(),Oe=X.split(":")[0].toLowerCase();(0,t.assert)(this.method==="GET"&&(Ae!=="https"||Oe!=="http")&&X.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(X)})`});const Me=new te(X);return Me.method="GET",Me.allowGzip=this.allowGzip,Me.timeout=this.timeout,k(Me,C,Object.assign({},g(this,C))),g(this,z)&&k(Me,z,new Uint8Array(g(this,z))),k(Me,F,g(this,F)),Me}clone(){const X=new te(this.url);return k(X,P,g(this,P)),g(this,z)&&k(X,z,g(this,z)),k(X,F,g(this,F)),k(X,C,Object.assign({},g(this,C))),k(X,W,g(this,W)),this.allowGzip&&(X.allowGzip=!0),X.timeout=this.timeout,this.allowInsecureAuthentication&&(X.allowInsecureAuthentication=!0),k(X,H,g(this,H)),k(X,L,g(this,L)),k(X,M,g(this,M)),X}static lockConfig(){d=!0}static getGateway(X){return p[X.toLowerCase()]||null}static registerGateway(X,Ae){if(X=X.toLowerCase(),X==="http"||X==="https")throw new Error(`cannot intercept ${X}; use registerGetUrl`);if(d)throw new Error("gateways locked");p[X]=Ae}static registerGetUrl(X){if(d)throw new Error("gateways locked");u=X}static createDataGateway(){return f}static createIpfsGatewayFunc(X){return h(X)}};_=new WeakMap,E=new WeakMap,C=new WeakMap,P=new WeakMap,I=new WeakMap,j=new WeakMap,z=new WeakMap,F=new WeakMap,W=new WeakMap,H=new WeakMap,L=new WeakMap,M=new WeakMap,T=new WeakMap,B=new WeakMap,N=new WeakSet,wl=async function(X,Ae,Oe,Me,Qe){var U,G,Y;if(X>=g(this,B).maxAttempts)return Qe.makeServerError("exceeded maximum retry limit");(0,t.assert)(y()<=Ae,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:Me}),Oe>0&&await S(Oe);let Ye=this.clone();const ge=(Ye.url.split(":")[0]||"").toLowerCase();if(ge in p){const J=await p[ge](Ye.url,w(g(Me,T)));if(J instanceof x){let ee=J;if(this.processFunc){w(g(Me,T));try{ee=await this.processFunc(Ye,ee)}catch(ue){(ue.throttle==null||typeof ue.stall!="number")&&ee.makeServerError("error in post-processing function",ue).assertOk()}}return ee}Ye=J}this.preflightFunc&&(Ye=await this.preflightFunc(Ye));const q=await u(Ye,w(g(Me,T)));let V=new x(q.statusCode,q.statusMessage,q.headers,q.body,Me);if(V.statusCode===301||V.statusCode===302){try{const J=V.headers.location||"";return Q(U=Ye.redirect(J),N,wl).call(U,X+1,Ae,0,Me,V)}catch{}return V}else if(V.statusCode===429&&(this.retryFunc==null||await this.retryFunc(Ye,V,X))){const J=V.headers["retry-after"];let ee=g(this,B).slotInterval*Math.trunc(Math.random()*Math.pow(2,X));return typeof J=="string"&&J.match(/^[1-9][0-9]*$/)&&(ee=parseInt(J)),Q(G=Ye.clone(),N,wl).call(G,X+1,Ae,ee,Me,V)}if(this.processFunc){w(g(Me,T));try{V=await this.processFunc(Ye,V)}catch(J){(J.throttle==null||typeof J.stall!="number")&&V.makeServerError("error in post-processing function",J).assertOk();let ee=g(this,B).slotInterval*Math.trunc(Math.random()*Math.pow(2,X));return J.stall>=0&&(ee=J.stall),Q(Y=Ye.clone(),N,wl).call(Y,X+1,Ae,ee,Me,V)}}return V};let m=te;fs.FetchRequest=m;const be=class be{constructor(X,Ae,Oe,Me,Qe){$(this,ne,void 0);$(this,le,void 0);$(this,ie,void 0);$(this,pe,void 0);$(this,xe,void 0);$(this,me,void 0);k(this,ne,X),k(this,le,Ae),k(this,ie,Object.keys(Oe).reduce((Ye,ge)=>(Ye[ge.toLowerCase()]=String(Oe[ge]),Ye),{})),k(this,pe,Me==null?null:new Uint8Array(Me)),k(this,xe,Qe||null),k(this,me,{message:""})}toString(){return``}get statusCode(){return g(this,ne)}get statusMessage(){return g(this,le)}get headers(){return Object.assign({},g(this,ie))}get body(){return g(this,pe)==null?null:new Uint8Array(g(this,pe))}get bodyText(){try{return g(this,pe)==null?"":(0,s.toUtf8String)(g(this,pe))}catch{(0,t.assert)(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{(0,t.assert)(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const X=this.headers,Ae=Object.keys(X);let Oe=0;return{next:()=>{if(Oe=0,"invalid stall timeout","stall",Ae);const Oe=new Error(X||"throttling requests");throw(0,r.defineProperties)(Oe,{stall:Ae,throttle:!0}),Oe}getHeader(X){return this.headers[X.toLowerCase()]}hasBody(){return g(this,pe)!=null}get request(){return g(this,xe)}ok(){return g(this,me).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:X,error:Ae}=g(this,me);X===""&&(X=`server response ${this.statusCode} ${this.statusMessage}`),(0,t.assert)(!1,X,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:Ae})}};ne=new WeakMap,le=new WeakMap,ie=new WeakMap,pe=new WeakMap,xe=new WeakMap,me=new WeakMap;let x=be;fs.FetchResponse=x;function y(){return new Date().getTime()}function A(Ie){return(0,s.toUtf8Bytes)(Ie.replace(/%([0-9a-f][0-9a-f])/gi,(X,Ae)=>String.fromCharCode(parseInt(Ae,16))))}function S(Ie){return new Promise(X=>setTimeout(X,Ie))}return fs}var ou={},b8;function Xv(){var b,v,w,m,B0,y,ms,S,e5,O,t5,E,n5,P,r5;if(b8)return ou;b8=1,Object.defineProperty(ou,"__esModule",{value:!0}),ou.FixedNumber=void 0;const n=Ur(),e=cs(),t=Mf(),r=La(),s=BigInt(-1),i=BigInt(0),a=BigInt(1),o=BigInt(5),u={};let c="0000";for(;c.length<80;)c+=c;function l(z){let F=c;for(;F.length=-L&&zi?z=(0,t.fromTwos)((0,t.mask)(z,H),H):z=-(0,t.fromTwos)((0,t.mask)(-z,H),H)}else{const L=a<=0&&zM[B]==null?K:((0,e.assertArgument)(typeof M[B]===N,"invalid fixed format ("+B+" not "+N+")","format."+B,M[B]),M[B]);F=T("signed","boolean",F),W=T("width","number",W),H=T("decimals","number",H)}(0,e.assertArgument)(W%8===0,"invalid FixedNumber width (not byte aligned)","format.width",W),(0,e.assertArgument)(H<=80,"invalid FixedNumber decimals (too large)","format.decimals",H);const L=(F?"":"u")+"fixed"+String(W)+"x"+String(H);return{signed:F,width:W,decimals:H,name:L}}function h(z,F){let W="";z0?H*=l(L):L<0&&(W*=l(-L)),WH?1:0}eq(F){return this.cmp(F)===0}lt(F){return this.cmp(F)<0}lte(F){return this.cmp(F)<=0}gt(F){return this.cmp(F)>0}gte(F){return this.cmp(F)>=0}floor(){let F=g(this,v);return g(this,v)i&&(F+=g(this,w)-a),F=g(this,v)/g(this,w)*g(this,w),Q(this,y,ms).call(this,F,"ceiling")}round(F){if(F==null&&(F=0),F>=this.decimals)return this;const W=this.decimals-F,H=o*l(W-1);let L=this.value+H;const M=l(W);return L=L/M*M,d(L,g(this,b),"round"),new j(u,L,g(this,b))}isZero(){return g(this,v)===i}isNegative(){return g(this,v)0){const N=l(B);(0,e.assert)(T%N===i,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:F}),T/=N}else B<0&&(T*=l(-B));return d(T,M,"fromValue"),new j(u,T,M)}static fromString(F,W){const H=F.match(/^(-?)([0-9]*)\.?([0-9]*)$/);(0,e.assertArgument)(H&&H[2].length+H[3].length>0,"invalid FixedNumber string value","value",F);const L=f(W);let M=H[2]||"0",T=H[3]||"";for(;T.length{(0,e.assert)(d<=u.length,"data short segment too short","BUFFER_OVERRUN",{buffer:u,length:u.length,offset:d})};if(u[c]>=248){const d=u[c]-247;l(c+1+d);const f=s(u,c+1,d);return l(c+1+d+f),i(u,c,c+1+d,d+f)}else if(u[c]>=192){const d=u[c]-192;return l(c+1+d),i(u,c,c+1,d)}else if(u[c]>=184){const d=u[c]-183;l(c+1+d);const f=s(u,c+1,d);l(c+1+d+f);const h=(0,n.hexlify)(u.slice(c+1+d,c+1+d+f));return{consumed:1+d+f,result:h}}else if(u[c]>=128){const d=u[c]-128;l(c+1+d);const f=(0,n.hexlify)(u.slice(c+1,c+1+d));return{consumed:1+d,result:f}}return{consumed:1,result:r(u[c])}}function o(u){const c=(0,t.getBytes)(u,"data"),l=a(c,0);return(0,e.assertArgument)(l.consumed===c.length,"unexpected junk after rlp payload","data",u),l.result}return cu.decodeRlp=o,cu}var uu={},y8;function ZN(){if(y8)return uu;y8=1,Object.defineProperty(uu,"__esModule",{value:!0}),uu.encodeRlp=void 0;const n=Ur();function e(i){const a=[];for(;i;)a.unshift(i&255),i>>=8;return a}function t(i){if(Array.isArray(i)){let u=[];if(i.forEach(function(l){u=u.concat(t(l))}),u.length<=55)return u.unshift(192+u.length),u;const c=e(u.length);return c.unshift(247+c.length),c.concat(u)}const a=Array.prototype.slice.call((0,n.getBytes)(i,"object"));if(a.length===1&&a[0]<=127)return a;if(a.length<=55)return a.unshift(128+a.length),a;const o=e(a.length);return o.unshift(183+o.length),o.concat(a)}const r="0123456789abcdef";function s(i){let a="0x";for(const o of t(i))a+=r[o>>4],a+=r[o&15];return a}return uu.encodeRlp=s,uu}var pr={},m8;function XN(){if(m8)return pr;m8=1,Object.defineProperty(pr,"__esModule",{value:!0}),pr.parseEther=pr.formatEther=pr.parseUnits=pr.formatUnits=void 0;const n=cs(),e=Xv(),t=Mf(),r=["wei","kwei","mwei","gwei","szabo","finney","ether"];function s(u,c){let l=18;if(typeof c=="string"){const d=r.indexOf(c);(0,n.assertArgument)(d>=0,"invalid unit","unit",c),l=3*d}else c!=null&&(l=(0,t.getNumber)(c,"unit"));return e.FixedNumber.fromValue(u,l,{decimals:l,width:512}).toString()}pr.formatUnits=s;function i(u,c){(0,n.assertArgument)(typeof u=="string","value must be a string","value",u);let l=18;if(typeof c=="string"){const d=r.indexOf(c);(0,n.assertArgument)(d>=0,"invalid unit","unit",c),l=3*d}else c!=null&&(l=(0,t.getNumber)(c,"unit"));return e.FixedNumber.fromString(u,{decimals:l,width:512}).value}pr.parseUnits=i;function a(u){return s(u,18)}pr.formatEther=a;function o(u){return i(u,18)}return pr.parseEther=o,pr}var lu={},x8;function eI(){if(x8)return lu;x8=1,Object.defineProperty(lu,"__esModule",{value:!0}),lu.uuidV4=void 0;const n=Ur();function e(t){const r=(0,n.getBytes)(t,"randomBytes");r[6]=r[6]&15|64,r[8]=r[8]&63|128;const s=(0,n.hexlify)(r);return[s.substring(2,10),s.substring(10,14),s.substring(14,18),s.substring(18,22),s.substring(22,34)].join("-")}return lu.uuidV4=e,lu}var w8;function Ee(){return w8||(w8=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.toUtf8String=n.toUtf8CodePoints=n.toUtf8Bytes=n.parseUnits=n.formatUnits=n.parseEther=n.formatEther=n.encodeRlp=n.decodeRlp=n.defineProperties=n.resolveProperties=n.toQuantity=n.toBeArray=n.toBeHex=n.toNumber=n.toBigInt=n.getUint=n.getNumber=n.getBigInt=n.mask=n.toTwos=n.fromTwos=n.FixedNumber=n.FetchCancelSignal=n.FetchResponse=n.FetchRequest=n.EventPayload=n.makeError=n.assertNormalize=n.assertPrivate=n.assertArgumentCount=n.assertArgument=n.assert=n.isError=n.isCallException=n.zeroPadBytes=n.zeroPadValue=n.stripZerosLeft=n.dataSlice=n.dataLength=n.concat=n.hexlify=n.isBytesLike=n.isHexString=n.getBytesCopy=n.getBytes=n.encodeBase64=n.decodeBase64=n.encodeBase58=n.decodeBase58=void 0,n.uuidV4=n.Utf8ErrorFuncs=void 0;var e=VN();Object.defineProperty(n,"decodeBase58",{enumerable:!0,get:function(){return e.decodeBase58}}),Object.defineProperty(n,"encodeBase58",{enumerable:!0,get:function(){return e.encodeBase58}});var t=Zv();Object.defineProperty(n,"decodeBase64",{enumerable:!0,get:function(){return t.decodeBase64}}),Object.defineProperty(n,"encodeBase64",{enumerable:!0,get:function(){return t.encodeBase64}});var r=Ur();Object.defineProperty(n,"getBytes",{enumerable:!0,get:function(){return r.getBytes}}),Object.defineProperty(n,"getBytesCopy",{enumerable:!0,get:function(){return r.getBytesCopy}}),Object.defineProperty(n,"isHexString",{enumerable:!0,get:function(){return r.isHexString}}),Object.defineProperty(n,"isBytesLike",{enumerable:!0,get:function(){return r.isBytesLike}}),Object.defineProperty(n,"hexlify",{enumerable:!0,get:function(){return r.hexlify}}),Object.defineProperty(n,"concat",{enumerable:!0,get:function(){return r.concat}}),Object.defineProperty(n,"dataLength",{enumerable:!0,get:function(){return r.dataLength}}),Object.defineProperty(n,"dataSlice",{enumerable:!0,get:function(){return r.dataSlice}}),Object.defineProperty(n,"stripZerosLeft",{enumerable:!0,get:function(){return r.stripZerosLeft}}),Object.defineProperty(n,"zeroPadValue",{enumerable:!0,get:function(){return r.zeroPadValue}}),Object.defineProperty(n,"zeroPadBytes",{enumerable:!0,get:function(){return r.zeroPadBytes}});var s=cs();Object.defineProperty(n,"isCallException",{enumerable:!0,get:function(){return s.isCallException}}),Object.defineProperty(n,"isError",{enumerable:!0,get:function(){return s.isError}}),Object.defineProperty(n,"assert",{enumerable:!0,get:function(){return s.assert}}),Object.defineProperty(n,"assertArgument",{enumerable:!0,get:function(){return s.assertArgument}}),Object.defineProperty(n,"assertArgumentCount",{enumerable:!0,get:function(){return s.assertArgumentCount}}),Object.defineProperty(n,"assertPrivate",{enumerable:!0,get:function(){return s.assertPrivate}}),Object.defineProperty(n,"assertNormalize",{enumerable:!0,get:function(){return s.assertNormalize}}),Object.defineProperty(n,"makeError",{enumerable:!0,get:function(){return s.makeError}});var i=qN();Object.defineProperty(n,"EventPayload",{enumerable:!0,get:function(){return i.EventPayload}});var a=QN();Object.defineProperty(n,"FetchRequest",{enumerable:!0,get:function(){return a.FetchRequest}}),Object.defineProperty(n,"FetchResponse",{enumerable:!0,get:function(){return a.FetchResponse}}),Object.defineProperty(n,"FetchCancelSignal",{enumerable:!0,get:function(){return a.FetchCancelSignal}});var o=Xv();Object.defineProperty(n,"FixedNumber",{enumerable:!0,get:function(){return o.FixedNumber}});var u=Mf();Object.defineProperty(n,"fromTwos",{enumerable:!0,get:function(){return u.fromTwos}}),Object.defineProperty(n,"toTwos",{enumerable:!0,get:function(){return u.toTwos}}),Object.defineProperty(n,"mask",{enumerable:!0,get:function(){return u.mask}}),Object.defineProperty(n,"getBigInt",{enumerable:!0,get:function(){return u.getBigInt}}),Object.defineProperty(n,"getNumber",{enumerable:!0,get:function(){return u.getNumber}}),Object.defineProperty(n,"getUint",{enumerable:!0,get:function(){return u.getUint}}),Object.defineProperty(n,"toBigInt",{enumerable:!0,get:function(){return u.toBigInt}}),Object.defineProperty(n,"toNumber",{enumerable:!0,get:function(){return u.toNumber}}),Object.defineProperty(n,"toBeHex",{enumerable:!0,get:function(){return u.toBeHex}}),Object.defineProperty(n,"toBeArray",{enumerable:!0,get:function(){return u.toBeArray}}),Object.defineProperty(n,"toQuantity",{enumerable:!0,get:function(){return u.toQuantity}});var c=La();Object.defineProperty(n,"resolveProperties",{enumerable:!0,get:function(){return c.resolveProperties}}),Object.defineProperty(n,"defineProperties",{enumerable:!0,get:function(){return c.defineProperties}});var l=YN();Object.defineProperty(n,"decodeRlp",{enumerable:!0,get:function(){return l.decodeRlp}});var d=ZN();Object.defineProperty(n,"encodeRlp",{enumerable:!0,get:function(){return d.encodeRlp}});var f=XN();Object.defineProperty(n,"formatEther",{enumerable:!0,get:function(){return f.formatEther}}),Object.defineProperty(n,"parseEther",{enumerable:!0,get:function(){return f.parseEther}}),Object.defineProperty(n,"formatUnits",{enumerable:!0,get:function(){return f.formatUnits}}),Object.defineProperty(n,"parseUnits",{enumerable:!0,get:function(){return f.parseUnits}});var h=Pb();Object.defineProperty(n,"toUtf8Bytes",{enumerable:!0,get:function(){return h.toUtf8Bytes}}),Object.defineProperty(n,"toUtf8CodePoints",{enumerable:!0,get:function(){return h.toUtf8CodePoints}}),Object.defineProperty(n,"toUtf8String",{enumerable:!0,get:function(){return h.toUtf8String}}),Object.defineProperty(n,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return h.Utf8ErrorFuncs}});var p=eI();Object.defineProperty(n,"uuidV4",{enumerable:!0,get:function(){return p.uuidV4}})}(v2)),v2}var E2={},v8;function jr(){return v8||(v8=1,function(n){var f,p,b,v,h1,m,x,y,eA;Object.defineProperty(n,"__esModule",{value:!0}),n.Reader=n.Writer=n.Coder=n.checkResultErrors=n.Result=n.WordSize=void 0;const e=Ee();n.WordSize=32;const t=new Uint8Array(n.WordSize),r=["then"],s={};function i(D,O){const _=new Error(`deferred error during ABI decoding triggered accessing ${D}`);throw _.error=O,_}const h=class h extends Array{constructor(..._){const E=_[0];let C=_[1],P=(_[2]||[]).slice(),I=!0;E!==s&&(C=_,P=[],I=!1);super(C.length);$(this,f,void 0);C.forEach((z,F)=>{this[F]=z});const j=P.reduce((z,F)=>(typeof F=="string"&&z.set(F,(z.get(F)||0)+1),z),new Map);if(k(this,f,Object.freeze(C.map((z,F)=>{const W=P[F];return W!=null&&j.get(W)===1?W:null}))),!!I)return Object.freeze(this),new Proxy(this,{get:(z,F,W)=>{if(typeof F=="string"){if(F.match(/^[0-9]+$/)){const L=(0,e.getNumber)(F,"%index");if(L<0||L>=this.length)throw new RangeError("out of result range");const M=z[L];return M instanceof Error&&i(`index ${L}`,M),M}if(r.indexOf(F)>=0)return Reflect.get(z,F,W);const H=z[F];if(H instanceof Function)return function(...L){return H.apply(this===W?z:this,L)};if(!(F in z))return z.getValue.apply(this===W?z:this,[F])}return Reflect.get(z,F,W)}})}toArray(){const _=[];return this.forEach((E,C)=>{E instanceof Error&&i(`index ${C}`,E),_.push(E)}),_}toObject(){return g(this,f).reduce((_,E,C)=>((0,e.assert)(E!=null,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"}),E in _||(_[E]=this.getValue(E)),_),{})}slice(_,E){_==null&&(_=0),_<0&&(_+=this.length,_<0&&(_=0)),E==null&&(E=this.length),E<0&&(E+=this.length,E<0&&(E=0)),E>this.length&&(E=this.length);const C=[],P=[];for(let I=_;I{g(this,p)[O]=u(_)}}}p=new WeakMap,b=new WeakMap,v=new WeakSet,h1=function(O){return g(this,p).push(O),k(this,b,g(this,b)+O.length),O.length},n.Writer=l;const S=class S{constructor(O,_){$(this,y);R(this,"allowLoose");$(this,m,void 0);$(this,x,void 0);(0,e.defineProperties)(this,{allowLoose:!!_}),k(this,m,(0,e.getBytesCopy)(O)),k(this,x,0)}get data(){return(0,e.hexlify)(g(this,m))}get dataLength(){return g(this,m).length}get consumed(){return g(this,x)}get bytes(){return new Uint8Array(g(this,m))}subReader(O){return new S(g(this,m).slice(g(this,x)+O),this.allowLoose)}readBytes(O,_){let E=Q(this,y,eA).call(this,0,O,!!_);return k(this,x,g(this,x)+E.length),E.slice(0,O)}readValue(){return(0,e.toBigInt)(this.readBytes(n.WordSize))}readIndex(){return(0,e.toNumber)(this.readBytes(n.WordSize))}};m=new WeakMap,x=new WeakMap,y=new WeakSet,eA=function(O,_,E){let C=Math.ceil(_/n.WordSize)*n.WordSize;return g(this,x)+C>g(this,m).length&&(this.allowLoose&&E&&g(this,x)+_<=g(this,m).length?C=_:(0,e.assert)(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:(0,e.getBytesCopy)(g(this,m)),length:g(this,m).length,offset:g(this,x)+C})),g(this,m).slice(g(this,x),g(this,x)+C)};let d=S;n.Reader=d}(E2)),E2}var fu={},_2={},h0={},P2={},du={},br={};const tI=jn(W_),nI=jn(V_),rI=jn(X_),sI=jn(CP);var A8;function Dh(){if(A8)return br;A8=1,Object.defineProperty(br,"__esModule",{value:!0}),br.randomBytes=br.pbkdf2Sync=br.createHmac=br.createHash=void 0;const n=tI,e=nI,t=rI,r=sI,s=Ee();function i(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof oe<"u")return oe;throw new Error("unable to locate global object")}const a=i(),o=a.crypto||a.msCrypto;function u(f){switch(f){case"sha256":return t.sha256.create();case"sha512":return r.sha512.create()}(0,s.assertArgument)(!1,"invalid hashing algorithm name","algorithm",f)}br.createHash=u;function c(f,h){const p={sha256:t.sha256,sha512:r.sha512}[f];return(0,s.assertArgument)(p!=null,"invalid hmac algorithm","algorithm",f),n.hmac.create(p,h)}br.createHmac=c;function l(f,h,p,b,v){const w={sha256:t.sha256,sha512:r.sha512}[v];return(0,s.assertArgument)(w!=null,"invalid pbkdf2 algorithm","algorithm",v),(0,e.pbkdf2)(w,f,h,{c:p,dkLen:b})}br.pbkdf2Sync=l;function d(f){(0,s.assert)(o!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),(0,s.assertArgument)(Number.isInteger(f)&&f>0&&f<=1024,"invalid length","length",f);const h=new Uint8Array(f);return o.getRandomValues(h),h}return br.randomBytes=d,br}var E8;function tA(){if(E8)return du;E8=1,Object.defineProperty(du,"__esModule",{value:!0}),du.computeHmac=void 0;const n=Dh(),e=Ee();let t=!1;const r=function(a,o,u){return(0,n.createHmac)(a,o).update(u).digest()};let s=r;function i(a,o,u){const c=(0,e.getBytes)(o,"key"),l=(0,e.getBytes)(u,"data");return(0,e.hexlify)(s(a,c,l))}return du.computeHmac=i,i._=r,i.lock=function(){t=!0},i.register=function(a){if(t)throw new Error("computeHmac is locked");s=a},Object.freeze(i),du}var hu={};const iI=jn(JP);var _8;function aI(){if(_8)return hu;_8=1,Object.defineProperty(hu,"__esModule",{value:!0}),hu.keccak256=void 0;const n=iI,e=Ee();let t=!1;const r=function(a){return(0,n.keccak_256)(a)};let s=r;function i(a){const o=(0,e.getBytes)(a,"data");return(0,e.hexlify)(s(o))}return hu.keccak256=i,i._=r,i.lock=function(){t=!0},i.register=function(a){if(t)throw new TypeError("keccak256 is locked");s=a},Object.freeze(i),hu}var pu={};const oI=jn(nk);var P8;function cI(){if(P8)return pu;P8=1,Object.defineProperty(pu,"__esModule",{value:!0}),pu.ripemd160=void 0;const n=oI,e=Ee();let t=!1;const r=function(a){return(0,n.ripemd160)(a)};let s=r;function i(a){const o=(0,e.getBytes)(a,"data");return(0,e.hexlify)(s(o))}return pu.ripemd160=i,i._=r,i.lock=function(){t=!0},i.register=function(a){if(t)throw new TypeError("ripemd160 is locked");s=a},Object.freeze(i),pu}var bu={},k8;function uI(){if(k8)return bu;k8=1,Object.defineProperty(bu,"__esModule",{value:!0}),bu.pbkdf2=void 0;const n=Dh(),e=Ee();let t=!1;const r=function(a,o,u,c,l){return(0,n.pbkdf2Sync)(a,o,u,c,l)};let s=r;function i(a,o,u,c,l){const d=(0,e.getBytes)(a,"password"),f=(0,e.getBytes)(o,"salt");return(0,e.hexlify)(s(d,f,u,c,l))}return bu.pbkdf2=i,i._=r,i.lock=function(){t=!0},i.register=function(a){if(t)throw new Error("pbkdf2 is locked");s=a},Object.freeze(i),bu}var gu={},C8;function lI(){if(C8)return gu;C8=1,Object.defineProperty(gu,"__esModule",{value:!0}),gu.randomBytes=void 0;const n=Dh();let e=!1;const t=function(i){return new Uint8Array((0,n.randomBytes)(i))};let r=t;function s(i){return r(i)}return gu.randomBytes=s,s._=t,s.lock=function(){e=!0},s.register=function(i){if(e)throw new Error("randomBytes is locked");r=i},Object.freeze(s),gu}var p0={};const fI=jn(rk);var S8;function dI(){if(S8)return p0;S8=1,Object.defineProperty(p0,"__esModule",{value:!0}),p0.scryptSync=p0.scrypt=void 0;const n=fI,e=Ee();let t=!1,r=!1;const s=async function(l,d,f,h,p,b,v){return await(0,n.scryptAsync)(l,d,{N:f,r:h,p,dkLen:b,onProgress:v})},i=function(l,d,f,h,p,b){return(0,n.scrypt)(l,d,{N:f,r:h,p,dkLen:b})};let a=s,o=i;async function u(l,d,f,h,p,b,v){const w=(0,e.getBytes)(l,"passwd"),m=(0,e.getBytes)(d,"salt");return(0,e.hexlify)(await a(w,m,f,h,p,b,v))}p0.scrypt=u,u._=s,u.lock=function(){r=!0},u.register=function(l){if(r)throw new Error("scrypt is locked");a=l},Object.freeze(u);function c(l,d,f,h,p,b){const v=(0,e.getBytes)(l,"passwd"),w=(0,e.getBytes)(d,"salt");return(0,e.hexlify)(o(v,w,f,h,p,b))}return p0.scryptSync=c,c._=i,c.lock=function(){t=!0},c.register=function(l){if(t)throw new Error("scryptSync is locked");o=l},Object.freeze(c),p0}var b0={},R8;function hI(){if(R8)return b0;R8=1,Object.defineProperty(b0,"__esModule",{value:!0}),b0.sha512=b0.sha256=void 0;const n=Dh(),e=Ee(),t=function(l){return(0,n.createHash)("sha256").update(l).digest()},r=function(l){return(0,n.createHash)("sha512").update(l).digest()};let s=t,i=r,a=!1,o=!1;function u(l){const d=(0,e.getBytes)(l,"data");return(0,e.hexlify)(s(d))}b0.sha256=u,u._=t,u.lock=function(){a=!0},u.register=function(l){if(a)throw new Error("sha256 is locked");s=l},Object.freeze(u);function c(l){const d=(0,e.getBytes)(l,"data");return(0,e.hexlify)(i(d))}return b0.sha512=c,c._=r,c.lock=function(){o=!0},c.register=function(l){if(o)throw new Error("sha512 is locked");i=l},Object.freeze(u),b0}var yu={};const pI=jn(xk);var mu={},k2={},xu={},T8;function bI(){return T8||(T8=1,Object.defineProperty(xu,"__esModule",{value:!0}),xu.ZeroAddress=void 0,xu.ZeroAddress="0x0000000000000000000000000000000000000000"),xu}var wu={},O8;function gI(){return O8||(O8=1,Object.defineProperty(wu,"__esModule",{value:!0}),wu.ZeroHash=void 0,wu.ZeroHash="0x0000000000000000000000000000000000000000000000000000000000000000"),wu}var Cn={},N8;function yI(){return N8||(N8=1,Object.defineProperty(Cn,"__esModule",{value:!0}),Cn.MaxInt256=Cn.MinInt256=Cn.MaxUint256=Cn.WeiPerEther=Cn.N=void 0,Cn.N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Cn.WeiPerEther=BigInt("1000000000000000000"),Cn.MaxUint256=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Cn.MinInt256=BigInt("0x8000000000000000000000000000000000000000000000000000000000000000")*BigInt(-1),Cn.MaxInt256=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")),Cn}var g0={},I8;function mI(){return I8||(I8=1,Object.defineProperty(g0,"__esModule",{value:!0}),g0.MessagePrefix=g0.EtherSymbol=void 0,g0.EtherSymbol="Ξ",g0.MessagePrefix=`Ethereum Signed Message: +`),g0}var B8;function jf(){return B8||(B8=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.MessagePrefix=n.EtherSymbol=n.MaxInt256=n.MinInt256=n.MaxUint256=n.WeiPerEther=n.N=n.ZeroHash=n.ZeroAddress=void 0;var e=bI();Object.defineProperty(n,"ZeroAddress",{enumerable:!0,get:function(){return e.ZeroAddress}});var t=gI();Object.defineProperty(n,"ZeroHash",{enumerable:!0,get:function(){return t.ZeroHash}});var r=yI();Object.defineProperty(n,"N",{enumerable:!0,get:function(){return r.N}}),Object.defineProperty(n,"WeiPerEther",{enumerable:!0,get:function(){return r.WeiPerEther}}),Object.defineProperty(n,"MaxUint256",{enumerable:!0,get:function(){return r.MaxUint256}}),Object.defineProperty(n,"MinInt256",{enumerable:!0,get:function(){return r.MinInt256}}),Object.defineProperty(n,"MaxInt256",{enumerable:!0,get:function(){return r.MaxInt256}});var s=mI();Object.defineProperty(n,"EtherSymbol",{enumerable:!0,get:function(){return s.EtherSymbol}}),Object.defineProperty(n,"MessagePrefix",{enumerable:!0,get:function(){return s.MessagePrefix}})}(k2)),k2}var F8;function nA(){var d,f,h,p;if(F8)return mu;F8=1,Object.defineProperty(mu,"__esModule",{value:!0}),mu.Signature=void 0;const n=jf(),e=Ee(),t=BigInt(0),r=BigInt(1),s=BigInt(2),i=BigInt(27),a=BigInt(28),o=BigInt(35),u={};function c(v){return(0,e.zeroPadValue)((0,e.toBeArray)(v),32)}const b=class b{constructor(w,m,x,y){$(this,d,void 0);$(this,f,void 0);$(this,h,void 0);$(this,p,void 0);(0,e.assertPrivate)(w,u,"Signature"),k(this,d,m),k(this,f,x),k(this,h,y),k(this,p,null)}get r(){return g(this,d)}set r(w){(0,e.assertArgument)((0,e.dataLength)(w)===32,"invalid r","value",w),k(this,d,(0,e.hexlify)(w))}get s(){return g(this,f)}set s(w){(0,e.assertArgument)((0,e.dataLength)(w)===32,"invalid s","value",w);const m=(0,e.hexlify)(w);(0,e.assertArgument)(parseInt(m.substring(0,3))<8,"non-canonical s","value",m),k(this,f,m)}get v(){return g(this,h)}set v(w){const m=(0,e.getNumber)(w,"value");(0,e.assertArgument)(m===27||m===28,"invalid v","v",w),k(this,h,m)}get networkV(){return g(this,p)}get legacyChainId(){const w=this.networkV;return w==null?null:b.getChainId(w)}get yParity(){return this.v===27?0:1}get yParityAndS(){const w=(0,e.getBytes)(this.s);return this.yParity&&(w[0]|=128),(0,e.hexlify)(w)}get compactSerialized(){return(0,e.concat)([this.r,this.yParityAndS])}get serialized(){return(0,e.concat)([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 w=new b(u,this.r,this.s,this.v);return this.networkV&&k(w,p,this.networkV),w}toJSON(){const w=this.networkV;return{_type:"signature",networkV:w!=null?w.toString():null,r:this.r,s:this.s,v:this.v}}static getChainId(w){const m=(0,e.getBigInt)(w,"v");return m==i||m==a?t:((0,e.assertArgument)(m>=o,"invalid EIP-155 v","v",w),(m-o)/s)}static getChainIdV(w,m){return(0,e.getBigInt)(w)*s+BigInt(35+m-27)}static getNormalizedV(w){const m=(0,e.getBigInt)(w);return m===t||m===i?27:m===r||m===a?28:((0,e.assertArgument)(m>=o,"invalid v","v",w),m&r?27:28)}static from(w){function m(_,E){(0,e.assertArgument)(_,E,"signature",w)}if(w==null)return new b(u,n.ZeroHash,n.ZeroHash,27);if(typeof w=="string"){const _=(0,e.getBytes)(w,"signature");if(_.length===64){const E=(0,e.hexlify)(_.slice(0,32)),C=_.slice(32,64),P=C[0]&128?28:27;return C[0]&=127,new b(u,E,(0,e.hexlify)(C),P)}if(_.length===65){const E=(0,e.hexlify)(_.slice(0,32)),C=_.slice(32,64);m((C[0]&128)===0,"non-canonical s");const P=b.getNormalizedV(_[64]);return new b(u,E,(0,e.hexlify)(C),P)}m(!1,"invalid raw signature length")}if(w instanceof b)return w.clone();const x=w.r;m(x!=null,"missing r");const y=c(x),A=function(_,E){if(_!=null)return c(_);if(E!=null){m((0,e.isHexString)(E,32),"invalid yParityAndS");const C=(0,e.getBytes)(E);return C[0]&=127,(0,e.hexlify)(C)}m(!1,"missing s")}(w.s,w.yParityAndS);m(((0,e.getBytes)(A)[0]&128)==0,"non-canonical s");const{networkV:S,v:D}=function(_,E,C){if(_!=null){const P=(0,e.getBigInt)(_);return{networkV:P>=o?P:void 0,v:b.getNormalizedV(P)}}if(E!=null)return m((0,e.isHexString)(E,32),"invalid yParityAndS"),{v:(0,e.getBytes)(E)[0]&128?28:27};if(C!=null){switch((0,e.getNumber)(C,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}m(!1,"invalid yParity")}m(!1,"missing v")}(w.v,w.yParityAndS,w.yParity),O=new b(u,y,A,D);return S&&k(O,p,S),m(w.yParity==null||(0,e.getNumber)(w.yParity,"sig.yParity")===O.yParity,"yParity mismatch"),m(w.yParityAndS==null||w.yParityAndS===O.yParityAndS,"yParityAndS mismatch"),O}};d=new WeakMap,f=new WeakMap,h=new WeakMap,p=new WeakMap;let l=b;return mu.Signature=l,mu}var U8;function xI(){var a;if(U8)return yu;U8=1,Object.defineProperty(yu,"__esModule",{value:!0}),yu.SigningKey=void 0;const e=Yv.__importStar(pI),t=Ee(),r=tA(),s=nA();e.utils.hmacSha256Sync=function(u,...c){return(0,t.getBytes)((0,r.computeHmac)("sha256",u,(0,t.concat)(c)))};const o=class o{constructor(c){$(this,a,void 0);(0,t.assertArgument)((0,t.dataLength)(c)===32,"invalid private key","privateKey","[REDACTED]"),k(this,a,(0,t.hexlify)(c))}get privateKey(){return g(this,a)}get publicKey(){return o.computePublicKey(g(this,a))}get compressedPublicKey(){return o.computePublicKey(g(this,a),!0)}sign(c){(0,t.assertArgument)((0,t.dataLength)(c)===32,"invalid digest length","digest",c);const[l,d]=e.signSync((0,t.getBytesCopy)(c),(0,t.getBytesCopy)(g(this,a)),{recovered:!0,canonical:!0}),f=e.Signature.fromHex(l);return s.Signature.from({r:(0,t.toBeHex)("0x"+f.r.toString(16),32),s:(0,t.toBeHex)("0x"+f.s.toString(16),32),v:d?28:27})}computeSharedSecret(c){const l=o.computePublicKey(c);return(0,t.hexlify)(e.getSharedSecret((0,t.getBytesCopy)(g(this,a)),(0,t.getBytes)(l)))}static computePublicKey(c,l){let d=(0,t.getBytes)(c,"key");if(d.length===32){const h=e.getPublicKey(d,!!l);return(0,t.hexlify)(h)}if(d.length===64){const h=new Uint8Array(65);h[0]=4,h.set(d,1),d=h}const f=e.Point.fromHex(d);return(0,t.hexlify)(f.toRawBytes(l))}static recoverPublicKey(c,l){(0,t.assertArgument)((0,t.dataLength)(c)===32,"invalid digest length","digest",c);const d=s.Signature.from(l),f=e.Signature.fromCompact((0,t.getBytesCopy)((0,t.concat)([d.r,d.s]))).toDERRawBytes(),h=e.recoverPublicKey((0,t.getBytesCopy)(c),f,d.yParity);return(0,t.assertArgument)(h!=null,"invalid signautre for digest","signature",l),(0,t.hexlify)(h)}static addPoints(c,l,d){const f=e.Point.fromHex(o.computePublicKey(c).substring(2)),h=e.Point.fromHex(o.computePublicKey(l).substring(2));return"0x"+f.add(h).toHex(!!d)}};a=new WeakMap;let i=o;return yu.SigningKey=i,yu}var L8;function Mt(){return L8||(L8=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.lock=n.Signature=n.SigningKey=n.scryptSync=n.scrypt=n.pbkdf2=n.sha512=n.sha256=n.ripemd160=n.keccak256=n.randomBytes=n.computeHmac=void 0;const e=tA();Object.defineProperty(n,"computeHmac",{enumerable:!0,get:function(){return e.computeHmac}});const t=aI();Object.defineProperty(n,"keccak256",{enumerable:!0,get:function(){return t.keccak256}});const r=cI();Object.defineProperty(n,"ripemd160",{enumerable:!0,get:function(){return r.ripemd160}});const s=uI();Object.defineProperty(n,"pbkdf2",{enumerable:!0,get:function(){return s.pbkdf2}});const i=lI();Object.defineProperty(n,"randomBytes",{enumerable:!0,get:function(){return i.randomBytes}});const a=dI();Object.defineProperty(n,"scrypt",{enumerable:!0,get:function(){return a.scrypt}}),Object.defineProperty(n,"scryptSync",{enumerable:!0,get:function(){return a.scryptSync}});const o=hI();Object.defineProperty(n,"sha256",{enumerable:!0,get:function(){return o.sha256}}),Object.defineProperty(n,"sha512",{enumerable:!0,get:function(){return o.sha512}});var u=xI();Object.defineProperty(n,"SigningKey",{enumerable:!0,get:function(){return u.SigningKey}});var c=nA();Object.defineProperty(n,"Signature",{enumerable:!0,get:function(){return c.Signature}});function l(){e.computeHmac.lock(),t.keccak256.lock(),s.pbkdf2.lock(),i.randomBytes.lock(),r.ripemd160.lock(),a.scrypt.lock(),a.scryptSync.lock(),o.sha256.lock(),o.sha512.lock(),i.randomBytes.lock()}n.lock=l}(P2)),P2}var D8;function kb(){if(D8)return h0;D8=1,Object.defineProperty(h0,"__esModule",{value:!0}),h0.getIcapAddress=h0.getAddress=void 0;const n=Mt(),e=Ee(),t=BigInt(0),r=BigInt(36);function s(f){f=f.toLowerCase();const h=f.substring(2).split(""),p=new Uint8Array(40);for(let v=0;v<40;v++)p[v]=h[v].charCodeAt(0);const b=(0,e.getBytes)((0,n.keccak256)(p));for(let v=0;v<40;v+=2)b[v>>1]>>4>=8&&(h[v]=h[v].toUpperCase()),(b[v>>1]&15)>=8&&(h[v+1]=h[v+1].toUpperCase());return"0x"+h.join("")}const i={};for(let f=0;f<10;f++)i[String(f)]=String(f);for(let f=0;f<26;f++)i[String.fromCharCode(65+f)]=String(10+f);const a=15;function o(f){f=f.toUpperCase(),f=f.substring(4)+f.substring(0,2)+"00";let h=f.split("").map(b=>i[b]).join("");for(;h.length>=a;){let b=h.substring(0,a);h=parseInt(b,10)%97+h.substring(b.length)}let p=String(98-parseInt(h,10)%97);for(;p.length<2;)p="0"+p;return p}const u=function(){const f={};for(let h=0;h<36;h++){const p="0123456789abcdefghijklmnopqrstuvwxyz"[h];f[p]=BigInt(h)}return f}();function c(f){f=f.toLowerCase();let h=t;for(let p=0;pc.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 g(this,a)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return g(this,a)===!0?-1:g(this,a)===!1?this.value.length:null}static from(c,l){return new o(e,c,l)}static uint8(c){return t(c,8)}static uint16(c){return t(c,16)}static uint24(c){return t(c,24)}static uint32(c){return t(c,32)}static uint40(c){return t(c,40)}static uint48(c){return t(c,48)}static uint56(c){return t(c,56)}static uint64(c){return t(c,64)}static uint72(c){return t(c,72)}static uint80(c){return t(c,80)}static uint88(c){return t(c,88)}static uint96(c){return t(c,96)}static uint104(c){return t(c,104)}static uint112(c){return t(c,112)}static uint120(c){return t(c,120)}static uint128(c){return t(c,128)}static uint136(c){return t(c,136)}static uint144(c){return t(c,144)}static uint152(c){return t(c,152)}static uint160(c){return t(c,160)}static uint168(c){return t(c,168)}static uint176(c){return t(c,176)}static uint184(c){return t(c,184)}static uint192(c){return t(c,192)}static uint200(c){return t(c,200)}static uint208(c){return t(c,208)}static uint216(c){return t(c,216)}static uint224(c){return t(c,224)}static uint232(c){return t(c,232)}static uint240(c){return t(c,240)}static uint248(c){return t(c,248)}static uint256(c){return t(c,256)}static uint(c){return t(c,256)}static int8(c){return t(c,-8)}static int16(c){return t(c,-16)}static int24(c){return t(c,-24)}static int32(c){return t(c,-32)}static int40(c){return t(c,-40)}static int48(c){return t(c,-48)}static int56(c){return t(c,-56)}static int64(c){return t(c,-64)}static int72(c){return t(c,-72)}static int80(c){return t(c,-80)}static int88(c){return t(c,-88)}static int96(c){return t(c,-96)}static int104(c){return t(c,-104)}static int112(c){return t(c,-112)}static int120(c){return t(c,-120)}static int128(c){return t(c,-128)}static int136(c){return t(c,-136)}static int144(c){return t(c,-144)}static int152(c){return t(c,-152)}static int160(c){return t(c,-160)}static int168(c){return t(c,-168)}static int176(c){return t(c,-176)}static int184(c){return t(c,-184)}static int192(c){return t(c,-192)}static int200(c){return t(c,-200)}static int208(c){return t(c,-208)}static int216(c){return t(c,-216)}static int224(c){return t(c,-224)}static int232(c){return t(c,-232)}static int240(c){return t(c,-240)}static int248(c){return t(c,-248)}static int256(c){return t(c,-256)}static int(c){return t(c,-256)}static bytes1(c){return r(c,1)}static bytes2(c){return r(c,2)}static bytes3(c){return r(c,3)}static bytes4(c){return r(c,4)}static bytes5(c){return r(c,5)}static bytes6(c){return r(c,6)}static bytes7(c){return r(c,7)}static bytes8(c){return r(c,8)}static bytes9(c){return r(c,9)}static bytes10(c){return r(c,10)}static bytes11(c){return r(c,11)}static bytes12(c){return r(c,12)}static bytes13(c){return r(c,13)}static bytes14(c){return r(c,14)}static bytes15(c){return r(c,15)}static bytes16(c){return r(c,16)}static bytes17(c){return r(c,17)}static bytes18(c){return r(c,18)}static bytes19(c){return r(c,19)}static bytes20(c){return r(c,20)}static bytes21(c){return r(c,21)}static bytes22(c){return r(c,22)}static bytes23(c){return r(c,23)}static bytes24(c){return r(c,24)}static bytes25(c){return r(c,25)}static bytes26(c){return r(c,26)}static bytes27(c){return r(c,27)}static bytes28(c){return r(c,28)}static bytes29(c){return r(c,29)}static bytes30(c){return r(c,30)}static bytes31(c){return r(c,31)}static bytes32(c){return r(c,32)}static address(c){return new o(e,"address",c)}static bool(c){return new o(e,"bool",!!c)}static bytes(c){return new o(e,"bytes",c)}static string(c){return new o(e,"string",c)}static array(c,l){throw new Error("not implemented yet")}static tuple(c,l){throw new Error("not implemented yet")}static overrides(c){return new o(e,"overrides",Object.assign({},c))}static isTyped(c){return c&&typeof c=="object"&&"_typedSymbol"in c&&c._typedSymbol===s}static dereference(c,l){if(o.isTyped(c)){if(c.type!==l)throw new Error(`invalid type: expecetd ${l}, got ${c.type}`);return c.value}return c}};a=new WeakMap;let i=o;return vu.Typed=i,vu}var G8;function AI(){if(G8)return fu;G8=1,Object.defineProperty(fu,"__esModule",{value:!0}),fu.AddressCoder=void 0;const n=Ot(),e=Mf(),t=ai(),r=jr();class s extends r.Coder{constructor(a){super("address","address",a,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(a,o){let u=t.Typed.dereference(o,"string");try{u=(0,n.getAddress)(u)}catch(c){return this._throwError(c.message,o)}return a.writeValue(u)}decode(a){return(0,n.getAddress)((0,e.toBeHex)(a.readValue(),20))}}return fu.AddressCoder=s,fu}var hs={},Au={},z8;function EI(){if(z8)return Au;z8=1,Object.defineProperty(Au,"__esModule",{value:!0}),Au.AnonymousCoder=void 0;const n=jr();class e extends n.Coder{constructor(s){super(s.name,s.type,"_",s.dynamic);R(this,"coder");this.coder=s}defaultValue(){return this.coder.defaultValue()}encode(s,i){return this.coder.encode(s,i)}decode(s){return this.coder.decode(s)}}return Au.AnonymousCoder=e,Au}var W8;function rA(){if(W8)return hs;W8=1,Object.defineProperty(hs,"__esModule",{value:!0}),hs.ArrayCoder=hs.unpack=hs.pack=void 0;const n=Ee(),e=ai(),t=jr(),r=EI();function s(o,u,c){let l=[];if(Array.isArray(c))l=c;else if(c&&typeof c=="object"){let b={};l=u.map(v=>{const w=v.localName;return(0,n.assert)(w,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:v},value:c}),(0,n.assert)(!b[w],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:v},value:c}),b[w]=!0,c[w]})}else(0,n.assertArgument)(!1,"invalid tuple value","tuple",c);(0,n.assertArgument)(u.length===l.length,"types/value length mismatch","tuple",c);let d=new t.Writer,f=new t.Writer,h=[];u.forEach((b,v)=>{let w=l[v];if(b.dynamic){let m=f.length;b.encode(f,w);let x=d.writeUpdatableValue();h.push(y=>{x(y+m)})}else b.encode(d,w)}),h.forEach(b=>{b(d.length)});let p=o.appendWriter(d);return p+=o.appendWriter(f),p}hs.pack=s;function i(o,u){let c=[],l=[],d=o.subReader(0);return u.forEach(f=>{let h=null;if(f.dynamic){let p=o.readIndex(),b=d.subReader(p);try{h=f.decode(b)}catch(v){if((0,n.isError)(v,"BUFFER_OVERRUN"))throw v;h=v,h.baseType=f.name,h.name=f.localName,h.type=f.type}}else try{h=f.decode(o)}catch(p){if((0,n.isError)(p,"BUFFER_OVERRUN"))throw p;h=p,h.baseType=f.name,h.name=f.localName,h.type=f.type}if(h==null)throw new Error("investigate");c.push(h),l.push(f.localName||null)}),t.Result.fromItems(c,l)}hs.unpack=i;class a extends t.Coder{constructor(c,l,d){const f=c.type+"["+(l>=0?l:"")+"]",h=l===-1||c.dynamic;super("array",f,d,h);R(this,"coder");R(this,"length");(0,n.defineProperties)(this,{coder:c,length:l})}defaultValue(){const c=this.coder.defaultValue(),l=[];for(let d=0;dh||d<-(h+s))&&this._throwError("value out-of-bounds",l),d=(0,n.toTwos)(d,8*t.WordSize)}else(d(0,n.mask)(f,this.size*8))&&this._throwError("value out-of-bounds",l);return c.writeValue(d)}decode(c){let l=(0,n.mask)(c.readValue(),this.size*8);return this.signed&&(l=(0,n.fromTwos)(l,this.size*8)),l}}return ku.NumberCoder=a,ku}var Cu={},Y8;function SI(){if(Y8)return Cu;Y8=1,Object.defineProperty(Cu,"__esModule",{value:!0}),Cu.StringCoder=void 0;const n=Pb(),e=ai(),t=sA();class r extends t.DynamicBytesCoder{constructor(i){super("string",i)}defaultValue(){return""}encode(i,a){return super.encode(i,(0,n.toUtf8Bytes)(e.Typed.dereference(a,"string")))}decode(i){return(0,n.toUtf8String)(super.decode(i))}}return Cu.StringCoder=r,Cu}var Su={},Z8;function RI(){if(Z8)return Su;Z8=1,Object.defineProperty(Su,"__esModule",{value:!0}),Su.TupleCoder=void 0;const n=La(),e=ai(),t=jr(),r=rA();class s extends t.Coder{constructor(o,u){let c=!1;const l=[];o.forEach(f=>{f.dynamic&&(c=!0),l.push(f.type)});const d="tuple("+l.join(",")+")";super("tuple",d,u,c);R(this,"coders");(0,n.defineProperties)(this,{coders:Object.freeze(o.slice())})}defaultValue(){const o=[];this.coders.forEach(c=>{o.push(c.defaultValue())});const u=this.coders.reduce((c,l)=>{const d=l.localName;return d&&(c[d]||(c[d]=0),c[d]++),c},{});return this.coders.forEach((c,l)=>{let d=c.localName;!d||u[d]!==1||(d==="length"&&(d="_length"),o[d]==null&&(o[d]=o[l]))}),Object.freeze(o)}encode(o,u){const c=e.Typed.dereference(u,"tuple");return(0,r.pack)(o,this.coders,c)}decode(o){return(0,r.unpack)(o,this.coders)}}return Su.TupleCoder=s,Su}var xt={},C2={},Ru={},X8;function iA(){if(X8)return Ru;X8=1,Object.defineProperty(Ru,"__esModule",{value:!0}),Ru.id=void 0;const n=Mt(),e=Ee();function t(r){return(0,n.keccak256)((0,e.toUtf8Bytes)(r))}return Ru.id=t,Ru}var gr={};const TI=jn(AC);var e3;function OI(){if(e3)return gr;e3=1,Object.defineProperty(gr,"__esModule",{value:!0}),gr.dnsEncode=gr.namehash=gr.isValidName=gr.ensNormalize=void 0;const n=Mt(),e=Ee(),t=TI,r=new Uint8Array(32);r.fill(0);function s(l){return(0,e.assertArgument)(l.length!==0,"invalid ENS name; empty component","comp",l),l}function i(l){const d=(0,e.toUtf8Bytes)(a(l)),f=[];if(l.length===0)return f;let h=0;for(let p=0;p{if(d.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const f=new Uint8Array(d.length+1);return f.set(d,1),f[0]=f.length-1,f})))+"00"}return gr.dnsEncode=c,gr}var x0={},S2={},Tu={},t3;function aA(){if(t3)return Tu;t3=1,Object.defineProperty(Tu,"__esModule",{value:!0}),Tu.accessListify=void 0;const n=Ot(),e=Ee();function t(s,i){return{address:(0,n.getAddress)(s),storageKeys:i.map((a,o)=>((0,e.assertArgument)((0,e.isHexString)(a,32),"invalid slot",`storageKeys[${o}]`,a),a.toLowerCase()))}}function r(s){if(Array.isArray(s))return s.map((a,o)=>Array.isArray(a)?((0,e.assertArgument)(a.length===2,"invalid slot set",`value[${o}]`,a),t(a[0],a[1])):((0,e.assertArgument)(a!=null&&typeof a=="object","invalid address-slot set","value",s),t(a.address,a.storageKeys)));(0,e.assertArgument)(s!=null&&typeof s=="object","invalid access list","value",s);const i=Object.keys(s).map(a=>{const o=s[a].reduce((u,c)=>(u[c]=!0,u),{});return t(a,Object.keys(o).sort())});return i.sort((a,o)=>a.address.localeCompare(o.address)),i}return Tu.accessListify=r,Tu}var w0={},n3;function oA(){if(n3)return w0;n3=1,Object.defineProperty(w0,"__esModule",{value:!0}),w0.recoverAddress=w0.computeAddress=void 0;const n=Ot(),e=Mt();function t(s){let i;return typeof s=="string"?i=e.SigningKey.computePublicKey(s,!1):i=s.publicKey,(0,n.getAddress)((0,e.keccak256)("0x"+i.substring(4)).substring(26))}w0.computeAddress=t;function r(s,i){return t(e.SigningKey.recoverPublicKey(s,i))}return w0.recoverAddress=r,w0}var Ou={},r3;function NI(){var _,E,C,P,I,j,z,F,W,H,L,M;if(r3)return Ou;r3=1,Object.defineProperty(Ou,"__esModule",{value:!0}),Ou.Transaction=void 0;const n=Ot(),e=Mt(),t=Ee(),r=aA(),s=oA(),i=BigInt(0),a=BigInt(2),o=BigInt(27),u=BigInt(28),c=BigInt(35),l=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function d(B){return B==="0x"?null:(0,n.getAddress)(B)}function f(B,N){try{return(0,r.accessListify)(B)}catch(K){(0,t.assertArgument)(!1,K.message,N,B)}}function h(B,N){return B==="0x"?0:(0,t.getNumber)(B,N)}function p(B,N){if(B==="0x")return i;const K=(0,t.getBigInt)(B,N);return(0,t.assertArgument)(K<=l,"value exceeds uint size",N,K),K}function b(B,N){const K=(0,t.getBigInt)(B,"value"),te=(0,t.toBeArray)(K);return(0,t.assertArgument)(te.length<=32,"value too large",`tx.${N}`,K),te}function v(B){return(0,r.accessListify)(B).map(N=>[N.address,N.storageKeys])}function w(B){const N=(0,t.decodeRlp)(B);(0,t.assertArgument)(Array.isArray(N)&&(N.length===9||N.length===6),"invalid field count for legacy transaction","data",B);const K={type:0,nonce:h(N[0],"nonce"),gasPrice:p(N[1],"gasPrice"),gasLimit:p(N[2],"gasLimit"),to:d(N[3]),value:p(N[4],"value"),data:(0,t.hexlify)(N[5]),chainId:i};if(N.length===6)return K;const te=p(N[6],"v"),ne=p(N[7],"r"),le=p(N[8],"s");if(ne===i&&le===i)K.chainId=te;else{let ie=(te-c)/a;ie=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),(0,t.assert)(!K||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),(0,t.assert)(this.type!==0||!te,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const ne=[];return this.type!=null?ne.push(this.type):K?ne.push(2):N?(ne.push(1),te||ne.push(0)):te?(ne.push(1),ne.push(2)):(ne.push(0),ne.push(1),ne.push(2)),ne.sort(),ne}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}clone(){return T.from(this)}toJSON(){const N=K=>K==null?null:K.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:N(this.gasLimit),gasPrice:N(this.gasPrice),maxPriorityFeePerGas:N(this.maxPriorityFeePerGas),maxFeePerGas:N(this.maxFeePerGas),value:N(this.value),chainId:N(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(N){if(N==null)return new T;if(typeof N=="string"){const te=(0,t.getBytes)(N);if(te[0]>=127)return T.from(w(te));switch(te[0]){case 1:return T.from(S(te));case 2:return T.from(y(te))}(0,t.assert)(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const K=new T;return N.type!=null&&(K.type=N.type),N.to!=null&&(K.to=N.to),N.nonce!=null&&(K.nonce=N.nonce),N.gasLimit!=null&&(K.gasLimit=N.gasLimit),N.gasPrice!=null&&(K.gasPrice=N.gasPrice),N.maxPriorityFeePerGas!=null&&(K.maxPriorityFeePerGas=N.maxPriorityFeePerGas),N.maxFeePerGas!=null&&(K.maxFeePerGas=N.maxFeePerGas),N.data!=null&&(K.data=N.data),N.value!=null&&(K.value=N.value),N.chainId!=null&&(K.chainId=N.chainId),N.signature!=null&&(K.signature=e.Signature.from(N.signature)),N.accessList!=null&&(K.accessList=N.accessList),N.hash!=null&&((0,t.assertArgument)(K.isSigned(),"unsigned transaction cannot define hash","tx",N),(0,t.assertArgument)(K.hash===N.hash,"hash mismatch","tx",N)),N.from!=null&&((0,t.assertArgument)(K.isSigned(),"unsigned transaction cannot define from","tx",N),(0,t.assertArgument)(K.from.toLowerCase()===(N.from||"").toLowerCase(),"from mismatch","tx",N)),K}};_=new WeakMap,E=new WeakMap,C=new WeakMap,P=new WeakMap,I=new WeakMap,j=new WeakMap,z=new WeakMap,F=new WeakMap,W=new WeakMap,H=new WeakMap,L=new WeakMap,M=new WeakMap;let O=T;return Ou.Transaction=O,Ou}var s3;function $n(){return s3||(s3=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Transaction=n.recoverAddress=n.computeAddress=n.accessListify=void 0;var e=aA();Object.defineProperty(n,"accessListify",{enumerable:!0,get:function(){return e.accessListify}});var t=oA();Object.defineProperty(n,"computeAddress",{enumerable:!0,get:function(){return t.computeAddress}}),Object.defineProperty(n,"recoverAddress",{enumerable:!0,get:function(){return t.recoverAddress}});var r=NI();Object.defineProperty(n,"Transaction",{enumerable:!0,get:function(){return r.Transaction}})}(S2)),S2}var i3;function II(){if(i3)return x0;i3=1,Object.defineProperty(x0,"__esModule",{value:!0}),x0.verifyMessage=x0.hashMessage=void 0;const n=Mt(),e=jf(),t=$n(),r=Ee();function s(a){return typeof a=="string"&&(a=(0,r.toUtf8Bytes)(a)),(0,n.keccak256)((0,r.concat)([(0,r.toUtf8Bytes)(e.MessagePrefix),(0,r.toUtf8Bytes)(String(a.length)),a]))}x0.hashMessage=s;function i(a,o){const u=s(a);return(0,t.recoverAddress)(u,o)}return x0.verifyMessage=i,x0}var ps={},a3;function BI(){if(a3)return ps;a3=1,Object.defineProperty(ps,"__esModule",{value:!0}),ps.solidityPackedSha256=ps.solidityPackedKeccak256=ps.solidityPacked=void 0;const n=Ot(),e=Mt(),t=Ee(),r=new RegExp("^bytes([0-9]+)$"),s=new RegExp("^(u?int)([0-9]*)$"),i=new RegExp("^(.*)\\[([0-9]*)\\]$");function a(l,d,f){switch(l){case"address":return f?(0,t.getBytes)((0,t.zeroPadValue)(d,32)):(0,t.getBytes)((0,n.getAddress)(d));case"string":return(0,t.toUtf8Bytes)(d);case"bytes":return(0,t.getBytes)(d);case"bool":return d=d?"0x01":"0x00",f?(0,t.getBytes)((0,t.zeroPadValue)(d,32)):(0,t.getBytes)(d)}let h=l.match(s);if(h){let p=h[1]==="int",b=parseInt(h[2]||"256");return(0,t.assertArgument)((!h[2]||h[2]===String(b))&&b%8===0&&b!==0&&b<=256,"invalid number type","type",l),f&&(b=256),p&&(d=(0,t.toTwos)(d,b)),(0,t.getBytes)((0,t.zeroPadValue)((0,t.toBeArray)(d),b/8))}if(h=l.match(r),h){const p=parseInt(h[1]);return(0,t.assertArgument)(String(p)===h[1]&&p!==0&&p<=32,"invalid bytes type","type",l),(0,t.assertArgument)((0,t.dataLength)(d)===p,`invalid value for ${l}`,"value",d),f?(0,t.getBytes)((0,t.zeroPadBytes)(d,32)):d}if(h=l.match(i),h&&Array.isArray(d)){const p=h[1],b=parseInt(h[2]||String(d.length));(0,t.assertArgument)(b===d.length,`invalid array length for ${l}`,"value",d);const v=[];return d.forEach(function(w){v.push(a(p,w,!0))}),(0,t.getBytes)((0,t.concat)(v))}(0,t.assertArgument)(!1,"invalid type","type",l)}function o(l,d){(0,t.assertArgument)(l.length===d.length,"wrong number of values; expected ${ types.length }","values",d);const f=[];return l.forEach(function(h,p){f.push(a(h,d[p]))}),(0,t.hexlify)((0,t.concat)(f))}ps.solidityPacked=o;function u(l,d){return(0,e.keccak256)(o(l,d))}ps.solidityPackedKeccak256=u;function c(l,d){return(0,e.sha256)(o(l,d))}return ps.solidityPackedSha256=c,ps}var v0={},o3;function FI(){var A,S,D,O,cA;if(o3)return v0;o3=1,Object.defineProperty(v0,"__esModule",{value:!0}),v0.verifyTypedData=v0.TypedDataEncoder=void 0;const n=Ot(),e=Mt(),t=$n(),r=Ee(),s=iA(),i=new Uint8Array(32);i.fill(0);const a=BigInt(-1),o=BigInt(0),u=BigInt(1),c=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function l(C){const P=(0,r.getBytes)(C),I=P.length%32;return I?(0,r.concat)([P,i.slice(I)]):(0,r.hexlify)(P)}const d=(0,r.toBeHex)(u,32),f=(0,r.toBeHex)(o,32),h={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},p=["name","version","chainId","verifyingContract","salt"];function b(C){return function(P){return(0,r.assertArgument)(typeof P=="string",`invalid domain value for ${JSON.stringify(C)}`,`domain.${C}`,P),P}}const v={name:b("name"),version:b("version"),chainId:function(C){const P=(0,r.getBigInt)(C,"domain.chainId");return(0,r.assertArgument)(P>=0,"invalid chain ID","domain.chainId",C),Number.isSafeInteger(P)?Number(P):(0,r.toQuantity)(P)},verifyingContract:function(C){try{return(0,n.getAddress)(C).toLowerCase()}catch{}(0,r.assertArgument)(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",C)},salt:function(C){const P=(0,r.getBytes)(C,"domain.salt");return(0,r.assertArgument)(P.length===32,'invalid domain value "salt"',"domain.salt",C),(0,r.hexlify)(P)}};function w(C){{const P=C.match(/^(u?)int(\d*)$/);if(P){const I=P[1]==="",j=parseInt(P[2]||"256");(0,r.assertArgument)(j%8===0&&j!==0&&j<=256&&(P[2]==null||P[2]===String(j)),"invalid numeric width","type",C);const z=(0,r.mask)(c,I?j-1:j),F=I?(z+u)*a:o;return function(W){const H=(0,r.getBigInt)(W,"value");return(0,r.assertArgument)(H>=F&&H<=z,`value out-of-bounds for ${C}`,"value",H),(0,r.toBeHex)(I?(0,r.toTwos)(H,256):H,32)}}}{const P=C.match(/^bytes(\d+)$/);if(P){const I=parseInt(P[1]);return(0,r.assertArgument)(I!==0&&I<=32&&P[1]===String(I),"invalid bytes width","type",C),function(j){const z=(0,r.getBytes)(j);return(0,r.assertArgument)(z.length===I,`invalid length for ${C}`,"value",j),l(j)}}}switch(C){case"address":return function(P){return(0,r.zeroPadValue)((0,n.getAddress)(P),32)};case"bool":return function(P){return P?d:f};case"bytes":return function(P){return(0,e.keccak256)(P)};case"string":return function(P){return(0,s.id)(P)}}return null}function m(C,P){return`${C}(${P.map(({name:I,type:j})=>j+" "+I).join(",")})`}const E=class E{constructor(P){$(this,O);R(this,"primaryType");$(this,A,void 0);$(this,S,void 0);$(this,D,void 0);k(this,A,JSON.stringify(P)),k(this,S,new Map),k(this,D,new Map);const I=new Map,j=new Map,z=new Map;Object.keys(P).forEach(H=>{I.set(H,new Set),j.set(H,[]),z.set(H,new Set)});for(const H in P){const L=new Set;for(const M of P[H]){(0,r.assertArgument)(!L.has(M.name),`duplicate variable name ${JSON.stringify(M.name)} in ${JSON.stringify(H)}`,"types",P),L.add(M.name);const T=M.type.match(/^([^\x5b]*)(\x5b|$)/)[1]||null;(0,r.assertArgument)(T!==H,`circular type reference to ${JSON.stringify(T)}`,"types",P),!w(T)&&((0,r.assertArgument)(j.has(T),`unknown type ${JSON.stringify(T)}`,"types",P),j.get(T).push(H),I.get(H).add(T))}}const F=Array.from(j.keys()).filter(H=>j.get(H).length===0);(0,r.assertArgument)(F.length!==0,"missing primary type","types",P),(0,r.assertArgument)(F.length===1,`ambiguous primary types or unused types: ${F.map(H=>JSON.stringify(H)).join(", ")}`,"types",P),(0,r.defineProperties)(this,{primaryType:F[0]});function W(H,L){(0,r.assertArgument)(!L.has(H),`circular type reference to ${JSON.stringify(H)}`,"types",P),L.add(H);for(const M of I.get(H))if(j.has(M)){W(M,L);for(const T of L)z.get(T).add(M)}L.delete(H)}W(this.primaryType,new Set);for(const[H,L]of z){const M=Array.from(L);M.sort(),g(this,S).set(H,m(H,P[H])+M.map(T=>m(T,P[T])).join(""))}}get types(){return JSON.parse(g(this,A))}getEncoder(P){let I=g(this,D).get(P);return I||(I=Q(this,O,cA).call(this,P),g(this,D).set(P,I)),I}encodeType(P){const I=g(this,S).get(P);return(0,r.assertArgument)(I,`unknown type: ${JSON.stringify(P)}`,"name",P),I}encodeData(P,I){return this.getEncoder(P)(I)}hashStruct(P,I){return(0,e.keccak256)(this.encodeData(P,I))}encode(P){return this.encodeData(this.primaryType,P)}hash(P){return this.hashStruct(this.primaryType,P)}_visit(P,I,j){if(w(P))return j(P,I);const z=P.match(/^(.*)(\x5b(\d*)\x5d)$/);if(z)return(0,r.assertArgument)(!z[3]||parseInt(z[3])===I.length,`array length mismatch; expected length ${parseInt(z[3])}`,"value",I),I.map(W=>this._visit(z[1],W,j));const F=this.types[P];if(F)return F.reduce((W,{name:H,type:L})=>(W[H]=this._visit(L,I[H],j),W),{});(0,r.assertArgument)(!1,`unknown type: ${P}`,"type",P)}visit(P,I){return this._visit(this.primaryType,P,I)}static from(P){return new E(P)}static getPrimaryType(P){return E.from(P).primaryType}static hashStruct(P,I,j){return E.from(I).hashStruct(P,j)}static hashDomain(P){const I=[];for(const j in P){if(P[j]==null)continue;const z=h[j];(0,r.assertArgument)(z,`invalid typed-data domain key: ${JSON.stringify(j)}`,"domain",P),I.push({name:j,type:z})}return I.sort((j,z)=>p.indexOf(j.name)-p.indexOf(z.name)),E.hashStruct("EIP712Domain",{EIP712Domain:I},P)}static encode(P,I,j){return(0,r.concat)(["0x1901",E.hashDomain(P),E.from(I).hash(j)])}static hash(P,I,j){return(0,e.keccak256)(E.encode(P,I,j))}static async resolveNames(P,I,j,z){P=Object.assign({},P);for(const H in P)P[H]==null&&delete P[H];const F={};P.verifyingContract&&!(0,r.isHexString)(P.verifyingContract,20)&&(F[P.verifyingContract]="0x");const W=E.from(I);W.visit(j,(H,L)=>(H==="address"&&!(0,r.isHexString)(L,20)&&(F[L]="0x"),L));for(const H in F)F[H]=await z(H);return P.verifyingContract&&F[P.verifyingContract]&&(P.verifyingContract=F[P.verifyingContract]),j=W.visit(j,(H,L)=>H==="address"&&F[L]?F[L]:L),{domain:P,value:j}}static getPayload(P,I,j){E.hashDomain(P);const z={},F=[];p.forEach(L=>{const M=P[L];M!=null&&(z[L]=v[L](M),F.push({name:L,type:h[L]}))});const W=E.from(I),H=Object.assign({},I);return(0,r.assertArgument)(H.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",I),H.EIP712Domain=F,W.encode(j),{types:H,domain:z,primaryType:W.primaryType,message:W.visit(j,(L,M)=>{if(L.match(/^bytes(\d*)/))return(0,r.hexlify)((0,r.getBytes)(M));if(L.match(/^u?int/))return(0,r.getBigInt)(M).toString();switch(L){case"address":return M.toLowerCase();case"bool":return!!M;case"string":return(0,r.assertArgument)(typeof M=="string","invalid string","value",M),M}(0,r.assertArgument)(!1,"unsupported type","type",L)})}}};A=new WeakMap,S=new WeakMap,D=new WeakMap,O=new WeakSet,cA=function(P){{const z=w(P);if(z)return z}const I=P.match(/^(.*)(\x5b(\d*)\x5d)$/);if(I){const z=I[1],F=this.getEncoder(z);return W=>{(0,r.assertArgument)(!I[3]||parseInt(I[3])===W.length,`array length mismatch; expected length ${parseInt(I[3])}`,"value",W);let H=W.map(F);return g(this,S).has(z)&&(H=H.map(e.keccak256)),(0,e.keccak256)((0,r.concat)(H))}}const j=this.types[P];if(j){const z=(0,s.id)(g(this,S).get(P));return F=>{const W=j.map(({name:H,type:L})=>{const M=this.getEncoder(L)(F[H]);return g(this,S).has(L)?(0,e.keccak256)(M):M});return W.unshift(z),(0,r.concat)(W)}}(0,r.assertArgument)(!1,`unknown type: ${P}`,"type",P)};let x=E;v0.TypedDataEncoder=x;function y(C,P,I,j){return(0,t.recoverAddress)(x.hash(C,P,I),j)}return v0.verifyTypedData=y,v0}var c3;function oi(){return c3||(c3=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.verifyTypedData=n.TypedDataEncoder=n.solidityPackedSha256=n.solidityPackedKeccak256=n.solidityPacked=n.verifyMessage=n.hashMessage=n.dnsEncode=n.namehash=n.isValidName=n.ensNormalize=n.id=void 0;var e=iA();Object.defineProperty(n,"id",{enumerable:!0,get:function(){return e.id}});var t=OI();Object.defineProperty(n,"ensNormalize",{enumerable:!0,get:function(){return t.ensNormalize}}),Object.defineProperty(n,"isValidName",{enumerable:!0,get:function(){return t.isValidName}}),Object.defineProperty(n,"namehash",{enumerable:!0,get:function(){return t.namehash}}),Object.defineProperty(n,"dnsEncode",{enumerable:!0,get:function(){return t.dnsEncode}});var r=II();Object.defineProperty(n,"hashMessage",{enumerable:!0,get:function(){return r.hashMessage}}),Object.defineProperty(n,"verifyMessage",{enumerable:!0,get:function(){return r.verifyMessage}});var s=BI();Object.defineProperty(n,"solidityPacked",{enumerable:!0,get:function(){return s.solidityPacked}}),Object.defineProperty(n,"solidityPackedKeccak256",{enumerable:!0,get:function(){return s.solidityPackedKeccak256}}),Object.defineProperty(n,"solidityPackedSha256",{enumerable:!0,get:function(){return s.solidityPackedSha256}});var i=FI();Object.defineProperty(n,"TypedDataEncoder",{enumerable:!0,get:function(){return i.TypedDataEncoder}}),Object.defineProperty(n,"verifyTypedData",{enumerable:!0,get:function(){return i.verifyTypedData}})}(C2)),C2}var u3;function Cb(){var X,Ae,Oe,s5,Ye,p1;if(u3)return xt;u3=1,Object.defineProperty(xt,"__esModule",{value:!0}),xt.StructFragment=xt.FunctionFragment=xt.FallbackFragment=xt.ConstructorFragment=xt.EventFragment=xt.ErrorFragment=xt.NamedFragment=xt.Fragment=xt.ParamType=void 0;const n=Ee(),e=oi();function t(V){const U=new Set;return V.forEach(G=>U.add(G)),Object.freeze(U)}const s=t("external public payable".split(" ")),i="constant external internal payable private public pure view",a=t(i.split(" ")),o="constructor error event fallback function receive struct",u=t(o.split(" ")),c="calldata memory storage payable indexed",l=t(c.split(" ")),f=[o,c,"tuple returns",i].join(" "),h=t(f.split(" ")),p={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},b=new RegExp("^(\\s*)"),v=new RegExp("^([0-9]+)"),w=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),m=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),x=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"),Qe=class Qe{constructor(U){$(this,Oe);$(this,X,void 0);$(this,Ae,void 0);k(this,X,0),k(this,Ae,U.slice())}get offset(){return g(this,X)}get length(){return g(this,Ae).length-g(this,X)}clone(){return new Qe(g(this,Ae))}reset(){k(this,X,0)}popKeyword(U){const G=this.peek();if(G.type!=="KEYWORD"||!U.has(G.text))throw new Error(`expected keyword ${G.text}`);return this.pop().text}popType(U){if(this.peek().type!==U)throw new Error(`expected ${U}; got ${JSON.stringify(this.peek())}`);return this.pop().text}popParen(){const U=this.peek();if(U.type!=="OPEN_PAREN")throw new Error("bad start");const G=Q(this,Oe,s5).call(this,g(this,X)+1,U.match+1);return k(this,X,U.match+1),G}popParams(){const U=this.peek();if(U.type!=="OPEN_PAREN")throw new Error("bad start");const G=[];for(;g(this,X)=g(this,Ae).length)throw new Error("out-of-bounds");return g(this,Ae)[g(this,X)]}peekKeyword(U){const G=this.peekType("KEYWORD");return G!=null&&U.has(G)?G:null}peekType(U){if(this.length===0)return null;const G=this.peek();return G.type===U?G.text:null}pop(){const U=this.peek();return hr(this,X)._++,U}toString(){const U=[];for(let G=g(this,X);G`}};X=new WeakMap,Ae=new WeakMap,Oe=new WeakSet,s5=function(U=0,G=0){return new Qe(g(this,Ae).slice(U,G).map(Y=>Object.freeze(Object.assign({},Y,{match:Y.match-U,linkBack:Y.linkBack-U,linkNext:Y.linkNext-U}))))};let y=Qe;function A(V){const U=[],G=ue=>{const _e=ee0&&U[U.length-1].type==="NUMBER"){const At=U.pop().text;rt=At+rt,U[U.length-1].value=(0,n.getNumber)(At)}if(U.length===0||U[U.length-1].type!=="BRACKET")throw new Error("missing opening bracket");U[U.length-1].text+=rt}continue}if(_e=ue.match(w),_e){if(he.text=_e[1],ee+=he.text.length,h.has(he.text)){he.type="KEYWORD";continue}if(he.text.match(x)){he.type="TYPE";continue}he.type="ID";continue}if(_e=ue.match(v),_e){he.text=_e[1],he.type="NUMBER",ee+=he.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(ue[0])} at position ${ee}`)}return new y(U.map(ue=>Object.freeze(ue)))}function S(V,U){let G=[];for(const Y in U.keys())V.has(Y)&&G.push(Y);if(G.length>1)throw new Error(`conflicting types: ${G.join(", ")}`)}function D(V,U){if(U.peekKeyword(u)){const G=U.pop().text;if(G!==V)throw new Error(`expected ${V}, got ${G}`)}return U.popType("ID")}function O(V,U){const G=new Set;for(;;){const Y=V.peekType("KEYWORD");if(Y==null||U&&!U.has(Y))break;if(V.pop(),G.has(Y))throw new Error(`duplicate keywords: ${JSON.stringify(Y)}`);G.add(Y)}return Object.freeze(G)}function _(V){let U=O(V,a);return S(U,t("constant payable nonpayable".split(" "))),S(U,t("pure view payable nonpayable".split(" "))),U.has("view")?"view":U.has("pure")?"pure":U.has("payable")?"payable":U.has("nonpayable")?"nonpayable":U.has("constant")?"view":"nonpayable"}function E(V,U){return V.popParams().map(G=>K.from(G,U))}function C(V){if(V.peekType("AT")){if(V.pop(),V.peekType("NUMBER"))return(0,n.getBigInt)(V.pop().text);throw new Error("invalid gas")}return null}function P(V){if(V.length)throw new Error(`unexpected tokens: ${V.toString()}`)}const I=new RegExp(/^(.*)\[([0-9]*)\]$/);function j(V){const U=V.match(x);if((0,n.assertArgument)(U,"invalid type","type",V),V==="uint")return"uint256";if(V==="int")return"int256";if(U[2]){const G=parseInt(U[2]);(0,n.assertArgument)(G!==0&&G<=32,"invalid bytes length","type",V)}else if(U[3]){const G=parseInt(U[3]);(0,n.assertArgument)(G!==0&&G<=256&&G%8===0,"invalid numeric width","type",V)}return V}const z={},F=Symbol.for("_ethers_internal"),W="_ParamTypeInternal",H="_ErrorInternal",L="_EventInternal",M="_ConstructorInternal",T="_FallbackInternal",B="_FunctionInternal",N="_StructInternal",q=class q{constructor(U,G,Y,J,ee,ue,_e,he){$(this,Ye);R(this,"name");R(this,"type");R(this,"baseType");R(this,"indexed");R(this,"components");R(this,"arrayLength");R(this,"arrayChildren");if((0,n.assertPrivate)(U,z,"ParamType"),Object.defineProperty(this,F,{value:W}),ue&&(ue=Object.freeze(ue.slice())),J==="array"){if(_e==null||he==null)throw new Error("")}else if(_e!=null||he!=null)throw new Error("");if(J==="tuple"){if(ue==null)throw new Error("")}else if(ue!=null)throw new Error("");(0,n.defineProperties)(this,{name:G,type:Y,baseType:J,indexed:ee,components:ue,arrayLength:_e,arrayChildren:he})}format(U){if(U==null&&(U="sighash"),U==="json"){const Y=this.name||"";if(this.isArray()){const ee=JSON.parse(this.arrayChildren.format("json"));return ee.name=Y,ee.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(ee)}const J={type:this.baseType==="tuple"?"tuple":this.type,name:Y};return typeof this.indexed=="boolean"&&(J.indexed=this.indexed),this.isTuple()&&(J.components=this.components.map(ee=>JSON.parse(ee.format(U)))),JSON.stringify(J)}let G="";return this.isArray()?(G+=this.arrayChildren.format(U),G+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?(U!=="sighash"&&(G+=this.type),G+="("+this.components.map(Y=>Y.format(U)).join(U==="full"?", ":",")+")"):G+=this.type,U!=="sighash"&&(this.indexed===!0&&(G+=" indexed"),U==="full"&&this.name&&(G+=" "+this.name)),G}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(U,G){if(this.isArray()){if(!Array.isArray(U))throw new Error("invalid array value");if(this.arrayLength!==-1&&U.length!==this.arrayLength)throw new Error("array is wrong length");const Y=this;return U.map(J=>Y.arrayChildren.walk(J,G))}if(this.isTuple()){if(!Array.isArray(U))throw new Error("invalid tuple value");if(U.length!==this.components.length)throw new Error("array is wrong length");const Y=this;return U.map((J,ee)=>Y.components[ee].walk(J,G))}return G(this.type,U)}async walkAsync(U,G){const Y=[],J=[U];return Q(this,Ye,p1).call(this,Y,U,G,ee=>{J[0]=ee}),Y.length&&await Promise.all(Y),J[0]}static from(U,G){if(q.isParamType(U))return U;if(typeof U=="string")try{return q.from(A(U),G)}catch{(0,n.assertArgument)(!1,"invalid param type","obj",U)}else if(U instanceof y){let _e="",he="",Ue=null;O(U,t(["tuple"])).has("tuple")||U.peekType("OPEN_PAREN")?(he="tuple",Ue=U.popParams().map(ui=>q.from(ui)),_e=`tuple(${Ue.map(ui=>ui.format()).join(",")})`):(_e=j(U.popType("TYPE")),he=_e);let rt=null,At=null;for(;U.length&&U.peekType("BRACKET");){const ui=U.pop();rt=new q(z,"",_e,he,null,Ue,At,rt),At=ui.value,_e+=ui.text,he="array",Ue=null}let qc=null;if(O(U,l).has("indexed")){if(!G)throw new Error("");qc=!0}const l6=U.peekType("ID")?U.pop().text:"";if(U.length)throw new Error("leftover tokens");return new q(z,l6,_e,he,qc,Ue,At,rt)}const Y=U.name;(0,n.assertArgument)(!Y||typeof Y=="string"&&Y.match(m),"invalid name","obj.name",Y);let J=U.indexed;J!=null&&((0,n.assertArgument)(G,"parameter cannot be indexed","obj.indexed",U.indexed),J=!!J);let ee=U.type,ue=ee.match(I);if(ue){const _e=parseInt(ue[2]||"-1"),he=q.from({type:ue[1],components:U.components});return new q(z,Y||"",ee,"array",J,null,_e,he)}if(ee==="tuple"||ee.startsWith("tuple(")||ee.startsWith("(")){const _e=U.components!=null?U.components.map(Ue=>q.from(Ue)):null;return new q(z,Y||"",ee,"tuple",J,_e,null,null)}return ee=j(U.type),new q(z,Y||"",ee,ee,J,null,null,null)}static isParamType(U){return U&&U[F]===W}};Ye=new WeakSet,p1=function(U,G,Y,J){if(this.isArray()){if(!Array.isArray(G))throw new Error("invalid array value");if(this.arrayLength!==-1&&G.length!==this.arrayLength)throw new Error("array is wrong length");const ue=this.arrayChildren,_e=G.slice();_e.forEach((he,Ue)=>{var rt;Q(rt=ue,Ye,p1).call(rt,U,he,Y,At=>{_e[Ue]=At})}),J(_e);return}if(this.isTuple()){const ue=this.components;let _e;if(Array.isArray(G))_e=G.slice();else{if(G==null||typeof G!="object")throw new Error("invalid tuple value");_e=ue.map(he=>{if(!he.name)throw new Error("cannot use object value with unnamed components");if(!(he.name in G))throw new Error(`missing value for component ${he.name}`);return G[he.name]})}if(_e.length!==this.components.length)throw new Error("array is wrong length");_e.forEach((he,Ue)=>{var rt;Q(rt=ue[Ue],Ye,p1).call(rt,U,he,Y,At=>{_e[Ue]=At})}),J(_e);return}const ee=Y(this.type,G);ee.then?U.push(async function(){J(await ee)}()):J(ee)};let K=q;xt.ParamType=K;class te{constructor(U,G,Y){R(this,"type");R(this,"inputs");(0,n.assertPrivate)(U,z,"Fragment"),Y=Object.freeze(Y.slice()),(0,n.defineProperties)(this,{type:G,inputs:Y})}static from(U){if(typeof U=="string"){try{te.from(JSON.parse(U))}catch{}return te.from(A(U))}if(U instanceof y)switch(U.peekKeyword(u)){case"constructor":return xe.from(U);case"error":return ie.from(U);case"event":return pe.from(U);case"fallback":case"receive":return me.from(U);case"function":return be.from(U);case"struct":return Ie.from(U)}else if(typeof U=="object"){switch(U.type){case"constructor":return xe.from(U);case"error":return ie.from(U);case"event":return pe.from(U);case"fallback":case"receive":return me.from(U);case"function":return be.from(U);case"struct":return Ie.from(U)}(0,n.assert)(!1,`unsupported type: ${U.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}(0,n.assertArgument)(!1,"unsupported frgament object","obj",U)}static isConstructor(U){return xe.isFragment(U)}static isError(U){return ie.isFragment(U)}static isEvent(U){return pe.isFragment(U)}static isFunction(U){return be.isFragment(U)}static isStruct(U){return Ie.isFragment(U)}}xt.Fragment=te;class ne extends te{constructor(G,Y,J,ee){super(G,Y,ee);R(this,"name");(0,n.assertArgument)(typeof J=="string"&&J.match(m),"invalid identifier","name",J),ee=Object.freeze(ee.slice()),(0,n.defineProperties)(this,{name:J})}}xt.NamedFragment=ne;function le(V,U){return"("+U.map(G=>G.format(V)).join(V==="full"?", ":",")+")"}class ie extends ne{constructor(U,G,Y){super(U,"error",G,Y),Object.defineProperty(this,F,{value:H})}get selector(){return(0,e.id)(this.format("sighash")).substring(0,10)}format(U){if(U==null&&(U="sighash"),U==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(Y=>JSON.parse(Y.format(U)))});const G=[];return U!=="sighash"&&G.push("error"),G.push(this.name+le(U,this.inputs)),G.join(" ")}static from(U){if(ie.isFragment(U))return U;if(typeof U=="string")return ie.from(A(U));if(U instanceof y){const G=D("error",U),Y=E(U);return P(U),new ie(z,G,Y)}return new ie(z,U.name,U.inputs?U.inputs.map(K.from):[])}static isFragment(U){return U&&U[F]===H}}xt.ErrorFragment=ie;class pe extends ne{constructor(G,Y,J,ee){super(G,"event",Y,J);R(this,"anonymous");Object.defineProperty(this,F,{value:L}),(0,n.defineProperties)(this,{anonymous:ee})}get topicHash(){return(0,e.id)(this.format("sighash"))}format(G){if(G==null&&(G="sighash"),G==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(J=>JSON.parse(J.format(G)))});const Y=[];return G!=="sighash"&&Y.push("event"),Y.push(this.name+le(G,this.inputs)),G!=="sighash"&&this.anonymous&&Y.push("anonymous"),Y.join(" ")}static getTopicHash(G,Y){return Y=(Y||[]).map(ee=>K.from(ee)),new pe(z,G,Y,!1).topicHash}static from(G){if(pe.isFragment(G))return G;if(typeof G=="string")try{return pe.from(A(G))}catch{(0,n.assertArgument)(!1,"invalid event fragment","obj",G)}else if(G instanceof y){const Y=D("event",G),J=E(G,!0),ee=!!O(G,t(["anonymous"])).has("anonymous");return P(G),new pe(z,Y,J,ee)}return new pe(z,G.name,G.inputs?G.inputs.map(Y=>K.from(Y,!0)):[],!!G.anonymous)}static isFragment(G){return G&&G[F]===L}}xt.EventFragment=pe;class xe extends te{constructor(G,Y,J,ee,ue){super(G,Y,J);R(this,"payable");R(this,"gas");Object.defineProperty(this,F,{value:M}),(0,n.defineProperties)(this,{payable:ee,gas:ue})}format(G){if((0,n.assert)(G!=null&&G!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),G==="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(J=>JSON.parse(J.format(G)))});const Y=[`constructor${le(G,this.inputs)}`];return Y.push(this.payable?"payable":"nonpayable"),this.gas!=null&&Y.push(`@${this.gas.toString()}`),Y.join(" ")}static from(G){if(xe.isFragment(G))return G;if(typeof G=="string")try{return xe.from(A(G))}catch{(0,n.assertArgument)(!1,"invalid constuctor fragment","obj",G)}else if(G instanceof y){O(G,t(["constructor"]));const Y=E(G),J=!!O(G,s).has("payable"),ee=C(G);return P(G),new xe(z,"constructor",Y,J,ee)}return new xe(z,"constructor",G.inputs?G.inputs.map(K.from):[],!!G.payable,G.gas!=null?G.gas:null)}static isFragment(G){return G&&G[F]===M}}xt.ConstructorFragment=xe;class me extends te{constructor(G,Y,J){super(G,"fallback",Y);R(this,"payable");Object.defineProperty(this,F,{value:T}),(0,n.defineProperties)(this,{payable:J})}format(G){const Y=this.inputs.length===0?"receive":"fallback";if(G==="json"){const J=this.payable?"payable":"nonpayable";return JSON.stringify({type:Y,stateMutability:J})}return`${Y}()${this.payable?" payable":""}`}static from(G){if(me.isFragment(G))return G;if(typeof G=="string")try{return me.from(A(G))}catch{(0,n.assertArgument)(!1,"invalid fallback fragment","obj",G)}else if(G instanceof y){const Y=G.toString(),J=G.peekKeyword(t(["fallback","receive"]));if((0,n.assertArgument)(J,"type must be fallback or receive","obj",Y),G.popKeyword(t(["fallback","receive"]))==="receive"){const he=E(G);return(0,n.assertArgument)(he.length===0,"receive cannot have arguments","obj.inputs",he),O(G,t(["payable"])),P(G),new me(z,[],!0)}let ue=E(G);ue.length?(0,n.assertArgument)(ue.length===1&&ue[0].type==="bytes","invalid fallback inputs","obj.inputs",ue.map(he=>he.format("minimal")).join(", ")):ue=[K.from("bytes")];const _e=_(G);if((0,n.assertArgument)(_e==="nonpayable"||_e==="payable","fallback cannot be constants","obj.stateMutability",_e),O(G,t(["returns"])).has("returns")){const he=E(G);(0,n.assertArgument)(he.length===1&&he[0].type==="bytes","invalid fallback outputs","obj.outputs",he.map(Ue=>Ue.format("minimal")).join(", "))}return P(G),new me(z,ue,_e==="payable")}if(G.type==="receive")return new me(z,[],!0);if(G.type==="fallback"){const Y=[K.from("bytes")],J=G.stateMutability==="payable";return new me(z,Y,J)}(0,n.assertArgument)(!1,"invalid fallback description","obj",G)}static isFragment(G){return G&&G[F]===T}}xt.FallbackFragment=me;class be extends ne{constructor(G,Y,J,ee,ue,_e){super(G,"function",Y,ee);R(this,"constant");R(this,"outputs");R(this,"stateMutability");R(this,"payable");R(this,"gas");Object.defineProperty(this,F,{value:B}),ue=Object.freeze(ue.slice());const he=J==="view"||J==="pure",Ue=J==="payable";(0,n.defineProperties)(this,{constant:he,gas:_e,outputs:ue,payable:Ue,stateMutability:J})}get selector(){return(0,e.id)(this.format("sighash")).substring(0,10)}format(G){if(G==null&&(G="sighash"),G==="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(J=>JSON.parse(J.format(G))),outputs:this.outputs.map(J=>JSON.parse(J.format(G)))});const Y=[];return G!=="sighash"&&Y.push("function"),Y.push(this.name+le(G,this.inputs)),G!=="sighash"&&(this.stateMutability!=="nonpayable"&&Y.push(this.stateMutability),this.outputs&&this.outputs.length&&(Y.push("returns"),Y.push(le(G,this.outputs))),this.gas!=null&&Y.push(`@${this.gas.toString()}`)),Y.join(" ")}static getSelector(G,Y){return Y=(Y||[]).map(ee=>K.from(ee)),new be(z,G,"view",Y,[],null).selector}static from(G){if(be.isFragment(G))return G;if(typeof G=="string")try{return be.from(A(G))}catch{(0,n.assertArgument)(!1,"invalid function fragment","obj",G)}else if(G instanceof y){const J=D("function",G),ee=E(G),ue=_(G);let _e=[];O(G,t(["returns"])).has("returns")&&(_e=E(G));const he=C(G);return P(G),new be(z,J,ue,ee,_e,he)}let Y=G.stateMutability;return Y==null&&(Y="payable",typeof G.constant=="boolean"?(Y="view",G.constant||(Y="payable",typeof G.payable=="boolean"&&!G.payable&&(Y="nonpayable"))):typeof G.payable=="boolean"&&!G.payable&&(Y="nonpayable")),new be(z,G.name,Y,G.inputs?G.inputs.map(K.from):[],G.outputs?G.outputs.map(K.from):[],G.gas!=null?G.gas:null)}static isFragment(G){return G&&G[F]===B}}xt.FunctionFragment=be;class Ie extends ne{constructor(U,G,Y){super(U,"struct",G,Y),Object.defineProperty(this,F,{value:N})}format(){throw new Error("@TODO")}static from(U){if(typeof U=="string")try{return Ie.from(A(U))}catch{(0,n.assertArgument)(!1,"invalid struct fragment","obj",U)}else if(U instanceof y){const G=D("struct",U),Y=E(U);return P(U),new Ie(z,G,Y)}return new Ie(z,U.name,U.inputs?U.inputs.map(K.from):[])}static isFragment(U){return U&&U[F]===N}}return xt.StructFragment=Ie,xt}var l3;function uA(){var y,no;if(l3)return su;l3=1,Object.defineProperty(su,"__esModule",{value:!0}),su.AbiCoder=void 0;const n=Ee(),e=jr(),t=AI(),r=rA(),s=_I(),i=sA(),a=PI(),o=kI(),u=CI(),c=SI(),l=RI(),d=Cb(),f=Ot(),h=Ee(),p=new Map;p.set(0,"GENERIC_PANIC"),p.set(1,"ASSERT_FALSE"),p.set(17,"OVERFLOW"),p.set(18,"DIVIDE_BY_ZERO"),p.set(33,"ENUM_RANGE_ERROR"),p.set(34,"BAD_STORAGE_DATA"),p.set(49,"STACK_UNDERFLOW"),p.set(50,"ARRAY_RANGE_ERROR"),p.set(65,"OUT_OF_MEMORY"),p.set(81,"UNINITIALIZED_FUNCTION_CALL");const b=new RegExp(/^bytes([0-9]*)$/),v=new RegExp(/^(u?int)([0-9]*)$/);let w=null;function m(D,O,_,E){let C="missing revert data",P=null;const I=null;let j=null;if(_){C="execution reverted";const F=(0,h.getBytes)(_);if(_=(0,h.hexlify)(_),F.length===0)C+=" (no data present; likely require(false) occurred",P="require(false)";else if(F.length%32!==4)C+=" (could not decode reason; invalid data length)";else if((0,h.hexlify)(F.slice(0,4))==="0x08c379a0")try{P=E.decode(["string"],F.slice(4))[0],j={signature:"Error(string)",name:"Error",args:[P]},C+=`: ${JSON.stringify(P)}`}catch{C+=" (could not decode reason; invalid string data)"}else if((0,h.hexlify)(F.slice(0,4))==="0x4e487b71")try{const W=Number(E.decode(["uint256"],F.slice(4))[0]);j={signature:"Panic(uint256)",name:"Panic",args:[W]},P=`Panic due to ${p.get(W)||"UNKNOWN"}(${W})`,C+=`: ${P}`}catch{C+=" (could not decode panic code)"}else C+=" (unknown custom error)"}const z={to:O.to?(0,f.getAddress)(O.to):null,data:O.data||"0x"};return O.from&&(z.from=(0,f.getAddress)(O.from)),(0,h.makeError)(C,"CALL_EXCEPTION",{action:D,data:_,reason:P,transaction:z,invocation:I,revert:j})}const S=class S{constructor(){$(this,y)}getDefaultValue(O){const _=O.map(C=>Q(this,y,no).call(this,d.ParamType.from(C)));return new l.TupleCoder(_,"_").defaultValue()}encode(O,_){(0,n.assertArgumentCount)(_.length,O.length,"types/values length mismatch");const E=O.map(I=>Q(this,y,no).call(this,d.ParamType.from(I))),C=new l.TupleCoder(E,"_"),P=new e.Writer;return C.encode(P,_),P.data}decode(O,_,E){const C=O.map(I=>Q(this,y,no).call(this,d.ParamType.from(I)));return new l.TupleCoder(C,"_").decode(new e.Reader(_,E))}static defaultAbiCoder(){return w==null&&(w=new S),w}static getBuiltinCallException(O,_,E){return m(O,_,E,S.defaultAbiCoder())}};y=new WeakSet,no=function(O){if(O.isArray())return new r.ArrayCoder(Q(this,y,no).call(this,O.arrayChildren),O.arrayLength,O.name);if(O.isTuple())return new l.TupleCoder(O.components.map(E=>Q(this,y,no).call(this,E)),O.name);switch(O.baseType){case"address":return new t.AddressCoder(O.name);case"bool":return new s.BooleanCoder(O.name);case"string":return new c.StringCoder(O.name);case"bytes":return new i.BytesCoder(O.name);case"":return new o.NullCoder(O.name)}let _=O.type.match(v);if(_){let E=parseInt(_[2]||"256");return(0,n.assertArgument)(E!==0&&E<=256&&E%8===0,"invalid "+_[1]+" bit length","param",O),new u.NumberCoder(E/8,_[1]==="int",O.name)}if(_=O.type.match(b),_){let E=parseInt(_[1]);return(0,n.assertArgument)(E!==0&&E<=32,"invalid bytes length","param",O),new a.FixedBytesCoder(E,O.name)}(0,n.assertArgument)(!1,"invalid type","type",O.type)};let x=S;return su.AbiCoder=x,su}var A0={},f3;function UI(){if(f3)return A0;f3=1,Object.defineProperty(A0,"__esModule",{value:!0}),A0.decodeBytes32String=A0.encodeBytes32String=void 0;const n=Ee();function e(r){const s=(0,n.toUtf8Bytes)(r);if(s.length>31)throw new Error("bytes32 string must be less than 32 bytes");return(0,n.zeroPadBytes)(s,32)}A0.encodeBytes32String=e;function t(r){const s=(0,n.getBytes)(r,"bytes");if(s.length!==32)throw new Error("invalid bytes32 - not 32 bytes long");if(s[31]!==0)throw new Error("invalid bytes32 string - no null terminator");let i=31;for(;s[i-1]===0;)i--;return(0,n.toUtf8String)(s.slice(0,i))}return A0.decodeBytes32String=t,A0}var R2={},d3;function LI(){return d3||(d3=1,function(n){var b,v,w,m,x,b1,A,g1;Object.defineProperty(n,"__esModule",{value:!0}),n.Interface=n.Indexed=n.ErrorDescription=n.TransactionDescription=n.LogDescription=n.Result=n.checkResultErrors=void 0;const e=Mt(),t=oi(),r=Ee(),s=uA(),i=jr();Object.defineProperty(n,"checkResultErrors",{enumerable:!0,get:function(){return i.checkResultErrors}}),Object.defineProperty(n,"Result",{enumerable:!0,get:function(){return i.Result}});const a=Cb(),o=ai();class u{constructor(_,E,C){R(this,"fragment");R(this,"name");R(this,"signature");R(this,"topic");R(this,"args");const P=_.name,I=_.format();(0,r.defineProperties)(this,{fragment:_,name:P,signature:I,topic:E,args:C})}}n.LogDescription=u;class c{constructor(_,E,C,P){R(this,"fragment");R(this,"name");R(this,"args");R(this,"signature");R(this,"selector");R(this,"value");const I=_.name,j=_.format();(0,r.defineProperties)(this,{fragment:_,name:I,args:C,signature:j,selector:E,value:P})}}n.TransactionDescription=c;class l{constructor(_,E,C){R(this,"fragment");R(this,"name");R(this,"args");R(this,"signature");R(this,"selector");const P=_.name,I=_.format();(0,r.defineProperties)(this,{fragment:_,name:P,args:C,signature:I,selector:E})}}n.ErrorDescription=l;class d{constructor(_){R(this,"hash");R(this,"_isIndexed");(0,r.defineProperties)(this,{hash:_,_isIndexed:!0})}static isIndexed(_){return!!(_&&_._isIndexed)}}n.Indexed=d;const f={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"},h={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:O=>`reverted with reason string ${JSON.stringify(O)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:O=>{let _="unknown panic code";return O>=0&&O<=255&&f[O.toString()]&&(_=f[O.toString()]),`reverted with panic code 0x${O.toString(16)} (${_})`}}},D=class D{constructor(_){$(this,x);$(this,A);R(this,"fragments");R(this,"deploy");R(this,"fallback");R(this,"receive");$(this,b,void 0);$(this,v,void 0);$(this,w,void 0);$(this,m,void 0);let E=[];typeof _=="string"?E=JSON.parse(_):E=_,k(this,w,new Map),k(this,b,new Map),k(this,v,new Map);const C=[];for(const j of E)try{C.push(a.Fragment.from(j))}catch(z){console.log("EE",z)}(0,r.defineProperties)(this,{fragments:Object.freeze(C)});let P=null,I=!1;k(this,m,this.getAbiCoder()),this.fragments.forEach((j,z)=>{let F;switch(j.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}(0,r.defineProperties)(this,{deploy:j});return;case"fallback":j.inputs.length===0?I=!0:((0,r.assertArgument)(!P||j.payable!==P.payable,"conflicting fallback fragments",`fragments[${z}]`,j),P=j,I=P.payable);return;case"function":F=g(this,w);break;case"event":F=g(this,v);break;case"error":F=g(this,b);break;default:return}const W=j.format();F.has(W)||F.set(W,j)}),this.deploy||(0,r.defineProperties)(this,{deploy:a.ConstructorFragment.from("constructor()")}),(0,r.defineProperties)(this,{fallback:P,receive:I})}format(_){const E=_?"minimal":"full";return this.fragments.map(P=>P.format(E))}formatJson(){const _=this.fragments.map(E=>E.format("json"));return JSON.stringify(_.map(E=>JSON.parse(E)))}getAbiCoder(){return s.AbiCoder.defaultAbiCoder()}getFunctionName(_){const E=Q(this,x,b1).call(this,_,null,!1);return(0,r.assertArgument)(E,"no matching function","key",_),E.name}hasFunction(_){return!!Q(this,x,b1).call(this,_,null,!1)}getFunction(_,E){return Q(this,x,b1).call(this,_,E||null,!0)}forEachFunction(_){const E=Array.from(g(this,w).keys());E.sort((C,P)=>C.localeCompare(P));for(let C=0;CC.localeCompare(P));for(let C=0;C1){const I=P.map(j=>JSON.stringify(j.format())).join(", ");(0,r.assertArgument)(!1,`ambiguous error description (i.e. ${I})`,"name",_)}return P[0]}if(_=a.ErrorFragment.from(_).format(),_==="Error(string)")return a.ErrorFragment.from("error Error(string)");if(_==="Panic(uint256)")return a.ErrorFragment.from("error Panic(uint256)");const C=g(this,b).get(_);return C||null}forEachError(_){const E=Array.from(g(this,b).keys());E.sort((C,P)=>C.localeCompare(P));for(let C=0;CI.type==="string"?(0,t.id)(j):I.type==="bytes"?(0,e.keccak256)((0,r.hexlify)(j)):(I.type==="bool"&&typeof j=="boolean"?j=j?"0x01":"0x00":I.type.match(/^u?int/)?j=(0,r.toBeHex)(j):I.type.match(/^bytes/)?j=(0,r.zeroPadBytes)(j,32):I.type==="address"&&g(this,m).encode(["address"],[j]),(0,r.zeroPadValue)((0,r.hexlify)(j),32));for(E.forEach((I,j)=>{const z=_.inputs[j];if(!z.indexed){(0,r.assertArgument)(I==null,"cannot filter non-indexed parameters; must be null","contract."+z.name,I);return}I==null?C.push(null):z.baseType==="array"||z.baseType==="tuple"?(0,r.assertArgument)(!1,"filtering with tuples or arrays not supported","contract."+z.name,I):Array.isArray(I)?C.push(I.map(F=>P(z,F))):C.push(P(z,I))});C.length&&C[C.length-1]===null;)C.pop();return C}encodeEventLog(_,E){if(typeof _=="string"){const j=this.getEvent(_);(0,r.assertArgument)(j,"unknown event","eventFragment",_),_=j}const C=[],P=[],I=[];return _.anonymous||C.push(_.topicHash),(0,r.assertArgument)(E.length===_.inputs.length,"event arguments/values mismatch","values",E),_.inputs.forEach((j,z)=>{const F=E[z];if(j.indexed)if(j.type==="string")C.push((0,t.id)(F));else if(j.type==="bytes")C.push((0,e.keccak256)(F));else{if(j.baseType==="tuple"||j.baseType==="array")throw new Error("not implemented");C.push(g(this,m).encode([j.type],[F]))}else P.push(j),I.push(F)}),{data:g(this,m).encode(P,I),topics:C}}decodeEventLog(_,E,C){if(typeof _=="string"){const T=this.getEvent(_);(0,r.assertArgument)(T,"unknown event","eventFragment",_),_=T}if(C!=null&&!_.anonymous){const T=_.topicHash;(0,r.assertArgument)((0,r.isHexString)(C[0],32)&&C[0].toLowerCase()===T,"fragment/topic mismatch","topics[0]",C[0]),C=C.slice(1)}const P=[],I=[],j=[];_.inputs.forEach((T,B)=>{T.indexed?T.type==="string"||T.type==="bytes"||T.baseType==="tuple"||T.baseType==="array"?(P.push(a.ParamType.from({type:"bytes32",name:T.name})),j.push(!0)):(P.push(T),j.push(!1)):(I.push(T),j.push(!1))});const z=C!=null?g(this,m).decode(P,(0,r.concat)(C)):null,F=g(this,m).decode(I,E,!0),W=[],H=[];let L=0,M=0;return _.inputs.forEach((T,B)=>{let N=null;if(T.indexed)if(z==null)N=new d(null);else if(j[B])N=new d(z[M++]);else try{N=z[M++]}catch(K){N=K}else try{N=F[L++]}catch(K){N=K}W.push(N),H.push(T.name||null)}),i.Result.fromItems(W,H)}parseTransaction(_){const E=(0,r.getBytes)(_.data,"tx.data"),C=(0,r.getBigInt)(_.value!=null?_.value:0,"tx.value"),P=this.getFunction((0,r.hexlify)(E.slice(0,4)));if(!P)return null;const I=g(this,m).decode(P.inputs,E.slice(4));return new c(P,P.selector,I,C)}parseCallResult(_){throw new Error("@TODO")}parseLog(_){const E=this.getEvent(_.topics[0]);return!E||E.anonymous?null:new u(E,E.topicHash,this.decodeEventLog(E,_.data,_.topics))}parseError(_){const E=(0,r.hexlify)(_),C=this.getError((0,r.dataSlice)(E,0,4));if(!C)return null;const P=g(this,m).decode(C.inputs,(0,r.dataSlice)(E,4));return new l(C,C.selector,P)}static from(_){return _ instanceof D?_:typeof _=="string"?new D(JSON.parse(_)):typeof _.format=="function"?new D(_.format("json")):new D(_)}};b=new WeakMap,v=new WeakMap,w=new WeakMap,m=new WeakMap,x=new WeakSet,b1=function(_,E,C){if((0,r.isHexString)(_)){const I=_.toLowerCase();for(const j of g(this,w).values())if(I===j.selector)return j;return null}if(_.indexOf("(")===-1){const I=[];for(const[j,z]of g(this,w))j.split("(")[0]===_&&I.push(z);if(E){const j=E.length>0?E[E.length-1]:null;let z=E.length,F=!0;o.Typed.isTyped(j)&&j.type==="overrides"&&(F=!1,z--);for(let W=I.length-1;W>=0;W--){const H=I[W].inputs.length;H!==z&&(!F||H!==z-1)&&I.splice(W,1)}for(let W=I.length-1;W>=0;W--){const H=I[W].inputs;for(let L=0;L=H.length){if(E[L].type==="overrides")continue;I.splice(W,1);break}if(E[L].type!==H[L].baseType){I.splice(W,1);break}}}}if(I.length===1&&E&&E.length!==I[0].inputs.length){const j=E[E.length-1];(j==null||Array.isArray(j)||typeof j!="object")&&I.splice(0,1)}if(I.length===0)return null;if(I.length>1&&C){const j=I.map(z=>JSON.stringify(z.format())).join(", ");(0,r.assertArgument)(!1,`ambiguous function description (i.e. matches ${j})`,"key",_)}return I[0]}const P=g(this,w).get(a.FunctionFragment.from(_).format());return P||null},A=new WeakSet,g1=function(_,E,C){if((0,r.isHexString)(_)){const I=_.toLowerCase();for(const j of g(this,v).values())if(I===j.topicHash)return j;return null}if(_.indexOf("(")===-1){const I=[];for(const[j,z]of g(this,v))j.split("(")[0]===_&&I.push(z);if(E){for(let j=I.length-1;j>=0;j--)I[j].inputs.length=0;j--){const z=I[j].inputs;for(let F=0;F1&&C){const j=I.map(z=>JSON.stringify(z.format())).join(", ");(0,r.assertArgument)(!1,`ambiguous event description (i.e. matches ${j})`,"key",_)}return I[0]}const P=g(this,v).get(a.EventFragment.from(_).format());return P||null};let p=D;n.Interface=p}(R2)),R2}var h3;function $f(){return h3||(h3=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Typed=n.Result=n.TransactionDescription=n.LogDescription=n.ErrorDescription=n.Interface=n.Indexed=n.checkResultErrors=n.StructFragment=n.ParamType=n.NamedFragment=n.FunctionFragment=n.Fragment=n.FallbackFragment=n.EventFragment=n.ErrorFragment=n.ConstructorFragment=n.encodeBytes32String=n.decodeBytes32String=n.AbiCoder=void 0;var e=uA();Object.defineProperty(n,"AbiCoder",{enumerable:!0,get:function(){return e.AbiCoder}});var t=UI();Object.defineProperty(n,"decodeBytes32String",{enumerable:!0,get:function(){return t.decodeBytes32String}}),Object.defineProperty(n,"encodeBytes32String",{enumerable:!0,get:function(){return t.encodeBytes32String}});var r=Cb();Object.defineProperty(n,"ConstructorFragment",{enumerable:!0,get:function(){return r.ConstructorFragment}}),Object.defineProperty(n,"ErrorFragment",{enumerable:!0,get:function(){return r.ErrorFragment}}),Object.defineProperty(n,"EventFragment",{enumerable:!0,get:function(){return r.EventFragment}}),Object.defineProperty(n,"FallbackFragment",{enumerable:!0,get:function(){return r.FallbackFragment}}),Object.defineProperty(n,"Fragment",{enumerable:!0,get:function(){return r.Fragment}}),Object.defineProperty(n,"FunctionFragment",{enumerable:!0,get:function(){return r.FunctionFragment}}),Object.defineProperty(n,"NamedFragment",{enumerable:!0,get:function(){return r.NamedFragment}}),Object.defineProperty(n,"ParamType",{enumerable:!0,get:function(){return r.ParamType}}),Object.defineProperty(n,"StructFragment",{enumerable:!0,get:function(){return r.StructFragment}});var s=LI();Object.defineProperty(n,"checkResultErrors",{enumerable:!0,get:function(){return s.checkResultErrors}}),Object.defineProperty(n,"Indexed",{enumerable:!0,get:function(){return s.Indexed}}),Object.defineProperty(n,"Interface",{enumerable:!0,get:function(){return s.Interface}}),Object.defineProperty(n,"ErrorDescription",{enumerable:!0,get:function(){return s.ErrorDescription}}),Object.defineProperty(n,"LogDescription",{enumerable:!0,get:function(){return s.LogDescription}}),Object.defineProperty(n,"TransactionDescription",{enumerable:!0,get:function(){return s.TransactionDescription}}),Object.defineProperty(n,"Result",{enumerable:!0,get:function(){return s.Result}});var i=ai();Object.defineProperty(n,"Typed",{enumerable:!0,get:function(){return i.Typed}})}(w2)),w2}var T2={},yr={},Yt={},p3;function Hf(){var b,v,w;if(p3)return Yt;p3=1,Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.TransactionResponse=Yt.TransactionReceipt=Yt.Log=Yt.Block=Yt.copyRequest=Yt.FeeData=void 0;const n=Ee(),e=$n(),t=BigInt(0);function r(x){return x??null}function s(x){return x==null?null:x.toString()}class i{constructor(y,A,S){R(this,"gasPrice");R(this,"maxFeePerGas");R(this,"maxPriorityFeePerGas");(0,n.defineProperties)(this,{gasPrice:r(y),maxFeePerGas:r(A),maxPriorityFeePerGas:r(S)})}toJSON(){const{gasPrice:y,maxFeePerGas:A,maxPriorityFeePerGas:S}=this;return{_type:"FeeData",gasPrice:s(y),maxFeePerGas:s(A),maxPriorityFeePerGas:s(S)}}}Yt.FeeData=i;function a(x){const y={};x.to&&(y.to=x.to),x.from&&(y.from=x.from),x.data&&(y.data=(0,n.hexlify)(x.data));const A="chainId,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const D of A)!(D in x)||x[D]==null||(y[D]=(0,n.getBigInt)(x[D],`request.${D}`));const S="type,nonce".split(/,/);for(const D of S)!(D in x)||x[D]==null||(y[D]=(0,n.getNumber)(x[D],`request.${D}`));return x.accessList&&(y.accessList=(0,e.accessListify)(x.accessList)),"blockTag"in x&&(y.blockTag=x.blockTag),"enableCcipRead"in x&&(y.enableCcipRead=!!x.enableCcipRead),"customData"in x&&(y.customData=x.customData),y}Yt.copyRequest=a;class o{constructor(y,A){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");$(this,b,void 0);k(this,b,y.transactions.map(S=>typeof S!="string"?new l(S,A):S)),(0,n.defineProperties)(this,{provider:A,hash:r(y.hash),number:y.number,timestamp:y.timestamp,parentHash:y.parentHash,nonce:y.nonce,difficulty:y.difficulty,gasLimit:y.gasLimit,gasUsed:y.gasUsed,miner:y.miner,extraData:y.extraData,baseFeePerGas:r(y.baseFeePerGas)})}get transactions(){return g(this,b).map(y=>typeof y=="string"?y:y.hash)}get prefetchedTransactions(){const y=g(this,b).slice();return y.length===0?[]:((0,n.assert)(typeof y[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),y)}toJSON(){const{baseFeePerGas:y,difficulty:A,extraData:S,gasLimit:D,gasUsed:O,hash:_,miner:E,nonce:C,number:P,parentHash:I,timestamp:j,transactions:z}=this;return{_type:"Block",baseFeePerGas:s(y),difficulty:s(A),extraData:S,gasLimit:s(D),gasUsed:s(O),hash:_,miner:E,nonce:C,number:P,parentHash:I,timestamp:j,transactions:z}}[Symbol.iterator](){let y=0;const A=this.transactions;return{next:()=>ynew u(D,A))));let S=t;y.effectiveGasPrice!=null?S=y.effectiveGasPrice:y.gasPrice!=null&&(S=y.gasPrice),(0,n.defineProperties)(this,{provider:A,to:y.to,from:y.from,contractAddress:y.contractAddress,hash:y.hash,index:y.index,blockHash:y.blockHash,blockNumber:y.blockNumber,logsBloom:y.logsBloom,gasUsed:y.gasUsed,cumulativeGasUsed:y.cumulativeGasUsed,gasPrice:S,type:y.type,status:y.status,root:y.root})}get logs(){return g(this,v)}toJSON(){const{to:y,from:A,contractAddress:S,hash:D,index:O,blockHash:_,blockNumber:E,logsBloom:C,logs:P,status:I,root:j}=this;return{_type:"TransactionReceipt",blockHash:_,blockNumber:E,contractAddress:S,cumulativeGasUsed:s(this.cumulativeGasUsed),from:A,gasPrice:s(this.gasPrice),gasUsed:s(this.gasUsed),hash:D,index:O,logs:P,logsBloom:C,root:j,status:I,to:y}}get length(){return this.logs.length}[Symbol.iterator](){let y=0;return{next:()=>y{if(E)return null;const{blockNumber:z,nonce:F}=await(0,n.resolveProperties)({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(F{if(z==null||z.status!==0)return z;(0,n.assert)(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:z.to,from:z.from,data:""},receipt:z})},I=await this.provider.getTransactionReceipt(this.hash);if(S===0)return P(I);if(I){if(await I.confirmations()>=S)return P(I)}else if(await C(),S===0)return null;return await new Promise((z,F)=>{const W=[],H=()=>{W.forEach(M=>M())};if(W.push(()=>{E=!0}),D>0){const M=setTimeout(()=>{H(),F((0,n.makeError)("wait for transaction timeout","TIMEOUT"))},D);W.push(()=>{clearTimeout(M)})}const L=async M=>{if(await M.confirmations()>=S){H();try{z(P(M))}catch(T){F(T)}}};if(W.push(()=>{this.provider.off(this.hash,L)}),this.provider.on(this.hash,L),O>=0){const M=async()=>{try{await C()}catch(T){if((0,n.isError)(T,"TRANSACTION_REPLACED")){H(),F(T);return}}E||this.provider.once("block",M)};W.push(()=>{this.provider.off("block",M)}),this.provider.once("block",M)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}removedEvent(){return(0,n.assert)(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),h(this)}reorderedEvent(y){return(0,n.assert)(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),(0,n.assert)(!y||y.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),f(this,y)}replaceableTransaction(y){(0,n.assertArgument)(Number.isInteger(y)&&y>=0,"invalid startBlock","startBlock",y);const A=new m(this,this.provider);return k(A,w,y),A}};w=new WeakMap;let l=m;Yt.TransactionResponse=l;function d(x){return{orphan:"drop-block",hash:x.hash,number:x.number}}function f(x,y){return{orphan:"reorder-transaction",tx:x,other:y}}function h(x){return{orphan:"drop-transaction",tx:x}}function p(x){return{orphan:"drop-log",log:{transactionHash:x.transactionHash,blockHash:x.blockHash,blockNumber:x.blockNumber,address:x.address,data:x.data,topics:Object.freeze(x.topics.slice()),index:x.index}}}return Yt}var Zt={},b3;function lA(){var u,c;if(b3)return Zt;b3=1,Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.ContractEventPayload=Zt.ContractUnknownEventPayload=Zt.ContractTransactionResponse=Zt.ContractTransactionReceipt=Zt.UndecodedEventLog=Zt.EventLog=void 0;const n=Hf(),e=Ee();class t extends n.Log{constructor(f,h,p){super(f,f.provider);R(this,"interface");R(this,"fragment");R(this,"args");const b=h.decodeEventLog(p,f.data,f.topics);(0,e.defineProperties)(this,{args:b,fragment:p,interface:h})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}Zt.EventLog=t;class r extends n.Log{constructor(f,h){super(f,f.provider);R(this,"error");(0,e.defineProperties)(this,{error:h})}}Zt.UndecodedEventLog=r;class s extends n.TransactionReceipt{constructor(f,h,p){super(p,h);$(this,u,void 0);k(this,u,f)}get logs(){return super.logs.map(f=>{const h=f.topics.length?g(this,u).getEvent(f.topics[0]):null;if(h)try{return new t(f,g(this,u),h)}catch(p){return new r(f,p)}return f})}}u=new WeakMap,Zt.ContractTransactionReceipt=s;class i extends n.TransactionResponse{constructor(f,h,p){super(p,h);$(this,c,void 0);k(this,c,f)}async wait(f){const h=await super.wait(f);return h==null?null:new s(g(this,c),this.provider,h)}}c=new WeakMap,Zt.ContractTransactionResponse=i;class a extends e.EventPayload{constructor(f,h,p,b){super(f,h,p);R(this,"log");(0,e.defineProperties)(this,{log:b})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}Zt.ContractUnknownEventPayload=a;class o extends a{constructor(d,f,h,p,b){super(d,f,h,new t(b,d.interface,p));const v=d.interface.decodeEventLog(p,this.log.data,this.log.topics);(0,e.defineProperties)(this,{args:v,fragment:p})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}return Zt.ContractEventPayload=o,Zt}var g3;function fA(){var W,H;if(g3)return yr;g3=1,Object.defineProperty(yr,"__esModule",{value:!0}),yr.Contract=yr.BaseContract=yr.resolveArgs=yr.copyOverrides=void 0;const n=$f(),e=Ot(),t=Hf(),r=Ee(),s=lA(),i=BigInt(0);function a(M){return M&&typeof M.call=="function"}function o(M){return M&&typeof M.estimateGas=="function"}function u(M){return M&&typeof M.resolveName=="function"}function c(M){return M&&typeof M.sendTransaction=="function"}class l{constructor(T,B,N){$(this,W,void 0);R(this,"fragment");if((0,r.defineProperties)(this,{fragment:B}),B.inputs.lengthN[ie]==null?null:le.walkAsync(N[ie],(xe,me)=>xe==="address"?Array.isArray(me)?Promise.all(me.map(be=>(0,e.resolveAddress)(be,te))):(0,e.resolveAddress)(me,te):me)));return T.interface.encodeFilterTopics(B,ne)}())}getTopicFilter(){return g(this,W)}}W=new WeakMap;function d(M,T){return M==null?null:typeof M[T]=="function"?M:M.provider&&typeof M.provider[T]=="function"?M.provider:null}function f(M){return M==null?null:M.provider||null}async function h(M,T){const B=n.Typed.dereference(M,"overrides");(0,r.assertArgument)(typeof B=="object","invalid overrides parameter","overrides",M);const N=(0,t.copyRequest)(B);return(0,r.assertArgument)(N.to==null||(T||[]).indexOf("to")>=0,"cannot override to","overrides.to",N.to),(0,r.assertArgument)(N.data==null||(T||[]).indexOf("data")>=0,"cannot override data","overrides.data",N.data),N.from&&(N.from=await(0,e.resolveAddress)(N.from)),N}yr.copyOverrides=h;async function p(M,T,B){const N=d(M,"resolveName"),K=u(N)?N:null;return await Promise.all(T.map((te,ne)=>te.walkAsync(B[ne],(le,ie)=>(ie=n.Typed.dereference(ie,le),le==="address"?(0,e.resolveAddress)(ie,K):ie))))}yr.resolveArgs=p;function b(M){const T=async function(ne){const le=await h(ne,["data"]);le.to=await M.getAddress();const ie=M.interface,pe=(0,r.getBigInt)(le.value||i,"overrides.value")===i,xe=(le.data||"0x")==="0x";ie.fallback&&!ie.fallback.payable&&ie.receive&&!xe&&!pe&&(0,r.assertArgument)(!1,"cannot send data to receive or send value to non-payable fallback","overrides",ne),(0,r.assertArgument)(ie.fallback||xe,"cannot send data to receive-only contract","overrides.data",le.data);const me=ie.receive||ie.fallback&&ie.fallback.payable;return(0,r.assertArgument)(me||pe,"cannot send value to non-payable fallback","overrides.value",le.value),(0,r.assertArgument)(ie.fallback||xe,"cannot send data to receive-only contract","overrides.data",le.data),le},B=async function(ne){const le=d(M.runner,"call");(0,r.assert)(a(le),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const ie=await T(ne);try{return await le.call(ie)}catch(pe){throw(0,r.isCallException)(pe)&&pe.data?M.interface.makeError(pe.data,ie):pe}},N=async function(ne){const le=M.runner;(0,r.assert)(c(le),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const ie=await le.sendTransaction(await T(ne)),pe=f(M.runner);return new s.ContractTransactionResponse(M.interface,pe,ie)},K=async function(ne){const le=d(M.runner,"estimateGas");return(0,r.assert)(o(le),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await le.estimateGas(await T(ne))},te=async ne=>await N(ne);return(0,r.defineProperties)(te,{_contract:M,estimateGas:K,populateTransaction:T,send:N,staticCall:B}),te}function v(M,T){const B=function(...pe){const xe=M.interface.getFunction(T,pe);return(0,r.assert)(xe,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:T,args:pe}}),xe},N=async function(...pe){const xe=B(...pe);let me={};if(xe.inputs.length+1===pe.length&&(me=await h(pe.pop())),xe.inputs.length!==pe.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const be=await p(M.runner,xe.inputs,pe);return Object.assign({},me,await(0,r.resolveProperties)({to:M.getAddress(),data:M.interface.encodeFunctionData(xe,be)}))},K=async function(...pe){const xe=await le(...pe);return xe.length===1?xe[0]:xe},te=async function(...pe){const xe=M.runner;(0,r.assert)(c(xe),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const me=await xe.sendTransaction(await N(...pe)),be=f(M.runner);return new s.ContractTransactionResponse(M.interface,be,me)},ne=async function(...pe){const xe=d(M.runner,"estimateGas");return(0,r.assert)(o(xe),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await xe.estimateGas(await N(...pe))},le=async function(...pe){const xe=d(M.runner,"call");(0,r.assert)(a(xe),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const me=await N(...pe);let be="0x";try{be=await xe.call(me)}catch(X){throw(0,r.isCallException)(X)&&X.data?M.interface.makeError(X.data,me):X}const Ie=B(...pe);return M.interface.decodeFunctionResult(Ie,be)},ie=async(...pe)=>B(...pe).constant?await K(...pe):await te(...pe);return(0,r.defineProperties)(ie,{name:M.interface.getFunctionName(T),_contract:M,_key:T,getFragment:B,estimateGas:ne,populateTransaction:N,send:te,staticCall:K,staticCallResult:le}),Object.defineProperty(ie,"fragment",{configurable:!1,enumerable:!0,get:()=>{const pe=M.interface.getFunction(T);return(0,r.assert)(pe,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:T}}),pe}}),ie}function w(M,T){const B=function(...K){const te=M.interface.getEvent(T,K);return(0,r.assert)(te,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:T,args:K}}),te},N=function(...K){return new l(M,B(...K),K)};return(0,r.defineProperties)(N,{name:M.interface.getEventName(T),_contract:M,_key:T,getFragment:B}),Object.defineProperty(N,"fragment",{configurable:!1,enumerable:!0,get:()=>{const K=M.interface.getEvent(T);return(0,r.assert)(K,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:T}}),K}}),N}const m=Symbol.for("_ethersInternal_contract"),x=new WeakMap;function y(M,T){x.set(M[m],T)}function A(M){return x.get(M[m])}function S(M){return M&&typeof M=="object"&&"getTopicFilter"in M&&typeof M.getTopicFilter=="function"&&M.fragment}async function D(M,T){let B,N=null;if(Array.isArray(T)){const te=function(ne){if((0,r.isHexString)(ne,32))return ne;const le=M.interface.getEvent(ne);return(0,r.assertArgument)(le,"unknown fragment","name",ne),le.topicHash};B=T.map(ne=>ne==null?null:Array.isArray(ne)?ne.map(te):te(ne))}else T==="*"?B=[null]:typeof T=="string"?(0,r.isHexString)(T,32)?B=[T]:(N=M.interface.getEvent(T),(0,r.assertArgument)(N,"unknown fragment","event",T),B=[N.topicHash]):S(T)?B=await T.getTopicFilter():"fragment"in T?(N=T.fragment,B=[N.topicHash]):(0,r.assertArgument)(!1,"unknown event name","event",T);B=B.map(te=>{if(te==null)return null;if(Array.isArray(te)){const ne=Array.from(new Set(te.map(le=>le.toLowerCase())).values());return ne.length===1?ne[0]:(ne.sort(),ne)}return te.toLowerCase()});const K=B.map(te=>te==null?"null":Array.isArray(te)?te.join("|"):te).join("&");return{fragment:N,tag:K,topics:B}}async function O(M,T){const{subs:B}=A(M);return B.get((await D(M,T)).tag)||null}async function _(M,T,B){const N=f(M.runner);(0,r.assert)(N,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:T});const{fragment:K,tag:te,topics:ne}=await D(M,B),{addr:le,subs:ie}=A(M);let pe=ie.get(te);if(!pe){const me={address:le||M,topics:ne},be=Oe=>{let Me=K;if(Me==null)try{Me=M.interface.getEvent(Oe.topics[0])}catch{}if(Me){const Qe=Me,Ye=K?M.interface.decodeEventLog(K,Oe.data,Oe.topics):[];P(M,B,Ye,ge=>new s.ContractEventPayload(M,ge,B,Qe,Oe))}else P(M,B,[],Qe=>new s.ContractUnknownEventPayload(M,Qe,B,Oe))};let Ie=[];pe={tag:te,listeners:[],start:()=>{Ie.length||Ie.push(N.on(me,be))},stop:async()=>{if(Ie.length==0)return;let Oe=Ie;Ie=[],await Promise.all(Oe),N.off(me,be)}},ie.set(te,pe)}return pe}let E=Promise.resolve();async function C(M,T,B,N){await E;const K=await O(M,T);if(!K)return!1;const te=K.listeners.length;return K.listeners=K.listeners.filter(({listener:ne,once:le})=>{const ie=Array.from(B);N&&ie.push(N(le?null:ne));try{ne.call(M,...ie)}catch{}return!le}),K.listeners.length===0&&(K.stop(),A(M).subs.delete(K.tag)),te>0}async function P(M,T,B,N){try{await E}catch{}const K=C(M,T,B,N);return E=K,await K}const I=["then"],L=class L{constructor(T,B,N,K){R(this,"target");R(this,"interface");R(this,"runner");R(this,"filters");R(this,H);R(this,"fallback");(0,r.assertArgument)(typeof T=="string"||(0,e.isAddressable)(T),"invalid value for Contract target","target",T),N==null&&(N=null);const te=n.Interface.from(B);(0,r.defineProperties)(this,{target:T,runner:N,interface:te}),Object.defineProperty(this,m,{value:{}});let ne,le=null,ie=null;if(K){const me=f(N);ie=new s.ContractTransactionResponse(this.interface,me,K)}let pe=new Map;if(typeof T=="string")if((0,r.isHexString)(T))le=T,ne=Promise.resolve(T);else{const me=d(N,"resolveName");if(!u(me))throw(0,r.makeError)("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});ne=me.resolveName(T).then(be=>{if(be==null)throw(0,r.makeError)("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:T});return A(this).addr=be,be})}else ne=T.getAddress().then(me=>{if(me==null)throw new Error("TODO");return A(this).addr=me,me});y(this,{addrPromise:ne,addr:le,deployTx:ie,subs:pe});const xe=new Proxy({},{get:(me,be,Ie)=>{if(typeof be=="symbol"||I.indexOf(be)>=0)return Reflect.get(me,be,Ie);try{return this.getEvent(be)}catch(X){if(!(0,r.isError)(X,"INVALID_ARGUMENT")||X.argument!=="key")throw X}},has:(me,be)=>I.indexOf(be)>=0?Reflect.has(me,be):Reflect.has(me,be)||this.interface.hasEvent(String(be))});return(0,r.defineProperties)(this,{filters:xe}),(0,r.defineProperties)(this,{fallback:te.receive||te.fallback?b(this):null}),new Proxy(this,{get:(me,be,Ie)=>{if(typeof be=="symbol"||be in me||I.indexOf(be)>=0)return Reflect.get(me,be,Ie);try{return me.getFunction(be)}catch(X){if(!(0,r.isError)(X,"INVALID_ARGUMENT")||X.argument!=="key")throw X}},has:(me,be)=>typeof be=="symbol"||be in me||I.indexOf(be)>=0?Reflect.has(me,be):me.interface.hasFunction(be)})}connect(T){return new L(this.target,this.interface,T)}attach(T){return new L(T,this.interface,this.runner)}async getAddress(){return await A(this).addrPromise}async getDeployedCode(){const T=f(this.runner);(0,r.assert)(T,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const B=await T.getCode(await this.getAddress());return B==="0x"?null:B}async waitForDeployment(){const T=this.deploymentTransaction();if(T)return await T.wait(),this;if(await this.getDeployedCode()!=null)return this;const N=f(this.runner);return(0,r.assert)(N!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((K,te)=>{const ne=async()=>{try{if(await this.getDeployedCode()!=null)return K(this);N.once("block",ne)}catch(le){te(le)}};ne()})}deploymentTransaction(){return A(this).deployTx}getFunction(T){return typeof T!="string"&&(T=T.format()),v(this,T)}getEvent(T){return typeof T!="string"&&(T=T.format()),w(this,T)}async queryTransaction(T){throw new Error("@TODO")}async queryFilter(T,B,N){B==null&&(B=0),N==null&&(N="latest");const{addr:K,addrPromise:te}=A(this),ne=K||await te,{fragment:le,topics:ie}=await D(this,T),pe={address:ne,topics:ie,fromBlock:B,toBlock:N},xe=f(this.runner);return(0,r.assert)(xe,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await xe.getLogs(pe)).map(me=>{let be=le;if(be==null)try{be=this.interface.getEvent(me.topics[0])}catch{}if(be)try{return new s.EventLog(me,this.interface,be)}catch(Ie){return new s.UndecodedEventLog(me,Ie)}return new t.Log(me,xe)})}async on(T,B){const N=await _(this,"on",T);return N.listeners.push({listener:B,once:!1}),N.start(),this}async once(T,B){const N=await _(this,"once",T);return N.listeners.push({listener:B,once:!0}),N.start(),this}async emit(T,...B){return await P(this,T,B,null)}async listenerCount(T){if(T){const K=await O(this,T);return K?K.listeners.length:0}const{subs:B}=A(this);let N=0;for(const{listeners:K}of B.values())N+=K.length;return N}async listeners(T){if(T){const K=await O(this,T);return K?K.listeners.map(({listener:te})=>te):[]}const{subs:B}=A(this);let N=[];for(const{listeners:K}of B.values())N=N.concat(K.map(({listener:te})=>te));return N}async off(T,B){const N=await O(this,T);if(!N)return this;if(B){const K=N.listeners.map(({listener:te})=>te).indexOf(B);K>=0&&N.listeners.splice(K,1)}return(B==null||N.listeners.length===0)&&(N.stop(),A(this).subs.delete(N.tag)),this}async removeAllListeners(T){if(T){const B=await O(this,T);if(!B)return this;B.stop(),A(this).subs.delete(B.tag)}else{const{subs:B}=A(this);for(const{tag:N,stop:K}of B.values())K(),B.delete(N)}return this}async addListener(T,B){return await this.on(T,B)}async removeListener(T,B){return await this.off(T,B)}static buildClass(T){class B extends L{constructor(K,te=null){super(K,T,te)}}return B}static from(T,B,N){return N==null&&(N=null),new this(T,B,N)}};H=m;let j=L;yr.BaseContract=j;function z(){return j}class F extends z(){}return yr.Contract=F,yr}var Nu={},y3;function DI(){if(y3)return Nu;y3=1,Object.defineProperty(Nu,"__esModule",{value:!0}),Nu.ContractFactory=void 0;const n=$f(),e=Ot(),t=Ee(),r=fA();class s{constructor(a,o,u){R(this,"interface");R(this,"bytecode");R(this,"runner");const c=n.Interface.from(a);o instanceof Uint8Array||(typeof o=="object"&&(o=o.object),o.startsWith("0x")||(o="0x"+o)),o=(0,t.hexlify)((0,t.getBytes)(o)),(0,t.defineProperties)(this,{bytecode:o,interface:c,runner:u||null})}attach(a){return new r.BaseContract(a,this.interface,this.runner)}async getDeployTransaction(...a){let o={};const u=this.interface.deploy;if(u.inputs.length+1===a.length&&(o=await(0,r.copyOverrides)(a.pop())),u.inputs.length!==a.length)throw new Error("incorrect number of arguments to constructor");const c=await(0,r.resolveArgs)(this.runner,u.inputs,a),l=(0,t.concat)([this.bytecode,this.interface.encodeDeploy(c)]);return Object.assign({},o,{data:l})}async deploy(...a){const o=await this.getDeployTransaction(...a);(0,t.assert)(this.runner&&typeof this.runner.sendTransaction=="function","factory runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const u=await this.runner.sendTransaction(o),c=(0,e.getCreateAddress)(u);return new r.BaseContract(c,this.interface,this.runner,u)}connect(a){return new s(this.interface,this.bytecode,a)}static fromSolidity(a,o){(0,t.assertArgument)(a!=null,"bad compiler output","output",a),typeof a=="string"&&(a=JSON.parse(a));const u=a.abi;let c="";return a.bytecode?c=a.bytecode:a.evm&&a.evm.bytecode&&(c=a.evm.bytecode),new this(u,c,o)}}return Nu.ContractFactory=s,Nu}var m3;function Mh(){return m3||(m3=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.UndecodedEventLog=n.EventLog=n.ContractTransactionResponse=n.ContractTransactionReceipt=n.ContractUnknownEventPayload=n.ContractEventPayload=n.ContractFactory=n.Contract=n.BaseContract=void 0;var e=fA();Object.defineProperty(n,"BaseContract",{enumerable:!0,get:function(){return e.BaseContract}}),Object.defineProperty(n,"Contract",{enumerable:!0,get:function(){return e.Contract}});var t=DI();Object.defineProperty(n,"ContractFactory",{enumerable:!0,get:function(){return t.ContractFactory}});var r=lA();Object.defineProperty(n,"ContractEventPayload",{enumerable:!0,get:function(){return r.ContractEventPayload}}),Object.defineProperty(n,"ContractUnknownEventPayload",{enumerable:!0,get:function(){return r.ContractUnknownEventPayload}}),Object.defineProperty(n,"ContractTransactionReceipt",{enumerable:!0,get:function(){return r.ContractTransactionReceipt}}),Object.defineProperty(n,"ContractTransactionResponse",{enumerable:!0,get:function(){return r.ContractTransactionResponse}}),Object.defineProperty(n,"EventLog",{enumerable:!0,get:function(){return r.EventLog}}),Object.defineProperty(n,"UndecodedEventLog",{enumerable:!0,get:function(){return r.UndecodedEventLog}})}(T2)),T2}var O2={},E0={},bs={},x3;function hA(){var f,h,p,ro,v,dA;if(x3)return bs;x3=1,Object.defineProperty(bs,"__esModule",{value:!0}),bs.EnsResolver=bs.BasicMulticoinProviderPlugin=bs.MulticoinProviderPlugin=void 0;const n=Ot(),e=jf(),t=Mh(),r=oi(),s=Ee();function i(x){return x.match(/^ipfs:\/\/ipfs\//i)?x=x.substring(12):x.match(/^ipfs:\/\//i)?x=x.substring(7):(0,s.assertArgument)(!1,"unsupported IPFS format","link",x),`https://gateway.ipfs.io/ipfs/${x}`}class a{constructor(y){R(this,"name");(0,s.defineProperties)(this,{name:y})}connect(y){return this}supportsCoinType(y){return!1}async encodeAddress(y,A){throw new Error("unsupported coin")}async decodeAddress(y,A){throw new Error("unsupported coin")}}bs.MulticoinProviderPlugin=a;const o="org.ethers.plugins.provider.BasicMulticoin";class u extends a{constructor(){super(o)}}bs.BasicMulticoinProviderPlugin=u;const c=new RegExp("^(ipfs)://(.*)$","i"),l=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),c,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")],m=class m{constructor(y,A,S){$(this,p);R(this,"provider");R(this,"address");R(this,"name");$(this,f,void 0);$(this,h,void 0);(0,s.defineProperties)(this,{provider:y,address:A,name:S}),k(this,f,null),k(this,h,new t.Contract(A,["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)"],y))}async supportsWildcard(){return g(this,f)==null&&k(this,f,(async()=>{try{return await g(this,h).supportsInterface("0x9061b923")}catch(y){if((0,s.isError)(y,"CALL_EXCEPTION"))return!1;throw k(this,f,null),y}})()),await g(this,f)}async getAddress(y){if(y==null&&(y=60),y===60)try{const O=await Q(this,p,ro).call(this,"addr(bytes32)");return O==null||O===e.ZeroAddress?null:O}catch(O){if((0,s.isError)(O,"CALL_EXCEPTION"))return null;throw O}if(y>=0&&y<2147483648){let O=y+2147483648;const _=await Q(this,p,ro).call(this,"addr(bytes32,uint)",[O]);if((0,s.isHexString)(_,20))return(0,n.getAddress)(_)}let A=null;for(const O of this.provider.plugins)if(O instanceof a&&O.supportsCoinType(y)){A=O;break}if(A==null)return null;const S=await Q(this,p,ro).call(this,"addr(bytes32,uint)",[y]);if(S==null||S==="0x")return null;const D=await A.decodeAddress(y,S);if(D!=null)return D;(0,s.assert)(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${y})`,info:{coinType:y,data:S}})}async getText(y){const A=await Q(this,p,ro).call(this,"text(bytes32,string)",[y]);return A==null||A==="0x"?null:A}async getContentHash(){const y=await Q(this,p,ro).call(this,"contenthash(bytes32)");if(y==null||y==="0x")return null;const A=y.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(A){const D=A[1]==="e3010170"?"ipfs":"ipns",O=parseInt(A[4],16);if(A[5].length===O*2)return`${D}://${(0,s.encodeBase58)("0x"+A[2])}`}const S=y.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(S&&S[1].length===64)return`bzz://${S[1]}`;(0,s.assert)(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:y}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const y=[{type:"name",value:this.name}];try{const A=await this.getText("avatar");if(A==null)return y.push({type:"!avatar",value:""}),{url:null,linkage:y};y.push({type:"avatar",value:A});for(let S=0;S{if(!Array.isArray(S))throw new Error("not an array");return S.map(D=>A(D))}}at.arrayOf=a;function o(A,S){return D=>{const O={};for(const _ in A){let E=_;if(S&&_ in S&&!(E in D)){for(const C of S[_])if(C in D){E=C;break}}try{const C=A[_](D[E]);C!==void 0&&(O[_]=C)}catch(C){const P=C instanceof Error?C.message:"not-an-error";(0,r.assert)(!1,`invalid value for value.${_} (${P})`,"BAD_DATA",{value:D})}}return O}}at.object=o;function u(A){switch(A){case!0:case"true":return!0;case!1:case"false":return!1}(0,r.assertArgument)(!1,`invalid boolean; ${JSON.stringify(A)}`,"value",A)}at.formatBoolean=u;function c(A){return(0,r.assertArgument)((0,r.isHexString)(A,!0),"invalid data","value",A),A}at.formatData=c;function l(A){return(0,r.assertArgument)((0,r.isHexString)(A,32),"invalid hash","value",A),A}at.formatHash=l;function d(A){if(!(0,r.isHexString)(A))throw new Error("invalid uint256");return(0,r.zeroPadValue)(A,32)}at.formatUint256=d;const f=o({address:n.getAddress,blockHash:l,blockNumber:r.getNumber,data:c,index:r.getNumber,removed:i(u,!1),topics:a(l),transactionHash:l,transactionIndex:r.getNumber},{index:["logIndex"]});function h(A){return f(A)}at.formatLog=h;const p=o({hash:i(l),parentHash:l,number:r.getNumber,timestamp:r.getNumber,nonce:i(c),difficulty:r.getBigInt,gasLimit:r.getBigInt,gasUsed:r.getBigInt,miner:i(n.getAddress),extraData:c,baseFeePerGas:i(r.getBigInt)});function b(A){const S=p(A);return S.transactions=A.transactions.map(D=>typeof D=="string"?D:y(D)),S}at.formatBlock=b;const v=o({transactionIndex:r.getNumber,blockNumber:r.getNumber,transactionHash:l,address:n.getAddress,topics:a(l),data:c,index:r.getNumber,blockHash:l},{index:["logIndex"]});function w(A){return v(A)}at.formatReceiptLog=w;const m=o({to:i(n.getAddress,null),from:i(n.getAddress,null),contractAddress:i(n.getAddress,null),index:r.getNumber,root:i(r.hexlify),gasUsed:r.getBigInt,logsBloom:i(c),blockHash:l,hash:l,logs:a(w),blockNumber:r.getNumber,cumulativeGasUsed:r.getBigInt,effectiveGasPrice:i(r.getBigInt),status:i(r.getNumber),type:i(r.getNumber,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function x(A){return m(A)}at.formatTransactionReceipt=x;function y(A){A.to&&(0,r.getBigInt)(A.to)===s&&(A.to="0x0000000000000000000000000000000000000000");const S=o({hash:l,type:D=>D==="0x"||D==null?0:(0,r.getNumber)(D),accessList:i(t.accessListify,null),blockHash:i(l,null),blockNumber:i(r.getNumber,null),transactionIndex:i(r.getNumber,null),from:n.getAddress,gasPrice:i(r.getBigInt),maxPriorityFeePerGas:i(r.getBigInt),maxFeePerGas:i(r.getBigInt),gasLimit:r.getBigInt,to:i(n.getAddress,null),value:r.getBigInt,nonce:r.getNumber,data:c,creates:i(n.getAddress,null),chainId:i(r.getBigInt,null)},{data:["input"],gasLimit:["gas"]})(A);if(S.to==null&&S.creates==null&&(S.creates=(0,n.getCreateAddress)(S)),(A.type===1||A.type===2)&&A.accessList==null&&(S.accessList=[]),A.signature?S.signature=e.Signature.from(A.signature):S.signature=e.Signature.from(A),S.chainId==null){const D=S.signature.legacyChainId;D!=null&&(S.chainId=D)}return S.blockHash&&(0,r.getBigInt)(S.blockHash)===s&&(S.blockHash=null),S}return at.formatTransactionResponse=y,at}var Iu={},Sn={},v3;function Sb(){var u,l,d;if(v3)return Sn;v3=1,Object.defineProperty(Sn,"__esModule",{value:!0}),Sn.FetchUrlFeeDataNetworkPlugin=Sn.FeeDataNetworkPlugin=Sn.EnsPlugin=Sn.GasCostPlugin=Sn.NetworkPlugin=void 0;const n=La(),e=Ee(),t="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class r{constructor(h){R(this,"name");(0,n.defineProperties)(this,{name:h})}clone(){return new r(this.name)}}Sn.NetworkPlugin=r;class s extends r{constructor(p,b){p==null&&(p=0);super(`org.ethers.network.plugins.GasCost#${p||0}`);R(this,"effectiveBlock");R(this,"txBase");R(this,"txCreate");R(this,"txDataZero");R(this,"txDataNonzero");R(this,"txAccessListStorageKey");R(this,"txAccessListAddress");const v={effectiveBlock:p};function w(m,x){let y=(b||{})[m];y==null&&(y=x),(0,e.assertArgument)(typeof y=="number",`invalud value for ${m}`,"costs",b),v[m]=y}w("txBase",21e3),w("txCreate",32e3),w("txDataZero",4),w("txDataNonzero",16),w("txAccessListStorageKey",1900),w("txAccessListAddress",2400),(0,n.defineProperties)(this,v)}clone(){return new s(this.effectiveBlock,this)}}Sn.GasCostPlugin=s;class i extends r{constructor(p,b){super("org.ethers.plugins.network.Ens");R(this,"address");R(this,"targetNetwork");(0,n.defineProperties)(this,{address:p||t,targetNetwork:b??1})}clone(){return new i(this.address,this.targetNetwork)}}Sn.EnsPlugin=i;const c=class c extends r{constructor(p){super("org.ethers.plugins.network.FeeData");$(this,u,void 0);k(this,u,p)}get feeDataFunc(){return g(this,u)}async getFeeData(p){return await g(this,u).call(this,p)}clone(){return new c(g(this,u))}};u=new WeakMap;let a=c;Sn.FeeDataNetworkPlugin=a;class o extends r{constructor(p,b){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");$(this,l,void 0);$(this,d,void 0);k(this,l,p),k(this,d,b)}get url(){return g(this,l)}get processFunc(){return g(this,d)}clone(){return this}}return l=new WeakMap,d=new WeakMap,Sn.FetchUrlFeeDataNetworkPlugin=o,Sn}var A3;function dr(){var l,d,f;if(A3)return Iu;A3=1,Object.defineProperty(Iu,"__esModule",{value:!0}),Iu.Network=void 0;const n=$n(),e=Ee(),t=Sb(),r=new Map,h=class h{constructor(b,v){$(this,l,void 0);$(this,d,void 0);$(this,f,void 0);k(this,l,b),k(this,d,(0,e.getBigInt)(v)),k(this,f,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return g(this,l)}set name(b){k(this,l,b)}get chainId(){return g(this,d)}set chainId(b){k(this,d,(0,e.getBigInt)(b,"chainId"))}matches(b){if(b==null)return!1;if(typeof b=="string"){try{return this.chainId===(0,e.getBigInt)(b)}catch{}return this.name===b}if(typeof b=="number"||typeof b=="bigint"){try{return this.chainId===(0,e.getBigInt)(b)}catch{}return!1}if(typeof b=="object"){if(b.chainId!=null){try{return this.chainId===(0,e.getBigInt)(b.chainId)}catch{}return!1}return b.name!=null?this.name===b.name:!1}return!1}get plugins(){return Array.from(g(this,f).values())}attachPlugin(b){if(g(this,f).get(b.name))throw new Error(`cannot replace existing plugin: ${b.name} `);return g(this,f).set(b.name,b.clone()),this}getPlugin(b){return g(this,f).get(b)||null}getPlugins(b){return this.plugins.filter(v=>v.name.split("#")[0]===b)}clone(){const b=new h(this.name,this.chainId);return this.plugins.forEach(v=>{b.attachPlugin(v.clone())}),b}computeIntrinsicGas(b){const v=this.getPlugin("org.ethers.plugins.network.GasCost")||new t.GasCostPlugin;let w=v.txBase;if(b.to==null&&(w+=v.txCreate),b.data)for(let m=2;m9){let m=BigInt(w[1].substring(0,9));w[1].substring(9).match(/^0+$/)||m++,w[1]=m.toString()}return BigInt(w[0]+w[1])}function a(p){return new t.FetchUrlFeeDataNetworkPlugin(p,async(b,v,w)=>{w.setHeader("User-Agent","ethers");let m;try{m=await w.send();const x=m.bodyJson.standard;return{maxFeePerGas:i(x.maxFee,9),maxPriorityFeePerGas:i(x.maxPriorityFee,9)}}catch(x){(0,e.assert)(!1,`error encountered with polygon gas station (${JSON.stringify(w.url)})`,"SERVER_ERROR",{request:w,response:m,error:x})}})}function o(p){return new t.FetchUrlFeeDataNetworkPlugin("data:",async(b,v,w)=>{const m=await b();if(m.maxFeePerGas==null||m.maxPriorityFeePerGas==null)return m;const x=m.maxFeePerGas-m.maxPriorityFeePerGas;return{gasPrice:m.gasPrice,maxFeePerGas:x+p,maxPriorityFeePerGas:p}})}let u=!1;function c(){if(u)return;u=!0;function p(b,v,w){const m=function(){const x=new s(b,v);return w.ensNetwork!=null&&x.attachPlugin(new t.EnsPlugin(null,w.ensNetwork)),x.attachPlugin(new t.GasCostPlugin),(w.plugins||[]).forEach(y=>{x.attachPlugin(y)}),x};s.register(b,m),s.register(v,m),w.altNames&&w.altNames.forEach(x=>{s.register(x,m)})}p("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),p("ropsten",3,{ensNetwork:3}),p("rinkeby",4,{ensNetwork:4}),p("goerli",5,{ensNetwork:5}),p("kovan",42,{ensNetwork:42}),p("sepolia",11155111,{}),p("classic",61,{}),p("classicKotti",6,{}),p("arbitrum",42161,{ensNetwork:1}),p("arbitrum-goerli",421613,{}),p("bnb",56,{ensNetwork:1}),p("bnbt",97,{}),p("linea",59144,{ensNetwork:1}),p("linea-goerli",59140,{}),p("matic",137,{ensNetwork:1,plugins:[a("https://gasstation.polygon.technology/v2")]}),p("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[a("https://gasstation-testnet.polygon.technology/v2")]}),p("optimism",10,{ensNetwork:1,plugins:[o(BigInt("1000000"))]}),p("optimism-goerli",420,{}),p("xdai",100,{ensNetwork:1})}return Iu}var Xt={},E3;function Rb(){var u,c,l,d,f,y1,p,b,v,w,m,x,y,A,S,D,O,pA;if(E3)return Xt;E3=1,Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.PollingEventSubscriber=Xt.PollingTransactionSubscriber=Xt.PollingOrphanSubscriber=Xt.OnBlockSubscriber=Xt.PollingBlockSubscriber=Xt.getPollingSubscriber=void 0;const n=Ee();function e(E){return JSON.parse(JSON.stringify(E))}function t(E,C){if(C==="block")return new r(E);if((0,n.isHexString)(C,32))return new a(E,C);(0,n.assert)(!1,"unsupported polling event","UNSUPPORTED_OPERATION",{operation:"getPollingSubscriber",info:{event:C}})}Xt.getPollingSubscriber=t;class r{constructor(C){$(this,f);$(this,u,void 0);$(this,c,void 0);$(this,l,void 0);$(this,d,void 0);k(this,u,C),k(this,c,null),k(this,l,4e3),k(this,d,-2)}get pollingInterval(){return g(this,l)}set pollingInterval(C){k(this,l,C)}start(){g(this,c)||(k(this,c,g(this,u)._setTimeout(Q(this,f,y1).bind(this),g(this,l))),Q(this,f,y1).call(this))}stop(){g(this,c)&&(g(this,u)._clearTimeout(g(this,c)),k(this,c,null))}pause(C){this.stop(),C&&k(this,d,-2)}resume(){this.start()}}u=new WeakMap,c=new WeakMap,l=new WeakMap,d=new WeakMap,f=new WeakSet,y1=async function(){try{const C=await g(this,u).getBlockNumber();if(g(this,d)===-2){k(this,d,C);return}if(C!==g(this,d)){for(let P=g(this,d)+1;P<=C;P++){if(g(this,c)==null)return;await g(this,u).emit("block",P)}k(this,d,C)}}catch{}g(this,c)!=null&&k(this,c,g(this,u)._setTimeout(Q(this,f,y1).bind(this),g(this,l)))},Xt.PollingBlockSubscriber=r;class s{constructor(C){$(this,p,void 0);$(this,b,void 0);$(this,v,void 0);k(this,p,C),k(this,v,!1),k(this,b,P=>{this._poll(P,g(this,p))})}async _poll(C,P){throw new Error("sub-classes must override this")}start(){g(this,v)||(k(this,v,!0),g(this,b).call(this,-2),g(this,p).on("block",g(this,b)))}stop(){g(this,v)&&(k(this,v,!1),g(this,p).off("block",g(this,b)))}pause(C){this.stop()}resume(){this.start()}}p=new WeakMap,b=new WeakMap,v=new WeakMap,Xt.OnBlockSubscriber=s;class i extends s{constructor(P,I){super(P);$(this,w,void 0);k(this,w,e(I))}async _poll(P,I){throw new Error("@TODO")}}w=new WeakMap,Xt.PollingOrphanSubscriber=i;class a extends s{constructor(P,I){super(P);$(this,m,void 0);k(this,m,I)}async _poll(P,I){const j=await I.getTransactionReceipt(g(this,m));j&&I.emit(g(this,m),j)}}m=new WeakMap,Xt.PollingTransactionSubscriber=a;class o{constructor(C,P){$(this,O);$(this,x,void 0);$(this,y,void 0);$(this,A,void 0);$(this,S,void 0);$(this,D,void 0);k(this,x,C),k(this,y,e(P)),k(this,A,Q(this,O,pA).bind(this)),k(this,S,!1),k(this,D,-2)}start(){g(this,S)||(k(this,S,!0),g(this,D)===-2&&g(this,x).getBlockNumber().then(C=>{k(this,D,C)}),g(this,x).on("block",g(this,A)))}stop(){g(this,S)&&(k(this,S,!1),g(this,x).off("block",g(this,A)))}pause(C){this.stop(),C&&k(this,D,-2)}resume(){this.start()}}return x=new WeakMap,y=new WeakMap,A=new WeakMap,S=new WeakMap,D=new WeakMap,O=new WeakSet,pA=async function(C){if(g(this,D)===-2)return;const P=e(g(this,y));P.fromBlock=g(this,D)+1,P.toBlock=C;const I=await g(this,x).getLogs(P);if(I.length===0){g(this,D){if(U==null)return"null";if(typeof U=="bigint")return`bigint:${U.toString()}`;if(typeof U=="string")return U.toLowerCase();if(typeof U=="object"&&!Array.isArray(U)){const G=Object.keys(U);return G.sort(),G.reduce((Y,J)=>(Y[J]=U[J],Y),{})}return U})}class b{constructor(q){R(this,"name");(0,i.defineProperties)(this,{name:q})}start(){}stop(){}pause(q){}resume(){}}E0.UnmanagedSubscriber=b;function v(ge){return JSON.parse(JSON.stringify(ge))}function w(ge){return ge=Array.from(new Set(ge).values()),ge.sort(),ge}async function m(ge,q){if(ge==null)throw new Error("invalid event");if(Array.isArray(ge)&&(ge={topics:ge}),typeof ge=="string")switch(ge){case"block":case"pending":case"debug":case"error":case"network":return{type:ge,tag:ge}}if((0,i.isHexString)(ge,32)){const V=ge.toLowerCase();return{type:"transaction",tag:p("tx",{hash:V}),hash:V}}if(ge.orphan){const V=ge;return{type:"orphan",tag:p("orphan",V),filter:v(V)}}if(ge.address||ge.topics){const V=ge,U={topics:(V.topics||[]).map(G=>G==null?null:Array.isArray(G)?w(G.map(Y=>Y.toLowerCase())):G.toLowerCase())};if(V.address){const G=[],Y=[],J=ee=>{(0,i.isHexString)(ee)?G.push(ee):Y.push((async()=>{G.push(await(0,n.resolveAddress)(ee,q))})())};Array.isArray(V.address)?V.address.forEach(J):J(V.address),Y.length&&await Promise.all(Y),U.address=w(G.map(ee=>ee.toLowerCase()))}return{filter:U,tag:p("event",U),type:"event"}}(0,i.assertArgument)(!1,"unknown ProviderEvent","event",ge)}function x(){return new Date().getTime()}const y={cacheTimeout:250,pollingInterval:4e3};class A{constructor(q,V){$(this,ne);$(this,ie);$(this,xe);$(this,be);$(this,X);$(this,Oe);$(this,Qe);$(this,j,void 0);$(this,z,void 0);$(this,F,void 0);$(this,W,void 0);$(this,H,void 0);$(this,L,void 0);$(this,M,void 0);$(this,T,void 0);$(this,B,void 0);$(this,N,void 0);$(this,K,void 0);$(this,te,void 0);if(k(this,te,Object.assign({},y,V||{})),q==="any")k(this,L,!0),k(this,H,null);else if(q){const U=u.Network.from(q);k(this,L,!1),k(this,H,Promise.resolve(U)),setTimeout(()=>{this.emit("network",U,null)},0)}else k(this,L,!1),k(this,H,null);k(this,T,-1),k(this,M,new Map),k(this,j,new Map),k(this,z,new Map),k(this,F,null),k(this,W,!1),k(this,B,1),k(this,N,new Map),k(this,K,!1)}get pollingInterval(){return g(this,te).pollingInterval}get provider(){return this}get plugins(){return Array.from(g(this,z).values())}attachPlugin(q){if(g(this,z).get(q.name))throw new Error(`cannot replace existing plugin: ${q.name} `);return g(this,z).set(q.name,q.connect(this)),this}getPlugin(q){return g(this,z).get(q)||null}get disableCcipRead(){return g(this,K)}set disableCcipRead(q){k(this,K,!!q)}async ccipReadFetch(q,V,U){if(this.disableCcipRead||U.length===0||q.to==null)return null;const G=q.to.toLowerCase(),Y=V.toLowerCase(),J=[];for(let ee=0;ee=500,`response not found during CCIP fetch: ${Ue}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:q,info:{url:ue,errorMessage:Ue}}),J.push(Ue)}(0,i.assert)(!1,`error encountered during CCIP fetch: ${J.map(ee=>JSON.stringify(ee)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:q,info:{urls:U,errorMessages:J}})}_wrapBlock(q,V){return new c.Block((0,o.formatBlock)(q),this)}_wrapLog(q,V){return new c.Log((0,o.formatLog)(q),this)}_wrapTransactionReceipt(q,V){return new c.TransactionReceipt((0,o.formatTransactionReceipt)(q),this)}_wrapTransactionResponse(q,V){return new c.TransactionResponse((0,o.formatTransactionResponse)(q),this)}_detectNetwork(){(0,i.assert)(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(q){(0,i.assert)(!1,`unsupported method: ${q.method}`,"UNSUPPORTED_OPERATION",{operation:q.method,info:q})}async getBlockNumber(){const q=(0,i.getNumber)(await Q(this,ne,Qn).call(this,{method:"getBlockNumber"}),"%response");return g(this,T)>=0&&k(this,T,q),q}_getAddress(q){return(0,n.resolveAddress)(q,this)}_getBlockTag(q){if(q==null)return"latest";switch(q){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return q}if((0,i.isHexString)(q))return(0,i.isHexString)(q,32)?q:(0,i.toQuantity)(q);if(typeof q=="bigint"&&(q=(0,i.getNumber)(q,"blockTag")),typeof q=="number")return q>=0?(0,i.toQuantity)(q):g(this,T)>=0?(0,i.toQuantity)(g(this,T)+q):this.getBlockNumber().then(V=>(0,i.toQuantity)(V+q));(0,i.assertArgument)(!1,"invalid blockTag","blockTag",q)}_getFilter(q){const V=(q.topics||[]).map(ue=>ue==null?null:Array.isArray(ue)?w(ue.map(_e=>_e.toLowerCase())):ue.toLowerCase()),U="blockHash"in q?q.blockHash:void 0,G=(ue,_e,he)=>{let Ue;switch(ue.length){case 0:break;case 1:Ue=ue[0];break;default:ue.sort(),Ue=ue}if(U&&(_e!=null||he!=null))throw new Error("invalid filter");const rt={};return Ue&&(rt.address=Ue),V.length&&(rt.topics=V),_e&&(rt.fromBlock=_e),he&&(rt.toBlock=he),U&&(rt.blockHash=U),rt};let Y=[];if(q.address)if(Array.isArray(q.address))for(const ue of q.address)Y.push(this._getAddress(ue));else Y.push(this._getAddress(q.address));let J;"fromBlock"in q&&(J=this._getBlockTag(q.fromBlock));let ee;return"toBlock"in q&&(ee=this._getBlockTag(q.toBlock)),Y.filter(ue=>typeof ue!="string").length||J!=null&&typeof J!="string"||ee!=null&&typeof ee!="string"?Promise.all([Promise.all(Y),J,ee]).then(ue=>G(ue[0],ue[1],ue[2])):G(Y,J,ee)}_getTransactionRequest(q){const V=(0,c.copyRequest)(q),U=[];if(["to","from"].forEach(G=>{if(V[G]==null)return;const Y=(0,n.resolveAddress)(V[G]);h(Y)?U.push(async function(){V[G]=await Y}()):V[G]=Y}),V.blockTag!=null){const G=this._getBlockTag(V.blockTag);h(G)?U.push(async function(){V.blockTag=await G}()):V.blockTag=G}return U.length?async function(){return await Promise.all(U),V}():V}async getNetwork(){if(g(this,H)==null){const G=this._detectNetwork().then(Y=>(this.emit("network",Y,null),Y),Y=>{throw g(this,H)===G&&k(this,H,null),Y});return k(this,H,G),(await G).clone()}const q=g(this,H),[V,U]=await Promise.all([q,this._detectNetwork()]);return V.chainId!==U.chainId&&(g(this,L)?(this.emit("network",U,V),g(this,H)===q&&k(this,H,Promise.resolve(U))):(0,i.assert)(!1,`network changed: ${V.chainId} => ${U.chainId} `,"NETWORK_ERROR",{event:"changed"})),V.clone()}async getFeeData(){const q=await this.getNetwork(),V=async()=>{const{_block:G,gasPrice:Y}=await(0,i.resolveProperties)({_block:Q(this,X,o5).call(this,"latest",!1),gasPrice:(async()=>{try{const _e=await Q(this,ne,Qn).call(this,{method:"getGasPrice"});return(0,i.getBigInt)(_e,"%response")}catch{}return null})()});let J=null,ee=null;const ue=this._wrapBlock(G,q);return ue&&ue.baseFeePerGas&&(ee=BigInt("1000000000"),J=ue.baseFeePerGas*d+ee),new c.FeeData(Y,J,ee)},U=q.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(U){const G=new i.FetchRequest(U.url),Y=await U.processFunc(V,this,G);return new c.FeeData(Y.gasPrice,Y.maxFeePerGas,Y.maxPriorityFeePerGas)}return await V()}async estimateGas(q){let V=this._getTransactionRequest(q);return h(V)&&(V=await V),(0,i.getBigInt)(await Q(this,ne,Qn).call(this,{method:"estimateGas",transaction:V}),"%response")}async call(q){const{tx:V,blockTag:U}=await(0,i.resolveProperties)({tx:this._getTransactionRequest(q),blockTag:this._getBlockTag(q.blockTag)});return await Q(this,xe,a5).call(this,Q(this,ie,i5).call(this,V,U,q.enableCcipRead?0:-1))}async getBalance(q,V){return(0,i.getBigInt)(await Q(this,be,vl).call(this,{method:"getBalance"},q,V),"%response")}async getTransactionCount(q,V){return(0,i.getNumber)(await Q(this,be,vl).call(this,{method:"getTransactionCount"},q,V),"%response")}async getCode(q,V){return(0,i.hexlify)(await Q(this,be,vl).call(this,{method:"getCode"},q,V))}async getStorage(q,V,U){const G=(0,i.getBigInt)(V,"position");return(0,i.hexlify)(await Q(this,be,vl).call(this,{method:"getStorage",position:G},q,U))}async broadcastTransaction(q){const{blockNumber:V,hash:U,network:G}=await(0,i.resolveProperties)({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:q}),network:this.getNetwork()}),Y=s.Transaction.from(q);if(Y.hash!==U)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(Y,G).replaceableTransaction(V)}async getBlock(q,V){const{network:U,params:G}=await(0,i.resolveProperties)({network:this.getNetwork(),params:Q(this,X,o5).call(this,q,!!V)});return G==null?null:this._wrapBlock(G,U)}async getTransaction(q){const{network:V,params:U}=await(0,i.resolveProperties)({network:this.getNetwork(),params:Q(this,ne,Qn).call(this,{method:"getTransaction",hash:q})});return U==null?null:this._wrapTransactionResponse(U,V)}async getTransactionReceipt(q){const{network:V,params:U}=await(0,i.resolveProperties)({network:this.getNetwork(),params:Q(this,ne,Qn).call(this,{method:"getTransactionReceipt",hash:q})});if(U==null)return null;if(U.gasPrice==null&&U.effectiveGasPrice==null){const G=await Q(this,ne,Qn).call(this,{method:"getTransaction",hash:q});if(G==null)throw new Error("report this; could not find tx or effectiveGasPrice");U.effectiveGasPrice=G.gasPrice}return this._wrapTransactionReceipt(U,V)}async getTransactionResult(q){const{result:V}=await(0,i.resolveProperties)({network:this.getNetwork(),result:Q(this,ne,Qn).call(this,{method:"getTransactionResult",hash:q})});return V==null?null:(0,i.hexlify)(V)}async getLogs(q){let V=this._getFilter(q);h(V)&&(V=await V);const{network:U,params:G}=await(0,i.resolveProperties)({network:this.getNetwork(),params:Q(this,ne,Qn).call(this,{method:"getLogs",filter:V})});return G.map(Y=>this._wrapLog(Y,U))}_getProvider(q){(0,i.assert)(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(q){return await a.EnsResolver.fromName(this,q)}async getAvatar(q){const V=await this.getResolver(q);return V?await V.getAvatar():null}async resolveName(q){const V=await this.getResolver(q);return V?await V.getAddress():null}async lookupAddress(q){q=(0,n.getAddress)(q);const V=(0,r.namehash)(q.substring(2).toLowerCase()+".addr.reverse");try{const U=await a.EnsResolver.getEnsAddress(this),Y=await new t.Contract(U,["function resolver(bytes32) view returns (address)"],this).resolver(V);if(Y==null||Y===e.ZeroAddress)return null;const ee=await new t.Contract(Y,["function name(bytes32) view returns (string)"],this).name(V);return await this.resolveName(ee)!==q?null:ee}catch(U){if((0,i.isError)(U,"BAD_DATA")&&U.value==="0x"||(0,i.isError)(U,"CALL_EXCEPTION"))return null;throw U}return null}async waitForTransaction(q,V,U){const G=V??1;return G===0?this.getTransactionReceipt(q):new Promise(async(Y,J)=>{let ee=null;const ue=async _e=>{try{const he=await this.getTransactionReceipt(q);if(he!=null&&_e-he.blockNumber+1>=G){Y(he),ee&&(clearTimeout(ee),ee=null);return}}catch(he){console.log("EEE",he)}this.once("block",ue)};U!=null&&(ee=setTimeout(()=>{ee!=null&&(ee=null,this.off("block",ue),J((0,i.makeError)("timeout","TIMEOUT",{reason:"timeout"})))},U)),ue(await this.getBlockNumber())})}async waitForBlock(q){(0,i.assert)(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(q){const V=g(this,N).get(q);V&&(V.timer&&clearTimeout(V.timer),g(this,N).delete(q))}_setTimeout(q,V){V==null&&(V=0);const U=hr(this,B)._++,G=()=>{g(this,N).delete(U),q()};if(this.paused)g(this,N).set(U,{timer:null,func:G,time:V});else{const Y=setTimeout(G,V);g(this,N).set(U,{timer:Y,func:G,time:x()})}return U}_forEachSubscriber(q){for(const V of g(this,j).values())q(V.subscriber)}_getSubscriber(q){switch(q.type){case"debug":case"error":case"network":return new b(q.type);case"block":{const V=new l.PollingBlockSubscriber(this);return V.pollingInterval=this.pollingInterval,V}case"event":return new l.PollingEventSubscriber(this,q.filter);case"transaction":return new l.PollingTransactionSubscriber(this,q.hash);case"orphan":return new l.PollingOrphanSubscriber(this,q.filter)}throw new Error(`unsupported event: ${q.type}`)}_recoverSubscriber(q,V){for(const U of g(this,j).values())if(U.subscriber===q){U.started&&U.subscriber.stop(),U.subscriber=V,U.started&&V.start(),g(this,F)!=null&&V.pause(g(this,F));break}}async on(q,V){const U=await Q(this,Qe,m1).call(this,q);return U.listeners.push({listener:V,once:!1}),U.started||(U.subscriber.start(),U.started=!0,g(this,F)!=null&&U.subscriber.pause(g(this,F))),this}async once(q,V){const U=await Q(this,Qe,m1).call(this,q);return U.listeners.push({listener:V,once:!0}),U.started||(U.subscriber.start(),U.started=!0,g(this,F)!=null&&U.subscriber.pause(g(this,F))),this}async emit(q,...V){const U=await Q(this,Oe,Al).call(this,q,V);if(!U||U.listeners.length===0)return!1;const G=U.listeners.length;return U.listeners=U.listeners.filter(({listener:Y,once:J})=>{const ee=new i.EventPayload(this,J?null:Y,q);try{Y.call(this,...V,ee)}catch{}return!J}),U.listeners.length===0&&(U.started&&U.subscriber.stop(),g(this,j).delete(U.tag)),G>0}async listenerCount(q){if(q){const U=await Q(this,Oe,Al).call(this,q);return U?U.listeners.length:0}let V=0;for(const{listeners:U}of g(this,j).values())V+=U.length;return V}async listeners(q){if(q){const U=await Q(this,Oe,Al).call(this,q);return U?U.listeners.map(({listener:G})=>G):[]}let V=[];for(const{listeners:U}of g(this,j).values())V=V.concat(U.map(({listener:G})=>G));return V}async off(q,V){const U=await Q(this,Oe,Al).call(this,q);if(!U)return this;if(V){const G=U.listeners.map(({listener:Y})=>Y).indexOf(V);G>=0&&U.listeners.splice(G,1)}return(!V||U.listeners.length===0)&&(U.started&&U.subscriber.stop(),g(this,j).delete(U.tag)),this}async removeAllListeners(q){if(q){const{tag:V,started:U,subscriber:G}=await Q(this,Qe,m1).call(this,q);U&&G.stop(),g(this,j).delete(V)}else for(const[V,{started:U,subscriber:G}]of g(this,j))U&&G.stop(),g(this,j).delete(V);return this}async addListener(q,V){return await this.on(q,V)}async removeListener(q,V){return this.off(q,V)}get destroyed(){return g(this,W)}destroy(){this.removeAllListeners();for(const q of g(this,N).keys())this._clearTimeout(q);k(this,W,!0)}get paused(){return g(this,F)!=null}set paused(q){!!q!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(q){if(k(this,T,-1),g(this,F)!=null){if(g(this,F)==!!q)return;(0,i.assert)(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(V=>V.pause(q)),k(this,F,!!q);for(const V of g(this,N).values())V.timer&&clearTimeout(V.timer),V.time=x()-V.time}resume(){if(g(this,F)!=null){this._forEachSubscriber(q=>q.resume()),k(this,F,null);for(const q of g(this,N).values()){let V=q.time;V<0&&(V=0),q.time=x(),setTimeout(q.func,V)}}}}j=new WeakMap,z=new WeakMap,F=new WeakMap,W=new WeakMap,H=new WeakMap,L=new WeakMap,M=new WeakMap,T=new WeakMap,B=new WeakMap,N=new WeakMap,K=new WeakMap,te=new WeakMap,ne=new WeakSet,Qn=async function(q){const V=g(this,te).cacheTimeout;if(V<0)return await this._perform(q);const U=p(q.method,q);let G=g(this,M).get(U);return G||(G=this._perform(q),g(this,M).set(U,G),setTimeout(()=>{g(this,M).get(U)===G&&g(this,M).delete(U)},V)),await G},ie=new WeakSet,i5=async function(q,V,U){(0,i.assert)(U=0&&V==="latest"&&G.to!=null&&(0,i.dataSlice)(Y.data,0,4)==="0x556f1830"){const J=Y.data,ee=await(0,n.resolveAddress)(G.to,this);let ue;try{ue=I((0,i.dataSlice)(Y.data,4))}catch(Ue){(0,i.assert)(!1,Ue.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:G,info:{data:J}})}(0,i.assert)(ue.sender.toLowerCase()===ee.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:J,reason:"OffchainLookup",transaction:G,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:ue.errorArgs}});const _e=await this.ccipReadFetch(G,ue.calldata,ue.urls);(0,i.assert)(_e!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:G,info:{data:Y.data,errorArgs:ue.errorArgs}});const he={to:ee,data:(0,i.concat)([ue.selector,C([_e,ue.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:he});try{const Ue=await Q(this,ie,i5).call(this,he,V,U+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},he),result:Ue}),Ue}catch(Ue){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},he),error:Ue}),Ue}}throw Y}},xe=new WeakSet,a5=async function(q){const{value:V}=await(0,i.resolveProperties)({network:this.getNetwork(),value:q});return V},be=new WeakSet,vl=async function(q,V,U){let G=this._getAddress(V),Y=this._getBlockTag(U);return(typeof G!="string"||typeof Y!="string")&&([G,Y]=await Promise.all([G,Y])),await Q(this,xe,a5).call(this,Q(this,ne,Qn).call(this,Object.assign(q,{address:G,blockTag:Y})))},X=new WeakSet,o5=async function(q,V){if((0,i.isHexString)(q,32))return await Q(this,ne,Qn).call(this,{method:"getBlock",blockHash:q,includeTransactions:V});let U=this._getBlockTag(q);return typeof U!="string"&&(U=await U),await Q(this,ne,Qn).call(this,{method:"getBlock",blockTag:U,includeTransactions:V})},Oe=new WeakSet,Al=async function(q,V){let U=await m(q,this);return U.type==="event"&&V&&V.length>0&&V[0].removed===!0&&(U=await m({orphan:"drop-log",log:V[0]},this)),g(this,j).get(U.tag)||null},Qe=new WeakSet,m1=async function(q){const V=await m(q,this),U=V.tag;let G=g(this,j).get(U);return G||(G={subscriber:this._getSubscriber(V),tag:U,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},g(this,j).set(U,G)),G},E0.AbstractProvider=A;function S(ge,q){try{const V=D(ge,q);if(V)return(0,i.toUtf8String)(V)}catch{}return null}function D(ge,q){if(ge==="0x")return null;try{const V=(0,i.getNumber)((0,i.dataSlice)(ge,q,q+32)),U=(0,i.getNumber)((0,i.dataSlice)(ge,V,V+32));return(0,i.dataSlice)(ge,V+32,V+32+U)}catch{}return null}function O(ge){const q=(0,i.toBeArray)(ge);if(q.length>32)throw new Error("internal; should not happen");const V=new Uint8Array(32);return V.set(q,32-q.length),V}function _(ge){if(ge.length%32===0)return ge;const q=new Uint8Array(Math.ceil(ge.length/32)*32);return q.set(ge),q}const E=new Uint8Array([]);function C(ge){const q=[];let V=0;for(let U=0;U=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const V=(0,i.dataSlice)(ge,0,32);(0,i.assert)((0,i.dataSlice)(V,0,12)===(0,i.dataSlice)(P,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),q.sender=(0,i.dataSlice)(V,12);try{const U=[],G=(0,i.getNumber)((0,i.dataSlice)(ge,32,64)),Y=(0,i.getNumber)((0,i.dataSlice)(ge,G,G+32)),J=(0,i.dataSlice)(ge,G+32);for(let ee=0;eeq[U]),q}return E0}var _0={},P3;function Tb(){var u,x1;if(P3)return _0;P3=1,Object.defineProperty(_0,"__esModule",{value:!0}),_0.VoidSigner=_0.AbstractSigner=void 0;const n=Ot(),e=$n(),t=Ee(),r=Hf();function s(d,f){if(d.provider)return d.provider;(0,t.assert)(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:f})}async function i(d,f){let h=(0,r.copyRequest)(f);if(h.to!=null&&(h.to=(0,n.resolveAddress)(h.to,d)),h.from!=null){const p=h.from;h.from=Promise.all([d.getAddress(),(0,n.resolveAddress)(p,d)]).then(([b,v])=>((0,t.assertArgument)(b.toLowerCase()===v.toLowerCase(),"transaction from mismatch","tx.from",v),b))}else h.from=d.getAddress();return await(0,t.resolveProperties)(h)}class a{constructor(f){R(this,"provider");(0,t.defineProperties)(this,{provider:f||null})}async getNonce(f){return s(this,"getTransactionCount").getTransactionCount(await this.getAddress(),f)}async populateCall(f){return await i(this,f)}async populateTransaction(f){const h=s(this,"populateTransaction"),p=await i(this,f);p.nonce==null&&(p.nonce=await this.getNonce("pending")),p.gasLimit==null&&(p.gasLimit=await this.estimateGas(p));const b=await this.provider.getNetwork();if(p.chainId!=null){const w=(0,t.getBigInt)(p.chainId);(0,t.assertArgument)(w===b.chainId,"transaction chainId mismatch","tx.chainId",f.chainId)}else p.chainId=b.chainId;const v=p.maxFeePerGas!=null||p.maxPriorityFeePerGas!=null;if(p.gasPrice!=null&&(p.type===2||v)?(0,t.assertArgument)(!1,"eip-1559 transaction do not support gasPrice","tx",f):(p.type===0||p.type===1)&&v&&(0,t.assertArgument)(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",f),(p.type===2||p.type==null)&&p.maxFeePerGas!=null&&p.maxPriorityFeePerGas!=null)p.type=2;else if(p.type===0||p.type===1){const w=await h.getFeeData();(0,t.assert)(w.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),p.gasPrice==null&&(p.gasPrice=w.gasPrice)}else{const w=await h.getFeeData();if(p.type==null)if(w.maxFeePerGas!=null&&w.maxPriorityFeePerGas!=null)if(p.type=2,p.gasPrice!=null){const m=p.gasPrice;delete p.gasPrice,p.maxFeePerGas=m,p.maxPriorityFeePerGas=m}else p.maxFeePerGas==null&&(p.maxFeePerGas=w.maxFeePerGas),p.maxPriorityFeePerGas==null&&(p.maxPriorityFeePerGas=w.maxPriorityFeePerGas);else w.gasPrice!=null?((0,t.assert)(!v,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),p.gasPrice==null&&(p.gasPrice=w.gasPrice),p.type=0):(0,t.assert)(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else p.type===2&&(p.maxFeePerGas==null&&(p.maxFeePerGas=w.maxFeePerGas),p.maxPriorityFeePerGas==null&&(p.maxPriorityFeePerGas=w.maxPriorityFeePerGas))}return await(0,t.resolveProperties)(p)}async estimateGas(f){return s(this,"estimateGas").estimateGas(await this.populateCall(f))}async call(f){return s(this,"call").call(await this.populateCall(f))}async resolveName(f){return await s(this,"resolveName").resolveName(f)}async sendTransaction(f){const h=s(this,"sendTransaction"),p=await this.populateTransaction(f);delete p.from;const b=e.Transaction.from(p);return await h.broadcastTransaction(await this.signTransaction(b))}}_0.AbstractSigner=a;const l=class l extends a{constructor(h,p){super(p);$(this,u);R(this,"address");(0,t.defineProperties)(this,{address:h})}async getAddress(){return this.address}connect(h){return new l(this.address,h)}async signTransaction(h){Q(this,u,x1).call(this,"transactions","signTransaction")}async signMessage(h){Q(this,u,x1).call(this,"messages","signMessage")}async signTypedData(h,p,b){Q(this,u,x1).call(this,"typed-data","signTypedData")}};u=new WeakSet,x1=function(h,p){(0,t.assert)(!1,`VoidSigner cannot sign ${h}`,"UNSUPPORTED_OPERATION",{operation:p})};let o=l;return _0.VoidSigner=o,_0}var Bu={},k3;function Da(){if(k3)return Bu;k3=1,Object.defineProperty(Bu,"__esModule",{value:!0}),Bu.showThrottleMessage=void 0;const n=new Set;function e(t){n.has(t)||(n.add(t),console.log("========= NOTICE ========="),console.log(`Request-Rate Exceeded for ${t} (this message will not be repeated)`),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.org/api-keys/"),console.log("=========================="))}return Bu.showThrottleMessage=e,Bu}var Fu={},Uu={},mr={},gs={},C3;function jI(){var a,o,u,c,l,d,f,c5,p,u5,v;if(C3)return gs;C3=1,Object.defineProperty(gs,"__esModule",{value:!0}),gs.FilterIdPendingSubscriber=gs.FilterIdEventSubscriber=gs.FilterIdSubscriber=void 0;const n=Ee(),e=Rb();function t(w){return JSON.parse(JSON.stringify(w))}class r{constructor(m){$(this,f);$(this,p);$(this,a,void 0);$(this,o,void 0);$(this,u,void 0);$(this,c,void 0);$(this,l,void 0);$(this,d,void 0);k(this,a,m),k(this,o,null),k(this,u,Q(this,f,c5).bind(this)),k(this,c,!1),k(this,l,null),k(this,d,!1)}_subscribe(m){throw new Error("subclasses must override this")}_emitResults(m,x){throw new Error("subclasses must override this")}_recover(m){throw new Error("subclasses must override this")}start(){g(this,c)||(k(this,c,!0),Q(this,f,c5).call(this,-2))}stop(){g(this,c)&&(k(this,c,!1),k(this,d,!0),Q(this,p,u5).call(this),g(this,a).off("block",g(this,u)))}pause(m){m&&Q(this,p,u5).call(this),g(this,a).off("block",g(this,u))}resume(){this.start()}}a=new WeakMap,o=new WeakMap,u=new WeakMap,c=new WeakMap,l=new WeakMap,d=new WeakMap,f=new WeakSet,c5=async function(m){try{g(this,o)==null&&k(this,o,this._subscribe(g(this,a)));let x=null;try{x=await g(this,o)}catch(S){if(!(0,n.isError)(S,"UNSUPPORTED_OPERATION")||S.operation!=="eth_newFilter")throw S}if(x==null){k(this,o,null),g(this,a)._recoverSubscriber(this,this._recover(g(this,a)));return}const y=await g(this,a).getNetwork();if(g(this,l)||k(this,l,y),g(this,l).chainId!==y.chainId)throw new Error("chaid changed");if(g(this,d))return;const A=await g(this,a).send("eth_getFilterChanges",[x]);await this._emitResults(g(this,a),A)}catch(x){console.log("@TODO",x)}g(this,a).once("block",g(this,u))},p=new WeakSet,u5=function(){const m=g(this,o);m&&(k(this,o,null),m.then(x=>{g(this,a).send("eth_uninstallFilter",[x])}))},gs.FilterIdSubscriber=r;class s extends r{constructor(x,y){super(x);$(this,v,void 0);k(this,v,t(y))}_recover(x){return new e.PollingEventSubscriber(x,g(this,v))}async _subscribe(x){return await x.send("eth_newFilter",[g(this,v)])}async _emitResults(x,y){for(const A of y)x.emit(g(this,v),x._wrapLog(A,x._network))}}v=new WeakMap,gs.FilterIdEventSubscriber=s;class i extends r{async _subscribe(m){return await m.send("eth_newPendingTransactionFilter",[])}async _emitResults(m,x){for(const y of x)m.emit("pending",y)}}return gs.FilterIdPendingSubscriber=i,gs}var S3;function us(){var D,O,_,E,C,P,I,l5,z,F;if(S3)return mr;S3=1,Object.defineProperty(mr,"__esModule",{value:!0}),mr.JsonRpcProvider=mr.JsonRpcApiPollingProvider=mr.JsonRpcApiProvider=mr.JsonRpcSigner=void 0;const n=$f(),e=Ot(),t=oi(),r=$n(),s=Ee(),i=Gf(),a=Tb(),o=dr(),u=jI(),c=Rb(),l="bigint,boolean,function,number,string,symbol".split(/,/g);function d(W){if(W==null||l.indexOf(typeof W)>=0||typeof W.getAddress=="function")return W;if(Array.isArray(W))return W.map(d);if(typeof W=="object")return Object.keys(W).reduce((H,L)=>(H[L]=W[L],H),{});throw new Error(`should not happen: ${W} (${typeof W})`)}function f(W){return new Promise(H=>{setTimeout(H,W)})}function h(W){return W&&W.toLowerCase()}function p(W){return W&&typeof W.pollingInterval=="number"}const b={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class v extends a.AbstractSigner{constructor(L,M){super(L);R(this,"address");M=(0,e.getAddress)(M),(0,s.defineProperties)(this,{address:M})}connect(L){(0,s.assert)(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(L){return await this.populateCall(L)}async sendUncheckedTransaction(L){const M=d(L),T=[];if(M.from){const N=M.from;T.push((async()=>{const K=await(0,e.resolveAddress)(N,this.provider);(0,s.assertArgument)(K!=null&&K.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",L),M.from=K})())}else M.from=this.address;if(M.gasLimit==null&&T.push((async()=>{M.gasLimit=await this.provider.estimateGas({...M,from:this.address})})()),M.to!=null){const N=M.to;T.push((async()=>{M.to=await(0,e.resolveAddress)(N,this.provider)})())}T.length&&await Promise.all(T);const B=this.provider.getRpcTransaction(M);return this.provider.send("eth_sendTransaction",[B])}async sendTransaction(L){const M=await this.provider.getBlockNumber(),T=await this.sendUncheckedTransaction(L);return await new Promise((B,N)=>{const K=[1e3,100],te=async()=>{const ne=await this.provider.getTransaction(T);if(ne!=null){B(ne.replaceableTransaction(M));return}this.provider._setTimeout(()=>{te()},K.pop()||4e3)};te()})}async signTransaction(L){const M=d(L);if(M.from){const B=await(0,e.resolveAddress)(M.from,this.provider);(0,s.assertArgument)(B!=null&&B.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",L),M.from=B}else M.from=this.address;const T=this.provider.getRpcTransaction(M);return await this.provider.send("eth_signTransaction",[T])}async signMessage(L){const M=typeof L=="string"?(0,s.toUtf8Bytes)(L):L;return await this.provider.send("personal_sign",[(0,s.hexlify)(M),this.address.toLowerCase()])}async signTypedData(L,M,T){const B=d(T),N=await t.TypedDataEncoder.resolveNames(L,M,B,async K=>{const te=await(0,e.resolveAddress)(K);return(0,s.assertArgument)(te!=null,"TypedData does not support null address","value",K),te});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(t.TypedDataEncoder.getPayload(N.domain,M,N.value))])}async unlock(L){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),L,null])}async _legacySignMessage(L){const M=typeof L=="string"?(0,s.toUtf8Bytes)(L):L;return await this.provider.send("eth_sign",[this.address.toLowerCase(),(0,s.hexlify)(M)])}}mr.JsonRpcSigner=v;class w extends i.AbstractProvider{constructor(L,M){super(L,M);$(this,I);$(this,D,void 0);$(this,O,void 0);$(this,_,void 0);$(this,E,void 0);$(this,C,void 0);$(this,P,void 0);k(this,O,1),k(this,D,Object.assign({},b,M||{})),k(this,_,[]),k(this,E,null),k(this,P,null);{let B=null;const N=new Promise(K=>{B=K});k(this,C,{promise:N,resolve:B})}const T=this._getOption("staticNetwork");T&&((0,s.assertArgument)(L==null||T.matches(L),"staticNetwork MUST match network object","options",M),k(this,P,T))}_getOption(L){return g(this,D)[L]}get _network(){return(0,s.assert)(g(this,P),"network is not available yet","NETWORK_ERROR"),g(this,P)}async _perform(L){if(L.method==="call"||L.method==="estimateGas"){let T=L.transaction;if(T&&T.type!=null&&(0,s.getBigInt)(T.type)&&T.maxFeePerGas==null&&T.maxPriorityFeePerGas==null){const B=await this.getFeeData();B.maxFeePerGas==null&&B.maxPriorityFeePerGas==null&&(L=Object.assign({},L,{transaction:Object.assign({},T,{type:void 0})}))}}const M=this.getRpcRequest(L);return M!=null?await this.send(M.method,M.args):super._perform(L)}async _detectNetwork(){const L=this._getOption("staticNetwork");if(L)return L;if(this.ready)return o.Network.from((0,s.getBigInt)(await this.send("eth_chainId",[])));const M={id:hr(this,O)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:M});let T;try{T=(await this._send(M))[0]}catch(B){throw this.emit("debug",{action:"receiveRpcError",error:B}),B}if(this.emit("debug",{action:"receiveRpcResult",result:T}),"result"in T)return o.Network.from((0,s.getBigInt)(T.result));throw this.getRpcError(M,T)}_start(){g(this,C)==null||g(this,C).resolve==null||(g(this,C).resolve(),k(this,C,null),(async()=>{for(;g(this,P)==null&&!this.destroyed;)try{k(this,P,await this._detectNetwork())}catch(L){console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",(0,s.makeError)("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:L}})),await f(1e3)}Q(this,I,l5).call(this)})())}async _waitUntilReady(){if(g(this,C)!=null)return await g(this,C).promise}_getSubscriber(L){return L.type==="pending"?new u.FilterIdPendingSubscriber(this):L.type==="event"?this._getOption("polling")?new c.PollingEventSubscriber(this,L.filter):new u.FilterIdEventSubscriber(this,L.filter):L.type==="orphan"&&L.filter.orphan==="drop-log"?new i.UnmanagedSubscriber("orphan"):super._getSubscriber(L)}get ready(){return g(this,C)==null}getRpcTransaction(L){const M={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(T=>{if(L[T]==null)return;let B=T;T==="gasLimit"&&(B="gas"),M[B]=(0,s.toQuantity)((0,s.getBigInt)(L[T],`tx.${T}`))}),["from","to","data"].forEach(T=>{L[T]!=null&&(M[T]=(0,s.hexlify)(L[T]))}),L.accessList&&(M.accessList=(0,r.accessListify)(L.accessList)),M}getRpcRequest(L){switch(L.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getBalance":return{method:"eth_getBalance",args:[h(L.address),L.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[h(L.address),L.blockTag]};case"getCode":return{method:"eth_getCode",args:[h(L.address),L.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[h(L.address),"0x"+L.position.toString(16),L.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[L.signedTransaction]};case"getBlock":if("blockTag"in L)return{method:"eth_getBlockByNumber",args:[L.blockTag,!!L.includeTransactions]};if("blockHash"in L)return{method:"eth_getBlockByHash",args:[L.blockHash,!!L.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[L.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[L.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(L.transaction),L.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(L.transaction)]};case"getLogs":return L.filter&&L.filter.address!=null&&(Array.isArray(L.filter.address)?L.filter.address=L.filter.address.map(h):L.filter.address=h(L.filter.address)),{method:"eth_getLogs",args:[L.filter]}}return null}getRpcError(L,M){const{method:T}=L,{error:B}=M;if(T==="eth_estimateGas"&&B.message){const te=B.message;if(!te.match(/revert/i)&&te.match(/insufficient funds/i))return(0,s.makeError)("insufficient funds","INSUFFICIENT_FUNDS",{transaction:L.params[0],info:{payload:L,error:B}})}if(T==="eth_call"||T==="eth_estimateGas"){const te=y(B),ne=n.AbiCoder.getBuiltinCallException(T==="eth_call"?"call":"estimateGas",L.params[0],te?te.data:null);return ne.info={error:B,payload:L},ne}const N=JSON.stringify(S(B));if(typeof B.message=="string"&&B.message.match(/user denied|ethers-user-denied/i)){const te={eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"};return(0,s.makeError)("user rejected action","ACTION_REJECTED",{action:te[T]||"unknown",reason:"rejected",info:{payload:L,error:B}})}if(T==="eth_sendRawTransaction"||T==="eth_sendTransaction"){const te=L.params[0];if(N.match(/insufficient funds|base fee exceeds gas limit/i))return(0,s.makeError)("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:te,info:{error:B}});if(N.match(/nonce/i)&&N.match(/too low/i))return(0,s.makeError)("nonce has already been used","NONCE_EXPIRED",{transaction:te,info:{error:B}});if(N.match(/replacement transaction/i)&&N.match(/underpriced/i))return(0,s.makeError)("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:te,info:{error:B}});if(N.match(/only replay-protected/i))return(0,s.makeError)("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:T,info:{transaction:te,info:{error:B}}})}let K=!!N.match(/the method .* does not exist/i);return K||B&&B.details&&B.details.startsWith("Unauthorized method:")&&(K=!0),K?(0,s.makeError)("unsupported operation","UNSUPPORTED_OPERATION",{operation:L.method,info:{error:B,payload:L}}):(0,s.makeError)("could not coalesce error","UNKNOWN_ERROR",{error:B,payload:L})}send(L,M){if(this.destroyed)return Promise.reject((0,s.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:L}));const T=hr(this,O)._++,B=new Promise((N,K)=>{g(this,_).push({resolve:N,reject:K,payload:{method:L,params:M,id:T,jsonrpc:"2.0"}})});return Q(this,I,l5).call(this),B}async getSigner(L){L==null&&(L=0);const M=this.send("eth_accounts",[]);if(typeof L=="number"){const B=await M;if(L>=B.length)throw new Error("no such account");return new v(this,B[L])}const{accounts:T}=await(0,s.resolveProperties)({network:this.getNetwork(),accounts:M});L=(0,e.getAddress)(L);for(const B of T)if((0,e.getAddress)(B)===L)return new v(this,L);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(M=>new v(this,M))}destroy(){g(this,E)&&(clearTimeout(g(this,E)),k(this,E,null));for(const{payload:L,reject:M}of g(this,_))M((0,s.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:L.method}));k(this,_,[]),super.destroy()}}D=new WeakMap,O=new WeakMap,_=new WeakMap,E=new WeakMap,C=new WeakMap,P=new WeakMap,I=new WeakSet,l5=function(){if(g(this,E))return;const L=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");k(this,E,setTimeout(()=>{k(this,E,null);const M=g(this,_);for(k(this,_,[]);M.length;){const T=[M.shift()];for(;M.length&&T.length!==g(this,D).batchMaxCount;)if(T.push(M.shift()),JSON.stringify(T.map(N=>N.payload)).length>g(this,D).batchMaxSize){M.unshift(T.pop());break}(async()=>{const B=T.length===1?T[0].payload:T.map(N=>N.payload);this.emit("debug",{action:"sendRpcPayload",payload:B});try{const N=await this._send(B);this.emit("debug",{action:"receiveRpcResult",result:N});for(const{resolve:K,reject:te,payload:ne}of T){if(this.destroyed){te((0,s.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:ne.method}));continue}const le=N.filter(ie=>ie.id===ne.id)[0];if(le==null){const ie=(0,s.makeError)("missing response for request","BAD_DATA",{value:N,info:{payload:ne}});this.emit("error",ie),te(ie);continue}if("error"in le){te(this.getRpcError(ne,le));continue}K(le.result)}}catch(N){this.emit("debug",{action:"receiveRpcError",error:N});for(const{reject:K}of T)K(N)}})()}},L))},mr.JsonRpcApiProvider=w;class m extends w{constructor(L,M){super(L,M);$(this,z,void 0);k(this,z,4e3)}_getSubscriber(L){const M=super._getSubscriber(L);return p(M)&&(M.pollingInterval=g(this,z)),M}get pollingInterval(){return g(this,z)}set pollingInterval(L){if(!Number.isInteger(L)||L<0)throw new Error("invalid interval");k(this,z,L),this._forEachSubscriber(M=>{p(M)&&(M.pollingInterval=g(this,z))})}}z=new WeakMap,mr.JsonRpcApiPollingProvider=m;class x extends m{constructor(L,M,T){L==null&&(L="http://localhost:8545");super(M,T);$(this,F,void 0);typeof L=="string"?k(this,F,new s.FetchRequest(L)):k(this,F,L.clone())}_getConnection(){return g(this,F).clone()}async send(L,M){return await this._start(),await super.send(L,M)}async _send(L){const M=this._getConnection();M.body=JSON.stringify(L),M.setHeader("content-type","application/json");const T=await M.send();T.assertOk();let B=T.bodyJson;return Array.isArray(B)||(B=[B]),B}}F=new WeakMap,mr.JsonRpcProvider=x;function y(W){if(W==null)return null;if(typeof W.message=="string"&&W.message.match(/revert/i)&&(0,s.isHexString)(W.data))return{message:W.message,data:W.data};if(typeof W=="object"){for(const H in W){const L=y(W[H]);if(L)return L}return null}if(typeof W=="string")try{return y(JSON.parse(W))}catch{}return null}function A(W,H){if(W!=null){if(typeof W.message=="string"&&H.push(W.message),typeof W=="object")for(const L in W)A(W[L],H);if(typeof W=="string")try{return A(JSON.parse(W),H)}catch{}}}function S(W){const H=[];return A(W,H),H}return mr}var R3;function bA(){if(R3)return Uu;R3=1,Object.defineProperty(Uu,"__esModule",{value:!0}),Uu.AnkrProvider=void 0;const n=Ee(),e=Da(),t=dr(),r=us(),s="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function i(o){switch(o){case"mainnet":return"rpc.ankr.com/eth";case"goerli":return"rpc.ankr.com/eth_goerli";case"matic":return"rpc.ankr.com/polygon";case"arbitrum":return"rpc.ankr.com/arbitrum"}(0,n.assertArgument)(!1,"unsupported network","network",o)}class a extends r.JsonRpcProvider{constructor(c,l){c==null&&(c="mainnet");const d=t.Network.from(c);l==null&&(l=s);const f={polling:!0,staticNetwork:d},h=a.getRequest(d,l);super(h,d,f);R(this,"apiKey");(0,n.defineProperties)(this,{apiKey:l})}_getProvider(c){try{return new a(c,this.apiKey)}catch{}return super._getProvider(c)}static getRequest(c,l){l==null&&(l=s);const d=new n.FetchRequest(`https://${i(c.name)}/${l}`);return d.allowGzip=!0,l===s&&(d.retryFunc=async(f,h,p)=>((0,e.showThrottleMessage)("AnkrProvider"),!0)),d}getRpcError(c,l){return c.method==="eth_sendRawTransaction"&&l&&l.error&&l.error.message==="INTERNAL_ERROR: could not replace existing tx"&&(l.error.message="replacement transaction underpriced"),super.getRpcError(c,l)}isCommunityResource(){return this.apiKey===s}}return Uu.AnkrProvider=a,Uu}var Lu={},T3;function gA(){if(T3)return Lu;T3=1,Object.defineProperty(Lu,"__esModule",{value:!0}),Lu.AlchemyProvider=void 0;const n=Ee(),e=Da(),t=dr(),r=us(),s="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";function i(o){switch(o){case"mainnet":return"eth-mainnet.alchemyapi.io";case"goerli":return"eth-goerli.g.alchemy.com";case"sepolia":return"eth-sepolia.g.alchemy.com";case"arbitrum":return"arb-mainnet.g.alchemy.com";case"arbitrum-goerli":return"arb-goerli.g.alchemy.com";case"matic":return"polygon-mainnet.g.alchemy.com";case"matic-mumbai":return"polygon-mumbai.g.alchemy.com";case"optimism":return"opt-mainnet.g.alchemy.com";case"optimism-goerli":return"opt-goerli.g.alchemy.com"}(0,n.assertArgument)(!1,"unsupported network","network",o)}class a extends r.JsonRpcProvider{constructor(c,l){c==null&&(c="mainnet");const d=t.Network.from(c);l==null&&(l=s);const f=a.getRequest(d,l);super(f,d,{staticNetwork:d});R(this,"apiKey");(0,n.defineProperties)(this,{apiKey:l})}_getProvider(c){try{return new a(c,this.apiKey)}catch{}return super._getProvider(c)}async _perform(c){if(c.method==="getTransactionResult"){const{trace:l,tx:d}=await(0,n.resolveProperties)({trace:this.send("trace_transaction",[c.hash]),tx:this.getTransaction(c.hash)});if(l==null||d==null)return null;let f,h=!1;try{f=l[0].result.output,h=l[0].error==="Reverted"}catch{}if(f)return(0,n.assert)(!h,"an error occurred during transaction executions","CALL_EXCEPTION",{action:"getTransactionResult",data:f,reason:null,transaction:d,invocation:null,revert:null}),f;(0,n.assert)(!1,"could not parse trace result","BAD_DATA",{value:l})}return await super._perform(c)}isCommunityResource(){return this.apiKey===s}static getRequest(c,l){l==null&&(l=s);const d=new n.FetchRequest(`https://${i(c.name)}/v2/${l}`);return d.allowGzip=!0,l===s&&(d.retryFunc=async(f,h,p)=>((0,e.showThrottleMessage)("alchemy"),!0)),d}}return Lu.AlchemyProvider=a,Lu}var Du={},O3;function yA(){if(O3)return Du;O3=1,Object.defineProperty(Du,"__esModule",{value:!0}),Du.CloudflareProvider=void 0;const n=Ee(),e=dr(),t=us();class r extends t.JsonRpcProvider{constructor(i){i==null&&(i="mainnet");const a=e.Network.from(i);(0,n.assertArgument)(a.name==="mainnet","unsupported network","network",i),super("https://cloudflare-eth.com/",a,{staticNetwork:a})}}return Du.CloudflareProvider=r,Du}var P0={},N3;function mA(){var b;if(N3)return P0;N3=1,Object.defineProperty(P0,"__esModule",{value:!0}),P0.EtherscanProvider=P0.EtherscanPlugin=void 0;const n=$f(),e=Mh(),t=$n(),r=Ee(),s=Gf(),i=dr(),a=Sb(),o=Da(),u=2e3;function c(v){return v&&typeof v.then=="function"}const l="org.ethers.plugins.provider.Etherscan";class d extends a.NetworkPlugin{constructor(m){super(l);R(this,"baseUrl");(0,r.defineProperties)(this,{baseUrl:m})}clone(){return new d(this.baseUrl)}}P0.EtherscanPlugin=d;const f=["enableCcipRead"];let h=1;class p extends s.AbstractProvider{constructor(m,x){const y=x??null;super();R(this,"network");R(this,"apiKey");$(this,b,void 0);const A=i.Network.from(m);k(this,b,A.getPlugin(l)),(0,r.defineProperties)(this,{apiKey:y,network:A}),this.getBaseUrl()}getBaseUrl(){if(g(this,b))return g(this,b).baseUrl;switch(this.network.name){case"mainnet":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"matic":return"https://api.polygonscan.com";case"matic-mumbai":return"https://api-testnet.polygonscan.com";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io";case"bnb":return"http://api.bscscan.com";case"bnbt":return"http://api-testnet.bscscan.com"}(0,r.assertArgument)(!1,"unsupported network","network",this.network)}getUrl(m,x){const y=Object.keys(x).reduce((S,D)=>{const O=x[D];return O!=null&&(S+=`&${D}=${O}`),S},""),A=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.getBaseUrl()}/api?module=${m}${y}${A}`}getPostUrl(){return`${this.getBaseUrl()}/api`}getPostData(m,x){return x.module=m,x.apikey=this.apiKey,x}async detectNetwork(){return this.network}async fetch(m,x,y){const A=h++,S=y?this.getPostUrl():this.getUrl(m,x),D=y?this.getPostData(m,x):null;this.emit("debug",{action:"sendRequest",id:A,url:S,payload:D});const O=new r.FetchRequest(S);O.setThrottleParams({slotInterval:1e3}),O.retryFunc=(C,P,I)=>(this.isCommunityResource()&&(0,o.showThrottleMessage)("Etherscan"),Promise.resolve(!0)),O.processFunc=async(C,P)=>{const I=P.hasBody()?JSON.parse((0,r.toUtf8String)(P.body)):{},j=(typeof I.result=="string"?I.result:"").toLowerCase().indexOf("rate limit")>=0;return m==="proxy"?I&&I.status==0&&I.message=="NOTOK"&&j&&(this.emit("debug",{action:"receiveError",id:A,reason:"proxy-NOTOK",error:I}),P.throwThrottleError(I.result,u)):j&&(this.emit("debug",{action:"receiveError",id:A,reason:"null result",error:I.result}),P.throwThrottleError(I.result,u)),P},D&&(O.setHeader("content-type","application/x-www-form-urlencoded; charset=UTF-8"),O.body=Object.keys(D).map(C=>`${C}=${D[C]}`).join("&"));const _=await O.send();try{_.assertOk()}catch(C){this.emit("debug",{action:"receiveError",id:A,error:C,reason:"assertOk"}),(0,r.assert)(!1,"response error","SERVER_ERROR",{request:O,response:_})}_.hasBody()||(this.emit("debug",{action:"receiveError",id:A,error:"missing body",reason:"null body"}),(0,r.assert)(!1,"missing response","SERVER_ERROR",{request:O,response:_}));const E=JSON.parse((0,r.toUtf8String)(_.body));return m==="proxy"?(E.jsonrpc!="2.0"&&(this.emit("debug",{action:"receiveError",id:A,result:E,reason:"invalid JSON-RPC"}),(0,r.assert)(!1,"invalid JSON-RPC response (missing jsonrpc='2.0')","SERVER_ERROR",{request:O,response:_,info:{result:E}})),E.error&&(this.emit("debug",{action:"receiveError",id:A,result:E,reason:"JSON-RPC error"}),(0,r.assert)(!1,"error response","SERVER_ERROR",{request:O,response:_,info:{result:E}})),this.emit("debug",{action:"receiveRequest",id:A,result:E}),E.result):E.status==0&&(E.message==="No records found"||E.message==="No transactions found")?(this.emit("debug",{action:"receiveRequest",id:A,result:E}),E.result):((E.status!=1||typeof E.message=="string"&&!E.message.match(/^OK/))&&(this.emit("debug",{action:"receiveError",id:A,result:E}),(0,r.assert)(!1,"error response","SERVER_ERROR",{request:O,response:_,info:{result:E}})),this.emit("debug",{action:"receiveRequest",id:A,result:E}),E.result)}_getTransactionPostData(m){const x={};for(let y in m){if(f.indexOf(y)>=0||m[y]==null)continue;let A=m[y];y==="type"&&A===0||({type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[y]?A=(0,r.toQuantity)(A):y==="accessList"?A="["+(0,t.accessListify)(A).map(S=>`{address:"${S.address}",storageKeys:["${S.storageKeys.join('","')}"]}`).join(",")+"]":A=(0,r.hexlify)(A),x[y]=A)}return x}_checkError(m,x,y){let A="";if((0,r.isError)(x,"SERVER_ERROR")){try{A=x.info.result.error.message}catch{}if(!A)try{A=x.info.message}catch{}}if(m.method==="estimateGas"&&!A.match(/revert/i)&&A.match(/insufficient funds/i)&&(0,r.assert)(!1,"insufficient funds","INSUFFICIENT_FUNDS",{transaction:m.transaction}),(m.method==="call"||m.method==="estimateGas")&&A.match(/execution reverted/i)){let S="";try{S=x.info.result.error.data}catch{}const D=n.AbiCoder.getBuiltinCallException(m.method,m.transaction,S);throw D.info={request:m,error:x},D}if(A&&m.method==="broadcastTransaction"){const S=t.Transaction.from(m.signedTransaction);A.match(/replacement/i)&&A.match(/underpriced/i)&&(0,r.assert)(!1,"replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:S}),A.match(/insufficient funds/)&&(0,r.assert)(!1,"insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:S}),A.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&(0,r.assert)(!1,"nonce has already been used","NONCE_EXPIRED",{transaction:S})}throw x}async _detectNetwork(){return this.network}async _perform(m){switch(m.method){case"chainId":return this.network.chainId;case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getBalance":return this.fetch("account",{action:"balance",address:m.address,tag:m.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:m.address,tag:m.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:m.address,tag:m.blockTag});case"getStorage":return this.fetch("proxy",{action:"eth_getStorageAt",address:m.address,position:m.position,tag:m.blockTag});case"broadcastTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:m.signedTransaction},!0).catch(x=>this._checkError(m,x,m.signedTransaction));case"getBlock":if("blockTag"in m)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:m.blockTag,boolean:m.includeTransactions?"true":"false"});(0,r.assert)(!1,"getBlock by blockHash not supported by Etherscan","UNSUPPORTED_OPERATION",{operation:"getBlock(blockHash)"});case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:m.hash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:m.hash});case"call":{if(m.blockTag!=="latest")throw new Error("EtherscanProvider does not support blockTag for call");const x=this._getTransactionPostData(m.transaction);x.module="proxy",x.action="eth_call";try{return await this.fetch("proxy",x,!0)}catch(y){return this._checkError(m,y,m.transaction)}}case"estimateGas":{const x=this._getTransactionPostData(m.transaction);x.module="proxy",x.action="eth_estimateGas";try{return await this.fetch("proxy",x,!0)}catch(y){return this._checkError(m,y,m.transaction)}}}return super._perform(m)}async getNetwork(){return this.network}async getEtherPrice(){return this.network.name!=="mainnet"?0:parseFloat((await this.fetch("stats",{action:"ethprice"})).ethusd)}async getContract(m){let x=this._getAddress(m);c(x)&&(x=await x);try{const y=await this.fetch("contract",{action:"getabi",address:x}),A=JSON.parse(y);return new e.Contract(x,A,this)}catch{return null}}isCommunityResource(){return this.apiKey==null}}return b=new WeakMap,P0.EtherscanProvider=p,P0}var k0={},Mu={},ju={},I3;function $I(){if(I3)return ju;I3=1,Object.defineProperty(ju,"__esModule",{value:!0}),ju.WebSocket=void 0;function n(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof oe<"u")return oe;throw new Error("unable to locate global object")}const e=n().WebSocket;return ju.WebSocket=e,ju}var Rn={},B3;function f5(){var u,c,l,d,f,h,p,b,v;if(B3)return Rn;B3=1,Object.defineProperty(Rn,"__esModule",{value:!0}),Rn.SocketProvider=Rn.SocketEventSubscriber=Rn.SocketPendingSubscriber=Rn.SocketBlockSubscriber=Rn.SocketSubscriber=void 0;const n=Gf(),e=Ee(),t=us();class r{constructor(m,x){$(this,u,void 0);$(this,c,void 0);$(this,l,void 0);$(this,d,void 0);$(this,f,void 0);k(this,u,m),k(this,c,JSON.stringify(x)),k(this,l,null),k(this,d,null),k(this,f,null)}get filter(){return JSON.parse(g(this,c))}start(){k(this,l,g(this,u).send("eth_subscribe",this.filter).then(m=>(g(this,u)._register(m,this),m)))}stop(){g(this,l).then(m=>{g(this,u).send("eth_unsubscribe",[m])}),k(this,l,null)}pause(m){(0,e.assert)(m,"preserve logs while paused not supported by SocketSubscriber yet","UNSUPPORTED_OPERATION",{operation:"pause(false)"}),k(this,d,!!m)}resume(){k(this,d,null)}_handleMessage(m){if(g(this,l)!=null&&g(this,d)===null){let x=g(this,f);x==null?x=this._emit(g(this,u),m):x=x.then(async()=>{await this._emit(g(this,u),m)}),k(this,f,x.then(()=>{g(this,f)===x&&k(this,f,null)}))}}async _emit(m,x){throw new Error("sub-classes must implemente this; _emit")}}u=new WeakMap,c=new WeakMap,l=new WeakMap,d=new WeakMap,f=new WeakMap,Rn.SocketSubscriber=r;class s extends r{constructor(m){super(m,["newHeads"])}async _emit(m,x){m.emit("block",parseInt(x.number))}}Rn.SocketBlockSubscriber=s;class i extends r{constructor(m){super(m,["newPendingTransactions"])}async _emit(m,x){m.emit("pending",x)}}Rn.SocketPendingSubscriber=i;class a extends r{constructor(x,y){super(x,["logs",y]);$(this,h,void 0);k(this,h,JSON.stringify(y))}get logFilter(){return JSON.parse(g(this,h))}async _emit(x,y){x.emit(this.logFilter,x._wrapLog(y,x._network))}}h=new WeakMap,Rn.SocketEventSubscriber=a;class o extends t.JsonRpcApiProvider{constructor(x){super(x,{batchMaxCount:1});$(this,p,void 0);$(this,b,void 0);$(this,v,void 0);k(this,p,new Map),k(this,b,new Map),k(this,v,new Map)}_getSubscriber(x){switch(x.type){case"close":return new n.UnmanagedSubscriber("close");case"block":return new s(this);case"pending":return new i(this);case"event":return new a(this,x.filter);case"orphan":if(x.filter.orphan==="drop-log")return new n.UnmanagedSubscriber("drop-log")}return super._getSubscriber(x)}_register(x,y){g(this,b).set(x,y);const A=g(this,v).get(x);if(A){for(const S of A)y._handleMessage(S);g(this,v).delete(x)}}async _send(x){(0,e.assertArgument)(!Array.isArray(x),"WebSocket does not support batch send","payload",x);const y=new Promise((A,S)=>{g(this,p).set(x.id,{payload:x,resolve:A,reject:S})});return await this._waitUntilReady(),await this._write(JSON.stringify(x)),[await y]}async _processMessage(x){const y=JSON.parse(x);if(y&&typeof y=="object"&&"id"in y){const A=g(this,p).get(y.id);if(A==null){this.emit("error",(0,e.makeError)("received result for unknown id","UNKNOWN_ERROR",{reasonCode:"UNKNOWN_ID",result:y}));return}g(this,p).delete(y.id),A.resolve(y)}else if(y&&y.method==="eth_subscription"){const A=y.params.subscription,S=g(this,b).get(A);if(S)S._handleMessage(y.params.result);else{let D=g(this,v).get(A);D==null&&(D=[],g(this,v).set(A,D)),D.push(y.params.result)}}else{this.emit("error",(0,e.makeError)("received unexpected message","UNKNOWN_ERROR",{reasonCode:"UNEXPECTED_MESSAGE",result:y}));return}}async _write(x){throw new Error("sub-classes must override this")}}return p=new WeakMap,b=new WeakMap,v=new WeakMap,Rn.SocketProvider=o,Rn}var F3;function Ob(){var r,s;if(F3)return Mu;F3=1,Object.defineProperty(Mu,"__esModule",{value:!0}),Mu.WebSocketProvider=void 0;const n=$I(),e=f5();class t extends e.SocketProvider{constructor(o,u){super(u);$(this,r,void 0);$(this,s,void 0);typeof o=="string"?(k(this,r,()=>new n.WebSocket(o)),k(this,s,g(this,r).call(this))):typeof o=="function"?(k(this,r,o),k(this,s,o())):(k(this,r,null),k(this,s,o)),this.websocket.onopen=async()=>{try{await this._start(),this.resume()}catch(c){console.log("failed to start WebsocketProvider",c)}},this.websocket.onmessage=c=>{this._processMessage(c.data)}}get websocket(){if(g(this,s)==null)throw new Error("websocket closed");return g(this,s)}async _write(o){this.websocket.send(o)}async destroy(){g(this,s)!=null&&(g(this,s).close(),k(this,s,null)),super.destroy()}}return r=new WeakMap,s=new WeakMap,Mu.WebSocketProvider=t,Mu}var U3;function xA(){if(U3)return k0;U3=1,Object.defineProperty(k0,"__esModule",{value:!0}),k0.InfuraProvider=k0.InfuraWebSocketProvider=void 0;const n=Ee(),e=Da(),t=dr(),r=us(),s=Ob(),i="84842078b09946638c03157f83405213";function a(c){switch(c){case"mainnet":return"mainnet.infura.io";case"goerli":return"goerli.infura.io";case"sepolia":return"sepolia.infura.io";case"arbitrum":return"arbitrum-mainnet.infura.io";case"arbitrum-goerli":return"arbitrum-goerli.infura.io";case"linea":return"linea-mainnet.infura.io";case"linea-goerli":return"linea-goerli.infura.io";case"matic":return"polygon-mainnet.infura.io";case"matic-mumbai":return"polygon-mumbai.infura.io";case"optimism":return"optimism-mainnet.infura.io";case"optimism-goerli":return"optimism-goerli.infura.io"}(0,n.assertArgument)(!1,"unsupported network","network",c)}class o extends s.WebSocketProvider{constructor(d,f){const h=new u(d,f),p=h._getConnection();(0,n.assert)(!p.credentials,"INFURA WebSocket project secrets unsupported","UNSUPPORTED_OPERATION",{operation:"InfuraProvider.getWebSocketProvider()"});const b=p.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(b,d);R(this,"projectId");R(this,"projectSecret");(0,n.defineProperties)(this,{projectId:h.projectId,projectSecret:h.projectSecret})}isCommunityResource(){return this.projectId===i}}k0.InfuraWebSocketProvider=o;class u extends r.JsonRpcProvider{constructor(d,f,h){d==null&&(d="mainnet");const p=t.Network.from(d);f==null&&(f=i),h==null&&(h=null);const b=u.getRequest(p,f,h);super(b,p,{staticNetwork:p});R(this,"projectId");R(this,"projectSecret");(0,n.defineProperties)(this,{projectId:f,projectSecret:h})}_getProvider(d){try{return new u(d,this.projectId,this.projectSecret)}catch{}return super._getProvider(d)}isCommunityResource(){return this.projectId===i}static getWebSocketProvider(d,f){return new o(d,f)}static getRequest(d,f,h){f==null&&(f=i),h==null&&(h=null);const p=new n.FetchRequest(`https://${a(d.name)}/v3/${f}`);return p.allowGzip=!0,h&&p.setCredentials("",h),f===i&&(p.retryFunc=async(b,v,w)=>((0,e.showThrottleMessage)("InfuraProvider"),!0)),p}}return k0.InfuraProvider=u,k0}var $u={},L3;function wA(){if(L3)return $u;L3=1,Object.defineProperty($u,"__esModule",{value:!0}),$u.QuickNodeProvider=void 0;const n=Ee(),e=Da(),t=dr(),r=us(),s="919b412a057b5e9c9b6dce193c5a60242d6efadb";function i(o){switch(o){case"mainnet":return"ethers.quiknode.pro";case"goerli":return"ethers.ethereum-goerli.quiknode.pro";case"arbitrum":return"ethers.arbitrum-mainnet.quiknode.pro";case"arbitrum-goerli":return"ethers.arbitrum-goerli.quiknode.pro";case"matic":return"ethers.matic.quiknode.pro";case"matic-mumbai":return"ethers.matic-testnet.quiknode.pro";case"optimism":return"ethers.optimism.quiknode.pro";case"optimism-goerli":return"ethers.optimism-goerli.quiknode.pro"}(0,n.assertArgument)(!1,"unsupported network","network",o)}class a extends r.JsonRpcProvider{constructor(c,l){c==null&&(c="mainnet");const d=t.Network.from(c);l==null&&(l=s);const f=a.getRequest(d,l);super(f,d,{staticNetwork:d});R(this,"token");(0,n.defineProperties)(this,{token:l})}_getProvider(c){try{return new a(c,this.token)}catch{}return super._getProvider(c)}isCommunityResource(){return this.token===s}static getRequest(c,l){l==null&&(l=s);const d=new n.FetchRequest(`https://${i(c.name)}/${l}`);return d.allowGzip=!0,l===s&&(d.retryFunc=async(f,h,p)=>((0,e.showThrottleMessage)("QuickNodeProvider"),!0)),d}}return $u.QuickNodeProvider=a,$u}var Hu={},D3;function _A(){var x,y,A,S,vA,O,d5,E,AA,P,EA,j,h5;if(D3)return Hu;D3=1,Object.defineProperty(Hu,"__esModule",{value:!0}),Hu.FallbackProvider=void 0;const n=Ee(),e=Gf(),t=dr(),r=BigInt("1"),s=BigInt("2");function i(F){for(let W=F.length-1;W>0;W--){const H=Math.floor(Math.random()*(W+1)),L=F[W];F[W]=F[H],F[H]=L}}function a(F){return new Promise(W=>{setTimeout(W,F)})}function o(){return new Date().getTime()}function u(F){return JSON.stringify(F,(W,H)=>typeof H=="bigint"?{type:"bigint",value:H.toString()}:H)}const c={stallTimeout:400,priority:1,weight:1},l={blockNumber:-2,requests:0,lateResponses:0,errorResponses:0,outOfSync:-1,unsupportedEvents:0,rollingDuration:0,score:0,_network:null,_updateNumber:null,_totalTime:0,_lastFatalError:null,_lastFatalErrorTimestamp:0};async function d(F,W){for(;(F.blockNumber<0||F.blockNumber{try{const H=await F.provider.getBlockNumber();H>F.blockNumber&&(F.blockNumber=H)}catch(H){F.blockNumber=-2,F._lastFatalError=H,F._lastFatalErrorTimestamp=o()}F._updateNumber=null})()),await F._updateNumber,F.outOfSync++,!F._lastFatalError););}function f(F){if(F==null)return"null";if(Array.isArray(F))return"["+F.map(f).join(",")+"]";if(typeof F=="object"&&typeof F.toJSON=="function")return f(F.toJSON());switch(typeof F){case"boolean":case"symbol":return F.toString();case"bigint":case"number":return BigInt(F).toString();case"string":return JSON.stringify(F);case"object":{const W=Object.keys(F);return W.sort(),"{"+W.map(H=>`${JSON.stringify(H)}:${f(F[H])}`).join(",")+"}"}}throw console.log("Could not serialize",F),new Error("Hmm...")}function h(F){if("error"in F){const H=F.error;return{tag:f(H),value:H}}const W=F.result;return{tag:f(W),value:W}}function p(F,W){const H=new Map;for(const{value:M,tag:T,weight:B}of W){const N=H.get(T)||{value:M,weight:0};N.weight+=B,H.set(T,N)}let L=null;for(const M of H.values())M.weight>=F&&(!L||M.weight>L.weight)&&(L=M);if(L)return L.value}function b(F,W){let H=0;const L=new Map;let M=null;const T=[];for(const{value:N,tag:K,weight:te}of W)if(N instanceof Error){const ne=L.get(K)||{value:N,weight:0};ne.weight+=te,L.set(K,ne),(M==null||ne.weight>M.weight)&&(M=ne)}else T.push(BigInt(N)),H+=te;if(H=F?M.value:void 0;T.sort((N,K)=>NN?1:0);const B=Math.floor(T.length/2);return T.length%2?T[B]:(T[B-1]+T[B]+r)/s}function v(F,W){const H=p(F,W);if(H!==void 0)return H;for(const L of W)if(L.value)return L.value}function w(F,W){if(F===1)return(0,n.getNumber)(b(F,W),"%internal");const H=new Map,L=(B,N)=>{const K=H.get(B)||{result:B,weight:0};K.weight+=N,H.set(B,K)};for(const{weight:B,value:N}of W){const K=(0,n.getNumber)(N);L(K-1,B),L(K,B),L(K+1,B)}let M=0,T;for(const{weight:B,result:N}of H.values())B>=F&&(B>M||T!=null&&B===M&&N>T)&&(M=B,T=N);return T}class m extends e.AbstractProvider{constructor(H,L,M){super(L,M);$(this,S);$(this,O);$(this,E);$(this,P);$(this,j);R(this,"quorum");R(this,"eventQuorum");R(this,"eventWorkers");$(this,x,void 0);$(this,y,void 0);$(this,A,void 0);k(this,x,H.map(T=>T instanceof e.AbstractProvider?Object.assign({provider:T},c,l):Object.assign({},c,T,l))),k(this,y,-2),k(this,A,null),M&&M.quorum!=null?this.quorum=M.quorum:this.quorum=Math.ceil(g(this,x).reduce((T,B)=>(T+=B.weight,T),0)/2),this.eventQuorum=1,this.eventWorkers=1,(0,n.assertArgument)(this.quorum<=g(this,x).reduce((T,B)=>T+B.weight,0),"quorum exceed provider wieght","quorum",this.quorum)}get providerConfigs(){return g(this,x).map(H=>{const L=Object.assign({},H);for(const M in L)M[0]==="_"&&delete L[M];return L})}async _detectNetwork(){return t.Network.from((0,n.getBigInt)(await this._perform({method:"chainId"})))}async _translatePerform(H,L){switch(L.method){case"broadcastTransaction":return await H.broadcastTransaction(L.signedTransaction);case"call":return await H.call(Object.assign({},L.transaction,{blockTag:L.blockTag}));case"chainId":return(await H.getNetwork()).chainId;case"estimateGas":return await H.estimateGas(L.transaction);case"getBalance":return await H.getBalance(L.address,L.blockTag);case"getBlock":{const M="blockHash"in L?L.blockHash:L.blockTag;return await H.getBlock(M,L.includeTransactions)}case"getBlockNumber":return await H.getBlockNumber();case"getCode":return await H.getCode(L.address,L.blockTag);case"getGasPrice":return(await H.getFeeData()).gasPrice;case"getLogs":return await H.getLogs(L.filter);case"getStorage":return await H.getStorage(L.address,L.position,L.blockTag);case"getTransaction":return await H.getTransaction(L.hash);case"getTransactionCount":return await H.getTransactionCount(L.address,L.blockTag);case"getTransactionReceipt":return await H.getTransactionReceipt(L.hash);case"getTransactionResult":return await H.getTransactionResult(L.hash)}}async _perform(H){if(H.method==="broadcastTransaction"){const T=await Promise.all(g(this,x).map(async({provider:N,weight:K})=>{try{const te=await N._perform(H);return Object.assign(h({result:te}),{weight:K})}catch(te){return Object.assign(h({error:te}),{weight:K})}})),B=v(this.quorum,T);if((0,n.assert)(B!==void 0,"problem multi-broadcasting","SERVER_ERROR",{request:"%sub-requests",info:{request:H,results:T.map(u)}}),B instanceof Error)throw B;return B}await Q(this,E,AA).call(this);const L=new Set;for(let T=0;TT.config),M=g(this,x).slice();i(M),M.sort((T,B)=>T.priority-B.priority);for(const T of M)if(!T._lastFatalError&&L.indexOf(T)===-1)return T;return null},O=new WeakSet,d5=function(H,L){const M=Q(this,S,vA).call(this,H);if(M==null)return null;const T={config:M,result:null,didBump:!1,perform:null,staller:null},B=o();return T.perform=(async()=>{try{M.requests++;const K=await this._translatePerform(M.provider,L);T.result={result:K}}catch(K){M.errorResponses++,T.result={error:K}}const N=o()-B;M._totalTime+=N,M.rollingDuration=.95*M.rollingDuration+.05*N,T.perform=null})(),T.staller=(async()=>{await a(M.stallTimeout),T.staller=null})(),H.add(T),T},E=new WeakSet,AA=async function(){let H=g(this,A);if(!H){const L=[];g(this,x).forEach(M=>{L.push((async()=>{await d(M,0),M._lastFatalError||(M._network=await M.provider.getNetwork())})())}),k(this,A,H=(async()=>{await Promise.all(L);let M=null;for(const T of g(this,x)){if(T._lastFatalError)continue;const B=T._network;M==null?M=B.chainId:B.chainId!==M&&(0,n.assert)(!1,"cannot mix providers on different networks","UNSUPPORTED_OPERATION",{operation:"new FallbackProvider"})}})())}await H},P=new WeakSet,EA=async function(H,L){const M=[];for(const T of H)if(T.result!=null){const{tag:B,value:N}=h(T.result);M.push({tag:B,value:N,weight:T.config.weight})}if(!(M.reduce((T,B)=>T+B.weight,0)!B._lastFatalError).map(B=>({value:B.blockNumber,tag:(0,n.getNumber)(B.blockNumber).toString(),weight:B.weight}))))));const T=w(this.quorum,M);return T===void 0?void 0:(T>g(this,y)&&k(this,y,T),g(this,y))}case"getGasPrice":case"estimateGas":return b(this.quorum,M);case"getBlock":return"blockTag"in L&&L.blockTag==="pending"?v(this.quorum,M):p(this.quorum,M);case"call":case"chainId":case"getBalance":case"getTransactionCount":case"getCode":case"getStorage":case"getTransaction":case"getTransactionReceipt":case"getLogs":return p(this.quorum,M);case"broadcastTransaction":return v(this.quorum,M)}(0,n.assert)(!1,"unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${u(L.method)})`})}},j=new WeakSet,h5=async function(H,L){if(H.size===0)throw new Error("no runners?!");const M=[];let T=0;for(const N of H){if(N.perform&&M.push(N.perform),N.staller){M.push(N.staller);continue}N.didBump||(N.didBump=!0,T++)}const B=await Q(this,P,EA).call(this,H,L);if(B!==void 0){if(B instanceof Error)throw B;return B}for(let N=0;N0,"quorum not met","SERVER_ERROR",{request:"%sub-requests",info:{request:L,results:Array.from(H).map(N=>u(N.result))}}),await Promise.race(M),await Q(this,j,h5).call(this,H,L)},Hu.FallbackProvider=m,Hu}var M3;function HI(){if(M3)return Fu;M3=1,Object.defineProperty(Fu,"__esModule",{value:!0}),Fu.getDefaultProvider=void 0;const n=Ee(),e=bA(),t=gA(),r=yA(),s=mA(),i=xA(),a=wA(),o=_A(),u=us(),c=dr(),l=Ob();function d(p){return p&&typeof p.send=="function"&&typeof p.close=="function"}const f="goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" ");function h(p,b){b==null&&(b={});const v=y=>b[y]==="-"?!1:typeof b.exclusive=="string"?y===b.exclusive:Array.isArray(b.exclusive)?b.exclusive.indexOf(y)!==-1:!0;if(typeof p=="string"&&p.match(/^https?:/))return new u.JsonRpcProvider(p);if(typeof p=="string"&&p.match(/^wss?:/)||d(p))return new l.WebSocketProvider(p);let w=null;try{w=c.Network.from(p)}catch{}const m=[];if(v("publicPolygon")&&w&&w.name==="matic"&&m.push(new u.JsonRpcProvider("https://polygon-rpc.com/",w,{staticNetwork:w})),v("alchemy"))try{m.push(new t.AlchemyProvider(p,b.alchemy))}catch{}if(v("ankr")&&b.ankr!=null)try{m.push(new e.AnkrProvider(p,b.ankr))}catch{}if(v("cloudflare"))try{m.push(new r.CloudflareProvider(p))}catch{}if(v("etherscan"))try{m.push(new s.EtherscanProvider(p,b.etherscan))}catch{}if(v("infura"))try{let y=b.infura,A;typeof y=="object"&&(A=y.projectSecret,y=y.projectId),m.push(new i.InfuraProvider(p,y,A))}catch{}if(v("quicknode"))try{let y=b.quicknode;m.push(new a.QuickNodeProvider(p,y))}catch{}if((0,n.assert)(m.length,"unsupported default network","UNSUPPORTED_OPERATION",{operation:"getDefaultProvider"}),m.length===1)return m[0];let x=Math.floor(m.length/2);return x>2&&(x=2),w&&f.indexOf(w.name)!==-1&&(x=1),b&&b.quorum&&(x=b.quorum),new o.FallbackProvider(m,void 0,{quorum:x})}return Fu.getDefaultProvider=h,Fu}var Gu={},j3;function GI(){var r,s;if(j3)return Gu;j3=1,Object.defineProperty(Gu,"__esModule",{value:!0}),Gu.NonceManager=void 0;const n=Ee(),e=Tb(),i=class i extends e.AbstractSigner{constructor(u){super(u.provider);R(this,"signer");$(this,r,void 0);$(this,s,void 0);(0,n.defineProperties)(this,{signer:u}),k(this,r,null),k(this,s,0)}async getAddress(){return this.signer.getAddress()}connect(u){return new i(this.signer.connect(u))}async getNonce(u){if(u==="pending"){g(this,r)==null&&k(this,r,super.getNonce("pending"));const c=g(this,s);return await g(this,r)+c}return super.getNonce(u)}increment(){hr(this,s)._++}reset(){k(this,s,0),k(this,r,null)}async sendTransaction(u){const c=this.getNonce("pending");return this.increment(),u=await this.signer.populateTransaction(u),u.nonce=await c,await this.signer.sendTransaction(u)}signTransaction(u){return this.signer.signTransaction(u)}signMessage(u){return this.signer.signMessage(u)}signTypedData(u,c,l){return this.signer.signTypedData(u,c,l)}};r=new WeakMap,s=new WeakMap;let t=i;return Gu.NonceManager=t,Gu}var zu={},$3;function zI(){var r;if($3)return zu;$3=1,Object.defineProperty(zu,"__esModule",{value:!0}),zu.BrowserProvider=void 0;const n=Ee(),e=us();class t extends e.JsonRpcApiPollingProvider{constructor(a,o){super(o,{batchMaxCount:1});$(this,r,void 0);k(this,r,async(u,c)=>{const l={method:u,params:c};this.emit("debug",{action:"sendEip1193Request",payload:l});try{const d=await a.request(l);return this.emit("debug",{action:"receiveEip1193Result",result:d}),d}catch(d){const f=new Error(d.message);throw f.code=d.code,f.data=d.data,f.payload=l,this.emit("debug",{action:"receiveEip1193Error",error:f}),f}})}async send(a,o){return await this._start(),await super.send(a,o)}async _send(a){(0,n.assertArgument)(!Array.isArray(a),"EIP-1193 does not support batch request","payload",a);try{const o=await g(this,r).call(this,a.method,a.params||[]);return[{id:a.id,result:o}]}catch(o){return[{id:a.id,error:{code:o.code,data:o.data,message:o.message}}]}}getRpcError(a,o){switch(o=JSON.parse(JSON.stringify(o)),o.error.code||-1){case 4001:o.error.message=`ethers-user-denied: ${o.error.message}`;break;case 4200:o.error.message=`ethers-unsupported: ${o.error.message}`;break}return super.getRpcError(a,o)}async hasSigner(a){a==null&&(a=0);const o=await this.send("eth_accounts",[]);return typeof a=="number"?o.length>a:(a=a.toLowerCase(),o.filter(u=>u.toLowerCase()===a).length!==0)}async getSigner(a){if(a==null&&(a=0),!await this.hasSigner(a))try{await g(this,r).call(this,"eth_requestAccounts",[])}catch(o){const u=o.payload;throw this.getRpcError(u,{id:u.id,error:o})}return await super.getSigner(a)}}return r=new WeakMap,zu.BrowserProvider=t,zu}var Wu={},H3;function WI(){if(H3)return Wu;H3=1,Object.defineProperty(Wu,"__esModule",{value:!0}),Wu.PocketProvider=void 0;const n=Ee(),e=Da(),t=dr(),r=us(),s="62e1ad51b37b8e00394bda3b";function i(o){switch(o){case"mainnet":return"eth-mainnet.gateway.pokt.network";case"goerli":return"eth-goerli.gateway.pokt.network";case"matic":return"poly-mainnet.gateway.pokt.network";case"matic-mumbai":return"polygon-mumbai-rpc.gateway.pokt.network"}(0,n.assertArgument)(!1,"unsupported network","network",o)}class a extends r.JsonRpcProvider{constructor(c,l,d){c==null&&(c="mainnet");const f=t.Network.from(c);l==null&&(l=s),d==null&&(d=null);const h={staticNetwork:f},p=a.getRequest(f,l,d);super(p,f,h);R(this,"applicationId");R(this,"applicationSecret");(0,n.defineProperties)(this,{applicationId:l,applicationSecret:d})}_getProvider(c){try{return new a(c,this.applicationId,this.applicationSecret)}catch{}return super._getProvider(c)}static getRequest(c,l,d){l==null&&(l=s);const f=new n.FetchRequest(`https://${i(c.name)}/v1/lb/${l}`);return f.allowGzip=!0,d&&f.setCredentials("",d),l===s&&(f.retryFunc=async(h,p,b)=>((0,e.showThrottleMessage)("PocketProvider"),!0)),f}isCommunityResource(){return this.applicationId===s}}return Wu.PocketProvider=a,Wu}var Ku={},G3;function KI(){if(G3)return Ku;G3=1,Object.defineProperty(Ku,"__esModule",{value:!0}),Ku.IpcSocketProvider=void 0;const n=void 0;return Ku.IpcSocketProvider=n,Ku}var z3;function Nb(){return z3||(z3=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.SocketEventSubscriber=n.SocketPendingSubscriber=n.SocketBlockSubscriber=n.SocketSubscriber=n.WebSocketProvider=n.SocketProvider=n.IpcSocketProvider=n.QuickNodeProvider=n.PocketProvider=n.InfuraWebSocketProvider=n.InfuraProvider=n.EtherscanPlugin=n.EtherscanProvider=n.CloudflareProvider=n.AnkrProvider=n.AlchemyProvider=n.BrowserProvider=n.JsonRpcSigner=n.JsonRpcProvider=n.JsonRpcApiProvider=n.FallbackProvider=n.copyRequest=n.TransactionResponse=n.TransactionReceipt=n.Log=n.FeeData=n.Block=n.FetchUrlFeeDataNetworkPlugin=n.FeeDataNetworkPlugin=n.EnsPlugin=n.GasCostPlugin=n.NetworkPlugin=n.NonceManager=n.Network=n.MulticoinProviderPlugin=n.EnsResolver=n.getDefaultProvider=n.showThrottleMessage=n.VoidSigner=n.AbstractSigner=n.UnmanagedSubscriber=n.AbstractProvider=void 0;var e=Gf();Object.defineProperty(n,"AbstractProvider",{enumerable:!0,get:function(){return e.AbstractProvider}}),Object.defineProperty(n,"UnmanagedSubscriber",{enumerable:!0,get:function(){return e.UnmanagedSubscriber}});var t=Tb();Object.defineProperty(n,"AbstractSigner",{enumerable:!0,get:function(){return t.AbstractSigner}}),Object.defineProperty(n,"VoidSigner",{enumerable:!0,get:function(){return t.VoidSigner}});var r=Da();Object.defineProperty(n,"showThrottleMessage",{enumerable:!0,get:function(){return r.showThrottleMessage}});var s=HI();Object.defineProperty(n,"getDefaultProvider",{enumerable:!0,get:function(){return s.getDefaultProvider}});var i=hA();Object.defineProperty(n,"EnsResolver",{enumerable:!0,get:function(){return i.EnsResolver}}),Object.defineProperty(n,"MulticoinProviderPlugin",{enumerable:!0,get:function(){return i.MulticoinProviderPlugin}});var a=dr();Object.defineProperty(n,"Network",{enumerable:!0,get:function(){return a.Network}});var o=GI();Object.defineProperty(n,"NonceManager",{enumerable:!0,get:function(){return o.NonceManager}});var u=Sb();Object.defineProperty(n,"NetworkPlugin",{enumerable:!0,get:function(){return u.NetworkPlugin}}),Object.defineProperty(n,"GasCostPlugin",{enumerable:!0,get:function(){return u.GasCostPlugin}}),Object.defineProperty(n,"EnsPlugin",{enumerable:!0,get:function(){return u.EnsPlugin}}),Object.defineProperty(n,"FeeDataNetworkPlugin",{enumerable:!0,get:function(){return u.FeeDataNetworkPlugin}}),Object.defineProperty(n,"FetchUrlFeeDataNetworkPlugin",{enumerable:!0,get:function(){return u.FetchUrlFeeDataNetworkPlugin}});var c=Hf();Object.defineProperty(n,"Block",{enumerable:!0,get:function(){return c.Block}}),Object.defineProperty(n,"FeeData",{enumerable:!0,get:function(){return c.FeeData}}),Object.defineProperty(n,"Log",{enumerable:!0,get:function(){return c.Log}}),Object.defineProperty(n,"TransactionReceipt",{enumerable:!0,get:function(){return c.TransactionReceipt}}),Object.defineProperty(n,"TransactionResponse",{enumerable:!0,get:function(){return c.TransactionResponse}}),Object.defineProperty(n,"copyRequest",{enumerable:!0,get:function(){return c.copyRequest}});var l=_A();Object.defineProperty(n,"FallbackProvider",{enumerable:!0,get:function(){return l.FallbackProvider}});var d=us();Object.defineProperty(n,"JsonRpcApiProvider",{enumerable:!0,get:function(){return d.JsonRpcApiProvider}}),Object.defineProperty(n,"JsonRpcProvider",{enumerable:!0,get:function(){return d.JsonRpcProvider}}),Object.defineProperty(n,"JsonRpcSigner",{enumerable:!0,get:function(){return d.JsonRpcSigner}});var f=zI();Object.defineProperty(n,"BrowserProvider",{enumerable:!0,get:function(){return f.BrowserProvider}});var h=gA();Object.defineProperty(n,"AlchemyProvider",{enumerable:!0,get:function(){return h.AlchemyProvider}});var p=bA();Object.defineProperty(n,"AnkrProvider",{enumerable:!0,get:function(){return p.AnkrProvider}});var b=yA();Object.defineProperty(n,"CloudflareProvider",{enumerable:!0,get:function(){return b.CloudflareProvider}});var v=mA();Object.defineProperty(n,"EtherscanProvider",{enumerable:!0,get:function(){return v.EtherscanProvider}}),Object.defineProperty(n,"EtherscanPlugin",{enumerable:!0,get:function(){return v.EtherscanPlugin}});var w=xA();Object.defineProperty(n,"InfuraProvider",{enumerable:!0,get:function(){return w.InfuraProvider}}),Object.defineProperty(n,"InfuraWebSocketProvider",{enumerable:!0,get:function(){return w.InfuraWebSocketProvider}});var m=WI();Object.defineProperty(n,"PocketProvider",{enumerable:!0,get:function(){return m.PocketProvider}});var x=wA();Object.defineProperty(n,"QuickNodeProvider",{enumerable:!0,get:function(){return x.QuickNodeProvider}});const y=KI();Object.defineProperty(n,"IpcSocketProvider",{enumerable:!0,get:function(){return y.IpcSocketProvider}});var A=f5();Object.defineProperty(n,"SocketProvider",{enumerable:!0,get:function(){return A.SocketProvider}});var S=Ob();Object.defineProperty(n,"WebSocketProvider",{enumerable:!0,get:function(){return S.WebSocketProvider}});var D=f5();Object.defineProperty(n,"SocketSubscriber",{enumerable:!0,get:function(){return D.SocketSubscriber}}),Object.defineProperty(n,"SocketBlockSubscriber",{enumerable:!0,get:function(){return D.SocketBlockSubscriber}}),Object.defineProperty(n,"SocketPendingSubscriber",{enumerable:!0,get:function(){return D.SocketPendingSubscriber}}),Object.defineProperty(n,"SocketEventSubscriber",{enumerable:!0,get:function(){return D.SocketEventSubscriber}})}(O2)),O2}var N2={},Vu={},W3;function Ib(){var a;if(W3)return Vu;W3=1,Object.defineProperty(Vu,"__esModule",{value:!0}),Vu.BaseWallet=void 0;const n=Ot(),e=oi(),t=Nb(),r=$n(),s=Ee(),o=class o extends t.AbstractSigner{constructor(l,d){super(d);R(this,"address");$(this,a,void 0);(0,s.assertArgument)(l&&typeof l.sign=="function","invalid private key","privateKey","[ REDACTED ]"),k(this,a,l);const f=(0,r.computeAddress)(this.signingKey.publicKey);(0,s.defineProperties)(this,{address:f})}get signingKey(){return g(this,a)}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(l){return new o(g(this,a),l)}async signTransaction(l){const{to:d,from:f}=await(0,s.resolveProperties)({to:l.to?(0,n.resolveAddress)(l.to,this.provider):void 0,from:l.from?(0,n.resolveAddress)(l.from,this.provider):void 0});d!=null&&(l.to=d),f!=null&&(l.from=f),l.from!=null&&((0,s.assertArgument)((0,n.getAddress)(l.from)===this.address,"transaction from address mismatch","tx.from",l.from),delete l.from);const h=r.Transaction.from(l);return h.signature=this.signingKey.sign(h.unsignedHash),h.serialized}async signMessage(l){return this.signMessageSync(l)}signMessageSync(l){return this.signingKey.sign((0,e.hashMessage)(l)).serialized}async signTypedData(l,d,f){const h=await e.TypedDataEncoder.resolveNames(l,d,f,async p=>{(0,s.assert)(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:p}});const b=await this.provider.resolveName(p);return(0,s.assert)(b!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:p}),b});return this.signingKey.sign(e.TypedDataEncoder.hash(h.domain,d,h.value)).serialized}};a=new WeakMap;let i=o;return Vu.BaseWallet=i,Vu}var I2={},qu={},Ju={},C0={},K3;function PA(){if(K3)return C0;K3=1,Object.defineProperty(C0,"__esModule",{value:!0}),C0.decodeOwl=C0.decode=void 0;const n=Ee(),e=" !#$%&'()*+,-./<=>?@[]^_`{|}~",t=/^[a-z]*$/i;function r(a,o){let u=97;return a.reduce((c,l)=>(l===o?u++:l.match(t)?c.push(String.fromCharCode(u)+l):(u=97,c.push(l)),c),[])}function s(a,o){for(let l=e.length-1;l>=0;l--)a=a.split(e[l]).join(o.substring(2*l,2*l+2));const u=[],c=a.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(l,d,f,h)=>{if(f)for(let p=parseInt(f);p>=0;p--)u.push(";");else u.push(d.toLowerCase());return""});if(c)throw new Error(`leftovers: ${JSON.stringify(c)}`);return r(r(u,";"),":")}C0.decode=s;function i(a){return(0,n.assertArgument)(a[0]==="0","unsupported auwl data","data",a),s(a.substring(1+2*e.length),a.substring(1,1+2*e.length))}return C0.decodeOwl=i,C0}var Qu={},V3;function kA(){if(V3)return Qu;V3=1,Object.defineProperty(Qu,"__esModule",{value:!0}),Qu.Wordlist=void 0;const n=Ee();class e{constructor(r){R(this,"locale");(0,n.defineProperties)(this,{locale:r})}split(r){return r.toLowerCase().split(/\s+/g)}join(r){return r.join(" ")}}return Qu.Wordlist=e,Qu}var q3;function Bb(){var i,a,o,u,p5;if(q3)return Ju;q3=1,Object.defineProperty(Ju,"__esModule",{value:!0}),Ju.WordlistOwl=void 0;const n=oi(),e=Ee(),t=PA(),r=kA();class s extends r.Wordlist{constructor(f,h,p){super(f);$(this,u);$(this,i,void 0);$(this,a,void 0);$(this,o,void 0);k(this,i,h),k(this,a,p),k(this,o,null)}get _data(){return g(this,i)}_decodeWords(){return(0,t.decodeOwl)(g(this,i))}getWord(f){const h=Q(this,u,p5).call(this);return(0,e.assertArgument)(f>=0&&furAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-EgSe0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-PM&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryFN Noc|PutQuirySSue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurEAyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO",t="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60";let r=null;class s extends n.WordlistOwl{constructor(){super("en",e,t)}static wordlist(){return r==null&&(r=new s),r}}return qu.LangEn=s,qu}var Yu={},Q3;function Fb(){if(Q3)return Yu;Q3=1,Object.defineProperty(Yu,"__esModule",{value:!0}),Yu.Mnemonic=void 0;const n=Mt(),e=Ee(),t=jh();function r(c){return(1<=12&&d.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const f=new Uint8Array(Math.ceil(11*d.length/8));let h=0;for(let m=0;m=0,`invalid mnemonic word at index ${m}`,"mnemonic","[ REDACTED ]");for(let y=0;y<11;y++)x&1<<10-y&&(f[h>>3]|=1<<7-h%8),h++}const p=32*d.length/3,b=d.length/3,v=r(b),w=(0,e.getBytes)((0,n.sha256)(f.slice(0,p/8)))[0]&v;return(0,e.assertArgument)(w===(f[f.length-1]&v),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),(0,e.hexlify)(f.slice(0,p/8))}function a(c,l){(0,e.assertArgument)(c.length%4===0&&c.length>=16&&c.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),l==null&&(l=t.LangEn.wordlist());const d=[0];let f=11;for(let b=0;b8?(d[d.length-1]<<=8,d[d.length-1]|=c[b],f-=8):(d[d.length-1]<<=f,d[d.length-1]|=c[b]>>8-f,d.push(c[b]&s(8-f)),f+=3);const h=c.length/4,p=parseInt((0,n.sha256)(c).substring(2,4),16)&r(h);return d[d.length-1]<<=h,d[d.length-1]|=p>>8-h,l.join(d.map(b=>l.getWord(b)))}const o={};class u{constructor(l,d,f,h,p){R(this,"phrase");R(this,"password");R(this,"wordlist");R(this,"entropy");h==null&&(h=""),p==null&&(p=t.LangEn.wordlist()),(0,e.assertPrivate)(l,o,"Mnemonic"),(0,e.defineProperties)(this,{phrase:f,password:h,wordlist:p,entropy:d})}computeSeed(){const l=(0,e.toUtf8Bytes)("mnemonic"+this.password,"NFKD");return(0,n.pbkdf2)((0,e.toUtf8Bytes)(this.phrase,"NFKD"),l,2048,64,"sha512")}static fromPhrase(l,d,f){const h=i(l,f);return l=a((0,e.getBytes)(h),f),new u(o,h,l,d,f)}static fromEntropy(l,d,f){const h=(0,e.getBytes)(l,"entropy"),p=a(h,f);return new u(o,(0,e.hexlify)(h),p,d,f)}static entropyToPhrase(l,d){const f=(0,e.getBytes)(l,"entropy");return a(f,d)}static phraseToEntropy(l,d){return i(l,d)}static isValidMnemonic(l,d){try{return i(l,d),!0}catch{}return!1}}return Yu.Mnemonic=u,Yu}var Tn={};const CA=jn(kR);var xr={},Y3;function SA(){if(Y3)return xr;Y3=1,Object.defineProperty(xr,"__esModule",{value:!0}),xr.spelunk=xr.getPassword=xr.zpad=xr.looseArrayify=void 0;const n=Ee();function e(i){return typeof i=="string"&&!i.startsWith("0x")&&(i="0x"+i),(0,n.getBytesCopy)(i)}xr.looseArrayify=e;function t(i,a){for(i=String(i);i.length0&&(S&S-1)===0,"invalid kdf.N","kdf.N",S),(0,s.assertArgument)(D>0&&O>0,"invalid kdf","kdf",y);const _=(0,i.spelunk)(x,"crypto.kdfparams.dklen:int!");return(0,s.assertArgument)(_===32,"invalid kdf.dklen","kdf.dflen",_),{name:"scrypt",salt:A,N:S,r:D,p:O,dkLen:64}}else if(y.toLowerCase()==="pbkdf2"){const A=(0,i.spelunk)(x,"crypto.kdfparams.salt:data!"),S=(0,i.spelunk)(x,"crypto.kdfparams.prf:string!"),D=S.split("-").pop();(0,s.assertArgument)(D==="sha256"||D==="sha512","invalid kdf.pdf","kdf.pdf",S);const O=(0,i.spelunk)(x,"crypto.kdfparams.c:int!"),_=(0,i.spelunk)(x,"crypto.kdfparams.dklen:int!");return(0,s.assertArgument)(_===32,"invalid kdf.dklen","kdf.dklen",_),{name:"pbkdf2",salt:A,count:O,dkLen:_,algorithm:D}}}(0,s.assertArgument)(!1,"unsupported key-derivation function","kdf",y)}function f(x,y){const A=JSON.parse(x),S=(0,i.getPassword)(y),D=d(A);if(D.name==="pbkdf2"){const{salt:j,count:z,dkLen:F,algorithm:W}=D,H=(0,t.pbkdf2)(S,j,z,F,W);return l(A,H)}(0,s.assert)(D.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:D});const{salt:O,N:_,r:E,p:C,dkLen:P}=D,I=(0,t.scryptSync)(S,O,_,E,C,P);return l(A,I)}Tn.decryptKeystoreJsonSync=f;function h(x){return new Promise(y=>{setTimeout(()=>{y()},x)})}async function p(x,y,A){const S=JSON.parse(x),D=(0,i.getPassword)(y),O=d(S);if(O.name==="pbkdf2"){A&&(A(0),await h(0));const{salt:z,count:F,dkLen:W,algorithm:H}=O,L=(0,t.pbkdf2)(D,z,F,W,H);return A&&(A(1),await h(0)),l(S,L)}(0,s.assert)(O.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:O});const{salt:_,N:E,r:C,p:P,dkLen:I}=O,j=await(0,t.scrypt)(D,_,E,C,P,I,A);return l(S,j)}Tn.decryptKeystoreJson=p;function b(x){const y=x.salt!=null?(0,s.getBytes)(x.salt,"options.salt"):(0,t.randomBytes)(32);let A=1<<17,S=8,D=1;return x.scrypt&&(x.scrypt.N&&(A=x.scrypt.N),x.scrypt.r&&(S=x.scrypt.r),x.scrypt.p&&(D=x.scrypt.p)),(0,s.assertArgument)(typeof A=="number"&&A>0&&Number.isSafeInteger(A)&&(BigInt(A)&BigInt(A-1))===BigInt(0),"invalid scrypt N parameter","options.N",A),(0,s.assertArgument)(typeof S=="number"&&S>0&&Number.isSafeInteger(S),"invalid scrypt r parameter","options.r",S),(0,s.assertArgument)(typeof D=="number"&&D>0&&Number.isSafeInteger(D),"invalid scrypt p parameter","options.p",D),{name:"scrypt",dkLen:32,salt:y,N:A,r:S,p:D}}function v(x,y,A,S){const D=(0,s.getBytes)(A.privateKey,"privateKey"),O=S.iv!=null?(0,s.getBytes)(S.iv,"options.iv"):(0,t.randomBytes)(16);(0,s.assertArgument)(O.length===16,"invalid options.iv length","options.iv",S.iv);const _=S.uuid!=null?(0,s.getBytes)(S.uuid,"options.uuid"):(0,t.randomBytes)(16);(0,s.assertArgument)(_.length===16,"invalid options.uuid length","options.uuid",S.iv);const E=x.slice(0,16),C=x.slice(16,32),P=new n.CTR(E,O),I=(0,s.getBytes)(P.encrypt(D)),j=(0,t.keccak256)((0,s.concat)([C,I])),z={address:A.address.substring(2).toLowerCase(),id:(0,s.uuidV4)(_),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,s.hexlify)(O).substring(2)},ciphertext:(0,s.hexlify)(I).substring(2),kdf:"scrypt",kdfparams:{salt:(0,s.hexlify)(y.salt).substring(2),n:y.N,dklen:32,p:y.p,r:y.r},mac:j.substring(2)}};if(A.mnemonic){const F=S.client!=null?S.client:`ethers/${a.version}`,W=A.mnemonic.path||o,H=A.mnemonic.locale||"en",L=x.slice(32,64),M=(0,s.getBytes)(A.mnemonic.entropy,"account.mnemonic.entropy"),T=(0,t.randomBytes)(16),B=new n.CTR(L,T),N=(0,s.getBytes)(B.encrypt(M)),K=new Date,ne="UTC--"+(K.getUTCFullYear()+"-"+(0,i.zpad)(K.getUTCMonth()+1,2)+"-"+(0,i.zpad)(K.getUTCDate(),2)+"T"+(0,i.zpad)(K.getUTCHours(),2)+"-"+(0,i.zpad)(K.getUTCMinutes(),2)+"-"+(0,i.zpad)(K.getUTCSeconds(),2)+".0Z")+"--"+z.address;z["x-ethers"]={client:F,gethFilename:ne,path:W,locale:H,mnemonicCounter:(0,s.hexlify)(T).substring(2),mnemonicCiphertext:(0,s.hexlify)(N).substring(2),version:"0.1"}}return JSON.stringify(z)}function w(x,y,A){A==null&&(A={});const S=(0,i.getPassword)(y),D=b(A),O=(0,t.scryptSync)(S,D.salt,D.N,D.r,D.p,64);return v((0,s.getBytes)(O),D,x,A)}Tn.encryptKeystoreJsonSync=w;async function m(x,y,A){A==null&&(A={});const S=(0,i.getPassword)(y),D=b(A),O=await(0,t.scrypt)(S,D.salt,D.N,D.r,D.p,64,A.progressCallback);return v((0,s.getBytes)(O),D,x,A)}return Tn.encryptKeystoreJson=m,Tn}var X3;function RA(){return X3||(X3=1,function(n){var S,b5,O,El;Object.defineProperty(n,"__esModule",{value:!0}),n.getIndexedAccountPath=n.getAccountPath=n.HDNodeVoidWallet=n.HDNodeWallet=n.defaultPath=void 0;const e=Mt(),t=Nb(),r=$n(),s=Ee(),i=jh(),a=Ib(),o=Fb(),u=Ub();n.defaultPath="m/44'/60'/0'/0/0";const c=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),l=2147483648,d=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),f="0123456789abcdef";function h(C,P){let I="";for(;C;)I=f[C%16]+I,C=Math.trunc(C/16);for(;I.length=0;W-=8)z[33+(W>>3)]=C>>24-W&255;const F=(0,s.getBytes)((0,e.computeHmac)("sha512",P,z));return{IL:F.slice(0,32),IR:F.slice(32)}}function w(C,P){const I=P.split("/");(0,s.assertArgument)(I.length>0&&(I[0]==="m"||C.depth>0),"invalid path","path",P),I[0]==="m"&&I.shift();let j=C;for(let z=0;z=16&&z.length<=64,"invalid seed","seed","[REDACTED]");const F=(0,s.getBytes)((0,e.computeHmac)("sha512",c,z)),W=new e.SigningKey((0,s.hexlify)(F.slice(0,32)));return new E(b,W,"0x00000000",(0,s.hexlify)(F.slice(32)),"m",0,0,j,null)},$(E,O);let m=E;n.HDNodeWallet=m;class x extends t.VoidSigner{constructor(I,j,z,F,W,H,L,M,T){super(j,T);R(this,"publicKey");R(this,"fingerprint");R(this,"parentFingerprint");R(this,"chainCode");R(this,"path");R(this,"index");R(this,"depth");(0,s.assertPrivate)(I,b,"HDNodeVoidWallet"),(0,s.defineProperties)(this,{publicKey:z});const B=(0,s.dataSlice)((0,e.ripemd160)((0,e.sha256)(z)),0,4);(0,s.defineProperties)(this,{publicKey:z,fingerprint:B,parentFingerprint:F,chainCode:W,path:H,index:L,depth:M})}connect(I){return new x(b,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,I)}get extendedKey(){return(0,s.assert)(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),p((0,s.concat)(["0x0488B21E",h(this.depth,1),this.parentFingerprint,h(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return this.path!=null}deriveChild(I){const j=(0,s.getNumber)(I,"index");(0,s.assertArgument)(j<=4294967295,"invalid index","index",j);let z=this.path;z&&(z+="/"+(j&~l),j&l&&(z+="'"));const{IR:F,IL:W}=v(j,this.chainCode,this.publicKey,null),H=e.SigningKey.addPoints(W,this.publicKey,!0),L=(0,r.computeAddress)(H);return new x(b,L,H,this.fingerprint,(0,s.hexlify)(F),z,j,this.depth+1,this.provider)}derivePath(I){return w(this,I)}}n.HDNodeVoidWallet=x;function y(C){const P=(0,s.getNumber)(C,"index");return(0,s.assertArgument)(P>=0&&P=0&&P{setTimeout(()=>{h()},f)})}const d=class d extends t.BaseWallet{constructor(h,p){typeof h=="string"&&!h.startsWith("0x")&&(h="0x"+h);let b=typeof h=="string"?new n.SigningKey(h):h;super(b,p)}connect(h){return new d(this.signingKey,h)}async encrypt(h,p){const b={address:this.address,privateKey:this.privateKey};return await(0,i.encryptKeystoreJson)(b,h,{progressCallback:p})}encryptSync(h){const p={address:this.address,privateKey:this.privateKey};return(0,i.encryptKeystoreJsonSync)(p,h)}static async fromEncryptedJson(h,p,b){var w;let v=null;return(0,i.isKeystoreJson)(h)?v=await(0,i.decryptKeystoreJson)(h,p,b):(0,s.isCrowdsaleJson)(h)&&(b&&(b(0),await o(0)),v=(0,s.decryptCrowdsaleJson)(h,p),b&&(b(1),await o(0))),Q(w=d,c,g5).call(w,v)}static fromEncryptedJsonSync(h,p){var v;let b=null;return(0,i.isKeystoreJson)(h)?b=(0,i.decryptKeystoreJsonSync)(h,p):(0,s.isCrowdsaleJson)(h)?b=(0,s.decryptCrowdsaleJson)(h,p):(0,e.assertArgument)(!1,"invalid JSON wallet","json","[ REDACTED ]"),Q(v=d,c,g5).call(v,b)}static createRandom(h){const p=r.HDNodeWallet.createRandom();return h?p.connect(h):p}static fromPhrase(h,p){const b=r.HDNodeWallet.fromPhrase(h);return p?b.connect(p):b}};c=new WeakSet,g5=function(h){if((0,e.assertArgument)(h,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in h&&h.mnemonic&&h.mnemonic.locale==="en"){const b=a.Mnemonic.fromEntropy(h.mnemonic.entropy),v=r.HDNodeWallet.fromMnemonic(b,h.mnemonic.path);if(v.address===h.address&&v.privateKey===h.privateKey)return v;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const p=new d(h.privateKey);return(0,e.assertArgument)(p.address===h.address,"address/privateKey mismatch","json","[ REDACTED ]"),p},$(d,c);let u=d;return Zu.Wallet=u,Zu}var nx;function qI(){return nx||(nx=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.Wallet=n.Mnemonic=n.encryptKeystoreJsonSync=n.encryptKeystoreJson=n.decryptKeystoreJson=n.decryptKeystoreJsonSync=n.isKeystoreJson=n.decryptCrowdsaleJson=n.isCrowdsaleJson=n.HDNodeVoidWallet=n.HDNodeWallet=n.getIndexedAccountPath=n.getAccountPath=n.defaultPath=n.BaseWallet=void 0;var e=Ib();Object.defineProperty(n,"BaseWallet",{enumerable:!0,get:function(){return e.BaseWallet}});var t=RA();Object.defineProperty(n,"defaultPath",{enumerable:!0,get:function(){return t.defaultPath}}),Object.defineProperty(n,"getAccountPath",{enumerable:!0,get:function(){return t.getAccountPath}}),Object.defineProperty(n,"getIndexedAccountPath",{enumerable:!0,get:function(){return t.getIndexedAccountPath}}),Object.defineProperty(n,"HDNodeWallet",{enumerable:!0,get:function(){return t.HDNodeWallet}}),Object.defineProperty(n,"HDNodeVoidWallet",{enumerable:!0,get:function(){return t.HDNodeVoidWallet}});var r=TA();Object.defineProperty(n,"isCrowdsaleJson",{enumerable:!0,get:function(){return r.isCrowdsaleJson}}),Object.defineProperty(n,"decryptCrowdsaleJson",{enumerable:!0,get:function(){return r.decryptCrowdsaleJson}});var s=Ub();Object.defineProperty(n,"isKeystoreJson",{enumerable:!0,get:function(){return s.isKeystoreJson}}),Object.defineProperty(n,"decryptKeystoreJsonSync",{enumerable:!0,get:function(){return s.decryptKeystoreJsonSync}}),Object.defineProperty(n,"decryptKeystoreJson",{enumerable:!0,get:function(){return s.decryptKeystoreJson}}),Object.defineProperty(n,"encryptKeystoreJson",{enumerable:!0,get:function(){return s.encryptKeystoreJson}}),Object.defineProperty(n,"encryptKeystoreJsonSync",{enumerable:!0,get:function(){return s.encryptKeystoreJsonSync}});var i=Fb();Object.defineProperty(n,"Mnemonic",{enumerable:!0,get:function(){return i.Mnemonic}});var a=VI();Object.defineProperty(n,"Wallet",{enumerable:!0,get:function(){return a.Wallet}})}(N2)),N2}var B2={},Xu={},el={},tl={},rx;function JI(){if(rx)return tl;rx=1,Object.defineProperty(tl,"__esModule",{value:!0}),tl.decodeBits=void 0;const n=")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_";function e(t,r){const s=(1<=t;){const l=a>>o-t;a&=(1<{const u=o.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);(0,n.assertArgument)(u!==null,"internal error parsing accents","accents",i);let c=0;const l=(0,e.decodeBits)(parseInt(u[3]),u[4]),d=parseInt(u[2]),f=new RegExp(`([${u[1]}])`,"g");a=a.replace(f,(h,p)=>(--l[c]===0&&(p=String.fromCharCode(p.charCodeAt(0),d),c++),p))}),a.split(",")}return el.decodeOwlA=r,el}var ix;function YI(){var r;if(ix)return Xu;ix=1,Object.defineProperty(Xu,"__esModule",{value:!0}),Xu.WordlistOwlA=void 0;const n=Bb(),e=QI();class t extends n.WordlistOwl{constructor(a,o,u,c){super(a,o,c);$(this,r,void 0);k(this,r,u)}get _accent(){return g(this,r)}_decodeWords(){return(0,e.decodeOwlA)(this._data,this._accent)}}return r=new WeakMap,Xu.WordlistOwlA=t,Xu}var nl={},ax;function ZI(){if(ax)return nl;ax=1,Object.defineProperty(nl,"__esModule",{value:!0}),nl.wordlists=void 0;const n=jh();return nl.wordlists={en:n.LangEn.wordlist()},nl}var ox;function XI(){return ox||(ox=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.wordlists=n.WordlistOwlA=n.WordlistOwl=n.LangEn=n.Wordlist=void 0;var e=kA();Object.defineProperty(n,"Wordlist",{enumerable:!0,get:function(){return e.Wordlist}});var t=jh();Object.defineProperty(n,"LangEn",{enumerable:!0,get:function(){return t.LangEn}});var r=Bb();Object.defineProperty(n,"WordlistOwl",{enumerable:!0,get:function(){return r.WordlistOwl}});var s=YI();Object.defineProperty(n,"WordlistOwlA",{enumerable:!0,get:function(){return s.WordlistOwlA}});var i=ZI();Object.defineProperty(n,"wordlists",{enumerable:!0,get:function(){return i.wordlists}})}(B2)),B2}var cx;function ux(){return cx||(cx=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.ripemd160=n.keccak256=n.randomBytes=n.computeHmac=n.UndecodedEventLog=n.EventLog=n.ContractUnknownEventPayload=n.ContractTransactionResponse=n.ContractTransactionReceipt=n.ContractEventPayload=n.ContractFactory=n.Contract=n.BaseContract=n.MessagePrefix=n.EtherSymbol=n.ZeroHash=n.N=n.MaxInt256=n.MinInt256=n.MaxUint256=n.WeiPerEther=n.ZeroAddress=n.resolveAddress=n.isAddress=n.isAddressable=n.getCreate2Address=n.getCreateAddress=n.getIcapAddress=n.getAddress=n.Typed=n.TransactionDescription=n.Result=n.LogDescription=n.Interface=n.Indexed=n.ErrorDescription=n.checkResultErrors=n.StructFragment=n.ParamType=n.NamedFragment=n.FunctionFragment=n.FallbackFragment=n.Fragment=n.EventFragment=n.ErrorFragment=n.ConstructorFragment=n.AbiCoder=n.encodeBytes32String=n.decodeBytes32String=n.version=void 0,n.EtherscanPlugin=n.EnsPlugin=n.Network=n.EnsResolver=n.WebSocketProvider=n.SocketProvider=n.IpcSocketProvider=n.QuickNodeProvider=n.PocketProvider=n.InfuraWebSocketProvider=n.InfuraProvider=n.EtherscanProvider=n.CloudflareProvider=n.AnkrProvider=n.AlchemyProvider=n.BrowserProvider=n.JsonRpcSigner=n.JsonRpcProvider=n.JsonRpcApiProvider=n.FallbackProvider=n.AbstractProvider=n.VoidSigner=n.NonceManager=n.AbstractSigner=n.TransactionResponse=n.TransactionReceipt=n.Log=n.FeeData=n.Block=n.getDefaultProvider=n.verifyTypedData=n.TypedDataEncoder=n.solidityPackedSha256=n.solidityPackedKeccak256=n.solidityPacked=n.verifyMessage=n.hashMessage=n.dnsEncode=n.namehash=n.isValidName=n.ensNormalize=n.id=n.SigningKey=n.Signature=n.lock=n.scryptSync=n.scrypt=n.pbkdf2=n.sha512=n.sha256=void 0,n.toBeArray=n.getUint=n.getNumber=n.getBigInt=n.FixedNumber=n.FetchCancelSignal=n.FetchResponse=n.FetchRequest=n.EventPayload=n.isError=n.isCallException=n.makeError=n.assertPrivate=n.assertNormalize=n.assertArgumentCount=n.assertArgument=n.assert=n.resolveProperties=n.defineProperties=n.zeroPadValue=n.zeroPadBytes=n.stripZerosLeft=n.isBytesLike=n.isHexString=n.hexlify=n.getBytesCopy=n.getBytes=n.dataSlice=n.dataLength=n.concat=n.encodeBase64=n.decodeBase64=n.encodeBase58=n.decodeBase58=n.Transaction=n.recoverAddress=n.computeAddress=n.accessListify=n.showThrottleMessage=n.copyRequest=n.UnmanagedSubscriber=n.SocketSubscriber=n.SocketPendingSubscriber=n.SocketEventSubscriber=n.SocketBlockSubscriber=n.MulticoinProviderPlugin=n.NetworkPlugin=n.GasCostPlugin=n.FetchUrlFeeDataNetworkPlugin=n.FeeDataNetworkPlugin=void 0,n.wordlists=n.WordlistOwlA=n.WordlistOwl=n.LangEn=n.Wordlist=n.encryptKeystoreJsonSync=n.encryptKeystoreJson=n.decryptKeystoreJson=n.decryptKeystoreJsonSync=n.decryptCrowdsaleJson=n.isKeystoreJson=n.isCrowdsaleJson=n.getIndexedAccountPath=n.getAccountPath=n.defaultPath=n.Wallet=n.HDNodeVoidWallet=n.HDNodeWallet=n.BaseWallet=n.Mnemonic=n.uuidV4=n.encodeRlp=n.decodeRlp=n.Utf8ErrorFuncs=n.toUtf8String=n.toUtf8CodePoints=n.toUtf8Bytes=n.parseUnits=n.formatUnits=n.parseEther=n.formatEther=n.mask=n.toTwos=n.fromTwos=n.toQuantity=n.toNumber=n.toBeHex=n.toBigInt=void 0;var e=_b();Object.defineProperty(n,"version",{enumerable:!0,get:function(){return e.version}});var t=$f();Object.defineProperty(n,"decodeBytes32String",{enumerable:!0,get:function(){return t.decodeBytes32String}}),Object.defineProperty(n,"encodeBytes32String",{enumerable:!0,get:function(){return t.encodeBytes32String}}),Object.defineProperty(n,"AbiCoder",{enumerable:!0,get:function(){return t.AbiCoder}}),Object.defineProperty(n,"ConstructorFragment",{enumerable:!0,get:function(){return t.ConstructorFragment}}),Object.defineProperty(n,"ErrorFragment",{enumerable:!0,get:function(){return t.ErrorFragment}}),Object.defineProperty(n,"EventFragment",{enumerable:!0,get:function(){return t.EventFragment}}),Object.defineProperty(n,"Fragment",{enumerable:!0,get:function(){return t.Fragment}}),Object.defineProperty(n,"FallbackFragment",{enumerable:!0,get:function(){return t.FallbackFragment}}),Object.defineProperty(n,"FunctionFragment",{enumerable:!0,get:function(){return t.FunctionFragment}}),Object.defineProperty(n,"NamedFragment",{enumerable:!0,get:function(){return t.NamedFragment}}),Object.defineProperty(n,"ParamType",{enumerable:!0,get:function(){return t.ParamType}}),Object.defineProperty(n,"StructFragment",{enumerable:!0,get:function(){return t.StructFragment}}),Object.defineProperty(n,"checkResultErrors",{enumerable:!0,get:function(){return t.checkResultErrors}}),Object.defineProperty(n,"ErrorDescription",{enumerable:!0,get:function(){return t.ErrorDescription}}),Object.defineProperty(n,"Indexed",{enumerable:!0,get:function(){return t.Indexed}}),Object.defineProperty(n,"Interface",{enumerable:!0,get:function(){return t.Interface}}),Object.defineProperty(n,"LogDescription",{enumerable:!0,get:function(){return t.LogDescription}}),Object.defineProperty(n,"Result",{enumerable:!0,get:function(){return t.Result}}),Object.defineProperty(n,"TransactionDescription",{enumerable:!0,get:function(){return t.TransactionDescription}}),Object.defineProperty(n,"Typed",{enumerable:!0,get:function(){return t.Typed}});var r=Ot();Object.defineProperty(n,"getAddress",{enumerable:!0,get:function(){return r.getAddress}}),Object.defineProperty(n,"getIcapAddress",{enumerable:!0,get:function(){return r.getIcapAddress}}),Object.defineProperty(n,"getCreateAddress",{enumerable:!0,get:function(){return r.getCreateAddress}}),Object.defineProperty(n,"getCreate2Address",{enumerable:!0,get:function(){return r.getCreate2Address}}),Object.defineProperty(n,"isAddressable",{enumerable:!0,get:function(){return r.isAddressable}}),Object.defineProperty(n,"isAddress",{enumerable:!0,get:function(){return r.isAddress}}),Object.defineProperty(n,"resolveAddress",{enumerable:!0,get:function(){return r.resolveAddress}});var s=jf();Object.defineProperty(n,"ZeroAddress",{enumerable:!0,get:function(){return s.ZeroAddress}}),Object.defineProperty(n,"WeiPerEther",{enumerable:!0,get:function(){return s.WeiPerEther}}),Object.defineProperty(n,"MaxUint256",{enumerable:!0,get:function(){return s.MaxUint256}}),Object.defineProperty(n,"MinInt256",{enumerable:!0,get:function(){return s.MinInt256}}),Object.defineProperty(n,"MaxInt256",{enumerable:!0,get:function(){return s.MaxInt256}}),Object.defineProperty(n,"N",{enumerable:!0,get:function(){return s.N}}),Object.defineProperty(n,"ZeroHash",{enumerable:!0,get:function(){return s.ZeroHash}}),Object.defineProperty(n,"EtherSymbol",{enumerable:!0,get:function(){return s.EtherSymbol}}),Object.defineProperty(n,"MessagePrefix",{enumerable:!0,get:function(){return s.MessagePrefix}});var i=Mh();Object.defineProperty(n,"BaseContract",{enumerable:!0,get:function(){return i.BaseContract}}),Object.defineProperty(n,"Contract",{enumerable:!0,get:function(){return i.Contract}}),Object.defineProperty(n,"ContractFactory",{enumerable:!0,get:function(){return i.ContractFactory}}),Object.defineProperty(n,"ContractEventPayload",{enumerable:!0,get:function(){return i.ContractEventPayload}}),Object.defineProperty(n,"ContractTransactionReceipt",{enumerable:!0,get:function(){return i.ContractTransactionReceipt}}),Object.defineProperty(n,"ContractTransactionResponse",{enumerable:!0,get:function(){return i.ContractTransactionResponse}}),Object.defineProperty(n,"ContractUnknownEventPayload",{enumerable:!0,get:function(){return i.ContractUnknownEventPayload}}),Object.defineProperty(n,"EventLog",{enumerable:!0,get:function(){return i.EventLog}}),Object.defineProperty(n,"UndecodedEventLog",{enumerable:!0,get:function(){return i.UndecodedEventLog}});var a=Mt();Object.defineProperty(n,"computeHmac",{enumerable:!0,get:function(){return a.computeHmac}}),Object.defineProperty(n,"randomBytes",{enumerable:!0,get:function(){return a.randomBytes}}),Object.defineProperty(n,"keccak256",{enumerable:!0,get:function(){return a.keccak256}}),Object.defineProperty(n,"ripemd160",{enumerable:!0,get:function(){return a.ripemd160}}),Object.defineProperty(n,"sha256",{enumerable:!0,get:function(){return a.sha256}}),Object.defineProperty(n,"sha512",{enumerable:!0,get:function(){return a.sha512}}),Object.defineProperty(n,"pbkdf2",{enumerable:!0,get:function(){return a.pbkdf2}}),Object.defineProperty(n,"scrypt",{enumerable:!0,get:function(){return a.scrypt}}),Object.defineProperty(n,"scryptSync",{enumerable:!0,get:function(){return a.scryptSync}}),Object.defineProperty(n,"lock",{enumerable:!0,get:function(){return a.lock}}),Object.defineProperty(n,"Signature",{enumerable:!0,get:function(){return a.Signature}}),Object.defineProperty(n,"SigningKey",{enumerable:!0,get:function(){return a.SigningKey}});var o=oi();Object.defineProperty(n,"id",{enumerable:!0,get:function(){return o.id}}),Object.defineProperty(n,"ensNormalize",{enumerable:!0,get:function(){return o.ensNormalize}}),Object.defineProperty(n,"isValidName",{enumerable:!0,get:function(){return o.isValidName}}),Object.defineProperty(n,"namehash",{enumerable:!0,get:function(){return o.namehash}}),Object.defineProperty(n,"dnsEncode",{enumerable:!0,get:function(){return o.dnsEncode}}),Object.defineProperty(n,"hashMessage",{enumerable:!0,get:function(){return o.hashMessage}}),Object.defineProperty(n,"verifyMessage",{enumerable:!0,get:function(){return o.verifyMessage}}),Object.defineProperty(n,"solidityPacked",{enumerable:!0,get:function(){return o.solidityPacked}}),Object.defineProperty(n,"solidityPackedKeccak256",{enumerable:!0,get:function(){return o.solidityPackedKeccak256}}),Object.defineProperty(n,"solidityPackedSha256",{enumerable:!0,get:function(){return o.solidityPackedSha256}}),Object.defineProperty(n,"TypedDataEncoder",{enumerable:!0,get:function(){return o.TypedDataEncoder}}),Object.defineProperty(n,"verifyTypedData",{enumerable:!0,get:function(){return o.verifyTypedData}});var u=Nb();Object.defineProperty(n,"getDefaultProvider",{enumerable:!0,get:function(){return u.getDefaultProvider}}),Object.defineProperty(n,"Block",{enumerable:!0,get:function(){return u.Block}}),Object.defineProperty(n,"FeeData",{enumerable:!0,get:function(){return u.FeeData}}),Object.defineProperty(n,"Log",{enumerable:!0,get:function(){return u.Log}}),Object.defineProperty(n,"TransactionReceipt",{enumerable:!0,get:function(){return u.TransactionReceipt}}),Object.defineProperty(n,"TransactionResponse",{enumerable:!0,get:function(){return u.TransactionResponse}}),Object.defineProperty(n,"AbstractSigner",{enumerable:!0,get:function(){return u.AbstractSigner}}),Object.defineProperty(n,"NonceManager",{enumerable:!0,get:function(){return u.NonceManager}}),Object.defineProperty(n,"VoidSigner",{enumerable:!0,get:function(){return u.VoidSigner}}),Object.defineProperty(n,"AbstractProvider",{enumerable:!0,get:function(){return u.AbstractProvider}}),Object.defineProperty(n,"FallbackProvider",{enumerable:!0,get:function(){return u.FallbackProvider}}),Object.defineProperty(n,"JsonRpcApiProvider",{enumerable:!0,get:function(){return u.JsonRpcApiProvider}}),Object.defineProperty(n,"JsonRpcProvider",{enumerable:!0,get:function(){return u.JsonRpcProvider}}),Object.defineProperty(n,"JsonRpcSigner",{enumerable:!0,get:function(){return u.JsonRpcSigner}}),Object.defineProperty(n,"BrowserProvider",{enumerable:!0,get:function(){return u.BrowserProvider}}),Object.defineProperty(n,"AlchemyProvider",{enumerable:!0,get:function(){return u.AlchemyProvider}}),Object.defineProperty(n,"AnkrProvider",{enumerable:!0,get:function(){return u.AnkrProvider}}),Object.defineProperty(n,"CloudflareProvider",{enumerable:!0,get:function(){return u.CloudflareProvider}}),Object.defineProperty(n,"EtherscanProvider",{enumerable:!0,get:function(){return u.EtherscanProvider}}),Object.defineProperty(n,"InfuraProvider",{enumerable:!0,get:function(){return u.InfuraProvider}}),Object.defineProperty(n,"InfuraWebSocketProvider",{enumerable:!0,get:function(){return u.InfuraWebSocketProvider}}),Object.defineProperty(n,"PocketProvider",{enumerable:!0,get:function(){return u.PocketProvider}}),Object.defineProperty(n,"QuickNodeProvider",{enumerable:!0,get:function(){return u.QuickNodeProvider}}),Object.defineProperty(n,"IpcSocketProvider",{enumerable:!0,get:function(){return u.IpcSocketProvider}}),Object.defineProperty(n,"SocketProvider",{enumerable:!0,get:function(){return u.SocketProvider}}),Object.defineProperty(n,"WebSocketProvider",{enumerable:!0,get:function(){return u.WebSocketProvider}}),Object.defineProperty(n,"EnsResolver",{enumerable:!0,get:function(){return u.EnsResolver}}),Object.defineProperty(n,"Network",{enumerable:!0,get:function(){return u.Network}}),Object.defineProperty(n,"EnsPlugin",{enumerable:!0,get:function(){return u.EnsPlugin}}),Object.defineProperty(n,"EtherscanPlugin",{enumerable:!0,get:function(){return u.EtherscanPlugin}}),Object.defineProperty(n,"FeeDataNetworkPlugin",{enumerable:!0,get:function(){return u.FeeDataNetworkPlugin}}),Object.defineProperty(n,"FetchUrlFeeDataNetworkPlugin",{enumerable:!0,get:function(){return u.FetchUrlFeeDataNetworkPlugin}}),Object.defineProperty(n,"GasCostPlugin",{enumerable:!0,get:function(){return u.GasCostPlugin}}),Object.defineProperty(n,"NetworkPlugin",{enumerable:!0,get:function(){return u.NetworkPlugin}}),Object.defineProperty(n,"MulticoinProviderPlugin",{enumerable:!0,get:function(){return u.MulticoinProviderPlugin}}),Object.defineProperty(n,"SocketBlockSubscriber",{enumerable:!0,get:function(){return u.SocketBlockSubscriber}}),Object.defineProperty(n,"SocketEventSubscriber",{enumerable:!0,get:function(){return u.SocketEventSubscriber}}),Object.defineProperty(n,"SocketPendingSubscriber",{enumerable:!0,get:function(){return u.SocketPendingSubscriber}}),Object.defineProperty(n,"SocketSubscriber",{enumerable:!0,get:function(){return u.SocketSubscriber}}),Object.defineProperty(n,"UnmanagedSubscriber",{enumerable:!0,get:function(){return u.UnmanagedSubscriber}}),Object.defineProperty(n,"copyRequest",{enumerable:!0,get:function(){return u.copyRequest}}),Object.defineProperty(n,"showThrottleMessage",{enumerable:!0,get:function(){return u.showThrottleMessage}});var c=$n();Object.defineProperty(n,"accessListify",{enumerable:!0,get:function(){return c.accessListify}}),Object.defineProperty(n,"computeAddress",{enumerable:!0,get:function(){return c.computeAddress}}),Object.defineProperty(n,"recoverAddress",{enumerable:!0,get:function(){return c.recoverAddress}}),Object.defineProperty(n,"Transaction",{enumerable:!0,get:function(){return c.Transaction}});var l=Ee();Object.defineProperty(n,"decodeBase58",{enumerable:!0,get:function(){return l.decodeBase58}}),Object.defineProperty(n,"encodeBase58",{enumerable:!0,get:function(){return l.encodeBase58}}),Object.defineProperty(n,"decodeBase64",{enumerable:!0,get:function(){return l.decodeBase64}}),Object.defineProperty(n,"encodeBase64",{enumerable:!0,get:function(){return l.encodeBase64}}),Object.defineProperty(n,"concat",{enumerable:!0,get:function(){return l.concat}}),Object.defineProperty(n,"dataLength",{enumerable:!0,get:function(){return l.dataLength}}),Object.defineProperty(n,"dataSlice",{enumerable:!0,get:function(){return l.dataSlice}}),Object.defineProperty(n,"getBytes",{enumerable:!0,get:function(){return l.getBytes}}),Object.defineProperty(n,"getBytesCopy",{enumerable:!0,get:function(){return l.getBytesCopy}}),Object.defineProperty(n,"hexlify",{enumerable:!0,get:function(){return l.hexlify}}),Object.defineProperty(n,"isHexString",{enumerable:!0,get:function(){return l.isHexString}}),Object.defineProperty(n,"isBytesLike",{enumerable:!0,get:function(){return l.isBytesLike}}),Object.defineProperty(n,"stripZerosLeft",{enumerable:!0,get:function(){return l.stripZerosLeft}}),Object.defineProperty(n,"zeroPadBytes",{enumerable:!0,get:function(){return l.zeroPadBytes}}),Object.defineProperty(n,"zeroPadValue",{enumerable:!0,get:function(){return l.zeroPadValue}}),Object.defineProperty(n,"defineProperties",{enumerable:!0,get:function(){return l.defineProperties}}),Object.defineProperty(n,"resolveProperties",{enumerable:!0,get:function(){return l.resolveProperties}}),Object.defineProperty(n,"assert",{enumerable:!0,get:function(){return l.assert}}),Object.defineProperty(n,"assertArgument",{enumerable:!0,get:function(){return l.assertArgument}}),Object.defineProperty(n,"assertArgumentCount",{enumerable:!0,get:function(){return l.assertArgumentCount}}),Object.defineProperty(n,"assertNormalize",{enumerable:!0,get:function(){return l.assertNormalize}}),Object.defineProperty(n,"assertPrivate",{enumerable:!0,get:function(){return l.assertPrivate}}),Object.defineProperty(n,"makeError",{enumerable:!0,get:function(){return l.makeError}}),Object.defineProperty(n,"isCallException",{enumerable:!0,get:function(){return l.isCallException}}),Object.defineProperty(n,"isError",{enumerable:!0,get:function(){return l.isError}}),Object.defineProperty(n,"EventPayload",{enumerable:!0,get:function(){return l.EventPayload}}),Object.defineProperty(n,"FetchRequest",{enumerable:!0,get:function(){return l.FetchRequest}}),Object.defineProperty(n,"FetchResponse",{enumerable:!0,get:function(){return l.FetchResponse}}),Object.defineProperty(n,"FetchCancelSignal",{enumerable:!0,get:function(){return l.FetchCancelSignal}}),Object.defineProperty(n,"FixedNumber",{enumerable:!0,get:function(){return l.FixedNumber}}),Object.defineProperty(n,"getBigInt",{enumerable:!0,get:function(){return l.getBigInt}}),Object.defineProperty(n,"getNumber",{enumerable:!0,get:function(){return l.getNumber}}),Object.defineProperty(n,"getUint",{enumerable:!0,get:function(){return l.getUint}}),Object.defineProperty(n,"toBeArray",{enumerable:!0,get:function(){return l.toBeArray}}),Object.defineProperty(n,"toBigInt",{enumerable:!0,get:function(){return l.toBigInt}}),Object.defineProperty(n,"toBeHex",{enumerable:!0,get:function(){return l.toBeHex}}),Object.defineProperty(n,"toNumber",{enumerable:!0,get:function(){return l.toNumber}}),Object.defineProperty(n,"toQuantity",{enumerable:!0,get:function(){return l.toQuantity}}),Object.defineProperty(n,"fromTwos",{enumerable:!0,get:function(){return l.fromTwos}}),Object.defineProperty(n,"toTwos",{enumerable:!0,get:function(){return l.toTwos}}),Object.defineProperty(n,"mask",{enumerable:!0,get:function(){return l.mask}}),Object.defineProperty(n,"formatEther",{enumerable:!0,get:function(){return l.formatEther}}),Object.defineProperty(n,"parseEther",{enumerable:!0,get:function(){return l.parseEther}}),Object.defineProperty(n,"formatUnits",{enumerable:!0,get:function(){return l.formatUnits}}),Object.defineProperty(n,"parseUnits",{enumerable:!0,get:function(){return l.parseUnits}}),Object.defineProperty(n,"toUtf8Bytes",{enumerable:!0,get:function(){return l.toUtf8Bytes}}),Object.defineProperty(n,"toUtf8CodePoints",{enumerable:!0,get:function(){return l.toUtf8CodePoints}}),Object.defineProperty(n,"toUtf8String",{enumerable:!0,get:function(){return l.toUtf8String}}),Object.defineProperty(n,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return l.Utf8ErrorFuncs}}),Object.defineProperty(n,"decodeRlp",{enumerable:!0,get:function(){return l.decodeRlp}}),Object.defineProperty(n,"encodeRlp",{enumerable:!0,get:function(){return l.encodeRlp}}),Object.defineProperty(n,"uuidV4",{enumerable:!0,get:function(){return l.uuidV4}});var d=qI();Object.defineProperty(n,"Mnemonic",{enumerable:!0,get:function(){return d.Mnemonic}}),Object.defineProperty(n,"BaseWallet",{enumerable:!0,get:function(){return d.BaseWallet}}),Object.defineProperty(n,"HDNodeWallet",{enumerable:!0,get:function(){return d.HDNodeWallet}}),Object.defineProperty(n,"HDNodeVoidWallet",{enumerable:!0,get:function(){return d.HDNodeVoidWallet}}),Object.defineProperty(n,"Wallet",{enumerable:!0,get:function(){return d.Wallet}}),Object.defineProperty(n,"defaultPath",{enumerable:!0,get:function(){return d.defaultPath}}),Object.defineProperty(n,"getAccountPath",{enumerable:!0,get:function(){return d.getAccountPath}}),Object.defineProperty(n,"getIndexedAccountPath",{enumerable:!0,get:function(){return d.getIndexedAccountPath}}),Object.defineProperty(n,"isCrowdsaleJson",{enumerable:!0,get:function(){return d.isCrowdsaleJson}}),Object.defineProperty(n,"isKeystoreJson",{enumerable:!0,get:function(){return d.isKeystoreJson}}),Object.defineProperty(n,"decryptCrowdsaleJson",{enumerable:!0,get:function(){return d.decryptCrowdsaleJson}}),Object.defineProperty(n,"decryptKeystoreJsonSync",{enumerable:!0,get:function(){return d.decryptKeystoreJsonSync}}),Object.defineProperty(n,"decryptKeystoreJson",{enumerable:!0,get:function(){return d.decryptKeystoreJson}}),Object.defineProperty(n,"encryptKeystoreJson",{enumerable:!0,get:function(){return d.encryptKeystoreJson}}),Object.defineProperty(n,"encryptKeystoreJsonSync",{enumerable:!0,get:function(){return d.encryptKeystoreJsonSync}});var f=XI();Object.defineProperty(n,"Wordlist",{enumerable:!0,get:function(){return f.Wordlist}}),Object.defineProperty(n,"LangEn",{enumerable:!0,get:function(){return f.LangEn}}),Object.defineProperty(n,"WordlistOwl",{enumerable:!0,get:function(){return f.WordlistOwl}}),Object.defineProperty(n,"WordlistOwlA",{enumerable:!0,get:function(){return f.WordlistOwlA}}),Object.defineProperty(n,"wordlists",{enumerable:!0,get:function(){return f.wordlists}})}(x2)),x2}(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.ethers=void 0;const e=Yv,t=e.__importStar(ux());n.ethers=t,e.__exportStar(ux(),n)})(Gc);var zc={},Ma={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.ERC2771Type=n.EIP712_CALL_WITH_SYNC_FEE_CONCURRENT_ERC2771_TYPE_DATA=n.EIP712_SPONSORED_CALL_CONCURRENT_ERC2771_TYPE_DATA=n.EIP712_CALL_WITH_SYNC_FEE_ERC2771_TYPE_DATA=n.EIP712_SPONSORED_CALL_ERC2771_TYPE_DATA=void 0,n.EIP712_SPONSORED_CALL_ERC2771_TYPE_DATA={SponsoredCallERC2771:[{name:"chainId",type:"uint256"},{name:"target",type:"address"},{name:"data",type:"bytes"},{name:"user",type:"address"},{name:"userNonce",type:"uint256"},{name:"userDeadline",type:"uint256"}]},n.EIP712_CALL_WITH_SYNC_FEE_ERC2771_TYPE_DATA={CallWithSyncFeeERC2771:[{name:"chainId",type:"uint256"},{name:"target",type:"address"},{name:"data",type:"bytes"},{name:"user",type:"address"},{name:"userNonce",type:"uint256"},{name:"userDeadline",type:"uint256"}]},n.EIP712_SPONSORED_CALL_CONCURRENT_ERC2771_TYPE_DATA={SponsoredCallConcurrentERC2771:[{name:"chainId",type:"uint256"},{name:"target",type:"address"},{name:"data",type:"bytes"},{name:"user",type:"address"},{name:"userSalt",type:"bytes32"},{name:"userDeadline",type:"uint256"}]},n.EIP712_CALL_WITH_SYNC_FEE_CONCURRENT_ERC2771_TYPE_DATA={CallWithSyncFeeConcurrentERC2771:[{name:"chainId",type:"uint256"},{name:"target",type:"address"},{name:"data",type:"bytes"},{name:"user",type:"address"},{name:"userSalt",type:"bytes32"},{name:"userDeadline",type:"uint256"}]},function(e){e.CallWithSyncFee="CallWithSyncFee",e.SponsoredCall="SponsoredCall",e.ConcurrentCallWithSyncFee="ConcurrentCallWithSyncFee",e.ConcurrentSponsoredCall="ConcurrentSponsoredCall"}(n.ERC2771Type||(n.ERC2771Type={}))})(Ma);var zf={};Object.defineProperty(zf,"__esModule",{value:!0});zf.isZkSync=void 0;const eB=n=>n===BigInt(324)||n===BigInt(280);zf.isZkSync=eB;Object.defineProperty(zc,"__esModule",{value:!0});zc.getGelatoRelayERC2771Address=void 0;const bi=Gc,Pd=Ma,kd=zf,tB=(n,e)=>{const{chainId:t,type:r}=n;switch(r){case Pd.ERC2771Type.CallWithSyncFee:return(0,kd.isZkSync)(t)?(0,bi.getAddress)(e.contract.relayERC2771zkSync):(0,bi.getAddress)(e.contract.relayERC2771);case Pd.ERC2771Type.SponsoredCall:return(0,kd.isZkSync)(t)?(0,bi.getAddress)(e.contract.relay1BalanceERC2771zkSync):(0,bi.getAddress)(e.contract.relay1BalanceERC2771);case Pd.ERC2771Type.ConcurrentCallWithSyncFee:return(0,kd.isZkSync)(t)?(0,bi.getAddress)(e.contract.relayConcurrentERC2771zkSync):(0,bi.getAddress)(e.contract.relayConcurrentERC2771);case Pd.ERC2771Type.ConcurrentSponsoredCall:return(0,kd.isZkSync)(t)?(0,bi.getAddress)(e.contract.relay1BalanceConcurrentERC2771zkSync):(0,bi.getAddress)(e.contract.relay1BalanceConcurrentERC2771);default:return r}};zc.getGelatoRelayERC2771Address=tB;var Wc={},nB=oe&&oe.__awaiter||function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function o(l){try{c(r.next(l))}catch(d){a(d)}}function u(l){try{c(r.throw(l))}catch(d){a(d)}}function c(l){l.done?i(l.value):s(l.value).then(o,u)}c((r=r.apply(n,e||[])).next())})};Object.defineProperty(Wc,"__esModule",{value:!0});Wc.getProviderChainId=void 0;const rB=Hc,sB=n=>nB(void 0,void 0,void 0,function*(){let e;if((0,rB.isSigner)(n)){if(!n.provider)throw new Error("Missing provider");e=n.provider}else e=n;const{chainId:t}=yield e.getNetwork();return t});Wc.getProviderChainId=sB;var iB=oe&&oe.__awaiter||function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function o(l){try{c(r.next(l))}catch(d){a(d)}}function u(l){try{c(r.throw(l))}catch(d){a(d)}}function c(l){l.done?i(l.value):s(l.value).then(o,u)}c((r=r.apply(n,e||[])).next())})};Object.defineProperty(Df,"__esModule",{value:!0});Df.getUserNonce=void 0;const aB=Gc,oB=tt,cB=zc,uB=Wc,lB=(n,e)=>iB(void 0,void 0,void 0,function*(){const{account:t,type:r,signerOrProvider:s}=n;if(!s.provider)throw new Error("Missing provider");const i=yield(0,uB.getProviderChainId)(s);return yield new aB.Contract((0,cB.getGelatoRelayERC2771Address)({chainId:i,type:r},e),oB.USER_NONCE_ABI,s).userNonce(t)});Df.getUserNonce=lB;var $h={};Object.defineProperty($h,"__esModule",{value:!0});$h.getEIP712Domain=void 0;const Cd=Ma,Sd=zc,fB=(n,e)=>{const{chainId:t,type:r}=n;switch(r){case Cd.ERC2771Type.CallWithSyncFee:return{name:"GelatoRelayERC2771",version:"1",chainId:t.toString(),verifyingContract:(0,Sd.getGelatoRelayERC2771Address)({chainId:t,type:r},e)};case Cd.ERC2771Type.SponsoredCall:return{name:"GelatoRelay1BalanceERC2771",version:"1",chainId:t.toString(),verifyingContract:(0,Sd.getGelatoRelayERC2771Address)({chainId:t,type:r},e)};case Cd.ERC2771Type.ConcurrentCallWithSyncFee:return{name:"GelatoRelayConcurrentERC2771",version:"1",chainId:t.toString(),verifyingContract:(0,Sd.getGelatoRelayERC2771Address)({chainId:t,type:r},e)};case Cd.ERC2771Type.ConcurrentSponsoredCall:return{name:"GelatoRelay1BalanceConcurrentERC2771",version:"1",chainId:t.toString(),verifyingContract:(0,Sd.getGelatoRelayERC2771Address)({chainId:t,type:r},e)};default:return r}};$h.getEIP712Domain=fB;var Wf={};Object.defineProperty(Wf,"__esModule",{value:!0});Wf.getHttpErrorMessage=void 0;const dB=tt,hB=n=>{var e,t,r,s;return(s=(r=(t=(e=n.response)===null||e===void 0?void 0:e.data)===null||t===void 0?void 0:t.message)!==null&&r!==void 0?r:n.message)!==null&&s!==void 0?s:dB.DEFAULT_INTERNAL_ERROR_MESSAGE};Wf.getHttpErrorMessage=hB;var Hh={},Kf={};Object.defineProperty(Kf,"__esModule",{value:!0});Kf.isConcurrentRequest=void 0;const pB=n=>!!n.isConcurrent;Kf.isConcurrentRequest=pB;var Vf={};Object.defineProperty(Vf,"__esModule",{value:!0});Vf.generateSalt=void 0;const lx=Gc,bB=()=>{const n=Math.floor(Math.random()*1e6),e=lx.AbiCoder.defaultAbiCoder().encode(["uint256","uint256"],[n,new Date().getMilliseconds()]);return(0,lx.keccak256)(e)};Vf.generateSalt=bB;var gB=oe&&oe.__awaiter||function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function o(l){try{c(r.next(l))}catch(d){a(d)}}function u(l){try{c(r.throw(l))}catch(d){a(d)}}function c(l){l.done?i(l.value):s(l.value).then(o,u)}c((r=r.apply(n,e||[])).next())})};Object.defineProperty(Hh,"__esModule",{value:!0});Hh.populateOptionalUserParameters=void 0;const fx=tt,dx=Lf,yB=Df,mB=Kf,xB=Vf,wB=Wc;function vB(n,e){return gB(this,void 0,void 0,function*(){if((0,mB.isConcurrentRequest)(n.request)){const{request:t}=n,r={};return t.userDeadline||(r.userDeadline=(0,dx.calculateDeadline)(fx.DEFAULT_DEADLINE_GAP)),t.userSalt||(r.userSalt=(0,xB.generateSalt)()),r}else{const{type:t,signerOrProvider:r,request:s}=n,i={};if(s.userDeadline||(i.userDeadline=(0,dx.calculateDeadline)(fx.DEFAULT_DEADLINE_GAP)),s.userNonce===void 0){if(!r||!r.provider)throw new Error("Missing provider.");const a=yield(0,wB.getProviderChainId)(r);if(s.chainId!==a)throw new Error(`Request and provider chain id mismatch. Request: [${s.chainId.toString()}], provider: [${a.toString()}]`);i.userNonce=yield(0,yB.getUserNonce)({account:s.user,type:t,signerOrProvider:r},e)}return i}})}Hh.populateOptionalUserParameters=vB;var Gh={},ci={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.EIP712_DOMAIN_TYPE_DATA=n.RelayCall=void 0,function(e){e[e.CallWithSyncFee=0]="CallWithSyncFee",e[e.CallWithSyncFeeERC2771=1]="CallWithSyncFeeERC2771",e[e.SponsoredCall=2]="SponsoredCall",e[e.SponsoredCallERC2771=3]="SponsoredCallERC2771"}(n.RelayCall||(n.RelayCall={})),n.EIP712_DOMAIN_TYPE_DATA={EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}]}})(ci);var qf={},Lb={exports:{}},OA=function(e,t){return function(){for(var s=new Array(arguments.length),i=0;i"u"}function EB(n){return n!==null&&!Z1(n)&&n.constructor!==null&&!Z1(n.constructor)&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}var NA=ja("ArrayBuffer");function _B(n){var e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&NA(n.buffer),e}function PB(n){return typeof n=="string"}function kB(n){return typeof n=="number"}function IA(n){return n!==null&&typeof n=="object"}function w1(n){if(Mb(n)!=="object")return!1;var e=Object.getPrototypeOf(n);return e===null||e===Object.prototype}var CB=ja("Date"),SB=ja("File"),RB=ja("Blob"),TB=ja("FileList");function $b(n){return Db.call(n)==="[object Function]"}function OB(n){return IA(n)&&$b(n.pipe)}function NB(n){var e="[object FormData]";return n&&(typeof FormData=="function"&&n instanceof FormData||Db.call(n)===e||$b(n.toString)&&n.toString()===e)}var IB=ja("URLSearchParams");function BB(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function FB(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function Hb(n,e){if(!(n===null||typeof n>"u"))if(typeof n!="object"&&(n=[n]),jb(n))for(var t=0,r=n.length;t0;)i=r[s],a[i]||(e[i]=n[i],a[i]=!0);n=Object.getPrototypeOf(n)}while(n&&(!t||t(n,e))&&n!==Object.prototype);return e}function jB(n,e,t){n=String(n),(t===void 0||t>n.length)&&(t=n.length),t-=e.length;var r=n.indexOf(e,t);return r!==-1&&r===t}function $B(n){if(!n)return null;var e=n.length;if(Z1(e))return null;for(var t=new Array(e);e-- >0;)t[e]=n[e];return t}var HB=function(n){return function(e){return n&&e instanceof n}}(typeof Uint8Array<"u"&&Object.getPrototypeOf(Uint8Array)),jt={isArray:jb,isArrayBuffer:NA,isBuffer:EB,isFormData:NB,isArrayBufferView:_B,isString:PB,isNumber:kB,isObject:IA,isPlainObject:w1,isUndefined:Z1,isDate:CB,isFile:SB,isBlob:RB,isFunction:$b,isStream:OB,isURLSearchParams:IB,isStandardBrowserEnv:FB,forEach:Hb,merge:y5,extend:UB,trim:BB,stripBOM:LB,inherits:DB,toFlatObject:MB,kindOf:Mb,kindOfTest:ja,endsWith:jB,toArray:$B,isTypedArray:HB,isFileList:TB},qa=jt;function hx(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var BA=function(e,t,r){if(!t)return e;var s;if(r)s=r(t);else if(qa.isURLSearchParams(t))s=t.toString();else{var i=[];qa.forEach(t,function(u,c){u===null||typeof u>"u"||(qa.isArray(u)?c=c+"[]":u=[u],qa.forEach(u,function(d){qa.isDate(d)?d=d.toISOString():qa.isObject(d)&&(d=JSON.stringify(d)),i.push(hx(c)+"="+hx(d))}))}),s=i.join("&")}if(s){var a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e},GB=jt;function zh(){this.handlers=[]}zh.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1};zh.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};zh.prototype.forEach=function(e){GB.forEach(this.handlers,function(r){r!==null&&e(r)})};var zB=zh,WB=jt,KB=function(e,t){WB.forEach(e,function(s,i){i!==t&&i.toUpperCase()===t.toUpperCase()&&(e[t]=s,delete e[i])})},FA=jt;function Ac(n,e,t,r,s){Error.call(this),this.message=n,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),r&&(this.request=r),s&&(this.response=s)}FA.inherits(Ac,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var UA=Ac.prototype,LA={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(n){LA[n]={value:n}});Object.defineProperties(Ac,LA);Object.defineProperty(UA,"isAxiosError",{value:!0});Ac.from=function(n,e,t,r,s,i){var a=Object.create(UA);return FA.toFlatObject(n,a,function(u){return u!==Error.prototype}),Ac.call(a,n.message,e,t,r,s),a.name=n.name,i&&Object.assign(a,i),a};var Kc=Ac,DA={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},wr=jt;function VB(n,e){e=e||new FormData;var t=[];function r(i){return i===null?"":wr.isDate(i)?i.toISOString():wr.isArrayBuffer(i)||wr.isTypedArray(i)?typeof Blob=="function"?new Blob([i]):Buffer.from(i):i}function s(i,a){if(wr.isPlainObject(i)||wr.isArray(i)){if(t.indexOf(i)!==-1)throw Error("Circular reference detected in "+a);t.push(i),wr.forEach(i,function(u,c){if(!wr.isUndefined(u)){var l=a?a+"."+c:c,d;if(u&&!a&&typeof u=="object"){if(wr.endsWith(c,"{}"))u=JSON.stringify(u);else if(wr.endsWith(c,"[]")&&(d=wr.toArray(u))){d.forEach(function(f){!wr.isUndefined(f)&&e.append(l,r(f))});return}}s(u,l)}}),t.pop()}else e.append(a,r(i))}return s(n),e}var MA=VB,F2,px;function qB(){if(px)return F2;px=1;var n=Kc;return F2=function(t,r,s){var i=s.config.validateStatus;!s.status||!i||i(s.status)?t(s):r(new n("Request failed with status code "+s.status,[n.ERR_BAD_REQUEST,n.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))},F2}var U2,bx;function JB(){if(bx)return U2;bx=1;var n=jt;return U2=n.isStandardBrowserEnv()?function(){return{write:function(r,s,i,a,o,u){var c=[];c.push(r+"="+encodeURIComponent(s)),n.isNumber(i)&&c.push("expires="+new Date(i).toGMTString()),n.isString(a)&&c.push("path="+a),n.isString(o)&&c.push("domain="+o),u===!0&&c.push("secure"),document.cookie=c.join("; ")},read:function(r){var s=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),U2}var QB=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},YB=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},ZB=QB,XB=YB,jA=function(e,t){return e&&!ZB(t)?XB(e,t):t},L2,gx;function eF(){if(gx)return L2;gx=1;var n=jt,e=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return L2=function(r){var s={},i,a,o;return r&&n.forEach(r.split(` +`),function(c){if(o=c.indexOf(":"),i=n.trim(c.substr(0,o)).toLowerCase(),a=n.trim(c.substr(o+1)),i){if(s[i]&&e.indexOf(i)>=0)return;i==="set-cookie"?s[i]=(s[i]?s[i]:[]).concat([a]):s[i]=s[i]?s[i]+", "+a:a}}),s},L2}var D2,yx;function tF(){if(yx)return D2;yx=1;var n=jt;return D2=n.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),s;function i(a){var o=a;return t&&(r.setAttribute("href",o),o=r.href),r.setAttribute("href",o),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return s=i(window.location.href),function(o){var u=n.isString(o)?i(o):o;return u.protocol===s.protocol&&u.host===s.host}}():function(){return function(){return!0}}(),D2}var M2,mx;function Wh(){if(mx)return M2;mx=1;var n=Kc,e=jt;function t(r){n.call(this,r??"canceled",n.ERR_CANCELED),this.name="CanceledError"}return e.inherits(t,n,{__CANCEL__:!0}),M2=t,M2}var j2,xx;function nF(){return xx||(xx=1,j2=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}),j2}var $2,wx;function vx(){if(wx)return $2;wx=1;var n=jt,e=qB(),t=JB(),r=BA,s=jA,i=eF(),a=tF(),o=DA,u=Kc,c=Wh(),l=nF();return $2=function(f){return new Promise(function(p,b){var v=f.data,w=f.headers,m=f.responseType,x;function y(){f.cancelToken&&f.cancelToken.unsubscribe(x),f.signal&&f.signal.removeEventListener("abort",x)}n.isFormData(v)&&n.isStandardBrowserEnv()&&delete w["Content-Type"];var A=new XMLHttpRequest;if(f.auth){var S=f.auth.username||"",D=f.auth.password?unescape(encodeURIComponent(f.auth.password)):"";w.Authorization="Basic "+btoa(S+":"+D)}var O=s(f.baseURL,f.url);A.open(f.method.toUpperCase(),r(O,f.params,f.paramsSerializer),!0),A.timeout=f.timeout;function _(){if(A){var P="getAllResponseHeaders"in A?i(A.getAllResponseHeaders()):null,I=!m||m==="text"||m==="json"?A.responseText:A.response,j={data:I,status:A.status,statusText:A.statusText,headers:P,config:f,request:A};e(function(F){p(F),y()},function(F){b(F),y()},j),A=null}}if("onloadend"in A?A.onloadend=_:A.onreadystatechange=function(){!A||A.readyState!==4||A.status===0&&!(A.responseURL&&A.responseURL.indexOf("file:")===0)||setTimeout(_)},A.onabort=function(){A&&(b(new u("Request aborted",u.ECONNABORTED,f,A)),A=null)},A.onerror=function(){b(new u("Network Error",u.ERR_NETWORK,f,A,A)),A=null},A.ontimeout=function(){var I=f.timeout?"timeout of "+f.timeout+"ms exceeded":"timeout exceeded",j=f.transitional||o;f.timeoutErrorMessage&&(I=f.timeoutErrorMessage),b(new u(I,j.clarifyTimeoutError?u.ETIMEDOUT:u.ECONNABORTED,f,A)),A=null},n.isStandardBrowserEnv()){var E=(f.withCredentials||a(O))&&f.xsrfCookieName?t.read(f.xsrfCookieName):void 0;E&&(w[f.xsrfHeaderName]=E)}"setRequestHeader"in A&&n.forEach(w,function(I,j){typeof v>"u"&&j.toLowerCase()==="content-type"?delete w[j]:A.setRequestHeader(j,I)}),n.isUndefined(f.withCredentials)||(A.withCredentials=!!f.withCredentials),m&&m!=="json"&&(A.responseType=f.responseType),typeof f.onDownloadProgress=="function"&&A.addEventListener("progress",f.onDownloadProgress),typeof f.onUploadProgress=="function"&&A.upload&&A.upload.addEventListener("progress",f.onUploadProgress),(f.cancelToken||f.signal)&&(x=function(P){A&&(b(!P||P&&P.type?new c:P),A.abort(),A=null)},f.cancelToken&&f.cancelToken.subscribe(x),f.signal&&(f.signal.aborted?x():f.signal.addEventListener("abort",x))),v||(v=null);var C=l(O);if(C&&["http","https","file"].indexOf(C)===-1){b(new u("Unsupported protocol "+C+":",u.ERR_BAD_REQUEST,f));return}A.send(v)})},$2}var H2,Ax;function rF(){return Ax||(Ax=1,H2=null),H2}var St=jt,Ex=KB,_x=Kc,sF=DA,iF=MA,aF={"Content-Type":"application/x-www-form-urlencoded"};function Px(n,e){!St.isUndefined(n)&&St.isUndefined(n["Content-Type"])&&(n["Content-Type"]=e)}function oF(){var n;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(n=vx()),n}function cF(n,e,t){if(St.isString(n))try{return(e||JSON.parse)(n),St.trim(n)}catch(r){if(r.name!=="SyntaxError")throw r}return(t||JSON.stringify)(n)}var Kh={transitional:sF,adapter:oF(),transformRequest:[function(e,t){if(Ex(t,"Accept"),Ex(t,"Content-Type"),St.isFormData(e)||St.isArrayBuffer(e)||St.isBuffer(e)||St.isStream(e)||St.isFile(e)||St.isBlob(e))return e;if(St.isArrayBufferView(e))return e.buffer;if(St.isURLSearchParams(e))return Px(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var r=St.isObject(e),s=t&&t["Content-Type"],i;if((i=St.isFileList(e))||r&&s==="multipart/form-data"){var a=this.env&&this.env.FormData;return iF(i?{"files[]":e}:e,a&&new a)}else if(r||s==="application/json")return Px(t,"application/json"),cF(e);return e}],transformResponse:[function(e){var t=this.transitional||Kh.transitional,r=t&&t.silentJSONParsing,s=t&&t.forcedJSONParsing,i=!r&&this.responseType==="json";if(i||s&&St.isString(e)&&e.length)try{return JSON.parse(e)}catch(a){if(i)throw a.name==="SyntaxError"?_x.from(a,_x.ERR_BAD_RESPONSE,this,null,this.response):a}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:rF()},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};St.forEach(["delete","get","head"],function(e){Kh.headers[e]={}});St.forEach(["post","put","patch"],function(e){Kh.headers[e]=St.merge(aF)});var Gb=Kh,uF=jt,lF=Gb,fF=function(e,t,r){var s=this||lF;return uF.forEach(r,function(a){e=a.call(s,e,t)}),e},G2,kx;function $A(){return kx||(kx=1,G2=function(e){return!!(e&&e.__CANCEL__)}),G2}var Cx=jt,z2=fF,dF=$A(),hF=Gb,pF=Wh();function W2(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new pF}var bF=function(e){W2(e),e.headers=e.headers||{},e.data=z2.call(e,e.data,e.headers,e.transformRequest),e.headers=Cx.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),Cx.forEach(["delete","get","head","post","put","patch","common"],function(s){delete e.headers[s]});var t=e.adapter||hF.adapter;return t(e).then(function(s){return W2(e),s.data=z2.call(e,s.data,s.headers,e.transformResponse),s},function(s){return dF(s)||(W2(e),s&&s.response&&(s.response.data=z2.call(e,s.response.data,s.response.headers,e.transformResponse))),Promise.reject(s)})},On=jt,HA=function(e,t){t=t||{};var r={};function s(l,d){return On.isPlainObject(l)&&On.isPlainObject(d)?On.merge(l,d):On.isPlainObject(d)?On.merge({},d):On.isArray(d)?d.slice():d}function i(l){if(On.isUndefined(t[l])){if(!On.isUndefined(e[l]))return s(void 0,e[l])}else return s(e[l],t[l])}function a(l){if(!On.isUndefined(t[l]))return s(void 0,t[l])}function o(l){if(On.isUndefined(t[l])){if(!On.isUndefined(e[l]))return s(void 0,e[l])}else return s(void 0,t[l])}function u(l){if(l in t)return s(e[l],t[l]);if(l in e)return s(void 0,e[l])}var c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:u};return On.forEach(Object.keys(e).concat(Object.keys(t)),function(d){var f=c[d]||i,h=f(d);On.isUndefined(h)&&f!==u||(r[d]=h)}),r},K2,Sx;function GA(){return Sx||(Sx=1,K2={version:"0.27.2"}),K2}var gF=GA().version,xi=Kc,zb={};["object","boolean","number","function","string","symbol"].forEach(function(n,e){zb[n]=function(r){return typeof r===n||"a"+(e<1?"n ":" ")+n}});var Rx={};zb.transitional=function(e,t,r){function s(i,a){return"[Axios v"+gF+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return function(i,a,o){if(e===!1)throw new xi(s(a," has been removed"+(t?" in "+t:"")),xi.ERR_DEPRECATED);return t&&!Rx[a]&&(Rx[a]=!0,console.warn(s(a," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,a,o):!0}};function yF(n,e,t){if(typeof n!="object")throw new xi("options must be an object",xi.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(n),s=r.length;s-- >0;){var i=r[s],a=e[i];if(a){var o=n[i],u=o===void 0||a(o,i,n);if(u!==!0)throw new xi("option "+i+" must be "+u,xi.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new xi("Unknown option "+i,xi.ERR_BAD_OPTION)}}var mF={assertOptions:yF,validators:zb},zA=jt,xF=BA,Tx=zB,Ox=bF,Vh=HA,wF=jA,WA=mF,Ja=WA.validators;function Ec(n){this.defaults=n,this.interceptors={request:new Tx,response:new Tx}}Ec.prototype.request=function(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Vh(this.defaults,t),t.method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;r!==void 0&&WA.assertOptions(r,{silentJSONParsing:Ja.transitional(Ja.boolean),forcedJSONParsing:Ja.transitional(Ja.boolean),clarifyTimeoutError:Ja.transitional(Ja.boolean)},!1);var s=[],i=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(t)===!1||(i=i&&h.synchronous,s.unshift(h.fulfilled,h.rejected))});var a=[];this.interceptors.response.forEach(function(h){a.push(h.fulfilled,h.rejected)});var o;if(!i){var u=[Ox,void 0];for(Array.prototype.unshift.apply(u,s),u=u.concat(a),o=Promise.resolve(t);u.length;)o=o.then(u.shift(),u.shift());return o}for(var c=t;s.length;){var l=s.shift(),d=s.shift();try{c=l(c)}catch(f){d(f);break}}try{o=Ox(c)}catch(f){return Promise.reject(f)}for(;a.length;)o=o.then(a.shift(),a.shift());return o};Ec.prototype.getUri=function(e){e=Vh(this.defaults,e);var t=wF(e.baseURL,e.url);return xF(t,e.params,e.paramsSerializer)};zA.forEach(["delete","get","head","options"],function(e){Ec.prototype[e]=function(t,r){return this.request(Vh(r||{},{method:e,url:t,data:(r||{}).data}))}});zA.forEach(["post","put","patch"],function(e){function t(r){return function(i,a,o){return this.request(Vh(o||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}Ec.prototype[e]=t(),Ec.prototype[e+"Form"]=t(!0)});var vF=Ec,V2,Nx;function AF(){if(Nx)return V2;Nx=1;var n=Wh();function e(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var r;this.promise=new Promise(function(a){r=a});var s=this;this.promise.then(function(i){if(s._listeners){var a,o=s._listeners.length;for(a=0;aNF(void 0,void 0,void 0,function*(){try{const{relayCall:t,request:r}=n;let s;switch(t){case Rd.RelayCall.CallWithSyncFee:s=`${e.url}/relays/v2/call-with-sync-fee`;break;case Rd.RelayCall.CallWithSyncFeeERC2771:s=`${e.url}/relays/v2/call-with-sync-fee-erc2771`;break;case Rd.RelayCall.SponsoredCall:s=`${e.url}/relays/v2/sponsored-call`;break;case Rd.RelayCall.SponsoredCallERC2771:s=`${e.url}/relays/v2/sponsored-call-erc2771`;break;default:return t}return(yield IF.axiosInstance.post(s,r)).data}catch(t){throw new Error((0,BF.getHttpErrorMessage)(t))}});Gh.post=FF;var qh={};Object.defineProperty(qh,"__esModule",{value:!0});qh.isConcurrentStruct=void 0;const UF=n=>!!n.userSalt;qh.isConcurrentStruct=UF;var Jf={},Wb={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.TaskState=void 0,function(e){e.CheckPending="CheckPending",e.ExecPending="ExecPending",e.WaitingForConfirmation="WaitingForConfirmation",e.ExecSuccess="ExecSuccess",e.ExecReverted="ExecReverted",e.Cancelled="Cancelled"}(n.TaskState||(n.TaskState={}))})(Wb);Object.defineProperty(Jf,"__esModule",{value:!0});Jf.isFinalTaskState=void 0;const Q2=Wb,LF=n=>{switch(n){case Q2.TaskState.ExecSuccess:case Q2.TaskState.ExecReverted:case Q2.TaskState.Cancelled:return!0;default:return!1}};Jf.isFinalTaskState=LF;var Jh={},so=null;typeof WebSocket<"u"?so=WebSocket:typeof MozWebSocket<"u"?so=MozWebSocket:typeof global<"u"?so=global.WebSocket||global.MozWebSocket:typeof window<"u"?so=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(so=self.WebSocket||self.MozWebSocket);const DF=so,MF=Object.freeze(Object.defineProperty({__proto__:null,default:DF},Symbol.toStringTag,{value:"Module"})),jF=jn(MF);var VA={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.WebsocketEvent=void 0,function(e){e.ERROR="error",e.UPDATE="update"}(n.WebsocketEvent||(n.WebsocketEvent={}))})(VA);var R0=oe&&oe.__awaiter||function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function o(l){try{c(r.next(l))}catch(d){a(d)}}function u(l){try{c(r.throw(l))}catch(d){a(d)}}function c(l){l.done?i(l.value):s(l.value).then(o,u)}c((r=r.apply(n,e||[])).next())})},rl=oe&&oe.__classPrivateFieldSet||function(n,e,t,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!s:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(n,t):s?s.value=t:e.set(n,t),t},Je=oe&&oe.__classPrivateFieldGet||function(n,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(n):r?r.value:e.get(n)},$F=oe&&oe.__importDefault||function(n){return n&&n.__esModule?n:{default:n}},_l,F0,gi,yi,kt,m5,x5;Object.defineProperty(Jh,"__esModule",{value:!0});Jh.WebsocketHandler=void 0;const Td=$F(jF),HF=Jf,Ux=VA;class GF{constructor(e){_l.set(this,void 0),F0.set(this,new Set),gi.set(this,[]),yi.set(this,[]),kt.set(this,void 0),m5.set(this,1e3),x5.set(this,1e4),rl(this,_l,`${e}/tasks/ws/status`,"f")}onUpdate(e){if(!e)throw new Error("Callback handler is not provided");Je(this,gi,"f").push(e),this._connect()}offUpdate(e){if(!e)throw new Error("Callback handler is not provided");rl(this,gi,Je(this,gi,"f").filter(t=>t!==e),"f"),this._disconnectIfUnused()}onError(e){if(!e)throw new Error("Callback handler is not provided");Je(this,yi,"f").push(e),this._connect()}offError(e){if(!e)throw new Error("Callback handler is not provided");rl(this,yi,Je(this,yi,"f").filter(t=>t!==e),"f"),this._disconnectIfUnused()}subscribe(e){return R0(this,void 0,void 0,function*(){Je(this,F0,"f").has(e)||(Je(this,F0,"f").add(e),yield this._sendWebsocketMessage({action:"subscribe",taskId:e}))})}unsubscribe(e){return R0(this,void 0,void 0,function*(){Je(this,F0,"f").has(e)&&(Je(this,F0,"f").delete(e),yield this._sendWebsocketMessage({action:"unsubscribe",taskId:e}))})}hasHandlers(){return Je(this,gi,"f").length>0||Je(this,yi,"f").length>0}_connect(){Je(this,kt,"f")||(rl(this,kt,new Td.default(Je(this,_l,"f")),"f"),Je(this,kt,"f").onopen=()=>R0(this,void 0,void 0,function*(){Je(this,F0,"f").forEach(e=>{this._sendWebsocketMessage({action:"subscribe",taskId:e})})}),Je(this,kt,"f").onclose=()=>{setTimeout(()=>{this._reconnect()},Je(this,m5,"f"))},Je(this,kt,"f").onerror=e=>{this._handleError(e)},Je(this,kt,"f").onmessage=e=>R0(this,void 0,void 0,function*(){const t=JSON.parse(e.data.toString());switch(t.event){case Ux.WebsocketEvent.ERROR:{const s=t.payload;this._handleError(s);break}case Ux.WebsocketEvent.UPDATE:{const s=t.payload;Je(this,gi,"f").forEach(i=>{i(s)}),(0,HF.isFinalTaskState)(s.taskState)&&(yield this.unsubscribe(s.taskId));break}}}))}_sendWebsocketMessage(e){return R0(this,void 0,void 0,function*(){(yield this._ensureIsConnected())&&Je(this,kt,"f").send(JSON.stringify(e))})}_disconnectIfUnused(){Je(this,gi,"f").length===0&&Je(this,yi,"f").length===0&&Je(this,kt,"f")&&this._disconnect()}_disconnect(){Je(this,kt,"f")&&(Je(this,kt,"f").close(),rl(this,kt,void 0,"f"))}_reconnect(){this._disconnect(),this._connect()}_ensureIsConnected(){return R0(this,void 0,void 0,function*(){return Je(this,kt,"f")?Je(this,kt,"f").readyState!==Td.default.CONNECTING&&Je(this,kt,"f").readyState!==Td.default.OPEN&&this._reconnect():this._connect(),yield this._awaitConnection()})}_awaitConnection(){return R0(this,void 0,void 0,function*(){const e=Date.now();for(;!Je(this,kt,"f")||Je(this,kt,"f").readyState!==Td.default.OPEN;){const t=Date.now()-e;if(t>Je(this,x5,"f"))return this._handleError(new Error(`Timeout connecting to ${Je(this,_l,"f")} after ${t}ms`)),!1;yield new Promise(r=>setTimeout(r,10))}return!0})}_handleError(e){Je(this,yi,"f").forEach(t=>{t(e)})}}Jh.WebsocketHandler=GF;_l=new WeakMap,F0=new WeakMap,gi=new WeakMap,yi=new WeakMap,kt=new WeakMap,m5=new WeakMap,x5=new WeakMap;(function(n){var e=oe&&oe.__createBinding||(Object.create?function(r,s,i,a){a===void 0&&(a=i);var o=Object.getOwnPropertyDescriptor(s,i);(!o||("get"in o?!s.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(r,a,o)}:function(r,s,i,a){a===void 0&&(a=i),r[a]=s[i]}),t=oe&&oe.__exportStar||function(r,s){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&e(s,r,i)};Object.defineProperty(n,"__esModule",{value:!0}),t(Lh,n),t(Lf,n),t(Df,n),t($h,n),t(Wf,n),t(Hh,n),t(Gh,n),t(Hc,n),t(zc,n),t(zf,n),t(Wc,n),t(qf,n),t(qh,n),t(Kf,n),t(Vf,n),t(Jf,n),t(Jh,n)})(Dt);var $a={};(function(n){var e=oe&&oe.__awaiter||function(i,a,o,u){function c(l){return l instanceof o?l:new o(function(d){d(l)})}return new(o||(o=Promise))(function(l,d){function f(b){try{p(u.next(b))}catch(v){d(v)}}function h(b){try{p(u.throw(b))}catch(v){d(v)}}function p(b){b.done?l(b.value):c(b.value).then(f,h)}p((u=u.apply(i,a||[])).next())})};Object.defineProperty(n,"__esModule",{value:!0}),n.getSupportedNetworks=n.isNetworkSupported=void 0;const t=Dt,r=(i,a)=>e(void 0,void 0,void 0,function*(){return(yield(0,n.getSupportedNetworks)(a)).includes(i.chainId.toString())});n.isNetworkSupported=r;const s=i=>e(void 0,void 0,void 0,function*(){try{return(yield t.axiosInstance.get(`${i.url}/relays/v2`)).data.relays}catch(a){throw new Error(`GelatoRelaySDK/getSupportedNetworks: Failed with error: ${(0,t.getHttpErrorMessage)(a)}`)}});n.getSupportedNetworks=s})($a);var zF=oe&&oe.__awaiter||function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function o(l){try{c(r.next(l))}catch(d){a(d)}}function u(l){try{c(r.throw(l))}catch(d){a(d)}}function c(l){l.done?i(l.value):s(l.value).then(o,u)}c((r=r.apply(n,e||[])).next())})};Object.defineProperty(Uh,"__esModule",{value:!0});Uh.relayWithSyncFee=void 0;const Lx=Dt,WF=$a,KF=ci,VF=(n,e)=>zF(void 0,void 0,void 0,function*(){var t;try{const{request:r,options:s,sponsorApiKey:i}=n;if(!(yield(0,WF.isNetworkSupported)({chainId:r.chainId},e)))throw new Error(`Chain id [${r.chainId}] is not supported`);return yield(0,Lx.post)({relayCall:KF.RelayCall.CallWithSyncFee,request:Object.assign(Object.assign({},r),{isRelayContext:(t=r.isRelayContext)!==null&&t!==void 0?t:!0,sponsorApiKey:i,chainId:r.chainId.toString(),gasLimit:s!=null&&s.gasLimit?s.gasLimit.toString():void 0,retries:s==null?void 0:s.retries})},e)}catch(r){throw new Error(`GelatoRelaySDK/relayWithSyncFee: Failed with error: ${(0,Lx.getHttpErrorMessage)(r)}`)}});Uh.relayWithSyncFee=VF;var Qh={},qA=oe&&oe.__awaiter||function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function o(l){try{c(r.next(l))}catch(d){a(d)}}function u(l){try{c(r.throw(l))}catch(d){a(d)}}function c(l){l.done?i(l.value):s(l.value).then(o,u)}c((r=r.apply(n,e||[])).next())})};Object.defineProperty(Qh,"__esModule",{value:!0});Qh.relayWithSponsoredCall=void 0;const qF=Gc,JF=Dt,QF=$a,YF=ci,ZF=(n,e)=>qA(void 0,void 0,void 0,function*(){return yield eU(n,e)});Qh.relayWithSponsoredCall=ZF;const XF=n=>({chainId:n.chainId.toString(),target:(0,qF.getAddress)(n.target),data:n.data}),eU=(n,e)=>qA(void 0,void 0,void 0,function*(){try{const{request:t,sponsorApiKey:r,options:s}=n;if(!(yield(0,QF.isNetworkSupported)({chainId:t.chainId},e)))throw new Error(`Chain id [${t.chainId}] is not supported`);const a=yield XF(t);return yield(0,JF.post)({relayCall:YF.RelayCall.SponsoredCall,request:Object.assign(Object.assign({},a),{sponsorApiKey:r,gasLimit:s!=null&&s.gasLimit?s.gasLimit.toString():void 0,retries:s==null?void 0:s.retries})},e)}catch(t){const r=t.message;throw new Error(`GelatoRelaySDK/sponsoredCall: Failed with error: ${r}`)}});var JA={},Vc={},Qf={},QA={},Yh={},Zh={},tU=oe&&oe.__awaiter||function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function o(l){try{c(r.next(l))}catch(d){a(d)}}function u(l){try{c(r.throw(l))}catch(d){a(d)}}function c(l){l.done?i(l.value):s(l.value).then(o,u)}c((r=r.apply(n,e||[])).next())})};Object.defineProperty(Zh,"__esModule",{value:!0});Zh.mapRequestToStruct=void 0;const Od=Gc,nU=Dt;function rU(n,e){var t,r,s;return tU(this,void 0,void 0,function*(){if(!e.userDeadline&&!n.userDeadline)throw new Error("userDeadline is not found in the request, nor fetched");if((0,nU.isConcurrentRequest)(n)){const i=e;return{userDeadline:(t=i.userDeadline)!==null&&t!==void 0?t:n.userDeadline,chainId:n.chainId,target:(0,Od.getAddress)(n.target),data:n.data,user:(0,Od.getAddress)(n.user),userSalt:(r=i.userSalt)!==null&&r!==void 0?r:n.userSalt}}else{const i=e;if(i.userNonce===void 0&&n.userNonce===void 0)throw new Error("userNonce is not found in the request, nor fetched");return{userDeadline:(s=i.userDeadline)!==null&&s!==void 0?s:n.userDeadline,chainId:n.chainId,target:(0,Od.getAddress)(n.target),data:n.data,user:(0,Od.getAddress)(n.user),userNonce:i.userNonce!==void 0?i.userNonce:n.userNonce}}})}Zh.mapRequestToStruct=rU;var Xh={};Object.defineProperty(Xh,"__esModule",{value:!0});Xh.getPayloadToSign=void 0;const sU=Dt,Nd=ci,Kn=Ma;function iU(n,e){const{isSigner:t,struct:r,type:s}=n,i=(0,sU.getEIP712Domain)({chainId:BigInt(r.chainId),type:s},e);switch(s){case Kn.ERC2771Type.SponsoredCall:return t?{domain:i,types:Object.assign({},Kn.EIP712_SPONSORED_CALL_ERC2771_TYPE_DATA),message:r}:{domain:i,types:Object.assign(Object.assign({},Kn.EIP712_SPONSORED_CALL_ERC2771_TYPE_DATA),Nd.EIP712_DOMAIN_TYPE_DATA),primaryType:"SponsoredCallERC2771",message:r};case Kn.ERC2771Type.CallWithSyncFee:return t?{domain:i,types:Object.assign({},Kn.EIP712_CALL_WITH_SYNC_FEE_ERC2771_TYPE_DATA),message:r}:{domain:i,types:Object.assign(Object.assign({},Kn.EIP712_CALL_WITH_SYNC_FEE_ERC2771_TYPE_DATA),Nd.EIP712_DOMAIN_TYPE_DATA),primaryType:"CallWithSyncFeeERC2771",message:r};case Kn.ERC2771Type.ConcurrentSponsoredCall:return t?{domain:i,types:Object.assign({},Kn.EIP712_SPONSORED_CALL_CONCURRENT_ERC2771_TYPE_DATA),message:r}:{domain:i,types:Object.assign(Object.assign({},Kn.EIP712_SPONSORED_CALL_CONCURRENT_ERC2771_TYPE_DATA),Nd.EIP712_DOMAIN_TYPE_DATA),primaryType:"SponsoredCallConcurrentERC2771",message:r};case Kn.ERC2771Type.ConcurrentCallWithSyncFee:return t?{domain:i,types:Object.assign({},Kn.EIP712_CALL_WITH_SYNC_FEE_CONCURRENT_ERC2771_TYPE_DATA),message:r}:{domain:i,types:Object.assign(Object.assign({},Kn.EIP712_CALL_WITH_SYNC_FEE_CONCURRENT_ERC2771_TYPE_DATA),Nd.EIP712_DOMAIN_TYPE_DATA),primaryType:"CallWithSyncFeeConcurrentERC2771",message:r};default:return s}}Xh.getPayloadToSign=iU;var a0={};Object.defineProperty(a0,"__esModule",{value:!0});a0.safeTransformStruct=void 0;const aU=Dt;function oU(n){return(0,aU.isConcurrentStruct)(n)?Object.assign(Object.assign({},n),{chainId:n.chainId.toString()}):Object.assign(Object.assign({},n),{chainId:n.chainId.toString(),userNonce:n.userNonce.toString()})}a0.safeTransformStruct=oU;var cU=oe&&oe.__awaiter||function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function o(l){try{c(r.next(l))}catch(d){a(d)}}function u(l){try{c(r.throw(l))}catch(d){a(d)}}function c(l){l.done?i(l.value):s(l.value).then(o,u)}c((r=r.apply(n,e||[])).next())})};Object.defineProperty(Yh,"__esModule",{value:!0});Yh.populatePayloadToSign=void 0;const sl=Dt,Dx=Zh,Mx=Xh,jx=a0;function uU(n,e){return cU(this,void 0,void 0,function*(){const{request:t,signerOrProvider:r}=n;if((0,sl.isConcurrentRequest)(t)){const s=n.type,i=yield(0,sl.populateOptionalUserParameters)({request:t,type:s,signerOrProvider:r},e),a=yield(0,Dx.mapRequestToStruct)(t,i),o=(0,jx.safeTransformStruct)(a),u=(0,Mx.getPayloadToSign)({struct:o,type:s,isSigner:r?(0,sl.isSigner)(r):void 0},e);return{struct:a,typedData:u}}else{const s=n.type,i=yield(0,sl.populateOptionalUserParameters)({request:t,type:s,signerOrProvider:r},e),a=yield(0,Dx.mapRequestToStruct)(t,i),o=(0,jx.safeTransformStruct)(a),u=(0,Mx.getPayloadToSign)({struct:o,type:s,isSigner:r?(0,sl.isSigner)(r):void 0},e);return{struct:a,typedData:u}}})}Yh.populatePayloadToSign=uU;(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.populatePayloadToSign=void 0;var e=Yh;Object.defineProperty(n,"populatePayloadToSign",{enumerable:!0,get:function(){return e.populatePayloadToSign}})})(QA);var lU=oe&&oe.__awaiter||function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function o(l){try{c(r.next(l))}catch(d){a(d)}}function u(l){try{c(r.throw(l))}catch(d){a(d)}}function c(l){l.done?i(l.value):s(l.value).then(o,u)}c((r=r.apply(n,e||[])).next())})};Object.defineProperty(Qf,"__esModule",{value:!0});Qf.getDataToSignERC2771=void 0;const fU=Dt,dU=$a,$x=QA;function hU(n,e){return lU(this,void 0,void 0,function*(){try{const{request:t,signerOrProvider:r}=n,{chainId:s}=t;if(!(yield(0,dU.isNetworkSupported)({chainId:s},e)))throw new Error(`Chain id [${s.toString()}] is not supported`);if((0,fU.isConcurrentRequest)(t)){const a=n.type,{struct:o,typedData:u}=yield(0,$x.populatePayloadToSign)({request:t,type:a,signerOrProvider:r},e);return{struct:o,typedData:u}}else{const a=n.type,{struct:o,typedData:u}=yield(0,$x.populatePayloadToSign)({request:t,type:a,signerOrProvider:r},e);return{struct:o,typedData:u}}}catch(t){const r=t.message;throw new Error(`GelatoRelaySDK/getDataToSignERC2771: Failed with error: ${r}`)}})}Qf.getDataToSignERC2771=hU;var pU=oe&&oe.__awaiter||function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function o(l){try{c(r.next(l))}catch(d){a(d)}}function u(l){try{c(r.throw(l))}catch(d){a(d)}}function c(l){l.done?i(l.value):s(l.value).then(o,u)}c((r=r.apply(n,e||[])).next())})};Object.defineProperty(Vc,"__esModule",{value:!0});Vc.getSignatureDataERC2771=void 0;const Y2=Dt,Hx=Qf;function bU(n,e){return pU(this,void 0,void 0,function*(){try{const{request:t,signerOrProvider:r}=n;if((0,Y2.isConcurrentRequest)(t)){const s=n.type,{struct:i,typedData:a}=yield(0,Hx.getDataToSignERC2771)({request:t,signerOrProvider:r,type:s},e),o=yield(0,Y2.signTypedDataV4)(r,t.user,a);return{struct:i,signature:o}}else{const s=n.type,{struct:i,typedData:a}=yield(0,Hx.getDataToSignERC2771)({request:t,signerOrProvider:r,type:s},e),o=yield(0,Y2.signTypedDataV4)(r,t.user,a);return{struct:i,signature:o}}}catch(t){const r=t.message;throw new Error(`GelatoRelaySDK/getSignatureDataERC2771: Failed with error: ${r}`)}})}Vc.getSignatureDataERC2771=bU;var e6={},YA=oe&&oe.__awaiter||function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function o(l){try{c(r.next(l))}catch(d){a(d)}}function u(l){try{c(r.throw(l))}catch(d){a(d)}}function c(l){l.done?i(l.value):s(l.value).then(o,u)}c((r=r.apply(n,e||[])).next())})};Object.defineProperty(e6,"__esModule",{value:!0});e6.relayWithSponsoredCallERC2771=void 0;const Z2=Dt,Gx=ci,zx=Ma,Wx=Vc,Kx=a0,gU=(n,e)=>YA(void 0,void 0,void 0,function*(){return yield yU(n,e)});e6.relayWithSponsoredCallERC2771=gU;const yU=(n,e)=>YA(void 0,void 0,void 0,function*(){try{const{request:t,sponsorApiKey:r,signerOrProvider:s,options:i}=n;if((0,Z2.isConcurrentRequest)(t)){const o=zx.ERC2771Type.ConcurrentSponsoredCall,{struct:u,signature:c}=yield(0,Wx.getSignatureDataERC2771)({request:t,signerOrProvider:s,type:o},e);return yield(0,Z2.post)({relayCall:Gx.RelayCall.SponsoredCallERC2771,request:Object.assign(Object.assign({},(0,Kx.safeTransformStruct)(u)),{userSignature:c,sponsorApiKey:r,isConcurrent:!0,gasLimit:i!=null&&i.gasLimit?i.gasLimit.toString():void 0,retries:i==null?void 0:i.retries})},e)}else{const o=zx.ERC2771Type.SponsoredCall,{struct:u,signature:c}=yield(0,Wx.getSignatureDataERC2771)({request:t,signerOrProvider:s,type:o},e);return yield(0,Z2.post)({relayCall:Gx.RelayCall.SponsoredCallERC2771,request:Object.assign(Object.assign({},(0,Kx.safeTransformStruct)(u)),{userSignature:c,sponsorApiKey:r,isConcurrent:!1,gasLimit:i!=null&&i.gasLimit?i.gasLimit.toString():void 0,retries:i==null?void 0:i.retries})},e)}}catch(t){const r=t.message;throw new Error(`GelatoRelaySDK/sponsoredCallERC2771: Failed with error: ${r}`)}});var t6={},mU=oe&&oe.__awaiter||function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function o(l){try{c(r.next(l))}catch(d){a(d)}}function u(l){try{c(r.throw(l))}catch(d){a(d)}}function c(l){l.done?i(l.value):s(l.value).then(o,u)}c((r=r.apply(n,e||[])).next())})};Object.defineProperty(t6,"__esModule",{value:!0});t6.sponsoredCallERC2771WithSignature=void 0;const X2=Dt,xU=$a,Vx=ci,qx=a0,wU=(n,e)=>mU(void 0,void 0,void 0,function*(){try{const{signature:t,sponsorApiKey:r,struct:s,options:i}=n;if(!(yield(0,xU.isNetworkSupported)({chainId:s.chainId},e)))throw new Error(`Chain id [${s.chainId}] is not supported`);return(0,X2.isConcurrentStruct)(s)?yield(0,X2.post)({relayCall:Vx.RelayCall.SponsoredCallERC2771,request:Object.assign(Object.assign({},(0,qx.safeTransformStruct)(s)),{userSignature:t,sponsorApiKey:r,isConcurrent:!0,gasLimit:i!=null&&i.gasLimit?i.gasLimit.toString():void 0,retries:i==null?void 0:i.retries})},e):yield(0,X2.post)({relayCall:Vx.RelayCall.SponsoredCallERC2771,request:Object.assign(Object.assign({},(0,qx.safeTransformStruct)(s)),{userSignature:t,sponsorApiKey:r,isConcurrent:!1,gasLimit:i!=null&&i.gasLimit?i.gasLimit.toString():void 0,retries:i==null?void 0:i.retries})},e)}catch(t){const r=t.message;throw new Error(`GelatoRelaySDK/sponsoredCallERC2771WithSignature: Failed with error: ${r}`)}});t6.sponsoredCallERC2771WithSignature=wU;var n6={},vU=oe&&oe.__awaiter||function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function o(l){try{c(r.next(l))}catch(d){a(d)}}function u(l){try{c(r.throw(l))}catch(d){a(d)}}function c(l){l.done?i(l.value):s(l.value).then(o,u)}c((r=r.apply(n,e||[])).next())})};Object.defineProperty(n6,"__esModule",{value:!0});n6.relayWithCallWithSyncFeeERC2771=void 0;const Jx=Dt,Qx=ci,Yx=Ma,Zx=Vc,Xx=a0,AU=(n,e)=>vU(void 0,void 0,void 0,function*(){try{const{request:t,signerOrProvider:r,options:s,sponsorApiKey:i}=n;if(t.isConcurrent){const{isRelayContext:o,feeToken:u}=t,c=Yx.ERC2771Type.ConcurrentCallWithSyncFee,{struct:l,signature:d}=yield(0,Zx.getSignatureDataERC2771)({request:t,signerOrProvider:r,type:c},e);return yield(0,Jx.post)({relayCall:Qx.RelayCall.CallWithSyncFeeERC2771,request:Object.assign(Object.assign({},(0,Xx.safeTransformStruct)(l)),{feeToken:u,isRelayContext:o??!0,userSignature:d,isConcurrent:!0,sponsorApiKey:i,gasLimit:s!=null&&s.gasLimit?s.gasLimit.toString():void 0,retries:s==null?void 0:s.retries})},e)}else{const{isRelayContext:o,feeToken:u}=t,c=Yx.ERC2771Type.CallWithSyncFee,{struct:l,signature:d}=yield(0,Zx.getSignatureDataERC2771)({request:t,signerOrProvider:r,type:c},e);return yield(0,Jx.post)({relayCall:Qx.RelayCall.CallWithSyncFeeERC2771,request:Object.assign(Object.assign({},(0,Xx.safeTransformStruct)(l)),{feeToken:u,isRelayContext:o??!0,userSignature:d,isConcurrent:!1,sponsorApiKey:i,gasLimit:s!=null&&s.gasLimit?s.gasLimit.toString():void 0,retries:s==null?void 0:s.retries})},e)}}catch(t){const r=t.message;throw new Error(`GelatoRelaySDK/callWithSyncFeeERC2771: Failed with error: ${r}`)}});n6.relayWithCallWithSyncFeeERC2771=AU;var r6={},EU=oe&&oe.__awaiter||function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function o(l){try{c(r.next(l))}catch(d){a(d)}}function u(l){try{c(r.throw(l))}catch(d){a(d)}}function c(l){l.done?i(l.value):s(l.value).then(o,u)}c((r=r.apply(n,e||[])).next())})};Object.defineProperty(r6,"__esModule",{value:!0});r6.callWithSyncFeeERC2771WithSignature=void 0;const ep=Dt,_U=$a,e4=ci,t4=a0,PU=(n,e)=>EU(void 0,void 0,void 0,function*(){var t,r;try{const{signature:s,struct:i,syncFeeParams:a,options:o,sponsorApiKey:u}=n;if(!(yield(0,_U.isNetworkSupported)({chainId:i.chainId},e)))throw new Error(`Chain id [${i.chainId}] is not supported`);return(0,ep.isConcurrentStruct)(i)?yield(0,ep.post)({relayCall:e4.RelayCall.CallWithSyncFeeERC2771,request:Object.assign(Object.assign(Object.assign({},(0,t4.safeTransformStruct)(i)),a),{isRelayContext:(t=a.isRelayContext)!==null&&t!==void 0?t:!0,userSignature:s,isConcurrent:!0,sponsorApiKey:u,gasLimit:o!=null&&o.gasLimit?o.gasLimit.toString():void 0,retries:o==null?void 0:o.retries})},e):yield(0,ep.post)({relayCall:e4.RelayCall.CallWithSyncFeeERC2771,request:Object.assign(Object.assign(Object.assign({},(0,t4.safeTransformStruct)(i)),a),{isRelayContext:(r=a.isRelayContext)!==null&&r!==void 0?r:!0,userSignature:s,isConcurrent:!1,sponsorApiKey:u,gasLimit:o!=null&&o.gasLimit?o.gasLimit.toString():void 0,retries:o==null?void 0:o.retries})},e)}catch(s){const i=s.message;throw new Error(`GelatoRelaySDK/callWithSyncFeeERC2771WithSignature: Failed with error: ${i}`)}});r6.callWithSyncFeeERC2771WithSignature=PU;(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.callWithSyncFeeERC2771WithSignature=n.relayWithCallWithSyncFeeERC2771=n.sponsoredCallERC2771WithSignature=n.relayWithSponsoredCallERC2771=n.getDataToSignERC2771=n.getSignatureDataERC2771=void 0;var e=Vc;Object.defineProperty(n,"getSignatureDataERC2771",{enumerable:!0,get:function(){return e.getSignatureDataERC2771}});var t=Qf;Object.defineProperty(n,"getDataToSignERC2771",{enumerable:!0,get:function(){return t.getDataToSignERC2771}});var r=e6;Object.defineProperty(n,"relayWithSponsoredCallERC2771",{enumerable:!0,get:function(){return r.relayWithSponsoredCallERC2771}});var s=t6;Object.defineProperty(n,"sponsoredCallERC2771WithSignature",{enumerable:!0,get:function(){return s.sponsoredCallERC2771WithSignature}});var i=n6;Object.defineProperty(n,"relayWithCallWithSyncFeeERC2771",{enumerable:!0,get:function(){return i.relayWithCallWithSyncFeeERC2771}});var a=r6;Object.defineProperty(n,"callWithSyncFeeERC2771WithSignature",{enumerable:!0,get:function(){return a.callWithSyncFeeERC2771WithSignature}})})(JA);var ZA={};(function(n){var e=oe&&oe.__awaiter||function(o,u,c,l){function d(f){return f instanceof c?f:new c(function(h){h(f)})}return new(c||(c=Promise))(function(f,h){function p(w){try{v(l.next(w))}catch(m){h(m)}}function b(w){try{v(l.throw(w))}catch(m){h(m)}}function v(w){w.done?f(w.value):d(w.value).then(p,b)}v((l=l.apply(o,u||[])).next())})};Object.defineProperty(n,"__esModule",{value:!0}),n.getEstimatedFee=n.getPaymentTokens=n.getGelatoOracles=n.isOracleActive=void 0;const t=Dt,r=(o,u)=>e(void 0,void 0,void 0,function*(){return(yield(0,n.getGelatoOracles)(u)).includes(o.chainId.toString())});n.isOracleActive=r;const s=o=>e(void 0,void 0,void 0,function*(){try{return(yield t.axiosInstance.get(`${o.url}/oracles/`)).data.oracles}catch(u){throw new Error(`GelatoRelaySDK/getGelatoOracles: Failed with error: ${(0,t.getHttpErrorMessage)(u)}`)}});n.getGelatoOracles=s;const i=(o,u)=>e(void 0,void 0,void 0,function*(){try{return(yield t.axiosInstance.get(`${u.url}/oracles/${o.chainId.toString()}/paymentTokens/`)).data.paymentTokens}catch(c){throw new Error(`GelatoRelaySDK/getPaymentTokens: Failed with error: ${(0,t.getHttpErrorMessage)(c)}`)}});n.getPaymentTokens=i;const a=(o,u)=>e(void 0,void 0,void 0,function*(){const{chainId:c,gasLimit:l,gasLimitL1:d,isHighPriority:f,paymentToken:h}=o,p={paymentToken:h,gasLimit:l.toString(),isHighPriority:f,gasLimitL1:d.toString()};try{const b=yield t.axiosInstance.get(`${u.url}/oracles/${c.toString()}/estimate`,{params:p});return BigInt(b.data.estimatedFee)}catch(b){throw new Error(`GelatoRelaySDK/getEstimatedFee: Failed with error: ${(0,t.getHttpErrorMessage)(b)}`)}});n.getEstimatedFee=a})(ZA);var s6={},kU=oe&&oe.__awaiter||function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function o(l){try{c(r.next(l))}catch(d){a(d)}}function u(l){try{c(r.throw(l))}catch(d){a(d)}}function c(l){l.done?i(l.value):s(l.value).then(o,u)}c((r=r.apply(n,e||[])).next())})};Object.defineProperty(s6,"__esModule",{value:!0});s6.getTaskStatus=void 0;const n4=Dt,CU=(n,e)=>kU(void 0,void 0,void 0,function*(){try{return(yield n4.axiosInstance.get(`${e.url}/tasks/status/${n.taskId}`)).data.task}catch(t){throw new Error(`GelatoRelaySDK/getTaskStatus: Failed with error: ${(0,n4.getHttpErrorMessage)(t)}`)}});s6.getTaskStatus=CU;(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.getTaskStatus=n.isNetworkSupported=n.getSupportedNetworks=n.isOracleActive=n.getPaymentTokens=n.getGelatoOracles=n.getEstimatedFee=n.relayWithCallWithSyncFeeERC2771=n.callWithSyncFeeERC2771WithSignature=n.sponsoredCallERC2771WithSignature=n.getDataToSignERC2771=n.getSignatureDataERC2771=n.relayWithSponsoredCallERC2771=n.relayWithSponsoredCall=n.relayWithSyncFee=void 0;var e=Uh;Object.defineProperty(n,"relayWithSyncFee",{enumerable:!0,get:function(){return e.relayWithSyncFee}});var t=Qh;Object.defineProperty(n,"relayWithSponsoredCall",{enumerable:!0,get:function(){return t.relayWithSponsoredCall}});var r=JA;Object.defineProperty(n,"relayWithSponsoredCallERC2771",{enumerable:!0,get:function(){return r.relayWithSponsoredCallERC2771}}),Object.defineProperty(n,"getSignatureDataERC2771",{enumerable:!0,get:function(){return r.getSignatureDataERC2771}}),Object.defineProperty(n,"getDataToSignERC2771",{enumerable:!0,get:function(){return r.getDataToSignERC2771}}),Object.defineProperty(n,"sponsoredCallERC2771WithSignature",{enumerable:!0,get:function(){return r.sponsoredCallERC2771WithSignature}}),Object.defineProperty(n,"callWithSyncFeeERC2771WithSignature",{enumerable:!0,get:function(){return r.callWithSyncFeeERC2771WithSignature}}),Object.defineProperty(n,"relayWithCallWithSyncFeeERC2771",{enumerable:!0,get:function(){return r.relayWithCallWithSyncFeeERC2771}});var s=ZA;Object.defineProperty(n,"getEstimatedFee",{enumerable:!0,get:function(){return s.getEstimatedFee}}),Object.defineProperty(n,"getGelatoOracles",{enumerable:!0,get:function(){return s.getGelatoOracles}}),Object.defineProperty(n,"getPaymentTokens",{enumerable:!0,get:function(){return s.getPaymentTokens}}),Object.defineProperty(n,"isOracleActive",{enumerable:!0,get:function(){return s.isOracleActive}});var i=$a;Object.defineProperty(n,"getSupportedNetworks",{enumerable:!0,get:function(){return i.getSupportedNetworks}}),Object.defineProperty(n,"isNetworkSupported",{enumerable:!0,get:function(){return i.isNetworkSupported}});var a=s6;Object.defineProperty(n,"getTaskStatus",{enumerable:!0,get:function(){return a.getTaskStatus}})})(Jv);(function(n){var e=oe&&oe.__createBinding||(Object.create?function(b,v,w,m){m===void 0&&(m=w);var x=Object.getOwnPropertyDescriptor(v,w);(!x||("get"in x?!v.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return v[w]}}),Object.defineProperty(b,m,x)}:function(b,v,w,m){m===void 0&&(m=w),b[m]=v[w]}),t=oe&&oe.__setModuleDefault||(Object.create?function(b,v){Object.defineProperty(b,"default",{enumerable:!0,value:v})}:function(b,v){b.default=v}),r=oe&&oe.__importStar||function(b){if(b&&b.__esModule)return b;var v={};if(b!=null)for(var w in b)w!=="default"&&Object.prototype.hasOwnProperty.call(b,w)&&e(v,b,w);return t(v,b),v},s=oe&&oe.__awaiter||function(b,v,w,m){function x(y){return y instanceof w?y:new w(function(A){A(y)})}return new(w||(w=Promise))(function(y,A){function S(_){try{O(m.next(_))}catch(E){A(E)}}function D(_){try{O(m.throw(_))}catch(E){A(E)}}function O(_){_.done?y(_.value):x(_.value).then(S,D)}O((m=m.apply(b,v||[])).next())})},i=oe&&oe.__classPrivateFieldSet||function(b,v,w,m,x){if(m==="m")throw new TypeError("Private method is not writable");if(m==="a"&&!x)throw new TypeError("Private accessor was defined without a setter");if(typeof v=="function"?b!==v||!x:!v.has(b))throw new TypeError("Cannot write private member to an object whose class did not declare it");return m==="a"?x.call(b,w):x?x.value=w:v.set(b,w),w},a=oe&&oe.__classPrivateFieldGet||function(b,v,w,m){if(w==="a"&&!m)throw new TypeError("Private accessor was defined without a getter");if(typeof v=="function"?b!==v||!m:!v.has(b))throw new TypeError("Cannot read private member from an object whose class did not declare it");return w==="m"?m:w==="a"?m.call(b):m?m.value:v.get(b)},o,u;Object.defineProperty(n,"__esModule",{value:!0}),n.GelatoRelay=n.TaskState=n.ERC2771Type=void 0;const c=r(Jv),l=Ma;Object.defineProperty(n,"ERC2771Type",{enumerable:!0,get:function(){return l.ERC2771Type}});const d=Wb;Object.defineProperty(n,"TaskState",{enumerable:!0,get:function(){return d.TaskState}});const f=tt,h=Dt;class p{constructor(v){o.set(this,void 0),u.set(this,void 0),this.configure=w=>{i(this,o,this._getConfiguration(w),"f")},this._getConfiguration=w=>{var m,x,y,A,S,D,O,_,E,C,P,I,j,z,F,W,H;const L=(m=w==null?void 0:w.url)!==null&&m!==void 0?m:f.GELATO_RELAY_URL;return{url:L,websocketUrl:L.replace(/^http/,"ws"),contract:{relayERC2771:(y=(x=w==null?void 0:w.contract)===null||x===void 0?void 0:x.relayERC2771)!==null&&y!==void 0?y:f.GELATO_RELAY_ERC2771_ADDRESS,relay1BalanceERC2771:(S=(A=w==null?void 0:w.contract)===null||A===void 0?void 0:A.relay1BalanceERC2771)!==null&&S!==void 0?S:f.GELATO_RELAY_1BALANCE_ERC2771_ADDRESS,relayERC2771zkSync:(O=(D=w==null?void 0:w.contract)===null||D===void 0?void 0:D.relayERC2771zkSync)!==null&&O!==void 0?O:f.GELATO_RELAY_ERC2771_ZKSYNC_ADDRESS,relay1BalanceERC2771zkSync:(E=(_=w==null?void 0:w.contract)===null||_===void 0?void 0:_.relay1BalanceERC2771zkSync)!==null&&E!==void 0?E:f.GELATO_RELAY_1BALANCE_ERC2771_ZKSYNC_ADDRESS,relayConcurrentERC2771:(P=(C=w==null?void 0:w.contract)===null||C===void 0?void 0:C.relayConcurrentERC2771)!==null&&P!==void 0?P:f.GELATO_RELAY_CONCURRENT_ERC2771_ADDRESS,relay1BalanceConcurrentERC2771:(j=(I=w==null?void 0:w.contract)===null||I===void 0?void 0:I.relay1BalanceConcurrentERC2771)!==null&&j!==void 0?j:f.GELATO_RELAY_1BALANCE_CONCURRENT_ERC2771_ADDRESS,relayConcurrentERC2771zkSync:(F=(z=w==null?void 0:w.contract)===null||z===void 0?void 0:z.relayConcurrentERC2771zkSync)!==null&&F!==void 0?F:f.GELATO_RELAY_CONCURRENT_ERC2771_ZKSYNC_ADDRESS,relay1BalanceConcurrentERC2771zkSync:(H=(W=w==null?void 0:w.contract)===null||W===void 0?void 0:W.relay1BalanceConcurrentERC2771zkSync)!==null&&H!==void 0?H:f.GELATO_RELAY_1BALANCE_CONCURRENT_ERC2771_ZKSYNC_ADDRESS}}},this.callWithSyncFee=(w,m,x)=>s(this,void 0,void 0,function*(){const y=yield c.relayWithSyncFee({request:w,sponsorApiKey:x,options:m},a(this,o,"f"));return a(this,u,"f").hasHandlers()&&(yield a(this,u,"f").subscribe(y.taskId)),y}),this.callWithSyncFeeERC2771=(w,m,x,y)=>s(this,void 0,void 0,function*(){const A=yield c.relayWithCallWithSyncFeeERC2771({request:w,signerOrProvider:m,sponsorApiKey:y,options:x},a(this,o,"f"));return a(this,u,"f").hasHandlers()&&(yield a(this,u,"f").subscribe(A.taskId)),A}),this.sponsoredCall=(w,m,x)=>s(this,void 0,void 0,function*(){const y=yield c.relayWithSponsoredCall({request:w,sponsorApiKey:m,options:x},a(this,o,"f"));return a(this,u,"f").hasHandlers()&&(yield a(this,u,"f").subscribe(y.taskId)),y}),this.sponsoredCallERC2771=(w,m,x,y)=>s(this,void 0,void 0,function*(){const A=yield c.relayWithSponsoredCallERC2771({request:w,signerOrProvider:m,sponsorApiKey:x,options:y},a(this,o,"f"));return a(this,u,"f").hasHandlers()&&(yield a(this,u,"f").subscribe(A.taskId)),A}),this.getSignatureDataERC2771=(w,m,x)=>c.getSignatureDataERC2771({request:w,signerOrProvider:m,type:x},a(this,o,"f")),this.getDataToSignERC2771=(w,m,x)=>c.getDataToSignERC2771({request:w,signerOrProvider:x,type:m},a(this,o,"f")),this.sponsoredCallERC2771WithSignature=(w,m,x,y)=>s(this,void 0,void 0,function*(){const A=yield c.sponsoredCallERC2771WithSignature({struct:w,signature:m,sponsorApiKey:x,options:y},a(this,o,"f"));return a(this,u,"f").hasHandlers()&&(yield a(this,u,"f").subscribe(A.taskId)),A}),this.callWithSyncFeeERC2771WithSignature=(w,m,x,y,A)=>s(this,void 0,void 0,function*(){const S=yield c.callWithSyncFeeERC2771WithSignature({struct:w,syncFeeParams:m,signature:x,options:y,sponsorApiKey:A},a(this,o,"f"));return a(this,u,"f").hasHandlers()&&(yield a(this,u,"f").subscribe(S.taskId)),S}),this.isNetworkSupported=w=>c.isNetworkSupported({chainId:w},a(this,o,"f")),this.getSupportedNetworks=()=>c.getSupportedNetworks(a(this,o,"f")),this.isOracleActive=w=>c.isOracleActive({chainId:w},a(this,o,"f")),this.getGelatoOracles=()=>c.getGelatoOracles(a(this,o,"f")),this.getPaymentTokens=w=>c.getPaymentTokens({chainId:w},a(this,o,"f")),this.getEstimatedFee=(w,m,x,y,A=BigInt(0))=>c.getEstimatedFee({chainId:w,paymentToken:m,gasLimit:x,isHighPriority:y,gasLimitL1:A},a(this,o,"f")),this.getTaskStatus=w=>c.getTaskStatus({taskId:w},a(this,o,"f")),this.onTaskStatusUpdate=w=>{a(this,u,"f").onUpdate(w)},this.offTaskStatusUpdate=w=>{a(this,u,"f").offUpdate(w)},this.onError=w=>{a(this,u,"f").onError(w)},this.offError=w=>{a(this,u,"f").offError(w)},this.subscribeTaskStatusUpdate=w=>s(this,void 0,void 0,function*(){yield a(this,u,"f").subscribe(w)}),this.unsubscribeTaskStatusUpdate=w=>s(this,void 0,void 0,function*(){yield a(this,u,"f").unsubscribe(w)}),i(this,o,this._getConfiguration(v),"f"),i(this,u,new h.WebsocketHandler(a(this,o,"f").websocketUrl),"f")}}n.GelatoRelay=p,o=new WeakMap,u=new WeakMap})(Ab);const SU=[],RU=["0x4f7c52E5298A0723B44cd31B584a3D4a0BF0C948","0x2763FA0FB3770FDb9e15E0d1ff4718Cd6C1f01Ab","0x762788E3dE8246FB6fC9D80B8044C7E8822D016C","0xbC839d9dB567BcB38A1D504212749898E2a189fE","0x0BfF3142db4932cf8A736662a148C926B444C2D3","0x8b87637C98dA8c21E28E489B4C14d4b9A352441b","0xdC4F210c57Ea6D41F067Bf5efCe47e1411e84D4C","0x6F19aa2a07E8e85310bdF1E3AA62D395751C6646","0x92Cb43322C8ECC475129EecD549eE2FbB2c405f4","0x397b1047d420e87EaF5bc8CB4477cA8963B4471B","0xbF86B9518C01019d1fa46b56daEDD6f5Da416297","0x79f604b760Ba5530C3fa81fB217a557fFA75828f","0x51273D672d954b4A99181ee79665189CCa181bf0","0x9cce34F7aB185c7ABA1b7C8140d620B4BDA941d6"],Ql={keys:SU,chapters:RU};async function A1(n){return new Promise(e=>setTimeout(e,n))}function r4(n){return n.substring(0,6)+"…"+n.substring(16,20)}async function XA(n){n=n.toLowerCase();const e=st(Pt(n));return new Sa(e).address}async function TU(n,e){e=e.toLowerCase();const t=st(Pt(e)),s=await new Sa(t).signMessage(Ce(n));return ur.from(s)}async function OU(n,e){function t(i){const a="0x"+(i>>96n).toString(16).padStart(40,"0"),o=i>>8n&(1n<<80n)-1n,u=[];for(let l=0;l0n?u.push(Ql.keys[l].emoji):u.push("?");const c=Number(i&0xffn);return{address:a,chapter:c,keys:u}}async function r(){const i=[];let a=0;for(;;){const o=await n.getLeaderboard(a);for(let u of o){if(u===0n)return i;i.push(t(u))}a++}}const s=await r();return s.sort((i,a)=>a.chapter-i.chapter||a.keys.filter(o=>o).length-i.keys.filter(o=>o).length),s}function eE(n,e,t,r){const s=Ki(),i=Ki(),a=Ki();async function o(l){s.set("PENDING");const d=await e.getAddress(),{r:f,s:h,v:p}=await TU(d,l);let b;r?{data:b}=await n.submit.populateTransaction(p,f,h):{data:b}=await n.submitKey.populateTransaction(p,f,h);const v=new Ab.GelatoRelay,w={chainId:BigInt(BR),target:ob.TreasureHuntCreator,data:b,user:d,feeToken:"0x4200000000000000000000000000000000000006",isRelayContext:!0},m=await v.callWithSyncFeeERC2771(w,e);localStorage.setItem("gelatoTaskId",m.taskId),localStorage.setItem("gelatoSolution",l),localStorage.removeItem("gelatoTxHash");let x=3;for(await A1(1e3);;){console.log(`[${x}] Polling task`,m.taskId);let y;try{y=await v.getTaskStatus(m.taskId)}catch(A){if(x===0)throw A;x--,await A1(1e3);continue}if(console.log(y),y){const{taskState:A}=y;if(["CheckPending","ExecPending","WaitingForConfirmation"].includes(A))s.set("PENDING"),i.set(void 0);else{if(["ExecSuccess"].includes(A)&&y.transactionHash)return localStorage.setItem("gelatoTxHash",y.transactionHash),a.set(y.transactionHash),s.set("SUCCESS"),i.set(void 0),localStorage.removeItem("gelatoTaskId"),localStorage.removeItem("gelatoTxHash"),localStorage.removeItem("gelatoSolution"),{txHash:y.transactionHash,solution:l};if(["ExecReverted","Cancelled"].includes(A))return a.set(void 0),s.set("ERROR"),i.set(y.lastCheckMessage),localStorage.removeItem("gelatoTaskId"),localStorage.removeItem("gelatoTxHash"),localStorage.removeItem("gelatoSolution"),{}}}await A1(1e3)}}async function u(l){console.log("submit",l),c();try{const d=await o(l);if(d&&d.txHash)return t({txHash:d.txHash,solution:l}),!0}catch(d){const f=d.toString();f.toLowerCase().includes("wrong solution")?s.set("WRONG"):(console.log("error submitting solution",d),s.set("ERROR"),i.set(f))}return!1}function c(){s.set(void 0),i.set(void 0),a.set(void 0)}return{submit:u,status:s,error:i,txHash:a,reset:c}}function NU(n,e,t){return eE(n,e,t,!0)}function IU(n,e,t){return eE(n,e,t,!1)}function s4(n){let e=0;for(n=n.toLowerCase();en?yb.connect(ob.TreasureHuntCreator,n):null,null),UU=fr(o0,(n,e)=>{if(n){const t=Sh(async()=>{const s=await n.getQuestsRootCID();console.log("Update quests root CID",s),e(s)},!0),r=window.setInterval(t,3e4);return t(),()=>window.clearInterval(r)}}),LU=fr(o0,(n,e)=>{n&&ub(async()=>{e(Number(await n.totalChapters()))},!0)}),DU=fr(o0,(n,e)=>{n&&ub(async()=>{e(Number(await n.totalKeys()))},!0)},null),nE=fr([o0,E1],([n],e)=>{e(n?parseInt(localStorage.getItem("currentChapter")||"0"):null)},null),Kb=Ki(!1),MU=fr([UU,nE],([n,e],t)=>{if(n&&e!==null){const r=e.toString(),s=BE(sr);r in s||(console.log("store game",e),s[r]={solution:null,questHash:null,questHashLastSeen:null,transactionHash:null},sr.set(s),console.log("state",s)),console.log("Load new quest",e,s);let i=null;try{e>0&&(i=localStorage.getItem(`solution:${e-1}`))}catch(a){console.error("current quest error",a),Kb.set(!0);return}ub(async()=>{const a=`/game-data/${n}/${e}`;let o;try{o=await(await fetch(a)).text()}catch(u){throw console.log(u),Bf}if(i!==null){console.log("solution is",i);const u=st(Pt(i));o=Qm.AES.decrypt(o,u.toString()).toString(Qm.enc.Utf8),t(o)}else t(o);s[r].questHash=st(Pt(o)),s[r].questHashLastSeen===null&&(s[r].questHashLastSeen=s[r].questHash),sr.set(s)})}}),jU=fr(MU,n=>n?De(n):null);let tp=-1;const rE=fr([o0,DU],([n,e],t)=>{if(window.clearInterval(tp),n&&e!==null){const r=Sh(async()=>{t(await OU(n,e))});return tp=window.setInterval(r,6e4),r(),()=>window.clearInterval(tp)}else t(null)}),$U=60*60*1e3,HU=Ki(Date.now()),GU=fr([z9,rE,HU],([n,e],t)=>{n&&e?Sh(async()=>{console.log("Task: update ens addresses");const s="ensAddresses",i=co.getsert(s,{});t(i);for(let a=0;a$U){console.log("lookup ENS for address",o);try{const u=await n.lookupAddress(o);if(u){i[o].ensName=u,i[o].lastUpdate=Date.now(),co.set(s,i),t(i);const c=await n.getAvatar(o);c&&(c.startsWith("ipfs://")?i[o].avatar=`https://gateway.pinata.cloud/ipfs/${c.replace("ipfs://","")}`:c.startsWith("bzz://")?i[o].avatar=`https://bzz.link/bzz/${c.replace("bzz://","")}/`:i[o].avatar=c,i[o].lastUpdate=Date.now(),co.set(s,i),t(i))}}catch(u){console.error(u)}}i[o].lastUpdate=Date.now(),co.set(s,i)}})():t({})});var w5={},_c={},sE={};(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.randArr=new Array(4);function e(r){let s;for(s=0;s>19^r^r>>8,(n.randArr[3]>>>0)/(1<<31>>>0)}n.random=t})(sE);var Yf={};Object.defineProperty(Yf,"__esModule",{value:!0});Yf.DEFAULT_SIZE=8;Yf.DEFAULT_SCALE=4;Object.defineProperty(_c,"__esModule",{value:!0});const wi=sE,i4=Yf;function _1(){let n=Math.floor(wi.random()*360),e=wi.random()*60+40+"%",t=(wi.random()+wi.random()+wi.random()+wi.random())*25+"%";return"hsl("+n+","+e+","+t+")"}_c.createColor=_1;function zU(n){let e=n,t=n,r=Math.ceil(e/2),s=e-r,i=[];for(let a=0;a + Address + Chapter + Documents`,r=Re(),s=ce("tbody");for(let o=0;o{"address"in a&&t(0,r=a.address),"ensAddresses"in a&&t(1,s=a.ensAddresses),"leaderboard"in a&&t(2,i=a.leaderboard)},[r,s,i]}class QU extends _n{constructor(e){super(),En(this,e,JU,qU,on,{address:0,ensAddresses:1,leaderboard:2})}}function d4(n){let e,t,r,s={ctx:n,current:null,token:null,hasCatch:!1,pending:XU,then:ZU,catch:YU,value:4,blocks:[,,,]};return hc(t=n[0],s),{c(){e=cn(),s.block.c()},m(i,a){se(i,e,a),s.block.m(i,s.anchor=a),s.mount=()=>e.parentNode,s.anchor=e,r=!0},p(i,a){n=i,s.ctx=n,a&1&&t!==(t=n[0])&&hc(t,s)||S5(s,n,a)},i(i){r||($e(s.block),r=!0)},o(i){for(let a=0;a<3;a+=1){const o=s.blocks[a];ze(o)}r=!1},d(i){i&&re(e),s.block.d(i),s.token=null,s=null}}}function YU(n){return{c:we,m:we,p:we,i:we,o:we,d:we}}function ZU(n){let e,t;return e=new QU({props:{address:n[4],ensAddresses:n[2],leaderboard:n[1]}}),{c(){Ir(e.$$.fragment)},m(r,s){or(e,r,s),t=!0},p(r,s){const i={};s&1&&(i.address=r[4]),s&4&&(i.ensAddresses=r[2]),s&2&&(i.leaderboard=r[1]),e.$set(i)},i(r){t||($e(e.$$.fragment,r),t=!0)},o(r){ze(e.$$.fragment,r),t=!1},d(r){cr(e,r)}}}function XU(n){return{c:we,m:we,p:we,i:we,o:we,d:we}}function eL(n){let e,t,r,s,i=n[1]&&n[0]&&n[2]&&d4(n);return{c(){e=ce("h1"),e.textContent="Leaderboard",t=Re(),i&&i.c(),r=cn()},m(a,o){se(a,e,o),se(a,t,o),i&&i.m(a,o),se(a,r,o),s=!0},p(a,[o]){a[1]&&a[0]&&a[2]?i?(i.p(a,o),o&7&&$e(i,1)):(i=d4(a),i.c(),$e(i,1),i.m(r.parentNode,r)):i&&(yn(),ze(i,1,1,()=>{i=null}),mn())},i(a){s||($e(i),s=!0)},o(a){ze(i),s=!1},d(a){a&&re(e),a&&re(t),i&&i.d(a),a&&re(r)}}}function tL(n,e,t){let r,s,i,a;return mt(n,Ff,o=>t(3,s=o)),mt(n,rE,o=>t(1,i=o)),mt(n,GU,o=>t(2,a=o)),n.$$.update=()=>{n.$$.dirty&8&&t(0,r=s==null?void 0:s.getAddress())},[r,i,a,s]}class nL extends _n{constructor(e){super(),En(this,e,tL,eL,on,{})}}var Zf={},rL=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},iE={},Hn={};let Vb;const sL=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];Hn.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};Hn.getSymbolTotalCodewords=function(e){return sL[e]};Hn.getBCHDigit=function(n){let e=0;for(;n!==0;)e++,n>>>=1;return e};Hn.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');Vb=e};Hn.isKanjiModeEnabled=function(){return typeof Vb<"u"};Hn.toSJIS=function(e){return Vb(e)};var i6={};(function(n){n.L={bit:1},n.M={bit:0},n.Q={bit:3},n.H={bit:2};function e(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return n.L;case"m":case"medium":return n.M;case"q":case"quartile":return n.Q;case"h":case"high":return n.H;default:throw new Error("Unknown EC Level: "+t)}}n.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},n.from=function(r,s){if(n.isValid(r))return r;try{return e(r)}catch{return s}}})(i6);function aE(){this.buffer=[],this.length=0}aE.prototype={get:function(n){const e=Math.floor(n/8);return(this.buffer[e]>>>7-n%8&1)===1},put:function(n,e){for(let t=0;t>>e-t-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(n){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),n&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var iL=aE;function Xf(n){if(!n||n<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=n,this.data=new Uint8Array(n*n),this.reservedBit=new Uint8Array(n*n)}Xf.prototype.set=function(n,e,t,r){const s=n*this.size+e;this.data[s]=t,r&&(this.reservedBit[s]=!0)};Xf.prototype.get=function(n,e){return this.data[n*this.size+e]};Xf.prototype.xor=function(n,e,t){this.data[n*this.size+e]^=t};Xf.prototype.isReserved=function(n,e){return this.reservedBit[n*this.size+e]};var aL=Xf,oE={};(function(n){const e=Hn.getSymbolSize;n.getRowColCoords=function(r){if(r===1)return[];const s=Math.floor(r/7)+2,i=e(r),a=i===145?26:Math.ceil((i-13)/(2*s-2))*2,o=[i-7];for(let u=1;u=0&&s<=7},n.from=function(s){return n.isValid(s)?parseInt(s,10):void 0},n.getPenaltyN1=function(s){const i=s.size;let a=0,o=0,u=0,c=null,l=null;for(let d=0;d=5&&(a+=e.N1+(o-5)),c=h,o=1),h=s.get(f,d),h===l?u++:(u>=5&&(a+=e.N1+(u-5)),l=h,u=1)}o>=5&&(a+=e.N1+(o-5)),u>=5&&(a+=e.N1+(u-5))}return a},n.getPenaltyN2=function(s){const i=s.size;let a=0;for(let o=0;o=10&&(o===1488||o===93)&&a++,u=u<<1&2047|s.get(l,c),l>=10&&(u===1488||u===93)&&a++}return a*e.N3},n.getPenaltyN4=function(s){let i=0;const a=s.data.length;for(let u=0;u=0;){const a=i[0];for(let u=0;u0){const i=new Uint8Array(this.degree);return i.set(r,s),i}return r};var cL=qb,dE={},c0={},Jb={};Jb.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var ls={};const hE="[0-9]+",uL="[A-Z $%*+\\-./:]+";let Yl="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Yl=Yl.replace(/u/g,"\\u");const lL="(?:(?![A-Z0-9 $%*+\\-./:]|"+Yl+`)(?:.|[\r +]))+`;ls.KANJI=new RegExp(Yl,"g");ls.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");ls.BYTE=new RegExp(lL,"g");ls.NUMERIC=new RegExp(hE,"g");ls.ALPHANUMERIC=new RegExp(uL,"g");const fL=new RegExp("^"+Yl+"$"),dL=new RegExp("^"+hE+"$"),hL=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");ls.testKanji=function(e){return fL.test(e)};ls.testNumeric=function(e){return dL.test(e)};ls.testAlphanumeric=function(e){return hL.test(e)};(function(n){const e=Jb,t=ls;n.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},n.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},n.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},n.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},n.MIXED={bit:-1},n.getCharCountIndicator=function(i,a){if(!i.ccBits)throw new Error("Invalid mode: "+i);if(!e.isValid(a))throw new Error("Invalid version: "+a);return a>=1&&a<10?i.ccBits[0]:a<27?i.ccBits[1]:i.ccBits[2]},n.getBestModeForData=function(i){return t.testNumeric(i)?n.NUMERIC:t.testAlphanumeric(i)?n.ALPHANUMERIC:t.testKanji(i)?n.KANJI:n.BYTE},n.toString=function(i){if(i&&i.id)return i.id;throw new Error("Invalid mode")},n.isValid=function(i){return i&&i.bit&&i.ccBits};function r(s){if(typeof s!="string")throw new Error("Param is not a string");switch(s.toLowerCase()){case"numeric":return n.NUMERIC;case"alphanumeric":return n.ALPHANUMERIC;case"kanji":return n.KANJI;case"byte":return n.BYTE;default:throw new Error("Unknown mode: "+s)}}n.from=function(i,a){if(n.isValid(i))return i;try{return r(i)}catch{return a}}})(c0);(function(n){const e=Hn,t=a6,r=i6,s=c0,i=Jb,a=7973,o=e.getBCHDigit(a);function u(f,h,p){for(let b=1;b<=40;b++)if(h<=n.getCapacity(b,p,f))return b}function c(f,h){return s.getCharCountIndicator(f,h)+4}function l(f,h){let p=0;return f.forEach(function(b){const v=c(b.mode,h);p+=v+b.getBitsLength()}),p}function d(f,h){for(let p=1;p<=40;p++)if(l(f,p)<=n.getCapacity(p,h,s.MIXED))return p}n.from=function(h,p){return i.isValid(h)?parseInt(h,10):p},n.getCapacity=function(h,p,b){if(!i.isValid(h))throw new Error("Invalid QR Code version");typeof b>"u"&&(b=s.BYTE);const v=e.getSymbolTotalCodewords(h),w=t.getTotalCodewordsCount(h,p),m=(v-w)*8;if(b===s.MIXED)return m;const x=m-c(b,h);switch(b){case s.NUMERIC:return Math.floor(x/10*3);case s.ALPHANUMERIC:return Math.floor(x/11*2);case s.KANJI:return Math.floor(x/13);case s.BYTE:default:return Math.floor(x/8)}},n.getBestVersionForData=function(h,p){let b;const v=r.from(p,r.M);if(Array.isArray(h)){if(h.length>1)return d(h,v);if(h.length===0)return 1;b=h[0]}else b=h;return u(b.mode,b.getLength(),v)},n.getEncodedBits=function(h){if(!i.isValid(h)||h<7)throw new Error("Invalid QR Code version");let p=h<<12;for(;e.getBCHDigit(p)-o>=0;)p^=a<=0;)s^=bE<0&&(r=this.data.substr(t),s=parseInt(r,10),e.put(s,i*3+1))};var gL=Pc;const yL=c0,np=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function kc(n){this.mode=yL.ALPHANUMERIC,this.data=n}kc.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};kc.prototype.getLength=function(){return this.data.length};kc.prototype.getBitsLength=function(){return kc.getBitsLength(this.data.length)};kc.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let r=np.indexOf(this.data[t])*45;r+=np.indexOf(this.data[t+1]),e.put(r,11)}this.data.length%2&&e.put(np.indexOf(this.data[t]),6)};var mL=kc,xL=function(e){for(var t=[],r=e.length,s=0;s=55296&&i<=56319&&r>s+1){var a=e.charCodeAt(s+1);a>=56320&&a<=57343&&(i=(i-55296)*1024+a-56320+65536,s+=1)}if(i<128){t.push(i);continue}if(i<2048){t.push(i>>6|192),t.push(i&63|128);continue}if(i<55296||i>=57344&&i<65536){t.push(i>>12|224),t.push(i>>6&63|128),t.push(i&63|128);continue}if(i>=65536&&i<=1114111){t.push(i>>18|240),t.push(i>>12&63|128),t.push(i>>6&63|128),t.push(i&63|128);continue}t.push(239,191,189)}return new Uint8Array(t).buffer};const wL=xL,vL=c0;function Cc(n){this.mode=vL.BYTE,typeof n=="string"&&(n=wL(n)),this.data=new Uint8Array(n)}Cc.getBitsLength=function(e){return e*8};Cc.prototype.getLength=function(){return this.data.length};Cc.prototype.getBitsLength=function(){return Cc.getBitsLength(this.data.length)};Cc.prototype.write=function(n){for(let e=0,t=this.data.length;e=33088&&t<=40956)t-=33088;else if(t>=57408&&t<=60351)t-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+` +Make sure your charset is UTF-8`);t=(t>>>8&255)*192+(t&255),n.put(t,13)}};var PL=Sc,yE={exports:{}};(function(n){var e={single_source_shortest_paths:function(t,r,s){var i={},a={};a[r]=0;var o=e.PriorityQueue.make();o.push(r,0);for(var u,c,l,d,f,h,p,b,v;!o.empty();){u=o.pop(),c=u.value,d=u.cost,f=t[c]||{};for(l in f)f.hasOwnProperty(l)&&(h=f[l],p=d+h,b=a[l],v=typeof a[l]>"u",(v||b>p)&&(a[l]=p,o.push(l,p),i[l]=c))}if(typeof s<"u"&&typeof a[s]>"u"){var w=["Could not find a path from ",r," to ",s,"."].join("");throw new Error(w)}return i},extract_shortest_path_from_predecessor_list:function(t,r){for(var s=[],i=r;i;)s.push(i),t[i],i=t[i];return s.reverse(),s},find_path:function(t,r,s){var i=e.single_source_shortest_paths(t,r,s);return e.extract_shortest_path_from_predecessor_list(i,s)},PriorityQueue:{make:function(t){var r=e.PriorityQueue,s={},i;t=t||{};for(i in r)r.hasOwnProperty(i)&&(s[i]=r[i]);return s.queue=[],s.sorter=t.sorter||r.default_sorter,s},default_sorter:function(t,r){return t.cost-r.cost},push:function(t,r){var s={value:t,cost:r};this.queue.push(s),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};n.exports=e})(yE);var kL=yE.exports;(function(n){const e=c0,t=gL,r=mL,s=AL,i=PL,a=ls,o=Hn,u=kL;function c(w){return unescape(encodeURIComponent(w)).length}function l(w,m,x){const y=[];let A;for(;(A=w.exec(x))!==null;)y.push({data:A[0],index:A.index,mode:m,length:A[0].length});return y}function d(w){const m=l(a.NUMERIC,e.NUMERIC,w),x=l(a.ALPHANUMERIC,e.ALPHANUMERIC,w);let y,A;return o.isKanjiModeEnabled()?(y=l(a.BYTE,e.BYTE,w),A=l(a.KANJI,e.KANJI,w)):(y=l(a.BYTE_KANJI,e.BYTE,w),A=[]),m.concat(x,y,A).sort(function(D,O){return D.index-O.index}).map(function(D){return{data:D.data,mode:D.mode,length:D.length}})}function f(w,m){switch(m){case e.NUMERIC:return t.getBitsLength(w);case e.ALPHANUMERIC:return r.getBitsLength(w);case e.KANJI:return i.getBitsLength(w);case e.BYTE:return s.getBitsLength(w)}}function h(w){return w.reduce(function(m,x){const y=m.length-1>=0?m[m.length-1]:null;return y&&y.mode===x.mode?(m[m.length-1].data+=x.data,m):(m.push(x),m)},[])}function p(w){const m=[];for(let x=0;x=0&&o<=6&&(u===0||u===6)||u>=0&&u<=6&&(o===0||o===6)||o>=2&&o<=4&&u>=2&&u<=4?n.set(i+o,a+u,!0,!0):n.set(i+o,a+u,!1,!0))}}function FL(n){const e=n.size;for(let t=8;t>o&1)===1,n.set(s,i,a,!0),n.set(i,s,a,!0)}function ip(n,e,t){const r=n.size,s=NL.getEncodedBits(e,t);let i,a;for(i=0;i<15;i++)a=(s>>i&1)===1,i<6?n.set(i,8,a,!0):i<8?n.set(i+1,8,a,!0):n.set(r-15+i,8,a,!0),i<8?n.set(8,r-i-1,a,!0):i<9?n.set(8,15-i-1+1,a,!0):n.set(8,15-i-1,a,!0);n.set(r-8,8,1,!0)}function DL(n,e){const t=n.size;let r=-1,s=t-1,i=7,a=0;for(let o=t-1;o>0;o-=2)for(o===6&&o--;;){for(let u=0;u<2;u++)if(!n.isReserved(s,o-u)){let c=!1;a>>i&1)===1),n.set(s,o-u,c),i--,i===-1&&(a++,i=7)}if(s+=r,s<0||t<=s){s-=r,r=-r;break}}}function ML(n,e,t){const r=new CL;t.forEach(function(u){r.put(u.mode.bit,4),r.put(u.getLength(),IL.getCharCountIndicator(u.mode,n)),u.write(r)});const s=c6.getSymbolTotalCodewords(n),i=E5.getTotalCodewordsCount(n,e),a=(s-i)*8;for(r.getLengthInBits()+4<=a&&r.put(0,4);r.getLengthInBits()%8!==0;)r.putBit(0);const o=(a-r.getLengthInBits())/8;for(let u=0;u=7&&LL(u,e),DL(u,a),isNaN(r)&&(r=A5.getBestMask(u,ip.bind(null,u,t))),A5.applyMask(r,u),ip(u,t,r),{modules:u,version:e,errorCorrectionLevel:t,maskPattern:r,segments:s}}iE.create=function(e,t){if(typeof e>"u"||e==="")throw new Error("No input text");let r=rp.M,s,i;return typeof t<"u"&&(r=rp.from(t.errorCorrectionLevel,rp.M),s=eh.from(t.version),i=A5.from(t.maskPattern),t.toSJISFunc&&c6.setToSJISFunction(t.toSJISFunc)),$L(e,s,r,i)};var mE={},Qb={};(function(n){function e(t){if(typeof t=="number"&&(t=t.toString()),typeof t!="string")throw new Error("Color should be defined as hex string");let r=t.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+t);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(i){return[i,i]}))),r.length===6&&r.push("F","F");const s=parseInt(r.join(""),16);return{r:s>>24&255,g:s>>16&255,b:s>>8&255,a:s&255,hex:"#"+r.slice(0,6).join("")}}n.getOptions=function(r){r||(r={}),r.color||(r.color={});const s=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,i=r.width&&r.width>=21?r.width:void 0,a=r.scale||4;return{width:i,scale:i?4:a,margin:s,color:{dark:e(r.color.dark||"#000000ff"),light:e(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},n.getScale=function(r,s){return s.width&&s.width>=r+s.margin*2?s.width/(r+s.margin*2):s.scale},n.getImageWidth=function(r,s){const i=n.getScale(r,s);return Math.floor((r+s.margin*2)*i)},n.qrToImageData=function(r,s,i){const a=s.modules.size,o=s.modules.data,u=n.getScale(a,i),c=Math.floor((a+i.margin*2)*u),l=i.margin*u,d=[i.color.light,i.color.dark];for(let f=0;f=l&&h>=l&&f"u"&&(!a||!a.getContext)&&(u=a,a=void 0),a||(c=r()),u=e.getOptions(u);const l=e.getImageWidth(i.modules.size,u),d=c.getContext("2d"),f=d.createImageData(l,l);return e.qrToImageData(f.data,i,u),t(d,c,l),d.putImageData(f,0,0),c},n.renderToDataURL=function(i,a,o){let u=o;typeof u>"u"&&(!a||!a.getContext)&&(u=a,a=void 0),u||(u={});const c=n.render(i,a,u),l=u.type||"image/png",d=u.rendererOpts||{};return c.toDataURL(l,d.quality)}})(mE);var xE={};const HL=Qb;function b4(n,e){const t=n.a/255,r=e+'="'+n.hex+'"';return t<1?r+" "+e+'-opacity="'+t.toFixed(2).slice(1)+'"':r}function ap(n,e,t){let r=n+e;return typeof t<"u"&&(r+=" "+t),r}function GL(n,e,t){let r="",s=0,i=!1,a=0;for(let o=0;o0&&u>0&&n[o-1]||(r+=i?ap("M",u+t,.5+c+t):ap("m",s,0),s=0,i=!1),u+1':"",c="',l='viewBox="0 0 '+o+" "+o+'"',f=''+u+c+` +`;return typeof r=="function"&&r(null,f),f};const zL=rL,_5=iE,wE=mE,WL=xE;function Yb(n,e,t,r,s){const i=[].slice.call(arguments,1),a=i.length,o=typeof i[a-1]=="function";if(!o&&!zL())throw new Error("Callback required as last argument");if(o){if(a<2)throw new Error("Too few arguments provided");a===2?(s=t,t=e,e=r=void 0):a===3&&(e.getContext&&typeof s>"u"?(s=r,r=void 0):(s=r,r=t,t=e,e=void 0))}else{if(a<1)throw new Error("Too few arguments provided");return a===1?(t=e,e=r=void 0):a===2&&!e.getContext&&(r=t,t=e,e=void 0),new Promise(function(u,c){try{const l=_5.create(t,r);u(n(l,e,r))}catch(l){c(l)}})}try{const u=_5.create(t,r);s(null,n(u,e,r))}catch(u){s(u)}}Zf.create=_5.create;Zf.toCanvas=Yb.bind(null,wE.render);Zf.toDataURL=Yb.bind(null,wE.renderToDataURL);Zf.toString=Yb.bind(null,function(n,e,t){return WL.render(n,t)});function g4(n){let e,t,r={ctx:n,current:null,token:null,hasCatch:!1,pending:qL,then:VL,catch:KL,value:17};return hc(t=n[7].getAddress(),r),{c(){e=cn(),r.block.c()},m(s,i){se(s,e,i),r.block.m(s,r.anchor=i),r.mount=()=>e.parentNode,r.anchor=e},p(s,i){n=s,r.ctx=n,i&128&&t!==(t=n[7].getAddress())&&hc(t,r)||S5(r,n,i)},d(s){s&&re(e),r.block.d(s),r.token=null,r=null}}}function KL(n){return{c:we,m:we,p:we,d:we}}function VL(n){let e=n[17]+"",t;return{c(){t=Tt(e)},m(r,s){se(r,t,s)},p(r,s){s&128&&e!==(e=r[17]+"")&&Yi(t,e)},d(r){r&&re(t)}}}function qL(n){return{c:we,m:we,p:we,d:we}}function y4(n){let e,t,r={ctx:n,current:null,token:null,hasCatch:!1,pending:YL,then:QL,catch:JL,value:17};return hc(t=n[8].getAddress(),r),{c(){e=cn(),r.block.c()},m(s,i){se(s,e,i),r.block.m(s,r.anchor=i),r.mount=()=>e.parentNode,r.anchor=e},p(s,i){n=s,r.ctx=n,i&256&&t!==(t=n[8].getAddress())&&hc(t,r)||S5(r,n,i)},d(s){s&&re(e),r.block.d(s),r.token=null,r=null}}}function JL(n){return{c:we,m:we,p:we,d:we}}function QL(n){let e,t=n[17]+"",r,s;return{c(){e=ce("a"),r=Tt(t),Fe(e,"href",s="https://optimistic.etherscan.io/address/"+n[17])},m(i,a){se(i,e,a),ve(e,r)},p(i,a){a&256&&t!==(t=i[17]+"")&&Yi(r,t),a&256&&s!==(s="https://optimistic.etherscan.io/address/"+i[17])&&Fe(e,"href",s)},d(i){i&&re(e)}}}function YL(n){return{c:we,m:we,p:we,d:we}}function ZL(n){let e,t,r,s,i,a,o,u;return{c(){e=ce("label"),t=Tt(`Mnemonic + `),r=ce("textarea"),s=Re(),i=ce("label"),a=Tt(`Game State + `),o=ce("input"),r.readOnly=!0,r.value=n[6],o.readOnly=!0,o.value=u=window.btoa(JSON.stringify(n[5]))},m(c,l){se(c,e,l),ve(e,t),ve(e,r),se(c,s,l),se(c,i,l),ve(i,a),ve(i,o)},p(c,l){l&64&&(r.value=c[6]),l&32&&u!==(u=window.btoa(JSON.stringify(c[5])))&&o.value!==u&&(o.value=u)},d(c){c&&re(e),c&&re(s),c&&re(i)}}}function XL(n){let e,t,r;return{c(){e=ce("button"),e.textContent="Reveal secrets"},m(s,i){se(s,e,i),t||(r=Kt(e,"click",n[14]),t=!0)},p:we,d(s){s&&re(e),t=!1,r()}}}function eD(n){let e,t,r,s,i,a,o,u,c,l,d,f,h,p,b,v,w,m,x,y,A,S,D,O,_,E,C,P,I,j,z,F,W,H,L,M,T,B,N,K,te,ne,le,ie,pe,xe,me,be,Ie,X,Ae,Oe,Me,Qe,Ye,ge,q=n[7]&&g4(n),V=n[8]&&y4(n);function U(J,ee){return J[0]?ZL:XL}let G=U(n),Y=G(n);return{c(){e=ce("h1"),e.textContent="Settings",t=Re(),r=ce("h2"),r.textContent="Wallet address",s=Re(),i=ce("p"),q&&q.c(),a=Re(),o=ce("canvas"),u=Re(),c=ce("h2"),c.textContent="Network",l=Re(),d=ce("p"),d.textContent="Optimism",f=Re(),h=ce("h2"),h.textContent="Smart Contract",p=Re(),b=ce("p"),V&&V.c(),v=Re(),w=ce("h2"),w.textContent="Change Seedphrase",m=Re(),x=ce("form"),y=ce("label"),A=Tt(`Mnemonic + `),S=ce("textarea"),D=Re(),O=ce("button"),O.textContent="Change",_=Re(),E=ce("h2"),E.textContent="Mnemonic and game secret",C=Re(),Y.c(),P=Re(),I=ce("h2"),I.textContent="Restore game",j=Re(),z=ce("form"),F=ce("label"),W=Tt(`Mnemonic + `),H=ce("textarea"),L=Re(),M=ce("label"),T=Tt(`Game State + `),B=ce("input"),N=Re(),K=ce("button"),K.textContent="Restore",te=Re(),ne=ce("h2"),ne.textContent="Reset",le=Re(),ie=ce("p"),ie.textContent="Reset the current session, you'll start from Chapter 0 again",pe=Re(),xe=ce("button"),xe.textContent="Reset game",me=Re(),be=ce("h2"),be.textContent="Ver",Ie=Re(),X=ce("pre"),X.textContent="3",Ae=Re(),Oe=ce("h2"),Oe.textContent="State",Me=Re(),Qe=ce("pre"),Qe.textContent=`${n[9]}`,Fe(r,"class","svelte-6o31gi"),Fe(i,"class","scroll svelte-6o31gi"),Fe(c,"class","svelte-6o31gi"),Fe(h,"class","svelte-6o31gi"),Fe(b,"class","scroll svelte-6o31gi"),Fe(w,"class","svelte-6o31gi"),Fe(O,"type","submit"),Fe(E,"class","svelte-6o31gi"),Fe(I,"class","svelte-6o31gi"),Fe(K,"type","submit"),Fe(ne,"class","svelte-6o31gi"),Fe(be,"class","svelte-6o31gi"),Fe(Oe,"class","svelte-6o31gi"),jE(Qe,"font-size","0.6rem")},m(J,ee){se(J,e,ee),se(J,t,ee),se(J,r,ee),se(J,s,ee),se(J,i,ee),q&&q.m(i,null),se(J,a,ee),se(J,o,ee),n[12](o),se(J,u,ee),se(J,c,ee),se(J,l,ee),se(J,d,ee),se(J,f,ee),se(J,h,ee),se(J,p,ee),se(J,b,ee),V&&V.m(b,null),se(J,v,ee),se(J,w,ee),se(J,m,ee),se(J,x,ee),ve(x,y),ve(y,A),ve(y,S),es(S,n[2]),ve(x,D),ve(x,O),se(J,_,ee),se(J,E,ee),se(J,C,ee),Y.m(J,ee),se(J,P,ee),se(J,I,ee),se(J,j,ee),se(J,z,ee),ve(z,F),ve(F,W),ve(F,H),es(H,n[3]),ve(z,L),ve(z,M),ve(M,T),ve(M,B),es(B,n[4]),ve(z,N),ve(z,K),se(J,te,ee),se(J,ne,ee),se(J,le,ee),se(J,ie,ee),se(J,pe,ee),se(J,xe,ee),se(J,me,ee),se(J,be,ee),se(J,Ie,ee),se(J,X,ee),se(J,Ae,ee),se(J,Oe,ee),se(J,Me,ee),se(J,Qe,ee),Ye||(ge=[Kt(S,"input",n[13]),Kt(x,"submit",k1(n[10])),Kt(H,"input",n[15]),Kt(B,"input",n[16]),Kt(z,"submit",k1(n[11])),Kt(xe,"click",tD)],Ye=!0)},p(J,[ee]){J[7]?q?q.p(J,ee):(q=g4(J),q.c(),q.m(i,null)):q&&(q.d(1),q=null),J[8]?V?V.p(J,ee):(V=y4(J),V.c(),V.m(b,null)):V&&(V.d(1),V=null),ee&4&&es(S,J[2]),G===(G=U(J))&&Y?Y.p(J,ee):(Y.d(1),Y=G(J),Y&&(Y.c(),Y.m(P.parentNode,P))),ee&8&&es(H,J[3]),ee&16&&B.value!==J[4]&&es(B,J[4])},i:we,o:we,d(J){J&&re(e),J&&re(t),J&&re(r),J&&re(s),J&&re(i),q&&q.d(),J&&re(a),J&&re(o),n[12](null),J&&re(u),J&&re(c),J&&re(l),J&&re(d),J&&re(f),J&&re(h),J&&re(p),J&&re(b),V&&V.d(),J&&re(v),J&&re(w),J&&re(m),J&&re(x),J&&re(_),J&&re(E),J&&re(C),Y.d(J),J&&re(P),J&&re(I),J&&re(j),J&&re(z),J&&re(te),J&&re(ne),J&&re(le),J&&re(ie),J&&re(pe),J&&re(xe),J&&re(me),J&&re(be),J&&re(Ie),J&&re(X),J&&re(Ae),J&&re(Oe),J&&re(Me),J&&re(Qe),Ye=!1,os(ge)}}}function tD(){prompt('WARNING: this action will reset your current game, type "yes" to confirm.')==="yes"&&(localStorage.clear(),window.location.reload())}function nD(n,e,t){let r,s,i,a;mt(n,sr,y=>t(5,r=y)),mt(n,n1,y=>t(6,s=y)),mt(n,Ff,y=>t(7,i=y)),mt(n,o0,y=>t(8,a=y));let o=!1,u,c,l,d=null,f=localStorage.getItem("dump")||"";WE(async()=>{Zf.toCanvas(u,`ethereum:${await i.getAddress()}`,{width:200})});async function h(){prompt('WARNING: this action will reset your current game, type "yes" to confirm.')==="yes"&&(localStorage.clear(),Sr(n1,s=c,s),window.location.reload())}async function p(){if(prompt('WARNING: this action will reset your current game, type "yes" to confirm.')==="yes"){localStorage.clear(),Sr(n1,s=l,s);try{d?Sr(sr,r=JSON.parse(window.atob(d)),r):Sr(sr,r={},r)}catch{alert("There was an error importing the game. Please try again."),localStorage.clear();return}window.location.reload()}}function b(y){op[y?"unshift":"push"](()=>{u=y,t(1,u)})}function v(){c=this.value,t(2,c)}const w=()=>t(0,o=!0);function m(){l=this.value,t(3,l)}function x(){d=this.value,t(4,d)}return[o,u,c,l,d,r,s,i,a,f,h,p,b,v,w,m,x]}class rD extends _n{constructor(e){super(),En(this,e,nD,eD,on,{})}}function sD(n){let e,t,r,s,i,a,o,u,c;return{c(){e=ce("h1"),e.textContent="FAQ",t=Re(),r=ce("section"),r.innerHTML=`

    I'm stuck, can I get a hint?

    +
    `,s=Re(),i=ce("section"),i.innerHTML=`

    What are the "documents"

    +

    The documents are optional side quests. + All documents start with the hashtag symbol #. + They may require specific technical skills. Don't expect them to be easy. + Actually, we really hope all of them will be solved at one point, we put so + much sweat 😓 on them (figuratively). You don't need to do them, but you + earn extra points if you complete them.

    `,a=Re(),o=ce("section"),o.innerHTML=`

    I want to speak to the manager

    +

    disappear is a Treasure Hunt Challenge (THC for short) + created by + Social Dist0rtion Protocol. We do + this for the clout so don't forget to follow on tweeeeetererer: + @dist0rtionporoto

    `,u=Re(),c=ce("section"),c.innerHTML=`

    Show me the code

    +

    The Holy Code of Treasure Hunt Creator (or THCTHC for short) is published on GitHub.

    `,Fe(r,"class","thc--chapter svelte-8lnl4f"),Fe(i,"class","thc--chapter svelte-8lnl4f"),Fe(o,"class","thc--chapter svelte-8lnl4f"),Fe(c,"class","thc--chapter svelte-8lnl4f")},m(l,d){se(l,e,d),se(l,t,d),se(l,r,d),se(l,s,d),se(l,i,d),se(l,a,d),se(l,o,d),se(l,u,d),se(l,c,d)},p:we,i:we,o:we,d(l){l&&re(e),l&&re(t),l&&re(r),l&&re(s),l&&re(i),l&&re(a),l&&re(o),l&&re(u),l&&re(c)}}}class iD extends _n{constructor(e){super(),En(this,e,null,sD,on,{})}}function aD(n){let e;return{c(){e=Tt("not found :/")},m(t,r){se(t,e,r)},p:we,i:we,o:we,d(t){t&&re(e)}}}class oD extends _n{constructor(e){super(),En(this,e,null,aD,on,{})}}function m4(n){let e;return{c(){e=ce("div"),e.innerHTML=`

    This game stores the session in your browser (no cookie, no login, no + recover password). Be aware that if you use incognito you might lose your + progress.

    +

    The game uses a burner wallet and runs on the Sepolia test network, + check your address in the settings page.

    `,Fe(e,"class","thc--notification warning")},m(t,r){se(t,e,r)},d(t){t&&re(e)}}}function x4(n){let e,t,r,s,i,a,o,u;return{c(){e=ce("form"),t=ce("input"),r=Re(),s=ce("button"),i=Tt("Submit"),Fe(t,"placeholder","solution to the puzzle"),s.disabled=a=n[3].length===0,Fe(s,"type","submit")},m(c,l){se(c,e,l),ve(e,t),es(t,n[3]),ve(e,r),ve(e,s),ve(s,i),o||(u=[Kt(t,"input",n[6]),Kt(e,"submit",k1(n[4]))],o=!0)},p(c,l){l&8&&t.value!==c[3]&&es(t,c[3]),l&8&&a!==(a=c[3].length===0)&&(s.disabled=a)},d(c){c&&re(e),o=!1,os(u)}}}function cD(n){let e,t,r,s,i=n[1]===0&&m4(),a=n[1]!==n[2]-1&&x4(n);return{c(){i&&i.c(),e=Re(),t=ce("article"),r=ce("section"),s=Re(),a&&a.c(),Fe(r,"class","thc--chapter-text"),Fe(t,"class","thc--chapter")},m(o,u){i&&i.m(o,u),se(o,e,u),se(o,t,u),ve(t,r),r.innerHTML=n[0],ve(t,s),a&&a.m(t,null)},p(o,[u]){o[1]===0?i||(i=m4(),i.c(),i.m(e.parentNode,e)):i&&(i.d(1),i=null),u&1&&(r.innerHTML=o[0]),o[1]!==o[2]-1?a?a.p(o,u):(a=x4(o),a.c(),a.m(t,null)):a&&(a.d(1),a=null)},i:we,o:we,d(o){i&&i.d(o),o&&re(e),o&&re(t),a&&a.d()}}}function uD(n,e,t){let{currentQuestHtml:r}=e,{currentChapter:s}=e,{totalChapters:i}=e,{onSubmitSolution:a}=e,o="";async function u(){await a(o)&&t(3,o="")}function c(){o=this.value,t(3,o)}return n.$$set=l=>{"currentQuestHtml"in l&&t(0,r=l.currentQuestHtml),"currentChapter"in l&&t(1,s=l.currentChapter),"totalChapters"in l&&t(2,i=l.totalChapters),"onSubmitSolution"in l&&t(5,a=l.onSubmitSolution)},[r,s,i,o,u,a,c]}class lD extends _n{constructor(e){super(),En(this,e,uD,cD,on,{currentQuestHtml:0,currentChapter:1,totalChapters:2,onSubmitSolution:5})}}function fD(n){let e,t,r,s,i,a,o,u,c;return{c(){e=ce("div"),t=ce("section"),r=ce("p"),r.textContent="This chapter has been updated, please give it another read 🙏",s=Re(),i=ce("button"),i.textContent="OK I understand",a=Re(),o=ce("small"),o.textContent=`Please appreciate this button it's 3:27AM and I dunno why I'm focusing so + much on it.`,Fe(r,"class","svelte-qjm3zq"),Fe(i,"class","svelte-qjm3zq"),Fe(o,"class","svelte-qjm3zq"),Fe(t,"class","svelte-qjm3zq"),Fe(e,"class","svelte-qjm3zq")},m(l,d){se(l,e,d),ve(e,t),ve(t,r),ve(t,s),ve(t,i),ve(t,a),ve(t,o),u||(c=Kt(i,"click",function(){lh(n[0])&&n[0].apply(this,arguments)}),u=!0)},p(l,[d]){n=l},i:we,o:we,d(l){l&&re(e),u=!1,c()}}}function dD(n,e,t){let{onQuestUpdatedConfirm:r}=e;return n.$$set=s=>{"onQuestUpdatedConfirm"in s&&t(0,r=s.onQuestUpdatedConfirm)},[r]}class hD extends _n{constructor(e){super(),En(this,e,dD,fD,on,{onQuestUpdatedConfirm:0})}}function pD(n){let e,t,r,s,i,a;e=new lD({props:{currentChapter:n[0],currentQuestHtml:n[4],totalChapters:n[5],onSubmitSolution:n[12]}});let o=n[1]&&w4(n),u=n[6]!==void 0&&v4(n),c=n[2]&&A4(n);return{c(){Ir(e.$$.fragment),t=Re(),o&&o.c(),r=Re(),u&&u.c(),s=Re(),c&&c.c(),i=cn()},m(l,d){or(e,l,d),se(l,t,d),o&&o.m(l,d),se(l,r,d),u&&u.m(l,d),se(l,s,d),c&&c.m(l,d),se(l,i,d),a=!0},p(l,d){const f={};d&1&&(f.currentChapter=l[0]),d&16&&(f.currentQuestHtml=l[4]),d&32&&(f.totalChapters=l[5]),e.$set(f),l[1]?o?(o.p(l,d),d&2&&$e(o,1)):(o=w4(l),o.c(),$e(o,1),o.m(r.parentNode,r)):o&&(yn(),ze(o,1,1,()=>{o=null}),mn()),l[6]!==void 0?u?(u.p(l,d),d&64&&$e(u,1)):(u=v4(l),u.c(),$e(u,1),u.m(s.parentNode,s)):u&&(yn(),ze(u,1,1,()=>{u=null}),mn()),l[2]?c?(c.p(l,d),d&4&&$e(c,1)):(c=A4(l),c.c(),$e(c,1),c.m(i.parentNode,i)):c&&(yn(),ze(c,1,1,()=>{c=null}),mn())},i(l){a||($e(e.$$.fragment,l),$e(o),$e(u),$e(c),a=!0)},o(l){ze(e.$$.fragment,l),ze(o),ze(u),ze(c),a=!1},d(l){cr(e,l),l&&re(t),o&&o.d(l),l&&re(r),u&&u.d(l),l&&re(s),c&&c.d(l),l&&re(i)}}}function bD(n){let e;return{c(){e=ce("p"),e.innerHTML=`The game is br0ken, something happened to the storage. Reach out to our + discord and ask for help or go to Settings and restart + the game.`},m(t,r){se(t,e,r)},p:we,i:we,o:we,d(t){t&&re(e)}}}function w4(n){let e,t,r,s,i,a,o,u,c;return{c(){e=ce("div"),t=ce("div"),r=ce("h2"),r.textContent="Wrong answer",s=Re(),i=ce("button"),i.textContent="Try again",Fe(e,"class","thc--chapter-state")},m(l,d){se(l,e,d),ve(e,t),ve(t,r),ve(t,s),ve(t,i),o=!0,u||(c=Kt(i,"click",n[16]),u=!0)},p:we,i(l){o||(Zi(()=>{a||(a=Xi(e,e0,{},!0)),a.run(1)}),o=!0)},o(l){a||(a=Xi(e,e0,{},!1)),a.run(0),o=!1},d(l){l&&re(e),l&&a&&a.end(),u=!1,c()}}}function v4(n){let e,t,r,s;function i(u,c){return u[6]==="ERROR"?yD:gD}let a=i(n),o=a(n);return{c(){e=ce("div"),t=ce("div"),o.c(),Fe(e,"class","thc--chapter-state")},m(u,c){se(u,e,c),ve(e,t),o.m(t,null),s=!0},p(u,c){a===(a=i(u))&&o?o.p(u,c):(o.d(1),o=a(u),o&&(o.c(),o.m(t,null)))},i(u){s||(Zi(()=>{r||(r=Xi(e,e0,{},!0)),r.run(1)}),s=!0)},o(u){r||(r=Xi(e,e0,{},!1)),r.run(0),s=!1},d(u){u&&re(e),o.d(),u&&r&&r.end()}}}function gD(n){let e,t,r;function s(o,u){if(o[6]==="PENDING")return xD;if(o[6]==="SUCCESS")return mD}let i=s(n),a=i&&i(n);return{c(){e=ce("h2"),e.textContent="Correct answer",t=Re(),a&&a.c(),r=cn()},m(o,u){se(o,e,u),se(o,t,u),a&&a.m(o,u),se(o,r,u)},p(o,u){i===(i=s(o))&&a?a.p(o,u):(a&&a.d(1),a=i&&i(o),a&&(a.c(),a.m(r.parentNode,r)))},d(o){o&&re(e),o&&re(t),a&&a.d(o),o&&re(r)}}}function yD(n){let e,t,r,s;return{c(){e=ce("p"),e.textContent="Something bad happened 🤕 get in contact with us, we can help you.",t=Re(),r=ce("p"),s=Tt(n[7])},m(i,a){se(i,e,a),se(i,t,a),se(i,r,a),ve(r,s)},p(i,a){a&128&&Yi(s,i[7])},d(i){i&&re(e),i&&re(t),i&&re(r)}}}function mD(n){let e,t,r,s,i;return{c(){e=ce("p"),e.textContent="Your score has been updated.",t=Re(),r=ce("button"),r.textContent="Go to next chapter"},m(a,o){se(a,e,o),se(a,t,o),se(a,r,o),s||(i=Kt(r,"click",n[17]),s=!0)},p:we,d(a){a&&re(e),a&&re(t),a&&re(r),s=!1,i()}}}function xD(n){let e,t,r;return{c(){e=ce("p"),e.textContent="Please wait some seconds because blockchains are fast.",t=Re(),r=ce("p"),r.textContent=`Keep this window open, wait, cross your fingers, don't enter any + Faraday cage, don't drop your mobile phone in the toilet or in any + other liquid, don't accept candies from strangers unless you are + in Görlitzer Park, make sure you have enough battery left, don't + lock your mobile phone.`},m(s,i){se(s,e,i),se(s,t,i),se(s,r,i)},p:we,d(s){s&&re(e),s&&re(t),s&&re(r)}}}function A4(n){let e,t;return e=new hD({props:{onQuestUpdatedConfirm:n[11]}}),{c(){Ir(e.$$.fragment)},m(r,s){or(e,r,s),t=!0},p:we,i(r){t||($e(e.$$.fragment,r),t=!0)},o(r){ze(e.$$.fragment,r),t=!1},d(r){cr(e,r)}}}function wD(n){let e,t,r,s;const i=[bD,pD],a=[];function o(u,c){return u[3]?0:u[0]!==null&&u[4]!==null&&u[5]!==null?1:-1}return~(e=o(n))&&(t=a[e]=i[e](n)),{c(){t&&t.c(),r=cn()},m(u,c){~e&&a[e].m(u,c),se(u,r,c),s=!0},p(u,[c]){let l=e;e=o(u),e===l?~e&&a[e].p(u,c):(t&&(yn(),ze(a[l],1,1,()=>{a[l]=null}),mn()),~e?(t=a[e],t?t.p(u,c):(t=a[e]=i[e](u),t.c()),$e(t,1),t.m(r.parentNode,r)):t=null)},i(u){s||($e(t),s=!0)},o(u){ze(t),s=!1},d(u){~e&&a[e].d(u),u&&re(r)}}}function vD(n,e,t){let r,s,i,a,o,u,c,l;mt(n,nE,E=>t(0,r=E)),mt(n,sr,E=>t(15,s=E)),mt(n,E1,E=>t(18,i=E)),mt(n,Kb,E=>t(3,a=E)),mt(n,jU,E=>t(4,o=E)),mt(n,LU,E=>t(5,u=E));let{signer:d}=e,{thc:f}=e,h;const{submit:p,status:b,error:v,reset:w}=NU(f,d,({solution:E,txHash:C})=>{Id("before hook");const P=r.toString();console.log("store game",P,E,C),Sr(sr,s[P].transactionHash=C,s),Sr(sr,s[P].solution=E,s),console.log("state",s);const I=localStorage.getItem("currentChapter")||"0";localStorage.setItem("currentChapter",(parseInt(I)+1).toString()),Id("after hook"),Sr(E1,i=C,i)});mt(n,b,E=>t(6,c=E)),mt(n,v,E=>t(7,l=E));function m(E){w(),t(1,h=!1),E&&window.scrollTo({top:0,behavior:"smooth"})}function x(){r!==null&&Sr(sr,s[r.toString()].questHashLastSeen=s[r.toString()].questHash,s)}async function y(E){if(E=E.toLowerCase(),console.log("sol",E,r),r===null)return!1;const C=await XA(E);if(console.log("address",C),console.log(s4(C)),s4(C)===r){Id("before submit"),localStorage.setItem(`solution:${r}`,E),localStorage.setItem(`solution:${r}:status`,"SUBMITTED");const P=await p(E);return localStorage.setItem(`solution:${r}:status`,"CONFIRMED"),Id("after submit"),P}else return t(1,h=!0),!1}let A=!1;const S=localStorage.getItem("gelatoTaskId"),D=localStorage.getItem("gelatoTxHash");S!==null&&D===null&&(b.set("PENDING"),FU(S).then(E=>{if(E===null)b.set("ERROR");else{const C=localStorage.getItem("gelatoSolution"),P=r.toString();console.log("store game",P,C,E),Sr(sr,s[P].transactionHash=E,s),Sr(sr,s[P].solution=C,s),console.log("state",s),b.set("SUCCESS");const I=localStorage.getItem("currentChapter")||"0";localStorage.setItem("currentChapter",(parseInt(I)+1).toString()),Sr(E1,i=E,i)}localStorage.removeItem("gelatoTaskId"),localStorage.removeItem("gelatoTxHash"),localStorage.removeItem("gelatoSolution")}));const O=()=>m(!1),_=()=>m();return n.$$set=E=>{"signer"in E&&t(13,d=E.signer),"thc"in E&&t(14,f=E.thc)},n.$$.update=()=>{n.$$.dirty&32769&&t(2,A=r!==null&&s[r.toString()]&&s[r.toString()].questHashLastSeen!==s[r.toString()].questHash)},[r,h,A,a,o,u,c,l,b,v,m,x,y,d,f,s,O,_]}class AD extends _n{constructor(e){super(),En(this,e,vD,wD,on,{signer:13,thc:14})}}function E4(n){let e,t;return e=new AD({props:{signer:n[0],thc:n[1]}}),{c(){Ir(e.$$.fragment)},m(r,s){or(e,r,s),t=!0},p(r,s){const i={};s&1&&(i.signer=r[0]),s&2&&(i.thc=r[1]),e.$set(i)},i(r){t||($e(e.$$.fragment,r),t=!0)},o(r){ze(e.$$.fragment,r),t=!1},d(r){cr(e,r)}}}function ED(n){let e,t,r=n[0]&&n[1]&&E4(n);return{c(){r&&r.c(),e=cn()},m(s,i){r&&r.m(s,i),se(s,e,i),t=!0},p(s,[i]){s[0]&&s[1]?r?(r.p(s,i),i&3&&$e(r,1)):(r=E4(s),r.c(),$e(r,1),r.m(e.parentNode,e)):r&&(yn(),ze(r,1,1,()=>{r=null}),mn())},i(s){t||($e(r),t=!0)},o(s){ze(r),t=!1},d(s){r&&r.d(s),s&&re(e)}}}function _D(n,e,t){let r,s;return mt(n,Ff,i=>t(0,r=i)),mt(n,o0,i=>t(1,s=i)),[r,s]}class PD extends _n{constructor(e){super(),En(this,e,_D,ED,on,{})}}function kD(n){let e,t,r,s,i,a,o,u,c,l,d,f,h,p,b,v=n[1]&&_4(n),w=n[3]!==void 0&&P4(n);return{c(){e=ce("section"),t=ce("p"),t.innerHTML=`Did you find a document? Submit it with this form to add it to your score + in the leaderboard. More info in the FAQs.`,r=Re(),s=ce("form"),i=ce("input"),a=Re(),o=ce("button"),u=Tt("Submit"),l=Re(),v&&v.c(),d=Re(),w&&w.c(),f=cn(),Fe(i,"placeholder","Key"),o.disabled=c=n[0].length===0,Fe(o,"type","submit"),Fe(e,"class","thc--chapter")},m(m,x){se(m,e,x),ve(e,t),ve(e,r),ve(e,s),ve(s,i),es(i,n[0]),ve(s,a),ve(s,o),ve(o,u),se(m,l,x),v&&v.m(m,x),se(m,d,x),w&&w.m(m,x),se(m,f,x),h=!0,p||(b=[Kt(i,"input",n[11]),Kt(s,"submit",k1(n[12]))],p=!0)},p(m,x){x&1&&i.value!==m[0]&&es(i,m[0]),(!h||x&1&&c!==(c=m[0].length===0))&&(o.disabled=c),m[1]?v?(v.p(m,x),x&2&&$e(v,1)):(v=_4(m),v.c(),$e(v,1),v.m(d.parentNode,d)):v&&(yn(),ze(v,1,1,()=>{v=null}),mn()),m[3]!==void 0?w?(w.p(m,x),x&8&&$e(w,1)):(w=P4(m),w.c(),$e(w,1),w.m(f.parentNode,f)):w&&(yn(),ze(w,1,1,()=>{w=null}),mn())},i(m){h||($e(v),$e(w),h=!0)},o(m){ze(v),ze(w),h=!1},d(m){m&&re(e),m&&re(l),v&&v.d(m),m&&re(d),w&&w.d(m),m&&re(f),p=!1,os(b)}}}function CD(n){let e;return{c(){e=ce("p"),e.innerHTML=`The game is br0ken, something happened to the storage. Reach out to our + discord and ask for help or go to Settings and restart + the game.`},m(t,r){se(t,e,r)},p:we,i:we,o:we,d(t){t&&re(e)}}}function _4(n){let e,t,r,s,i,a,o,u,c;return{c(){e=ce("div"),t=ce("div"),r=ce("h2"),r.textContent="Wrong answer",s=Re(),i=ce("button"),i.textContent="Try again",Fe(e,"class","thc--chapter-state")},m(l,d){se(l,e,d),ve(e,t),ve(t,r),ve(t,s),ve(t,i),o=!0,u||(c=Kt(i,"click",n[13]),u=!0)},p:we,i(l){o||(Zi(()=>{a||(a=Xi(e,e0,{},!0)),a.run(1)}),o=!0)},o(l){a||(a=Xi(e,e0,{},!1)),a.run(0),o=!1},d(l){l&&re(e),l&&a&&a.end(),u=!1,c()}}}function P4(n){let e,t,r,s;function i(u,c){return u[3]==="ERROR"?RD:SD}let a=i(n),o=a(n);return{c(){e=ce("div"),t=ce("div"),o.c(),Fe(e,"class","thc--chapter-state")},m(u,c){se(u,e,c),ve(e,t),o.m(t,null),s=!0},p(u,c){a===(a=i(u))&&o?o.p(u,c):(o.d(1),o=a(u),o&&(o.c(),o.m(t,null)))},i(u){s||(Zi(()=>{r||(r=Xi(e,e0,{},!0)),r.run(1)}),s=!0)},o(u){r||(r=Xi(e,e0,{},!1)),r.run(0),s=!1},d(u){u&&re(e),o.d(),u&&r&&r.end()}}}function SD(n){let e,t,r;function s(o,u){if(o[3]==="PENDING")return OD;if(o[3]==="SUCCESS")return TD}let i=s(n),a=i&&i(n);return{c(){e=ce("h2"),e.textContent="Correct Document",t=Re(),a&&a.c(),r=cn()},m(o,u){se(o,e,u),se(o,t,u),a&&a.m(o,u),se(o,r,u)},p(o,u){i===(i=s(o))&&a?a.p(o,u):(a&&a.d(1),a=i&&i(o),a&&(a.c(),a.m(r.parentNode,r)))},d(o){o&&re(e),o&&re(t),a&&a.d(o),o&&re(r)}}}function RD(n){let e,t,r,s;return{c(){e=ce("p"),e.textContent="Something bad happened, get in contact with us, we can help you.",t=Re(),r=ce("pre"),s=Tt(n[4])},m(i,a){se(i,e,a),se(i,t,a),se(i,r,a),ve(r,s)},p(i,a){a&16&&Yi(s,i[4])},d(i){i&&re(e),i&&re(t),i&&re(r)}}}function TD(n){let e,t,r,s,i;return{c(){e=ce("p"),e.textContent="Your score has been updated.",t=Re(),r=ce("button"),r.textContent="Close"},m(a,o){se(a,e,o),se(a,t,o),se(a,r,o),s||(i=Kt(r,"click",n[8]),s=!0)},p:we,d(a){a&&re(e),a&&re(t),a&&re(r),s=!1,i()}}}function OD(n){let e,t,r;return{c(){e=ce("p"),e.textContent="Please wait some seconds because blockchains are fast.",t=Re(),r=ce("p"),r.textContent=`Keep this window open, wait, cross your fingers, don't enter any + Faraday cage, don't drop your mobile phone in the toilet or in any + other liquid, don't accept candies from strangers unless you are + in Görlitzer Park, make sure you have enough battery left, don't + lock your mobile phone.`},m(s,i){se(s,e,i),se(s,t,i),se(s,r,i)},p:we,d(s){s&&re(e),s&&re(t),s&&re(r)}}}function ND(n){let e,t,r,s;const i=[CD,kD],a=[];function o(u,c){return u[2]?0:1}return e=o(n),t=a[e]=i[e](n),{c(){t.c(),r=cn()},m(u,c){a[e].m(u,c),se(u,r,c),s=!0},p(u,[c]){let l=e;e=o(u),e===l?a[e].p(u,c):(yn(),ze(a[l],1,1,()=>{a[l]=null}),mn(),t=a[e],t?t.p(u,c):(t=a[e]=i[e](u),t.c()),$e(t,1),t.m(r.parentNode,r))},i(u){s||($e(t),s=!0)},o(u){ze(t),s=!1},d(u){a[e].d(u),u&&re(r)}}}function ID(n,e,t){let r,s,i;mt(n,Kb,y=>t(2,r=y));let{signer:a}=e,{thc:o}=e,u="",c=!1;const{submit:l,status:d,txHash:f,error:h,reset:p}=IU(o,a,({solution:y,txHash:A})=>{});mt(n,d,y=>t(3,s=y)),mt(n,h,y=>t(4,i=y));async function b(){const y=await XA(u);if(BU(y)>-1){const S=await l(u);return t(0,u=""),S}else return t(1,c=!0),!1}function v(){t(1,c=!1),p()}function w(){u=this.value,t(0,u)}const m=()=>b(),x=()=>v();return n.$$set=y=>{"signer"in y&&t(9,a=y.signer),"thc"in y&&t(10,o=y.thc)},[u,c,r,s,i,d,h,b,v,a,o,w,m,x]}class BD extends _n{constructor(e){super(),En(this,e,ID,ND,on,{signer:9,thc:10})}}function k4(n){let e,t;return e=new BD({props:{signer:n[0],thc:n[1]}}),{c(){Ir(e.$$.fragment)},m(r,s){or(e,r,s),t=!0},p(r,s){const i={};s&1&&(i.signer=r[0]),s&2&&(i.thc=r[1]),e.$set(i)},i(r){t||($e(e.$$.fragment,r),t=!0)},o(r){ze(e.$$.fragment,r),t=!1},d(r){cr(e,r)}}}function FD(n){let e,t,r=n[0]&&n[1]&&k4(n);return{c(){r&&r.c(),e=cn()},m(s,i){r&&r.m(s,i),se(s,e,i),t=!0},p(s,[i]){s[0]&&s[1]?r?(r.p(s,i),i&3&&$e(r,1)):(r=k4(s),r.c(),$e(r,1),r.m(e.parentNode,e)):r&&(yn(),ze(r,1,1,()=>{r=null}),mn())},i(s){t||($e(r),t=!0)},o(s){ze(r),t=!1},d(s){r&&r.d(s),s&&re(e)}}}function UD(n,e,t){let r,s;return mt(n,Ff,i=>t(0,r=i)),mt(n,o0,i=>t(1,s=i)),[r,s]}class LD extends _n{constructor(e){super(),En(this,e,UD,FD,on,{})}}const DD={"/":PD,"/keys":LD,"/leaderboard":nL,"/settings":rD,"/about":iD,"*":oD};function MD(n){let e,t,r,s,i;return e=new c_({}),s=new a_({props:{routes:DD}}),{c(){Ir(e.$$.fragment),t=Re(),r=ce("main"),Ir(s.$$.fragment)},m(a,o){or(e,a,o),se(a,t,o),se(a,r,o),or(s,r,null),i=!0},p:we,i(a){i||($e(e.$$.fragment,a),$e(s.$$.fragment,a),i=!0)},o(a){ze(e.$$.fragment,a),ze(s.$$.fragment,a),i=!1},d(a){cr(e,a),a&&re(t),a&&re(r),cr(s)}}}class jD extends _n{constructor(e){super(),En(this,e,null,MD,on,{})}}const C4=document.getElementById("app");if(C4)new jD({target:C4});else throw"Error: mount point for app doesn't exist."; diff --git a/index.html b/index.html index e42f81d..7535fcf 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -disappear
    \ No newline at end of file +disappear
    \ No newline at end of file